public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Rebecca Cran <rebecca@bluestop.org>
Cc: Rebecca Cran via edk2-devel <edk2-devel@lists.01.org>
Subject: Re: OVMF and TCP4, HTTP protocols
Date: Wed, 13 Feb 2019 06:44:21 +0100	[thread overview]
Message-ID: <e5febd66-4319-d766-7bc9-3788d6100192@redhat.com> (raw)
In-Reply-To: <etPan.5c639cdf.67e2aa78.20ad@bluestop.org>

On 02/13/19 05:28, Rebecca Cran wrote:
> On February 6, 2019 at 4:08:03 PM, Rebecca Cran via edk2-devel
> (edk2-devel@lists.01.org <mailto:edk2-devel@lists.01.org>) wrote:
>>
>> Oh, that makes sense! Thanks, after disabling the existing code that was 
>> opening SNP exclusively, things started working much better. 
> 
> 
> I have a follow-up question. After opening the EFI_SIMPLE_NETWORK
> protocol exclusively, should code be able to later call
> gBS->CloseProtocol on the handle and subsequently start using TCP/HTTP? 
> 
> From what I’ve seen, closing the protocol (I’m also calling
> net->Shutdown(), and the CloseProtocol succeeds) has no effect and the
> TCP and HTTP protocols still can’t be found/used.

Sure, that's expected.

Just because an agent releases a reference to a protocol interface, no
other agent is expected to automatically bind the interface. In order to
get back from SNP to the HTTP SB, you have to re-connect the related
drivers (recursively).

"Recursive" has dual meaning here. First, it means that, given a
specific handle, and a protocol interface on that handle, another driver
-- a device driver -- can consume the protocol interace, and install
another protocol interface on the *same* handle.

The other meaning of "recursive" is that a *bus* driver may produce a
number of direct child handles (with appropriate device paths on them)
for the original handle, and install the suitable protocol interface(s)
on those child handles. In turn another driver will bind the protocol
interfaces on the child handles.

Thus "recursion" may occur on two axes -- one axis is the protocol stack
on a given, single, handle; the other axis is the hierarchy of child
handles (reflected by device paths). In the ConnectController() boot
service, the first axis is covered automatically (it is not optional).
The second axis is controlled by the "Recursive" parameter.

In your case, I think it should suffice to call ConnectController() with
Recursive=FALSE, on the controller that already has SNP. The
HttpServiceBinding, Tcp6ServiceBinding and TCPv4ServiceBinding protocols
seem to be installed on the same handle. (The device path on this handle
ends with the MAC() node.)

Once the HttpServiceBinding protocol instance exists, UEFI 2.7 "29.6.2.1
Usage Examples" provides a code example for a HTTP file download,
including IPv4 address configuration with DHCP.

Thanks,
Laszlo


  reply	other threads:[~2019-02-13  5:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-06  6:06 OVMF and TCP4, HTTP protocols Rebecca Cran
2019-02-06 16:36 ` Laszlo Ersek
2019-02-06 17:44   ` Rebecca Cran
2019-02-06 19:05     ` Laszlo Ersek
2019-02-06 23:07       ` Rebecca Cran
2019-02-13  4:28         ` Rebecca Cran
2019-02-13  5:44           ` Laszlo Ersek [this message]
2019-02-13 18:46             ` Rebecca Cran

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=e5febd66-4319-d766-7bc9-3788d6100192@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