ixgbe: Fix ixgbe TX hangs with XDP_TX beyond queue limit
authorRadoslaw Tyl <radoslawx.tyl@intel.com>
Wed, 5 Sep 2018 07:00:51 +0000 (09:00 +0200)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 3 Oct 2018 19:26:05 +0000 (12:26 -0700)
We have Tx hang when number Tx and XDP queues are more than 64.
In XDP always is MTQC == 0x0 (64TxQs). We need more space for Tx queues.

Signed-off-by: Radoslaw Tyl <radoslawx.tyl@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index 140e87a10ff54f356bf6459b1644de1dceb8de11..ddc22557155b602d779318de8bad73add78bd048 100644 (file)
@@ -3577,12 +3577,18 @@ static void ixgbe_setup_mtqc(struct ixgbe_adapter *adapter)
                else
                        mtqc |= IXGBE_MTQC_64VF;
        } else {
-               if (tcs > 4)
+               if (tcs > 4) {
                        mtqc = IXGBE_MTQC_RT_ENA | IXGBE_MTQC_8TC_8TQ;
-               else if (tcs > 1)
+               } else if (tcs > 1) {
                        mtqc = IXGBE_MTQC_RT_ENA | IXGBE_MTQC_4TC_4TQ;
-               else
-                       mtqc = IXGBE_MTQC_64Q_1PB;
+               } else {
+                       u8 max_txq = adapter->num_tx_queues +
+                               adapter->num_xdp_queues;
+                       if (max_txq > 63)
+                               mtqc = IXGBE_MTQC_RT_ENA | IXGBE_MTQC_4TC_4TQ;
+                       else
+                               mtqc = IXGBE_MTQC_64Q_1PB;
+               }
        }
 
        IXGBE_WRITE_REG(hw, IXGBE_MTQC, mtqc);