DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
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	[thread overview]
Message-ID: <611b8127523b793a6fde85213c6493aacca8dc16.1655112181.git.rahul.lakkireddy@chelsio.com> (raw)
In-Reply-To: <872fbb13ed0df67f7dedbf3db340464bb7391af1.1654898453.git.rahul.lakkireddy@chelsio.com>

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 <daxuex.gao@intel.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
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;
 
-- 
2.27.0


  parent reply	other threads:[~2022-06-13  9:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10 22:09 [PATCH] " Rahul Lakkireddy
2022-06-13  5:02 ` [EXT] " Anoob Joseph
2022-06-13  9:52 ` Rahul Lakkireddy [this message]
2022-06-13  9:54   ` [EXT] [PATCH v2] " Anoob Joseph
2022-06-15 15:08   ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=611b8127523b793a6fde85213c6493aacca8dc16.1655112181.git.rahul.lakkireddy@chelsio.com \
    --to=rahul.lakkireddy@chelsio.com \
    --cc=anoobj@marvell.com \
    --cc=daxuex.gao@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=roy.fan.zhang@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).