Re: [edk2] [PATCH 00/15] OvmfPkg: introduce virtio-net driver

Subject: Re: [edk2] [PATCH 00/15] OvmfPkg: introduce virtio-net driver

From: Gerd Hoffmann <kraxel@redhat.com>

To: Laszlo Ersek <lersek@redhat.com>

Date: 2013-05-07 16:07:56

  Hi,

> The -D NETWORK_ENABLE build switch enables and embeds the following
> drivers in the firmware image (not mentioning VirtioNetDxe now):

> This is the generic edk2 network stack. The only missing link is the
> lowest level, hardware NIC driver.

Yes.

> Currently, -D NETWORK_ENABLE also adds that link for the e1000 card: the
> DSC file doesn't mention the driver (because we don't build it), but the
> FDF file does (because we embed the pre-built binary):
> 
>   FILE DRIVER = 5D695E11-9B3F-4b83-B25F-4A8D5D69BE07 {
>     SECTION PE32 = Intel3.5/EFIX64/E3507X2.EFI
>   }

Yes.

> - "generic network stack + e1000 driver" makes sense,
> - "generic network stack + virtio-net driver" also makes sense,
> - "generic network stack + some other NIC driver" would also make sense.

Yes.

> *However*, the EFI option ROMs coming with / from qemu-1.5 are *not*
> UEFI NIC drivers. By that I mean that they don't implement Simple
> Network Protocol, or Managed Network Protocol, or a UNDI driver.

I don't think so:

Shell> devtree
[ ... ]
    Ctrl[7F] QEMU Video PCI Adapter
    Ctrl[80] PciRoot(0x0)/Pci(0x3,0x0)
      Ctrl[8D] iPXE net0 (52:54:00:12:34:56)
        Ctrl[8F] MNP (MAC=52-54-00-12-34-56, ProtocolType=0x806, VlanId=0)
        Ctrl[90] MNP (Not started)
        Ctrl[92] MNP (MAC=52-54-00-12-34-56, ProtocolType=0x800, VlanId=0)
        Ctrl[8E]
PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/VenHw(D79DF6B0-EF44-43BD-9797-43E93BCF5FA8)
        Ctrl[91]
PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400123456,0x1)/VenHw(D8944553-C4DD-41F4-9B30-E1397CFB267B)
        Ctrl[9A] 

Guess the MNP there means ipxe implements a Managed Network Protocol driver.

> What the option ROMs contain instead is a UEFI *application*, called
> iPXE. iPXE happens to be a PXE boot loader. It drives the hardware at
> the lowest level and has a huge number of NIC drivers *for itself*.

That exists too, but that isn't in the qemu roms.

You get that with "make bin-${arch}-efi/${VID}${DID}.efirom".

> Those drivers don't conform to anything else than the iPXE-internal
> driver interface. Among them there's a virtio-net driver
> (src/drivers/net/virtio-net.c), and just for kicks, there is even a
> "glue driver" available that presents a preexistent Simple Network
> Protocol driver to iPXE under the iPXE-internal driver interface
> (src/drivers/net/efi/snp*).

There also is some glue to register ipxe drivers in the uefi network stack.

You get that with "make bin-${arch}-efi/${VID}${DID}.efidrv", and this
is what the qemu roms contain.

> Conversely, the NIC drivers inside iPXE are unusable by the edk2 network
> stack (eg. shell command line or AppPkg/StdLib applications).

ifconfig WorksForMe[tm].

> What speaks against building & including VirtioNetDxe + the rest of the
> generic network stack per default though?

Nothing ;)

cheers,
  Gerd


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel