Skip to content

Commit 2f90b86

Browse files
Alexander Duyckdavem330
authored andcommitted
ixgbe: this patch adds support for DCB to the kernel and ixgbe driver
This adds support for Data Center Bridging (DCB) features in the ixgbe driver and adds an rtnetlink interface for configuring DCB to the kernel. The DCB feature support included are Priority Grouping (PG) - which allows bandwidth guarantees to be allocated to groups to traffic based on the 802.1q priority, and Priority Based Flow Control (PFC) - which introduces a new MAC control PAUSE frame which works at granularity of the 802.1p priority instead of the link (IEEE 802.3x). Signed-off-by: Alexander Duyck <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> Signed-off-by: Peter P Waskiewicz Jr <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9db66bd commit 2f90b86

File tree

19 files changed

+2593
-19
lines changed

19 files changed

+2593
-19
lines changed

drivers/net/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,6 +2451,16 @@ config IXGBE_DCA
24512451
driver. DCA is a method for warming the CPU cache before data
24522452
is used, with the intent of lessening the impact of cache misses.
24532453

2454+
config IXGBE_DCBNL
2455+
bool "Data Center Bridging (DCB) Support"
2456+
default n
2457+
depends on IXGBE && DCBNL
2458+
---help---
2459+
Say Y here if you want to use Data Center Bridging (DCB) in the
2460+
driver.
2461+
2462+
If unsure, say N.
2463+
24542464
config IXGB
24552465
tristate "Intel(R) PRO/10GbE support"
24562466
depends on PCI

drivers/net/ixgbe/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ obj-$(CONFIG_IXGBE) += ixgbe.o
3434

3535
ixgbe-objs := ixgbe_main.o ixgbe_common.o ixgbe_ethtool.o \
3636
ixgbe_82598.o ixgbe_phy.o
37+
38+
ixgbe-$(CONFIG_IXGBE_DCBNL) += ixgbe_dcb.o ixgbe_dcb_82598.o ixgbe_dcb_nl.o

drivers/net/ixgbe/ixgbe.h

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
#include "ixgbe_type.h"
3737
#include "ixgbe_common.h"
38-
38+
#include "ixgbe_dcb.h"
3939
#ifdef CONFIG_IXGBE_DCA
4040
#include <linux/dca.h>
4141
#endif
@@ -84,6 +84,7 @@
8484
#define IXGBE_TX_FLAGS_TSO (u32)(1 << 2)
8585
#define IXGBE_TX_FLAGS_IPV4 (u32)(1 << 3)
8686
#define IXGBE_TX_FLAGS_VLAN_MASK 0xffff0000
87+
#define IXGBE_TX_FLAGS_VLAN_PRIO_MASK 0x0000e000
8788
#define IXGBE_TX_FLAGS_VLAN_SHIFT 16
8889

8990
#define IXGBE_MAX_LRO_DESCRIPTORS 8
@@ -134,7 +135,7 @@ struct ixgbe_ring {
134135

135136
u16 reg_idx; /* holds the special value that gets the hardware register
136137
* offset associated with this ring, which is different
137-
* for DCE and RSS modes */
138+
* for DCB and RSS modes */
138139

139140
#ifdef CONFIG_IXGBE_DCA
140141
/* cpu for tx queue */
@@ -152,8 +153,10 @@ struct ixgbe_ring {
152153
u16 rx_buf_len;
153154
};
154155

156+
#define RING_F_DCB 0
155157
#define RING_F_VMDQ 1
156158
#define RING_F_RSS 2
159+
#define IXGBE_MAX_DCB_INDICES 8
157160
#define IXGBE_MAX_RSS_INDICES 16
158161
#define IXGBE_MAX_VMDQ_INDICES 16
159162
struct ixgbe_ring_feature {
@@ -164,6 +167,10 @@ struct ixgbe_ring_feature {
164167
#define MAX_RX_QUEUES 64
165168
#define MAX_TX_QUEUES 32
166169

170+
#define MAX_RX_PACKET_BUFFERS ((adapter->flags & IXGBE_FLAG_DCB_ENABLED) \
171+
? 8 : 1)
172+
#define MAX_TX_PACKET_BUFFERS MAX_RX_PACKET_BUFFERS
173+
167174
/* MAX_MSIX_Q_VECTORS of these are allocated,
168175
* but we only use one per queue-specific vector.
169176
*/
@@ -215,6 +222,9 @@ struct ixgbe_adapter {
215222
struct work_struct reset_task;
216223
struct ixgbe_q_vector q_vector[MAX_MSIX_Q_VECTORS];
217224
char name[MAX_MSIX_COUNT][IFNAMSIZ + 5];
225+
struct ixgbe_dcb_config dcb_cfg;
226+
struct ixgbe_dcb_config temp_dcb_cfg;
227+
u8 dcb_set_bitmap;
218228

219229
/* Interrupt Throttle Rate */
220230
u32 itr_setting;
@@ -270,6 +280,7 @@ struct ixgbe_adapter {
270280
#define IXGBE_FLAG_FAN_FAIL_CAPABLE (u32)(1 << 20)
271281
#define IXGBE_FLAG_NEED_LINK_UPDATE (u32)(1 << 22)
272282
#define IXGBE_FLAG_IN_WATCHDOG_TASK (u32)(1 << 23)
283+
#define IXGBE_FLAG_DCB_ENABLED (u32)(1 << 24)
273284

274285
/* default to trying for four seconds */
275286
#define IXGBE_TRY_LINK_TIMEOUT (4 * HZ)
@@ -313,6 +324,12 @@ enum ixgbe_boards {
313324
};
314325

315326
extern struct ixgbe_info ixgbe_82598_info;
327+
#ifdef CONFIG_IXGBE_DCBNL
328+
extern struct dcbnl_rtnl_ops dcbnl_ops;
329+
extern int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *src_dcb_cfg,
330+
struct ixgbe_dcb_config *dst_dcb_cfg,
331+
int tc_max);
332+
#endif
316333

317334
extern char ixgbe_driver_name[];
318335
extern const char ixgbe_driver_version[];
@@ -327,5 +344,9 @@ extern int ixgbe_setup_tx_resources(struct ixgbe_adapter *, struct ixgbe_ring *)
327344
extern void ixgbe_free_rx_resources(struct ixgbe_adapter *, struct ixgbe_ring *);
328345
extern void ixgbe_free_tx_resources(struct ixgbe_adapter *, struct ixgbe_ring *);
329346
extern void ixgbe_update_stats(struct ixgbe_adapter *adapter);
347+
extern void ixgbe_reset_interrupt_capability(struct ixgbe_adapter *adapter);
348+
extern int ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter);
349+
void ixgbe_napi_add_all(struct ixgbe_adapter *adapter);
350+
void ixgbe_napi_del_all(struct ixgbe_adapter *adapter);
330351

331352
#endif /* _IXGBE_H_ */

0 commit comments

Comments
 (0)