lkml.org 
[lkml]   [2013]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [PATCH 1/1] AX88179_178A: Add FLAG_HW_IPALIGN to determine whether reserving NET_IP_ALIGN bytes for an SKB.
Date
From
> From: freddy@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 the definition:
static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev,
unsigned int length, gfp_t gfp)
{
struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp);

if (NET_IP_ALIGN && skb)
skb_reserve(skb, NET_IP_ALIGN);
return skb;
}

It really ought to be possible to code that without an extra conditional.

David





\
 
 \ /
  Last update: 2013-12-13 12:41    [W:0.074 / U:0.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site