aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_repr.c
diff options
context:
space:
mode:
authorMichal Swiatkowski <[email protected]>2024-08-20 06:57:58 +0000
committerTony Nguyen <[email protected]>2024-09-06 18:01:24 +0000
commit7cde47431df52c73ce51287ccacdc572bb3ddd0a (patch)
treec4335c9c3090f422dbcb0f1093d716551756087e /drivers/net/ethernet/intel/ice/ice_repr.c
parentice: implement netdevice ops for SF representor (diff)
downloadkernel-7cde47431df52c73ce51287ccacdc572bb3ddd0a.tar.gz
kernel-7cde47431df52c73ce51287ccacdc572bb3ddd0a.zip
ice: support subfunction devlink Tx topology
Flow for creating Tx topology is the same as for VF port representors, but the devlink port is stored in different place (sf->devlink_port). When creating VF devlink lock isn't taken, when creating subfunction it is. Setting Tx topology function needs to take this lock, check if it was taken before to not do it twice. Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Signed-off-by: Michal Swiatkowski <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_repr.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_repr.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c
index 78abfdf5d47b..00d4a9125dfa 100644
--- a/drivers/net/ethernet/intel/ice/ice_repr.c
+++ b/drivers/net/ethernet/intel/ice/ice_repr.c
@@ -347,16 +347,13 @@ static void ice_repr_rem_sf(struct ice_repr *repr)
ice_devlink_destroy_sf_port(repr->sf);
}
-static void ice_repr_set_tx_topology(struct ice_pf *pf)
+static void ice_repr_set_tx_topology(struct ice_pf *pf, struct devlink *devlink)
{
- struct devlink *devlink;
-
/* only export if ADQ and DCB disabled and eswitch enabled*/
if (ice_is_adq_active(pf) || ice_is_dcb_active(pf) ||
!ice_is_switchdev_running(pf))
return;
- devlink = priv_to_devlink(pf);
ice_devlink_rate_init_tx_topology(devlink, ice_get_main_vsi(pf));
}
@@ -408,6 +405,7 @@ err_alloc:
static int ice_repr_add_vf(struct ice_repr *repr)
{
struct ice_vf *vf = repr->vf;
+ struct devlink *devlink;
int err;
err = ice_devlink_create_vf_port(vf);
@@ -424,7 +422,9 @@ static int ice_repr_add_vf(struct ice_repr *repr)
goto err_cfg_vsi;
ice_virtchnl_set_repr_ops(vf);
- ice_repr_set_tx_topology(vf->pf);
+
+ devlink = priv_to_devlink(vf->pf);
+ ice_repr_set_tx_topology(vf->pf, devlink);
return 0;
@@ -480,6 +480,8 @@ static int ice_repr_add_sf(struct ice_repr *repr)
if (err)
goto err_netdev;
+ ice_repr_set_tx_topology(sf->vsi->back, priv_to_devlink(sf->vsi->back));
+
return 0;
err_netdev: