mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH v2 0/3] net: ifup: greatly reduce ifup -a time for multiple network interface
Date: Mon, 30 Jan 2023 08:20:54 +0100	[thread overview]
Message-ID: <20230130072057.34349-1-a.fatoum@pengutronix.de> (raw)

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




             reply	other threads:[~2023-01-30 17:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30  7:20 Ahmad Fatoum [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230130072057.34349-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox