patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: David Marchand <david.marchand@redhat.com>
Cc: Raslan Darawsheh <rasland@nvidia.com>, dpdk stable <stable@dpdk.org>
Subject: patch 'net/mlx5: fix build with GCC 12 and ASan' has been queued to stable release 21.11.4
Date: Thu, 30 Mar 2023 09:35:54 +0100	[thread overview]
Message-ID: <20230330083600.473876-2-ktraynor@redhat.com> (raw)
In-Reply-To: <20230330083600.473876-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to stable release 21.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/02/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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/9950bb97caf0b3daad6282d678c9d3ce7df98518

Thanks.

Kevin

---
From 9950bb97caf0b3daad6282d678c9d3ce7df98518 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 22 Mar 2023 18:06:27 +0100
Subject: [PATCH] net/mlx5: fix build with GCC 12 and ASan
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit e17840756179410283ef03660578310874432f40 ]

Building with gcc 12 and ASan raises this warning:

../drivers/net/mlx5/mlx5_txpp.c: In function ‘mlx5_txpp_xstats_get_names’:
../drivers/net/mlx5/mlx5_txpp.c:1066:25: error: ‘strncpy’ specified bound
	64 equals destination size [-Werror=stringop-truncation]
 1066 |                         strncpy(xstats_names[i + n_used].name,
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1067 |                                 mlx5_txpp_stat_names[i],
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~
 1068 |                                 RTE_ETH_XSTATS_NAME_SIZE);
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Prefer strlcpy for xstats.

Fixes: 3b025c0ca425 ("net/mlx5: provide send scheduling error statistics")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Raslan Darawsheh <rasland@nvidia.com>
---
 drivers/net/mlx5/mlx5_stats.c | 3 +--
 drivers/net/mlx5/mlx5_txpp.c  | 4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index f64fa3587b..615e1d073d 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -289,8 +289,7 @@ mlx5_xstats_get_names(struct rte_eth_dev *dev,
 	if (n >= mlx5_xstats_n && xstats_names) {
 		for (i = 0; i != mlx5_xstats_n; ++i) {
-			strncpy(xstats_names[i].name,
+			strlcpy(xstats_names[i].name,
 				xstats_ctrl->info[i].dpdk_name,
 				RTE_ETH_XSTATS_NAME_SIZE);
-			xstats_names[i].name[RTE_ETH_XSTATS_NAME_SIZE - 1] = 0;
 		}
 	}
diff --git a/drivers/net/mlx5/mlx5_txpp.c b/drivers/net/mlx5/mlx5_txpp.c
index af77e91e4c..83d17997d1 100644
--- a/drivers/net/mlx5/mlx5_txpp.c
+++ b/drivers/net/mlx5/mlx5_txpp.c
@@ -1065,9 +1065,7 @@ int mlx5_txpp_xstats_get_names(struct rte_eth_dev *dev __rte_unused,
 	if (n >= n_used + n_txpp && xstats_names) {
 		for (i = 0; i < n_txpp; ++i) {
-			strncpy(xstats_names[i + n_used].name,
+			strlcpy(xstats_names[i + n_used].name,
 				mlx5_txpp_stat_names[i],
 				RTE_ETH_XSTATS_NAME_SIZE);
-			xstats_names[i + n_used].name
-					[RTE_ETH_XSTATS_NAME_SIZE - 1] = 0;
 		}
 	}
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-30 09:30:45.343886598 +0100
+++ 0003-net-mlx5-fix-build-with-GCC-12-and-ASan.patch	2023-03-30 09:30:45.242229240 +0100
@@ -1 +1 @@
-From e17840756179410283ef03660578310874432f40 Mon Sep 17 00:00:00 2001
+From 9950bb97caf0b3daad6282d678c9d3ce7df98518 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit e17840756179410283ef03660578310874432f40 ]
+
@@ -25 +26,0 @@
-Cc: stable@dpdk.org
@@ -49 +50 @@
-index 63d98dbde9..0e1da1d5f5 100644
+index af77e91e4c..83d17997d1 100644
@@ -52 +53 @@
-@@ -1064,9 +1064,7 @@ int mlx5_txpp_xstats_get_names(struct rte_eth_dev *dev __rte_unused,
+@@ -1065,9 +1065,7 @@ int mlx5_txpp_xstats_get_names(struct rte_eth_dev *dev __rte_unused,


  reply	other threads:[~2023-03-30  8:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30  8:35 patch 'examples/qos_sched: fix config entries in wrong sections' " Kevin Traynor
2023-03-30  8:35 ` Kevin Traynor [this message]
2023-03-30  8:35 ` patch 'net/mlx5: fix CQE dump for Tx' " Kevin Traynor
2023-03-30  8:35 ` patch 'net/mlx5: fix sysfs port name translation' " Kevin Traynor
2023-03-30  8:35 ` patch 'test/crypto: fix statistics error messages' " Kevin Traynor
2023-03-30  8:35 ` patch 'pdump: fix build with GCC 12' " Kevin Traynor
2023-03-30  8:35 ` patch 'acl: fix crash on PPC64 with GCC 11' " Kevin Traynor
2023-03-30  8:36 ` patch 'doc: fix pipeline example path in user guide' " Kevin Traynor

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=20230330083600.473876-2-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=david.marchand@redhat.com \
    --cc=rasland@nvidia.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).