sfc: The size of the RX recycle ring should be more flexible
authorMartin Habets <habetsm.xilinx@gmail.com>
Mon, 31 Jan 2022 11:10:54 +0000 (11:10 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 2 Feb 2022 04:34:59 +0000 (20:34 -0800)
commit000fe940e51f03210bd5fb1061d4d82ed9a7b1b6
tree735f0b96bb69ff245eae2e51d06439a53a156232
parent68650b4e6c13bb3c33c3e552b1fd25bc1af9b0bb
sfc: The size of the RX recycle ring should be more flexible

Ideally the size would depend on the link speed, but the recycle
ring is created when the interface is brought up before the driver
knows the link speed. So size it for the maximum speed of a given NIC.
PowerPC is only supported on SFN7xxx and SFN8xxx NICs.

With this patch on a 40G NIC the number of calls to alloc_pages and
friends went down from about 18% to under 2%.
On a 10G NIC the number of calls to alloc_pages and friends went down
from about 15% to 0 (perf did not capture any calls during the 60
second test).
On a 100G NIC the number of calls to alloc_pages and friends went down
from about 23% to 4%.

Reported-by: Íñigo Huguet <ihuguet@redhat.com>
Signed-off-by: Martin Habets <habetsm.xilinx@gmail.com>
Link: https://lore.kernel.org/r/20220131111054.cp4f6foyinaarwbn@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/sfc/ef10.c
drivers/net/ethernet/sfc/ef100_nic.c
drivers/net/ethernet/sfc/net_driver.h
drivers/net/ethernet/sfc/nic_common.h
drivers/net/ethernet/sfc/rx_common.c
drivers/net/ethernet/sfc/rx_common.h
drivers/net/ethernet/sfc/siena.c