mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] net: stmmac: First Queue must always be in DCB mode
@ 2017-10-26  9:07 Jose Abreu
  2017-10-26 10:51 ` Bhadram Varka
  2017-10-27 14:33 ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Jose Abreu @ 2017-10-26  9:07 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: Jose Abreu, Joao Pinto, David S. Miller, Giuseppe Cavallaro,
	Alexandre Torgue

According to DWMAC databook the first queue operating mode
must always be in DCB.

As MTL_QUEUE_DCB = 1, we need to always set the first queue
operating mode to DCB otherwise driver will think that queue
is in AVB mode (because MTL_QUEUE_AVB = 0).

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 21f59fe..603225b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -150,6 +150,13 @@ static void stmmac_mtl_setup(struct platform_device *pdev,
 	plat->rx_queues_to_use = 1;
 	plat->tx_queues_to_use = 1;
 
+	/* First Queue must always be in DCB mode. As MTL_QUEUE_DCB = 1 we need
+	 * to always set this, otherwise Queue will be classified as AVB
+	 * (because MTL_QUEUE_AVB = 0).
+	 */
+	plat->rx_queues_cfg[0].mode_to_use = MTL_QUEUE_DCB;
+	plat->tx_queues_cfg[0].mode_to_use = MTL_QUEUE_DCB;
+
 	rx_node = of_parse_phandle(pdev->dev.of_node, "snps,mtl-rx-config", 0);
 	if (!rx_node)
 		return;
-- 
1.9.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH net] net: stmmac: First Queue must always be in DCB mode
  2017-10-26  9:07 [PATCH net] net: stmmac: First Queue must always be in DCB mode Jose Abreu
@ 2017-10-26 10:51 ` Bhadram Varka
  2017-10-26 11:49   ` Jose Abreu
  2017-10-27 14:33 ` David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Bhadram Varka @ 2017-10-26 10:51 UTC (permalink / raw)
  To: Jose Abreu, netdev, linux-kernel
  Cc: Joao Pinto, David S. Miller, Giuseppe Cavallaro, Alexandre Torgue

Hi Jose,

> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-
> owner@vger.kernel.org] On Behalf Of Jose Abreu
> Sent: Thursday, October 26, 2017 2:37 PM
> To: netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Cc: Jose Abreu <Jose.Abreu@synopsys.com>; Joao Pinto
> <Joao.Pinto@synopsys.com>; David S. Miller <davem@davemloft.net>;
> Giuseppe Cavallaro <peppe.cavallaro@st.com>; Alexandre Torgue
> <alexandre.torgue@st.com>
> Subject: [PATCH net] net: stmmac: First Queue must always be in DCB mode
> 
> According to DWMAC databook the first queue operating mode must always
> be in DCB.
> 
> As MTL_QUEUE_DCB = 1, we need to always set the first queue operating
> mode to DCB otherwise driver will think that queue is in AVB mode (because
> MTL_QUEUE_AVB = 0).
> 
> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> Cc: Joao Pinto <jpinto@synopsys.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Cc: Alexandre Torgue <alexandre.torgue@st.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index 21f59fe..603225b 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -150,6 +150,13 @@ static void stmmac_mtl_setup(struct
> platform_device *pdev,
>  	plat->rx_queues_to_use = 1;
>  	plat->tx_queues_to_use = 1;
> 
> +	/* First Queue must always be in DCB mode. As MTL_QUEUE_DCB =
> 1 we need
> +	 * to always set this, otherwise Queue will be classified as AVB
> +	 * (because MTL_QUEUE_AVB = 0).
> +	 */
Its better if we can check whether IP HW features (register - 0x120) supports the DCB or not. If yes, then set the DCB mode.
There is possibility that DCB feature not enable for few of the Synopsys IP's.

Thanks,
Bhadram.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] net: stmmac: First Queue must always be in DCB mode
  2017-10-26 10:51 ` Bhadram Varka
@ 2017-10-26 11:49   ` Jose Abreu
  2017-10-26 14:44     ` Bhadram Varka
  0 siblings, 1 reply; 6+ messages in thread
From: Jose Abreu @ 2017-10-26 11:49 UTC (permalink / raw)
  To: Bhadram Varka, netdev, linux-kernel
  Cc: Joao Pinto, David S. Miller, Giuseppe Cavallaro, Alexandre Torgue

Hi Bhadram,

On 26-10-2017 11:51, Bhadram Varka wrote:
> Hi Jose,
>
>> -----Original Message-----
>> From: netdev-owner@vger.kernel.org [mailto:netdev-
>> owner@vger.kernel.org] On Behalf Of Jose Abreu
>> Sent: Thursday, October 26, 2017 2:37 PM
>> To: netdev@vger.kernel.org; linux-kernel@vger.kernel.org
>> Cc: Jose Abreu <Jose.Abreu@synopsys.com>; Joao Pinto
>> <Joao.Pinto@synopsys.com>; David S. Miller <davem@davemloft.net>;
>> Giuseppe Cavallaro <peppe.cavallaro@st.com>; Alexandre Torgue
>> <alexandre.torgue@st.com>
>> Subject: [PATCH net] net: stmmac: First Queue must always be in DCB mode
>>
>> According to DWMAC databook the first queue operating mode must always
>> be in DCB.
>>
>> As MTL_QUEUE_DCB = 1, we need to always set the first queue operating
>> mode to DCB otherwise driver will think that queue is in AVB mode (because
>> MTL_QUEUE_AVB = 0).
>>
>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
>> Cc: Joao Pinto <jpinto@synopsys.com>
>> Cc: David S. Miller <davem@davemloft.net>
>> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
>> Cc: Alexandre Torgue <alexandre.torgue@st.com>
>> ---
>>  drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>> b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>> index 21f59fe..603225b 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>> @@ -150,6 +150,13 @@ static void stmmac_mtl_setup(struct
>> platform_device *pdev,
>>  	plat->rx_queues_to_use = 1;
>>  	plat->tx_queues_to_use = 1;
>>
>> +	/* First Queue must always be in DCB mode. As MTL_QUEUE_DCB =
>> 1 we need
>> +	 * to always set this, otherwise Queue will be classified as AVB
>> +	 * (because MTL_QUEUE_AVB = 0).
>> +	 */
> Its better if we can check whether IP HW features (register - 0x120) supports the DCB or not. If yes, then set the DCB mode.
> There is possibility that DCB feature not enable for few of the Synopsys IP's.

A queue can either be in Generic/DCB or AVB mode. The sequence to
enable a DCB or a Generic queue is the same so there is no need
to check for DCB capability in HW.

Best Regards,
Jose Miguel Abreu

>
> Thanks,
> Bhadram.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH net] net: stmmac: First Queue must always be in DCB mode
  2017-10-26 11:49   ` Jose Abreu
@ 2017-10-26 14:44     ` Bhadram Varka
  2017-10-27  8:10       ` Jose Abreu
  0 siblings, 1 reply; 6+ messages in thread
From: Bhadram Varka @ 2017-10-26 14:44 UTC (permalink / raw)
  To: Jose Abreu, netdev, linux-kernel
  Cc: Joao Pinto, David S. Miller, Giuseppe Cavallaro, Alexandre Torgue

Hi Jose,

> -----Original Message-----
> From: Jose Abreu [mailto:Jose.Abreu@synopsys.com]
> Sent: Thursday, October 26, 2017 5:19 PM
> To: Bhadram Varka <vbhadram@nvidia.com>; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Cc: Joao Pinto <Joao.Pinto@synopsys.com>; David S. Miller
> <davem@davemloft.net>; Giuseppe Cavallaro <peppe.cavallaro@st.com>;
> Alexandre Torgue <alexandre.torgue@st.com>
> Subject: Re: [PATCH net] net: stmmac: First Queue must always be in DCB
> mode
> 
> Hi Bhadram,
> 
> On 26-10-2017 11:51, Bhadram Varka wrote:
> > Hi Jose,
> >
> >> -----Original Message-----
> >> From: netdev-owner@vger.kernel.org [mailto:netdev-
> >> owner@vger.kernel.org] On Behalf Of Jose Abreu
> >> Sent: Thursday, October 26, 2017 2:37 PM
> >> To: netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> >> Cc: Jose Abreu <Jose.Abreu@synopsys.com>; Joao Pinto
> >> <Joao.Pinto@synopsys.com>; David S. Miller <davem@davemloft.net>;
> >> Giuseppe Cavallaro <peppe.cavallaro@st.com>; Alexandre Torgue
> >> <alexandre.torgue@st.com>
> >> Subject: [PATCH net] net: stmmac: First Queue must always be in DCB
> >> mode
> >>
> >> According to DWMAC databook the first queue operating mode must
> >> always be in DCB.
> >>
> >> As MTL_QUEUE_DCB = 1, we need to always set the first queue operating
> >> mode to DCB otherwise driver will think that queue is in AVB mode
> >> (because MTL_QUEUE_AVB = 0).
> >>
> >> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> >> Cc: Joao Pinto <jpinto@synopsys.com>
> >> Cc: David S. Miller <davem@davemloft.net>
> >> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> >> Cc: Alexandre Torgue <alexandre.torgue@st.com>
> >> ---
> >>  drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++++++
> >>  1 file changed, 7 insertions(+)
> >>
> >> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> >> b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> >> index 21f59fe..603225b 100644
> >> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> >> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> >> @@ -150,6 +150,13 @@ static void stmmac_mtl_setup(struct
> >> platform_device *pdev,
> >>  	plat->rx_queues_to_use = 1;
> >>  	plat->tx_queues_to_use = 1;
> >>
> >> +	/* First Queue must always be in DCB mode. As MTL_QUEUE_DCB =
> >> 1 we need
> >> +	 * to always set this, otherwise Queue will be classified as AVB
> >> +	 * (because MTL_QUEUE_AVB = 0).
> >> +	 */
> > Its better if we can check whether IP HW features (register - 0x120)
> supports the DCB or not. If yes, then set the DCB mode.
> > There is possibility that DCB feature not enable for few of the Synopsys
> IP's.
> 
> A queue can either be in Generic/DCB or AVB mode. The sequence to enable
> a DCB or a Generic queue is the same so there is no need to check for DCB
> capability in HW.

Point is that we don't have DCB enabled for the IP. 

>From your point it will work in Generic (legacy) mode if we set DCB filed. If this is the understanding then we are fine.

Thanks,
Bhadram.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] net: stmmac: First Queue must always be in DCB mode
  2017-10-26 14:44     ` Bhadram Varka
@ 2017-10-27  8:10       ` Jose Abreu
  0 siblings, 0 replies; 6+ messages in thread
From: Jose Abreu @ 2017-10-27  8:10 UTC (permalink / raw)
  To: Bhadram Varka, Jose Abreu, netdev, linux-kernel
  Cc: Joao Pinto, David S. Miller, Giuseppe Cavallaro, Alexandre Torgue



On 26-10-2017 15:44, Bhadram Varka wrote:
> Hi Jose,
>
>> -----Original Message-----
>> From: Jose Abreu [mailto:Jose.Abreu@synopsys.com]
>> Sent: Thursday, October 26, 2017 5:19 PM
>> To: Bhadram Varka <vbhadram@nvidia.com>; netdev@vger.kernel.org;
>> linux-kernel@vger.kernel.org
>> Cc: Joao Pinto <Joao.Pinto@synopsys.com>; David S. Miller
>> <davem@davemloft.net>; Giuseppe Cavallaro <peppe.cavallaro@st.com>;
>> Alexandre Torgue <alexandre.torgue@st.com>
>> Subject: Re: [PATCH net] net: stmmac: First Queue must always be in DCB
>> mode
>>
>> Hi Bhadram,
>>
>> On 26-10-2017 11:51, Bhadram Varka wrote:
>>> Hi Jose,
>>>
>>>> -----Original Message-----
>>>> From: netdev-owner@vger.kernel.org [mailto:netdev-
>>>> owner@vger.kernel.org] On Behalf Of Jose Abreu
>>>> Sent: Thursday, October 26, 2017 2:37 PM
>>>> To: netdev@vger.kernel.org; linux-kernel@vger.kernel.org
>>>> Cc: Jose Abreu <Jose.Abreu@synopsys.com>; Joao Pinto
>>>> <Joao.Pinto@synopsys.com>; David S. Miller <davem@davemloft.net>;
>>>> Giuseppe Cavallaro <peppe.cavallaro@st.com>; Alexandre Torgue
>>>> <alexandre.torgue@st.com>
>>>> Subject: [PATCH net] net: stmmac: First Queue must always be in DCB
>>>> mode
>>>>
>>>> According to DWMAC databook the first queue operating mode must
>>>> always be in DCB.
>>>>
>>>> As MTL_QUEUE_DCB = 1, we need to always set the first queue operating
>>>> mode to DCB otherwise driver will think that queue is in AVB mode
>>>> (because MTL_QUEUE_AVB = 0).
>>>>
>>>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
>>>> Cc: Joao Pinto <jpinto@synopsys.com>
>>>> Cc: David S. Miller <davem@davemloft.net>
>>>> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
>>>> Cc: Alexandre Torgue <alexandre.torgue@st.com>
>>>> ---
>>>>  drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++++++
>>>>  1 file changed, 7 insertions(+)
>>>>
>>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>>>> b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>>>> index 21f59fe..603225b 100644
>>>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>>>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>>>> @@ -150,6 +150,13 @@ static void stmmac_mtl_setup(struct
>>>> platform_device *pdev,
>>>>  	plat->rx_queues_to_use = 1;
>>>>  	plat->tx_queues_to_use = 1;
>>>>
>>>> +	/* First Queue must always be in DCB mode. As MTL_QUEUE_DCB =
>>>> 1 we need
>>>> +	 * to always set this, otherwise Queue will be classified as AVB
>>>> +	 * (because MTL_QUEUE_AVB = 0).
>>>> +	 */
>>> Its better if we can check whether IP HW features (register - 0x120)
>> supports the DCB or not. If yes, then set the DCB mode.
>>> There is possibility that DCB feature not enable for few of the Synopsys
>> IP's.
>>
>> A queue can either be in Generic/DCB or AVB mode. The sequence to enable
>> a DCB or a Generic queue is the same so there is no need to check for DCB
>> capability in HW.
> Point is that we don't have DCB enabled for the IP. 
>
> From your point it will work in Generic (legacy) mode if we set DCB filed. If this is the understanding then we are fine.

Yes, thats true. Generic and DCB have the same configuration.

Best Regards,
Jose Miguel Abreu

>
> Thanks,
> Bhadram.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] net: stmmac: First Queue must always be in DCB mode
  2017-10-26  9:07 [PATCH net] net: stmmac: First Queue must always be in DCB mode Jose Abreu
  2017-10-26 10:51 ` Bhadram Varka
@ 2017-10-27 14:33 ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2017-10-27 14:33 UTC (permalink / raw)
  To: Jose.Abreu
  Cc: netdev, linux-kernel, Joao.Pinto, peppe.cavallaro, alexandre.torgue

From: Jose Abreu <Jose.Abreu@synopsys.com>
Date: Thu, 26 Oct 2017 10:07:12 +0100

> According to DWMAC databook the first queue operating mode
> must always be in DCB.
> 
> As MTL_QUEUE_DCB = 1, we need to always set the first queue
> operating mode to DCB otherwise driver will think that queue
> is in AVB mode (because MTL_QUEUE_AVB = 0).
> 
> Signed-off-by: Jose Abreu <joabreu@synopsys.com>

Applied.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-27 14:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-26  9:07 [PATCH net] net: stmmac: First Queue must always be in DCB mode Jose Abreu
2017-10-26 10:51 ` Bhadram Varka
2017-10-26 11:49   ` Jose Abreu
2017-10-26 14:44     ` Bhadram Varka
2017-10-27  8:10       ` Jose Abreu
2017-10-27 14:33 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome