svn commit: r360328 - in head/sys: kern sys x86/x86
Author: vangyzen Date: Sun Apr 26 00:41:29 2020 New Revision: 360328 URL: https://svnweb.freebsd.org/changeset/base/360328 Log: Fix handling of NMIs from unknown sources (BMC, hypervisor) Release kernels have no KDB backends enabled, so they discard an NMI if it is not due to a hardware failure. This includes NMIs from IPMI BMCs and hypervisors. Furthermore, the interaction of panic_on_nmi, kdb_on_nmi, and debugger_on_panic is confusing. Respond to all NMIs according to panic_on_nmi and debugger_on_panic. Remove kdb_on_nmi. Expand the meaning of panic_on_nmi by making it a bitfield. There are currently two bits: one for NMIs due to hardware failure, and one for all others. Leave room for more. If panic_on_nmi and debugger_on_panic are both true, don't actually panic, but directly enter the debugger, to allow someone to leave the debugger and [hopefully] resume normal execution. Reviewed by: kib MFC after:2 weeks Relnotes: yes: machdep.kdb_on_nmi is gone; machdep.panic_on_nmi changed Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D24558 Modified: head/sys/kern/kern_shutdown.c head/sys/sys/kdb.h head/sys/x86/x86/cpu_machdep.c Modified: head/sys/kern/kern_shutdown.c == --- head/sys/kern/kern_shutdown.c Sat Apr 25 23:35:49 2020 (r360327) +++ head/sys/kern/kern_shutdown.c Sun Apr 26 00:41:29 2020 (r360328) @@ -119,9 +119,9 @@ SYSCTL_INT(_kern, OID_AUTO, panic_reboot_wait_time, CT #ifdef KDB #ifdef KDB_UNATTENDED -static int debugger_on_panic = 0; +int debugger_on_panic = 0; #else -static int debugger_on_panic = 1; +int debugger_on_panic = 1; #endif SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RWTUN | CTLFLAG_SECURE, Modified: head/sys/sys/kdb.h == --- head/sys/sys/kdb.h Sat Apr 25 23:35:49 2020(r360327) +++ head/sys/sys/kdb.h Sun Apr 26 00:41:29 2020(r360328) @@ -65,6 +65,7 @@ struct kdb_dbbe { SET_DECLARE(kdb_dbbe_set, struct kdb_dbbe); extern u_char kdb_active; /* Non-zero while in debugger. */ +extern int debugger_on_panic; /* enter the debugger on panic. */ extern int debugger_on_trap; /* enter the debugger on trap. */ extern struct kdb_dbbe *kdb_dbbe; /* Default debugger backend or NULL. */ extern struct trapframe *kdb_frame;/* Frame to kdb_trap(). */ Modified: head/sys/x86/x86/cpu_machdep.c == --- head/sys/x86/x86/cpu_machdep.c Sat Apr 25 23:35:49 2020 (r360327) +++ head/sys/x86/x86/cpu_machdep.c Sun Apr 26 00:41:29 2020 (r360328) @@ -823,20 +823,14 @@ cpu_idle_tun(void *unused __unused) } SYSINIT(cpu_idle_tun, SI_SUB_CPU, SI_ORDER_MIDDLE, cpu_idle_tun, NULL); -static int panic_on_nmi = 1; +static int panic_on_nmi = 0xff; SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RWTUN, _on_nmi, 0, -"Panic on NMI raised by hardware failure"); +"Panic on NMI: 1 = H/W failure; 2 = unknown; 0xff = all"); int nmi_is_broadcast = 1; SYSCTL_INT(_machdep, OID_AUTO, nmi_is_broadcast, CTLFLAG_RWTUN, _is_broadcast, 0, "Chipset NMI is broadcast"); -#ifdef KDB -int kdb_on_nmi = 1; -SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RWTUN, -_on_nmi, 0, -"Go to KDB on NMI with unknown source"); -#endif void nmi_call_kdb(u_int cpu, u_int type, struct trapframe *frame) @@ -847,19 +841,31 @@ nmi_call_kdb(u_int cpu, u_int type, struct trapframe * /* machine/parity/power fail/"kitchen sink" faults */ if (isa_nmi(frame->tf_err)) { claimed = true; - if (panic_on_nmi) + if ((panic_on_nmi & 1) != 0) panic("NMI indicates hardware failure"); } #endif /* DEV_ISA */ + + /* +* NMIs can be useful for debugging. They can be hooked up to a +* pushbutton, usually on an ISA, PCI, or PCIe card. They can also be +* generated by an IPMI BMC, either manually or in response to a +* watchdog timeout. For example, see the "power diag" command in +* ports/sysutils/ipmitool. They can also be generated by a +* hypervisor; see "bhyvectl --inject-nmi". +*/ + #ifdef KDB - if (!claimed && kdb_on_nmi) { - /* -* NMI can be hooked up to a pushbutton for debugging. -*/ - printf("NMI/cpu%d ... going to debugger\n", cpu); - kdb_trap(type, 0, frame); + if (!claimed && (panic_on_nmi & 2) != 0) { + if (debugger_on_panic) { + printf("NMI/cpu%d ... going to debugger\n", cpu); + claimed = kdb_trap(type, 0, frame); + } } #endif /*
svn commit: r360325 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: pjd Date: Sat Apr 25 21:45:31 2020 New Revision: 360325 URL: https://svnweb.freebsd.org/changeset/base/360325 Log: Avoid the GEOM topology lock recursion when we automatically expand a pool. The steps to reproduce the problem: mdconfig -a -t swap -s 3g -u 0 gpart create -s GPT md0 gpart add -t freebsd-zfs -s 1g md0 zpool create -o autoexpand=on foo md0p1 gpart resize -i 1 -s 2g md0 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sat Apr 25 21:41:38 2020(r360324) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sat Apr 25 21:45:31 2020(r360325) @@ -973,18 +973,22 @@ static void vdev_geom_close(vdev_t *vd) { struct g_consumer *cp; + int locked; cp = vd->vdev_tsd; DROP_GIANT(); - g_topology_lock(); + locked = g_topology_locked(); + if (!locked) + g_topology_lock(); if (!vd->vdev_reopening || (cp != NULL && ((cp->flags & G_CF_ORPHAN) != 0 || (cp->provider != NULL && cp->provider->error != 0 vdev_geom_close_locked(vd); - g_topology_unlock(); + if (!locked) + g_topology_unlock(); PICKUP_GIANT(); } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r360323 - head/sys/geom
Author: pjd Date: Sat Apr 25 21:41:09 2020 New Revision: 360323 URL: https://svnweb.freebsd.org/changeset/base/360323 Log: Add g_topology_locked() macro that returns true if we already hold the GEOM topology lock. Modified: head/sys/geom/geom.h Modified: head/sys/geom/geom.h == --- head/sys/geom/geom.hSat Apr 25 20:24:41 2020(r360322) +++ head/sys/geom/geom.hSat Apr 25 21:41:09 2020(r360323) @@ -395,6 +395,8 @@ g_free(void *ptr) sx_xunlock(_lock); \ } while (0) +#define g_topology_locked()sx_xlocked(_lock) + #define g_topology_assert()\ do {\ sx_assert(_lock, SX_XLOCKED); \ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r360322 - head
Author: dim Date: Sat Apr 25 20:24:41 2020 New Revision: 360322 URL: https://svnweb.freebsd.org/changeset/base/360322 Log: Fix race between prebuilding libsbuf and libgeom The latter needs the former, but with a multi-job build on a fast machine, the race is sometimes lost. This leads to "ld: error: unable to find library -lsbuf", when linking libgeom.so. Submitted by: kevans MFC after:3 days Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Sat Apr 25 20:00:44 2020(r360321) +++ head/Makefile.inc1 Sat Apr 25 20:24:41 2020(r360322) @@ -2760,7 +2760,7 @@ gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw _prebuild_libs+= lib/libc++ .endif -lib/libgeom__L: lib/libexpat__L +lib/libgeom__L: lib/libexpat__L lib/libsbuf__L lib/libkvm__L: lib/libelf__L .if ${MK_LIBTHR} != "no" ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r360321 - head/release/arm64
Author: manu Date: Sat Apr 25 20:00:44 2020 New Revision: 360321 URL: https://svnweb.freebsd.org/changeset/base/360321 Log: release: arm64: rockpro64: Set hw.ncpu to 4 Since there is known issue with big.LITTLE set the number of CPU to 4 which is the number present in the LITTLE cluster. Modified: head/release/arm64/ROCKPRO64.conf Modified: head/release/arm64/ROCKPRO64.conf == --- head/release/arm64/ROCKPRO64.conf Sat Apr 25 18:23:23 2020 (r360320) +++ head/release/arm64/ROCKPRO64.conf Sat Apr 25 20:00:44 2020 (r360321) @@ -26,3 +26,10 @@ arm_install_uboot() { of=/dev/${mddev} bs=512 seek=16384 conv=sync return 0 } + +arm_do_quirk() { + echo '# Known issue with big.LITTLE' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf + echo 'hw.ncpu=4' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf +} ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r360311 - head/sys/arm64/rockchip
Author: manu Date: Sat Apr 25 15:34:48 2020 New Revision: 360311 URL: https://svnweb.freebsd.org/changeset/base/360311 Log: arm64: rockchip: rk805: Use a tailq for the attached regulator Store the attached regulator in a tailq to later find them in ofw_map. While here, do not attempt to attach a regulator without a name, a node might exists but if it doesn't have a name the regulator is unused. MFC after:1 month Modified: head/sys/arm64/rockchip/rk805.c Modified: head/sys/arm64/rockchip/rk805.c == --- head/sys/arm64/rockchip/rk805.c Sat Apr 25 15:29:06 2020 (r360310) +++ head/sys/arm64/rockchip/rk805.c Sat Apr 25 15:34:48 2020 (r360311) @@ -85,6 +85,11 @@ struct rk805_reg_sc { struct regnode_std_param *param; }; +struct reg_list { + TAILQ_ENTRY(reg_list) next; + struct rk805_reg_sc *reg; +}; + struct rk805_softc { device_tdev; struct mtx mtx; @@ -93,7 +98,7 @@ struct rk805_softc { struct intr_config_hook intr_hook; enum rk_pmic_type type; - struct rk805_reg_sc **regs; + TAILQ_HEAD(, reg_list) regs; int nregs; }; @@ -619,6 +624,7 @@ rk805_attach(device_t dev) struct rk805_softc *sc; struct rk805_reg_sc *reg; struct rk805_regdef *regdefs; + struct reg_list *regp; phandle_t rnode, child; int i; @@ -645,8 +651,7 @@ rk805_attach(device_t dev) return (ENXIO); } - sc->regs = malloc(sizeof(struct rk805_reg_sc *) * sc->nregs, - M_RK805_REG, M_WAITOK | M_ZERO); + TAILQ_INIT(>regs); rnode = ofw_bus_find_child(ofw_bus_get_node(dev), "regulators"); if (rnode > 0) { @@ -655,6 +660,8 @@ rk805_attach(device_t dev) regdefs[i].name); if (child == 0) continue; + if (OF_hasprop(child, "regulator-name") != 1) + continue; reg = rk805_reg_attach(dev, child, [i]); if (reg == NULL) { device_printf(dev, @@ -662,7 +669,9 @@ rk805_attach(device_t dev) regdefs[i].name); continue; } - sc->regs[i] = reg; + regp = malloc(sizeof(*regp), M_DEVBUF, M_WAITOK | M_ZERO); + regp->reg = reg; + TAILQ_INSERT_TAIL(>regs, regp, next); if (bootverbose) device_printf(dev, "Regulator %s attached\n", regdefs[i].name); @@ -685,13 +694,13 @@ rk805_map(device_t dev, phandle_t xref, int ncells, pcell_t *cells, intptr_t *id) { struct rk805_softc *sc; - int i; + struct reg_list *regp; sc = device_get_softc(dev); - for (i = 0; i < sc->nregs; i++) { - if (sc->regs[i]->xref == xref) { - *id = sc->regs[i]->def->id; + TAILQ_FOREACH(regp, >regs, next) { + if (regp->reg->xref == xref) { + *id = regp->reg->def->id; return (0); } } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r360306 - head/lib/libc/sys
Author: cem Date: Sat Apr 25 14:24:54 2020 New Revision: 360306 URL: https://svnweb.freebsd.org/changeset/base/360306 Log: libc: partially revert r326576 In r326576 ("use @@@ instead of @@ in __sym_default"), an earlier version of the phabricator-discussed patch was inadvertently committed. The commit message claims that @@@ means that weak is not needed, but that was due to a misunderstanding of the use of weak symbols in this context by the submitted in the first draft of the patch; the description text was not updated to match the discussion. As discussed in phabricator, weak is needed for symbol interposing because of the behavior of our rtld, and is widely used elsewhere in libc. This partial revert restores the approved version of the patch and permits symbol interposing for openat. Reported by: Raymond Ramsden Reviewed by: dim, emaste, kib (2017) Discussed with: kib (2020) Differential Revision:https://reviews.freebsd.org/D11653 Modified: head/lib/libc/sys/openat.c head/lib/libc/sys/setcontext.c head/lib/libc/sys/swapcontext.c Modified: head/lib/libc/sys/openat.c == --- head/lib/libc/sys/openat.c Sat Apr 25 13:18:29 2020(r360305) +++ head/lib/libc/sys/openat.c Sat Apr 25 14:24:54 2020(r360306) @@ -43,6 +43,7 @@ __sym_compat(openat, __impl_openat, FBSD_1.1); __weak_reference(openat, __impl_openat); __sym_default(openat, openat, FBSD_1.2); +#pragma weak openat int openat(int fd, const char *path, int flags, ...) { Modified: head/lib/libc/sys/setcontext.c == --- head/lib/libc/sys/setcontext.c Sat Apr 25 13:18:29 2020 (r360305) +++ head/lib/libc/sys/setcontext.c Sat Apr 25 14:24:54 2020 (r360306) @@ -42,6 +42,7 @@ __sym_compat(setcontext, __impl_setcontext, FBSD_1.0); __weak_reference(setcontext, __impl_setcontext); __sym_default(setcontext, setcontext, FBSD_1.2); +#pragma weak setcontext int setcontext(const ucontext_t *uc) { Modified: head/lib/libc/sys/swapcontext.c == --- head/lib/libc/sys/swapcontext.c Sat Apr 25 13:18:29 2020 (r360305) +++ head/lib/libc/sys/swapcontext.c Sat Apr 25 14:24:54 2020 (r360306) @@ -43,6 +43,7 @@ __sym_compat(swapcontext, __impl_swapcontext, FBSD_1.0 __weak_reference(swapcontext, __impl_swapcontext); __sym_default(swapcontext, swapcontext, FBSD_1.2); +#pragma weak swapcontext int swapcontext(ucontext_t *oucp, const ucontext_t *ucp) { ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r360296 - in head/sys: kern netinet netinet/tcp_stacks
Author: melifaro Date: Sat Apr 25 11:35:38 2020 New Revision: 360296 URL: https://svnweb.freebsd.org/changeset/base/360296 Log: Fix LINT build #2 after r360292. Pointyhat to: melifaro Modified: head/sys/kern/uipc_ktls.c head/sys/netinet/sctp_output.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/kern/uipc_ktls.c == --- head/sys/kern/uipc_ktls.c Sat Apr 25 10:31:56 2020(r360295) +++ head/sys/kern/uipc_ktls.c Sat Apr 25 11:35:38 2020(r360296) @@ -61,6 +61,8 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#include +#include #if defined(INET) || defined(INET6) #include #include Modified: head/sys/netinet/sctp_output.c == --- head/sys/netinet/sctp_output.c Sat Apr 25 10:31:56 2020 (r360295) +++ head/sys/netinet/sctp_output.c Sat Apr 25 11:35:38 2020 (r360296) @@ -13901,7 +13901,7 @@ sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_r sin = >ro_nh->gw4_sa; gwnetaddr.s_addr = (sin->sin_addr.s_addr & mask->sin_addr.s_addr); SCTPDBG(SCTP_DEBUG_OUTPUT1, "match_nexthop4: nexthop is "); - SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, >ro_nh->gw4_sa); + SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, >ro_nh->gw_sa); SCTPDBG(SCTP_DEBUG_OUTPUT1, "network address is %x\n", gwnetaddr.s_addr); if (srcnetaddr.s_addr == gwnetaddr.s_addr) { return (1); Modified: head/sys/netinet/tcp_stacks/rack.c == --- head/sys/netinet/tcp_stacks/rack.c Sat Apr 25 10:31:56 2020 (r360295) +++ head/sys/netinet/tcp_stacks/rack.c Sat Apr 25 11:35:38 2020 (r360296) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #define TCPSTATES /* for logging */ @@ -9778,8 +9779,8 @@ send: ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), NULL, NULL, inp); - if (error == EMSGSIZE && inp->inp_route6.ro_rt != NULL) - mtu = inp->inp_route6.ro_rt->rt_mtu; + if (error == EMSGSIZE && inp->inp_route6.ro_nh != NULL) + mtu = inp->inp_route6.ro_nh->nh_mtu; } #endif /* INET6 */ #if defined(INET) && defined(INET6) @@ -9819,8 +9820,8 @@ send: error = ip_output(m, tp->t_inpcb->inp_options, >inp_route, ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), 0, inp); - if (error == EMSGSIZE && inp->inp_route.ro_rt != NULL) - mtu = inp->inp_route.ro_rt->rt_mtu; + if (error == EMSGSIZE && inp->inp_route.ro_nh != NULL) + mtu = inp->inp_route.ro_nh->nh_mtu; } #endif /* INET */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r360295 - head/sys/netinet/tcp_stacks
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Am Sat, 25 Apr 2020 10:31:56 + (UTC) "Alexander V. Chernikov" schrieb: > Author: melifaro > Date: Sat Apr 25 10:31:56 2020 > New Revision: 360295 > URL: https://svnweb.freebsd.org/changeset/base/360295 > > Log: > Fix LINT build broken by r360292. > > Modified: > head/sys/netinet/tcp_stacks/bbr.c > > Modified: head/sys/netinet/tcp_stacks/bbr.c > == > --- head/sys/netinet/tcp_stacks/bbr.c Sat Apr 25 09:25:06 2020 > (r360294) > +++ head/sys/netinet/tcp_stacks/bbr.c Sat Apr 25 10:31:56 2020 > (r360295) > @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); > #include > > #include > +#include > #include > > #define TCPSTATES/* for logging */ > ___ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org" Make buildkernel still fails due to error shown below: [...] - --- all_subdir_tcp --- - --- rack.o --- /usr/src/sys/modules/tcp/rack/../../../netinet/tcp_stacks/rack.c:9781:44: error: no member named 'ro_rt' in 'struct route_in6' if (error == EMSGSIZE && inp->inp_route6.ro_rt != NULL) ~~~ ^ /usr/src/sys/modules/tcp/rack/../../../netinet/tcp_stacks/rack.c:9782:26: error: no member named 'ro_rt' in 'struct route_in6' mtu = inp->inp_route6.ro_rt->rt_mtu; ~~~ ^ /usr/src/sys/modules/tcp/rack/../../../netinet/tcp_stacks/rack.c:9822:43: error: no member named 'ro_rt' in 'struct route' if (error == EMSGSIZE && inp->inp_route.ro_rt != NULL) ~~ ^ /usr/src/sys/modules/tcp/rack/../../../netinet/tcp_stacks/rack.c:9823:25: error: no member named 'ro_rt' in 'struct route' mtu = inp->inp_route.ro_rt->rt_mtu; ~~ ^ - --- all_subdir_uart --- - -- O. Hartmann Ich widerspreche der Nutzung oder Übermittlung meiner Daten für Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4 BDSG). -BEGIN PGP SIGNATURE- iHUEARYIAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCXqQVlQAKCRA4N1ZZPba5 R27CAPwJ2fRgzivf12gJOAQJ89qHMLm+6U/EXLV+cCxiGkpv8wD8DWs2wiedbQF6 lxn9GSkDD9zijudPOrHUk66jppQoPwQ= =1ROx -END PGP SIGNATURE- ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r360295 - head/sys/netinet/tcp_stacks
Author: melifaro Date: Sat Apr 25 10:31:56 2020 New Revision: 360295 URL: https://svnweb.freebsd.org/changeset/base/360295 Log: Fix LINT build broken by r360292. Modified: head/sys/netinet/tcp_stacks/bbr.c Modified: head/sys/netinet/tcp_stacks/bbr.c == --- head/sys/netinet/tcp_stacks/bbr.c Sat Apr 25 09:25:06 2020 (r360294) +++ head/sys/netinet/tcp_stacks/bbr.c Sat Apr 25 10:31:56 2020 (r360295) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #define TCPSTATES /* for logging */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r360294 - head/sys/net
Author: melifaro Date: Sat Apr 25 09:25:06 2020 New Revision: 360294 URL: https://svnweb.freebsd.org/changeset/base/360294 Log: Fix userland build broken by r360292. Modified: head/sys/net/route.h Modified: head/sys/net/route.h == --- head/sys/net/route.hSat Apr 25 09:17:49 2020(r360293) +++ head/sys/net/route.hSat Apr 25 09:25:06 2020(r360294) @@ -331,6 +331,7 @@ struct rt_msghdr { #define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */ #define RTAX_MAX 8 /* size of array to allocate */ +struct rtentry; struct nhop_object; typedef int rt_filter_f_t(const struct rtentry *, const struct nhop_object *, void *); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r360293 - head/sys/arm64/rockchip
Author: mmel Date: Sat Apr 25 09:17:49 2020 New Revision: 360293 URL: https://svnweb.freebsd.org/changeset/base/360293 Log: Reorder initialization steps for given pin. If pin is switched from fixed function to GPIO, it should have prepared direction, pull-up/down and default value before function gets switched. Otherwise we may produce unwanted glitch on output pin. Right order of drive strength settings is questionable, but I think that is slightly safer to do it also before function switch. This fixes serial port corruption observed after DT 5.6 import. MFC after:1 week Modified: head/sys/arm64/rockchip/rk_pinctrl.c Modified: head/sys/arm64/rockchip/rk_pinctrl.c == --- head/sys/arm64/rockchip/rk_pinctrl.cSat Apr 25 09:06:11 2020 (r360292) +++ head/sys/arm64/rockchip/rk_pinctrl.cSat Apr 25 09:17:49 2020 (r360293) @@ -932,7 +932,28 @@ rk_pinctrl_configure_pin(struct rk_pinctrl_softc *sc, /* Find syscon */ syscon = sc->conf->get_syscon(sc, bank); - /* Parse pin function */ + /* Setup GPIO properties first */ + rv = rk_pinctrl_handle_io(sc, pin_conf, bank, pin); + + /* Then pin pull-up/down */ + bias = sc->conf->parse_bias(pin_conf, bank); + if (bias >= 0) { + reg = sc->conf->get_pd_offset(sc, bank); + reg += bank * 0x10 + ((pin / 8) * 0x4); + bit = (pin % 8) * 2; + mask = (0x3 << bit); + SYSCON_MODIFY_4(syscon, reg, mask, bias << bit | (mask << 16)); + } + + /* Then drive strength */ + rv = rk_pinctrl_parse_drive(sc, pin_conf, bank, subbank, , ); + if (rv == 0) { + bit = (pin % 8) * 2; + mask = (0x3 << bit); + SYSCON_MODIFY_4(syscon, reg, mask, drive << bit | (mask << 16)); + } + + /* Finally set the pin function */ reg = sc->conf->iomux_conf[i].offset; switch (sc->conf->iomux_conf[i].nbits) { case 4: @@ -966,28 +987,6 @@ rk_pinctrl_configure_pin(struct rk_pinctrl_softc *sc, * without hi-word write mask. */ SYSCON_MODIFY_4(syscon, reg, mask, function << bit | (mask << 16)); - - /* Pull-Up/Down */ - bias = sc->conf->parse_bias(pin_conf, bank); - if (bias >= 0) { - reg = sc->conf->get_pd_offset(sc, bank); - - reg += bank * 0x10 + ((pin / 8) * 0x4); - bit = (pin % 8) * 2; - mask = (0x3 << bit); - SYSCON_MODIFY_4(syscon, reg, mask, bias << bit | (mask << 16)); - } - - /* Drive Strength */ - rv = rk_pinctrl_parse_drive(sc, pin_conf, bank, subbank, , ); - if (rv == 0) { - bit = (pin % 8) * 2; - mask = (0x3 << bit); - SYSCON_MODIFY_4(syscon, reg, mask, drive << bit | (mask << 16)); - } - - /* Input/Outpot + default level */ - rv = rk_pinctrl_handle_io(sc, pin_conf, bank, pin); } static int ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r360292 - in head/sys: kern net netinet netinet/tcp_stacks netinet6
Author: melifaro Date: Sat Apr 25 09:06:11 2020 New Revision: 360292 URL: https://svnweb.freebsd.org/changeset/base/360292 Log: Convert route caching to nexthop caching. This change is build on top of nexthop objects introduced in r359823. Nexthops are separate datastructures, containing all necessary information to perform packet forwarding such as gateway interface and mtu. Nexthops are shared among the routes, providing more pre-computed cache-efficient data while requiring less memory. Splitting the LPM code and the attached data solves multiple long-standing problems in the routing layer, drastically reduces the coupling with outher parts of the stack and allows to transparently introduce faster lookup algorithms. Route caching was (re)introduced to minimise (slow) routing lookups, allowing for notably better performance for large TCP senders. Caching works by acquiring rtentry reference, which is protected by per-rtentry mutex. If the routing table is changed (checked by comparing the rtable generation id) or link goes down, cache record gets withdrawn. Nexthops have the same reference counting interface, backed by refcount(9). This change merely replaces rtentry with the actual forwarding nextop as a cached object, which is mostly mechanical. Other moving parts like cache cleanup on rtable change remains the same. Differential Revision:https://reviews.freebsd.org/D24340 Modified: head/sys/kern/uipc_ktls.c head/sys/net/radix_mpath.c head/sys/net/route.c head/sys/net/route.h head/sys/net/route_var.h head/sys/netinet/in_fib.c head/sys/netinet/in_fib.h head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_var.h head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_subr.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/in6.h head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_src.c head/sys/netinet6/ip6_output.c head/sys/netinet6/ip6_var.h Modified: head/sys/kern/uipc_ktls.c == --- head/sys/kern/uipc_ktls.c Sat Apr 25 06:42:46 2020(r360291) +++ head/sys/kern/uipc_ktls.c Sat Apr 25 09:06:11 2020(r360292) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef RSS #include +#include #include #endif #if defined(INET) || defined(INET6) @@ -754,7 +755,7 @@ ktls_alloc_snd_tag(struct inpcb *inp, struct ktls_sess { union if_snd_tag_alloc_params params; struct ifnet *ifp; - struct rtentry *rt; + struct nhop_object *nh; struct tcpcb *tp; int error; @@ -792,12 +793,12 @@ ktls_alloc_snd_tag(struct inpcb *inp, struct ktls_sess * enabled after a connection has completed key negotiation in * userland, the cached route will be present in practice. */ - rt = inp->inp_route.ro_rt; - if (rt == NULL || rt->rt_ifp == NULL) { + nh = inp->inp_route.ro_nh; + if (nh == NULL) { INP_RUNLOCK(inp); return (ENXIO); } - ifp = rt->rt_ifp; + ifp = nh->nh_ifp; if_ref(ifp); params.hdr.type = IF_SND_TAG_TYPE_TLS; Modified: head/sys/net/radix_mpath.c == --- head/sys/net/radix_mpath.c Sat Apr 25 06:42:46 2020(r360291) +++ head/sys/net/radix_mpath.c Sat Apr 25 09:06:11 2020(r360292) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -257,42 +259,41 @@ rt_mpath_select(struct rtentry *rte, uint32_t hash) void rtalloc_mpath_fib(struct route *ro, uint32_t hash, u_int fibnum) { - struct rtentry *rt; + struct rtentry *rt, *rt_tmp; /* * XXX we don't attempt to lookup cached route again; what should * be done for sendto(3) case? */ - if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP) - && RT_LINK_IS_UP(ro->ro_rt->rt_ifp)) + if (ro->ro_nh && RT_LINK_IS_UP(ro->ro_nh->nh_ifp)) return; - ro->ro_rt = rtalloc1_fib(>ro_dst, 1, 0, fibnum); + ro->ro_nh = NULL; + rt_tmp = rtalloc1_fib(>ro_dst, 1, 0, fibnum); /* if the route does not exist or it is not multipath, don't care */ - if (ro->ro_rt == NULL) + if (rt_tmp == NULL) return; - if (rn_mpath_next((struct radix_node *)ro->ro_rt) == NULL) { - RT_UNLOCK(ro->ro_rt); + if (rn_mpath_next((struct radix_node *)rt_tmp) == NULL) { + ro->ro_nh = rt_tmp->rt_nhop; +