Index: sys/dev/ixl/if_ixl.c =================================================================== --- sys/dev/ixl/if_ixl.c +++ sys/dev/ixl/if_ixl.c @@ -397,6 +397,7 @@ u16 bus; int error = 0; #ifdef PCI_IOV + nvlist_t *pf_schema, *vf_schema; int iov_error; #endif @@ -723,7 +724,11 @@ #ifdef PCI_IOV /* SR-IOV is only supported when MSI-X is in use. */ if (pf->msix > 1) { - iov_error = pci_iov_attach(dev, NULL, NULL); + pf_schema = pci_iov_schema_alloc_node(); + vf_schema = pci_iov_schema_alloc_node(); + pci_iov_schema_add_unicast_mac(vf_schema, "mac-addr", 0, NULL); + + iov_error = pci_iov_attach(dev, pf_schema, vf_schema); if (iov_error != 0) device_printf(dev, "Failed to initialize SR-IOV (error=%d)\n", @@ -6628,6 +6633,8 @@ char sysctl_name[QUEUE_NAME_LEN]; struct ixl_pf *pf; struct ixl_vf *vf; + const void *mac; + size_t size; int error; pf = device_get_softc(dev); @@ -6644,6 +6651,12 @@ if (error != 0) goto out; + if (nvlist_exists_binary(params, "mac-addr")) { + mac = nvlist_get_binary(params, "mac-addr", &size); + bcopy(mac, vf->mac, ETHER_ADDR_LEN); + } else + vf->vf_flags |= VF_FLAG_SET_MAC_CAP; + vf->vf_flags |= VF_FLAG_VLAN_CAP; ixl_reset_vf(pf, vf); Index: sys/dev/ixl/ixl.h =================================================================== --- sys/dev/ixl/ixl.h +++ sys/dev/ixl/ixl.h @@ -46,7 +46,6 @@ #include #include #include -#include #include #include @@ -91,6 +90,11 @@ #include #include +#ifdef PCI_IOV +#include +#include +#endif + #include "i40e_type.h" #include "i40e_prototype.h"