diff options
author | Amit Cohen <amcohen@nvidia.com> | 2022-06-21 11:33:44 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-06-22 12:56:58 +0100 |
commit | 784763e59225c3baf7d97fbcda5bc7bb0dc77380 (patch) | |
tree | f8ea4c0bcbcd13aa36a19610804c995a82700130 /drivers | |
parent | 736bf371d2d460c9ded1073e8490be1d294ee177 (diff) | |
download | linux-stable-784763e59225c3baf7d97fbcda5bc7bb0dc77380.tar.gz linux-stable-784763e59225c3baf7d97fbcda5bc7bb0dc77380.tar.bz2 linux-stable-784763e59225c3baf7d97fbcda5bc7bb0dc77380.zip |
mlxsw: spectrum_fid: Use 'fid->fid_offset' when setting VNI
The previous patch added 'fid_offset' field to FID structure. Now, this
field can be used when VNI is set using SFMR register. Currently
'fid_offset' is set to zero, instead, use the new field which is now set
to zero and in the future will be changed.
Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c index df096e2c3822..fe5a60bfbf59 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c @@ -420,13 +420,13 @@ static int mlxsw_sp_fid_op(struct mlxsw_sp *mlxsw_sp, u16 fid_index, } static int mlxsw_sp_fid_vni_op(struct mlxsw_sp *mlxsw_sp, u16 fid_index, - __be32 vni, bool vni_valid, u32 nve_flood_index, - bool nve_flood_index_valid) + u16 fid_offset, __be32 vni, bool vni_valid, + u32 nve_flood_index, bool nve_flood_index_valid) { char sfmr_pl[MLXSW_REG_SFMR_LEN]; mlxsw_reg_sfmr_pack(sfmr_pl, MLXSW_REG_SFMR_OP_CREATE_FID, fid_index, - 0); + fid_offset); mlxsw_reg_sfmr_vv_set(sfmr_pl, vni_valid); mlxsw_reg_sfmr_vni_set(sfmr_pl, be32_to_cpu(vni)); mlxsw_reg_sfmr_vtfp_set(sfmr_pl, nve_flood_index_valid); @@ -613,8 +613,9 @@ static int mlxsw_sp_fid_8021d_vni_set(struct mlxsw_sp_fid *fid, __be32 vni) { struct mlxsw_sp_fid_family *fid_family = fid->fid_family; - return mlxsw_sp_fid_vni_op(fid_family->mlxsw_sp, fid->fid_index, vni, - true, fid->nve_flood_index, + return mlxsw_sp_fid_vni_op(fid_family->mlxsw_sp, fid->fid_index, + fid->fid_offset, vni, true, + fid->nve_flood_index, fid->nve_flood_index_valid); } @@ -622,8 +623,9 @@ static void mlxsw_sp_fid_8021d_vni_clear(struct mlxsw_sp_fid *fid) { struct mlxsw_sp_fid_family *fid_family = fid->fid_family; - mlxsw_sp_fid_vni_op(fid_family->mlxsw_sp, fid->fid_index, 0, false, - fid->nve_flood_index, fid->nve_flood_index_valid); + mlxsw_sp_fid_vni_op(fid_family->mlxsw_sp, fid->fid_index, + fid->fid_offset, 0, false, fid->nve_flood_index, + fid->nve_flood_index_valid); } static int mlxsw_sp_fid_8021d_nve_flood_index_set(struct mlxsw_sp_fid *fid, @@ -632,16 +634,17 @@ static int mlxsw_sp_fid_8021d_nve_flood_index_set(struct mlxsw_sp_fid *fid, struct mlxsw_sp_fid_family *fid_family = fid->fid_family; return mlxsw_sp_fid_vni_op(fid_family->mlxsw_sp, fid->fid_index, - fid->vni, fid->vni_valid, nve_flood_index, - true); + fid->fid_offset, fid->vni, fid->vni_valid, + nve_flood_index, true); } static void mlxsw_sp_fid_8021d_nve_flood_index_clear(struct mlxsw_sp_fid *fid) { struct mlxsw_sp_fid_family *fid_family = fid->fid_family; - mlxsw_sp_fid_vni_op(fid_family->mlxsw_sp, fid->fid_index, fid->vni, - fid->vni_valid, 0, false); + mlxsw_sp_fid_vni_op(fid_family->mlxsw_sp, fid->fid_index, + fid->fid_offset, fid->vni, fid->vni_valid, 0, + false); } static void |