RE: [PATCH 1/1] AX88179_178A: Add FLAG_HW_IPALIGN to determine whether reserving NET_IP_ALIGN bytes for an SKB.

From: David Laight
Date: Thu Dec 19 2013 - 05:03:36 EST


> From: Freddy Xin
> On 2013å12æ16æ 18:09, David Laight wrote:
> >> I was thinking of something like: skb = netdev_alloc_skb(dev, length
> >> + dev->skb_align, gfp); if (NET_IP_ALIGN && skb && !(ev->driver_flags
> >> & FLAG_HW_IPALIGN)) skb_reserve(skb, NET_IP_ALIGN); It might even be
> >> reasonable to remove the length adjustment - provided that all the
> >> later code uses the skb length. David
>
> Thanks for your advice.
> In the way you advised, does the dev->skb_align equal
> to NET_IP_ALIGN in the case that HW doesn't supoort
> IP alignment?

Yes

> In other words, dev->skb_align should be initialized to
> NET_IP_ALIGN in USBNET, and I can change its value to
> 0 in AX88179_178A driver, right?

I'd probably set a flag to request that usbnet set the offset
to the correct value. That makes the initialisation a bit clearer.

David

èº{.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&—