* [PATCH] net: ethernet: ti: fix netdev_queue compiling error
@ 2021-06-17 11:28 Chen Jiahao
2021-06-18 10:40 ` Grygorii Strashko
0 siblings, 1 reply; 3+ messages in thread
From: Chen Jiahao @ 2021-06-17 11:28 UTC (permalink / raw)
To: davem, kuba, grygorii.strashko, jesse.brandeburg, vigneshr,
peter.ujfalusi, netdev, linux-kernel
Cc: chenjiahao16, heying24
There is a compiling error in am65-cpsw-nuss.c while not selecting
CONFIG_BQL:
drivers/net/ethernet/ti/am65-cpsw-nuss.c: In function
‘am65_cpsw_nuss_ndo_host_tx_timeout’:
drivers/net/ethernet/ti/am65-cpsw-nuss.c:353:26: error:
‘struct netdev_queue’ has no member named ‘dql’
353 | dql_avail(&netif_txq->dql),
| ^~
This problem is solved by adding the #ifdef CONFIG_BQL directive
where struct dql is used.
Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver")
Signed-off-by: Chen Jiahao <chenjiahao16@huawei.com>
---
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index 6a67b026df0b..a0b30bb763ea 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -346,12 +346,20 @@ static void am65_cpsw_nuss_ndo_host_tx_timeout(struct net_device *ndev,
tx_chn = &common->tx_chns[txqueue];
trans_start = netif_txq->trans_start;
+#ifdef CONFIG_BQL
netdev_err(ndev, "txq:%d DRV_XOFF:%d tmo:%u dql_avail:%d free_desc:%zu\n",
txqueue,
netif_tx_queue_stopped(netif_txq),
jiffies_to_msecs(jiffies - trans_start),
dql_avail(&netif_txq->dql),
k3_cppi_desc_pool_avail(tx_chn->desc_pool));
+#else
+ netdev_err(ndev, "txq:%d DRV_XOFF:%d tmo:%u free_desc:%zu\n",
+ txqueue,
+ netif_tx_queue_stopped(netif_txq),
+ jiffies_to_msecs(jiffies - trans_start),
+ k3_cppi_desc_pool_avail(tx_chn->desc_pool));
+#endif
if (netif_tx_queue_stopped(netif_txq)) {
/* try recover if stopped by us */
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: ethernet: ti: fix netdev_queue compiling error
2021-06-17 11:28 [PATCH] net: ethernet: ti: fix netdev_queue compiling error Chen Jiahao
@ 2021-06-18 10:40 ` Grygorii Strashko
2021-06-21 8:18 ` chenjiahao (C)
0 siblings, 1 reply; 3+ messages in thread
From: Grygorii Strashko @ 2021-06-18 10:40 UTC (permalink / raw)
To: Chen Jiahao, davem, kuba, jesse.brandeburg, vigneshr, netdev,
linux-kernel
Cc: heying24
On 17/06/2021 14:28, Chen Jiahao wrote:
> There is a compiling error in am65-cpsw-nuss.c while not selecting
> CONFIG_BQL:
>
> drivers/net/ethernet/ti/am65-cpsw-nuss.c: In function
> ‘am65_cpsw_nuss_ndo_host_tx_timeout’:
> drivers/net/ethernet/ti/am65-cpsw-nuss.c:353:26: error:
> ‘struct netdev_queue’ has no member named ‘dql’
> 353 | dql_avail(&netif_txq->dql),
> | ^~
>
> This problem is solved by adding the #ifdef CONFIG_BQL directive
> where struct dql is used.
>
> Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver")
> Signed-off-by: Chen Jiahao <chenjiahao16@huawei.com>
> ---
> drivers/net/ethernet/ti/am65-cpsw-nuss.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> index 6a67b026df0b..a0b30bb763ea 100644
> --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> @@ -346,12 +346,20 @@ static void am65_cpsw_nuss_ndo_host_tx_timeout(struct net_device *ndev,
> tx_chn = &common->tx_chns[txqueue];
> trans_start = netif_txq->trans_start;
>
> +#ifdef CONFIG_BQL
> netdev_err(ndev, "txq:%d DRV_XOFF:%d tmo:%u dql_avail:%d free_desc:%zu\n",
> txqueue,
> netif_tx_queue_stopped(netif_txq),
> jiffies_to_msecs(jiffies - trans_start),
> dql_avail(&netif_txq->dql),
> k3_cppi_desc_pool_avail(tx_chn->desc_pool));
> +#else
> + netdev_err(ndev, "txq:%d DRV_XOFF:%d tmo:%u free_desc:%zu\n",
> + txqueue,
> + netif_tx_queue_stopped(netif_txq),
> + jiffies_to_msecs(jiffies - trans_start),
> + k3_cppi_desc_pool_avail(tx_chn->desc_pool));
> +#endif
>
> if (netif_tx_queue_stopped(netif_txq)) {
> /* try recover if stopped by us */
>
Seems like there is right helper available - qdisc_avail_bulklimit().
Any way, it most probably has to be solved in generic way on netdev/dql level.
--
Best regards,
grygorii
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: ethernet: ti: fix netdev_queue compiling error
2021-06-18 10:40 ` Grygorii Strashko
@ 2021-06-21 8:18 ` chenjiahao (C)
0 siblings, 0 replies; 3+ messages in thread
From: chenjiahao (C) @ 2021-06-21 8:18 UTC (permalink / raw)
To: Grygorii Strashko, davem, kuba, jesse.brandeburg, vigneshr,
netdev, linux-kernel
Cc: heying24
Hi,
Thanks for the review. But still I have a little question in the helper
you just mentioned:
static inline int qdisc_avail_bulklimit(const struct netdev_queue *txq)
{
#ifdef CONFIG_BQL
/* Non-BQL migrated drivers will return 0, too. */
return dql_avail(&txq->dql);
#else
return 0;
#endif
}
In the snippet above, if CONFIG_BQL is not set, 0 will be simply
returned and get printed. Should we distinguish this case, or just let
it be?
Sincerely,
Jiahao Chen
在 2021/6/18 18:40, Grygorii Strashko 写道:
>
>
> On 17/06/2021 14:28, Chen Jiahao wrote:
>> There is a compiling error in am65-cpsw-nuss.c while not selecting
>> CONFIG_BQL:
>>
>> drivers/net/ethernet/ti/am65-cpsw-nuss.c: In function
>> ‘am65_cpsw_nuss_ndo_host_tx_timeout’:
>> drivers/net/ethernet/ti/am65-cpsw-nuss.c:353:26: error:
>> ‘struct netdev_queue’ has no member named ‘dql’
>> 353 | dql_avail(&netif_txq->dql),
>> | ^~
>>
>> This problem is solved by adding the #ifdef CONFIG_BQL directive
>> where struct dql is used.
>>
>> Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit
>> eth subsystem driver")
>> Signed-off-by: Chen Jiahao <chenjiahao16@huawei.com>
>> ---
>> drivers/net/ethernet/ti/am65-cpsw-nuss.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
>> b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
>> index 6a67b026df0b..a0b30bb763ea 100644
>> --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
>> +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
>> @@ -346,12 +346,20 @@ static void
>> am65_cpsw_nuss_ndo_host_tx_timeout(struct net_device *ndev,
>> tx_chn = &common->tx_chns[txqueue];
>> trans_start = netif_txq->trans_start;
>> +#ifdef CONFIG_BQL
>> netdev_err(ndev, "txq:%d DRV_XOFF:%d tmo:%u dql_avail:%d
>> free_desc:%zu\n",
>> txqueue,
>> netif_tx_queue_stopped(netif_txq),
>> jiffies_to_msecs(jiffies - trans_start),
>> dql_avail(&netif_txq->dql),
>> k3_cppi_desc_pool_avail(tx_chn->desc_pool));
>> +#else
>> + netdev_err(ndev, "txq:%d DRV_XOFF:%d tmo:%u free_desc:%zu\n",
>> + txqueue,
>> + netif_tx_queue_stopped(netif_txq),
>> + jiffies_to_msecs(jiffies - trans_start),
>> + k3_cppi_desc_pool_avail(tx_chn->desc_pool));
>> +#endif
>> if (netif_tx_queue_stopped(netif_txq)) {
>> /* try recover if stopped by us */
>>
>
> Seems like there is right helper available - qdisc_avail_bulklimit().
>
> Any way, it most probably has to be solved in generic way on netdev/dql
> level.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-21 8:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 11:28 [PATCH] net: ethernet: ti: fix netdev_queue compiling error Chen Jiahao
2021-06-18 10:40 ` Grygorii Strashko
2021-06-21 8:18 ` chenjiahao (C)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).