dcbnl.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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. #define DCB_PROTO_VERSION 1
  22. struct dcbmsg {
  23. unsigned char dcb_family;
  24. __u8 cmd;
  25. __u16 dcb_pad;
  26. };
  27. /**
  28. * enum dcbnl_commands - supported DCB commands
  29. *
  30. * @DCB_CMD_UNDEFINED: unspecified command to catch errors
  31. * @DCB_CMD_GSTATE: request the state of DCB in the device
  32. * @DCB_CMD_SSTATE: set the state of DCB in the device
  33. * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
  34. * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
  35. * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
  36. * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
  37. * @DCB_CMD_PFC_GCFG: request the priority flow control configuration
  38. * @DCB_CMD_PFC_SCFG: set the priority flow control configuration
  39. * @DCB_CMD_SET_ALL: apply all changes to the underlying device
  40. * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
  41. * device. Only useful when using bonding.
  42. */
  43. enum dcbnl_commands {
  44. DCB_CMD_UNDEFINED,
  45. DCB_CMD_GSTATE,
  46. DCB_CMD_SSTATE,
  47. DCB_CMD_PGTX_GCFG,
  48. DCB_CMD_PGTX_SCFG,
  49. DCB_CMD_PGRX_GCFG,
  50. DCB_CMD_PGRX_SCFG,
  51. DCB_CMD_PFC_GCFG,
  52. DCB_CMD_PFC_SCFG,
  53. DCB_CMD_SET_ALL,
  54. DCB_CMD_GPERM_HWADDR,
  55. __DCB_CMD_ENUM_MAX,
  56. DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
  57. };
  58. /**
  59. * enum dcbnl_attrs - DCB top-level netlink attributes
  60. *
  61. * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
  62. * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
  63. * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
  64. * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
  65. * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
  66. * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
  67. * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
  68. * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
  69. * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
  70. */
  71. enum dcbnl_attrs {
  72. DCB_ATTR_UNDEFINED,
  73. DCB_ATTR_IFNAME,
  74. DCB_ATTR_STATE,
  75. DCB_ATTR_PFC_STATE,
  76. DCB_ATTR_PFC_CFG,
  77. DCB_ATTR_NUM_TC,
  78. DCB_ATTR_PG_CFG,
  79. DCB_ATTR_SET_ALL,
  80. DCB_ATTR_PERM_HWADDR,
  81. __DCB_ATTR_ENUM_MAX,
  82. DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
  83. };
  84. /**
  85. * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
  86. *
  87. * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
  88. * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
  89. * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
  90. * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
  91. * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
  92. * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
  93. * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
  94. * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
  95. * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
  96. * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
  97. * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
  98. *
  99. */
  100. enum dcbnl_pfc_up_attrs {
  101. DCB_PFC_UP_ATTR_UNDEFINED,
  102. DCB_PFC_UP_ATTR_0,
  103. DCB_PFC_UP_ATTR_1,
  104. DCB_PFC_UP_ATTR_2,
  105. DCB_PFC_UP_ATTR_3,
  106. DCB_PFC_UP_ATTR_4,
  107. DCB_PFC_UP_ATTR_5,
  108. DCB_PFC_UP_ATTR_6,
  109. DCB_PFC_UP_ATTR_7,
  110. DCB_PFC_UP_ATTR_ALL,
  111. __DCB_PFC_UP_ATTR_ENUM_MAX,
  112. DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
  113. };
  114. /**
  115. * enum dcbnl_pg_attrs - DCB Priority Group attributes
  116. *
  117. * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
  118. * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
  119. * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
  120. * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
  121. * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
  122. * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
  123. * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
  124. * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
  125. * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
  126. * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
  127. * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
  128. * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
  129. * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
  130. * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
  131. * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
  132. * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
  133. * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
  134. * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
  135. * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
  136. * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
  137. * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
  138. *
  139. */
  140. enum dcbnl_pg_attrs {
  141. DCB_PG_ATTR_UNDEFINED,
  142. DCB_PG_ATTR_TC_0,
  143. DCB_PG_ATTR_TC_1,
  144. DCB_PG_ATTR_TC_2,
  145. DCB_PG_ATTR_TC_3,
  146. DCB_PG_ATTR_TC_4,
  147. DCB_PG_ATTR_TC_5,
  148. DCB_PG_ATTR_TC_6,
  149. DCB_PG_ATTR_TC_7,
  150. DCB_PG_ATTR_TC_MAX,
  151. DCB_PG_ATTR_TC_ALL,
  152. DCB_PG_ATTR_BW_ID_0,
  153. DCB_PG_ATTR_BW_ID_1,
  154. DCB_PG_ATTR_BW_ID_2,
  155. DCB_PG_ATTR_BW_ID_3,
  156. DCB_PG_ATTR_BW_ID_4,
  157. DCB_PG_ATTR_BW_ID_5,
  158. DCB_PG_ATTR_BW_ID_6,
  159. DCB_PG_ATTR_BW_ID_7,
  160. DCB_PG_ATTR_BW_ID_MAX,
  161. DCB_PG_ATTR_BW_ID_ALL,
  162. __DCB_PG_ATTR_ENUM_MAX,
  163. DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
  164. };
  165. /**
  166. * enum dcbnl_tc_attrs - DCB Traffic Class attributes
  167. *
  168. * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
  169. * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
  170. * Valid values are: 0-7
  171. * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
  172. * Some devices may not support changing the
  173. * user priority map of a TC.
  174. * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
  175. * 0 - none
  176. * 1 - group strict
  177. * 2 - link strict
  178. * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
  179. * not configured to use link strict priority,
  180. * this is the percentage of bandwidth of the
  181. * priority group this traffic class belongs to
  182. * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
  183. *
  184. */
  185. enum dcbnl_tc_attrs {
  186. DCB_TC_ATTR_PARAM_UNDEFINED,
  187. DCB_TC_ATTR_PARAM_PGID,
  188. DCB_TC_ATTR_PARAM_UP_MAPPING,
  189. DCB_TC_ATTR_PARAM_STRICT_PRIO,
  190. DCB_TC_ATTR_PARAM_BW_PCT,
  191. DCB_TC_ATTR_PARAM_ALL,
  192. __DCB_TC_ATTR_PARAM_ENUM_MAX,
  193. DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
  194. };
  195. /**
  196. * enum dcb_general_attr_values - general DCB attribute values
  197. *
  198. * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
  199. *
  200. */
  201. enum dcb_general_attr_values {
  202. DCB_ATTR_VALUE_UNDEFINED = 0xff
  203. };
  204. #endif /* __LINUX_DCBNL_H__ */