From patchwork Tue Sep 28 14:42:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladislav Zolotarov X-Patchwork-Id: 65973 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D4FC1B6EF1 for ; Wed, 29 Sep 2010 00:42:38 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755152Ab0I1Ome (ORCPT ); Tue, 28 Sep 2010 10:42:34 -0400 Received: from mms3.broadcom.com ([216.31.210.19]:1646 "EHLO MMS3.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754781Ab0I1Omd (ORCPT ); Tue, 28 Sep 2010 10:42:33 -0400 Received: from [10.9.200.131] by MMS3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Tue, 28 Sep 2010 07:42:24 -0700 X-Server-Uuid: B55A25B1-5D7D-41F8-BC53-C57E7AD3C201 Received: from mail-irva-12.broadcom.com (10.11.16.101) by IRVEXCHHUB01.corp.ad.broadcom.com (10.9.200.131) with Microsoft SMTP Server id 8.2.247.2; Tue, 28 Sep 2010 07:42:24 -0700 Received: from [10.185.6.94] (lb-tlvb-vladz.il.broadcom.com [10.185.6.94]) by mail-irva-12.broadcom.com (Postfix) with ESMTP id 33F5869CA8; Tue, 28 Sep 2010 07:42:22 -0700 (PDT) Subject: [PATCH net-next-2.6] bnx2x: Moved enabling of MSI to the bnx2x_set_num_queues() From: "Vladislav Zolotarov" To: "Dave Miller" cc: "Eilon Greenstein" , "netdev list" Date: Tue, 28 Sep 2010 16:42:20 +0200 Message-ID: <1285684941.31967.21.camel@lb-tlvb-vladz> MIME-Version: 1.0 X-Mailer: Evolution 2.28.3 X-WSS-ID: 60BF215A3KC118949147-01-01 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Moved enabling of MSI to the bnx2x_set_num_queues() - the same functions that handles the initialization of the MSI-X. Signed-off-by: Vladislav Zolotarov Signed-off-by: Eilon Greenstein --- This patch is required for the integration of Ben Hutchings bnx2x patch from the "netif_set_real_num_{rx,tx}_queues" patch series. drivers/net/bnx2x/bnx2x_cmn.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index efc7be4..453d3b6 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c @@ -1185,8 +1185,10 @@ static int bnx2x_set_num_queues(struct bnx2x *bp) int rc = 0; switch (bp->int_mode) { - case INT_MODE_INTx: case INT_MODE_MSI: + bnx2x_enable_msi(bp); + /* falling through... */ + case INT_MODE_INTx: bp->num_queues = 1; DP(NETIF_MSG_IFUP, "set number of queues to 1\n"); break; @@ -1202,9 +1204,16 @@ static int bnx2x_set_num_queues(struct bnx2x *bp) * and fallback to MSI or legacy INTx with one fp */ rc = bnx2x_enable_msix(bp); - if (rc) + if (rc) { /* failed to enable MSI-X */ bp->num_queues = 1; + + /* Fall to INTx if failed to enable MSI-X due to lack of + * memory (in bnx2x_set_num_queues()) */ + if ((rc != -ENOMEM) && (bp->int_mode != INT_MODE_INTx)) + bnx2x_enable_msi(bp); + } + break; } bp->dev->real_num_tx_queues = bp->num_queues; @@ -1263,10 +1272,6 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) goto load_error1; } } else { - /* Fall to INTx if failed to enable MSI-X due to lack of - memory (in bnx2x_set_num_queues()) */ - if ((rc != -ENOMEM) && (bp->int_mode != INT_MODE_INTx)) - bnx2x_enable_msi(bp); bnx2x_ack_int(bp); rc = bnx2x_req_irq(bp); if (rc) {