]> git.baikalelectronics.ru Git - kernel.git/commit
net: thunderx: Optimize page recycling for XDP
authorSunil Goutham <sgoutham@cavium.com>
Tue, 2 May 2017 13:06:58 +0000 (18:36 +0530)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 May 2017 19:41:22 +0000 (15:41 -0400)
commitb58c9bcc18f27b3f7b36a1ee8421e1883b6987ba
tree5a75ad322f5011b324bf620aa0d69ae06caa90fd
parent5c67a3d40e48060189f982af0ad0e112a91dfc84
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>
drivers/net/ethernet/cavium/thunder/nicvf_queues.c
drivers/net/ethernet/cavium/thunder/nicvf_queues.h