aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zou <yi.zou@intel.com>2009-07-08 22:29:50 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-09 20:16:05 -0400
commit8faa2a786a5337683109d77ccf880339fdcdb332 (patch)
tree1f4653830fc4473967c3520b7359900a2d122818
parentad46276952f1af34cd91d46d49ba13d347d56367 (diff)
ixgbe: Fix coexistence of FCoE and Flow Director in 82599
Fix coexistence of Fiber Channel over Ethernet (FCoE) and Flow Director (FDIR) in 82599 and remove the disabling of FDIR when FCoE is enabled. Currently, FDIR is turned off when FCoE is enabled under the assumption that FCoE is always enabled with DCB being turned on. However, FDIR does not have to be turned off all the time when FCoE is enabled since FCoE can be enabled without DCB being turned on, e.g., use link pause only. This patch makes sure that when DCB is turned on or off, FDIR is turned on or off correspondingly; and when FCoE is enabled, it does not disable FDIR, rather, it will have FDIR set up properly so FCoE and FDIR can coexist regardless of DCB being on or off. Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_nl.c6
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c19
2 files changed, 17 insertions, 8 deletions
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index d56890f5c9d5..7c5978ad929a 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -138,6 +138,10 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
138 adapter->hw.fc.requested_mode = ixgbe_fc_none; 138 adapter->hw.fc.requested_mode = ixgbe_fc_none;
139 } 139 }
140 adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED; 140 adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED;
141 if (adapter->hw.mac.type == ixgbe_mac_82599EB) {
142 adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE;
143 adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
144 }
141 adapter->flags |= IXGBE_FLAG_DCB_ENABLED; 145 adapter->flags |= IXGBE_FLAG_DCB_ENABLED;
142 ixgbe_init_interrupt_scheme(adapter); 146 ixgbe_init_interrupt_scheme(adapter);
143 if (netif_running(netdev)) 147 if (netif_running(netdev))
@@ -154,6 +158,8 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
154 adapter->dcb_cfg.pfc_mode_enable = false; 158 adapter->dcb_cfg.pfc_mode_enable = false;
155 adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; 159 adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED;
156 adapter->flags |= IXGBE_FLAG_RSS_ENABLED; 160 adapter->flags |= IXGBE_FLAG_RSS_ENABLED;
161 if (adapter->hw.mac.type == ixgbe_mac_82599EB)
162 adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
157 ixgbe_init_interrupt_scheme(adapter); 163 ixgbe_init_interrupt_scheme(adapter);
158 if (netif_running(netdev)) 164 if (netif_running(netdev))
159 netdev->netdev_ops->ndo_open(netdev); 165 netdev->netdev_ops->ndo_open(netdev);
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index a3061aacffd8..e3442f47f932 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3130,7 +3130,11 @@ static inline bool ixgbe_set_fcoe_queues(struct ixgbe_adapter *adapter)
3130#endif 3130#endif
3131 if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { 3131 if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) {
3132 DPRINTK(PROBE, INFO, "FCOE enabled with RSS \n"); 3132 DPRINTK(PROBE, INFO, "FCOE enabled with RSS \n");
3133 ixgbe_set_rss_queues(adapter); 3133 if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) ||
3134 (adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE))
3135 ixgbe_set_fdir_queues(adapter);
3136 else
3137 ixgbe_set_rss_queues(adapter);
3134 } 3138 }
3135 /* adding FCoE rx rings to the end */ 3139 /* adding FCoE rx rings to the end */
3136 f->mask = adapter->num_rx_queues; 3140 f->mask = adapter->num_rx_queues;
@@ -3388,7 +3392,12 @@ static inline bool ixgbe_cache_ring_fcoe(struct ixgbe_adapter *adapter)
3388 } 3392 }
3389#endif /* CONFIG_IXGBE_DCB */ 3393#endif /* CONFIG_IXGBE_DCB */
3390 if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { 3394 if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) {
3391 ixgbe_cache_ring_rss(adapter); 3395 if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) ||
3396 (adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE))
3397 ixgbe_cache_ring_fdir(adapter);
3398 else
3399 ixgbe_cache_ring_rss(adapter);
3400
3392 fcoe_i = f->mask; 3401 fcoe_i = f->mask;
3393 } 3402 }
3394 for (i = 0; i < f->indices; i++, fcoe_i++) 3403 for (i = 0; i < f->indices; i++, fcoe_i++)
@@ -5578,12 +5587,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
5578 netdev->features |= NETIF_F_FCOE_CRC; 5587 netdev->features |= NETIF_F_FCOE_CRC;
5579 netdev->features |= NETIF_F_FSO; 5588 netdev->features |= NETIF_F_FSO;
5580 netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; 5589 netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1;
5581 DPRINTK(DRV, INFO, "FCoE enabled, "
5582 "disabling Flow Director\n");
5583 adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE;
5584 adapter->flags &=
5585 ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
5586 adapter->atr_sample_rate = 0;
5587 } else { 5590 } else {
5588 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; 5591 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
5589 } 5592 }