mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cpumask: provide a dummy cpumask_next_wrap
@ 2018-08-13 21:55 Arnd Bergmann
  2018-08-13 22:01 ` Caleb Raitto
  2018-08-13 22:57 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2018-08-13 21:55 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, Peter Zijlstra, Caleb Raitto, Willem de Bruijn,
	David S . Miller, Alexey Dobriyan, Ingo Molnar, Rakib Mullick,
	Amritha Nambiar, Michael Kelley, linux-kernel

The virtio_net driver has become the first one to call cpumask_next_wrap()
even if CONFIG_SMP is disabled, leading to a build error:

drivers/net/virtio_net.c: In function 'virtnet_set_affinity':
drivers/net/virtio_net.c:1916:10: error: implicit declaration of function 'cpumask_next_wrap'; did you mean 'cpumask_next_and'? [-Werror=implicit-function-declaration]
    cpu = cpumask_next_wrap(cpu, cpu_online_mask,

Add a stub function along the lines of cpumask_first(), cpumask_next() etc.
I'm not entirely sure what should be returned in this case, but at
least for virtio_net, anything should work.

Fixes: 2ca653d607ce ("virtio_net: Stripe queue affinities across cores.")
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Caleb Raitto <caraitto@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/cpumask.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 57f20a0a7794..079ba06309bd 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -159,6 +159,11 @@ static inline unsigned int cpumask_next_and(int n,
 	return n+1;
 }
 
+static inline int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap)
+{
+	return n;
+}
+
 /* cpu must be a valid cpu, ie 0, so there's no other choice. */
 static inline unsigned int cpumask_any_but(const struct cpumask *mask,
 					   unsigned int cpu)
-- 
2.18.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cpumask: provide a dummy cpumask_next_wrap
  2018-08-13 21:55 [PATCH] cpumask: provide a dummy cpumask_next_wrap Arnd Bergmann
@ 2018-08-13 22:01 ` Caleb Raitto
  2018-08-13 22:05   ` Arnd Bergmann
  2018-08-13 22:57 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Caleb Raitto @ 2018-08-13 22:01 UTC (permalink / raw)
  To: arnd
  Cc: akpm, peterz, Willem de Bruijn, davem, adobriyan, mingo,
	rakib.mullick, amritha.nambiar, mhkelley, linux-kernel

On Mon, Aug 13, 2018 at 2:55 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> The virtio_net driver has become the first one to call cpumask_next_wrap()
> even if CONFIG_SMP is disabled, leading to a build error:
>
> drivers/net/virtio_net.c: In function 'virtnet_set_affinity':
> drivers/net/virtio_net.c:1916:10: error: implicit declaration of function 'cpumask_next_wrap'; did you mean 'cpumask_next_and'? [-Werror=implicit-function-declaration]
>     cpu = cpumask_next_wrap(cpu, cpu_online_mask,
>
> Add a stub function along the lines of cpumask_first(), cpumask_next() etc.
> I'm not entirely sure what should be returned in this case, but at
> least for virtio_net, anything should work.

Sorry about the build break, I think this patch with a fix was already merged:

cpumask: make cpumask_next_wrap available without smp
https://patchwork.ozlabs.org/patch/956670/

Thanks,
-Caleb

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cpumask: provide a dummy cpumask_next_wrap
  2018-08-13 22:01 ` Caleb Raitto
@ 2018-08-13 22:05   ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2018-08-13 22:05 UTC (permalink / raw)
  To: caraitto
  Cc: Andrew Morton, Peter Zijlstra, Willem de Bruijn, David Miller,
	Alexey Dobriyan, Ingo Molnar, rakib.mullick, Amritha Nambiar,
	mhkelley, Linux Kernel Mailing List

On Tue, Aug 14, 2018 at 12:02 AM Caleb Raitto <caraitto@google.com> wrote:
>
> On Mon, Aug 13, 2018 at 2:55 PM Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > The virtio_net driver has become the first one to call cpumask_next_wrap()
> > even if CONFIG_SMP is disabled, leading to a build error:
> >
> > drivers/net/virtio_net.c: In function 'virtnet_set_affinity':
> > drivers/net/virtio_net.c:1916:10: error: implicit declaration of function 'cpumask_next_wrap'; did you mean 'cpumask_next_and'? [-Werror=implicit-function-declaration]
> >     cpu = cpumask_next_wrap(cpu, cpu_online_mask,
> >
> > Add a stub function along the lines of cpumask_first(), cpumask_next() etc.
> > I'm not entirely sure what should be returned in this case, but at
> > least for virtio_net, anything should work.
>
> Sorry about the build break, I think this patch with a fix was already merged:
>
> cpumask: make cpumask_next_wrap available without smp
> https://patchwork.ozlabs.org/patch/956670/

Ok, that's also a better fix than mine I think.

Thanks,

        Arnd

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cpumask: provide a dummy cpumask_next_wrap
  2018-08-13 21:55 [PATCH] cpumask: provide a dummy cpumask_next_wrap Arnd Bergmann
  2018-08-13 22:01 ` Caleb Raitto
@ 2018-08-13 22:57 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2018-08-13 22:57 UTC (permalink / raw)
  To: arnd
  Cc: akpm, peterz, caraitto, willemb, adobriyan, mingo, rakib.mullick,
	amritha.nambiar, mhkelley, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 13 Aug 2018 23:55:16 +0200

> The virtio_net driver has become the first one to call cpumask_next_wrap()
> even if CONFIG_SMP is disabled, leading to a build error:
> 
> drivers/net/virtio_net.c: In function 'virtnet_set_affinity':
> drivers/net/virtio_net.c:1916:10: error: implicit declaration of function 'cpumask_next_wrap'; did you mean 'cpumask_next_and'? [-Werror=implicit-function-declaration]
>     cpu = cpumask_next_wrap(cpu, cpu_online_mask,
> 
> Add a stub function along the lines of cpumask_first(), cpumask_next() etc.
> I'm not entirely sure what should be returned in this case, but at
> least for virtio_net, anything should work.
> 
> Fixes: 2ca653d607ce ("virtio_net: Stripe queue affinities across cores.")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

This should already be fixed in my tree, and:

> +static inline int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap)
> +{
> +	return n;
> +}

this doesn't handle the "n==0 && wrap" case properly, in that situation you should
return '1'.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-13 22:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-13 21:55 [PATCH] cpumask: provide a dummy cpumask_next_wrap Arnd Bergmann
2018-08-13 22:01 ` Caleb Raitto
2018-08-13 22:05   ` Arnd Bergmann
2018-08-13 22:57 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®