From owner-freebsd-net@freebsd.org Thu Oct 4 07:49:14 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E13E10C3081 for ; Thu, 4 Oct 2018 07:49:14 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id AE2B3887E5 for ; Thu, 4 Oct 2018 07:49:13 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 70FC610C3080; Thu, 4 Oct 2018 07:49:13 +0000 (UTC) Delivered-To: net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E55710C307F for ; Thu, 4 Oct 2018 07:49:13 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF9CB887D4; Thu, 4 Oct 2018 07:49:12 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: by mail-qt1-x835.google.com with SMTP id b4-v6so796842qtc.7; Thu, 04 Oct 2018 00:49:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ONTA2LZXhniqE8i6PjRjYF4D/36ekXcoZsVxHdTKooo=; b=eb25kt3mh+SHbS29q/ayAikqkQ9+nVkK6HFpnJpohBxx70HE36FQ5PPdfmccVWQrAM Fgc6l6fRl8Y4h0BV/R4etQvV3QCxuRhd7p0pzI66A2XWl2oRyEfOaMbH17BTSGSlI1yr SPpf/0xF/YLqedZdr1hKOFrLnTlNMRAYEp7tI8AdqDhtbFD2SzVwW7hR08RI80tv3mvO vaMajbQ29ohHSPl7kFLx1Xh9WkXNA2vQ3a+rjoyfiz1dPvy7y32b7gM6PBR1iyZXHK4u op6NhzkZ87tGr46MaTxeZJeifPhxvK6LA9KMt2ETOzjx6+V8Jzpq9zpcZyHzouvfZXXx gbrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ONTA2LZXhniqE8i6PjRjYF4D/36ekXcoZsVxHdTKooo=; b=ZYnqZ67/CUX0szqmlnKUwO24t2RdkIHnL8TdLLY3LLWb1a0Jz9vKqk3ObUjkiAPS5v yWWTmdZs/h6ehp4Bh05m4hQlQZdFhai8fmvjefGI1OFVRsHAngVsNYgCiXhy2NOMzSkX bvkI5UQCSUtMvrur0r/pqrGJOH8Ub/Y79VRIniwkHbM+QXTtTEHfQCGRxIG2+KcZl2L8 vMK8u6m7g8gAXIrJiQexspDKDVzIXWVjVE0NAv+qtva19pyxerXK4LK9sQxGbLEIxP9g h7eqFwinNDRs/M8IgyS3BMPBjXCz260LJeo9/eLPzYhkzk3kfYmldkopgwpX+4zUDKvx aaXQ== X-Gm-Message-State: ABuFfoizUsg3WuwKvH/Ye2oVYUuI0/Ib2lKUyBZxvjBmsEqxI3jvsetw QCIbP55Q6tYwt0eiFmQdbwNii59GVjNecQsTEIIYbJ0S X-Google-Smtp-Source: ACcGV60Kjo9pTQwC54QK5NKulcwVJNQQdVhjF9G8X9t0+qK12xgsqbEnRaITg7gZIYChtaflGX5k5UugA7XuShUP4Ro= X-Received: by 2002:a0c:8c44:: with SMTP id o4-v6mr4120933qvb.179.1538639352018; Thu, 04 Oct 2018 00:49:12 -0700 (PDT) MIME-Version: 1.0 References: <20180901014953.GV45503@funkthat.com> In-Reply-To: From: Vincenzo Maffione Date: Thu, 4 Oct 2018 09:48:59 +0200 Message-ID: Subject: Re: vale and netmap module questions To: "K. Macy" Cc: "freebsd-net@freebsd.org" , Luigi Rizzo Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Oct 2018 07:49:14 -0000 Hi, I fixed this upstream in this commit https://github.com/luigirizzo/netmap/commit/282f404ccb4fc777056a591127060e29657c9ab7 I will apply the change into FreeBSD as soon as HEAD thaws. Cheers, Vincenzo Il giorno gio 4 ott 2018 alle ore 00:36 K. Macy ha scritto: > On Fri, Aug 31, 2018 at 6:50 PM John-Mark Gurney wrote: > > > > First, does vale work for anyone? At least one of the documented > > commands in vale(4) does not work. > > > The documentation with respect to naming is wrong. I didn't have a bit > when I was using it so never got around to fixing it. > > > > After manually building the netmap module and loading it: > > # tcpdump -ni vale-a:1 > > 313.748851 nm_open [947] invalid bridge name vale-a:1 > > tcpdump: netmap open: cannot access vale-a:1: Invalid argument > > > > If I run tcpdump with a more correct looking name of vale1:a, I get a > > null deref panic in ifunit_ref. Full trace is at the end. > > > > Second, is there a good reason why the netmap module is still > > disconnected from being built as a module? I guess not working > > would be one, but I figure the above might be an aarch64 specific > > problem, and not a general issue. > > > > FreeBSD generic 12.0-ALPHA3 FreeBSD 12.0-ALPHA3 #0 r338296M: Sat Aug 25 > 06:17:25 UTC 2018 freebsd@generic:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC > arm64 > > > > netmap: loaded module > > Fatal data abort: > > x0: ffff00005894f900 > > x1: ffff000040351028 > > x2: 5 > > x3: ffff0000405e4090 > > x4: 4000 > > x5: 0 > > x6: 0 > > x7: ffff000040351cb0 > > x8: 0 > > x9: ffff000000a09960 > > x10: ffff00005894f908 > > x11: 0 > > x12: 1 > > x13: fffffcffc0000000 > > x14: 3 > > x15: 10000 > > x16: ffff00005cd35580 > > x17: ffff000000476de0 > > x18: ffff000040351010 > > x19: ffff000040351160 > > x20: fffffd000739798e > > x21: ffff000000a02000 > > x22: 1 > > x23: 0 > > x24: fffffd0007397988 > > x25: 0 > > x26: 1 > > x27: 0 > > x28: fffffd0007397982 > > x29: ffff000040351050 > > sp: ffff000040351010 > > lr: ffff000000476e0c > > elr: ffff000000476e1c > > spsr: 60000345 > > far: 28 > > esr: 96000007 > > [ thread pid 802 tid 100096 ] > > Stopped at ifunit_ref+0x3c: ldr x8, [x8, #40] > > db> bt > > Tracing pid 802 tid 100096 td 0xfffffd0007422000 > > db_trace_self() at db_stack_trace+0xf0 > > pc = 0xffff00000069b81c lr = 0xffff0000000d6b28 > > sp = 0xffff000040350920 fp = 0xffff000040350950 > > > > db_stack_trace() at db_command+0x220 > > pc = 0xffff0000000d6b28 lr = 0xffff0000000d67ac > > sp = 0xffff000040350960 fp = 0xffff000040350a40 > > > > db_command() at db_command_loop+0x60 > > pc = 0xffff0000000d67ac lr = 0xffff0000000d6570 > > sp = 0xffff000040350a50 fp = 0xffff000040350a70 > > > > db_command_loop() at db_trap+0xf4 > > pc = 0xffff0000000d6570 lr = 0xffff0000000d9694 > > sp = 0xffff000040350a80 fp = 0xffff000040350ca0 > > > > db_trap() at kdb_trap+0x1d8 > > pc = 0xffff0000000d9694 lr = 0xffff0000003cdf70 > > sp = 0xffff000040350cb0 fp = 0xffff000040350d60 > > > > kdb_trap() at data_abort+0x1e0 > > pc = 0xffff0000003cdf70 lr = 0xffff0000006b5ca4 > > sp = 0xffff000040350d70 fp = 0xffff000040350e20 > > > > data_abort() at do_el1h_sync+0x11c > > pc = 0xffff0000006b5ca4 lr = 0xffff0000006b59c0 > > sp = 0xffff000040350e30 fp = 0xffff000040350e60 > > > > do_el1h_sync() at handle_el1h_sync+0x74 > > pc = 0xffff0000006b59c0 lr = 0xffff00000069d874 > > sp = 0xffff000040350e70 fp = 0xffff000040350f80 > > > > handle_el1h_sync() at ifunit_ref+0x28 > > pc = 0xffff00000069d874 lr = 0xffff000000476e08 > > sp = 0xffff000040350f90 fp = 0xffff000040351050 > > > > ifunit_ref() at netmap_get_bdg_na+0x194 > > pc = 0xffff000000476e08 lr = 0xffff00005cd20b24 > > sp = 0xffff000040351060 fp = 0xffff0000403510c0 > > > > netmap_get_bdg_na() at netmap_get_na+0x1b0 > > pc = 0xffff00005cd20b24 lr = 0xffff00005cd15994 > > sp = 0xffff0000403510d0 fp = 0xffff000040351120 > > > > netmap_get_na() at netmap_ioctl+0xcd0 > > pc = 0xffff00005cd15994 lr = 0xffff00005cd18160 > > sp = 0xffff000040351130 fp = 0xffff0000403511f0 > > > > netmap_ioctl() at netmap_ioctl_legacy+0x4b8 > > pc = 0xffff00005cd18160 lr = 0xffff00005cd2b188 > > sp = 0xffff000040351200 fp = 0xffff0000403515b0 > > > > netmap_ioctl_legacy() at netmap_ioctl+0x15c > > pc = 0xffff00005cd2b188 lr = 0xffff00005cd175ec > > sp = 0xffff0000403515c0 fp = 0xffff000040351680 > > > > netmap_ioctl() at freebsd_netmap_ioctl+0x4c > > pc = 0xffff00005cd175ec lr = 0xffff00005cd25f94 > > sp = 0xffff000040351690 fp = 0xffff0000403516b0 > > > > freebsd_netmap_ioctl() at devfs_ioctl+0xc4 > > pc = 0xffff00005cd25f94 lr = 0xffff00000025f1ac > > sp = 0xffff0000403516c0 fp = 0xffff000040351700 > > > > devfs_ioctl() at VOP_IOCTL_APV+0xa8 > > pc = 0xffff00000025f1ac lr = 0xffff0000006ef704 > > sp = 0xffff000040351710 fp = 0xffff000040351730 > > > > VOP_IOCTL_APV() at vn_ioctl+0x110 > > pc = 0xffff0000006ef704 lr = 0xffff00000045c828 > > sp = 0xffff000040351740 fp = 0xffff000040351840 > > > > vn_ioctl() at devfs_ioctl_f+0x24 > > pc = 0xffff00000045c828 lr = 0xffff00000025f818 > > sp = 0xffff000040351850 fp = 0xffff000040351860 > > > > devfs_ioctl_f() at kern_ioctl+0x358 > > pc = 0xffff00000025f818 lr = 0xffff0000003f130c > > sp = 0xffff000040351870 fp = 0xffff0000403518c0 > > > > kern_ioctl() at sys_ioctl+0x15c > > pc = 0xffff0000003f130c lr = 0xffff0000003f0f64 > > sp = 0xffff0000403518d0 fp = 0xffff0000403519a0 > > > > sys_ioctl() at do_el0_sync+0x4b8 > > pc = 0xffff0000003f0f64 lr = 0xffff0000006b61f8 > > sp = 0xffff0000403519b0 fp = 0xffff000040351a70 > > > > do_el0_sync() at handle_el0_sync+0x84 > > pc = 0xffff0000006b61f8 lr = 0xffff00000069da00 > > sp = 0xffff000040351a80 fp = 0xffff000040351b90 > > > > handle_el0_sync() at 0x401996f4 > > pc = 0xffff00000069da00 lr = 0x00000000401996f4 > > sp = 0xffff000040351ba0 fp = 0x0000ffffffffe2f0 > > > > Line number maps: > > (kgdb) list *ifunit_ref+0x28 > > 0xffff000000476e08 is in ifunit_ref (/usr/src/sys/net/if.c:2417). > > 2412 struct ifnet * > > 2413 ifunit_ref(const char *name) > > 2414 { > > 2415 struct ifnet *ifp; > > 2416 > > 2417 IFNET_RLOCK_NOSLEEP(); > > 2418 CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { > > 2419 if (strncmp(name, ifp->if_xname, IFNAMSIZ) == 0 > && > > 2420 !(ifp->if_flags & IFF_DYING)) > > 2421 break; > > > > Following look to be correct, but modules don't build by default w/ > > debug symbols, so I had to rebuild the module... > > > > Reading symbols from > /usr/obj/usr/src/arm64.aarch64/sys/modules/netmap/netmap.kld...done. > > (kgdb) list *netmap_get_bdg_na+0x194 > > 0xcb18 is in netmap_get_bdg_na > (/usr/src/sys/dev/netmap/netmap_vale.c:931). > > 926 /* > > 927 * try see if there is a matching NIC with this name > > 928 * (after the bridge's name) > > 929 */ > > 930 ifname = nr_name + b->bdg_namelen + 1; > > 931 ifp = ifunit_ref(ifname); > > 932 if (!ifp) { > > 933 /* Create an ephemeral virtual port. > > 934 * This block contains all the > ephemeral-specific logic. > > 935 */ > > (kgdb) list *netmap_get_na+0x1b0 > > 0x1994 is in netmap_get_na (/usr/src/sys/dev/netmap/netmap.c:1538). > > 1533 error = netmap_get_pipe_na(hdr, na, nmd, create); > > 1534 if (error || *na != NULL) > > 1535 goto out; > > 1536 > > 1537 /* try to see if this is a bridge port */ > > 1538 error = netmap_get_bdg_na(hdr, na, nmd, create); > > 1539 if (error) > > 1540 goto out; > > 1541 > > 1542 if (*na != NULL) /* valid match in netmap_get_bdg_na() */ > > > > Thanks. > > > > -- > > John-Mark Gurney Voice: +1 415 225 5579 > > > > "All that I will do, has been done, All that I have, has not." > > _______________________________________________ > > freebsd-net@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-net > > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > -- Vincenzo