[ipxe-devel] [PATCH 4/4] [virtio] Add virtio-net 1.0 support

Ladi Prosek lprosek at redhat.com
Fri Mar 11 13:26:42 UTC 2016


On Thu, Mar 10, 2016 at 5:46 PM, Michael Brown <mcb30 at ipxe.org> wrote:
> On 10/03/16 14:52, Ladi Prosek wrote:
>>>>
>>>> +static int virtnet_probe ( struct pci_device *pci ) {
>>>> +     int rc = virtnet_probe_modern ( pci );
>>>> +     if ( rc == -ENODEV ) {
>>>> +             /* fall back to the legacy probe */
>>>> +             rc = virtnet_probe_legacy ( pci );
>>>> +     }
>>>> +     return rc;
>>>> +}
>
>
> Please find a way to do this that doesn't involve testing the error return
> status.  (Error values in iPXE vary depending on the file, and so checks for
> specific error values may break if code is refactored into multiple files in
> future.)

Will do, thanks!

> If the PCI device ID is sufficient to differentiate between legacy/modern,
> then the easiest change is probably to use the id->driver_data field; see
> e.g. INTEL_PBS_ERRATA in drivers/net/intel.c.

Using the device ID for this is something we explicitly don't want to
do. Even the old ID may support the modern protocol.

> Michael



More information about the ipxe-devel mailing list