On 04/12/2026 3:28, Andrew Lunn wrote:
>> 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
Hi Andrew,
Indeed, my experience also shows that MAC passthrough is difficult to get to work smoothly. That is because it tries to balance ease-of-use and "seamlessness" with generality and "not breaking systems".
After trying many approaches, we narrowed down to this particular implementation as one that balances these requirements in a way that seems, to me, near-optimal.
1. It is driven by a user-configurable BIOS setting stored in the ACPI tables. This gives the user (whether an individual or a corporate policy driver) full control over it on the system-level.
2. It is tied to a system setting, and not a controller setting, which is how it should be for the seamless experience. The goal is to be able to connect to any docking station in the environment and retain the system MAC. If every LAN controller in every dock has to be explicitly primed for it, it defeats the purpose.
3. The ACPI tables have been implemented in this fashion by at least two major OEMs, who are the ones driving this request. The igc driver can thus piggy-back on an existing infrastructure (same one used by r8152), without "reinventing the wheel".
The can of worms you refer to is indeed real. It was spotted by the AI at every step of the review. :) Having considered it, I have still decided to go forward (with the appropriate limitation of checking Thunderbolt docks), mostly because of point 2 above. I just don't see a way to protect against every possible corner case, without making the feature worthless.
The rationale is that it is all guarded by a single setting in the system BIOS. If a user is connecting their system to multiple docks, or docks that have multiple NICs, and intends to use several at once, in a way that MAC passthrough becomes an issue, then the user should not enable MAC passthrough in the BIOS, or else should configure custom MAC addresses for specific NICs (which take precedence over system MAC).
I am driving this patch not because it is some cool new feature I came up with, but because customers have asked for it, and I understand why they want it. I hope I succeeded in explaining why I think the existing protections are sufficient.
Thanks!
--Dima