diff options
author | Alexander Duyck <alexander.h.duyck@redhat.com> | 2014-12-09 19:40:49 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-12-10 13:31:57 -0500 |
commit | fd11a83dd3630ec6a60f8a702446532c5c7e1991 (patch) | |
tree | 4ab4c6966cfbd5ff9bb437592cf6e59c4ef6859d /net/core/dev.c | |
parent | ffde7328a36d16e626bae8468571858d71cd010b (diff) | |
download | op-kernel-dev-fd11a83dd3630ec6a60f8a702446532c5c7e1991.zip op-kernel-dev-fd11a83dd3630ec6a60f8a702446532c5c7e1991.tar.gz |
net: Pull out core bits of __netdev_alloc_skb and add __napi_alloc_skb
This change pulls the core functionality out of __netdev_alloc_skb and
places them in a new function named __alloc_rx_skb. The reason for doing
this is to make these bits accessible to a new function __napi_alloc_skb.
In addition __alloc_rx_skb now has a new flags value that is used to
determine which page frag pool to allocate from. If the SKB_ALLOC_NAPI
flag is set then the NAPI pool is used. The advantage of this is that we
do not have to use local_irq_save/restore when accessing the NAPI pool from
NAPI context.
In my test setup I saw at least 11ns of savings using the napi_alloc_skb
function versus the netdev_alloc_skb function, most of this being due to
the fact that we didn't have to call local_irq_save/restore.
The main use case for napi_alloc_skb would be for things such as copybreak
or page fragment based receive paths where an skb is allocated after the
data has been received instead of before.
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 3f191da..80f798d 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4172,7 +4172,7 @@ struct sk_buff *napi_get_frags(struct napi_struct *napi) struct sk_buff *skb = napi->skb; if (!skb) { - skb = netdev_alloc_skb_ip_align(napi->dev, GRO_MAX_HEAD); + skb = napi_alloc_skb(napi, GRO_MAX_HEAD); napi->skb = skb; } return skb; |