> igc: Support ACPI-based MAC passthrough
>
> With this patch, igc_probe() looks for a system MAC address in the ACPI
> \_SB.AMAC or \MACA objects when the I225/I226 controller is
> Thunderbolt-attached. If it finds a valid "_AUXMAC_#...#" MAC, that MAC
> replaces the NVM MAC and the netdev is marked NET_ADDR_STOLEN.
MAC passthrough is a big can of worms with all sorts of corner cases
breaking systems. In general, don't do it. If you do do it, expect it
to get reverted at least once, maybe more times. That is what history
shows.
> > + if (pci_is_thunderbolt_attached(pdev) &&
> > + igc_get_acpi_mac_passthru(hw->mac.addr)) {
>
> [Severity: Medium]
> Can more than one interface end up with the same MAC address here?
>
> igc_get_acpi_mac_passthru() evaluates a global ACPI object with a NULL
> handle:
>
> status = acpi_evaluate_object(NULL, (char *)sources[i].name,
> NULL, &buffer);
>
> So every caller gets the same 6 bytes.
>
> Nothing in igc_probe() ties the NIC to a specific dock. Nothing records
> that the MAC has already been claimed, and there is no way to opt out.
>
> Every probe that passes pci_is_thunderbolt_attached() gets the same
> dev_addr. igc_reset()->igc_init_rx_addrs()->rar_set() then programs that
> address into RAR[0] on each device.
>
> Some setups where this would happen:
>
> - both ports of a dual-port I225/I226 card in a Thunderbolt PCIe enclosure
> - a generic Thunderbolt-attached I225/I226 adapter that is not an OEM dock
> - daisy-chained docks that each contain an I225/I226
> - an igc dock NIC next to an r8152 dock that also does passthrough
See the worms wriggling in the can...
Andrew