[ovs-dev] [PATCH] VLAN actions should use push/pop semantics 2

Jesse Gross jesse at nicira.com
Thu Jul 21 16:17:26 UTC 2011


On Wed, Jul 13, 2011 at 5:45 PM, pravin shelar <pshelar at nicira.com> wrote:
> diff --git a/datapath/actions.c b/datapath/actions.c
> index ed61039..a91eca5 100644
> --- a/datapath/actions.c
> +++ b/datapath/actions.c
> +static int push_vlan_tci(struct sk_buff *skb, __be16 new_tci)
> +{
> +       if (vlan_tx_tag_present(skb)) {
> +               u16 current_tag;
> +
> +               current_tag = vlan_tx_tag_get(skb);
>
> +               if (!__vlan_put_tag(skb, current_tag))
> +                       return -ENOMEM;
> +       }
> +       __vlan_hwaccel_put_tag(skb, ntohs(new_tci));
>        return 0;
>  }

One other thing that I remembered this morning is that GSO cannot
handle multiple levels of vlan tags on kernels earlier than 2.6.37
(actually it can't handle any number of non-accelerated tags).  We
previously solved this by always using vlan acceleration in the core
of OVS and handling the various corner conditions on egress to the
rest of the network stack but this breaks that.

Hopefully we can write a compatibility macro for older code that gives
GSO the ability handle tags when it is called from our code and then
just check that the conditions are right in the egress points.



More information about the dev mailing list