Skip to contentSkip to conversation

net/qede: fix build with gcc 11

PATCH Applied Ferruh Yigit 5 participants 14 messages Sep 21, 2020 – Oct 8, 2020 3 messages not in the archive Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 net/qede: fix build with gcc 11

Error observed with gcc 11 under development
gcc (GCC) 11.0.0 20200920 (experimental)

build error:
../drivers/net/qede/qede_main.c: In function ‘qed_get_current_link’:
../drivers/net/qede/qede_main.c:587:17:
warning: this ‘if’ clause does not guard...
[-Wmisleading-indentation]

  587 |                 if (!ptt)
      |                 ^~
../drivers/net/qede/qede_main.c:590:25:
	note: ...this statement, but the latter is misleadingly indented
              as if it were guarded by the ‘if’
  590 |                         qed_fill_link(hwfn, ptt, if_link);
      |                         ^~~~~~~~~~~~~

---
I am not clear what the exact intention of the original code is, compiler warning is about wrong indentation of 'qed_fill_link(..)', I have updated the code to keep the behavior same but fix the indentation. Please send a proper fix if the existing behavior needs to be updated.

---
 drivers/net/qede/qede_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/qede/qede_main.c +1 -1
index aecb98261..0f82568d3 100644
@@ -587,7 +587,7 @@ qed_get_current_link(struct ecore_dev *edev, struct qed_link_output *if_link)
 		if (!ptt)
 			DP_NOTICE(hwfn, true, "Failed to fill link; No PTT\n");
 
-			qed_fill_link(hwfn, ptt, if_link);
+		qed_fill_link(hwfn, ptt, if_link);
 
 		if (ptt)
 			ecore_ptt_release(hwfn, ptt);
Signature · 1 line
2.26.2
#1 lore raw

PATCH 2/4 raw/dpaa2: fix build with gcc 11

Error observed with gcc 11 under development
gcc (GCC) 11.0.0 20200920 (experimental)

build error:
../drivers/raw/dpaa2_qdma/dpaa2_qdma.c: In function ‘rte_qdma_reset’:
../drivers/raw/dpaa2_qdma/dpaa2_qdma.c:454:17:
warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]

  454 |         if (qdma_vqs[i].in_use && (qdma_vqs[i].num_enqueues !=
      |         ^~
../drivers/raw/dpaa2_qdma/dpaa2_qdma.c:457:25:
	note: ...this statement, but the latter is misleadingly indented
	as if it were guarded by the ‘if’
  457 |                         return -EBUSY;
      |                         ^~~~~~
---
 drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/raw/dpaa2_qdma/dpaa2_qdma.c +2 -1
index 0b9c4e3d7..2cba71c63 100644
@@ -452,9 +452,10 @@ rte_qdma_reset(void)
 	/* In case there are pending jobs on any VQ, return -EBUSY */
 	for (i = 0; i < qdma_dev.max_vqs; i++) {
 		if (qdma_vqs[i].in_use && (qdma_vqs[i].num_enqueues !=
-		    qdma_vqs[i].num_dequeues))
+			    qdma_vqs[i].num_dequeues)) {
 			DPAA2_QDMA_ERR("Jobs are still pending on VQ: %d", i);
 			return -EBUSY;
+		}
 	}
 
 	/* Reset HW queues */
Signature · 1 line
2.26.2

A message that is not in the archive (sent off-list or not yet received): CAJFAV8wAio=NF2eMMx9URkNinht2sPtBrE9k1c0uD+_GJcM4aw@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): CAJFAV8y9zFUAKoqhQxobdQDVPAOny4ie+Cm1fHneEX6g6zdtjw@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): AM5PR0401MB2593386BAB0C09ABE92F9D65E60B0@AM5PR0401MB2593.eurprd04.prod.outlook.com

#5 lore raw

Re: [dpdk-dev] [PATCH 2/4] raw/dpaa2: fix build with gcc 11

Quoted 5 lines · Nipun Gupta

Hi David,

https://patchwork.dpdk.org/patch/76983/ - this patch have same changes? Please check and let me know what shall be done.

Ok, I'll mark Ferruh patch as rejected.
Thank you.

Signature · 1 line
David Marchand
#6 lore raw

Re: [dpdk-dev] [PATCH 2/4] raw/dpaa2: fix build with gcc 11

Quoted 9 lines · David Marchand
Quoted 5 lines · Nipun Gupta

Hi David,

https://patchwork.dpdk.org/patch/76983/ - this patch have same changes? Please check and let me know what shall be done.

Ok, I'll mark Ferruh patch as rejected.

Yes looks like fixing same thing, good for me.

#7 lore raw

PATCH 3/4 app/testpmd: fix build with gcc 11

In reply to Ferruh Yigit

Error observed with gcc 11 under development
gcc (GCC) 11.0.0 20200920 (experimental)

../app/test-pmd/config.c:1777:61:
warning: argument 3 of type ‘const uint32_t[n]’ {aka ‘const unsigned int[n]’} declared as a variable length array [-Wvla-parameter]
1777 | port_flow_list(portid_t port_id, uint32_t n,
const uint32_t group[n])

      |                 ~~~~~~~~~~~~~~~^~~~~~~~
In file included from ../app/test-pmd/config.c:53:
../app/test-pmd/testpmd.h:764:67:
	note: previously declared as a pointer ‘const uint32_t *’
	{aka ‘const unsigned int *’}
  764 | void port_flow_list(portid_t port_id, uint32_t n,
  				const uint32_t *group);
      |                         ~~~~~~~~~~~~~~~~^~~~~
---
 app/test-pmd/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/config.c +1 -1
index b6eb2a57a..380f3b5f6 100644
@@ -1774,7 +1774,7 @@ port_flow_aged(portid_t port_id, uint8_t destroy)
 
 /** List flow rules. */
 void
-port_flow_list(portid_t port_id, uint32_t n, const uint32_t group[n])
+port_flow_list(portid_t port_id, uint32_t n, const uint32_t *group)
 {
 	struct rte_port *port;
 	struct port_flow *pf;
Signature · 1 line
2.26.2
Reviewed-by on v1 3/4
#8 lore raw

Re: [dpdk-dev] [PATCH 3/4] app/testpmd: fix build with gcc 11

Quoted 16 lines · Ferruh Yigit

Error observed with gcc 11 under development
gcc (GCC) 11.0.0 20200920 (experimental)

../app/test-pmd/config.c:1777:61:
warning: argument 3 of type ‘const uint32_t[n]’ {aka ‘const unsigned int[n]’} declared as a variable length array [-Wvla-parameter]
1777 | port_flow_list(portid_t port_id, uint32_t n,
const uint32_t group[n])
| ~~~~~~~~~~~~~~~^~~~~~~~
In file included from ../app/test-pmd/config.c:53:
../app/test-pmd/testpmd.h:764:67:
note: previously declared as a pointer ‘const uint32_t *’ {aka ‘const unsigned int *’}
764 | void port_flow_list(portid_t port_id, uint32_t n,

Quoted 3 lines
                                const uint32_t *group);
      |                         ~~~~~~~~~~~~~~~~^~~~~

It won't hurt to backport this.

Fixes 938a184a1870 ("app/testpmd: implement basic support for flow API")
Quoted 19 lines
---
 app/test-pmd/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/config.c +1 -2
index b6eb2a57a..380f3b5f6 100644
@@ -1774,7 +1774,7 @@ port_flow_aged(portid_t port_id, uint8_t destroy)
 
 /** List flow rules. */
 void
-port_flow_list(portid_t port_id, uint32_t n, const uint32_t group[n])
+port_flow_list(portid_t port_id, uint32_t n, const uint32_t *group)
 {
        struct rte_port *port;
        struct port_flow *pf;
--
Quoted 2 lines

2.26.2

Signature · 1 line
David Marchand
Reviewed-by
#9 lore raw

Re: [dpdk-dev] [PATCH 3/4] app/testpmd: fix build with gcc 11

Quoted 61 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of David Marchand
Sent: Thursday, September 24, 2020 12:31 PM
To: Ferruh Yigit <[email protected]>
Cc: Wenzhuo Lu <[email protected]>; Beilei Xing <[email protected]>; Bernard Iremonger <[email protected]>; dev <[email protected]>; NBU-Contact-Adrien Mazarguil <[email protected]>
Subject: Re: [dpdk-dev] [PATCH 3/4] app/testpmd: fix build with gcc 11

Quoted 16 lines · Ferruh Yigit

Error observed with gcc 11 under development gcc (GCC) 11.0.0 20200920 (experimental)

../app/test-pmd/config.c:1777:61:
warning: argument 3 of type ‘const uint32_t[n]’ {aka ‘const unsigned int[n]’} declared as a variable length array [-Wvla-parameter]
1777 | port_flow_list(portid_t port_id, uint32_t n,
const uint32_t group[n])
| ~~~~~~~~~~~~~~~^~~~~~~~
In file included from ../app/test-pmd/config.c:53:
../app/test-pmd/testpmd.h:764:67:
note: previously declared as a pointer ‘const uint32_t *’ {aka ‘const unsigned int *’}
764 | void port_flow_list(portid_t port_id, uint32_t n,

Quoted 3 lines
                                const uint32_t *group);
      |                         ~~~~~~~~~~~~~~~~^~~~~

It won't hurt to backport this.

Fixes 938a184a1870 ("app/testpmd: implement basic support for flow API")
Quoted 19 lines
---
 app/test-pmd/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/config.c index renamed from app/test-pmd/config.c +0 -0

b6eb2a57a..380f3b5f6 100644

app/test-pmd/config.c +1 -1
@@ -1774,7 +1774,7 @@ port_flow_aged(portid_t port_id, uint8_t
 destroy)
 
 /** List flow rules. */
 void
-port_flow_list(portid_t port_id, uint32_t n, const uint32_t group[n])
+port_flow_list(portid_t port_id, uint32_t n, const uint32_t *group)
 {
        struct rte_port *port;
        struct port_flow *pf;
Quoted 3 lines

--
2.26.2

Quoted 2 lines

--
David Marchand

Reviewed-by on v1 3/4
#10 lore raw

Re: [dpdk-dev] [PATCH 3/4] app/testpmd: fix build with gcc 11

In reply to Ferruh Yigit

<snip>

Quoted 20 lines

Subject: [dpdk-dev] [PATCH 3/4] app/testpmd: fix build with gcc 11

Error observed with gcc 11 under development
gcc (GCC) 11.0.0 20200920 (experimental)

../app/test-pmd/config.c:1777:61:
warning: argument 3 of type ‘const uint32_t[n]’ {aka ‘const unsigned int[n]’} declared as a variable length array [-Wvla-parameter]
1777 | port_flow_list(portid_t port_id, uint32_t n,
const uint32_t group[n])

      |                 ~~~~~~~~~~~~~~~^~~~~~~~
In file included from ../app/test-pmd/config.c:53:
../app/test-pmd/testpmd.h:764:67:
	note: previously declared as a pointer ‘const uint32_t *’
	{aka ‘const unsigned int *’}
  764 | void port_flow_list(portid_t port_id, uint32_t n,
  				const uint32_t *group);
      |                         ~~~~~~~~~~~~~~~~^~~~~
Quoted 1 line

Verified with gcc version 11.0.0 20200920 (experimental).

Quoted 19 lines
---
 app/test-pmd/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/config.c +1 -2
index b6eb2a57a..380f3b5f6 100644
@@ -1774,7 +1774,7 @@ port_flow_aged(portid_t port_id, uint8_t destroy)
 
 /** List flow rules. */
 void
-port_flow_list(portid_t port_id, uint32_t n, const uint32_t group[n])
+port_flow_list(portid_t port_id, uint32_t n, const uint32_t *group)
 {
 	struct rte_port *port;
 	struct port_flow *pf;
--

2.26.2

Reviewed-by Reviewed-by Phil Yang Reviewed-by Asaf Penso on v1 3/4 Applied
#11 lore raw

Re: [dpdk-dev] [PATCH 3/4] app/testpmd: fix build with gcc 11

In reply to Ferruh Yigit
Quoted 16 lines · Ferruh Yigit

Error observed with gcc 11 under development
gcc (GCC) 11.0.0 20200920 (experimental)

../app/test-pmd/config.c:1777:61:
warning: argument 3 of type ‘const uint32_t[n]’ {aka ‘const unsigned int[n]’} declared as a variable length array [-Wvla-parameter]
1777 | port_flow_list(portid_t port_id, uint32_t n,
const uint32_t group[n])
| ~~~~~~~~~~~~~~~^~~~~~~~
In file included from ../app/test-pmd/config.c:53:
../app/test-pmd/testpmd.h:764:67:
note: previously declared as a pointer ‘const uint32_t *’ {aka ‘const unsigned int *’}
764 | void port_flow_list(portid_t port_id, uint32_t n,

Quoted 3 lines
                                const uint32_t *group);
      |                         ~~~~~~~~~~~~~~~~^~~~~
Fixes 938a184a1870 ("app/testpmd: implement basic support for flow API")
Quoted 1 line

Applied, thanks.

Signature · 1 line
David Marchand
#12 lore raw

PATCH 4/4 pmdinfogen: fix build with gcc 11

In reply to Ferruh Yigit

Error observed with gcc 11 under development
gcc (GCC) 11.0.0 20200920 (experimental)

build error:
In file included from ../buildtools/pmdinfogen/pmdinfogen.c:17:
../buildtools/pmdinfogen/pmdinfogen.c: In function ‘parse_elf’:
../buildtools/pmdinfogen/pmdinfogen.h:78:1:
warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]

   78 | else \
      | ^~~~
../buildtools/pmdinfogen/pmdinfogen.h:83:35:
	note: in expansion of macro ‘CONVERT_NATIVE’
   83 | #define TO_NATIVE(fend, width, x) CONVERT_NATIVE(fend, width, x)
      |                                   ^~~~~~~~~~~~~~
../buildtools/pmdinfogen/pmdinfogen.c:152:28:
	note: in expansion of macro ‘TO_NATIVE’
  152 |         hdr->e_type      = TO_NATIVE(endian, 16, hdr->e_type);
      |                            ^~~~~~~~~
../buildtools/pmdinfogen/pmdinfogen.h:80:9:
	note: ...this statement, but the latter is misleadingly indented
	as if it were guarded by the ‘else’
   80 |         ___x; \
      |         ^~~~
---
 buildtools/pmdinfogen/pmdinfogen.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
buildtools/pmdinfogen/pmdinfogen.h +1 -1
index 93930e454..38fd3ddcc 100644
@@ -77,7 +77,7 @@ if ((fend) == ELFDATA2LSB) \
 	___x = le##width##toh(x); \
 else \
 	___x = be##width##toh(x); \
-	___x; \
+___x; \
 })
 
 #define TO_NATIVE(fend, width, x) CONVERT_NATIVE(fend, width, x)
Signature · 1 line
2.26.2
Reviewed-by on v1 4/4
#13 lore raw

Re: [dpdk-dev] [PATCH 4/4] pmdinfogen: fix build with gcc 11

Quoted 10 lines · Ferruh Yigit

Error observed with gcc 11 under development
gcc (GCC) 11.0.0 20200920 (experimental)

build error:
In file included from ../buildtools/pmdinfogen/pmdinfogen.c:17:
../buildtools/pmdinfogen/pmdinfogen.c: In function ‘parse_elf’:
../buildtools/pmdinfogen/pmdinfogen.h:78:1:
warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]

Quoted 16 lines
   78 | else \
      | ^~~~
../buildtools/pmdinfogen/pmdinfogen.h:83:35:
        note: in expansion of macro ‘CONVERT_NATIVE’
   83 | #define TO_NATIVE(fend, width, x) CONVERT_NATIVE(fend, width, x)
      |                                   ^~~~~~~~~~~~~~
../buildtools/pmdinfogen/pmdinfogen.c:152:28:
        note: in expansion of macro ‘TO_NATIVE’
  152 |         hdr->e_type      = TO_NATIVE(endian, 16, hdr->e_type);
      |                            ^~~~~~~~~
../buildtools/pmdinfogen/pmdinfogen.h:80:9:
        note: ...this statement, but the latter is misleadingly indented
        as if it were guarded by the ‘else’
   80 |         ___x; \
      |         ^~~~
Fixes 98b0fdb0ffc6 ("pmdinfogen: add buildtools and pmdinfogen utility")
Quoted 19 lines
---
 buildtools/pmdinfogen/pmdinfogen.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
buildtools/pmdinfogen/pmdinfogen.h +1 -2
index 93930e454..38fd3ddcc 100644
@@ -77,7 +77,7 @@ if ((fend) == ELFDATA2LSB) \
        ___x = le##width##toh(x); \
 else \
        ___x = be##width##toh(x); \
-       ___x; \
+___x; \
 })
 
 #define TO_NATIVE(fend, width, x) CONVERT_NATIVE(fend, width, x)
--
Quoted 2 lines

2.26.2

Signature · 1 line
David Marchand
#14 lore raw

Re: [dpdk-dev] [PATCH 4/4] pmdinfogen: fix build with gcc 11

Quoted 29 lines · David Marchand
Quoted 10 lines · Ferruh Yigit

Error observed with gcc 11 under development
gcc (GCC) 11.0.0 20200920 (experimental)

build error:
In file included from ../buildtools/pmdinfogen/pmdinfogen.c:17:
../buildtools/pmdinfogen/pmdinfogen.c: In function ‘parse_elf’:
../buildtools/pmdinfogen/pmdinfogen.h:78:1:
warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]

Quoted 16 lines
   78 | else \
      | ^~~~
../buildtools/pmdinfogen/pmdinfogen.h:83:35:
        note: in expansion of macro ‘CONVERT_NATIVE’
   83 | #define TO_NATIVE(fend, width, x) CONVERT_NATIVE(fend, width, x)
      |                                   ^~~~~~~~~~~~~~
../buildtools/pmdinfogen/pmdinfogen.c:152:28:
        note: in expansion of macro ‘TO_NATIVE’
  152 |         hdr->e_type      = TO_NATIVE(endian, 16, hdr->e_type);
      |                            ^~~~~~~~~
../buildtools/pmdinfogen/pmdinfogen.h:80:9:
        note: ...this statement, but the latter is misleadingly indented
        as if it were guarded by the ‘else’
   80 |         ___x; \
      |         ^~~~
Quoted 5 lines
Fixes 98b0fdb0ffc6 ("pmdinfogen: add buildtools and pmdinfogen utility")
Quoted 1 line

Applied, thanks.

Signature · 1 line
David Marchand
#15 lore raw
In reply to Ferruh Yigit

Hi Ferruh,

Quoted 19 lines

From: Ferruh Yigit <[email protected]>
Sent: Monday, September 21, 2020 6:38 AM

Error observed with gcc 11 under development gcc (GCC) 11.0.0 20200920 (experimental)

build error:
../drivers/net/qede/qede_main.c: In function ‘qed_get_current_link’:
../drivers/net/qede/qede_main.c:587:17:
warning: this ‘if’ clause does not guard...
[-Wmisleading-indentation]

 587 |                 if (!ptt)
     |                 ^~
../drivers/net/qede/qede_main.c:590:25:
	note: ...this statement, but the latter is misleadingly indented
             as if it were guarded by the ‘if’
 590 |                         qed_fill_link(hwfn, ptt, if_link);
     |                         ^~~~~~~~~~~~~
Quoted 6 lines

---
I am not clear what the exact intention of the original code is, compiler warning is about wrong indentation of 'qed_fill_link(..)', I have updated the code to keep the behavior same but fix the indentation.
Please send a proper fix if the existing behavior needs to be updated.

The existing behavior needs to be fixed, I'll send a proper fix for 20.11.

Thanks!
-Rasesh

#16 lore raw
Quoted 19 lines · Rasesh Mody
Quoted 19 lines

From: Ferruh Yigit <[email protected]>
Sent: Monday, September 21, 2020 6:38 AM

Error observed with gcc 11 under development gcc (GCC) 11.0.0 20200920 (experimental)

build error:
../drivers/net/qede/qede_main.c: In function ‘qed_get_current_link’:
../drivers/net/qede/qede_main.c:587:17:
warning: this ‘if’ clause does not guard...
[-Wmisleading-indentation]

 587 |                 if (!ptt)
     |                 ^~
../drivers/net/qede/qede_main.c:590:25:
      note: ...this statement, but the latter is misleadingly indented
             as if it were guarded by the ‘if’
 590 |                         qed_fill_link(hwfn, ptt, if_link);
     |                         ^~~~~~~~~~~~~
Quoted 8 lines
Quoted 6 lines

---
I am not clear what the exact intention of the original code is, compiler warning is about wrong indentation of 'qed_fill_link(..)', I have updated the code to keep the behavior same but fix the indentation.
Please send a proper fix if the existing behavior needs to be updated.

The existing behavior needs to be fixed, I'll send a proper fix for 20.11.

I suppose this is fixed with:
https://patchwork.dpdk.org/patch/79562/

I'll mark Ferruh patch as rejected.

Signature · 1 line
David Marchand