aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
diff options
context:
space:
mode:
authorSunil Goutham <sgoutham@cavium.com>2017-05-02 18:36:58 +0530
committerDavid S. Miller <davem@davemloft.net>2017-05-02 15:41:22 -0400
commit773225388dae15e72790d6f573e2e70e96292b6b (patch)
tree5a75ad322f5011b324bf620aa0d69ae06caa90fd /drivers/net/ethernet/cavium/thunder/nicvf_queues.h
parentnet: thunderx: Support for XDP header adjustment (diff)
downloadlinux-dev-773225388dae15e72790d6f573e2e70e96292b6b.tar.xz
linux-dev-773225388dae15e72790d6f573e2e70e96292b6b.zip
net: thunderx: Optimize page recycling for XDP
Driver follows a method of taking one extra reference on the page for recycling which is fine in usual packet path where each 64KB page is segmented into multiple receive buffers. But in XDP mode since there is just one receive buffer per page taking extra page reference itself becomes big bottleneck consuming ~50% of CPU cycles due to atomic operations. This patch adds a internal ref count in pgcache for each page and additional page references are taken in a batch instead of just one at a time. Internal i.e 'pgcache->ref_count' and page's i.e 'page->_refcount' counters are compared to check page's recyclability. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/cavium/thunder/nicvf_queues.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.h b/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
index a07d5b4d5ce2..57858522c33c 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
@@ -216,6 +216,7 @@ struct q_desc_mem {
struct pgcache {
struct page *page;
+ int ref_count;
u64 dma_addr;
};