<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/net, branch v2025.04</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>net: lwip: Remove error print on failed tx</title>
<updated>2025-03-31T07:46:25+00:00</updated>
<author>
<name>Ilias Apalodimas</name>
<email>ilias.apalodimas@linaro.org</email>
</author>
<published>2025-03-26T08:28:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f93b15e70649d0639b71206abf03ca34184a0ed3'/>
<id>f93b15e70649d0639b71206abf03ca34184a0ed3</id>
<content type='text'>
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 &lt;ilias.apalodimas@linaro.org&gt;
Reviewed-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;ilias.apalodimas@linaro.org&gt;
Reviewed-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: lwip: do_ping() should return CMD_RET_FAILURE when no device</title>
<updated>2025-03-31T07:46:25+00:00</updated>
<author>
<name>Jerome Forissier</name>
<email>jerome.forissier@linaro.org</email>
</author>
<published>2025-03-14T08:44:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=42df30a210c07c020b96a1d13d066125bd5f0ffd'/>
<id>42df30a210c07c020b96a1d13d066125bd5f0ffd</id>
<content type='text'>
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 &lt;jerome.forissier@linaro.org&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;jerome.forissier@linaro.org&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>miiphy: define mii_devs with LIST_HEAD()</title>
<updated>2025-03-04T14:03:47+00:00</updated>
<author>
<name>Weijie Gao</name>
<email>hackpascal@gmail.com</email>
</author>
<published>2025-01-25T15:26:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7e0370f37d242f45d2fcfa3ab727d48f88ccace9'/>
<id>7e0370f37d242f45d2fcfa3ab727d48f88ccace9</id>
<content type='text'>
When enabling net console and console multiplexing, a boot crash was
observed using mtk_eth driver with stdin/stdout set to "serial,nc"
in persistent environment:

&gt; CPU:   MediaTek MT7981
&gt; Model: OpenWrt One
&gt; DRAM:  1 GiB
&gt; Core:  35 devices, 15 uclasses, devicetree: separate
&gt; spi-nand: spi_nand spi_nand@0: Winbond SPI NAND was found.
&gt; spi-nand: spi_nand spi_nand@0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
&gt; Loading Environment from UBI... SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
&gt; mtd: partition "ubi" extends beyond the end of device "spi-nand0" -- size truncated to 0x7f00000
&gt; Read 126976 bytes from volume ubootenv to 000000007f7bf0c0
&gt; Read 126976 bytes from volume ubootenv2 to 000000007f7de100
&gt; OK
&gt; "Synchronous Abort" handler, esr 0x96000004, far 0xeafffffeea000018
&gt; elr: 0000000041e63cd4 lr : 0000000041e1b844 (reloc)
&gt; elr: 000000007ff9ecd4 lr : 000000007ff56844
&gt; x0 : eafffffeea000018 x1 : 000000007fb552e0
&gt; x2 : 00000000000000fe x3 : 0000000000000000

The cause is that "serial,nc" forced the console subsystem to
initialize the ethernet driver before ethernet subsystem
initialization (console_init_r() is called before initr_net()).

During the mtk_eth driver initialization, mdio_register() will be
called, and miiphy_get_dev_by_name() will then be called.

The miiphy_get_dev_by_name() will check the list "mii_devs" to see
if the passed device name exists. However the mii_devs is defined
without initialization:
&gt; static struct list_head mii_devs;
and the actual initialization is done in the following chain:
initr_net -&gt; eth_initialize -&gt; eth_common_init -&gt; miiphy_init
Since initr_net() hasn't be called, iterating over the mii_devs
will access to physical address 0 (mii_devs.next == NULL) and will
cause the crash.

The fix is to define mii_devs using:
&gt; static LIST_HEAD(mii_devs);

As the "current_mii" is defined as a static variable, it will
always be NULL in board_r stage and initializing it will NULL is
unnecessary. So the entire miiphy_init() can be remove.

Signed-off-by: Weijie Gao &lt;hackpascal@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When enabling net console and console multiplexing, a boot crash was
observed using mtk_eth driver with stdin/stdout set to "serial,nc"
in persistent environment:

&gt; CPU:   MediaTek MT7981
&gt; Model: OpenWrt One
&gt; DRAM:  1 GiB
&gt; Core:  35 devices, 15 uclasses, devicetree: separate
&gt; spi-nand: spi_nand spi_nand@0: Winbond SPI NAND was found.
&gt; spi-nand: spi_nand spi_nand@0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
&gt; Loading Environment from UBI... SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
&gt; mtd: partition "ubi" extends beyond the end of device "spi-nand0" -- size truncated to 0x7f00000
&gt; Read 126976 bytes from volume ubootenv to 000000007f7bf0c0
&gt; Read 126976 bytes from volume ubootenv2 to 000000007f7de100
&gt; OK
&gt; "Synchronous Abort" handler, esr 0x96000004, far 0xeafffffeea000018
&gt; elr: 0000000041e63cd4 lr : 0000000041e1b844 (reloc)
&gt; elr: 000000007ff9ecd4 lr : 000000007ff56844
&gt; x0 : eafffffeea000018 x1 : 000000007fb552e0
&gt; x2 : 00000000000000fe x3 : 0000000000000000

The cause is that "serial,nc" forced the console subsystem to
initialize the ethernet driver before ethernet subsystem
initialization (console_init_r() is called before initr_net()).

During the mtk_eth driver initialization, mdio_register() will be
called, and miiphy_get_dev_by_name() will then be called.

The miiphy_get_dev_by_name() will check the list "mii_devs" to see
if the passed device name exists. However the mii_devs is defined
without initialization:
&gt; static struct list_head mii_devs;
and the actual initialization is done in the following chain:
initr_net -&gt; eth_initialize -&gt; eth_common_init -&gt; miiphy_init
Since initr_net() hasn't be called, iterating over the mii_devs
will access to physical address 0 (mii_devs.next == NULL) and will
cause the crash.

The fix is to define mii_devs using:
&gt; static LIST_HEAD(mii_devs);

As the "current_mii" is defined as a static variable, it will
always be NULL in board_r stage and initializing it will NULL is
unnecessary. So the entire miiphy_init() can be remove.

Signed-off-by: Weijie Gao &lt;hackpascal@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>legacy-net: wget: fix wget_info handling after new tcp legacy stack</title>
<updated>2025-02-28T14:26:05+00:00</updated>
<author>
<name>Adriano Cordova</name>
<email>adrianox@gmail.com</email>
</author>
<published>2025-02-06T17:40:11+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=32a6c5eac0004bcfbb75d7ff9e9d627aca0e2852'/>
<id>32a6c5eac0004bcfbb75d7ff9e9d627aca0e2852</id>
<content type='text'>
Check wget_info-&gt;buffer_size for overflow and do not clean the wget_info struct
on failure, let the owner of the struct handle the error. The latter is necesary
, e.g., for when a request fails because the provided buffer was too small.

Signed-off-by: Adriano Cordova &lt;adriano.cordova@canonical.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Check wget_info-&gt;buffer_size for overflow and do not clean the wget_info struct
on failure, let the owner of the struct handle the error. The latter is necesary
, e.g., for when a request fails because the provided buffer was too small.

Signed-off-by: Adriano Cordova &lt;adriano.cordova@canonical.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: Kconfig: depend on DM_RNG for WGET_HTTPS</title>
<updated>2025-02-12T18:37:24+00:00</updated>
<author>
<name>Jerome Forissier</name>
<email>jerome.forissier@linaro.org</email>
</author>
<published>2025-02-04T16:00:49+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a091d173e32b98fe372b5b02d4e25c81f1bc9dc1'/>
<id>a091d173e32b98fe372b5b02d4e25c81f1bc9dc1</id>
<content type='text'>
net/lwip/wget.c/mbedtls_hardware_poll() is calling dm_rng_read() but
dependency is not recorded anywhere that's why depend on DM_RNG
when WGET_HTTPS is used.

Suggested-by: Michal Simek &lt;michal.simek@amd.com&gt;
Co-developed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Signed-off-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Tested-by: Michal Simek &lt;michal.simek@amd.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
net/lwip/wget.c/mbedtls_hardware_poll() is calling dm_rng_read() but
dependency is not recorded anywhere that's why depend on DM_RNG
when WGET_HTTPS is used.

Suggested-by: Michal Simek &lt;michal.simek@amd.com&gt;
Co-developed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Signed-off-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Tested-by: Michal Simek &lt;michal.simek@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: lwip: move eth_init() out of new_netif()</title>
<updated>2025-02-12T18:36:57+00:00</updated>
<author>
<name>Jerome Forissier</name>
<email>jerome.forissier@linaro.org</email>
</author>
<published>2025-01-30T08:22:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9f6b9f57fefa391018083c42bc3de9f33ea3bd90'/>
<id>9f6b9f57fefa391018083c42bc3de9f33ea3bd90</id>
<content type='text'>
Move the initialization of the ethernet devices out of the new_netif()
function. Indeed, new_netif() accepts a struct device argument, which
is expected to be valid and active. The activation and selection of
this device are achieved by eth_init() (on first time the network
stack is used) and eth_set_current(). This is what takes care of the
ethrotate and ethact environment variables. Therefore, move these calls
to a new function: net_lwip_set_current(), and use it whenever a
net-lwip command is run.

This patch hopefully fixes the incorrect net-lwip behavior observed on
boards with multiple ethernet interfaces [1].

Tested on an i.MX8MPlus EVK equipped wih two ethernet ports. The dhcp
command succeeds whether the cable is plugged into the first or second
port.

[1] https://lists.denx.de/pipermail/u-boot/2025-January/576326.html

Reported-by: E Shattow &lt;e@freeshell.de&gt;
Tested-by: E Shattow &lt;e@freeshell.de&gt;
Signed-off-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the initialization of the ethernet devices out of the new_netif()
function. Indeed, new_netif() accepts a struct device argument, which
is expected to be valid and active. The activation and selection of
this device are achieved by eth_init() (on first time the network
stack is used) and eth_set_current(). This is what takes care of the
ethrotate and ethact environment variables. Therefore, move these calls
to a new function: net_lwip_set_current(), and use it whenever a
net-lwip command is run.

This patch hopefully fixes the incorrect net-lwip behavior observed on
boards with multiple ethernet interfaces [1].

Tested on an i.MX8MPlus EVK equipped wih two ethernet ports. The dhcp
command succeeds whether the cable is plugged into the first or second
port.

[1] https://lists.denx.de/pipermail/u-boot/2025-January/576326.html

Reported-by: E Shattow &lt;e@freeshell.de&gt;
Tested-by: E Shattow &lt;e@freeshell.de&gt;
Signed-off-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: eth_bootdev_hunt() should not run DHCP</title>
<updated>2025-01-05T01:30:48+00:00</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2024-11-27T07:06:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1f68057e03206e6597ca8b2be8bb1c49d4bd47d0'/>
<id>1f68057e03206e6597ca8b2be8bb1c49d4bd47d0</id>
<content type='text'>
Currently when booting dhcp_run() may be executed multiple times:
once in eth_bootdev_hunt() and once in the network booting bootmeth.

We need to call eth_bootdev_hunt() when setting up the EFI sub-system to
supply the simple network protocol. We don't need an IP address set up.

We can reduce the bootime by not executing dhcp_run() in
eth_bootdev_hunt().

Furthermore eth_bootdev_hunt() with autostart=yes leads on the legacy
network stack leads to downloading a file via TFTP and to booting the
downloaded file.

Instead of running dchp_run() just check that there is a network device
in eth_bootdev_hunt().

Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently when booting dhcp_run() may be executed multiple times:
once in eth_bootdev_hunt() and once in the network booting bootmeth.

We need to call eth_bootdev_hunt() when setting up the EFI sub-system to
supply the simple network protocol. We don't need an IP address set up.

We can reduce the bootime by not executing dhcp_run() in
eth_bootdev_hunt().

Furthermore eth_bootdev_hunt() with autostart=yes leads on the legacy
network stack leads to downloading a file via TFTP and to booting the
downloaded file.

Instead of running dchp_run() just check that there is a network device
in eth_bootdev_hunt().

Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix neighbor discovery ethernet address saving</title>
<updated>2025-01-01T20:40:04+00:00</updated>
<author>
<name>Sean Edmond</name>
<email>seanedmond@microsoft.com</email>
</author>
<published>2024-04-29T18:51:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ec9263b4f15c4cf82eb6a211c67baa6385065b8e'/>
<id>ec9263b4f15c4cf82eb6a211c67baa6385065b8e</id>
<content type='text'>
When a successful neighbor advertisement is received, the ethernet
address should be saved for later use to avoid having to redo the
neighbor discovery process.

For example, with TFTP the address should get saved into
"net_server_ethaddr".  This is being done correctly with ARP for IPv4,
but not for neighbor discovery with IPv6.

Signed-off-by: Sean Edmond &lt;seanedmond@microsoft.com&gt;
Reviewed-by: Viacheslav Mitrofanov &lt;v.v.mitrofanov@yadro.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a successful neighbor advertisement is received, the ethernet
address should be saved for later use to avoid having to redo the
neighbor discovery process.

For example, with TFTP the address should get saved into
"net_server_ethaddr".  This is being done correctly with ARP for IPv4,
but not for neighbor discovery with IPv6.

Signed-off-by: Sean Edmond &lt;seanedmond@microsoft.com&gt;
Reviewed-by: Viacheslav Mitrofanov &lt;v.v.mitrofanov@yadro.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: tftpput: reset timeout_count when an ACK is received</title>
<updated>2025-01-01T20:40:04+00:00</updated>
<author>
<name>Jerome Forissier</name>
<email>jerome.forissier@linaro.org</email>
</author>
<published>2024-11-29T14:47:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=eeee0e2b850d2b76d102fc1acca9e3101b1baf3a'/>
<id>eeee0e2b850d2b76d102fc1acca9e3101b1baf3a</id>
<content type='text'>
timeout_count is never reset once a tftpput transfer has started. If for
whatever reason timeouts occur frequently, but the server keeps replying
nonetheless, the transfer may be needlessly aborted.

Reset timer_count on reception of an ACK to avoid this situation.

Signed-off-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Signed-off-by: Mikhail Kshevetskiy &lt;mikhail.kshevetskiy@iopsys.eu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
timeout_count is never reset once a tftpput transfer has started. If for
whatever reason timeouts occur frequently, but the server keeps replying
nonetheless, the transfer may be needlessly aborted.

Reset timer_count on reception of an ACK to avoid this situation.

Signed-off-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Signed-off-by: Mikhail Kshevetskiy &lt;mikhail.kshevetskiy@iopsys.eu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: tftpboot: clear timeout_count on every successful block</title>
<updated>2025-01-01T20:35:46+00:00</updated>
<author>
<name>Mikhail Kshevetskiy</name>
<email>mikhail.kshevetskiy@iopsys.eu</email>
</author>
<published>2025-01-01T03:20:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=395ee74991aaeac3c0ba0aa505f108571a107da7'/>
<id>395ee74991aaeac3c0ba0aa505f108571a107da7</id>
<content type='text'>
We have a some boards that rarely starts networking abnormally, so there are
many timeouts during file transfer. In the same time there is a normal transfer
between timeouts. In this case we can continue transfer (instead of connection
aborting) by just clearing timeout counter on every successful block.

This patch does not affect the case when several timeouts happen one after
another. The transfer will be aborted. Thus the transfer will be
continued in the case of unstable link, but will be aborted in the case
of inaccessible server.

Feature downside: it may greatly slowdown (instead of abort) file transfer
in the case of unstable link.

Signed-off-by: Mikhail Kshevetskiy &lt;mikhail.kshevetskiy@iopsys.eu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have a some boards that rarely starts networking abnormally, so there are
many timeouts during file transfer. In the same time there is a normal transfer
between timeouts. In this case we can continue transfer (instead of connection
aborting) by just clearing timeout counter on every successful block.

This patch does not affect the case when several timeouts happen one after
another. The transfer will be aborted. Thus the transfer will be
continued in the case of unstable link, but will be aborted in the case
of inaccessible server.

Feature downside: it may greatly slowdown (instead of abort) file transfer
in the case of unstable link.

Signed-off-by: Mikhail Kshevetskiy &lt;mikhail.kshevetskiy@iopsys.eu&gt;
</pre>
</div>
</content>
</entry>
</feed>
