← Documents Documentation/networking/devlink/index.rst GitHub 원문 ↗

Linux 6.18.37 · Networking

Linux Devlink Documentation

Devlink API의 역할, locking 순서, nested instance helper와 interface·driver 문서 목록을 안내합니다.

Source pathDocumentation/networking/devlink/index.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

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

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.