mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
eth: bnxt: disable rx-copybreak by default
rx-copybreak requires an extra slab allocation. Since bnxt uses page pool frags and HDS by default, the rx-copybreak doesn't buy us anything. The extra pressure on slab causes overload on pre-sheaves kernels on modern AMD platforms. In synthetic testing on net-next this patch shows little difference but I think copybreak is "obvious waste" at this point. Default rx-copybreak threshold to 0 / disabled. The "copybreak" defines are really the size bounds for the Rx header buffer. Rename them. Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com> Link: https://patch.msgid.link/20260602003759.1545645-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
ee5aee77bc
commit
bd3beb5c86
|
|
@ -4846,11 +4846,11 @@ static void bnxt_init_ring_params(struct bnxt *bp)
|
|||
{
|
||||
unsigned int rx_size;
|
||||
|
||||
bp->rx_copybreak = BNXT_DEFAULT_RX_COPYBREAK;
|
||||
bp->rx_copybreak = 0; /* rx-copybreak disabled by default */
|
||||
/* Try to fit 4 chunks into a 4k page */
|
||||
rx_size = SZ_1K -
|
||||
NET_SKB_PAD - SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
|
||||
bp->dev->cfg->hds_thresh = max(BNXT_DEFAULT_RX_COPYBREAK, rx_size);
|
||||
bp->dev->cfg->hds_thresh = max(BNXT_MIN_RX_HDR_BUF, rx_size);
|
||||
}
|
||||
|
||||
/* bp->rx_ring_size, bp->tx_ring_size, dev->mtu, BNXT_FLAG_{G|L}RO flags must
|
||||
|
|
@ -4911,7 +4911,7 @@ void bnxt_set_ring_params(struct bnxt *bp)
|
|||
ALIGN(max(NET_SKB_PAD, XDP_PACKET_HEADROOM), 8) -
|
||||
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
|
||||
} else {
|
||||
rx_size = max3(BNXT_DEFAULT_RX_COPYBREAK,
|
||||
rx_size = max3(BNXT_MIN_RX_HDR_BUF,
|
||||
bp->rx_copybreak,
|
||||
bp->dev->cfg_pending->hds_thresh);
|
||||
rx_size = SKB_DATA_ALIGN(rx_size + NET_IP_ALIGN);
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@
|
|||
#include <linux/firmware/broadcom/tee_bnxt_fw.h>
|
||||
#endif
|
||||
|
||||
#define BNXT_DEFAULT_RX_COPYBREAK 256
|
||||
#define BNXT_MAX_RX_COPYBREAK 1024
|
||||
#define BNXT_MIN_RX_HDR_BUF 256
|
||||
#define BNXT_MAX_RX_HDR_BUF 1024
|
||||
|
||||
extern struct list_head bnxt_block_cb_list;
|
||||
|
||||
|
|
|
|||
|
|
@ -4594,7 +4594,7 @@ static int bnxt_set_tunable(struct net_device *dev,
|
|||
switch (tuna->id) {
|
||||
case ETHTOOL_RX_COPYBREAK:
|
||||
rx_copybreak = *(u32 *)data;
|
||||
if (rx_copybreak > BNXT_MAX_RX_COPYBREAK)
|
||||
if (rx_copybreak > BNXT_MAX_RX_HDR_BUF)
|
||||
return -ERANGE;
|
||||
if (rx_copybreak != bp->rx_copybreak) {
|
||||
if (netif_running(dev))
|
||||
|
|
@ -5172,7 +5172,7 @@ static int bnxt_run_loopback(struct bnxt *bp)
|
|||
cpr = &rxr->bnapi->cp_ring;
|
||||
if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS)
|
||||
cpr = rxr->rx_cpr;
|
||||
pkt_size = min(bp->dev->mtu + ETH_HLEN, max(BNXT_DEFAULT_RX_COPYBREAK,
|
||||
pkt_size = min(bp->dev->mtu + ETH_HLEN, max(BNXT_MIN_RX_HDR_BUF,
|
||||
bp->rx_copybreak));
|
||||
skb = netdev_alloc_skb(bp->dev, pkt_size);
|
||||
if (!skb)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user