From: Ben Hutchings <bhutchings@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-net-drivers@solarflare.com>,
Shradha Shah <sshah@solarflare.com>
Subject: [PATCH net-next 15/19] sfc: Make all CPU/IRQ/channel/queue counts unsigned
Date: Thu, 16 Feb 2012 00:50:27 +0000 [thread overview]
Message-ID: <1329353427.2565.41.camel@bwh-desktop> (raw)
In-Reply-To: <1329352938.2565.26.camel@bwh-desktop>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/ethernet/sfc/efx.c | 18 ++++++++++--------
drivers/net/ethernet/sfc/net_driver.h | 2 +-
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index eda2272..3a103f8 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -1104,10 +1104,10 @@ static void efx_fini_io(struct efx_nic *efx)
pci_disable_device(efx->pci_dev);
}
-static int efx_wanted_parallelism(void)
+static unsigned int efx_wanted_parallelism(void)
{
cpumask_var_t thread_mask;
- int count;
+ unsigned int count;
int cpu;
if (rss_cpus)
@@ -1136,7 +1136,8 @@ static int
efx_init_rx_cpu_rmap(struct efx_nic *efx, struct msix_entry *xentries)
{
#ifdef CONFIG_RFS_ACCEL
- int i, rc;
+ unsigned int i;
+ int rc;
efx->net_dev->rx_cpu_rmap = alloc_irq_cpu_rmap(efx->n_rx_channels);
if (!efx->net_dev->rx_cpu_rmap)
@@ -1159,13 +1160,14 @@ efx_init_rx_cpu_rmap(struct efx_nic *efx, struct msix_entry *xentries)
*/
static int efx_probe_interrupts(struct efx_nic *efx)
{
- int max_channels =
- min_t(int, efx->type->phys_addr_channels, EFX_MAX_CHANNELS);
- int rc, i;
+ unsigned int max_channels =
+ min(efx->type->phys_addr_channels, EFX_MAX_CHANNELS);
+ unsigned int i;
+ int rc;
if (efx->interrupt_mode == EFX_INT_MODE_MSIX) {
struct msix_entry xentries[EFX_MAX_CHANNELS];
- int n_channels;
+ unsigned int n_channels;
n_channels = efx_wanted_parallelism();
if (separate_tx_channels)
@@ -1178,7 +1180,7 @@ static int efx_probe_interrupts(struct efx_nic *efx)
if (rc > 0) {
netif_err(efx, drv, efx->net_dev,
"WARNING: Insufficient MSI-X vectors"
- " available (%d < %d).\n", rc, n_channels);
+ " available (%d < %u).\n", rc, n_channels);
netif_err(efx, drv, efx->net_dev,
"WARNING: Performance may be reduced.\n");
EFX_BUG_ON_PARANOID(rc >= n_channels);
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index 59c0583..3260e71 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -52,7 +52,7 @@
*
**************************************************************************/
-#define EFX_MAX_CHANNELS 32
+#define EFX_MAX_CHANNELS 32U
#define EFX_MAX_RX_QUEUES EFX_MAX_CHANNELS
/* Checksum generation is a per-queue option in hardware, so each
--
1.7.7.6
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2012-02-16 0:50 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-16 0:42 pull request: sfc-next 2012-02-16 Ben Hutchings
2012-02-16 0:44 ` [PATCH net-next 01/19] sfc: Skip RX end-of-batch work on channels without an RX queue Ben Hutchings
2012-02-16 0:44 ` [PATCH net-next 02/19] sfc: Do not retry hardware probe if it schedules a reset Ben Hutchings
2012-02-16 0:45 ` [PATCH net-next 03/19] sfc: Replace some literal constants with EFX_PAGE_SIZE/EFX_BUF_SIZE Ben Hutchings
2012-02-16 0:45 ` [PATCH net-next 04/19] sfc: Warn if unable to create MTDs Ben Hutchings
2012-02-16 0:46 ` [PATCH net-next 05/19] sfc: Add support for configuring RX unicast/multicast default filters Ben Hutchings
2012-02-16 0:46 ` [PATCH net-next 06/19] sfc: Add support for TX MAC filters Ben Hutchings
2012-02-16 0:47 ` [PATCH net-next 07/19] sfc: Correct MAC filter bitfield definitions Ben Hutchings
2012-02-16 0:47 ` [PATCH net-next 08/19] sfc: Generalise driver event generation Ben Hutchings
2012-02-16 0:47 ` [PATCH net-next 09/19] sfc: Generate RX fill events based on RX queues, not channels Ben Hutchings
2012-02-16 0:48 ` [PATCH net-next 10/19] sfc: Leave interrupts and event queues enabled whenever we can Ben Hutchings
2012-02-16 0:48 ` [PATCH net-next 11/19] sfc: Use proper function to test for RX channel in efx_poll() Ben Hutchings
2012-02-16 0:48 ` [PATCH net-next 12/19] sfc: Generalise event generation to cover VF-owned event queues Ben Hutchings
2012-02-16 0:49 ` [PATCH net-next 13/19] sfc: Disable flow control during flushes Ben Hutchings
2012-02-16 0:49 ` [PATCH net-next 14/19] sfc: Make buffer table indices and counts consistently unsigned Ben Hutchings
2012-02-16 0:50 ` Ben Hutchings [this message]
2012-02-16 0:50 ` [PATCH net-next 16/19] sfc: Add support for 'extra' channel types Ben Hutchings
2012-02-16 0:51 ` [PATCH net-next 17/19] sfc: Pass NIC structure into efx_wanted_parallelism() Ben Hutchings
2012-02-16 0:52 ` [PATCH net-next 18/19] sfc: Allocate SRAM between buffer table and descriptor caches at init time Ben Hutchings
2012-02-16 0:52 ` [PATCH net-next 19/19] sfc: Add SR-IOV back-end support for SFC9000 family Ben Hutchings
2012-02-16 1:18 ` John Fastabend
2012-02-16 1:57 ` Ben Hutchings
2012-02-21 19:52 ` John Fastabend
2012-02-21 20:24 ` Ben Hutchings
2012-02-16 22:08 ` pull request: sfc-next 2012-02-16 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=1329353427.2565.41.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=linux-net-drivers@solarflare.com \
--cc=netdev@vger.kernel.org \
--cc=sshah@solarflare.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).