Skip to content

Commit 3875f7c

Browse files
committed
eth: bnxt: update header sizing defaults
JIRA: https://issues.redhat.com/browse/RHEL-106550 commit 99d028c Author: Jakub Kicinski <kuba@kernel.org> Date: Sat Jan 18 18:05:17 2025 -0800 eth: bnxt: update header sizing defaults 300-400B RPC requests are fairly common. With the current default of 256B HDS threshold bnxt ends up splitting those, lowering PCIe bandwidth efficiency and increasing the number of memory allocation. Increase the HDS threshold to fit 4 buffers in a 4k page. This works out to 640B as the threshold on a typical kernel confing. This change increases the performance for a microbenchmark which receives 400B RPCs and sends empty responses by 4.5%. Admittedly this is just a single benchmark, but 256B works out to just 6 (so 2 more) packets per head page, because shinfo size dominates the headers. Now that we use page pool for the header pages I was also tempted to default rx_copybreak to 0, but in synthetic testing the copybreak size doesn't seem to make much difference. Reviewed-by: Michael Chan <michael.chan@broadcom.com> Link: https://patch.msgid.link/20250119020518.1962249-8-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
1 parent 2ea3bc5 commit 3875f7c

File tree

1 file changed

+6
-1
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+6
-1
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4632,8 +4632,13 @@ void bnxt_set_tpa_flags(struct bnxt *bp)
46324632

46334633
static void bnxt_init_ring_params(struct bnxt *bp)
46344634
{
4635+
unsigned int rx_size;
4636+
46354637
bp->rx_copybreak = BNXT_DEFAULT_RX_COPYBREAK;
4636-
bp->dev->cfg->hds_thresh = BNXT_DEFAULT_RX_COPYBREAK;
4638+
/* Try to fit 4 chunks into a 4k page */
4639+
rx_size = SZ_1K -
4640+
NET_SKB_PAD - SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
4641+
bp->dev->cfg->hds_thresh = max(BNXT_DEFAULT_RX_COPYBREAK, rx_size);
46374642
}
46384643

46394644
/* bp->rx_ring_size, bp->tx_ring_size, dev->mtu, BNXT_FLAG_{G|L}RO flags must

0 commit comments

Comments
 (0)