Skip to contentSkip to conversation

ice: call netif_keep_dst() once when entering switchdev mode

PATCH In review Aleksandr Loktionov 3 participants 3 messages Apr 8 – Apr 14

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ice: call netif_keep_dst() once when entering switchdev mode

From: Marcin Szycik <[email protected]>

netif_keep_dst() only needs to be called once for the uplink VSI, not once for each port representor. Move it from ice_eswitch_setup_repr() to ice_eswitch_enable_switchdev().

Fixes defd52455aee ("ice: do Tx through PF netdev in slow-path")

---
v1 -> v2:
- Verified Fixes: tag via bisect - defd52455aee introduced the redundant per-repr call to netif_keep_dst(uplink_vsi->netdev) by changing the target netdev to the uplink VSI inside the per-representor setup function. Before that commit, each call was on a distinct repr->netdev so no Fixes: predating it applies.

 drivers/net/ethernet/intel/ice/ice_eswitch.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ice/ice_eswitch.c +2 -2
index 2e4f096..c30e27b 100644
@@ -117,8 +117,6 @@ static int ice_eswitch_setup_repr(struct ice_pf *pf, struct ice_repr *repr)
 	if (!repr->dst)
 		return -ENOMEM;
 
-	netif_keep_dst(uplink_vsi->netdev);
-
 	dst = repr->dst;
 	dst->u.port_info.port_id = vsi->vsi_num;
 	dst->u.port_info.lower_dev = uplink_vsi->netdev;
@@ -312,6 +310,8 @@ static int ice_eswitch_enable_switchdev(struct ice_pf *pf)
 	if (ice_eswitch_br_offloads_init(pf))
 		goto err_br_offloads;
 
+	netif_keep_dst(uplink_vsi->netdev);
+
 	pf->eswitch.is_running = true;
 
 	return 0;
Signature · 1 line
2.52.0
Reviewed-by on v2 1/1
#1 lore raw

Dear Aleksandr, dear Marcin,

Thank you for the patch.

Am 08.04.26 um 16:14 schrieb Aleksandr Loktionov:

Quoted 5 lines

From: Marcin Szycik <[email protected]>

netif_keep_dst() only needs to be called once for the uplink VSI, not once for each port representor. Move it from ice_eswitch_setup_repr() to ice_eswitch_enable_switchdev().

It’d be great, if you could share the commands, how to verify your change.

Quoted 28 lines
Fixes defd52455aee ("ice: do Tx through PF netdev in slow-path")

---
v1 -> v2:
- Verified Fixes: tag via bisect - defd52455aee introduced the redundant per-repr call to netif_keep_dst(uplink_vsi->netdev) by changing the target netdev to the uplink VSI inside the per-representor setup function. Before that commit, each call was on a distinct repr->netdev so no Fixes: predating it applies.

  drivers/net/ethernet/intel/ice/ice_eswitch.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ice/ice_eswitch.c +0 -2
index 2e4f096..c30e27b 100644
@@ -117,8 +117,6 @@ static int ice_eswitch_setup_repr(struct ice_pf *pf, struct ice_repr *repr)
  	if (!repr->dst)
  		return -ENOMEM;
 
-	netif_keep_dst(uplink_vsi->netdev);
-
  	dst = repr->dst;
  	dst->u.port_info.port_id = vsi->vsi_num;
  	dst->u.port_info.lower_dev = uplink_vsi->netdev;

drivers/net/ethernet/intel/ice/ice_eswitch.c static int ice_eswitch_enable_switchdev(struct ice_pf *pf) · line 317

Quoted 8 lines
drivers/net/ethernet/intel/ice/ice_eswitch.c +2 -0
@@ -312,6 +310,8 @@ static int ice_eswitch_enable_switchdev(struct ice_pf *pf)
  	if (ice_eswitch_br_offloads_init(pf))
  		goto err_br_offloads;
 
+	netif_keep_dst(uplink_vsi->netdev);
+
  	pf->eswitch.is_running = true;
 
  	return 0;

Kind regards,

Paul

Tested-by
#2 lore raw
Quoted 62 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Paul Menzel
Sent: Wednesday, April 8, 2026 4:28 PM
To: Loktionov, Aleksandr <[email protected]>
Cc: [email protected]; Nguyen, Anthony L <[email protected]>; [email protected]; Szycik, Marcin <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v2] ice: call netif_keep_dst() once when entering switchdev mode

Dear Aleksandr, dear Marcin,

Thank you for the patch.

Am 08.04.26 um 16:14 schrieb Aleksandr Loktionov:

Quoted 5 lines

From: Marcin Szycik <[email protected]>

netif_keep_dst() only needs to be called once for the uplink VSI, not once for each port representor. Move it from ice_eswitch_setup_repr() to ice_eswitch_enable_switchdev().

It’d be great, if you could share the commands, how to verify your change.

drivers/net/ethernet/intel/ice/ice_eswitch.c static int ice_eswitch_setup_repr(struct ice_pf

Quoted 20 lines
Fixes defd52455aee ("ice: do Tx through PF netdev in slow-path")

---
v1 -> v2:
- Verified Fixes: tag via bisect - defd52455aee introduced the redundant per-repr call to netif_keep_dst(uplink_vsi->netdev) by changing the target netdev to the uplink VSI inside the per-representor setup function. Before that commit, each call was on a distinct repr->netdev so no Fixes: predating it applies.

  drivers/net/ethernet/intel/ice/ice_eswitch.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ice/ice_eswitch.c +0 -0
index 2e4f096..c30e27b 100644
@@ -117,8 +117,6 @@ static int ice_eswitch_setup_repr(struct ice_pf

*pf, struct ice_repr *repr)

Quoted 16 lines
drivers/net/ethernet/intel/ice/ice_eswitch.c +0 -2
  	if (!repr->dst)
  		return -ENOMEM;
 
-	netif_keep_dst(uplink_vsi->netdev);
-
  	dst = repr->dst;
  	dst->u.port_info.port_id = vsi->vsi_num;
  	dst->u.port_info.lower_dev = uplink_vsi->netdev; @@ -312,6 +310,8

@@ static int ice_eswitch_enable_switchdev(struct ice_pf *pf)
if (ice_eswitch_br_offloads_init(pf))
goto err_br_offloads;

drivers/net/ethernet/intel/ice/ice_eswitch.c +2 -0
+	netif_keep_dst(uplink_vsi->netdev);
+
  	pf->eswitch.is_running = true;
Quoted 8 lines
Quoted 1 line

return 0;

Kind regards,

Paul