From patchwork Mon Jun 13 09:52:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rahul Lakkireddy X-Patchwork-Id: 112690 X-Patchwork-Delegate: gakhil@marvell.com 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 615BEA0543; Mon, 13 Jun 2022 11:52:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 463AB40150; Mon, 13 Jun 2022 11:52:35 +0200 (CEST) Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by mails.dpdk.org (Postfix) with ESMTP id E3E5D400EF; Mon, 13 Jun 2022 11:52:33 +0200 (CEST) Received: from localhost (vishalgaurav.asicdesigners.com [10.193.177.157] (may be forged)) by stargate.chelsio.com (8.14.7/8.14.7) with ESMTP id 25D9qV0U018757; Mon, 13 Jun 2022 02:52:32 -0700 From: Rahul Lakkireddy To: dev@dpdk.org Cc: gakhil@marvell.com, roy.fan.zhang@intel.com, anoobj@marvell.com, daxuex.gao@intel.com, stable@dpdk.org Subject: [PATCH v2] test/crypto: fix warnings for optimization=1 build Date: Mon, 13 Jun 2022 15:22:23 +0530 Message-Id: <611b8127523b793a6fde85213c6493aacca8dc16.1655112181.git.rahul.lakkireddy@chelsio.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <872fbb13ed0df67f7dedbf3db340464bb7391af1.1654898453.git.rahul.lakkireddy@chelsio.com> References: <872fbb13ed0df67f7dedbf3db340464bb7391af1.1654898453.git.rahul.lakkireddy@chelsio.com> MIME-Version: 1.0 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 Fail IPSec ESN and antireplay cases, if there are no packets. Fixes following warning when using optimization=1 build flag with GCC 11. ../app/test/test_cryptodev.c: In function ‘test_ipsec_pkt_replay’: ../app/test/test_cryptodev.c:10074:15: warning: ‘td_outb’ may be used uninitialized [-Wmaybe-uninitialized] ret = test_ipsec_proto_process(td_outb, td_inb, nb_pkts, true, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &flags); ~~~~~~~ ../app/test/test_cryptodev.c:9150:1: note: by argument 1 of type ‘const struct ipsec_test_data[]’ to ‘test_ipsec_proto_process’ declared here test_ipsec_proto_process(const struct ipsec_test_data td[], ^~~~~~~~~~~~~~~~~~~~~~~~ ../app/test/test_cryptodev.c:10056:32: note: ‘td_outb’ declared here struct ipsec_test_data td_outb[IPSEC_TEST_PACKETS_MAX]; ^~~~~~~ Bugzilla ID: 1032 Fixes: d02c6bfcb99a ("test/crypto: add ESN and antireplay cases") Cc: stable@dpdk.org Reported-by: Daxue Gao Signed-off-by: Rahul Lakkireddy Acked-by: Anoob Joseph --- v2: - Return TEST_FAILED, instead of TEST_SKIPPED - Add the new Bugzilla ID in commit message app/test/test_cryptodev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 524019ce0e..2766e0cc10 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -10058,6 +10058,9 @@ test_ipsec_pkt_replay(const void *test_data, const uint64_t esn[], struct ipsec_test_flags flags; uint32_t i = 0, ret = 0; + if (nb_pkts == 0) + return TEST_FAILED; + memset(&flags, 0, sizeof(flags)); flags.antireplay = true;