From patchwork Wed Nov 17 11:28:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 104465 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 14C1BA0C41; Wed, 17 Nov 2021 12:30:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 00ECD41229; Wed, 17 Nov 2021 12:30:12 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 257854116D for ; Wed, 17 Nov 2021 12:30:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637148610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PMu7nobBAVQP17ugzVbs7/doPMW9oO/W6/9cZ+UbBPo=; b=MBWstQZ37KcRGw1rLd2F659v+dZrthsb2zg+pe79G2AKBK16xDTGthLtnRYUXJOTqbuGPY 9rux9NYoENjZ+n+KtljdVDl9KhhSBNP9xNi3ftDcxxuS2FiUsD1F9IvYetfM8Qpv8v2SKk VQkt2YUAZ4/ijD2INXrk/RCXBRplH54= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-312-2-tamLD4PM6VRdhkjH2j5w-1; Wed, 17 Nov 2021 06:30:05 -0500 X-MC-Unique: 2-tamLD4PM6VRdhkjH2j5w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4470618125C4; Wed, 17 Nov 2021 11:30:03 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F77421ECB; Wed, 17 Nov 2021 11:29:40 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: bruce.richardson@intel.com, thomas@monjalon.net, bluca@debian.org, tredaelli@redhat.com, i.maximets@ovn.org, james.r.harris@intel.com, mohammed@hawari.fr, Aaron Conole , Michael Santana Subject: [PATCH v2 1/5] ci: test minimum configuration Date: Wed, 17 Nov 2021 12:28:43 +0100 Message-Id: <20211117112847.7362-2-david.marchand@redhat.com> In-Reply-To: <20211117112847.7362-1-david.marchand@redhat.com> References: <20211110164814.5231-1-david.marchand@redhat.com> <20211117112847.7362-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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. Signed-off-by: David Marchand Acked-by: Thomas Monjalon Acked-by: Aaron Conole --- 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(+) diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index ef0bd099be..6e8bd7baa9 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4151cafee7..2e9c4be6d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index 9ec8e2bc7e..4ed61328b9 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -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. From patchwork Wed Nov 17 11:28:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 104466 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2BEF9A0C41; Wed, 17 Nov 2021 12:30:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15926411A4; Wed, 17 Nov 2021 12:30:38 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 3CB514116D for ; Wed, 17 Nov 2021 12:30:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637148635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ttZ255ma/X78Kc0l+TS+zmy9zZ+1EWsoGsjkL8MLDRE=; b=aDvMVY7bpsdofDQ7Yjuqzv5069mvauFp8Uw1BqPJCEXrzzHMGZPiukvj6V1PTlnwDfEB6d HcPNePvfic4we/OoxZNDKh/6jbFnCGxcqO3s8b4DDBdlxnCJKHjx2UrAa7hKkyO14/UVR0 sPqxz47eI0hf0oR4QG3QkJ0dAEEcG50= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-403-rAnwFMs0OtCqGKwWwzmJAA-1; Wed, 17 Nov 2021 06:30:32 -0500 X-MC-Unique: rAnwFMs0OtCqGKwWwzmJAA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3A07110168C0; Wed, 17 Nov 2021 11:30:31 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 387E91F46B; Wed, 17 Nov 2021 11:30:05 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: bruce.richardson@intel.com, thomas@monjalon.net, bluca@debian.org, tredaelli@redhat.com, i.maximets@ovn.org, james.r.harris@intel.com, mohammed@hawari.fr, Xiaoyun Li Subject: [PATCH v2 2/5] build: make GRO/GSO optional Date: Wed, 17 Nov 2021 12:28:44 +0100 Message-Id: <20211117112847.7362-3-david.marchand@redhat.com> In-Reply-To: <20211117112847.7362-1-david.marchand@redhat.com> References: <20211110164814.5231-1-david.marchand@redhat.com> <20211117112847.7362-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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. Signed-off-by: David Marchand Acked-by: Bruce Richardson Acked-by: Thomas Monjalon --- 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(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 85d9b57a9b..3faa37db6d 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -34,7 +34,9 @@ #include #include #include +#ifdef RTE_LIB_GRO #include +#endif #include #include @@ -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, diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 2c2ab449b5..6fca09527b 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -48,7 +48,9 @@ #ifdef RTE_NET_BNXT #include #endif +#ifdef RTE_LIB_GRO #include +#endif #include #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) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index e0b00abe8c..2aeea243b6 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -40,8 +40,12 @@ #include #include #include +#ifdef RTE_LIB_GRO #include +#endif +#ifdef RTE_LIB_GSO #include +#endif #include #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); diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build index d5df52c470..eba03b572c 100644 --- a/app/test-pmd/meson.build +++ b/app/test-pmd/meson.build @@ -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 diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 59cc4580b2..f74ba61be6 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -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 } diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 669ce1e87d..b1dfd097c7 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -9,8 +9,12 @@ #include #include +#ifdef RTE_LIB_GRO #include +#endif +#ifdef RTE_LIB_GSO #include +#endif #include #include #include @@ -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, diff --git a/lib/meson.build b/lib/meson.build index 8537a5ab80..2766c02bd2 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -66,6 +66,8 @@ libraries = [ ] optional_libs = [ + 'gro', + 'gso', 'kni', 'power', 'vhost', From patchwork Wed Nov 17 11:28:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 104467 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6BB25A0C41; Wed, 17 Nov 2021 12:30:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 630D441C3D; Wed, 17 Nov 2021 12:30:43 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 8B8CF41C3C for ; Wed, 17 Nov 2021 12:30:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637148641; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wEHJIWnfDNLNULCIBwcJTVlsPJmicZ2i6+D6hnA7DRQ=; b=hQu/7ei5sWxXRGbD500Kb7YUKpWA0yDt2c6nqZlvIZFRGZVo5aRWeV5KAvG8kOCCuxaoxt y5K8y1WyonkfvlwcJnWKo1l1IujR/Nz5lcW1zThpnQSTAu/qwnDKoFPeMzNTgkC1TpVCgP gZuPZuCIAeG8Rgcsbn0C//SqvRvCJp4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-103-MN8zyPByMxaucfzkmMIsWA-1; Wed, 17 Nov 2021 06:30:39 -0500 X-MC-Unique: MN8zyPByMxaucfzkmMIsWA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 150CBEC1A0; Wed, 17 Nov 2021 11:30:38 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52E9B1F452; Wed, 17 Nov 2021 11:30:34 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: bruce.richardson@intel.com, thomas@monjalon.net, bluca@debian.org, tredaelli@redhat.com, i.maximets@ovn.org, james.r.harris@intel.com, mohammed@hawari.fr, Maryam Tahhan , Reshma Pattan , Xiaoyun Li Subject: [PATCH v2 3/5] build: make metrics libraries optional Date: Wed, 17 Nov 2021 12:28:45 +0100 Message-Id: <20211117112847.7362-4-david.marchand@redhat.com> In-Reply-To: <20211117112847.7362-1-david.marchand@redhat.com> References: <20211110164814.5231-1-david.marchand@redhat.com> <20211117112847.7362-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org metrics, bitratestats, jobstats and latencystats libraries can be made optional as they provide standalone features. Signed-off-by: David Marchand Acked-by: Bruce Richardson Acked-by: Thomas Monjalon --- 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(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index ebe2d77264..ce140aaf84 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -29,7 +29,9 @@ #include #include #include +#ifdef RTE_LIB_METRICS #include +#endif #include #ifdef RTE_LIB_SECURITY #include @@ -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) diff --git a/app/proc-info/meson.build b/app/proc-info/meson.build index 1062e0ef86..1563ce656a 100644 --- a/app/proc-info/meson.build +++ b/app/proc-info/meson.build @@ -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 diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build index eba03b572c..43130c8856 100644 --- a/app/test-pmd/meson.build +++ b/app/test-pmd/meson.build @@ -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 diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index f74ba61be6..ba65342b6d 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -54,7 +54,9 @@ #include #endif #include +#ifdef RTE_LIB_METRICS #include +#endif #ifdef RTE_LIB_BITRATESTATS #include #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) { diff --git a/app/test/meson.build b/app/test/meson.build index 2191a5e146..0d261b1138 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -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') diff --git a/lib/meson.build b/lib/meson.build index 2766c02bd2..961b95f4ad 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -66,9 +66,13 @@ libraries = [ ] optional_libs = [ + 'bitratestats', 'gro', 'gso', 'kni', + 'jobstats', + 'latencystats', + 'metrics', 'power', 'vhost', ] From patchwork Wed Nov 17 11:28:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 104468 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 216DAA0C41; Wed, 17 Nov 2021 12:30:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 65C3E41C27; Wed, 17 Nov 2021 12:30:50 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id E6A574122E for ; Wed, 17 Nov 2021 12:30:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637148648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wlg0L2Vsj/piA/sy0WuLx1wn5Vi4N5uQpXene9/+6h8=; b=JFpcBAl7Q7B9WdxwatXTSYb8+u/UYxZQdsUXpnvx/lgX08yA5RWDsih5ij5+EUYPUihZDa Lqz5UXMrq7rQs0YZwO6A5lUxFsNzL2DuBVHmqJMfWi78ZVSfy0z/jCHbAGDAuPoXjfIaXn oT/p3wcgliNxaJFYK/QlJB8v/1ylNcY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-162-C58sWiXkPaestUB5FkJuXg-1; Wed, 17 Nov 2021 06:30:47 -0500 X-MC-Unique: C58sWiXkPaestUB5FkJuXg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2D06B10168C0; Wed, 17 Nov 2021 11:30:46 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DF019329; Wed, 17 Nov 2021 11:30:42 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: bruce.richardson@intel.com, thomas@monjalon.net, bluca@debian.org, tredaelli@redhat.com, i.maximets@ovn.org, james.r.harris@intel.com, mohammed@hawari.fr Subject: [PATCH v2 4/5] build: make pdump optional Date: Wed, 17 Nov 2021 12:28:46 +0100 Message-Id: <20211117112847.7362-5-david.marchand@redhat.com> In-Reply-To: <20211117112847.7362-1-david.marchand@redhat.com> References: <20211110164814.5231-1-david.marchand@redhat.com> <20211117112847.7362-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This library can be made optional. dumpcap and pdump applications depend on this library, check for dependencies like what we have for examples. Signed-off-by: David Marchand Acked-by: Bruce Richardson Acked-by: Thomas Monjalon --- app/meson.build | 18 +++++++++++++----- app/test/meson.build | 10 +++++----- lib/meson.build | 1 + 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/app/meson.build b/app/meson.build index 310e83076f..93d8c15032 100644 --- a/app/meson.build +++ b/app/meson.build @@ -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 diff --git a/app/test/meson.build b/app/test/meson.build index 0d261b1138..961bebc5cb 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -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' diff --git a/lib/meson.build b/lib/meson.build index 961b95f4ad..dad9fce14d 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -73,6 +73,7 @@ optional_libs = [ 'jobstats', 'latencystats', 'metrics', + 'pdump', 'power', 'vhost', ] From patchwork Wed Nov 17 11:28:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 104469 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CAB8CA0C41; Wed, 17 Nov 2021 12:30:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B4824426DD; Wed, 17 Nov 2021 12:30:59 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id AFBE5426D5 for ; Wed, 17 Nov 2021 12:30:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637148657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z/y5opQLD6rkmw7+UdV0i3a+Igjd/TEA7TSAOIQKldg=; b=Ef1Tn+QSxTZSBxn+oh8Pj9fXh1ia/WehBuyqilWABGgpIxb/y2vYLGuZ/zVnf/kwE9S07o 9sdzRFUbTJWvrVkRd4+eO0D28W/Nm9jsdcr7Al9i7al5GOuDAPFWU99PU4CRphniHxtSOh XOjiDvibBAXNvB2fb7bOGi08Nb/9e2I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-19-cxX8JfxGPt2KyhGQSQ93cA-1; Wed, 17 Nov 2021 06:30:54 -0500 X-MC-Unique: cxX8JfxGPt2KyhGQSQ93cA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B52461006AA0; Wed, 17 Nov 2021 11:30:52 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4A359329; Wed, 17 Nov 2021 11:30:49 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: bruce.richardson@intel.com, thomas@monjalon.net, bluca@debian.org, tredaelli@redhat.com, i.maximets@ovn.org, james.r.harris@intel.com, mohammed@hawari.fr Subject: [PATCH v2 5/5] build: select optional libraries Date: Wed, 17 Nov 2021 12:28:47 +0100 Message-Id: <20211117112847.7362-6-david.marchand@redhat.com> In-Reply-To: <20211117112847.7362-1-david.marchand@redhat.com> References: <20211110164814.5231-1-david.marchand@redhat.com> <20211117112847.7362-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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. Signed-off-by: David Marchand --- buildtools/chkincs/meson.build | 2 +- lib/meson.build | 34 ++++++++++++++++++---------------- meson.build | 3 ++- meson_options.txt | 2 ++ 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/buildtools/chkincs/meson.build b/buildtools/chkincs/meson.build index 5ffca89761..6b93d5f46c 100644 --- a/buildtools/chkincs/meson.build +++ b/buildtools/chkincs/meson.build @@ -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 diff --git a/lib/meson.build b/lib/meson.build index dad9fce14d..47c857c0fc 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -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 = '' # 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) diff --git a/meson.build b/meson.build index 12cb6e0e83..65855ceee8 100644 --- a/meson.build +++ b/meson.build @@ -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 diff --git a/meson_options.txt b/meson_options.txt index 7c220ad68d..ccb92cff7a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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: