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

Michael Brown mcb30 at ipxe.org
Fri Mar 11 14:07:30 UTC 2016


On 11/03/16 13:37, Michael S. Tsirkin wrote:
> On Thu, Mar 10, 2016 at 04:46:25PM +0000, Michael Brown 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.)
>
> Maybe simply virtnet_probe_modern(..., bool *legacy_fallback).

Or just try the modern probe, and if that fails then try the legacy 
probe.  It doesn't really matter if we redundantly try a legacy probe 
when the modern probe failed for some other reason: driver probe is not 
a path that cares about performance.

Michael



More information about the ipxe-devel mailing list