index.rst 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. Linux Devlink Documentation
  2. ===========================
  3. devlink is an API to expose device information and resources not directly
  4. related to any device class, such as chip-wide/switch-ASIC-wide configuration.
  5. Locking
  6. -------
  7. Driver facing APIs are currently transitioning to allow more explicit
  8. locking. Drivers can use the existing ``devlink_*`` set of APIs, or
  9. new APIs prefixed by ``devl_*``. The older APIs handle all the locking
  10. in devlink core, but don't allow registration of most sub-objects once
  11. the main devlink object is itself registered. The newer ``devl_*`` APIs assume
  12. the devlink instance lock is already held. Drivers can take the instance
  13. lock by calling ``devl_lock()``. It is also held all callbacks of devlink
  14. netlink commands.
  15. Drivers are encouraged to use the devlink instance lock for their own needs.
  16. Drivers need to be cautious when taking devlink instance lock and
  17. taking RTNL lock at the same time. Devlink instance lock needs to be taken
  18. first, only after that RTNL lock could be taken.
  19. Nested instances
  20. ----------------
  21. Some objects, like linecards or port functions, could have another
  22. devlink instances created underneath. In that case, drivers should make
  23. sure to respect following rules:
  24. - Lock ordering should be maintained. If driver needs to take instance
  25. lock of both nested and parent instances at the same time, devlink
  26. instance lock of the parent instance should be taken first, only then
  27. instance lock of the nested instance could be taken.
  28. - Driver should use object-specific helpers to setup the
  29. nested relationship:
  30. - ``devl_nested_devlink_set()`` - called to setup devlink -> nested
  31. devlink relationship (could be user for multiple nested instances.
  32. - ``devl_port_fn_devlink_set()`` - called to setup port function ->
  33. nested devlink relationship.
  34. - ``devlink_linecard_nested_dl_set()`` - called to setup linecard ->
  35. nested devlink relationship.
  36. The nested devlink info is exposed to the userspace over object-specific
  37. attributes of devlink netlink.
  38. Interface documentation
  39. -----------------------
  40. The following pages describe various interfaces available through devlink in
  41. general.
  42. .. toctree::
  43. :maxdepth: 1
  44. devlink-dpipe
  45. devlink-eswitch-attr
  46. devlink-flash
  47. devlink-health
  48. devlink-info
  49. devlink-linecard
  50. devlink-params
  51. devlink-port
  52. devlink-region
  53. devlink-reload
  54. devlink-resource
  55. devlink-selftests
  56. devlink-trap
  57. Driver-specific documentation
  58. -----------------------------
  59. Each driver that implements ``devlink`` is expected to document what
  60. parameters, info versions, and other features it supports.
  61. .. toctree::
  62. :maxdepth: 1
  63. am65-nuss-cpsw-switch
  64. bnxt
  65. etas_es58x
  66. hns3
  67. i40e
  68. ice
  69. ionic
  70. iosm
  71. ixgbe
  72. kvaser_pciefd
  73. kvaser_usb
  74. mlx4
  75. mlx5
  76. mlxsw
  77. mv88e6xxx
  78. netdevsim
  79. nfp
  80. octeontx2
  81. prestera
  82. qed
  83. sfc
  84. stmmac
  85. ti-cpsw-switch
  86. zl3073x