mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Aldo Ariel <qwe.aldo@gmail.com>
Cc: wei.fang@nxp.com, frank.li@nxp.com, shenwei.wang@nxp.com,
	imx@lists.linux.dev, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Sashiko <sashiko-bot@kernel.org>
Subject: Re: [PATCH net v2] net: fec: reject oversized fragments before bounce-buffer memcpy
Date: Thu, 24 Sep 2026 14:40:50 +0200	[thread overview]
Message-ID: <a230cd62-db31-4128-acfa-93501d30aa39@lunn.ch> (raw)
In-Reply-To: <CAP48Hfto4qc285B3Jw7ZRuC-wGf57JOBPZOdrrAt-aDfGcas8Q@mail.gmail.com>

On Wed, Sep 23, 2026 at 06:22:01PM -0300, Aldo Ariel wrote:
> Hi Andrew,
> 
> PKT_MAXBUF_SIZE = round_down(2048 - 64, 64) = 1984
> max_mtu (non-jumbo) = 1984 - VLAN_ETH_HLEN - ETH_FCS_LEN = 1962
> 
> So for standard MTU, max_mtu < FEC_ENET_TX_FRSIZE and individual
> fragments should not exceed the bounce buffer.
> 
> However, when the device supports jumbo frames,
> max_buf_size = MAX_JUMBO_BUF_SIZE (~16256) and max_mtu reaches ~16234.
> Scatter-gather fragments in that case can exceed FEC_ENET_TX_FRSIZE
> while still needing the bounce path for alignment or byte-swap.
> 
> Should I respin with a check only for the jumbo path, or is the
> unconditional guard acceptable?

Can bounce buffers and jumbo be used at the same time?

How is the scatter-gather size determined? Maybe the better fix is to
set the fragment size based on the size of the bounce buffer when it
is in use?

	Andrew

  parent reply	other threads:[~2026-09-24 12:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23 20:37 Aldo Ariel Panzardo
2026-09-23 21:00 ` Andrew Lunn
     [not found]   ` <CAP48Hfto4qc285B3Jw7ZRuC-wGf57JOBPZOdrrAt-aDfGcas8Q@mail.gmail.com>
2026-09-24 12:40     ` Andrew Lunn [this message]
2026-09-24 15:24       ` Shenwei Wang
2026-09-24  2:15 ` Wei Fang

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=a230cd62-db31-4128-acfa-93501d30aa39@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=frank.li@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=qwe.aldo@gmail.com \
    --cc=sashiko-bot@kernel.org \
    --cc=shenwei.wang@nxp.com \
    --cc=stable@vger.kernel.org \
    --cc=wei.fang@nxp.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

all inboxes | Powered by JetHome®