From patchwork Sun May 17 22:34:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 27324 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id F09E8B7069 for ; Mon, 18 May 2009 08:34:42 +1000 (EST) Received: by ozlabs.org (Postfix) id E5A45DE09E; Mon, 18 May 2009 08:34:42 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 89144DE057 for ; Mon, 18 May 2009 08:34:42 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755316AbZEQWef (ORCPT ); Sun, 17 May 2009 18:34:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755260AbZEQWed (ORCPT ); Sun, 17 May 2009 18:34:33 -0400 Received: from qmta07.westchester.pa.mail.comcast.net ([76.96.62.64]:43664 "EHLO QMTA07.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755239AbZEQWec (ORCPT ); Sun, 17 May 2009 18:34:32 -0400 Received: from OMTA13.westchester.pa.mail.comcast.net ([76.96.62.52]) by QMTA07.westchester.pa.mail.comcast.net with comcast id sgnS1b00417dt5G57ma6U2; Sun, 17 May 2009 22:34:06 +0000 Received: from localhost.localdomain ([63.64.152.142]) by OMTA13.westchester.pa.mail.comcast.net with comcast id smaF1b00434bfcX3ZmaHrA; Sun, 17 May 2009 22:34:32 +0000 From: Jeff Kirsher Subject: [net-next-2.6 PATCH 06/11] ixgbe: Enable FCoE redirection table feature in 82599 To: davem@davemloft.net Cc: netdev@vger.kernel.org, linux-scsi@vger.kernel.org, Yi Zou , Jeff Kirsher Date: Sun, 17 May 2009 15:34:14 -0700 Message-ID: <20090517223413.14124.35244.stgit@localhost.localdomain> In-Reply-To: <20090517223213.14124.61405.stgit@localhost.localdomain> References: <20090517223213.14124.61405.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Yi Zou 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 Signed-off-by: Jeff Kirsher --- drivers/net/ixgbe/ixgbe_fcoe.c | 28 ++++++++++++++++++++++++---- 1 files changed, 24 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 |