Skip to contentSkip to conversation

Documentation: Add documentation for eswitch attribute

PATCH Superseded William Tu 2 participants 3 messages Mar 8, 2024 – Mar 10, 2024

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

William Tu

author
#0 lore raw

PATCH 1/1 Documentation: Add documentation for eswitch attribute

Provide devlink documentation for three eswitch attributes:
mode, inline-mode, and encap-mode.

---
 .../devlink/devlink-eswitch-attr.rst          | 58 +++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 Documentation/networking/devlink/devlink-eswitch-attr.rst
Documentation/networking/devlink/devlink-eswitch-attr.rst new file +58 -0
new file mode 100644
index 000000000000..2405f19e1439
@@ -0,0 +1,58 @@
+.. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+
+=========================
+Devlink Eswitch Attribute
+=========================
+
+The ``devlink-eswitch-attribute`` allows setting/getting devlink eswitch
+device's attributes.
+
+
+Attributes Description
+======================
+
+The following is a list of eswitch attributes that users may use.
+
+.. list-table:: eswitch attributes
+   :widths: 8 5 45
+
+   * - Name
+     - Type
+     - Description
+   * - ``mode``
+     - enum
+     - The mode of the device. The mode can be one of the following:
+
+       * ``legacy`` Legacy SRIOV.
+       * ``switchdev`` SRIOV switchdev offloads.
+   * - ``inline-mode``
+     - enum
+     - Some HWs need the VF driver to put part of the packet
+       headers on the TX descriptor so the e-switch can do proper
+       matching and steering.
+
+       * ``none`` none.
+       * ``link`` L2 mode.
+       * ``network`` L3 mode.
+       * ``transport`` L4 mode.
+   * - ``encap-mode``
+     - enum
+     - The encapsulation mode of the device. The mode can be one of the following:
+
+       * ``none`` Disable encapsulation support.
+       * ``basic`` Enable encapsulation support.
+
+example usage
+-------------
+
+.. code:: shell
+
+    # enable switchdev mode
+    $ devlink dev eswitch set pci/0000:08:00.0 mode switchdev
+
+    # set inline-mode and encap-mode
+    $ devlink dev eswitch set pci/0000:08:00.0 inline-mode none encap-mode basic
+
+    # display devlink device eswitch attributes
+    $ devlink dev eswitch show pci/0000:08:00.0
+      pci/0000:08:00.0: mode switchdev inline-mode none encap-mode basic
Signature · 1 line
2.38.1
maintainer
#1 lore raw

Documentation/networking/devlink/devlink-eswitch-attr.rst line 27

Quoted 6 lines · On Fri, 8 Mar 2024 02:01:06 +0200 William Tu wrote:
Documentation/networking/devlink/devlink-eswitch-attr.rst new file +6 -0
+   * - ``mode``
+     - enum
+     - The mode of the device. The mode can be one of the following:
+
+       * ``legacy`` Legacy SRIOV.
+       * ``switchdev`` SRIOV switchdev offloads.

In my head mode is special because it controls on / off for switchdev, and none of the other attrs do anything outside of switchdev mode. But thinking about it now, I'm not sure if that's actually the case. Let's clarify. And if other attrs indeed are only meaningful in switchdev mode we should feature mode more prominently than others. Separate section perhaps?

Please link to representors.rst and perhaps switchdev.rst ?

Signature · 1 line
pw-bot: cr
author
#2 lore raw
Quoted 10 lines · Jakub Kicinski

External email: Use caution opening links or attachments

Documentation/networking/devlink/devlink-eswitch-attr.rst line 27

Quoted 6 lines · On Fri, 8 Mar 2024 02:01:06 +0200 William Tu wrote:
Documentation/networking/devlink/devlink-eswitch-attr.rst new file +6 -0
+   * - ``mode``
+     - enum
+     - The mode of the device. The mode can be one of the following:
+
+       * ``legacy`` Legacy SRIOV.
+       * ``switchdev`` SRIOV switchdev offloads.
Quoted 6 lines

In my head mode is special because it controls on / off for switchdev, and none of the other attrs do anything outside of switchdev mode. But thinking about it now, I'm not sure if that's actually the case. Let's clarify. And if other attrs indeed are only meaningful in switchdev mode we should feature mode more prominently than others. Separate section perhaps?

got it, will check their dependencies and put in doc.

Quoted 2 lines

Please link to representors.rst and perhaps switchdev.rst ? --

OK
William