patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] common/mlx5: fix compilation for zero-length array
@ 2021-11-08 12:22 Matan Azrad
  2021-11-10  8:49 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Matan Azrad @ 2021-11-08 12:22 UTC (permalink / raw)
  To: Viacheslav Ovsiienko; +Cc: dev, stable

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
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.

Fixes: 3a22f3877c9d ("net/mlx5: replace external mbuf shared memory")
Cc: stable@dpdk.org

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

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

diff --git a/drivers/common/mlx5/mlx5_common_mr.h b/drivers/common/mlx5/mlx5_common_mr.h
index e74f81641c..748dfc68b0 100644
--- a/drivers/common/mlx5/mlx5_common_mr.h
+++ b/drivers/common/mlx5/mlx5_common_mr.h
@@ -93,7 +93,6 @@ struct mlx5_mr_share_cache {
 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.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] common/mlx5: fix compilation for zero-length array
  2021-11-08 12:22 [dpdk-stable] [PATCH] common/mlx5: fix compilation for zero-length array Matan Azrad
@ 2021-11-10  8:49 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2021-11-10  8:49 UTC (permalink / raw)
  To: Matan Azrad, Slava Ovsiienko; +Cc: dev, stable

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Matan Azrad
> Sent: Monday, November 8, 2021 2:22 PM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] common/mlx5: fix compilation for zero-length
> array
> 
> 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
> 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.
> 
> Fixes: 3a22f3877c9d ("net/mlx5: replace external mbuf shared memory")
> Cc: stable@dpdk.org
> 
> [1] commit 7d6bf6b866b8 ("net/mlx5: add Multi-Packet Rx support")
> 
> Signed-off-by: Matan Azrad <matan@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-10  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 12:22 [dpdk-stable] [PATCH] common/mlx5: fix compilation for zero-length array Matan Azrad
2021-11-10  8:49 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git