DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] examples/ip_pipeline: fix build issue with GCC 13
@ 2023-05-02 13:50 jerinj
  2023-05-02 13:50 ` [dpdk-dev] [PATCH v1] examples/ntb: " jerinj
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: jerinj @ 2023-05-02 13:50 UTC (permalink / raw)
  To: dev, Cristian Dumitrescu, Jasvinder Singh
  Cc: thomas, david.marchand, ferruh.yigit, stephen, Jerin Jacob, stable

From: Jerin Jacob <jerinj@marvell.com>

Fix the following build issue by initializing req to NULL for
the local variable.

In function 'thread_msg_handle', inlined from 'thread_main' at
../examples/ip_pipeline/thread.c:3130:6:
../examples/ip_pipeline/thread.c:535:20: warning: 'req' may be used
uninitialized [-Wmaybe-uninitialized]
  535 |                 if (req == NULL)
      |                    ^
../examples/ip_pipeline/thread.c: In function 'thread_main':
../examples/ip_pipeline/thread.c:433:32: note: 'req' was declared here
  433 |         struct thread_msg_req *req;

Bugzilla ID: 1220
Fixes: a8bd581de397 ("examples/ip_pipeline: add thread runtime")
Cc: stable@dpdk.org

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
 examples/ip_pipeline/thread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/ip_pipeline/thread.c b/examples/ip_pipeline/thread.c
index 82d5f87c38..9817657ca9 100644
--- a/examples/ip_pipeline/thread.c
+++ b/examples/ip_pipeline/thread.c
@@ -430,7 +430,7 @@ thread_pipeline_disable(uint32_t thread_id,
 static inline struct thread_msg_req *
 thread_msg_recv(struct rte_ring *msgq_req)
 {
-	struct thread_msg_req *req;
+	struct thread_msg_req *req = NULL;
 
 	int status = rte_ring_sc_dequeue(msgq_req, (void **) &req);
 
-- 
2.40.1


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

* [dpdk-dev] [PATCH v1] examples/ntb: fix build issue with GCC 13
  2023-05-02 13:50 [dpdk-dev] [PATCH v1] examples/ip_pipeline: fix build issue with GCC 13 jerinj
@ 2023-05-02 13:50 ` jerinj
  2023-05-03  8:37   ` Ali Alnubani
                     ` (2 more replies)
  2023-05-02 14:54 ` [dpdk-dev] [PATCH v1] examples/ip_pipeline: " Dumitrescu, Cristian
                   ` (2 subsequent siblings)
  3 siblings, 3 replies; 12+ messages in thread
From: jerinj @ 2023-05-02 13:50 UTC (permalink / raw)
  To: dev, Jingjing Wu, Junfeng Guo, Xiaoyun Li
  Cc: thomas, david.marchand, ferruh.yigit, stephen, Jerin Jacob, stable

From: Jerin Jacob <jerinj@marvell.com>

Fix the following build issue by not allowing nb_ids to be zero.
nb_ids can be zero based on rte_rawdev_xstats_get() API
documentation but it is not valid for the case when second
argument is NULL.

examples/ntb/ntb_fwd.c: In function 'ntb_stats_display':
examples/ntb/ntb_fwd.c:945:23: error: 'rte_rawdev_xstats_get'
accessing 8 bytes in a region of size 0 [-Werror=stringop-overflow=]
  945 | if (nb_ids != rte_rawdev_xstats_get(dev_id, ids, values, nb_ids)) {
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

examples/ntb/ntb_fwd.c:945:23: note: referencing argument 3
of type 'uint64_t[0]' {aka 'long unsigned int[]'}
In file included from ../examples/ntb/ntb_fwd.c:17:
lib/rawdev/rte_rawdev.h:504:1: note: in a call to function
'rte_rawdev_xstats_get'
  504 | rte_rawdev_xstats_get(uint16_t dev_id,

Fixes: 5194299d6ef5 ("examples/ntb: support more functions")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
 examples/ntb/ntb_fwd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c
index f9abed28e4..5489c3b3cd 100644
--- a/examples/ntb/ntb_fwd.c
+++ b/examples/ntb/ntb_fwd.c
@@ -923,7 +923,7 @@ ntb_stats_display(void)
 
 	/* Get NTB dev stats and stats names */
 	nb_ids = rte_rawdev_xstats_names_get(dev_id, NULL, 0);
-	if (nb_ids  < 0) {
+	if (nb_ids <= 0) {
 		printf("Error: Cannot get count of xstats\n");
 		return;
 	}
-- 
2.40.1


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

* RE: [dpdk-dev] [PATCH v1] examples/ip_pipeline: fix build issue with GCC 13
  2023-05-02 13:50 [dpdk-dev] [PATCH v1] examples/ip_pipeline: fix build issue with GCC 13 jerinj
  2023-05-02 13:50 ` [dpdk-dev] [PATCH v1] examples/ntb: " jerinj
@ 2023-05-02 14:54 ` Dumitrescu, Cristian
  2023-05-11  6:51 ` Gao, DaxueX
  2023-05-11  7:01 ` David Marchand
  3 siblings, 0 replies; 12+ messages in thread
From: Dumitrescu, Cristian @ 2023-05-02 14:54 UTC (permalink / raw)
  To: jerinj, dev, Singh, Jasvinder
  Cc: thomas, david.marchand, ferruh.yigit, stephen, stable



> -----Original Message-----
> From: jerinj@marvell.com <jerinj@marvell.com>
> Sent: Tuesday, May 2, 2023 2:51 PM
> To: dev@dpdk.org; Dumitrescu, Cristian <cristian.dumitrescu@intel.com>;
> Singh, Jasvinder <jasvinder.singh@intel.com>
> Cc: thomas@monjalon.net; david.marchand@redhat.com;
> ferruh.yigit@xilinx.com; stephen@networkplumber.org; Jerin Jacob
> <jerinj@marvell.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v1] examples/ip_pipeline: fix build issue with GCC 13
> 
> From: Jerin Jacob <jerinj@marvell.com>
> 
> Fix the following build issue by initializing req to NULL for
> the local variable.
> 
> In function 'thread_msg_handle', inlined from 'thread_main' at
> ../examples/ip_pipeline/thread.c:3130:6:
> ../examples/ip_pipeline/thread.c:535:20: warning: 'req' may be used
> uninitialized [-Wmaybe-uninitialized]
>   535 |                 if (req == NULL)
>       |                    ^
> ../examples/ip_pipeline/thread.c: In function 'thread_main':
> ../examples/ip_pipeline/thread.c:433:32: note: 'req' was declared here
>   433 |         struct thread_msg_req *req;
> 
> Bugzilla ID: 1220
> Fixes: a8bd581de397 ("examples/ip_pipeline: add thread runtime")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> ---
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>


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

* RE: [dpdk-dev] [PATCH v1] examples/ntb: fix build issue with GCC 13
  2023-05-02 13:50 ` [dpdk-dev] [PATCH v1] examples/ntb: " jerinj
@ 2023-05-03  8:37   ` Ali Alnubani
  2023-05-04  8:36   ` Guo, Junfeng
  2023-05-04  8:53   ` [dpdk-dev] [PATCH v2] " jerinj
  2 siblings, 0 replies; 12+ messages in thread
From: Ali Alnubani @ 2023-05-03  8:37 UTC (permalink / raw)
  To: jerinj, dev, Jingjing Wu, Junfeng Guo, Xiaoyun Li
  Cc: NBU-Contact-Thomas Monjalon (EXTERNAL),
	david.marchand, ferruh.yigit, stephen, stable

> -----Original Message-----
> From: jerinj@marvell.com <jerinj@marvell.com>
> Sent: Tuesday, May 2, 2023 4:51 PM
> To: dev@dpdk.org; Jingjing Wu <jingjing.wu@intel.com>; Junfeng Guo
> <junfeng.guo@intel.com>; Xiaoyun Li <xiaoyun.li@intel.com>
> Cc: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> david.marchand@redhat.com; ferruh.yigit@xilinx.com;
> stephen@networkplumber.org; Jerin Jacob <jerinj@marvell.com>;
> stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v1] examples/ntb: fix build issue with GCC 13
> 
> From: Jerin Jacob <jerinj@marvell.com>
> 
> Fix the following build issue by not allowing nb_ids to be zero.
> nb_ids can be zero based on rte_rawdev_xstats_get() API
> documentation but it is not valid for the case when second
> argument is NULL.
> 
> examples/ntb/ntb_fwd.c: In function 'ntb_stats_display':
> examples/ntb/ntb_fwd.c:945:23: error: 'rte_rawdev_xstats_get'
> accessing 8 bytes in a region of size 0 [-Werror=stringop-overflow=]
>   945 | if (nb_ids != rte_rawdev_xstats_get(dev_id, ids, values, nb_ids)) {
>       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> examples/ntb/ntb_fwd.c:945:23: note: referencing argument 3
> of type 'uint64_t[0]' {aka 'long unsigned int[]'}
> In file included from ../examples/ntb/ntb_fwd.c:17:
> lib/rawdev/rte_rawdev.h:504:1: note: in a call to function
> 'rte_rawdev_xstats_get'
>   504 | rte_rawdev_xstats_get(uint16_t dev_id,
> 
> Fixes: 5194299d6ef5 ("examples/ntb: support more functions")
> Cc: stable@dpdk.org
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> ---

Resolves the build failure for me on Fedora 38 with gcc 13.1.1.

Tested-by: Ali Alnubani <alialnu@nvidia.com>

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

* RE: [dpdk-dev] [PATCH v1] examples/ntb: fix build issue with GCC 13
  2023-05-02 13:50 ` [dpdk-dev] [PATCH v1] examples/ntb: " jerinj
  2023-05-03  8:37   ` Ali Alnubani
@ 2023-05-04  8:36   ` Guo, Junfeng
  2023-05-04  8:46     ` Jerin Jacob
  2023-05-04  8:53   ` [dpdk-dev] [PATCH v2] " jerinj
  2 siblings, 1 reply; 12+ messages in thread
From: Guo, Junfeng @ 2023-05-04  8:36 UTC (permalink / raw)
  To: jerinj, dev, Wu, Jingjing, Li, Xiaoyun
  Cc: thomas, david.marchand, ferruh.yigit, stephen, stable



> -----Original Message-----
> From: jerinj@marvell.com <jerinj@marvell.com>
> Sent: Tuesday, May 2, 2023 21:51
> To: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; Guo, Junfeng
> <junfeng.guo@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>
> Cc: thomas@monjalon.net; david.marchand@redhat.com;
> ferruh.yigit@xilinx.com; stephen@networkplumber.org; Jerin Jacob
> <jerinj@marvell.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v1] examples/ntb: fix build issue with GCC 13
> 
> From: Jerin Jacob <jerinj@marvell.com>
> 
> Fix the following build issue by not allowing nb_ids to be zero.
> nb_ids can be zero based on rte_rawdev_xstats_get() API
> documentation but it is not valid for the case when second
> argument is NULL.

Is this the new standard for GCC 13?

> 
> examples/ntb/ntb_fwd.c: In function 'ntb_stats_display':
> examples/ntb/ntb_fwd.c:945:23: error: 'rte_rawdev_xstats_get'
> accessing 8 bytes in a region of size 0 [-Werror=stringop-overflow=]
>   945 | if (nb_ids != rte_rawdev_xstats_get(dev_id, ids, values, nb_ids)) {
>       |
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> examples/ntb/ntb_fwd.c:945:23: note: referencing argument 3
> of type 'uint64_t[0]' {aka 'long unsigned int[]'}
> In file included from ../examples/ntb/ntb_fwd.c:17:
> lib/rawdev/rte_rawdev.h:504:1: note: in a call to function
> 'rte_rawdev_xstats_get'
>   504 | rte_rawdev_xstats_get(uint16_t dev_id,
> 
> Fixes: 5194299d6ef5 ("examples/ntb: support more functions")
> Cc: stable@dpdk.org
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> ---
>  examples/ntb/ntb_fwd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c
> index f9abed28e4..5489c3b3cd 100644
> --- a/examples/ntb/ntb_fwd.c
> +++ b/examples/ntb/ntb_fwd.c
> @@ -923,7 +923,7 @@ ntb_stats_display(void)
> 
>  	/* Get NTB dev stats and stats names */
>  	nb_ids = rte_rawdev_xstats_names_get(dev_id, NULL, 0);
> -	if (nb_ids  < 0) {
> +	if (nb_ids <= 0) {

Should the one in func ntb_stats_clear also be updated non-zero?

>  		printf("Error: Cannot get count of xstats\n");
>  		return;
>  	}
> --
> 2.40.1


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

* Re: [dpdk-dev] [PATCH v1] examples/ntb: fix build issue with GCC 13
  2023-05-04  8:36   ` Guo, Junfeng
@ 2023-05-04  8:46     ` Jerin Jacob
  0 siblings, 0 replies; 12+ messages in thread
From: Jerin Jacob @ 2023-05-04  8:46 UTC (permalink / raw)
  To: Guo, Junfeng
  Cc: jerinj, dev, Wu, Jingjing, Li, Xiaoyun, thomas, david.marchand,
	ferruh.yigit, stephen, stable

On Thu, May 4, 2023 at 2:06 PM Guo, Junfeng <junfeng.guo@intel.com> wrote:
>
>
>
> > -----Original Message-----
> > From: jerinj@marvell.com <jerinj@marvell.com>
> > Sent: Tuesday, May 2, 2023 21:51
> > To: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; Guo, Junfeng
> > <junfeng.guo@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>
> > Cc: thomas@monjalon.net; david.marchand@redhat.com;
> > ferruh.yigit@xilinx.com; stephen@networkplumber.org; Jerin Jacob
> > <jerinj@marvell.com>; stable@dpdk.org
> > Subject: [dpdk-dev] [PATCH v1] examples/ntb: fix build issue with GCC 13
> >
> > From: Jerin Jacob <jerinj@marvell.com>
> >
> > Fix the following build issue by not allowing nb_ids to be zero.
> > nb_ids can be zero based on rte_rawdev_xstats_get() API
> > documentation but it is not valid for the case when second
> > argument is NULL.
>
> Is this the new standard for GCC 13?

No. Looks like optimization from compiler. It is able to detect their
case for zero memory allocation.

>
> >
> > examples/ntb/ntb_fwd.c: In function 'ntb_stats_display':
> > examples/ntb/ntb_fwd.c:945:23: error: 'rte_rawdev_xstats_get'
> > accessing 8 bytes in a region of size 0 [-Werror=stringop-overflow=]
> >   945 | if (nb_ids != rte_rawdev_xstats_get(dev_id, ids, values, nb_ids)) {
> >       |
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > examples/ntb/ntb_fwd.c:945:23: note: referencing argument 3
> > of type 'uint64_t[0]' {aka 'long unsigned int[]'}
> > In file included from ../examples/ntb/ntb_fwd.c:17:
> > lib/rawdev/rte_rawdev.h:504:1: note: in a call to function
> > 'rte_rawdev_xstats_get'
> >   504 | rte_rawdev_xstats_get(uint16_t dev_id,
> >
> > Fixes: 5194299d6ef5 ("examples/ntb: support more functions")
> > Cc: stable@dpdk.org
> > Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> > ---
> >  examples/ntb/ntb_fwd.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c
> > index f9abed28e4..5489c3b3cd 100644
> > --- a/examples/ntb/ntb_fwd.c
> > +++ b/examples/ntb/ntb_fwd.c
> > @@ -923,7 +923,7 @@ ntb_stats_display(void)
> >
> >       /* Get NTB dev stats and stats names */
> >       nb_ids = rte_rawdev_xstats_names_get(dev_id, NULL, 0);
> > -     if (nb_ids  < 0) {
> > +     if (nb_ids <= 0) {
>
> Should the one in func ntb_stats_clear also be updated non-zero?

Some reason compiler is not detecting it. I will fix in next version.


>
> >               printf("Error: Cannot get count of xstats\n");
> >               return;
> >       }
> > --
> > 2.40.1
>

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

* [dpdk-dev] [PATCH v2] examples/ntb: fix build issue with GCC 13
  2023-05-02 13:50 ` [dpdk-dev] [PATCH v1] examples/ntb: " jerinj
  2023-05-03  8:37   ` Ali Alnubani
  2023-05-04  8:36   ` Guo, Junfeng
@ 2023-05-04  8:53   ` jerinj
  2023-05-04  9:07     ` Guo, Junfeng
                       ` (2 more replies)
  2 siblings, 3 replies; 12+ messages in thread
From: jerinj @ 2023-05-04  8:53 UTC (permalink / raw)
  To: dev, Jingjing Wu, Junfeng Guo, Xiaoyun Li
  Cc: thomas, david.marchand, ferruh.yigit, Jerin Jacob, stable, Ali Alnubani

From: Jerin Jacob <jerinj@marvell.com>

Fix the following build issue by not allowing nb_ids to be zero.
nb_ids can be zero based on rte_rawdev_xstats_get() API
documentation but it is not valid for the case when second
argument is NULL.

examples/ntb/ntb_fwd.c: In function 'ntb_stats_display':
examples/ntb/ntb_fwd.c:945:23: error: 'rte_rawdev_xstats_get'
accessing 8 bytes in a region of size 0 [-Werror=stringop-overflow=]
  945 | if (nb_ids != rte_rawdev_xstats_get(dev_id, ids, values, nb_ids)) {
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

examples/ntb/ntb_fwd.c:945:23: note: referencing argument 3
of type 'uint64_t[0]' {aka 'long unsigned int[]'}
In file included from ../examples/ntb/ntb_fwd.c:17:
lib/rawdev/rte_rawdev.h:504:1: note: in a call to function
'rte_rawdev_xstats_get'
  504 | rte_rawdev_xstats_get(uint16_t dev_id,

Fixes: 5194299d6ef5 ("examples/ntb: support more functions")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
---
v2:
- Apply the same fix for ntb_stats_clear()(Junfeng)

 examples/ntb/ntb_fwd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c
index f9abed28e4..585aad9d70 100644
--- a/examples/ntb/ntb_fwd.c
+++ b/examples/ntb/ntb_fwd.c
@@ -865,7 +865,7 @@ ntb_stats_clear(void)
 
 	/* Clear NTB dev stats */
 	nb_ids = rte_rawdev_xstats_names_get(dev_id, NULL, 0);
-	if (nb_ids  < 0) {
+	if (nb_ids <= 0) {
 		printf("Error: Cannot get count of xstats\n");
 		return;
 	}
@@ -923,7 +923,7 @@ ntb_stats_display(void)
 
 	/* Get NTB dev stats and stats names */
 	nb_ids = rte_rawdev_xstats_names_get(dev_id, NULL, 0);
-	if (nb_ids  < 0) {
+	if (nb_ids <= 0) {
 		printf("Error: Cannot get count of xstats\n");
 		return;
 	}
-- 
2.40.1


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

* RE: [dpdk-dev] [PATCH v2] examples/ntb: fix build issue with GCC 13
  2023-05-04  8:53   ` [dpdk-dev] [PATCH v2] " jerinj
@ 2023-05-04  9:07     ` Guo, Junfeng
  2023-05-11  6:54     ` Gao, DaxueX
  2023-05-11  7:02     ` David Marchand
  2 siblings, 0 replies; 12+ messages in thread
From: Guo, Junfeng @ 2023-05-04  9:07 UTC (permalink / raw)
  To: jerinj, dev, Wu, Jingjing, Li, Xiaoyun
  Cc: thomas, david.marchand, ferruh.yigit, stable, Ali Alnubani



> -----Original Message-----
> From: jerinj@marvell.com <jerinj@marvell.com>
> Sent: Thursday, May 4, 2023 16:54
> To: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; Guo, Junfeng
> <junfeng.guo@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>
> Cc: thomas@monjalon.net; david.marchand@redhat.com;
> ferruh.yigit@amd.com; Jerin Jacob <jerinj@marvell.com>;
> stable@dpdk.org; Ali Alnubani <alialnu@nvidia.com>
> Subject: [dpdk-dev] [PATCH v2] examples/ntb: fix build issue with GCC 13
> 
> From: Jerin Jacob <jerinj@marvell.com>
> 
> Fix the following build issue by not allowing nb_ids to be zero.
> nb_ids can be zero based on rte_rawdev_xstats_get() API
> documentation but it is not valid for the case when second
> argument is NULL.
> 
> examples/ntb/ntb_fwd.c: In function 'ntb_stats_display':
> examples/ntb/ntb_fwd.c:945:23: error: 'rte_rawdev_xstats_get'
> accessing 8 bytes in a region of size 0 [-Werror=stringop-overflow=]
>   945 | if (nb_ids != rte_rawdev_xstats_get(dev_id, ids, values, nb_ids)) {
>       |
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> examples/ntb/ntb_fwd.c:945:23: note: referencing argument 3
> of type 'uint64_t[0]' {aka 'long unsigned int[]'}
> In file included from ../examples/ntb/ntb_fwd.c:17:
> lib/rawdev/rte_rawdev.h:504:1: note: in a call to function
> 'rte_rawdev_xstats_get'
>   504 | rte_rawdev_xstats_get(uint16_t dev_id,
> 
> Fixes: 5194299d6ef5 ("examples/ntb: support more functions")
> Cc: stable@dpdk.org
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> Tested-by: Ali Alnubani <alialnu@nvidia.com>
> ---
> v2:
> - Apply the same fix for ntb_stats_clear()(Junfeng)
> 
>  examples/ntb/ntb_fwd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c
> index f9abed28e4..585aad9d70 100644
> --- a/examples/ntb/ntb_fwd.c
> +++ b/examples/ntb/ntb_fwd.c
> @@ -865,7 +865,7 @@ ntb_stats_clear(void)
> --
> 2.40.1

LGTM, it makes sense to avoid zero memory allocation. Thanks!

Acked-by: Junfeng Guo <junfeng.guo@intel.com>

Regards,
Junfeng Guo

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

* RE: [dpdk-dev] [PATCH v1] examples/ip_pipeline: fix build issue with GCC 13
  2023-05-02 13:50 [dpdk-dev] [PATCH v1] examples/ip_pipeline: fix build issue with GCC 13 jerinj
  2023-05-02 13:50 ` [dpdk-dev] [PATCH v1] examples/ntb: " jerinj
  2023-05-02 14:54 ` [dpdk-dev] [PATCH v1] examples/ip_pipeline: " Dumitrescu, Cristian
@ 2023-05-11  6:51 ` Gao, DaxueX
  2023-05-11  7:01 ` David Marchand
  3 siblings, 0 replies; 12+ messages in thread
From: Gao, DaxueX @ 2023-05-11  6:51 UTC (permalink / raw)
  To: jerinj, dev, Dumitrescu, Cristian, Singh, Jasvinder
  Cc: thomas, david.marchand, ferruh.yigit, stephen, stable



> -----Original Message-----
> From: jerinj@marvell.com <jerinj@marvell.com>
> Sent: 2023年5月2日 21:51
> To: dev@dpdk.org; Dumitrescu, Cristian <cristian.dumitrescu@intel.com>;
> Singh, Jasvinder <jasvinder.singh@intel.com>
> Cc: thomas@monjalon.net; david.marchand@redhat.com;
> ferruh.yigit@xilinx.com; stephen@networkplumber.org; Jerin Jacob
> <jerinj@marvell.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v1] examples/ip_pipeline: fix build issue with GCC 13
> 
> From: Jerin Jacob <jerinj@marvell.com>
> 
> Fix the following build issue by initializing req to NULL for the local variable.
> 
> In function 'thread_msg_handle', inlined from 'thread_main' at
> ../examples/ip_pipeline/thread.c:3130:6:
> ../examples/ip_pipeline/thread.c:535:20: warning: 'req' may be used
> uninitialized [-Wmaybe-uninitialized]
>   535 |                 if (req == NULL)
>       |                    ^
> ../examples/ip_pipeline/thread.c: In function 'thread_main':
> ../examples/ip_pipeline/thread.c:433:32: note: 'req' was declared here
>   433 |         struct thread_msg_req *req;
> 
> Bugzilla ID: 1220
> Fixes: a8bd581de397 ("examples/ip_pipeline: add thread runtime")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Daxue Gao <daxuex.gao@intel.com>

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

* RE: [dpdk-dev] [PATCH v2] examples/ntb: fix build issue with GCC 13
  2023-05-04  8:53   ` [dpdk-dev] [PATCH v2] " jerinj
  2023-05-04  9:07     ` Guo, Junfeng
@ 2023-05-11  6:54     ` Gao, DaxueX
  2023-05-11  7:02     ` David Marchand
  2 siblings, 0 replies; 12+ messages in thread
From: Gao, DaxueX @ 2023-05-11  6:54 UTC (permalink / raw)
  To: jerinj, dev, Wu, Jingjing, Guo, Junfeng, Li, Xiaoyun
  Cc: thomas, david.marchand, ferruh.yigit, stable, Ali Alnubani

> -----Original Message-----
> From: jerinj@marvell.com <jerinj@marvell.com>
> Sent: 2023年5月4日 16:54
> To: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; Guo, Junfeng
> <junfeng.guo@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>
> Cc: thomas@monjalon.net; david.marchand@redhat.com;
> ferruh.yigit@amd.com; Jerin Jacob <jerinj@marvell.com>; stable@dpdk.org; Ali
> Alnubani <alialnu@nvidia.com>
> Subject: [dpdk-dev] [PATCH v2] examples/ntb: fix build issue with GCC 13
> 
> From: Jerin Jacob <jerinj@marvell.com>
> 
> Fix the following build issue by not allowing nb_ids to be zero.
> nb_ids can be zero based on rte_rawdev_xstats_get() API documentation but it
> is not valid for the case when second argument is NULL.
> 
> examples/ntb/ntb_fwd.c: In function 'ntb_stats_display':
> examples/ntb/ntb_fwd.c:945:23: error: 'rte_rawdev_xstats_get'
> accessing 8 bytes in a region of size 0 [-Werror=stringop-overflow=]
>   945 | if (nb_ids != rte_rawdev_xstats_get(dev_id, ids, values, nb_ids)) {
>       |
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> examples/ntb/ntb_fwd.c:945:23: note: referencing argument 3 of type
> 'uint64_t[0]' {aka 'long unsigned int[]'} In file included
> from ../examples/ntb/ntb_fwd.c:17:
> lib/rawdev/rte_rawdev.h:504:1: note: in a call to function
> 'rte_rawdev_xstats_get'
>   504 | rte_rawdev_xstats_get(uint16_t dev_id,
> 
> Fixes: 5194299d6ef5 ("examples/ntb: support more functions")
> Cc: stable@dpdk.org
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> Tested-by: Ali Alnubani <alialnu@nvidia.com>
Tested-by: Daxue Gao <daxuex.gao@intel.com>

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

* Re: [dpdk-dev] [PATCH v1] examples/ip_pipeline: fix build issue with GCC 13
  2023-05-02 13:50 [dpdk-dev] [PATCH v1] examples/ip_pipeline: fix build issue with GCC 13 jerinj
                   ` (2 preceding siblings ...)
  2023-05-11  6:51 ` Gao, DaxueX
@ 2023-05-11  7:01 ` David Marchand
  3 siblings, 0 replies; 12+ messages in thread
From: David Marchand @ 2023-05-11  7:01 UTC (permalink / raw)
  To: jerinj
  Cc: dev, Cristian Dumitrescu, Jasvinder Singh, thomas, ferruh.yigit,
	stephen, stable

On Tue, May 2, 2023 at 3:51 PM <jerinj@marvell.com> wrote:
>
> From: Jerin Jacob <jerinj@marvell.com>
>
> Fix the following build issue by initializing req to NULL for
> the local variable.
>
> In function 'thread_msg_handle', inlined from 'thread_main' at
> ../examples/ip_pipeline/thread.c:3130:6:
> ../examples/ip_pipeline/thread.c:535:20: warning: 'req' may be used
> uninitialized [-Wmaybe-uninitialized]
>   535 |                 if (req == NULL)
>       |                    ^
> ../examples/ip_pipeline/thread.c: In function 'thread_main':
> ../examples/ip_pipeline/thread.c:433:32: note: 'req' was declared here
>   433 |         struct thread_msg_req *req;
>
> Bugzilla ID: 1220
> Fixes: a8bd581de397 ("examples/ip_pipeline: add thread runtime")
> Cc: stable@dpdk.org
>
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
Tested-by: Daxue Gao <daxuex.gao@intel.com>

Applied, thanks.


-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH v2] examples/ntb: fix build issue with GCC 13
  2023-05-04  8:53   ` [dpdk-dev] [PATCH v2] " jerinj
  2023-05-04  9:07     ` Guo, Junfeng
  2023-05-11  6:54     ` Gao, DaxueX
@ 2023-05-11  7:02     ` David Marchand
  2 siblings, 0 replies; 12+ messages in thread
From: David Marchand @ 2023-05-11  7:02 UTC (permalink / raw)
  To: jerinj
  Cc: dev, Jingjing Wu, Junfeng Guo, Xiaoyun Li, thomas, ferruh.yigit,
	stable, Ali Alnubani

On Thu, May 4, 2023 at 10:54 AM <jerinj@marvell.com> wrote:
>
> From: Jerin Jacob <jerinj@marvell.com>
>
> Fix the following build issue by not allowing nb_ids to be zero.
> nb_ids can be zero based on rte_rawdev_xstats_get() API
> documentation but it is not valid for the case when second
> argument is NULL.
>
> examples/ntb/ntb_fwd.c: In function 'ntb_stats_display':
> examples/ntb/ntb_fwd.c:945:23: error: 'rte_rawdev_xstats_get'
> accessing 8 bytes in a region of size 0 [-Werror=stringop-overflow=]
>   945 | if (nb_ids != rte_rawdev_xstats_get(dev_id, ids, values, nb_ids)) {
>       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> examples/ntb/ntb_fwd.c:945:23: note: referencing argument 3
> of type 'uint64_t[0]' {aka 'long unsigned int[]'}
> In file included from ../examples/ntb/ntb_fwd.c:17:
> lib/rawdev/rte_rawdev.h:504:1: note: in a call to function
> 'rte_rawdev_xstats_get'
>   504 | rte_rawdev_xstats_get(uint16_t dev_id,
>
> Fixes: 5194299d6ef5 ("examples/ntb: support more functions")
> Cc: stable@dpdk.org

> Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> Tested-by: Ali Alnubani <alialnu@nvidia.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
Tested-by: Daxue Gao <daxuex.gao@intel.com>

Applied, thanks.


-- 
David Marchand


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

end of thread, other threads:[~2023-05-11  7:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-02 13:50 [dpdk-dev] [PATCH v1] examples/ip_pipeline: fix build issue with GCC 13 jerinj
2023-05-02 13:50 ` [dpdk-dev] [PATCH v1] examples/ntb: " jerinj
2023-05-03  8:37   ` Ali Alnubani
2023-05-04  8:36   ` Guo, Junfeng
2023-05-04  8:46     ` Jerin Jacob
2023-05-04  8:53   ` [dpdk-dev] [PATCH v2] " jerinj
2023-05-04  9:07     ` Guo, Junfeng
2023-05-11  6:54     ` Gao, DaxueX
2023-05-11  7:02     ` David Marchand
2023-05-02 14:54 ` [dpdk-dev] [PATCH v1] examples/ip_pipeline: " Dumitrescu, Cristian
2023-05-11  6:51 ` Gao, DaxueX
2023-05-11  7:01 ` David Marchand

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