docs: net: more adjustments to docs
Subsystems (6)
Jakub Kicinski
maintainercover docs: net: more adjustments to docs
A few small updates to the docs. Mostly typos this time. This is trying to prepare docs for getting fed directly into AI reviews.
Jakub Kicinski (3):
docs: net: fix minor issues with XDP metadata docs
docs: net: tls-offload: document tls_dev_del, tls_dev_resync, and
rekey
docs: net: fix minor issues with devlink docs
.../networking/devlink/devlink-health.rst | 12 +++++--- .../networking/devlink/devlink-params.rst | 2 +- .../networking/devlink/devlink-port.rst | 5 +++- .../networking/devlink/devlink-trap.rst | 8 +++-- Documentation/networking/devlink/index.rst | 10 +++---- Documentation/networking/tls-offload.rst | 29 ++++++++++++++++++ Documentation/networking/xdp-rx-metadata.rst | 2 +- Documentation/networking/xsk-tx-metadata.rst | 30 ++++++++++--------- 8 files changed, 69 insertions(+), 29 deletions(-)
Signature · 1 line
2.54.0
Jakub Kicinski
maintainerPATCH 1/3 docs: net: fix minor issues with XDP metadata docs
Minor updates to the XDP metadata documentation:
- s/union/struct/ for xsk_tx_metadata
- document nested request and completion metadata fields
- point capability queries at the xsk-features attribute
- fix grammar in the XDP RX metadata guide
- typos
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- Documentation/networking/xdp-rx-metadata.rst | 2 +- Documentation/networking/xsk-tx-metadata.rst | 30 +++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-)
Documentation/networking/xdp-rx-metadata.rst +1 -1
@@ -36,7 +36,7 @@ metadata available in which case the driver returns ``-ENODATA``. Not all kfuncs have to be implemented by the device driver; when not implemented, the default ones that return ``-EOPNOTSUPP`` will be used -to indicate the device driver have not implemented this kfunc. +to indicate the device driver has not implemented this kfunc. Within an XDP frame, the metadata layout (accessed via ``xdp_buff``) is
Documentation/networking/xsk-tx-metadata.rst +16 -14
@@ -14,9 +14,9 @@ General Design The headroom for the metadata is reserved via ``tx_metadata_len`` and ``XDP_UMEM_TX_METADATA_LEN`` flag in ``struct xdp_umem_reg``. The metadata length is therefore the same for every socket that shares the same umem. -The metadata layout is a fixed UAPI, refer to ``union xsk_tx_metadata`` in +The metadata layout is a fixed UAPI, refer to ``struct xsk_tx_metadata`` in ``include/uapi/linux/if_xdp.h``. Thus, generally, the ``tx_metadata_len`` -field above should contain ``sizeof(union xsk_tx_metadata)``. +field above should contain ``sizeof(struct xsk_tx_metadata)``. Note that in the original implementation the ``XDP_UMEM_TX_METADATA_LEN`` flag was not required. Applications might attempt to create a umem
@@ -45,15 +45,16 @@ the metadata area is ignored by the kernel as well. The flags field enables the particular offload: - ``XDP_TXMD_FLAGS_TIMESTAMP``: requests the device to put transmission - timestamp into ``tx_timestamp`` field of ``union xsk_tx_metadata``. + timestamp into ``completion.tx_timestamp`` field of + ``struct xsk_tx_metadata``. - ``XDP_TXMD_FLAGS_CHECKSUM``: requests the device to calculate L4 - checksum. ``csum_start`` specifies byte offset of where the checksumming - should start and ``csum_offset`` specifies byte offset where the - device should store the computed checksum. + checksum. ``request.csum_start`` specifies byte offset of where the + checksumming should start and ``request.csum_offset`` specifies byte offset + where the device should store the computed checksum. - ``XDP_TXMD_FLAGS_LAUNCH_TIME``: requests the device to schedule the packet for transmission at a pre-determined time called launch time. The - value of launch time is indicated by ``launch_time`` field of - ``union xsk_tx_metadata``. + value of launch time is indicated by ``request.launch_time`` field of + ``struct xsk_tx_metadata``. Besides the flags above, in order to trigger the offloads, the first packet's ``struct xdp_desc`` descriptor should set ``XDP_TX_METADATA``
@@ -63,9 +64,9 @@ only the first chunk should carry the metadata. Software TX Checksum ==================== -For development and testing purposes its possible to pass +For development and testing purposes it's possible to pass ``XDP_UMEM_TX_SW_CSUM`` flag to ``XDP_UMEM_REG`` UMEM registration call. -In this case, when running in ``XDK_COPY`` mode, the TX checksum +In this case, when running in ``XDP_COPY`` mode, the TX checksum is calculated on the CPU. Do not enable this option in production because it will negatively affect performance.
@@ -118,7 +119,7 @@ schedule with a 1-second cycle time, with all Tx Queues open at all times. The value of the launch time that is programmed in the Advanced Transmit Context Descriptor is a relative offset to the starting time of the Qbv -transmission window of the queue. The Frst flag of the descriptor can be +transmission window of the queue. The First flag of the descriptor can be set to schedule the packet for the next Qbv cycle. Therefore, the horizon of the launch time for i225 and i226 is the ending time of the next cycle of the Qbv transmission window of the queue. For example, when the Qbv
@@ -129,9 +130,10 @@ running. Querying Device Capabilities ============================ -Every devices exports its offloads capabilities via netlink netdev family. -Refer to ``xsk-flags`` features bitmask in -``Documentation/netlink/specs/netdev.yaml``. +Every device exports its offload capabilities via the Netlink netdev family. +Query the ``xsk-features`` attribute in +``Documentation/netlink/specs/netdev.yaml``. Its bits are defined by the +``xsk-flags`` enum. - ``tx-timestamp``: device supports ``XDP_TXMD_FLAGS_TIMESTAMP`` - ``tx-checksum``: device supports ``XDP_TXMD_FLAGS_CHECKSUM``
Signature · 1 line
2.54.0
Jakub Kicinski
maintainerPATCH 2/3 docs: net: tls-offload: document tls_dev_del, tls_dev_resync, and rekey
In reply to Jakub KicinskiFill in some gaps in the TLS offload doc:
- describe the tls_dev_del and tls_dev_resync callbacks
- add a mention of rekeying being out of scope for now
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- Documentation/networking/tls-offload.rst | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
Documentation/networking/tls-offload.rst +29 -0
@@ -104,6 +104,29 @@ at the end of kernel structures (see :c:member:`driver_state` members in ``include/net/tls.h``) to avoid additional allocations and pointer dereferences. +When the offloaded connection is destroyed the core calls +the :c:member:`tls_dev_del` callback so the driver can release per-direction +state: + +.. code-block:: c + + void (*tls_dev_del)(struct net_device *netdev, + struct tls_context *ctx, + enum tls_offload_ctx_dir direction); + +``tls_dev_del`` is mandatory whenever ``tls_dev_add`` is provided. + +The third TLS device callback is :c:member:`tls_dev_resync`, called by the core +to synchronize the TCP stream with the record boundaries: + +.. code-block:: c + + int (*tls_dev_resync)(struct net_device *netdev, + struct sock *sk, u32 seq, u8 *rcd_sn, + enum tls_offload_ctx_dir direction); + +See the `Resync handling`_ section for details. + TX --
@@ -381,6 +404,12 @@ synchronization with an exponential back off (first after 2 encrypted records, then after 4 records, after 8, after 16... up until every 128 records). +Rekey +===== + +Offload does not currently support TLS 1.3, therefore key rotation +is not a concern for offloaded connections at this point. + Error handling ==============
Signature · 1 line
2.54.0
Jakub Kicinski
maintainerPATCH 3/3 docs: net: fix minor issues with devlink docs
In reply to Jakub KicinskiUpdate devlink documentation to match current code:
- describe health reporter defaults (it's currently under "callbacks"), best-effort auto-dump, and port-scoped reporters
- fix generic parameter names and values
- fix nested devlink setup wording and registration ordering
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- Documentation/networking/devlink/devlink-health.rst | 12 ++++++++---- Documentation/networking/devlink/devlink-params.rst | 2 +- Documentation/networking/devlink/devlink-port.rst | 5 ++++- Documentation/networking/devlink/devlink-trap.rst | 8 +++++--- Documentation/networking/devlink/index.rst | 10 +++++----- 5 files changed, 23 insertions(+), 14 deletions(-)
Documentation/networking/devlink/devlink-health.rst +8 -4
@@ -33,7 +33,9 @@ asynchronously. All health reports handling is done by ``devlink``. * Recovery procedures * Diagnostics procedures * Object dump procedures - * Out Of Box initial parameters + +Drivers also provide default values for generic reporter parameters when +creating a health reporter. Different parts of the driver can register different types of health reporters with different handlers.
@@ -45,8 +47,9 @@ Actions * A log is being send to the kernel trace events buffer * Health status and statistics are being updated for the reporter instance - * Object dump is being taken and saved at the reporter instance (as long as - auto-dump is set and there is no other dump which is already stored) + * Object dump is being taken and saved at the reporter instance. This is + best effort and skipped when recovery is aborted, auto-dump is disabled, + no dump callback is registered, or a dump is already stored. * Auto recovery attempt is being done. Depends on: - Auto-recovery configuration
@@ -75,7 +78,8 @@ User Interface ============== User can access/change each reporter's parameters and driver specific callbacks -via ``devlink``, e.g per error type (per health reporter): +via ``devlink``, e.g. per error type (per health reporter). Reporters may be +registered for the whole devlink instance or for a specific devlink port. * Configure reporter's generic parameters (like: disable/enable auto recovery) * Invoke recovery procedure
Documentation/networking/devlink/devlink-params.rst +1 -1
@@ -122,7 +122,7 @@ own name. * - ``enable_iwarp`` - Boolean - Enable handling of iWARP traffic in the device. - * - ``internal_err_reset`` + * - ``internal_error_reset`` - Boolean - When enabled, the device driver will reset the device on internal errors.
Documentation/networking/devlink/devlink-port.rst +4 -1
@@ -38,7 +38,7 @@ Devlink port flavours are described below. - This indicates an eswitch port representing a port of PCI subfunction (SF). * - ``DEVLINK_PORT_FLAVOUR_VIRTUAL`` - - This indicates a virtual port for the PCI virtual function. + - Any virtual port facing the user. Devlink port can have a different type based on the link layer described below.
@@ -134,6 +134,9 @@ Users may also set the IPsec crypto capability of the function using Users may also set the IPsec packet capability of the function using `devlink port function set ipsec_packet` command. +The ``migratable`` attribute may be set only on ports with +``DEVLINK_PORT_FLAVOUR_PCI_VF``. + Users may also set the maximum IO event queues of the function using `devlink port function set max_io_eqs` command.
Documentation/networking/devlink/devlink-trap.rst +5 -3
@@ -516,9 +516,11 @@ Generic Packet Trap Groups Generic packet trap groups are used to aggregate logically related packet traps. These groups allow the user to batch operations such as setting the trap -action of all member traps. In addition, ``devlink-trap`` can report aggregated -per-group packets and bytes statistics, in case per-trap statistics are too -narrow. The description of these groups must be added to the following table: +action of all member drop traps whose action may legally change. Exception and +control traps remain unchanged. In addition, ``devlink-trap`` can report +aggregated per-group packets and bytes statistics, in case per-trap statistics +are too narrow. The description of these groups must be added to the following +table: .. list-table:: List of Generic Packet Trap Groups :widths: 10 90
Documentation/networking/devlink/index.rst +5 -5
@@ -13,8 +13,8 @@ new APIs prefixed by ``devl_*``. The older APIs handle all the locking in devlink core, but don't allow registration of most sub-objects once the main devlink object is itself registered. The newer ``devl_*`` APIs assume the devlink instance lock is already held. Drivers can take the instance -lock by calling ``devl_lock()``. It is also held all callbacks of devlink -netlink commands. +lock by calling ``devl_lock()``. It is also held across all callbacks of +devlink netlink commands. Drivers are encouraged to use the devlink instance lock for their own needs.
@@ -33,11 +33,11 @@ devlink instances created underneath. In that case, drivers should make lock of both nested and parent instances at the same time, devlink instance lock of the parent instance should be taken first, only then instance lock of the nested instance could be taken. - - Driver should use object-specific helpers to setup the - nested relationship: + - Driver should use object-specific helpers to setup the nested relationship + before registering the nested devlink instance: - ``devl_nested_devlink_set()`` - called to setup devlink -> nested - devlink relationship (could be user for multiple nested instances. + devlink relationship (could be used for multiple nested instances). - ``devl_port_fn_devlink_set()`` - called to setup port function -> nested devlink relationship. - ``devlink_linecard_nested_dl_set()`` - called to setup linecard ->
Signature · 1 line
2.54.0
Sabrina Dubroca
maintainerRe: [PATCH net-next 2/3] docs: net: tls-offload: document tls_dev_del, tls_dev_resync, and rekey
In reply to Jakub KicinskiQuoted 36 lines · Jakub Kicinski
Fill in some gaps in the TLS offload doc:
- describe the
tls_dev_delandtls_dev_resynccallbacks
- add a mention of rekeying being out of scope for nowSigned-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- Documentation/networking/tls-offload.rst | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+)Documentation/networking/tls-offload.rst +12
-0@@ -104,6 +104,29 @@ at the end of kernel structures (see :c:member:`driver_state` members in ``include/net/tls.h``) to avoid additional allocations and pointer dereferences. +When the offloaded connection is destroyed the core calls +the :c:member:`tls_dev_del` callback so the driver can release per-direction +state: + +.. code-block:: c + + void (*tls_dev_del)(struct net_device *netdev, + struct tls_context *ctx, + enum tls_offload_ctx_dir direction); + +``tls_dev_del`` is mandatory whenever ``tls_dev_add`` is provided. +
Documentation/networking/tls-offload.rst at the end of kernel structures (see :c:member:`driver_state` members · line 128
Quoted 10 lines
Documentation/networking/tls-offload.rst +10
-0+The third TLS device callback is :c:member:`tls_dev_resync`, called by the core +to synchronize the TCP stream with the record boundaries: + +.. code-block:: c + + int (*tls_dev_resync)(struct net_device *netdev, + struct sock *sk, u32 seq, u8 *rcd_sn, + enum tls_offload_ctx_dir direction); + +See the `Resync handling`_ section for details.
Hmm, this callback is not mentioned at all in the "Resync handling" section. I think it'd be good to add at least a quick note there about how/when it's invoked, and what the arguments mean (at least the two types of sequence numbers, since the rest is identical to the other driver CBs).
Signature · 1 line
Sabrina
Re: [PATCH net-next 1/3] docs: net: fix minor issues with XDP metadata docs
In reply to Jakub KicinskiQuoted 8 lines · Jakub Kicinski
Minor updates to the XDP metadata documentation:
- s/union/struct/ forxsk_tx_metadata
- document nested request and completion metadata fields
- point capability queries at the xsk-features attribute
- fix grammar in the XDP RX metadata guide
- typosSigned-off-by Jakub Kicinski <[email protected]>
Quoted 10 lines
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
Re: [PATCH net-next 1/3] docs: net: fix minor issues with XDP metadata docs
In reply to Jakub KicinskiQuoted 18 lines · Jakub Kicinski
Minor updates to the XDP metadata documentation:
- s/union/struct/ forxsk_tx_metadata
- document nested request and completion metadata fields
- point capability queries at the xsk-features attribute
- fix grammar in the XDP RX metadata guide
- typosSigned-off-by Jakub Kicinski<[email protected]>---
CC:[email protected]
CC:[email protected]
CC:[email protected]
CC:[email protected]
CC:[email protected]
CC:[email protected]
CC:[email protected]
CC:[email protected]
CC:[email protected]
Quoted 4 lines
--- Documentation/networking/xdp-rx-metadata.rst | 2 +- Documentation/networking/xsk-tx-metadata.rst | 30 +++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-)
LGTM
Jakub Kicinski
maintainerRe: [PATCH net-next 2/3] docs: net: tls-offload: document tls_dev_del, tls_dev_resync, and rekey
In reply to Sabrina DubrocaQuoted 8 lines · On Wed, 10 Jun 2026 23:06:44 +0200 Sabrina Dubroca wrote:
Quoted 8 lines
(quoted diff) +8
-0+The third TLS device callback is :c:member:`tls_dev_resync`, called by the core +to synchronize the TCP stream with the record boundaries: + +.. code-block:: c + + int (*tls_dev_resync)(struct net_device *netdev, + struct sock *sk, u32 seq, u8 *rcd_sn, + enum tls_offload_ctx_dir direction);
Quoted 8 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ +See the `Resync handling`_ section for details.Hmm, this callback is not mentioned at all in the "Resync handling" section. I think it'd be good to add at least a quick note there about how/when it's invoked, and what the arguments mean (at least the two types of sequence numbers, since the rest is identical to the other driver CBs).
Something like this, you mean?
Documentation/networking/tls-offload.rst +9 -7
@@ -278,9 +278,9 @@ sequence number (as it will be updated from a different context). bool tls_offload_tx_resync_pending(struct sock *sk) Next time ``ktls`` pushes a record it will first send its TCP sequence number -and TLS record number to the driver. Stack will also make sure that -the new record will start on a segment boundary (like it does when -the connection is initially added). +and TLS record number to the driver via the ``tls_dev_resync`` callback. +Stack will also make sure that the new record will start on a segment boundary +(like it does when the connection is initially added). RX --
@@ -372,9 +372,10 @@ all TLS record headers that have been logged since the resync request started. The kernel confirms the guessed location was correct and tells the device -the record sequence number. Meanwhile, the device had been parsing -and counting all records since the just-confirmed one, it adds the number -of records it had seen to the record number provided by the kernel. +the record sequence number via the ``tls_dev_resync`` callback. Meanwhile, +the device had been parsing and counting all records since the just-confirmed +one, it adds the number of records it had seen to the record number provided +by the kernel. At this point the device is in sync and can resume decryption at next segment boundary.
@@ -398,7 +399,8 @@ schedules resynchronization after it has received two completely encrypted records. The stack waits for the socket to drain and informs the device about -the next expected record number and its TCP sequence number. If the +the next expected record number and its TCP sequence number via the +``tls_dev_resync`` callback. If the records continue to be received fully encrypted stack retries the synchronization with an exponential back off (first after 2 encrypted records, then after 4 records, after 8, after 16... up until every
Sabrina Dubroca
maintainerRe: [PATCH net-next 2/3] docs: net: tls-offload: document tls_dev_del, tls_dev_resync, and rekey
Quoted 18 lines · Jakub Kicinski
Quoted 8 lines · On Wed, 10 Jun 2026 23:06:44 +0200 Sabrina Dubroca wrote:
Quoted 8 lines
(quoted diff) +8
-0+The third TLS device callback is :c:member:`tls_dev_resync`, called by the core +to synchronize the TCP stream with the record boundaries: + +.. code-block:: c + + int (*tls_dev_resync)(struct net_device *netdev, + struct sock *sk, u32 seq, u8 *rcd_sn, + enum tls_offload_ctx_dir direction);Quoted 8 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ +See the `Resync handling`_ section for details.Hmm, this callback is not mentioned at all in the "Resync handling" section. I think it'd be good to add at least a quick note there about how/when it's invoked, and what the arguments mean (at least the two types of sequence numbers, since the rest is identical to the other driver CBs).
Quoted 1 line
Something like this, you mean?
Yeah, exactly.
Signature · 1 line
Sabrina
Randy Dunlap
reviewerRe: [PATCH net-next 2/3] docs: net: tls-offload: document tls_dev_del, tls_dev_resync, and rekey
In reply to Jakub KicinskiQuoted 23 lines · Jakub Kicinski
Quoted 8 lines · On Wed, 10 Jun 2026 23:06:44 +0200 Sabrina Dubroca wrote:
Quoted 8 lines
(quoted diff) +8
-0+The third TLS device callback is :c:member:`tls_dev_resync`, called by the core +to synchronize the TCP stream with the record boundaries: + +.. code-block:: c + + int (*tls_dev_resync)(struct net_device *netdev, + struct sock *sk, u32 seq, u8 *rcd_sn, + enum tls_offload_ctx_dir direction);Quoted 8 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ +See the `Resync handling`_ section for details.Hmm, this callback is not mentioned at all in the "Resync handling" section. I think it'd be good to add at least a quick note there about how/when it's invoked, and what the arguments mean (at least the two types of sequence numbers, since the rest is identical to the other driver CBs).
Something like this, you mean?
Documentation/networking/tls-offload.rst sequence number (as it will be updated from a different context). · line 282
Quoted 8 lines
Documentation/networking/tls-offload.rst +2
-3@@ -278,9 +278,9 @@ sequence number (as it will be updated from a different context). bool tls_offload_tx_resync_pending(struct sock *sk) Next time ``ktls`` pushes a record it will first send its TCP sequence number -and TLS record number to the driver. Stack will also make sure that -the new record will start on a segment boundary (like it does when -the connection is initially added). +and TLS record number to the driver via the ``tls_dev_resync`` callback. +Stack will also make sure that the new record will start on a segment boundary
Preferably "The stack ..."
Quoted 4 lines
Documentation/networking/tls-offload.rst +1
-0+(like it does when the connection is initially added). RX --
Signature · 1 line
~Randy
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Tue, 9 Jun 2026 13:12:21 -0700 you wrote:
A few small updates to the docs. Mostly typos this time. This is trying to prepare docs for getting fed directly into AI reviews.
Jakub Kicinski (3):
docs: net: fix minor issues with XDP metadata docs
docs: net: tls-offload: documenttls_dev_del,tls_dev_resync, and
rekey
docs: net: fix minor issues with devlink docs[...]
Here is the summary with links:
- [net-next,1/3] docs: net: fix minor issues with XDP metadata docs
https://git.kernel.org/netdev/net-next/c/6213cf54adad
- [net-next,2/3] docs: net: tls-offload: document tls_dev_del, tls_dev_resync, and rekey (no matching commit)
- [net-next,3/3] docs: net: fix minor issues with devlink docs
(no matching commit)
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html