Skip to content

Commit f7ebb40

Browse files
pmachatakuba-moo
authored andcommittedNov 21, 2023
mlxsw: spectrum_router: Call RIF setup before obtaining FID
For subport RIFs, the setup initializes, among other things, RIF port and LAG numbers. Those are important to determine where in the PGT the RIF FID will be stored. Therefore, call the RIF setup before fid_get. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Amit Cohen <amcohen@nvidia.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://lore.kernel.org/r/f24d8cad7e4748b8e8e0e16894ca6a20704dea32.1700503644.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 27851df commit f7ebb40

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -8419,6 +8419,9 @@ mlxsw_sp_rif_create(struct mlxsw_sp *mlxsw_sp,
84198419
rif->ops = ops;
84208420
rif->rif_entries = rif_entries;
84218421

8422+
if (ops->setup)
8423+
ops->setup(rif, params);
8424+
84228425
if (ops->fid_get) {
84238426
fid = ops->fid_get(rif, params, extack);
84248427
if (IS_ERR(fid)) {
@@ -8428,9 +8431,6 @@ mlxsw_sp_rif_create(struct mlxsw_sp *mlxsw_sp,
84288431
rif->fid = fid;
84298432
}
84308433

8431-
if (ops->setup)
8432-
ops->setup(rif, params);
8433-
84348434
err = ops->configure(rif, extack);
84358435
if (err)
84368436
goto err_configure;

0 commit comments

Comments
 (0)
Please sign in to comment.