netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-scsi@vger.kernel.org,
	Yi Zou <yi.zou@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next-2.6 PATCH 06/11] ixgbe: Enable FCoE redirection table feature in 82599
Date: Sun, 17 May 2009 15:34:14 -0700	[thread overview]
Message-ID: <20090517223413.14124.35244.stgit@localhost.localdomain> (raw)
In-Reply-To: <20090517223213.14124.61405.stgit@localhost.localdomain>

From: Yi Zou <yi.zou@intel.com>

Enable using FCoE redirection table feature in 82599. The FCoE
redirection table has maximum of eight entries, corresponding
to maximum of eight receive queues to be used for distributing
incoming FCoE packets. This patch sets up the FCoE redirection
table when multiple receive queues are available for FCoE.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/ixgbe/ixgbe_fcoe.c |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c
index a11c620..d5939de 100644
--- a/drivers/net/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ixgbe/ixgbe_fcoe.c
@@ -482,8 +482,10 @@ int ixgbe_fso(struct ixgbe_adapter *adapter,
  */
 void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter)
 {
+	int i, fcoe_q, fcoe_i;
 	struct ixgbe_hw *hw = &adapter->hw;
 	struct ixgbe_fcoe *fcoe = &adapter->fcoe;
+	struct ixgbe_ring_feature *f = &adapter->ring_feature[RING_F_FCOE];
 
 	/* create the pool for ddp if not created yet */
 	if (!fcoe->pool) {
@@ -497,12 +499,30 @@ void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter)
 
 		spin_lock_init(&fcoe->lock);
 	}
-	/* L2 filter for FCoE: default to queue 0 */
+
+	/* Enable L2 eth type filter for FCoE */
 	IXGBE_WRITE_REG(hw, IXGBE_ETQF(IXGBE_ETQF_FILTER_FCOE),
 			(ETH_P_FCOE | IXGBE_ETQF_FCOE | IXGBE_ETQF_FILTER_EN));
-	IXGBE_WRITE_REG(hw, IXGBE_FCRECTL, 0);
-	IXGBE_WRITE_REG(hw, IXGBE_ETQS(IXGBE_ETQF_FILTER_FCOE),
-			IXGBE_ETQS_QUEUE_EN);
+	if (adapter->ring_feature[RING_F_FCOE].indices) {
+		/* Use multiple rx queues for FCoE by redirection table */
+		for (i = 0; i < IXGBE_FCRETA_SIZE; i++) {
+			fcoe_i = f->mask + i % f->indices;
+			fcoe_i &= IXGBE_FCRETA_ENTRY_MASK;
+			fcoe_q = adapter->rx_ring[fcoe_i].reg_idx;
+			IXGBE_WRITE_REG(hw, IXGBE_FCRETA(i), fcoe_q);
+		}
+		IXGBE_WRITE_REG(hw, IXGBE_FCRECTL, IXGBE_FCRECTL_ENA);
+		IXGBE_WRITE_REG(hw, IXGBE_ETQS(IXGBE_ETQF_FILTER_FCOE), 0);
+	} else  {
+		/* Use single rx queue for FCoE */
+		fcoe_i = f->mask;
+		fcoe_q = adapter->rx_ring[fcoe_i].reg_idx;
+		IXGBE_WRITE_REG(hw, IXGBE_FCRECTL, 0);
+		IXGBE_WRITE_REG(hw, IXGBE_ETQS(IXGBE_ETQF_FILTER_FCOE),
+				IXGBE_ETQS_QUEUE_EN |
+				(fcoe_q << IXGBE_ETQS_RX_QUEUE_SHIFT));
+	}
+
 	IXGBE_WRITE_REG(hw, IXGBE_FCRXCTRL,
 			IXGBE_FCRXCTRL_FCOELLI |
 			IXGBE_FCRXCTRL_FCCRCBO |


  parent reply	other threads:[~2009-05-17 22:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-17 22:32 [net-next-2.6 PATCH 01/11] ixgbe: Add FCoE Storage MAC Address support Jeff Kirsher
2009-05-17 22:32 ` [net-next-2.6 PATCH 02/11] ixgbe: Add SAN MAC address to the RAR, return the address to DCB Jeff Kirsher
2009-05-17 22:33 ` [net-next-2.6 PATCH 03/11] fcoe: consolidates netdev related config and cleanup for spma mode Jeff Kirsher
2009-05-17 22:33 ` [net-next-2.6 PATCH 04/11] fcoe: adds spma mode support Jeff Kirsher
2009-05-17 22:33 ` [net-next-2.6 PATCH 05/11] ixgbe: Add RING_F_FCOE for FCoE feature in 82599 Jeff Kirsher
2009-05-17 22:34 ` Jeff Kirsher [this message]
2009-05-17 22:34 ` [net-next-2.6 PATCH 07/11] ixgbe: Enable jumbo frame " Jeff Kirsher
2009-05-17 22:34 ` [net-next-2.6 PATCH 08/11] ixgbe: Set Priority Flow Control low water threshhold for DCB Jeff Kirsher
2009-05-17 22:35 ` [net-next-2.6 PATCH 09/11] ixgbe: Allow link flow control in DCB mode for 82599 adapters Jeff Kirsher
2009-05-17 22:35 ` [net-next-2.6 PATCH 10/11] ixgbe: When in DCB mode with PFC enabled, show LFC is disabled Jeff Kirsher
2009-05-17 22:35 ` [net-next-2.6 PATCH 11/11] ixgbe: Don't reset the hardware when switching between LFC and PFC Jeff Kirsher
2009-05-18  4:08 ` [net-next-2.6 PATCH 01/11] ixgbe: Add FCoE Storage MAC Address support David Miller

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=20090517223413.14124.35244.stgit@localhost.localdomain \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=linux-scsi@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yi.zou@intel.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).