Created attachment 222466 [details] em VF MAC address patch I have a host with I350 Ethernet Controller Virtual Function [8086:1520], when I try to passthrough it into FreeBSD (running on QEMU '-device vfio-pci,host=04:10.1') I get an error: igb0: Invalid MAC address igb0: IFDI_ATTACH_PRE failed 5 device_attach: igb0 attach returned 5 After applying patch (attached) everthing works fine: igb0: Generate a random address igb0: Using 1024 TX descriptors and 1024 RX descriptors igb0: Using 1 RX queues 1 TX queues igb0: Using MSI-X interrupts with 2 vectors igb0: Ethernet address: 7e:da:23:50:00:1d igb0: link state changed to UP igb0: netmap queues/slots: TX 1/1024, RX 1/1024 This problem was fixed in igb driver: https://reviews.freebsd.org/rS308429. But after merging igb into em driver, it was lost.
https://reviews.freebsd.org/D29785
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=68a46f11eadab48a1da9e3d3900569a6a1ce142e commit 68a46f11eadab48a1da9e3d3900569a6a1ce142e Author: Kevin Bowling <kbowling@FreeBSD.org> AuthorDate: 2021-04-15 18:45:02 +0000 Commit: Kevin Bowling <kbowling@FreeBSD.org> CommitDate: 2021-04-15 18:45:02 +0000 e1000: Restore VF interface random MAC Restore 525e07418c77 after the iflib conversion of igb(4). This reenables random MAC address generation when attaching to a VF with a zeroed MAC. PR: 253535 Reported by: Balaev PA <mail@void.so> Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29785 sys/dev/e1000/if_em.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=1a34afa9541e9e086451786a168c6fed634eb05b commit 1a34afa9541e9e086451786a168c6fed634eb05b Author: Kevin Bowling <kbowling@FreeBSD.org> AuthorDate: 2021-04-15 18:45:02 +0000 Commit: Kevin Bowling <kbowling@FreeBSD.org> CommitDate: 2021-04-29 01:22:16 +0000 e1000: Restore VF interface random MAC Restore 525e07418c77 after the iflib conversion of igb(4). This reenables random MAC address generation when attaching to a VF with a zeroed MAC. PR: 253535 Reported by: Balaev PA <mail@void.so> Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29785 (cherry picked from commit 68a46f11eadab48a1da9e3d3900569a6a1ce142e) sys/dev/e1000/if_em.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=50cebb6a8596eaccca5c6ea6f0fbc871d0197ef3 commit 50cebb6a8596eaccca5c6ea6f0fbc871d0197ef3 Author: Kevin Bowling <kbowling@FreeBSD.org> AuthorDate: 2021-04-15 18:45:02 +0000 Commit: Kevin Bowling <kbowling@FreeBSD.org> CommitDate: 2021-04-29 01:23:07 +0000 e1000: Restore VF interface random MAC Restore 525e07418c77 after the iflib conversion of igb(4). This reenables random MAC address generation when attaching to a VF with a zeroed MAC. PR: 253535 Reported by: Balaev PA <mail@void.so> Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29785 (cherry picked from commit 68a46f11eadab48a1da9e3d3900569a6a1ce142e) sys/dev/e1000/if_em.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
Thanks for your contribution!