diff options
author | Ben Pfaff <blp@nicira.com> | 2012-07-10 09:50:22 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-07-10 09:50:22 -0700 |
commit | a2211ea773528f611c6edfa31379a9087d2e0c32 (patch) | |
tree | 7d15ca0dce90e3995269de2697ef5f7b8da95570 | |
parent | 1f86162ac8969612ae19e1e1e07290ab53f8d936 (diff) | |
download | openvswitch-vlan-maint.tar.gz |
ofproto: Preserve in_port across trips through the datapath.vlan-maint
When a "packet out" sent a packet to the datapath and then the datapath
sent the packet back via ODP_ACTION_ATTR_CONTROLLER, the in_port included
in the "packet out" was lost (it became OFPP_LOCAL) because the datapath's
"execute" operation doesn't accept an in_port.
This commit fixes the problem by including the in_port in the userdata
argument to ODP_ACTION_ATTR_CONTROLLER.
NICS-15.
Reported-by: Zoltan Kiss <zoltan.kiss@citrix.com>
CC: David Tsai <dtsai@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | ofproto/ofproto.c | 6 |
2 files changed, 5 insertions, 2 deletions
@@ -80,6 +80,7 @@ Takayuki HAMA t-hama@cb.jp.nec.com Teemu Koponen koponen@nicira.com Vishal Swarankar vishal.swarnkar@gmail.com Yongqiang Liu liuyq7809@gmail.com +Zoltan Kiss zoltan.kiss@citrix.com kk yap yapkke@stanford.edu Thanks to all Open vSwitch contributors. If you are not listed above diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 37e2ad9d2..975e434bc 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -2752,7 +2752,8 @@ xlate_output_action__(struct action_xlate_ctx *ctx, &ctx->nf_output_iface, ctx->odp_actions); break; case OFPP_CONTROLLER: - nl_msg_put_u64(ctx->odp_actions, ODP_ACTION_ATTR_CONTROLLER, max_len); + nl_msg_put_u64(ctx->odp_actions, ODP_ACTION_ATTR_CONTROLLER, + max_len | (ctx->flow.in_port << 16)); break; case OFPP_LOCAL: add_output_action(ctx, ODPP_LOCAL); @@ -4463,6 +4464,7 @@ handle_upcall(struct ofproto *p, struct dpif_upcall *upcall) case DPIF_UC_ACTION: COVERAGE_INC(ofproto_ctlr_action); odp_flow_key_to_flow(upcall->key, upcall->key_len, &flow); + flow.in_port = upcall->userdata >> 16; send_packet_in(p, upcall, &flow, false); break; @@ -4902,7 +4904,7 @@ schedule_packet_in(struct ofconn *ofconn, struct dpif_upcall *upcall, send_len = MIN(send_len, ofconn->miss_send_len); } if (upcall->type == DPIF_UC_ACTION) { - send_len = MIN(send_len, upcall->userdata); + send_len = MIN(send_len, upcall->userdata & 0xffff); } /* Copy or steal buffer for OFPT_PACKET_IN. */ |