🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23847

Re: [PATCH net-next v10 2/8] net: bcmgenet: allow a continuation descriptor without the alignment pad

#23847
From: netdev-bot+sashiko
Date: Sat, 28 Nov 2026 11:26
75 lines
11042 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] Concern: after this patch, the length check in bcmgenet_desc_rx()
  (drivers/net/ethernet/broadcom/genet/bcmgenet.c), commented "Reject…

--

net: bcmgenet: allow a continuation descriptor without the alignment pad

This patch changes the RX length check in bcmgenet_desc_rx(). Only
descriptors with DMA_SOP now need room for the 64 byte status block plus
the 2 byte alignment pad. Continuation descriptors only need room for the
64 byte status block. The patch prepares for a larger MTU.

> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> index 7e78db243442c..67296eb22a5c3 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c

[ ... ]

> @@ -2394,8 +2396,12 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_rx_ring *ring,
>  			  __func__, p_index, ring->c_index,
>  			  ring->read_ptr, dma_length_status);
>  
> +		/* Only the first descriptor carries the alignment pad */
> +		min_len = dma_flag & DMA_SOP ? GENET_RSB_PAD
> +					     : sizeof(struct status_64);
> +
>  		/* Reject lengths that would underflow the SKB build path. */
> -		if (unlikely(len > RX_BUF_LENGTH || len < GENET_RSB_PAD)) {
> +		if (unlikely(len > RX_BUF_LENGTH || len < min_len)) {

[Severity: Low]
The comment above this check still says it rejects lengths that would
underflow the SKB build path. For a non-SOP descriptor, though, it now
accepts len values of 64 and 65.

Further down in bcmgenet_desc_rx(), the build path always subtracts the
full 66 byte GENET_RSB_PAD:

	skb_reserve(skb, GENET_RSB_PAD);
	__skb_put(skb, len - GENET_RSB_PAD);

At this commit, only the fragmented drop that comes next keeps such a
descriptor away from that subtraction:

	if (unlikely(!(dma_flag & DMA_EOP) || !(dma_flag & DMA_SOP))) {

So nothing can be hit at runtime here. Still, is it intended that the
guard and the build path disagree at this point in the series?

Later in the series, "net: bcmgenet: reassemble jumbo frames from status
block fragments" sends non-SOP descriptors to bcmgenet_add_frag(), which
subtracts sizeof(struct status_64). That commit also raises the non-SOP
minimum to sizeof(struct status_64) + 1, which brings the guard and both
build paths back in line.

The commit message describes a continuation "holding a single byte", which
is a len of 65. A len of 64, with no data bytes, also passes this check.

Would it make sense to use sizeof(struct status_64) + 1 here already, or
to adjust the comment in this patch?

>  			netif_err(priv, rx_status, dev,
>  				  "invalid packet length %d\n", len);
>  			BCMGENET_STATS64_INC(stats, length_errors);

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261127-nb-genet-mtu-nn-v2-v10-0-749c7cc45d97%40tipi-net.de
Technical Details
Message-ID: <179586516149.3135.9738232664292864629@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373097-linux-kernel-netdev=dewy.ru
References: <20261127-nb-genet-mtu-nn-v2-v10-2-749c7cc45d97@tipi-net.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373097-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v10 2/8] net: bcmgenet: allow a continuation
 descriptor without the alignment pad
Date: Sat, 28 Nov 2026 11:26:01 +0000
Organization: Usenet Network
Message-ID: <179586516149.3135.9738232664292864629@kernel.org>
References: <20261127-nb-genet-mtu-nn-v2-v10-2-749c7cc45d97@tipi-net.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="938184"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:c5mA6BC9qVa83DncPzN1Tt5rSZY= sha256:w22M/7mNEUq/mVEg8xLpkqu5cikWmOW5Z9kwSbIIYro=
	sha1:TlNGD+C0dACKgwigKKa6eQGhJjI= sha256:Ab0BHS0bKcyQ/oqVLYBaSeep9F6p9axom0XzqfHOBog=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 533F2125F79; Sat, 28 Nov 2026 14:26:23 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id A_PW7fRQEXYb;
	Sat, 28 Nov 2026 14:26:15 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373097-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 30732125F70; Sat, 28 Nov 2026 14:26:05 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 15B77294E6; Sat, 28 Nov 2026 11:26:04 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795865164;
	b=SutzaBlWpuDQj/3TLhukvtS3B5HMlkKW8+pObsKECevqpRS0fQsi6u9YX+De5k48ON3O
	 /+EXGh0nEv3oDnfjIn+w2oGyPR+NHmX31sRdQ7k4O8QB5kUqP1il40CsEkU4DCuyk+dDf
	 MIDFyB/U4uo7sRPk7kxK/oC/3ue/dOiwzZfzcocKqPsDo55ieSeTZiUVjh0zwQ79EsP/+
	 xWV0vg5KbwDC9X0tT9vymNDj5nPA+y8w58wxAqac7NhJY/JtX55MhqCenEWokDieYLsZH
	 NhUlpJK0M3gNpTpvijksNYcMxRZE/BLXgJ4/utDyUhiQ6fUm0WopEeTqqKTx7BU6SBw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795865164;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=e0p66sCFiRDmHakXf0/+dm4/kpSJWzWCKHTUu/k0+tM=;
	b=YZGOv8qUYbehb8O2BgEkXJ333ajZ8VchtwEaf6fySRtQ0on8ejfm1/kmDCSNL6DocP3V
	 rAW8Je7PxCHzDDXW4b8D4l/wLE1CVkNz70pNTvdvJWdX+y4pTfRCY/sJT/yTF+ENXwV+i
	 xH3FWFvLkBs1w0SXfSuqvM9tYwjPQyiQTJuaEkMfhfYLZy7ai2Q1SgRNqROvdLJCJ8zTF
	 uBaXlt5iYOUt8yID0mc2xn7O8L+dSJi3pcepL6obu7Als3aP9wfcDeYlaFQPyR03caxm6
	 aeoY9jin/xDe2pe/Gc59Vzcv7gR0NMml7HwOhZtpapfIanArnA9WPNdYQac4hQumztQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=b4GFCA4M;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id E1E0C606A32A;
	Sat, 28 Nov 2026 11:26:03 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=b4GFCA4M
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795865163;
	b=LNDlCxI8ajIqohWh6TlxUubUr+sQdbuGpUQFz+3fbIx0MwJ8018kwPo1Ah2aH846yYqZ
	 0kE4uzlOFEy4+mY90Pm2anq7kj+n+jxbazrUB9+gDn1v47/N6Q54J2lqjwds7sFSozXRo
	 L45svkwyO2lS5GwpJn5bNyg+dxXdJUqexoqVCmjFq0ZtHYgyqOk/b4VVkAMhs++EckUaN
	 w8G3whLuqRJk1dg4NsYNujLdD2S5x9A4FvtG1zCO05qaLSUhM+KgTjlg+PN3KsolQNjpl
	 7c0cEVTs1XzWL6fh0jYXDW4ZUuJ1hcO/9Uy8qrzhe8+MhmCpQ5+qW0SZVYE5jNZhFMA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795865163;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=e0p66sCFiRDmHakXf0/+dm4/kpSJWzWCKHTUu/k0+tM=;
	b=vIXBFzkvjh3MlVVjqKZeYTSUTnBnd4LR3oGHrHx17C8zyCU9hUkk19vORRZpAbEuDzw7
	 OmE46scOTlUwcYXZLm4SKq8Gl6M0aw9LjrScwgjjJg5Kyay8kwoe5F00HQu90JFglcyWy
	 fc43L4xxHTYP69BelZrqq3X5FNpidqcBIIaj6MR+BdpW3rDYfj2h1CFP59VdgvXSAzwXg
	 ctn3RT0wh6yG5n2Clw3gdn0bUnUVyPi33JK119vSE5c6TeeKpp6ILPBt8/WJUFmCE1sVE
	 tV0aFCrE97JFK3VB97uACk9Qgd4hR6uNEyVWGFXsdq0C8H0HaDEm6im+KKlORNyrAxA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=b4GFCA4M;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B4A9606A31C;
	Sat, 28 Nov 2026 11:26:02 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01AD71F00893;
	Sat, 28 Nov 2026 11:26:01 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795865162;
	bh=e0p66sCFiRDmHakXf0/+dm4/kpSJWzWCKHTUu/k0+tM=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=b4GFCA4MeTbZN22JpuOcUiXAZm+p9v69s/mV5Km8yJR+HI98GoOX0fUiCpZ7ZtCIQ
	 l0lw5sH13VdNvlakzhv8KCncUdv/MA6z9KfCn0M8RhAFXcfRSCy2p194/D4sfP0ye3
	 Xt/3w1m0+dQp34K3ik8H/H0R9BQOABdaxKzEUqQlKtpqOaj6N9rYNZcUaF0dBTXNtz
	 zAXI1dVIqjvGPetPzUpt6o3eKF2aQ3MnlkbDUvwiXQA8Gl3dbSU8uiphxiVJ9VI19/
	 Cn+u1k7bnmMhbT95dkZgOhgyK0F36p6v7By5WFs7lJpmJpy7aL5NsAUGw6A/2onOny
	 efMPwTV5RuoBQ==
X-Cc: opendmb@gmail.com, florian.fainelli@broadcom.com,
 bcm-kernel-feedback-list@broadcom.com, andrew+netdev@lunn.ch,
 davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
 f.fainelli@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
 pierremarinleclercq88@gmail.com, dave.stevenson@raspberrypi.com,
 justin.chen@broadcom.com
X-In-Reply-To: <20261127-nb-genet-mtu-nn-v2-v10-2-749c7cc45d97@tipi-net.de>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list