bna: TX Queue Depth Fix
authorRasesh Mody <rmody@brocade.com>
Tue, 30 Aug 2011 15:27:46 +0000 (15:27 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Sep 2011 19:36:34 +0000 (15:36 -0400)
sk_buff unmap_array grows greater than 65536 (x2) with Tx ring of 65536.
Reducing TXQ depth and safe(max) acking of Tx events to 32768 (same as Rx).
Add defines for TX and RX queue depths.

Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/brocade/bna/bnad.h
drivers/net/ethernet/brocade/bna/bnad_ethtool.c

index 0c9d736a15de47309c2466a149071efd3d6879de..6c42c1441679e9caebc834c22c48c80c2f2fdff8 100644 (file)
@@ -86,6 +86,10 @@ struct bnad_rx_ctrl {
 #define BNAD_MAX_Q_DEPTH               0x10000
 #define BNAD_MIN_Q_DEPTH               0x200
 
+#define BNAD_MAX_RXQ_DEPTH             (BNAD_MAX_Q_DEPTH / bnad_rxqs_per_cq)
+/* keeping MAX TX and RX Q depth equal */
+#define BNAD_MAX_TXQ_DEPTH             BNAD_MAX_RXQ_DEPTH
+
 #define BNAD_JUMBO_MTU                 9000
 
 #define BNAD_NETIF_WAKE_THRESHOLD      8
index 96ff7001a1a2abb448cb427bafe15907456a7257..48422244397c250053b92b21f745abe1e7d4df55 100644 (file)
@@ -418,10 +418,10 @@ bnad_get_ringparam(struct net_device *netdev,
 {
        struct bnad *bnad = netdev_priv(netdev);
 
-       ringparam->rx_max_pending = BNAD_MAX_Q_DEPTH / bnad_rxqs_per_cq;
+       ringparam->rx_max_pending = BNAD_MAX_RXQ_DEPTH;
        ringparam->rx_mini_max_pending = 0;
        ringparam->rx_jumbo_max_pending = 0;
-       ringparam->tx_max_pending = BNAD_MAX_Q_DEPTH;
+       ringparam->tx_max_pending = BNAD_MAX_TXQ_DEPTH;
 
        ringparam->rx_pending = bnad->rxq_depth;
        ringparam->rx_mini_max_pending = 0;
@@ -445,13 +445,13 @@ bnad_set_ringparam(struct net_device *netdev,
        }
 
        if (ringparam->rx_pending < BNAD_MIN_Q_DEPTH ||
-           ringparam->rx_pending > BNAD_MAX_Q_DEPTH / bnad_rxqs_per_cq ||
+           ringparam->rx_pending > BNAD_MAX_RXQ_DEPTH ||
            !BNA_POWER_OF_2(ringparam->rx_pending)) {
                mutex_unlock(&bnad->conf_mutex);
                return -EINVAL;
        }
        if (ringparam->tx_pending < BNAD_MIN_Q_DEPTH ||
-           ringparam->tx_pending > BNAD_MAX_Q_DEPTH ||
+           ringparam->tx_pending > BNAD_MAX_TXQ_DEPTH ||
            !BNA_POWER_OF_2(ringparam->tx_pending)) {
                mutex_unlock(&bnad->conf_mutex);
                return -EINVAL;