[ovs-dev] [PATCH] datapath: Better handle vlan packets sent to userspace.

Brian Haley brian.haley at hp.com
Fri Nov 18 01:45:34 UTC 2011


On 11/17/2011 07:05 PM, Jesse Gross wrote:
> diff --git a/datapath/datapath.c b/datapath/datapath.c
> index c43adf9..4a51da6 100644
> --- a/datapath/datapath.c
> +++ b/datapath/datapath.c
> @@ -437,17 +437,28 @@ static int queue_userspace_packet(int dp_ifindex, struct sk_buff *skb,
>  				  const struct dp_upcall_info *upcall_info)
>  {
>  	struct ovs_header *upcall;
> +	struct sk_buff *nskb = NULL;

Should this be moved...

> -	err = vlan_deaccel_tag(skb);
> -	if (unlikely(err))
> -		return err;
> +	if (vlan_tx_tag_present(skb)) {
> +		nskb = skb_clone(skb, GFP_ATOMIC);

		struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);

... here, since it's not used except in this block?

> +		if (!nskb)
> +			return -ENOMEM;
> +		
> +		err = vlan_deaccel_tag(nskb);
> +		if (err)
> +			return err;
> +
> +		skb = nskb;
> +	}

-Brian



More information about the dev mailing list