i40e: Resume Port Tx after DCB event
authorNeerav Parikh <neerav.parikh@intel.com>
Wed, 12 Nov 2014 00:18:20 +0000 (00:18 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 18 Nov 2014 09:08:56 +0000 (01:08 -0800)
When there are DCB configuration changes based on DCBX the firmware suspends
the port's Tx and generates an event to the PF. The PF is then responsible
to reconfigure the PF VSIs and switching topology as per the updated DCB
configuration and then resume the port's Tx by calling the "Resume Port Tx"
AQ command.

This patch adds this call to the flow that handles DCB re-configuration in
the PF.

Change-ID: I5b860ad48abfbf379b003143c4d3453e2ed5cc1c
Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Tested-By: Jack Morgan <jack.morgan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_common.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40e/i40e_prototype.h

index c49416cfe61652a820b19fdcbcd6341208c619c4..76735d5f34ebbeaf7f296de9459548a4814c1df3 100644 (file)
@@ -3216,6 +3216,26 @@ i40e_status i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw,
        return status;
 }
 
+/**
+ * i40e_aq_resume_port_tx
+ * @hw: pointer to the hardware structure
+ * @cmd_details: pointer to command details structure or NULL
+ *
+ * Resume port's Tx traffic
+ **/
+i40e_status i40e_aq_resume_port_tx(struct i40e_hw *hw,
+                                  struct i40e_asq_cmd_details *cmd_details)
+{
+       struct i40e_aq_desc desc;
+       i40e_status status;
+
+       i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_resume_port_tx);
+
+       status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+
+       return status;
+}
+
 /**
  * i40e_set_pci_config_data - store PCI bus info
  * @hw: pointer to hardware structure
index 68c19c87ebed5a9c208a7e7b8383002feadb8692..185f977e8a9841dcbfe84d139ee6acbc314be78f 100644 (file)
@@ -4381,6 +4381,31 @@ static void i40e_dcb_reconfigure(struct i40e_pf *pf)
        }
 }
 
+/**
+ * i40e_resume_port_tx - Resume port Tx
+ * @pf: PF struct
+ *
+ * Resume a port's Tx and issue a PF reset in case of failure to
+ * resume.
+ **/
+static int i40e_resume_port_tx(struct i40e_pf *pf)
+{
+       struct i40e_hw *hw = &pf->hw;
+       int ret;
+
+       ret = i40e_aq_resume_port_tx(hw, NULL);
+       if (ret) {
+               dev_info(&pf->pdev->dev,
+                        "AQ command Resume Port Tx failed = %d\n",
+                         pf->hw.aq.asq_last_status);
+               /* Schedule PF reset to recover */
+               set_bit(__I40E_PF_RESET_REQUESTED, &pf->state);
+               i40e_service_event_schedule(pf);
+       }
+
+       return ret;
+}
+
 /**
  * i40e_init_pf_dcb - Initialize DCB configuration
  * @pf: PF being configured
@@ -5075,7 +5100,11 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,
        /* Changes in configuration update VEB/VSI */
        i40e_dcb_reconfigure(pf);
 
-       i40e_pf_unquiesce_all_vsi(pf);
+       ret = i40e_resume_port_tx(pf);
+
+       /* In case of error no point in resuming VSIs */
+       if (!ret)
+               i40e_pf_unquiesce_all_vsi(pf);
 exit:
        return ret;
 }
index 246c27869a63814496041101b86bdb1893eab0e4..98a735cdf03815b21314b9b6a23ab7184bb39ea8 100644 (file)
@@ -230,6 +230,8 @@ i40e_status i40e_aq_query_switch_comp_bw_config(struct i40e_hw *hw,
                u16 seid,
                struct i40e_aqc_query_switching_comp_bw_config_resp *bw_data,
                struct i40e_asq_cmd_details *cmd_details);
+i40e_status i40e_aq_resume_port_tx(struct i40e_hw *hw,
+                                  struct i40e_asq_cmd_details *cmd_details);
 /* i40e_common */
 i40e_status i40e_init_shared_code(struct i40e_hw *hw);
 i40e_status i40e_pf_reset(struct i40e_hw *hw);