net/mlx5: SF, Reuse stored hardware function id
SF's hardware function id is already stored in mlx5_sf. Reuse it, instead of querying the hw table. Signed-off-by: Parav Pandit <parav@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
parent
6e74e6ea1b
commit
a74ed24c43
@ -270,15 +270,14 @@ static int mlx5_sf_add(struct mlx5_core_dev *dev, struct mlx5_sf_table *table,
|
|||||||
{
|
{
|
||||||
struct mlx5_eswitch *esw = dev->priv.eswitch;
|
struct mlx5_eswitch *esw = dev->priv.eswitch;
|
||||||
struct mlx5_sf *sf;
|
struct mlx5_sf *sf;
|
||||||
u16 hw_fn_id;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
sf = mlx5_sf_alloc(table, new_attr->sfnum, extack);
|
sf = mlx5_sf_alloc(table, new_attr->sfnum, extack);
|
||||||
if (IS_ERR(sf))
|
if (IS_ERR(sf))
|
||||||
return PTR_ERR(sf);
|
return PTR_ERR(sf);
|
||||||
|
|
||||||
hw_fn_id = mlx5_sf_sw_to_hw_id(dev, sf->id);
|
err = mlx5_esw_offloads_sf_vport_enable(esw, &sf->dl_port, sf->hw_fn_id,
|
||||||
err = mlx5_esw_offloads_sf_vport_enable(esw, &sf->dl_port, hw_fn_id, new_attr->sfnum);
|
new_attr->sfnum);
|
||||||
if (err)
|
if (err)
|
||||||
goto esw_err;
|
goto esw_err;
|
||||||
*new_port_index = sf->port_index;
|
*new_port_index = sf->port_index;
|
||||||
|
Loading…
Reference in New Issue
Block a user