Commit 32ad45b7 authored by Jakub Kicinski's avatar Jakub Kicinski

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/20230720161323.2025379-1-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 57f1f9dd
...@@ -65,15 +65,16 @@ argument - drivers can process completions for any number of Tx ...@@ -65,15 +65,16 @@ argument - drivers can process completions for any number of Tx
packets but should only process up to ``budget`` number of packets but should only process up to ``budget`` number of
Rx packets. Rx processing is usually much more expensive. Rx packets. Rx processing is usually much more expensive.
In other words, it is recommended to ignore the budget argument when In other words for Rx processing the ``budget`` argument limits how many
performing TX buffer reclamation to ensure that the reclamation is not packets driver can process in a single poll. Rx specific APIs like page
arbitrarily bounded; however, it is required to honor the budget argument pool or XDP cannot be used at all when ``budget`` is 0.
for RX processing. 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:: .. warning::
The ``budget`` argument may be 0 if core tries to only process Tx completions The ``budget`` argument may be 0 if core tries to only process
and no Rx packets. skb Tx completions and no Rx or XDP packets.
The poll method returns the amount of work done. If the driver still The poll method returns the amount of work done. If the driver still
has outstanding work to do (e.g. ``budget`` was exhausted) has outstanding work to do (e.g. ``budget`` was exhausted)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment