aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/bnx2x/bnx2x_cmn.c17
-rw-r--r--drivers/net/bnx2x/bnx2x_ethtool.c5
2 files changed, 12 insertions, 10 deletions
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c
index 2a33d2433c31..c4cbf9736414 100644
--- a/drivers/net/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/bnx2x/bnx2x_cmn.c
@@ -3091,15 +3091,20 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index)
3091 struct bnx2x_fastpath *fp = &bp->fp[index]; 3091 struct bnx2x_fastpath *fp = &bp->fp[index];
3092 int ring_size = 0; 3092 int ring_size = 0;
3093 u8 cos; 3093 u8 cos;
3094 int rx_ring_size = 0;
3094 3095
3095 /* if rx_ring_size specified - use it */ 3096 /* if rx_ring_size specified - use it */
3096 int rx_ring_size = bp->rx_ring_size ? bp->rx_ring_size : 3097 if (!bp->rx_ring_size) {
3097 MAX_RX_AVAIL/BNX2X_NUM_RX_QUEUES(bp);
3098 3098
3099 /* allocate at least number of buffers required by FW */ 3099 rx_ring_size = MAX_RX_AVAIL/BNX2X_NUM_RX_QUEUES(bp);
3100 rx_ring_size = max_t(int, bp->disable_tpa ? MIN_RX_SIZE_NONTPA : 3100
3101 MIN_RX_SIZE_TPA, 3101 /* allocate at least number of buffers required by FW */
3102 rx_ring_size); 3102 rx_ring_size = max_t(int, bp->disable_tpa ? MIN_RX_SIZE_NONTPA :
3103 MIN_RX_SIZE_TPA, rx_ring_size);
3104
3105 bp->rx_ring_size = rx_ring_size;
3106 } else
3107 rx_ring_size = bp->rx_ring_size;
3103 3108
3104 /* Common */ 3109 /* Common */
3105 sb = &bnx2x_fp(bp, index, status_blk); 3110 sb = &bnx2x_fp(bp, index, status_blk);
diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c
index 221863059dae..0ceb6c7b1238 100644
--- a/drivers/net/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/bnx2x/bnx2x_ethtool.c
@@ -1310,10 +1310,7 @@ static void bnx2x_get_ringparam(struct net_device *dev,
1310 if (bp->rx_ring_size) 1310 if (bp->rx_ring_size)
1311 ering->rx_pending = bp->rx_ring_size; 1311 ering->rx_pending = bp->rx_ring_size;
1312 else 1312 else
1313 if (bp->state == BNX2X_STATE_OPEN && bp->num_queues) 1313 ering->rx_pending = MAX_RX_AVAIL;
1314 ering->rx_pending = MAX_RX_AVAIL/bp->num_queues;
1315 else
1316 ering->rx_pending = MAX_RX_AVAIL;
1317 1314
1318 ering->rx_mini_pending = 0; 1315 ering->rx_mini_pending = 0;
1319 ering->rx_jumbo_pending = 0; 1316 ering->rx_jumbo_pending = 0;