]> git.droids-corp.org - dpdk.git/commit
common/mlx5: fix build for zero-length headroom array
authorMatan Azrad <matan@nvidia.com>
Mon, 8 Nov 2021 12:22:04 +0000 (14:22 +0200)
committerRaslan Darawsheh <rasland@nvidia.com>
Wed, 10 Nov 2021 14:44:45 +0000 (15:44 +0100)
commit8594e2a64ffe54b57f06a259d2be694096b8dccb
tree18e1c3a11b5fae8e29208374142cc672841b4ec5
parent6b5b3005cb1854e471fa1ef3eb579dbd444c05b0
common/mlx5: fix build for zero-length headroom 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 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")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
drivers/common/mlx5/mlx5_common_mr.h