Lines Matching +full:rx +full:- +full:queues +full:- +full:config

1 .. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
23 of event (packet Rx and Tx) processing.
30 of the NAPI instance while the method is the driver-specific event
37 -----------
55 ------------
64 argument - drivers can process completions for any number of Tx
66 Rx packets. Rx processing is usually much more expensive.
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
77 skb Tx completions and no Rx or XDP packets.
96 or return ``budget - 1``.
101 -------------
109 As mentioned in the :ref:`drv_ctrl` section - napi_disable() and subsequent
118 --------------------------
121 the NAPI instance - until NAPI polling finishes any further
125 to IRQ being auto-masked by the device) should use the napi_schedule_prep()
128 .. code-block:: c
130 if (napi_schedule_prep(&v->napi)) {
131 mydrv_mask_rxtx_irq(v->idx);
133 __napi_schedule(&v->napi);
138 .. code-block:: c
140 if (budget && napi_complete_done(&v->napi, work_done)) {
141 mydrv_unmask_rxtx_irq(v->idx);
142 return min(work_done, budget - 1);
151 -------------------------
155 mapped to queues and interrupts. NAPI is primarily a polling/processing
156 abstraction without specific user-facing semantics. That said, most networking
160 (queue pair is a set of a single Rx and single Tx queue).
162 In less common cases a NAPI instance may be used for multiple queues
163 or Rx and Tx queues can be serviced by separate NAPI instances on a single
168 each channel can be either ``rx``, ``tx`` or ``combined``. It's not clear
170 a channel as an IRQ/NAPI which services queues of a given type. For example,
171 a configuration of 1 ``rx``, 1 ``tx`` and 1 ``combined`` channel is expected
172 to utilize 3 interrupts, 2 Rx and 2 Tx queues.
174 Persistent NAPI config
175 ----------------------
178 of NAPI-related user configuration each time NAPI instances are reallocated.
199 For example, using the script to dump all of the queues for a device (which
202 .. code-block:: bash
204 $ kernel-source/tools/net/ynl/pyynl/cli.py \
205 --spec Documentation/netlink/specs/netdev.yaml \
206 --dump queue-get \
207 --json='{"ifindex": 2}'
213 -----------------------
226 The above parameters can also be set on a per-NAPI basis using netlink via
227 netdev-genl. When used with netlink and configured on a per-NAPI basis, the
229 ``gro-flush-timeout`` and ``napi-defer-hard-irqs``.
231 Per-NAPI configuration can be done programmatically in a user application
237 .. code-block:: bash
239 $ kernel-source/tools/net/ynl/pyynl/cli.py \
240 --spec Documentation/netlink/specs/netdev.yaml \
241 --do napi-set \
242 --json='{"id": 345,
243 "defer-hard-irqs": 111,
244 "gro-flush-timeout": 11111}'
246 Similarly, the parameter ``irq-suspend-timeout`` can be set using netlink
247 via netdev-genl. There is no global sysfs parameter for this value.
249 ``irq-suspend-timeout`` is used to determine how long an application can
251 which can be set on a per-epoll context basis with ``EPIOCSPARAMS`` ioctl.
256 ------------
268 epoll-based busy polling
269 ------------------------
289 loop waiting for events. This is a system-wide setting and will cause all
290 epoll-based applications to busy poll when they call epoll_wait. This may
297 .. code-block:: c
309 ---------------
314 Very high request-per-second applications (especially routing/forwarding
323 if ``gro_flush_timeout`` passes without any busy poll call. For epoll-based
331 with the ``SO_BUSY_POLL_BUDGET`` socket option. For epoll-based busy polling
341 should be chosen carefully with these tradeoffs in mind. epoll-based busy
349 --------------
365 1. The per-NAPI config parameter ``irq-suspend-timeout`` should be set to the
374 2. The sysfs parameter or per-NAPI config parameters ``gro_flush_timeout``
385 userland, the ``irq-suspend-timeout`` is deferred and IRQs are disabled. This
392 It is expected that ``irq-suspend-timeout`` will be set to a value much larger
393 than ``gro_flush_timeout`` as ``irq-suspend-timeout`` should suspend IRQs for
401 irq-driven packet delivery. During busy periods, ``irq-suspend-timeout``
409 1) hardirq -> softirq -> napi poll; basic interrupt delivery
410 2) timer -> softirq -> napi poll; deferred irq processing
411 3) epoll -> busy-poll -> napi poll; busy looping
419 During busy periods, ``irq-suspend-timeout`` is used as timer in Loop 2,
426 the recommended usage, because otherwise setting ``irq-suspend-timeout``
432 -------------
437 (called ``napi/${ifc-name}-${napi-id}``).
451 .. code-block:: bash
453 $ ynl --family netdev --do napi-set --json='{"id": 66, "threaded": 1}'