Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 May 2017 17:56:07 +0200
From:      Vincenzo Maffione <v.maffione@gmail.com>
To:        Harry Schmalzbauer <freebsd@omnilan.de>
Cc:        freebsd-net <freebsd-net@freebsd.org>
Subject:   Re: [panic] netmap(4) and if_lagg(4)
Message-ID:  <CA%2B_eA9hripEStmfJhj_Q93OF5jFf2nfQXeuA2DnuSjBmJi6j4g@mail.gmail.com>
In-Reply-To: <5926F9F9.4040706@omnilan.de>
References:  <58CBCD7A.8060301@omnilan.de> <CA%2B_eA9iCT7evWUcZMA_ViKfrZnSHp3OpBTS5c4iJ9=ZjO-Pfgw@mail.gmail.com> <58CC23F5.7060507@omnilan.de> <CA%2B_eA9iajZOUFsnWKdodN7zMvst8wn0xViM4xxEx%2B41jw_0B3g@mail.gmail.com> <58CFA394.8070901@omnilan.de> <CA%2B_eA9jf_VjcYUZynu5CXx-ps5z7PSxOky=QLpR-miqtxmMU5w@mail.gmail.com> <5926EE96.1010000@omnilan.de> <CA%2B_eA9gcMD1QyG35p5UY8kz6n1kF%2B56Arz3q1T8HVBfMv3XN0w@mail.gmail.com> <5926F9F9.4040706@omnilan.de>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
I see the bug is in FreeBSD 11. I attached the simple patch to fix it.
Can someone commit the patch to 11/stable?

Harry: You should be able to workaround the bug by setting

# sysctl dev.netmap.generic_rings=1

And yes, if_lagg(4) doesn't have native netmap support, like all the
meta-drivers (e.g. vlan, tunnels, etc.).
Point is that you should implement link aggregation in your application (in
user-space).

Cheers,
  Vincenzo

2017-05-25 17:36 GMT+02:00 Harry Schmalzbauer <freebsd@omnilan.de>:

> Bezüglich Vincenzo Maffione's Nachricht vom 25.05.2017 17:31 (localtime):
> > Hi,
> >   This is a (silly) bug that is not present anymore in the upstream code
> > https://github.com/luigirizzo/netmap/blob/master/sys/dev/
> netmap/netmap_freebsd.c#L410-L417
> > that is txq and rxq for generic adapter cannot be 0.
> >
> > So I would say the problem is outdated code in the FreeBSD version you
> are
> > using. Which version you are using exactly? Maybe we can try to push a
> fix.
>
> Thanks for the quick reply!
> This panic was with r318629 (stable/11 = FreeBSD 11.1-PRERELEASE)
>
> You mentioned "generic adapter": Does this mean native-netmap support
> get's lost when if_lagg(4) is in game after if_igb(4)?
>
> Thanks,
>
> -harry
>
>
>


-- 
Vincenzo Maffione

[-- Attachment #2 --]
--- f1.c	2017-05-25 17:46:36.948871305 +0200
+++ f.c	2017-05-25 17:46:01.542203054 +0200
@@ -273,9 +273,10 @@ generic_find_num_desc(struct ifnet *ifp,
 void
 generic_find_num_queues(struct ifnet *ifp, u_int *txq, u_int *rxq)
 {
-	D("called, in txq %d rxq %d", *txq, *rxq);
-	*txq = netmap_generic_rings;
-	*rxq = netmap_generic_rings;
+	u_int num_rings = netmap_generic_rings ? netmap_generic_rings : 1;
+
+	*txq = num_rings;
+	*rxq = num_rings;
 }
 
 

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B_eA9hripEStmfJhj_Q93OF5jFf2nfQXeuA2DnuSjBmJi6j4g>