{"id":2230144,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2230144/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260429-sys_rx_eth_buffer-no-net-v1-4-396ef37ae93c@cherry.de/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.2/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260429-sys_rx_eth_buffer-no-net-v1-4-396ef37ae93c@cherry.de>","list_archive_url":null,"date":"2026-04-29T10:35:04","name":"[RFC,next,4/5] net: guard SYS_RX_ETH_BUFFER with NET","commit_ref":null,"pull_url":null,"state":"rfc","archived":false,"hash":"3922fb9dd0eaf5e71a7495059880e3fdd562bc66","submitter":{"id":84425,"url":"http://patchwork.ozlabs.org/api/1.2/people/84425/?format=json","name":"Quentin Schulz","email":"foss+uboot@0leil.net"},"delegate":{"id":157425,"url":"http://patchwork.ozlabs.org/api/1.2/users/157425/?format=json","username":"jforissier","first_name":"Jerome","last_name":"Forissier","email":"jerome.forissier@linaro.org"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260429-sys_rx_eth_buffer-no-net-v1-4-396ef37ae93c@cherry.de/mbox/","series":[{"id":502037,"url":"http://patchwork.ozlabs.org/api/1.2/series/502037/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=502037","date":"2026-04-29T10:35:00","name":"net: guard SYS_RX_ETH_BUFFER with NET + required changes (ls1028a!) to make this happen","version":1,"mbox":"http://patchwork.ozlabs.org/series/502037/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2230144/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2230144/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=0leil.net header.i=@0leil.net header.a=rsa-sha256\n header.s=20231125 header.b=JfKmQwRW;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=0leil.net","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=0leil.net header.i=@0leil.net header.b=\"JfKmQwRW\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=0leil.net","phobos.denx.de;\n spf=pass smtp.mailfrom=foss+uboot@0leil.net"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g5DGn31sDz1xqf\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 20:35:45 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 294D08483F;\n\tWed, 29 Apr 2026 12:35:24 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 7BAD68483A; Wed, 29 Apr 2026 12:35:20 +0200 (CEST)","from smtp-190b.mail.infomaniak.ch (smtp-190b.mail.infomaniak.ch\n [IPv6:2001:1600:19:b8b8::190b])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 370CE8483E\n for <u-boot@lists.denx.de>; Wed, 29 Apr 2026 12:35:17 +0200 (CEST)","from smtp-4-0000.mail.infomaniak.ch (unknown\n [IPv6:2001:1600:7:10::a6b])\n by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4g5DGD5mv1zCrD;\n Wed, 29 Apr 2026 12:35:16 +0200 (CEST)","from unknown by smtp-4-0000.mail.infomaniak.ch (Postfix) with ESMTPA\n id 4g5DGC5SGKzZwh; Wed, 29 Apr 2026 12:35:15 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=0leil.net;\n s=20231125; t=1777458916;\n bh=G/6mFTrsAmzkNw9hWSBEBzGrFEyWaaPbMXiyTaHilrU=;\n h=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n b=JfKmQwRW3Ibr/o5ExyrBC3lyHUB9bmDp3J/lERXDc/tTZe9O6WgUBEdB+CZy9OdXO\n iuDwJjnbgIQ0B+oiNyXFUoqypqTc8Nkg20OmHSjaWeLbpEOmTg7S40jiMeE7KuEL1H\n GqSfIchq47GaLZttejLsDCLCA08yF7QYALHhSxJ6ALGFwTdENXly1z6N4gDU49zDmY\n RIF3QOTmse2WST+TmVFZUkj2Bm29tl/h06f0G7uVy4VrJzO8+62CSCVtdSsog8ol70\n G1qGbRt6EdihkIhtq995DYj4mbQjvdcTLAybRbFfFaFTkeguixmZ5O9q3P12JHXohT\n D9QrhhxTJzIdw==","From":"Quentin Schulz <foss+uboot@0leil.net>","Date":"Wed, 29 Apr 2026 12:35:04 +0200","Subject":"[PATCH RFC next 4/5] net: guard SYS_RX_ETH_BUFFER with NET","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20260429-sys_rx_eth_buffer-no-net-v1-4-396ef37ae93c@cherry.de>","References":"<20260429-sys_rx_eth_buffer-no-net-v1-0-396ef37ae93c@cherry.de>","In-Reply-To":"<20260429-sys_rx_eth_buffer-no-net-v1-0-396ef37ae93c@cherry.de>","To":"u-boot@lists.denx.de","Cc":"Tang Yuantian <andy.tang@nxp.com>, Tom Rini <trini@konsulko.com>,\n  Fabio Estevam <festevam@gmail.com>, Alice Guo <alice.guo@nxp.com>,\n  Jerome Forissier <jerome.forissier@arm.com>,\n  Peter Robinson <pbrobinson@gmail.com>, Simon Glass <sjg@chromium.org>,\n  Andrew Goodbody <andrew.goodbody@linaro.org>,\n  Benjamin Hahn <B.Hahn@phytec.de>,\n  Ilias Apalodimas <ilias.apalodimas@linaro.org>, =?utf-8?q?Alvin_=C5=A0ipra?=\n\t=?utf-8?q?ga?= <alvin@pqrs.dk>,  Quentin Schulz <quentin.schulz@cherry.de>","X-Mailer":"b4 0.15-dev-47773","X-Infomaniak-Routing":"alpha","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"From: Quentin Schulz <quentin.schulz@cherry.de>\n\nSYS_RX_ETH_BUFFER represents the number of Ethernet receive packet\nbuffers. It therefore doesn't make sense it's reachable if NET isn't\nenabled.\n\nDirect users of SYS_RX_ETH_BUFFER are:\n- drivers/net/rtl8169.c, only compiled if CONFIG_RTL8169=y, depends on\n  CONFIG_NETDEVICES=y, depends on CONFIG_NET=y,\n- drivers/net/fsl_enetc.h, via ENETC_BD_CNT, included in\n    drivers/net/{fsl_enetc.c,fsl_enetc_mdio.c,mscc_eswitch/felix_switch.c}\n  First two only compiled if CONFIG_FSL_ENETC=y, latter with\n  CONFIG_MSCC_FELIX_SWITCH=y. Both symbols depends on\n  CONFIG_NETDEVICES=y, depends on CONFIG_NET=y.\n- include/net-common.h via PKTBUFSRX,\n\nIndirect users via PKTBUFSRX:\n- arch/sandbox/include/asm/eth.h\n  - according to ./tools/qconfig.py -l -f CONFIG_SANDBOX CONFIG_NO_NET,\n    all sandbox defconfigs have network enabled so ignore this for now,\n- drivers/dma/ti/k3-udma.c\n  - sets UDMA_RX_DESC_NUM to that if defined, else 4. PKTBUFSRX is\n    CONFIG_SYS_RX_ETH_BUFFER which defaults to 4. According to\n    ./tools/qconfig.py -l -f CONFIG_TI_K3_NAVSS_UDMA '~CONFIG_SYS_RX_ETH_BUFFER=4'\n    no defconfig enabling this DMA driver sets CONFIG_SYS_RX_ETH_BUFFER\n    to anything but the default of 4, so regardless of NET being built\n    UDMA_RX_DESC_NUM will always be 4 with current defconfigs.\n- drivers/net/{airoha_eth.c,bcm6348-eth.c,bcm6368-eth.c,cortina_ni.c,\n\tdc2114x.c,eepro100.c,essedma.c,ethoc.c,ftgmac100.c,ftmac100.c,\n\thifemac.c,mcffec.c,mpc8xx_fec.c,pic32_eth.c,sandbox.c,sni_ave.c,\n\tsni_netsec.c,ti/am65-cpsw-nuss.c,ti/cpsw.c,ti/icssg_prueth.c,\n\ttsec.c} all depends on CONFIG_NETDEVICES=y, depends on\n  CONFIG_NET=y,\n- net/lwip/net-lwip.c, only compiled if CONFIG_NET_LWIP=y, depends on\n  CONFIG_NET=y,\n- net/{net.c,tcp.c}, only compiled if CONFIG_NET_LEGACY=y, depends on\n  CONFIG_NET=y,\n- net/net-common.c, only compiled if CONFIG_NET=y,\n- test/cmd/wget.c, only compiled if CONFIG_NET_LEGACY=y, depends on\n  CONFIG_NET=y,\n- test/image/spl_load_net.c, only compiled if CONFIG_SPL_UT_LOAD_NET=y,\n  depends on CONFIG_SPL_ETH=y, depends on CONFIG_SPL_NET=y, depends on\n  CONFIG_NET_LEGACY=y, depends on CONFIG_NET=y,\n\nIndirect users via net_rx_packets[PKTBUFSRX]. This array is only\nexternally defined in net/net-common.c which is only compiled if\nCONFIG_NET=y.\n\nUsers of net_rx_packets are:\n- drivers/net/{airoha_eth.c,bcm6348-eth.c,bcm6368-eth.c,cortina_ni.c,\n\tdc2114x.c,dm9000x.c,essedma.c,ethoc.c,fsl_enetc.c,ftgmac100.c,\n\tftmac100.c,hifemac.c,ks8851_mll.c,macb.c,mcffec.c,mpc8xx_fec.c,\n        mscc_eswitch/jr2_switch.c,mscc_eswitch/luton_switch.c,\n        mscc_eswitch/ocelot_switch.c,mscc_eswitch/serval_switch.c,\n        mscc_eswitch/servalt_switch.c,pic32_eth.c,sandbox-raw.c,\n\tsandbox.c,smc911x.c,sni_ave.c,sni_netsec.c,ti/am65-cpsw-nuss.c,\n\tti/cpsw.c,ti/icssg_prueth.c,tsec.c,xilinx_axi_mrmac.c} all\n\tdepends on CONFIG_NETDEVICES=y, depends on CONFIG_NET=y,\n- drivers/usb/gadget/ether.c only built if CONFIG_$(PHASE_)USB_ETHER=y,\n  depends on CONFIG_NET=y/CONFIG_SPL_NET=y,\n- net/lwip/net-lwip.c only compiled if CONFIG_NET_LWIP=y, depends on\n  CONFIG_NET=y,\n- net/net.c, only compiled if CONFIG_NET_LEGACY=y, depends on\n  CONFIG_NET=y,\n- net/net-common.c, only compiled if CONFIG_NET=y,\n\nSigned-off-by: Quentin Schulz <quentin.schulz@cherry.de>\n---\n include/net-common.h | 4 ++++\n net/Kconfig          | 4 ++--\n 2 files changed, 6 insertions(+), 2 deletions(-)","diff":"diff --git a/include/net-common.h b/include/net-common.h\nindex 69b6316c1ec..0c260873c2c 100644\n--- a/include/net-common.h\n+++ b/include/net-common.h\n@@ -20,7 +20,9 @@\n  *\talignment in memory.\n  *\n  */\n+#if CONFIG_IS_ENABLED(NET)\n #define PKTBUFSRX\tCONFIG_SYS_RX_ETH_BUFFER\n+#endif\n #define PKTALIGN\tARCH_DMA_MINALIGN\n \n /* IPv4 addresses are always 32 bits in size */\n@@ -132,7 +134,9 @@ static inline void net_set_state(enum net_loop_state state)\n }\n \n extern int\t\tnet_restart_wrap;\t/* Tried all network devices */\n+#if CONFIG_IS_ENABLED(NET)\n extern uchar\t\t*net_rx_packets[PKTBUFSRX]; /* Receive packets */\n+#endif\n extern const u8\t\tnet_bcast_ethaddr[ARP_HLEN];\t/* Ethernet broadcast address */\n extern struct in_addr\tnet_ip;\t\t/* Our    IP addr (0 = unknown) */\n /* Indicates whether the pxe path prefix / config file was specified in dhcp option */\ndiff --git a/net/Kconfig b/net/Kconfig\nindex e712a0dd2ac..171a88f8ed2 100644\n--- a/net/Kconfig\n+++ b/net/Kconfig\n@@ -279,8 +279,6 @@ config TFTP_BLOCKSIZE\n \t  almost-MTU block sizes.\n \t  You can also activate CONFIG_IP_DEFRAG to set a larger block.\n \n-endif   # if NET\n-\n config SYS_RX_ETH_BUFFER\n         int \"Number of receive packet buffers\"\n         default 4\n@@ -289,3 +287,5 @@ config SYS_RX_ETH_BUFFER\n           controllers it is recommended to set this value to 8 or even higher,\n           since all buffers can be full shortly after enabling the interface on\n           high Ethernet traffic.\n+\n+endif   # if NET\n","prefixes":["RFC","next","4/5"]}