brintos

brintos / linux-shallow public Read only

0
0
Text · 2.6 KiB · 08bb39a Raw
77 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3==========================4Devlink E-Switch Attribute5==========================6 7Devlink E-Switch supports two modes of operation: legacy and switchdev.8Legacy mode operates based on traditional MAC/VLAN steering rules. Switching9decisions are made based on MAC addresses, VLANs, etc. There is limited ability10to offload switching rules to hardware.11 12On the other hand, switchdev mode allows for more advanced offloading13capabilities of the E-Switch to hardware. In switchdev mode, more switching14rules and logic can be offloaded to the hardware switch ASIC. It enables15representor netdevices that represent the slow path of virtual functions (VFs)16or scalable-functions (SFs) of the device. See more information about17:ref:`Documentation/networking/switchdev.rst <switchdev>` and18:ref:`Documentation/networking/representors.rst <representors>`.19 20In addition, the devlink E-Switch also comes with other attributes listed21in the following section.22 23Attributes Description24======================25 26The following is a list of E-Switch attributes.27 28.. list-table:: E-Switch attributes29   :widths: 8 5 4530 31   * - Name32     - Type33     - Description34   * - ``mode``35     - enum36     - The mode of the device. The mode can be one of the following:37 38       * ``legacy`` operates based on traditional MAC/VLAN steering39         rules.40       * ``switchdev`` allows for more advanced offloading capabilities of41         the E-Switch to hardware.42   * - ``inline-mode``43     - enum44     - Some HWs need the VF driver to put part of the packet45       headers on the TX descriptor so the e-switch can do proper46       matching and steering. Support for both switchdev mode and legacy mode.47 48       * ``none`` none.49       * ``link`` L2 mode.50       * ``network`` L3 mode.51       * ``transport`` L4 mode.52   * - ``encap-mode``53     - enum54     - The encapsulation mode of the device. Support for both switchdev mode55       and legacy mode. The mode can be one of the following:56 57       * ``none`` Disable encapsulation support.58       * ``basic`` Enable encapsulation support.59 60Example Usage61=============62 63.. code:: shell64 65    # enable switchdev mode66    $ devlink dev eswitch set pci/0000:08:00.0 mode switchdev67 68    # set inline-mode and encap-mode69    $ devlink dev eswitch set pci/0000:08:00.0 inline-mode none encap-mode basic70 71    # display devlink device eswitch attributes72    $ devlink dev eswitch show pci/0000:08:00.073      pci/0000:08:00.0: mode switchdev inline-mode none encap-mode basic74 75    # enable encap-mode with legacy mode76    $ devlink dev eswitch set pci/0000:08:00.0 mode legacy inline-mode none encap-mode basic77