• L
    util: if setting admin MAC to 00:00:00:00:00:00 fails, try 02:00:00:00:00:00 · d5f4abef
    Laine Stump 提交于
    Some PF drivers allow setting the admin MAC (that is the MAC address
    that the VF will be initialized to the next time the VF's driver is
    loaded) to 00:00:00:00:00:00, and some don't. Multiple drivers
    initialize the admin MACs to all 0, but don't allow setting it to that
    very same value. It has been an uphill battle convincing the driver
    people that it's reasonable to expect The argument that's used is
    that an all 0 device MAC address on a device is invalid; however, from
    an outsider's point of view, when the admin MAC is set to 0 at the
    time the VF driver is loaded, the VF's MAC is *not* set to 0, but to a
    random non-0 value. But that's beside the point - even if I could
    convince one or two SRIOV driver maintainers to permit setting the
    admin MAC to 0, there are still several other drivers.
    
    So rather than fighting that losing battle, this patch checks for a
    failure to set the admin MAC due to an all 0 value, and retries it
    with 02:00:00:00:00:00. That won't result in a random value being set
    in the VF MAC at next VF driver init, but that's okay, because we
    always want to set a specific value anyway. Rather, the "almost 0"
    setting makes it easy to visually detect from the output of "ip link
    show" which VFs are currently in use and which are free.
    d5f4abef
virnetdev.c 83.5 KB