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

2013-12-19 Thread David Laight
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

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

2013-12-18 Thread 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 -

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

2013-12-15 Thread Freddy Xin
On 2013年12月13日 18:36, David Laight wrote: From: fre...@asix.com.tw ... - skb = __netdev_alloc_skb_ip_align(dev-net, size, flags); + if (dev-driver_info-flags FLAG_HW_IPALIGN) + skb = __netdev_alloc_skb(dev-net, size, flags); + else + skb =

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

2013-12-13 Thread David Laight
From: fre...@asix.com.tw ... - skb = __netdev_alloc_skb_ip_align(dev-net, size, flags); + if (dev-driver_info-flags FLAG_HW_IPALIGN) + skb = __netdev_alloc_skb(dev-net, size, flags); + else + skb = __netdev_alloc_skb_ip_align(dev-net, size, flags); Given