Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1605707 > unrolled thread

Re: [PATCH 1/3] net: stmmac: Always enable MAC RX queues

Started byJoao Pinto <Joao.Pinto@synopsys.com>
First post2017-03-21 16:20 +0100
Last post2017-03-21 17:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 1/3] net: stmmac: Always enable MAC RX queues Joao Pinto <Joao.Pinto@synopsys.com> - 2017-03-21 16:20 +0100
    Re: [PATCH 1/3] net: stmmac: Always enable MAC RX queues Thierry Reding <thierry.reding@gmail.com> - 2017-03-21 17:50 +0100

#1605707 — Re: [PATCH 1/3] net: stmmac: Always enable MAC RX queues

FromJoao Pinto <Joao.Pinto@synopsys.com>
Date2017-03-21 16:20 +0100
SubjectRe: [PATCH 1/3] net: stmmac: Always enable MAC RX queues
Message-ID<tntJN-55L-27@gated-at.bofh.it>
Às 3:12 PM de 3/21/2017, Thierry Reding escreveu:
> From: Thierry Reding <treding@nvidia.com>
> 
> The MAC RX queues always need to be enabled in order to receive network
> packets. Remove the condition that this only needs to be done for multi-
> queue configurations.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index d3a21519e4c0..298956032098 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -1943,7 +1943,7 @@ static void stmmac_mtl_configuration(struct stmmac_priv *priv)
>  		stmmac_rx_queue_dma_chan_map(priv);
>  
>  	/* Enable MAC RX Queues */
> -	if (rx_queues_count > 1 && priv->hw->mac->rx_queue_enable)
> +	if (priv->hw->mac->rx_queue_enable)
>  		stmmac_mac_enable_rx_queues(priv);
>  
>  	/* Set the HW DMA mode and the COE */
> 

This text is from the Databook:

"In multiple Rx queues configuration, all the queues are disabled by default.
Enable the Rx queue by programming the corresponding field in this register."

So by theory, only multiple queue configured cores needs the enable operation.

>>> But came to my attention a setup that has 1 RX queue and 2 TX queues, which
enables multiple queues mechanism inside the core (even with 1 RX) and so RX
needs to be enabled. Because of that I agree with this patch.

Acked-By: Joao Pinto <jpinto@synopsys.com>

[toc] | [next] | [standalone]


#1605803

FromThierry Reding <thierry.reding@gmail.com>
Date2017-03-21 17:50 +0100
Message-ID<tnv8S-5UV-19@gated-at.bofh.it>
In reply to#1605707

[Multipart message — attachments visible in raw view] — view raw

On Tue, Mar 21, 2017 at 03:18:20PM +0000, Joao Pinto wrote:
> Às 3:12 PM de 3/21/2017, Thierry Reding escreveu:
> > From: Thierry Reding <treding@nvidia.com>
> > 
> > The MAC RX queues always need to be enabled in order to receive network
> > packets. Remove the condition that this only needs to be done for multi-
> > queue configurations.
> > 
> > Signed-off-by: Thierry Reding <treding@nvidia.com>
> > ---
> >  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > index d3a21519e4c0..298956032098 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > @@ -1943,7 +1943,7 @@ static void stmmac_mtl_configuration(struct stmmac_priv *priv)
> >  		stmmac_rx_queue_dma_chan_map(priv);
> >  
> >  	/* Enable MAC RX Queues */
> > -	if (rx_queues_count > 1 && priv->hw->mac->rx_queue_enable)
> > +	if (priv->hw->mac->rx_queue_enable)
> >  		stmmac_mac_enable_rx_queues(priv);
> >  
> >  	/* Set the HW DMA mode and the COE */
> > 
> 
> This text is from the Databook:
> 
> "In multiple Rx queues configuration, all the queues are disabled by default.
> Enable the Rx queue by programming the corresponding field in this register."
> 
> So by theory, only multiple queue configured cores needs the enable operation.

But that's related to multiple queues configured in the core when it was
instantiated (i.e. the capabilities). rx_queues_count reflects the
number of queues enabled in the driver, so it can be 1 even if the core
itself supports more than one queue.

In that case, we still want to enable the MAC RX queue because it will
otherwise remain disabled.

> 
> >>> But came to my attention a setup that has 1 RX queue and 2 TX queues, which
> enables multiple queues mechanism inside the core (even with 1 RX) and so RX
> needs to be enabled. Because of that I agree with this patch.
> 
> Acked-By: Joao Pinto <jpinto@synopsys.com>

Yeah, that case would also require this patch.

Thierry

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web