From: Vladimir Oltean <olteanv@gmail.com>
To: Furong Xu <0x1207@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Jose Abreu <joabreu@synopsys.com>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Joao Pinto <jpinto@synopsys.com>,
netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, xfr@outlook.com, rock.xu@nio.com
Subject: Re: [PATCH net-next v1 3/5] net: stmmac: support fp parameter of tc-taprio
Date: Fri, 2 Aug 2024 02:16:25 +0300 [thread overview]
Message-ID: <20240801231625.uqa4gq7vokp63dfp@skbuf> (raw)
In-Reply-To: <4603a4f68616ce41aca97bac2f55e5d51c865f53.1722421644.git.0x1207@gmail.com>
On Wed, Jul 31, 2024 at 06:43:14PM +0800, Furong Xu wrote:
> tc-taprio can select whether traffic classes are express or preemptible.
>
> After some traffic tests, MAC merge layer statistics are all good.
>
> Local device:
> ethtool --include-statistics --json --show-mm eth1
> [ {
> "ifname": "eth1",
> "pmac-enabled": true,
> "tx-enabled": true,
> "tx-active": true,
> "tx-min-frag-size": 60,
> "rx-min-frag-size": 60,
> "verify-enabled": true,
> "verify-time": 100,
> "max-verify-time": 128,
> "verify-status": "SUCCEEDED",
> "statistics": {
> "MACMergeFrameAssErrorCount": 0,
> "MACMergeFrameSmdErrorCount": 0,
> "MACMergeFrameAssOkCount": 0,
> "MACMergeFragCountRx": 0,
> "MACMergeFragCountTx": 1398,
> "MACMergeHoldCount": 15783
> }
> } ]
>
> Remote device:
> ethtool --include-statistics --json --show-mm eth1
> [ {
> "ifname": "eth1",
> "pmac-enabled": true,
> "tx-enabled": true,
> "tx-active": true,
> "tx-min-frag-size": 60,
> "rx-min-frag-size": 60,
> "verify-enabled": true,
> "verify-time": 100,
> "max-verify-time": 128,
> "verify-status": "SUCCEEDED",
> "statistics": {
> "MACMergeFrameAssErrorCount": 0,
> "MACMergeFrameSmdErrorCount": 0,
> "MACMergeFrameAssOkCount": 1388,
> "MACMergeFragCountRx": 1398,
> "MACMergeFragCountTx": 0,
> "MACMergeHoldCount": 0
> }
> } ]
>
> Tested on DWMAC CORE 5.10a
>
> Signed-off-by: Furong Xu <0x1207@gmail.com>
> ---
> .../net/ethernet/stmicro/stmmac/stmmac_tc.c | 34 ++-----------------
> 1 file changed, 3 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
> index 494fe2f68300..eeb5eb453b98 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
> @@ -943,7 +943,6 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
> u32 size, wid = priv->dma_cap.estwid, dep = priv->dma_cap.estdep;
> struct timespec64 time, current_time, qopt_time;
> ktime_t current_time_ns;
> - bool fpe = false;
> int i, ret = 0;
> u64 ctr;
>
> @@ -1028,16 +1027,6 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
>
> switch (qopt->entries[i].command) {
> case TC_TAPRIO_CMD_SET_GATES:
> - if (fpe)
> - return -EINVAL;
> - break;
> - case TC_TAPRIO_CMD_SET_AND_HOLD:
> - gates |= BIT(0);
> - fpe = true;
> - break;
> - case TC_TAPRIO_CMD_SET_AND_RELEASE:
> - gates &= ~BIT(0);
> - fpe = true;
I don't think these can go.
In the DWMAC5 manual, I see:
"To enable the support of hold and release operations, the format of the
GCL is slightly changed while configuring and enabling the FPE. The first Queue (Q0) is always programmed to carry preemption
traffic and therefore it is always Open. The bit corresponding to Q0 is renamed as Release/Hold MAC control. The TX Queues
whose packets are preemptable are indicated by setting the PEC field of the MTL_FPE_CTRL_STS register. The GCL bit of the
corresponding Queue are ignored and considered as always "Open". So, even if the software writes a "0" ("C"), it is ignored for
such queues."
It's relatively clear to me that this is what the "gates" variable is
doing here - it's modulating when preemptible traffic begins to be
"held", and when it is "released".
Now, the "fpe" variable - that can definitely go.
> break;
> default:
> return -EOPNOTSUPP;
Also, this is more general advice. If TC_TAPRIO_CMD_SET_AND_HOLD and
TC_TAPRIO_CMD_SET_AND_RELEASE used to work as UAPI input into this
driver, you don't want to break that now by letting those fall into the
default -EOPNOTSUPP case. What worked must continue to work... somehow.
> @@ -1068,16 +1057,11 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
>
> tc_taprio_map_maxsdu_txq(priv, qopt);
>
> - if (fpe && !priv->dma_cap.fpesel) {
> + if (qopt->mqprio.preemptible_tcs && !priv->dma_cap.fpesel) {
> mutex_unlock(&priv->est_lock);
> return -EOPNOTSUPP;
> }
>
> - /* Actual FPE register configuration will be done after FPE handshake
> - * is success.
> - */
> - priv->plat->fpe_cfg->enable = fpe;
> -
> ret = stmmac_est_configure(priv, priv, priv->est,
> priv->plat->clk_ptp_rate);
> mutex_unlock(&priv->est_lock);
next prev parent reply other threads:[~2024-08-01 23:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-31 10:43 [PATCH net-next v1 0/5] net: stmmac: FPE via ethtool + tc Furong Xu
2024-07-31 10:43 ` [PATCH net-next v1 1/5] net: stmmac: configure FPE via ethtool-mm Furong Xu
2024-08-01 20:04 ` Vladimir Oltean
2024-07-31 10:43 ` [PATCH net-next v1 2/5] net: stmmac: support fp parameter of tc-mqprio Furong Xu
2024-08-01 23:07 ` Vladimir Oltean
2024-07-31 10:43 ` [PATCH net-next v1 3/5] net: stmmac: support fp parameter of tc-taprio Furong Xu
2024-08-01 23:16 ` Vladimir Oltean [this message]
2024-08-01 23:29 ` Vladimir Oltean
2024-07-31 10:43 ` [PATCH net-next v1 4/5] net: stmmac: drop unneeded FPE handshake code Furong Xu
2024-07-31 10:43 ` [PATCH net-next v1 5/5] net: stmmac: silence FPE kernel logs Furong Xu
2024-08-01 16:02 ` [PATCH net-next v1 0/5] net: stmmac: FPE via ethtool + tc Vladimir Oltean
2024-08-01 16:17 ` Vladimir Oltean
2024-08-05 17:11 ` Serge Semin
2024-08-06 4:55 ` Furong Xu
2024-08-06 9:16 ` Serge Semin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240801231625.uqa4gq7vokp63dfp@skbuf \
--to=olteanv@gmail.com \
--cc=0x1207@gmail.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=joabreu@synopsys.com \
--cc=jpinto@synopsys.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rock.xu@nio.com \
--cc=xfr@outlook.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox