aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40e/i40e_dcb.h
diff options
context:
space:
mode:
authorNeerav Parikh <Neerav.Parikh@intel.com>2014-01-17 18:36:36 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-17 22:13:04 -0500
commitafb3ff0da4f5603fe9f2ef1654b55700407a7a5d (patch)
tree8e369d613ce7dc11c637ff8a31e21fe017d58534 /drivers/net/ethernet/intel/i40e/i40e_dcb.h
parentcbf613252496ed00f8669328bbd94296a03bcc79 (diff)
i40e: implement DCB support infastructure
Intel XL710 series of adapters support QoS as per the IEEE 802.1 DCB (Data Center Bridging) standard. This is supported in conjuction with: - Enhanced Transmission Selection (ETS) - IEEE 802.1Qaz - Priority Flow Control (PFC) - IEEE 802.1Qbb - DCB eXchange Protocol (DCBX) - IEEE 802.1Qaz On Intel XL710 adapters DCBX is performed by the adapter firmware. The firmware runs DCBX in willing mode and configures the port as per the DCB settings recommended by it's link partner. By default in absence of any DCBX; firmware would configure the port with a single traffic class and all of the port bandwith will be allocated to that traffic class. This patch adds functions and calls to support querying and configuring DCB using firmware APIs. Signed-off-by: Neerav Parikh <Neerav.Parikh@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-By: Jack Morgan<jack.morgan@intel.com> Signed-off-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/i40e/i40e_dcb.h')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_dcb.h107
1 files changed, 107 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_dcb.h b/drivers/net/ethernet/intel/i40e/i40e_dcb.h
new file mode 100644
index 000000000000..34cf1c30c7ff
--- /dev/null
+++ b/drivers/net/ethernet/intel/i40e/i40e_dcb.h
@@ -0,0 +1,107 @@
1/*******************************************************************************
2 *
3 * Intel Ethernet Controller XL710 Family Linux Driver
4 * Copyright(c) 2013 - 2014 Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * The full GNU General Public License is included in this distribution in
19 * the file called "COPYING".
20 *
21 * Contact Information:
22 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 *
25 ******************************************************************************/
26
27#ifndef _I40E_DCB_H_
28#define _I40E_DCB_H_
29
30#include "i40e_type.h"
31
32#define I40E_DCBX_STATUS_NOT_STARTED 0
33#define I40E_DCBX_STATUS_IN_PROGRESS 1
34#define I40E_DCBX_STATUS_DONE 2
35#define I40E_DCBX_STATUS_MULTIPLE_PEERS 3
36#define I40E_DCBX_STATUS_DISABLED 7
37
38#define I40E_TLV_TYPE_END 0
39#define I40E_TLV_TYPE_ORG 127
40
41#define I40E_IEEE_8021QAZ_OUI 0x0080C2
42#define I40E_IEEE_SUBTYPE_ETS_CFG 9
43#define I40E_IEEE_SUBTYPE_ETS_REC 10
44#define I40E_IEEE_SUBTYPE_PFC_CFG 11
45#define I40E_IEEE_SUBTYPE_APP_PRI 12
46
47/* Defines for LLDP TLV header */
48#define I40E_LLDP_TLV_LEN_SHIFT 0
49#define I40E_LLDP_TLV_LEN_MASK (0x01FF << I40E_LLDP_TLV_LEN_SHIFT)
50#define I40E_LLDP_TLV_TYPE_SHIFT 9
51#define I40E_LLDP_TLV_TYPE_MASK (0x7F << I40E_LLDP_TLV_TYPE_SHIFT)
52#define I40E_LLDP_TLV_SUBTYPE_SHIFT 0
53#define I40E_LLDP_TLV_SUBTYPE_MASK (0xFF << I40E_LLDP_TLV_SUBTYPE_SHIFT)
54#define I40E_LLDP_TLV_OUI_SHIFT 8
55#define I40E_LLDP_TLV_OUI_MASK (0xFFFFFF << I40E_LLDP_TLV_OUI_SHIFT)
56
57/* Defines for IEEE ETS TLV */
58#define I40E_IEEE_ETS_MAXTC_SHIFT 0
59#define I40E_IEEE_ETS_MAXTC_MASK (0x7 << I40E_IEEE_ETS_MAXTC_SHIFT)
60#define I40E_IEEE_ETS_CBS_SHIFT 6
61#define I40E_IEEE_ETS_CBS_MASK (0x1 << I40E_IEEE_ETS_CBS_SHIFT)
62#define I40E_IEEE_ETS_WILLING_SHIFT 7
63#define I40E_IEEE_ETS_WILLING_MASK (0x1 << I40E_IEEE_ETS_WILLING_SHIFT)
64#define I40E_IEEE_ETS_PRIO_0_SHIFT 0
65#define I40E_IEEE_ETS_PRIO_0_MASK (0x7 << I40E_IEEE_ETS_PRIO_0_SHIFT)
66#define I40E_IEEE_ETS_PRIO_1_SHIFT 4
67#define I40E_IEEE_ETS_PRIO_1_MASK (0x7 << I40E_IEEE_ETS_PRIO_1_SHIFT)
68
69/* Defines for IEEE TSA types */
70#define I40E_IEEE_TSA_STRICT 0
71#define I40E_IEEE_TSA_ETS 2
72
73/* Defines for IEEE PFC TLV */
74#define I40E_IEEE_PFC_CAP_SHIFT 0
75#define I40E_IEEE_PFC_CAP_MASK (0xF << I40E_IEEE_PFC_CAP_SHIFT)
76#define I40E_IEEE_PFC_MBC_SHIFT 6
77#define I40E_IEEE_PFC_MBC_MASK (0x1 << I40E_IEEE_PFC_MBC_SHIFT)
78#define I40E_IEEE_PFC_WILLING_SHIFT 7
79#define I40E_IEEE_PFC_WILLING_MASK (0x1 << I40E_IEEE_PFC_WILLING_SHIFT)
80
81/* Defines for IEEE APP TLV */
82#define I40E_IEEE_APP_SEL_SHIFT 0
83#define I40E_IEEE_APP_SEL_MASK (0x7 << I40E_IEEE_APP_SEL_SHIFT)
84#define I40E_IEEE_APP_PRIO_SHIFT 5
85#define I40E_IEEE_APP_PRIO_MASK (0x7 << I40E_IEEE_APP_PRIO_SHIFT)
86
87
88#pragma pack(1)
89
90/* IEEE 802.1AB LLDP Organization specific TLV */
91struct i40e_lldp_org_tlv {
92 __be16 typelength;
93 __be32 ouisubtype;
94 u8 tlvinfo[1];
95};
96#pragma pack()
97
98i40e_status i40e_get_dcbx_status(struct i40e_hw *hw,
99 u16 *status);
100i40e_status i40e_lldp_to_dcb_config(u8 *lldpmib,
101 struct i40e_dcbx_config *dcbcfg);
102i40e_status i40e_aq_get_dcb_config(struct i40e_hw *hw, u8 mib_type,
103 u8 bridgetype,
104 struct i40e_dcbx_config *dcbcfg);
105i40e_status i40e_get_dcb_config(struct i40e_hw *hw);
106i40e_status i40e_init_dcb(struct i40e_hw *hw);
107#endif /* _I40E_DCB_H_ */