Commit 10bfec0a authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

mlxsw: spectrum: compile-in dpipe support only if devlink is enabled

Makes no sense to have dpipe compiled in when devlink is not enabled,
because the devlink dpipe registation is noop function. So don't compile
it in. This also fixes missing extern structs errors.
Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Fixes: a86f0309 ("mlxsw: spectrum_dpipe: Add support for IPv4 host table dump")
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ae0078fc
...@@ -16,8 +16,9 @@ mlxsw_spectrum-objs := spectrum.o spectrum_buffers.o \ ...@@ -16,8 +16,9 @@ mlxsw_spectrum-objs := spectrum.o spectrum_buffers.o \
spectrum_switchdev.o spectrum_router.o \ spectrum_switchdev.o spectrum_router.o \
spectrum_kvdl.o spectrum_acl_tcam.o \ spectrum_kvdl.o spectrum_acl_tcam.o \
spectrum_acl.o spectrum_flower.o \ spectrum_acl.o spectrum_flower.o \
spectrum_cnt.o spectrum_dpipe.o \ spectrum_cnt.o \
spectrum_fid.o spectrum_fid.o
mlxsw_spectrum-$(CONFIG_MLXSW_SPECTRUM_DCB) += spectrum_dcb.o mlxsw_spectrum-$(CONFIG_MLXSW_SPECTRUM_DCB) += spectrum_dcb.o
mlxsw_spectrum-$(CONFIG_NET_DEVLINK) += spectrum_dpipe.o
obj-$(CONFIG_MLXSW_MINIMAL) += mlxsw_minimal.o obj-$(CONFIG_MLXSW_MINIMAL) += mlxsw_minimal.o
mlxsw_minimal-objs := minimal.o mlxsw_minimal-objs := minimal.o
...@@ -35,9 +35,24 @@ ...@@ -35,9 +35,24 @@
#ifndef _MLXSW_PIPELINE_H_ #ifndef _MLXSW_PIPELINE_H_
#define _MLXSW_PIPELINE_H_ #define _MLXSW_PIPELINE_H_
#if IS_ENABLED(CONFIG_NET_DEVLINK)
int mlxsw_sp_dpipe_init(struct mlxsw_sp *mlxsw_sp); int mlxsw_sp_dpipe_init(struct mlxsw_sp *mlxsw_sp);
void mlxsw_sp_dpipe_fini(struct mlxsw_sp *mlxsw_sp); void mlxsw_sp_dpipe_fini(struct mlxsw_sp *mlxsw_sp);
#else
static inline int mlxsw_sp_dpipe_init(struct mlxsw_sp *mlxsw_sp)
{
return 0;
}
static inline void mlxsw_sp_dpipe_fini(struct mlxsw_sp *mlxsw_sp)
{
}
#endif
#define MLXSW_SP_DPIPE_TABLE_NAME_ERIF "mlxsw_erif" #define MLXSW_SP_DPIPE_TABLE_NAME_ERIF "mlxsw_erif"
#define MLXSW_SP_DPIPE_TABLE_NAME_HOST4 "mlxsw_host4" #define MLXSW_SP_DPIPE_TABLE_NAME_HOST4 "mlxsw_host4"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment