public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Furong Xu <0x1207@gmail.com>
Cc: Alexander Lobakin <aleksander.lobakin@intel.com>,
	Serge Semin <fancer.lancer@gmail.com>,
	"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, rmk+kernel@armlinux.org.uk,
	linux@armlinux.org.uk, xfr@outlook.com
Subject: Re: [PATCH net-next v7 6/7] net: stmmac: support fp parameter of tc-taprio
Date: Wed, 4 Sep 2024 18:55:39 +0300	[thread overview]
Message-ID: <20240904155539.mh5crdw7xqudkjur@skbuf> (raw)
In-Reply-To: <3bf0857f46b15980e60f3ec71acd0f80452863e4.1725441317.git.0x1207@gmail.com> <3bf0857f46b15980e60f3ec71acd0f80452863e4.1725441317.git.0x1207@gmail.com>

On Wed, Sep 04, 2024 at 05:21:21PM +0800, Furong Xu wrote:
>  .../net/ethernet/stmicro/stmmac/stmmac_tc.c   | 23 +++++++------------
>  1 file changed, 8 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
> index 9ec2e6ab81aa..2bdb22e175bc 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
> @@ -931,9 +931,9 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
>  			       struct tc_taprio_qopt_offload *qopt)
>  {
>  	u32 size, wid = priv->dma_cap.estwid, dep = priv->dma_cap.estdep;
> +	struct netlink_ext_ack *extack = qopt->mqprio.extack;
>  	struct timespec64 time, current_time, qopt_time;
>  	ktime_t current_time_ns;
> -	bool fpe = false;
>  	int i, ret = 0;
>  	u64 ctr;
>  
> @@ -1018,16 +1018,12 @@ 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;
>  			break;
>  		default:
>  			return -EOPNOTSUPP;
> @@ -1058,11 +1054,6 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
>  
>  	tc_taprio_map_maxsdu_txq(priv, qopt);
>  
> -	if (fpe && !priv->dma_cap.fpesel) {
> -		mutex_unlock(&priv->est_lock);
> -		return -EOPNOTSUPP;
> -	}
> -
>  	ret = stmmac_est_configure(priv, priv, priv->est,
>  				   priv->plat->clk_ptp_rate);
>  	mutex_unlock(&priv->est_lock);
> @@ -1071,6 +1062,11 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
>  		goto disable;
>  	}
>  
> +	ret = stmmac_fpe_map_preemption_class(priv, priv->dev, extack,
> +					      qopt->mqprio.preemptible_tcs);
> +	if (ret)
> +		goto disable;
> +

Doesn't this break taprio for those callers of tc_setup_taprio() which
do not implement fpe_map_preemption_class(), but at least want taprio
without FPE nonetheless? As in the earlier mqprio patch, they will
return -EINVAL here.

Through code inspection, those users are:
- All users of .tc = dwxgmac_tc_ops: they have .mac = &dwxlgmac2_ops or
  .mac = &dwxgmac210_ops, neither of which implements fpe_map_preemption_class().
- The users of .tc = &dwmac510_tc_ops which have .mac = &dwmac4_ops.
  Again, this does not implement .fpe_map_preemption_class().

I can only rely on code inspection, because I don't know what is the
priv->dma_cap.estsel value that the above cores were synthesized with.
Thus, I don't know if we break a feature which was available before, or
one that was already unavailable.

My suggestion is similar: allow mqprio.preemptible_tcs to go to non-zero
only if fpe_map_preemption_class() is implemented. Then, program it with
any value (including 0) only if fpe_map_preemption_class() is implemented.

>  	netdev_info(priv->dev, "configured EST\n");
>  
>  	return 0;

  reply	other threads:[~2024-09-04 15:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04  9:21 [PATCH net-next v7 0/7] net: stmmac: FPE via ethtool + tc Furong Xu
2024-09-04  9:21 ` [PATCH net-next v7 1/7] net: stmmac: move stmmac_fpe_cfg to stmmac_priv data Furong Xu
2024-09-04  9:21 ` [PATCH net-next v7 2/7] net: stmmac: drop stmmac_fpe_handshake Furong Xu
2024-09-04  9:21 ` [PATCH net-next v7 3/7] net: stmmac: refactor FPE verification process Furong Xu
2024-09-04 13:02   ` Vladimir Oltean
2024-09-04 14:04   ` Vladimir Oltean
2024-09-04 14:58   ` Vladimir Oltean
2024-09-04  9:21 ` [PATCH net-next v7 4/7] net: stmmac: configure FPE via ethtool-mm Furong Xu
2024-09-04  9:21 ` [PATCH net-next v7 5/7] net: stmmac: support fp parameter of tc-mqprio Furong Xu
2024-09-04 15:42   ` Vladimir Oltean
2024-09-04  9:21 ` [PATCH net-next v7 6/7] net: stmmac: support fp parameter of tc-taprio Furong Xu
2024-09-04 15:55   ` Vladimir Oltean [this message]
2024-09-04  9:21 ` [PATCH net-next v7 7/7] net: stmmac: silence FPE kernel logs Furong Xu
2024-09-04 16:00   ` Vladimir Oltean

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=20240904155539.mh5crdw7xqudkjur@skbuf \
    --to=olteanv@gmail.com \
    --cc=0x1207@gmail.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fancer.lancer@gmail.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=linux@armlinux.org.uk \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --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