[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080324.132253.110641003.davem@davemloft.net>
Date: Mon, 24 Mar 2008 13:22:53 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: bhutchings@...arflare.com
Cc: netdev@...r.kernel.org, linux-net-drivers@...arflare.com,
jgarzik@...ox.com
Subject: Re: [PATCH 1/8] New driver "sfc" for Solarstorm SFC4000 controller
(try #8)
From: Ben Hutchings <bhutchings@...arflare.com>
Date: Mon, 24 Mar 2008 10:29:38 +0000
> David Miller wrote:
> > > +
> > > + if (rss_cpus == 0) {
> > > +#ifdef topology_core_siblings
> > > + cpumask_t core_mask;
> > > + int cpu;
> > > +
> > > + cpus_clear(core_mask);
> > > + efx->rss_queues = 0;
> > > + for_each_online_cpu(cpu) {
> > > + if (!cpu_isset(cpu, core_mask)) {
> > > + ++efx->rss_queues;
> > > + cpus_or(core_mask, core_mask,
> > > + topology_core_siblings(cpu));
> > > + }
> > > + }
> > > +#else
> > > + efx->rss_queues = num_online_cpus();
> > > +#endif
> >
> > Please don't test feature availability this way.
> >
> > Either use the proper CONFIG_* option ifdef.
>
> The macro is defined for some architectures and not for others, and does
> not depend on config options. See Documentation/cputopology.txt.
Then this needs to be fixed at the top level because drivers doing
this is beyond ugly.
I'd suggest that some default define be provided by the generic
header files so code doesn't have to do this.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists