netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	edumazet@google.com
Subject: Re: [PATCH net-next] selftests/net: add csum offload test
Date: Tue, 29 Nov 2022 19:08:27 +0100	[thread overview]
Message-ID: <e80ea4e8f42c2113af358b971610f7341eb7494b.camel@redhat.com> (raw)
In-Reply-To: <CA+FuTScsg6b8wKc4Sz=z+M53nWaxOZh4J+A=JooJspDjysXg6Q@mail.gmail.com>

On Mon, 2022-11-28 at 11:14 -0500, Willem de Bruijn wrote:
> On Mon, Nov 28, 2022 at 11:08 AM Paolo Abeni <pabeni@redhat.com> wrote:
> > On Mon, 2022-11-28 at 09:02 -0500, Willem de Bruijn wrote:
> > > From: Willem de Bruijn <willemb@google.com>
> > > 
> > > Test NIC hardware checksum offload:
> > > 
> > > - Rx + Tx
> > > - IPv4 + IPv6
> > > - TCP + UDP
> > > 
> > > Optional features:
> > > 
> > > - zero checksum 0xFFFF
> > > - checksum disable 0x0000
> > > - transport encap headers
> > > - randomization
> > > 
> > > See file header for detailed comments.
> > > 
> > > Expected results differ depending on NIC features:
> > > 
> > > - CHECKSUM_UNNECESSARY vs CHECKSUM_COMPLETE
> > > - NETIF_F_HW_CSUM (csum_start/csum_off) vs NETIF_F_IP(V6)_CSUM
> > > 
> > > Signed-off-by: Willem de Bruijn <willemb@google.com>
> > 
> > I'm wondering if we could hook this into the self-tests list with a
> > suitable wrapper script, e.g. searching for a NIC exposing the loopback
> > feature, quering the NETIF_F_HW_CSUM/NETIF_F_IP(V6)_CSUM bit via
> > ethtool and guessing CHECKSUM_UNNECESSARY vs CHECKSUM_COMPLETE via the
> > received packet.
> > 
> > If the host lacks a suitable device, the test is skipped. WDYT?
> 
> We could. Optionally with ipvlan and two netns to really emulate a two
> host setup.
> 
> I'm hesitant to include this into kselftests without warning though.
> Have too often had to debug tests that crashed and left a machine
> unreachable, because in loopback mode.

I see your point. The forwarding/loopback.sh test does nothing by
default without additional command line arguments, something similar
could work here, too.

I think it would still be valuable, because it will simplify automating
this kind of testing - compared to guessing the needed setup from the
binary alone. 

> Either way, something to do as a separate follow-up patch?

Fine by me. 

Thanks,

Paolo




  reply	other threads:[~2022-11-29 18:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 14:02 [PATCH net-next] selftests/net: add csum offload test Willem de Bruijn
2022-11-28 16:08 ` Paolo Abeni
2022-11-28 16:14   ` Willem de Bruijn
2022-11-29 18:08     ` Paolo Abeni [this message]
2022-11-30  5:30 ` patchwork-bot+netdevbpf

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=e80ea4e8f42c2113af358b971610f7341eb7494b.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=willemdebruijn.kernel@gmail.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 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).