dcbnl.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. /*
  2. * Copyright (c) 2008, Intel Corporation.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms and conditions of the GNU General Public License,
  6. * version 2, as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * You should have received a copy of the GNU General Public License along with
  14. * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  15. * Place - Suite 330, Boston, MA 02111-1307 USA.
  16. *
  17. * Author: Lucy Liu <lucy.liu@intel.com>
  18. */
  19. #ifndef __LINUX_DCBNL_H__
  20. #define __LINUX_DCBNL_H__
  21. #include <linux/types.h>
  22. /* IEEE 802.1Qaz std supported values */
  23. #define IEEE_8021QAZ_MAX_TCS 8
  24. #define IEEE_8021QAZ_TSA_STRICT 0
  25. #define IEEE_8021QAZ_TSA_CB_SHABER 1
  26. #define IEEE_8021QAZ_TSA_ETS 2
  27. #define IEEE_8021QAZ_TSA_VENDOR 255
  28. /* This structure contains the IEEE 802.1Qaz ETS managed object
  29. *
  30. * @willing: willing bit in ETS configuratin TLV
  31. * @ets_cap: indicates supported capacity of ets feature
  32. * @cbs: credit based shaper ets algorithm supported
  33. * @tc_tx_bw: tc tx bandwidth indexed by traffic class
  34. * @tc_rx_bw: tc rx bandwidth indexed by traffic class
  35. * @tc_tsa: TSA Assignment table, indexed by traffic class
  36. * @prio_tc: priority assignment table mapping 8021Qp to traffic class
  37. * @tc_reco_bw: recommended tc bandwidth indexed by traffic class for TLV
  38. * @tc_reco_tsa: recommended tc bandwidth indexed by traffic class for TLV
  39. * @reco_prio_tc: recommended tc tx bandwidth indexed by traffic class for TLV
  40. *
  41. * Recommended values are used to set fields in the ETS recommendation TLV
  42. * with hardware offloaded LLDP.
  43. *
  44. * ----
  45. * TSA Assignment 8 bit identifiers
  46. * 0 strict priority
  47. * 1 credit-based shaper
  48. * 2 enhanced transmission selection
  49. * 3-254 reserved
  50. * 255 vendor specific
  51. */
  52. struct ieee_ets {
  53. __u8 willing;
  54. __u8 ets_cap;
  55. __u8 cbs;
  56. __u8 tc_tx_bw[IEEE_8021QAZ_MAX_TCS];
  57. __u8 tc_rx_bw[IEEE_8021QAZ_MAX_TCS];
  58. __u8 tc_tsa[IEEE_8021QAZ_MAX_TCS];
  59. __u8 prio_tc[IEEE_8021QAZ_MAX_TCS];
  60. __u8 tc_reco_bw[IEEE_8021QAZ_MAX_TCS];
  61. __u8 tc_reco_tsa[IEEE_8021QAZ_MAX_TCS];
  62. __u8 reco_prio_tc[IEEE_8021QAZ_MAX_TCS];
  63. };
  64. /* This structure contains the IEEE 802.1Qaz PFC managed object
  65. *
  66. * @pfc_cap: Indicates the number of traffic classes on the local device
  67. * that may simultaneously have PFC enabled.
  68. * @pfc_en: bitmap indicating pfc enabled traffic classes
  69. * @mbc: enable macsec bypass capability
  70. * @delay: the allowance made for a round-trip propagation delay of the
  71. * link in bits.
  72. * @requests: count of the sent pfc frames
  73. * @indications: count of the received pfc frames
  74. */
  75. struct ieee_pfc {
  76. __u8 pfc_cap;
  77. __u8 pfc_en;
  78. __u8 mbc;
  79. __u16 delay;
  80. __u64 requests[IEEE_8021QAZ_MAX_TCS];
  81. __u64 indications[IEEE_8021QAZ_MAX_TCS];
  82. };
  83. /* This structure contains the IEEE 802.1Qaz APP managed object. This
  84. * object is also used for the CEE std as well. There is no difference
  85. * between the objects.
  86. *
  87. * @selector: protocol identifier type
  88. * @protocol: protocol of type indicated
  89. * @priority: 3-bit unsigned integer indicating priority
  90. *
  91. * ----
  92. * Selector field values
  93. * 0 Reserved
  94. * 1 Ethertype
  95. * 2 Well known port number over TCP or SCTP
  96. * 3 Well known port number over UDP or DCCP
  97. * 4 Well known port number over TCP, SCTP, UDP, or DCCP
  98. * 5-7 Reserved
  99. */
  100. struct dcb_app {
  101. __u8 selector;
  102. __u8 priority;
  103. __u16 protocol;
  104. };
  105. /**
  106. * struct dcb_peer_app_info - APP feature information sent by the peer
  107. *
  108. * @willing: willing bit in the peer APP tlv
  109. * @error: error bit in the peer APP tlv
  110. *
  111. * In addition to this information the full peer APP tlv also contains
  112. * a table of 'app_count' APP objects defined above.
  113. */
  114. struct dcb_peer_app_info {
  115. __u8 willing;
  116. __u8 error;
  117. };
  118. struct dcbmsg {
  119. __u8 dcb_family;
  120. __u8 cmd;
  121. __u16 dcb_pad;
  122. };
  123. /**
  124. * enum dcbnl_commands - supported DCB commands
  125. *
  126. * @DCB_CMD_UNDEFINED: unspecified command to catch errors
  127. * @DCB_CMD_GSTATE: request the state of DCB in the device
  128. * @DCB_CMD_SSTATE: set the state of DCB in the device
  129. * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
  130. * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
  131. * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
  132. * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
  133. * @DCB_CMD_PFC_GCFG: request the priority flow control configuration
  134. * @DCB_CMD_PFC_SCFG: set the priority flow control configuration
  135. * @DCB_CMD_SET_ALL: apply all changes to the underlying device
  136. * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
  137. * device. Only useful when using bonding.
  138. * @DCB_CMD_GCAP: request the DCB capabilities of the device
  139. * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
  140. * @DCB_CMD_SNUMTCS: set the number of traffic classes
  141. * @DCB_CMD_GBCN: set backward congestion notification configuration
  142. * @DCB_CMD_SBCN: get backward congestion notification configration.
  143. * @DCB_CMD_GAPP: get application protocol configuration
  144. * @DCB_CMD_SAPP: set application protocol configuration
  145. * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
  146. * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
  147. * @DCB_CMD_GDCBX: get DCBX engine configuration
  148. * @DCB_CMD_SDCBX: set DCBX engine configuration
  149. * @DCB_CMD_GFEATCFG: get DCBX features flags
  150. * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
  151. */
  152. enum dcbnl_commands {
  153. DCB_CMD_UNDEFINED,
  154. DCB_CMD_GSTATE,
  155. DCB_CMD_SSTATE,
  156. DCB_CMD_PGTX_GCFG,
  157. DCB_CMD_PGTX_SCFG,
  158. DCB_CMD_PGRX_GCFG,
  159. DCB_CMD_PGRX_SCFG,
  160. DCB_CMD_PFC_GCFG,
  161. DCB_CMD_PFC_SCFG,
  162. DCB_CMD_SET_ALL,
  163. DCB_CMD_GPERM_HWADDR,
  164. DCB_CMD_GCAP,
  165. DCB_CMD_GNUMTCS,
  166. DCB_CMD_SNUMTCS,
  167. DCB_CMD_PFC_GSTATE,
  168. DCB_CMD_PFC_SSTATE,
  169. DCB_CMD_BCN_GCFG,
  170. DCB_CMD_BCN_SCFG,
  171. DCB_CMD_GAPP,
  172. DCB_CMD_SAPP,
  173. DCB_CMD_IEEE_SET,
  174. DCB_CMD_IEEE_GET,
  175. DCB_CMD_GDCBX,
  176. DCB_CMD_SDCBX,
  177. DCB_CMD_GFEATCFG,
  178. DCB_CMD_SFEATCFG,
  179. __DCB_CMD_ENUM_MAX,
  180. DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
  181. };
  182. /**
  183. * enum dcbnl_attrs - DCB top-level netlink attributes
  184. *
  185. * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
  186. * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
  187. * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
  188. * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
  189. * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
  190. * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
  191. * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
  192. * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
  193. * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
  194. * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
  195. * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
  196. * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
  197. * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
  198. * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
  199. * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED)
  200. */
  201. enum dcbnl_attrs {
  202. DCB_ATTR_UNDEFINED,
  203. DCB_ATTR_IFNAME,
  204. DCB_ATTR_STATE,
  205. DCB_ATTR_PFC_STATE,
  206. DCB_ATTR_PFC_CFG,
  207. DCB_ATTR_NUM_TC,
  208. DCB_ATTR_PG_CFG,
  209. DCB_ATTR_SET_ALL,
  210. DCB_ATTR_PERM_HWADDR,
  211. DCB_ATTR_CAP,
  212. DCB_ATTR_NUMTCS,
  213. DCB_ATTR_BCN,
  214. DCB_ATTR_APP,
  215. /* IEEE std attributes */
  216. DCB_ATTR_IEEE,
  217. DCB_ATTR_DCBX,
  218. DCB_ATTR_FEATCFG,
  219. __DCB_ATTR_ENUM_MAX,
  220. DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
  221. };
  222. /**
  223. * enum ieee_attrs - IEEE 802.1Qaz get/set attributes
  224. *
  225. * @DCB_ATTR_IEEE_UNSPEC: unspecified
  226. * @DCB_ATTR_IEEE_ETS: negotiated ETS configuration
  227. * @DCB_ATTR_IEEE_PFC: negotiated PFC configuration
  228. * @DCB_ATTR_IEEE_APP_TABLE: negotiated APP configuration
  229. * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only
  230. * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only
  231. * @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only
  232. */
  233. enum ieee_attrs {
  234. DCB_ATTR_IEEE_UNSPEC,
  235. DCB_ATTR_IEEE_ETS,
  236. DCB_ATTR_IEEE_PFC,
  237. DCB_ATTR_IEEE_APP_TABLE,
  238. DCB_ATTR_IEEE_PEER_ETS,
  239. DCB_ATTR_IEEE_PEER_PFC,
  240. DCB_ATTR_IEEE_PEER_APP,
  241. __DCB_ATTR_IEEE_MAX
  242. };
  243. #define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
  244. enum ieee_attrs_app {
  245. DCB_ATTR_IEEE_APP_UNSPEC,
  246. DCB_ATTR_IEEE_APP,
  247. __DCB_ATTR_IEEE_APP_MAX
  248. };
  249. #define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
  250. /**
  251. * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
  252. *
  253. * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
  254. * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
  255. * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
  256. * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
  257. * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
  258. * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
  259. * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
  260. * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
  261. * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
  262. * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
  263. * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
  264. *
  265. */
  266. enum dcbnl_pfc_up_attrs {
  267. DCB_PFC_UP_ATTR_UNDEFINED,
  268. DCB_PFC_UP_ATTR_0,
  269. DCB_PFC_UP_ATTR_1,
  270. DCB_PFC_UP_ATTR_2,
  271. DCB_PFC_UP_ATTR_3,
  272. DCB_PFC_UP_ATTR_4,
  273. DCB_PFC_UP_ATTR_5,
  274. DCB_PFC_UP_ATTR_6,
  275. DCB_PFC_UP_ATTR_7,
  276. DCB_PFC_UP_ATTR_ALL,
  277. __DCB_PFC_UP_ATTR_ENUM_MAX,
  278. DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
  279. };
  280. /**
  281. * enum dcbnl_pg_attrs - DCB Priority Group attributes
  282. *
  283. * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
  284. * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
  285. * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
  286. * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
  287. * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
  288. * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
  289. * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
  290. * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
  291. * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
  292. * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
  293. * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
  294. * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
  295. * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
  296. * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
  297. * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
  298. * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
  299. * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
  300. * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
  301. * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
  302. * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
  303. * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
  304. *
  305. */
  306. enum dcbnl_pg_attrs {
  307. DCB_PG_ATTR_UNDEFINED,
  308. DCB_PG_ATTR_TC_0,
  309. DCB_PG_ATTR_TC_1,
  310. DCB_PG_ATTR_TC_2,
  311. DCB_PG_ATTR_TC_3,
  312. DCB_PG_ATTR_TC_4,
  313. DCB_PG_ATTR_TC_5,
  314. DCB_PG_ATTR_TC_6,
  315. DCB_PG_ATTR_TC_7,
  316. DCB_PG_ATTR_TC_MAX,
  317. DCB_PG_ATTR_TC_ALL,
  318. DCB_PG_ATTR_BW_ID_0,
  319. DCB_PG_ATTR_BW_ID_1,
  320. DCB_PG_ATTR_BW_ID_2,
  321. DCB_PG_ATTR_BW_ID_3,
  322. DCB_PG_ATTR_BW_ID_4,
  323. DCB_PG_ATTR_BW_ID_5,
  324. DCB_PG_ATTR_BW_ID_6,
  325. DCB_PG_ATTR_BW_ID_7,
  326. DCB_PG_ATTR_BW_ID_MAX,
  327. DCB_PG_ATTR_BW_ID_ALL,
  328. __DCB_PG_ATTR_ENUM_MAX,
  329. DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
  330. };
  331. /**
  332. * enum dcbnl_tc_attrs - DCB Traffic Class attributes
  333. *
  334. * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
  335. * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
  336. * Valid values are: 0-7
  337. * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
  338. * Some devices may not support changing the
  339. * user priority map of a TC.
  340. * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
  341. * 0 - none
  342. * 1 - group strict
  343. * 2 - link strict
  344. * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
  345. * not configured to use link strict priority,
  346. * this is the percentage of bandwidth of the
  347. * priority group this traffic class belongs to
  348. * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
  349. *
  350. */
  351. enum dcbnl_tc_attrs {
  352. DCB_TC_ATTR_PARAM_UNDEFINED,
  353. DCB_TC_ATTR_PARAM_PGID,
  354. DCB_TC_ATTR_PARAM_UP_MAPPING,
  355. DCB_TC_ATTR_PARAM_STRICT_PRIO,
  356. DCB_TC_ATTR_PARAM_BW_PCT,
  357. DCB_TC_ATTR_PARAM_ALL,
  358. __DCB_TC_ATTR_PARAM_ENUM_MAX,
  359. DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
  360. };
  361. /**
  362. * enum dcbnl_cap_attrs - DCB Capability attributes
  363. *
  364. * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
  365. * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
  366. * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
  367. * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
  368. * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
  369. * traffic class mapping
  370. * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
  371. * number of traffic classes the device
  372. * can be configured to use for Priority Groups
  373. * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
  374. * number of traffic classes the device can be
  375. * configured to use for Priority Flow Control
  376. * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
  377. * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
  378. * Notification
  379. * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine
  380. *
  381. */
  382. enum dcbnl_cap_attrs {
  383. DCB_CAP_ATTR_UNDEFINED,
  384. DCB_CAP_ATTR_ALL,
  385. DCB_CAP_ATTR_PG,
  386. DCB_CAP_ATTR_PFC,
  387. DCB_CAP_ATTR_UP2TC,
  388. DCB_CAP_ATTR_PG_TCS,
  389. DCB_CAP_ATTR_PFC_TCS,
  390. DCB_CAP_ATTR_GSP,
  391. DCB_CAP_ATTR_BCN,
  392. DCB_CAP_ATTR_DCBX,
  393. __DCB_CAP_ATTR_ENUM_MAX,
  394. DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
  395. };
  396. /**
  397. * DCBX capability flags
  398. *
  399. * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent.
  400. * 'set' routines are used to configure the device with
  401. * the negotiated parameters
  402. *
  403. * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but
  404. * by another entity
  405. * 'get' routines are used to retrieve the
  406. * negotiated parameters
  407. * 'set' routines can be used to set the initial
  408. * negotiation configuration
  409. *
  410. * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine
  411. * supports the CEE protocol flavor
  412. *
  413. * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine
  414. * supports the IEEE protocol flavor
  415. *
  416. * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine
  417. * supports static configuration (i.e no actual
  418. * negotiation is performed negotiated parameters equal
  419. * the initial configuration)
  420. *
  421. */
  422. #define DCB_CAP_DCBX_HOST 0x01
  423. #define DCB_CAP_DCBX_LLD_MANAGED 0x02
  424. #define DCB_CAP_DCBX_VER_CEE 0x04
  425. #define DCB_CAP_DCBX_VER_IEEE 0x08
  426. #define DCB_CAP_DCBX_STATIC 0x10
  427. /**
  428. * enum dcbnl_numtcs_attrs - number of traffic classes
  429. *
  430. * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
  431. * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes
  432. * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for
  433. * priority groups
  434. * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can
  435. * support priority flow control
  436. */
  437. enum dcbnl_numtcs_attrs {
  438. DCB_NUMTCS_ATTR_UNDEFINED,
  439. DCB_NUMTCS_ATTR_ALL,
  440. DCB_NUMTCS_ATTR_PG,
  441. DCB_NUMTCS_ATTR_PFC,
  442. __DCB_NUMTCS_ATTR_ENUM_MAX,
  443. DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1,
  444. };
  445. enum dcbnl_bcn_attrs{
  446. DCB_BCN_ATTR_UNDEFINED = 0,
  447. DCB_BCN_ATTR_RP_0,
  448. DCB_BCN_ATTR_RP_1,
  449. DCB_BCN_ATTR_RP_2,
  450. DCB_BCN_ATTR_RP_3,
  451. DCB_BCN_ATTR_RP_4,
  452. DCB_BCN_ATTR_RP_5,
  453. DCB_BCN_ATTR_RP_6,
  454. DCB_BCN_ATTR_RP_7,
  455. DCB_BCN_ATTR_RP_ALL,
  456. DCB_BCN_ATTR_BCNA_0,
  457. DCB_BCN_ATTR_BCNA_1,
  458. DCB_BCN_ATTR_ALPHA,
  459. DCB_BCN_ATTR_BETA,
  460. DCB_BCN_ATTR_GD,
  461. DCB_BCN_ATTR_GI,
  462. DCB_BCN_ATTR_TMAX,
  463. DCB_BCN_ATTR_TD,
  464. DCB_BCN_ATTR_RMIN,
  465. DCB_BCN_ATTR_W,
  466. DCB_BCN_ATTR_RD,
  467. DCB_BCN_ATTR_RU,
  468. DCB_BCN_ATTR_WRTT,
  469. DCB_BCN_ATTR_RI,
  470. DCB_BCN_ATTR_C,
  471. DCB_BCN_ATTR_ALL,
  472. __DCB_BCN_ATTR_ENUM_MAX,
  473. DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1,
  474. };
  475. /**
  476. * enum dcb_general_attr_values - general DCB attribute values
  477. *
  478. * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
  479. *
  480. */
  481. enum dcb_general_attr_values {
  482. DCB_ATTR_VALUE_UNDEFINED = 0xff
  483. };
  484. #define DCB_APP_IDTYPE_ETHTYPE 0x00
  485. #define DCB_APP_IDTYPE_PORTNUM 0x01
  486. enum dcbnl_app_attrs {
  487. DCB_APP_ATTR_UNDEFINED,
  488. DCB_APP_ATTR_IDTYPE,
  489. DCB_APP_ATTR_ID,
  490. DCB_APP_ATTR_PRIORITY,
  491. __DCB_APP_ATTR_ENUM_MAX,
  492. DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
  493. };
  494. /**
  495. * enum dcbnl_featcfg_attrs - features conifiguration flags
  496. *
  497. * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors
  498. * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes
  499. * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups
  500. * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority
  501. * flow control
  502. * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV
  503. *
  504. */
  505. #define DCB_FEATCFG_ERROR 0x01 /* error in feature resolution */
  506. #define DCB_FEATCFG_ENABLE 0x02 /* enable feature */
  507. #define DCB_FEATCFG_WILLING 0x04 /* feature is willing */
  508. #define DCB_FEATCFG_ADVERTISE 0x08 /* advertise feature */
  509. enum dcbnl_featcfg_attrs {
  510. DCB_FEATCFG_ATTR_UNDEFINED,
  511. DCB_FEATCFG_ATTR_ALL,
  512. DCB_FEATCFG_ATTR_PG,
  513. DCB_FEATCFG_ATTR_PFC,
  514. DCB_FEATCFG_ATTR_APP,
  515. __DCB_FEATCFG_ATTR_ENUM_MAX,
  516. DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1,
  517. };
  518. #endif /* __LINUX_DCBNL_H__ */