igb driver to generate random MAC address for VF interface when none assigned
ClosedPublic

Authored by skoumjian_juniper.net on Oct 31 2016, 1:40 PM.

Details

Summary

The igb driver currently requires a VF interface to have a non-zero MAC
address, but the associated PF is giving the VF an all zeros MAC address
when one is not administratively assigned. The driver should check for
this case and generate a random address, similar to how the linux igbvf
driver does.

Test Plan

My test setup is a linux host OS (for the PF) with a freebsd10 guest OS
running in a VM (for the VF). The VM has an application that creates
the igb interface and sets a MAC address for it.

I performed the following two tests.

Host OS has administratively assigned address 02:00:00:00:00:04 for igb
vf 0. Guest OS creates igb interface and attempts to assign address
02:00:00:01:00:04. Host OS rejects the set (VF 0 attempted to override
administratively set MAC address) and retains the original address.
This is expected results.

Host OS has no assigned address for igb vf 0. Guest OS creates igb
interface and attempts to assign address 02:00:00:01:00:04. Host OS
accepts the set and assigns the new address. This is expected results.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
skoumjian_juniper.net retitled this revision from to igb driver to generate random MAC address for VF interface when none assigned.Oct 31 2016, 1:40 PM
skoumjian_juniper.net updated this object.
skoumjian_juniper.net edited the test plan for this revision. (Show Details)

This seems a sensible implementation. I have no objection.

Remove inadvertant whitespace addition.

Remove inadvertant debug device_printf.

sbruno accepted this revision.Nov 2 2016, 2:52 PM

Do you want me to commit this as is?

This revision is now accepted and ready to land.Nov 2 2016, 2:52 PM

I was hoping for some feedback from the Intel folks about this change. To me, it seems to make sense given that's how the other VF drivers work. If there are no other comments, then yes please commit as is. Thanks.

Please proceed to commit this as is. Thanks.

This revision was automatically updated to reflect the committed changes.
erj added a subscriber: erj.Nov 7 2016, 10:40 PM

I was late to commenting on it, but it looked fine to me. It looks like it's similar to the ixgbe code.