* [dpdk-dev] [PATCH] net/bnxt: fix build failure
@ 2021-07-08 22:49 Ajit Khaparde
2021-07-09 8:48 ` Thomas Monjalon
0 siblings, 1 reply; 7+ messages in thread
From: Ajit Khaparde @ 2021-07-08 22:49 UTC (permalink / raw)
To: dev; +Cc: thomas, Kishore Padmanabha
[-- Attachment #1: Type: text/plain, Size: 1411 bytes --]
Fix build failures because of uninitialized variable usage.
Fixes: 05b405d58148 ("net/bnxt: add dpool allocator for EM allocation")
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/tf_core/dpool.c | 1 +
drivers/net/bnxt/tf_ulp/ulp_mapper.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/tf_core/dpool.c b/drivers/net/bnxt/tf_core/dpool.c
index 0dae42b1bb..145efa486f 100644
--- a/drivers/net/bnxt/tf_core/dpool.c
+++ b/drivers/net/bnxt/tf_core/dpool.c
@@ -125,6 +125,7 @@ int dpool_defrag(struct dpool *dpool,
largest_free_size = 0;
largest_free_index = 0;
count = 0;
+ index = 0;
for (i = 0; i < dpool->size; i++) {
if (DP_IS_FREE(dpool->entry[i].flags)) {
diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c
index acd9f996e8..871dbad0fe 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c
@@ -2249,7 +2249,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
struct tf_free_tbl_entry_parms free_parms = { 0 };
uint32_t tbl_scope_id;
struct tf *tfp;
- struct bnxt_ulp_glb_resource_info glb_res;
+ struct bnxt_ulp_glb_resource_info glb_res = { 0 };
uint16_t bit_size;
bool alloc = false;
bool write = false;
--
2.21.1 (Apple Git-122.3)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] net/bnxt: fix build failure
2021-07-08 22:49 [dpdk-dev] [PATCH] net/bnxt: fix build failure Ajit Khaparde
@ 2021-07-09 8:48 ` Thomas Monjalon
2021-07-09 14:41 ` Ajit Khaparde
2021-07-09 15:02 ` [dpdk-dev] [PATCH] " Lance Richardson
0 siblings, 2 replies; 7+ messages in thread
From: Thomas Monjalon @ 2021-07-09 8:48 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: dev, Kishore Padmanabha
09/07/2021 00:49, Ajit Khaparde:
> Fix build failures because of uninitialized variable usage.
You should add the error log here.
You don't mention the condition of failure.
Nobody reproduced a failure so far.
> Fixes: 05b405d58148 ("net/bnxt: add dpool allocator for EM allocation")
>
> Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] net/bnxt: fix build failure
2021-07-09 8:48 ` Thomas Monjalon
@ 2021-07-09 14:41 ` Ajit Khaparde
2021-07-09 15:37 ` [dpdk-dev] [PATCH v2] " Ajit Khaparde
2021-07-09 15:02 ` [dpdk-dev] [PATCH] " Lance Richardson
1 sibling, 1 reply; 7+ messages in thread
From: Ajit Khaparde @ 2021-07-09 14:41 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dpdk-dev, Kishore Padmanabha
[-- Attachment #1: Type: text/plain, Size: 743 bytes --]
On Fri, Jul 9, 2021 at 1:48 AM Thomas Monjalon <thomas@monjalon.net> wrote:
> 09/07/2021 00:49, Ajit Khaparde:
> > Fix build failures because of uninitialized variable usage.
>
> You should add the error log here.
> You don't mention the condition of failure.
> Nobody reproduced a failure so far.
>
Sure. I did not notice it on my Fedora34 either.
The build error was reported in the dpdk-test-report [1].
Let me resend a v2 with the information.
[1] http://mails.dpdk.org/archives/test-report/2021-July/203186.html
> > Fixes: 05b405d58148 ("net/bnxt: add dpool allocator for EM allocation")
> >
> > Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
> > Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] net/bnxt: fix build failure
2021-07-09 8:48 ` Thomas Monjalon
2021-07-09 14:41 ` Ajit Khaparde
@ 2021-07-09 15:02 ` Lance Richardson
1 sibling, 0 replies; 7+ messages in thread
From: Lance Richardson @ 2021-07-09 15:02 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: Ajit Khaparde, dev, Kishore Padmanabha
[-- Attachment #1: Type: text/plain, Size: 496 bytes --]
On Fri, Jul 9, 2021 at 4:48 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 09/07/2021 00:49, Ajit Khaparde:
> > Fix build failures because of uninitialized variable usage.
>
> You should add the error log here.
> You don't mention the condition of failure.
> Nobody reproduced a failure so far.
Hi Thomas,
This addresses FC34 (which I think is using gcc11) build failures, there
is an example here:
http://mails.dpdk.org/archives/test-report/2021-July/203186.html
Regards,
Lance
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH v2] net/bnxt: fix build failure
2021-07-09 14:41 ` Ajit Khaparde
@ 2021-07-09 15:37 ` Ajit Khaparde
2021-07-09 18:38 ` Ajit Khaparde
0 siblings, 1 reply; 7+ messages in thread
From: Ajit Khaparde @ 2021-07-09 15:37 UTC (permalink / raw)
To: dev; +Cc: thomas, Kishore Padmanabha
[-- Attachment #1: Type: text/plain, Size: 2337 bytes --]
Fix build failures because of uninitialized variables.
../drivers/net/bnxt/tf_ulp/ulp_mapper.c: In function ‘ulp_mapper_index_tbl_process’:
../drivers/net/bnxt/tf_ulp/ulp_mapper.c:2252:43: error: ‘*(unsigned int *)((char *)&glb_res + offsetof(struct bnxt_ulp_glb_resource_info, resource_func))’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
2252 | struct bnxt_ulp_glb_resource_info glb_res;
| ^~~~~~~
../drivers/net/bnxt/tf_ulp/ulp_mapper.c:2252:43: error: ‘glb_res.resource_type’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
../drivers/net/bnxt/tf_core/dpool.c: In function ‘dpool_defrag’:
../drivers/net/bnxt/tf_core/dpool.c:95:18: error: ‘index’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
95 | uint32_t index;
| ^~~~~
Fixes: 05b405d58148 ("net/bnxt: add dpool allocator for EM allocation")
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
v1->v2: update commit log to show the build error encountered.
---
drivers/net/bnxt/tf_core/dpool.c | 1 +
drivers/net/bnxt/tf_ulp/ulp_mapper.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/tf_core/dpool.c b/drivers/net/bnxt/tf_core/dpool.c
index 0dae42b1bb..145efa486f 100644
--- a/drivers/net/bnxt/tf_core/dpool.c
+++ b/drivers/net/bnxt/tf_core/dpool.c
@@ -125,6 +125,7 @@ int dpool_defrag(struct dpool *dpool,
largest_free_size = 0;
largest_free_index = 0;
count = 0;
+ index = 0;
for (i = 0; i < dpool->size; i++) {
if (DP_IS_FREE(dpool->entry[i].flags)) {
diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c
index acd9f996e8..871dbad0fe 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c
@@ -2249,7 +2249,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
struct tf_free_tbl_entry_parms free_parms = { 0 };
uint32_t tbl_scope_id;
struct tf *tfp;
- struct bnxt_ulp_glb_resource_info glb_res;
+ struct bnxt_ulp_glb_resource_info glb_res = { 0 };
uint16_t bit_size;
bool alloc = false;
bool write = false;
--
2.21.1 (Apple Git-122.3)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/bnxt: fix build failure
2021-07-09 15:37 ` [dpdk-dev] [PATCH v2] " Ajit Khaparde
@ 2021-07-09 18:38 ` Ajit Khaparde
2021-07-09 20:39 ` Thomas Monjalon
0 siblings, 1 reply; 7+ messages in thread
From: Ajit Khaparde @ 2021-07-09 18:38 UTC (permalink / raw)
To: dpdk-dev; +Cc: Thomas Monjalon, Kishore Padmanabha
[-- Attachment #1: Type: text/plain, Size: 2809 bytes --]
On Fri, Jul 9, 2021 at 8:37 AM Ajit Khaparde <ajit.khaparde@broadcom.com>
wrote:
> Fix build failures because of uninitialized variables.
>
> ../drivers/net/bnxt/tf_ulp/ulp_mapper.c: In function
> ‘ulp_mapper_index_tbl_process’:
> ../drivers/net/bnxt/tf_ulp/ulp_mapper.c:2252:43: error: ‘*(unsigned int
> *)((char *)&glb_res + offsetof(struct bnxt_ulp_glb_resource_info,
> resource_func))’ may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
> 2252 | struct bnxt_ulp_glb_resource_info glb_res;
> | ^~~~~~~
> ../drivers/net/bnxt/tf_ulp/ulp_mapper.c:2252:43: error:
> ‘glb_res.resource_type’ may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
>
> ../drivers/net/bnxt/tf_core/dpool.c: In function ‘dpool_defrag’:
> ../drivers/net/bnxt/tf_core/dpool.c:95:18: error: ‘index’ may be used
> uninitialized in this function [-Werror=maybe-uninitialized]
> 95 | uint32_t index;
> | ^~~~~
>
> Fixes: 05b405d58148 ("net/bnxt: add dpool allocator for EM allocation")
>
> Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
> v1->v2: update commit log to show the build error encountered.
> ---
>
Patch applied to dpdk-next-net-brcm for-next-net branch. Thanks
> drivers/net/bnxt/tf_core/dpool.c | 1 +
> drivers/net/bnxt/tf_ulp/ulp_mapper.c | 2 +-
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/bnxt/tf_core/dpool.c
> b/drivers/net/bnxt/tf_core/dpool.c
> index 0dae42b1bb..145efa486f 100644
> --- a/drivers/net/bnxt/tf_core/dpool.c
> +++ b/drivers/net/bnxt/tf_core/dpool.c
> @@ -125,6 +125,7 @@ int dpool_defrag(struct dpool *dpool,
> largest_free_size = 0;
> largest_free_index = 0;
> count = 0;
> + index = 0;
>
> for (i = 0; i < dpool->size; i++) {
> if (DP_IS_FREE(dpool->entry[i].flags)) {
> diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c
> b/drivers/net/bnxt/tf_ulp/ulp_mapper.c
> index acd9f996e8..871dbad0fe 100644
> --- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c
> +++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c
> @@ -2249,7 +2249,7 @@ ulp_mapper_index_tbl_process(struct
> bnxt_ulp_mapper_parms *parms,
> struct tf_free_tbl_entry_parms free_parms = { 0 };
> uint32_t tbl_scope_id;
> struct tf *tfp;
> - struct bnxt_ulp_glb_resource_info glb_res;
> + struct bnxt_ulp_glb_resource_info glb_res = { 0 };
> uint16_t bit_size;
> bool alloc = false;
> bool write = false;
> --
> 2.21.1 (Apple Git-122.3)
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/bnxt: fix build failure
2021-07-09 18:38 ` Ajit Khaparde
@ 2021-07-09 20:39 ` Thomas Monjalon
0 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2021-07-09 20:39 UTC (permalink / raw)
To: Ajit Khaparde
Cc: dpdk-dev, Kishore Padmanabha, david.marchand, ferruh.yigit,
andrew.rybchenko
09/07/2021 20:38, Ajit Khaparde:
> On Fri, Jul 9, 2021 at 8:37 AM Ajit Khaparde <ajit.khaparde@broadcom.com>
> wrote:
>
> > Fix build failures because of uninitialized variables.
> >
> > ../drivers/net/bnxt/tf_ulp/ulp_mapper.c: In function
> > ‘ulp_mapper_index_tbl_process’:
> > ../drivers/net/bnxt/tf_ulp/ulp_mapper.c:2252:43: error: ‘*(unsigned int
> > *)((char *)&glb_res + offsetof(struct bnxt_ulp_glb_resource_info,
> > resource_func))’ may be used uninitialized in this function
> > [-Werror=maybe-uninitialized]
> > 2252 | struct bnxt_ulp_glb_resource_info glb_res;
> > | ^~~~~~~
> > ../drivers/net/bnxt/tf_ulp/ulp_mapper.c:2252:43: error:
> > ‘glb_res.resource_type’ may be used uninitialized in this function
> > [-Werror=maybe-uninitialized]
> >
> > ../drivers/net/bnxt/tf_core/dpool.c: In function ‘dpool_defrag’:
> > ../drivers/net/bnxt/tf_core/dpool.c:95:18: error: ‘index’ may be used
> > uninitialized in this function [-Werror=maybe-uninitialized]
> > 95 | uint32_t index;
> > | ^~~~~
> >
> > Fixes: 05b405d58148 ("net/bnxt: add dpool allocator for EM allocation")
> >
> > Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
> > Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>
> Patch applied to dpdk-next-net-brcm for-next-net branch. Thanks
Pulled in main with additional info:
seen on Fedora Core 34 (GCC 11)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-07-09 20:39 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08 22:49 [dpdk-dev] [PATCH] net/bnxt: fix build failure Ajit Khaparde
2021-07-09 8:48 ` Thomas Monjalon
2021-07-09 14:41 ` Ajit Khaparde
2021-07-09 15:37 ` [dpdk-dev] [PATCH v2] " Ajit Khaparde
2021-07-09 18:38 ` Ajit Khaparde
2021-07-09 20:39 ` Thomas Monjalon
2021-07-09 15:02 ` [dpdk-dev] [PATCH] " Lance Richardson
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).