* [PATCH net-next] net: gso_test: fix build with gcc-12 and earlier
@ 2023-10-12 12:08 Florian Westphal
2023-10-12 12:15 ` Willem de Bruijn
2023-10-12 13:40 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Florian Westphal @ 2023-10-12 12:08 UTC (permalink / raw)
To: netdev; +Cc: Florian Westphal, Willem de Bruijn, Tasmiya Nalatwad
gcc 12 errors out with:
net/core/gso_test.c:58:48: error: initializer element is not constant
58 | .segs = (const unsigned int[]) { gso_size },
This version isn't old (2022), so switch to preprocessor-bsaed constant
instead of 'static const int'.
Cc: Willem de Bruijn <willemb@google.com>
Reported-by: Tasmiya Nalatwad <tasmiya@linux.vnet.ibm.com>
Closes: https://lore.kernel.org/netdev/79fbe35c-4dd1-4f27-acb2-7a60794bc348@linux.vnet.ibm.com/
Fixes: 1b4fa28a8b07 ("net: parametrize skb_segment unit test to expand coverage")
Signed-off-by: Florian Westphal <fw@strlen.de>
---
net/core/gso_test.c | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/net/core/gso_test.c b/net/core/gso_test.c
index c1a6cffb6f96..c4b13de6abfb 100644
--- a/net/core/gso_test.c
+++ b/net/core/gso_test.c
@@ -4,7 +4,7 @@
#include <linux/skbuff.h>
static const char hdr[] = "abcdefgh";
-static const int gso_size = 1000;
+#define GSO_TEST_SIZE 1000
static void __init_skb(struct sk_buff *skb)
{
@@ -18,7 +18,7 @@ static void __init_skb(struct sk_buff *skb)
/* proto is arbitrary, as long as not ETH_P_TEB or vlan */
skb->protocol = htons(ETH_P_ATALK);
- skb_shinfo(skb)->gso_size = gso_size;
+ skb_shinfo(skb)->gso_size = GSO_TEST_SIZE;
}
enum gso_test_nr {
@@ -53,70 +53,70 @@ static struct gso_test_case cases[] = {
{
.id = GSO_TEST_NO_GSO,
.name = "no_gso",
- .linear_len = gso_size,
+ .linear_len = GSO_TEST_SIZE,
.nr_segs = 1,
- .segs = (const unsigned int[]) { gso_size },
+ .segs = (const unsigned int[]) { GSO_TEST_SIZE },
},
{
.id = GSO_TEST_LINEAR,
.name = "linear",
- .linear_len = gso_size + gso_size + 1,
+ .linear_len = GSO_TEST_SIZE + GSO_TEST_SIZE + 1,
.nr_segs = 3,
- .segs = (const unsigned int[]) { gso_size, gso_size, 1 },
+ .segs = (const unsigned int[]) { GSO_TEST_SIZE, GSO_TEST_SIZE, 1 },
},
{
.id = GSO_TEST_FRAGS,
.name = "frags",
- .linear_len = gso_size,
+ .linear_len = GSO_TEST_SIZE,
.nr_frags = 2,
- .frags = (const unsigned int[]) { gso_size, 1 },
+ .frags = (const unsigned int[]) { GSO_TEST_SIZE, 1 },
.nr_segs = 3,
- .segs = (const unsigned int[]) { gso_size, gso_size, 1 },
+ .segs = (const unsigned int[]) { GSO_TEST_SIZE, GSO_TEST_SIZE, 1 },
},
{
.id = GSO_TEST_FRAGS_PURE,
.name = "frags_pure",
.nr_frags = 3,
- .frags = (const unsigned int[]) { gso_size, gso_size, 2 },
+ .frags = (const unsigned int[]) { GSO_TEST_SIZE, GSO_TEST_SIZE, 2 },
.nr_segs = 3,
- .segs = (const unsigned int[]) { gso_size, gso_size, 2 },
+ .segs = (const unsigned int[]) { GSO_TEST_SIZE, GSO_TEST_SIZE, 2 },
},
{
.id = GSO_TEST_GSO_PARTIAL,
.name = "gso_partial",
- .linear_len = gso_size,
+ .linear_len = GSO_TEST_SIZE,
.nr_frags = 2,
- .frags = (const unsigned int[]) { gso_size, 3 },
+ .frags = (const unsigned int[]) { GSO_TEST_SIZE, 3 },
.nr_segs = 2,
- .segs = (const unsigned int[]) { 2 * gso_size, 3 },
+ .segs = (const unsigned int[]) { 2 * GSO_TEST_SIZE, 3 },
},
{
/* commit 89319d3801d1: frag_list on mss boundaries */
.id = GSO_TEST_FRAG_LIST,
.name = "frag_list",
- .linear_len = gso_size,
+ .linear_len = GSO_TEST_SIZE,
.nr_frag_skbs = 2,
- .frag_skbs = (const unsigned int[]) { gso_size, gso_size },
+ .frag_skbs = (const unsigned int[]) { GSO_TEST_SIZE, GSO_TEST_SIZE },
.nr_segs = 3,
- .segs = (const unsigned int[]) { gso_size, gso_size, gso_size },
+ .segs = (const unsigned int[]) { GSO_TEST_SIZE, GSO_TEST_SIZE, GSO_TEST_SIZE },
},
{
.id = GSO_TEST_FRAG_LIST_PURE,
.name = "frag_list_pure",
.nr_frag_skbs = 2,
- .frag_skbs = (const unsigned int[]) { gso_size, gso_size },
+ .frag_skbs = (const unsigned int[]) { GSO_TEST_SIZE, GSO_TEST_SIZE },
.nr_segs = 2,
- .segs = (const unsigned int[]) { gso_size, gso_size },
+ .segs = (const unsigned int[]) { GSO_TEST_SIZE, GSO_TEST_SIZE },
},
{
/* commit 43170c4e0ba7: GRO of frag_list trains */
.id = GSO_TEST_FRAG_LIST_NON_UNIFORM,
.name = "frag_list_non_uniform",
- .linear_len = gso_size,
+ .linear_len = GSO_TEST_SIZE,
.nr_frag_skbs = 4,
- .frag_skbs = (const unsigned int[]) { gso_size, 1, gso_size, 2 },
+ .frag_skbs = (const unsigned int[]) { GSO_TEST_SIZE, 1, GSO_TEST_SIZE, 2 },
.nr_segs = 4,
- .segs = (const unsigned int[]) { gso_size, gso_size, gso_size, 3 },
+ .segs = (const unsigned int[]) { GSO_TEST_SIZE, GSO_TEST_SIZE, GSO_TEST_SIZE, 3 },
},
{
/* commit 3953c46c3ac7 ("sk_buff: allow segmenting based on frag sizes") and
--
2.41.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: gso_test: fix build with gcc-12 and earlier
2023-10-12 12:08 [PATCH net-next] net: gso_test: fix build with gcc-12 and earlier Florian Westphal
@ 2023-10-12 12:15 ` Willem de Bruijn
2023-10-12 13:32 ` Paolo Abeni
2023-10-12 13:40 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Willem de Bruijn @ 2023-10-12 12:15 UTC (permalink / raw)
To: Florian Westphal; +Cc: netdev, Willem de Bruijn, Tasmiya Nalatwad
On Thu, Oct 12, 2023 at 8:09 AM Florian Westphal <fw@strlen.de> wrote:
>
> gcc 12 errors out with:
> net/core/gso_test.c:58:48: error: initializer element is not constant
> 58 | .segs = (const unsigned int[]) { gso_size },
>
> This version isn't old (2022), so switch to preprocessor-bsaed constant
> instead of 'static const int'.
>
> Cc: Willem de Bruijn <willemb@google.com>
> Reported-by: Tasmiya Nalatwad <tasmiya@linux.vnet.ibm.com>
> Closes: https://lore.kernel.org/netdev/79fbe35c-4dd1-4f27-acb2-7a60794bc348@linux.vnet.ibm.com/
> Fixes: 1b4fa28a8b07 ("net: parametrize skb_segment unit test to expand coverage")
> Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Thanks for the fix, Florian!
Note to self to not only rely on my default compiler.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: gso_test: fix build with gcc-12 and earlier
2023-10-12 12:15 ` Willem de Bruijn
@ 2023-10-12 13:32 ` Paolo Abeni
0 siblings, 0 replies; 4+ messages in thread
From: Paolo Abeni @ 2023-10-12 13:32 UTC (permalink / raw)
To: Willem de Bruijn, Florian Westphal
Cc: netdev, Willem de Bruijn, Tasmiya Nalatwad
On Thu, 2023-10-12 at 08:15 -0400, Willem de Bruijn wrote:
> On Thu, Oct 12, 2023 at 8:09 AM Florian Westphal <fw@strlen.de> wrote:
> >
> > gcc 12 errors out with:
> > net/core/gso_test.c:58:48: error: initializer element is not constant
> > 58 | .segs = (const unsigned int[]) { gso_size },
> >
> > This version isn't old (2022), so switch to preprocessor-bsaed constant
> > instead of 'static const int'.
> >
> > Cc: Willem de Bruijn <willemb@google.com>
> > Reported-by: Tasmiya Nalatwad <tasmiya@linux.vnet.ibm.com>
> > Closes: https://lore.kernel.org/netdev/79fbe35c-4dd1-4f27-acb2-7a60794bc348@linux.vnet.ibm.com/
> > Fixes: 1b4fa28a8b07 ("net: parametrize skb_segment unit test to expand coverage")
> > Signed-off-by: Florian Westphal <fw@strlen.de>
>
> Reviewed-by: Willem de Bruijn <willemb@google.com>
>
> Thanks for the fix, Florian!
>
> Note to self to not only rely on my default compiler.
Unless someone barks very loudly in the next 5', I'm going to
exceptionally apply this one well before the 24h grace period, for
obvious reasons.
Cheers,
Paolo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: gso_test: fix build with gcc-12 and earlier
2023-10-12 12:08 [PATCH net-next] net: gso_test: fix build with gcc-12 and earlier Florian Westphal
2023-10-12 12:15 ` Willem de Bruijn
@ 2023-10-12 13:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-12 13:40 UTC (permalink / raw)
To: Florian Westphal; +Cc: netdev, willemb, tasmiya
Hello:
This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Thu, 12 Oct 2023 14:08:56 +0200 you wrote:
> gcc 12 errors out with:
> net/core/gso_test.c:58:48: error: initializer element is not constant
> 58 | .segs = (const unsigned int[]) { gso_size },
>
> This version isn't old (2022), so switch to preprocessor-bsaed constant
> instead of 'static const int'.
>
> [...]
Here is the summary with links:
- [net-next] net: gso_test: fix build with gcc-12 and earlier
https://git.kernel.org/netdev/net-next/c/2f0968a030f2
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-12 13:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-12 12:08 [PATCH net-next] net: gso_test: fix build with gcc-12 and earlier Florian Westphal
2023-10-12 12:15 ` Willem de Bruijn
2023-10-12 13:32 ` Paolo Abeni
2023-10-12 13:40 ` patchwork-bot+netdevbpf
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).