]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ice: do not configure destination override for switchdev
authorLarysa Zaremba <larysa.zaremba@intel.com>
Mon, 9 Dec 2024 14:08:53 +0000 (15:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Mar 2025 19:54:10 +0000 (12:54 -0700)
[ Upstream commit 3be83ee9de0298f8321aa0b148d8f9995102e40f ]

After switchdev is enabled and disabled later, LLDP packets sending stops,
despite working perfectly fine before and during switchdev state.
To reproduce (creating/destroying VF is what triggers the reconfiguration):

devlink dev eswitch set pci/<address> mode switchdev
echo '2' > /sys/class/net/<ifname>/device/sriov_numvfs
echo '0' > /sys/class/net/<ifname>/device/sriov_numvfs

This happens because LLDP relies on the destination override functionality.
It needs to 1) set a flag in the descriptor, 2) set the VSI permission to
make it valid. The permissions are set when the PF VSI is first configured,
but switchdev then enables it for the uplink VSI (which is always the PF)
once more when configured and disables when deconfigured, which leads to
software-generated LLDP packets being blocked.

Do not modify the destination override permissions when configuring
switchdev, as the enabled state is the default configuration that is never
modified.

Fixes: 1a1c40df2e80 ("ice: set and release switchdev environment")
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@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_eswitch.c
drivers/net/ethernet/intel/ice/ice_lib.c
drivers/net/ethernet/intel/ice/ice_lib.h

index d649c197cf673f7256428a3ae773dd932cca3020..ed21d7f55ac11b9fd573d02fb5ae95167eaf734d 100644 (file)
@@ -49,9 +49,6 @@ static int ice_eswitch_setup_env(struct ice_pf *pf)
        if (vlan_ops->dis_rx_filtering(uplink_vsi))
                goto err_vlan_filtering;
 
-       if (ice_vsi_update_security(uplink_vsi, ice_vsi_ctx_set_allow_override))
-               goto err_override_uplink;
-
        if (ice_vsi_update_local_lb(uplink_vsi, true))
                goto err_override_local_lb;
 
@@ -63,8 +60,6 @@ static int ice_eswitch_setup_env(struct ice_pf *pf)
 err_up:
        ice_vsi_update_local_lb(uplink_vsi, false);
 err_override_local_lb:
-       ice_vsi_update_security(uplink_vsi, ice_vsi_ctx_clear_allow_override);
-err_override_uplink:
        vlan_ops->ena_rx_filtering(uplink_vsi);
 err_vlan_filtering:
        ice_cfg_dflt_vsi(uplink_vsi->port_info, uplink_vsi->idx, false,
@@ -275,7 +270,6 @@ static void ice_eswitch_release_env(struct ice_pf *pf)
        vlan_ops = ice_get_compat_vsi_vlan_ops(uplink_vsi);
 
        ice_vsi_update_local_lb(uplink_vsi, false);
-       ice_vsi_update_security(uplink_vsi, ice_vsi_ctx_clear_allow_override);
        vlan_ops->ena_rx_filtering(uplink_vsi);
        ice_cfg_dflt_vsi(uplink_vsi->port_info, uplink_vsi->idx, false,
                         ICE_FLTR_TX);
index d4e74f96a8ad5d6942489c88eee617f90aa9a807..121a5ad5c8e10bd938bb29ea9a98e98f5b78fe9c 100644 (file)
@@ -3928,24 +3928,6 @@ void ice_vsi_ctx_clear_antispoof(struct ice_vsi_ctx *ctx)
                                 ICE_AQ_VSI_SEC_TX_PRUNE_ENA_S);
 }
 
-/**
- * ice_vsi_ctx_set_allow_override - allow destination override on VSI
- * @ctx: pointer to VSI ctx structure
- */
-void ice_vsi_ctx_set_allow_override(struct ice_vsi_ctx *ctx)
-{
-       ctx->info.sec_flags |= ICE_AQ_VSI_SEC_FLAG_ALLOW_DEST_OVRD;
-}
-
-/**
- * ice_vsi_ctx_clear_allow_override - turn off destination override on VSI
- * @ctx: pointer to VSI ctx structure
- */
-void ice_vsi_ctx_clear_allow_override(struct ice_vsi_ctx *ctx)
-{
-       ctx->info.sec_flags &= ~ICE_AQ_VSI_SEC_FLAG_ALLOW_DEST_OVRD;
-}
-
 /**
  * ice_vsi_update_local_lb - update sw block in VSI with local loopback bit
  * @vsi: pointer to VSI structure
index 1a6cfc8693ce47046125ba2932c64a151e056c8c..2b27998fd1be36f7b8be35439e7cec751e659957 100644 (file)
@@ -106,10 +106,6 @@ ice_vsi_update_security(struct ice_vsi *vsi, void (*fill)(struct ice_vsi_ctx *))
 void ice_vsi_ctx_set_antispoof(struct ice_vsi_ctx *ctx);
 
 void ice_vsi_ctx_clear_antispoof(struct ice_vsi_ctx *ctx);
-
-void ice_vsi_ctx_set_allow_override(struct ice_vsi_ctx *ctx);
-
-void ice_vsi_ctx_clear_allow_override(struct ice_vsi_ctx *ctx);
 int ice_vsi_update_local_lb(struct ice_vsi *vsi, bool set);
 int ice_vsi_add_vlan_zero(struct ice_vsi *vsi);
 int ice_vsi_del_vlan_zero(struct ice_vsi *vsi);