#include <net/arp.h>
#include <net/ip_fib.h>
#include <net/fib_rules.h>
+#include <net/l3mdev.h>
#include "spectrum.h"
#include "core.h"
struct net_device *l3_dev)
{
struct mlxsw_sp *mlxsw_sp = mlxsw_sp_vport->mlxsw_sp;
+ u32 tb_id = l3mdev_fib_table(l3_dev);
struct mlxsw_sp_vr *vr;
struct mlxsw_sp_fid *f;
struct mlxsw_sp_rif *r;
if (rif == MLXSW_SP_INVALID_RIF)
return ERR_PTR(-ERANGE);
- vr = mlxsw_sp_vr_get(mlxsw_sp, RT_TABLE_MAIN);
+ vr = mlxsw_sp_vr_get(mlxsw_sp, tb_id ? : RT_TABLE_MAIN);
if (IS_ERR(vr))
return ERR_CAST(vr);
struct net_device *l3_dev,
struct mlxsw_sp_fid *f)
{
+ u32 tb_id = l3mdev_fib_table(l3_dev);
struct mlxsw_sp_vr *vr;
struct mlxsw_sp_rif *r;
u16 rif;
if (rif == MLXSW_SP_INVALID_RIF)
return -ERANGE;
- vr = mlxsw_sp_vr_get(mlxsw_sp, RT_TABLE_MAIN);
+ vr = mlxsw_sp_vr_get(mlxsw_sp, tb_id ? : RT_TABLE_MAIN);
if (IS_ERR(vr))
return PTR_ERR(vr);