[PATCH v2 0/3] net: ifup: greatly reduce ifup -a time for multiple network interface

Sascha Hauer sha at pengutronix.de
Fri Feb 3 00:05:38 PST 2023


On Mon, Jan 30, 2023 at 08:20:54AM +0100, Ahmad Fatoum wrote:
> So far, ifup -a tries to up all non-disabled interfaces in sequence.
> This can take a quite a while, because interfaces with the link down,
> will be polled for 10s, before giving up on doing DHCP on them.
> 
> This series accelerates this in the common case by doing link up
> check in parallel, getting down from (number_of_ports_wihout_link * 10s)
> to 10s and then adds an optimization for the common case of automounts
> with $global.net.server not set.
> 
> Times after eth_open_all has brought up CPU Ethernet and 4 DSA ports:
> 
>   barebox$ time ifup -a -s # old behavior
>   time: 31081ms
> 
>   barebox$ time ifup -a
>   time: 10002ms
> 
>   barebox$ time ifup -a1
>   time: 1072ms
> 
> Ahmad Fatoum (3):
>   net: ifup: have ifup -a poll for link up in parallel
>   net: ifup: have ifup -a1 stop at first DHCP-set global.net.server
>   defaultenv-2: automount: use ifup -a1 for NFS/TFTP automounts

Applied, thanks

Sascha

> 
>  Documentation/user/automount.rst            |   2 +-
>  defaultenv/defaultenv-2-base/boot/net       |   2 +-
>  defaultenv/defaultenv-2-base/init/automount |   4 +-
>  include/net.h                               |   5 +
>  net/eth.c                                   |  28 +++--
>  net/ifup.c                                  | 124 ++++++++++++++++----
>  net/net.c                                   |   7 +-
>  7 files changed, 138 insertions(+), 34 deletions(-)
> 
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list