Commit f71be9d0 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by David S. Miller
Browse files

net: liquidio: fix mixed module-builtin object



With CONFIG_LIQUIDIO=m and CONFIG_LIQUIDIO_VF=y (or vice versa),
$(common-objs) are linked to a module and also to vmlinux even though
the expected CFLAGS are different between builtins and modules.

This is the same situation as fixed by commit 637a642f ("zstd:
Fixing mixed module-builtin objects").

Introduce the new module, liquidio-core, to provide the common functions
to liquidio and liquidio-vf.

Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0824a987
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -62,6 +62,9 @@ config CAVIUM_PTP
	  Precision Time Protocol or other purposes.  Timestamps can be used in
	  BGX, TNS, GTI, and NIC blocks.

config LIQUIDIO_CORE
	tristate

config LIQUIDIO
	tristate "Cavium LiquidIO support"
	depends on 64BIT && PCI
@@ -69,6 +72,7 @@ config LIQUIDIO
	depends on PTP_1588_CLOCK_OPTIONAL
	select FW_LOADER
	select LIBCRC32C
	select LIQUIDIO_CORE
	select NET_DEVLINK
	help
	  This driver supports Cavium LiquidIO Intelligent Server Adapters
@@ -92,6 +96,7 @@ config LIQUIDIO_VF
	tristate "Cavium LiquidIO VF support"
	depends on 64BIT && PCI_MSI
	depends on PTP_1588_CLOCK_OPTIONAL
	select LIQUIDIO_CORE
	help
	  This driver supports Cavium LiquidIO Intelligent Server Adapter
	  based on CN23XX chips.
+5 −3
Original line number Diff line number Diff line
@@ -3,7 +3,9 @@
# Cavium Liquidio ethernet device driver
#

common-objs :=	lio_ethtool.o		\
obj-$(CONFIG_LIQUIDIO_CORE) += liquidio-core.o
liquidio-core-y := \
		lio_ethtool.o		\
		lio_core.o		\
		request_manager.o	\
		response_manager.o	\
@@ -18,7 +20,7 @@ common-objs := lio_ethtool.o \
		octeon_nic.o

obj-$(CONFIG_LIQUIDIO) += liquidio.o
liquidio-y := lio_main.o octeon_console.o lio_vf_rep.o $(common-objs)
liquidio-y := lio_main.o octeon_console.o lio_vf_rep.o

obj-$(CONFIG_LIQUIDIO_VF) += liquidio_vf.o
liquidio_vf-y := lio_vf_main.o $(common-objs)
liquidio_vf-y := lio_vf_main.o
+4 −0
Original line number Diff line number Diff line
@@ -1375,6 +1375,7 @@ int setup_cn23xx_octeon_pf_device(struct octeon_device *oct)

	return 0;
}
EXPORT_SYMBOL_GPL(setup_cn23xx_octeon_pf_device);

int validate_cn23xx_pf_config_info(struct octeon_device *oct,
				   struct octeon_config *conf23xx)
@@ -1433,6 +1434,7 @@ int cn23xx_fw_loaded(struct octeon_device *oct)
	val = octeon_read_csr64(oct, CN23XX_SLI_SCRATCH2);
	return (val >> SCR2_BIT_FW_LOADED) & 1ULL;
}
EXPORT_SYMBOL_GPL(cn23xx_fw_loaded);

void cn23xx_tell_vf_its_macaddr_changed(struct octeon_device *oct, int vfidx,
					u8 *mac)
@@ -1454,6 +1456,7 @@ void cn23xx_tell_vf_its_macaddr_changed(struct octeon_device *oct, int vfidx,
		octeon_mbox_write(oct, &mbox_cmd);
	}
}
EXPORT_SYMBOL_GPL(cn23xx_tell_vf_its_macaddr_changed);

static void
cn23xx_get_vf_stats_callback(struct octeon_device *oct,
@@ -1508,3 +1511,4 @@ int cn23xx_get_vf_stats(struct octeon_device *oct, int vfidx,

	return 0;
}
EXPORT_SYMBOL_GPL(cn23xx_get_vf_stats);
+3 −0
Original line number Diff line number Diff line
@@ -384,6 +384,7 @@ void cn23xx_vf_ask_pf_to_do_flr(struct octeon_device *oct)

	octeon_mbox_write(oct, &mbox_cmd);
}
EXPORT_SYMBOL_GPL(cn23xx_vf_ask_pf_to_do_flr);

static void octeon_pfvf_hs_callback(struct octeon_device *oct,
				    struct octeon_mbox_cmd *cmd,
@@ -466,6 +467,7 @@ int cn23xx_octeon_pfvf_handshake(struct octeon_device *oct)

	return 0;
}
EXPORT_SYMBOL_GPL(cn23xx_octeon_pfvf_handshake);

static void cn23xx_handle_vf_mbox_intr(struct octeon_ioq_vector *ioq_vector)
{
@@ -678,3 +680,4 @@ int cn23xx_setup_octeon_vf_device(struct octeon_device *oct)

	return 0;
}
EXPORT_SYMBOL_GPL(cn23xx_setup_octeon_vf_device);
+1 −0
Original line number Diff line number Diff line
@@ -697,6 +697,7 @@ int lio_setup_cn66xx_octeon_device(struct octeon_device *oct)

	return 0;
}
EXPORT_SYMBOL_GPL(lio_setup_cn66xx_octeon_device);

int lio_validate_cn6xxx_config_info(struct octeon_device *oct,
				    struct octeon_config *conf6xxx)
Loading