🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23481

Re: [PATCH net-next v9 7/8] net: bcmgenet: allow the MTU to be changed

#23481
From: Nicolai Buchwitz
Date: Fri, 27 Nov 2026 10:22
42 lines
9852 bytes
Hi Daniel,

On 26.11.2026 13:15, Daniel Machon wrote:

> [...]

>> +static int bcmgenet_change_mtu(struct net_device *dev, int new_mtu)
>> +{
>> +	struct bcmgenet_priv *priv = netdev_priv(dev);
>> +	unsigned int old_mtu = dev->mtu;
>> +	struct bcmgenet_dma_set set;
>> +	int ret;
>> +
>> +	/* A failed resume left the datapath down, nothing to reprogram */
>> +	if (!netif_running(dev) || !priv->tx_cbs) {
>> +		WRITE_ONCE(dev->mtu, new_mtu);
>> +		priv->rx_buf_len = bcmgenet_rx_buf_len(new_mtu);
>> +		return 0;
>> +	}
>> +
>> +	/* Below ETH_DATA_LEN everything is floored, so there is nothing to
>> +	 * reprogram and rx_buf_len stays as the receive path reads it.
>> +	 */
>> +	if (max_t(unsigned int, old_mtu, ETH_DATA_LEN) ==
>> +	    max_t(unsigned int, new_mtu, ETH_DATA_LEN)) {
>> +		WRITE_ONCE(dev->mtu, new_mtu);
>> +		return 0;
>> +	}
> 
> What about a similar check for MTUs above ETH_DATA_LEN? AFAICT, there 
> are
> ranges where you don't need to do a full replacement of the buffers, 
> yet
> you still do.

Makes sense. I will add this in the next version!

> [...]

Thanks,
Nicolai
Technical Details
Message-ID: <3a85abf16fd109d255b4d9bd1c40558d@tipi-net.de>
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-372656-linux-kernel-netdev=dewy.ru
References: <20261123-nb-genet-mtu-nn-v2-v9-0-4f93ded19bbb@tipi-net.de> <20261123-nb-genet-mtu-nn-v2-v9-7-4f93ded19bbb@tipi-net.de> <20261126121541.6gybeqbkxsvjav5i@DEN-DL-M70577>

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-372656-linux-kernel-netdev=dewy.ru
From: nb@tipi-net.de (Nicolai Buchwitz)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v9 7/8] net: bcmgenet: allow the MTU to be
 changed
Date: Fri, 27 Nov 2026 11:22:49 +0100
Organization: Usenet Network
Message-ID: <3a85abf16fd109d255b4d9bd1c40558d@tipi-net.de>
References: <20261123-nb-genet-mtu-nn-v2-v9-0-4f93ded19bbb@tipi-net.de>
 <20261123-nb-genet-mtu-nn-v2-v9-7-4f93ded19bbb@tipi-net.de>
 <20261126121541.6gybeqbkxsvjav5i@DEN-DL-M70577>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="707116"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:r7mKRi+rkEDTShVsOmqfVeXuJDc= sha256:QaJMkhV9fF9hwAoYMGwgBZe364TxavbMIO5lUnigkXo=
	sha1:b9dQteTya9Xnc/TjdrQggPZ8lQ0= sha256:4gAwdHQkm0kYDTqpu85ht60838x3kozo8nLodRI+oI0=
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 135AA125F4E; Fri, 27 Nov 2026 13:23:38 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	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=tipi-net.de
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 2dBuRsj9rdFU;
	Fri, 27 Nov 2026 13:23:35 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-372656-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 0D30E125F50; Fri, 27 Nov 2026 13:23:26 +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 C31B9625CA; Fri, 27 Nov 2026 10:23:20 +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=1795774983;
	b=GH2kBt6/CzuJUIrTUjDU/wW7zlE//SW900oxlxBC/TQF3K5N7K5gmhq6Nosh9JDqT9YS
	 dF9yh/Bsg1XH+llcwZbLy4HG8Uu3hWTC42hlPermBeQK/fw3Nfhw3ZZFNpDQzH4fyW557
	 Wo+yADQL+hhZG/Cc3mj3bam7aQn59pRHC5S+fjYRmnHaL4k0nk8ZdQqDje4lHKRL36IVJ
	 5isenN+b5xAA7IUzLx8KFcIkXhuWbYeDuFAAFDmsNm4zf7DPtq8YudvkPShmiZ3wf/yXe
	 B7PNX1hr7/oY1VDRN7kT66Jm15EuXhNx5U3porZdx5Z+nW06fSblNuIYSa13lSJR1OQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795774983;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Date:From:To:Cc:
	 Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type:
	 Content-Transfer-Encoding:X-Last-TLS-Session-Version;
	bh=gDwkOnp2LvRTB/zVL5oprT8GvNodnF+cyhcTLQbY5nc=;
	b=jbAiUhAnSZtYbGPrs6Qg4bB4S7tEx/iyuNQd0uouDmbAI58LT9dRNQvB+hwLnlkkj84D
	 67KbJ5K2cEHXUAHhAMiFRhUpHjxzpXNcjQNYgEIFjS3+q9K3w/xiHlLG9rq7aoBDu3M54
	 TQYFz8kpqUiBOnyJFB+WfAzG8g8FeQ3b1BJDpeuQDRBQtfyTaKbDBaId080SDy/w3ojnS
	 8RZFO6DTXhGemWNDZ1ctzTjAL0AUliF4J7GnqItGYcfaacrd6/gnq7uWvPV3ZmbspUTvQ
	 xwF4QRRxeVelLyrng8FAM7ut9XTFhio8B3CfJeMLKeCvDZr8Jbq763533MLtPaIR8fg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=jqRVQqbd;
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	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 8ABAB606A69B;
	Fri, 27 Nov 2026 10:23:03 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=jqRVQqbd
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=194.13.80.246
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795774982;
	b=37xjEuglNuvJrje+m3L47OXqT6SbHHvenZqIUI4S6cxvqDst2SpRBR9WlDM1smkRaDNf
	 8knEQkqFIFg5V9wyaXbA/nNotJUGkgdxeQ4/Y3G5az7yZj4+J03okwa1TUpI++YBKgq5E
	 4ChxjVDQexXsxRKdJiQlTC4VFeIeTAUTT8aXvQ6siaBp5pdwsuySW9i9WBMOBX631V0Mf
	 8uyT9EAigjgifF16W0kFSpIxn+IVtw/NZ5CQ22Omrfydm6821EVY9MzqjymNoCmfhbVwc
	 ty3jZ7qVZUBAAiBK52vhLiOOCH55I8LWugDlCz5bqsPiusuSTsCS7w+/HoxNTXO5FWQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795774982;
	h=DMARC-Filter:Received:DKIM-Signature:MIME-Version:Date:From:To:Cc:
	 Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type:
	 Content-Transfer-Encoding:X-Last-TLS-Session-Version;
	bh=gDwkOnp2LvRTB/zVL5oprT8GvNodnF+cyhcTLQbY5nc=;
	b=1hv8c/6qJzHuzXnXrYQxcPgfZbu3L+L4UUfkQLKnnRxFAnK/Q4Odj8RDw6vMEXiYK1yI
	 GnEl/wm8cgGdE4yooltEFq+oP+XaO+SYQujET+60Gg+ZQkHfB+8zK5ZvZA4BN4sAuJNPl
	 6RmWlLPULVAKZn4qB3uNoWjNDrC1diDAoaBEjAxxjgscRS/1sOH7/oJgrbGETqCFU1Zyl
	 Mn6MMGEfcbgCTtTiva2A9MU2axotFuEIXaJs1HmfxMZq4xVs7xBpC+WI9+tgJtyU6AMgG
	 B81s43+NI8z45ASGBTq4/FgPJkPqXKqO1QNdclNW8Ma+Axp9m7b6uPbJUJzACcFvE7w==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=jqRVQqbd;
	arc=none smtp.remote-ip=194.13.80.246
X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8175F606A6B0;
	Fri, 27 Nov 2026 10:23:00 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8175F606A6B0
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de
X-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0DC93A15F9;
	Fri, 27 Nov 2026 11:22:49 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim;
	t=1795774972; h=from:subject:date:message-id:to:cc:mime-version:content-type:
	 content-transfer-encoding:in-reply-to:references;
	bh=gDwkOnp2LvRTB/zVL5oprT8GvNodnF+cyhcTLQbY5nc=;
	b=jqRVQqbdfgPFhTwAiAp6i+43rOP2cVaFUxtS/4kFv6uriGv5LgbTXwlKJjfInSK1h2zXER
	1E8PmGCvxkHEcR7hn+cIApEKBjxmJlk40diwpjLMfKqQZdL4HtzLSYUh6OPJwxSF1f39gt
	qCAK8L9tIj3f+gslTlEC4v2NptvK26MjV56czxUZtS63sxfnWngxV58NekiS2ACwCaVwBO
	l26LryO1AQdiWAZruhpXkboOmQwx03YCbJD+nM3khsUrE+aQohAVKr2tqm9B4p1qtjM39q
	nNM9MEG9CDGA71A94HCqBFQNzNHxjnv1weSmDUxDDQjEB1X0Y7mUZwHG9I9Krg==
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
X-Cc: Doug Berger <opendmb@gmail.com>, Florian Fainelli
 <florian.fainelli@broadcom.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@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni
 <pabeni@redhat.com>, Florian Fainelli <f.fainelli@gmail.com>,
 netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Dave Stevenson
 <dave.stevenson@raspberrypi.com>
X-In-Reply-To: <20261126121541.6gybeqbkxsvjav5i@DEN-DL-M70577>
X-Sender: nb@tipi-net.de
X-Last-TLS-Session-Version: TLSv1.3