netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
	herbert@gondor.apana.org.au, alexander.duyck@gmail.com,
	hkallweit1@gmail.com, andrew@lunn.ch, willemb@google.com,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next v4 0/7] net: lockless stop/wake combo macros
Date: Thu,  6 Apr 2023 18:25:29 -0700	[thread overview]
Message-ID: <20230407012536.273382-1-kuba@kernel.org> (raw)

A lot of drivers follow the same scheme to stop / start queues
without introducing locks between xmit and NAPI tx completions.
I'm guessing they all copy'n'paste each other's code.
The original code dates back all the way to e1000 and Linux 2.6.19.

v4:
 - adjust a comment in patch 4
 - use IS_ENABLED() in patch 7
v3: https://lore.kernel.org/all/20230405223134.94665-1-kuba@kernel.org/
 - render the info as part of documentation, maybe someone will
   notice and use it (patches 1, 2, 3 are new)
 - use the __after_atomic barrier
 - add last patch to avoid a barrier in the wake path
more detailed change logs in the patches.

v2: https://lore.kernel.org/all/20230401051221.3160913-2-kuba@kernel.org/
 - really flip the unlikely into a likely in __netif_tx_queue_maybe_wake()
 - convert if / else into pre-init of _ret
v1: https://lore.kernel.org/all/20230322233028.269410-1-kuba@kernel.org/
 - perdicate -> predicate
 - on race use start instead of wake and make a note of that
   in the doc / comment at the start
rfc: https://lore.kernel.org/all/20230311050130.115138-1-kuba@kernel.org/

Jakub Kicinski (7):
  docs: net: reformat driver.rst from a list to sections
  docs: net: move the probe and open/close sections of driver.rst up
  docs: net: use C syntax highlight in driver.rst
  net: provide macros for commonly copied lockless queue stop/wake code
  ixgbe: use new queue try_stop/try_wake macros
  bnxt: use new queue try_stop/try_wake macros
  net: piggy back on the memory barrier in bql when waking queues

 Documentation/networking/driver.rst           | 119 ++++++++-----
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     |  42 +----
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |  42 ++---
 include/linux/netdevice.h                     |   3 +-
 include/net/netdev_queues.h                   | 163 ++++++++++++++++++
 5 files changed, 262 insertions(+), 107 deletions(-)
 create mode 100644 include/net/netdev_queues.h

-- 
2.39.2


             reply	other threads:[~2023-04-07  1:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07  1:25 Jakub Kicinski [this message]
2023-04-07  1:25 ` [PATCH net-next v4 1/7] docs: net: reformat driver.rst from a list to sections Jakub Kicinski
2023-04-07  1:25 ` [PATCH net-next v4 2/7] docs: net: move the probe and open/close sections of driver.rst up Jakub Kicinski
2023-04-07  1:25 ` [PATCH net-next v4 3/7] docs: net: use C syntax highlight in driver.rst Jakub Kicinski
2023-04-07  1:25 ` [PATCH net-next v4 4/7] net: provide macros for commonly copied lockless queue stop/wake code Jakub Kicinski
2023-04-07  1:25 ` [PATCH net-next v4 5/7] ixgbe: use new queue try_stop/try_wake macros Jakub Kicinski
2023-04-07  1:25 ` [PATCH net-next v4 6/7] bnxt: " Jakub Kicinski
2023-04-07  9:25   ` Eric Dumazet
2023-04-07 14:36     ` Jakub Kicinski
2023-04-07  1:25 ` [PATCH net-next v4 7/7] net: piggy back on the memory barrier in bql when waking queues Jakub Kicinski
2023-04-11  1:30 ` [PATCH net-next v4 0/7] net: lockless stop/wake combo macros patchwork-bot+netdevbpf

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=20230407012536.273382-1-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=alexander.duyck@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=hkallweit1@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).