summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-11-20 19:01:24 -0800
committerJakub Kicinski <kuba@kernel.org>2025-11-20 19:01:25 -0800
commite2c20036a8879476c88002730d8a27f4e3c32d4b (patch)
treeb64e319d25ab1c81025ced8cd45791f2ff8a2c1b /Documentation
parentb8f2b678fcc3d7fd2fcf1db5ddcbd67ef64a0234 (diff)
parent8be656cfb931f79b3971407622422c62575abf90 (diff)
downloadlinux-next-e2c20036a8879476c88002730d8a27f4e3c32d4b.tar.gz
linux-next-e2c20036a8879476c88002730d8a27f4e3c32d4b.zip
Merge branch 'devlink-net-mlx5-implement-swp_l4_csum_mode-via-devlink-params'
Daniel Zahka says: ==================== devlink: net/mlx5: implement swp_l4_csum_mode via devlink params This series introduces a new devlink feature for querying param default values, and resetting params to their default values. This feature is then used to implement a new mlx5 driver param. The series starts with two pure refactor patches: one that passes through the extack to devlink_param::get() implementations. And a second small refactor that prepares the netlink tlv handling code in the devlink_param::get() path to better handle default parameter values. The third patch introduces the uapi and driver api for default parameter values. The driver api is opt-in, and both the uapi and driver api preserve existing behavior when not used by drivers or userspace. The fourth patch introduces a new mlx5 driver param, swp_l4_csum_mode, for controlling tx csum behavior. The "l4_only" value of this param is a dependency for PSP initialization on CX7 NICs. Lastly, the series introduces a new driver param with cmode runtime to netdevsim, and then uses this param in a new testcase for netdevsim devlink params. Here are some examples of using the default param uapi with the devlink cli. Note the devlink cli binary I am using has changes which I am posting in accompanying series targeting iproute2-next: # netdevsim ./devlink dev param show netdevsim/netdevsim0 netdevsim/netdevsim0: name max_macs type generic values: cmode driverinit value 32 default 32 name test1 type driver-specific values: cmode driverinit value true default true # set to false ./devlink dev param set netdevsim/netdevsim0 name test1 value false cmode driverinit ./devlink dev param show netdevsim/netdevsim0 netdevsim/netdevsim0: name max_macs type generic values: cmode driverinit value 32 default 32 name test1 type driver-specific values: cmode driverinit value false default true # set back to default ./devlink dev param set netdevsim/netdevsim0 name test1 default cmode driverinit ./devlink dev param show netdevsim/netdevsim0 netdevsim/netdevsim0: name max_macs type generic values: cmode driverinit value 32 default 32 name test1 type driver-specific values: cmode driverinit value true default true # mlx5 params on cx7 ./devlink dev param show pci/0000:01:00.0 pci/0000:01:00.0: name max_macs type generic values: cmode driverinit value 128 default 128 ... name swp_l4_csum_mode type driver-specific values: cmode permanent value default default default # set to l4_only ./devlink dev param set pci/0000:01:00.0 name swp_l4_csum_mode value l4_only cmode permanent ./devlink dev param show pci/0000:01:00.0 name swp_l4_csum_mode pci/0000:01:00.0: name swp_l4_csum_mode type driver-specific values: cmode permanent value l4_only default default # reset to default ./devlink dev param set pci/0000:01:00.0 name swp_l4_csum_mode default cmode permanent ./devlink dev param show pci/0000:01:00.0 name swp_l4_csum_mode pci/0000:01:00.0: name swp_l4_csum_mode type driver-specific values: cmode permanent value default default default ==================== Link: https://patch.msgid.link/20251119025038.651131-1-daniel.zahka@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/netlink/specs/devlink.yaml9
-rw-r--r--Documentation/networking/devlink/devlink-params.rst10
-rw-r--r--Documentation/networking/devlink/mlx5.rst14
3 files changed, 33 insertions, 0 deletions
diff --git a/Documentation/netlink/specs/devlink.yaml b/Documentation/netlink/specs/devlink.yaml
index 426d5aa7d955..837112da6738 100644
--- a/Documentation/netlink/specs/devlink.yaml
+++ b/Documentation/netlink/specs/devlink.yaml
@@ -859,6 +859,14 @@ attribute-sets:
name: health-reporter-burst-period
type: u64
doc: Time (in msec) for recoveries before starting the grace period.
+
+ # TODO: fill in the attributes in between
+
+ -
+ name: param-reset-default
+ type: flag
+ doc: Request restoring parameter to its default value.
+ value: 183
-
name: dl-dev-stats
subset-of: devlink
@@ -1793,6 +1801,7 @@ operations:
- param-type
# param-value-data is missing here as the type is variable
- param-value-cmode
+ - param-reset-default
-
name: region-get
diff --git a/Documentation/networking/devlink/devlink-params.rst b/Documentation/networking/devlink/devlink-params.rst
index c0597d456641..ea17756dcda6 100644
--- a/Documentation/networking/devlink/devlink-params.rst
+++ b/Documentation/networking/devlink/devlink-params.rst
@@ -41,6 +41,16 @@ In order for ``driverinit`` parameters to take effect, the driver must
support reloading via the ``devlink-reload`` command. This command will
request a reload of the device driver.
+Default parameter values
+=========================
+
+Drivers may optionally export default values for parameters of cmode
+``runtime`` and ``permanent``. For ``driverinit`` parameters, the last
+value set by the driver will be used as the default value. Drivers can
+also support resetting params with cmode ``runtime`` and ``permanent``
+to their default values. Resetting ``driverinit`` params is supported
+by devlink core without additional driver support needed.
+
.. _devlink_params_generic:
Generic configuration parameters
diff --git a/Documentation/networking/devlink/mlx5.rst b/Documentation/networking/devlink/mlx5.rst
index 0e5f9c76e514..4bba4d780a4a 100644
--- a/Documentation/networking/devlink/mlx5.rst
+++ b/Documentation/networking/devlink/mlx5.rst
@@ -218,6 +218,20 @@ parameters.
* ``balanced`` : Merges fewer CQEs, resulting in a moderate compression ratio but maintaining a balance between bandwidth savings and performance
* ``aggressive`` : Merges more CQEs into a single entry, achieving a higher compression rate and maximizing performance, particularly under high traffic loads
+ * - ``swp_l4_csum_mode``
+ - string
+ - permanent
+ - Configure how the L4 checksum is calculated by the device when using
+ Software Parser (SWP) hints for header locations.
+
+ * ``default`` : Use the device's default checksum calculation
+ mode. The driver will discover during init whether or
+ full_csum or l4_only is in use. Setting this value explicitly
+ from userspace is not allowed, but some firmware versions may
+ return this value on param read.
+ * ``full_csum`` : Calculate full checksum including the pseudo-header
+ * ``l4_only`` : Calculate L4-only checksum, excluding the pseudo-header
+
The ``mlx5`` driver supports reloading via ``DEVLINK_CMD_RELOAD``
Info versions