Skip to content

Commit 32ad45b

Browse files
committed
docs: net: clarify the NAPI rules around XDP Tx
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. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 57f1f9d commit 32ad45b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Documentation/networking/napi.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,16 @@ argument - drivers can process completions for any number of Tx
6565
packets but should only process up to ``budget`` number of
6666
Rx packets. Rx processing is usually much more expensive.
6767

68-
In other words, it is recommended to ignore the budget argument when
69-
performing TX buffer reclamation to ensure that the reclamation is not
70-
arbitrarily bounded; however, it is required to honor the budget argument
71-
for RX processing.
68+
In other words for Rx processing the ``budget`` argument limits how many
69+
packets driver can process in a single poll. Rx specific APIs like page
70+
pool or XDP cannot be used at all when ``budget`` is 0.
71+
skb Tx processing should happen regardless of the ``budget``, but if
72+
the argument is 0 driver cannot call any XDP (or page pool) APIs.
7273

7374
.. warning::
7475

75-
The ``budget`` argument may be 0 if core tries to only process Tx completions
76-
and no Rx packets.
76+
The ``budget`` argument may be 0 if core tries to only process
77+
skb Tx completions and no Rx or XDP packets.
7778

7879
The poll method returns the amount of work done. If the driver still
7980
has outstanding work to do (e.g. ``budget`` was exhausted)

0 commit comments

Comments
 (0)