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