From owner-freebsd-net@freebsd.org Fri May 26 08:42:00 2017 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECD26D82F4E for ; Fri, 26 May 2017 08:42:00 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: from mail-oi0-x236.google.com (mail-oi0-x236.google.com [IPv6:2607:f8b0:4003:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA8511370 for ; Fri, 26 May 2017 08:42:00 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: by mail-oi0-x236.google.com with SMTP id l18so5037046oig.2 for ; Fri, 26 May 2017 01:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tootsQg9r8pPVgySuj5J3RM9ZmllGAoEBa2M/jPybL8=; b=ZQ8l/6c0douPA7QpA88a9UDder21vfOU4nzYi+BdmsiKtvx/SuJHTlYFP0dpAxe0I7 +VoA/PJ29WO3J5o+YDmPnlq4MPY7LBFhWaMV7aKwsrkAOrfHZung5l2Ja6WRmK42Bhmm Urt4p7a7xDW+Epex+T+I9f+CCSrkQFkQesRUjsNOIS4oDstG1NNQTWBvaJZU/OE0Itod fMKHsZIuBuFe8UOYPzULeQm9lJEZ7pc7RqwIq1+1mmEbItzIPwjp1SiBROsJIqdG486x YqOy073l52dK4d+BSV/IOiEl6ATSibciH8M60uIGYk7zdtwF3oZNxSTwQX5FYmG3ko2f IiPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tootsQg9r8pPVgySuj5J3RM9ZmllGAoEBa2M/jPybL8=; b=STkYVTeVO41gGctqElkNPb683a7txgqR2i/Od9OabSOAJ82WexhFyiDP/M7lqx9/oB xcyVu7QgEidssGuQpC/PFTVrpM97QY1V+U9gNDl4byXJDCfbTkYsItjwayxR6lfz0G3U lXG1b986IpPvSUy/P4SP6KUYoNlMhfxBHO6mjHOHcS/1JnYmDzLWIjTWStg5Y3LZ46gA mY5mN4og2DOTiIJzmOl2pvEs9ZwBNst/pAowKt+NVF4CJkjUNN6sfvf5HViJbvzERKRz 2toZLJDm7dluMvAxJ7oy5aDDCon1GL2b9oHJ8sYNMzVG5jBsnOyLORsM+uSidjfp+EWi uYGA== X-Gm-Message-State: AODbwcDGrpAP+cAJRmXPYNNdn7xsMdzojFJaqTI0YM+Lua8Ik4pw/lfR pmAcdfIw7izOu66Q8OAHwa17BOAXBA== X-Received: by 10.202.236.67 with SMTP id k64mr371654oih.192.1495788119995; Fri, 26 May 2017 01:41:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.17.59 with HTTP; Fri, 26 May 2017 01:41:59 -0700 (PDT) In-Reply-To: <5927E974.6060706@omnilan.de> References: <58CBCD7A.8060301@omnilan.de> <58CC23F5.7060507@omnilan.de> <58CFA394.8070901@omnilan.de> <5926EE96.1010000@omnilan.de> <5926F9F9.4040706@omnilan.de> <592701D6.7030301@omnilan.de> <592742A8.4010207@omnilan.de> <5927D560.10003@omnilan.de> <5927D77A.60502@omnilan.de> <5927E974.6060706@omnilan.de> From: Vincenzo Maffione Date: Fri, 26 May 2017 10:41:59 +0200 Message-ID: Subject: Re: [panic] netmap(4) and if_lagg(4) To: Harry Schmalzbauer Cc: FreeBSD Net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 May 2017 08:42:01 -0000 Ok, so you should try to completely replace the code in your /usr/src/sys with the code in the upstream netmap repository https://github.com/luigirizzo/netmap (sys directory). 2017-05-26 10:38 GMT+02:00 Harry Schmalzbauer : > Bez=C3=BCglich Vincenzo Maffione's Nachricht vom 26.05.2017 09:31 (localt= ime): > > Is lagg0 the only interface attached to vale0? > > Is lagg0 aggregating a VLAN interface? > > > > You can try this trivial patch > > > > diff --git a/sys/dev/netmap/netmap_generic.c > > b/sys/dev/netmap/netmap_generic.c > > index f148b228..46a3c2c6 100644 > > --- a/sys/dev/netmap/netmap_generic.c > > +++ b/sys/dev/netmap/netmap_generic.c > > @@ -950,6 +950,10 @@ generic_rx_handler(struct ifnet *ifp, struct mbuf > *m) > > u_int work_done; > > u_int r =3D MBUF_RXQ(m); /* receive ring number */ > > > > + if (!NM_NA_VALID(ifp)) { > > + return 0; > > + } > > + > > if (r >=3D na->num_rx_rings) { > > r =3D r % na->num_rx_rings; > > } > > Unfortunately code base is too differing for me, since I absolutely > don't know what I'm doing here. > My resulting patch follows (combining this patch with the previous you > provided and adding NM_NA_VALID()), but there are unmatching macros > involved, which I have no idea about, so I'm not able to test this patch: > --- src/sys/dev/netmap/netmap_freebsd.c.orig 2017-05-25 > 20:36:29.744382000 +0200 > +++ src/sys/dev/netmap/netmap_freebsd.c 2017-05-25 20:35:53.858843000 > +0200 > @@ -259,9 +259,10 @@ > void > generic_find_num_queues(struct ifnet *ifp, u_int *txq, u_int *rxq) > { > - D("called, in txq %d rxq %d", *txq, *rxq); > - *txq =3D netmap_generic_rings; > - *rxq =3D netmap_generic_rings; > + u_int num_rings =3D netmap_generic_rings ? netmap_generic_rings := 1; > + > + *txq =3D num_rings; > + *rxq =3D num_rings; > } > > > --- src/sys/dev/netmap/netmap_kern.h.orig 2017-01-31 > 19:42:41.453502000 +0100 > +++ src/sys/dev/netmap/netmap_kern.h 2017-05-26 10:08:17.128420000 > +0200 > @@ -1284,6 +1284,12 @@ > > #endif /* linux */ > > +#define NM_NA_VALID(ifp) (NA(ifp) && \ > + ((uint32_t)(uintptr_t)NA(ifp) ^ NA(ifp)->magic) =3D=3D NETMAP_MAG= IC ) > + > + ((uint32_t)(uintptr_t)NA(ifp)) ^ NETMAP_MAGIC; \ > + } while(0) > + > #ifdef __FreeBSD__ > > /* Assigns the device IOMMU domain to an allocator. > --- src/sys/dev/netmap/netmap_generic.c.orig 2017-01-31 > 19:42:41.452980000 +0100 > +++ src/sys/dev/netmap/netmap_generic.c 2017-05-26 09:55:21.265066000 > +0200 > @@ -625,6 +625,10 @@ > u_int work_done; > u_int rr =3D MBUF_RXQ(m); // receive ring number > > + if (!NM_NA_VALID(ifp)) { > + return; > + } > + > if (rr >=3D na->num_rx_rings) { > rr =3D rr % na->num_rx_rings; // XXX expensive... > } > > In file included from > /usr/local/share/deploy-tools/RELENG_11/src/sys/modules/ > cxgbe/if_cxgbe/../../../dev/cxgbe/t4_netmap.c:52: > /usr/local/share/deploy-tools/RELENG_11/src/sys/dev/netmap/ > netmap_kern.h:1290:24: > error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int] > ((uint32_t)(uintptr_t)NA(ifp)) ^ NETMAP_MAGIC; \ > ^ > /usr/local/share/deploy-tools/RELENG_11/src/sys/dev/netmap/ > netmap_kern.h:1254:20: > note: expanded from macro 'NA' > #define NA(_ifp) ((struct netmap_adapter *)WNA(_ifp)) > ^ > /usr/local/share/deploy-tools/RELENG_11/src/sys/dev/netmap/ > netmap_kern.h:1290:27: > error: a parameter list without types is only allowed in a function > definition > ((uint32_t)(uintptr_t)NA(ifp)) ^ NETMAP_MAGIC; \ > ^ > /usr/local/share/deploy-tools/RELENG_11/src/sys/dev/netmap/ > netmap_kern.h:1290:24: > error: function cannot return function type 'int ()' > ((uint32_t)(uintptr_t)NA(ifp)) ^ NETMAP_MAGIC; \ > ^ > /usr/local/share/deploy-tools/RELENG_11/src/sys/dev/netmap/ > netmap_kern.h:1254:19: > note: expanded from macro 'NA' > #define NA(_ifp) ((struct netmap_adapter *)WNA(_ifp)) > ^ > /usr/local/share/deploy-tools/RELENG_11/src/sys/dev/netmap/ > netmap_kern.h:1290:24: > error: expected ')' > /usr/local/share/deploy-tools/RELENG_11/src/sys/dev/netmap/ > netmap_kern.h:1254:44: > note: expanded from macro 'NA' > #define NA(_ifp) ((struct netmap_adapter *)WNA(_ifp)) > ^ > /usr/local/share/deploy-tools/RELENG_11/src/sys/dev/netmap/ > netmap_kern.h:90:25: > note: expanded from macro 'WNA' > #define WNA(_ifp) (_ifp)->if_netmap > ^ > /usr/local/share/deploy-tools/RELENG_11/src/sys/dev/netmap/ > netmap_kern.h:1290:24: > note: to match this '(' > /usr/local/share/deploy-tools/RELENG_11/src/sys/dev/netmap/ > netmap_kern.h:1254:18: > note: expanded from macro 'NA' > #define NA(_ifp) ((struct netmap_adapter *)WNA(_ifp)) > > thanks, > > -harry > --=20 Vincenzo Maffione