aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2010-12-30 04:25:46 -0500
committerDavid S. Miller <davem@davemloft.net>2010-12-31 13:47:45 -0500
commit3e29027af43728c2a91fe3f735ab2822edaf54a8 (patch)
treefb453671722596b9dcb1af4171bdcfa17cd48d61 /include/linux
parenta7dd6027e55992dd7c409a71a4a2b576fda2f7c2 (diff)
dcbnl: add support for ieee8021Qaz attributes
The IEEE8021Qaz is the IEEE standard version of CEE. The standard has had enough significant changes from the CEE version that many of the CEE attributes have no meaning in the new spec or do not easily map to IEEE standards. Rather then attempt to create a complicated mapping between CEE and IEEE standards this patch adds a nested IEEE attribute to the list of DCB attributes. The policy is, [DCB_ATTR_IFNAME] [DCB_ATTR_STATE] ... [DCB_ATTR_IEEE] [DCB_ATTR_IEEE_ETS] [DCB_ATTR_IEEE_PFC] [DCB_ATTR_IEEE_APP_TABLE] [DCB_ATTR_IEEE_APP] ... The following dcbnl_rtnl_ops routines were added to handle the IEEE standard, int (*ieee_getets) (struct net_device *, struct ieee_ets *); int (*ieee_setets) (struct net_device *, struct ieee_ets *); int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *); int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *); int (*ieee_getapp) (struct net_device *, struct dcb_app *); int (*ieee_setapp) (struct net_device *, struct dcb_app *); Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dcbnl.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index 8723491f7dfd..287b5618e296 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -22,6 +22,87 @@
22 22
23#include <linux/types.h> 23#include <linux/types.h>
24 24
25/* IEEE 802.1Qaz std supported values */
26#define IEEE_8021QAZ_MAX_TCS 8
27
28/* This structure contains the IEEE 802.1Qaz ETS managed object
29 *
30 * @willing: willing bit in ETS configuratin TLV
31 * @ets_cap: indicates supported capacity of ets feature
32 * @cbs: credit based shaper ets algorithm supported
33 * @tc_tx_bw: tc tx bandwidth indexed by traffic class
34 * @tc_rx_bw: tc rx bandwidth indexed by traffic class
35 * @tc_tsa: TSA Assignment table, indexed by traffic class
36 * @prio_tc: priority assignment table mapping 8021Qp to traffic class
37 * @tc_reco_bw: recommended tc bandwidth indexed by traffic class for TLV
38 * @tc_reco_tsa: recommended tc bandwidth indexed by traffic class for TLV
39 * @reco_prio_tc: recommended tc tx bandwidth indexed by traffic class for TLV
40 *
41 * Recommended values are used to set fields in the ETS recommendation TLV
42 * with hardware offloaded LLDP.
43 *
44 * ----
45 * TSA Assignment 8 bit identifiers
46 * 0 strict priority
47 * 1 credit-based shaper
48 * 2 enhanced transmission selection
49 * 3-254 reserved
50 * 255 vendor specific
51 */
52struct 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
65/* This structure contains the IEEE 802.1Qaz PFC managed object
66 *
67 * @pfc_cap: Indicates the number of traffic classes on the local device
68 * that may simultaneously have PFC enabled.
69 * @pfc_en: bitmap indicating pfc enabled traffic classes
70 * @mbc: enable macsec bypass capability
71 * @delay: the allowance made for a round-trip propagation delay of the
72 * link in bits.
73 * @requests: count of the sent pfc frames
74 * @indications: count of the received pfc frames
75 */
76struct ieee_pfc {
77 __u8 pfc_cap;
78 __u8 pfc_en;
79 __u8 mbc;
80 __u16 delay;
81 __u64 requests[IEEE_8021QAZ_MAX_TCS];
82 __u64 indications[IEEE_8021QAZ_MAX_TCS];
83};
84
85/* This structure contains the IEEE 802.1Qaz APP managed object
86 *
87 * @selector: protocol identifier type
88 * @protocol: protocol of type indicated
89 * @priority: 3-bit unsigned integer indicating priority
90 *
91 * ----
92 * Selector field values
93 * 0 Reserved
94 * 1 Ethertype
95 * 2 Well known port number over TCP or SCTP
96 * 3 Well known port number over UDP or DCCP
97 * 4 Well known port number over TCP, SCTP, UDP, or DCCP
98 * 5-7 Reserved
99 */
100struct dcb_app {
101 __u8 selector;
102 __u32 protocol;
103 __u8 priority;
104};
105
25struct dcbmsg { 106struct dcbmsg {
26 __u8 dcb_family; 107 __u8 dcb_family;
27 __u8 cmd; 108 __u8 cmd;
@@ -50,6 +131,8 @@ struct dcbmsg {
50 * @DCB_CMD_SBCN: get backward congestion notification configration. 131 * @DCB_CMD_SBCN: get backward congestion notification configration.
51 * @DCB_CMD_GAPP: get application protocol configuration 132 * @DCB_CMD_GAPP: get application protocol configuration
52 * @DCB_CMD_SAPP: set application protocol configuration 133 * @DCB_CMD_SAPP: set application protocol configuration
134 * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
135 * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
53 */ 136 */
54enum dcbnl_commands { 137enum dcbnl_commands {
55 DCB_CMD_UNDEFINED, 138 DCB_CMD_UNDEFINED,
@@ -83,6 +166,9 @@ enum dcbnl_commands {
83 DCB_CMD_GAPP, 166 DCB_CMD_GAPP,
84 DCB_CMD_SAPP, 167 DCB_CMD_SAPP,
85 168
169 DCB_CMD_IEEE_SET,
170 DCB_CMD_IEEE_GET,
171
86 __DCB_CMD_ENUM_MAX, 172 __DCB_CMD_ENUM_MAX,
87 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, 173 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
88}; 174};
@@ -102,6 +188,7 @@ enum dcbnl_commands {
102 * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED) 188 * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
103 * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED) 189 * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
104 * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED) 190 * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
191 * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
105 */ 192 */
106enum dcbnl_attrs { 193enum dcbnl_attrs {
107 DCB_ATTR_UNDEFINED, 194 DCB_ATTR_UNDEFINED,
@@ -119,10 +206,29 @@ enum dcbnl_attrs {
119 DCB_ATTR_BCN, 206 DCB_ATTR_BCN,
120 DCB_ATTR_APP, 207 DCB_ATTR_APP,
121 208
209 /* IEEE std attributes */
210 DCB_ATTR_IEEE,
211
122 __DCB_ATTR_ENUM_MAX, 212 __DCB_ATTR_ENUM_MAX,
123 DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1, 213 DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
124}; 214};
125 215
216enum ieee_attrs {
217 DCB_ATTR_IEEE_UNSPEC,
218 DCB_ATTR_IEEE_ETS,
219 DCB_ATTR_IEEE_PFC,
220 DCB_ATTR_IEEE_APP_TABLE,
221 __DCB_ATTR_IEEE_MAX
222};
223#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
224
225enum ieee_attrs_app {
226 DCB_ATTR_IEEE_APP_UNSPEC,
227 DCB_ATTR_IEEE_APP,
228 __DCB_ATTR_IEEE_APP_MAX
229};
230#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
231
126/** 232/**
127 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs 233 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
128 * 234 *