diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2014-12-20 23:08:18 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2014-12-21 17:04:34 +0100 |
commit | 781f444908ded793c27cd41a8e2f0d51b9591016 (patch) | |
tree | 73087e97051a7b7724a64ad8020fa80ea2b872a7 /backport | |
parent | a337b9c4eca1d35e72fcaed415884ddf6b09e1e9 (diff) |
header: add napi_alloc_skb()
napi_alloc_skb() is now used by some Ethernet drivers instead of
netdev_alloc_skb_ip_align(). It can not be placed into backport-
include/linux/skbuff.h because it accesses a member of struct
napi_struct which is not possible in skbuff.h, placing it into
netdevice.h worked in my tests.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'backport')
-rw-r--r-- | backport/backport-include/linux/netdevice.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h index 0469fdd1..961450a1 100644 --- a/backport/backport-include/linux/netdevice.h +++ b/backport/backport-include/linux/netdevice.h @@ -225,4 +225,13 @@ extern u8 netdev_rss_key[NETDEV_RSS_KEY_LEN]; void netdev_rss_key_fill(void *buffer, size_t len); #endif /* __BACKPORT_NETDEV_RSS_KEY_FILL */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) +#define napi_alloc_skb LINUX_BACKPORT(napi_alloc_skb) +static inline struct sk_buff *napi_alloc_skb(struct napi_struct *napi, + unsigned int length) +{ + return netdev_alloc_skb_ip_align(napi->dev, length); +} +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) */ + #endif /* __BACKPORT_NETDEVICE_H */ |