Skip to content

Commit

Permalink
ixgbe: this patch adds support for DCB to the kernel and ixgbe driver
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Alexander Duyck authored and davem330 committed Nov 21, 2008
1 parent 9db66bd commit 2f90b86
Show file tree
Hide file tree
Showing 19 changed files with 2,593 additions and 19 deletions.
10 changes: 10 additions & 0 deletions drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2451,6 +2451,16 @@ config IXGBE_DCA
driver. DCA is a method for warming the CPU cache before data
is used, with the intent of lessening the impact of cache misses.

config IXGBE_DCBNL
bool "Data Center Bridging (DCB) Support"
default n
depends on IXGBE && DCBNL
---help---
Say Y here if you want to use Data Center Bridging (DCB) in the
driver.

If unsure, say N.

config IXGB
tristate "Intel(R) PRO/10GbE support"
depends on PCI
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ixgbe/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ obj-$(CONFIG_IXGBE) += ixgbe.o

ixgbe-objs := ixgbe_main.o ixgbe_common.o ixgbe_ethtool.o \
ixgbe_82598.o ixgbe_phy.o

ixgbe-$(CONFIG_IXGBE_DCBNL) += ixgbe_dcb.o ixgbe_dcb_82598.o ixgbe_dcb_nl.o
25 changes: 23 additions & 2 deletions drivers/net/ixgbe/ixgbe.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#include "ixgbe_type.h"
#include "ixgbe_common.h"

#include "ixgbe_dcb.h"
#ifdef CONFIG_IXGBE_DCA
#include <linux/dca.h>
#endif
Expand Down Expand Up @@ -84,6 +84,7 @@
#define IXGBE_TX_FLAGS_TSO (u32)(1 << 2)
#define IXGBE_TX_FLAGS_IPV4 (u32)(1 << 3)
#define IXGBE_TX_FLAGS_VLAN_MASK 0xffff0000
#define IXGBE_TX_FLAGS_VLAN_PRIO_MASK 0x0000e000
#define IXGBE_TX_FLAGS_VLAN_SHIFT 16

#define IXGBE_MAX_LRO_DESCRIPTORS 8
Expand Down Expand Up @@ -134,7 +135,7 @@ struct ixgbe_ring {

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

#ifdef CONFIG_IXGBE_DCA
/* cpu for tx queue */
Expand All @@ -152,8 +153,10 @@ struct ixgbe_ring {
u16 rx_buf_len;
};

#define RING_F_DCB 0
#define RING_F_VMDQ 1
#define RING_F_RSS 2
#define IXGBE_MAX_DCB_INDICES 8
#define IXGBE_MAX_RSS_INDICES 16
#define IXGBE_MAX_VMDQ_INDICES 16
struct ixgbe_ring_feature {
Expand All @@ -164,6 +167,10 @@ struct ixgbe_ring_feature {
#define MAX_RX_QUEUES 64
#define MAX_TX_QUEUES 32

#define MAX_RX_PACKET_BUFFERS ((adapter->flags & IXGBE_FLAG_DCB_ENABLED) \
? 8 : 1)
#define MAX_TX_PACKET_BUFFERS MAX_RX_PACKET_BUFFERS

/* MAX_MSIX_Q_VECTORS of these are allocated,
* but we only use one per queue-specific vector.
*/
Expand Down Expand Up @@ -215,6 +222,9 @@ struct ixgbe_adapter {
struct work_struct reset_task;
struct ixgbe_q_vector q_vector[MAX_MSIX_Q_VECTORS];
char name[MAX_MSIX_COUNT][IFNAMSIZ + 5];
struct ixgbe_dcb_config dcb_cfg;
struct ixgbe_dcb_config temp_dcb_cfg;
u8 dcb_set_bitmap;

/* Interrupt Throttle Rate */
u32 itr_setting;
Expand Down Expand Up @@ -270,6 +280,7 @@ struct ixgbe_adapter {
#define IXGBE_FLAG_FAN_FAIL_CAPABLE (u32)(1 << 20)
#define IXGBE_FLAG_NEED_LINK_UPDATE (u32)(1 << 22)
#define IXGBE_FLAG_IN_WATCHDOG_TASK (u32)(1 << 23)
#define IXGBE_FLAG_DCB_ENABLED (u32)(1 << 24)

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

extern struct ixgbe_info ixgbe_82598_info;
#ifdef CONFIG_IXGBE_DCBNL
extern struct dcbnl_rtnl_ops dcbnl_ops;
extern int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *src_dcb_cfg,
struct ixgbe_dcb_config *dst_dcb_cfg,
int tc_max);
#endif

extern char ixgbe_driver_name[];
extern const char ixgbe_driver_version[];
Expand All @@ -327,5 +344,9 @@ extern int ixgbe_setup_tx_resources(struct ixgbe_adapter *, struct ixgbe_ring *)
extern void ixgbe_free_rx_resources(struct ixgbe_adapter *, struct ixgbe_ring *);
extern void ixgbe_free_tx_resources(struct ixgbe_adapter *, struct ixgbe_ring *);
extern void ixgbe_update_stats(struct ixgbe_adapter *adapter);
extern void ixgbe_reset_interrupt_capability(struct ixgbe_adapter *adapter);
extern int ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter);
void ixgbe_napi_add_all(struct ixgbe_adapter *adapter);
void ixgbe_napi_del_all(struct ixgbe_adapter *adapter);

#endif /* _IXGBE_H_ */
Loading

0 comments on commit 2f90b86

Please sign in to comment.