]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
i40e/i40evf: Store CEE DCBX DesiredCfg and RemoteCfg
authorNeerav Parikh <neerav.parikh@intel.com>
Thu, 27 Aug 2015 15:42:37 +0000 (11:42 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 8 Oct 2015 22:20:35 +0000 (15:20 -0700)
This patch adds capability to query and store the CEE DCBX DesiredCfg
and RemoteCfg data from the LLDP MIB.
Added new member "desired_dcbx_config" in the i40e_hw data structure
to hold CEE only DesiredCfg data.

Change-ID: I19c550369594384eaff4cc63e690ca740231195d
Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_dcb.c
drivers/net/ethernet/intel/i40e/i40e_type.h
drivers/net/ethernet/intel/i40evf/i40e_type.h

index 89e60e3b74c61109e244a1ab3bd5fb9abd353cdc..fbec7d787f9d190e3949c18a3c2b3b1c552c8cf4 100644 (file)
@@ -761,6 +761,36 @@ static void i40e_cee_to_dcb_config(
        dcbcfg->numapps = i;
 }
 
+/**
+ * i40e_get_ieee_dcb_config
+ * @hw: pointer to the hw struct
+ *
+ * Get IEEE mode DCB configuration from the Firmware
+ **/
+static i40e_status i40e_get_ieee_dcb_config(struct i40e_hw *hw)
+{
+       i40e_status ret = 0;
+
+       /* IEEE mode */
+       hw->local_dcbx_config.dcbx_mode = I40E_DCBX_MODE_IEEE;
+       /* Get Local DCB Config */
+       ret = i40e_aq_get_dcb_config(hw, I40E_AQ_LLDP_MIB_LOCAL, 0,
+                                    &hw->local_dcbx_config);
+       if (ret)
+               goto out;
+
+       /* Get Remote DCB Config */
+       ret = i40e_aq_get_dcb_config(hw, I40E_AQ_LLDP_MIB_REMOTE,
+                                    I40E_AQ_LLDP_BRIDGE_TYPE_NEAREST_BRIDGE,
+                                    &hw->remote_dcbx_config);
+       /* Don't treat ENOENT as an error for Remote MIBs */
+       if (hw->aq.asq_last_status == I40E_AQ_RC_ENOENT)
+               ret = 0;
+
+out:
+       return ret;
+}
+
 /**
  * i40e_get_dcb_config
  * @hw: pointer to the hw struct
@@ -776,7 +806,7 @@ i40e_status i40e_get_dcb_config(struct i40e_hw *hw)
        /* If Firmware version < v4.33 IEEE only */
        if (((hw->aq.fw_maj_ver == 4) && (hw->aq.fw_min_ver < 33)) ||
            (hw->aq.fw_maj_ver < 4))
-               goto ieee;
+               return i40e_get_ieee_dcb_config(hw);
 
        /* If Firmware version == v4.33 use old CEE struct */
        if ((hw->aq.fw_maj_ver == 4) && (hw->aq.fw_min_ver == 33)) {
@@ -805,16 +835,14 @@ i40e_status i40e_get_dcb_config(struct i40e_hw *hw)
 
        /* CEE mode not enabled try querying IEEE data */
        if (hw->aq.asq_last_status == I40E_AQ_RC_ENOENT)
-               goto ieee;
-       else
+               return i40e_get_ieee_dcb_config(hw);
+
+       if (ret)
                goto out;
 
-ieee:
-       /* IEEE mode */
-       hw->local_dcbx_config.dcbx_mode = I40E_DCBX_MODE_IEEE;
-       /* Get Local DCB Config */
+       /* Get CEE DCB Desired Config */
        ret = i40e_aq_get_dcb_config(hw, I40E_AQ_LLDP_MIB_LOCAL, 0,
-                                    &hw->local_dcbx_config);
+                                    &hw->desired_dcbx_config);
        if (ret)
                goto out;
 
index 34720e07f990373d7760bc3373d8e34e5d5635f9..1c0bedbb413267e8d7f0bbe9b11e9e86f7da5de0 100644 (file)
@@ -510,8 +510,9 @@ struct i40e_hw {
        u16 dcbx_status;
 
        /* DCBX info */
-       struct i40e_dcbx_config local_dcbx_config;
-       struct i40e_dcbx_config remote_dcbx_config;
+       struct i40e_dcbx_config local_dcbx_config; /* Oper/Local Cfg */
+       struct i40e_dcbx_config remote_dcbx_config; /* Peer Cfg */
+       struct i40e_dcbx_config desired_dcbx_config; /* CEE Desired Cfg */
 
        /* debug mask */
        u32 debug_mask;
index bbb388660aa7de6ebeaab5a570470bf28ba6fe4d..4b5528d4ae3d748be8c959f08e93bdd3a8362917 100644 (file)
@@ -504,8 +504,9 @@ struct i40e_hw {
        u16 dcbx_status;
 
        /* DCBX info */
-       struct i40e_dcbx_config local_dcbx_config;
-       struct i40e_dcbx_config remote_dcbx_config;
+       struct i40e_dcbx_config local_dcbx_config; /* Oper/Local Cfg */
+       struct i40e_dcbx_config remote_dcbx_config; /* Peer Cfg */
+       struct i40e_dcbx_config desired_dcbx_config; /* CEE Desired Cfg */
 
        /* debug mask */
        u32 debug_mask;