Netdev List
 help / color / mirror / Atom feed
From: Justin Chen <justin.chen@broadcom.com>
To: Florian Fainelli <florian.fainelli@broadcom.com>, netdev@vger.kernel.org
Cc: Doug Berger <opendmb@gmail.com>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Zak Kemble <zakkemble@gmail.com>, Simon Horman <horms@kernel.org>,
	Ryo Takakura <ryotkkr98@gmail.com>,
	open list <linux-kernel@vger.kernel.org>,
	Nicolai Buchwitz <nb@tipi-net.de>
Subject: Re: [PATCH net v2 5/6] net: bcmasp: account for offload header in TX short packet padding
Date: Fri, 9 Oct 2026 11:36:49 -0700	[thread overview]
Message-ID: <a5782d0a-901d-4965-a5de-5826fda0d9c0@broadcom.com> (raw)
In-Reply-To: <20261008210621.1374785-6-florian.fainelli@broadcom.com>



On 10/8/26 2:06 PM, Florian Fainelli wrote:
> When hardware checksum offload is enabled for an skb,
> bcmasp_csum_offload() prepends a struct bcmasp_pkt_offload header
> (20 bytes) to the skb via skb_push(). This increases skb->len and
> skb_headlen(skb) by sizeof(struct bcmasp_pkt_offload).
> 
> Because the hardware descriptor processor strips this offload header
> before transmitting the packet on the wire, the wire packet length is
> smaller by sizeof(struct bcmasp_pkt_offload). The padding calculation
> must account for this extra header; otherwise, short frames are sent on
> the wire smaller than the minimum Ethernet frame size (ETH_ZLEN +
> ETH_FCS_LEN).
> 
> Furthermore, small frames with payload in page fragments (such as small
> TCP segments with CHECKSUM_PARTIAL) have nr_frags > 0 and were skipping
> padding entirely because the padding check was restricted to
> nr_frags == 0.
> 
> Perform the padding check on skb->len before the descriptor loop using
> skb_put_padto(), adding sizeof(struct bcmasp_pkt_offload) to min_size
> when checksum offload is enabled, and re-read nr_frags after padding in
> case the skb was linearized.
> 
> Fixes: 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
> Assisted-by: LLM
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Justin Chen <justin.chen@broadcom.com>

      parent reply	other threads:[~2026-10-09 18:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08 21:06 [PATCH net v2 0/6] net: bcmasp: Collection of fixes Florian Fainelli
2026-10-08 21:06 ` [PATCH net v2 1/6] net: bcmasp: fix mib counters struct alignment with ethtool stats Florian Fainelli
2026-10-09  8:42   ` Nicolai Buchwitz
2026-10-09 18:35   ` Justin Chen
2026-10-08 21:06 ` [PATCH net v2 2/6] net: bcmasp: unmap previous DMA mappings on TX map failure Florian Fainelli
2026-10-09 18:36   ` Justin Chen
2026-10-08 21:06 ` [PATCH net v2 3/6] net: bcmasp: validate minimum RX packet size in bcmasp_rx_poll() Florian Fainelli
2026-10-09 18:36   ` Justin Chen
2026-10-08 21:06 ` [PATCH net v2 4/6] net: bcmasp: fix OF node reference leak for phy_dn Florian Fainelli
2026-10-09 18:36   ` Justin Chen
2026-10-08 21:06 ` [PATCH net v2 6/6] net: bcmasp: fix network filter lookup and wake filter pair allocation Florian Fainelli
2026-10-09  8:55   ` Nicolai Buchwitz
2026-10-09 18:37   ` Justin Chen
     [not found] ` <20261008210621.1374785-6-florian.fainelli@broadcom.com>
2026-10-09 18:36   ` Justin Chen [this message]

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=a5782d0a-901d-4965-a5de-5826fda0d9c0@broadcom.com \
    --to=justin.chen@broadcom.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nb@tipi-net.de \
    --cc=netdev@vger.kernel.org \
    --cc=opendmb@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=ryotkkr98@gmail.com \
    --cc=zakkemble@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