lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250221095651.npjpkoy2y6nehusy@skbuf>
Date: Fri, 21 Feb 2025 11:56:51 +0200
From: Vladimir Oltean <vladimir.oltean@....com>
To: Furong Xu <0x1207@...il.com>
Cc: Faizal Rahim <faizal.abdul.rahim@...ux.intel.com>,
	Tony Nguyen <anthony.l.nguyen@...el.com>,
	Przemek Kitszel <przemyslaw.kitszel@...el.com>,
	Andrew Lunn <andrew+netdev@...n.ch>,
	"David S . Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Maxime Coquelin <mcoquelin.stm32@...il.com>,
	Alexandre Torgue <alexandre.torgue@...s.st.com>,
	Simon Horman <horms@...nel.org>,
	Russell King <linux@...linux.org.uk>,
	Alexei Starovoitov <ast@...nel.org>,
	Daniel Borkmann <daniel@...earbox.net>,
	Jesper Dangaard Brouer <hawk@...nel.org>,
	John Fastabend <john.fastabend@...il.com>,
	Russell King <rmk+kernel@...linux.org.uk>,
	Serge Semin <fancer.lancer@...il.com>,
	Xiaolei Wang <xiaolei.wang@...driver.com>,
	Suraj Jaiswal <quic_jsuraj@...cinc.com>,
	Kory Maincent <kory.maincent@...tlin.com>,
	Gal Pressman <gal@...dia.com>,
	Jesper Nilsson <jesper.nilsson@...s.com>,
	Andrew Halaney <ahalaney@...hat.com>,
	Choong Yong Liang <yong.liang.choong@...ux.intel.com>,
	Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
	Vinicius Costa Gomes <vinicius.gomes@...el.com>,
	intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	linux-stm32@...md-mailman.stormreply.com,
	linux-arm-kernel@...ts.infradead.org, bpf@...r.kernel.org
Subject: Re: [PATCH iwl-next v5 1/9] net: ethtool: mm: extract stmmac
 verification logic into common library

On Fri, Feb 21, 2025 at 05:42:49PM +0800, Furong Xu wrote:
> > +void ethtool_mmsv_link_state_handle(struct ethtool_mmsv *mmsv, bool up)
> > +{
> > +	unsigned long flags;
> > +
> > +	ethtool_mmsv_stop(mmsv);
> > +
> > +	spin_lock_irqsave(&mmsv->lock, flags);
> > +
> > +	if (up && mmsv->pmac_enabled) {
> > +		/* VERIFY process requires pMAC enabled when NIC comes up */
> > +		ethtool_mmsv_configure_pmac(mmsv, true);
> > +
> > +		/* New link => maybe new partner => new verification process */
> > +		ethtool_mmsv_apply(mmsv);
> > +	} else {
> > +		mmsv->status = ETHTOOL_MM_VERIFY_STATUS_INITIAL;
> 
> Tested this patch on my side, everything works well, but the verify-status
> is a little weird:
> 
> # kernel booted, check initial states:
> ethtool --include-statistics --json --show-mm eth1
> [ {
>         "ifname": "eth1",
>         "pmac-enabled": false,
>         "tx-enabled": false,
>         "tx-active": false,
>         "tx-min-frag-size": 60,
>         "rx-min-frag-size": 60,
>         "verify-enabled": false,
>         "verify-time": 128,
>         "max-verify-time": 128,
>         "verify-status": "INITIAL",
>         "statistics": {
>             "MACMergeFrameAssErrorCount": 0,
>             "MACMergeFrameSmdErrorCount": 0,
>             "MACMergeFrameAssOkCount": 0,
>             "MACMergeFragCountRx": 0,
>             "MACMergeFragCountTx": 0,
>             "MACMergeHoldCount": 0
>         }
>     } ]
> 
> # Enable pMAC by: ethtool --set-mm eth1 pmac-enabled on
> ethtool --include-statistics --json --show-mm eth1
> [ {
>         "ifname": "eth1",
>         "pmac-enabled": true,
>         "tx-enabled": false,
>         "tx-active": false,
>         "tx-min-frag-size": 60,
>         "rx-min-frag-size": 60,
>         "verify-enabled": false,
>         "verify-time": 128,
>         "max-verify-time": 128,
>         "verify-status": "DISABLED",
>         "statistics": {
>             "MACMergeFrameAssErrorCount": 0,
>             "MACMergeFrameSmdErrorCount": 0,
>             "MACMergeFrameAssOkCount": 0,
>             "MACMergeFragCountRx": 0,
>             "MACMergeFragCountTx": 0,
>             "MACMergeHoldCount": 0
>         }
>     } ]
> 
> # Disable pMAC by: ethtool --set-mm eth1 pmac-enabled off
> ethtool --include-statistics --json --show-mm eth1
> [ {
>         "ifname": "eth1",
>         "pmac-enabled": true,
>         "tx-enabled": false,
>         "tx-active": false,
>         "tx-min-frag-size": 60,
>         "rx-min-frag-size": 60,
>         "verify-enabled": false,
>         "verify-time": 128,
>         "max-verify-time": 128,
>         "verify-status": "DISABLED",
>         "statistics": {
>             "MACMergeFrameAssErrorCount": 0,
>             "MACMergeFrameSmdErrorCount": 0,
>             "MACMergeFrameAssOkCount": 0,
>             "MACMergeFragCountRx": 0,
>             "MACMergeFragCountTx": 0,
>             "MACMergeHoldCount": 0
>         }
>     } ]
> 
> verify-status always normal on other cases.

Thanks for testing and for reporting this inconsistency.

> @Vladimir, maybe we shouldn't update mmsv->status in ethtool_mmsv_link_state_handle()?
> Or, update mmsv->status like below:
> mmsv->status = mmsv->pmac_enabled ?
> 		ETHTOOL_MM_VERIFY_STATUS_INITIAL :
> 		ETHTOOL_MM_VERIFY_STATUS_DISABLED;

You mean mmsv->status = mmsv->verify_enabled ? ETHTOOL_MM_VERIFY_STATUS_INITIAL :
                        ~~~~~~~~~~~~~~~~~~~~   ETHTOOL_MM_VERIFY_STATUS_DISABLED?

> Anyway, this is too minor, so:
> 
> Tested-by: Furong Xu <0x1207@...il.com>
> 
> 
> > +		mmsv->verify_retries = ETHTOOL_MM_MAX_VERIFY_RETRIES;
> > +
> > +		/* No link or pMAC not enabled */
> > +		ethtool_mmsv_configure_pmac(mmsv, false);
> > +		ethtool_mmsv_configure_tx(mmsv, false);
> > +	}
> > +
> > +	spin_unlock_irqrestore(&mmsv->lock, flags);
> > +}
> > +EXPORT_SYMBOL_GPL(ethtool_mmsv_link_state_handle);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ