[Intel-wired-lan] [PATCH 2/2] ice: remove redundant switchdev check in ice_eswitch_attach_vf()

Loktionov, Aleksandr aleksandr.loktionov at intel.com
Wed Apr 29 09:18:05 UTC 2026



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf
> Of Vincent Chen via Intel-wired-lan
> Sent: Wednesday, April 29, 2026 8:51 AM
> To: Nguyen, Anthony L <anthony.l.nguyen at intel.com>; Kitszel,
> Przemyslaw <przemyslaw.kitszel at intel.com>
> Cc: andrew+netdev at lunn.ch; davem at davemloft.net; edumazet at google.com;
> kuba at kernel.org; pabeni at redhat.com; intel-wired-lan at lists.osuosl.org;
> netdev at vger.kernel.org; vincent.chen at sifive.com
> Subject: [Intel-wired-lan] [PATCH 2/2] ice: remove redundant switchdev
> check in ice_eswitch_attach_vf()
> 
> All callers of ice_eswitch_attach_vf() check the switchdev mode before
> calling the function, the internal switchdev mode check in
> ice_eswitch_attach_vf() is redundant. Remove this check to align with
> the design pattern used for ice_eswitch_attach_sf(), where the caller
> is responsible for checking switchdev mode before attachment.
> 
> Signed-off-by: Vincent Chen <vincent.chen at sifive.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_eswitch.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.c
> b/drivers/net/ethernet/intel/ice/ice_eswitch.c
> index 2e4f0969035f..c709decb26d5 100644
> --- a/drivers/net/ethernet/intel/ice/ice_eswitch.c
> +++ b/drivers/net/ethernet/intel/ice/ice_eswitch.c
> @@ -512,9 +512,6 @@ int ice_eswitch_attach_vf(struct ice_pf *pf,
> struct ice_vf *vf)
>  	struct ice_repr *repr;
>  	int err;
> 
> -	if (!ice_is_eswitch_mode_switchdev(pf))
> -		return 0;
> -
>  	repr = ice_repr_create_vf(vf);
>  	if (IS_ERR(repr))
>  		return PTR_ERR(repr);
> --
> 2.34.1

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov at intel.com>



More information about the Intel-wired-lan mailing list