From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.199 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796349335; b=0bAwS3MFg7tmbbFBWJtfxkqO9ggLQlJ253xUNEUdCl3TQN4vpyReynnWzjLMNhGBVMOd 1+iC7SwhclVVTiZpVBIOzg2+W+ctm1PL1iKrex4WcPqq4qHsTV4o26YuWOlllVdYMBGVj fwf2w3KL2qpzNhT/tWAg1Ruxm1IrpfmcoNkgcnXVZWHIA2pkDXXiTQPQTYCBcA8nS9EDQ BPGxlwLV+UnjMl5rlQkiyyATnLRMk56RJzcv0sSUrODCNYsSk2+jeHTSwNc7cMK2jvLjK +WEfw2pF7FfT+SrZPSlM5QhPOQCkPUDrspMvZFDp6i2yKO9TISK6Qbt1WVDFN6PUoIQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796349335; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:Message-ID:Subject:From:To:Cc:Content-Type; bh=ArGhmyQMfCRDRmZGXu4u548O0tjxs2Cf/E0CaGY8GJg=; b=otzmyloEUpSL1AqgU7LvqVGYNFro+hLlYFqA2SRmiuMkz/YxRCGI/Y+DZ5VaEGA7y7id PdiYF18F2WchGgOv/EpgxG9OIDI9luAc6V7xsMzx3AG/fRNB7IK7RouWdFaeFfawA6uf+ J152jV0T7b8QnIfosOJbEG0+Fk0DOJzQmsDfSnNgYPV92gzeAp8HzOTPKbkRs6kn6ABTc 2QdPRY//NVOSLXlA1r4yMYhItgr3aXvU6Ys5fydSAF/kehEhfSJj8hbdnr4Tbjk52f687 0L0l/dq94ePdNHq5fxECD/10vNfzaVq1DLS+SdMDhcmKEWpyyPXViaZjqM/RGUhn0Hw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--willemb.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b="N/WG/7JF"; arc=none smtp.remote-ip=209.85.160.199 Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CD42606A322 for ; Fri, 4 Dec 2026 01:55:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0CD42606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--willemb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=N/WG/7JF Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-55c16eb248eso6552371cf.2 for ; Thu, 03 Dec 2026 17:55:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796349334; x=1796954134; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ArGhmyQMfCRDRmZGXu4u548O0tjxs2Cf/E0CaGY8GJg=; b=N/WG/7JFadrPxB6B9dv5FH3En3aZCgotEZ5nuxFTjdgMUK2kdJWgiiklfD0o8GaCzO xUps4QoI+/3PZO/aoGRpbYRhst5BzIRno21dwr9idQEvFRN5cjz5Kmh9nSnFoGVLxByn 9u2RlXnG7A42EcHOPWJQ6x1Oh5hj53KTQWiReONNwXK8OW/QLl3cX9aIdOnX5BTlNjzT ZGWy8PbysR8apFqTOtLQZJt8eK6qnqCI2M4IaCtkH30xl2geQT4qR2pbd6MJnzPI7uX1 zvUQ9TVUjkmSfpO9fVucDRwBeym5zGv8zIzG+QTHPclPUFyIjx5u2ouDRUS/uAZ9pDa4 tgyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796349334; x=1796954134; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ArGhmyQMfCRDRmZGXu4u548O0tjxs2Cf/E0CaGY8GJg=; b=JFYHdRde66rB7H3MZq4kZG1W04pksO9Mg4wGSbeeQMeUoeMS3pHqUW6+osWnCdHO/L ZPyfWBbmjD6uSP75IadTOhsVIEbY7LDntPaUkIpHpO6gwn8l2J0geSm/w0tJWsjyxamv Olw5gtZfSE4mECYOt/VfYz26aX3t8x7O/3bo1wmuZqyNDwkerzUGT6zE8hHRxnTDuCXc w6FJ9hDSa0B7JVy1sSkPWfKFg7lh6sbO2g/MjXOCoUM2MCExZgwktYVbaJsID5pAoQr/ QJBtzXOK8qdEuzdm0KVbzGlzSS4Yax8c1JB7cZi/wPF/afJ461ElojfJ/Qau3voB7VHe FOuQ== X-Forwarded-Encrypted: i=1; AL+hErGxXDOc3hd0FQQJMtxM2MVzNbdhViM/l9Qf/vPF5teu7fU1qjFJ1ByaHYTE8m3AFMRv9nHOT5A=@vger.kernel.org X-Gm-Message-State: APuU4Z88inSy52U98xFxQZn8gcRHMYwpKv8Ex48PGHGvnJTLpT2SJd3I rCDudUQGuhyL1X9YJiFrXWhyRXeCkYFbCBY4aXTeRBNVCDThVsvzBIij2rVhdw7aO/RIJ00OOTq 9TWB9wHClxA== X-Received: from qvsw13.prod.google.com ([2002:a05:6214:12d:b0:921:19e:4132]) (user=willemb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:622a:580e:b0:533:3a14:6a2e with SMTP id d75a77b69052e-55e38957a35mr8305041cf.17.1796349333870; Thu, 03 Dec 2026 17:55:33 -0800 (PST) Date: Thu, 03 Dec 2026 20:55:33 -0500 In-Reply-To: <20261127-nb-genet-mtu-nn-v2-v10-0-749c7cc45d97@tipi-net.de> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261127-nb-genet-mtu-nn-v2-v10-0-749c7cc45d97@tipi-net.de> Message-ID: Subject: Re: [PATCH net-next v10 0/8] net: bcmgenet: support larger MTUs From: willemb@google.com To: Nicolai Buchwitz , Doug Berger , Florian Fainelli , Broadcom internal kernel review list , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Pierre-Marin Leclercq , Dave Stevenson , Justin Chen Content-Type: text/plain; charset="UTF-8"; format=flowed; delsp=yes Nicolai Buchwitz wrote: > This is v10 of my genet series which adds larger MTU / jumbo packet > support. > Larger MTU aka. jumbo frames are requested often by Raspberry Pi users, > but > the hardware has its quirks with larger frames. Dave Stevenson's PoC [1] > had > the receive side working, and thanks to Justin, who checked the RTL for > what > the hardware does with long frames, I could add the missing puzzle pieces. > GENET never sets dev->max_mtu and the packet ready thresholds stay at > their > 2048 byte reset default, so long frames were dropped on receive and never > sent on transmit. > Patches 1 to 4 prepare the driver, patch 7 sets the MTU, as far as one > descriptor reaches (3564 bytes with 4K pages). Patch 8 reassembles what > the > hardware hands up above that, which gets the ceiling to 16347 [2]. Patch 5 > splits a frame ending just past the packet ready threshold, which > otherwise > stops the transmitter [3]. Patch 6 builds the new rings before dropping > the > old ones, so a failed MTU change leaves the interface alone. > Only v5 gets the larger MTU in this version. The TBUF sizing and the > transmit length width on v2 to v4 are unconfirmed, so those keep the > default until someone with the hardware or the RTL can say. Although max_mtu is kept at ETH_DATA_LEN on v2-v4, patches 4 and 5 still write RBUF_PKT_RDY_THLD and TBUF_PKT_RDY_THLD (0x80) on v2-v4 (skipping only v1), while only confirming 0x80 as the reset value on v5. Given that v2 does not even set RBUF_TBUF_SIZE_CTRL in init_umac(), gating the RBUF/TBUF threshold writes to GENET_IS_V5() (until v2-v4 offsets/defaults are confirmed) would avoid touching unverified registers on older parts. > A split frame takes one descriptor more. Patch 5 adds it to the two limits > which 1e09af397bc7 and fbfd7cfd2019 put on the 32 descriptor rings, so the > queue stops one descriptor earlier and a frame is flattened one fragment > sooner. > Tested on a Raspberry Pi CM4 (GENET v5), peer at the same MTU: > - MTU 1500: iperf3 TCP 942/936 Mbit/s, UDP 956 Mbit/s, unchanged > - MTU 9000: iperf3 TCP 991/986 Mbit/s, UDP 992 Mbit/s, no transmit loss > - MTU 1500 to 16347 with traffic and ifdown/ifup's > - pktgen at line rate, 3858/3872/3886 byte frames mixed with 64 byte ones > - raw frames across every receive descriptor boundary, byte exact > - CONFIG_MAX_SKB_FRAGS 31, 29 to 31 fragment frames in the split window > - every frame length from two below the threshold to 79 past it, linear > and paged, each followed by a short frame, no stall > - the same with CONFIG_DMA_API_DEBUG, no error and no leaked mapping > Pierre-Marin Leclercq tested v5 on a Raspberry Pi 4. > [1] https://github.com/raspberrypi/linux/pull/7614 > [2] https://github.com/raspberrypi/linux/pull/7617#issuecomment-5669564355 > [3] https://github.com/raspberrypi/linux/pull/7617#issuecomment-5735557324 > Signed-off-by: Nicolai Buchwitz > --- > Changes in v10: > - Patch 5: Link to the split proposal (sashiko) > - Patch 5: only a v5 is known to hold 0x80 in the threshold (sashiko) > - Patch 7: reuse the rings when the MTU keeps the buffer size (Daniel) > - Patch 7: drop the tx_cbs check, the core returns -ENODEV first (sashiko) > - Rebased on net-next (my dim series was merged and conflicted) > - Link to v9: > https://patch.msgid.link/20261123-nb-genet-mtu-nn-v2-v9-0-4f93ded19bbb@tipi-net.de > To: Doug Berger > To: Florian Fainelli > To: Nicolai Buchwitz > To: Broadcom internal kernel review list > > To: Andrew Lunn > To: "David S. Miller" > To: Eric Dumazet > To: Jakub Kicinski > To: Paolo Abeni > Cc: netdev@vger.kernel.org > --- > Nicolai Buchwitz (8): > net: bcmgenet: let the caller decide whether to start the PHY > net: bcmgenet: allow a continuation descriptor without the > alignment pad > net: bcmgenet: rename ENET_MAX_MTU_SIZE to ENET_MAX_FRAME_LEN > net: bcmgenet: derive the receive buffer length from the MTU > net: bcmgenet: split frames that end just past the transmit > threshold > net: bcmgenet: build the DMA rings before giving up the running ones > net: bcmgenet: allow the MTU to be changed > net: bcmgenet: reassemble jumbo frames from status block fragments > drivers/net/ethernet/broadcom/genet/bcmgenet.c | 792 > +++++++++++++++++++------ > drivers/net/ethernet/broadcom/genet/bcmgenet.h | 38 +- > 2 files changed, 646 insertions(+), 184 deletions(-) > --- > base-commit: e20a00eb02ca87ab8e6e57468ed77268062bac74 > change-id: 20261002-nb-genet-mtu-nn-v2-402b5e6f306f > Best regards, > -- > Nicolai Buchwitz