aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_main.c
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2010-07-26 16:41:31 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-27 16:18:13 -0400
commit56075a98dfb887981ee0e4b6a768cd53f2514f4c (patch)
tree09bf8cfad0eba47672f42968a710e45c7c2254be /drivers/net/ixgbe/ixgbe_main.c
parentfeb8f47809fcc60250d28a6ddabc0ddbe9360d7c (diff)
ixgbe: priority tagging FCoE frames without FCoE offload
The DCB user priority for FCoE is available regardless of whether FCoE offload is enabled (IXGBE_FLAG_FCOE_ENABLED bit is set). This allows proper DCB user priority tagging for FCoE traffic on both 82598 and 82599 devices. Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Ross Brattain <ross.b.brattain@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/net/ixgbe/ixgbe_main.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 920375951454..bc22ab4336be 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -4783,6 +4783,7 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
4783#ifdef CONFIG_IXGBE_DCB 4783#ifdef CONFIG_IXGBE_DCB
4784 /* Default traffic class to use for FCoE */ 4784 /* Default traffic class to use for FCoE */
4785 adapter->fcoe.tc = IXGBE_FCOE_DEFTC; 4785 adapter->fcoe.tc = IXGBE_FCOE_DEFTC;
4786 adapter->fcoe.up = IXGBE_FCOE_DEFTC;
4786#endif 4787#endif
4787#endif /* IXGBE_FCOE */ 4788#endif /* IXGBE_FCOE */
4788 } 4789 }
@@ -6147,21 +6148,26 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb)
6147 struct ixgbe_adapter *adapter = netdev_priv(dev); 6148 struct ixgbe_adapter *adapter = netdev_priv(dev);
6148 int txq = smp_processor_id(); 6149 int txq = smp_processor_id();
6149 6150
6151#ifdef IXGBE_FCOE
6152 if ((skb->protocol == htons(ETH_P_FCOE)) ||
6153 (skb->protocol == htons(ETH_P_FIP))) {
6154 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) {
6155 txq &= (adapter->ring_feature[RING_F_FCOE].indices - 1);
6156 txq += adapter->ring_feature[RING_F_FCOE].mask;
6157 return txq;
6158 } else if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
6159 txq = adapter->fcoe.up;
6160 return txq;
6161 }
6162 }
6163#endif
6164
6150 if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) { 6165 if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) {
6151 while (unlikely(txq >= dev->real_num_tx_queues)) 6166 while (unlikely(txq >= dev->real_num_tx_queues))
6152 txq -= dev->real_num_tx_queues; 6167 txq -= dev->real_num_tx_queues;
6153 return txq; 6168 return txq;
6154 } 6169 }
6155 6170
6156#ifdef IXGBE_FCOE
6157 if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) &&
6158 ((skb->protocol == htons(ETH_P_FCOE)) ||
6159 (skb->protocol == htons(ETH_P_FIP)))) {
6160 txq &= (adapter->ring_feature[RING_F_FCOE].indices - 1);
6161 txq += adapter->ring_feature[RING_F_FCOE].mask;
6162 return txq;
6163 }
6164#endif
6165 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 6171 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
6166 if (skb->priority == TC_PRIO_CONTROL) 6172 if (skb->priority == TC_PRIO_CONTROL)
6167 txq = adapter->ring_feature[RING_F_DCB].indices-1; 6173 txq = adapter->ring_feature[RING_F_DCB].indices-1;
@@ -6205,18 +6211,15 @@ static netdev_tx_t ixgbe_xmit_frame(struct sk_buff *skb,
6205 tx_ring = adapter->tx_ring[skb->queue_mapping]; 6211 tx_ring = adapter->tx_ring[skb->queue_mapping];
6206 6212
6207#ifdef IXGBE_FCOE 6213#ifdef IXGBE_FCOE
6208 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { 6214 /* for FCoE with DCB, we force the priority to what
6209#ifdef CONFIG_IXGBE_DCB 6215 * was specified by the switch */
6210 /* for FCoE with DCB, we force the priority to what 6216 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED &&
6211 * was specified by the switch */ 6217 (skb->protocol == htons(ETH_P_FCOE) ||
6212 if ((skb->protocol == htons(ETH_P_FCOE)) || 6218 skb->protocol == htons(ETH_P_FIP))) {
6213 (skb->protocol == htons(ETH_P_FIP))) { 6219 tx_flags &= ~(IXGBE_TX_FLAGS_VLAN_PRIO_MASK
6214 tx_flags &= ~(IXGBE_TX_FLAGS_VLAN_PRIO_MASK 6220 << IXGBE_TX_FLAGS_VLAN_SHIFT);
6215 << IXGBE_TX_FLAGS_VLAN_SHIFT); 6221 tx_flags |= ((adapter->fcoe.up << 13)
6216 tx_flags |= ((adapter->fcoe.up << 13) 6222 << IXGBE_TX_FLAGS_VLAN_SHIFT);
6217 << IXGBE_TX_FLAGS_VLAN_SHIFT);
6218 }
6219#endif
6220 /* flag for FCoE offloads */ 6223 /* flag for FCoE offloads */
6221 if (skb->protocol == htons(ETH_P_FCOE)) 6224 if (skb->protocol == htons(ETH_P_FCOE))
6222 tx_flags |= IXGBE_TX_FLAGS_FCOE; 6225 tx_flags |= IXGBE_TX_FLAGS_FCOE;