]> git.baikalelectronics.ru Git - kernel.git/commit
ibmvnic: Allow multiple ltbs in rxpool ltb_set
authorSukadev Bhattiprolu <sukadev@linux.ibm.com>
Wed, 13 Apr 2022 17:10:25 +0000 (13:10 -0400)
committerJakub Kicinski <kuba@kernel.org>
Fri, 15 Apr 2022 21:02:05 +0000 (14:02 -0700)
commit54245cc32738b88d9683f7ca2ce35dbb56495cd0
treea3f812b18cf2a68055b9915ec40e294e44d3d38e
parent6beda778fa16b7d70c9562bfdd1db0ff73d4a627
ibmvnic: Allow multiple ltbs in rxpool ltb_set

Allow multiple LTBs in the rxpool's ltb_set. The first n-1 LTBs will all
be of the same size. The size of the last LTB in the set depends on the
number of buffers and buffer (mtu) size.

Having a set of LTBs per pool provides a couple of benefits.

First, with the current value of IBMVNIC_MAX_LTB_SIZE of 16MB, with an
MTU of 9000, we need a LTB (DMA buffer) of that size but the allocation
can fail in low memory conditions. With a set of LTBs per pool, we can
use several smaller (8MB) LTBs and hopefully have fewer allocation
failures. (See also comments in ibmvnic.h on the trade-off with smaller
LTBs)

Second since the kernel limits the size of the DMA buffer to 16MB (based
on MAX_ORDER), with a single DMA buffer per pool, the pool is also limited
to 16MB. This in turn limits the number of buffers per pool to 1763 when
MTU is 9000. With a set of LTBs per pool, we can have upto the max of 4096
buffers per pool even when MTU is 9000.

Suggested-by: Brian King <brking@linux.ibm.com>
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Signed-off-by: Dany Madden <drt@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/ibm/ibmvnic.c
drivers/net/ethernet/ibm/ibmvnic.h