dcbnl.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * Copyright (c) 2008-2011, Intel Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms and conditions of the GNU General Public License,
  7. * version 2, as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  16. * Place - Suite 330, Boston, MA 02111-1307 USA.
  17. *
  18. * Author: Lucy Liu <lucy.liu@intel.com>
  19. */
  20. #ifndef __LINUX_DCBNL_H__
  21. #define __LINUX_DCBNL_H__
  22. #include <linux/types.h>
  23. /* IEEE 802.1Qaz std supported values */
  24. #define IEEE_8021QAZ_MAX_TCS 8
  25. #define IEEE_8021QAZ_TSA_STRICT 0
  26. #define IEEE_8021QAZ_TSA_CB_SHAPER 1
  27. #define IEEE_8021QAZ_TSA_ETS 2
  28. #define IEEE_8021QAZ_TSA_VENDOR 255
  29. /* This structure contains the IEEE 802.1Qaz ETS managed object
  30. *
  31. * @willing: willing bit in ETS configuration TLV
  32. * @ets_cap: indicates supported capacity of ets feature
  33. * @cbs: credit based shaper ets algorithm supported
  34. * @tc_tx_bw: tc tx bandwidth indexed by traffic class
  35. * @tc_rx_bw: tc rx bandwidth indexed by traffic class
  36. * @tc_tsa: TSA Assignment table, indexed by traffic class
  37. * @prio_tc: priority assignment table mapping 8021Qp to traffic class
  38. * @tc_reco_bw: recommended tc bandwidth indexed by traffic class for TLV
  39. * @tc_reco_tsa: recommended tc bandwidth indexed by traffic class for TLV
  40. * @reco_prio_tc: recommended tc tx bandwidth indexed by traffic class for TLV
  41. *
  42. * Recommended values are used to set fields in the ETS recommendation TLV
  43. * with hardware offloaded LLDP.
  44. *
  45. * ----
  46. * TSA Assignment 8 bit identifiers
  47. * 0 strict priority
  48. * 1 credit-based shaper
  49. * 2 enhanced transmission selection
  50. * 3-254 reserved
  51. * 255 vendor specific
  52. */
  53. struct ieee_ets {
  54. __u8 willing;
  55. __u8 ets_cap;
  56. __u8 cbs;
  57. __u8 tc_tx_bw[IEEE_8021QAZ_MAX_TCS];
  58. __u8 tc_rx_bw[IEEE_8021QAZ_MAX_TCS];
  59. __u8 tc_tsa[IEEE_8021QAZ_MAX_TCS];
  60. __u8 prio_tc[IEEE_8021QAZ_MAX_TCS];
  61. __u8 tc_reco_bw[IEEE_8021QAZ_MAX_TCS];
  62. __u8 tc_reco_tsa[IEEE_8021QAZ_MAX_TCS];
  63. __u8 reco_prio_tc[IEEE_8021QAZ_MAX_TCS];
  64. };
  65. /* This structure contains rate limit extension to the IEEE 802.1Qaz ETS
  66. * managed object.
  67. * Values are 64 bits long and specified in Kbps to enable usage over both
  68. * slow and very fast networks.
  69. *
  70. * @tc_maxrate: maximal tc tx bandwidth indexed by traffic class
  71. */
  72. struct ieee_maxrate {
  73. __u64 tc_maxrate[IEEE_8021QAZ_MAX_TCS];
  74. };
  75. enum dcbnl_cndd_states {
  76. DCB_CNDD_RESET = 0,
  77. DCB_CNDD_EDGE,
  78. DCB_CNDD_INTERIOR,
  79. DCB_CNDD_INTERIOR_READY,
  80. };
  81. /* This structure contains the IEEE 802.1Qau QCN managed object.
  82. *
  83. *@rpg_enable: enable QCN RP
  84. *@rppp_max_rps: maximum number of RPs allowed for this CNPV on this port
  85. *@rpg_time_reset: time between rate increases if no CNMs received.
  86. * given in u-seconds
  87. *@rpg_byte_reset: transmitted data between rate increases if no CNMs received.
  88. * given in Bytes
  89. *@rpg_threshold: The number of times rpByteStage or rpTimeStage can count
  90. * before RP rate control state machine advances states
  91. *@rpg_max_rate: the maxinun rate, in Mbits per second,
  92. * at which an RP can transmit
  93. *@rpg_ai_rate: The rate, in Mbits per second,
  94. * used to increase rpTargetRate in the RPR_ACTIVE_INCREASE
  95. *@rpg_hai_rate: The rate, in Mbits per second,
  96. * used to increase rpTargetRate in the RPR_HYPER_INCREASE state
  97. *@rpg_gd: Upon CNM receive, flow rate is limited to (Fb/Gd)*CurrentRate.
  98. * rpgGd is given as log2(Gd), where Gd may only be powers of 2
  99. *@rpg_min_dec_fac: The minimum factor by which the current transmit rate
  100. * can be changed by reception of a CNM.
  101. * value is given as percentage (1-100)
  102. *@rpg_min_rate: The minimum value, in bits per second, for rate to limit
  103. *@cndd_state_machine: The state of the congestion notification domain
  104. * defense state machine, as defined by IEEE 802.3Qau
  105. * section 32.1.1. In the interior ready state,
  106. * the QCN capable hardware may add CN-TAG TLV to the
  107. * outgoing traffic, to specifically identify outgoing
  108. * flows.
  109. */
  110. struct ieee_qcn {
  111. __u8 rpg_enable[IEEE_8021QAZ_MAX_TCS];
  112. __u32 rppp_max_rps[IEEE_8021QAZ_MAX_TCS];
  113. __u32 rpg_time_reset[IEEE_8021QAZ_MAX_TCS];
  114. __u32 rpg_byte_reset[IEEE_8021QAZ_MAX_TCS];
  115. __u32 rpg_threshold[IEEE_8021QAZ_MAX_TCS];
  116. __u32 rpg_max_rate[IEEE_8021QAZ_MAX_TCS];
  117. __u32 rpg_ai_rate[IEEE_8021QAZ_MAX_TCS];
  118. __u32 rpg_hai_rate[IEEE_8021QAZ_MAX_TCS];
  119. __u32 rpg_gd[IEEE_8021QAZ_MAX_TCS];
  120. __u32 rpg_min_dec_fac[IEEE_8021QAZ_MAX_TCS];
  121. __u32 rpg_min_rate[IEEE_8021QAZ_MAX_TCS];
  122. __u32 cndd_state_machine[IEEE_8021QAZ_MAX_TCS];
  123. };
  124. /* This structure contains the IEEE 802.1Qau QCN statistics.
  125. *
  126. *@rppp_rp_centiseconds: the number of RP-centiseconds accumulated
  127. * by RPs at this priority level on this Port
  128. *@rppp_created_rps: number of active RPs(flows) that react to CNMs
  129. */
  130. struct ieee_qcn_stats {
  131. __u64 rppp_rp_centiseconds[IEEE_8021QAZ_MAX_TCS];
  132. __u32 rppp_created_rps[IEEE_8021QAZ_MAX_TCS];
  133. };
  134. /* This structure contains the IEEE 802.1Qaz PFC managed object
  135. *
  136. * @pfc_cap: Indicates the number of traffic classes on the local device
  137. * that may simultaneously have PFC enabled.
  138. * @pfc_en: bitmap indicating pfc enabled traffic classes
  139. * @mbc: enable macsec bypass capability
  140. * @delay: the allowance made for a round-trip propagation delay of the
  141. * link in bits.
  142. * @requests: count of the sent pfc frames
  143. * @indications: count of the received pfc frames
  144. */
  145. struct ieee_pfc {
  146. __u8 pfc_cap;
  147. __u8 pfc_en;
  148. __u8 mbc;
  149. __u16 delay;
  150. __u64 requests[IEEE_8021QAZ_MAX_TCS];
  151. __u64 indications[IEEE_8021QAZ_MAX_TCS];
  152. };
  153. #define IEEE_8021Q_MAX_PRIORITIES 8
  154. #define DCBX_MAX_BUFFERS 8
  155. struct dcbnl_buffer {
  156. /* priority to buffer mapping */
  157. __u8 prio2buffer[IEEE_8021Q_MAX_PRIORITIES];
  158. /* buffer size in Bytes */
  159. __u32 buffer_size[DCBX_MAX_BUFFERS];
  160. __u32 total_size;
  161. };
  162. /* CEE DCBX std supported values */
  163. #define CEE_DCBX_MAX_PGS 8
  164. #define CEE_DCBX_MAX_PRIO 8
  165. /**
  166. * struct cee_pg - CEE Priority-Group managed object
  167. *
  168. * @willing: willing bit in the PG tlv
  169. * @error: error bit in the PG tlv
  170. * @pg_en: enable bit of the PG feature
  171. * @tcs_supported: number of traffic classes supported
  172. * @pg_bw: bandwidth percentage for each priority group
  173. * @prio_pg: priority to PG mapping indexed by priority
  174. */
  175. struct cee_pg {
  176. __u8 willing;
  177. __u8 error;
  178. __u8 pg_en;
  179. __u8 tcs_supported;
  180. __u8 pg_bw[CEE_DCBX_MAX_PGS];
  181. __u8 prio_pg[CEE_DCBX_MAX_PGS];
  182. };
  183. /**
  184. * struct cee_pfc - CEE PFC managed object
  185. *
  186. * @willing: willing bit in the PFC tlv
  187. * @error: error bit in the PFC tlv
  188. * @pfc_en: bitmap indicating pfc enabled traffic classes
  189. * @tcs_supported: number of traffic classes supported
  190. */
  191. struct cee_pfc {
  192. __u8 willing;
  193. __u8 error;
  194. __u8 pfc_en;
  195. __u8 tcs_supported;
  196. };
  197. /* IEEE 802.1Qaz std supported values */
  198. #define IEEE_8021QAZ_APP_SEL_ETHERTYPE 1
  199. #define IEEE_8021QAZ_APP_SEL_STREAM 2
  200. #define IEEE_8021QAZ_APP_SEL_DGRAM 3
  201. #define IEEE_8021QAZ_APP_SEL_ANY 4
  202. #define IEEE_8021QAZ_APP_SEL_DSCP 5
  203. /* This structure contains the IEEE 802.1Qaz APP managed object. This
  204. * object is also used for the CEE std as well.
  205. *
  206. * @selector: protocol identifier type
  207. * @protocol: protocol of type indicated
  208. * @priority: 3-bit unsigned integer indicating priority for IEEE
  209. * 8-bit 802.1p user priority bitmap for CEE
  210. *
  211. * ----
  212. * Selector field values for IEEE 802.1Qaz
  213. * 0 Reserved
  214. * 1 Ethertype
  215. * 2 Well known port number over TCP or SCTP
  216. * 3 Well known port number over UDP or DCCP
  217. * 4 Well known port number over TCP, SCTP, UDP, or DCCP
  218. * 5 Differentiated Services Code Point (DSCP) value
  219. * 6-7 Reserved
  220. *
  221. * Selector field values for CEE
  222. * 0 Ethertype
  223. * 1 Well known port number over TCP or UDP
  224. * 2-3 Reserved
  225. */
  226. struct dcb_app {
  227. __u8 selector;
  228. __u8 priority;
  229. __u16 protocol;
  230. };
  231. /**
  232. * struct dcb_peer_app_info - APP feature information sent by the peer
  233. *
  234. * @willing: willing bit in the peer APP tlv
  235. * @error: error bit in the peer APP tlv
  236. *
  237. * In addition to this information the full peer APP tlv also contains
  238. * a table of 'app_count' APP objects defined above.
  239. */
  240. struct dcb_peer_app_info {
  241. __u8 willing;
  242. __u8 error;
  243. };
  244. struct dcbmsg {
  245. __u8 dcb_family;
  246. __u8 cmd;
  247. __u16 dcb_pad;
  248. };
  249. /**
  250. * enum dcbnl_commands - supported DCB commands
  251. *
  252. * @DCB_CMD_UNDEFINED: unspecified command to catch errors
  253. * @DCB_CMD_GSTATE: request the state of DCB in the device
  254. * @DCB_CMD_SSTATE: set the state of DCB in the device
  255. * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
  256. * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
  257. * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
  258. * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
  259. * @DCB_CMD_PFC_GCFG: request the priority flow control configuration
  260. * @DCB_CMD_PFC_SCFG: set the priority flow control configuration
  261. * @DCB_CMD_SET_ALL: apply all changes to the underlying device
  262. * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
  263. * device. Only useful when using bonding.
  264. * @DCB_CMD_GCAP: request the DCB capabilities of the device
  265. * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
  266. * @DCB_CMD_SNUMTCS: set the number of traffic classes
  267. * @DCB_CMD_GBCN: set backward congestion notification configuration
  268. * @DCB_CMD_SBCN: get backward congestion notification configration.
  269. * @DCB_CMD_GAPP: get application protocol configuration
  270. * @DCB_CMD_SAPP: set application protocol configuration
  271. * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
  272. * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
  273. * @DCB_CMD_GDCBX: get DCBX engine configuration
  274. * @DCB_CMD_SDCBX: set DCBX engine configuration
  275. * @DCB_CMD_GFEATCFG: get DCBX features flags
  276. * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
  277. * @DCB_CMD_CEE_GET: get CEE aggregated configuration
  278. * @DCB_CMD_IEEE_DEL: delete IEEE 802.1Qaz configuration
  279. */
  280. enum dcbnl_commands {
  281. DCB_CMD_UNDEFINED,
  282. DCB_CMD_GSTATE,
  283. DCB_CMD_SSTATE,
  284. DCB_CMD_PGTX_GCFG,
  285. DCB_CMD_PGTX_SCFG,
  286. DCB_CMD_PGRX_GCFG,
  287. DCB_CMD_PGRX_SCFG,
  288. DCB_CMD_PFC_GCFG,
  289. DCB_CMD_PFC_SCFG,
  290. DCB_CMD_SET_ALL,
  291. DCB_CMD_GPERM_HWADDR,
  292. DCB_CMD_GCAP,
  293. DCB_CMD_GNUMTCS,
  294. DCB_CMD_SNUMTCS,
  295. DCB_CMD_PFC_GSTATE,
  296. DCB_CMD_PFC_SSTATE,
  297. DCB_CMD_BCN_GCFG,
  298. DCB_CMD_BCN_SCFG,
  299. DCB_CMD_GAPP,
  300. DCB_CMD_SAPP,
  301. DCB_CMD_IEEE_SET,
  302. DCB_CMD_IEEE_GET,
  303. DCB_CMD_GDCBX,
  304. DCB_CMD_SDCBX,
  305. DCB_CMD_GFEATCFG,
  306. DCB_CMD_SFEATCFG,
  307. DCB_CMD_CEE_GET,
  308. DCB_CMD_IEEE_DEL,
  309. __DCB_CMD_ENUM_MAX,
  310. DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
  311. };
  312. /**
  313. * enum dcbnl_attrs - DCB top-level netlink attributes
  314. *
  315. * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
  316. * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
  317. * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
  318. * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
  319. * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
  320. * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
  321. * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
  322. * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
  323. * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
  324. * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
  325. * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
  326. * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
  327. * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
  328. * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
  329. * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED)
  330. * @DCB_ATTR_CEE: CEE std supported attributes (NLA_NESTED)
  331. */
  332. enum dcbnl_attrs {
  333. DCB_ATTR_UNDEFINED,
  334. DCB_ATTR_IFNAME,
  335. DCB_ATTR_STATE,
  336. DCB_ATTR_PFC_STATE,
  337. DCB_ATTR_PFC_CFG,
  338. DCB_ATTR_NUM_TC,
  339. DCB_ATTR_PG_CFG,
  340. DCB_ATTR_SET_ALL,
  341. DCB_ATTR_PERM_HWADDR,
  342. DCB_ATTR_CAP,
  343. DCB_ATTR_NUMTCS,
  344. DCB_ATTR_BCN,
  345. DCB_ATTR_APP,
  346. /* IEEE std attributes */
  347. DCB_ATTR_IEEE,
  348. DCB_ATTR_DCBX,
  349. DCB_ATTR_FEATCFG,
  350. /* CEE nested attributes */
  351. DCB_ATTR_CEE,
  352. __DCB_ATTR_ENUM_MAX,
  353. DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
  354. };
  355. /**
  356. * enum ieee_attrs - IEEE 802.1Qaz get/set attributes
  357. *
  358. * @DCB_ATTR_IEEE_UNSPEC: unspecified
  359. * @DCB_ATTR_IEEE_ETS: negotiated ETS configuration
  360. * @DCB_ATTR_IEEE_PFC: negotiated PFC configuration
  361. * @DCB_ATTR_IEEE_APP_TABLE: negotiated APP configuration
  362. * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only
  363. * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only
  364. * @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only
  365. */
  366. enum ieee_attrs {
  367. DCB_ATTR_IEEE_UNSPEC,
  368. DCB_ATTR_IEEE_ETS,
  369. DCB_ATTR_IEEE_PFC,
  370. DCB_ATTR_IEEE_APP_TABLE,
  371. DCB_ATTR_IEEE_PEER_ETS,
  372. DCB_ATTR_IEEE_PEER_PFC,
  373. DCB_ATTR_IEEE_PEER_APP,
  374. DCB_ATTR_IEEE_MAXRATE,
  375. DCB_ATTR_IEEE_QCN,
  376. DCB_ATTR_IEEE_QCN_STATS,
  377. DCB_ATTR_DCB_BUFFER,
  378. __DCB_ATTR_IEEE_MAX
  379. };
  380. #define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
  381. enum ieee_attrs_app {
  382. DCB_ATTR_IEEE_APP_UNSPEC,
  383. DCB_ATTR_IEEE_APP,
  384. __DCB_ATTR_IEEE_APP_MAX
  385. };
  386. #define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
  387. /**
  388. * enum cee_attrs - CEE DCBX get attributes.
  389. *
  390. * @DCB_ATTR_CEE_UNSPEC: unspecified
  391. * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only
  392. * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only
  393. * @DCB_ATTR_CEE_PEER_APP_TABLE: peer APP tlv - get only
  394. * @DCB_ATTR_CEE_TX_PG: TX PG configuration (DCB_CMD_PGTX_GCFG)
  395. * @DCB_ATTR_CEE_RX_PG: RX PG configuration (DCB_CMD_PGRX_GCFG)
  396. * @DCB_ATTR_CEE_PFC: PFC configuration (DCB_CMD_PFC_GCFG)
  397. * @DCB_ATTR_CEE_APP_TABLE: APP configuration (multi DCB_CMD_GAPP)
  398. * @DCB_ATTR_CEE_FEAT: DCBX features flags (DCB_CMD_GFEATCFG)
  399. *
  400. * An aggregated collection of the cee std negotiated parameters.
  401. */
  402. enum cee_attrs {
  403. DCB_ATTR_CEE_UNSPEC,
  404. DCB_ATTR_CEE_PEER_PG,
  405. DCB_ATTR_CEE_PEER_PFC,
  406. DCB_ATTR_CEE_PEER_APP_TABLE,
  407. DCB_ATTR_CEE_TX_PG,
  408. DCB_ATTR_CEE_RX_PG,
  409. DCB_ATTR_CEE_PFC,
  410. DCB_ATTR_CEE_APP_TABLE,
  411. DCB_ATTR_CEE_FEAT,
  412. __DCB_ATTR_CEE_MAX
  413. };
  414. #define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1)
  415. enum peer_app_attr {
  416. DCB_ATTR_CEE_PEER_APP_UNSPEC,
  417. DCB_ATTR_CEE_PEER_APP_INFO,
  418. DCB_ATTR_CEE_PEER_APP,
  419. __DCB_ATTR_CEE_PEER_APP_MAX
  420. };
  421. #define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1)
  422. enum cee_attrs_app {
  423. DCB_ATTR_CEE_APP_UNSPEC,
  424. DCB_ATTR_CEE_APP,
  425. __DCB_ATTR_CEE_APP_MAX
  426. };
  427. #define DCB_ATTR_CEE_APP_MAX (__DCB_ATTR_CEE_APP_MAX - 1)
  428. /**
  429. * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
  430. *
  431. * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
  432. * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
  433. * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
  434. * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
  435. * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
  436. * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
  437. * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
  438. * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
  439. * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
  440. * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
  441. * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
  442. *
  443. */
  444. enum dcbnl_pfc_up_attrs {
  445. DCB_PFC_UP_ATTR_UNDEFINED,
  446. DCB_PFC_UP_ATTR_0,
  447. DCB_PFC_UP_ATTR_1,
  448. DCB_PFC_UP_ATTR_2,
  449. DCB_PFC_UP_ATTR_3,
  450. DCB_PFC_UP_ATTR_4,
  451. DCB_PFC_UP_ATTR_5,
  452. DCB_PFC_UP_ATTR_6,
  453. DCB_PFC_UP_ATTR_7,
  454. DCB_PFC_UP_ATTR_ALL,
  455. __DCB_PFC_UP_ATTR_ENUM_MAX,
  456. DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
  457. };
  458. /**
  459. * enum dcbnl_pg_attrs - DCB Priority Group attributes
  460. *
  461. * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
  462. * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
  463. * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
  464. * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
  465. * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
  466. * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
  467. * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
  468. * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
  469. * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
  470. * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
  471. * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
  472. * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
  473. * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
  474. * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
  475. * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
  476. * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
  477. * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
  478. * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
  479. * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
  480. * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
  481. * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
  482. *
  483. */
  484. enum dcbnl_pg_attrs {
  485. DCB_PG_ATTR_UNDEFINED,
  486. DCB_PG_ATTR_TC_0,
  487. DCB_PG_ATTR_TC_1,
  488. DCB_PG_ATTR_TC_2,
  489. DCB_PG_ATTR_TC_3,
  490. DCB_PG_ATTR_TC_4,
  491. DCB_PG_ATTR_TC_5,
  492. DCB_PG_ATTR_TC_6,
  493. DCB_PG_ATTR_TC_7,
  494. DCB_PG_ATTR_TC_MAX,
  495. DCB_PG_ATTR_TC_ALL,
  496. DCB_PG_ATTR_BW_ID_0,
  497. DCB_PG_ATTR_BW_ID_1,
  498. DCB_PG_ATTR_BW_ID_2,
  499. DCB_PG_ATTR_BW_ID_3,
  500. DCB_PG_ATTR_BW_ID_4,
  501. DCB_PG_ATTR_BW_ID_5,
  502. DCB_PG_ATTR_BW_ID_6,
  503. DCB_PG_ATTR_BW_ID_7,
  504. DCB_PG_ATTR_BW_ID_MAX,
  505. DCB_PG_ATTR_BW_ID_ALL,
  506. __DCB_PG_ATTR_ENUM_MAX,
  507. DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
  508. };
  509. /**
  510. * enum dcbnl_tc_attrs - DCB Traffic Class attributes
  511. *
  512. * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
  513. * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
  514. * Valid values are: 0-7
  515. * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
  516. * Some devices may not support changing the
  517. * user priority map of a TC.
  518. * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
  519. * 0 - none
  520. * 1 - group strict
  521. * 2 - link strict
  522. * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
  523. * not configured to use link strict priority,
  524. * this is the percentage of bandwidth of the
  525. * priority group this traffic class belongs to
  526. * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
  527. *
  528. */
  529. enum dcbnl_tc_attrs {
  530. DCB_TC_ATTR_PARAM_UNDEFINED,
  531. DCB_TC_ATTR_PARAM_PGID,
  532. DCB_TC_ATTR_PARAM_UP_MAPPING,
  533. DCB_TC_ATTR_PARAM_STRICT_PRIO,
  534. DCB_TC_ATTR_PARAM_BW_PCT,
  535. DCB_TC_ATTR_PARAM_ALL,
  536. __DCB_TC_ATTR_PARAM_ENUM_MAX,
  537. DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
  538. };
  539. /**
  540. * enum dcbnl_cap_attrs - DCB Capability attributes
  541. *
  542. * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
  543. * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
  544. * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
  545. * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
  546. * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
  547. * traffic class mapping
  548. * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
  549. * number of traffic classes the device
  550. * can be configured to use for Priority Groups
  551. * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
  552. * number of traffic classes the device can be
  553. * configured to use for Priority Flow Control
  554. * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
  555. * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
  556. * Notification
  557. * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine
  558. *
  559. */
  560. enum dcbnl_cap_attrs {
  561. DCB_CAP_ATTR_UNDEFINED,
  562. DCB_CAP_ATTR_ALL,
  563. DCB_CAP_ATTR_PG,
  564. DCB_CAP_ATTR_PFC,
  565. DCB_CAP_ATTR_UP2TC,
  566. DCB_CAP_ATTR_PG_TCS,
  567. DCB_CAP_ATTR_PFC_TCS,
  568. DCB_CAP_ATTR_GSP,
  569. DCB_CAP_ATTR_BCN,
  570. DCB_CAP_ATTR_DCBX,
  571. __DCB_CAP_ATTR_ENUM_MAX,
  572. DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
  573. };
  574. /**
  575. * DCBX capability flags
  576. *
  577. * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent.
  578. * 'set' routines are used to configure the device with
  579. * the negotiated parameters
  580. *
  581. * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but
  582. * by another entity
  583. * 'get' routines are used to retrieve the
  584. * negotiated parameters
  585. * 'set' routines can be used to set the initial
  586. * negotiation configuration
  587. *
  588. * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine
  589. * supports the CEE protocol flavor
  590. *
  591. * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine
  592. * supports the IEEE protocol flavor
  593. *
  594. * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine
  595. * supports static configuration (i.e no actual
  596. * negotiation is performed negotiated parameters equal
  597. * the initial configuration)
  598. *
  599. */
  600. #define DCB_CAP_DCBX_HOST 0x01
  601. #define DCB_CAP_DCBX_LLD_MANAGED 0x02
  602. #define DCB_CAP_DCBX_VER_CEE 0x04
  603. #define DCB_CAP_DCBX_VER_IEEE 0x08
  604. #define DCB_CAP_DCBX_STATIC 0x10
  605. /**
  606. * enum dcbnl_numtcs_attrs - number of traffic classes
  607. *
  608. * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
  609. * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes
  610. * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for
  611. * priority groups
  612. * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can
  613. * support priority flow control
  614. */
  615. enum dcbnl_numtcs_attrs {
  616. DCB_NUMTCS_ATTR_UNDEFINED,
  617. DCB_NUMTCS_ATTR_ALL,
  618. DCB_NUMTCS_ATTR_PG,
  619. DCB_NUMTCS_ATTR_PFC,
  620. __DCB_NUMTCS_ATTR_ENUM_MAX,
  621. DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1,
  622. };
  623. enum dcbnl_bcn_attrs{
  624. DCB_BCN_ATTR_UNDEFINED = 0,
  625. DCB_BCN_ATTR_RP_0,
  626. DCB_BCN_ATTR_RP_1,
  627. DCB_BCN_ATTR_RP_2,
  628. DCB_BCN_ATTR_RP_3,
  629. DCB_BCN_ATTR_RP_4,
  630. DCB_BCN_ATTR_RP_5,
  631. DCB_BCN_ATTR_RP_6,
  632. DCB_BCN_ATTR_RP_7,
  633. DCB_BCN_ATTR_RP_ALL,
  634. DCB_BCN_ATTR_BCNA_0,
  635. DCB_BCN_ATTR_BCNA_1,
  636. DCB_BCN_ATTR_ALPHA,
  637. DCB_BCN_ATTR_BETA,
  638. DCB_BCN_ATTR_GD,
  639. DCB_BCN_ATTR_GI,
  640. DCB_BCN_ATTR_TMAX,
  641. DCB_BCN_ATTR_TD,
  642. DCB_BCN_ATTR_RMIN,
  643. DCB_BCN_ATTR_W,
  644. DCB_BCN_ATTR_RD,
  645. DCB_BCN_ATTR_RU,
  646. DCB_BCN_ATTR_WRTT,
  647. DCB_BCN_ATTR_RI,
  648. DCB_BCN_ATTR_C,
  649. DCB_BCN_ATTR_ALL,
  650. __DCB_BCN_ATTR_ENUM_MAX,
  651. DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1,
  652. };
  653. /**
  654. * enum dcb_general_attr_values - general DCB attribute values
  655. *
  656. * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
  657. *
  658. */
  659. enum dcb_general_attr_values {
  660. DCB_ATTR_VALUE_UNDEFINED = 0xff
  661. };
  662. #define DCB_APP_IDTYPE_ETHTYPE 0x00
  663. #define DCB_APP_IDTYPE_PORTNUM 0x01
  664. enum dcbnl_app_attrs {
  665. DCB_APP_ATTR_UNDEFINED,
  666. DCB_APP_ATTR_IDTYPE,
  667. DCB_APP_ATTR_ID,
  668. DCB_APP_ATTR_PRIORITY,
  669. __DCB_APP_ATTR_ENUM_MAX,
  670. DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
  671. };
  672. /**
  673. * enum dcbnl_featcfg_attrs - features conifiguration flags
  674. *
  675. * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors
  676. * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes
  677. * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups
  678. * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority
  679. * flow control
  680. * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV
  681. *
  682. */
  683. #define DCB_FEATCFG_ERROR 0x01 /* error in feature resolution */
  684. #define DCB_FEATCFG_ENABLE 0x02 /* enable feature */
  685. #define DCB_FEATCFG_WILLING 0x04 /* feature is willing */
  686. #define DCB_FEATCFG_ADVERTISE 0x08 /* advertise feature */
  687. enum dcbnl_featcfg_attrs {
  688. DCB_FEATCFG_ATTR_UNDEFINED,
  689. DCB_FEATCFG_ATTR_ALL,
  690. DCB_FEATCFG_ATTR_PG,
  691. DCB_FEATCFG_ATTR_PFC,
  692. DCB_FEATCFG_ATTR_APP,
  693. __DCB_FEATCFG_ATTR_ENUM_MAX,
  694. DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1,
  695. };
  696. #endif /* __LINUX_DCBNL_H__ */