Author: sbruno Date: Mon Nov 7 22:24:37 2016 New Revision: 308429 URL: https://svnweb.freebsd.org/changeset/base/308429
Log: 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. Submitted by: skoumj...@juniper.net (Scott Koumjian) MFH: 2 weeks Differential Revision: https://reviews.freebsd.org/D8399 Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Mon Nov 7 21:15:39 2016 (r308428) +++ head/sys/dev/e1000/if_igb.c Mon Nov 7 22:24:37 2016 (r308429) @@ -590,11 +590,20 @@ igb_attach(device_t dev) error = EIO; goto err_late; } - /* Check its sanity */ - if (!igb_is_valid_ether_addr(adapter->hw.mac.addr)) { - device_printf(dev, "Invalid MAC address\n"); - error = EIO; - goto err_late; + + /* Check its sanity */ + if (!igb_is_valid_ether_addr(adapter->hw.mac.addr)) { + if (adapter->vf_ifp) { + u8 addr[ETHER_ADDR_LEN]; + arc4rand(&addr, sizeof(addr), 0); + addr[0] &= 0xFE; + addr[0] |= 0x02; + bcopy(addr, adapter->hw.mac.addr, sizeof(addr)); + } else { + device_printf(dev, "Invalid MAC address\n"); + error = EIO; + goto err_late; + } } /* Setup OS specific network interface */ _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"