Article View: linux.kernel.netdev
Article #14617Re: [EXTERNAL] [PATCH net] net: marvell: prestera: disable port before changing its MAC mode
From: "Imre Kaloz"
Date: Wed, 11 Nov 2026 16:42
Date: Wed, 11 Nov 2026 16:42
40 lines
11375 bytes
11375 bytes
On Wed, Nov 11, 2026, at 15:39, Elad Nachman wrote:
<snip>
>> + /* Firmware may not report link up after the mode or inband setting of
>> + * an enabled port changes until the port is disabled and re-enabled.
>> + */
>> + if (old.admin && (old.mode != cfg_mac.mode ||
>> + old.inband != cfg_mac.inband)) {
>> + old.admin = false;
>> + err = prestera_port_cfg_mac_write(port, &old);
>> + if (err)
>> + return err;
>> + }
>
> From my experience, if you take the port down, it takes time for the firmware
> state machine to act accordingly, so you need some significant delay here
> (1-3 seconds) before you write the new configuration.
Thanks Elad. I found this bringing up the SFP+ ports on a Delta TN48M
(98DX3265) with firmware 4.1.0. With an S-RJ01 module in sfp-52,
the port came up in 30 of 30 boots with this patch, about 2.1 s after
link up, and in 21 of 30 without it. The disable write waits for the
firmwareโs acknowledgement, and I saw no failures without a delay.
Is the delay needed on particular firmware versions or devices? This
path runs under rtnl when an SFP module changes the mode, so I would
rather not sleep for seconds there. If the firmware reports when the
port is really down, I can wait for that instead, with a bounded
timeout.
Thanks,
Imre
Technical Details
Message-ID:
<02e94b70-d446-4518-8f7a-c0f710e3b572@app.fastmail.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361181-linux-kernel-netdev=dewy.ruReferences:
<20261111101521.9878-1-kaloz@kernel.org> <BL1PPFB0715B38BE2E57548F95CCBDFCAF7DB712@BL1PPFB0715B38B.namprd18.prod.outlook.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361181-linux-kernel-netdev=dewy.ru
From: kaloz@kernel.org ("Imre Kaloz")
Newsgroups: linux.kernel.netdev
Subject: Re: [EXTERNAL] [PATCH net] net: marvell: prestera: disable port before
changing its MAC mode
Date: Wed, 11 Nov 2026 17:42:44 +0100
Organization: Usenet Network
Message-ID: <02e94b70-d446-4518-8f7a-c0f710e3b572@app.fastmail.com>
References: <20261111101521.9878-1-kaloz@kernel.org>
<BL1PPFB0715B38BE2E57548F95CCBDFCAF7DB712@BL1PPFB0715B38B.namprd18.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="897832"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:VfmS4evCAJFBf5nAdY08E/wpR1w= sha256:FDMjJay+/hcG/E5fzYghhaJ8uYsGtEugAKcWAyF20wY=
sha1:eki4dR1+kX+Ox0k1YK8P8LUclQY= sha256:WlWMgJAh6CPgv8HBxrJt+IvRgCV8U3AaDSlHeWvuzMI=
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 322D6113F5F; Wed, 11 Nov 2026 19:55:13 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, 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] 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 WnLBy36UAsyC;
Wed, 11 Nov 2026 19:55:03 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-361181-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 49EA1113F5A; Wed, 11 Nov 2026 19:54:55 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 2EFDCA4AE0; Wed, 11 Nov 2026 16:44:23 +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=1794415435;
b=mMsuYn4VZIIcC412C83d23QpjrlrtowoOJhdekuEIe4g+PljJbRqRcw8KiKNz0QURZoa
eSSPfUNl6aVuf0ZNig4mrFJZrMDhXxtZQTCB6juP158qyzmDdDi352vBXeFdiVgPv9mRA
UM155vjulpsR5pvL8Kb8T9XEwSnWUUJE1QFvFTvmBdRl1Xe7wgLuxbQjnVCKrIkJ/QnVr
j/rTd5kPD/wecuZ4PK/TVO0HPNT3A+4DH9BU6rgoAAbhL3ST9gfgIMjda8HYHDras+0Aj
5tMPx9ZwVYhkCUkbzlV5VhtNgse5obXapwSsjXr+kpk8HOijg+FyY7cMSCBYY67xgvg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794415435;
h=X-Original-To:Received:Received:DKIM-Signature:Received:Received:
X-ME-Sender:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:X-Mailer:
X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:X-ThreadId:Date:
From:To:Cc:Message-Id:In-Reply-To:References:Subject:Content-Type:
Content-Transfer-Encoding;
bh=32zGssUEvJ3DhM4umYQny6PIrqpB5bwtNYfrOgNVlA0=;
b=hOv1pH55DjTmC+BVHAjiq/2WVNVAHmho0afmL8se+cuwI9ok9NrkHe3VXf8TBQ8fCcRF
+u5S6bFaU+R+uhh1F4RamfNneuQJNS47UJSOHc4Lv2o8CyfymUcDUJ17iTjL+pSZjaSat
73uOl2nbnhpN3DlT/h/pwJb04/cejql/2VTYjWLLYqwru1NRphe0oasn8tm9nHVST0V2M
jSHFmwG8eCeE+6hQJDJIhvVHicAaMr9L0nITHT3JNAIal0zHMI3XOoOy+e2rAdqQfvT32
1nSmyIiaEbZNX58qAyjlCmvGxsHbOpmNQmRb7a3HZp3U4bCLv2Bkz/vDTa9nxZYgwiw==
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=DLS50MZ2;
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 4135F60A2603;
Wed, 11 Nov 2026 16:43:55 +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=DLS50MZ2
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=1794415434;
b=01nW/FZFNd7DitC30QqipCUlTp13o5Byj+e4Ct12uos/LCBph3G/ZToihGbgWxnltSwQ
B1gdEyHHKk8jIpKySXXBS/1xiOhT5Scc78046FCCFOr19pAf1h29mI7wAlDto3PX5Xy38
jZpKF47ULwxp2mpRwxWANw5sVPAusplQuxp5cNnZFD+5jcChjRpWrWqtcLBRNACQlfDlC
FD4ZIIEj2AMKmzjmgFdq2SXEYp7pF1EWsYnpO+GJ0J6dSUJnr6OqRk6SE0nzorbShCFzg
JLCsW/1/wsStcMquB/nyLektxp7yFuGynSJFm8LGD+5r5dioegZKWaaZ9bIIWmMLNGg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794415434;
h=Received:DKIM-Signature:Received:Received:X-ME-Sender:
X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:X-Mailer:
MIME-Version:X-ThreadId:Date:From:To:Cc:Message-Id:In-Reply-To:
References:Subject:Content-Type:Content-Transfer-Encoding;
bh=32zGssUEvJ3DhM4umYQny6PIrqpB5bwtNYfrOgNVlA0=;
b=RIQHQXjlOHCYmJm3e/6XKs1vAd373rYaiOro+h1pWkM4xVyAYYsCVNFI5batzu9CCHlh
4uKtkNHe6XFser5jpumdsYARjzAuuL8b+UjLdXNa//nlCJMtNfO3cCl8mT5lepOe5nWY1
PCKXiVNamvVXaKtdoe8et0S4qyCPlxvAPYQMSZfMBBkHVe6qICpkwgcE0KozXEETJ86qg
v6aOim3IhiByQqkqcznj0iPrYKtRQN4n2bJFOjEY6cQ6F/atSTqVFguxCPgXOd3t5cUad
dAqob+PrsCGOP0oMwcJU7XMo1Pt6mpEsue+Nuoc/ZpLfIg+lGnFqOhDYlr2IM+4N9ug==
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=DLS50MZ2;
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 5F24B606A8B1
for <netdev@vger.kernel.org>; Wed, 11 Nov 2026 16:43:54 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34CFA1F00A0E;
Wed, 11 Nov 2026 16:43:53 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
s=k20260515; t=1794415434;
bh=32zGssUEvJ3DhM4umYQny6PIrqpB5bwtNYfrOgNVlA0=;
h=Date:From:To:Cc:In-Reply-To:References:Subject;
b=DLS50MZ2z494AvCFXcgO49Z28DKePHSI51aN6UOT17extFmfY5e17gs3nXlwtft44
7PIo1k/uxCB676H39utUrp8P7hemd7UKmUqVP/VPoQELQMRwyHja4tFmi0SfjcjMNL
q6zDB3401g9MgMAbPvwbRV8pNpFPOAfRMP8BZ5MYa2Ejx7iaH3uMTt35hKRYSAU4vq
2lsIdRxoQu8uEcJc6faqLzw84JfW6ipLeH4OGK8CsV73xFqPVtGNKMmqdsKFH/kVGj
WDl5NzyK4OI968JaCuv+n9sY1Jvyra7TgUDBMCG9ysLWc1Pbeyk4THqiRtWYvDbS+/
SV8Xo7mbyJPlA==
X-Received: from ams-compute-01.internal (ams-compute-01.internal [10.64.2.61])
by mailfauth.ams.internal (Postfix) with ESMTP id 76C01198003A;
Wed, 11 Nov 2026 11:43:51 -0500 (EST)
X-Received: from ams-imap-19 ([10.64.2.39])
by ams-compute-01.internal (MEProxy); Wed, 11 Nov 2026 11:43:51 -0500
X-ME-Sender: <xms:RZv0alPOP-mOidsSoToW7jwDKcrN-YVX7FCV9mjqsjh0nG0xNTapsg>
<xme:RZv0aiw_nK2Go7B8gtM_1AaNXmNQmbJHP5BjWbJ3fFwsO3VZT249F6CbAJ7iH6m-m
wYxUAhD4t5H9sKkaoDb3F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204a8f:Fastmail
X-Received: by mailuser.ams.internal (Postfix, from userid 501)
id A8AD12F8005A; Wed, 11 Nov 2026 11:43:49 -0500 (EST)
X-Mailer: MessagingEngine.com Webmail Interface
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
X-ThreadId: APqG7cBtEf9F
X-Cc: "David S . Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@kernel.org>, "Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>, "Andrew Lunn" <andrew+netdev@lunn.ch>,
"Oleksandr Mazur" <oleksandr.mazur@plvision.eu>
X-In-Reply-To: <BL1PPFB0715B38BE2E57548F95CCBDFCAF7DB712@BL1PPFB0715B38B.namprd18.prod.outlook.com>