patch 'event/sw: fix warning from useless snprintf' has been queued to stable release 21.11.8
Kevin Traynor
ktraynor at redhat.com
Fri Aug 23 18:17:45 CEST 2024
Hi,
FYI, your patch has been queued to stable release 21.11.8
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/28/24. 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/4722e89fcd6993d2de347b9145340efe776528c0
Thanks.
Kevin
---
>From 4722e89fcd6993d2de347b9145340efe776528c0 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Tue, 23 Apr 2024 20:45:40 -0700
Subject: [PATCH] event/sw: fix warning from useless snprintf
[ upstream commit 510e2b655b46d91d3cc189882e6392afdc0363ff ]
With GCC-14, this warning is generated:
drivers/event/sw/sw_evdev.c:263:3: warning:
snprintf' will always be truncated;
specified size is 12, but format string expands to at least 13
snprintf(buf, sizeof(buf), "sw%d_iq_%d_rob", dev_id, i);
^
Yet the whole printf to the buf is unnecessary. The type string argument
has never been implemented, and should just be NULL. Removing the
unnecessary snprintf, then means IQ_ROB_NAMESIZE can be removed.
Fixes: 5ffb2f142d95 ("event/sw: support event queues")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Harry van Haaren <harry.van.haaren at intel.com>
---
drivers/event/sw/iq_chunk.h | 2 --
drivers/event/sw/sw_evdev.c | 5 +----
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/event/sw/iq_chunk.h b/drivers/event/sw/iq_chunk.h
index 31d013eab7..7820815c38 100644
--- a/drivers/event/sw/iq_chunk.h
+++ b/drivers/event/sw/iq_chunk.h
@@ -10,6 +10,4 @@
#include <rte_eventdev.h>
-#define IQ_ROB_NAMESIZE 12
-
struct sw_queue_chunk {
struct rte_event events[SW_EVS_PER_Q_CHUNK];
diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index e43bf250d6..d1fd0eeb4f 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -230,7 +230,5 @@ qid_init(struct sw_evdev *sw, unsigned int idx, int type,
{
unsigned int i;
- int dev_id = sw->data->dev_id;
int socket_id = sw->data->socket_id;
- char buf[IQ_ROB_NAMESIZE];
struct sw_qid *qid = &sw->qids[idx];
@@ -262,6 +260,5 @@ qid_init(struct sw_evdev *sw, unsigned int idx, int type,
}
- snprintf(buf, sizeof(buf), "sw%d_iq_%d_rob", dev_id, i);
- qid->reorder_buffer = rte_zmalloc_socket(buf,
+ qid->reorder_buffer = rte_zmalloc_socket(NULL,
window_size * sizeof(qid->reorder_buffer[0]),
0, socket_id);
--
2.46.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-08-23 17:18:11.051820611 +0100
+++ 0037-event-sw-fix-warning-from-useless-snprintf.patch 2024-08-23 17:18:09.677429955 +0100
@@ -1 +1 @@
-From 510e2b655b46d91d3cc189882e6392afdc0363ff Mon Sep 17 00:00:00 2001
+From 4722e89fcd6993d2de347b9145340efe776528c0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 510e2b655b46d91d3cc189882e6392afdc0363ff ]
+
@@ -18 +19,0 @@
-Cc: stable at dpdk.org
@@ -28 +29 @@
-index 7a7a8782e6..e638142dbc 100644
+index 31d013eab7..7820815c38 100644
@@ -36 +37 @@
- struct __rte_cache_aligned sw_queue_chunk {
+ struct sw_queue_chunk {
@@ -39 +40 @@
-index 1c01b069fe..19a52afc7d 100644
+index e43bf250d6..d1fd0eeb4f 100644
@@ -42 +43 @@
-@@ -229,7 +229,5 @@ qid_init(struct sw_evdev *sw, unsigned int idx, int type,
+@@ -230,7 +230,5 @@ qid_init(struct sw_evdev *sw, unsigned int idx, int type,
@@ -50 +51 @@
-@@ -261,6 +259,5 @@ qid_init(struct sw_evdev *sw, unsigned int idx, int type,
+@@ -262,6 +260,5 @@ qid_init(struct sw_evdev *sw, unsigned int idx, int type,
More information about the stable
mailing list