dcbnl.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. /*
  2. * Copyright (c) 2008-2011, 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_SHAPER 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 configuration 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 rate limit extension to the IEEE 802.1Qaz ETS
  65. * managed object.
  66. * Values are 64 bits long and specified in Kbps to enable usage over both
  67. * slow and very fast networks.
  68. *
  69. * @tc_maxrate: maximal tc tx bandwidth indexed by traffic class
  70. */
  71. struct ieee_maxrate {
  72. __u64 tc_maxrate[IEEE_8021QAZ_MAX_TCS];
  73. };
  74. /* This structure contains the IEEE 802.1Qaz PFC managed object
  75. *
  76. * @pfc_cap: Indicates the number of traffic classes on the local device
  77. * that may simultaneously have PFC enabled.
  78. * @pfc_en: bitmap indicating pfc enabled traffic classes
  79. * @mbc: enable macsec bypass capability
  80. * @delay: the allowance made for a round-trip propagation delay of the
  81. * link in bits.
  82. * @requests: count of the sent pfc frames
  83. * @indications: count of the received pfc frames
  84. */
  85. struct ieee_pfc {
  86. __u8 pfc_cap;
  87. __u8 pfc_en;
  88. __u8 mbc;
  89. __u16 delay;
  90. __u64 requests[IEEE_8021QAZ_MAX_TCS];
  91. __u64 indications[IEEE_8021QAZ_MAX_TCS];
  92. };
  93. /* CEE DCBX std supported values */
  94. #define CEE_DCBX_MAX_PGS 8
  95. #define CEE_DCBX_MAX_PRIO 8
  96. /**
  97. * struct cee_pg - CEE Priority-Group managed object
  98. *
  99. * @willing: willing bit in the PG tlv
  100. * @error: error bit in the PG tlv
  101. * @pg_en: enable bit of the PG feature
  102. * @tcs_supported: number of traffic classes supported
  103. * @pg_bw: bandwidth percentage for each priority group
  104. * @prio_pg: priority to PG mapping indexed by priority
  105. */
  106. struct cee_pg {
  107. __u8 willing;
  108. __u8 error;
  109. __u8 pg_en;
  110. __u8 tcs_supported;
  111. __u8 pg_bw[CEE_DCBX_MAX_PGS];
  112. __u8 prio_pg[CEE_DCBX_MAX_PGS];
  113. };
  114. /**
  115. * struct cee_pfc - CEE PFC managed object
  116. *
  117. * @willing: willing bit in the PFC tlv
  118. * @error: error bit in the PFC tlv
  119. * @pfc_en: bitmap indicating pfc enabled traffic classes
  120. * @tcs_supported: number of traffic classes supported
  121. */
  122. struct cee_pfc {
  123. __u8 willing;
  124. __u8 error;
  125. __u8 pfc_en;
  126. __u8 tcs_supported;
  127. };
  128. /* IEEE 802.1Qaz std supported values */
  129. #define IEEE_8021QAZ_APP_SEL_ETHERTYPE 1
  130. #define IEEE_8021QAZ_APP_SEL_STREAM 2
  131. #define IEEE_8021QAZ_APP_SEL_DGRAM 3
  132. #define IEEE_8021QAZ_APP_SEL_ANY 4
  133. /* This structure contains the IEEE 802.1Qaz APP managed object. This
  134. * object is also used for the CEE std as well. There is no difference
  135. * between the objects.
  136. *
  137. * @selector: protocol identifier type
  138. * @protocol: protocol of type indicated
  139. * @priority: 3-bit unsigned integer indicating priority
  140. *
  141. * ----
  142. * Selector field values
  143. * 0 Reserved
  144. * 1 Ethertype
  145. * 2 Well known port number over TCP or SCTP
  146. * 3 Well known port number over UDP or DCCP
  147. * 4 Well known port number over TCP, SCTP, UDP, or DCCP
  148. * 5-7 Reserved
  149. */
  150. struct dcb_app {
  151. __u8 selector;
  152. __u8 priority;
  153. __u16 protocol;
  154. };
  155. /**
  156. * struct dcb_peer_app_info - APP feature information sent by the peer
  157. *
  158. * @willing: willing bit in the peer APP tlv
  159. * @error: error bit in the peer APP tlv
  160. *
  161. * In addition to this information the full peer APP tlv also contains
  162. * a table of 'app_count' APP objects defined above.
  163. */
  164. struct dcb_peer_app_info {
  165. __u8 willing;
  166. __u8 error;
  167. };
  168. struct dcbmsg {
  169. __u8 dcb_family;
  170. __u8 cmd;
  171. __u16 dcb_pad;
  172. };
  173. /**
  174. * enum dcbnl_commands - supported DCB commands
  175. *
  176. * @DCB_CMD_UNDEFINED: unspecified command to catch errors
  177. * @DCB_CMD_GSTATE: request the state of DCB in the device
  178. * @DCB_CMD_SSTATE: set the state of DCB in the device
  179. * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
  180. * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
  181. * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
  182. * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
  183. * @DCB_CMD_PFC_GCFG: request the priority flow control configuration
  184. * @DCB_CMD_PFC_SCFG: set the priority flow control configuration
  185. * @DCB_CMD_SET_ALL: apply all changes to the underlying device
  186. * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
  187. * device. Only useful when using bonding.
  188. * @DCB_CMD_GCAP: request the DCB capabilities of the device
  189. * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
  190. * @DCB_CMD_SNUMTCS: set the number of traffic classes
  191. * @DCB_CMD_GBCN: set backward congestion notification configuration
  192. * @DCB_CMD_SBCN: get backward congestion notification configration.
  193. * @DCB_CMD_GAPP: get application protocol configuration
  194. * @DCB_CMD_SAPP: set application protocol configuration
  195. * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
  196. * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
  197. * @DCB_CMD_GDCBX: get DCBX engine configuration
  198. * @DCB_CMD_SDCBX: set DCBX engine configuration
  199. * @DCB_CMD_GFEATCFG: get DCBX features flags
  200. * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
  201. * @DCB_CMD_CEE_GET: get CEE aggregated configuration
  202. * @DCB_CMD_IEEE_DEL: delete IEEE 802.1Qaz configuration
  203. */
  204. enum dcbnl_commands {
  205. DCB_CMD_UNDEFINED,
  206. DCB_CMD_GSTATE,
  207. DCB_CMD_SSTATE,
  208. DCB_CMD_PGTX_GCFG,
  209. DCB_CMD_PGTX_SCFG,
  210. DCB_CMD_PGRX_GCFG,
  211. DCB_CMD_PGRX_SCFG,
  212. DCB_CMD_PFC_GCFG,
  213. DCB_CMD_PFC_SCFG,
  214. DCB_CMD_SET_ALL,
  215. DCB_CMD_GPERM_HWADDR,
  216. DCB_CMD_GCAP,
  217. DCB_CMD_GNUMTCS,
  218. DCB_CMD_SNUMTCS,
  219. DCB_CMD_PFC_GSTATE,
  220. DCB_CMD_PFC_SSTATE,
  221. DCB_CMD_BCN_GCFG,
  222. DCB_CMD_BCN_SCFG,
  223. DCB_CMD_GAPP,
  224. DCB_CMD_SAPP,
  225. DCB_CMD_IEEE_SET,
  226. DCB_CMD_IEEE_GET,
  227. DCB_CMD_GDCBX,
  228. DCB_CMD_SDCBX,
  229. DCB_CMD_GFEATCFG,
  230. DCB_CMD_SFEATCFG,
  231. DCB_CMD_CEE_GET,
  232. DCB_CMD_IEEE_DEL,
  233. __DCB_CMD_ENUM_MAX,
  234. DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
  235. };
  236. /**
  237. * enum dcbnl_attrs - DCB top-level netlink attributes
  238. *
  239. * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
  240. * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
  241. * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
  242. * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
  243. * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
  244. * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
  245. * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
  246. * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
  247. * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
  248. * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
  249. * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
  250. * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
  251. * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
  252. * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
  253. * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED)
  254. * @DCB_ATTR_CEE: CEE std supported attributes (NLA_NESTED)
  255. */
  256. enum dcbnl_attrs {
  257. DCB_ATTR_UNDEFINED,
  258. DCB_ATTR_IFNAME,
  259. DCB_ATTR_STATE,
  260. DCB_ATTR_PFC_STATE,
  261. DCB_ATTR_PFC_CFG,
  262. DCB_ATTR_NUM_TC,
  263. DCB_ATTR_PG_CFG,
  264. DCB_ATTR_SET_ALL,
  265. DCB_ATTR_PERM_HWADDR,
  266. DCB_ATTR_CAP,
  267. DCB_ATTR_NUMTCS,
  268. DCB_ATTR_BCN,
  269. DCB_ATTR_APP,
  270. /* IEEE std attributes */
  271. DCB_ATTR_IEEE,
  272. DCB_ATTR_DCBX,
  273. DCB_ATTR_FEATCFG,
  274. /* CEE nested attributes */
  275. DCB_ATTR_CEE,
  276. __DCB_ATTR_ENUM_MAX,
  277. DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
  278. };
  279. /**
  280. * enum ieee_attrs - IEEE 802.1Qaz get/set attributes
  281. *
  282. * @DCB_ATTR_IEEE_UNSPEC: unspecified
  283. * @DCB_ATTR_IEEE_ETS: negotiated ETS configuration
  284. * @DCB_ATTR_IEEE_PFC: negotiated PFC configuration
  285. * @DCB_ATTR_IEEE_APP_TABLE: negotiated APP configuration
  286. * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only
  287. * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only
  288. * @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only
  289. */
  290. enum ieee_attrs {
  291. DCB_ATTR_IEEE_UNSPEC,
  292. DCB_ATTR_IEEE_ETS,
  293. DCB_ATTR_IEEE_PFC,
  294. DCB_ATTR_IEEE_APP_TABLE,
  295. DCB_ATTR_IEEE_PEER_ETS,
  296. DCB_ATTR_IEEE_PEER_PFC,
  297. DCB_ATTR_IEEE_PEER_APP,
  298. DCB_ATTR_IEEE_MAXRATE,
  299. __DCB_ATTR_IEEE_MAX
  300. };
  301. #define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
  302. enum ieee_attrs_app {
  303. DCB_ATTR_IEEE_APP_UNSPEC,
  304. DCB_ATTR_IEEE_APP,
  305. __DCB_ATTR_IEEE_APP_MAX
  306. };
  307. #define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
  308. /**
  309. * enum cee_attrs - CEE DCBX get attributes.
  310. *
  311. * @DCB_ATTR_CEE_UNSPEC: unspecified
  312. * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only
  313. * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only
  314. * @DCB_ATTR_CEE_PEER_APP_TABLE: peer APP tlv - get only
  315. * @DCB_ATTR_CEE_TX_PG: TX PG configuration (DCB_CMD_PGTX_GCFG)
  316. * @DCB_ATTR_CEE_RX_PG: RX PG configuration (DCB_CMD_PGRX_GCFG)
  317. * @DCB_ATTR_CEE_PFC: PFC configuration (DCB_CMD_PFC_GCFG)
  318. * @DCB_ATTR_CEE_APP_TABLE: APP configuration (multi DCB_CMD_GAPP)
  319. * @DCB_ATTR_CEE_FEAT: DCBX features flags (DCB_CMD_GFEATCFG)
  320. *
  321. * An aggregated collection of the cee std negotiated parameters.
  322. */
  323. enum cee_attrs {
  324. DCB_ATTR_CEE_UNSPEC,
  325. DCB_ATTR_CEE_PEER_PG,
  326. DCB_ATTR_CEE_PEER_PFC,
  327. DCB_ATTR_CEE_PEER_APP_TABLE,
  328. DCB_ATTR_CEE_TX_PG,
  329. DCB_ATTR_CEE_RX_PG,
  330. DCB_ATTR_CEE_PFC,
  331. DCB_ATTR_CEE_APP_TABLE,
  332. DCB_ATTR_CEE_FEAT,
  333. __DCB_ATTR_CEE_MAX
  334. };
  335. #define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1)
  336. enum peer_app_attr {
  337. DCB_ATTR_CEE_PEER_APP_UNSPEC,
  338. DCB_ATTR_CEE_PEER_APP_INFO,
  339. DCB_ATTR_CEE_PEER_APP,
  340. __DCB_ATTR_CEE_PEER_APP_MAX
  341. };
  342. #define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1)
  343. enum cee_attrs_app {
  344. DCB_ATTR_CEE_APP_UNSPEC,
  345. DCB_ATTR_CEE_APP,
  346. __DCB_ATTR_CEE_APP_MAX
  347. };
  348. #define DCB_ATTR_CEE_APP_MAX (__DCB_ATTR_CEE_APP_MAX - 1)
  349. /**
  350. * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
  351. *
  352. * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
  353. * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
  354. * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
  355. * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
  356. * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
  357. * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
  358. * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
  359. * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
  360. * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
  361. * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
  362. * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
  363. *
  364. */
  365. enum dcbnl_pfc_up_attrs {
  366. DCB_PFC_UP_ATTR_UNDEFINED,
  367. DCB_PFC_UP_ATTR_0,
  368. DCB_PFC_UP_ATTR_1,
  369. DCB_PFC_UP_ATTR_2,
  370. DCB_PFC_UP_ATTR_3,
  371. DCB_PFC_UP_ATTR_4,
  372. DCB_PFC_UP_ATTR_5,
  373. DCB_PFC_UP_ATTR_6,
  374. DCB_PFC_UP_ATTR_7,
  375. DCB_PFC_UP_ATTR_ALL,
  376. __DCB_PFC_UP_ATTR_ENUM_MAX,
  377. DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
  378. };
  379. /**
  380. * enum dcbnl_pg_attrs - DCB Priority Group attributes
  381. *
  382. * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
  383. * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
  384. * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
  385. * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
  386. * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
  387. * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
  388. * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
  389. * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
  390. * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
  391. * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
  392. * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
  393. * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
  394. * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
  395. * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
  396. * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
  397. * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
  398. * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
  399. * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
  400. * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
  401. * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
  402. * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
  403. *
  404. */
  405. enum dcbnl_pg_attrs {
  406. DCB_PG_ATTR_UNDEFINED,
  407. DCB_PG_ATTR_TC_0,
  408. DCB_PG_ATTR_TC_1,
  409. DCB_PG_ATTR_TC_2,
  410. DCB_PG_ATTR_TC_3,
  411. DCB_PG_ATTR_TC_4,
  412. DCB_PG_ATTR_TC_5,
  413. DCB_PG_ATTR_TC_6,
  414. DCB_PG_ATTR_TC_7,
  415. DCB_PG_ATTR_TC_MAX,
  416. DCB_PG_ATTR_TC_ALL,
  417. DCB_PG_ATTR_BW_ID_0,
  418. DCB_PG_ATTR_BW_ID_1,
  419. DCB_PG_ATTR_BW_ID_2,
  420. DCB_PG_ATTR_BW_ID_3,
  421. DCB_PG_ATTR_BW_ID_4,
  422. DCB_PG_ATTR_BW_ID_5,
  423. DCB_PG_ATTR_BW_ID_6,
  424. DCB_PG_ATTR_BW_ID_7,
  425. DCB_PG_ATTR_BW_ID_MAX,
  426. DCB_PG_ATTR_BW_ID_ALL,
  427. __DCB_PG_ATTR_ENUM_MAX,
  428. DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
  429. };
  430. /**
  431. * enum dcbnl_tc_attrs - DCB Traffic Class attributes
  432. *
  433. * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
  434. * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
  435. * Valid values are: 0-7
  436. * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
  437. * Some devices may not support changing the
  438. * user priority map of a TC.
  439. * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
  440. * 0 - none
  441. * 1 - group strict
  442. * 2 - link strict
  443. * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
  444. * not configured to use link strict priority,
  445. * this is the percentage of bandwidth of the
  446. * priority group this traffic class belongs to
  447. * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
  448. *
  449. */
  450. enum dcbnl_tc_attrs {
  451. DCB_TC_ATTR_PARAM_UNDEFINED,
  452. DCB_TC_ATTR_PARAM_PGID,
  453. DCB_TC_ATTR_PARAM_UP_MAPPING,
  454. DCB_TC_ATTR_PARAM_STRICT_PRIO,
  455. DCB_TC_ATTR_PARAM_BW_PCT,
  456. DCB_TC_ATTR_PARAM_ALL,
  457. __DCB_TC_ATTR_PARAM_ENUM_MAX,
  458. DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
  459. };
  460. /**
  461. * enum dcbnl_cap_attrs - DCB Capability attributes
  462. *
  463. * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
  464. * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
  465. * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
  466. * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
  467. * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
  468. * traffic class mapping
  469. * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
  470. * number of traffic classes the device
  471. * can be configured to use for Priority Groups
  472. * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
  473. * number of traffic classes the device can be
  474. * configured to use for Priority Flow Control
  475. * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
  476. * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
  477. * Notification
  478. * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine
  479. *
  480. */
  481. enum dcbnl_cap_attrs {
  482. DCB_CAP_ATTR_UNDEFINED,
  483. DCB_CAP_ATTR_ALL,
  484. DCB_CAP_ATTR_PG,
  485. DCB_CAP_ATTR_PFC,
  486. DCB_CAP_ATTR_UP2TC,
  487. DCB_CAP_ATTR_PG_TCS,
  488. DCB_CAP_ATTR_PFC_TCS,
  489. DCB_CAP_ATTR_GSP,
  490. DCB_CAP_ATTR_BCN,
  491. DCB_CAP_ATTR_DCBX,
  492. __DCB_CAP_ATTR_ENUM_MAX,
  493. DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
  494. };
  495. /**
  496. * DCBX capability flags
  497. *
  498. * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent.
  499. * 'set' routines are used to configure the device with
  500. * the negotiated parameters
  501. *
  502. * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but
  503. * by another entity
  504. * 'get' routines are used to retrieve the
  505. * negotiated parameters
  506. * 'set' routines can be used to set the initial
  507. * negotiation configuration
  508. *
  509. * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine
  510. * supports the CEE protocol flavor
  511. *
  512. * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine
  513. * supports the IEEE protocol flavor
  514. *
  515. * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine
  516. * supports static configuration (i.e no actual
  517. * negotiation is performed negotiated parameters equal
  518. * the initial configuration)
  519. *
  520. */
  521. #define DCB_CAP_DCBX_HOST 0x01
  522. #define DCB_CAP_DCBX_LLD_MANAGED 0x02
  523. #define DCB_CAP_DCBX_VER_CEE 0x04
  524. #define DCB_CAP_DCBX_VER_IEEE 0x08
  525. #define DCB_CAP_DCBX_STATIC 0x10
  526. /**
  527. * enum dcbnl_numtcs_attrs - number of traffic classes
  528. *
  529. * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
  530. * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes
  531. * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for
  532. * priority groups
  533. * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can
  534. * support priority flow control
  535. */
  536. enum dcbnl_numtcs_attrs {
  537. DCB_NUMTCS_ATTR_UNDEFINED,
  538. DCB_NUMTCS_ATTR_ALL,
  539. DCB_NUMTCS_ATTR_PG,
  540. DCB_NUMTCS_ATTR_PFC,
  541. __DCB_NUMTCS_ATTR_ENUM_MAX,
  542. DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1,
  543. };
  544. enum dcbnl_bcn_attrs{
  545. DCB_BCN_ATTR_UNDEFINED = 0,
  546. DCB_BCN_ATTR_RP_0,
  547. DCB_BCN_ATTR_RP_1,
  548. DCB_BCN_ATTR_RP_2,
  549. DCB_BCN_ATTR_RP_3,
  550. DCB_BCN_ATTR_RP_4,
  551. DCB_BCN_ATTR_RP_5,
  552. DCB_BCN_ATTR_RP_6,
  553. DCB_BCN_ATTR_RP_7,
  554. DCB_BCN_ATTR_RP_ALL,
  555. DCB_BCN_ATTR_BCNA_0,
  556. DCB_BCN_ATTR_BCNA_1,
  557. DCB_BCN_ATTR_ALPHA,
  558. DCB_BCN_ATTR_BETA,
  559. DCB_BCN_ATTR_GD,
  560. DCB_BCN_ATTR_GI,
  561. DCB_BCN_ATTR_TMAX,
  562. DCB_BCN_ATTR_TD,
  563. DCB_BCN_ATTR_RMIN,
  564. DCB_BCN_ATTR_W,
  565. DCB_BCN_ATTR_RD,
  566. DCB_BCN_ATTR_RU,
  567. DCB_BCN_ATTR_WRTT,
  568. DCB_BCN_ATTR_RI,
  569. DCB_BCN_ATTR_C,
  570. DCB_BCN_ATTR_ALL,
  571. __DCB_BCN_ATTR_ENUM_MAX,
  572. DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1,
  573. };
  574. /**
  575. * enum dcb_general_attr_values - general DCB attribute values
  576. *
  577. * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
  578. *
  579. */
  580. enum dcb_general_attr_values {
  581. DCB_ATTR_VALUE_UNDEFINED = 0xff
  582. };
  583. #define DCB_APP_IDTYPE_ETHTYPE 0x00
  584. #define DCB_APP_IDTYPE_PORTNUM 0x01
  585. enum dcbnl_app_attrs {
  586. DCB_APP_ATTR_UNDEFINED,
  587. DCB_APP_ATTR_IDTYPE,
  588. DCB_APP_ATTR_ID,
  589. DCB_APP_ATTR_PRIORITY,
  590. __DCB_APP_ATTR_ENUM_MAX,
  591. DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
  592. };
  593. /**
  594. * enum dcbnl_featcfg_attrs - features conifiguration flags
  595. *
  596. * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors
  597. * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes
  598. * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups
  599. * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority
  600. * flow control
  601. * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV
  602. *
  603. */
  604. #define DCB_FEATCFG_ERROR 0x01 /* error in feature resolution */
  605. #define DCB_FEATCFG_ENABLE 0x02 /* enable feature */
  606. #define DCB_FEATCFG_WILLING 0x04 /* feature is willing */
  607. #define DCB_FEATCFG_ADVERTISE 0x08 /* advertise feature */
  608. enum dcbnl_featcfg_attrs {
  609. DCB_FEATCFG_ATTR_UNDEFINED,
  610. DCB_FEATCFG_ATTR_ALL,
  611. DCB_FEATCFG_ATTR_PG,
  612. DCB_FEATCFG_ATTR_PFC,
  613. DCB_FEATCFG_ATTR_APP,
  614. __DCB_FEATCFG_ATTR_ENUM_MAX,
  615. DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1,
  616. };
  617. #endif /* __LINUX_DCBNL_H__ */