RE: [PATCH v4 1/5] net: Add support for hardware-offloadedencapsulation

From: Dmitry Kravkov
Date: Mon Dec 10 2012 - 14:59:01 EST


> -----Original Message-----
> From: saeed bishara [mailto:saeed.bishara@xxxxxxxxx]
> Sent: Monday, December 10, 2012 12:04 PM
> To: Joseph Gasparakis
> Cc: davem@xxxxxxxxxxxxx; shemminger@xxxxxxxxxx; chrisw@xxxxxxxxxxxx;
> gospo@xxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> Dmitry Kravkov; bhutchings@xxxxxxxxxxxxxx; Peter P Waskiewicz Jr; Alexander
> Duyck
> Subject: Re: [PATCH v4 1/5] net: Add support for hardware-offloaded
> encapsulation
>
> > +static inline struct iphdr *inner_ip_hdr(const struct sk_buff *skb)
> > +{
> > + return (struct iphdr *)skb_inner_network_header(skb);
> > +}
>
> Hi,
> I'm a little bit bothered because of those inner_ functions, what
> about the following approach:
> 1. the skb will have a new state, that state can be outer (normal
> mode) and inner.
> 2. when you change the state to inner, all the helper functions such
> as ip_hdr will return the innter header.
>
> that's ofcourse the API side. the implementation may still use the
> fields you added to the skb.
>
> what you think?
> saeed

Some drivers will probably need both inner_ and other_ in same flow, switching between two states will consume cpu cycles.
èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—