Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mlxsw: spectrum_router: Add mlxsw_sp_rif_fid()

In order to allow querying of the VID for which a RIF was created, add
a new function that returns a FID for a given RIF.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Petr Machata and committed by
David S. Miller
a28b1ebe 0c41292b

+6
+5
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
··· 6122 6122 return rif->dev; 6123 6123 } 6124 6124 6125 + struct mlxsw_sp_fid *mlxsw_sp_rif_fid(const struct mlxsw_sp_rif *rif) 6126 + { 6127 + return rif->fid; 6128 + } 6129 + 6125 6130 static struct mlxsw_sp_rif * 6126 6131 mlxsw_sp_rif_create(struct mlxsw_sp *mlxsw_sp, 6127 6132 const struct mlxsw_sp_rif_params *params,
+1
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h
··· 77 77 int mlxsw_sp_rif_dev_ifindex(const struct mlxsw_sp_rif *rif); 78 78 u8 mlxsw_sp_router_port(const struct mlxsw_sp *mlxsw_sp); 79 79 const struct net_device *mlxsw_sp_rif_dev(const struct mlxsw_sp_rif *rif); 80 + struct mlxsw_sp_fid *mlxsw_sp_rif_fid(const struct mlxsw_sp_rif *rif); 80 81 int mlxsw_sp_rif_counter_value_get(struct mlxsw_sp *mlxsw_sp, 81 82 struct mlxsw_sp_rif *rif, 82 83 enum mlxsw_sp_rif_counter_dir dir,