diff options
author | Alexander Duyck <alexander.h.duyck@redhat.com> | 2015-05-06 21:11:51 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-12 10:39:26 -0400 |
commit | 0e39250845c0f91acc64264709b25f7f9b85c2c3 (patch) | |
tree | d9b2a71f0af7180f5f5fcb7f6a17bf93bf67a3bc /include/linux | |
parent | 2ee52ad4962b32797bac33fa29ec8159e64c4ee3 (diff) | |
download | linux-0e39250845c0f91acc64264709b25f7f9b85c2c3.tar.gz linux-0e39250845c0f91acc64264709b25f7f9b85c2c3.tar.bz2 linux-0e39250845c0f91acc64264709b25f7f9b85c2c3.zip |
net: Store virtual address instead of page in netdev_alloc_cache
This change makes it so that we store the virtual address of the page
in the netdev_alloc_cache instead of the page pointer. The idea behind
this is to avoid multiple calls to page_address since the virtual address
is required for every access, but the page pointer is only needed at
allocation or reset of the page.
While I was at it I also reordered the netdev_alloc_cache structure a bit
so that the size is always 16 bytes by dropping size in the case where
PAGE_SIZE is greater than or equal to 32KB.
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/skbuff.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 9c2f793573fa..8b9a2c35a9d7 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -2128,9 +2128,8 @@ static inline void __skb_queue_purge(struct sk_buff_head *list) kfree_skb(skb); } -#define NETDEV_FRAG_PAGE_MAX_ORDER get_order(32768) -#define NETDEV_FRAG_PAGE_MAX_SIZE (PAGE_SIZE << NETDEV_FRAG_PAGE_MAX_ORDER) -#define NETDEV_PAGECNT_MAX_BIAS NETDEV_FRAG_PAGE_MAX_SIZE +#define NETDEV_FRAG_PAGE_MAX_SIZE __ALIGN_MASK(32768, ~PAGE_MASK) +#define NETDEV_FRAG_PAGE_MAX_ORDER get_order(NETDEV_FRAG_PAGE_MAX_SIZE) void *netdev_alloc_frag(unsigned int fragsz); |