[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZEFO+42Qy2sIxwpI@corigine.com>
Date: Thu, 20 Apr 2023 16:40:59 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Michal Kubecek <mkubecek@...e.cz>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Claudiu Manoil <claudiu.manoil@....com>,
Xiaoliang Yang <xiaoliang.yang_1@....com>,
Petr Machata <petrm@...dia.com>,
Danielle Ratson <danieller@...dia.com>,
Pranavi Somisetty <pranavi.somisetty@....com>,
Harini Katakam <harini.katakam@....com>,
Vinicius Costa Gomes <vinicius.gomes@...el.com>,
Kurt Kanzenbach <kurt@...utronix.de>,
Gerhard Engleder <gerhard@...leder-embedded.com>,
Ferenc Fejes <ferenc.fejes@...csson.com>,
Aaron Conole <aconole@...hat.com>,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 net-next 2/9] net: enetc: report mm tx-active based on
tx-enabled and verify-status
On Tue, Apr 18, 2023 at 02:14:52PM +0300, Vladimir Oltean wrote:
> The MMCSR register contains 2 fields with overlapping meaning:
>
> - LPA (Local preemption active):
> This read-only status bit indicates whether preemption is active for
> this port. This bit will be set if preemption is both enabled and has
> completed the verification process.
> - TXSTS (Merge status):
> This read-only status field provides the state of the MAC Merge sublayer
> transmit status as defined in IEEE Std 802.3-2018 Clause 99.
> 00 Transmit preemption is inactive
> 01 Transmit preemption is active
> 10 Reserved
> 11 Reserved
>
> However none of these 2 fields offer reliable reporting to software.
>
> When connecting ENETC to a link partner which is not capable of Frame
> Preemption, the expectation is that ENETC's verification should fail
> (VSTS=4) and its MM TX direction should be inactive (LPA=0, TXSTS=00)
> even though the MM TX is enabled (ME=1). But surprise, the LPA bit of
> MMCSR stays set even if VSTS=4 and ME=1.
>
> OTOH, the TXSTS field has the opposite problem. I cannot get its value
> to change from 0, even when connecting to a link partner capable of
> frame preemption, which does respond to its verification frames (ME=1
> and VSTS=3, "SUCCEEDED").
>
> The only option with such buggy hardware seems to be to reimplement the
> formula for calculating tx-active in software, which is for tx-enabled
> to be true, and for the verify-status to be either SUCCEEDED, or
> DISABLED.
>
> Without reliable tx-active reporting, we have no good indication when
> to commit the preemptible traffic classes to hardware, which makes it
> possible (but not desirable) to send preemptible traffic to a link
> partner incapable of receiving it. However, currently we do not have the
> logic to wait for TX to be active yet, so the impact is limited.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
Reviewed-by: Simon Horman <simon.horman@...igine.com>
Powered by blists - more mailing lists