bnxt_en: Fix ethtool -l pre-set max combined channel.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 13 Feb 2017 00:18:12 +0000 (19:18 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Feb 2017 03:18:49 +0000 (22:18 -0500)
With commit d1e7925e6d80 ("bnxt_en: Centralize logic to reserve rings."),
ring allocation for combined rings has become stricter.  A combined
ring must now have an rx-tx ring pair.  The pre-set max. for combined
rings should now be min(rx, tx).

Fixes: d1e7925e6d80 ("bnxt_en: Centralize logic to reserve rings.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

index 4b45b885b1e30f183248b2cfa3eeca99fbdad929..6903a873f072ae14f4a7638514446d6ad7b1c6a0 100644 (file)
@@ -357,7 +357,7 @@ static void bnxt_get_channels(struct net_device *dev,
        int max_rx_rings, max_tx_rings, tcs;
 
        bnxt_get_max_rings(bp, &max_rx_rings, &max_tx_rings, true);
-       channel->max_combined = max_t(int, max_rx_rings, max_tx_rings);
+       channel->max_combined = min_t(int, max_rx_rings, max_tx_rings);
 
        if (bnxt_get_max_rings(bp, &max_rx_rings, &max_tx_rings, false)) {
                max_rx_rings = 0;