OpenCloudOS-Kernel/drivers/infiniband/hw
Arnd Bergmann 3d1cbe839a net: mellanox: add DEVLINK dependencies
The new NET_DEVLINK infrastructure can be a loadable module, but the drivers
using it might be built-in, which causes link errors like:

drivers/net/built-in.o: In function `mlx4_load_one':
:(.text+0x2fbfda): undefined reference to `devlink_port_register'
:(.text+0x2fc084): undefined reference to `devlink_port_unregister'
drivers/net/built-in.o: In function `mlxsw_sx_port_remove':
:(.text+0x33a03a): undefined reference to `devlink_port_type_clear'
:(.text+0x33a04e): undefined reference to `devlink_port_unregister'

There are multiple ways to avoid this:

a) add 'depends on NET_DEVLINK || !NET_DEVLINK' dependencies
   for each user
b) use 'select NET_DEVLINK' from each driver that uses it
   and hide the symbol in Kconfig.
c) make NET_DEVLINK a 'bool' option so we don't have to
   list it as a dependency, and rely on the APIs to be
   stubbed out when it is disabled
d) use IS_REACHABLE() rather than IS_ENABLED() to check for
   NET_DEVLINK in include/net/devlink.h

This implements a variation of approach a) by adding an
intermediate symbol that drivers can depend on, and changes
the three drivers using it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 09d4d087cd ("mlx4: Implement devlink interface")
Fixes: c4745500e9 ("mlxsw: Implement devlink interface")
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-03 17:08:59 -05:00
..
cxgb3 iw_cxgb3: Fix incorrectly returning error on success 2015-12-24 00:17:30 -05:00
cxgb4 cxgb4/iw_cxgb4: TOS support 2016-02-11 07:13:23 -05:00
mlx4 net: mellanox: add DEVLINK dependencies 2016-03-03 17:08:59 -05:00
mlx5 net/mlx5: Introduce a new header file for physical port functions 2016-02-24 13:50:20 -05:00
mthca IB: remove in-kernel support for memory windows 2015-12-23 14:29:04 -05:00
nes RDMA/nes: Replace LRO with GRO 2016-02-17 16:15:45 -05:00
ocrdma RDMA/ocrdma: Fix arm logic to align with new cq API 2016-02-17 10:07:20 -05:00
qib Initial roundup of 4.5 merge window patches 2016-01-23 18:45:06 -08:00
usnic net: usnic: use __ethtool_get_ksettings 2016-02-25 22:06:45 -05:00
Makefile IB/ehca: Deprecate driver, move to staging, schedule deletion 2015-09-11 18:13:35 -04:00