All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Dong Yibo <dong100@mucse.com>
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, danishanwar@ti.com, vadim.fedorenko@linux.dev,
	horms@kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, yaojun@mucse.com
Subject: Re: [PATCH net-next v5 2/4] net: rnpgbe: Add basic TX packet transmission support
Date: Tue, 2 Jun 2026 14:31:27 -0700	[thread overview]
Message-ID: <20260602143127.097ed301@kernel.org> (raw)
In-Reply-To: <20260528023150.239532-3-dong100@mucse.com>

On Thu, 28 May 2026 10:31:48 +0800 Dong Yibo wrote:
> +static int rnpgbe_maybe_stop_tx(struct mucse_ring *tx_ring, u16 size)
> +{
> +	if (likely(mucse_desc_unused(tx_ring) >= size))
> +		return 0;
> +
> +	netif_stop_subqueue(tx_ring->netdev, tx_ring->queue_index);
> +	/* Herbert's original patch had:
> +	 *  smp_mb__after_netif_stop_queue();
> +	 * but since that doesn't exist yet, just open code it.
> +	 */
> +	smp_mb();
> +
> +	/* We need to check again in a case another CPU has just
> +	 * made room available.
> +	 */
> +	if (likely(mucse_desc_unused(tx_ring) < size))
> +		return -EBUSY;
> +
> +	/* A reprieve! - use start_queue because it doesn't call schedule */
> +	netif_start_subqueue(tx_ring->netdev, tx_ring->queue_index);
> +
> +	return 0;
> +}

please use existing helpers from include/net/netdev_queues.h
-- 
pw-bot: cr

  reply	other threads:[~2026-06-02 21:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28  2:31 [PATCH net-next v5 0/4] net: rnpgbe: Add TX/RX and link status support Dong Yibo
2026-05-28  2:31 ` [PATCH net-next v5 1/4] net: rnpgbe: Add interrupt handling Dong Yibo
2026-05-28  2:31 ` [PATCH net-next v5 2/4] net: rnpgbe: Add basic TX packet transmission support Dong Yibo
2026-06-02 21:31   ` Jakub Kicinski [this message]
2026-05-28  2:31 ` [PATCH net-next v5 3/4] net: rnpgbe: Add RX packet reception support Dong Yibo
2026-05-28  2:31 ` [PATCH net-next v5 4/4] net: rnpgbe: Add link status handling support Dong Yibo

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=20260602143127.097ed301@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=dong100@mucse.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=yaojun@mucse.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.