mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2 0/3] net: ifup: greatly reduce ifup -a time for multiple network interface
@ 2023-01-30  7:20 Ahmad Fatoum
  2023-01-30  7:20 ` [PATCH v2 1/3] net: ifup: have ifup -a poll for link up in parallel Ahmad Fatoum
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2023-01-30  7:20 UTC (permalink / raw)
  To: barebox

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

 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




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-03  8:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-30  7:20 [PATCH v2 0/3] net: ifup: greatly reduce ifup -a time for multiple network interface Ahmad Fatoum
2023-01-30  7:20 ` [PATCH v2 1/3] net: ifup: have ifup -a poll for link up in parallel Ahmad Fatoum
2023-01-30  7:20 ` [PATCH v2 2/3] net: ifup: have ifup -a1 stop at first DHCP-set global.net.server Ahmad Fatoum
2023-01-30  7:20 ` [PATCH v2 3/3] defaultenv-2: automount: use ifup -a1 for NFS/TFTP automounts Ahmad Fatoum
2023-02-03  8:05 ` [PATCH v2 0/3] net: ifup: greatly reduce ifup -a time for multiple network interface Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox