[PATCH v2 05/19] net: Move SYS_RX_ETH_BUFFER into the network menu
Simon Glass
sjg at chromium.org
Thu Aug 31 05:52:59 CEST 2023
Move this Kconfig option into the correct place, so it doesn't show up
in the top-level menu.
Unfortunately this makes the CONFIG undefined on some boards which don't
enable CONFIG_NET but do include the net.h header file. In fact that
header is included from a lot of common places. So use a fallback in the
header file.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
(no changes since v1)
include/net.h | 9 ++++++---
net/Kconfig | 4 ++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/include/net.h b/include/net.h
index e254df7d7f43..f70396c74ba5 100644
--- a/include/net.h
+++ b/include/net.h
@@ -31,11 +31,14 @@ struct udevice;
#define DEBUG_INT_STATE 0 /* Internal network state changes */
/*
- * The number of receive packet buffers, and the required packet buffer
- * alignment in memory.
- *
+ * The number of receive packet buffers, and the required packet buffer
+ * alignment in memory.
*/
+#ifdef CONFIG_SYS_RX_ETH_BUFFER
#define PKTBUFSRX CONFIG_SYS_RX_ETH_BUFFER
+#else
+#define PKTBUFSRX 4
+#endif
#define PKTALIGN ARCH_DMA_MINALIGN
/* Number of packets processed together */
diff --git a/net/Kconfig b/net/Kconfig
index 4215889127c9..a13ab1d80a0d 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -252,8 +252,6 @@ config IPV6
ip6addr, serverip6. If a u-boot command is capable to parse an IPv6
address and find it, it will force using IPv6 in the network stack.
-endif # if NET
-
config SYS_RX_ETH_BUFFER
int "Number of receive packet buffers"
default 4
@@ -262,3 +260,5 @@ config SYS_RX_ETH_BUFFER
controllers it is recommended to set this value to 8 or even higher,
since all buffers can be full shortly after enabling the interface on
high Ethernet traffic.
+
+endif # if NET
--
2.42.0.rc2.253.gd59a3bf2b4-goog
More information about the U-Boot
mailing list