Article View: linux.kernel.netdev
Article #19674[PATCH net-next v2] net: sunplus: also fix the byte order of 1c:50:1e MAC addresses
From: Andrew Gaylard
Date: Fri, 20 Nov 2026 07:39
Date: Fri, 20 Nov 2026 07:39
60 lines
13289 bytes
13289 bytes
The driver reverses a MAC address from the OTP when it finds the
Sunplus OUI fc:4b:bc at the wrong end. Newer SP7021 chips have
a different Sunplus OUI (1c:50:1e), possibly stored in the same
reversed order, which the driver does not recognise. If the reversed
address has the multicast bit set, the driver rejects it and uses a
random address; otherwise it uses the reversed address as it is.
Handle both these OUIs. An address that already starts with either OUI
is left as is. On chips that used the reversed address, the interface
now gets the correct address, so configuration tied to the old address
(DHCP reservations, udev or networkd rules) will need updating.
Tested on chips that needed each of these OUIs to be reversed.
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Signed-off-by: Andrew Gaylard <ag@ffroot.co.za>
---
v2: Use a helper that checks for both OUIs instead of an OUI table and
two loops, as suggested by Daniel Machon.
v1: https://lore.kernel.org/netdev/20261112123738.429728-1-ag@ffroot.co.za/
drivers/net/ethernet/sunplus/spl2sw_driver.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/sunplus/spl2sw_driver.c b/drivers/net/ethernet/sunplus/spl2sw_driver.c
index 9ccaf928ed66..b5ae950f6d5b 100644
--- a/drivers/net/ethernet/sunplus/spl2sw_driver.c
+++ b/drivers/net/ethernet/sunplus/spl2sw_driver.c
@@ -203,15 +203,20 @@ static const struct net_device_ops netdev_ops = {
.ndo_tx_timeout = spl2sw_ethernet_tx_timeout,
};
+static bool spl2sw_is_sunplus_oui(u8 b0, u8 b1, u8 b2)
+{
+ return (b0 == 0xfc && b1 == 0x4b && b2 == 0xbc) ||
+ (b0 == 0x1c && b1 == 0x50 && b2 == 0x1e);
+}
+
static void spl2sw_check_mac_vendor_id_and_convert(u8 *mac_addr)
{
- /* Byte order of MAC address of some samples are reversed.
- * Check vendor id and convert byte order if it is wrong.
- * OUI of Sunplus: fc:4b:bc
+ /* Some chips have the byte order of the MAC address reversed.
+ * Check for the Sunplus OUIs (fc:4b:bc, 1c:50:1e) and fix the
+ * byte order if it is.
*/
- if (mac_addr[5] == 0xfc && mac_addr[4] == 0x4b && mac_addr[3] == 0xbc &&
- (mac_addr[0] != 0xfc || mac_addr[1] != 0x4b || mac_addr[2] != 0xbc)) {
-
+ if (spl2sw_is_sunplus_oui(mac_addr[5], mac_addr[4], mac_addr[3]) &&
+ !spl2sw_is_sunplus_oui(mac_addr[0], mac_addr[1], mac_addr[2])) {
swap(mac_addr[0], mac_addr[5]);
swap(mac_addr[1], mac_addr[4]);
swap(mac_addr[2], mac_addr[3]);
base-commit: 2208ab00f4f213ade91ab775e7f8c4dacdcc856e
--
2.53.0
Technical Details
Message-ID:
<20261120073901.21656-1-ag@ffroot.co.za>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367743-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367743-linux-kernel-netdev=dewy.ru
From: ag@ffroot.co.za (Andrew Gaylard)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v2] net: sunplus: also fix the byte order of 1c:50:1e MAC addresses
Date: Fri, 20 Nov 2026 09:39:01 +0200
Organization: Usenet Network
Message-ID: <20261120073901.21656-1-ag@ffroot.co.za>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="3097858"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:kLUzpPlTnV49+fK7TcBH2vnw0KU= sha256:PI7wJZWFJL883wxpE77xvg5si1AtbheCpevswsXhTMk=
sha1:wm0RetKAJv5aYqdrEHtHWZGVqdU= sha256:aryz06hyEvBSWqdglmcwpxeQ7oH+Pwlk3XG3jaa5p9g=
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 1B4FE1158EF; Fri, 20 Nov 2026 10:39:41 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.951
X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=ffroot-co-za.20260707.gappssmtp.com
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 wW44cxeYvIPg;
Fri, 20 Nov 2026 10:39:32 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-367743-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=ffroot.co.za
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id B7C141158C6; Fri, 20 Nov 2026 10:39:21 +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 473936596F; Fri, 20 Nov 2026 07:39:18 +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=1795160356;
b=NDsT33FZVoYIZCFHgSdpQUbbXTvm9Ysm3pEhgGm/O7H3+3K2Al5Xrxuyr96kdXf1E16P
wRJqJV/0QnBF16eEuzChH+9sslld8EL3ErXQ1Ny5WQhT5YngReTndp14aerTPVZTsD0W1
PShDZhr8goxpF1DPbKtLEQ4BVCMdLeErEPx4hNQPUk5IrDP38N0HjHtLjxpi51qXaJbHl
ERx2ZLOkk7Tm1dgfy8x7E4hbIRLzUnE3mZnfmCPDPtzxc2yaI2rY3A77TC/Jph+KAGOvn
SpiCVMNjD4F19iTsCSNMo1srdLFtjffDthBLL7qUcjbYBDuwcEeODBBn+nhRT96kK3A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795160356;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-ID:
X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:
Content-Transfer-Encoding;
bh=lVTvq8d6IhVG4vZNXMLdoD7D7oeTtaAvwrHl+0pF8xI=;
b=bAlxVfkAP/WQXOhH1H2jzMz3oV8YjROtDNFyO6ec+9oYLcYHZcaqt605LEfdPoqME0Hs
akkr5rcyv0BJK60whBbxBa5MmOIjXRA07Jh2XrVhr6BhmDwf68osTT4nmCTzlw4wmk38U
wLN5BuQoU6Qz3BGSaEE9/AEaui2mRTNXX3Mo1tQTfgjYcAV5gY1Ea7TPDKq/BVtgBeVer
MygMBG1KVImXy0/m4L5advkiEPp5C/6UXtwG3xSeUWRJKAMXf8sMk3tLrgogII6lH7mCv
TQilcfRoSvhqC0tHstDcUt7u37GrlKpf/haUkfrHn8Zv1TwHfOjBHZcmB9mqkXKcZ4w==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=ffroot-co-za.20260707.gappssmtp.com header.i=@ffroot-co-za.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=VPDbLo1C;
dmarc=none header.from=ffroot.co.za;
spf=pass smtp.mailfrom=ffroot.co.za;
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 6FB00606A337;
Fri, 20 Nov 2026 07:39:16 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=ffroot-co-za.20260707.gappssmtp.com header.i=@ffroot-co-za.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=VPDbLo1C
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.45
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795160355;
b=PjJOv0uxnmX+65Vfnvvvui8YTPNmp8BBlcySkz91DKYWI9wtvnpGTsd73FN0vSHZKJ6/
MG8t5VyK+0Kq+BYlISrmEeuOOKFPGeFnx7gR4y6R4Ew2W3JhVbdqX0nSId5pSwzPKuhRX
GE3Hk340BzZ2N3QBtQ2h23IR4nsEVqGhyHTehYH63JxXoKYs3ik5qEzbQ+wmdL06kmS1+
RKaCWpZZ6LIibpXw1vuCBZNOZSKqN42phOhh02LTR+2WLEQCqvfk63wnmZvIrtkPRKaqH
Vau0Aysrnaqzv4DPaG5TjSepQjCvFEALb2k5D8Zy2Env/ARCaH4yzGjfzQzqZ9kOalg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795160355;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version:
Content-Transfer-Encoding;
bh=lVTvq8d6IhVG4vZNXMLdoD7D7oeTtaAvwrHl+0pF8xI=;
b=3hsL2TpSDStRY78hYAntj8IweiZFSrcznoHhORZmdrp0yZTPueKwmeBALesf9URSs0OU
zJ2YGJAjS7W4yPOf7loRS5MwpZzpGxhSqwBIj+uQuapu+KjSJC5JnQ7makLWbi539XzN0
qX8J7Dm9J23QIajk8gu8JSi+yhF/MZhV6mwFt/5LpnyRvTltUPQ3qrjhWeqaG3tNlTfmH
1BF+zpEA4RRTQ9ab1DXtv8A/gVLCBJR93tj7DjMJQfirdBfBaVRuY26buEwuuegDNVYbM
nGCQTFI8hqHyJsgVrDf4su09F6q+FRFds+j95ObWZQrcj1AnXLVsYZ7q25mdzLbxyfw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=none header.from=ffroot.co.za;
spf=pass smtp.mailfrom=ffroot.co.za;
dkim=pass header.d=ffroot-co-za.20260707.gappssmtp.com header.i=@ffroot-co-za.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=VPDbLo1C;
arc=none smtp.remote-ip=209.85.128.45
X-Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F6DB606A320
for <netdev@vger.kernel.org>; Fri, 20 Nov 2026 07:39:13 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5F6DB606A320
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffroot.co.za
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ffroot.co.za
X-Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4bb702a7548so4090605e9.1
for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 23:39:13 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=ffroot-co-za.20260707.gappssmtp.com; s=20260707; t=1795160352; x=1795765152; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=lVTvq8d6IhVG4vZNXMLdoD7D7oeTtaAvwrHl+0pF8xI=;
b=VPDbLo1CJKIq5TgsAPCEdMdcA9NkYuBQ8TvEuE5FC+GCTgpWIKHAIrJsCim1NhKHoL
MgGVVic/Oq79qHixBRsoJKMtkqbr+a5MHr1oR0tqoqXLdbRIwQApLLSFz2tKoPoLwucV
nCZhYsB5ZKoJrqWGbXQSHBQUbJgpw12nJZOPjMs4xWAk1yNn1P6LZs7xM3nqJONA3nC2
49JkSaN44fpOU7pSfDS/U4jjhqambIWg2pqlFiJmk1dAiqvLqpWBc9QGQI6MJEIGjZ1X
Ew+XpiSTFPugIf/ciO8iKIbvbZZ/9jlTwQPLIG3wffWgZqlzUZ+Jhawd7TqBVI0e6cES
RXGA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795160352; x=1795765152;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=lVTvq8d6IhVG4vZNXMLdoD7D7oeTtaAvwrHl+0pF8xI=;
b=tbjrNwbdwxKTPGyatZdOR1u6pCdQIHnT6aOZqB1tGxLFOGHu590cmkrD8qnPDESITy
VdMs98vHHrvbDTT5rdxUQjMG32rztu0xkvnC+ll3HJqOtKrILMUfRLNyLT4daSeP4v7s
xtc1rhciJmXHoJiJzR5rt+pgOanHb673GDAlfviEh2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Uzh4xwr
X-Received: by 2002:a05:600d:82d3:b0:49f:e701:51c8 with SMTP id 5b1f17b1804b1-4bb8880f0ebmr50112675e9.9.1795160352369;
Thu, 19 Nov 2026 23:39:12 -0800 (PST)
X-Received: from localhost ([192.145.132.58])
by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb853a12acsm99786745e9.8.2026.11.19.23.39.09
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 19 Nov 2026 23:39:11 -0800 (PST)
X-Cc: Daniel Machon <daniel.machon@microchip.com>,
netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Andrew Gaylard <ag@ffroot.co.za>
X-Mailer: git-send-email 2.53.0
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