diff options
-rw-r--r-- | drivers/net/bnx2x/bnx2x.h | 5 | ||||
-rw-r--r-- | drivers/net/bnx2x/bnx2x_cmn.c | 6 | ||||
-rw-r--r-- | drivers/net/bnx2x/bnx2x_ethtool.c | 10 | ||||
-rw-r--r-- | drivers/net/bnx2x/bnx2x_main.c | 1 |
4 files changed, 17 insertions, 5 deletions
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h index b6aaf22a1b84..64329c5fbdea 100644 --- a/drivers/net/bnx2x/bnx2x.h +++ b/drivers/net/bnx2x/bnx2x.h | |||
@@ -20,8 +20,8 @@ | |||
20 | * (you will need to reboot afterwards) */ | 20 | * (you will need to reboot afterwards) */ |
21 | /* #define BNX2X_STOP_ON_ERROR */ | 21 | /* #define BNX2X_STOP_ON_ERROR */ |
22 | 22 | ||
23 | #define DRV_MODULE_VERSION "1.52.53-6" | 23 | #define DRV_MODULE_VERSION "1.52.53-7" |
24 | #define DRV_MODULE_RELDATE "2010/09/07" | 24 | #define DRV_MODULE_RELDATE "2010/09/12" |
25 | #define BNX2X_BC_VER 0x040200 | 25 | #define BNX2X_BC_VER 0x040200 |
26 | 26 | ||
27 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | 27 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
@@ -369,6 +369,7 @@ struct bnx2x_fastpath { | |||
369 | #define NUM_RX_BD (RX_DESC_CNT * NUM_RX_RINGS) | 369 | #define NUM_RX_BD (RX_DESC_CNT * NUM_RX_RINGS) |
370 | #define MAX_RX_BD (NUM_RX_BD - 1) | 370 | #define MAX_RX_BD (NUM_RX_BD - 1) |
371 | #define MAX_RX_AVAIL (MAX_RX_DESC_CNT * NUM_RX_RINGS - 2) | 371 | #define MAX_RX_AVAIL (MAX_RX_DESC_CNT * NUM_RX_RINGS - 2) |
372 | #define MIN_RX_AVAIL 128 | ||
372 | #define NEXT_RX_IDX(x) ((((x) & RX_DESC_MASK) == \ | 373 | #define NEXT_RX_IDX(x) ((((x) & RX_DESC_MASK) == \ |
373 | (MAX_RX_DESC_CNT - 1)) ? (x) + 3 : (x) + 1) | 374 | (MAX_RX_DESC_CNT - 1)) ? (x) + 3 : (x) + 1) |
374 | #define RX_BD(x) ((x) & MAX_RX_BD) | 375 | #define RX_BD(x) ((x) & MAX_RX_BD) |
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index 7f1d291eaaa5..efc7be4aefb5 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c | |||
@@ -781,6 +781,10 @@ void bnx2x_init_rx_rings(struct bnx2x *bp) | |||
781 | ETH_MAX_AGGREGATION_QUEUES_E1H; | 781 | ETH_MAX_AGGREGATION_QUEUES_E1H; |
782 | u16 ring_prod, cqe_ring_prod; | 782 | u16 ring_prod, cqe_ring_prod; |
783 | int i, j; | 783 | int i, j; |
784 | int rx_ring_size = bp->rx_ring_size ? bp->rx_ring_size : | ||
785 | MAX_RX_AVAIL/bp->num_queues; | ||
786 | |||
787 | rx_ring_size = max_t(int, MIN_RX_AVAIL, rx_ring_size); | ||
784 | 788 | ||
785 | bp->rx_buf_size = bp->dev->mtu + ETH_OVREHEAD + BNX2X_RX_ALIGN; | 789 | bp->rx_buf_size = bp->dev->mtu + ETH_OVREHEAD + BNX2X_RX_ALIGN; |
786 | DP(NETIF_MSG_IFUP, | 790 | DP(NETIF_MSG_IFUP, |
@@ -883,7 +887,7 @@ void bnx2x_init_rx_rings(struct bnx2x *bp) | |||
883 | /* Allocate BDs and initialize BD ring */ | 887 | /* Allocate BDs and initialize BD ring */ |
884 | fp->rx_comp_cons = 0; | 888 | fp->rx_comp_cons = 0; |
885 | cqe_ring_prod = ring_prod = 0; | 889 | cqe_ring_prod = ring_prod = 0; |
886 | for (i = 0; i < bp->rx_ring_size; i++) { | 890 | for (i = 0; i < rx_ring_size; i++) { |
887 | if (bnx2x_alloc_rx_skb(bp, fp, ring_prod) < 0) { | 891 | if (bnx2x_alloc_rx_skb(bp, fp, ring_prod) < 0) { |
888 | BNX2X_ERR("was only able to allocate " | 892 | BNX2X_ERR("was only able to allocate " |
889 | "%d rx skbs on queue[%d]\n", i, j); | 893 | "%d rx skbs on queue[%d]\n", i, j); |
diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c index 6f939c5a0089..d9748e97fad3 100644 --- a/drivers/net/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/bnx2x/bnx2x_ethtool.c | |||
@@ -961,7 +961,14 @@ static void bnx2x_get_ringparam(struct net_device *dev, | |||
961 | ering->rx_mini_max_pending = 0; | 961 | ering->rx_mini_max_pending = 0; |
962 | ering->rx_jumbo_max_pending = 0; | 962 | ering->rx_jumbo_max_pending = 0; |
963 | 963 | ||
964 | ering->rx_pending = bp->rx_ring_size; | 964 | if (bp->rx_ring_size) |
965 | ering->rx_pending = bp->rx_ring_size; | ||
966 | else | ||
967 | if (bp->state == BNX2X_STATE_OPEN && bp->num_queues) | ||
968 | ering->rx_pending = MAX_RX_AVAIL/bp->num_queues; | ||
969 | else | ||
970 | ering->rx_pending = MAX_RX_AVAIL; | ||
971 | |||
965 | ering->rx_mini_pending = 0; | 972 | ering->rx_mini_pending = 0; |
966 | ering->rx_jumbo_pending = 0; | 973 | ering->rx_jumbo_pending = 0; |
967 | 974 | ||
@@ -981,6 +988,7 @@ static int bnx2x_set_ringparam(struct net_device *dev, | |||
981 | } | 988 | } |
982 | 989 | ||
983 | if ((ering->rx_pending > MAX_RX_AVAIL) || | 990 | if ((ering->rx_pending > MAX_RX_AVAIL) || |
991 | (ering->rx_pending < MIN_RX_AVAIL) || | ||
984 | (ering->tx_pending > MAX_TX_AVAIL) || | 992 | (ering->tx_pending > MAX_TX_AVAIL) || |
985 | (ering->tx_pending <= MAX_SKB_FRAGS + 4)) | 993 | (ering->tx_pending <= MAX_SKB_FRAGS + 4)) |
986 | return -EINVAL; | 994 | return -EINVAL; |
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index 7ba3a6d96fd5..67587fe9e358 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c | |||
@@ -6619,7 +6619,6 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) | |||
6619 | bp->mrrs = mrrs; | 6619 | bp->mrrs = mrrs; |
6620 | 6620 | ||
6621 | bp->tx_ring_size = MAX_TX_AVAIL; | 6621 | bp->tx_ring_size = MAX_TX_AVAIL; |
6622 | bp->rx_ring_size = MAX_RX_AVAIL; | ||
6623 | 6622 | ||
6624 | bp->rx_csum = 1; | 6623 | bp->rx_csum = 1; |
6625 | 6624 | ||