]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: Fix for ethtool Supported link modes
authorHarshitha Ramamurthy <harshitha.ramamurthy@intel.com>
Tue, 8 Nov 2016 21:05:09 +0000 (13:05 -0800)
committerDhaval Giani <dhaval.giani@oracle.com>
Wed, 8 Mar 2017 00:41:24 +0000 (19:41 -0500)
Orabug: 24568124

This patch fixes the problem where the ethtool Supported link
modes list backplane interfaces on X722 devices for 10GbE with
SFP+ and Cortina retimer. This patch fixes the problem by setting
and using a flag for this particular device since the backplane
interface is only between the internal PHY and the retimer and it
should not be seen by the user as they cannot use it.
Without this patch, the user wrongly thinks that backplane interfaces
are supported on their device when they actually are not.

Change-ID: I3882bc2928431d48a2db03a51a713a1f681a79e9
Signed-off-by: Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4ad9f4f9e2873ca999135b151dbb7d80f57ea0a9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
drivers/net/ethernet/intel/i40e/i40e_main.c

index 593cb716d17600a3b395eec6f3ee912c97b5b194..b02c944ac50740d469a67e41c166441844ae11f2 100644 (file)
@@ -359,6 +359,7 @@ struct i40e_pf {
 #define I40E_FLAG_HAVE_10GBASET_PHY            BIT_ULL(48)
 #define I40E_FLAG_PF_MAC                       BIT_ULL(50)
 #define I40E_FLAG_TRUE_PROMISC_SUPPORT         BIT_ULL(51)
+#define I40E_FLAG_HAVE_CRT_RETIMER             BIT_ULL(52)
 
        /* tracks features that get auto disabled by errors */
        u64 auto_disable_flags;
index b1f95c175357484849610d7f90d3a65fd34c8083..a29e52245c8bede6435169946462c4ca33a575f0 100644 (file)
@@ -345,11 +345,13 @@ static void i40e_phy_type_to_ethtool(struct i40e_pf *pf, u32 *supported,
                        *advertising |= ADVERTISED_20000baseKR2_Full;
        }
        if (phy_types & I40E_CAP_PHY_TYPE_10GBASE_KR) {
-               *supported |= SUPPORTED_10000baseKR_Full |
-                             SUPPORTED_Autoneg;
+               if (!(pf->flags & I40E_FLAG_HAVE_CRT_RETIMER))
+                       *supported |= SUPPORTED_10000baseKR_Full |
+                                     SUPPORTED_Autoneg;
                *advertising |= ADVERTISED_Autoneg;
                if (hw_link_info->requested_speeds & I40E_LINK_SPEED_10GB)
-                       *advertising |= ADVERTISED_10000baseKR_Full;
+                       if (!(pf->flags & I40E_FLAG_HAVE_CRT_RETIMER))
+                               *advertising |= ADVERTISED_10000baseKR_Full;
        }
        if (phy_types & I40E_CAP_PHY_TYPE_10GBASE_KX4) {
                *supported |= SUPPORTED_10000baseKX4_Full |
@@ -359,11 +361,13 @@ static void i40e_phy_type_to_ethtool(struct i40e_pf *pf, u32 *supported,
                        *advertising |= ADVERTISED_10000baseKX4_Full;
        }
        if (phy_types & I40E_CAP_PHY_TYPE_1000BASE_KX) {
-               *supported |= SUPPORTED_1000baseKX_Full |
-                             SUPPORTED_Autoneg;
+               if (!(pf->flags & I40E_FLAG_HAVE_CRT_RETIMER))
+                       *supported |= SUPPORTED_1000baseKX_Full |
+                                     SUPPORTED_Autoneg;
                *advertising |= ADVERTISED_Autoneg;
                if (hw_link_info->requested_speeds & I40E_LINK_SPEED_1GB)
-                       *advertising |= ADVERTISED_1000baseKX_Full;
+                       if (!(pf->flags & I40E_FLAG_HAVE_CRT_RETIMER))
+                               *advertising |= ADVERTISED_1000baseKX_Full;
        }
 }
 
index 03fdb43e4c9761737acbe3f8756b8c81fe70478f..0bd7e243c0caf81fce5e8e857377fde95818ad27 100644 (file)
@@ -11191,7 +11191,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        if ((pf->hw.device_id == I40E_DEV_ID_10G_BASE_T) ||
            (pf->hw.device_id == I40E_DEV_ID_10G_BASE_T4))
                pf->flags |= I40E_FLAG_HAVE_10GBASET_PHY;
-
+       if (pf->hw.device_id == I40E_DEV_ID_SFP_I_X722)
+               pf->flags |= I40E_FLAG_HAVE_CRT_RETIMER;
        /* print a string summarizing features */
        i40e_print_features(pf);