Re: [PATCH net] net: stmmac: First Queue must always be in DCB mode
From: Jose Abreu
Date: Thu Oct 26 2017 - 07:49:53 EST
Hi Bhadram,
On 26-10-2017 11:51, Bhadram Varka wrote:
> Hi Jose,
>
>> -----Original Message-----
>> From: netdev-owner@xxxxxxxxxxxxxxx [mailto:netdev-
>> owner@xxxxxxxxxxxxxxx] On Behalf Of Jose Abreu
>> Sent: Thursday, October 26, 2017 2:37 PM
>> To: netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
>> Cc: Jose Abreu <Jose.Abreu@xxxxxxxxxxxx>; Joao Pinto
>> <Joao.Pinto@xxxxxxxxxxxx>; David S. Miller <davem@xxxxxxxxxxxxx>;
>> Giuseppe Cavallaro <peppe.cavallaro@xxxxxx>; Alexandre Torgue
>> <alexandre.torgue@xxxxxx>
>> 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@xxxxxxxxxxxx>
>> Cc: Joao Pinto <jpinto@xxxxxxxxxxxx>
>> Cc: David S. Miller <davem@xxxxxxxxxxxxx>
>> Cc: Giuseppe Cavallaro <peppe.cavallaro@xxxxxx>
>> Cc: Alexandre Torgue <alexandre.torgue@xxxxxx>
>> ---
>> 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.