[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250508185138.44849a7a@kernel.org>
Date: Thu, 8 May 2025 18:51:38 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Gur Stavi <gur.stavi@...wei.com>
Cc: Fan Gong <gongfan1@...wei.com>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Simon
Horman <horms@...nel.org>, Andrew Lunn <andrew+netdev@...n.ch>,
<linux-doc@...r.kernel.org>, Jonathan Corbet <corbet@....net>, Bjorn
Helgaas <helgaas@...nel.org>, luosifu <luosifu@...wei.com>, Xin Guo
<guoxin09@...wei.com>, Shen Chenyang <shenchenyang1@...ilicon.com>, Zhou
Shuai <zhoushuai28@...wei.com>, Wu Like <wulike1@...wei.com>, Shi Jing
<shijing34@...wei.com>, Meny Yossefi <meny.yossefi@...wei.com>, Lee Trager
<lee@...ger.us>, Michael Ellerman <mpe@...erman.id.au>, Suman Ghosh
<sumang@...vell.com>, Przemek Kitszel <przemyslaw.kitszel@...el.com>, Joe
Damato <jdamato@...tly.com>, Christophe JAILLET
<christophe.jaillet@...adoo.fr>
Subject: Re: [PATCH net-next v14 1/1] hinic3: module initialization and
tx/rx logic
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.
Powered by blists - more mailing lists