]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: use i40e_stop_rings_no_wait to implement PORT_SUSPENDED state
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 13 Apr 2017 08:45:53 +0000 (04:45 -0400)
committerJack Vogel <jack.vogel@oracle.com>
Tue, 10 Oct 2017 21:15:23 +0000 (14:15 -0700)
This state bit was added as a way for DCB to avoid having to wait for
the queues to disable when handling LLDP events. The logic for this was
burried deep within stop Tx and stop Rx queue code. First, let's rename
it so that it does not appear to only affect Tx when infact it modifies
both Tx and Rx flow. Second we can move it up into the i40e_stop_rings()
function, and we can simply re-use the i40e_stop_rings_no_wait() so that
we don't have to bury the implementation as deep into the call stack.

An alternative might be to remove the state bit and instead attempt to
shut down everything directly in DCP flow. This, however, is not ideal
because it creates yet another separate shutdown routine that we'd have
to maintain. In the current implementation any changes will be made to
both flows.

Change-ID: I68e1ccb901af320862bca395e9c9746f08e8b17c
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 26785018
(cherry picked from commit 3480756f2cb93c9245e831a4f46ff6ed19c41031)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Kyle Fortin <kyle.fortin@oracle.com>
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_main.c

index 76c487eddd0768e4a021b976c5e4da758bb89e73..fc48d6f75f429d4aa80ff8844368b301286e71ce 100644 (file)
@@ -152,7 +152,7 @@ enum i40e_state_t {
        __I40E_DOWN_REQUESTED,
        __I40E_FD_FLUSH_REQUESTED,
        __I40E_RESET_FAILED,
-       __I40E_PORT_TX_SUSPENDED,
+       __I40E_PORT_SUSPENDED,
        __I40E_VF_DISABLE,
 };
 
index 9ec78aacc9fd00684b3ad2addee9b0b1d54e4f6e..089e1cde0ea53b042ebaa125dab625d5c72d6bd4 100644 (file)
@@ -4063,10 +4063,6 @@ static int i40e_vsi_control_tx(struct i40e_vsi *vsi, bool enable)
        for (i = 0; i < vsi->num_queue_pairs; i++, pf_q++) {
                i40e_control_tx_q(pf, pf_q, enable);
 
-               /* Don't wait to disable when port Tx is suspended */
-               if (!enable && test_bit(__I40E_PORT_TX_SUSPENDED, &pf->state))
-                       continue;
-
                /* wait for the change to finish */
                ret = i40e_pf_txq_wait(pf, pf_q, enable);
                if (ret) {
@@ -4160,10 +4156,6 @@ static int i40e_vsi_control_rx(struct i40e_vsi *vsi, bool enable)
        for (i = 0; i < vsi->num_queue_pairs; i++, pf_q++) {
                i40e_control_rx_q(pf, pf_q, enable);
 
-               /* Don't wait to disable when port Tx is suspended */
-               if (!enable && test_bit(__I40E_PORT_TX_SUSPENDED, &pf->state))
-                       continue;
-
                /* wait for the change to finish */
                ret = i40e_pf_rxq_wait(pf, pf_q, enable);
                if (ret) {
@@ -4206,6 +4198,10 @@ int i40e_vsi_start_rings(struct i40e_vsi *vsi)
  **/
 void i40e_vsi_stop_rings(struct i40e_vsi *vsi)
 {
+       /* When port TX is suspended, don't wait */
+       if (test_bit(__I40E_PORT_SUSPENDED, &vsi->back->state))
+               return i40e_vsi_stop_rings_no_wait(vsi);
+
        /* do rx first for enable and last for disable
         * Ignore return value, we need to shutdown whatever we can
         */
@@ -4515,14 +4511,6 @@ static void i40e_quiesce_vsi(struct i40e_vsi *vsi)
        if (test_bit(__I40E_DOWN, &vsi->state))
                return;
 
-       /* No need to disable FCoE VSI when Tx suspended */
-       if ((test_bit(__I40E_PORT_TX_SUSPENDED, &vsi->back->state)) &&
-           vsi->type == I40E_VSI_FCOE) {
-               dev_dbg(&vsi->back->pdev->dev,
-                        "VSI seid %d skipping FCoE VSI disable\n", vsi->seid);
-               return;
-       }
-
        set_bit(__I40E_NEEDS_RESTART, &vsi->state);
        if (vsi->netdev && netif_running(vsi->netdev))
                vsi->netdev->netdev_ops->ndo_stop(vsi->netdev);
@@ -6013,7 +6001,7 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,
        else
                pf->flags &= ~I40E_FLAG_DCB_ENABLED;
 
-       set_bit(__I40E_PORT_TX_SUSPENDED, &pf->state);
+       set_bit(__I40E_PORT_SUSPENDED, &pf->state);
        /* Reconfiguration needed quiesce all VSIs */
        i40e_pf_quiesce_all_vsi(pf);
 
@@ -6022,7 +6010,7 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,
 
        ret = i40e_resume_port_tx(pf);
 
-       clear_bit(__I40E_PORT_TX_SUSPENDED, &pf->state);
+       clear_bit(__I40E_PORT_SUSPENDED, &pf->state);
        /* In case of error no point in resuming VSIs */
        if (ret)
                goto exit;