ice: do not disable Tx queues twice in ice_down()
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Fri, 23 Feb 2024 16:06:27 +0000 (17:06 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 4 Mar 2024 18:33:44 +0000 (10:33 -0800)
ice_down() clears QINT_TQCTL_CAUSE_ENA_M bit twice, which is not
necessary. First clearing happens in ice_vsi_dis_irq() and second in
ice_vsi_stop_tx_ring() - remove the first one.

While at it, make ice_vsi_dis_irq() static as ice_down() is the only
current caller of it.

Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_lib.c
drivers/net/ethernet/intel/ice/ice_lib.h
drivers/net/ethernet/intel/ice/ice_main.c

index 59e8a2572985081cdcfb346bb3fc7bf8994e32e3..48e4c33a355061086fd21f643efd729357b05527 100644 (file)
@@ -2719,61 +2719,6 @@ void ice_dis_vsi(struct ice_vsi *vsi, bool locked)
        }
 }
 
-/**
- * ice_vsi_dis_irq - Mask off queue interrupt generation on the VSI
- * @vsi: the VSI being un-configured
- */
-void ice_vsi_dis_irq(struct ice_vsi *vsi)
-{
-       struct ice_pf *pf = vsi->back;
-       struct ice_hw *hw = &pf->hw;
-       u32 val;
-       int i;
-
-       /* disable interrupt causation from each queue */
-       if (vsi->tx_rings) {
-               ice_for_each_txq(vsi, i) {
-                       if (vsi->tx_rings[i]) {
-                               u16 reg;
-
-                               reg = vsi->tx_rings[i]->reg_idx;
-                               val = rd32(hw, QINT_TQCTL(reg));
-                               val &= ~QINT_TQCTL_CAUSE_ENA_M;
-                               wr32(hw, QINT_TQCTL(reg), val);
-                       }
-               }
-       }
-
-       if (vsi->rx_rings) {
-               ice_for_each_rxq(vsi, i) {
-                       if (vsi->rx_rings[i]) {
-                               u16 reg;
-
-                               reg = vsi->rx_rings[i]->reg_idx;
-                               val = rd32(hw, QINT_RQCTL(reg));
-                               val &= ~QINT_RQCTL_CAUSE_ENA_M;
-                               wr32(hw, QINT_RQCTL(reg), val);
-                       }
-               }
-       }
-
-       /* disable each interrupt */
-       ice_for_each_q_vector(vsi, i) {
-               if (!vsi->q_vectors[i])
-                       continue;
-               wr32(hw, GLINT_DYN_CTL(vsi->q_vectors[i]->reg_idx), 0);
-       }
-
-       ice_flush(hw);
-
-       /* don't call synchronize_irq() for VF's from the host */
-       if (vsi->type == ICE_VSI_VF)
-               return;
-
-       ice_for_each_q_vector(vsi, i)
-               synchronize_irq(vsi->q_vectors[i]->irq.virq);
-}
-
 /**
  * __ice_queue_set_napi - Set the napi instance for the queue
  * @dev: device to which NAPI and queue belong
index b5a1ed7cc4b1757b14d4cd24acd029c119b70cee..9cd23afe5f15a852d6356809842feac175b9712a 100644 (file)
@@ -110,8 +110,6 @@ void
 ice_write_qrxflxp_cntxt(struct ice_hw *hw, u16 pf_q, u32 rxdid, u32 prio,
                        bool ena_ts);
 
-void ice_vsi_dis_irq(struct ice_vsi *vsi);
-
 void ice_vsi_free_irq(struct ice_vsi *vsi);
 
 void ice_vsi_free_rx_rings(struct ice_vsi *vsi);
index 8f73ba77e8359ed84633310fff6588ea1391e1ba..062b4ea8e2c383a6192935283f93c8845a753d5c 100644 (file)
@@ -7001,6 +7001,50 @@ static void ice_napi_disable_all(struct ice_vsi *vsi)
        }
 }
 
+/**
+ * ice_vsi_dis_irq - Mask off queue interrupt generation on the VSI
+ * @vsi: the VSI being un-configured
+ */
+static void ice_vsi_dis_irq(struct ice_vsi *vsi)
+{
+       struct ice_pf *pf = vsi->back;
+       struct ice_hw *hw = &pf->hw;
+       u32 val;
+       int i;
+
+       /* disable interrupt causation from each Rx queue; Tx queues are
+        * handled in ice_vsi_stop_tx_ring()
+        */
+       if (vsi->rx_rings) {
+               ice_for_each_rxq(vsi, i) {
+                       if (vsi->rx_rings[i]) {
+                               u16 reg;
+
+                               reg = vsi->rx_rings[i]->reg_idx;
+                               val = rd32(hw, QINT_RQCTL(reg));
+                               val &= ~QINT_RQCTL_CAUSE_ENA_M;
+                               wr32(hw, QINT_RQCTL(reg), val);
+                       }
+               }
+       }
+
+       /* disable each interrupt */
+       ice_for_each_q_vector(vsi, i) {
+               if (!vsi->q_vectors[i])
+                       continue;
+               wr32(hw, GLINT_DYN_CTL(vsi->q_vectors[i]->reg_idx), 0);
+       }
+
+       ice_flush(hw);
+
+       /* don't call synchronize_irq() for VF's from the host */
+       if (vsi->type == ICE_VSI_VF)
+               return;
+
+       ice_for_each_q_vector(vsi, i)
+               synchronize_irq(vsi->q_vectors[i]->irq.virq);
+}
+
 /**
  * ice_down - Shutdown the connection
  * @vsi: The VSI being stopped