net/e1000: fix build of igb only
authorHarry van Haaren <harry.van.haaren@intel.com>
Mon, 21 May 2018 09:31:41 +0000 (10:31 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 22 May 2018 22:35:01 +0000 (00:35 +0200)
commit4ebbe84dae82290ed2e49e36bf894efec0dc2123
treec41171586b4975a734901a4f65d3accd50b1cd64
parent5fd4d049692b2fde8bf49c7461b18180a8fd2545
net/e1000: fix build of igb only

This commit fixes a compilation error if EM_PMD is
not defined, bug IGB_PMD is. The root cause of the
issue was that log init variables are declared as
extern in a header file, while the definition of the
variables was in e1000_ethdev.c. Hence, the definitions
were not available if the e1000 PMD is disabled.

To fix this, a new file is added e1000_logs.c, which
matches the e1000_logs.h header. The log variables are
always compiled in, but the PMD logs are only registered
if a PMD is enabled in the configuration. Extra checks
are added in order to avoid duplicate registering.

Fixes: ed5bbb767c3e ("net/e1000: implement dynamic logging")
Cc: stable@dpdk.org
Reported-by: Vipin Varghese <vipin.varghese@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Vipin Varghese <vipin.varghese@intel.com>
drivers/net/e1000/Makefile
drivers/net/e1000/e1000_logs.c [new file with mode: 0644]
drivers/net/e1000/e1000_logs.h
drivers/net/e1000/em_ethdev.c
drivers/net/e1000/igb_ethdev.c
drivers/net/e1000/meson.build