From 6d66a72a0acbbdcaed89bcbfabdbd86db37e49ac Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Wed, 12 Mar 2025 08:37:50 +0100 Subject: [PATCH 1/5] net: lwip: remove superfluous newline at tftp help text The help text has a newline at the end which will lead to an empty line after the tftpboot when printing the help overview. Remove it. Fixes: 4d4d7838127e ("net: lwip: add TFTP support and tftpboot command") Signed-off-by: Michael Walle Reviewed-by: Jerome Forissier --- cmd/net-lwip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/net-lwip.c b/cmd/net-lwip.c index 0fd446ecb20..249556243d6 100644 --- a/cmd/net-lwip.c +++ b/cmd/net-lwip.c @@ -17,7 +17,7 @@ U_BOOT_CMD(ping, 2, 1, do_ping, "send ICMP ECHO_REQUEST to network host", #if defined(CONFIG_CMD_TFTPBOOT) U_BOOT_CMD(tftpboot, 3, 0, do_tftpb, - "boot image via network using TFTP protocol\n", + "boot image via network using TFTP protocol", "[loadAddress] [[hostIPaddr:]bootfilename]"); #endif From 42df30a210c07c020b96a1d13d066125bd5f0ffd Mon Sep 17 00:00:00 2001 From: Jerome Forissier Date: Fri, 14 Mar 2025 09:44:10 +0100 Subject: [PATCH 2/5] net: lwip: do_ping() should return CMD_RET_FAILURE when no device do_ping() expects ping_loop() to return a negative value on error, so that it can propagate it to the caller as CMD_RET_FAILURE. This is not the case when no ethernet device is found, so fix that. Signed-off-by: Jerome Forissier Reviewed-by: Ilias Apalodimas --- net/lwip/ping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/lwip/ping.c b/net/lwip/ping.c index 200a702bbb5..c586a96806d 100644 --- a/net/lwip/ping.c +++ b/net/lwip/ping.c @@ -121,7 +121,7 @@ static int ping_loop(struct udevice *udev, const ip_addr_t *addr) netif = net_lwip_new_netif(udev); if (!netif) - return CMD_RET_FAILURE; + return -ENODEV; printf("Using %s device\n", udev->name); From 36510e4e41fdcb3188f44cd53d48c6e0c67c236a Mon Sep 17 00:00:00 2001 From: Jerome Forissier Date: Fri, 21 Mar 2025 13:42:14 +0100 Subject: [PATCH 3/5] net: remove commented out line Commit 1d5d292b7941 ("net: split net into net{,-common,-legacy,-lwip}") inadvertendly left a commented out declaration for do_wget() in net-common.h. Remove it. Signed-off-by: Jerome Forissier Reviewed-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas --- include/net-common.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/net-common.h b/include/net-common.h index 29d31f37263..89679e20860 100644 --- a/include/net-common.h +++ b/include/net-common.h @@ -518,7 +518,6 @@ int wget_do_request(ulong dst_addr, char *uri); * Return: true if uri is valid, false if uri is invalid */ bool wget_validate_uri(char *uri); -//int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]); /** * enum wget_http_method - http method From f93b15e70649d0639b71206abf03ca34184a0ed3 Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Wed, 26 Mar 2025 10:28:58 +0200 Subject: [PATCH 4/5] net: lwip: Remove error print on failed tx When an ethernet driver fails to send a frame we print an error in lwIP. But depending on how often that error is it might significantly delay transmissions. For example downloading a big file with the rpi4 spams the console with 'send error: -101', but removing the print makes the file download with an average speed of ~8.5MiB/s since the packets are retransmitted. So let's move it to a 'debug' in lwIP and expect ethernet drivers to handle the failure if it's severe. Signed-off-by: Ilias Apalodimas Reviewed-by: Jerome Forissier --- net/lwip/net-lwip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c index cab1dd7d483..4d2aa6099dd 100644 --- a/net/lwip/net-lwip.c +++ b/net/lwip/net-lwip.c @@ -50,7 +50,7 @@ static err_t linkoutput(struct netif *netif, struct pbuf *p) err = eth_get_ops(udev)->send(udev, pp ? pp : p->payload, p->len); free(pp); if (err) { - log_err("send error %d\n", err); + debug("send error %d\n", err); return ERR_ABRT; } From 64b973fc78fdba18389d372d6af2af18ee79dd8c Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Fri, 7 Mar 2025 15:15:29 +0000 Subject: [PATCH 5/5] cmd: Kconfig: Fix submenu for network commands The Kconfig parser seems to get confused by the current if conditions following CMD_NET and displays all network command options directly in the "Command line interface" menu instead of in a "Network commands" submenu. To help out Kconfig we can simplify the if conditions, so that the definition of CMD_NET is followed immediately by an if/endif block that contains all network command options. We can also remove nested checks for CMD_NET or (NET || NET_LWIP). Fixes: 98ad145db61a ("net: lwip: add DHCP support and dhcp commmand") Signed-off-by: Paul Barker Reviewed-by: Jerome Forissier --- cmd/Kconfig | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index 642cc1116e8..ce8393c72da 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1833,12 +1833,10 @@ menuconfig CMD_NET bool "Network commands" default y -endif +if CMD_NET if NET -if CMD_NET - config CMD_BOOTP bool "bootp" default y @@ -2079,7 +2077,6 @@ config IPV6_ROUTER_DISCOVERY help Will automatically perform router solicitation on first IPv6 network operation -endif # if CMD_NET config CMD_ETHSW bool "ethsw" @@ -2096,10 +2093,6 @@ config CMD_WOL endif # if NET -if NET || NET_LWIP - -if CMD_NET - config CMD_DHCP bool "dhcp" select PROT_DHCP_LWIP if NET_LWIP @@ -2175,8 +2168,6 @@ config WGET_HTTPS help Enable TLS over http for wget. -endif # if CMD_NET - config CMD_PXE bool "pxe" select PXE_UTILS @@ -2184,7 +2175,9 @@ config CMD_PXE help Boot image via network using PXE protocol -endif # if NET || NET_LWIP +endif # if CMD_NET + +endif # NET || NET_LWIP menu "Misc commands"