[PATCH] net: ethernet: ti: am65-cpsw-qos: fix non-bql configs

Arnd Bergmann posted 1 patch 1 year, 11 months ago
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 4 ++++
1 file changed, 4 insertions(+)
[PATCH] net: ethernet: ti: am65-cpsw-qos: fix non-bql configs
Posted by Arnd Bergmann 1 year, 11 months ago
From: Arnd Bergmann <arnd@arndb.de>

It is now possible to disable BQL, but that causes cpsw to break:

drivers/net/ethernet/ti/am65-cpsw-nuss.c:297:28: error: no member named 'dql' in 'struct netdev_queue'
  297 |                    dql_avail(&netif_txq->dql),

Add an #ifdef check for CONFIG_BQL around this usage.

Fixes: ea7f3cfaa588 ("net: bql: allow the config to be disabled")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/ti/am65-cpsw-nuss.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index 9d2f4ac783e4..3a3ec9959ee2 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -294,7 +294,11 @@ static void am65_cpsw_nuss_ndo_host_tx_timeout(struct net_device *ndev,
 		   txqueue,
 		   netif_tx_queue_stopped(netif_txq),
 		   jiffies_to_msecs(jiffies - trans_start),
+#ifdef CONFIG_BQL
 		   dql_avail(&netif_txq->dql),
+#else
+		   0,
+#endif
 		   k3_cppi_desc_pool_avail(tx_chn->desc_pool));
 
 	if (netif_tx_queue_stopped(netif_txq)) {
-- 
2.39.2
Re: [PATCH] net: ethernet: ti: am65-cpsw-qos: fix non-bql configs
Posted by Jakub Kicinski 1 year, 11 months ago
On Wed, 28 Feb 2024 15:03:10 +0100 Arnd Bergmann wrote:
> +#ifdef CONFIG_BQL
>  		   dql_avail(&netif_txq->dql),
> +#else
> +		   0,
> +#endif

Same exact code exists in qdisc_avail_bulklimit()
How about we add static inline in netdevice.h wrapping
this, like we do for other BQL related functionality?
(taking in txq as the argument)
Re: [PATCH] net: ethernet: ti: am65-cpsw-qos: fix non-bql configs
Posted by Breno Leitao 1 year, 11 months ago
On Wed, Feb 28, 2024 at 03:03:10PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> It is now possible to disable BQL, but that causes cpsw to break:
> 
> drivers/net/ethernet/ti/am65-cpsw-nuss.c:297:28: error: no member named 'dql' in 'struct netdev_queue'
>   297 |                    dql_avail(&netif_txq->dql),
> 
> Add an #ifdef check for CONFIG_BQL around this usage.

I confirmed that all other cases where queue->dql is accessed, it is
inside a #ifdef CONFIG_BQL block, so, seems appropriate doing the same
here.

> Fixes: ea7f3cfaa588 ("net: bql: allow the config to be disabled")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviwed-by: Breno Leitao <leitao@debian.org>
Re: [PATCH] net: ethernet: ti: am65-cpsw-qos: fix non-bql configs
Posted by Dave Taht 1 year, 11 months ago
but why do you want to disable BQL?

On Wed, Feb 28, 2024 at 9:04 AM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> It is now possible to disable BQL, but that causes cpsw to break:
>
> drivers/net/ethernet/ti/am65-cpsw-nuss.c:297:28: error: no member named 'dql' in 'struct netdev_queue'
>   297 |                    dql_avail(&netif_txq->dql),
>
> Add an #ifdef check for CONFIG_BQL around this usage.
>
> Fixes: ea7f3cfaa588 ("net: bql: allow the config to be disabled")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/net/ethernet/ti/am65-cpsw-nuss.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> index 9d2f4ac783e4..3a3ec9959ee2 100644
> --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> @@ -294,7 +294,11 @@ static void am65_cpsw_nuss_ndo_host_tx_timeout(struct net_device *ndev,
>                    txqueue,
>                    netif_tx_queue_stopped(netif_txq),
>                    jiffies_to_msecs(jiffies - trans_start),
> +#ifdef CONFIG_BQL
>                    dql_avail(&netif_txq->dql),
> +#else
> +                  0,
> +#endif
>                    k3_cppi_desc_pool_avail(tx_chn->desc_pool));
>
>         if (netif_tx_queue_stopped(netif_txq)) {
> --
> 2.39.2
>
>


-- 
https://blog.cerowrt.org/post/2024_predictions/
Dave Täht CSO, LibreQos