From owner-freebsd-net@freebsd.org Wed Oct 3 22:36:05 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 765EA10AFEA3 for ; Wed, 3 Oct 2018 22:36:05 +0000 (UTC) (envelope-from kmacybsd@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 096BD73464 for ; Wed, 3 Oct 2018 22:36:05 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id BF19210AFEA2; Wed, 3 Oct 2018 22:36:04 +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 9D06B10AFEA1 for ; Wed, 3 Oct 2018 22:36:04 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (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 247DE73463 for ; Wed, 3 Oct 2018 22:36:04 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: by mail-lj1-f194.google.com with SMTP id p89-v6so6619157ljb.3 for ; Wed, 03 Oct 2018 15:36:03 -0700 (PDT) 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; bh=oXgmTNXq1cBcVtQ8gC1hocgx6HjJoKGGfDc0kRL5K6w=; b=ElGDgi4BTLI+d0C78sStkujrJ0y5kaWb3aoh1RwZzWSM6AqlXtOIsajYI1O9HK7LG6 J4CiQWGHCs1Hhc6pf5Z77sIlPGBBIUVoUOwQmCOJRCBUsvmMxvByBIkjsdxka1vJGV5n yHlafOJaDLgTGiRzGrQgrTI/CLRR0Bg0zQ2nOiAPedCtB2u+06M8vkTnMQgx4ATwOnmB l5ZD8NHE2s4SPpp1bnvSWrssaxdzSOmDzx2Q/1gZoNVveXHZJe3KpvDs8W0yjG4YPigO qsy4d+49XZ+pBWoef7iEfU6NW1xrj6fuisFu6QrVAhZG8TkC1GhKe2Gx6HjRxRK8GS+H rc8g== X-Gm-Message-State: ABuFfoi4X99KFT1W6X8WSRO/s8O5s28yPGsi5g1xiCccwnRxMWIzN+j+ 0vEnRuToLVqlBGlb1OnTimm+TrVwZn6j5YaC3Q2w9g== X-Google-Smtp-Source: ACcGV60FxF+cf8CsqIgP1IogNbvL619iP2HOQF7OSBd2F++3btsY1xoyHqG2Pn+LW2bIbtOsr2XkHVLT/T9sBffUH8I= X-Received: by 2002:a2e:2d0a:: with SMTP id t10-v6mr2538378ljt.8.1538605657400; Wed, 03 Oct 2018 15:27:37 -0700 (PDT) MIME-Version: 1.0 References: <20180901014953.GV45503@funkthat.com> In-Reply-To: <20180901014953.GV45503@funkthat.com> From: "K. Macy" Date: Wed, 3 Oct 2018 15:27:25 -0700 Message-ID: Subject: Re: vale and netmap module questions To: FreeBSD Net , Luigi Rizzo Content-Type: text/plain; charset="UTF-8" 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: Wed, 03 Oct 2018 22:36:05 -0000 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"