patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/mvneta: compilation fix for GCC-12
@ 2022-09-01  8:31 Amit Prakash Shukla
  2022-09-01  8:36 ` Liron Himi
  0 siblings, 1 reply; 3+ messages in thread
From: Amit Prakash Shukla @ 2022-09-01  8:31 UTC (permalink / raw)
  To: Zyta Szpak, Liron Himi; +Cc: dev, jerinj, stable, Amit Prakash Shukla

./drivers/net/mvneta/mvneta_rxtx.c:89:42:
	error: 'mbufs' may be used uninitialized [-Werror=maybe-uninitialized]
   89 |         MVNETA_SET_COOKIE_HIGH_ADDR(mbufs[0]);
      |                                          ^
../drivers/net/mvneta/mvneta_rxtx.c:77:26: note: 'mbufs' declared here
   77 |      struct rte_mbuf *mbufs[MRVL_NETA_BUF_RELEASE_BURST_SIZE_MAX];
      |                       ^~~~~

Fixes: ce7ea764597e ("net/mvneta: support Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
---
 drivers/net/mvneta/mvneta_rxtx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mvneta/mvneta_rxtx.c b/drivers/net/mvneta/mvneta_rxtx.c
index 6e4a7896b4..952e982275 100644
--- a/drivers/net/mvneta/mvneta_rxtx.c
+++ b/drivers/net/mvneta/mvneta_rxtx.c
@@ -79,6 +79,10 @@ mvneta_buffs_refill(struct mvneta_priv *priv, struct mvneta_rxq *rxq, u16 *num)
 	int i, ret;
 	uint16_t nb_desc = *num;
 
+	/* To prevent GCC-12 warning. */
+	if (unlikely(nb_desc == 0))
+		return -1;
+
 	ret = rte_pktmbuf_alloc_bulk(rxq->mp, mbufs, nb_desc);
 	if (ret) {
 		MVNETA_LOG(ERR, "Failed to allocate %u mbufs.", nb_desc);
-- 
2.25.1


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

* RE: [PATCH] net/mvneta: compilation fix for GCC-12
  2022-09-01  8:31 [PATCH] net/mvneta: compilation fix for GCC-12 Amit Prakash Shukla
@ 2022-09-01  8:36 ` Liron Himi
  2022-09-16 14:56   ` Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: Liron Himi @ 2022-09-01  8:36 UTC (permalink / raw)
  To: Amit Prakash Shukla, Zyta Szpak
  Cc: dev, Jerin Jacob Kollanukkaran, stable, Amit Prakash Shukla, Liron Himi

Acked-by: Liron Himi <lironh@marvell.com>

-----Original Message-----
From: Amit Prakash Shukla <amitprakashs@marvell.com> 
Sent: Thursday, 1 September 2022 11:31
To: Zyta Szpak <zr@semihalf.com>; Liron Himi <lironh@marvell.com>
Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; stable@dpdk.org; Amit Prakash Shukla <amitprakashs@marvell.com>
Subject: [PATCH] net/mvneta: compilation fix for GCC-12

./drivers/net/mvneta/mvneta_rxtx.c:89:42:
	error: 'mbufs' may be used uninitialized [-Werror=maybe-uninitialized]
   89 |         MVNETA_SET_COOKIE_HIGH_ADDR(mbufs[0]);
      |                                          ^
../drivers/net/mvneta/mvneta_rxtx.c:77:26: note: 'mbufs' declared here
   77 |      struct rte_mbuf *mbufs[MRVL_NETA_BUF_RELEASE_BURST_SIZE_MAX];
      |                       ^~~~~

Fixes: ce7ea764597e ("net/mvneta: support Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
---
 drivers/net/mvneta/mvneta_rxtx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mvneta/mvneta_rxtx.c b/drivers/net/mvneta/mvneta_rxtx.c
index 6e4a7896b4..952e982275 100644
--- a/drivers/net/mvneta/mvneta_rxtx.c
+++ b/drivers/net/mvneta/mvneta_rxtx.c
@@ -79,6 +79,10 @@ mvneta_buffs_refill(struct mvneta_priv *priv, struct mvneta_rxq *rxq, u16 *num)
 	int i, ret;
 	uint16_t nb_desc = *num;
 
+	/* To prevent GCC-12 warning. */
+	if (unlikely(nb_desc == 0))
+		return -1;
+
 	ret = rte_pktmbuf_alloc_bulk(rxq->mp, mbufs, nb_desc);
 	if (ret) {
 		MVNETA_LOG(ERR, "Failed to allocate %u mbufs.", nb_desc);
-- 
2.25.1


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

* Re: [PATCH] net/mvneta: compilation fix for GCC-12
  2022-09-01  8:36 ` Liron Himi
@ 2022-09-16 14:56   ` Jerin Jacob
  0 siblings, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2022-09-16 14:56 UTC (permalink / raw)
  To: Liron Himi
  Cc: Amit Prakash Shukla, Zyta Szpak, dev, Jerin Jacob Kollanukkaran, stable

On Thu, Sep 1, 2022 at 2:06 PM Liron Himi <lironh@marvell.com> wrote:
>
> Acked-by: Liron Himi <lironh@marvell.com>

Applied to dpdk-next-net-mrvl/for-next-net. Thanks



>
> -----Original Message-----
> From: Amit Prakash Shukla <amitprakashs@marvell.com>
> Sent: Thursday, 1 September 2022 11:31
> To: Zyta Szpak <zr@semihalf.com>; Liron Himi <lironh@marvell.com>
> Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; stable@dpdk.org; Amit Prakash Shukla <amitprakashs@marvell.com>
> Subject: [PATCH] net/mvneta: compilation fix for GCC-12
>
> ./drivers/net/mvneta/mvneta_rxtx.c:89:42:
>         error: 'mbufs' may be used uninitialized [-Werror=maybe-uninitialized]
>    89 |         MVNETA_SET_COOKIE_HIGH_ADDR(mbufs[0]);
>       |                                          ^
> ../drivers/net/mvneta/mvneta_rxtx.c:77:26: note: 'mbufs' declared here
>    77 |      struct rte_mbuf *mbufs[MRVL_NETA_BUF_RELEASE_BURST_SIZE_MAX];
>       |                       ^~~~~
>
> Fixes: ce7ea764597e ("net/mvneta: support Rx/Tx")
> Cc: stable@dpdk.org
>
> Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
> ---
>  drivers/net/mvneta/mvneta_rxtx.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/mvneta/mvneta_rxtx.c b/drivers/net/mvneta/mvneta_rxtx.c
> index 6e4a7896b4..952e982275 100644
> --- a/drivers/net/mvneta/mvneta_rxtx.c
> +++ b/drivers/net/mvneta/mvneta_rxtx.c
> @@ -79,6 +79,10 @@ mvneta_buffs_refill(struct mvneta_priv *priv, struct mvneta_rxq *rxq, u16 *num)
>         int i, ret;
>         uint16_t nb_desc = *num;
>
> +       /* To prevent GCC-12 warning. */
> +       if (unlikely(nb_desc == 0))
> +               return -1;
> +
>         ret = rte_pktmbuf_alloc_bulk(rxq->mp, mbufs, nb_desc);
>         if (ret) {
>                 MVNETA_LOG(ERR, "Failed to allocate %u mbufs.", nb_desc);
> --
> 2.25.1
>

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

end of thread, other threads:[~2022-09-16 14:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-01  8:31 [PATCH] net/mvneta: compilation fix for GCC-12 Amit Prakash Shukla
2022-09-01  8:36 ` Liron Himi
2022-09-16 14:56   ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).