diff options
author | Yi Zou <yi.zou@intel.com> | 2009-07-22 10:07:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-23 14:05:30 -0400 |
commit | 0d5515894fd5b9e9402ef76e9a7e704fd26e0e5f (patch) | |
tree | 19a4a2f9ae90409fb1547be120e84ad13dde3bf0 /drivers | |
parent | dacac4da5290ee3f3f413bd6980af2befb813e28 (diff) |
ixgbe: Enable FCoE offload when DCB is enabled for 82599
Currently, FCoE offload feature is turned on when the kernel config has
CONFIG_FCOE or CONFIG_FCOE_MODULE set. However, we really want to turn
FCoE offload on when there is FCoE traffic passing and turn it off when
it's just LAN traffic. Since FCoE depends on a lossless network provided
by DCB, this allows us to have FCoE turned on/off when user turns on DCB
using dcbtool.
Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ixgbe/ixgbe.h | 1 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_dcb_nl.c | 24 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 16 |
3 files changed, 31 insertions, 10 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index cd22323cfd22..1b12c7ba275f 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h | |||
@@ -327,6 +327,7 @@ struct ixgbe_adapter { | |||
327 | #define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 25) | 327 | #define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 25) |
328 | #define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 26) | 328 | #define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 26) |
329 | #define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 27) | 329 | #define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 27) |
330 | #define IXGBE_FLAG_FCOE_CAPABLE (u32)(1 << 28) | ||
330 | #define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 29) | 331 | #define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 29) |
331 | 332 | ||
332 | u32 flags2; | 333 | u32 flags2; |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c index da2c8514b8d0..1c7265732900 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c | |||
@@ -139,6 +139,18 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) | |||
139 | adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE; | 139 | adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE; |
140 | } | 140 | } |
141 | adapter->flags |= IXGBE_FLAG_DCB_ENABLED; | 141 | adapter->flags |= IXGBE_FLAG_DCB_ENABLED; |
142 | #ifdef IXGBE_FCOE | ||
143 | /* Turn on FCoE offload */ | ||
144 | if ((adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) && | ||
145 | (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED))) { | ||
146 | adapter->flags |= IXGBE_FLAG_FCOE_ENABLED; | ||
147 | adapter->ring_feature[RING_F_FCOE].indices = | ||
148 | IXGBE_FCRETA_SIZE; | ||
149 | netdev->features |= NETIF_F_FCOE_CRC; | ||
150 | netdev->features |= NETIF_F_FSO; | ||
151 | netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; | ||
152 | } | ||
153 | #endif /* IXGBE_FCOE */ | ||
142 | ixgbe_init_interrupt_scheme(adapter); | 154 | ixgbe_init_interrupt_scheme(adapter); |
143 | if (netif_running(netdev)) | 155 | if (netif_running(netdev)) |
144 | netdev->netdev_ops->ndo_open(netdev); | 156 | netdev->netdev_ops->ndo_open(netdev); |
@@ -156,6 +168,18 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) | |||
156 | adapter->flags |= IXGBE_FLAG_RSS_ENABLED; | 168 | adapter->flags |= IXGBE_FLAG_RSS_ENABLED; |
157 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) | 169 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) |
158 | adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; | 170 | adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; |
171 | |||
172 | #ifdef IXGBE_FCOE | ||
173 | /* Turn off FCoE offload */ | ||
174 | if (adapter->flags & (IXGBE_FLAG_FCOE_CAPABLE | | ||
175 | IXGBE_FLAG_FCOE_ENABLED)) { | ||
176 | adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; | ||
177 | adapter->ring_feature[RING_F_FCOE].indices = 0; | ||
178 | netdev->features &= ~NETIF_F_FCOE_CRC; | ||
179 | netdev->features &= ~NETIF_F_FSO; | ||
180 | netdev->fcoe_ddp_xid = 0; | ||
181 | } | ||
182 | #endif /* IXGBE_FCOE */ | ||
159 | ixgbe_init_interrupt_scheme(adapter); | 183 | ixgbe_init_interrupt_scheme(adapter); |
160 | if (netif_running(netdev)) | 184 | if (netif_running(netdev)) |
161 | netdev->netdev_ops->ndo_open(netdev); | 185 | netdev->netdev_ops->ndo_open(netdev); |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index e3442f47f932..a2119d79ccdd 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -3806,8 +3806,9 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter) | |||
3806 | adapter->atr_sample_rate = 20; | 3806 | adapter->atr_sample_rate = 20; |
3807 | adapter->fdir_pballoc = 0; | 3807 | adapter->fdir_pballoc = 0; |
3808 | #ifdef IXGBE_FCOE | 3808 | #ifdef IXGBE_FCOE |
3809 | adapter->flags |= IXGBE_FLAG_FCOE_ENABLED; | 3809 | adapter->flags |= IXGBE_FLAG_FCOE_CAPABLE; |
3810 | adapter->ring_feature[RING_F_FCOE].indices = IXGBE_FCRETA_SIZE; | 3810 | adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; |
3811 | adapter->ring_feature[RING_F_FCOE].indices = 0; | ||
3811 | #endif /* IXGBE_FCOE */ | 3812 | #endif /* IXGBE_FCOE */ |
3812 | } | 3813 | } |
3813 | 3814 | ||
@@ -5580,16 +5581,11 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
5580 | #endif | 5581 | #endif |
5581 | 5582 | ||
5582 | #ifdef IXGBE_FCOE | 5583 | #ifdef IXGBE_FCOE |
5583 | if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { | 5584 | if (adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) { |
5584 | if (hw->mac.ops.get_device_caps) { | 5585 | if (hw->mac.ops.get_device_caps) { |
5585 | hw->mac.ops.get_device_caps(hw, &device_caps); | 5586 | hw->mac.ops.get_device_caps(hw, &device_caps); |
5586 | if (!(device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS)) { | 5587 | if (device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS) |
5587 | netdev->features |= NETIF_F_FCOE_CRC; | 5588 | adapter->flags &= ~IXGBE_FLAG_FCOE_CAPABLE; |
5588 | netdev->features |= NETIF_F_FSO; | ||
5589 | netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; | ||
5590 | } else { | ||
5591 | adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; | ||
5592 | } | ||
5593 | } | 5589 | } |
5594 | } | 5590 | } |
5595 | #endif /* IXGBE_FCOE */ | 5591 | #endif /* IXGBE_FCOE */ |