[ovs-dev] [PATCH vlan-maint] ofproto: Preserve in_port across trips through the datapath.

Justin Pettit jpettit at nicira.com
Tue Jul 10 22:11:11 UTC 2012


Looks good.

--Justin


On Jul 10, 2012, at 9:50 AM, Ben Pfaff wrote:

> 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 at citrix.com>
> CC: David Tsai <dtsai at nicira.com>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
> Apologies if you receive multiple copies of this patch.  This
> version adds a CC to David Tsai.
> 
> AUTHORS           |    1 +
> ofproto/ofproto.c |    6 ++++--
> 2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/AUTHORS b/AUTHORS
> index 84cb387..9033908 100644
> --- a/AUTHORS
> +++ b/AUTHORS
> @@ -80,6 +80,7 @@ Takayuki HAMA           t-hama at cb.jp.nec.com
> Teemu Koponen           koponen at nicira.com
> Vishal Swarankar        vishal.swarnkar at gmail.com
> Yongqiang Liu           liuyq7809 at gmail.com
> +Zoltan Kiss             zoltan.kiss at citrix.com
> kk yap                  yapkke at 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 37e2ad9..975e434 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. */
> -- 
> 1.7.2.5
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev




More information about the dev mailing list