All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org,
	Maxime Chevallier <maxime.chevallier@bootlin.com>
Subject: Re: [PATCH net-next v4 3/4] net: selftests: add checksum mode support and SW checksum handling
Date: Fri, 16 May 2025 18:48:49 -0700	[thread overview]
Message-ID: <20250516184849.27d795c1@kernel.org> (raw)
In-Reply-To: <20250515083100.2653102-4-o.rempel@pengutronix.de>

On Thu, 15 May 2025 10:30:59 +0200 Oleksij Rempel wrote:
> +enum net_test_checksum_mode {
> +	NET_TEST_CHECKSUM_COMPLETE,

Why COMPLETE? that means skb has checksum of the complete data.
If packet requires no checksumming you should probably use CHECKSUM_NONE

> +	switch (iph->protocol) {
> +	case IPPROTO_TCP:
> +		if (!pskb_may_pull(skb,
> +				   transport_offset + sizeof(struct tcphdr)))

Why are you so diligently checking if you can pull for the SW sum but
not for the HW sum? Both of them update the same header fields :)

> +static int net_test_setup_hw_csum(struct sk_buff *skb, struct iphdr *iph)
> +{
> +	u16 csum_offset;
> +
> +	skb->ip_summed = CHECKSUM_PARTIAL;
> +	skb->csum = 0;
> +
> +	switch (iph->protocol) {
> +	case IPPROTO_TCP:
> +		if (!tcp_hdr(skb))
> +			return -EINVAL;
> +		tcp_hdr(skb)->check = 0;

this filed should be filled with pseudo header checksum for HW offload,
not with 0, like the existing code did
-- 
pw-bot: cr

  parent reply	other threads:[~2025-05-17  1:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-15  8:30 [PATCH net-next v4 0/4] net: selftest: improve test string formatting and checksum handling Oleksij Rempel
2025-05-15  8:30 ` [PATCH net-next v4 1/4] net: selftests: drop test index from net_selftest_get_strings() Oleksij Rempel
2025-05-15  8:30 ` [PATCH net-next v4 2/4] net: selftests: prepare for detailed error handling in net_test_get_skb() Oleksij Rempel
2025-05-15  8:30 ` [PATCH net-next v4 3/4] net: selftests: add checksum mode support and SW checksum handling Oleksij Rempel
2025-05-16 12:57   ` Simon Horman
2025-05-17  1:48   ` Jakub Kicinski [this message]
2025-05-15  8:31 ` [PATCH net-next v4 4/4] net: selftests: add PHY loopback tests with HW checksum offload Oleksij Rempel
2025-05-17  1:45 ` [PATCH net-next v4 0/4] net: selftest: improve test string formatting and checksum handling Jakub Kicinski
2025-06-20 10:53   ` Oleksij Rempel
2025-06-21 13:46     ` Jakub Kicinski
2025-06-23 11:45       ` Oleksij Rempel
2025-06-23 17:19         ` Jakub Kicinski
2025-06-24  8:26           ` Oleksij Rempel
2025-06-24 16:09             ` Jakub Kicinski
2025-06-25  5:07               ` Oleksij Rempel
2025-06-25 20:21                 ` Jakub Kicinski
2025-07-11  8:42               ` Marc Kleine-Budde
2025-07-11 22:36                 ` Jakub Kicinski

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=20250516184849.27d795c1@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.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.