All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] docs: net: clarify the NAPI rules around XDP Tx
@ 2023-07-20 16:13 Jakub Kicinski
  2023-07-21  2:35 ` Wei Fang
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Jakub Kicinski @ 2023-07-20 16:13 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski, corbet, linux-doc

page pool and XDP should not be accessed from IRQ context
which may happen if drivers try to clean up XDP TX with
NAPI budget of 0.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: corbet@lwn.net
CC: linux-doc@vger.kernel.org
---
 Documentation/networking/napi.rst | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/Documentation/networking/napi.rst b/Documentation/networking/napi.rst
index a7a047742e93..7bf7b95c4f7a 100644
--- a/Documentation/networking/napi.rst
+++ b/Documentation/networking/napi.rst
@@ -65,15 +65,16 @@ argument - drivers can process completions for any number of Tx
 packets but should only process up to ``budget`` number of
 Rx packets. Rx processing is usually much more expensive.
 
-In other words, it is recommended to ignore the budget argument when
-performing TX buffer reclamation to ensure that the reclamation is not
-arbitrarily bounded; however, it is required to honor the budget argument
-for RX processing.
+In other words for Rx processing the ``budget`` argument limits how many
+packets driver can process in a single poll. Rx specific APIs like page
+pool or XDP cannot be used at all when ``budget`` is 0.
+skb Tx processing should happen regardless of the ``budget``, but if
+the argument is 0 driver cannot call any XDP (or page pool) APIs.
 
 .. warning::
 
-   The ``budget`` argument may be 0 if core tries to only process Tx completions
-   and no Rx packets.
+   The ``budget`` argument may be 0 if core tries to only process
+   skb Tx completions and no Rx or XDP packets.
 
 The poll method returns the amount of work done. If the driver still
 has outstanding work to do (e.g. ``budget`` was exhausted)
-- 
2.41.0


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

end of thread, other threads:[~2023-07-26  0:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-20 16:13 [PATCH net] docs: net: clarify the NAPI rules around XDP Tx Jakub Kicinski
2023-07-21  2:35 ` Wei Fang
2023-07-21  3:07   ` Jakub Kicinski
2023-07-21  4:31     ` Wei Fang
2023-07-22  2:10 ` patchwork-bot+netdevbpf
2023-07-25 17:30 ` Alexander H Duyck
2023-07-25 18:55   ` Jakub Kicinski
2023-07-25 20:10     ` Alexander Duyck
2023-07-25 20:41       ` Jakub Kicinski
2023-07-26  0:02         ` Alexander Duyck
2023-07-26  0:56           ` Jakub Kicinski

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.