Netdev List
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: muhammad.nazim.amirul.nazle.asmade@altera.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com,
	alexandre.torgue@foss.st.com
Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 1/3] net: stmmac: fpe: Enforce pmac_enabled in set_mm and keep it on at init
Date: Wed, 29 Jul 2026 08:26:28 +0200	[thread overview]
Message-ID: <22d95b3a-752f-46fc-be0f-497e78f9f189@bootlin.com> (raw)
In-Reply-To: <20260729015247.25774-2-muhammad.nazim.amirul.nazle.asmade@altera.com>

Hi,

On 7/29/26 03:52, muhammad.nazim.amirul.nazle.asmade@altera.com wrote:
> From: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
> 
> The preemptive MAC in DWMAC is always enabled, meaning DWMAC is always
> ready to receive preemptive mPackets. Initialize pmac_enabled to true
> at init time and reject attempts to disable it via ethtool set_mm.
> 
> Also add a missing fpesel capability check in stmmac_set_mm() to return
> -EOPNOTSUPP early on hardware without FPE support.
> 
> Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
> Signed-off-by: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Maxime

> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 7 +++++++
>  drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c     | 5 +++++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> index 92585d27ab88..8ebdd249e5c8 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> @@ -1064,6 +1064,13 @@ static int stmmac_set_mm(struct net_device *ndev, struct ethtool_mm_cfg *cfg,
>  	if (err)
>  		return err;
>  
> +	if (!priv->dma_cap.fpesel)
> +		return -EOPNOTSUPP;
> +
> +	/* DWMAC always have preemptible MAC enabled */
> +	if (!cfg->pmac_enabled)
> +		return -EINVAL;
> +
>  	stmmac_fpe_set_add_frag_size(priv, frag_size);
>  	ethtool_mmsv_set_mm(&priv->fpe_cfg.mmsv, cfg);
>  
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c
> index c54c70224351..2f880c5e35b0 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c
> @@ -176,6 +176,11 @@ void stmmac_fpe_init(struct stmmac_priv *priv)
>  	if ((!priv->fpe_cfg.reg || !priv->hw->mac->fpe_map_preemption_class) &&
>  	    priv->dma_cap.fpesel)
>  		dev_info(priv->device, "FPE is not supported by driver.\n");
> +
> +	/* The preemptive MAC in DWMAC is always enabled, so initialize
> +	 * pmac_enabled to true to reflect the hardware state.
> +	 */
> +	priv->fpe_cfg.mmsv.pmac_enabled = true;
>  }
>  
>  int stmmac_fpe_get_add_frag_size(struct stmmac_priv *priv)


  reply	other threads:[~2026-07-29  6:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29  1:52 [PATCH net-next 0/3] net: stmmac: fpe: pmac and fprq fixes muhammad.nazim.amirul.nazle.asmade
2026-07-29  1:52 ` [PATCH net-next 1/3] net: stmmac: fpe: Enforce pmac_enabled in set_mm and keep it on at init muhammad.nazim.amirul.nazle.asmade
2026-07-29  6:26   ` Maxime Chevallier [this message]
2026-07-29  1:52 ` [PATCH net-next 2/3] net: stmmac: fpe: Add missing return in stmmac_fpe_init() muhammad.nazim.amirul.nazle.asmade
2026-07-29  6:27   ` Maxime Chevallier
2026-07-29  1:52 ` [PATCH net-next 3/3] net: stmmac: fpe: Move fprq configuration to stmmac_fpe_configure_pmac() muhammad.nazim.amirul.nazle.asmade
2026-07-29  6:31   ` Maxime Chevallier

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=22d95b3a-752f-46fc-be0f-497e78f9f189@bootlin.com \
    --to=maxime.chevallier@bootlin.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.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=muhammad.nazim.amirul.nazle.asmade@altera.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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