netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cyril Strejc <cyril.strejc@skoda.cz>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Network Development <netdev@vger.kernel.org>
Subject: Re: [PATCH] net: multicast: calculate csum of looped-back and forwarded packets
Date: Sun, 24 Oct 2021 15:38:40 +0200	[thread overview]
Message-ID: <20211024133807.GA1112319@trnn1532h> (raw)
In-Reply-To: <CAF=yD-K_-i1wCaRg4VqocMqL9m7OrcCy3AXVn4d8k7yXg6yz5g@mail.gmail.com>

On 2021-10-23T22:41:06-0400, Willem de Bruijn wrote:
> >
> > Alternatively, we could solve the CHECKSUM_NONE case by a simple,
> > practical and historical compatible "TX->RX translation" of ip_summed
> > in dev_loopback_xmit(), which keeps CHECKSUM_PARTIAL and leaves
> > __skb_checksum_validate_needed() as is:
> >
> >         if (skb->ip_summed == CHECKSUM_NONE)
> >                 skb->ip_summed = CHECKSUM_UNNECESSARY;
> >
> > or:
> >         if (skb->ip_summed != CHECKSUM_PARTIAL)
> >                 skb->ip_summed = CHECKSUM_UNNECESSARY;
> 
> Based on the idea that these packets are fully checksummed, so even if
> they loop to the tx path again with ip_summed CHECKSUM_UNNECESSARY,
> they will not cause the bug that you originally reported?
> 

It won't cause the bug. The original bug is caused solely by
CHECKSUM_PARTIAL being unconditionally translated to
CHECKSUM_UNNECESSARY in dev_loopback_xmit(). Adding the condition to
keep CHECKSUM_PARTIAL solves the issue.

> Yes, that looks like a nice solution.

I will double-check and send PATCH v2 to this e-mail thread.


  reply	other threads:[~2021-10-24 13:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 11:44 [PATCH] net: multicast: calculate csum of looped-back and forwarded packets Cyril Strejc
2021-10-22 19:07 ` Willem de Bruijn
2021-10-23 23:26   ` Cyril Strejc
2021-10-24  2:41     ` Willem de Bruijn
2021-10-24 13:38       ` Cyril Strejc [this message]
2021-10-24 20:14 ` [PATCH v2] " Cyril Strejc
2021-10-25 14:31   ` Willem de Bruijn
2021-10-26 12:10   ` 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=20211024133807.GA1112319@trnn1532h \
    --to=cyril.strejc@skoda.cz \
    --cc=davem@davemloft.net \
    --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).