Commit d760fc37 authored by Mintz Yuval's avatar Mintz Yuval Committed by David S. Miller

bnx2x: allocate smaller Rx rings for 1G functions

Signed-off-by: default avatarYuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent afa13b4b
...@@ -3122,9 +3122,16 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index) ...@@ -3122,9 +3122,16 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index)
} else } else
#endif #endif
if (!bp->rx_ring_size) { if (!bp->rx_ring_size) {
u32 cfg = SHMEM_RD(bp,
dev_info.port_hw_config[BP_PORT(bp)].default_cfg);
rx_ring_size = MAX_RX_AVAIL/BNX2X_NUM_RX_QUEUES(bp); rx_ring_size = MAX_RX_AVAIL/BNX2X_NUM_RX_QUEUES(bp);
/* Dercease ring size for 1G functions */
if ((cfg & PORT_HW_CFG_NET_SERDES_IF_MASK) ==
PORT_HW_CFG_NET_SERDES_IF_SGMII)
rx_ring_size /= 10;
/* allocate at least number of buffers required by FW */ /* allocate at least number of buffers required by FW */
rx_ring_size = max_t(int, bp->disable_tpa ? MIN_RX_SIZE_NONTPA : rx_ring_size = max_t(int, bp->disable_tpa ? MIN_RX_SIZE_NONTPA :
MIN_RX_SIZE_TPA, rx_ring_size); MIN_RX_SIZE_TPA, rx_ring_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment