summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYi-Hung Wei <yihung.wei@gmail.com>2019-06-21 10:51:23 -0700
committerBen Pfaff <blp@ovn.org>2019-06-21 17:31:50 -0700
commit88d2ac50aa4e3383e185b698a1b3a44a6f7b4f80 (patch)
tree499488bfe3914920b93824534d55972e6835dc86 /lib
parent13c952ca05210c98d3b9773120a1ab48b05e4dce (diff)
downloadopenvswitch-88d2ac50aa4e3383e185b698a1b3a44a6f7b4f80.tar.gz
ofproto-dpif: Fix continuation with patch port
This patch fixes the ofp_port to odp_port translation issue on patch port with nxt_resume. When OVS resumes processing a packet from nxt_resume, OVS does not translate the ofp in_port to odp in_port correctly if the packet is originally received from a patch port. Currently,OVS sets the odp in_port for this resume pakcet as ODPP_NONE and push the resume packet back to the datapath. Later on, if the packet goes through a recirc, OVS will generate the following message since it can not translate odp in_port (ODPP_NONE) back to ofp in_port during upcall, and push down a datapath rule to drop the packet. ofproto_dpif_upcall(handler16)|INFO|received packet on unassociated datapath port 4294967295 When OVS revalidates the drop datapath flow with ODPP_NONE in_port, we will see the following warning. ofproto_dpif_upcall(revalidator18)|WARN|Failed to acquire udpif_key corresponding to unexpected flow (Invalid argument): ufid:.... This patch resolves this issue by storing the odp in_port in the continuation messages, and restores the odp in_port before push the packet back to the datapath. VMWare-BZ: 2364696 Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/ofp-packet.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/ofp-packet.c b/lib/ofp-packet.c
index a1ffe17de..4579548ee 100644
--- a/lib/ofp-packet.c
+++ b/lib/ofp-packet.c
@@ -420,6 +420,7 @@ enum nx_continuation_prop_type {
NXCPT_COOKIE,
NXCPT_ACTIONS,
NXCPT_ACTION_SET,
+ NXCPT_ODP_PORT,
};
/* Only NXT_PACKET_IN2 (not NXT_RESUME) should include NXCPT_USERDATA, so this
@@ -506,6 +507,10 @@ ofputil_put_packet_in_private(const struct ofputil_packet_in_private *pin,
ofpprop_end(msg, start);
}
+ if (pin->odp_port) {
+ ofpprop_put_u32(msg, NXCPT_ODP_PORT, odp_to_u32(pin->odp_port));
+ }
+
if (msg->size > inner_ofs) {
ofpprop_end(msg, continuation_ofs);
} else {
@@ -875,6 +880,13 @@ ofputil_decode_packet_in_private(const struct ofp_header *oh, bool loose,
error = parse_actions_property(&payload, oh->version, &action_set);
break;
+ case NXCPT_ODP_PORT: {
+ uint32_t value;
+ error = ofpprop_parse_u32(&payload, &value);
+ pin->odp_port = u32_to_odp(value);
+ break;
+ }
+
default:
error = OFPPROP_UNKNOWN(loose, "continuation", type);
break;
@@ -1010,6 +1022,11 @@ ofputil_packet_in_private_format(struct ds *s,
ds_put_char(s, '\n');
}
+ if (pin->odp_port) {
+ ds_put_format(s, " continuation.odp_port=%"PRIu32, pin->odp_port);
+ ds_put_char(s, '\n');
+ }
+
if (verbosity > 0) {
char *packet = ofp_packet_to_string(
public->packet, public->packet_len,