[ovs-dev] [PATCH] datapath: Integration with upstream kernel tunneling.

Rajahalme, Jarno (NSN - FI/Espoo) jarno.rajahalme at nsn.com
Wed Apr 3 06:24:41 UTC 2013


On Mar 30, 2013, at 18:20 , ext Pravin B Shelar wrote:

> diff --git a/datapath/linux/compat/include/linux/netdevice.h b/datapath/linux/compat/include/linux/netdevice.h
> index 71aad87..4ffdac4 100644
> --- a/datapath/linux/compat/include/linux/netdevice.h
> +++ b/datapath/linux/compat/include/linux/netdevice.h
> @@ -167,4 +167,30 @@ static inline struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
> }
> #endif
> 
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
> +static inline struct sk_buff *rpl__skb_gso_segment(struct sk_buff *skb,
> +						netdev_features_t features,
> +						bool tx_path)
> +{
> +	struct sk_buff *nskb;
> +	char cb[48];
> +
> +	/* From 3.9 kernel skb->cb is used by skb gso. Therefore
> +	 * make copy of it to restore it. */
> +
> +	memcpy(cb, skb->cb, sizeof(skb->cb));
> +	nskb = __skb_gso_segment(skb, 0, false);
> +	if (IS_ERR(nskb))
> +		return nskb;
> +
> +	skb = nskb;
> +	while (nskb) {
> +		memcpy(nskb->cb, cb, sizeof(nskb->cb));
> +		nskb = nskb->next;
> +	}
> +	return skb;
> +}
> +#define __skb_gso_segment rpl__skb_gso_segment
> +#endif
> +

Is it only the struct ovs_skb_cb we are concerned with here? If so, it would be more efficient just to copy "sizeof (struct ovs_skb_cb)" bytes back and forth, which is currently less than the full 48 bytes.

  Jarno




More information about the dev mailing list