svn commit: r302370 - head/sys/contrib/ipfilter/netinet
Author: bz Date: Wed Jul 6 10:29:29 2016 New Revision: 302370 URL: https://svnweb.freebsd.org/changeset/base/302370 Log: Only set the ipfilter running state to 'not running' if we are doing the teardown. ipf_destroy_all() may free ipfmain in case of ipf_dynamic_softc being true, thus we are avoiding a possible memory modified after free as well. Reported by: Coverity Coverity CID: 1357320 Approved by: re (hrs) MFC after:10 days Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c == --- head/sys/contrib/ipfilter/netinet/mlfk_ipl.cWed Jul 6 05:17:56 2016(r302369) +++ head/sys/contrib/ipfilter/netinet/mlfk_ipl.cWed Jul 6 10:29:29 2016(r302370) @@ -291,13 +291,14 @@ vnet_ipf_uninit(void) return; if (V_ipfmain.ipf_running >= 0) { + if (ipfdetach(&V_ipfmain) != 0) return; + V_ipfmain.ipf_running = -2; + ipf_destroy_all(&V_ipfmain); } - - V_ipfmain.ipf_running = -2; } VNET_SYSUNINIT(vnet_ipf_uninit, SI_SUB_PROTO_FIREWALL, SI_ORDER_THIRD, vnet_ipf_uninit, NULL); ___ 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: r302371 - head/sys/dev/usb/controller
Author: hselasky Date: Wed Jul 6 10:57:04 2016 New Revision: 302371 URL: https://svnweb.freebsd.org/changeset/base/302371 Log: Fix regression issue with XHCI on 32-bit ARMv7 Armada-38x. Make sure "struct xhci_dev_ctx_addr" fits into a single 4K page until further. Approved by: re (hrs) MFC after:1 week Modified: head/sys/dev/usb/controller/xhci.h Modified: head/sys/dev/usb/controller/xhci.h == --- head/sys/dev/usb/controller/xhci.h Wed Jul 6 10:29:29 2016 (r302370) +++ head/sys/dev/usb/controller/xhci.h Wed Jul 6 10:57:04 2016 (r302371) @@ -30,7 +30,7 @@ #defineXHCI_MAX_DEVICESMIN(USB_MAX_DEVICES, 128) #defineXHCI_MAX_ENDPOINTS 32 /* hardcoded - do not change */ -#defineXHCI_MAX_SCRATCHPADS1024 +#defineXHCI_MAX_SCRATCHPADS256 /* theoretical max is 1023 */ #defineXHCI_MAX_EVENTS (16 * 13) #defineXHCI_MAX_COMMANDS (16 * 1) #defineXHCI_MAX_RSEG 1 ___ 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: r302372 - in head/sys: amd64/include cddl/compat/opensolaris/sys dev/cpuctl i386/include kern net netinet powerpc/include powerpc/powerpc vm
Author: nwhitehorn Date: Wed Jul 6 14:09:49 2016 New Revision: 302372 URL: https://svnweb.freebsd.org/changeset/base/302372 Log: Replace a number of conflations of mp_ncpus and mp_maxid with either mp_maxid or CPU_FOREACH() as appropriate. This fixes a number of places in the kernel that assumed CPU IDs are dense in [0, mp_ncpus) and would try, for example, to run tasks on CPUs that did not exist or to allocate too few buffers on systems with sparse CPU IDs in which there are holes in the range and mp_maxid > mp_ncpus. Such circumstances generally occur on systems with SMT, but on which SMT is disabled. This patch restores system operation at least on POWER8 systems configured in this way. There are a number of other places in the kernel with potential problems in these situations, but where sparse CPU IDs are not currently known to occur, mostly in the ARM machine-dependent code. These will be fixed in a follow-up commit after the stable/11 branch. PR: kern/210106 Reviewed by: jhb Approved by: re (glebius) Modified: head/sys/amd64/include/counter.h head/sys/cddl/compat/opensolaris/sys/proc.h head/sys/dev/cpuctl/cpuctl.c head/sys/i386/include/counter.h head/sys/kern/subr_pcpu.c head/sys/kern/subr_taskqueue.c head/sys/net/flowtable.c head/sys/net/iflib.c head/sys/netinet/ip_id.c head/sys/powerpc/include/counter.h head/sys/powerpc/powerpc/mp_machdep.c head/sys/vm/uma.h head/sys/vm/uma_core.c Modified: head/sys/amd64/include/counter.h == --- head/sys/amd64/include/counter.hWed Jul 6 10:57:04 2016 (r302371) +++ head/sys/amd64/include/counter.hWed Jul 6 14:09:49 2016 (r302372) @@ -51,7 +51,7 @@ counter_u64_fetch_inline(uint64_t *p) int i; r = 0; - for (i = 0; i < mp_ncpus; i++) + CPU_FOREACH(i) r += counter_u64_read_one((uint64_t *)p, i); return (r); Modified: head/sys/cddl/compat/opensolaris/sys/proc.h == --- head/sys/cddl/compat/opensolaris/sys/proc.h Wed Jul 6 10:57:04 2016 (r302371) +++ head/sys/cddl/compat/opensolaris/sys/proc.h Wed Jul 6 14:09:49 2016 (r302372) @@ -45,8 +45,8 @@ #defineCPU curcpu #defineminclsyspri PRIBIO #definemaxclsyspri PVM -#definemax_ncpus mp_ncpus -#defineboot_max_ncpus mp_ncpus +#definemax_ncpus (mp_maxid + 1) +#defineboot_max_ncpus (mp_maxid + 1) #defineTS_RUN 0 Modified: head/sys/dev/cpuctl/cpuctl.c == --- head/sys/dev/cpuctl/cpuctl.cWed Jul 6 10:57:04 2016 (r302371) +++ head/sys/dev/cpuctl/cpuctl.cWed Jul 6 14:09:49 2016 (r302372) @@ -120,7 +120,7 @@ static void set_cpu(int cpu, struct thread *td) { - KASSERT(cpu >= 0 && cpu < mp_ncpus && cpu_enabled(cpu), + KASSERT(cpu >= 0 && cpu <= mp_maxid && cpu_enabled(cpu), ("[cpuctl,%d]: bad cpu number %d", __LINE__, cpu)); thread_lock(td); sched_bind(td, cpu); @@ -133,7 +133,7 @@ static void restore_cpu(int oldcpu, int is_bound, struct thread *td) { - KASSERT(oldcpu >= 0 && oldcpu < mp_ncpus && cpu_enabled(oldcpu), + KASSERT(oldcpu >= 0 && oldcpu <= mp_maxid && cpu_enabled(oldcpu), ("[cpuctl,%d]: bad cpu number %d", __LINE__, oldcpu)); thread_lock(td); if (is_bound == 0) @@ -150,7 +150,7 @@ cpuctl_ioctl(struct cdev *dev, u_long cm int ret; int cpu = dev2unit(dev); - if (cpu >= mp_ncpus || !cpu_enabled(cpu)) { + if (cpu > mp_maxid || !cpu_enabled(cpu)) { DPRINTF("[cpuctl,%d]: bad cpu number %d\n", __LINE__, cpu); return (ENXIO); } @@ -201,7 +201,7 @@ cpuctl_do_cpuid_count(int cpu, cpuctl_cp int is_bound = 0; int oldcpu; - KASSERT(cpu >= 0 && cpu < mp_ncpus, + KASSERT(cpu >= 0 && cpu <= mp_maxid, ("[cpuctl,%d]: bad cpu number %d", __LINE__, cpu)); /* Explicitly clear cpuid data to avoid returning stale info. */ @@ -245,7 +245,7 @@ cpuctl_do_msr(int cpu, cpuctl_msr_args_t int oldcpu; int ret; - KASSERT(cpu >= 0 && cpu < mp_ncpus, + KASSERT(cpu >= 0 && cpu <= mp_maxid, ("[cpuctl,%d]: bad cpu number %d", __LINE__, cpu)); /* @@ -296,7 +296,7 @@ cpuctl_do_update(int cpu, cpuctl_update_ char vendor[13]; int ret; - KASSERT(cpu >= 0 && cpu < mp_ncpus, + KASSERT(cpu >= 0 && cpu <= mp_maxid, ("[cpuctl,%d]: bad cpu number %d", __LINE__, cpu)); DPRINTF("[cpuctl,%d]: XXX %d", __LINE__, cpu); @@ -512,7 +512,7 @@ cpuctl_open(struct cdev *dev, int flags, int cpu; cpu = dev2unit(dev); -
svn commit: r302373 - head/usr.sbin/bhyve
Author: ngie Date: Wed Jul 6 16:02:15 2016 New Revision: 302373 URL: https://svnweb.freebsd.org/changeset/base/302373 Log: Fix CTASSERT issue in a more clean way - Replace all CTASSERT macro instances with static_assert's. - Remove the WRAPPED_CTASSERT macro; it's now an unnecessary obfuscation. - Localize all static_assert's to the structures being tested. - Sort some headers per-style(9). Approved by: re (hrs) Differential Revision: https://reviews.freebsd.org/D7130 MFC after: 1 week X-MFC with: r302364 Reviewed by: ed, grehan (maintainer) Submitted by: ed Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bhyve/bhyverun.h head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h head/usr.sbin/bhyve/task_switch.c Modified: head/usr.sbin/bhyve/bhyverun.h == --- head/usr.sbin/bhyve/bhyverun.h Wed Jul 6 14:09:49 2016 (r302372) +++ head/usr.sbin/bhyve/bhyverun.h Wed Jul 6 16:02:15 2016 (r302373) @@ -29,12 +29,6 @@ #ifndef_FBSDRUN_H_ #define_FBSDRUN_H_ -#ifndef CTASSERT /* Allow lint to override */ -#defineCTASSERT(x) _CTASSERT(x, __LINE__) -#define_CTASSERT(x, y) __CTASSERT(x, y) -#define__CTASSERT(x, y)typedef char __assert ## y[(x) ? 1 : -1] -#endif - #defineVMEXIT_CONTINUE (0) #defineVMEXIT_ABORT(-1) Modified: head/usr.sbin/bhyve/pci_emul.c == --- head/usr.sbin/bhyve/pci_emul.c Wed Jul 6 14:09:49 2016 (r302372) +++ head/usr.sbin/bhyve/pci_emul.c Wed Jul 6 16:02:15 2016 (r302373) @@ -31,9 +31,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include #include #include #include @@ -755,16 +755,6 @@ pci_emul_init(struct vmctx *ctx, struct return (err); } -#ifdef __GNU_C__ -#defineWRAPPED_CTASSERT(x) CTASSERT(x) __unused -#else -#defineWRAPPED_CTASSERT(x) CTASSERT(x) -#endif - -WRAPPED_CTASSERT(sizeof(struct msicap) == 14); -WRAPPED_CTASSERT(sizeof(struct msixcap) == 12); -WRAPPED_CTASSERT(sizeof(struct pciecap) == 60); - void pci_populate_msicap(struct msicap *msicap, int msgnum, int nextptr) { Modified: head/usr.sbin/bhyve/pci_emul.h == --- head/usr.sbin/bhyve/pci_emul.h Wed Jul 6 14:09:49 2016 (r302372) +++ head/usr.sbin/bhyve/pci_emul.h Wed Jul 6 16:02:15 2016 (r302373) @@ -160,6 +160,7 @@ struct msicap { uint32_taddrhi; uint16_tmsgdata; } __packed; +static_assert(sizeof(struct msicap) == 14, "compile-time assertion failed"); struct msixcap { uint8_t capid; @@ -168,6 +169,7 @@ struct msixcap { uint32_ttable_info; /* bar index and offset within it */ uint32_tpba_info; /* bar index and offset within it */ } __packed; +static_assert(sizeof(struct msixcap) == 12, "compile-time assertion failed"); struct pciecap { uint8_t capid; @@ -202,6 +204,7 @@ struct pciecap { uint16_tslot_control2; uint16_tslot_status2; } __packed; +static_assert(sizeof(struct pciecap) == 60, "compile-time assertion failed"); typedef void (*pci_lintr_cb)(int b, int s, int pin, int pirq_pin, int ioapic_irq, void *arg); Modified: head/usr.sbin/bhyve/task_switch.c == --- head/usr.sbin/bhyve/task_switch.c Wed Jul 6 14:09:49 2016 (r302372) +++ head/usr.sbin/bhyve/task_switch.c Wed Jul 6 16:02:15 2016 (r302373) @@ -37,11 +37,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include -#include -#include #include @@ -91,7 +91,7 @@ struct tss32 { uint16_ttss_trap; uint16_ttss_iomap; }; -CTASSERT(sizeof(struct tss32) == 104); +static_assert(sizeof(struct tss32) == 104, "compile-time assertion failed"); #defineSEL_START(sel) (((sel) & ~0x7)) #defineSEL_LIMIT(sel) (((sel) | 0x7)) ___ 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: r302374 - head/sys/netinet
Author: jtl Date: Wed Jul 6 16:17:13 2016 New Revision: 302374 URL: https://svnweb.freebsd.org/changeset/base/302374 Log: The TCPPCAP debugging feature caches recently-used mbufs for use in debugging TCP connections. This commit provides a mechanism to free those mbufs when the system is under memory pressure. Because this will result in lost debugging information, the behavior is controllable by a sysctl. The default setting is to free the mbufs. Reviewed by: gnn Approved by: re (gjb) Differential Revision:https://reviews.freebsd.org/D6931 Input from: novice_techie.com Modified: head/sys/netinet/tcp_pcap.c head/sys/netinet/tcp_pcap.h head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_pcap.c == --- head/sys/netinet/tcp_pcap.c Wed Jul 6 16:02:15 2016(r302373) +++ head/sys/netinet/tcp_pcap.c Wed Jul 6 16:17:13 2016(r302374) @@ -42,9 +42,13 @@ #define M_LEADINGSPACE_NOWRITE(m) \ ((m)->m_data - M_START(m)) +int tcp_pcap_aggressive_free = 1; static int tcp_pcap_clusters_referenced_cur = 0; static int tcp_pcap_clusters_referenced_max = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcp_pcap_aggressive_free, + CTLFLAG_RW, &tcp_pcap_aggressive_free, 0, + "Free saved packets when the memory system comes under pressure"); SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcp_pcap_clusters_referenced_cur, CTLFLAG_RD, &tcp_pcap_clusters_referenced_cur, 0, "Number of clusters currently referenced on TCP PCAP queues"); Modified: head/sys/netinet/tcp_pcap.h == --- head/sys/netinet/tcp_pcap.h Wed Jul 6 16:02:15 2016(r302373) +++ head/sys/netinet/tcp_pcap.h Wed Jul 6 16:17:13 2016(r302374) @@ -36,4 +36,6 @@ void tcp_pcap_tcpcb_init(struct tcpcb *t void tcp_pcap_set_sock_max(struct mbufq *queue, int newval); int tcp_pcap_get_sock_max(struct mbufq *queue); +extern int tcp_pcap_aggressive_free; + #endif /* _NETINET_TCP_PCAP_H_ */ Modified: head/sys/netinet/tcp_subr.c == --- head/sys/netinet/tcp_subr.c Wed Jul 6 16:02:15 2016(r302373) +++ head/sys/netinet/tcp_subr.c Wed Jul 6 16:17:13 2016(r302374) @@ -1605,6 +1605,13 @@ tcp_drain(void) if ((tcpb = intotcpcb(inpb)) != NULL) { tcp_reass_flush(tcpb); tcp_clean_sackreport(tcpb); +#ifdef TCPPCAP + if (tcp_pcap_aggressive_free) { + /* Free the TCP PCAP queues. */ + tcp_pcap_drain(&(tcpb->t_inpkts)); + tcp_pcap_drain(&(tcpb->t_outpkts)); + } +#endif } INP_WUNLOCK(inpb); } ___ 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: r302375 - in head/sys: arm64/arm64 conf
Author: andrew Date: Wed Jul 6 16:20:10 2016 New Revision: 302375 URL: https://svnweb.freebsd.org/changeset/base/302375 Log: Remove the old pre-INTRNG arm64 interrupt framework. GENERIC was switched to INTRNG in r301565 with the old code no longer being built by default with no reports of issues on any supported hardware. Approved by: re (gjb) Obtained from:ABT Systems Ltd Sponsored by: The FreeBSD Foundation Deleted: head/sys/arm64/arm64/gic.c head/sys/arm64/arm64/gic_acpi.c head/sys/arm64/arm64/gic_fdt.c head/sys/arm64/arm64/gic_v3_its.c head/sys/arm64/arm64/intr_machdep.c head/sys/arm64/arm64/pic_if.m Modified: head/sys/conf/files.arm64 Modified: head/sys/conf/files.arm64 == --- head/sys/conf/files.arm64 Wed Jul 6 16:17:13 2016(r302374) +++ head/sys/conf/files.arm64 Wed Jul 6 16:20:10 2016(r302375) @@ -25,15 +25,10 @@ arm64/arm64/disassem.c optionalddb arm64/arm64/dump_machdep.c standard arm64/arm64/elf_machdep.c standard arm64/arm64/exception.Sstandard -arm64/arm64/gic.c optional!intrng arm64/arm64/gicv3_its.coptionalintrng -arm64/arm64/gic_acpi.c optional!intrng acpi -arm64/arm64/gic_fdt.c optional!intrng fdt arm64/arm64/gic_v3.c standard arm64/arm64/gic_v3_fdt.c optionalfdt -arm64/arm64/gic_v3_its.c optional!intrng arm64/arm64/identcpu.c standard -arm64/arm64/intr_machdep.c optional!intrng arm64/arm64/in_cksum.c optionalinet | inet6 arm64/arm64/locore.S standardno-obj arm64/arm64/machdep.c standard @@ -42,7 +37,6 @@ arm64/arm64/minidump_machdep.cstandard arm64/arm64/mp_machdep.c optionalsmp arm64/arm64/nexus.cstandard arm64/arm64/ofw_machdep.c optionalfdt -arm64/arm64/pic_if.m optional!intrng arm64/arm64/pmap.c standard arm64/arm64/stack_machdep.coptionalddb | stack arm64/arm64/support.S standard ___ 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: r302372 - in head/sys: amd64/include cddl/compat/opensolaris/sys dev/cpuctl i386/include kern net netinet powerpc/include powerpc/powerpc vm
On Wed, 6 Jul 2016 14:09:49 + (UTC) Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Wed Jul 6 14:09:49 2016 > New Revision: 302372 > URL: https://svnweb.freebsd.org/changeset/base/302372 > > Log: > Replace a number of conflations of mp_ncpus and mp_maxid with either > mp_maxid or CPU_FOREACH() as appropriate. This fixes a number of > places in the kernel that assumed CPU IDs are dense in [0, mp_ncpus) > and would try, for example, to run tasks on CPUs that did not exist > or to allocate too few buffers on systems with sparse CPU IDs in > which there are holes in the range and mp_maxid > mp_ncpus. Such > circumstances generally occur on systems with SMT, but on which SMT > is disabled. This patch restores system operation at least on POWER8 > systems configured in this way. > There are a number of other places in the kernel with potential > problems in these situations, but where sparse CPU IDs are not > currently known to occur, mostly in the ARM machine-dependent code. > These will be fixed in a follow-up commit after the stable/11 branch. > ... > Modified: head/sys/net/flowtable.c > == > --- head/sys/net/flowtable.c Wed Jul 6 10:57:04 2016 > (r302371) +++ head/sys/net/flowtable.cWed Jul 6 14:09:49 > 2016 (r302372) @@ -746,7 +746,7 @@ flowtable_alloc(struct > flowtable *ft) ft->ft_table[i] = uma_zalloc(pcpu_zone_ptr, M_WAITOK | > M_ZERO); > ft->ft_masks = uma_zalloc(pcpu_zone_ptr, M_WAITOK); > - for (int i = 0; i < mp_ncpus; i++) { > + CPU_FOREACH(i) { This is broken, it removed the declaration of i. Andrew ___ 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: r302372 - in head/sys: amd64/include cddl/compat/opensolaris/sys dev/cpuctl i386/include kern net netinet powerpc/include powerpc/powerpc vm
On 07/06/16 09:57, Andrew Turner wrote: On Wed, 6 Jul 2016 14:09:49 + (UTC) Nathan Whitehorn wrote: Author: nwhitehorn Date: Wed Jul 6 14:09:49 2016 New Revision: 302372 URL: https://svnweb.freebsd.org/changeset/base/302372 Log: Replace a number of conflations of mp_ncpus and mp_maxid with either mp_maxid or CPU_FOREACH() as appropriate. This fixes a number of places in the kernel that assumed CPU IDs are dense in [0, mp_ncpus) and would try, for example, to run tasks on CPUs that did not exist or to allocate too few buffers on systems with sparse CPU IDs in which there are holes in the range and mp_maxid > mp_ncpus. Such circumstances generally occur on systems with SMT, but on which SMT is disabled. This patch restores system operation at least on POWER8 systems configured in this way. There are a number of other places in the kernel with potential problems in these situations, but where sparse CPU IDs are not currently known to occur, mostly in the ARM machine-dependent code. These will be fixed in a follow-up commit after the stable/11 branch. ... Modified: head/sys/net/flowtable.c == --- head/sys/net/flowtable.cWed Jul 6 10:57:04 2016 (r302371) +++ head/sys/net/flowtable.c Wed Jul 6 14:09:49 2016(r302372) @@ -746,7 +746,7 @@ flowtable_alloc(struct flowtable *ft) ft->ft_table[i] = uma_zalloc(pcpu_zone_ptr, M_WAITOK | M_ZERO); ft->ft_masks = uma_zalloc(pcpu_zone_ptr, M_WAITOK); - for (int i = 0; i < mp_ncpus; i++) { + CPU_FOREACH(i) { This is broken, it removed the declaration of i. Andrew You are right. Somehow my build tests succeeded anyway. Will fix quickly. -Nathan ___ 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: r302372 - in head/sys: amd64/include cddl/compat/opensolaris/sys dev/cpuctl i386/include kern net netinet powerpc/include powerpc/powerpc vm
On Wed, 6 Jul 2016 10:00:08 -0700 Nathan Whitehorn wrote: > On 07/06/16 09:57, Andrew Turner wrote: > > On Wed, 6 Jul 2016 14:09:49 + (UTC) > > Nathan Whitehorn wrote: > > > >> Author: nwhitehorn > >> Date: Wed Jul 6 14:09:49 2016 > >> New Revision: 302372 > >> URL: https://svnweb.freebsd.org/changeset/base/302372 > >> > >> Log: > >>Replace a number of conflations of mp_ncpus and mp_maxid with > >> either mp_maxid or CPU_FOREACH() as appropriate. This fixes a > >> number of places in the kernel that assumed CPU IDs are dense in > >> [0, mp_ncpus) and would try, for example, to run tasks on CPUs > >> that did not exist or to allocate too few buffers on systems with > >> sparse CPU IDs in which there are holes in the range and mp_maxid > >> > mp_ncpus. Such circumstances generally occur on systems with > >> > SMT, but on which SMT > >> is disabled. This patch restores system operation at least on > >> POWER8 systems configured in this way. > >>There are a number of other places in the kernel with potential > >> problems in these situations, but where sparse CPU IDs are not > >> currently known to occur, mostly in the ARM machine-dependent code. > >> These will be fixed in a follow-up commit after the stable/11 > >> branch. > > ... > >> Modified: head/sys/net/flowtable.c > >> == > >> --- head/sys/net/flowtable.c Wed Jul 6 10:57:04 2016 > >> (r302371) +++ head/sys/net/flowtable.c Wed Jul 6 14:09:49 > >> 2016 (r302372) @@ -746,7 +746,7 @@ flowtable_alloc(struct > >> flowtable *ft) ft->ft_table[i] = uma_zalloc(pcpu_zone_ptr, > >> M_WAITOK | M_ZERO); > >>ft->ft_masks = uma_zalloc(pcpu_zone_ptr, M_WAITOK); > >> - for (int i = 0; i < mp_ncpus; i++) { > >> + CPU_FOREACH(i) { > > This is broken, it removed the declaration of i. > > > > Andrew > > > > You are right. Somehow my build tests succeeded anyway. Will fix > quickly. -Nathan > It only seems to be enabled in LINT. Andrew ___ 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: r302378 - head/sys/net
Author: nwhitehorn Date: Wed Jul 6 17:46:49 2016 New Revision: 302378 URL: https://svnweb.freebsd.org/changeset/base/302378 Log: Add variable declaration missing in r302372. Submitted by: andrew Approved by: re (gjb, kib) Modified: head/sys/net/flowtable.c Modified: head/sys/net/flowtable.c == --- head/sys/net/flowtable.cWed Jul 6 17:45:38 2016(r302377) +++ head/sys/net/flowtable.cWed Jul 6 17:46:49 2016(r302378) @@ -739,6 +739,7 @@ flowtable_lookup_common(struct flowtable static void flowtable_alloc(struct flowtable *ft) { + int i; ft->ft_table = malloc(ft->ft_size * sizeof(struct flist), M_FTABLE, M_WAITOK); ___ 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: r302379 - head/sys/sys
Author: jhb Date: Wed Jul 6 18:55:46 2016 New Revision: 302379 URL: https://svnweb.freebsd.org/changeset/base/302379 Log: Correct locking annotation for p_comm. p_comm is changed during exec, it is not read-only after fork. Pointed out by: rwatson Approved by: re (gjb, kib) MFC after:1 week Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h == --- head/sys/sys/proc.h Wed Jul 6 17:46:49 2016(r302378) +++ head/sys/sys/proc.h Wed Jul 6 18:55:46 2016(r302379) @@ -602,7 +602,7 @@ struct proc { u_int p_magic;/* (b) Magic number. */ int p_osrel;/* (x) osreldate for the binary (from ELF note, if any) */ - charp_comm[MAXCOMLEN + 1]; /* (b) Process name. */ + charp_comm[MAXCOMLEN + 1]; /* (x) Process name. */ struct sysentvec *p_sysent; /* (b) Syscall dispatch info. */ struct pargs*p_args;/* (c) Process arguments. */ rlim_t p_cpulimit; /* (c) Current CPU limit in seconds. */ ___ 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: r302380 - head/sys/dev/isci/scil
Author: jimharris Date: Wed Jul 6 20:48:42 2016 New Revision: 302380 URL: https://svnweb.freebsd.org/changeset/base/302380 Log: isci: fix ATA PASSTHROUGH fixed sense data format PR: kern/191717 Submitted by: mar...@lispworks.com Approved by: re (gjb) MFC after: 3 days Modified: head/sys/dev/isci/scil/sati_passthrough.c head/sys/dev/isci/scil/sati_util.c Modified: head/sys/dev/isci/scil/sati_passthrough.c == --- head/sys/dev/isci/scil/sati_passthrough.c Wed Jul 6 18:55:46 2016 (r302379) +++ head/sys/dev/isci/scil/sati_passthrough.c Wed Jul 6 20:48:42 2016 (r302380) @@ -230,9 +230,9 @@ void sati_passthrough_construct_sense( // Command specific section sati_set_sense_data_byte(sense_data, sense_len, 8, (PASSTHROUGH_CDB_EXTEND(cdb) << 7) | (sector_count_upper << 6) | (lba_upper << 5)); - sati_set_sense_data_byte(sense_data, sense_len, 9, sati_get_ata_lba_high(register_fis)); + sati_set_sense_data_byte(sense_data, sense_len, 9, sati_get_ata_lba_low(register_fis)); sati_set_sense_data_byte(sense_data, sense_len, 10, sati_get_ata_lba_mid(register_fis)); - sati_set_sense_data_byte(sense_data, sense_len, 11, sati_get_ata_lba_low(register_fis)); + sati_set_sense_data_byte(sense_data, sense_len, 11, sati_get_ata_lba_high(register_fis)); sequence->is_sense_response_set = TRUE; } Modified: head/sys/dev/isci/scil/sati_util.c == --- head/sys/dev/isci/scil/sati_util.c Wed Jul 6 18:55:46 2016 (r302379) +++ head/sys/dev/isci/scil/sati_util.c Wed Jul 6 20:48:42 2016 (r302380) @@ -932,7 +932,7 @@ void sati_scsi_fixed_sense_data_construc sati_set_sense_data_byte(sense_data, sense_len, 4, 0); sati_set_sense_data_byte(sense_data, sense_len, 5, 0); sati_set_sense_data_byte(sense_data, sense_len, 6, 0); -sati_set_sense_data_byte(sense_data, sense_len, 7, 0); +sati_set_sense_data_byte(sense_data, sense_len, 7, (sense_len < 18 ? sense_len - 1 : 17) - 7); sati_set_sense_data_byte(sense_data, sense_len, 8, 0); sati_set_sense_data_byte(sense_data, sense_len, 9, 0); sati_set_sense_data_byte(sense_data, sense_len, 10, 0); @@ -981,7 +981,7 @@ void sati_scsi_common_fixed_sense_constr //Bytes 3, 4, 5, 6 are set in read_error_sense_construct functions - sati_set_sense_data_byte(sense_data, sense_len, 7, 0); + sati_set_sense_data_byte(sense_data, sense_len, 7, (sense_len < 18 ? sense_len - 1 : 17) - 7); sati_set_sense_data_byte(sense_data, sense_len, 8, 0); sati_set_sense_data_byte(sense_data, sense_len, 9, 0); sati_set_sense_data_byte(sense_data, sense_len, 10, 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: r302381 - head/sys/fs/cuse
Author: hselasky Date: Wed Jul 6 22:21:22 2016 New Revision: 302381 URL: https://svnweb.freebsd.org/changeset/base/302381 Log: Handle IOC_VOID special case of passing an integer IOCTL argument through CUSE. Submitted by: Vladimir Kondratyev Approved by: re (gjb) Modified: head/sys/fs/cuse/cuse.c Modified: head/sys/fs/cuse/cuse.c == --- head/sys/fs/cuse/cuse.c Wed Jul 6 20:48:42 2016(r302380) +++ head/sys/fs/cuse/cuse.c Wed Jul 6 22:21:22 2016(r302381) @@ -1656,7 +1656,7 @@ cuse_client_ioctl(struct cdev *dev, unsi cuse_cmd_lock(pccmd); - if (cmd & IOC_IN) + if (cmd & (IOC_IN | IOC_VOID)) memcpy(pcc->ioctl_buffer, data, len); /* ___ 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: r302382 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: smh Date: Wed Jul 6 23:49:19 2016 New Revision: 302382 URL: https://svnweb.freebsd.org/changeset/base/302382 Log: Fix ZFS ARC min / max tunable Due to ARC initial configuration not being done and kmem information not being available we need to blindly set zfs_arc_max and zfs_arc_min when configured via the tunable. This fixes vfs.zfs.arc_(min|max) configuration via loader.conf broken by r302265. Approved by: re(gjb) MFC after:1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Jul 6 22:21:22 2016(r302381) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Jul 6 23:49:19 2016(r302382) @@ -919,6 +919,12 @@ sysctl_vfs_zfs_arc_max(SYSCTL_HANDLER_AR if (err != 0 || req->newptr == NULL) return (err); + if (zfs_arc_max == 0) { + /* Loader tunable so blindly set */ + zfs_arc_max = val; + return (0); + } + if (val < arc_abs_min || val > kmem_size()) return (EINVAL); if (val < arc_c_min) @@ -956,6 +962,12 @@ sysctl_vfs_zfs_arc_min(SYSCTL_HANDLER_AR if (err != 0 || req->newptr == NULL) return (err); + if (zfs_arc_min == 0) { + /* Loader tunable so blindly set */ + zfs_arc_min = val; + return (0); + } + if (val < arc_abs_min || val > arc_c_max) return (EINVAL); ___ 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: r302384 - in head/sys/dev: e1000 ixgb ixgbe ixl
Author: sbruno Date: Thu Jul 7 03:39:18 2016 New Revision: 302384 URL: https://svnweb.freebsd.org/changeset/base/302384 Log: Do not initialize the adapter on MTU change when adapter status is down. This fixes long-standing problems when changing settings of the adapter. Discussed in: https://lists.freebsd.org/pipermail/freebsd-net/2016-June/045509.html Submitted by: arnaud.ys...@stormshield.eu Reviewed by: e...@freebsd.org Approved by: re (gjb) Differential Revision:https://reviews.freebsd.org/D7030 Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c head/sys/dev/ixgb/if_ixgb.c head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c Modified: head/sys/dev/e1000/if_em.c == --- head/sys/dev/e1000/if_em.c Thu Jul 7 02:23:52 2016(r302383) +++ head/sys/dev/e1000/if_em.c Thu Jul 7 03:39:18 2016(r302384) @@ -1214,7 +1214,8 @@ em_ioctl(if_t ifp, u_long command, caddr if_setmtu(ifp, ifr->ifr_mtu); adapter->hw.mac.max_frame_size = if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN; - em_init_locked(adapter); + if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) + em_init_locked(adapter); EM_CORE_UNLOCK(adapter); break; } Modified: head/sys/dev/e1000/if_igb.c == --- head/sys/dev/e1000/if_igb.c Thu Jul 7 02:23:52 2016(r302383) +++ head/sys/dev/e1000/if_igb.c Thu Jul 7 03:39:18 2016(r302384) @@ -1106,7 +1106,8 @@ igb_ioctl(struct ifnet *ifp, u_long comm ifp->if_mtu = ifr->ifr_mtu; adapter->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; - igb_init_locked(adapter); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING)) + igb_init_locked(adapter); IGB_CORE_UNLOCK(adapter); break; } Modified: head/sys/dev/e1000/if_lem.c == --- head/sys/dev/e1000/if_lem.c Thu Jul 7 02:23:52 2016(r302383) +++ head/sys/dev/e1000/if_lem.c Thu Jul 7 03:39:18 2016(r302384) @@ -1053,7 +1053,8 @@ lem_ioctl(if_t ifp, u_long command, cadd if_setmtu(ifp, ifr->ifr_mtu); adapter->max_frame_size = if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN; - lem_init_locked(adapter); + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING)) + lem_init_locked(adapter); EM_CORE_UNLOCK(adapter); break; } Modified: head/sys/dev/ixgb/if_ixgb.c == --- head/sys/dev/ixgb/if_ixgb.c Thu Jul 7 02:23:52 2016(r302383) +++ head/sys/dev/ixgb/if_ixgb.c Thu Jul 7 03:39:18 2016(r302384) @@ -539,7 +539,8 @@ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD adapter->hw.max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; - ixgb_init_locked(adapter); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + ixgb_init_locked(adapter); IXGB_UNLOCK(adapter); } break; Modified: head/sys/dev/ixgbe/if_ix.c == --- head/sys/dev/ixgbe/if_ix.c Thu Jul 7 02:23:52 2016(r302383) +++ head/sys/dev/ixgbe/if_ix.c Thu Jul 7 03:39:18 2016(r302384) @@ -893,7 +893,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_mtu = ifr->ifr_mtu; adapter->max_frame_size = ifp->if_mtu + IXGBE_MTU_HDR; - ixgbe_init_locked(adapter); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + ixgbe_init_locked(adapter); #ifdef PCI_IOV ixgbe_recalculate_max_frame(adapter); #endif Modified: head/sys/dev/ixgbe/if_ixv.c == --- head/sys/dev/ixgbe/if_ixv.c Thu Jul 7 02:23:52 2016(r302383) +++ head/sys/dev/ixgbe/if_ixv.c Thu Jul 7 03:39:18 2016(r302384) @@ -578,7 +578,8 @@ ixv_ioctl(struct ifnet * ifp, u_long com ifp->if_mtu = ifr->ifr_mtu; adapter->max_frame_size = ifp->if_mtu + IXGBE_MTU_HDR; - ixv_init_locked(adapter); + if (ifp->if_drv_flags & IFF_DRV_R
svn commit: r302387 - head/release/arm64
Author: wma Date: Thu Jul 7 05:47:42 2016 New Revision: 302387 URL: https://svnweb.freebsd.org/changeset/base/302387 Log: ARM64: move to GPT scheme in sysinstall It's time to abandon MBR installations on ARM64 platforms. Obtained from: Semihalf Submitted by: Dominik Ermel Sponsored by: Cavium Reviewed by: gjb, emaste, marcel Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D6798 Modified: head/release/arm64/make-memstick.sh Modified: head/release/arm64/make-memstick.sh == --- head/release/arm64/make-memstick.sh Thu Jul 7 05:04:20 2016 (r302386) +++ head/release/arm64/make-memstick.sh Thu Jul 7 05:47:42 2016 (r302387) @@ -38,6 +38,6 @@ fi rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s mbr -p efi:=${1}/boot/boot1.efifat -p freebsd:=${2}.part -o ${2} +mkimg -s gpt -p efi:=${1}/boot/boot1.efifat -p freebsd:=${2}.part -o ${2} rm ${2}.part ___ 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"