]> git.karo-electronics.de Git - linux-beck.git/commitdiff
i40e: mask phy events
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Sat, 13 Sep 2014 07:40:41 +0000 (07:40 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 24 Oct 2014 03:38:02 +0000 (20:38 -0700)
Tell the firmware what kind of link related events the driver is
interested in.  In this case, just link up/down and qualified module
events are the ones the driver really cares about.

Change-ID: If132c812c340c8e1927c2caf6d55185296b66201
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <jamesx.m.young@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 30056b25d94e6c331d9456c7171e3b51b5b7e754..c23e3772de58319f469ce7910ea9c84a8c365010 100644 (file)
@@ -1419,6 +1419,33 @@ i40e_status i40e_update_link_info(struct i40e_hw *hw, bool enable_lse)
        return status;
 }
 
+/**
+ * i40e_aq_set_phy_int_mask
+ * @hw: pointer to the hw struct
+ * @mask: interrupt mask to be set
+ * @cmd_details: pointer to command details structure or NULL
+ *
+ * Set link interrupt mask.
+ **/
+i40e_status i40e_aq_set_phy_int_mask(struct i40e_hw *hw,
+                                    u16 mask,
+                                    struct i40e_asq_cmd_details *cmd_details)
+{
+       struct i40e_aq_desc desc;
+       struct i40e_aqc_set_phy_int_mask *cmd =
+               (struct i40e_aqc_set_phy_int_mask *)&desc.params.raw;
+       i40e_status status;
+
+       i40e_fill_default_direct_cmd_desc(&desc,
+                                         i40e_aqc_opc_set_phy_int_mask);
+
+       cmd->event_mask = cpu_to_le16(mask);
+
+       status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+
+       return status;
+}
+
 /**
  * i40e_aq_add_vsi
  * @hw: pointer to the hw struct
index ed5f1c15fb0f4cd5fe7ce797920fd3b6cd21f7df..8cb64690a6c21a13717f0430f0d9bd97de37f915 100644 (file)
@@ -6038,6 +6038,15 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
        if (ret)
                goto end_core_reset;
 
+       /* driver is only interested in link up/down and module qualification
+        * reports from firmware
+        */
+       ret = i40e_aq_set_phy_int_mask(&pf->hw,
+                                      I40E_AQ_EVENT_LINK_UPDOWN |
+                                      I40E_AQ_EVENT_MODULE_QUAL_FAIL, NULL);
+       if (ret)
+               dev_info(&pf->pdev->dev, "set phy mask fail, aq_err %d\n", ret);
+
        /* Rebuild the VSIs and VEBs that existed before reset.
         * They are still in our local switch element arrays, so only
         * need to rebuild the switch model in the HW.
@@ -9158,6 +9167,15 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                }
        }
 
+       /* driver is only interested in link up/down and module qualification
+        * reports from firmware
+        */
+       err = i40e_aq_set_phy_int_mask(&pf->hw,
+                                      I40E_AQ_EVENT_LINK_UPDOWN |
+                                      I40E_AQ_EVENT_MODULE_QUAL_FAIL, NULL);
+       if (err)
+               dev_info(&pf->pdev->dev, "set phy mask fail, aq_err %d\n", err);
+
        /* The main driver is (mostly) up and happy. We need to set this state
         * before setting up the misc vector or we get a race and the vector
         * ends up disabled forever.
index 0988b5c1fe87d080e950f146c4c0c0b8ae231189..246c27869a63814496041101b86bdb1893eab0e4 100644 (file)
@@ -84,6 +84,8 @@ enum i40e_status_code i40e_aq_set_phy_config(struct i40e_hw *hw,
                                struct i40e_asq_cmd_details *cmd_details);
 enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,
                                  bool atomic_reset);
+i40e_status i40e_aq_set_phy_int_mask(struct i40e_hw *hw, u16 mask,
+                                    struct i40e_asq_cmd_details *cmd_details);
 i40e_status i40e_aq_clear_pxe_mode(struct i40e_hw *hw,
                                struct i40e_asq_cmd_details *cmd_details);
 i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw,