aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-12-10 13:32:02 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-10 13:32:02 -0500
commit7dbea3e8662eb491e9da109cf8ffc372e160fe9a (patch)
treee69f89b43fa65a1f4279bc6aa7dc068c0817c208 /include/linux
parent6e5f59aacbf9527dfe425541c78cb8c56623e7eb (diff)
parent45abfb1069e4c365f6c1e2fc97c5927272725bfa (diff)
Merge branch 'napi_page_frags'
Alexander Duyck says: ==================== net: Alloc NAPI page frags from their own pool This patch series implements a means of allocating page fragments without the need for the local_irq_save/restore in __netdev_alloc_frag. By doing this I am able to decrease packet processing time by 11ns per packet in my test environment. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/skbuff.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index ab0bc43c82a4..85ab7d72b54c 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -151,6 +151,7 @@ struct net_device;
151struct scatterlist; 151struct scatterlist;
152struct pipe_inode_info; 152struct pipe_inode_info;
153struct iov_iter; 153struct iov_iter;
154struct napi_struct;
154 155
155#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 156#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
156struct nf_conntrack { 157struct nf_conntrack {
@@ -673,6 +674,7 @@ struct sk_buff {
673 674
674#define SKB_ALLOC_FCLONE 0x01 675#define SKB_ALLOC_FCLONE 0x01
675#define SKB_ALLOC_RX 0x02 676#define SKB_ALLOC_RX 0x02
677#define SKB_ALLOC_NAPI 0x04
676 678
677/* Returns true if the skb was allocated from PFMEMALLOC reserves */ 679/* Returns true if the skb was allocated from PFMEMALLOC reserves */
678static inline bool skb_pfmemalloc(const struct sk_buff *skb) 680static inline bool skb_pfmemalloc(const struct sk_buff *skb)
@@ -2164,6 +2166,15 @@ static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
2164 return __netdev_alloc_skb_ip_align(dev, length, GFP_ATOMIC); 2166 return __netdev_alloc_skb_ip_align(dev, length, GFP_ATOMIC);
2165} 2167}
2166 2168
2169void *napi_alloc_frag(unsigned int fragsz);
2170struct sk_buff *__napi_alloc_skb(struct napi_struct *napi,
2171 unsigned int length, gfp_t gfp_mask);
2172static inline struct sk_buff *napi_alloc_skb(struct napi_struct *napi,
2173 unsigned int length)
2174{
2175 return __napi_alloc_skb(napi, length, GFP_ATOMIC);
2176}
2177
2167/** 2178/**
2168 * __dev_alloc_pages - allocate page for network Rx 2179 * __dev_alloc_pages - allocate page for network Rx
2169 * @gfp_mask: allocation priority. Set __GFP_NOMEMALLOC if not for network Rx 2180 * @gfp_mask: allocation priority. Set __GFP_NOMEMALLOC if not for network Rx