netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] cpumask: make cpumask_next_wrap available without smp
@ 2018-08-12 13:14 Willem de Bruijn
  2018-08-13 15:58 ` David Miller
  2018-08-13 16:01 ` [net-next,v2] " Krzysztof Kozlowski
  0 siblings, 2 replies; 4+ messages in thread
From: Willem de Bruijn @ 2018-08-12 13:14 UTC (permalink / raw)
  To: netdev; +Cc: davem, caleb.raitto, lkp, Willem de Bruijn

From: Willem de Bruijn <willemb@google.com>

The kbuild robot shows build failure on machines without CONFIG_SMP:

  drivers/net/virtio_net.c:1916:10: error:
    implicit declaration of function 'cpumask_next_wrap'

cpumask_next_wrap is exported from lib/cpumask.o, which has

    lib-$(CONFIG_SMP) += cpumask.o

same as other functions, also define it as static inline in the
NR_CPUS==1 branch in include/linux/cpumask.h.

If wrap is true and next == start, return nr_cpumask_bits, or 1.
Else wrap across the range of valid cpus, here [0].

Fixes: 2ca653d607ce ("virtio_net: Stripe queue affinities across cores.")
Signed-off-by: Willem de Bruijn <willemb@google.com>
---
 include/linux/cpumask.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 57f20a0a77949..147bdec42215d 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -159,6 +159,13 @@ static inline unsigned int cpumask_next_and(int n,
 	return n+1;
 }
 
+static inline unsigned int cpumask_next_wrap(int n, const struct cpumask *mask,
+					     int start, bool wrap)
+{
+	/* cpu0 unless stop condition, wrap and at cpu0, then nr_cpumask_bits */
+	return (wrap && n == 0);
+}
+
 /* 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.597.ga71716f1ad-goog

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

* Re: [PATCH net-next v2] cpumask: make cpumask_next_wrap available without smp
  2018-08-12 13:14 [PATCH net-next v2] cpumask: make cpumask_next_wrap available without smp Willem de Bruijn
@ 2018-08-13 15:58 ` David Miller
  2018-08-13 16:01 ` [net-next,v2] " Krzysztof Kozlowski
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2018-08-13 15:58 UTC (permalink / raw)
  To: willemdebruijn.kernel; +Cc: netdev, caleb.raitto, lkp, willemb

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: Sun, 12 Aug 2018 09:14:03 -0400

> From: Willem de Bruijn <willemb@google.com>
> 
> The kbuild robot shows build failure on machines without CONFIG_SMP:
> 
>   drivers/net/virtio_net.c:1916:10: error:
>     implicit declaration of function 'cpumask_next_wrap'
> 
> cpumask_next_wrap is exported from lib/cpumask.o, which has
> 
>     lib-$(CONFIG_SMP) += cpumask.o
> 
> same as other functions, also define it as static inline in the
> NR_CPUS==1 branch in include/linux/cpumask.h.
> 
> If wrap is true and next == start, return nr_cpumask_bits, or 1.
> Else wrap across the range of valid cpus, here [0].
> 
> Fixes: 2ca653d607ce ("virtio_net: Stripe queue affinities across cores.")
> Signed-off-by: Willem de Bruijn <willemb@google.com>

Applied, thanks Willem.

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

* Re: [net-next,v2] cpumask: make cpumask_next_wrap available without smp
  2018-08-12 13:14 [PATCH net-next v2] cpumask: make cpumask_next_wrap available without smp Willem de Bruijn
  2018-08-13 15:58 ` David Miller
@ 2018-08-13 16:01 ` Krzysztof Kozlowski
  2018-08-13 19:44   ` Willem de Bruijn
  1 sibling, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2018-08-13 16:01 UTC (permalink / raw)
  To: Willem de Bruijn; +Cc: netdev, davem, caleb.raitto, lkp, Willem de Bruijn

On Sun, Aug 12, 2018 at 09:14:03AM -0400, Willem de Bruijn wrote:
> From: Willem de Bruijn <willemb@google.com>
> 
> The kbuild robot shows build failure on machines without CONFIG_SMP:

If this was reported by kbuild robot, then could you credit him with
Reported-by?

> 
>   drivers/net/virtio_net.c:1916:10: error:
>     implicit declaration of function 'cpumask_next_wrap'
> 
> cpumask_next_wrap is exported from lib/cpumask.o, which has
> 
>     lib-$(CONFIG_SMP) += cpumask.o
> 
> same as other functions, also define it as static inline in the
> NR_CPUS==1 branch in include/linux/cpumask.h.
> 
> If wrap is true and next == start, return nr_cpumask_bits, or 1.
> Else wrap across the range of valid cpus, here [0].
> 
> Fixes: 2ca653d607ce ("virtio_net: Stripe queue affinities across cores.")
> Signed-off-by: Willem de Bruijn <willemb@google.com>
> ---
>  include/linux/cpumask.h | 7 +++++++
>  1 file changed, 7 insertions(+)
>

Tested-by: Krzysztof Kozlowski <krzk@kernel.org>

This fixes second build break of virtio driver in recent few days... I
wonder what happened with build-testing of own commits... or at least
reading kbuild robot mails.

Best regards,
Krzysztof

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

* Re: [net-next,v2] cpumask: make cpumask_next_wrap available without smp
  2018-08-13 16:01 ` [net-next,v2] " Krzysztof Kozlowski
@ 2018-08-13 19:44   ` Willem de Bruijn
  0 siblings, 0 replies; 4+ messages in thread
From: Willem de Bruijn @ 2018-08-13 19:44 UTC (permalink / raw)
  To: krzk
  Cc: Network Development, David Miller, caleb.raitto,
	kbuild test robot, Willem de Bruijn

On Mon, Aug 13, 2018 at 6:01 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On Sun, Aug 12, 2018 at 09:14:03AM -0400, Willem de Bruijn wrote:
> > From: Willem de Bruijn <willemb@google.com>
> >
> > The kbuild robot shows build failure on machines without CONFIG_SMP:
>
> If this was reported by kbuild robot, then could you credit him with
> Reported-by?

You're right. I forgot, sorry. Will do in the future.

> >
> >   drivers/net/virtio_net.c:1916:10: error:
> >     implicit declaration of function 'cpumask_next_wrap'
> >
> > cpumask_next_wrap is exported from lib/cpumask.o, which has
> >
> >     lib-$(CONFIG_SMP) += cpumask.o
> >
> > same as other functions, also define it as static inline in the
> > NR_CPUS==1 branch in include/linux/cpumask.h.
> >
> > If wrap is true and next == start, return nr_cpumask_bits, or 1.
> > Else wrap across the range of valid cpus, here [0].
> >
> > Fixes: 2ca653d607ce ("virtio_net: Stripe queue affinities across cores.")
> > Signed-off-by: Willem de Bruijn <willemb@google.com>
> > ---
> >  include/linux/cpumask.h | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
>
> Tested-by: Krzysztof Kozlowski <krzk@kernel.org>

Thanks for testing,

  Willem

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-12 13:14 [PATCH net-next v2] cpumask: make cpumask_next_wrap available without smp Willem de Bruijn
2018-08-13 15:58 ` David Miller
2018-08-13 16:01 ` [net-next,v2] " Krzysztof Kozlowski
2018-08-13 19:44   ` Willem de Bruijn

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).