All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Gur Stavi <gur.stavi@huawei.com>
Cc: Fan Gong <gongfan1@huawei.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>, <linux-doc@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Bjorn Helgaas <helgaas@kernel.org>, luosifu <luosifu@huawei.com>,
	Xin Guo <guoxin09@huawei.com>,
	Shen Chenyang <shenchenyang1@hisilicon.com>,
	Zhou Shuai <zhoushuai28@huawei.com>, Wu Like <wulike1@huawei.com>,
	Shi Jing <shijing34@huawei.com>,
	Meny Yossefi <meny.yossefi@huawei.com>,
	Lee Trager <lee@trager.us>, Michael Ellerman <mpe@ellerman.id.au>,
	Suman Ghosh <sumang@marvell.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Joe Damato <jdamato@fastly.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: Re: [PATCH net-next v14 1/1] hinic3: module initialization and tx/rx logic
Date: Thu, 8 May 2025 18:51:38 -0700	[thread overview]
Message-ID: <20250508185138.44849a7a@kernel.org> (raw)
In-Reply-To: <35f370e77ceaec7ebff5e160e9daee2f9c7b98f0.1746689795.git.gur.stavi@huawei.com>

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.

  reply	other threads:[~2025-05-09  1:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-08  7:56 [PATCH net-next v14 0/1] net: hinic3: Add a driver for Huawei 3rd gen NIC Gur Stavi
2025-08-20  8:55 ` Fan Gong
2025-05-08  7:56 ` [PATCH net-next v14 1/1] hinic3: module initialization and tx/rx logic Gur Stavi
2025-08-20  8:55   ` Fan Gong
2025-05-09  1:51   ` Jakub Kicinski [this message]
2025-08-20  9:30   ` Fan Gong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250508185138.44849a7a@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gongfan1@huawei.com \
    --cc=guoxin09@huawei.com \
    --cc=gur.stavi@huawei.com \
    --cc=helgaas@kernel.org \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=lee@trager.us \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luosifu@huawei.com \
    --cc=meny.yossefi@huawei.com \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=shenchenyang1@hisilicon.com \
    --cc=shijing34@huawei.com \
    --cc=sumang@marvell.com \
    --cc=wulike1@huawei.com \
    --cc=zhoushuai28@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.