[ovs-dev] [PATCH] datapath: Remove redundant key ref from upcall_info.

Andy Zhou azhou at nicira.com
Wed Jul 30 19:25:55 UTC 2014


LGTM.  A minor comment inline. It not essential, so please feel free to ignore.

Acked-by: Andy Zhou <azhou at nicira.com>



> @@ -353,25 +353,25 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,
>         if (IS_ERR(segs))
>                 return PTR_ERR(segs);
>
> +       if (gso_type & SKB_GSO_UDP) {
> +               /* The initial flow key extracted by ovs_flow_extract()
> +                * in this case is for a first fragment, so we need to
> +                * properly mark later fragments.
> +                */
> +               later_key = *OVS_CB(skb)->pkt_key;
> +               later_key.ip.frag = OVS_FRAG_TYPE_LATER;
> +       }
> +
>         /* Queue all of the segments. */
>         skb = segs;
>         do {
> +               if (gso_type & SKB_GSO_UDP && skb != segs)
> +                       OVS_CB(skb)->pkt_key = &later_key;
> +
>                 err = queue_userspace_packet(dp, skb, upcall_info);
>                 if (err)
>                         break;
>
> -               if (skb == segs && gso_type & SKB_GSO_UDP) {
> -                       /* The initial flow key extracted by ovs_flow_extract()
> -                        * in this case is for a first fragment, so we need to
> -                        * properly mark later fragments.
> -                        */
> -                       later_key = *upcall_info->key;
> -                       later_key.ip.frag = OVS_FRAG_TYPE_LATER;
> -
> -                       later_info = *upcall_info;
> -                       later_info.key = &later_key;
> -                       upcall_info = &later_info;
> -               }
>         } while ((skb = skb->next));

I think this function may be even easier to read if we switch from a
"do while" loop to a "for" loop.
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list