patch 'net: avoid cast-align warning in VLAN insert function' has been queued to stable release 19.11.11

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Nov 30 17:35:02 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before December 10th 2021. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/2cbe5b75dbea7ba4ee025f32887284ae77bca7d9

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 2cbe5b75dbea7ba4ee025f32887284ae77bca7d9 Mon Sep 17 00:00:00 2001
From: Eli Britstein <elibr at nvidia.com>
Date: Thu, 21 Oct 2021 11:51:30 +0300
Subject: [PATCH] net: avoid cast-align warning in VLAN insert function

[ upstream commit a3f8d05871887d257703f6f073da002b6c568519 ]

In rte_vlan_insert there is a casting of rte_pktmbuf_prepend returned
value to (struct rte_ether_hdr *), which causes cast-align warning when
using strict cast align flag with supporting gcc:
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
CFLAGS="-Wcast-align=strict" make V=1 -C examples/l2fwd clean static

In file included from main.c:35:
/dpdk/build/include/rte_ether.h:370:7: warning: cast increases required
alignment of target type [-Wcast-align]
  370 |  nh = (struct rte_ether_hdr *)
      |       ^

As the code assumes correct alignment, add first a (void *) casting, to
avoid the warning.

Fixes: c974021a5949 ("ether: add soft vlan encap/decap")

Signed-off-by: Eli Britstein <elibr at nvidia.com>
Acked-by: Olivier Matz <olivier.matz at 6wind.com>
---
 lib/librte_net/rte_ether.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index e069dc7fe0..8a31988f21 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -358,7 +358,7 @@ static inline int rte_vlan_insert(struct rte_mbuf **m)
 		return -EINVAL;
 
 	oh = rte_pktmbuf_mtod(*m, struct rte_ether_hdr *);
-	nh = (struct rte_ether_hdr *)
+	nh = (struct rte_ether_hdr *)(void *)
 		rte_pktmbuf_prepend(*m, sizeof(struct rte_vlan_hdr));
 	if (nh == NULL)
 		return -ENOSPC;
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-30 16:50:11.558666342 +0100
+++ 0098-net-avoid-cast-align-warning-in-VLAN-insert-function.patch	2021-11-30 16:50:05.894874293 +0100
@@ -1 +1 @@
-From a3f8d05871887d257703f6f073da002b6c568519 Mon Sep 17 00:00:00 2001
+From 2cbe5b75dbea7ba4ee025f32887284ae77bca7d9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a3f8d05871887d257703f6f073da002b6c568519 ]
+
@@ -22 +23,0 @@
-Cc: stable at dpdk.org
@@ -27 +28 @@
- lib/net/rte_ether.h | 2 +-
+ lib/librte_net/rte_ether.h | 2 +-
@@ -30,5 +31,5 @@
-diff --git a/lib/net/rte_ether.h b/lib/net/rte_ether.h
-index 2c7da55b6b..1a0dbf0d60 100644
---- a/lib/net/rte_ether.h
-+++ b/lib/net/rte_ether.h
-@@ -367,7 +367,7 @@ static inline int rte_vlan_insert(struct rte_mbuf **m)
+diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
+index e069dc7fe0..8a31988f21 100644
+--- a/lib/librte_net/rte_ether.h
++++ b/lib/librte_net/rte_ether.h
+@@ -358,7 +358,7 @@ static inline int rte_vlan_insert(struct rte_mbuf **m)


More information about the stable mailing list