From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Qingfang Deng <dqfext@gmail.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>,
Simon Horman <horms@kernel.org>,
Willem de Bruijn <willemb@google.com>,
Petr Machata <petrm@nvidia.com>,
Richard Gobert <richardbgobert@gmail.com>,
Anubhav Singh <anubhavsinggh@google.com>,
Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>,
netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: linux-ppp@vger.kernel.org
Subject: Re: [RFC PATCH net-next v6 2/2] selftests: net: test PPPoE packets in gro.sh
Date: Thu, 26 Mar 2026 12:29:07 -0400 [thread overview]
Message-ID: <willemdebruijn.kernel.29bf4e0691478@gmail.com> (raw)
In-Reply-To: <20260326081127.61229-2-dqfext@gmail.com>
Qingfang Deng wrote:
> Add PPPoE test-cases to the GRO selftest.
>
> Signed-off-by: Qingfang Deng <dqfext@gmail.com>
> ---
> v6: new patch
>
> I'm not sure if I should include all the existing IPv4/v6 tests for
> PPPoE. There are tests that hardcode ETH_HLEN as the NH offset, which
> are meant to test the L3 protocol, not the underlying protocol, and
> changing all of them seems too invasive.
Overall this change looks good to me. But indeed all the churn of
(pppoe ? PPPOE_SES_HLEN : 0)
is a bit annoying. Left a few representative snippets below.
I think that could be avoided similar to MAX_HDR_LEN by having a
global definition and using that everywhere. Still a lot of churn, but
at least no repeated open-coded logic.
Also consider whether running all these tests again in PPPoE adds
value, if not, then indeed trim the tests to those that truly add
code coverage.
> @@ -745,7 +777,7 @@ static void add_ipv4_ts_option(void *buf, void *optpkt)
> memcpy(optpkt + tcp_offset + optlen, buf + tcp_offset,
> sizeof(struct tcphdr) + PAYLOAD_LEN);
>
> - iph = (struct iphdr *)(optpkt + ETH_HLEN);
> + iph = (struct iphdr *)(optpkt + ETH_HLEN + (pppoe ? PPPOE_SES_HLEN : 0));
> iph->ihl = 5 + (optlen / 4);
> iph->tot_len = htons(ntohs(iph->tot_len) + optlen);
> iph->check = 0;
> @@ -755,7 +787,7 @@ static void add_ipv4_ts_option(void *buf, void *optpkt)
> static void add_ipv6_exthdr(void *buf, void *optpkt, __u8 exthdr_type, char *ext_payload)
> {
> struct ipv6_opt_hdr *exthdr = (struct ipv6_opt_hdr *)(optpkt + tcp_offset);
> - struct ipv6hdr *iph = (struct ipv6hdr *)(optpkt + ETH_HLEN);
> + struct ipv6hdr *iph = (struct ipv6hdr *)(optpkt + ETH_HLEN + (pppoe ? PPPOE_SES_HLEN : 0));
> char *exthdr_payload_start = (char *)(exthdr + 1);
>
> exthdr->hdrlen = 0;
next prev parent reply other threads:[~2026-03-26 16:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 8:11 [RFC PATCH net-next v6 1/2] net: pppoe: implement GRO/GSO support Qingfang Deng
2026-03-26 8:11 ` [RFC PATCH net-next v6 2/2] selftests: net: test PPPoE packets in gro.sh Qingfang Deng
2026-03-26 16:29 ` Willem de Bruijn [this message]
2026-04-30 9:34 ` [RFC PATCH net-next v6 1/2] net: pppoe: implement GRO/GSO support Paolo Abeni
2026-04-30 15:47 ` Qingfang Deng
2026-04-30 15:57 ` Pablo Neira Ayuso
2026-04-30 16:22 ` Paolo Abeni
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=willemdebruijn.kernel.29bf4e0691478@gmail.com \
--to=willemdebruijn.kernel@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=anubhavsinggh@google.com \
--cc=chia-yu.chang@nokia-bell-labs.com \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-ppp@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=richardbgobert@gmail.com \
--cc=shuah@kernel.org \
--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.