Article View: linux.kernel.netdev
Article #4286Re: [PATCH net-next v5 7/8] net: bcmgenet: allow the MTU to be changed
From: Nicolai Buchwitz
Date: Sat, 17 Oct 2026 06:26
Date: Sat, 17 Oct 2026 06:26
26 lines
7072 bytes
7072 bytes
On 17.10.2026 03:24, Jakub Kicinski wrote:
> On Tue, 13 Oct 2026 16:20:36 +0200 Nicolai Buchwitz wrote:
>> + ret = bcmgenet_init_dma(priv, true);
>> + if (ret) {
>> + /* Retry the size that was allocated a moment ago */
>> + WRITE_ONCE(dev->mtu, old_mtu);
>> + priv->rx_buf_len = bcmgenet_rx_buf_len(old_mtu);
>> + bcmgenet_set_mtu_regs(priv, old_mtu);
>> + if (bcmgenet_init_dma(priv, true)) {
>
> This will fail under memory pressure leaving the device inoperable.
Aye, I'll allocate the new rings before freeing the old ones, then a
failed MTU change just returns -ENOMEM and the rollback can go.
>
>> + priv->datapath_up = true;
>
> Hallmark of a bad design
Agreed, and redundant anyway once fini_dma() NULLs rx_cbs/tx_cbs. I have
a net series for that, on which I will rebuild this patch.
Thanks,
Nicolai
Technical Details
Message-ID:
<2304cd9afabc6f9e62d588b45b94015a@tipi-net.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-347705-linux-kernel-netdev=dewy.ruReferences:
<20261013-nb-genet-mtu-nn-v2-v5-0-076b6fc240be@tipi-net.de> <20261013-nb-genet-mtu-nn-v2-v5-7-076b6fc240be@tipi-net.de> <20261016182415.73f4f7e4@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-347705-linux-kernel-netdev=dewy.ru From: nb@tipi-net.de (Nicolai Buchwitz) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v5 7/8] net: bcmgenet: allow the MTU to be changed Date: Sat, 17 Oct 2026 08:26:34 +0200 Organization: Usenet Network Message-ID: <2304cd9afabc6f9e62d588b45b94015a@tipi-net.de> References: <20261013-nb-genet-mtu-nn-v2-v5-0-076b6fc240be@tipi-net.de> <20261013-nb-genet-mtu-nn-v2-v5-7-076b6fc240be@tipi-net.de> <20261016182415.73f4f7e4@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="2984216"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:VDaHvaMURldhJqDByxVLOakNyqU= sha256:tB2jUCZNnQ1j1SlzndmlploL5TENsjV+ajequNWgvyc= sha1:dHUreP1RuPMqRSsb9ehXn7h7nro= sha256:HmWW44SjPvfXSGEZcSb5i5dWnkojQle8fwaTjCCTzB0= 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 9EBA11106A2; Sat, 17 Oct 2026 09:27:13 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 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.25, 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 NnqZL08M_5sI; Sat, 17 Oct 2026 09:27:07 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-347705-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 034FF1106A1; Sat, 17 Oct 2026 09:26:56 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 0A64B35EA9; Sat, 17 Oct 2026 06:26:44 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B0B73D3CED; Sat, 17 Oct 2026 06:26:41 +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.b="xrz/D6rP" X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 281C038A736; Sat, 17 Oct 2026 06:26:39 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.13.80.246 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792218401; cv=none; b=cLC1iiwmnsuXHXk6XqZNsE8fZC7WQIy3WVWJXvtZECEyV3wkRFqr97QFB5X/BMl/gJhXdDz04J5Cbnl57ncbUIJmDjBGpnOGYj1CvQdgz7zlF5jo4nKwx2szBk5YMQ+zKJM9LZypy3wqU5sGKd4qkC4KD+xSL0/BXZvY/GKne6Q= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792218401; c=relaxed/simple; bh=3tC/kwj1+jForMsV997xcx23+SpH0TnehlSFeBpyMqY=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type; b=eZeZoIYzzTwASoLNrUqPYn5TG1dBC+ElexjiueqrdWN7vzvye6uoOyy100nnKNB8lzsWv10NJ3h8qhVPtSNIDrikYTZZNC5RluQUwwQ0ELfLwjyxKxCykLQq5AvgzKGtiPFMyzAhJK5VxKXFUNpPTnXpyQiWOnuBEp/DdBfKPmg= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.b=xrz/D6rP; arc=none smtp.client-ip=194.13.80.246 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 6542FA1559; Sat, 17 Oct 2026 08:26:34 +0200 (CEST) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim; t=1792218397; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=BQ9FXDq4m62P+Va6Th8Mp8RVPxQeOXHkr4s1H69I9rs=; b=xrz/D6rPp+RxIIOp3clQM0Mr5Yao0B/npy+a9v0lw41Wxmea2DeEAFsttNF/DbhuEW4nZn e4YjVW5ZHy1BvqiCSnSNAFfclEQAWIMbNHaIKERKEhNkn2VUC9lyh4oVh2okokVUZi35vi /8pkeXJuRvtWIBfXEZkLEgunEFflVO2uAw5JcEcvKSK/w2H40hLinLLZ/ReFCbHcNjlmuP rBsle46Pg52BYbd07yWWAIwv9AR1W89F6HK/dXJMhtLZuF62mX2ne6DtZ0UH2nQX4+R3xL ktzSZnHezq2BW8qi50CmMZSACPPqRnhE/WzNjNhiI3uRbS0G+dyXr/bAkkVv1w== X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> 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>, Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Dave Stevenson <dave.stevenson@raspberrypi.com>, Justin Chen <justin.chen@broadcom.com>, Pierre-Marin Leclercq <pierremarinleclercq88@gmail.com>, Florian Fainelli <f.fainelli@gmail.com> X-In-Reply-To: <20261016182415.73f4f7e4@kernel.org> X-Sender: nb@tipi-net.de X-Last-TLS-Session-Version: TLSv1.3