devlink-eswitch-attr.rst 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ==========================
  3. Devlink E-Switch Attribute
  4. ==========================
  5. Devlink E-Switch supports two modes of operation: legacy and switchdev.
  6. Legacy mode operates based on traditional MAC/VLAN steering rules. Switching
  7. decisions are made based on MAC addresses, VLANs, etc. There is limited ability
  8. to offload switching rules to hardware.
  9. On the other hand, switchdev mode allows for more advanced offloading
  10. capabilities of the E-Switch to hardware. In switchdev mode, more switching
  11. rules and logic can be offloaded to the hardware switch ASIC. It enables
  12. representor netdevices that represent the slow path of virtual functions (VFs)
  13. or scalable-functions (SFs) of the device. See more information about
  14. :ref:`Documentation/networking/switchdev.rst <switchdev>` and
  15. :ref:`Documentation/networking/representors.rst <representors>`.
  16. In addition, the devlink E-Switch also comes with other attributes listed
  17. in the following section.
  18. Attributes Description
  19. ======================
  20. The following is a list of E-Switch attributes.
  21. .. list-table:: E-Switch attributes
  22. :widths: 8 5 45
  23. * - Name
  24. - Type
  25. - Description
  26. * - ``mode``
  27. - enum
  28. - The mode of the device. The mode can be one of the following:
  29. * ``legacy`` operates based on traditional MAC/VLAN steering
  30. rules.
  31. * ``switchdev`` allows for more advanced offloading capabilities of
  32. the E-Switch to hardware.
  33. * - ``inline-mode``
  34. - enum
  35. - Some HWs need the VF driver to put part of the packet
  36. headers on the TX descriptor so the e-switch can do proper
  37. matching and steering. Support for both switchdev mode and legacy mode.
  38. * ``none`` none.
  39. * ``link`` L2 mode.
  40. * ``network`` L3 mode.
  41. * ``transport`` L4 mode.
  42. * - ``encap-mode``
  43. - enum
  44. - The encapsulation mode of the device. Support for both switchdev mode
  45. and legacy mode. The mode can be one of the following:
  46. * ``none`` Disable encapsulation support.
  47. * ``basic`` Enable encapsulation support.
  48. Example Usage
  49. =============
  50. .. code:: shell
  51. # enable switchdev mode
  52. $ devlink dev eswitch set pci/0000:08:00.0 mode switchdev
  53. # set inline-mode and encap-mode
  54. $ devlink dev eswitch set pci/0000:08:00.0 inline-mode none encap-mode basic
  55. # display devlink device eswitch attributes
  56. $ devlink dev eswitch show pci/0000:08:00.0
  57. pci/0000:08:00.0: mode switchdev inline-mode none encap-mode basic
  58. # enable encap-mode with legacy mode
  59. $ devlink dev eswitch set pci/0000:08:00.0 mode legacy inline-mode none encap-mode basic