aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 16c9858f7dcf..872d7aad810b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6374,38 +6374,40 @@ static inline int ixgbe_maybe_stop_tx(struct ixgbe_ring *tx_ring, u16 size)
6374 return __ixgbe_maybe_stop_tx(tx_ring, size); 6374 return __ixgbe_maybe_stop_tx(tx_ring, size);
6375} 6375}
6376 6376
6377#ifdef IXGBE_FCOE
6377static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb) 6378static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb)
6378{ 6379{
6379 struct ixgbe_adapter *adapter = netdev_priv(dev); 6380 struct ixgbe_adapter *adapter;
6380 int txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : 6381 struct ixgbe_ring_feature *f;
6381 smp_processor_id(); 6382 int txq;
6382#ifdef IXGBE_FCOE
6383 __be16 protocol = vlan_get_protocol(skb);
6384 6383
6385 if (((protocol == htons(ETH_P_FCOE)) || 6384 /*
6386 (protocol == htons(ETH_P_FIP))) && 6385 * only execute the code below if protocol is FCoE
6387 (adapter->flags & IXGBE_FLAG_FCOE_ENABLED)) { 6386 * or FIP and we have FCoE enabled on the adapter
6388 struct ixgbe_ring_feature *f; 6387 */
6388 switch (vlan_get_protocol(skb)) {
6389 case __constant_htons(ETH_P_FCOE):
6390 case __constant_htons(ETH_P_FIP):
6391 adapter = netdev_priv(dev);
6389 6392
6390 f = &adapter->ring_feature[RING_F_FCOE]; 6393 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED)
6394 break;
6395 default:
6396 return __netdev_pick_tx(dev, skb);
6397 }
6391 6398
6392 while (txq >= f->indices) 6399 f = &adapter->ring_feature[RING_F_FCOE];
6393 txq -= f->indices;
6394 txq += adapter->ring_feature[RING_F_FCOE].offset;
6395 6400
6396 return txq; 6401 txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) :
6397 } 6402 smp_processor_id();
6398#endif
6399 6403
6400 if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) { 6404 while (txq >= f->indices)
6401 while (unlikely(txq >= dev->real_num_tx_queues)) 6405 txq -= f->indices;
6402 txq -= dev->real_num_tx_queues;
6403 return txq;
6404 }
6405 6406
6406 return skb_tx_hash(dev, skb); 6407 return txq + f->offset;
6407} 6408}
6408 6409
6410#endif
6409netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, 6411netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
6410 struct ixgbe_adapter *adapter, 6412 struct ixgbe_adapter *adapter,
6411 struct ixgbe_ring *tx_ring) 6413 struct ixgbe_ring *tx_ring)
@@ -7129,7 +7131,9 @@ static const struct net_device_ops ixgbe_netdev_ops = {
7129 .ndo_open = ixgbe_open, 7131 .ndo_open = ixgbe_open,
7130 .ndo_stop = ixgbe_close, 7132 .ndo_stop = ixgbe_close,
7131 .ndo_start_xmit = ixgbe_xmit_frame, 7133 .ndo_start_xmit = ixgbe_xmit_frame,
7134#ifdef IXGBE_FCOE
7132 .ndo_select_queue = ixgbe_select_queue, 7135 .ndo_select_queue = ixgbe_select_queue,
7136#endif
7133 .ndo_set_rx_mode = ixgbe_set_rx_mode, 7137 .ndo_set_rx_mode = ixgbe_set_rx_mode,
7134 .ndo_validate_addr = eth_validate_addr, 7138 .ndo_validate_addr = eth_validate_addr,
7135 .ndo_set_mac_address = ixgbe_set_mac, 7139 .ndo_set_mac_address = ixgbe_set_mac,