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

Xueming Li xuemingl at nvidia.com
Sun Jun 25 08:33:42 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.3

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/27/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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=f9a20a28ecdc83ee76d696170a5ccb69afcb0518

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From f9a20a28ecdc83ee76d696170a5ccb69afcb0518 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
Cc: Xueming Li <xuemingl at nvidia.com>

[ 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 f9abed28e4..585aad9d70 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.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-06-25 14:31:58.705277700 +0800
+++ 0004-examples-ntb-fix-build-with-GCC-13.patch	2023-06-25 14:31:58.285773900 +0800
@@ -1 +1 @@
-From dbff181d62c997f128b75db2bbac9f42e8dd0f8f Mon Sep 17 00:00:00 2001
+From f9a20a28ecdc83ee76d696170a5ccb69afcb0518 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit dbff181d62c997f128b75db2bbac9f42e8dd0f8f ]
@@ -25 +27,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list