[v4,4/4] net/intel: allow building ice driver without iavf

Message ID 20250205115533.2746196-5-bruce.richardson@intel.com (mailing list archive)
State Superseded
Delegated to: Bruce Richardson
Headers
Series remove common iavf and idpf drivers |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Bruce Richardson Feb. 5, 2025, 11:55 a.m. UTC
The ice PMD relies on a number of functions from the iavf base code,
which can be got by linking against that iavf driver. However, since
only three C files are necessary here, we can allow ice to be built
independently of iavf by including the base files directly in cases
where iavf is not part of the build. If it is part of the build, the
dependency remains as now.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/iavf/base/iavf_prototype.h |  8 ++++++++
 drivers/net/intel/ice/meson.build            | 13 ++++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/intel/iavf/base/iavf_prototype.h b/drivers/net/intel/iavf/base/iavf_prototype.h
index 7c43a817bb..5d2ee0a785 100644
--- a/drivers/net/intel/iavf/base/iavf_prototype.h
+++ b/drivers/net/intel/iavf/base/iavf_prototype.h
@@ -11,6 +11,14 @@ 
 
 #include <rte_compat.h>
 
+/* functions only need exporting if this is being built into
+ * iavf driver itself. If included in ice driver, then no export
+ */
+#ifndef RTE_NET_IAVF
+#undef __rte_internal
+#define __rte_internal
+#endif
+
 /* Prototypes for shared code functions that are not in
  * the standard function pointer structures.  These are
  * mostly because they are needed even before the init
diff --git a/drivers/net/intel/ice/meson.build b/drivers/net/intel/ice/meson.build
index 5faf887386..ff7f84597a 100644
--- a/drivers/net/intel/ice/meson.build
+++ b/drivers/net/intel/ice/meson.build
@@ -18,9 +18,20 @@  sources = files(
 
 testpmd_sources = files('ice_testpmd.c')
 
-deps += ['hash', 'net', 'net_iavf']
+deps += ['hash', 'net']
 includes += include_directories('base')
 
+if dpdk_conf.has('RTE_NET_IAVF')
+    deps += 'net_iavf'
+else
+    includes += include_directories('../iavf/base')
+    sources += files(
+            '../iavf/base/iavf_adminq.c',
+            '../iavf/base/iavf_common.c',
+            '../iavf/base/iavf_impl.c',
+    )
+endif
+
 if arch_subdir == 'x86'
     sources += files('ice_rxtx_vec_sse.c')