patch 'examples/ntb: fix build with GCC 13' has been queued to stable release 20.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Jun 15 03:31:58 CEST 2023


Hi,

FYI, your patch has been queued to stable release 20.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/17/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/4a58ab873a5b754bc5f480bbd44798389d8ab319

Thanks.

Luca Boccassi

---
>From 4a58ab873a5b754bc5f480bbd44798389d8ab319 Mon Sep 17 00:00:00 2001
From: Jerin Jacob <jerinj at marvell.com>
Date: Thu, 4 May 2023 14:23:37 +0530
Subject: [PATCH] examples/ntb: fix build with GCC 13

[ upstream commit dbff181d62c997f128b75db2bbac9f42e8dd0f8f ]

Fix the following build issue by not allowing nb_ids to be zero.
nb_ids can be zero based on rte_rawdev_xstats_get() API
documentation but it is not valid for the case when second
argument is NULL.

examples/ntb/ntb_fwd.c: In function 'ntb_stats_display':
examples/ntb/ntb_fwd.c:945:23: error: 'rte_rawdev_xstats_get'
accessing 8 bytes in a region of size 0 [-Werror=stringop-overflow=]
  945 | if (nb_ids != rte_rawdev_xstats_get(dev_id, ids, values, nb_ids)) {
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

examples/ntb/ntb_fwd.c:945:23: note: referencing argument 3
of type 'uint64_t[0]' {aka 'long unsigned int[]'}
In file included from ../examples/ntb/ntb_fwd.c:17:
lib/rawdev/rte_rawdev.h:504:1: note: in a call to function
'rte_rawdev_xstats_get'
  504 | rte_rawdev_xstats_get(uint16_t dev_id,

Fixes: 5194299d6ef5 ("examples/ntb: support more functions")

Signed-off-by: Jerin Jacob <jerinj at marvell.com>
Tested-by: Ali Alnubani <alialnu at nvidia.com>
Acked-by: Junfeng Guo <junfeng.guo at intel.com>
Tested-by: Daxue Gao <daxuex.gao at intel.com>
---
 examples/ntb/ntb_fwd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c
index 8f42831399..49b8795e2d 100644
--- a/examples/ntb/ntb_fwd.c
+++ b/examples/ntb/ntb_fwd.c
@@ -865,7 +865,7 @@ ntb_stats_clear(void)
 
 	/* Clear NTB dev stats */
 	nb_ids = rte_rawdev_xstats_names_get(dev_id, NULL, 0);
-	if (nb_ids  < 0) {
+	if (nb_ids <= 0) {
 		printf("Error: Cannot get count of xstats\n");
 		return;
 	}
@@ -923,7 +923,7 @@ ntb_stats_display(void)
 
 	/* Get NTB dev stats and stats names */
 	nb_ids = rte_rawdev_xstats_names_get(dev_id, NULL, 0);
-	if (nb_ids  < 0) {
+	if (nb_ids <= 0) {
 		printf("Error: Cannot get count of xstats\n");
 		return;
 	}
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-06-15 01:56:34.900932610 +0100
+++ 0003-examples-ntb-fix-build-with-GCC-13.patch	2023-06-15 01:56:34.479539380 +0100
@@ -1 +1 @@
-From dbff181d62c997f128b75db2bbac9f42e8dd0f8f Mon Sep 17 00:00:00 2001
+From 4a58ab873a5b754bc5f480bbd44798389d8ab319 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit dbff181d62c997f128b75db2bbac9f42e8dd0f8f ]
+
@@ -25 +26,0 @@
-Cc: stable at dpdk.org
@@ -36 +37 @@
-index f9abed28e4..585aad9d70 100644
+index 8f42831399..49b8795e2d 100644


More information about the stable mailing list