patch 'common/mlx5: fix build for zero-length headroom array' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Sun Nov 28 15:53:14 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.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 11/30/21. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/7ae03fc171b21609212c6ed69d79e7f5f72a5811

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 7ae03fc171b21609212c6ed69d79e7f5f72a5811 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan at nvidia.com>
Date: Mon, 8 Nov 2021 14:22:04 +0200
Subject: [PATCH] common/mlx5: fix build for zero-length headroom array
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 8594e2a64ffe54b57f06a259d2be694096b8dccb ]

The structure of the striding RQ(MPRQ) buffer includes an array size
defined by the RTE_PKTMBUF_HEADROOM macro added in [1].

When RTE_PKTMBUF_HEADROOM is set to 0 in the compilation config file
the compilation with debug type failed:

"In file included from ../drivers/common/mlx5/mlx5_common.h:25,
                 from ../drivers/common/mlx5/linux/mlx5_nl.h:12,
                 from ../drivers/common/mlx5/linux/mlx5_nl.c:22:
../drivers/common/mlx5/mlx5_common_mr.h:96:10: error: ISO C forbids
                             zero-size array 'pad' [-Werror=pedantic]"

Actually, the array for the first stride headroom is not needed:

Each stride in the striding RQ buffer includes the headroom of the next
stride, so the headroom of the first stride should be allocated before
the starting point of the buffer posted to the HW(HW buffer).

The striding RQ buffer is used as an attached buffer to mbuf and have
shared information per stride.

The LRO support moved all the strides shared information to the top of
the buffer before the first stride headroom but didn't remove the old
memory of this headroom from the buffer.

Remove the old headroom memory from the striding RQ buffer.

[1] commit 7d6bf6b866b8 ("net/mlx5: add Multi-Packet Rx support")

Fixes: 3a22f3877c9d ("net/mlx5: replace external mbuf shared memory")

Signed-off-by: Matan Azrad <matan at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
 drivers/net/mlx5/mlx5_rxtx.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 4d043d2015..b2a891c8f6 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -69,7 +69,6 @@ struct rxq_zip {
 struct mlx5_mprq_buf {
 	struct rte_mempool *mp;
 	uint16_t refcnt; /* Atomically accessed refcnt. */
-	uint8_t pad[RTE_PKTMBUF_HEADROOM]; /* Headroom for the first packet. */
 	struct rte_mbuf_ext_shared_info shinfos[];
 	/*
 	 * Shared information per stride.
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-28 22:41:04.069713835 +0800
+++ 0010-common-mlx5-fix-build-for-zero-length-headroom-array.patch	2021-11-28 22:41:03.216876184 +0800
@@ -1 +1 @@
-From 8594e2a64ffe54b57f06a259d2be694096b8dccb Mon Sep 17 00:00:00 2001
+From 7ae03fc171b21609212c6ed69d79e7f5f72a5811 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 8594e2a64ffe54b57f06a259d2be694096b8dccb ]
@@ -36 +38,0 @@
-Cc: stable at dpdk.org
@@ -41 +43 @@
- drivers/common/mlx5/mlx5_common_mr.h | 1 -
+ drivers/net/mlx5/mlx5_rxtx.h | 1 -
@@ -44,5 +46,5 @@
-diff --git a/drivers/common/mlx5/mlx5_common_mr.h b/drivers/common/mlx5/mlx5_common_mr.h
-index 93903d8397..dc7ddc3513 100644
---- a/drivers/common/mlx5/mlx5_common_mr.h
-+++ b/drivers/common/mlx5/mlx5_common_mr.h
-@@ -96,7 +96,6 @@ struct mlx5_mr_share_cache {
+diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
+index 4d043d2015..b2a891c8f6 100644
+--- a/drivers/net/mlx5/mlx5_rxtx.h
++++ b/drivers/net/mlx5/mlx5_rxtx.h
+@@ -69,7 +69,6 @@ struct rxq_zip {


More information about the stable mailing list