From patchwork Fri Dec 12 12:52:30 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Hutchings X-Patchwork-Id: 13713 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.176.167]) by ozlabs.org (Postfix) with ESMTP id 51218474C1 for ; Fri, 12 Dec 2008 23:52:38 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757187AbYLLMwd (ORCPT ); Fri, 12 Dec 2008 07:52:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757153AbYLLMwd (ORCPT ); Fri, 12 Dec 2008 07:52:33 -0500 Received: from smarthost02.mail.zen.net.uk ([212.23.3.141]:47293 "EHLO smarthost02.mail.zen.net.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757130AbYLLMwc (ORCPT ); Fri, 12 Dec 2008 07:52:32 -0500 Received: from [82.69.137.158] (helo=opal.uk.level5networks.com) by smarthost02.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1LB7VO-0002VU-Q5; Fri, 12 Dec 2008 12:52:31 +0000 Received: from uklogin.uk.level5networks.com (uklogin.uk.level5networks.com [10.17.10.10]) by opal.uk.level5networks.com (8.12.8/8.12.8) with ESMTP id mBCCqUY0025708 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 Dec 2008 12:52:30 GMT Received: from uklogin.uk.level5networks.com (localhost [127.0.0.1]) by uklogin.uk.level5networks.com (8.12.11/8.12.11) with ESMTP id mBCCqU3k011080; Fri, 12 Dec 2008 12:52:30 GMT Received: (from bwh@localhost) by uklogin.uk.level5networks.com (8.12.11/8.12.11/Submit) id mBCCqUC3011078; Fri, 12 Dec 2008 12:52:30 GMT X-Authentication-Warning: uklogin.uk.level5networks.com: bwh set sender to bhutchings@solarflare.com using -f Date: Fri, 12 Dec 2008 12:52:30 +0000 From: Ben Hutchings To: David Miller Cc: netdev@vger.kernel.org, linux-net-drivers@solarflare.com Subject: [PATCH 11/33] sfc: Provide hints to irqbalance daemon Message-ID: <20081212125229.GK10372@solarflare.com> References: Mime-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Originating-Smarthost02-IP: [82.69.137.158] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Allocate IRQs with the name format [-]- so that future versions of irqbalanced understand what we're doing. Signed-off-by: Ben Hutchings --- drivers/net/sfc/efx.c | 24 ++++++++++++++++++++++++ drivers/net/sfc/falcon.c | 2 +- drivers/net/sfc/net_driver.h | 2 ++ 3 files changed, 27 insertions(+), 1 deletions(-) diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 58cbbd5..183a440 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c @@ -356,6 +356,27 @@ static int efx_probe_channel(struct efx_channel *channel) } +static void efx_set_channel_names(struct efx_nic *efx) +{ + struct efx_channel *channel; + const char *type = ""; + int number; + + efx_for_each_channel(channel, efx) { + number = channel->channel; + if (efx->n_channels > efx->n_rx_queues) { + if (channel->channel < efx->n_rx_queues) { + type = "-rx"; + } else { + type = "-tx"; + number -= efx->n_rx_queues; + } + } + snprintf(channel->name, sizeof(channel->name), + "%s%s-%d", efx->name, type, number); + } +} + /* Channels are shutdown and reinitialised whilst the NIC is running * to propagate configuration changes (mtu, checksum offload), or * to clear hardware error conditions @@ -1002,6 +1023,7 @@ static int efx_probe_all(struct efx_nic *efx) goto fail3; } } + efx_set_channel_names(efx); return 0; @@ -1483,6 +1505,7 @@ static int efx_netdev_event(struct notifier_block *this, strcpy(efx->name, net_dev->name); efx_mtd_rename(efx); + efx_set_channel_names(efx); } return NOTIFY_DONE; @@ -1516,6 +1539,7 @@ static int efx_register_netdev(struct efx_nic *efx) return rc; } strcpy(efx->name, net_dev->name); + efx_set_channel_names(efx); return 0; } diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 9563c13..7421945 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c @@ -1585,7 +1585,7 @@ int falcon_init_interrupt(struct efx_nic *efx) efx_for_each_channel(channel, efx) { rc = request_irq(channel->irq, falcon_msi_interrupt, IRQF_PROBE_SHARED, /* Not shared */ - efx->name, channel); + channel->name, channel); if (rc) { EFX_ERR(efx, "failed to hook IRQ %d\n", channel->irq); goto fail2; diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 2c5b5fa..abff908 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h @@ -327,6 +327,7 @@ enum efx_rx_alloc_method { * * @efx: Associated Efx NIC * @channel: Channel instance number + * @name: Name for channel and IRQ * @used_flags: Channel is used by net driver * @enabled: Channel enabled indicator * @irq: IRQ number (MSI and MSI-X only) @@ -357,6 +358,7 @@ enum efx_rx_alloc_method { struct efx_channel { struct efx_nic *efx; int channel; + char name[IFNAMSIZ + 6]; int used_flags; bool enabled; int irq;