Re: [PATCH net-next v14 1/1] hinic3: module initialization and tx/rx logic

From: Jakub Kicinski
Date: Thu May 08 2025 - 21:51:51 EST


On Thu, 8 May 2025 10:56:47 +0300 Gur Stavi wrote:
> + if (unlikely(__netif_subqueue_stopped(netdev, q_id) &&
> + hinic3_wq_free_wqebbs(&txq->sq->wq) >= 1 &&
> + test_bit(HINIC3_INTF_UP, &nic_dev->flags))) {
> + struct netdev_queue *netdev_txq =
> + netdev_get_tx_queue(netdev, q_id);
> +
> + __netif_tx_lock(netdev_txq, smp_processor_id());
> + /* avoid re-waking subqueue with xmit_frame */
> + if (__netif_subqueue_stopped(netdev, q_id))
> + netif_wake_subqueue(netdev, q_id);
> +
> + __netif_tx_unlock(netdev_txq);

Have you tried the macros in net/net_queue.h ?
netif_subqueue_maybe_stop() and netif_subqueue_completed_wake()
They implement tried and tested ordering, the lock shouldn't be
necessary.