netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Alexander Duyck <alexander.h.duyck@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 07/15] ixgbe: Update ixgbe driver to use __netdev_pick_tx in ixgbe_select_queue
Date: Sat, 16 Feb 2013 00:33:28 -0800	[thread overview]
Message-ID: <1361003616-3422-8-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1361003616-3422-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Alexander Duyck <alexander.h.duyck@intel.com>

This change updates the ixgbe driver to use __netdev_pick_tx instead of
the current logic it is using to select a queue.  The main result of this
change is that ixgbe can now fully support XPS, and in the case of non-FCoE
enabled configs it means we don't need to have our own ndo_select_queue.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Reviewed-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 48 +++++++++++++++------------
 1 file 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 16c9858..872d7aa 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)
 	return __ixgbe_maybe_stop_tx(tx_ring, size);
 }
 
+#ifdef IXGBE_FCOE
 static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb)
 {
-	struct ixgbe_adapter *adapter = netdev_priv(dev);
-	int txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) :
-					       smp_processor_id();
-#ifdef IXGBE_FCOE
-	__be16 protocol = vlan_get_protocol(skb);
+	struct ixgbe_adapter *adapter;
+	struct ixgbe_ring_feature *f;
+	int txq;
 
-	if (((protocol == htons(ETH_P_FCOE)) ||
-	    (protocol == htons(ETH_P_FIP))) &&
-	    (adapter->flags & IXGBE_FLAG_FCOE_ENABLED)) {
-		struct ixgbe_ring_feature *f;
+	/*
+	 * only execute the code below if protocol is FCoE
+	 * or FIP and we have FCoE enabled on the adapter
+	 */
+	switch (vlan_get_protocol(skb)) {
+	case __constant_htons(ETH_P_FCOE):
+	case __constant_htons(ETH_P_FIP):
+		adapter = netdev_priv(dev);
 
-		f = &adapter->ring_feature[RING_F_FCOE];
+		if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED)
+			break;
+	default:
+		return __netdev_pick_tx(dev, skb);
+	}
 
-		while (txq >= f->indices)
-			txq -= f->indices;
-		txq += adapter->ring_feature[RING_F_FCOE].offset;
+	f = &adapter->ring_feature[RING_F_FCOE];
 
-		return txq;
-	}
-#endif
+	txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) :
+					   smp_processor_id();
 
-	if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) {
-		while (unlikely(txq >= dev->real_num_tx_queues))
-			txq -= dev->real_num_tx_queues;
-		return txq;
-	}
+	while (txq >= f->indices)
+		txq -= f->indices;
 
-	return skb_tx_hash(dev, skb);
+	return txq + f->offset;
 }
 
+#endif
 netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
 			  struct ixgbe_adapter *adapter,
 			  struct ixgbe_ring *tx_ring)
@@ -7129,7 +7131,9 @@ static const struct net_device_ops ixgbe_netdev_ops = {
 	.ndo_open		= ixgbe_open,
 	.ndo_stop		= ixgbe_close,
 	.ndo_start_xmit		= ixgbe_xmit_frame,
+#ifdef IXGBE_FCOE
 	.ndo_select_queue	= ixgbe_select_queue,
+#endif
 	.ndo_set_rx_mode	= ixgbe_set_rx_mode,
 	.ndo_validate_addr	= eth_validate_addr,
 	.ndo_set_mac_address	= ixgbe_set_mac,
-- 
1.7.11.7

  parent reply	other threads:[~2013-02-16  8:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-16  8:33 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2013.02.16 Jeff Kirsher
2013-02-16  8:33 ` [net-next 01/15] e1000: fix whitespace issues and multi-line comments Jeff Kirsher
2013-02-16  8:33 ` [net-next 02/15] e1000e: display a warning message when SmartSpeed works Jeff Kirsher
2013-02-16  8:33 ` [net-next 03/15] igbvf: Make next_to_watch a pointer and adjust memory barriers to avoid races Jeff Kirsher
2013-02-16  8:33 ` [net-next 04/15] igb: increase timeout for ethtool offline self-test Jeff Kirsher
2013-02-16  8:33 ` [net-next 05/15] ixgbe: Define FCoE and Flow director limits much sooner to allow for changes Jeff Kirsher
2013-02-16  8:33 ` [net-next 06/15] ixgbe: Add function for setting XPS queue mapping Jeff Kirsher
2013-02-16  8:33 ` Jeff Kirsher [this message]
2013-02-16  8:33 ` [net-next 08/15] ixgbe: Make ixgbe_setup_tc usable even when DCB is not enabled Jeff Kirsher
2013-02-16  8:33 ` [net-next 09/15] ixgbe: Add support for displaying the number of Tx/Rx channels Jeff Kirsher
2013-02-16  8:33 ` [net-next 10/15] ixgbe: Add support for set_channels ethtool operation Jeff Kirsher
2013-02-16  8:33 ` [net-next 11/15] ixgbe: fix possible data corruption in read_i2c_byte Jeff Kirsher
2013-02-16  8:33 ` [net-next 12/15] ixgbe: cleanup error checking in ixgbe_identify_sfp_module_generic() Jeff Kirsher
2013-02-16  8:33 ` [net-next 13/15] ixgbe: implement SFF diagnostic monitoring via ethtool Jeff Kirsher
2013-02-16 10:53   ` Michał Mirosław
2013-02-17  6:16     ` Tantilov, Emil S
2013-02-17 13:41       ` Michał Mirosław
2013-02-19 22:14   ` Ben Hutchings
2013-02-20  0:26     ` Tantilov, Emil S
2013-02-16  8:33 ` [net-next 14/15] ixgbe: fix Tx timeouts with BQL Jeff Kirsher
2013-02-16  8:33 ` [net-next 15/15] ixgbe: Update DESC_NEEDED define to adjust for changes to MAX_SKB_FRAGS Jeff Kirsher
2013-02-18 17:37 ` [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2013.02.16 David Miller
2013-02-19 18:06   ` Tantilov, Emil S

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1361003616-3422-8-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).