Skip to contentSkip to conversation

Extend optional libraries list

PATCH Superseded David Marchand 7 participants 70 messages Nov 10, 2021 – Jul 17, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Extend optional libraries list

This series extends the optional libraries list adding to them testpmd non essential dependencies.

We were not testing the disable_libs option, so let's add a minimum target in the the public CI script (mainly for GHA) and in test-meson-builds.sh script.

The last patch is an idea for enhancing the optional libraries selection.

Signature · 30 lines
David Marchand

David Marchand (5):
  ci: test build with minimum configuration
  build: make GRO/GSO optional
  build: make metrics libraries optional
  build: make pdump optional
  build: select optional libraries

 .ci/linux-build.sh             |  3 +++
 .github/workflows/build.yml    |  5 +++++
 app/meson.build                | 18 ++++++++++-----
 app/proc-info/main.c           | 16 +++++++++++++
 app/proc-info/meson.build      |  5 ++++-
 app/test-pmd/cmdline.c         | 14 ++++++++++++
 app/test-pmd/config.c          |  6 +++++
 app/test-pmd/csumonly.c        | 35 ++++++++++++++++++++++++-----
 app/test-pmd/meson.build       | 11 ++++++++-
 app/test-pmd/testpmd.c         | 18 +++++++++++++++
 app/test-pmd/testpmd.h         | 18 +++++++++++++++
 app/test/meson.build           | 34 ++++++++++++++++------------
 buildtools/chkincs/meson.build |  2 +-
 devtools/test-meson-builds.sh  |  4 +++-
 lib/meson.build                | 41 +++++++++++++++++++++-------------
 meson.build                    |  3 ++-
 meson_options.txt              |  2 ++
 17 files changed, 189 insertions(+), 46 deletions(-)

-- 
2.23.0
#1 lore raw

PATCH 1/5 ci: test build with minimum configuration

Disabling optional libraries was not tested.
Add a new target in test-meson-builds.sh and GHA.

The Bluefield target is removed from test-meson-builds.sh to save space and compilation time in exchange of the new target.

---
 .ci/linux-build.sh            | 3 +++
 .github/workflows/build.yml   | 5 +++++
 devtools/test-meson-builds.sh | 4 +++-
 3 files changed, 11 insertions(+), 1 deletion(-)
.ci/linux-build.sh +3 -0
index ef0bd099be..e7ed648099 100755
@@ -87,6 +87,9 @@ OPTS="$OPTS -Dplatform=generic"
 OPTS="$OPTS --default-library=$DEF_LIB"
 OPTS="$OPTS --buildtype=debugoptimized"
 OPTS="$OPTS -Dcheck_includes=true"
+if [ "$NO_OPTIONAL_LIBS" = "true" ]; then
+    OPTS="$OPTS -Ddisable_libs=*"
+fi
 meson build --werror $OPTS
 ninja -C build
 
.github/workflows/build.yml +5 -0
index 4151cafee7..346cc75c20 100644
@@ -21,6 +21,7 @@ jobs:
       CC: ccache ${{ matrix.config.compiler }}
       DEF_LIB: ${{ matrix.config.library }}
       LIBABIGAIL_VERSION: libabigail-1.8
+      NO_OPTIONAL_LIBS: ${{ matrix.config.no_optional_libs != '' }}
       PPC64LE: ${{ matrix.config.cross == 'ppc64le' }}
       REF_GIT_TAG: none
       RUN_TESTS: ${{ contains(matrix.config.checks, 'tests') }}
@@ -32,6 +33,10 @@ jobs:
           - os: ubuntu-18.04
             compiler: gcc
             library: static
+          - os: ubuntu-18.04
+            compiler: gcc
+            library: shared
+            no_optional_libs: no-optional-libs
           - os: ubuntu-18.04
             compiler: gcc
             library: shared
devtools/test-meson-builds.sh +3 -1
index 9ec8e2bc7e..36ecf63ec6 100755
@@ -220,6 +220,8 @@ for c in gcc clang ; do
 	done
 done
 
+build build-x86-no-optional-libs cc skipABI $use_shared -Ddisable_libs=*
+
 # test compilation with minimal x86 instruction set
 # Set the install path for libraries to "lib" explicitly to prevent problems
 # with pkg-config prefixes if installed in "lib/x86_64-linux-gnu" later.
@@ -258,7 +260,7 @@ export CC="clang"
 build build-arm64-host-clang $f ABI $use_shared
 unset CC
 # some gcc/arm configurations
-for f in $srcdir/config/arm/arm64_[bdo]*gcc ; do
+for f in $srcdir/config/arm/arm64_[do]*gcc ; do
 	export CC="$CCACHE gcc"
 	targetdir=build-$(basename $f | tr '_' '-' | cut -d'-' -f-2)
 	build $targetdir $f skipABI $use_shared
Signature · 1 line
2.23.0
#2 lore raw

Re: [PATCH 1/5] ci: test build with minimum configuration

10/11/2021 17:48, David Marchand:

Quoted 5 lines

Disabling optional libraries was not tested.
Add a new target in test-meson-builds.sh and GHA.

The Bluefield target is removed from test-meson-builds.sh to save space and compilation time in exchange of the new target.

OK to remove build-arm64-bluefield.
We should also remove build-arm64-host-clang which has no benefit. And instead of adding a new target, can we reuse an existing one, like build-clang-static or build-arm64-dpaa?

#3 lore raw

Re: [PATCH 1/5] ci: test build with minimum configuration

Quoted 10 lines · Thomas Monjalon

10/11/2021 17:48, David Marchand:

Quoted 5 lines

Disabling optional libraries was not tested.
Add a new target in test-meson-builds.sh and GHA.

The Bluefield target is removed from test-meson-builds.sh to save space and compilation time in exchange of the new target.

OK to remove build-arm64-bluefield.
We should also remove build-arm64-host-clang which has no benefit.

To be fair, I originally had no such change and added this following an offline discussion you and I had :-).
But this is going farther than what this patch is about: testing disabling components through existing options.

Quoted 2 lines

And instead of adding a new target, can we reuse an existing one, like build-clang-static or build-arm64-dpaa?

Reusing means we lose some coverage of the existing target. I prefer adding a dedicated target.

So I think I'll go back to my original idea and drop the bluefield change. To make this new target less space/cpu consuming (which impacts us, maintainers, when merging patches), I can make it a really minimalistic configuration: I would disable all drivers (but the net/null one used in test-null.sh).

I don't mind looking into other target usefulness in test-meson-builds.sh, but as a followup series.

Signature · 1 line
David Marchand
#4 lore raw

Re: [PATCH 1/5] ci: test build with minimum configuration

16/11/2021 21:39, David Marchand:

Quoted 31 lines · Thomas Monjalon
Quoted 10 lines

10/11/2021 17:48, David Marchand:

Quoted 5 lines

Disabling optional libraries was not tested.
Add a new target in test-meson-builds.sh and GHA.

The Bluefield target is removed from test-meson-builds.sh to save space and compilation time in exchange of the new target.

OK to remove build-arm64-bluefield.
We should also remove build-arm64-host-clang which has no benefit.

To be fair, I originally had no such change and added this following an offline discussion you and I had :-).
But this is going farther than what this patch is about: testing disabling components through existing options.

Quoted 2 lines

And instead of adding a new target, can we reuse an existing one, like build-clang-static or build-arm64-dpaa?

Reusing means we lose some coverage of the existing target. I prefer adding a dedicated target.

So I think I'll go back to my original idea and drop the bluefield change. To make this new target less space/cpu consuming (which impacts us, maintainers, when merging patches), I can make it a really minimalistic configuration: I would disable all drivers (but the net/null one used in test-null.sh).

Quoted 2 lines

I don't mind looking into other target usefulness in test-meson-builds.sh, but as a followup series.

I fully agree with this plan.

#5 lore raw

PATCH 2/5 build: make GRO/GSO optional

In reply to David Marchand

GRO and GSO integration in testpmd is relatively self contained and easy to extract.
Those libraries can be made optional as they provide standalone features.

---
 app/test-pmd/cmdline.c   | 14 ++++++++++++++
 app/test-pmd/config.c    |  6 ++++++
 app/test-pmd/csumonly.c  | 35 +++++++++++++++++++++++++++++------
 app/test-pmd/meson.build |  8 +++++++-
 app/test-pmd/testpmd.c   | 14 ++++++++++++++
 app/test-pmd/testpmd.h   | 18 ++++++++++++++++++
 lib/meson.build          |  2 ++
 7 files changed, 90 insertions(+), 7 deletions(-)
app/test-pmd/cmdline.c +14 -0
index 4f51b259fe..1a3c0a56df 100644
@@ -35,7 +35,9 @@
 #include <rte_string_fns.h>
 #include <rte_devargs.h>
 #include <rte_flow.h>
+#ifdef RTE_LIB_GRO
 #include <rte_gro.h>
+#endif
 #include <rte_mbuf_dyn.h>
 
 #include <cmdline_rdline.h>
@@ -459,6 +461,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"tso show (portid)"
 			"    Display the status of TCP Segmentation Offload.\n\n"
 
+#ifdef RTE_LIB_GRO
 			"set port (port_id) gro on|off\n"
 			"    Enable or disable Generic Receive Offload in"
 			" csum forwarding engine.\n\n"
@@ -469,7 +472,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"set gro flush (cycles)\n"
 			"    Set the cycle to flush GROed packets from"
 			" reassembly tables.\n\n"
+#endif
 
+#ifdef RTE_LIB_GSO
 			"set port (port_id) gso (on|off)"
 			"    Enable or disable Generic Segmentation Offload in"
 			" csum forwarding engine.\n\n"
@@ -480,6 +485,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"show port (port_id) gso\n"
 			"    Show GSO configuration.\n\n"
+#endif
 
 			"set fwd (%s)\n"
 			"    Set packet forwarding mode.\n\n"
@@ -5150,6 +5156,7 @@ cmdline_parse_inst_t cmd_tunnel_tso_show = {
 	},
 };
 
+#ifdef RTE_LIB_GRO
 /* *** SET GRO FOR A PORT *** */
 struct cmd_gro_enable_result {
 	cmdline_fixed_string_t cmd_set;
@@ -5293,7 +5300,9 @@ cmdline_parse_inst_t cmd_gro_flush = {
 		NULL,
 	},
 };
+#endif /* RTE_LIB_GRO */
 
+#ifdef RTE_LIB_GSO
 /* *** ENABLE/DISABLE GSO *** */
 struct cmd_gso_enable_result {
 	cmdline_fixed_string_t cmd_set;
@@ -5460,6 +5469,7 @@ cmdline_parse_inst_t cmd_gso_show = {
 		NULL,
 	},
 };
+#endif /* RTE_LIB_GSO */
 
 /* *** ENABLE/DISABLE FLUSH ON RX STREAMS *** */
 struct cmd_set_flush_rx {
@@ -17661,12 +17671,16 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_tso_show,
 	(cmdline_parse_inst_t *)&cmd_tunnel_tso_set,
 	(cmdline_parse_inst_t *)&cmd_tunnel_tso_show,
+#ifdef RTE_LIB_GRO
 	(cmdline_parse_inst_t *)&cmd_gro_enable,
 	(cmdline_parse_inst_t *)&cmd_gro_flush,
 	(cmdline_parse_inst_t *)&cmd_gro_show,
+#endif
+#ifdef RTE_LIB_GSO
 	(cmdline_parse_inst_t *)&cmd_gso_enable,
 	(cmdline_parse_inst_t *)&cmd_gso_size,
 	(cmdline_parse_inst_t *)&cmd_gso_show,
+#endif
 	(cmdline_parse_inst_t *)&cmd_link_flow_control_set,
 	(cmdline_parse_inst_t *)&cmd_link_flow_control_set_rx,
 	(cmdline_parse_inst_t *)&cmd_link_flow_control_set_tx,
app/test-pmd/config.c +6 -0
index 26cadf39f7..9ece9cd8ba 100644
@@ -49,7 +49,9 @@
 #ifdef RTE_NET_BNXT
 #include <rte_pmd_bnxt.h>
 #endif
+#ifdef RTE_LIB_GRO
 #include <rte_gro.h>
+#endif
 #include <rte_hexdump.h>
 
 #include "testpmd.h"
@@ -4192,6 +4194,7 @@ set_tx_pkt_times(unsigned int *tx_times)
 	tx_pkt_times_intra = tx_times[1];
 }
 
+#ifdef RTE_LIB_GRO
 void
 setup_gro(const char *onoff, portid_t port_id)
 {
@@ -4273,7 +4276,9 @@ show_gro(portid_t port_id)
 	} else
 		printf("Port %u doesn't enable GRO.\n", port_id);
 }
+#endif /* RTE_LIB_GRO */
 
+#ifdef RTE_LIB_GSO
 void
 setup_gso(const char *mode, portid_t port_id)
 {
@@ -4297,6 +4302,7 @@ setup_gso(const char *mode, portid_t port_id)
 		gso_ports[port_id].enable = 0;
 	}
 }
+#endif /* RTE_LIB_GSO */
 
 char*
 list_pkt_forwarding_modes(void)
app/test-pmd/csumonly.c +29 -6
index 8526d9158a..4b6c6759a4 100644
@@ -41,8 +41,12 @@
 #include <rte_prefetch.h>
 #include <rte_string_fns.h>
 #include <rte_flow.h>
+#ifdef RTE_LIB_GRO
 #include <rte_gro.h>
+#endif
+#ifdef RTE_LIB_GSO
 #include <rte_gso.h>
+#endif
 #include <rte_geneve.h>
 
 #include "testpmd.h"
@@ -69,7 +73,9 @@ uint16_t geneve_udp_port = RTE_GENEVE_DEFAULT_PORT;
 /* structure that caches offload info for the current packet */
 struct testpmd_offload_info {
 	uint16_t ethertype;
+#ifdef RTE_LIB_GSO
 	uint8_t gso_enable;
+#endif
 	uint16_t l2_len;
 	uint16_t l3_len;
 	uint16_t l4_len;
@@ -511,8 +517,10 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 						info->ethertype);
 			}
 		}
+#ifdef RTE_LIB_GSO
 		if (info->gso_enable)
 			ol_flags |= RTE_MBUF_F_TX_UDP_SEG;
+#endif
 	} else if (info->l4_proto == IPPROTO_TCP) {
 		tcp_hdr = (struct rte_tcp_hdr *)((char *)l3_hdr + info->l3_len);
 		if (tso_segsz)
@@ -525,8 +533,10 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 				get_udptcp_checksum(l3_hdr, tcp_hdr,
 					info->ethertype);
 		}
+#ifdef RTE_LIB_GSO
 		if (info->gso_enable)
 			ol_flags |= RTE_MBUF_F_TX_TCP_SEG;
+#endif
 	} else if (info->l4_proto == IPPROTO_SCTP) {
 		sctp_hdr = (struct rte_sctp_hdr *)
 			((char *)l3_hdr + info->l3_len);
@@ -795,16 +805,20 @@ static void
 pkt_burst_checksum_forward(struct fwd_stream *fs)
 {
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
+#ifdef RTE_LIB_GSO
 	struct rte_mbuf *gso_segments[GSO_MAX_PKT_BURST];
 	struct rte_gso_ctx *gso_ctx;
+#endif
 	struct rte_mbuf **tx_pkts_burst;
 	struct rte_port *txp;
 	struct rte_mbuf *m, *p;
 	struct rte_ether_hdr *eth_hdr;
 	void *l3_hdr = NULL, *outer_l3_hdr = NULL; /* can be IPv4 or IPv6 */
+#ifdef RTE_LIB_GRO
 	void **gro_ctx;
 	uint16_t gro_pkts_num;
 	uint8_t gro_enable;
+#endif
 	uint16_t nb_rx;
 	uint16_t nb_tx;
 	uint16_t nb_prep;
@@ -817,8 +831,6 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	uint32_t rx_bad_outer_l4_csum;
 	uint32_t rx_bad_outer_ip_csum;
 	struct testpmd_offload_info info;
-	uint16_t nb_segments = 0;
-	int ret;
 
 	uint64_t start_tsc = 0;
 
@@ -836,15 +848,19 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	rx_bad_l4_csum = 0;
 	rx_bad_outer_l4_csum = 0;
 	rx_bad_outer_ip_csum = 0;
+#ifdef RTE_LIB_GRO
 	gro_enable = gro_ports[fs->rx_port].enable;
+#endif
 
 	txp = &ports[fs->tx_port];
 	tx_offloads = txp->dev_conf.txmode.offloads;
 	memset(&info, 0, sizeof(info));
 	info.tso_segsz = txp->tso_segsz;
 	info.tunnel_tso_segsz = txp->tunnel_tso_segsz;
+#ifdef RTE_LIB_GSO
 	if (gso_ports[fs->tx_port].enable)
 		info.gso_enable = 1;
+#endif
 
 	for (i = 0; i < nb_rx; i++) {
 		if (likely(i < nb_rx - 1))
@@ -1053,6 +1069,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 		}
 	}
 
+#ifdef RTE_LIB_GRO
 	if (unlikely(gro_enable)) {
 		if (gro_flush_cycles == GRO_DEFAULT_FLUSH_CYCLES) {
 			nb_rx = rte_gro_reassemble_burst(pkts_burst, nb_rx,
@@ -1074,13 +1091,17 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			}
 		}
 	}
+#endif
+
+#ifdef RTE_LIB_GSO
+	if (gso_ports[fs->tx_port].enable != 0) {
+		uint16_t nb_segments = 0;
 
-	if (gso_ports[fs->tx_port].enable == 0)
-		tx_pkts_burst = pkts_burst;
-	else {
 		gso_ctx = &(current_fwd_lcore()->gso_ctx);
 		gso_ctx->gso_size = gso_max_segment_size;
 		for (i = 0; i < nb_rx; i++) {
+			int ret;
+
 			ret = rte_gso_segment(pkts_burst[i], gso_ctx,
 					&gso_segments[nb_segments],
 					GSO_MAX_PKT_BURST - nb_segments);
@@ -1102,7 +1123,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 
 		tx_pkts_burst = gso_segments;
 		nb_rx = nb_segments;
-	}
+	} else
+#endif
+		tx_pkts_burst = pkts_burst;
 
 	nb_prep = rte_eth_tx_prepare(fs->tx_port, fs->tx_queue,
 			tx_pkts_burst, nb_rx);
app/test-pmd/meson.build +7 -1
index d5df52c470..eba03b572c 100644
@@ -32,7 +32,7 @@ if dpdk_conf.has('RTE_HAS_JANSSON')
     ext_deps += jansson_dep
 endif
 
-deps += ['ethdev', 'gro', 'gso', 'cmdline', 'metrics', 'bus_pci']
+deps += ['ethdev', 'cmdline', 'metrics', 'bus_pci']
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
     deps += 'crypto_scheduler'
 endif
@@ -43,6 +43,12 @@ if dpdk_conf.has('RTE_LIB_BPF')
     sources += files('bpf_cmd.c')
     deps += 'bpf'
 endif
+if dpdk_conf.has('RTE_LIB_GRO')
+    deps += 'gro'
+endif
+if dpdk_conf.has('RTE_LIB_GSO')
+    deps += 'gso'
+endif
 if dpdk_conf.has('RTE_LIB_LATENCYSTATS')
     deps += 'latencystats'
 endif
app/test-pmd/testpmd.c +14 -0
index a66dfb297c..e2998b066b 100644
@@ -518,8 +518,10 @@ lcoreid_t bitrate_lcore_id;
 uint8_t bitrate_enabled;
 #endif
 
+#ifdef RTE_LIB_GRO
 struct gro_status gro_ports[RTE_MAX_ETHPORTS];
 uint8_t gro_flush_cycles = GRO_DEFAULT_FLUSH_CYCLES;
+#endif
 
 /*
  * hexadecimal bitmask of RX mq mode can be enabled.
@@ -658,8 +660,10 @@ static void fill_xstats_display_info(void);
  */
 static int all_ports_started(void);
 
+#ifdef RTE_LIB_GSO
 struct gso_status gso_ports[RTE_MAX_ETHPORTS];
 uint16_t gso_max_segment_size = RTE_ETHER_MAX_LEN - RTE_ETHER_CRC_LEN;
+#endif
 
 /* Holds the registered mbuf dynamic flags names. */
 char dynf_names[64][RTE_MBUF_DYN_NAMESIZE];
@@ -1633,8 +1637,12 @@ init_config(void)
 	struct rte_mempool *mbp;
 	unsigned int nb_mbuf_per_pool;
 	lcoreid_t  lc_id;
+#ifdef RTE_LIB_GRO
 	struct rte_gro_param gro_param;
+#endif
+#ifdef RTE_LIB_GSO
 	uint32_t gso_types;
+#endif
 
 	/* Configuration of logical cores. */
 	fwd_lcores = rte_zmalloc("testpmd: fwd_lcores",
@@ -1717,8 +1725,10 @@ init_config(void)
 
 	init_port_config();
 
+#ifdef RTE_LIB_GSO
 	gso_types = RTE_ETH_TX_OFFLOAD_TCP_TSO | RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO |
 		RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO | RTE_ETH_TX_OFFLOAD_UDP_TSO;
+#endif
 	/*
 	 * Records which Mbuf pool to use by each logical core, if needed.
 	 */
@@ -1729,6 +1739,7 @@ init_config(void)
 		if (mbp == NULL)
 			mbp = mbuf_pool_find(0, 0);
 		fwd_lcores[lc_id]->mbp = mbp;
+#ifdef RTE_LIB_GSO
 		/* initialize GSO context */
 		fwd_lcores[lc_id]->gso_ctx.direct_pool = mbp;
 		fwd_lcores[lc_id]->gso_ctx.indirect_pool = mbp;
@@ -1736,10 +1747,12 @@ init_config(void)
 		fwd_lcores[lc_id]->gso_ctx.gso_size = RTE_ETHER_MAX_LEN -
 			RTE_ETHER_CRC_LEN;
 		fwd_lcores[lc_id]->gso_ctx.flag = 0;
+#endif
 	}
 
 	fwd_config_setup();
 
+#ifdef RTE_LIB_GRO
 	/* create a gro context for each lcore */
 	gro_param.gro_types = RTE_GRO_TCP_IPV4;
 	gro_param.max_flow_num = GRO_MAX_FLUSH_CYCLES;
@@ -1753,6 +1766,7 @@ init_config(void)
 					"rte_gro_ctx_create() failed\n");
 		}
 	}
+#endif
 }
 
 
app/test-pmd/testpmd.h +18 -0
index 669ce1e87d..b1dfd097c7 100644
@@ -9,8 +9,12 @@
 
 #include <rte_pci.h>
 #include <rte_bus_pci.h>
+#ifdef RTE_LIB_GRO
 #include <rte_gro.h>
+#endif
+#ifdef RTE_LIB_GSO
 #include <rte_gso.h>
+#endif
 #include <rte_os_shim.h>
 #include <cmdline.h>
 #include <sys/queue.h>
@@ -143,7 +147,9 @@ struct fwd_stream {
 	/**< received packets has bad outer l4 checksum */
 	uint64_t rx_bad_outer_ip_csum;
 	/**< received packets having bad outer ip checksum */
+#ifdef RTE_LIB_GRO
 	unsigned int gro_times;	/**< GRO operation times */
+#endif
 	uint64_t     core_cycles; /**< used for RX and TX processing */
 	struct pkt_burst_stats rx_burst_stats;
 	struct pkt_burst_stats tx_burst_stats;
@@ -264,9 +270,13 @@ struct rte_port {
  * CPU id. configuration table.
  */
 struct fwd_lcore {
+#ifdef RTE_LIB_GSO
 	struct rte_gso_ctx gso_ctx;     /**< GSO context */
+#endif
 	struct rte_mempool *mbp; /**< The mbuf pool to use by this core */
+#ifdef RTE_LIB_GRO
 	void *gro_ctx;		/**< GRO context */
+#endif
 	streamid_t stream_idx;   /**< index of 1st stream in "fwd_streams" */
 	streamid_t stream_nb;    /**< number of streams in "fwd_streams" */
 	lcoreid_t  cpuid_idx;    /**< index of logical core in CPU id table */
@@ -560,6 +570,7 @@ extern struct rte_ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS];
 extern uint32_t burst_tx_delay_time; /**< Burst tx delay time(us) for mac-retry. */
 extern uint32_t burst_tx_retry_num;  /**< Burst tx retry number for mac-retry. */
 
+#ifdef RTE_LIB_GRO
 #define GRO_DEFAULT_ITEM_NUM_PER_FLOW 32
 #define GRO_DEFAULT_FLOW_NUM (RTE_GRO_MAX_BURST_ITEM_NUM / \
 		GRO_DEFAULT_ITEM_NUM_PER_FLOW)
@@ -573,13 +584,16 @@ struct gro_status {
 };
 extern struct gro_status gro_ports[RTE_MAX_ETHPORTS];
 extern uint8_t gro_flush_cycles;
+#endif /* RTE_LIB_GRO */
 
+#ifdef RTE_LIB_GSO
 #define GSO_MAX_PKT_BURST 2048
 struct gso_status {
 	uint8_t enable;
 };
 extern struct gso_status gso_ports[RTE_MAX_ETHPORTS];
 extern uint16_t gso_max_segment_size;
+#endif /* RTE_LIB_GSO */
 
 /* VXLAN encap/decap parameters. */
 struct vxlan_encap_conf {
@@ -1006,10 +1020,14 @@ void port_rss_hash_key_update(portid_t port_id, char rss_type[],
 			      uint8_t *hash_key, uint8_t hash_key_len);
 int rx_queue_id_is_invalid(queueid_t rxq_id);
 int tx_queue_id_is_invalid(queueid_t txq_id);
+#ifdef RTE_LIB_GRO
 void setup_gro(const char *onoff, portid_t port_id);
 void setup_gro_flush_cycles(uint8_t cycles);
 void show_gro(portid_t port_id);
+#endif
+#ifdef RTE_LIB_GSO
 void setup_gso(const char *mode, portid_t port_id);
+#endif
 int eth_dev_info_get_print_err(uint16_t port_id,
 			struct rte_eth_dev_info *dev_info);
 int eth_dev_conf_get_print_err(uint16_t port_id,
lib/meson.build +2 -0
index 8537a5ab80..2766c02bd2 100644
@@ -66,6 +66,8 @@ libraries = [
 ]
 
 optional_libs = [
+        'gro',
+        'gso',
         'kni',
         'power',
         'vhost',
Signature · 1 line
2.23.0
#7 lore raw

PATCH 3/5 build: make metrics libraries optional

In reply to David Marchand

metrics, bitratestats, jobstats and latencystats libraries can be made optional as they provide standalone features.

---
 app/proc-info/main.c      | 16 ++++++++++++++++
 app/proc-info/meson.build |  5 ++++-
 app/test-pmd/meson.build  |  5 ++++-
 app/test-pmd/testpmd.c    |  4 ++++
 app/test/meson.build      | 24 +++++++++++++++---------
 lib/meson.build           |  4 ++++
 6 files changed, 47 insertions(+), 11 deletions(-)
app/proc-info/main.c +16 -0
index a4271047e6..19223d034c 100644
@@ -30,7 +30,9 @@
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
 #include <rte_string_fns.h>
+#ifdef RTE_LIB_METRICS
 #include <rte_metrics.h>
+#endif
 #include <rte_cycles.h>
 #ifdef RTE_LIB_SECURITY
 #include <rte_security.h>
@@ -59,8 +61,10 @@ static uint32_t enable_collectd_format;
 static int stdout_fd;
 /**< Host id process is running on */
 static char host_id[MAX_LONG_OPT_SZ];
+#ifdef RTE_LIB_METRICS
 /**< Enable metrics. */
 static uint32_t enable_metrics;
+#endif
 /**< Enable stats reset. */
 static uint32_t reset_stats;
 /**< Enable xstats reset. */
@@ -108,8 +112,10 @@ proc_info_usage(const char *prgname)
 		"  --stats: to display port statistics, enabled by default\n"
 		"  --xstats: to display extended port statistics, disabled by "
 			"default\n"
+#ifdef RTE_LIB_METRICS
 		"  --metrics: to display derived metrics of the ports, disabled by "
 			"default\n"
+#endif
 		"  --xstats-name NAME: to display single xstat id by NAME\n"
 		"  --xstats-ids IDLIST: to display xstat values by id. "
 			"The argument is comma-separated list of xstat ids to print out.\n"
@@ -218,7 +224,9 @@ proc_info_parse_args(int argc, char **argv)
 		{"stats", 0, NULL, 0},
 		{"stats-reset", 0, NULL, 0},
 		{"xstats", 0, NULL, 0},
+#ifdef RTE_LIB_METRICS
 		{"metrics", 0, NULL, 0},
+#endif
 		{"xstats-reset", 0, NULL, 0},
 		{"xstats-name", required_argument, NULL, 1},
 		{"collectd-format", 0, NULL, 0},
@@ -260,10 +268,12 @@ proc_info_parse_args(int argc, char **argv)
 			else if (!strncmp(long_option[option_index].name, "xstats",
 					MAX_LONG_OPT_SZ))
 				enable_xstats = 1;
+#ifdef RTE_LIB_METRICS
 			else if (!strncmp(long_option[option_index].name,
 					"metrics",
 					MAX_LONG_OPT_SZ))
 				enable_metrics = 1;
+#endif
 			/* Reset stats */
 			if (!strncmp(long_option[option_index].name, "stats-reset",
 					MAX_LONG_OPT_SZ))
@@ -593,6 +603,7 @@ nic_xstats_clear(uint16_t port_id)
 	printf("\n  NIC extended statistics for port %d cleared\n", port_id);
 }
 
+#ifdef RTE_LIB_METRICS
 static void
 metrics_display(int port_id)
 {
@@ -653,6 +664,7 @@ metrics_display(int port_id)
 	rte_free(metrics);
 	rte_free(names);
 }
+#endif
 
 static void
 show_security_context(uint16_t portid, bool inline_offload)
@@ -1522,14 +1534,18 @@ main(int argc, char **argv)
 		else if (nb_xstats_ids > 0)
 			nic_xstats_by_ids_display(i, xstats_ids,
 						  nb_xstats_ids);
+#ifdef RTE_LIB_METRICS
 		else if (enable_metrics)
 			metrics_display(i);
+#endif
 
 	}
 
+#ifdef RTE_LIB_METRICS
 	/* print port independent stats */
 	if (enable_metrics)
 		metrics_display(RTE_METRICS_GLOBAL);
+#endif
 
 	/* show information for PMD */
 	if (enable_shw_port)
app/proc-info/meson.build +4 -1
index 1062e0ef86..1563ce656a 100644
@@ -8,4 +8,7 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['ethdev', 'metrics', 'security']
+deps += ['ethdev', 'security']
+if dpdk_conf.has('RTE_LIB_METRICS')
+    deps += 'metrics'
+endif
app/test-pmd/meson.build +4 -1
index eba03b572c..43130c8856 100644
@@ -32,7 +32,7 @@ if dpdk_conf.has('RTE_HAS_JANSSON')
     ext_deps += jansson_dep
 endif
 
-deps += ['ethdev', 'cmdline', 'metrics', 'bus_pci']
+deps += ['ethdev', 'cmdline', 'bus_pci']
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
     deps += 'crypto_scheduler'
 endif
@@ -52,6 +52,9 @@ endif
 if dpdk_conf.has('RTE_LIB_LATENCYSTATS')
     deps += 'latencystats'
 endif
+if dpdk_conf.has('RTE_LIB_METRICS')
+    deps += 'metrics'
+endif
 if dpdk_conf.has('RTE_LIB_PDUMP')
     deps += 'pdump'
 endif
app/test-pmd/testpmd.c +4 -0
index e2998b066b..73b8ba7236 100644
@@ -55,7 +55,9 @@
 #include <rte_pdump.h>
 #endif
 #include <rte_flow.h>
+#ifdef RTE_LIB_METRICS
 #include <rte_metrics.h>
+#endif
 #ifdef RTE_LIB_BITRATESTATS
 #include <rte_bitrate.h>
 #endif
@@ -4231,8 +4233,10 @@ main(int argc, char** argv)
 				port_id, rte_strerror(-ret));
 	}
 
+#ifdef RTE_LIB_METRICS
 	/* Init metrics library */
 	rte_metrics_init(rte_socket_id());
+#endif
 
 #ifdef RTE_LIB_LATENCYSTATS
 	if (latencystats_enabled != 0) {
app/test/meson.build +15 -9
index a968abac76..b5f1a89edf 100644
@@ -98,7 +98,6 @@ test_sources = files(
         'test_mempool_perf.c',
         'test_memzone.c',
         'test_meter.c',
-        'test_metrics.c',
         'test_mcslock.c',
         'test_mp_secondary.c',
         'test_per_lcore.c',
@@ -162,7 +161,6 @@ test_deps = [
         'acl',
         'bus_pci',
         'bus_vdev',
-        'bitratestats',
         'bpf',
         'cfgfile',
         'cmdline',
@@ -177,10 +175,8 @@ test_deps = [
         'graph',
         'hash',
         'ipsec',
-        'latencystats',
         'lpm',
         'member',
-        'metrics',
         'node',
         'pipeline',
         'port',
@@ -281,7 +277,6 @@ fast_tests = [
         ['kni_autotest', false],
         ['kvargs_autotest', true],
         ['member_autotest', true],
-        ['metrics_autotest', true],
         ['power_cpufreq_autotest', false],
         ['power_autotest', true],
         ['power_kvm_vm_autotest', false],
@@ -378,6 +373,11 @@ endif
 if dpdk_conf.has('RTE_EVENT_SKELETON')
     test_deps += 'event_skeleton'
 endif
+if dpdk_conf.has('RTE_LIB_METRICS')
+    test_deps += 'metrics'
+    test_sources += ['test_metrics.c']
+    fast_tests += [['metrics_autotest', true]]
+endif
 if dpdk_conf.has('RTE_LIB_TELEMETRY')
     test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c']
     fast_tests += [['telemetry_json_autotest', true], ['telemetry_data_autotest', true]]
@@ -399,16 +399,22 @@ if dpdk_conf.has('RTE_NET_RING')
     test_sources += 'test_pmd_ring_perf.c'
     test_sources += 'test_pmd_ring.c'
     test_sources += 'test_event_eth_tx_adapter.c'
-    test_sources += 'test_bitratestats.c'
-    test_sources += 'test_latencystats.c'
     test_sources += 'sample_packet_forward.c'
     test_sources += 'test_pdump.c'
     fast_tests += [['ring_pmd_autotest', true]]
     perf_test_names += 'ring_pmd_perf_autotest'
     fast_tests += [['event_eth_tx_adapter_autotest', false]]
-    fast_tests += [['bitratestats_autotest', true]]
-    fast_tests += [['latencystats_autotest', true]]
     fast_tests += [['pdump_autotest', true]]
+    if dpdk_conf.has('RTE_LIB_BITRATESTATS')
+        test_deps += 'bitratestats'
+        test_sources += 'test_bitratestats.c'
+        fast_tests += [['bitratestats_autotest', true]]
+    endif
+    if dpdk_conf.has('RTE_LIB_LATENCYSTATS')
+        test_deps += 'latencystats'
+        test_sources += 'test_latencystats.c'
+        fast_tests += [['latencystats_autotest', true]]
+    endif
 endif
 
 if dpdk_conf.has('RTE_HAS_LIBPCAP')
lib/meson.build +4 -0
index 2766c02bd2..961b95f4ad 100644
@@ -66,9 +66,13 @@ libraries = [
 ]
 
 optional_libs = [
+        'bitratestats',
         'gro',
         'gso',
         'kni',
+        'jobstats',
+        'latencystats',
+        'metrics',
         'power',
         'vhost',
 ]
Signature · 1 line
2.23.0
#9 lore raw

PATCH 4/5 build: make pdump optional

In reply to David Marchand

This library can be made optional.
dumpcap and pdump applications depend on this library, check for dependencies like what we have for examples.

---
 app/meson.build      | 18 +++++++++++++-----
 app/test/meson.build | 10 +++++-----
 lib/meson.build      |  1 +
 3 files changed, 19 insertions(+), 10 deletions(-)
app/meson.build +13 -5
index 310e83076f..93d8c15032 100644
@@ -43,15 +43,23 @@ foreach app:apps
 
     subdir(name)
 
+    if build
+        dep_objs = []
+        foreach d:deps
+            var_name = get_option('default_library') + '_rte_' + d
+            if not is_variable(var_name)
+                build = false
+                message('Missing dependency "@0@" for app "@1@"'.format(d, name))
+                break
+            endif
+            dep_objs += [get_variable(var_name)]
+        endforeach
+    endif
+
     if not build
         continue
     endif
 
-    dep_objs = []
-    foreach d:deps
-        dep_objs += get_variable(get_option('default_library') + '_rte_' + d)
-    endforeach
-
     link_libs = []
     if get_option('default_library') == 'static'
         link_libs = dpdk_static_libraries + dpdk_drivers
app/test/meson.build +5 -5
index b5f1a89edf..07fe4870b0 100644
@@ -400,11 +400,9 @@ if dpdk_conf.has('RTE_NET_RING')
     test_sources += 'test_pmd_ring.c'
     test_sources += 'test_event_eth_tx_adapter.c'
     test_sources += 'sample_packet_forward.c'
-    test_sources += 'test_pdump.c'
     fast_tests += [['ring_pmd_autotest', true]]
     perf_test_names += 'ring_pmd_perf_autotest'
     fast_tests += [['event_eth_tx_adapter_autotest', false]]
-    fast_tests += [['pdump_autotest', true]]
     if dpdk_conf.has('RTE_LIB_BITRATESTATS')
         test_deps += 'bitratestats'
         test_sources += 'test_bitratestats.c'
@@ -415,6 +413,11 @@ if dpdk_conf.has('RTE_NET_RING')
         test_sources += 'test_latencystats.c'
         fast_tests += [['latencystats_autotest', true]]
     endif
+    if dpdk_conf.has('RTE_LIB_PDUMP')
+        test_deps += 'pdump'
+        test_sources += 'test_pdump.c'
+        fast_tests += [['pdump_autotest', true]]
+    endif
 endif
 
 if dpdk_conf.has('RTE_HAS_LIBPCAP')
@@ -431,9 +434,6 @@ endif
 if dpdk_conf.has('RTE_LIB_KNI')
     test_deps += 'kni'
 endif
-if dpdk_conf.has('RTE_LIB_PDUMP')
-    test_deps += 'pdump'
-endif
 
 if cc.has_argument('-Wno-format-truncation')
     cflags += '-Wno-format-truncation'
lib/meson.build +1 -0
index 961b95f4ad..dad9fce14d 100644
@@ -73,6 +73,7 @@ optional_libs = [
         'jobstats',
         'latencystats',
         'metrics',
+        'pdump',
         'power',
         'vhost',
 ]
Signature · 1 line
2.23.0
#11 lore raw

PATCH 5/5 build: select optional libraries

In reply to David Marchand

There is currently no way to know which libraries are optional. Introduce a enable_libs option (close to what we have for drivers) so that packagers or projects consuming DPDK can more easily select the optional libraries that matter to them and disable other optional libraries.

Note: the enabled_libs variable is renamed for sake of consistency.

---
 buildtools/chkincs/meson.build |  2 +-
 lib/meson.build                | 34 ++++++++++++++++++----------------
 meson.build                    |  3 ++-
 meson_options.txt              |  2 ++
 4 files changed, 23 insertions(+), 18 deletions(-)
buildtools/chkincs/meson.build +1 -1
index 5ffca89761..6b93d5f46c 100644
@@ -18,7 +18,7 @@ sources = files('main.c')
 sources += gen_c_files.process(dpdk_chkinc_headers)
 
 deps = []
-foreach l:enabled_libs
+foreach l:dpdk_libs_enabled
     deps += get_variable('static_rte_' + l)
 endforeach
 
lib/meson.build +18 -16
index dad9fce14d..47c857c0fc 100644
@@ -78,17 +78,10 @@ optional_libs = [
         'vhost',
 ]
 
-disabled_libs = []
-opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'),
+enable_libs = run_command(list_dir_globs, get_option('enable_libs'),
+        check: true).stdout().split()
+disable_libs = run_command(list_dir_globs, get_option('disable_libs'),
         check: true).stdout().split()
-foreach l:opt_disabled_libs
-    if not optional_libs.contains(l)
-        warning('Cannot disable mandatory library "@0@"'.format(l))
-        continue
-    endif
-    disabled_libs += l
-endforeach
-
 
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
@@ -98,8 +91,6 @@ if cc.has_argument('-Wno-format-truncation')
     default_cflags += '-Wno-format-truncation'
 endif
 
-enabled_libs = [] # used to print summary at the end
-
 foreach l:libraries
     build = true
     reason = '<unknown reason>' # set if build == false to explain why
@@ -123,10 +114,21 @@ foreach l:libraries
         deps += ['eal']
     endif
 
-    if disabled_libs.contains(l)
-        build = false
-        reason = 'explicitly disabled via build config'
+    if optional_libs.contains(l)
+        # check for enabled libraries only if one is set in config
+        if enable_libs.length() != 0 and not enable_libs.contains(l)
+            build = false
+            reason = 'not in enabled libraries build config'
+        elif disable_libs.contains(l)
+            build = false
+            reason = 'explicitly disabled via build config'
+        endif
     else
+        if disable_libs.contains(l)
+            warning('Cannot disable mandatory library "@0@"'.format(l))
+        endif
+    endif
+    if build
         subdir(l)
     endif
     if name != l
@@ -150,7 +152,7 @@ foreach l:libraries
         static_deps += [get_variable('static_rte_' + d)]
     endforeach
 
-    enabled_libs += name
+    dpdk_libs_enabled += name
     dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1)
     install_headers(headers)
     install_headers(indirect_headers)
meson.build +2 -1
index 12cb6e0e83..65855ceee8 100644
@@ -35,6 +35,7 @@ dpdk_driver_classes = []
 dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
+dpdk_libs_enabled = []
 dpdk_drvs_disabled = []
 abi_version_file = files('ABI_VERSION')
 
@@ -102,7 +103,7 @@ subdir('buildtools/pkg-config')
 output_message = '\n=================\nLibraries Enabled\n=================\n'
 output_message += '\nlibs:\n\t'
 output_count = 0
-foreach lib:enabled_libs
+foreach lib:dpdk_libs_enabled
     output_message += lib + ', '
     output_count += 1
     if output_count == 8
meson_options.txt +2 -0
index 7c220ad68d..ccb92cff7a 100644
@@ -16,6 +16,8 @@ option('enable_docs', type: 'boolean', value: false, description:
        'build documentation')
 option('enable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to build. If unspecified, build all drivers.')
+option('enable_libs', type: 'string', value: '', description:
+       'Comma-separated list of libraries to explicitly enable.')
 option('enable_driver_sdk', type: 'boolean', value: false, description:
        'Install headers to build drivers.')
 option('enable_kmods', type: 'boolean', value: false, description:
Signature · 1 line
2.23.0
#12 lore raw

Re: [PATCH 5/5] build: select optional libraries

Quoted 10 lines · David Marchand

There is currently no way to know which libraries are optional. Introduce a enable_libs option (close to what we have for drivers) so that packagers or projects consuming DPDK can more easily select the optional libraries that matter to them and disable other optional libraries.

Note: the enabled_libs variable is renamed for sake of consistency.

---

This is the only patch of this set I would have some concerns about. I'm just not sure that it makes sense to have this option for libraries compared to drivers.

Specifically:
* We have over 200 drivers in DPDK (rough count using find), of which 2 are mandatory, and therefore specifying just 1 or 2 that you want can make sense.
* On the other hand, we have 53 libraries, of which only 7 or so (after this patchset) are optional. This means that use of the term "enable_libs" is misleading - at least to me - in that it's only a very small proportion of the libs which would be affected by that flag (compared to 99% of the drivers)
* Also, while the number of mandatory drivers is unlikely to change much (since there are only 2), it should be fairly safe to do builds using "--enable-drivers". On the other hand, the list of libraries affected by "--enable-libs" is likely to change, so short of each user naming each and every lib they use (and each library those depend on), to the list, it's quite possible that any --enable-libs use could lead to a broken build in future if a library changes from mandatory to optional.

Overall, I'm just concerned that this flag is premature, and would prefer to keep it just to the disable option until we are confident that out "optional library" list is relatively settled.

/Bruce

#13 lore raw

Re: [PATCH 5/5] build: select optional libraries

10/11/2021 18:34, Bruce Richardson:

Quoted 15 lines · David Marchand
Quoted 10 lines

There is currently no way to know which libraries are optional. Introduce a enable_libs option (close to what we have for drivers) so that packagers or projects consuming DPDK can more easily select the optional libraries that matter to them and disable other optional libraries.

Note: the enabled_libs variable is renamed for sake of consistency.

---

This is the only patch of this set I would have some concerns about. I'm just not sure that it makes sense to have this option for libraries compared to drivers.

Quoted 9 lines

Specifically:
* We have over 200 drivers in DPDK (rough count using find), of which 2 are mandatory, and therefore specifying just 1 or 2 that you want can make sense.
* On the other hand, we have 53 libraries, of which only 7 or so (after this patchset) are optional. This means that use of the term "enable_libs" is misleading - at least to me - in that it's only a very small proportion of the libs which would be affected by that flag (compared to 99% of the drivers)

The options are described like this:

option('disable_libs', type: 'string', value: '', description:
'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')
+option('enable_libs', type: 'string', value: '', description:
+ 'Comma-separated list of libraries to explicitly enable.')

I feel we should mention it is enabling optional libraries, and the default is to enable all.

Quoted 7 lines

* Also, while the number of mandatory drivers is unlikely to change much (since there are only 2), it should be fairly safe to do builds using "--enable-drivers". On the other hand, the list of libraries affected by "--enable-libs" is likely to change, so short of each user naming each and every lib they use (and each library those depend on), to the list, it's quite possible that any --enable-libs use could lead to a broken build in future if a library changes from mandatory to optional.

In order to be safe, the user can list all required libs, including non-optional ones.

Quoted 3 lines

Overall, I'm just concerned that this flag is premature, and would prefer to keep it just to the disable option until we are confident that out "optional library" list is relatively settled.

I see it the opposite way:
Someone who does not wish to deliver extra libs could use this option to list the required libs, so not-required libs will disappear from the build once they are declared optional in future releases.

#14 lore raw

Re: [PATCH 5/5] build: select optional libraries

Quoted 44 lines · Thomas Monjalon

10/11/2021 18:34, Bruce Richardson:

Quoted 15 lines · David Marchand
Quoted 10 lines

There is currently no way to know which libraries are optional. Introduce a enable_libs option (close to what we have for drivers) so that packagers or projects consuming DPDK can more easily select the optional libraries that matter to them and disable other optional libraries.

Note: the enabled_libs variable is renamed for sake of consistency.

---

This is the only patch of this set I would have some concerns about. I'm just not sure that it makes sense to have this option for libraries compared to drivers.

Quoted 9 lines

Specifically:
* We have over 200 drivers in DPDK (rough count using find), of which 2 are mandatory, and therefore specifying just 1 or 2 that you want can make sense.
* On the other hand, we have 53 libraries, of which only 7 or so (after this patchset) are optional. This means that use of the term "enable_libs" is misleading - at least to me - in that it's only a very small proportion of the libs which would be affected by that flag (compared to 99% of the drivers)

The options are described like this:

option('disable_libs', type: 'string', value: '', description:
'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')

meson_options.txt +2 -0
+option('enable_libs', type: 'string', value: '', description:
+       'Comma-separated list of libraries to explicitly enable.')

I feel we should mention it is enabling optional libraries, and the default is to enable all.

Quoted 7 lines

* Also, while the number of mandatory drivers is unlikely to change much (since there are only 2), it should be fairly safe to do builds using "--enable-drivers". On the other hand, the list of libraries affected by "--enable-libs" is likely to change, so short of each user naming each and every lib they use (and each library those depend on), to the list, it's quite possible that any --enable-libs use could lead to a broken build in future if a library changes from mandatory to optional.

Quoted 3 lines

In order to be safe, the user can list all required libs, including non-optional ones.

Yes, they can, but that is the part I'm concerned about. It should not be expected for users to know what all libraries should be needed and dependencies between them. The list of mandatory libraries is quite long.

Quoted 9 lines
Quoted 3 lines

Overall, I'm just concerned that this flag is premature, and would prefer to keep it just to the disable option until we are confident that out "optional library" list is relatively settled.

I see it the opposite way:
Someone who does not wish to deliver extra libs could use this option to list the required libs, so not-required libs will disappear from the build once they are declared optional in future releases.

Yes, though as-above, I'm concerned about the difficulty of building up such a list. However, if this option is only for "expert" and distro-packaging use, then I suppose it's reasonable. Perhaps we should add a warning to the doc line too, noting that it's only recommended for advanced users.

/Bruce

#15 lore raw

Re: [PATCH 5/5] build: select optional libraries

Quoted 64 lines · Bruce Richardson
Quoted 44 lines · Thomas Monjalon

10/11/2021 18:34, Bruce Richardson:

Quoted 15 lines · David Marchand
Quoted 10 lines

There is currently no way to know which libraries are optional. Introduce a enable_libs option (close to what we have for drivers) so that packagers or projects consuming DPDK can more easily select the optional libraries that matter to them and disable other optional libraries.

Note: the enabled_libs variable is renamed for sake of consistency.

---

This is the only patch of this set I would have some concerns about. I'm just not sure that it makes sense to have this option for libraries compared to drivers.

Quoted 9 lines

Specifically:
* We have over 200 drivers in DPDK (rough count using find), of which 2 are mandatory, and therefore specifying just 1 or 2 that you want can make sense.
* On the other hand, we have 53 libraries, of which only 7 or so (after this patchset) are optional. This means that use of the term "enable_libs" is misleading - at least to me - in that it's only a very small proportion of the libs which would be affected by that flag (compared to 99% of the drivers)

The options are described like this:

option('disable_libs', type: 'string', value: '', description:
'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')

meson_options.txt +2 -0
+option('enable_libs', type: 'string', value: '', description:
+       'Comma-separated list of libraries to explicitly enable.')

I feel we should mention it is enabling optional libraries, and the default is to enable all.

Quoted 7 lines

* Also, while the number of mandatory drivers is unlikely to change much (since there are only 2), it should be fairly safe to do builds using "--enable-drivers". On the other hand, the list of libraries affected by "--enable-libs" is likely to change, so short of each user naming each and every lib they use (and each library those depend on), to the list, it's quite possible that any --enable-libs use could lead to a broken build in future if a library changes from mandatory to optional.

Quoted 3 lines

In order to be safe, the user can list all required libs, including non-optional ones.

Yes, they can, but that is the part I'm concerned about. It should not be expected for users to know what all libraries should be needed and dependencies between them. The list of mandatory libraries is quite long.

Quoted 9 lines
Quoted 3 lines

Overall, I'm just concerned that this flag is premature, and would prefer to keep it just to the disable option until we are confident that out "optional library" list is relatively settled.

I see it the opposite way:
Someone who does not wish to deliver extra libs could use this option to list the required libs, so not-required libs will disappear from the build once they are declared optional in future releases.

Quoted 6 lines

Yes, though as-above, I'm concerned about the difficulty of building up such a list. However, if this option is only for "expert" and distro-packaging use, then I suppose it's reasonable. Perhaps we should add a warning to the doc line too, noting that it's only recommended for advanced users.

Ok, we still need some discussion.
I'll just respin for Thomas to merge patches that are ready.

Signature · 1 line
David Marchand
#16 lore raw

RE: [PATCH 5/5] build: select optional libraries

Quoted 97 lines

From: David Marchand [mailto:[email protected]]
Sent: Wednesday, 17 November 2021 12.27

Quoted 6 lines · Bruce Richardson
Quoted 4 lines · Thomas Monjalon

10/11/2021 18:34, Bruce Richardson:

Quoted 3 lines · David Marchand
Quoted 2 lines

There is currently no way to know which libraries are optional. Introduce a enable_libs option (close to what we have for

drivers) so

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

that packagers or projects consuming DPDK can more easily

select the

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

optional libraries that matter to them and disable other

optional

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

libraries.

Note: the enabled_libs variable is renamed for sake of

consistency.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

---

This is the only patch of this set I would have some concerns

about. I'm

Quoted 1 line
Quoted 1 line
Quoted 1 line

just not sure that it makes sense to have this option for

libraries

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

compared to drivers.

Specifically:
* We have over 200 drivers in DPDK (rough count using find), of

which 2 are

Quoted 1 line
Quoted 1 line
Quoted 1 line

mandatory, and therefore specifying just 1 or 2 that you want

can make

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

sense.
* On the other hand, we have 53 libraries, of which only 7 or so

(after

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

this patchset) are optional. This means that use of the term "enable_libs" is misleading - at least to me - in that it's

only a very

Quoted 1 line
Quoted 1 line
Quoted 1 line

small proportion of the libs which would be affected by that

flag

Quoted 6 lines
Quoted 6 lines
Quoted 1 line

(compared to 99% of the drivers)

The options are described like this:

option('disable_libs', type: 'string', value: '', description:
'Comma-separated list of libraries to explicitly disable.

[NOTE: not all libs can be disabled]')

Quoted 7 lines
Quoted 7 lines
meson_options.txt +2 -0
+option('enable_libs', type: 'string', value: '', description:
+       'Comma-separated list of libraries to explicitly enable.')

I feel we should mention it is enabling optional libraries, and the default is to enable all.

Quoted 1 line

* Also, while the number of mandatory drivers is unlikely to

change much

Quoted 1 line
Quoted 1 line
Quoted 1 line

(since there are only 2), it should be fairly safe to do builds

using

Quoted 1 line
Quoted 1 line
Quoted 1 line

"--enable-drivers". On the other hand, the list of libraries

affected by

Quoted 1 line
Quoted 1 line
Quoted 1 line

"--enable-libs" is likely to change, so short of each user

naming each

Quoted 1 line
Quoted 1 line
Quoted 1 line

and every lib they use (and each library those depend on), to

the list,

Quoted 1 line
Quoted 1 line
Quoted 1 line

it's quite possible that any --enable-libs use could lead to a

broken

Quoted 1 line
Quoted 1 line
Quoted 1 line

build in future if a library changes from mandatory to

optional.

Quoted 6 lines
Quoted 4 lines

In order to be safe, the user can list all required libs, including non-optional ones.

Yes, they can, but that is the part I'm concerned about. It should

not be

Quoted 2 lines

expected for users to know what all libraries should be needed and dependencies between them. The list of mandatory libraries is quite

long.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Overall, I'm just concerned that this flag is premature, and

would prefer

Quoted 1 line
Quoted 1 line
Quoted 1 line

to keep it just to the disable option until we are confident that

out

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

"optional library" list is relatively settled.

I see it the opposite way:
Someone who does not wish to deliver extra libs could use this

option

Quoted 5 lines
Quoted 3 lines

to list the required libs, so not-required libs will disappear from the build once they are declared optional in future releases.

Yes, though as-above, I'm concerned about the difficulty of building

up

Quoted 2 lines

such a list. However, if this option is only for "expert" and distro-packaging use, then I suppose it's reasonable. Perhaps we

Quoted 7 lines

should add

Quoted 3 lines

a warning to the doc line too, noting that it's only recommended for advanced users.

Ok, we still need some discussion.
I'll just respin for Thomas to merge patches that are ready.

This patch is a step in the right direction. Thank you.

Adding my opinion to the discussion will be a long rant from a grumpy old minimalist (working on dedicated network appliances, not Linux distros), so here goes:

The goal should be making all non-core libraries optional. And off the top of my head, these are the only core libraries:
EAL, mbuf, mempool, ring.

And yes, that also means that not even the simplest example applications can compile with only the core libraries. However, the ability to build a minimal dpdk.so should not depend on what is required to be able to build any example applications. In other words: If an example application cannot be built due to an omitted library, then do not build that application.

E.g. an Ethernet bridge application does not need any IP or routing libraries, so they are not core libraries.

I consider the mbuf library and the libraries it uses (i.e. mempool and ring) core libraries, because the core purpose of DPDK is to provide a data plane library, and all DPDK data plane application use mbufs. :-)

BTW, I also consider the ethdev library extremely bloated, with Flow, Metering, Traffic Management and ever more being added into one big monolithic library instead of separate libraries or modules.

#17 lore raw

Re: [PATCH 5/5] build: select optional libraries

Quoted 112 lines · On Fri, 7 Jan 2022 17:13:04 +0100 Morten Brørup <[email protected]>…
Quoted 97 lines

From: David Marchand [mailto:[email protected]]
Sent: Wednesday, 17 November 2021 12.27

Quoted 6 lines · Bruce Richardson
Quoted 4 lines · Thomas Monjalon

10/11/2021 18:34, Bruce Richardson:

Quoted 3 lines · David Marchand
Quoted 2 lines

There is currently no way to know which libraries are optional. Introduce a enable_libs option (close to what we have for

drivers) so

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

that packagers or projects consuming DPDK can more easily

select the

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

optional libraries that matter to them and disable other

optional

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

libraries.

Note: the enabled_libs variable is renamed for sake of

consistency.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

---

This is the only patch of this set I would have some concerns

about. I'm

Quoted 1 line
Quoted 1 line
Quoted 1 line

just not sure that it makes sense to have this option for

libraries

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

compared to drivers.

Specifically:
* We have over 200 drivers in DPDK (rough count using find), of

which 2 are

Quoted 1 line
Quoted 1 line
Quoted 1 line

mandatory, and therefore specifying just 1 or 2 that you want

can make

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

sense.
* On the other hand, we have 53 libraries, of which only 7 or so

(after

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

this patchset) are optional. This means that use of the term "enable_libs" is misleading - at least to me - in that it's

only a very

Quoted 1 line
Quoted 1 line
Quoted 1 line

small proportion of the libs which would be affected by that

flag

Quoted 6 lines
Quoted 6 lines
Quoted 1 line

(compared to 99% of the drivers)

The options are described like this:

option('disable_libs', type: 'string', value: '', description:
'Comma-separated list of libraries to explicitly disable.

[NOTE: not all libs can be disabled]')

Quoted 7 lines
Quoted 7 lines
meson_options.txt +2 -0
+option('enable_libs', type: 'string', value: '', description:
+       'Comma-separated list of libraries to explicitly enable.')

I feel we should mention it is enabling optional libraries, and the default is to enable all.

Quoted 1 line

* Also, while the number of mandatory drivers is unlikely to

change much

Quoted 1 line
Quoted 1 line
Quoted 1 line

(since there are only 2), it should be fairly safe to do builds

using

Quoted 1 line
Quoted 1 line
Quoted 1 line

"--enable-drivers". On the other hand, the list of libraries

affected by

Quoted 1 line
Quoted 1 line
Quoted 1 line

"--enable-libs" is likely to change, so short of each user

naming each

Quoted 1 line
Quoted 1 line
Quoted 1 line

and every lib they use (and each library those depend on), to

the list,

Quoted 1 line
Quoted 1 line
Quoted 1 line

it's quite possible that any --enable-libs use could lead to a

broken

Quoted 1 line
Quoted 1 line
Quoted 1 line

build in future if a library changes from mandatory to

optional.

Quoted 6 lines
Quoted 4 lines

In order to be safe, the user can list all required libs, including non-optional ones.

Yes, they can, but that is the part I'm concerned about. It should

not be

Quoted 2 lines

expected for users to know what all libraries should be needed and dependencies between them. The list of mandatory libraries is quite

long.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Overall, I'm just concerned that this flag is premature, and

would prefer

Quoted 1 line
Quoted 1 line
Quoted 1 line

to keep it just to the disable option until we are confident that

out

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

"optional library" list is relatively settled.

I see it the opposite way:
Someone who does not wish to deliver extra libs could use this

option

Quoted 5 lines
Quoted 3 lines

to list the required libs, so not-required libs will disappear from the build once they are declared optional in future releases.

Yes, though as-above, I'm concerned about the difficulty of building

up

Quoted 2 lines

such a list. However, if this option is only for "expert" and distro-packaging use, then I suppose it's reasonable. Perhaps we

Quoted 7 lines

should add

Quoted 3 lines

a warning to the doc line too, noting that it's only recommended for advanced users.

Ok, we still need some discussion.
I'll just respin for Thomas to merge patches that are ready.

This patch is a step in the right direction. Thank you.

Adding my opinion to the discussion will be a long rant from a grumpy old minimalist (working on dedicated network appliances, not Linux distros), so here goes:

The goal should be making all non-core libraries optional. And off the top of my head, these are the only core libraries:
EAL, mbuf, mempool, ring.

Quoted 8 lines

And yes, that also means that not even the simplest example applications can compile with only the core libraries. However, the ability to build a minimal dpdk.so should not depend on what is required to be able to build any example applications. In other words: If an example application cannot be built due to an omitted library, then do not build that application.

E.g. an Ethernet bridge application does not need any IP or routing libraries, so they are not core libraries.

I consider the mbuf library and the libraries it uses (i.e. mempool and ring) core libraries, because the core purpose of DPDK is to provide a data plane library, and all DPDK data plane application use mbufs. :-)

BTW, I also consider the ethdev library extremely bloated, with Flow, Metering, Traffic Management and ever more being added into one big monolithic library instead of separate libraries or modules.

Agreed, DPDK has become fat and now requires lots of things like meter and telemetry to build.

Acked-by on the v1 series
#18 lore raw
In reply to David Marchand
Quoted 19 lines · David Marchand

This series extends the optional libraries list adding to them testpmd non essential dependencies.

We were not testing the disable_libs option, so let's add a minimum target in the the public CI script (mainly for GHA) and in test-meson-builds.sh script.

The last patch is an idea for enhancing the optional libraries selection.

Signature · 8 lines
David Marchand

David Marchand (5):
  ci: test build with minimum configuration
  build: make GRO/GSO optional
  build: make metrics libraries optional
  build: make pdump optional
  build: select optional libraries

I have concerns about patch 5, but for the rest

#19 lore raw

v2 cover Extend optional libraries list

In reply to David Marchand

This series extends the optional libraries list adding to them testpmd non essential dependencies.

We were not testing the disable_libs option, so let's add a minimum target in the the public CI script (mainly for GHA) and in test-meson-builds.sh script.

The last patch is an idea for enhancing the optional libraries selection.

Signature · 33 lines
David Marchand

Changes since v1:
- only touched patch1,

David Marchand (5):
  ci: test minimum configuration
  build: make GRO/GSO optional
  build: make metrics libraries optional
  build: make pdump optional
  build: select optional libraries

 .ci/linux-build.sh             |  4 ++++
 .github/workflows/build.yml    |  5 +++++
 app/meson.build                | 18 ++++++++++-----
 app/proc-info/main.c           | 16 +++++++++++++
 app/proc-info/meson.build      |  5 ++++-
 app/test-pmd/cmdline.c         | 14 ++++++++++++
 app/test-pmd/config.c          |  6 +++++
 app/test-pmd/csumonly.c        | 35 ++++++++++++++++++++++++-----
 app/test-pmd/meson.build       | 11 ++++++++-
 app/test-pmd/testpmd.c         | 18 +++++++++++++++
 app/test-pmd/testpmd.h         | 18 +++++++++++++++
 app/test/meson.build           | 34 ++++++++++++++++------------
 buildtools/chkincs/meson.build |  2 +-
 devtools/test-meson-builds.sh  |  3 +++
 lib/meson.build                | 41 +++++++++++++++++++++-------------
 meson.build                    |  3 ++-
 meson_options.txt              |  2 ++
 17 files changed, 190 insertions(+), 45 deletions(-)

-- 
2.23.0
#20 lore raw

PATCH v2 1/5 ci: test minimum configuration

Disabling drivers and optional libraries was not tested. Add a new target in test-meson-builds.sh and GHA with just the minimum to run test-null.sh and any other optional component disabled.

---
Changes since v1:
- dropped target cleanup in test-meson-builds.sh, this will be handled in a separate series in the future,
- disabled all drivers but mempool/ring and net/null, required to pass test-null.sh. bus/vdev is explicitly enabled for

---
 .ci/linux-build.sh            | 4 ++++
 .github/workflows/build.yml   | 5 +++++
 devtools/test-meson-builds.sh | 3 +++
 3 files changed, 12 insertions(+)
.ci/linux-build.sh +4 -0
index ef0bd099be..6e8bd7baa9 100755
@@ -87,6 +87,10 @@ OPTS="$OPTS -Dplatform=generic"
 OPTS="$OPTS --default-library=$DEF_LIB"
 OPTS="$OPTS --buildtype=debugoptimized"
 OPTS="$OPTS -Dcheck_includes=true"
+if [ "$MINI" = "true" ]; then
+    OPTS="$OPTS -Denable_drivers=bus/vdev,mempool/ring,net/null"
+    OPTS="$OPTS -Ddisable_libs=*"
+fi
 meson build --werror $OPTS
 ninja -C build
 
.github/workflows/build.yml +5 -0
index 4151cafee7..2e9c4be6d0 100644
@@ -21,6 +21,7 @@ jobs:
       CC: ccache ${{ matrix.config.compiler }}
       DEF_LIB: ${{ matrix.config.library }}
       LIBABIGAIL_VERSION: libabigail-1.8
+      MINI: ${{ matrix.config.mini != '' }}
       PPC64LE: ${{ matrix.config.cross == 'ppc64le' }}
       REF_GIT_TAG: none
       RUN_TESTS: ${{ contains(matrix.config.checks, 'tests') }}
@@ -32,6 +33,10 @@ jobs:
           - os: ubuntu-18.04
             compiler: gcc
             library: static
+          - os: ubuntu-18.04
+            compiler: gcc
+            library: shared
+            mini: mini
           - os: ubuntu-18.04
             compiler: gcc
             library: shared
devtools/test-meson-builds.sh +3 -0
index 9ec8e2bc7e..4ed61328b9 100755
@@ -220,6 +220,9 @@ for c in gcc clang ; do
 	done
 done
 
+build build-mini cc skipABI $use_shared -Ddisable_libs=* \
+	-Denable_drivers=bus/vdev,mempool/ring,net/null
+
 # test compilation with minimal x86 instruction set
 # Set the install path for libraries to "lib" explicitly to prevent problems
 # with pkg-config prefixes if installed in "lib/x86_64-linux-gnu" later.
Signature · 1 line
2.23.0
Acked-by on v2 1/5
#21 lore raw

Re: [PATCH v2 1/5] ci: test minimum configuration

17/11/2021 12:28, David Marchand:

Quoted 11 lines

Disabling drivers and optional libraries was not tested. Add a new target in test-meson-builds.sh and GHA with just the minimum to run test-null.sh and any other optional component disabled.

---
Changes since v1:
- dropped target cleanup in test-meson-builds.sh, this will be handled in a separate series in the future,
- disabled all drivers but mempool/ring and net/null, required to pass test-null.sh. bus/vdev is explicitly enabled for

Acked-by on v2 1/5
#22 lore raw

Re: [PATCH v2 1/5] ci: test minimum configuration

In reply to David Marchand
Quoted 4 lines · David Marchand

Disabling drivers and optional libraries was not tested. Add a new target in test-meson-builds.sh and GHA with just the minimum to run test-null.sh and any other optional component disabled.

Quoted 8 lines

---
Changes since v1:
- dropped target cleanup in test-meson-builds.sh, this will be handled in a separate series in the future,
- disabled all drivers but mempool/ring and net/null, required to pass test-null.sh. bus/vdev is explicitly enabled for

#23 lore raw

PATCH v2 2/5 build: make GRO/GSO optional

In reply to David Marchand

GRO and GSO integration in testpmd is relatively self contained and easy to extract.
Those libraries can be made optional as they provide standalone features.

---
 app/test-pmd/cmdline.c   | 14 ++++++++++++++
 app/test-pmd/config.c    |  6 ++++++
 app/test-pmd/csumonly.c  | 35 +++++++++++++++++++++++++++++------
 app/test-pmd/meson.build |  8 +++++++-
 app/test-pmd/testpmd.c   | 14 ++++++++++++++
 app/test-pmd/testpmd.h   | 18 ++++++++++++++++++
 lib/meson.build          |  2 ++
 7 files changed, 90 insertions(+), 7 deletions(-)
app/test-pmd/cmdline.c +14 -0
index 85d9b57a9b..3faa37db6d 100644
@@ -34,7 +34,9 @@
 #include <rte_string_fns.h>
 #include <rte_devargs.h>
 #include <rte_flow.h>
+#ifdef RTE_LIB_GRO
 #include <rte_gro.h>
+#endif
 #include <rte_mbuf_dyn.h>
 
 #include <cmdline_rdline.h>
@@ -458,6 +460,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"tso show (portid)"
 			"    Display the status of TCP Segmentation Offload.\n\n"
 
+#ifdef RTE_LIB_GRO
 			"set port (port_id) gro on|off\n"
 			"    Enable or disable Generic Receive Offload in"
 			" csum forwarding engine.\n\n"
@@ -468,7 +471,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"set gro flush (cycles)\n"
 			"    Set the cycle to flush GROed packets from"
 			" reassembly tables.\n\n"
+#endif
 
+#ifdef RTE_LIB_GSO
 			"set port (port_id) gso (on|off)"
 			"    Enable or disable Generic Segmentation Offload in"
 			" csum forwarding engine.\n\n"
@@ -479,6 +484,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"show port (port_id) gso\n"
 			"    Show GSO configuration.\n\n"
+#endif
 
 			"set fwd (%s)\n"
 			"    Set packet forwarding mode.\n\n"
@@ -5149,6 +5155,7 @@ cmdline_parse_inst_t cmd_tunnel_tso_show = {
 	},
 };
 
+#ifdef RTE_LIB_GRO
 /* *** SET GRO FOR A PORT *** */
 struct cmd_gro_enable_result {
 	cmdline_fixed_string_t cmd_set;
@@ -5292,7 +5299,9 @@ cmdline_parse_inst_t cmd_gro_flush = {
 		NULL,
 	},
 };
+#endif /* RTE_LIB_GRO */
 
+#ifdef RTE_LIB_GSO
 /* *** ENABLE/DISABLE GSO *** */
 struct cmd_gso_enable_result {
 	cmdline_fixed_string_t cmd_set;
@@ -5459,6 +5468,7 @@ cmdline_parse_inst_t cmd_gso_show = {
 		NULL,
 	},
 };
+#endif /* RTE_LIB_GSO */
 
 /* *** ENABLE/DISABLE FLUSH ON RX STREAMS *** */
 struct cmd_set_flush_rx {
@@ -17660,12 +17670,16 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_tso_show,
 	(cmdline_parse_inst_t *)&cmd_tunnel_tso_set,
 	(cmdline_parse_inst_t *)&cmd_tunnel_tso_show,
+#ifdef RTE_LIB_GRO
 	(cmdline_parse_inst_t *)&cmd_gro_enable,
 	(cmdline_parse_inst_t *)&cmd_gro_flush,
 	(cmdline_parse_inst_t *)&cmd_gro_show,
+#endif
+#ifdef RTE_LIB_GSO
 	(cmdline_parse_inst_t *)&cmd_gso_enable,
 	(cmdline_parse_inst_t *)&cmd_gso_size,
 	(cmdline_parse_inst_t *)&cmd_gso_show,
+#endif
 	(cmdline_parse_inst_t *)&cmd_link_flow_control_set,
 	(cmdline_parse_inst_t *)&cmd_link_flow_control_set_rx,
 	(cmdline_parse_inst_t *)&cmd_link_flow_control_set_tx,
app/test-pmd/config.c +6 -0
index 2c2ab449b5..6fca09527b 100644
@@ -48,7 +48,9 @@
 #ifdef RTE_NET_BNXT
 #include <rte_pmd_bnxt.h>
 #endif
+#ifdef RTE_LIB_GRO
 #include <rte_gro.h>
+#endif
 #include <rte_hexdump.h>
 
 #include "testpmd.h"
@@ -4191,6 +4193,7 @@ set_tx_pkt_times(unsigned int *tx_times)
 	tx_pkt_times_intra = tx_times[1];
 }
 
+#ifdef RTE_LIB_GRO
 void
 setup_gro(const char *onoff, portid_t port_id)
 {
@@ -4272,7 +4275,9 @@ show_gro(portid_t port_id)
 	} else
 		printf("Port %u doesn't enable GRO.\n", port_id);
 }
+#endif /* RTE_LIB_GRO */
 
+#ifdef RTE_LIB_GSO
 void
 setup_gso(const char *mode, portid_t port_id)
 {
@@ -4296,6 +4301,7 @@ setup_gso(const char *mode, portid_t port_id)
 		gso_ports[port_id].enable = 0;
 	}
 }
+#endif /* RTE_LIB_GSO */
 
 char*
 list_pkt_forwarding_modes(void)
app/test-pmd/csumonly.c +29 -6
index e0b00abe8c..2aeea243b6 100644
@@ -40,8 +40,12 @@
 #include <rte_prefetch.h>
 #include <rte_string_fns.h>
 #include <rte_flow.h>
+#ifdef RTE_LIB_GRO
 #include <rte_gro.h>
+#endif
+#ifdef RTE_LIB_GSO
 #include <rte_gso.h>
+#endif
 #include <rte_geneve.h>
 
 #include "testpmd.h"
@@ -68,7 +72,9 @@ uint16_t geneve_udp_port = RTE_GENEVE_DEFAULT_PORT;
 /* structure that caches offload info for the current packet */
 struct testpmd_offload_info {
 	uint16_t ethertype;
+#ifdef RTE_LIB_GSO
 	uint8_t gso_enable;
+#endif
 	uint16_t l2_len;
 	uint16_t l3_len;
 	uint16_t l4_len;
@@ -510,8 +516,10 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 						info->ethertype);
 			}
 		}
+#ifdef RTE_LIB_GSO
 		if (info->gso_enable)
 			ol_flags |= RTE_MBUF_F_TX_UDP_SEG;
+#endif
 	} else if (info->l4_proto == IPPROTO_TCP) {
 		tcp_hdr = (struct rte_tcp_hdr *)((char *)l3_hdr + info->l3_len);
 		if (tso_segsz)
@@ -524,8 +532,10 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 				get_udptcp_checksum(l3_hdr, tcp_hdr,
 					info->ethertype);
 		}
+#ifdef RTE_LIB_GSO
 		if (info->gso_enable)
 			ol_flags |= RTE_MBUF_F_TX_TCP_SEG;
+#endif
 	} else if (info->l4_proto == IPPROTO_SCTP) {
 		sctp_hdr = (struct rte_sctp_hdr *)
 			((char *)l3_hdr + info->l3_len);
@@ -794,16 +804,20 @@ static void
 pkt_burst_checksum_forward(struct fwd_stream *fs)
 {
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
+#ifdef RTE_LIB_GSO
 	struct rte_mbuf *gso_segments[GSO_MAX_PKT_BURST];
 	struct rte_gso_ctx *gso_ctx;
+#endif
 	struct rte_mbuf **tx_pkts_burst;
 	struct rte_port *txp;
 	struct rte_mbuf *m, *p;
 	struct rte_ether_hdr *eth_hdr;
 	void *l3_hdr = NULL, *outer_l3_hdr = NULL; /* can be IPv4 or IPv6 */
+#ifdef RTE_LIB_GRO
 	void **gro_ctx;
 	uint16_t gro_pkts_num;
 	uint8_t gro_enable;
+#endif
 	uint16_t nb_rx;
 	uint16_t nb_tx;
 	uint16_t nb_prep;
@@ -816,8 +830,6 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	uint32_t rx_bad_outer_l4_csum;
 	uint32_t rx_bad_outer_ip_csum;
 	struct testpmd_offload_info info;
-	uint16_t nb_segments = 0;
-	int ret;
 
 	uint64_t start_tsc = 0;
 
@@ -835,15 +847,19 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	rx_bad_l4_csum = 0;
 	rx_bad_outer_l4_csum = 0;
 	rx_bad_outer_ip_csum = 0;
+#ifdef RTE_LIB_GRO
 	gro_enable = gro_ports[fs->rx_port].enable;
+#endif
 
 	txp = &ports[fs->tx_port];
 	tx_offloads = txp->dev_conf.txmode.offloads;
 	memset(&info, 0, sizeof(info));
 	info.tso_segsz = txp->tso_segsz;
 	info.tunnel_tso_segsz = txp->tunnel_tso_segsz;
+#ifdef RTE_LIB_GSO
 	if (gso_ports[fs->tx_port].enable)
 		info.gso_enable = 1;
+#endif
 
 	for (i = 0; i < nb_rx; i++) {
 		if (likely(i < nb_rx - 1))
@@ -1052,6 +1068,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 		}
 	}
 
+#ifdef RTE_LIB_GRO
 	if (unlikely(gro_enable)) {
 		if (gro_flush_cycles == GRO_DEFAULT_FLUSH_CYCLES) {
 			nb_rx = rte_gro_reassemble_burst(pkts_burst, nb_rx,
@@ -1073,13 +1090,17 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			}
 		}
 	}
+#endif
+
+#ifdef RTE_LIB_GSO
+	if (gso_ports[fs->tx_port].enable != 0) {
+		uint16_t nb_segments = 0;
 
-	if (gso_ports[fs->tx_port].enable == 0)
-		tx_pkts_burst = pkts_burst;
-	else {
 		gso_ctx = &(current_fwd_lcore()->gso_ctx);
 		gso_ctx->gso_size = gso_max_segment_size;
 		for (i = 0; i < nb_rx; i++) {
+			int ret;
+
 			ret = rte_gso_segment(pkts_burst[i], gso_ctx,
 					&gso_segments[nb_segments],
 					GSO_MAX_PKT_BURST - nb_segments);
@@ -1101,7 +1122,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 
 		tx_pkts_burst = gso_segments;
 		nb_rx = nb_segments;
-	}
+	} else
+#endif
+		tx_pkts_burst = pkts_burst;
 
 	nb_prep = rte_eth_tx_prepare(fs->tx_port, fs->tx_queue,
 			tx_pkts_burst, nb_rx);
app/test-pmd/meson.build +7 -1
index d5df52c470..eba03b572c 100644
@@ -32,7 +32,7 @@ if dpdk_conf.has('RTE_HAS_JANSSON')
     ext_deps += jansson_dep
 endif
 
-deps += ['ethdev', 'gro', 'gso', 'cmdline', 'metrics', 'bus_pci']
+deps += ['ethdev', 'cmdline', 'metrics', 'bus_pci']
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
     deps += 'crypto_scheduler'
 endif
@@ -43,6 +43,12 @@ if dpdk_conf.has('RTE_LIB_BPF')
     sources += files('bpf_cmd.c')
     deps += 'bpf'
 endif
+if dpdk_conf.has('RTE_LIB_GRO')
+    deps += 'gro'
+endif
+if dpdk_conf.has('RTE_LIB_GSO')
+    deps += 'gso'
+endif
 if dpdk_conf.has('RTE_LIB_LATENCYSTATS')
     deps += 'latencystats'
 endif
app/test-pmd/testpmd.c +14 -0
index 59cc4580b2..f74ba61be6 100644
@@ -517,8 +517,10 @@ lcoreid_t bitrate_lcore_id;
 uint8_t bitrate_enabled;
 #endif
 
+#ifdef RTE_LIB_GRO
 struct gro_status gro_ports[RTE_MAX_ETHPORTS];
 uint8_t gro_flush_cycles = GRO_DEFAULT_FLUSH_CYCLES;
+#endif
 
 /*
  * hexadecimal bitmask of RX mq mode can be enabled.
@@ -657,8 +659,10 @@ static void fill_xstats_display_info(void);
  */
 static int all_ports_started(void);
 
+#ifdef RTE_LIB_GSO
 struct gso_status gso_ports[RTE_MAX_ETHPORTS];
 uint16_t gso_max_segment_size = RTE_ETHER_MAX_LEN - RTE_ETHER_CRC_LEN;
+#endif
 
 /* Holds the registered mbuf dynamic flags names. */
 char dynf_names[64][RTE_MBUF_DYN_NAMESIZE];
@@ -1632,8 +1636,12 @@ init_config(void)
 	struct rte_mempool *mbp;
 	unsigned int nb_mbuf_per_pool;
 	lcoreid_t  lc_id;
+#ifdef RTE_LIB_GRO
 	struct rte_gro_param gro_param;
+#endif
+#ifdef RTE_LIB_GSO
 	uint32_t gso_types;
+#endif
 
 	/* Configuration of logical cores. */
 	fwd_lcores = rte_zmalloc("testpmd: fwd_lcores",
@@ -1716,8 +1724,10 @@ init_config(void)
 
 	init_port_config();
 
+#ifdef RTE_LIB_GSO
 	gso_types = RTE_ETH_TX_OFFLOAD_TCP_TSO | RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO |
 		RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO | RTE_ETH_TX_OFFLOAD_UDP_TSO;
+#endif
 	/*
 	 * Records which Mbuf pool to use by each logical core, if needed.
 	 */
@@ -1728,6 +1738,7 @@ init_config(void)
 		if (mbp == NULL)
 			mbp = mbuf_pool_find(0, 0);
 		fwd_lcores[lc_id]->mbp = mbp;
+#ifdef RTE_LIB_GSO
 		/* initialize GSO context */
 		fwd_lcores[lc_id]->gso_ctx.direct_pool = mbp;
 		fwd_lcores[lc_id]->gso_ctx.indirect_pool = mbp;
@@ -1735,10 +1746,12 @@ init_config(void)
 		fwd_lcores[lc_id]->gso_ctx.gso_size = RTE_ETHER_MAX_LEN -
 			RTE_ETHER_CRC_LEN;
 		fwd_lcores[lc_id]->gso_ctx.flag = 0;
+#endif
 	}
 
 	fwd_config_setup();
 
+#ifdef RTE_LIB_GRO
 	/* create a gro context for each lcore */
 	gro_param.gro_types = RTE_GRO_TCP_IPV4;
 	gro_param.max_flow_num = GRO_MAX_FLUSH_CYCLES;
@@ -1752,6 +1765,7 @@ init_config(void)
 					"rte_gro_ctx_create() failed\n");
 		}
 	}
+#endif
 }
 
 
app/test-pmd/testpmd.h +18 -0
index 669ce1e87d..b1dfd097c7 100644
@@ -9,8 +9,12 @@
 
 #include <rte_pci.h>
 #include <rte_bus_pci.h>
+#ifdef RTE_LIB_GRO
 #include <rte_gro.h>
+#endif
+#ifdef RTE_LIB_GSO
 #include <rte_gso.h>
+#endif
 #include <rte_os_shim.h>
 #include <cmdline.h>
 #include <sys/queue.h>
@@ -143,7 +147,9 @@ struct fwd_stream {
 	/**< received packets has bad outer l4 checksum */
 	uint64_t rx_bad_outer_ip_csum;
 	/**< received packets having bad outer ip checksum */
+#ifdef RTE_LIB_GRO
 	unsigned int gro_times;	/**< GRO operation times */
+#endif
 	uint64_t     core_cycles; /**< used for RX and TX processing */
 	struct pkt_burst_stats rx_burst_stats;
 	struct pkt_burst_stats tx_burst_stats;
@@ -264,9 +270,13 @@ struct rte_port {
  * CPU id. configuration table.
  */
 struct fwd_lcore {
+#ifdef RTE_LIB_GSO
 	struct rte_gso_ctx gso_ctx;     /**< GSO context */
+#endif
 	struct rte_mempool *mbp; /**< The mbuf pool to use by this core */
+#ifdef RTE_LIB_GRO
 	void *gro_ctx;		/**< GRO context */
+#endif
 	streamid_t stream_idx;   /**< index of 1st stream in "fwd_streams" */
 	streamid_t stream_nb;    /**< number of streams in "fwd_streams" */
 	lcoreid_t  cpuid_idx;    /**< index of logical core in CPU id table */
@@ -560,6 +570,7 @@ extern struct rte_ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS];
 extern uint32_t burst_tx_delay_time; /**< Burst tx delay time(us) for mac-retry. */
 extern uint32_t burst_tx_retry_num;  /**< Burst tx retry number for mac-retry. */
 
+#ifdef RTE_LIB_GRO
 #define GRO_DEFAULT_ITEM_NUM_PER_FLOW 32
 #define GRO_DEFAULT_FLOW_NUM (RTE_GRO_MAX_BURST_ITEM_NUM / \
 		GRO_DEFAULT_ITEM_NUM_PER_FLOW)
@@ -573,13 +584,16 @@ struct gro_status {
 };
 extern struct gro_status gro_ports[RTE_MAX_ETHPORTS];
 extern uint8_t gro_flush_cycles;
+#endif /* RTE_LIB_GRO */
 
+#ifdef RTE_LIB_GSO
 #define GSO_MAX_PKT_BURST 2048
 struct gso_status {
 	uint8_t enable;
 };
 extern struct gso_status gso_ports[RTE_MAX_ETHPORTS];
 extern uint16_t gso_max_segment_size;
+#endif /* RTE_LIB_GSO */
 
 /* VXLAN encap/decap parameters. */
 struct vxlan_encap_conf {
@@ -1006,10 +1020,14 @@ void port_rss_hash_key_update(portid_t port_id, char rss_type[],
 			      uint8_t *hash_key, uint8_t hash_key_len);
 int rx_queue_id_is_invalid(queueid_t rxq_id);
 int tx_queue_id_is_invalid(queueid_t txq_id);
+#ifdef RTE_LIB_GRO
 void setup_gro(const char *onoff, portid_t port_id);
 void setup_gro_flush_cycles(uint8_t cycles);
 void show_gro(portid_t port_id);
+#endif
+#ifdef RTE_LIB_GSO
 void setup_gso(const char *mode, portid_t port_id);
+#endif
 int eth_dev_info_get_print_err(uint16_t port_id,
 			struct rte_eth_dev_info *dev_info);
 int eth_dev_conf_get_print_err(uint16_t port_id,
lib/meson.build +2 -0
index 8537a5ab80..2766c02bd2 100644
@@ -66,6 +66,8 @@ libraries = [
 ]
 
 optional_libs = [
+        'gro',
+        'gso',
         'kni',
         'power',
         'vhost',
Signature · 1 line
2.23.0
#24 lore raw

PATCH v2 3/5 build: make metrics libraries optional

In reply to David Marchand

metrics, bitratestats, jobstats and latencystats libraries can be made optional as they provide standalone features.

---
 app/proc-info/main.c      | 16 ++++++++++++++++
 app/proc-info/meson.build |  5 ++++-
 app/test-pmd/meson.build  |  5 ++++-
 app/test-pmd/testpmd.c    |  4 ++++
 app/test/meson.build      | 24 +++++++++++++++---------
 lib/meson.build           |  4 ++++
 6 files changed, 47 insertions(+), 11 deletions(-)
app/proc-info/main.c +16 -0
index ebe2d77264..ce140aaf84 100644
@@ -29,7 +29,9 @@
 #include <rte_log.h>
 #include <rte_branch_prediction.h>
 #include <rte_string_fns.h>
+#ifdef RTE_LIB_METRICS
 #include <rte_metrics.h>
+#endif
 #include <rte_cycles.h>
 #ifdef RTE_LIB_SECURITY
 #include <rte_security.h>
@@ -58,8 +60,10 @@ static uint32_t enable_collectd_format;
 static int stdout_fd;
 /**< Host id process is running on */
 static char host_id[MAX_LONG_OPT_SZ];
+#ifdef RTE_LIB_METRICS
 /**< Enable metrics. */
 static uint32_t enable_metrics;
+#endif
 /**< Enable stats reset. */
 static uint32_t reset_stats;
 /**< Enable xstats reset. */
@@ -107,8 +111,10 @@ proc_info_usage(const char *prgname)
 		"  --stats: to display port statistics, enabled by default\n"
 		"  --xstats: to display extended port statistics, disabled by "
 			"default\n"
+#ifdef RTE_LIB_METRICS
 		"  --metrics: to display derived metrics of the ports, disabled by "
 			"default\n"
+#endif
 		"  --xstats-name NAME: to display single xstat id by NAME\n"
 		"  --xstats-ids IDLIST: to display xstat values by id. "
 			"The argument is comma-separated list of xstat ids to print out.\n"
@@ -217,7 +223,9 @@ proc_info_parse_args(int argc, char **argv)
 		{"stats", 0, NULL, 0},
 		{"stats-reset", 0, NULL, 0},
 		{"xstats", 0, NULL, 0},
+#ifdef RTE_LIB_METRICS
 		{"metrics", 0, NULL, 0},
+#endif
 		{"xstats-reset", 0, NULL, 0},
 		{"xstats-name", required_argument, NULL, 1},
 		{"collectd-format", 0, NULL, 0},
@@ -259,10 +267,12 @@ proc_info_parse_args(int argc, char **argv)
 			else if (!strncmp(long_option[option_index].name, "xstats",
 					MAX_LONG_OPT_SZ))
 				enable_xstats = 1;
+#ifdef RTE_LIB_METRICS
 			else if (!strncmp(long_option[option_index].name,
 					"metrics",
 					MAX_LONG_OPT_SZ))
 				enable_metrics = 1;
+#endif
 			/* Reset stats */
 			if (!strncmp(long_option[option_index].name, "stats-reset",
 					MAX_LONG_OPT_SZ))
@@ -592,6 +602,7 @@ nic_xstats_clear(uint16_t port_id)
 	printf("\n  NIC extended statistics for port %d cleared\n", port_id);
 }
 
+#ifdef RTE_LIB_METRICS
 static void
 metrics_display(int port_id)
 {
@@ -652,6 +663,7 @@ metrics_display(int port_id)
 	rte_free(metrics);
 	rte_free(names);
 }
+#endif
 
 static void
 show_security_context(uint16_t portid, bool inline_offload)
@@ -1521,14 +1533,18 @@ main(int argc, char **argv)
 		else if (nb_xstats_ids > 0)
 			nic_xstats_by_ids_display(i, xstats_ids,
 						  nb_xstats_ids);
+#ifdef RTE_LIB_METRICS
 		else if (enable_metrics)
 			metrics_display(i);
+#endif
 
 	}
 
+#ifdef RTE_LIB_METRICS
 	/* print port independent stats */
 	if (enable_metrics)
 		metrics_display(RTE_METRICS_GLOBAL);
+#endif
 
 	/* show information for PMD */
 	if (enable_shw_port)
app/proc-info/meson.build +4 -1
index 1062e0ef86..1563ce656a 100644
@@ -8,4 +8,7 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['ethdev', 'metrics', 'security']
+deps += ['ethdev', 'security']
+if dpdk_conf.has('RTE_LIB_METRICS')
+    deps += 'metrics'
+endif
app/test-pmd/meson.build +4 -1
index eba03b572c..43130c8856 100644
@@ -32,7 +32,7 @@ if dpdk_conf.has('RTE_HAS_JANSSON')
     ext_deps += jansson_dep
 endif
 
-deps += ['ethdev', 'cmdline', 'metrics', 'bus_pci']
+deps += ['ethdev', 'cmdline', 'bus_pci']
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
     deps += 'crypto_scheduler'
 endif
@@ -52,6 +52,9 @@ endif
 if dpdk_conf.has('RTE_LIB_LATENCYSTATS')
     deps += 'latencystats'
 endif
+if dpdk_conf.has('RTE_LIB_METRICS')
+    deps += 'metrics'
+endif
 if dpdk_conf.has('RTE_LIB_PDUMP')
     deps += 'pdump'
 endif
app/test-pmd/testpmd.c +4 -0
index f74ba61be6..ba65342b6d 100644
@@ -54,7 +54,9 @@
 #include <rte_pdump.h>
 #endif
 #include <rte_flow.h>
+#ifdef RTE_LIB_METRICS
 #include <rte_metrics.h>
+#endif
 #ifdef RTE_LIB_BITRATESTATS
 #include <rte_bitrate.h>
 #endif
@@ -4242,8 +4244,10 @@ main(int argc, char** argv)
 				port_id, rte_strerror(-ret));
 	}
 
+#ifdef RTE_LIB_METRICS
 	/* Init metrics library */
 	rte_metrics_init(rte_socket_id());
+#endif
 
 #ifdef RTE_LIB_LATENCYSTATS
 	if (latencystats_enabled != 0) {
app/test/meson.build +15 -9
index 2191a5e146..0d261b1138 100644
@@ -98,7 +98,6 @@ test_sources = files(
         'test_mempool_perf.c',
         'test_memzone.c',
         'test_meter.c',
-        'test_metrics.c',
         'test_mcslock.c',
         'test_mp_secondary.c',
         'test_per_lcore.c',
@@ -162,7 +161,6 @@ test_deps = [
         'acl',
         'bus_pci',
         'bus_vdev',
-        'bitratestats',
         'bpf',
         'cfgfile',
         'cmdline',
@@ -177,10 +175,8 @@ test_deps = [
         'graph',
         'hash',
         'ipsec',
-        'latencystats',
         'lpm',
         'member',
-        'metrics',
         'node',
         'pipeline',
         'port',
@@ -280,7 +276,6 @@ fast_tests = [
         ['kni_autotest', false],
         ['kvargs_autotest', true],
         ['member_autotest', true],
-        ['metrics_autotest', true],
         ['power_cpufreq_autotest', false],
         ['power_autotest', true],
         ['power_kvm_vm_autotest', false],
@@ -385,6 +380,11 @@ endif
 if dpdk_conf.has('RTE_EVENT_SKELETON')
     test_deps += 'event_skeleton'
 endif
+if dpdk_conf.has('RTE_LIB_METRICS')
+    test_deps += 'metrics'
+    test_sources += ['test_metrics.c']
+    fast_tests += [['metrics_autotest', true]]
+endif
 if dpdk_conf.has('RTE_LIB_TELEMETRY')
     test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c']
     fast_tests += [['telemetry_json_autotest', true], ['telemetry_data_autotest', true]]
@@ -406,16 +406,22 @@ if dpdk_conf.has('RTE_NET_RING')
     test_sources += 'test_pmd_ring_perf.c'
     test_sources += 'test_pmd_ring.c'
     test_sources += 'test_event_eth_tx_adapter.c'
-    test_sources += 'test_bitratestats.c'
-    test_sources += 'test_latencystats.c'
     test_sources += 'sample_packet_forward.c'
     test_sources += 'test_pdump.c'
     fast_tests += [['ring_pmd_autotest', true]]
     perf_test_names += 'ring_pmd_perf_autotest'
     fast_tests += [['event_eth_tx_adapter_autotest', false]]
-    fast_tests += [['bitratestats_autotest', true]]
-    fast_tests += [['latencystats_autotest', true]]
     fast_tests += [['pdump_autotest', true]]
+    if dpdk_conf.has('RTE_LIB_BITRATESTATS')
+        test_deps += 'bitratestats'
+        test_sources += 'test_bitratestats.c'
+        fast_tests += [['bitratestats_autotest', true]]
+    endif
+    if dpdk_conf.has('RTE_LIB_LATENCYSTATS')
+        test_deps += 'latencystats'
+        test_sources += 'test_latencystats.c'
+        fast_tests += [['latencystats_autotest', true]]
+    endif
 endif
 
 if dpdk_conf.has('RTE_HAS_LIBPCAP')
lib/meson.build +4 -0
index 2766c02bd2..961b95f4ad 100644
@@ -66,9 +66,13 @@ libraries = [
 ]
 
 optional_libs = [
+        'bitratestats',
         'gro',
         'gso',
         'kni',
+        'jobstats',
+        'latencystats',
+        'metrics',
         'power',
         'vhost',
 ]
Signature · 1 line
2.23.0
#25 lore raw

PATCH v2 4/5 build: make pdump optional

In reply to David Marchand

This library can be made optional.
dumpcap and pdump applications depend on this library, check for dependencies like what we have for examples.

---
 app/meson.build      | 18 +++++++++++++-----
 app/test/meson.build | 10 +++++-----
 lib/meson.build      |  1 +
 3 files changed, 19 insertions(+), 10 deletions(-)
app/meson.build +13 -5
index 310e83076f..93d8c15032 100644
@@ -43,15 +43,23 @@ foreach app:apps
 
     subdir(name)
 
+    if build
+        dep_objs = []
+        foreach d:deps
+            var_name = get_option('default_library') + '_rte_' + d
+            if not is_variable(var_name)
+                build = false
+                message('Missing dependency "@0@" for app "@1@"'.format(d, name))
+                break
+            endif
+            dep_objs += [get_variable(var_name)]
+        endforeach
+    endif
+
     if not build
         continue
     endif
 
-    dep_objs = []
-    foreach d:deps
-        dep_objs += get_variable(get_option('default_library') + '_rte_' + d)
-    endforeach
-
     link_libs = []
     if get_option('default_library') == 'static'
         link_libs = dpdk_static_libraries + dpdk_drivers
app/test/meson.build +5 -5
index 0d261b1138..961bebc5cb 100644
@@ -407,11 +407,9 @@ if dpdk_conf.has('RTE_NET_RING')
     test_sources += 'test_pmd_ring.c'
     test_sources += 'test_event_eth_tx_adapter.c'
     test_sources += 'sample_packet_forward.c'
-    test_sources += 'test_pdump.c'
     fast_tests += [['ring_pmd_autotest', true]]
     perf_test_names += 'ring_pmd_perf_autotest'
     fast_tests += [['event_eth_tx_adapter_autotest', false]]
-    fast_tests += [['pdump_autotest', true]]
     if dpdk_conf.has('RTE_LIB_BITRATESTATS')
         test_deps += 'bitratestats'
         test_sources += 'test_bitratestats.c'
@@ -422,6 +420,11 @@ if dpdk_conf.has('RTE_NET_RING')
         test_sources += 'test_latencystats.c'
         fast_tests += [['latencystats_autotest', true]]
     endif
+    if dpdk_conf.has('RTE_LIB_PDUMP')
+        test_deps += 'pdump'
+        test_sources += 'test_pdump.c'
+        fast_tests += [['pdump_autotest', true]]
+    endif
 endif
 
 if dpdk_conf.has('RTE_HAS_LIBPCAP')
@@ -438,9 +441,6 @@ endif
 if dpdk_conf.has('RTE_LIB_KNI')
     test_deps += 'kni'
 endif
-if dpdk_conf.has('RTE_LIB_PDUMP')
-    test_deps += 'pdump'
-endif
 
 if cc.has_argument('-Wno-format-truncation')
     cflags += '-Wno-format-truncation'
lib/meson.build +1 -0
index 961b95f4ad..dad9fce14d 100644
@@ -73,6 +73,7 @@ optional_libs = [
         'jobstats',
         'latencystats',
         'metrics',
+        'pdump',
         'power',
         'vhost',
 ]
Signature · 1 line
2.23.0
#26 lore raw

PATCH v2 5/5 build: select optional libraries

In reply to David Marchand

There is currently no way to know which libraries are optional. Introduce a enable_libs option (close to what we have for drivers) so that packagers or projects consuming DPDK can more easily select the optional libraries that matter to them and disable other optional libraries.

Note: the enabled_libs variable is renamed for sake of consistency.

---
 buildtools/chkincs/meson.build |  2 +-
 lib/meson.build                | 34 ++++++++++++++++++----------------
 meson.build                    |  3 ++-
 meson_options.txt              |  2 ++
 4 files changed, 23 insertions(+), 18 deletions(-)
buildtools/chkincs/meson.build +1 -1
index 5ffca89761..6b93d5f46c 100644
@@ -18,7 +18,7 @@ sources = files('main.c')
 sources += gen_c_files.process(dpdk_chkinc_headers)
 
 deps = []
-foreach l:enabled_libs
+foreach l:dpdk_libs_enabled
     deps += get_variable('static_rte_' + l)
 endforeach
 
lib/meson.build +18 -16
index dad9fce14d..47c857c0fc 100644
@@ -78,17 +78,10 @@ optional_libs = [
         'vhost',
 ]
 
-disabled_libs = []
-opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'),
+enable_libs = run_command(list_dir_globs, get_option('enable_libs'),
+        check: true).stdout().split()
+disable_libs = run_command(list_dir_globs, get_option('disable_libs'),
         check: true).stdout().split()
-foreach l:opt_disabled_libs
-    if not optional_libs.contains(l)
-        warning('Cannot disable mandatory library "@0@"'.format(l))
-        continue
-    endif
-    disabled_libs += l
-endforeach
-
 
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
@@ -98,8 +91,6 @@ if cc.has_argument('-Wno-format-truncation')
     default_cflags += '-Wno-format-truncation'
 endif
 
-enabled_libs = [] # used to print summary at the end
-
 foreach l:libraries
     build = true
     reason = '<unknown reason>' # set if build == false to explain why
@@ -123,10 +114,21 @@ foreach l:libraries
         deps += ['eal']
     endif
 
-    if disabled_libs.contains(l)
-        build = false
-        reason = 'explicitly disabled via build config'
+    if optional_libs.contains(l)
+        # check for enabled libraries only if one is set in config
+        if enable_libs.length() != 0 and not enable_libs.contains(l)
+            build = false
+            reason = 'not in enabled libraries build config'
+        elif disable_libs.contains(l)
+            build = false
+            reason = 'explicitly disabled via build config'
+        endif
     else
+        if disable_libs.contains(l)
+            warning('Cannot disable mandatory library "@0@"'.format(l))
+        endif
+    endif
+    if build
         subdir(l)
     endif
     if name != l
@@ -150,7 +152,7 @@ foreach l:libraries
         static_deps += [get_variable('static_rte_' + d)]
     endforeach
 
-    enabled_libs += name
+    dpdk_libs_enabled += name
     dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1)
     install_headers(headers)
     install_headers(indirect_headers)
meson.build +2 -1
index 12cb6e0e83..65855ceee8 100644
@@ -35,6 +35,7 @@ dpdk_driver_classes = []
 dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
+dpdk_libs_enabled = []
 dpdk_drvs_disabled = []
 abi_version_file = files('ABI_VERSION')
 
@@ -102,7 +103,7 @@ subdir('buildtools/pkg-config')
 output_message = '\n=================\nLibraries Enabled\n=================\n'
 output_message += '\nlibs:\n\t'
 output_count = 0
-foreach lib:enabled_libs
+foreach lib:dpdk_libs_enabled
     output_message += lib + ', '
     output_count += 1
     if output_count == 8
meson_options.txt +2 -0
index 7c220ad68d..ccb92cff7a 100644
@@ -16,6 +16,8 @@ option('enable_docs', type: 'boolean', value: false, description:
        'build documentation')
 option('enable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to build. If unspecified, build all drivers.')
+option('enable_libs', type: 'string', value: '', description:
+       'Comma-separated list of libraries to explicitly enable.')
 option('enable_driver_sdk', type: 'boolean', value: false, description:
        'Install headers to build drivers.')
 option('enable_kmods', type: 'boolean', value: false, description:
Signature · 1 line
2.23.0
#27 lore raw

PATCH v3 1/1 build: select optional libraries

There is currently no way to know which libraries are optional. Introduce a enable_libs option (close to what we have for drivers) so that packagers or projects consuming DPDK can more easily select the optional libraries that matter to them and disable other optional libraries.

Deprecated libraries are handled via some logic in lib/meson.build rather than a default value in meson_options.txt. Enabling deprecated libraries is achieved by requesting all libraries to be built in the CI.

kni dependency to IOVA configuration is moved to its own meson.build.

Note: the enabled_libs variable is renamed for sake of consistency wrt to drivers and applications similar variables.

---
The topic was raised again while Stephen was reviewing stale patches in patchwork. The idea of this patch is the same as before.
I simply rebased the change (and dealt with the deprecated libraries that added some little complication).

Changes since v2:
- moved the IOVA check for kni build in lib/kni/meson.build,
- reworked deprecated libraries handling by only considering them when no enable_libs option is set. With this, no need for a default value in meson_options.txt, yet configurations in the CI must be adjusted,
- moved mandatory libraries check after enable/disable_libs evaluation,

---
 .ci/linux-build.sh             |  2 +-
 app/test/meson.build           |  2 +-
 buildtools/chkincs/meson.build |  2 +-
 devtools/test-meson-builds.sh  |  4 ++--
 lib/kni/meson.build            |  5 ++++
 lib/meson.build                | 44 ++++++++++++++++++++--------------
 meson.build                    |  3 ++-
 meson_options.txt              |  4 +++-
 8 files changed, 41 insertions(+), 25 deletions(-)
.ci/linux-build.sh +1 -1
index 9631e342b5..a4e474a900 100755
@@ -97,7 +97,7 @@ if [ "$MINI" = "true" ]; then
     OPTS="$OPTS -Denable_drivers=net/null"
     OPTS="$OPTS -Ddisable_libs=*"
 else
-    OPTS="$OPTS -Ddisable_libs="
+    OPTS="$OPTS -Denable_libs=*"
 fi
 
 if [ "$ASAN" = "true" ]; then
app/test/meson.build +1 -1
index d0fabcbb8b..f3217ae577 100644
@@ -152,7 +152,7 @@ test_sources = files(
         'virtual_pmd.c',
 )
 
-test_deps = enabled_libs
+test_deps = dpdk_libs_enabled
 # as well as libs, the pci and vdev bus drivers are needed for a lot of tests
 test_deps += ['bus_pci', 'bus_vdev']
 
buildtools/chkincs/meson.build +1 -1
index 378c2f19ef..f2dadcae18 100644
@@ -22,7 +22,7 @@ sources += gen_c_files.process(dpdk_chkinc_headers)
 # so we always include them in deps list
 deps = [get_variable('shared_rte_bus_vdev'), get_variable('shared_rte_bus_pci')]
 # add the rest of the libs to the dependencies
-foreach l:enabled_libs
+foreach l:dpdk_libs_enabled
     deps += get_variable('shared_rte_' + l)
 endforeach
 
devtools/test-meson-builds.sh +2 -2
index 9131088c9d..4f93702e1f 100755
@@ -122,8 +122,8 @@ config () # <dir> <builddir> <meson options>
 	options=
 	# deprecated libs may be disabled by default, so for complete builds ensure
 	# no libs are disabled
-	if ! echo $* | grep -q -- 'disable_libs' ; then
-		options="$options -Ddisable_libs="
+	if ! echo $* | grep -q -- 'enable_libs' ; then
+		options="$options -Denable_libs=*"
 	fi
 	if echo $* | grep -qw -- '--default-library=shared' ; then
 		options="$options -Dexamples=all"
lib/kni/meson.build +5 -0
index 8a71d8ba6f..5ce410f7f2 100644
@@ -7,6 +7,11 @@ if is_windows
     subdir_done()
 endif
 
+if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
+    build = false
+    reason = 'requires IOVA in mbuf (set enable_iova_as_pa option)'
+endif
+
 if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
     build = false
     reason = 'only supported on 64-bit Linux'
lib/meson.build +26 -18

74 lines not on this page · raw message

meson.build +2 -1
index 992ca91e88..39cb73846d 100644
@@ -44,6 +44,7 @@ dpdk_extra_ldflags = []
 dpdk_libs_deprecated = []
 dpdk_apps_disabled = []
 dpdk_libs_disabled = []
+dpdk_libs_enabled = []
 dpdk_drvs_disabled = []
 testpmd_drivers_sources = []
 testpmd_drivers_deps = []
@@ -134,7 +135,7 @@ message(output_message + '\n')
 output_message = '\n=================\nLibraries Enabled\n=================\n'
 output_message += '\nlibs:\n\t'
 output_count = 0
-foreach lib:enabled_libs
+foreach lib:dpdk_libs_enabled
     output_message += lib + ', '
     output_count += 1
     if output_count == 8
meson_options.txt +3 -1
index 82c8297065..af54f8b8d4 100644
@@ -10,7 +10,7 @@ option('disable_apps', type: 'string', value: '', description:
        'Comma-separated list of apps to explicitly disable.')
 option('disable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to explicitly disable.')
-option('disable_libs', type: 'string', value: 'flow_classify,kni', description:
+option('disable_libs', type: 'string', value: '', description:
        'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>', description:
        'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
@@ -20,6 +20,8 @@ option('enable_apps', type: 'string', value: '', description:
        'Comma-separated list of apps to build. If unspecified, build all apps.')
 option('enable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to build. If unspecified, build all drivers.')
+option('enable_libs', type: 'string', value: '', description:
+       'Comma-separated list of libraries to explicitly enable.')
 option('enable_driver_sdk', type: 'boolean', value: false, description:
        'Install headers to build drivers.')
 option('enable_kmods', type: 'boolean', value: false, description:
Signature · 1 line
2.40.1
#28 lore raw

Re: [PATCH v3] build: select optional libraries

Quoted 11 lines · David Marchand

There is currently no way to know which libraries are optional. Introduce a enable_libs option (close to what we have for drivers) so that packagers or projects consuming DPDK can more easily select the optional libraries that matter to them and disable other optional libraries.

Deprecated libraries are handled via some logic in lib/meson.build rather than a default value in meson_options.txt. Enabling deprecated libraries is achieved by requesting all libraries to be built in the CI.

Quoted 7 lines

kni dependency to IOVA configuration is moved to its own meson.build.

Note: the enabled_libs variable is renamed for sake of consistency wrt to drivers and applications similar variables.

---

Thanks David.
Some comments inline below just on the usability aspects of this.

/Bruce

Quoted 106 lines

The topic was raised again while Stephen was reviewing stale patches in patchwork. The idea of this patch is the same as before.
I simply rebased the change (and dealt with the deprecated libraries that added some little complication).

Changes since v2:
- moved the IOVA check for kni build in lib/kni/meson.build,
- reworked deprecated libraries handling by only considering them when no enable_libs option is set. With this, no need for a default value in meson_options.txt, yet configurations in the CI must be adjusted,
- moved mandatory libraries check after enable/disable_libs evaluation,

---
 .ci/linux-build.sh             |  2 +-
 app/test/meson.build           |  2 +-
 buildtools/chkincs/meson.build |  2 +-
 devtools/test-meson-builds.sh  |  4 ++--
 lib/kni/meson.build            |  5 ++++
 lib/meson.build                | 44 ++++++++++++++++++++--------------
 meson.build                    |  3 ++-
 meson_options.txt              |  4 +++-
 8 files changed, 41 insertions(+), 25 deletions(-)
.ci/linux-build.sh +1 -1
index 9631e342b5..a4e474a900 100755
@@ -97,7 +97,7 @@ if [ "$MINI" = "true" ]; then
     OPTS="$OPTS -Denable_drivers=net/null"
     OPTS="$OPTS -Ddisable_libs=*"
 else
-    OPTS="$OPTS -Ddisable_libs="
+    OPTS="$OPTS -Denable_libs=*"
 fi
 
 if [ "$ASAN" = "true" ]; then
app/test/meson.build +1 -1
index d0fabcbb8b..f3217ae577 100644
@@ -152,7 +152,7 @@ test_sources = files(
         'virtual_pmd.c',
 )
 
-test_deps = enabled_libs
+test_deps = dpdk_libs_enabled
 # as well as libs, the pci and vdev bus drivers are needed for a lot of tests
 test_deps += ['bus_pci', 'bus_vdev']
 
buildtools/chkincs/meson.build +1 -1
index 378c2f19ef..f2dadcae18 100644
@@ -22,7 +22,7 @@ sources += gen_c_files.process(dpdk_chkinc_headers)
 # so we always include them in deps list
 deps = [get_variable('shared_rte_bus_vdev'), get_variable('shared_rte_bus_pci')]
 # add the rest of the libs to the dependencies
-foreach l:enabled_libs
+foreach l:dpdk_libs_enabled
     deps += get_variable('shared_rte_' + l)
 endforeach
 
devtools/test-meson-builds.sh +2 -2
index 9131088c9d..4f93702e1f 100755
@@ -122,8 +122,8 @@ config () # <dir> <builddir> <meson options>
 	options=
 	# deprecated libs may be disabled by default, so for complete builds ensure
 	# no libs are disabled
-	if ! echo $* | grep -q -- 'disable_libs' ; then
-		options="$options -Ddisable_libs="
+	if ! echo $* | grep -q -- 'enable_libs' ; then
+		options="$options -Denable_libs=*"
 	fi
 	if echo $* | grep -qw -- '--default-library=shared' ; then
 		options="$options -Dexamples=all"
lib/kni/meson.build +5 -0
index 8a71d8ba6f..5ce410f7f2 100644
@@ -7,6 +7,11 @@ if is_windows
     subdir_done()
 endif
 
+if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
+    build = false
+    reason = 'requires IOVA in mbuf (set enable_iova_as_pa option)'
+endif
+
 if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
     build = false
     reason = 'only supported on 64-bit Linux'
lib/meson.build +1 -3
index 9677239236..6018f5230d 100644
@@ -92,20 +92,18 @@ dpdk_libs_deprecated += [
         'kni',
 ]
 
-disabled_libs = []
-opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'),
+disable_libs = run_command(list_dir_globs, get_option('disable_libs'),
         check: true).stdout().split()
-if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0

lib/meson.build dpdk_libs_deprecated += [ · line 105

Quoted 10 lines
lib/meson.build +9 -1
-    opt_disabled_libs += ['kni']
+enable_libs = run_command(list_dir_globs, get_option('enable_libs'),
+        check: true).stdout().split()
+if enable_libs.length() == 0
+    enable_libs = []
+    foreach l:run_command(list_dir_globs, '*', check: true).stdout().split()
+        if l not in dpdk_libs_deprecated
+            enable_libs += [l]
+        endif
+    endforeach

The enable libraries option is really only used for enabling optional libraries - mandatory libs should not need to be specified. I'm wondering about if we should append the mandatory libs to the glob search automatically. This specifically concerns the error messsage about mandatory libs being disabled below....

Quoted 31 lines
lib/meson.build +4 -11
 endif
-foreach l:opt_disabled_libs
-    if not optional_libs.contains(l)
-        warning('Cannot disable mandatory library "@0@"'.format(l))
-        continue
-    endif
-    disabled_libs += l
-endforeach
-
 
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
@@ -115,8 +113,6 @@ if cc.has_argument('-Wno-format-truncation')
     default_cflags += '-Wno-format-truncation'
 endif
 
-enabled_libs = [] # used to print summary at the end
-
 foreach l:libraries
     build = true
     reason = '<unknown reason>' # set if build == false to explain why
@@ -141,13 +137,25 @@ foreach l:libraries
         deps += ['eal']
     endif
 
-    if disabled_libs.contains(l)
+    if not enable_libs.contains(l)
+        build = false
+        reason = 'not in enabled libraries build config'
+    elif disable_libs.contains(l)
         build = false

lib/meson.build foreach l:libraries · line 153

Quoted 10 lines
lib/meson.build +8 -1
         reason = 'explicitly disabled via build config'
-        if dpdk_libs_deprecated.contains(l)
+    endif
+
+    if not build
+        if not optional_libs.contains(l)
+            warning('Cannot disable mandatory library "@0@"'.format(l))
+            build = true
+            reason = '<unknown reason>'
+        elif dpdk_libs_deprecated.contains(l)

This error message seems weird/wrong in the case that the user uses "enable_libs" option rather than "disable_libs". If the user specified he wanted to enable the vhost lib, for example, it would be strange getting an error about having disabled eal, mbuf etc. etc.

Quoted 53 lines
lib/meson.build +4 -2
             reason += ' (deprecated lib)'
         endif
-    else
+    endif
+
+    if build
         if dpdk_libs_deprecated.contains(l)
             warning('Enabling deprecated library, "@0@"'.format(l))
         endif
@@ -183,7 +191,7 @@ foreach l:libraries
         continue
     endif
 
-    enabled_libs += name
+    dpdk_libs_enabled += name
     dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1)
     install_headers(headers)
     install_headers(indirect_headers)
meson.build +2 -1
index 992ca91e88..39cb73846d 100644
@@ -44,6 +44,7 @@ dpdk_extra_ldflags = []
 dpdk_libs_deprecated = []
 dpdk_apps_disabled = []
 dpdk_libs_disabled = []
+dpdk_libs_enabled = []
 dpdk_drvs_disabled = []
 testpmd_drivers_sources = []
 testpmd_drivers_deps = []
@@ -134,7 +135,7 @@ message(output_message + '\n')
 output_message = '\n=================\nLibraries Enabled\n=================\n'
 output_message += '\nlibs:\n\t'
 output_count = 0
-foreach lib:enabled_libs
+foreach lib:dpdk_libs_enabled
     output_message += lib + ', '
     output_count += 1
     if output_count == 8
meson_options.txt +1 -1
index 82c8297065..af54f8b8d4 100644
@@ -10,7 +10,7 @@ option('disable_apps', type: 'string', value: '', description:
        'Comma-separated list of apps to explicitly disable.')
 option('disable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to explicitly disable.')
-option('disable_libs', type: 'string', value: 'flow_classify,kni', description:
+option('disable_libs', type: 'string', value: '', description:
        'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>', description:
        'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')

meson_options.txt option('enable_apps', type: 'string', value: '', description: · line 24

Quoted 5 lines
meson_options.txt +2 -0
@@ -20,6 +20,8 @@ option('enable_apps', type: 'string', value: '', description:
        'Comma-separated list of apps to build. If unspecified, build all apps.')
 option('enable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to build. If unspecified, build all drivers.')
+option('enable_libs', type: 'string', value: '', description:
+       'Comma-separated list of libraries to explicitly enable.')

s/libraries/optional libraries/ ??
Maybe like with the disable option, add a note that mandatory libs are always enabled?

Quoted 6 lines
meson_options.txt +0 -0
 option('enable_driver_sdk', type: 'boolean', value: false, description:
        'Install headers to build drivers.')
 option('enable_kmods', type: 'boolean', value: false, description:
Signature · 1 line
2.40.1
#29 lore raw

Re: [PATCH v3] build: select optional libraries

Quoted 139 lines · Bruce Richardson
Quoted 11 lines · David Marchand

There is currently no way to know which libraries are optional. Introduce a enable_libs option (close to what we have for drivers) so that packagers or projects consuming DPDK can more easily select the optional libraries that matter to them and disable other optional libraries.

Deprecated libraries are handled via some logic in lib/meson.build rather than a default value in meson_options.txt. Enabling deprecated libraries is achieved by requesting all libraries to be built in the CI.

Quoted 7 lines

kni dependency to IOVA configuration is moved to its own meson.build.

Note: the enabled_libs variable is renamed for sake of consistency wrt to drivers and applications similar variables.

---

Thanks David.
Some comments inline below just on the usability aspects of this.

/Bruce

Quoted 114 lines

The topic was raised again while Stephen was reviewing stale patches in patchwork. The idea of this patch is the same as before.
I simply rebased the change (and dealt with the deprecated libraries that added some little complication).

Changes since v2:
- moved the IOVA check for kni build in lib/kni/meson.build,
- reworked deprecated libraries handling by only considering them when no enable_libs option is set. With this, no need for a default value in meson_options.txt, yet configurations in the CI must be adjusted,
- moved mandatory libraries check after enable/disable_libs evaluation,

---
 .ci/linux-build.sh             |  2 +-
 app/test/meson.build           |  2 +-
 buildtools/chkincs/meson.build |  2 +-
 devtools/test-meson-builds.sh  |  4 ++--
 lib/kni/meson.build            |  5 ++++
 lib/meson.build                | 44 ++++++++++++++++++++--------------
 meson.build                    |  3 ++-
 meson_options.txt              |  4 +++-
 8 files changed, 41 insertions(+), 25 deletions(-)
.ci/linux-build.sh +1 -1
index 9631e342b5..a4e474a900 100755
@@ -97,7 +97,7 @@ if [ "$MINI" = "true" ]; then
     OPTS="$OPTS -Denable_drivers=net/null"
     OPTS="$OPTS -Ddisable_libs=*"
 else
-    OPTS="$OPTS -Ddisable_libs="
+    OPTS="$OPTS -Denable_libs=*"
 fi
 
 if [ "$ASAN" = "true" ]; then
app/test/meson.build +1 -1
index d0fabcbb8b..f3217ae577 100644
@@ -152,7 +152,7 @@ test_sources = files(
         'virtual_pmd.c',
 )
 
-test_deps = enabled_libs
+test_deps = dpdk_libs_enabled
 # as well as libs, the pci and vdev bus drivers are needed for a lot of tests
 test_deps += ['bus_pci', 'bus_vdev']
 
buildtools/chkincs/meson.build +1 -1
index 378c2f19ef..f2dadcae18 100644
@@ -22,7 +22,7 @@ sources += gen_c_files.process(dpdk_chkinc_headers)
 # so we always include them in deps list
 deps = [get_variable('shared_rte_bus_vdev'), get_variable('shared_rte_bus_pci')]
 # add the rest of the libs to the dependencies
-foreach l:enabled_libs
+foreach l:dpdk_libs_enabled
     deps += get_variable('shared_rte_' + l)
 endforeach
 
devtools/test-meson-builds.sh +2 -2
index 9131088c9d..4f93702e1f 100755
@@ -122,8 +122,8 @@ config () # <dir> <builddir> <meson options>
      options=
      # deprecated libs may be disabled by default, so for complete builds ensure
      # no libs are disabled
-     if ! echo $* | grep -q -- 'disable_libs' ; then
-             options="$options -Ddisable_libs="
+     if ! echo $* | grep -q -- 'enable_libs' ; then
+             options="$options -Denable_libs=*"
      fi
      if echo $* | grep -qw -- '--default-library=shared' ; then
              options="$options -Dexamples=all"
lib/kni/meson.build +5 -0
index 8a71d8ba6f..5ce410f7f2 100644
@@ -7,6 +7,11 @@ if is_windows
     subdir_done()
 endif
 
+if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
+    build = false
+    reason = 'requires IOVA in mbuf (set enable_iova_as_pa option)'
+endif
+
 if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
     build = false
     reason = 'only supported on 64-bit Linux'
lib/meson.build +8 -4
index 9677239236..6018f5230d 100644
@@ -92,20 +92,18 @@ dpdk_libs_deprecated += [
         'kni',
 ]
 
-disabled_libs = []
-opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'),
+disable_libs = run_command(list_dir_globs, get_option('disable_libs'),
         check: true).stdout().split()
-if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
-    opt_disabled_libs += ['kni']
+enable_libs = run_command(list_dir_globs, get_option('enable_libs'),
+        check: true).stdout().split()
+if enable_libs.length() == 0
+    enable_libs = []
+    foreach l:run_command(list_dir_globs, '*', check: true).stdout().split()
+        if l not in dpdk_libs_deprecated
+            enable_libs += [l]
Quoted 8 lines

lib/meson.build dpdk_libs_deprecated += [ · line 105

Quoted 2 lines
lib/meson.build +2 -0
+        endif
+    endforeach

The enable libraries option is really only used for enabling optional libraries - mandatory libs should not need to be specified. I'm wondering about if we should append the mandatory libs to the glob search automatically. This specifically concerns the error messsage about mandatory libs being disabled below....

Good point.
Let me relook at this.

Quoted 39 lines
Quoted 39 lines
lib/meson.build +9 -12
 endif
-foreach l:opt_disabled_libs
-    if not optional_libs.contains(l)
-        warning('Cannot disable mandatory library "@0@"'.format(l))
-        continue
-    endif
-    disabled_libs += l
-endforeach
-
 
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
@@ -115,8 +113,6 @@ if cc.has_argument('-Wno-format-truncation')
     default_cflags += '-Wno-format-truncation'
 endif
 
-enabled_libs = [] # used to print summary at the end
-
 foreach l:libraries
     build = true
     reason = '<unknown reason>' # set if build == false to explain why
@@ -141,13 +137,25 @@ foreach l:libraries
         deps += ['eal']
     endif
 
-    if disabled_libs.contains(l)
+    if not enable_libs.contains(l)
+        build = false
+        reason = 'not in enabled libraries build config'
+    elif disable_libs.contains(l)
         build = false
         reason = 'explicitly disabled via build config'
-        if dpdk_libs_deprecated.contains(l)
+    endif
+
+    if not build
+        if not optional_libs.contains(l)
+            warning('Cannot disable mandatory library "@0@"'.format(l))
Quoted 8 lines

lib/meson.build foreach l:libraries · line 153

Quoted 3 lines
lib/meson.build +3 -0
+            build = true
+            reason = '<unknown reason>'
+        elif dpdk_libs_deprecated.contains(l)

This error message seems weird/wrong in the case that the user uses "enable_libs" option rather than "disable_libs". If the user specified he wanted to enable the vhost lib, for example, it would be strange getting an error about having disabled eal, mbuf etc. etc.

Ack.

Quoted 55 lines
Quoted 55 lines
lib/meson.build +4 -2
             reason += ' (deprecated lib)'
         endif
-    else
+    endif
+
+    if build
         if dpdk_libs_deprecated.contains(l)
             warning('Enabling deprecated library, "@0@"'.format(l))
         endif
@@ -183,7 +191,7 @@ foreach l:libraries
         continue
     endif
 
-    enabled_libs += name
+    dpdk_libs_enabled += name
     dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1)
     install_headers(headers)
     install_headers(indirect_headers)
meson.build +2 -1
index 992ca91e88..39cb73846d 100644
@@ -44,6 +44,7 @@ dpdk_extra_ldflags = []
 dpdk_libs_deprecated = []
 dpdk_apps_disabled = []
 dpdk_libs_disabled = []
+dpdk_libs_enabled = []
 dpdk_drvs_disabled = []
 testpmd_drivers_sources = []
 testpmd_drivers_deps = []
@@ -134,7 +135,7 @@ message(output_message + '\n')
 output_message = '\n=================\nLibraries Enabled\n=================\n'
 output_message += '\nlibs:\n\t'
 output_count = 0
-foreach lib:enabled_libs
+foreach lib:dpdk_libs_enabled
     output_message += lib + ', '
     output_count += 1
     if output_count == 8
meson_options.txt +1 -1
index 82c8297065..af54f8b8d4 100644
@@ -10,7 +10,7 @@ option('disable_apps', type: 'string', value: '', description:
        'Comma-separated list of apps to explicitly disable.')
 option('disable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to explicitly disable.')
-option('disable_libs', type: 'string', value: 'flow_classify,kni', description:
+option('disable_libs', type: 'string', value: '', description:
        'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>', description:
        'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
@@ -20,6 +20,8 @@ option('enable_apps', type: 'string', value: '', description:
        'Comma-separated list of apps to build. If unspecified, build all apps.')
Quoted 8 lines

meson_options.txt option('enable_apps', type: 'string', value: '', description: · line 24

Quoted 4 lines
meson_options.txt +2 -0
 option('enable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to build. If unspecified, build all drivers.')
+option('enable_libs', type: 'string', value: '', description:
+       'Comma-separated list of libraries to explicitly enable.')

s/libraries/optional libraries/ ??
Maybe like with the disable option, add a note that mandatory libs are always enabled?

I'll update this too.

Quoted 8 lines
Quoted 7 lines
meson_options.txt +0 -1
 option('enable_driver_sdk', type: 'boolean', value: false, description:
        'Install headers to build drivers.')
 option('enable_kmods', type: 'boolean', value: false, description:
--

2.40.1

Thanks Bruce.

Signature · 1 line
David Marchand
#30 lore raw

Re: [PATCH v3] build: select optional libraries

In reply to David Marchand

lib/meson.build foreach l:libraries · line 146

Quoted 13 lines · David Marchand
lib/meson.build +5 -2
@@ -141,13 +137,25 @@ foreach l:libraries
         deps += ['eal']
     endif
 
-    if disabled_libs.contains(l)
+    if not enable_libs.contains(l)
+        build = false
+        reason = 'not in enabled libraries build config'
+    elif disable_libs.contains(l)
         build = false
         reason = 'explicitly disabled via build config'
-        if dpdk_libs_deprecated.contains(l)
+    endif

There is also a change in behavior for current users of the -Ddisable_libs= configuration (which was used for enabling deprecated libraries, for example).
My current solution resides in making disable_libs and enable_libs options being mutually exclusive (meaning that presence of a value for enable_libs will ignore any configuration around disable_libs).

Does it look ok to you?

Signature · 1 line
David Marchand
#31 lore raw

Re: [PATCH v3] build: select optional libraries

Quoted 6 lines · David Marchand
Quoted 4 lines · David Marchand
lib/meson.build +0 -0
@@ -141,13 +137,25 @@ foreach l:libraries
         deps += ['eal']
     endif
 
Quoted 13 lines

lib/meson.build foreach l:libraries · line 146

Quoted 9 lines
lib/meson.build +5 -2
-    if disabled_libs.contains(l)
+    if not enable_libs.contains(l)
+        build = false
+        reason = 'not in enabled libraries build config'
+    elif disable_libs.contains(l)
         build = false
         reason = 'explicitly disabled via build config'
-        if dpdk_libs_deprecated.contains(l)
+    endif

There is also a change in behavior for current users of the -Ddisable_libs= configuration (which was used for enabling deprecated libraries, for example).

I notice the change in behaviour for enabling the deprecated libs. Is there any other change in behaviour for current users?

Quoted 6 lines

My current solution resides in making disable_libs and enable_libs options being mutually exclusive (meaning that presence of a value for enable_libs will ignore any configuration around disable_libs).

Does it look ok to you?

Do we need to make them mutually exclusive? The current drivers implementation allows them to be used together, I think.

/Bruce

#32 lore raw

Re: [PATCH v3] build: select optional libraries

Quoted 22 lines · Bruce Richardson
Quoted 6 lines · David Marchand
Quoted 4 lines · David Marchand
lib/meson.build +0 -0
@@ -141,13 +137,25 @@ foreach l:libraries
         deps += ['eal']
     endif
 
Quoted 13 lines

lib/meson.build foreach l:libraries · line 146

Quoted 9 lines
lib/meson.build +5 -2
-    if disabled_libs.contains(l)
+    if not enable_libs.contains(l)
+        build = false
+        reason = 'not in enabled libraries build config'
+    elif disable_libs.contains(l)
         build = false
         reason = 'explicitly disabled via build config'
-        if dpdk_libs_deprecated.contains(l)
+    endif

There is also a change in behavior for current users of the -Ddisable_libs= configuration (which was used for enabling deprecated libraries, for example).

Quoted 2 lines

I notice the change in behaviour for enabling the deprecated libs. Is there any other change in behaviour for current users?

The only change I see, is that this implementation breaks enabling deprecated libs via disable_libs.
It may break existing developer build directory and maybe some packaging scripts, this is why I am a bit puzzled.

Relooking at the disable_libs option current implementation, it seems backward to pass a disable_libs option when you want to build some deprecated library.
It is more straightforward to request building libraries via -Denable_libs=<deprecated_lib> explicitly or -Denable_libs=* implicitly.

But again, we may be breaking something for people who relied on this behavior.

Quoted 9 lines
Quoted 7 lines

My current solution resides in making disable_libs and enable_libs options being mutually exclusive (meaning that presence of a value for enable_libs will ignore any configuration around disable_libs).

Does it look ok to you?

Do we need to make them mutually exclusive? The current drivers implementation allows them to be used together, I think.

I would prefer we are consistent with the drivers options.

Signature · 1 line
David Marchand
#33 lore raw

Re: [PATCH v3] build: select optional libraries

Quoted 32 lines · David Marchand
Quoted 22 lines · Bruce Richardson
Quoted 6 lines · David Marchand
Quoted 4 lines · David Marchand
lib/meson.build +0 -0
@@ -141,13 +137,25 @@ foreach l:libraries
         deps += ['eal']
     endif
 
Quoted 13 lines

lib/meson.build foreach l:libraries · line 146

Quoted 9 lines
lib/meson.build +5 -2
-    if disabled_libs.contains(l)
+    if not enable_libs.contains(l)
+        build = false
+        reason = 'not in enabled libraries build config'
+    elif disable_libs.contains(l)
         build = false
         reason = 'explicitly disabled via build config'
-        if dpdk_libs_deprecated.contains(l)
+    endif

There is also a change in behavior for current users of the -Ddisable_libs= configuration (which was used for enabling deprecated libraries, for example).

Quoted 2 lines

I notice the change in behaviour for enabling the deprecated libs. Is there any other change in behaviour for current users?

The only change I see, is that this implementation breaks enabling deprecated libs via disable_libs.
It may break existing developer build directory and maybe some packaging scripts, this is why I am a bit puzzled.

Quoted 9 lines

Relooking at the disable_libs option current implementation, it seems backward to pass a disable_libs option when you want to build some deprecated library.
It is more straightforward to request building libraries via -Denable_libs=<deprecated_lib> explicitly or -Denable_libs=* implicitly.

But again, we may be breaking something for people who relied on this behavior.

That's what I expected, and I think that is ok. I just wanted to check that the change in behaviour was only for the deprecated libs case.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

My current solution resides in making disable_libs and enable_libs options being mutually exclusive (meaning that presence of a value for enable_libs will ignore any configuration around disable_libs).

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Does it look ok to you?

Do we need to make them mutually exclusive? The current drivers implementation allows them to be used together, I think.

I would prefer we are consistent with the drivers options.

Yep, I definitely agree. Both drivers and libs should have the same behaviour.

#34 lore raw

Re: [PATCH v3] build: select optional libraries

Quoted 40 lines · Bruce Richardson
Quoted 39 lines · David Marchand
Quoted 22 lines · Bruce Richardson
Quoted 6 lines · David Marchand
Quoted 4 lines · David Marchand
lib/meson.build +0 -0
@@ -141,13 +137,25 @@ foreach l:libraries
         deps += ['eal']
     endif
 
Quoted 13 lines

lib/meson.build foreach l:libraries · line 146

Quoted 9 lines
lib/meson.build +5 -2
-    if disabled_libs.contains(l)
+    if not enable_libs.contains(l)
+        build = false
+        reason = 'not in enabled libraries build config'
+    elif disable_libs.contains(l)
         build = false
         reason = 'explicitly disabled via build config'
-        if dpdk_libs_deprecated.contains(l)
+    endif

There is also a change in behavior for current users of the -Ddisable_libs= configuration (which was used for enabling deprecated libraries, for example).

Quoted 2 lines

I notice the change in behaviour for enabling the deprecated libs. Is there any other change in behaviour for current users?

The only change I see, is that this implementation breaks enabling deprecated libs via disable_libs.
It may break existing developer build directory and maybe some packaging scripts, this is why I am a bit puzzled.

Relooking at the disable_libs option current implementation, it seems backward to pass a disable_libs option when you want to build some deprecated library.
It is more straightforward to request building libraries via -Denable_libs=<deprecated_lib> explicitly or -Denable_libs=* implicitly.

Quoted 5 lines
Quoted 2 lines

But again, we may be breaking something for people who relied on this behavior.

That's what I expected, and I think that is ok. I just wanted to check that the change in behaviour was only for the deprecated libs case.

Thomas, wdyt?
It requires some release note, at least.

Signature · 1 line
David Marchand
#35 lore raw

Re: [PATCH v3] build: select optional libraries

Quoted 42 lines · David Marchand
Quoted 40 lines · Bruce Richardson
Quoted 39 lines · David Marchand
Quoted 22 lines · Bruce Richardson
Quoted 6 lines · David Marchand
Quoted 4 lines · David Marchand
lib/meson.build +0 -0
@@ -141,13 +137,25 @@ foreach l:libraries
         deps += ['eal']
     endif
 
Quoted 13 lines

lib/meson.build foreach l:libraries · line 146

Quoted 9 lines
lib/meson.build +5 -2
-    if disabled_libs.contains(l)
+    if not enable_libs.contains(l)
+        build = false
+        reason = 'not in enabled libraries build config'
+    elif disable_libs.contains(l)
         build = false
         reason = 'explicitly disabled via build config'
-        if dpdk_libs_deprecated.contains(l)
+    endif

There is also a change in behavior for current users of the -Ddisable_libs= configuration (which was used for enabling deprecated libraries, for example).

Quoted 2 lines

I notice the change in behaviour for enabling the deprecated libs. Is there any other change in behaviour for current users?

The only change I see, is that this implementation breaks enabling deprecated libs via disable_libs.
It may break existing developer build directory and maybe some packaging scripts, this is why I am a bit puzzled.

Relooking at the disable_libs option current implementation, it seems backward to pass a disable_libs option when you want to build some deprecated library.
It is more straightforward to request building libraries via -Denable_libs=<deprecated_lib> explicitly or -Denable_libs=* implicitly.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

But again, we may be breaking something for people who relied on this behavior.

That's what I expected, and I think that is ok. I just wanted to check that the change in behaviour was only for the deprecated libs case.

Thomas, wdyt?
It requires some release note, at least.

I am assuming this is not targetting this release though, right? Assuming 23.11, we can put in a deprecation note informing of the change ahead of time too.

/Bruce

#36 lore raw

Re: [PATCH v3] build: select optional libraries

Quoted 21 lines · Bruce Richardson
Quoted 21 lines
Quoted 20 lines
Quoted 8 lines
Quoted 2 lines

I notice the change in behaviour for enabling the deprecated libs. Is there any other change in behaviour for current users?

The only change I see, is that this implementation breaks enabling deprecated libs via disable_libs.
It may break existing developer build directory and maybe some packaging scripts, this is why I am a bit puzzled.

Quoted 9 lines

Relooking at the disable_libs option current implementation, it seems backward to pass a disable_libs option when you want to build some deprecated library.
It is more straightforward to request building libraries via -Denable_libs=<deprecated_lib> explicitly or -Denable_libs=* implicitly.

But again, we may be breaking something for people who relied on this behavior.

That's what I expected, and I think that is ok. I just wanted to check that the change in behaviour was only for the deprecated libs case.

Quoted 6 lines
Quoted 3 lines

Thomas, wdyt?
It requires some release note, at least.

I am assuming this is not targetting this release though, right? Assuming 23.11, we can put in a deprecation note informing of the change ahead of time too.

I was hoping to get it in this release.
But I am fine with postponing and announcing the change beforehand.

Signature · 1 line
David Marchand
#37 lore raw

Re: [PATCH v3] build: select optional libraries

Quoted 26 lines · David Marchand
Quoted 24 lines · Bruce Richardson
Quoted 24 lines
Quoted 15 lines
Quoted 15 lines
Quoted 2 lines

I notice the change in behaviour for enabling the deprecated libs. Is there any other change in behaviour for current users?

The only change I see, is that this implementation breaks enabling deprecated libs via disable_libs.
It may break existing developer build directory and maybe some packaging scripts, this is why I am a bit puzzled.

Relooking at the disable_libs option current implementation, it seems backward to pass a disable_libs option when you want to build some deprecated library.
It is more straightforward to request building libraries via -Denable_libs=<deprecated_lib> explicitly or -Denable_libs=* implicitly.

Quoted 5 lines
Quoted 2 lines

But again, we may be breaking something for people who relied on this behavior.

That's what I expected, and I think that is ok. I just wanted to check that the change in behaviour was only for the deprecated libs case.

Thomas, wdyt?
It requires some release note, at least.

Quoted 7 lines
Quoted 3 lines

I am assuming this is not targetting this release though, right? Assuming 23.11, we can put in a deprecation note informing of the change ahead of time too.

I was hoping to get it in this release.
But I am fine with postponing and announcing the change beforehand.

Given the fact that we are likely changing behaviour, and the fact that the deprecated libs makes it more complicated than the drivers one (since we have always on, default on and default off cases to consider), I think it's best we don't rush this.

/Bruce

#38 lore raw

Re: [PATCH v3] build: select optional libraries

20/06/2023 11:03, Bruce Richardson:

Quoted 31 lines · David Marchand
Quoted 30 lines
Quoted 27 lines · Bruce Richardson
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 2 lines

I notice the change in behaviour for enabling the deprecated libs. Is there any other change in behaviour for current users?

The only change I see, is that this implementation breaks enabling deprecated libs via disable_libs.
It may break existing developer build directory and maybe some packaging scripts, this is why I am a bit puzzled.

Relooking at the disable_libs option current implementation, it seems backward to pass a disable_libs option when you want to build some deprecated library.
It is more straightforward to request building libraries via -Denable_libs=<deprecated_lib> explicitly or -Denable_libs=* implicitly.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

But again, we may be breaking something for people who relied on this behavior.

That's what I expected, and I think that is ok. I just wanted to check that the change in behaviour was only for the deprecated libs case.

Thomas, wdyt?
It requires some release note, at least.

I am assuming this is not targetting this release though, right? Assuming 23.11, we can put in a deprecation note informing of the change ahead of time too.

Quoted 7 lines
Quoted 3 lines

I was hoping to get it in this release.
But I am fine with postponing and announcing the change beforehand.

Given the fact that we are likely changing behaviour, and the fact that the deprecated libs makes it more complicated than the drivers one (since we have always on, default on and default off cases to consider), I think it's best we don't rush this.

I'm not sure what is the best behaviour.
I tend to think such options should be simple to understand with only 3 cases:
- no option -> default
- enable option -> only core mandatory and listed libraries
- disable option -> all but the listed libraries
It looks simpler to forbid having both enable and disable libraries.

Would you be open to change the behaviour of the drivers options?

#39 lore raw

Re: [PATCH v3] build: select optional libraries

Quoted 48 lines · Thomas Monjalon

20/06/2023 11:03, Bruce Richardson:

Quoted 31 lines · David Marchand
Quoted 30 lines
Quoted 27 lines · Bruce Richardson
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 2 lines

I notice the change in behaviour for enabling the deprecated libs. Is there any other change in behaviour for current users?

The only change I see, is that this implementation breaks enabling deprecated libs via disable_libs.
It may break existing developer build directory and maybe some packaging scripts, this is why I am a bit puzzled.

Relooking at the disable_libs option current implementation, it seems backward to pass a disable_libs option when you want to build some deprecated library.
It is more straightforward to request building libraries via -Denable_libs=<deprecated_lib> explicitly or -Denable_libs=* implicitly.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

But again, we may be breaking something for people who relied on this behavior.

That's what I expected, and I think that is ok. I just wanted to check that the change in behaviour was only for the deprecated libs case.

Thomas, wdyt?
It requires some release note, at least.

I am assuming this is not targetting this release though, right? Assuming 23.11, we can put in a deprecation note informing of the change ahead of time too.

Quoted 7 lines
Quoted 3 lines

I was hoping to get it in this release.
But I am fine with postponing and announcing the change beforehand.

Given the fact that we are likely changing behaviour, and the fact that the deprecated libs makes it more complicated than the drivers one (since we have always on, default on and default off cases to consider), I think it's best we don't rush this.

I'm not sure what is the best behaviour.
I tend to think such options should be simple to understand with only 3 cases:
- no option -> default
- enable option -> only core mandatory and listed libraries
- disable option -> all but the listed libraries
It looks simpler to forbid having both enable and disable libraries.

Quoted 2 lines

Would you be open to change the behaviour of the drivers options?

Yes, no issue there. I don't see a problem with disallowing having both enable and disable options set.

#40 lore raw

Re: [PATCH v3] build: select optional libraries

In reply to Thomas Monjalon
Quoted 48 lines · Thomas Monjalon

20/06/2023 11:03, Bruce Richardson:

Quoted 31 lines · David Marchand
Quoted 30 lines
Quoted 27 lines · Bruce Richardson
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 2 lines

I notice the change in behaviour for enabling the deprecated libs. Is there any other change in behaviour for current users?

The only change I see, is that this implementation breaks enabling deprecated libs via disable_libs.
It may break existing developer build directory and maybe some packaging scripts, this is why I am a bit puzzled.

Relooking at the disable_libs option current implementation, it seems backward to pass a disable_libs option when you want to build some deprecated library.
It is more straightforward to request building libraries via -Denable_libs=<deprecated_lib> explicitly or -Denable_libs=* implicitly.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

But again, we may be breaking something for people who relied on this behavior.

That's what I expected, and I think that is ok. I just wanted to check that the change in behaviour was only for the deprecated libs case.

Thomas, wdyt?
It requires some release note, at least.

I am assuming this is not targetting this release though, right? Assuming 23.11, we can put in a deprecation note informing of the change ahead of time too.

Quoted 7 lines
Quoted 3 lines

I was hoping to get it in this release.
But I am fine with postponing and announcing the change beforehand.

Given the fact that we are likely changing behaviour, and the fact that the deprecated libs makes it more complicated than the drivers one (since we have always on, default on and default off cases to consider), I think it's best we don't rush this.

I'm not sure what is the best behaviour.
I tend to think such options should be simple to understand with only 3 cases:
- no option -> default
- enable option -> only core mandatory and listed libraries
- disable option -> all but the listed libraries
It looks simpler to forbid having both enable and disable libraries.

Quoted 2 lines

Would you be open to change the behaviour of the drivers options?

[reducing CC list a bit]

As a further follow-up, I really think we need to move slowly and more carefully on this. While I can see the simplicity in disallowing the two options to be specified, depending on how we go about choosing the enabling of the deprecated libs, we may want to keep support for allowing both.

Specifically, my current concern/thinking is:
* David points out that using the "disabled_libs" options may not make the most logic sense for *enabling* deprecated libs.
* While that is true, I think the usability of enabling them via "enabled_libs" could be pretty terrible - unless we start adding more complications. Specifically, if someone wants to just enable KNI in the build using "enable_libs", specifying "-Denable_libs=kni" will not do what they want - sure it will enable kni, but will disable dozens of other parts of DPDK.
* Therefore, I think keeping the disabling of deprecated parts of DPDK via disabled_libs is easier on users - though agreed it is slightly less logical. However, if we forbid using enabled and disabled options together, that would mean that to switch to enabled libs style, the user has to set both enabled libs, *and* clear the default disabled libs option of the deprecated ones.
* Therefore, right now I'm tending more towards something like the status quo - disabling deprecated via disable option, but allowing both enable and disable options together. This hasn't caused us issues with drivers thus far, so I'd be hopeful for using it for libs.

The other alternative, is we come up with:
* another scheme for managing deprecated libs
* a special keyword for enabled libs to cover the default case, that one can use to add on the deprecated libs, without having to call out each and every other optional library.

#41 lore raw

Re: [PATCH v3] build: select optional libraries

Quoted 53 lines · Bruce Richardson
Quoted 48 lines · Thomas Monjalon

20/06/2023 11:03, Bruce Richardson:

Quoted 31 lines · David Marchand
Quoted 30 lines
Quoted 27 lines · Bruce Richardson
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 2 lines

I notice the change in behaviour for enabling the deprecated libs. Is there any other change in behaviour for current users?

The only change I see, is that this implementation breaks enabling deprecated libs via disable_libs.
It may break existing developer build directory and maybe some packaging scripts, this is why I am a bit puzzled.

Relooking at the disable_libs option current implementation, it seems backward to pass a disable_libs option when you want to build some deprecated library.
It is more straightforward to request building libraries via -Denable_libs=<deprecated_lib> explicitly or -Denable_libs=* implicitly.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

But again, we may be breaking something for people who relied on this behavior.

That's what I expected, and I think that is ok. I just wanted to check that the change in behaviour was only for the deprecated libs case.

Thomas, wdyt?
It requires some release note, at least.

I am assuming this is not targetting this release though, right? Assuming 23.11, we can put in a deprecation note informing of the change ahead of time too.

Quoted 7 lines
Quoted 3 lines

I was hoping to get it in this release.
But I am fine with postponing and announcing the change beforehand.

Given the fact that we are likely changing behaviour, and the fact that the deprecated libs makes it more complicated than the drivers one (since we have always on, default on and default off cases to consider), I think it's best we don't rush this.

I'm not sure what is the best behaviour.
I tend to think such options should be simple to understand with only 3 cases:
- no option -> default
- enable option -> only core mandatory and listed libraries
- disable option -> all but the listed libraries
It looks simpler to forbid having both enable and disable libraries.

Quoted 2 lines

Would you be open to change the behaviour of the drivers options?

Quoted 7 lines

[reducing CC list a bit]

As a further follow-up, I really think we need to move slowly and more carefully on this. While I can see the simplicity in disallowing the two options to be specified, depending on how we go about choosing the enabling of the deprecated libs, we may want to keep support for allowing both.

I agree, we need more time on this topic, sorry for being pushy earlier :-).

Quoted 12 lines

Specifically, my current concern/thinking is:
* David points out that using the "disabled_libs" options may not make the most logic sense for *enabling* deprecated libs.
* While that is true, I think the usability of enabling them via "enabled_libs" could be pretty terrible - unless we start adding more complications. Specifically, if someone wants to just enable KNI in the build using "enable_libs", specifying "-Denable_libs=kni" will not do what they want - sure it will enable kni, but will disable dozens of other parts of DPDK.
* Therefore, I think keeping the disabling of deprecated parts of DPDK via disabled_libs is easier on users - though agreed it is slightly less

Quoted 8 lines

logical. However, if we forbid using enabled and disabled options together, that would mean that to switch to enabled libs style, the user has to set both enabled libs, *and* clear the default disabled libs option of the deprecated ones.
* Therefore, right now I'm tending more towards something like the status quo - disabling deprecated via disable option, but allowing both enable and disable options together. This hasn't caused us issues with drivers thus far, so I'd be hopeful for using it for libs.

Mixing enable/disable_drivers has been possible since the introduction of enable_drivers.
Looking at the code, it is unclear the intention was to make them exclusive. Is there no usecase for using both options in some soc configuration? Juraj, do you have an opinion?

Quoted 6 lines

The other alternative, is we come up with:
* another scheme for managing deprecated libs
* a special keyword for enabled libs to cover the default case, that one can use to add on the deprecated libs, without having to call out each and every other optional library.

I think a separate option to control deprecated libraries would be better. This option would control whether the deprecation libs are part of the optional libraries list.
The optional libraries list would then be evaluated according to enable/disable_libs.

I'll try this to see how it behaves.

Signature · 1 line
David Marchand
#42 lore raw

Re: [PATCH v3] build: select optional libraries

Quoted 57 lines · David Marchand
Quoted 55 lines · Bruce Richardson
Quoted 48 lines · Thomas Monjalon

20/06/2023 11:03, Bruce Richardson:

Quoted 31 lines · David Marchand
Quoted 30 lines
Quoted 27 lines · Bruce Richardson
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 2 lines

I notice the change in behaviour for enabling the deprecated libs. Is there any other change in behaviour for current users?

The only change I see, is that this implementation breaks enabling deprecated libs via disable_libs.
It may break existing developer build directory and maybe some packaging scripts, this is why I am a bit puzzled.

Relooking at the disable_libs option current implementation, it seems backward to pass a disable_libs option when you want to build some deprecated library.
It is more straightforward to request building libraries via -Denable_libs=<deprecated_lib> explicitly or -Denable_libs=* implicitly.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

But again, we may be breaking something for people who relied on this behavior.

That's what I expected, and I think that is ok. I just wanted to check that the change in behaviour was only for the deprecated libs case.

Thomas, wdyt?
It requires some release note, at least.

I am assuming this is not targetting this release though, right? Assuming 23.11, we can put in a deprecation note informing of the change ahead of time too.

Quoted 7 lines
Quoted 3 lines

I was hoping to get it in this release.
But I am fine with postponing and announcing the change beforehand.

Given the fact that we are likely changing behaviour, and the fact that the deprecated libs makes it more complicated than the drivers one (since we have always on, default on and default off cases to consider), I think it's best we don't rush this.

I'm not sure what is the best behaviour.
I tend to think such options should be simple to understand with only 3 cases:
- no option -> default
- enable option -> only core mandatory and listed libraries
- disable option -> all but the listed libraries
It looks simpler to forbid having both enable and disable libraries.

Quoted 2 lines

Would you be open to change the behaviour of the drivers options?

[reducing CC list a bit]

Quoted 8 lines
Quoted 5 lines

As a further follow-up, I really think we need to move slowly and more carefully on this. While I can see the simplicity in disallowing the two options to be specified, depending on how we go about choosing the enabling of the deprecated libs, we may want to keep support for allowing both.

I agree, we need more time on this topic, sorry for being pushy earlier :-).

No problem at all. I too was keen to get this done, but what initially we thought was simple turns out (as usual!) to have hidden complexity. :-)

Quoted 22 lines
Quoted 13 lines

Specifically, my current concern/thinking is:
* David points out that using the "disabled_libs" options may not make the most logic sense for *enabling* deprecated libs.
* While that is true, I think the usability of enabling them via "enabled_libs" could be pretty terrible - unless we start adding more complications. Specifically, if someone wants to just enable KNI in the build using "enable_libs", specifying "-Denable_libs=kni" will not do what they want - sure it will enable kni, but will disable dozens of other parts of DPDK.
* Therefore, I think keeping the disabling of deprecated parts of DPDK via disabled_libs is easier on users - though agreed it is slightly less

Quoted 8 lines

logical. However, if we forbid using enabled and disabled options together, that would mean that to switch to enabled libs style, the user has to set both enabled libs, *and* clear the default disabled libs option of the deprecated ones.
* Therefore, right now I'm tending more towards something like the status quo - disabling deprecated via disable option, but allowing both enable and disable options together. This hasn't caused us issues with drivers thus far, so I'd be hopeful for using it for libs.

Quoted 4 lines

Mixing enable/disable_drivers has been possible since the introduction of enable_drivers.
Looking at the code, it is unclear the intention was to make them exclusive. Is there no usecase for using both options in some soc configuration?

If we can solve the deprecated libs management separately, having them exclusive may well make sense. Since we can wildcard, I think the cases where we need both simultaneously should be few.

Quoted 10 lines

Juraj, do you have an opinion?

Quoted 6 lines

The other alternative, is we come up with:
* another scheme for managing deprecated libs
* a special keyword for enabled libs to cover the default case, that one can use to add on the deprecated libs, without having to call out each and every other optional library.

Quoted 8 lines

I think a separate option to control deprecated libraries would be better. This option would control whether the deprecation libs are part of the optional libraries list.
The optional libraries list would then be evaluated according to enable/disable_libs.

I'll try this to see how it behaves.

Ok, let's see how that goes. It does likely mean another build config flag though, which I was hoping to avoid, but if it simplifies everything else it may be worth it.

/Bruce

#43 lore raw

RE: [PATCH v3] build: select optional libraries

I haven't followed this discussion in detail, so this might have been mentioned already...

Omitting deprecated libs when building will not omit deprecated functions in other libs.

In other words: Omitting deprecated libs only achieves part of what we really want to achieve (omitting everything deprecated), so special handling of deprecated libs might not be that important.

PS: I appreciate the effort to make the libs optional at build time, like the drivers!

#44 lore raw

Re: [PATCH v3] build: select optional libraries

In reply to David Marchand
Quoted 107 lines · David Marchand
Quoted 7 lines · Bruce Richardson
Quoted 5 lines · Thomas Monjalon

20/06/2023 11:03, Bruce Richardson:

Quoted 4 lines · David Marchand
Quoted 3 lines
Quoted 1 line · Bruce Richardson
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I notice the change in behaviour for enabling the

deprecated libs. Is there

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

any other change in behaviour for current users?

The only change I see, is that this implementation breaks

enabling

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

deprecated libs via disable_libs.
It may break existing developer build directory and maybe

some

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

packaging scripts, this is why I am a bit puzzled.

Relooking at the disable_libs option current

implementation, it seems

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

backward to pass a disable_libs option when you want to

build some

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

deprecated library.
It is more straightforward to request building libraries

via

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

-Denable_libs=<deprecated_lib> explicitly or

-Denable_libs=*

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

implicitly.

But again, we may be breaking something for people who

relied on this behavior.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

That's what I expected, and I think that is ok. I just

wanted to check that

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

the change in behaviour was only for the deprecated libs

case.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Thomas, wdyt?
It requires some release note, at least.

I am assuming this is not targetting this release though, right?

Assuming

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

23.11, we can put in a deprecation note informing of the change

ahead of

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 1 line

time too.

I was hoping to get it in this release.
But I am fine with postponing and announcing the change beforehand.

Given the fact that we are likely changing behaviour, and the fact

that the

Quoted 1 line
Quoted 1 line
Quoted 1 line

deprecated libs makes it more complicated than the drivers one

(since we

Quoted 1 line
Quoted 1 line
Quoted 1 line

have always on, default on and default off cases to consider), I

think it's

Quoted 13 lines
Quoted 10 lines
Quoted 1 line

best we don't rush this.

I'm not sure what is the best behaviour.
I tend to think such options should be simple to understand with only 3 cases:
- no option -> default
- enable option -> only core mandatory and listed libraries
- disable option -> all but the listed libraries
It looks simpler to forbid having both enable and disable libraries.

Quoted 2 lines

Would you be open to change the behaviour of the drivers options?

Quoted 7 lines

[reducing CC list a bit]

As a further follow-up, I really think we need to move slowly and more carefully on this. While I can see the simplicity in disallowing the two options to be specified, depending on how we go about choosing the enabling of the deprecated libs, we may want to keep support for allowing both.

I agree, we need more time on this topic, sorry for being pushy earlier :-).

Quoted 3 lines

Specifically, my current concern/thinking is:
* David points out that using the "disabled_libs" options may not make

the

Quoted 8 lines

most logic sense for *enabling* deprecated libs.
* While that is true, I think the usability of enabling them via "enabled_libs" could be pretty terrible - unless we start adding more complications. Specifically, if someone wants to just enable KNI in the build using "enable_libs", specifying "-Denable_libs=kni" will not do what they want - sure it will enable kni, but will disable dozens of other parts of DPDK.
* Therefore, I think keeping the disabling of deprecated parts of DPDK

via

Quoted 3 lines

disabled_libs is easier on users - though agreed it is slightly less logical. However, if we forbid using enabled and disabled options together, that would mean that to switch to enabled libs style, the

user

Quoted 1 line

has to set both enabled libs, *and* clear the default disabled libs

option

Quoted 5 lines

of the deprecated ones.
* Therefore, right now I'm tending more towards something like the status quo - disabling deprecated via disable option, but allowing both enable and disable options together. This hasn't caused us issues with drivers thus far, so I'd be hopeful for using it for libs.

Quoted 8 lines

Mixing enable/disable_drivers has been possible since the introduction of enable_drivers.
Looking at the code, it is unclear the intention was to make them exclusive.
Is there no usecase for using both options in some soc configuration? Juraj, do you have an opinion?

I seem to remember that there wasn't any intention of using them together - I think I did it this way because it was essentially "free" (i.e. the ability to use them together was an extra feature on top of what we needed).

The SoC considerations were for cross compilation between Arm microarchitectures/SoCs - use enable_drivers mainly to enable only a handful of relevant drivers for small SoC's when building on a server grade SoC. The same applies for disable_drivers - the server grade SoC where we're building may have extra dependencies that we may not want/need on the target (possibly server-grade) system. They don't need to be used in conjunction in these scenarios.

Quoted 21 lines
Quoted 7 lines

The other alternative, is we come up with:
* another scheme for managing deprecated libs
* a special keyword for enabled libs to cover the default case, that one can use to add on the deprecated libs, without having to call out each and every other optional library.

I think a separate option to control deprecated libraries would be better. This option would control whether the deprecation libs are part of the optional libraries list.
The optional libraries list would then be evaluated according to enable/disable_libs.

I'll try this to see how it behaves.

--
David Marchand

#45 lore raw

v4 cover Select optional libraries

In reply to David Marchand

This series is one implementation to try and please users who want to select more easily which parts of DPDK are built.

It introduces a change in behavior for enabling deprecated libraries:
this series is aimed at the next release but sent early as a demo of what changes are required.

If no strong opposition is met, a deprecation notice will be sent for v23.07 to announce this change in v23.11.

Changes since v3:
- split kni cleanup,
- split variable rename cleanup,
- introduced a new meson option to control deprecated libraries activation,
- simplified the actual implementation of enable_libs to mimic enable_drivers behavior,

Signature · 20 lines
David Marchand

David Marchand (4):
  kni: move IOVA build check
  build: rename enabled libraries list
  build: select deprecated libraries
  build: select optional libraries

 .ci/linux-build.sh             |  2 +-
 app/test/meson.build           |  2 +-
 buildtools/chkincs/meson.build |  2 +-
 devtools/test-meson-builds.sh  |  8 +++---
 lib/kni/meson.build            |  5 ++++
 lib/meson.build                | 45 ++++++++++++++++++++++------------
 meson.build                    |  3 ++-
 meson_options.txt              |  8 ++++--
 8 files changed, 49 insertions(+), 26 deletions(-)

-- 
2.40.1
#46 lore raw

PATCH v4 1/4 kni: move IOVA build check

kni dependency to IOVA configuration does not need to be expressed in the top level lib/meson.build file.

---
 lib/kni/meson.build | 5 +++++
 lib/meson.build     | 3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)
lib/kni/meson.build +5 -0
index 8a71d8ba6f..5ce410f7f2 100644
@@ -7,6 +7,11 @@ if is_windows
     subdir_done()
 endif
 
+if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
+    build = false
+    reason = 'requires IOVA in mbuf (set enable_iova_as_pa option)'
+endif
+
 if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
     build = false
     reason = 'only supported on 64-bit Linux'
lib/meson.build +0 -3
index 9677239236..f5c8a70a1d 100644
@@ -95,9 +95,6 @@ dpdk_libs_deprecated += [
 disabled_libs = []
 opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'),
         check: true).stdout().split()
-if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
-    opt_disabled_libs += ['kni']
-endif
 foreach l:opt_disabled_libs
     if not optional_libs.contains(l)
         warning('Cannot disable mandatory library "@0@"'.format(l))
Signature · 1 line
2.40.1
Acked-by on v4 1/4
#47 lore raw

Re: [PATCH v4 1/4] kni: move IOVA build check

Quoted 8 lines · David Marchand

kni dependency to IOVA configuration does not need to be expressed in the top level lib/meson.build file.

---
 lib/kni/meson.build | 5 +++++
 lib/meson.build     | 3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)

even if the rest of the set gets pushed to next release, I think this patch should go in this one anyway. It's a simple cleanup.
Thanks.

#48 lore raw

PATCH v4 2/4 build: rename enabled libraries list

In reply to David Marchand

The enabled_libs variable is renamed and moved to the top level meson.build file, for sake of consistency wrt to drivers and applications similar variables.

---
 app/test/meson.build           | 2 +-
 buildtools/chkincs/meson.build | 2 +-
 lib/meson.build                | 4 +---
 meson.build                    | 3 ++-
 4 files changed, 5 insertions(+), 6 deletions(-)
app/test/meson.build +1 -1
index d0fabcbb8b..f3217ae577 100644
@@ -152,7 +152,7 @@ test_sources = files(
         'virtual_pmd.c',
 )
 
-test_deps = enabled_libs
+test_deps = dpdk_libs_enabled
 # as well as libs, the pci and vdev bus drivers are needed for a lot of tests
 test_deps += ['bus_pci', 'bus_vdev']
 
buildtools/chkincs/meson.build +1 -1
index 378c2f19ef..f2dadcae18 100644
@@ -22,7 +22,7 @@ sources += gen_c_files.process(dpdk_chkinc_headers)
 # so we always include them in deps list
 deps = [get_variable('shared_rte_bus_vdev'), get_variable('shared_rte_bus_pci')]
 # add the rest of the libs to the dependencies
-foreach l:enabled_libs
+foreach l:dpdk_libs_enabled
     deps += get_variable('shared_rte_' + l)
 endforeach
 
lib/meson.build +1 -3
index f5c8a70a1d..363a4fd79f 100644
@@ -112,8 +112,6 @@ if cc.has_argument('-Wno-format-truncation')
     default_cflags += '-Wno-format-truncation'
 endif
 
-enabled_libs = [] # used to print summary at the end
-
 foreach l:libraries
     build = true
     reason = '<unknown reason>' # set if build == false to explain why
@@ -180,7 +178,7 @@ foreach l:libraries
         continue
     endif
 
-    enabled_libs += name
+    dpdk_libs_enabled += name
     dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1)
     install_headers(headers)
     install_headers(indirect_headers)
meson.build +2 -1
index 992ca91e88..39cb73846d 100644
@@ -44,6 +44,7 @@ dpdk_extra_ldflags = []
 dpdk_libs_deprecated = []
 dpdk_apps_disabled = []
 dpdk_libs_disabled = []
+dpdk_libs_enabled = []
 dpdk_drvs_disabled = []
 testpmd_drivers_sources = []
 testpmd_drivers_deps = []
@@ -134,7 +135,7 @@ message(output_message + '\n')
 output_message = '\n=================\nLibraries Enabled\n=================\n'
 output_message += '\nlibs:\n\t'
 output_count = 0
-foreach lib:enabled_libs
+foreach lib:dpdk_libs_enabled
     output_message += lib + ', '
     output_count += 1
     if output_count == 8
Signature · 1 line
2.40.1
#50 lore raw

PATCH v4 3/4 build: select deprecated libraries

In reply to David Marchand

Rework deprecated libraries selection by introducing a new configuration option.

This breaks existing configurations that were relying on disable_libs='' for enabling deprecated libraries.
On the other hand, it will make enabling optional libraries more straightforward by taking the deprecated libraries out of the picture.

---
 .ci/linux-build.sh            | 2 +-
 devtools/test-meson-builds.sh | 8 ++++----
 lib/meson.build               | 9 +++++++--
 meson_options.txt             | 4 +++-
 4 files changed, 15 insertions(+), 8 deletions(-)
.ci/linux-build.sh +1 -1
index 9631e342b5..da51f8e55e 100755
@@ -97,7 +97,7 @@ if [ "$MINI" = "true" ]; then
     OPTS="$OPTS -Denable_drivers=net/null"
     OPTS="$OPTS -Ddisable_libs=*"
 else
-    OPTS="$OPTS -Ddisable_libs="
+    OPTS="$OPTS -Denable_deprecated_libs=true"
 fi
 
 if [ "$ASAN" = "true" ]; then
devtools/test-meson-builds.sh +4 -4
index 9131088c9d..efeddb36f3 100755
@@ -120,10 +120,10 @@ config () # <dir> <builddir> <meson options>
 		return
 	fi
 	options=
-	# deprecated libs may be disabled by default, so for complete builds ensure
-	# no libs are disabled
-	if ! echo $* | grep -q -- 'disable_libs' ; then
-		options="$options -Ddisable_libs="
+	# deprecated libs are disabled by default, so for complete builds
+	# enable them
+	if ! echo $* | grep -q -- 'enable_deprecated_libs' ; then
+		options="$options -Denable_deprecated_libs=true"
 	fi
 	if echo $* | grep -qw -- '--default-library=shared' ; then
 		options="$options -Dexamples=all"
lib/meson.build +7 -2
index 363a4fd79f..a6e9e19b42 100644
@@ -136,13 +136,18 @@ foreach l:libraries
         deps += ['eal']
     endif
 
-    if disabled_libs.contains(l)
+    if dpdk_libs_deprecated.contains(l) and not get_option('enable_deprecated_libs')
+        build = false
+        reason = 'deprecated libraries disabled via build config'
+    elif disabled_libs.contains(l)
         build = false
         reason = 'explicitly disabled via build config'
         if dpdk_libs_deprecated.contains(l)
             reason += ' (deprecated lib)'
         endif
-    else
+    endif
+
+    if build
         if dpdk_libs_deprecated.contains(l)
             warning('Enabling deprecated library, "@0@"'.format(l))
         endif
meson_options.txt +3 -1
index 82c8297065..f959015e46 100644
@@ -10,7 +10,7 @@ option('disable_apps', type: 'string', value: '', description:
        'Comma-separated list of apps to explicitly disable.')
 option('disable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to explicitly disable.')
-option('disable_libs', type: 'string', value: 'flow_classify,kni', description:
+option('disable_libs', type: 'string', value: '', description:
        'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>', description:
        'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
@@ -18,6 +18,8 @@ option('enable_docs', type: 'boolean', value: false, description:
        'build documentation')
 option('enable_apps', type: 'string', value: '', description:
        'Comma-separated list of apps to build. If unspecified, build all apps.')
+option('enable_deprecated_libs', type: 'boolean', value: false, description:
+       'Add deprecated libraries to the list of optional libraries to build')
 option('enable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to build. If unspecified, build all drivers.')
 option('enable_driver_sdk', type: 'boolean', value: false, description:
Signature · 1 line
2.40.1
#51 lore raw

Re: [PATCH v4 3/4] build: select deprecated libraries

Quoted 9 lines · David Marchand

Rework deprecated libraries selection by introducing a new configuration option.

This breaks existing configurations that were relying on disable_libs='' for enabling deprecated libraries.
On the other hand, it will make enabling optional libraries more straightforward by taking the deprecated libraries out of the picture.

This gives us a single on/off value for the deprecated libs. So if you wants to build only a single deprecated lib, you need to turn on this option and then use "disable_libs/enable_libs" option to then selectively pick which of the deprecated libs you actually want. Is that the expected behaviour? Just checking that we don't want this to be a list too.

#52 lore raw

Re: [PATCH v4 3/4] build: select deprecated libraries

Quoted 9 lines · Bruce Richardson
Quoted 8 lines · David Marchand

Rework deprecated libraries selection by introducing a new configuration option.

This breaks existing configurations that were relying on disable_libs='' for enabling deprecated libraries.
On the other hand, it will make enabling optional libraries more straightforward by taking the deprecated libraries out of the picture.

Quoted 8 lines
Quoted 1 line

This gives us a single on/off value for the deprecated libs. So if you wants to build only a single deprecated lib, you need to turn on this option and then use "disable_libs/enable_libs" option to then selectively pick which of the deprecated libs you actually want. Is that the expected behaviour? Just checking that we don't want this to be a list too.

The patch is fine itself though, so:

#53 lore raw

Re: [PATCH v4 3/4] build: select deprecated libraries

In reply to Bruce Richardson

Hello Bruce,

Quoted 10 lines · Bruce Richardson
Quoted 8 lines · David Marchand

Rework deprecated libraries selection by introducing a new configuration option.

This breaks existing configurations that were relying on disable_libs='' for enabling deprecated libraries.
On the other hand, it will make enabling optional libraries more straightforward by taking the deprecated libraries out of the picture.

Quoted 7 lines
Quoted 1 line

This gives us a single on/off value for the deprecated libs. So if you wants to build only a single deprecated lib, you need to turn on this option and then use "disable_libs/enable_libs" option to then selectively pick which of the deprecated libs you actually want. Is that the expected behaviour? Just checking that we don't want this to be a list too.

Yes, I wanted a single unified filtering stage.

But I think your suggestion is easier to use.

- That would make it simpler for people who simply want to enable kni, as you mentionned before:

$ meson setup plop -Denable_deprecated_libs=kni

But I would make this list not overlap with the disable/enable_libs options evaluation.
Otherwise, in the case of a enable_libs user, the user would have to set kni in both lists, which is not that great:

$ meson setup plop -Denable_deprecated_libs=kni -Denable_libs=kni,vhost

Instead, I would make it so the config is done as:

$ meson setup plop -Denable_deprecated_libs=kni -Denable_libs=vhost

Is this what you had in mind?

- I don't have a usage for this, but if we go with separating deprecated and "normal" optional libs filtering, should I introduce a disable_deprecated_libs too?

Signature · 1 line
David Marchand
#54 lore raw

Re: [PATCH v4 3/4] build: select deprecated libraries

Quoted 22 lines · David Marchand

Hello Bruce,

Quoted 10 lines · Bruce Richardson
Quoted 8 lines · David Marchand

Rework deprecated libraries selection by introducing a new configuration option.

This breaks existing configurations that were relying on disable_libs='' for enabling deprecated libraries.
On the other hand, it will make enabling optional libraries more straightforward by taking the deprecated libraries out of the picture.

Quoted 7 lines
Quoted 1 line

This gives us a single on/off value for the deprecated libs. So if you wants to build only a single deprecated lib, you need to turn on this option and then use "disable_libs/enable_libs" option to then selectively pick which of the deprecated libs you actually want. Is that the expected behaviour? Just checking that we don't want this to be a list too.

Quoted 3 lines

Yes, I wanted a single unified filtering stage.

But I think your suggestion is easier to use.

Slightly easier for the simple case.

Quoted 9 lines

- That would make it simpler for people who simply want to enable kni, as you mentionned before:

$ meson setup plop -Denable_deprecated_libs=kni

But I would make this list not overlap with the disable/enable_libs options evaluation.
Otherwise, in the case of a enable_libs user, the user would have to set kni in both lists, which is not that great:

Quoted 7 lines
$ meson setup plop -Denable_deprecated_libs=kni -Denable_libs=kni,vhost

Instead, I would make it so the config is done as:

$ meson setup plop -Denable_deprecated_libs=kni -Denable_libs=vhost

Is this what you had in mind?

I'm not sure myself what I had in mind, just asking if it had been considered as much as anything else.

Having them not-overlap would seem to be necessary to provide a meaningful interface.

Quoted 5 lines

- I don't have a usage for this, but if we go with separating deprecated and "normal" optional libs filtering, should I introduce a disable_deprecated_libs too?

That would give us *way* to many options. I think for the sake of simplicity we probably are as well to just go with what you are proposing in this set. Since we only have two deprecated libraries - and hopefully never many more - the benefit of the list for that setting is probably minimal. I'm keen to avoid too much complexity if we can manage it.

#55 lore raw

RE: [PATCH v4 3/4] build: select deprecated libraries

Quoted 60 lines

From: Bruce Richardson [mailto:[email protected]]
Sent: Friday, 23 June 2023 13.04

Quoted 22 lines · David Marchand

Hello Bruce,

Quoted 10 lines · Bruce Richardson
Quoted 8 lines · David Marchand

Rework deprecated libraries selection by introducing a new configuration option.

This breaks existing configurations that were relying on disable_libs='' for enabling deprecated libraries.
On the other hand, it will make enabling optional libraries more straightforward by taking the deprecated libraries out of the picture.

Quoted 7 lines
Quoted 1 line

This gives us a single on/off value for the deprecated libs. So if you wants to build only a single deprecated lib, you need to turn on this option and then use "disable_libs/enable_libs" option to then selectively pick which of the deprecated libs you actually want. Is that the expected behaviour? Just checking that we don't want this to be a list too.

Quoted 3 lines

Yes, I wanted a single unified filtering stage.

But I think your suggestion is easier to use.

Slightly easier for the simple case.

Quoted 9 lines

- That would make it simpler for people who simply want to enable kni, as you mentionned before:

$ meson setup plop -Denable_deprecated_libs=kni

But I would make this list not overlap with the disable/enable_libs options evaluation.
Otherwise, in the case of a enable_libs user, the user would have to set kni in both lists, which is not that great:

Quoted 7 lines
$ meson setup plop -Denable_deprecated_libs=kni -Denable_libs=kni,vhost

Instead, I would make it so the config is done as:

$ meson setup plop -Denable_deprecated_libs=kni -Denable_libs=vhost

Is this what you had in mind?

I'm not sure myself what I had in mind, just asking if it had been considered as much as anything else.

Having them not-overlap would seem to be necessary to provide a meaningful interface.

Quoted 5 lines

- I don't have a usage for this, but if we go with separating deprecated and "normal" optional libs filtering, should I introduce a disable_deprecated_libs too?

Quoted 5 lines

That would give us *way* to many options. I think for the sake of simplicity we probably are as well to just go with what you are proposing in this set. Since we only have two deprecated libraries - and hopefully never many more - the benefit of the list for that setting is probably minimal. I'm keen to avoid too much complexity if we can manage it.

I strongly agree with Bruce about avoiding too many options. Here's an idea:

How about just having the disable/enable_libs options, and by default omit the deprecated libs.

Then, the deprecated libs can be enabled by using the enable_libs option.

Do we have special treatment for deprecated drivers?

#56 lore raw

Re: [PATCH v4 3/4] build: select deprecated libraries

Quoted 66 lines · Morten Brørup
Quoted 60 lines

From: Bruce Richardson [mailto:[email protected]]
Sent: Friday, 23 June 2023 13.04

Quoted 22 lines · David Marchand

Hello Bruce,

Quoted 10 lines · Bruce Richardson
Quoted 8 lines · David Marchand

Rework deprecated libraries selection by introducing a new configuration option.

This breaks existing configurations that were relying on disable_libs='' for enabling deprecated libraries.
On the other hand, it will make enabling optional libraries more straightforward by taking the deprecated libraries out of the picture.

Quoted 7 lines
Quoted 1 line

This gives us a single on/off value for the deprecated libs. So if you wants to build only a single deprecated lib, you need to turn on this option and then use "disable_libs/enable_libs" option to then selectively pick which of the deprecated libs you actually want. Is that the expected behaviour? Just checking that we don't want this to be a list too.

Quoted 3 lines

Yes, I wanted a single unified filtering stage.

But I think your suggestion is easier to use.

Slightly easier for the simple case.

Quoted 9 lines

- That would make it simpler for people who simply want to enable kni, as you mentionned before:

$ meson setup plop -Denable_deprecated_libs=kni

But I would make this list not overlap with the disable/enable_libs options evaluation.
Otherwise, in the case of a enable_libs user, the user would have to set kni in both lists, which is not that great:

Quoted 7 lines
$ meson setup plop -Denable_deprecated_libs=kni -Denable_libs=kni,vhost

Instead, I would make it so the config is done as:

$ meson setup plop -Denable_deprecated_libs=kni -Denable_libs=vhost

Is this what you had in mind?

I'm not sure myself what I had in mind, just asking if it had been considered as much as anything else.

Having them not-overlap would seem to be necessary to provide a meaningful interface.

Quoted 5 lines

- I don't have a usage for this, but if we go with separating deprecated and "normal" optional libs filtering, should I introduce a disable_deprecated_libs too?

Quoted 5 lines

That would give us *way* to many options. I think for the sake of simplicity we probably are as well to just go with what you are proposing in this set. Since we only have two deprecated libraries - and hopefully never many more - the benefit of the list for that setting is probably minimal. I'm keen to avoid too much complexity if we can manage it.

Quoted 6 lines

I strongly agree with Bruce about avoiding too many options. Here's an idea:

How about just having the disable/enable_libs options, and by default omit the deprecated libs.

Then, the deprecated libs can be enabled by using the enable_libs option.

That was the original suggestion and implementation. The trouble is that if you specify, for example, -Denable_libs=kni, you have just disabled every other optional library in DPDK, since the enable_libs option switches DPDK to "allowlist"-only mode.

Quoted 2 lines

Do we have special treatment for deprecated drivers?

Its the best solution we have come up with so far to work around the above problem.

/Bruce

#57 lore raw

RE: [PATCH v4 3/4] build: select deprecated libraries

Quoted 83 lines

From: Bruce Richardson [mailto:[email protected]]
Sent: Friday, 23 June 2023 13.19

Quoted 11 lines · Morten Brørup
Quoted 11 lines

From: Bruce Richardson [mailto:[email protected]]
Sent: Friday, 23 June 2023 13.04

Quoted 7 lines · David Marchand

Hello Bruce,

Quoted 3 lines · Bruce Richardson
Quoted 1 line · David Marchand

Rework deprecated libraries selection by introducing a new

configuration

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

option.

This breaks existing configurations that were relying on

disable_libs=''

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

for enabling deprecated libraries.
On the other hand, it will make enabling optional libraries more straightforward by taking the deprecated libraries out of the

picture.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

This gives us a single on/off value for the deprecated libs. So if you wants to build only a single deprecated lib, you need to turn on this option and then use "disable_libs/enable_libs" option to then

selectively

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

pick which of the deprecated libs you actually want. Is that the

expected

Quoted 31 lines
Quoted 31 lines
Quoted 5 lines
Quoted 1 line

behaviour? Just checking that we don't want this to be a list too.

Yes, I wanted a single unified filtering stage.

But I think your suggestion is easier to use.

Slightly easier for the simple case.

Quoted 9 lines

- That would make it simpler for people who simply want to enable kni, as you mentionned before:

$ meson setup plop -Denable_deprecated_libs=kni

But I would make this list not overlap with the disable/enable_libs options evaluation.
Otherwise, in the case of a enable_libs user, the user would have to set kni in both lists, which is not that great:

Quoted 7 lines
$ meson setup plop -Denable_deprecated_libs=kni -Denable_libs=kni,vhost

Instead, I would make it so the config is done as:

$ meson setup plop -Denable_deprecated_libs=kni -Denable_libs=vhost

Is this what you had in mind?

I'm not sure myself what I had in mind, just asking if it had been considered as much as anything else.

Having them not-overlap would seem to be necessary to provide a meaningful interface.

Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

- I don't have a usage for this, but if we go with separating deprecated and "normal" optional libs filtering, should I introduce a disable_deprecated_libs too?

That would give us *way* to many options. I think for the sake of

simplicity

Quoted 1 line
Quoted 1 line

we probably are as well to just go with what you are proposing in this

set.

Quoted 1 line
Quoted 1 line

Since we only have two deprecated libraries - and hopefully never many

more -

Quoted 6 lines
Quoted 2 lines

the benefit of the list for that setting is probably minimal. I'm keen to avoid too much complexity if we can manage it.

I strongly agree with Bruce about avoiding too many options. Here's an idea:

How about just having the disable/enable_libs options, and by default omit

the deprecated libs.

Quoted 1 line
Quoted 7 lines
Quoted 2 lines

Then, the deprecated libs can be enabled by using the enable_libs option.

That was the original suggestion and implementation. The trouble is that if you specify, for example, -Denable_libs=kni, you have just disabled every other optional library in DPDK, since the enable_libs option switches DPDK to "allowlist"-only mode.

OK. Hmmm.... Perhaps we can accept that, using this argument:

If you are in a situation where you are using some deprecated libs, you probably also know exactly which other optional libs you are using. So you must specify the full list on enable_libs.

I won't object if anyone disagrees with this idea. I'm only trying to keep it simple. :-)

Quoted 7 lines
Quoted 3 lines

Do we have special treatment for deprecated drivers?

Its the best solution we have come up with so far to work around the above problem.

/Bruce

#58 lore raw

Re: [PATCH v4 3/4] build: select deprecated libraries

Quoted 27 lines · Morten Brørup
Quoted 19 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

- I don't have a usage for this, but if we go with separating deprecated and "normal" optional libs filtering, should I introduce a disable_deprecated_libs too?

That would give us *way* to many options. I think for the sake of

simplicity

Quoted 1 line
Quoted 1 line

we probably are as well to just go with what you are proposing in this

set.

Quoted 1 line
Quoted 1 line

Since we only have two deprecated libraries - and hopefully never many

more -

Quoted 6 lines
Quoted 2 lines

the benefit of the list for that setting is probably minimal. I'm keen to avoid too much complexity if we can manage it.

I strongly agree with Bruce about avoiding too many options. Here's an idea:

How about just having the disable/enable_libs options, and by default omit

the deprecated libs.

Quoted 1 line
Quoted 7 lines
Quoted 2 lines

Then, the deprecated libs can be enabled by using the enable_libs option.

That was the original suggestion and implementation. The trouble is that if you specify, for example, -Denable_libs=kni, you have just disabled every other optional library in DPDK, since the enable_libs option switches DPDK to "allowlist"-only mode.

Quoted 5 lines

OK. Hmmm.... Perhaps we can accept that, using this argument:

If you are in a situation where you are using some deprecated libs, you probably also know exactly which other optional libs you are using. So you must specify the full list on enable_libs.

I won't object if anyone disagrees with this idea. I'm only trying to keep it simple. :-)

- Mixing deprecated and "normal" libraries in a single generic option means that people (who are selecting some optional libraries only atm) could miss when an optional library is deprecated (in the future). On the other hand, if we go with a specialised option for deprecated libs, users will have to explicitly ask for keeping them.
I think it is also clearer from a user pov.

So I would stick with a separate handling of normal and deprecated libs.

- Adding a disable_deprecated_libs option does not make much sense for only two libraries.

- For v23.07, I'll announce a change in behavior in the build system wrt deprecated libraries.

I'll respin on top of Bruce idea (implementing enable_deprecated_libs as a list) for now.
And we can conclude on how to best expose/configure this by v23.11.

Signature · 1 line
David Marchand
#59 lore raw

PATCH v4 4/4 build: select optional libraries

In reply to David Marchand

There is currently no way to know which libraries are optional. Introduce a enable_libs option (close to what we have for drivers) so that packagers or projects consuming DPDK can more easily select the optional libraries that matter to them and disable other optional libraries.

---
Changes since v3:
- split non related cleanup changes,
- fixed false positive complaints about disabling mandatory libs by building the list of always enabled libs, appending this list to enable_list and checking the disable side,
- updated enable/disable_libs descriptions,

Changes since v2:
- moved the IOVA check for kni build in lib/kni/meson.build,
- reworked deprecated libraries handling by only considering them when no enable_libs option is set. With this, no need for a default value in meson_options.txt, yet configurations in the CI must be adjusted,
- moved mandatory libraries check after enable/disable_libs evaluation,

---
 lib/meson.build   | 33 +++++++++++++++++++++++----------
 meson_options.txt |  4 +++-
 2 files changed, 26 insertions(+), 11 deletions(-)
lib/meson.build +23 -10
index a6e9e19b42..407769b270 100644
@@ -92,17 +92,20 @@ dpdk_libs_deprecated += [
         'kni',
 ]
 
-disabled_libs = []
-opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'),
-        check: true).stdout().split()
-foreach l:opt_disabled_libs
+disable_libs = run_command(list_dir_globs, get_option('disable_libs'), check: true).stdout().split()
+
+enable_libs = run_command(list_dir_globs, get_option('enable_libs'), check: true).stdout().split()
+if enable_libs.length() == 0
+    enable_libs += optional_libs
+endif
+
+always_enable = []
+foreach l:libraries
     if not optional_libs.contains(l)
-        warning('Cannot disable mandatory library "@0@"'.format(l))
-        continue
+        always_enable += l
     endif
-    disabled_libs += l
 endforeach
-
+enable_libs += always_enable
 
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
@@ -139,12 +142,22 @@ foreach l:libraries
     if dpdk_libs_deprecated.contains(l) and not get_option('enable_deprecated_libs')
         build = false
         reason = 'deprecated libraries disabled via build config'
-    elif disabled_libs.contains(l)
+    elif not enable_libs.contains(l)
         build = false
-        reason = 'explicitly disabled via build config'
+        reason = 'not in enabled libraries build config'
         if dpdk_libs_deprecated.contains(l)
             reason += ' (deprecated lib)'
         endif
+    elif disable_libs.contains(l)
+        if always_enable.contains(l)
+            warning('Cannot disable mandatory library "@0@"'.format(l))
+        else
+            build = false
+            reason = 'explicitly disabled via build config'
+            if dpdk_libs_deprecated.contains(l)
+                reason += ' (deprecated lib)'
+            endif
+        endif
     endif
 
     if build
meson_options.txt +3 -1
index f959015e46..9951563146 100644
@@ -11,7 +11,7 @@ option('disable_apps', type: 'string', value: '', description:
 option('disable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to explicitly disable.')
 option('disable_libs', type: 'string', value: '', description:
-       'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')
+       'Comma-separated list of optional libraries to explicitly disable. [NOTE: mandatory libs cannot be disabled]')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>', description:
        'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
 option('enable_docs', type: 'boolean', value: false, description:
@@ -26,6 +26,8 @@ option('enable_driver_sdk', type: 'boolean', value: false, description:
        'Install headers to build drivers.')
 option('enable_kmods', type: 'boolean', value: false, description:
        'build kernel modules')
+option('enable_libs', type: 'string', value: '', description:
+       'Comma-separated list of optional libraries to explicitly enable. [NOTE: mandatory libs are always enabled]')
 option('examples', type: 'string', value: '', description:
        'Comma-separated list of examples to build by default')
 option('ibverbs_link', type: 'combo', choices : ['static', 'shared', 'dlopen'], value: 'shared', description:
Signature · 1 line
2.40.1
Acked-by on v4 4/4
#60 lore raw

Re: [PATCH v4 4/4] build: select optional libraries

Quoted 8 lines · David Marchand

There is currently no way to know which libraries are optional. Introduce a enable_libs option (close to what we have for drivers) so that packagers or projects consuming DPDK can more easily select the optional libraries that matter to them and disable other optional libraries.

---

LGTM - one minor suggestion inline below.

Quoted 37 lines

Changes since v3:
- split non related cleanup changes,
- fixed false positive complaints about disabling mandatory libs by building the list of always enabled libs, appending this list to enable_list and checking the disable side,
- updated enable/disable_libs descriptions,

Changes since v2:
- moved the IOVA check for kni build in lib/kni/meson.build,
- reworked deprecated libraries handling by only considering them when no enable_libs option is set. With this, no need for a default value in meson_options.txt, yet configurations in the CI must be adjusted,
- moved mandatory libraries check after enable/disable_libs evaluation,

---
 lib/meson.build   | 33 +++++++++++++++++++++++----------
 meson_options.txt |  4 +++-
 2 files changed, 26 insertions(+), 11 deletions(-)
lib/meson.build +6 -4
index a6e9e19b42..407769b270 100644
@@ -92,17 +92,20 @@ dpdk_libs_deprecated += [
         'kni',
 ]
 
-disabled_libs = []
-opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'),
-        check: true).stdout().split()
-foreach l:opt_disabled_libs
+disable_libs = run_command(list_dir_globs, get_option('disable_libs'), check: true).stdout().split()
+
+enable_libs = run_command(list_dir_globs, get_option('enable_libs'), check: true).stdout().split()
+if enable_libs.length() == 0
+    enable_libs += optional_libs
+endif

lib/meson.build dpdk_libs_deprecated += [ · line 107

Quoted 10 lines
lib/meson.build +4 -3
+
+always_enable = []
+foreach l:libraries
     if not optional_libs.contains(l)
-        warning('Cannot disable mandatory library "@0@"'.format(l))
-        continue
+        always_enable += l
     endif
-    disabled_libs += l
 endforeach

Minor nit, I'd actually put this block further up the file just after the optional_libs list. It's more an array definition, and moving it up puts the next line (below) to add to enable_libs immediately after the other assignments to enable_libs.

Quoted 55 lines
lib/meson.build +13 -3
-
+enable_libs += always_enable
 
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
@@ -139,12 +142,22 @@ foreach l:libraries
     if dpdk_libs_deprecated.contains(l) and not get_option('enable_deprecated_libs')
         build = false
         reason = 'deprecated libraries disabled via build config'
-    elif disabled_libs.contains(l)
+    elif not enable_libs.contains(l)
         build = false
-        reason = 'explicitly disabled via build config'
+        reason = 'not in enabled libraries build config'
         if dpdk_libs_deprecated.contains(l)
             reason += ' (deprecated lib)'
         endif
+    elif disable_libs.contains(l)
+        if always_enable.contains(l)
+            warning('Cannot disable mandatory library "@0@"'.format(l))
+        else
+            build = false
+            reason = 'explicitly disabled via build config'
+            if dpdk_libs_deprecated.contains(l)
+                reason += ' (deprecated lib)'
+            endif
+        endif
     endif
 
     if build
meson_options.txt +3 -1
index f959015e46..9951563146 100644
@@ -11,7 +11,7 @@ option('disable_apps', type: 'string', value: '', description:
 option('disable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to explicitly disable.')
 option('disable_libs', type: 'string', value: '', description:
-       'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')
+       'Comma-separated list of optional libraries to explicitly disable. [NOTE: mandatory libs cannot be disabled]')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>', description:
        'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
 option('enable_docs', type: 'boolean', value: false, description:
@@ -26,6 +26,8 @@ option('enable_driver_sdk', type: 'boolean', value: false, description:
        'Install headers to build drivers.')
 option('enable_kmods', type: 'boolean', value: false, description:
        'build kernel modules')
+option('enable_libs', type: 'string', value: '', description:
+       'Comma-separated list of optional libraries to explicitly enable. [NOTE: mandatory libs are always enabled]')
 option('examples', type: 'string', value: '', description:
        'Comma-separated list of examples to build by default')
 option('ibverbs_link', type: 'combo', choices : ['static', 'shared', 'dlopen'], value: 'shared', description:
Signature · 1 line
2.40.1
#61 lore raw

Re: [PATCH v4 0/4] Select optional libraries

In reply to David Marchand
Quoted 11 lines · David Marchand

This series is one implementation to try and please users who want to select more easily which parts of DPDK are built.

It introduces a change in behavior for enabling deprecated libraries:
this series is aimed at the next release but sent early as a demo of what changes are required.

If no strong opposition is met, a deprecation notice will be sent for v23.07 to announce this change in v23.11.

Quoted 18 lines

Changes since v3:
- split kni cleanup,
- split variable rename cleanup,
- introduced a new meson option to control deprecated libraries activation,
- simplified the actual implementation of enable_libs to mimic enable_drivers behavior,

Signature · 7 lines
David Marchand

David Marchand (4):
  kni: move IOVA build check
  build: rename enabled libraries list
  build: select deprecated libraries
  build: select optional libraries

I think the first 2 patches should definitely go into 23.07. The latter two cause a change in how one needs to build DPDK with libs enabled, so we may want to push that out, and flag the change in advance. Since it's a relatively minor change, and a build-time one only, I'm fine with it going in either 23.07 or 23.11, as maintainers decide.

#62 lore raw

Re: [PATCH v4 0/4] Select optional libraries

22/06/2023 11:09, Bruce Richardson:

Quoted 21 lines · David Marchand
Quoted 11 lines

This series is one implementation to try and please users who want to select more easily which parts of DPDK are built.

It introduces a change in behavior for enabling deprecated libraries:
this series is aimed at the next release but sent early as a demo of what changes are required.

If no strong opposition is met, a deprecation notice will be sent for v23.07 to announce this change in v23.11.

Quoted 9 lines

Changes since v3:
- split kni cleanup,
- split variable rename cleanup,
- introduced a new meson option to control deprecated libraries activation,
- simplified the actual implementation of enable_libs to mimic enable_drivers behavior,

Quoted 7 lines

I think the first 2 patches should definitely go into 23.07. The latter two cause a change in how one needs to build DPDK with libs enabled, so we may want to push that out, and flag the change in advance. Since it's a relatively minor change, and a build-time one only, I'm fine with it going in either 23.07 or 23.11, as maintainers decide.

Applied first 2 patches, thanks.

#63 lore raw

v5 cover Select optional libraries

In reply to David Marchand

This series is one implementation to try and please users who want to select more easily which parts of DPDK are built.

It introduces a change in behavior for enabling deprecated libraries:
this series is aimed at the next release but sent early as a demo of what changes are required.

If no strong opposition is met, a deprecation notice will be sent for v23.07 to announce this change in v23.11.

Changes since v4:
- rebased on main,
- switched to a list of enabled deprecated libraries,

Changes since v3:
- split kni cleanup,
- split variable rename cleanup,
- introduced a new meson option to control deprecated libraries activation,
- simplified the actual implementation of enable_libs to mimic enable_drivers behavior,

Signature · 14 lines
David Marchand

David Marchand (2):
  build: select deprecated libraries
  build: select optional libraries

 .ci/linux-build.sh            |  2 +-
 devtools/test-meson-builds.sh |  8 +++---
 lib/meson.build               | 50 +++++++++++++++++++++++++----------
 meson_options.txt             |  8 ++++--
 4 files changed, 47 insertions(+), 21 deletions(-)

-- 
2.40.1
#64 lore raw

PATCH v5 1/2 build: select deprecated libraries

Rework deprecated libraries selection by introducing a new configuration option.

This breaks existing configurations that were relying on disable_libs='' for enabling deprecated libraries.
On the other hand, it will make enabling optional libraries more straightforward by taking the deprecated libraries out of the picture.

---
Changes since v4:
- changed the option to a list of libraries instead of a global on/off knob,
- moved all deprecated libs checks under a single block for readability,

---
 .ci/linux-build.sh            |  2 +-
 devtools/test-meson-builds.sh |  8 ++++----
 lib/meson.build               | 28 ++++++++++++++++++++--------
 meson_options.txt             |  4 +++-
 4 files changed, 28 insertions(+), 14 deletions(-)
.ci/linux-build.sh +1 -1
index 45f2729996..e0b62bac90 100755
@@ -97,7 +97,7 @@ if [ "$MINI" = "true" ]; then
     OPTS="$OPTS -Denable_drivers=net/null"
     OPTS="$OPTS -Ddisable_libs=*"
 else
-    OPTS="$OPTS -Ddisable_libs="
+    OPTS="$OPTS -Denable_deprecated_libs=*"
 fi
 OPTS="$OPTS -Dlibdir=lib"
 
devtools/test-meson-builds.sh +4 -4
index 84b907d2ea..c41659d28b 100755
@@ -120,10 +120,10 @@ config () # <dir> <builddir> <meson options>
 		return
 	fi
 	options=
-	# deprecated libs may be disabled by default, so for complete builds ensure
-	# no libs are disabled
-	if ! echo $* | grep -q -- 'disable_libs' ; then
-		options="$options -Ddisable_libs="
+	# deprecated libs are disabled by default, so for complete builds
+	# enable them
+	if ! echo $* | grep -q -- 'enable_deprecated_libs' ; then
+		options="$options -Denable_deprecated_libs=*"
 	fi
 	if echo $* | grep -qw -- '--default-library=shared' ; then
 		options="$options -Dexamples=all"
lib/meson.build +20 -8
index fac2f52cad..73afd90b38 100644
@@ -93,6 +93,15 @@ dpdk_libs_deprecated += [
         'kni',
 ]
 
+enable_deprecated_libs = []
+foreach l:run_command(list_dir_globs, get_option('enable_deprecated_libs'),
+        check: true).stdout().split()
+    if not dpdk_libs_deprecated.contains(l)
+        continue
+    endif
+    enable_deprecated_libs += l
+endforeach
+
 disabled_libs = []
 opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'),
         check: true).stdout().split()
@@ -137,16 +146,19 @@ foreach l:libraries
         deps += ['eal']
     endif
 
-    if disabled_libs.contains(l)
-        build = false
-        reason = 'explicitly disabled via build config'
-        if dpdk_libs_deprecated.contains(l)
-            reason += ' (deprecated lib)'
-        endif
-    else
-        if dpdk_libs_deprecated.contains(l)
+    if dpdk_libs_deprecated.contains(l)
+        if not enable_deprecated_libs.contains(l)
+            build = false
+            reason = 'not in enabled deprecated libraries build config'
+        else
             warning('Enabling deprecated library, "@0@"'.format(l))
         endif
+    elif disabled_libs.contains(l)
+        build = false
+        reason = 'explicitly disabled via build config'
+    endif
+
+    if build
         subdir(l)
     endif
     if name != l
meson_options.txt +3 -1
index 82c8297065..839d4266c6 100644
@@ -10,7 +10,7 @@ option('disable_apps', type: 'string', value: '', description:
        'Comma-separated list of apps to explicitly disable.')
 option('disable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to explicitly disable.')
-option('disable_libs', type: 'string', value: 'flow_classify,kni', description:
+option('disable_libs', type: 'string', value: '', description:
        'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>', description:
        'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
@@ -18,6 +18,8 @@ option('enable_docs', type: 'boolean', value: false, description:
        'build documentation')
 option('enable_apps', type: 'string', value: '', description:
        'Comma-separated list of apps to build. If unspecified, build all apps.')
+option('enable_deprecated_libs', type: 'string', value: '', description:
+       'Comma-separated list of deprecated libraries to explicitly enable.')
 option('enable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to build. If unspecified, build all drivers.')
 option('enable_driver_sdk', type: 'boolean', value: false, description:
Signature · 1 line
2.40.1
#65 lore raw

Re: [PATCH v5 1/2] build: select deprecated libraries

Quoted 8 lines · David Marchand

Rework deprecated libraries selection by introducing a new configuration option.

This breaks existing configurations that were relying on disable_libs='' for enabling deprecated libraries.
On the other hand, it will make enabling optional libraries more straightforward by taking the deprecated libraries out of the picture.

Quoted 6 lines

---
Changes since v4:
- changed the option to a list of libraries instead of a global on/off knob,
- moved all deprecated libs checks under a single block for readability,

Looks nice. I guess we can also update
guides/prog_guide/kernel_nic_interface.rst
guides/prog_guide/flow_classify_lib.rst

with something like the following:

doc/guides/prog_guide/flow_classify_lib.rst +3 -2
index ad2e10ec26..c2706b8d46 100644
@@ -10,8 +10,9 @@ Flow Classification Library
    See :doc:`../rel_notes/deprecation`.
 
    It is disabled by default in the DPDK build.
-   To re-enable the library, remove 'flow_classify' from the "disable_libs"
-   meson option when configuring a build.
+   To re-enable the library, tell meson to enable 'flow_classify' as part of
+   the deprecated libraries meson
+   option ``-Denable_deprecated_libs=flow_classify``.
 
 DPDK provides a Flow Classification library that provides the ability
 to classify an input packet by matching it against a set of Flow rules.
doc/guides/prog_guide/kernel_nic_interface.rst +2 -1
index 392e5df75f..1097ecc695 100644
@@ -18,7 +18,8 @@ Kernel NIC Interface
 .. note::
 
    KNI is disabled by default in the DPDK build.
-   To re-enable the library, remove 'kni' from the "disable_libs" meson option when configuring a build.
+   To re-enable the library, tell meson to enable 'kni' as part of the
+   deprecated libraries meson option ``-Denable_deprecated_libs=kni``.
 
 The DPDK Kernel NIC Interface (KNI) allows userspace applications access to the Linux* control plane.
 

---

Quoted 109 lines
---
 .ci/linux-build.sh            |  2 +-
 devtools/test-meson-builds.sh |  8 ++++----
 lib/meson.build               | 28 ++++++++++++++++++++--------
 meson_options.txt             |  4 +++-
 4 files changed, 28 insertions(+), 14 deletions(-)
.ci/linux-build.sh +1 -1
index 45f2729996..e0b62bac90 100755
@@ -97,7 +97,7 @@ if [ "$MINI" = "true" ]; then
     OPTS="$OPTS -Denable_drivers=net/null"
     OPTS="$OPTS -Ddisable_libs=*"
 else
-    OPTS="$OPTS -Ddisable_libs="
+    OPTS="$OPTS -Denable_deprecated_libs=*"
 fi
 OPTS="$OPTS -Dlibdir=lib"
 
devtools/test-meson-builds.sh +4 -4
index 84b907d2ea..c41659d28b 100755
@@ -120,10 +120,10 @@ config () # <dir> <builddir> <meson options>
 		return
 	fi
 	options=
-	# deprecated libs may be disabled by default, so for complete builds ensure
-	# no libs are disabled
-	if ! echo $* | grep -q -- 'disable_libs' ; then
-		options="$options -Ddisable_libs="
+	# deprecated libs are disabled by default, so for complete builds
+	# enable them
+	if ! echo $* | grep -q -- 'enable_deprecated_libs' ; then
+		options="$options -Denable_deprecated_libs=*"
 	fi
 	if echo $* | grep -qw -- '--default-library=shared' ; then
 		options="$options -Dexamples=all"
lib/meson.build +20 -8
index fac2f52cad..73afd90b38 100644
@@ -93,6 +93,15 @@ dpdk_libs_deprecated += [
         'kni',
 ]
 
+enable_deprecated_libs = []
+foreach l:run_command(list_dir_globs, get_option('enable_deprecated_libs'),
+        check: true).stdout().split()
+    if not dpdk_libs_deprecated.contains(l)
+        continue
+    endif
+    enable_deprecated_libs += l
+endforeach
+
 disabled_libs = []
 opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'),
         check: true).stdout().split()
@@ -137,16 +146,19 @@ foreach l:libraries
         deps += ['eal']
     endif
 
-    if disabled_libs.contains(l)
-        build = false
-        reason = 'explicitly disabled via build config'
-        if dpdk_libs_deprecated.contains(l)
-            reason += ' (deprecated lib)'
-        endif
-    else
-        if dpdk_libs_deprecated.contains(l)
+    if dpdk_libs_deprecated.contains(l)
+        if not enable_deprecated_libs.contains(l)
+            build = false
+            reason = 'not in enabled deprecated libraries build config'
+        else
             warning('Enabling deprecated library, "@0@"'.format(l))
         endif
+    elif disabled_libs.contains(l)
+        build = false
+        reason = 'explicitly disabled via build config'
+    endif
+
+    if build
         subdir(l)
     endif
     if name != l
meson_options.txt +3 -1
index 82c8297065..839d4266c6 100644
@@ -10,7 +10,7 @@ option('disable_apps', type: 'string', value: '', description:
        'Comma-separated list of apps to explicitly disable.')
 option('disable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to explicitly disable.')
-option('disable_libs', type: 'string', value: 'flow_classify,kni', description:
+option('disable_libs', type: 'string', value: '', description:
        'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>', description:
        'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
@@ -18,6 +18,8 @@ option('enable_docs', type: 'boolean', value: false, description:
        'build documentation')
 option('enable_apps', type: 'string', value: '', description:
        'Comma-separated list of apps to build. If unspecified, build all apps.')
+option('enable_deprecated_libs', type: 'string', value: '', description:
+       'Comma-separated list of deprecated libraries to explicitly enable.')
 option('enable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to build. If unspecified, build all drivers.')
 option('enable_driver_sdk', type: 'boolean', value: false, description:
#66 lore raw

PATCH v5 2/2 build: select optional libraries

In reply to David Marchand

There is currently no way to know which libraries are optional. Introduce a enable_libs option (close to what we have for drivers) so that packagers or projects consuming DPDK can more easily select the optional libraries that matter to them and disable other optional libraries.

---
Changes since v4:
- moved always_enable earlier for readability,

Changes since v3:
- split non related cleanup changes,
- fixed false positive complaints about disabling mandatory libs by building the list of always enabled libs, appending this list to enable_list and checking the disable side,
- updated enable/disable_libs descriptions,

Changes since v2:
- moved the IOVA check for kni build in lib/kni/meson.build,
- reworked deprecated libraries handling by only considering them when no enable_libs option is set. With this, no need for a default value in meson_options.txt, yet configurations in the CI must be adjusted,
- moved mandatory libraries check after enable/disable_libs evaluation,

---
 lib/meson.build   | 34 ++++++++++++++++++++++------------
 meson_options.txt |  4 +++-
 2 files changed, 25 insertions(+), 13 deletions(-)
lib/meson.build +22 -12
index 73afd90b38..b8834fc277 100644
@@ -88,6 +88,13 @@ optional_libs = [
         'vhost',
 ]
 
+always_enable = []
+foreach l:libraries
+    if not optional_libs.contains(l)
+        always_enable += l
+    endif
+endforeach
+
 dpdk_libs_deprecated += [
         'flow_classify',
         'kni',
@@ -102,17 +109,13 @@ foreach l:run_command(list_dir_globs, get_option('enable_deprecated_libs'),
     enable_deprecated_libs += l
 endforeach
 
-disabled_libs = []
-opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'),
-        check: true).stdout().split()
-foreach l:opt_disabled_libs
-    if not optional_libs.contains(l)
-        warning('Cannot disable mandatory library "@0@"'.format(l))
-        continue
-    endif
-    disabled_libs += l
-endforeach
+disable_libs = run_command(list_dir_globs, get_option('disable_libs'), check: true).stdout().split()
 
+enable_libs = run_command(list_dir_globs, get_option('enable_libs'), check: true).stdout().split()
+if enable_libs.length() == 0
+    enable_libs += optional_libs
+endif
+enable_libs += always_enable
 
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
@@ -153,9 +156,16 @@ foreach l:libraries
         else
             warning('Enabling deprecated library, "@0@"'.format(l))
         endif
-    elif disabled_libs.contains(l)
+    elif not enable_libs.contains(l)
         build = false
-        reason = 'explicitly disabled via build config'
+        reason = 'not in enabled libraries build config'
+    elif disable_libs.contains(l)
+        if always_enable.contains(l)
+            warning('Cannot disable mandatory library "@0@"'.format(l))
+        else
+            build = false
+            reason = 'explicitly disabled via build config'
+        endif
     endif
 
     if build
meson_options.txt +3 -1
index 839d4266c6..7312da3640 100644
@@ -11,7 +11,7 @@ option('disable_apps', type: 'string', value: '', description:
 option('disable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to explicitly disable.')
 option('disable_libs', type: 'string', value: '', description:
-       'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')
+       'Comma-separated list of optional libraries to explicitly disable. [NOTE: mandatory libs cannot be disabled]')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>', description:
        'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
 option('enable_docs', type: 'boolean', value: false, description:
@@ -26,6 +26,8 @@ option('enable_driver_sdk', type: 'boolean', value: false, description:
        'Install headers to build drivers.')
 option('enable_kmods', type: 'boolean', value: false, description:
        'build kernel modules')
+option('enable_libs', type: 'string', value: '', description:
+       'Comma-separated list of optional libraries to explicitly enable. [NOTE: mandatory libs are always enabled]')
 option('examples', type: 'string', value: '', description:
        'Comma-separated list of examples to build by default')
 option('ibverbs_link', type: 'combo', choices : ['static', 'shared', 'dlopen'], value: 'shared', description:
Signature · 1 line
2.40.1
#67 lore raw

RE: [PATCH v5 0/2] Select optional libraries

In reply to David Marchand
Quoted 5 lines

From: David Marchand [mailto:[email protected]]
Sent: Wednesday, 28 June 2023 15.20

This series is one implementation to try and please users who want to select more easily which parts of DPDK are built.

/me feels pleased :-)

Quoted 7 lines

It introduces a change in behavior for enabling deprecated libraries:
this series is aimed at the next release but sent early as a demo of what changes are required.

If no strong opposition is met, a deprecation notice will be sent for v23.07 to announce this change in v23.11.

+1 for deprecation notice.

#68 lore raw

Re: [PATCH v5 0/2] Select optional libraries

Quoted 13 lines · Morten Brørup
Quoted 5 lines

From: David Marchand [mailto:[email protected]]
Sent: Wednesday, 28 June 2023 15.20

This series is one implementation to try and please users who want to select more easily which parts of DPDK are built.

/me feels pleased :-)

Quoted 5 lines

It introduces a change in behavior for enabling deprecated libraries:
this series is aimed at the next release but sent early as a demo of what changes are required.

Quoted 6 lines
Quoted 2 lines

If no strong opposition is met, a deprecation notice will be sent for v23.07 to announce this change in v23.11.

+1 for deprecation notice.

#69 lore raw
In reply to David Marchand

17/11/2021 12:28, David Marchand:

Quoted 8 lines

This series extends the optional libraries list adding to them testpmd non essential dependencies.

We were not testing the disable_libs option, so let's add a minimum target in the the public CI script (mainly for GHA) and in test-meson-builds.sh script.

The last patch is an idea for enhancing the optional libraries selection.

Applied all but last patch, thanks.