Skip to content

Commit eb2c11b

Browse files
arndbdavem330
authored andcommitted
net: bql: fix building with BQL disabled
It is now possible to disable BQL, but that causes the cpsw driver 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), There is already a helper function in net/sch_generic.h that could be used to help here. Move its implementation into the common linux/netdevice.h along with the other bql interfaces and change both users over to the new interface. Fixes: ea7f3cf ("net: bql: allow the config to be disabled") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1eecc7a commit eb2c11b

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

drivers/net/ethernet/ti/am65-cpsw-nuss.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static void am65_cpsw_nuss_ndo_host_tx_timeout(struct net_device *ndev,
294294
txqueue,
295295
netif_tx_queue_stopped(netif_txq),
296296
jiffies_to_msecs(jiffies - trans_start),
297-
dql_avail(&netif_txq->dql),
297+
netdev_queue_dql_avail(netif_txq),
298298
k3_cppi_desc_pool_avail(tx_chn->desc_pool));
299299

300300
if (netif_tx_queue_stopped(netif_txq)) {

include/linux/netdevice.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3499,6 +3499,16 @@ static inline void netdev_queue_set_dql_min_limit(struct netdev_queue *dev_queue
34993499
#endif
35003500
}
35013501

3502+
static inline int netdev_queue_dql_avail(const struct netdev_queue *txq)
3503+
{
3504+
#ifdef CONFIG_BQL
3505+
/* Non-BQL migrated drivers will return 0, too. */
3506+
return dql_avail(&txq->dql);
3507+
#else
3508+
return 0;
3509+
#endif
3510+
}
3511+
35023512
/**
35033513
* netdev_txq_bql_enqueue_prefetchw - prefetch bql data for write
35043514
* @dev_queue: pointer to transmit queue

include/net/sch_generic.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,7 @@ static inline bool qdisc_may_bulk(const struct Qdisc *qdisc)
238238

239239
static inline int qdisc_avail_bulklimit(const struct netdev_queue *txq)
240240
{
241-
#ifdef CONFIG_BQL
242-
/* Non-BQL migrated drivers will return 0, too. */
243-
return dql_avail(&txq->dql);
244-
#else
245-
return 0;
246-
#endif
241+
return netdev_queue_dql_avail(txq);
247242
}
248243

249244
struct Qdisc_class_ops {

0 commit comments

Comments
 (0)