On Tue, Apr 2, 2013 at 11:24 PM, Rajahalme, Jarno (NSN - FI/Espoo) < jarno.rajaha...@nsn.com> wrote:
> > 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. > > It is part of linux compatibility code, therefore I do not have access to 'struct ovs_skb_cb'. I can move it to datapath directory, but I am not sure if it is worth doing it if lisp starts using UDP TUNNEL GSO. Since then upcall handler will be the only user of skb_gso_segment() where GSO packets should be rare.
_______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev