From patchwork Tue Jun 20 14:07:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 128857 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 3998342D09; Tue, 20 Jun 2023 16:11:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A09F42C4D; Tue, 20 Jun 2023 16:11:21 +0200 (CEST) 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 E3380410F6 for ; Tue, 20 Jun 2023 16:11:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687270278; 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=VDy/XVEKHAQtAm9tw28OLbN8iXApShF8uhZGDU91GEg=; b=UWeMNojteKHexIx5pDCp2eQzYyXv41ZnlcFibkCmwTIz5B/Imvy+AUIu711pSAR/XKoKfK itWssDjPsOLWaxd27dysTUQxtgCYY1RzaYoKPpSX/H69ypsUD7shN3vq3t8HvmXaoyxpJs KmGSKxu0VEj1hFVjRukdhsXKsxULehA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-594-tCl_2Bs_OJ2rA89j8ipvuQ-1; Tue, 20 Jun 2023 10:08:57 -0400 X-MC-Unique: tCl_2Bs_OJ2rA89j8ipvuQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 675DE88D586; Tue, 20 Jun 2023 14:07:37 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 397E69E9C; Tue, 20 Jun 2023 14:07:36 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, bruce.richardson@intel.com, stable@dpdk.org, Brian Dooley , Gowrishankar Muthukrishnan Subject: [PATCH v3 1/4] examples/fips_validation: fix external build Date: Tue, 20 Jun 2023 16:07:01 +0200 Message-Id: <20230620140704.171667-2-david.marchand@redhat.com> In-Reply-To: <20230620140704.171667-1-david.marchand@redhat.com> References: <20230613081741.4083273-1-david.marchand@redhat.com> <20230620140704.171667-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 Added sources were not referenced in the makefile used when compiling this example externally. Fixes: 36128a67c27e ("examples/fips_validation: add asymmetric validation") Fixes: b455d261eb89 ("examples/fips_validation: validate ECDSA") Cc: stable@dpdk.org Signed-off-by: David Marchand Acked-by: Bruce Richardson Acked-by: Gowrishankar Muthukrishnan --- examples/fips_validation/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/fips_validation/Makefile b/examples/fips_validation/Makefile index bca6647f55..fbb778d57a 100644 --- a/examples/fips_validation/Makefile +++ b/examples/fips_validation/Makefile @@ -15,6 +15,8 @@ SRCS-y += fips_validation_ccm.c SRCS-y += fips_validation_sha.c SRCS-y += fips_dev_self_test.c SRCS-y += fips_validation_xts.c +SRCS-y += fips_validation_rsa.c +SRCS-y += fips_validation_ecdsa.c SRCS-y += main.c PKGCONF ?= pkg-config From patchwork Tue Jun 20 14:07:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 128855 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 52E7942D09; Tue, 20 Jun 2023 16:10:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4021E406BC; Tue, 20 Jun 2023 16:10:04 +0200 (CEST) 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 7DAF24068E for ; Tue, 20 Jun 2023 16:10:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687270202; 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=tvU6qbYAw3YkVvlgJ4mqWSaoabVk6dY+uHlqeoEWIBQ=; b=VSYBVnTjQvERSr0nW5wf0JzI+2/TPuM3O5aSmTQj8I7DbeWS4eVxzDAVlQqW54mdFnPWfP RCoVpa8OMc3qrDg7p7Om7H2mKaufJ1dJ2CXb4EsFR/UDzdMIwlsqSOOHB9fFKkNh3aMQn9 nwr/tHnoc8EnJqhj0sEbnfs9b16RCiI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-606-QzzE1ncVMmm6fo9d1ELrqA-1; Tue, 20 Jun 2023 10:08:50 -0400 X-MC-Unique: QzzE1ncVMmm6fo9d1ELrqA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 98DF6382C98C; Tue, 20 Jun 2023 14:07:40 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B50A200A398; Tue, 20 Jun 2023 14:07:39 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, bruce.richardson@intel.com, Byron Marohn , Yipeng Wang Subject: [PATCH v3 2/4] examples/server_node_efd: simplify build configuration Date: Tue, 20 Jun 2023 16:07:02 +0200 Message-Id: <20230620140704.171667-3-david.marchand@redhat.com> In-Reply-To: <20230620140704.171667-1-david.marchand@redhat.com> References: <20230613081741.4083273-1-david.marchand@redhat.com> <20230620140704.171667-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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 The server_node_efd example contains various binaries whose sources are in sub directories that do not match their name. Rename sub directories in this example and stop overriding the binaries names in meson.build. This makes a next change easier in the build scripts used by CI. Signed-off-by: David Marchand Acked-by: Bruce Richardson --- Changes since v2: - updated commitlog, --- doc/guides/sample_app_ug/server_node_efd.rst | 14 +++++++------- examples/meson.build | 4 ++-- examples/server_node_efd/Makefile | 2 +- .../server_node_efd/{node => efd_node}/Makefile | 0 .../server_node_efd/{node => efd_node}/meson.build | 2 -- examples/server_node_efd/{node => efd_node}/node.c | 0 .../{server => efd_server}/Makefile | 0 .../server_node_efd/{server => efd_server}/args.c | 0 .../server_node_efd/{server => efd_server}/args.h | 0 .../server_node_efd/{server => efd_server}/init.c | 0 .../server_node_efd/{server => efd_server}/init.h | 0 .../server_node_efd/{server => efd_server}/main.c | 0 .../{server => efd_server}/meson.build | 2 -- 13 files changed, 10 insertions(+), 14 deletions(-) rename examples/server_node_efd/{node => efd_node}/Makefile (100%) rename examples/server_node_efd/{node => efd_node}/meson.build (95%) rename examples/server_node_efd/{node => efd_node}/node.c (100%) rename examples/server_node_efd/{server => efd_server}/Makefile (100%) rename examples/server_node_efd/{server => efd_server}/args.c (100%) rename examples/server_node_efd/{server => efd_server}/args.h (100%) rename examples/server_node_efd/{server => efd_server}/init.c (100%) rename examples/server_node_efd/{server => efd_server}/init.h (100%) rename examples/server_node_efd/{server => efd_server}/main.c (100%) rename examples/server_node_efd/{server => efd_server}/meson.build (94%) diff --git a/doc/guides/sample_app_ug/server_node_efd.rst b/doc/guides/sample_app_ug/server_node_efd.rst index c6cbc3def6..7253b38da7 100644 --- a/doc/guides/sample_app_ug/server_node_efd.rst +++ b/doc/guides/sample_app_ug/server_node_efd.rst @@ -137,7 +137,7 @@ which is used to distribute packets to nodes, which the number of flows specified in the command line (1 million, by default). -.. literalinclude:: ../../../examples/server_node_efd/server/init.c +.. literalinclude:: ../../../examples/server_node_efd/efd_server/init.c :language: c :start-after: Create EFD table. 8< :end-before: >8 End of creation EFD table. @@ -146,7 +146,7 @@ After initialization, packets are received from the enabled ports, and the IPv4 address from the packets is used as a key to look up in the EFD table, which tells the node where the packet has to be distributed. -.. literalinclude:: ../../../examples/server_node_efd/server/main.c +.. literalinclude:: ../../../examples/server_node_efd/efd_server/main.c :language: c :start-after: Processing packets. 8< :end-before: >8 End of process_packets. @@ -156,7 +156,7 @@ and enqueued in the shared ring between the server and the node. After this, a new burst of packets is received and this process is repeated infinitely. -.. literalinclude:: ../../../examples/server_node_efd/server/main.c +.. literalinclude:: ../../../examples/server_node_efd/efd_server/main.c :language: c :start-after: Flush rx queue. 8< :end-before: >8 End of sending a burst of traffic to a node. @@ -167,7 +167,7 @@ ring with the server and send them out, if they belong to the node. At initialization, it attaches to the server process memory, to have access to the shared ring, parameters and statistics. -.. literalinclude:: ../../../examples/server_node_efd/node/node.c +.. literalinclude:: ../../../examples/server_node_efd/efd_node/node.c :language: c :start-after: Attaching to the server process memory. 8< :end-before: >8 End of attaching to the server process memory. @@ -176,7 +176,7 @@ access to the shared ring, parameters and statistics. Then, the hash table that contains the flows that will be handled by the node is created and populated. -.. literalinclude:: ../../../examples/server_node_efd/node/node.c +.. literalinclude:: ../../../examples/server_node_efd/efd_node/node.c :language: c :start-after: Creation of hash table. 8< :end-before: >8 End of creation of hash table. @@ -188,7 +188,7 @@ If there is a hit, packet is stored in a buffer, to be eventually transmitted in one of the enabled ports. If key is not there, packet is dropped, since the flow is not handled by the node. -.. literalinclude:: ../../../examples/server_node_efd/node/node.c +.. literalinclude:: ../../../examples/server_node_efd/efd_node/node.c :language: c :start-after: Packets dequeued from the shared ring. 8< :end-before: >8 End of packets dequeuing. @@ -196,7 +196,7 @@ flow is not handled by the node. Finally, note that both processes updates statistics, such as transmitted, received and dropped packets, which are shown and refreshed by the server app. -.. literalinclude:: ../../../examples/server_node_efd/server/main.c +.. literalinclude:: ../../../examples/server_node_efd/efd_server/main.c :language: c :start-after: Display recorded statistics. 8< :end-before: >8 End of displaying the recorded statistics. diff --git a/examples/meson.build b/examples/meson.build index 6968c09252..55ba8847a0 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -46,8 +46,8 @@ all_examples = [ 'qos_meter', 'qos_sched', 'rxtx_callbacks', - 'server_node_efd/node', - 'server_node_efd/server', + 'server_node_efd/efd_node', + 'server_node_efd/efd_server', 'service_cores', 'skeleton', 'timer', diff --git a/examples/server_node_efd/Makefile b/examples/server_node_efd/Makefile index e4a4a94a79..6d61c93dac 100644 --- a/examples/server_node_efd/Makefile +++ b/examples/server_node_efd/Makefile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2016-2020 Intel Corporation -subdirs := node server +subdirs := efd_node efd_server .PHONY: all static shared clean $(subdirs) all static shared clean: $(subdirs) diff --git a/examples/server_node_efd/node/Makefile b/examples/server_node_efd/efd_node/Makefile similarity index 100% rename from examples/server_node_efd/node/Makefile rename to examples/server_node_efd/efd_node/Makefile diff --git a/examples/server_node_efd/node/meson.build b/examples/server_node_efd/efd_node/meson.build similarity index 95% rename from examples/server_node_efd/node/meson.build rename to examples/server_node_efd/efd_node/meson.build index 1c720968af..b03e65f266 100644 --- a/examples/server_node_efd/node/meson.build +++ b/examples/server_node_efd/efd_node/meson.build @@ -6,8 +6,6 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' -name = 'efd_node' - allow_experimental_apis = true deps += ['hash'] sources += files('node.c') diff --git a/examples/server_node_efd/node/node.c b/examples/server_node_efd/efd_node/node.c similarity index 100% rename from examples/server_node_efd/node/node.c rename to examples/server_node_efd/efd_node/node.c diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/efd_server/Makefile similarity index 100% rename from examples/server_node_efd/server/Makefile rename to examples/server_node_efd/efd_server/Makefile diff --git a/examples/server_node_efd/server/args.c b/examples/server_node_efd/efd_server/args.c similarity index 100% rename from examples/server_node_efd/server/args.c rename to examples/server_node_efd/efd_server/args.c diff --git a/examples/server_node_efd/server/args.h b/examples/server_node_efd/efd_server/args.h similarity index 100% rename from examples/server_node_efd/server/args.h rename to examples/server_node_efd/efd_server/args.h diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/efd_server/init.c similarity index 100% rename from examples/server_node_efd/server/init.c rename to examples/server_node_efd/efd_server/init.c diff --git a/examples/server_node_efd/server/init.h b/examples/server_node_efd/efd_server/init.h similarity index 100% rename from examples/server_node_efd/server/init.h rename to examples/server_node_efd/efd_server/init.h diff --git a/examples/server_node_efd/server/main.c b/examples/server_node_efd/efd_server/main.c similarity index 100% rename from examples/server_node_efd/server/main.c rename to examples/server_node_efd/efd_server/main.c diff --git a/examples/server_node_efd/server/meson.build b/examples/server_node_efd/efd_server/meson.build similarity index 94% rename from examples/server_node_efd/server/meson.build rename to examples/server_node_efd/efd_server/meson.build index 7abc333e1d..f1a6616738 100644 --- a/examples/server_node_efd/server/meson.build +++ b/examples/server_node_efd/efd_server/meson.build @@ -6,8 +6,6 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' -name = 'efd_server' - allow_experimental_apis = true deps += 'efd' sources += files('args.c', 'init.c', 'main.c') From patchwork Tue Jun 20 14:07:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 128854 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 B164542D09; Tue, 20 Jun 2023 16:09:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9FC114113F; Tue, 20 Jun 2023 16:09:10 +0200 (CEST) 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 1F52F406BC for ; Tue, 20 Jun 2023 16:09:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687270144; 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=Cra5u/NvhlKE6bjt0pErsGXh0cXKjfo5uC8GvhFl3dE=; b=UTS53056200CsV8vcQIqAJ/W8baOtFxbJC0ROjqPQ8zcQMybwJdnInO/+v0Uc8JXGt3W+0 HitEr8qJFFnNzVDSkNP22jjS0enu8SQCqVBE98vMD716f9aYodfuX8oe5j6NRGrdAnJnNV H3jm8DVaM4NLLKEPemIlJuZ4CMKLoAM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-670-kUsUdlkDPTa53MZcPEE09Q-1; Tue, 20 Jun 2023 10:08:27 -0400 X-MC-Unique: kUsUdlkDPTa53MZcPEE09Q-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4A45988D5A7; Tue, 20 Jun 2023 14:07:43 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 896892166B26; Tue, 20 Jun 2023 14:07:42 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, bruce.richardson@intel.com Subject: [PATCH v3 3/4] devtools: build all examples externally Date: Tue, 20 Jun 2023 16:07:03 +0200 Message-Id: <20230620140704.171667-4-david.marchand@redhat.com> In-Reply-To: <20230620140704.171667-1-david.marchand@redhat.com> References: <20230613081741.4083273-1-david.marchand@redhat.com> <20230620140704.171667-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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 So far, users of test-meson-builds.sh had to define their own set of examples to build externally. This is not that great because users need to maintain this list when examples are removed/added. Rework the script so that the 'all' value triggers an automatic discovery based on what was configured/compiled with meson/ninja. Signed-off-by: David Marchand Acked-by: Bruce Richardson --- Changes since v2: - dropped unneeded -e in sed cmdline, Changes since v1: - reworked built examples discovery, - added comment for people who are not sed fluent, --- devtools/test-meson-builds.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index 9131088c9d..1eb28a2490 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -299,6 +299,22 @@ export PKG_CONFIG_PATH=$(dirname $pc_file):$PKG_CONFIG_PATH libdir=$(dirname $(find $DESTDIR -name librte_eal.so)) export LD_LIBRARY_PATH=$libdir:$LD_LIBRARY_PATH examples=${DPDK_BUILD_TEST_EXAMPLES:-"cmdline helloworld l2fwd l3fwd skeleton timer"} +if [ "$examples" = 'all' ]; then + examples=$(find $build_path/examples -maxdepth 1 -type f -name "dpdk-*" | + while read target; do + target=${target%%:*} + target=${target#$build_path/examples/dpdk-} + if [ -e $srcdir/examples/$target/Makefile ]; then + echo $target + continue + fi + # Some examples binaries are built from an example sub + # directory, discover the "top level" example name. + find $srcdir/examples -name Makefile | + sed -n "s,$srcdir/examples/\([^/]*\)\(/.*\|\)/$target/Makefile,\1,p" + done | sort -u | + tr '\n' ' ') +fi # if pkg-config defines the necessary flags, test building some examples if pkg-config --define-prefix libdpdk >/dev/null 2>&1; then export PKGCONF="pkg-config --define-prefix" From patchwork Tue Jun 20 14:07:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 128853 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 B43CE42D09; Tue, 20 Jun 2023 16:08:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7E08A40DDA; Tue, 20 Jun 2023 16:08:43 +0200 (CEST) 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 8F9BD400D6 for ; Tue, 20 Jun 2023 16:08:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687270121; 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=Co0zeLwHidaWkG+loEHzJ3C8FIkEVdWTy1gsr4jWHJY=; b=C3rZadR3rYLxlEkppYCW7jVSa4IHf/UE5Pty/uzkG97rwK4jqGFo7Rw6a0IhJ2HjUVTjWH tUwGx5xWkPYkJ1uOgvWsUW1a374UYYr6r8286Kvwat/I1EvlhNHOXib0IGjt6dOGjcMhac cVWOYhXriLudRIRZeXePGHZkVzY00j0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-126-R5_TRFiDPXSDtKWHHH96Ug-1; Tue, 20 Jun 2023 10:08:34 -0400 X-MC-Unique: R5_TRFiDPXSDtKWHHH96Ug-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6506989E764; Tue, 20 Jun 2023 14:07:46 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BDA5425357; Tue, 20 Jun 2023 14:07:45 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, bruce.richardson@intel.com, Aaron Conole , Michael Santana Subject: [PATCH v3 4/4] ci: build examples externally Date: Tue, 20 Jun 2023 16:07:04 +0200 Message-Id: <20230620140704.171667-5-david.marchand@redhat.com> In-Reply-To: <20230620140704.171667-1-david.marchand@redhat.com> References: <20230613081741.4083273-1-david.marchand@redhat.com> <20230620140704.171667-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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 Enhance our CI coverage by building examples against an installed DPDK. Signed-off-by: David Marchand Acked-by: Bruce Richardson Acked-by: Aaron Conole --- Changes since v2: - dropped unneeded -e in sed cmdline, Changes since v1: - reworked built examples discovery, - added comment for people who are not sed fluent, --- .ci/linux-build.sh | 27 ++++++++++++++++++++++++++- .github/workflows/build.yml | 6 +++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index 9631e342b5..d0d9f89bae 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -1,7 +1,7 @@ #!/bin/sh -xe if [ -z "${DEF_LIB:-}" ]; then - DEF_LIB=static ABI_CHECKS= BUILD_DOCS= RUN_TESTS= $0 + DEF_LIB=static ABI_CHECKS= BUILD_DOCS= BUILD_EXAMPLES= RUN_TESTS= $0 DEF_LIB=shared $0 exit fi @@ -99,6 +99,7 @@ if [ "$MINI" = "true" ]; then else OPTS="$OPTS -Ddisable_libs=" fi +OPTS="$OPTS -Dlibdir=lib" if [ "$ASAN" = "true" ]; then OPTS="$OPTS -Db_sanitize=address" @@ -168,3 +169,27 @@ if [ "$RUN_TESTS" = "true" ]; then catch_coredump [ "$failed" != "true" ] fi + +# Test examples compilation with an installed dpdk +if [ "$BUILD_EXAMPLES" = "true" ]; then + [ -d install ] || DESTDIR=$(pwd)/install ninja -C build install + export LD_LIBRARY_PATH=$(dirname $(find $(pwd)/install -name librte_eal.so)):$LD_LIBRARY_PATH + export PKG_CONFIG_PATH=$(dirname $(find $(pwd)/install -name libdpdk.pc)):$PKG_CONFIG_PATH + export PKGCONF="pkg-config --define-prefix" + find build/examples -maxdepth 1 -type f -name "dpdk-*" | + while read target; do + target=${target%%:*} + target=${target#build/examples/dpdk-} + if [ -e examples/$target/Makefile ]; then + echo $target + continue + fi + # Some examples binaries are built from an example sub + # directory, discover the "top level" example name. + find examples -name Makefile | + sed -n "s,examples/\([^/]*\)\(/.*\|\)/$target/Makefile,\1,p" + done | sort -u | + while read example; do + make -C install/usr/local/share/dpdk/examples/$example clean shared + done +fi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b629fcdbd..414dd089e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,7 @@ jobs: BUILD_32BIT: ${{ matrix.config.cross == 'i386' }} BUILD_DEBUG: ${{ contains(matrix.config.checks, 'debug') }} BUILD_DOCS: ${{ contains(matrix.config.checks, 'doc') }} + BUILD_EXAMPLES: ${{ contains(matrix.config.checks, 'examples') }} CC: ccache ${{ matrix.config.compiler }} DEF_LIB: ${{ matrix.config.library }} LIBABIGAIL_VERSION: libabigail-2.1 @@ -39,7 +40,7 @@ jobs: mini: mini - os: ubuntu-20.04 compiler: gcc - checks: abi+debug+doc+tests + checks: abi+debug+doc+examples+tests - os: ubuntu-20.04 compiler: clang checks: asan+doc+tests @@ -96,12 +97,11 @@ jobs: - name: Install packages run: sudo apt install -y ccache libarchive-dev libbsd-dev libfdt-dev libibverbs-dev libjansson-dev libnuma-dev libpcap-dev libssl-dev - ninja-build python3-pip python3-pyelftools python3-setuptools + ninja-build pkg-config python3-pip python3-pyelftools python3-setuptools python3-wheel zlib1g-dev - name: Install libabigail build dependencies if no cache is available if: env.ABI_CHECKS == 'true' && steps.libabigail-cache.outputs.cache-hit != 'true' run: sudo apt install -y autoconf automake libdw-dev libtool libxml2-dev - pkg-config - name: Install i386 cross compiling packages if: env.BUILD_32BIT == 'true' run: sudo apt install -y gcc-multilib g++-multilib