]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: Make the DCB firmware checks for X710/XL710 only
authorNeerav Parikh <neerav.parikh@intel.com>
Thu, 14 Jan 2016 00:51:39 +0000 (16:51 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 16:37:16 +0000 (08:37 -0800)
Orabug: 22342532

Make the DCB firmware version related checks specific to
X710 and XL710 only. These checks are not required for
X722 family of devices.

Introduced an inline routine to help determine if the
MAC type is X710/XL710 or not.

Moved the firmware version related checks in i40e_sw_init()
and defined flags for different cases

Fix the version check to allow using "Set LLDP MIB" AQ
for beyond FVL4 FW releases.

Change-ID: Ib78288343de983aa0354fc28aa36e99b073662c0
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>
(cherry picked from commit f1bbad339cdd74cea945e33d758200d42310be17)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_main.c

drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_main.c

index e35ec0d7ca4ffca3955b5c78070e62b29fcbca1b..a32f7bf27f444c5fc48cb5d6772ea2dff6b269a6 100644 (file)
 /* default to trying for four seconds */
 #define I40E_TRY_LINK_TIMEOUT (4 * HZ)
 
+/**
+ * i40e_is_mac_710 - Return true if MAC is X710/XL710
+ * @hw: ptr to the hardware info
+ **/
+static inline bool i40e_is_mac_710(struct i40e_hw *hw)
+{
+       if ((hw->mac.type == I40E_MAC_X710) ||
+           (hw->mac.type == I40E_MAC_XL710))
+               return true;
+
+       return false;
+}
+
 /* driver state flags */
 enum i40e_state_t {
        __I40E_TESTING,
@@ -342,6 +355,9 @@ struct i40e_pf {
 #define I40E_FLAG_NO_PCI_LINK_CHECK            BIT_ULL(42)
 #define I40E_FLAG_100M_SGMII_CAPABLE           BIT_ULL(43)
 #define I40E_FLAG_RESTART_AUTONEG              BIT_ULL(44)
+#define I40E_FLAG_NO_DCB_SUPPORT               BIT_ULL(45)
+#define I40E_FLAG_USE_SET_LLDP_MIB             BIT_ULL(46)
+#define I40E_FLAG_STOP_FW_LLDP                 BIT_ULL(47)
 
        /* tracks features that get auto disabled by errors */
        u64 auto_disable_flags;
index 42307677a9a1de90dde9b8fa10cd54f04221e152..b2729b40af992a1e334af6b11d152f17f7afa32d 100644 (file)
@@ -4983,6 +4983,10 @@ static int i40e_init_pf_dcb(struct i40e_pf *pf)
        struct i40e_hw *hw = &pf->hw;
        int err = 0;
 
+       /* Do not enable DCB for SW1 and SW2 images even if the FW is capable */
+       if (pf->flags & I40E_FLAG_NO_DCB_SUPPORT)
+               goto out;
+
        /* Get the initial DCB configuration */
        err = i40e_init_dcb(hw);
        if (!err) {
@@ -8368,11 +8372,25 @@ static int i40e_sw_init(struct i40e_pf *pf)
                                 pf->hw.func_caps.fd_filters_best_effort;
        }
 
-       if (((pf->hw.mac.type == I40E_MAC_X710) ||
-            (pf->hw.mac.type == I40E_MAC_XL710)) &&
+       if (i40e_is_mac_710(&pf->hw) &&
            (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 33)) ||
-           (pf->hw.aq.fw_maj_ver < 4)))
+           (pf->hw.aq.fw_maj_ver < 4))) {
                pf->flags |= I40E_FLAG_RESTART_AUTONEG;
+               /* No DCB support  for FW < v4.33 */
+               pf->flags |= I40E_FLAG_NO_DCB_SUPPORT;
+       }
+
+       /* Disable FW LLDP if FW < v4.3 */
+       if (i40e_is_mac_710(&pf->hw) &&
+           (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 3)) ||
+           (pf->hw.aq.fw_maj_ver < 4)))
+               pf->flags |= I40E_FLAG_STOP_FW_LLDP;
+
+       /* Use the FW Set LLDP MIB API if FW > v4.40 */
+       if (i40e_is_mac_710(&pf->hw) &&
+           (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver >= 40)) ||
+           (pf->hw.aq.fw_maj_ver >= 5)))
+               pf->flags |= I40E_FLAG_USE_SET_LLDP_MIB;
 
        if (pf->hw.func_caps.vmdq) {
                pf->num_vmdq_vsis = I40E_DEFAULT_NUM_VMDQ_VSI;
@@ -8400,6 +8418,7 @@ static int i40e_sw_init(struct i40e_pf *pf)
                             I40E_FLAG_WB_ON_ITR_CAPABLE |
                             I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE |
                             I40E_FLAG_100M_SGMII_CAPABLE |
+                            I40E_FLAG_USE_SET_LLDP_MIB |
                             I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
        } else if ((pf->hw.aq.api_maj_ver > 1) ||
                   ((pf->hw.aq.api_maj_ver == 1) &&
@@ -10693,8 +10712,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
         * Ignore error return codes because if it was already disabled via
         * hardware settings this will fail
         */
-       if (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 3)) ||
-           (pf->hw.aq.fw_maj_ver < 4)) {
+       if (pf->flags & I40E_FLAG_STOP_FW_LLDP) {
                dev_info(&pdev->dev, "Stopping firmware LLDP agent.\n");
                i40e_aq_stop_lldp(hw, true, NULL);
        }