summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2017-08-26 08:35:38 +0200
committerDavid S. Miller <davem@davemloft.net>2017-08-28 15:41:15 -0700
commit10bfec0a2b4b9d3b81e09b43266ebe370bb17760 (patch)
tree51a4d6c984a060062807d3994b6579bb16a6cf11 /drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.h
parentae0078fcf0a5eb3a8623bfb5f988262e0911fdb9 (diff)
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: kbuild test robot <fengguang.wu@intel.com> Fixes: a86f030915f2 ("mlxsw: spectrum_dpipe: Add support for IPv4 host table dump") Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.h
index 7785f9e26a18..c56a3d92a2bb 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.h
@@ -35,9 +35,24 @@
#ifndef _MLXSW_PIPELINE_H_
#define _MLXSW_PIPELINE_H_
+#if IS_ENABLED(CONFIG_NET_DEVLINK)
+
int mlxsw_sp_dpipe_init(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_HOST4 "mlxsw_host4"