All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	edumazet@google.com, pabeni@redhat.com, andrew+netdev@lunn.ch,
	Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH net-next v3] selftests: net: csum: filter packets by source address and port
Date: Wed, 9 Sep 2026 17:57:01 +0100	[thread overview]
Message-ID: <20260909165701.GK40544@horms.kernel.org> (raw)
In-Reply-To: <20260908155537.813889-1-willemdebruijn.kernel@gmail.com>

On Tue, Sep 08, 2026 at 11:54:29AM -0400, Willem de Bruijn wrote:
> From: Willem de Bruijn <willemb@google.com>
> 
> Add source address and port verification in recv_verify_packet_* and
> recv_udp: non-matching packets are skipped.
> 
> The receiver reads from PF_PACKET and UDP sockets to verify incoming
> packets to test hardware checksum offload. It did not validate the
> packet source address or source port.
> 
> During tests expecting an invalid checksum (-E) or zero checksum (-Z),
> background packets can fail the test.
> 
> For -Z, build_packet_udp chooses a specific source port that causes
> the checksum to sum to zero. When running in receive-only mode (-R),
> call build_packet in do_rx to compute the expected source port so
> that source port filtering can be applied to -Z as well.
> 
> Also
> - add an inter-packet delay to avoid drops from bursts.
> - remove a comment that is no longer correct.
> 
> Fixes: 91a7de85600d ("selftests/net: add csum offload test")
> Signed-off-by: Willem de Bruijn <willemb@google.com>
> 
> ---
> 
> Changes
>   v2 -> v3
>     - also fix same issue for zero checksum:
>       calculate expected src_port by calling build_packet on rx side
>   v1 -> v2
>     - also check udp socket, with recvfrom
> 
> v2: https://lore.kernel.org/netdev/20260904030624.3833721-1-willemdebruijn.kernel@gmail.com/
> v1: https://lore.kernel.org/netdev/20260831210128.1359978-1-willemdebruijn.kernel@gmail.com/

Reviewed-by: Simon Horman <horms@kernel.org>


  reply	other threads:[~2026-09-09 16:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 15:54 [PATCH net-next v3] selftests: net: csum: filter packets by source address and port Willem de Bruijn
2026-09-09 16:57 ` Simon Horman [this message]
2026-09-09 20:20 ` 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=20260909165701.GK40544@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@google.com \
    --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 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.