diff mbox series

[net-next] Documentation: Add documentation for eswitch attribute

Message ID 20240308000106.17605-1-witu@nvidia.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next] Documentation: Add documentation for eswitch attribute | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 4 maintainers not CCed: pabeni@redhat.com edumazet@google.com corbet@lwn.net linux-doc@vger.kernel.org
netdev/build_clang success Errors and warnings before: 957 this patch: 957
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch warning WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-08--09-00 (tests: 890)

Commit Message

William Tu March 8, 2024, 12:01 a.m. UTC
Provide devlink documentation for three eswitch attributes:
mode, inline-mode, and encap-mode.

Signed-off-by: William Tu <witu@nvidia.com>
---
 .../devlink/devlink-eswitch-attr.rst          | 58 +++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 Documentation/networking/devlink/devlink-eswitch-attr.rst

Comments

Jakub Kicinski March 9, 2024, 4:14 a.m. UTC | #1
On Fri, 8 Mar 2024 02:01:06 +0200 William Tu wrote:
> +   * - ``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 ?
William Tu March 10, 2024, 3:10 p.m. UTC | #2
On 3/8/24 8:14 PM, Jakub Kicinski wrote:
> External email: Use caution opening links or attachments
>
>
> On Fri, 8 Mar 2024 02:01:06 +0200 William Tu wrote:
>> +   * - ``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?
got it, will check their dependencies and put in doc.
> Please link to representors.rst and perhaps switchdev.rst ?
> --
OK
William
diff mbox series

Patch

diff --git a/Documentation/networking/devlink/devlink-eswitch-attr.rst b/Documentation/networking/devlink/devlink-eswitch-attr.rst
new file mode 100644
index 000000000000..2405f19e1439
--- /dev/null
+++ b/Documentation/networking/devlink/devlink-eswitch-attr.rst
@@ -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