]> git.itanic.dy.fi Git - linux-stable/commitdiff
ice: Remove unnecessary checker loop
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Thu, 25 Mar 2021 22:35:08 +0000 (15:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Mar 2022 13:15:58 +0000 (14:15 +0100)
[ Upstream commit fd3dc1655eda6173566d56eaeb54f27ab4c9e33c ]

The loop checking for PF VSI doesn't make any sense. The VSI type
backing the netdev passed to ice_set_link_ksettings will always be
of type ICE_PF_VSI. Remove it.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ice/ice_ethtool.c

index be02f8f4d854554e479c4536898ed7be41a3472a..300fd5d0ff3261c3a3b64558c9a58e1f2a8e5faa 100644 (file)
@@ -2189,8 +2189,8 @@ ice_set_link_ksettings(struct net_device *netdev,
        struct ethtool_link_ksettings safe_ks, copy_ks;
        struct ice_aqc_get_phy_caps_data *abilities;
        u8 autoneg, timeout = TEST_SET_BITS_TIMEOUT;
-       u16 adv_link_speed, curr_link_speed, idx;
        struct ice_aqc_set_phy_cfg_data config;
+       u16 adv_link_speed, curr_link_speed;
        struct ice_pf *pf = np->vsi->back;
        struct ice_port_info *p;
        u8 autoneg_changed = 0;
@@ -2205,14 +2205,6 @@ ice_set_link_ksettings(struct net_device *netdev,
        if (!p)
                return -EOPNOTSUPP;
 
-       /* Check if this is LAN VSI */
-       ice_for_each_vsi(pf, idx)
-               if (pf->vsi[idx]->type == ICE_VSI_PF) {
-                       if (np->vsi != pf->vsi[idx])
-                               return -EOPNOTSUPP;
-                       break;
-               }
-
        if (p->phy.media_type != ICE_MEDIA_BASET &&
            p->phy.media_type != ICE_MEDIA_FIBER &&
            p->phy.media_type != ICE_MEDIA_BACKPLANE &&