From: Florian Westphal <fw@strlen.de>
To: Tasmiya Nalatwad <tasmiya@linux.vnet.ibm.com>
Cc: willemb@google.com, netdev@vger.kernel.org, fw@strlen.de,
linux-kernel@vger.kernel.org, sachinp@linux.vnet.com,
abdhalee@linux.vnet.ibm.com, edumazet@google.com,
mputtash@linux.vnet.com, kuba@kernel.org,
linuxppc-dev@lists.ozlabs.org, davem@davemloft.net
Subject: Re: [Bisected] [1b4fa28a8b07] Build failure "net/core/gso_test.c"
Date: Thu, 12 Oct 2023 11:57:46 +0200 [thread overview]
Message-ID: <20231012095746.GA26871@breakpoint.cc> (raw)
In-Reply-To: <79fbe35c-4dd1-4f27-acb2-7a60794bc348@linux.vnet.ibm.com>
Tasmiya Nalatwad <tasmiya@linux.vnet.ibm.com> wrote:
> Greetings,
>
> [net-next] [6.6-rc4] Build failure "net/core/gso_test.c"
>
> --- Traces ---
>
> make -j 33 -s && make modules_install && make install
> net/core/gso_test.c:58:48: error: initializer element is not constant
> 58 | .segs = (const unsigned int[]) { gso_size },
> | ^
Ouch, I can reproduce this with: gcc --version
gcc (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
gcc 13.2.1 and clang-16.0.6 are ok.
Whats the preference here? We could use simple preprocessor constant
or we could require much more recent compiler version for the net
kunit tests via kconfig.
gcc-12.2.0 can compile it after this simple s//g "fix":
diff --git a/net/core/gso_test.c b/net/core/gso_test.c
--- 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
WARNING: multiple messages have this Message-ID (diff)
From: Florian Westphal <fw@strlen.de>
To: Tasmiya Nalatwad <tasmiya@linux.vnet.ibm.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, willemb@google.com, fw@strlen.de,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
abdhalee@linux.vnet.ibm.com, sachinp@linux.vnet.com,
mputtash@linux.vnet.com
Subject: Re: [Bisected] [1b4fa28a8b07] Build failure "net/core/gso_test.c"
Date: Thu, 12 Oct 2023 11:57:46 +0200 [thread overview]
Message-ID: <20231012095746.GA26871@breakpoint.cc> (raw)
In-Reply-To: <79fbe35c-4dd1-4f27-acb2-7a60794bc348@linux.vnet.ibm.com>
Tasmiya Nalatwad <tasmiya@linux.vnet.ibm.com> wrote:
> Greetings,
>
> [net-next] [6.6-rc4] Build failure "net/core/gso_test.c"
>
> --- Traces ---
>
> make -j 33 -s && make modules_install && make install
> net/core/gso_test.c:58:48: error: initializer element is not constant
> 58 | .segs = (const unsigned int[]) { gso_size },
> | ^
Ouch, I can reproduce this with: gcc --version
gcc (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
gcc 13.2.1 and clang-16.0.6 are ok.
Whats the preference here? We could use simple preprocessor constant
or we could require much more recent compiler version for the net
kunit tests via kconfig.
gcc-12.2.0 can compile it after this simple s//g "fix":
diff --git a/net/core/gso_test.c b/net/core/gso_test.c
--- 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
next prev parent reply other threads:[~2023-10-12 10:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-12 7:37 [Bisected] [1b4fa28a8b07] Build failure "net/core/gso_test.c" Tasmiya Nalatwad
2023-10-12 7:37 ` Tasmiya Nalatwad
2023-10-12 9:57 ` Florian Westphal [this message]
2023-10-12 9:57 ` Florian Westphal
2023-10-12 12:01 ` Tasmiya Nalatwad
2023-10-12 12:01 ` Tasmiya Nalatwad
2023-10-12 16:29 ` Kees Cook
2023-10-12 16:29 ` Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231012095746.GA26871@breakpoint.cc \
--to=fw@strlen.de \
--cc=abdhalee@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mputtash@linux.vnet.com \
--cc=netdev@vger.kernel.org \
--cc=sachinp@linux.vnet.com \
--cc=tasmiya@linux.vnet.ibm.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.