public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Tomas Pilar (tpilar)" <tpilar@solarflare.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: Network Stack Budgeting
Date: Wed, 23 Jan 2019 17:08:44 +0100	[thread overview]
Message-ID: <32137552-e2b0-4392-17c7-dedaa1f05244@redhat.com> (raw)
In-Reply-To: <6029fb15-3820-0f05-f02a-577e99592bbc@solarflare.com>

Hi,

On 01/23/19 11:55, Tomas Pilar (tpilar) wrote:
> Hi,
> 
> Recently I have done some performance improvements to my network
> driver. I am however finding that on some platforms, it's becoming
> impossible to boot if the network cable has a lot of traffic on it
> that is not filtered by the NIC itself (broadcast, multicast or
> directed unicast). It would seem the platform hangs in the DXE phase
> trying to process (drop) all the packets and not progressing through
> the boot order.
> 
> I am wondering if anyone has seen similar behaviour. Does the network
> stack have any budgeting?
> 
> Ideally this would be fixed by the network stack not calling
> Snp.Start() until in the BDS phase but it seems most platforms just
> call Snp.Start() immediately following the driver probe.

this is a platform BDS issue, on those platforms where you see the
symptom.

The set of devices connected during BDS is platform policy. It is not
the "network stack" that calls Snp.Start(), but the platform BDS code
that calls gBS->ConnectController() on the device, possibly without a
good reason (e.g. without the device being present in a UEFI boot
option). The network stack only "reacts" to that connection request.

It is convenient for a platform BDS implementation to just connect all
drivers to all devices, regardless of what devices are actually going to
be booted. Unfortunately, as the number of devices grows (or the traffic
grows, as you say), the boot performance worsens.

In OVMF and ArmVirtQemu, we saw pretty dramatic gains when we switched
from the simple+convenient approach to a bit smarter/selective approach.
And once we had fixed all the regressions too :) , it was a net win.

(Regressions because, once you switch the policy from "blanket connect"
to "specific connect", it is easy to forget about devices that are not
really "boot" devices, but you still might want to connect them in every
case. Consider a USB keyboard, or a hardware entropy device, for
example. After the switch, you have to connect those individually.)

Thanks,
Laszlo


  parent reply	other threads:[~2019-01-23 16:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-23 10:55 Network Stack Budgeting Tomas Pilar (tpilar)
2019-01-23 14:14 ` Ye, Ting
2019-01-23 14:51   ` Tomas Pilar (tpilar)
2019-01-23 16:08 ` Laszlo Ersek [this message]
2019-01-23 16:27   ` Tomas Pilar (tpilar)
2019-01-23 17:47     ` Andrew Fish
2019-01-23 22:18     ` Laszlo Ersek
2019-01-24 11:37       ` Tomas Pilar (tpilar)
2019-01-24 12:25         ` Laszlo Ersek
2019-01-24 12:58           ` Tomas Pilar (tpilar)
2019-01-24 13:25             ` Tomas Pilar (tpilar)
2019-01-24 16:49               ` Laszlo Ersek
2019-01-24 17:43                 ` Tomas Pilar (tpilar)
2019-01-25  8:44                   ` Wu, Jiaxin
2019-01-25 12:08                     ` Tomas Pilar (tpilar)
2019-01-27 14:28                       ` Fu, Siyuan
2019-01-28 11:24                         ` Tomas Pilar (tpilar)
2019-01-29  3:20                           ` Fu, Siyuan
2019-01-29 10:54                             ` Tomas Pilar (tpilar)
2019-01-29 13:06                               ` Fu, Siyuan
2019-01-29 13:12                                 ` Tomas Pilar (tpilar)
2019-01-29 13:42                               ` Laszlo Ersek
2019-01-29 13:52                                 ` Tomas Pilar (tpilar)

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-list 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=32137552-e2b0-4392-17c7-dedaa1f05244@redhat.com \
    --to=devel@edk2.groups.io \
    /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