public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@linux.dev>
To: Eric Dumazet <edumazet@google.com>
Cc: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, Michal Simek <michal.simek@amd.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] net: xilinx: axienet: Relax partial rx checksum checks
Date: Thu, 5 Sep 2024 10:24:23 -0400	[thread overview]
Message-ID: <156719f8-7ee8-4c81-97ba-5f87afb44fcf@linux.dev> (raw)
In-Reply-To: <CANn89iKJiU0DirRbpnMTPe0w_PZn9rf1_5=mAxhi3zbcoJR49A@mail.gmail.com>

On 9/4/24 12:30, Eric Dumazet wrote:
> On Tue, Sep 3, 2024 at 8:43 PM Sean Anderson <sean.anderson@linux.dev> wrote:
>>
>> The partial rx checksum feature computes a checksum over the entire
>> packet, regardless of the L3 protocol. Remove the check for IPv4.
>> Additionally, packets under 64 bytes should have been dropped by the
>> MAC, so we can remove the length check as well.
> 
> Some packets have a smaller len (than 64).
> 
> For instance, TCP pure ACK and no options over IPv4 would be 54 bytes long.
> 
> Presumably they are not dropped by the MAC ?

Ethernet frames have a minimum size on the wire of 64 bytes. From 802.3
section 4.2.4.2.2:

| The shortest valid transmission in full duplex mode must be at least
| minFrameSize in length. While collisions do not occur in full duplex
| mode MACs, a full duplex MAC nevertheless discards received frames
| containing less than minFrameSize bits. The discarding of such a frame
| by a MAC is not reported as an error.

where minFrameSize is 512 bits (64 bytes).

On the transmit side, undersize frames are padded. From 802.3 section
4.2.3.3:

| The CSMA/CD Media Access mechanism requires that a minimum frame
| length of minFrameSize bits be transmitted. If frameSize is less than
| minFrameSize, then the CSMA/CD MAC sublayer shall append extra bits in
| units of octets (Pad), after the end of the MAC Client Data field but
| prior to calculating and appending the FCS (if not provided by the MAC
| client).

That said, I could not find any mention of a minimum frame size
limitation for partial checksums in the AXI Ethernet documentation.
RX_CSRAW is calculated over the whole packet, so it's possible that this
check is trying to avoid passing it to the net subsystem when the frame
has been padded. However, skb->len is the length of the Ethernet packet,
so we can't tell how long the original packet was at this point. That
can only be determined from the L3 header, which isn't parsed yet. I
assume this is handled by the net subsystem.

--Sean

  reply	other threads:[~2024-09-05 14:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 18:43 [PATCH 0/3] net: xilinx: axienet: Partial checksum offload improvements Sean Anderson
2024-09-03 18:43 ` [PATCH 1/3] net: xilinx: axienet: Remove unused checksum variables Sean Anderson
2024-09-04 16:19   ` Simon Horman
2024-09-04 17:03   ` Pandey, Radhey Shyam
2024-09-05 14:09     ` Sean Anderson
2024-09-03 18:43 ` [PATCH 2/3] net: xilinx: axienet: Enable NETIF_F_HW_CSUM for partial tx checksumming Sean Anderson
2024-09-04 16:20   ` Simon Horman
2024-09-03 18:43 ` [PATCH 3/3] net: xilinx: axienet: Relax partial rx checksum checks Sean Anderson
2024-09-04 16:20   ` Simon Horman
2024-09-04 16:30   ` Eric Dumazet
2024-09-05 14:24     ` Sean Anderson [this message]
2024-09-05 14:59       ` Eric Dumazet
2024-09-05 16:32         ` Sean Anderson
2024-09-06 21:37           ` Sean Anderson
2024-09-03 18:48 ` [PATCH 0/3] net: xilinx: axienet: Partial checksum offload improvements Sean Anderson

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=156719f8-7ee8-4c81-97ba-5f87afb44fcf@linux.dev \
    --to=sean.anderson@linux.dev \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=radhey.shyam.pandey@amd.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