🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26635

Re: [PATCH net-next 1/4] igc: Support ACPI-based MAC passthrough

#26635
From: netdev-bot+sashiko
Date: Fri, 04 Dec 2026 01:07
166 lines
14021 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 2

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] igc_probe() (drivers/net/ethernet/intel/igc/igc_main.c, ~line
  7333) replaces the NVM MAC with the ACPI system MAC for every…
- [Low] The new comment in igc_probe() says the ACPI lookup is for
  'devices behind a Thunderbolt/USB4 dock'.
- [Low] The patch adds ether_addr_copy(netdev->perm_addr,
  hw->mac.perm_addr) in igc_probe()…

--

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.

> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index 1fb5f3cbe93c5..1c7fb61f10411 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c

[ ... ]

> @@ -7272,6 +7326,22 @@ static int igc_probe(struct pci_dev *pdev,
>  		/* copy the MAC address out of the NVM */
>  		if (hw->mac.ops.read_mac_addr(hw))
>  			dev_err(&pdev->dev, "NVM Read Error\n");
> +
> +		/* For devices behind a Thunderbolt/USB4 dock, look for a
> +		 * system-provided MAC in the ACPI table
> +		 */

[Severity: Low]
Does this check really cover USB4 docks, as the comment says?

pci_is_thunderbolt_attached() only checks pdev->is_thunderbolt on the
device and its upstream bridges:

include/linux/pci.h:pci_is_thunderbolt_attached() {
	if (pdev->is_thunderbolt)
		return true;

	while ((parent = pci_upstream_bridge(parent)))
		if (parent->is_thunderbolt)
			return true;
	...
}

set_pcie_thunderbolt() in drivers/pci/probe.c only sets that flag when the
Intel TBT VSEC is present:

	vsec = pci_find_vsec_capability(dev, PCI_VENDOR_ID_INTEL, PCI_VSEC_ID_INTEL_TBT);

Take an I225/I226 tunneled through a non-Intel USB4 host and dock. It
would fail this check, so igc_get_acpi_mac_passthru() is never called.
The NVM MAC is then used and nothing is logged.

The commit message has the same gap:

    Limit the lookup only to controllers that are Thunderbolt-attached, as
    these are the only docking stations that can pass through an I225/I226
    controller to the host.

For comparison, amdgpu_device_detect_runtime_pm_mode() pairs
pci_is_thunderbolt_attached() with dev_is_removable() to catch these
devices.

Should the comment and commit message say Thunderbolt only, or should the
check be extended?

> +		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

If those interfaces share an L2 segment, ARP/ND entries would flap between
them. A device that is not a dock could also take on the corporate system
identity.

The commit message calls single attachment an "expectation":

    The expectation is that only one docking station is attached at a
    time, or that only a single network controller is plugged in at a
    time.

The code does not enforce this.

r8152, the existing in-tree user of these ACPI objects, checks the device
first:

  - It uses \MACA only for whitelisted Lenovo dock VID/PIDs, in
    rtl8152_supports_lenovo_macpassthru().
  - In vendor_mac_passthru_addr_read(), it uses \_SB.AMAC only after
    checking the RTL8153-AD eFuse passthrough bit or the RTL8153-BND/BD
    variants.

Does this need some check that the device is a qualified dock NIC, or a
guard against handing the same MAC out twice?

> +			/* Set the permanent MAC address. Leave blank if invalid
> +			 * to reflect there is something wrong with the NVM MAC.
> +			 */
> +			if (is_valid_ether_addr(hw->mac.perm_addr))
> +				ether_addr_copy(netdev->perm_addr, hw->mac.perm_addr);

[Severity: Low]
Is this call within ether_addr_copy()'s alignment rule?

The kernel-doc for ether_addr_copy() says "dst & src must both be aligned
to u16".

In struct net_device, perm_addr follows unsigned int operstate and three
unsigned char fields (link_mode, if_port, dma). That puts perm_addr at an
odd offset.

Without CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS, ether_addr_copy() does
three u16 stores through a cast pointer. On strict-alignment CPUs those
stores would hit an odd address. Examples are RISC-V without
RISCV_EFFICIENT_UNALIGNED_ACCESS and LoongArch with ARCH_STRICT_ALIGN.

The same patch marks the local buf in igc_get_acpi_mac_passthru() as
__aligned(2) to follow this rule.

Would memcpy(netdev->perm_addr, hw->mac.perm_addr, ETH_ALEN) be safer here?

> +			netdev->addr_assign_type = NET_ADDR_STOLEN;

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203005042.348952-1-anthony.l.nguyen%40intel.com
Technical Details
Message-ID: <179634646953.3146.945938889144604548@kernel.org>
Path: mbox-mo1.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-nl.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376941-linux-kernel-netdev=dewy.ru
References: <20261203005042.348952-2-anthony.l.nguyen@intel.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-nl.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376941-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 1/4] igc: Support ACPI-based MAC passthrough
Date: Fri, 04 Dec 2026 01:07:49 +0000
Organization: Usenet Network
Message-ID: <179634646953.3146.945938889144604548@kernel.org>
References: <20261203005042.348952-2-anthony.l.nguyen@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2643667"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:w/20kkNsDoMQKsLpgcFtj7c1Glo= sha256:iqMupbV7jvL2VAIuiSgrDrc7NQV8C8YRutKGN1cAtzk=
	sha1:9n+8Hz39bgOQoY5Id3gFQMVgdeI= sha256:QMbqriH+AKTU+fjH/1pmZQBYSM2tQfTRRUJ792lqVDA=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 7ACD2117A9A; Fri,  4 Dec 2026 04:08:12 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.739
X-Spam-Status: No, score=-3.739 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id Lb3pv_fI7C5w;
	Fri,  4 Dec 2026 04:08:09 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376941-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 1F5F6117A92; Fri,  4 Dec 2026 04:07:58 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id A59DF24670; Fri,  4 Dec 2026 01:07:55 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796346472;
	b=YEmzIcAk84bexd/yHOfz82Hy3W/G7HVhhKCCYYNthnCURBhPz0lztCWx00cPy3iOvCuT
	 YCzhoI/mj8gRJuCvvDmZMtUjlnVz+ttidt6S+5WKhu2TuQ/YQIC6E/V6NDH/rm7imUtIc
	 ZzrC78JWuhOTDWiKAlcF3mmEn4ZKj7zntwyqrpJWX+0OMgjv5c4qhLaZfNtXF/qYBfrMI
	 MTzriM1vBtS+prLgGweCnN5LjWbwdX3i0FmprHE/7OkovzkRo29ODfxTYvHMFVEwYanvs
	 /3TxfEvhMRLoFdqJDl2kkShFKZXaSwQyygrH0N8ChlC1ks52nMai1K7UX2b82nt9EDQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796346472;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=8gDUVXNxmlWHxVNnXU/8h9F0yEF6SN30malsI+RXuQI=;
	b=igilC3HNZASdRPzO3BfZTZbvL5JepDTXUsHSDxx/HElnj8ReQFJI+oTgXJbgouYK1JW3
	 VEZPQKUlGU5rfvQgowAqbiR7k5puz8z+/tWt/aZTmnEHztYtNMeH5tfA0mk6Z+9v4eToB
	 r0zNNu/Uugrpyx9Xo5wG+W8a2MZk6BPg0tEzo+hzcNUTAI0fuSt2150rM8jE4yhioqdaS
	 gl+zYh5cXNmEA1aY17We0Dq4P5pl6UcpROnTtbMjw3iayiBav101nMmV8+GAKRjRSaSef
	 LtRgwNmRzCxjwE9zjHsBQCKaM6Vwb5XbdRy/ShX/PtKRaWW8pIT5LAivQkf7fbQgbCw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=keOiXjxI;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id F3DC4606A33E;
	Fri,  4 Dec 2026 01:07:51 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=keOiXjxI
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796346471;
	b=cl2dOvPxvnofp2OCby5Ukg/KXhUHuj8KXlKH8bK5ljF3hkijpv3H/F1T6St7uh9dq2VI
	 b5lidKpVxPQz7XrNfPyoerm7oDdBKqkfSNH2HVfdjTBsaHYKvHy9p3wHR2W8AtaU3oTwp
	 Fl9S6KqaQPzKj9D5l0+XcHpjdlsE87eTVQr2Cb5qLfIyGwA7ObgBXr1oCkyPtxgq7amPC
	 ROCegJdXxtAp4IyUTMZNVjgWxBQGDmIgvNzZiJOXkv3vNzNlGwY87352sadsmQvhFysGW
	 q7fiG/TbtvXvj9pRn/Kd8HA06wlsF8sR2H0AMHtbDy7H3uOs5X6E81vM8/yt8oya5qw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796346471;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=8gDUVXNxmlWHxVNnXU/8h9F0yEF6SN30malsI+RXuQI=;
	b=ynspzYsu4LgPETjk/SWGxVKLmvtXsxoLpb60bY1wgtxPxRR+AQJtn8CQmwuxkT0zdvaO
	 JZpJIE+TljY9erxxq2WgbZFhtFgPT+0nD3OwZQUnAY4y+/wYqkClnXzbi2GzD3/hJARA7
	 KLUBG64dTXZKkTbW8X6Z3KEU7KfkodyDnPilY95muybcyLkamU4qYHR7JdSrAdELfbFJd
	 DTqtBApStDUh/W1a5LF1l2bxYGiXbGu/Kur822t3yTRDLeH6nyquhK38V3fl7uzxlLD2X
	 aIwaCKTPrHlCM+nv3N90pxkLBWQcVp7ANdCoz+WV480abJliXfVs3vQUtTIrGoBuDHw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=keOiXjxI;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B21E606A332
	for <netdev@vger.kernel.org>; Fri,  4 Dec 2026 01:07:50 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C3A11F0092C;
	Fri,  4 Dec 2026 01:07:49 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796346470;
	bh=8gDUVXNxmlWHxVNnXU/8h9F0yEF6SN30malsI+RXuQI=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=keOiXjxIsW0Z5w0Kz/yB49flAjd5l6GFOK3REFKJ2Jn/tZNg8XQtLQtfbYWs+i6qZ
	 bRyYQnsGtQEjLpcyCARrMicvOTRv5De+vHaP+qMVAdGVei7qvryUDVRQc6sN+yFGF8
	 PULiRdeNErEVZ3liLx9O/7mUDOMj/MABk7GcR5CRsEX3AVrng+NkrFrmese/e/kbA7
	 KeweMPwRjjNAT1gGfBJ3j+nmCPvfVf2tWqRhMdLI5C7O9dgVXaIXjiZFlkd3VNOgSm
	 7BYQ7B0D4PC2b35RMubx7w0ijHGwfFzzKh2k4t3M3W8fsOCEU8AoMEC7Sn9wBAzvNK
	 39bJrbrE91aIA==
X-Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
 edumazet@kernel.org, andrew+netdev@lunn.ch, willemb@google.com,
 netdev@vger.kernel.org, paweldembicki@gmail.com, dima.ruinskiy@intel.com,
 pavankumaryalagada@gmail.com, sx.rinitha@intel.com
X-In-Reply-To: <20261203005042.348952-2-anthony.l.nguyen@intel.com>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list