index.rst 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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-health
  46. devlink-info
  47. devlink-flash
  48. devlink-params
  49. devlink-port
  50. devlink-region
  51. devlink-resource
  52. devlink-reload
  53. devlink-selftests
  54. devlink-trap
  55. devlink-linecard
  56. devlink-eswitch-attr
  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. bnxt
  64. etas_es58x
  65. hns3
  66. i40e
  67. ionic
  68. ice
  69. mlx4
  70. mlx5
  71. mlxsw
  72. mv88e6xxx
  73. netdevsim
  74. nfp
  75. qed
  76. ti-cpsw-switch
  77. am65-nuss-cpsw-switch
  78. prestera
  79. iosm
  80. octeontx2
  81. sfc