Skip to contentSkip to conversation

ice: remove eswitch rebuild

PATCH In review Michal Swiatkowski 3 participants 3 messages Jun 24, 2024 – Jul 9, 2024

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

PATCH 1/1 ice: remove eswitch rebuild

Since the port representors are added one by one there is no need to do eswitch rebuild. Each port representor is detached and attached in VF reset path.

---
 drivers/net/ethernet/intel/ice/ice_eswitch.c | 16 ----------------
 drivers/net/ethernet/intel/ice/ice_eswitch.h |  6 ------
 drivers/net/ethernet/intel/ice/ice_main.c    |  2 --
 3 files changed, 24 deletions(-)
drivers/net/ethernet/intel/ice/ice_eswitch.c +0 -16
index d8c06147d4d4..c0b3e70a7ea3 100644
@@ -607,22 +607,6 @@ void ice_eswitch_detach_sf(struct ice_pf *pf, struct ice_dynamic_port *sf)
 	ice_eswitch_detach(pf, repr);
 }
 
-/**
- * ice_eswitch_rebuild - rebuild eswitch
- * @pf: pointer to PF structure
- */
-void ice_eswitch_rebuild(struct ice_pf *pf)
-{
-	struct ice_repr *repr;
-	unsigned long id;
-
-	if (!ice_is_switchdev_running(pf))
-		return;
-
-	xa_for_each(&pf->eswitch.reprs, id, repr)
-		ice_eswitch_detach(pf, repr);
-}
-
 /**
  * ice_eswitch_get_target - get netdev based on src_vsi from descriptor
  * @rx_ring: ring used to receive the packet
drivers/net/ethernet/intel/ice/ice_eswitch.h +0 -6
index 20f301093b36..20ce32dda69c 100644
@@ -12,7 +12,6 @@ void ice_eswitch_detach_vf(struct ice_pf *pf, struct ice_vf *vf);
 void ice_eswitch_detach_sf(struct ice_pf *pf, struct ice_dynamic_port *sf);
 int ice_eswitch_attach_vf(struct ice_pf *pf, struct ice_vf *vf);
 int ice_eswitch_attach_sf(struct ice_pf *pf, struct ice_dynamic_port *sf);
-void ice_eswitch_rebuild(struct ice_pf *pf);
 
 int ice_eswitch_mode_get(struct devlink *devlink, u16 *mode);
 int
@@ -66,11 +65,6 @@ static inline int ice_eswitch_configure(struct ice_pf *pf)
 	return 0;
 }
 
-static inline int ice_eswitch_rebuild(struct ice_pf *pf)
-{
-	return -EOPNOTSUPP;
-}
-
 static inline int ice_eswitch_mode_get(struct devlink *devlink, u16 *mode)
 {
 	return DEVLINK_ESWITCH_MODE_LEGACY;
drivers/net/ethernet/intel/ice/ice_main.c +0 -2
index f38a30775a2e..14b61ed34dbe 100644
@@ -7699,8 +7699,6 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
 		goto err_vsi_rebuild;
 	}
 
-	ice_eswitch_rebuild(pf);
-
 	if (reset_type == ICE_RESET_PFR) {
 		err = ice_rebuild_channels(pf);
 		if (err) {
Signature · 1 line
2.42.0
Tested-by on v1 1/1
#2 lore raw
In reply to Michal Swiatkowski
Quoted 13 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Swiatkowski
Sent: Monday, June 24, 2024 1:35 PM
To: [email protected]
Cc: [email protected]; Drewek, Wojciech <[email protected]>
Subject: [Intel-wired-lan] [iwl-next v1] ice: remove eswitch rebuild

Since the port representors are added one by one there is no need to do eswitch rebuild. Each port representor is detached and attached in VF reset path.

Quoted 8 lines
---
 drivers/net/ethernet/intel/ice/ice_eswitch.c | 16 ----------------
drivers/net/ethernet/intel/ice/ice_eswitch.h |  6 ------
 drivers/net/ethernet/intel/ice/ice_main.c    |  2 --
 3 files changed, 24 deletions(-)