Skip to content

Commit bee0180

Browse files
committed
eth: bnxt: allocate enough buffer space to meet HDS threshold
Now that we can configure HDS threshold separately from the rx_copybreak HDS threshold may be higher than rx_copybreak. We need to make sure that we have enough space for the headers. Fixes: 6b43673 ("bnxt_en: add support for hds-thresh ethtool command") Reviewed-by: Michael Chan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 928459b commit bee0180

File tree

1 file changed

+4
-3
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4671,9 +4671,10 @@ void bnxt_set_ring_params(struct bnxt *bp)
46714671
ALIGN(max(NET_SKB_PAD, XDP_PACKET_HEADROOM), 8) -
46724672
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
46734673
} else {
4674-
rx_size = SKB_DATA_ALIGN(max(BNXT_DEFAULT_RX_COPYBREAK,
4675-
bp->rx_copybreak) +
4676-
NET_IP_ALIGN);
4674+
rx_size = max3(BNXT_DEFAULT_RX_COPYBREAK,
4675+
bp->rx_copybreak,
4676+
bp->dev->cfg_pending->hds_thresh);
4677+
rx_size = SKB_DATA_ALIGN(rx_size + NET_IP_ALIGN);
46774678
rx_space = rx_size + NET_SKB_PAD +
46784679
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
46794680
}

0 commit comments

Comments
 (0)