netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/7] net: lockless stop/wake combo macros
@ 2023-04-05 22:31 Jakub Kicinski
  2023-04-05 22:31 ` [PATCH net-next v3 1/7] docs: net: reformat driver.rst from a list to sections Jakub Kicinski
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Jakub Kicinski @ 2023-04-05 22:31 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, herbert, alexander.duyck, hkallweit1,
	andrew, willemb, Jakub Kicinski

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.

v3:
 - 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                   | 165 ++++++++++++++++++
 5 files changed, 264 insertions(+), 107 deletions(-)
 create mode 100644 include/net/netdev_queues.h

-- 
2.39.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-04-13  2:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-05 22:31 [PATCH net-next v3 0/7] net: lockless stop/wake combo macros Jakub Kicinski
2023-04-05 22:31 ` [PATCH net-next v3 1/7] docs: net: reformat driver.rst from a list to sections Jakub Kicinski
2023-04-05 22:31 ` [PATCH net-next v3 2/7] docs: net: move the probe and open/close sections of driver.rst up Jakub Kicinski
2023-04-05 22:31 ` [PATCH net-next v3 3/7] docs: net: use C syntax highlight in driver.rst Jakub Kicinski
2023-04-05 22:31 ` [PATCH net-next v3 4/7] net: provide macros for commonly copied lockless queue stop/wake code Jakub Kicinski
2023-04-06  7:22   ` Herbert Xu
2023-04-05 22:31 ` [PATCH net-next v3 5/7] ixgbe: use new queue try_stop/try_wake macros Jakub Kicinski
2023-04-05 22:31 ` [PATCH net-next v3 6/7] bnxt: " Jakub Kicinski
2023-04-05 22:31 ` [PATCH net-next v3 7/7] net: piggy back on the memory barrier in bql when waking queues Jakub Kicinski
2023-04-06  7:35   ` Herbert Xu
2023-04-07  0:41     ` Jakub Kicinski
2023-04-12  6:06       ` Herbert Xu
2023-04-12 13:54         ` Jakub Kicinski
2023-04-13  2:31           ` Herbert Xu

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).