From owner-svn-src-stable-10@freebsd.org Sun Jul 30 10:36:22 2017 Return-Path: Delivered-To: svn-src-stable-10@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 8A8B2DB3EA6; Sun, 30 Jul 2017 10:36:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5756C5C7; Sun, 30 Jul 2017 10:36:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6UAaLQE087544; Sun, 30 Jul 2017 10:36:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UAaKOf087535; Sun, 30 Jul 2017 10:36:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707301036.v6UAaKOf087535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Jul 2017 10:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321717 - in stable/10: lib/libc/sys sys/sys sys/vm X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/10: lib/libc/sys sys/sys sys/vm X-SVN-Commit-Revision: 321717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jul 2017 10:36:22 -0000 Author: kib Date: Sun Jul 30 10:36:20 2017 New Revision: 321717 URL: https://svnweb.freebsd.org/changeset/base/321717 Log: Merge MAP_GUARD. MFC r316687 (by markj), r320314, r320317, r320338, r320339, r320344, r320430, r320560 (by alc), r320801, r320843, r321173, r321230. Tested by: pho Sponsored by: The FreeBSD Foundation Modified: stable/10/lib/libc/sys/mmap.2 stable/10/lib/libc/sys/munmap.2 stable/10/sys/sys/mman.h stable/10/sys/sys/param.h stable/10/sys/vm/vm.h stable/10/sys/vm/vm_fault.c stable/10/sys/vm/vm_map.c stable/10/sys/vm/vm_map.h stable/10/sys/vm/vm_mmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/mmap.2 ============================================================================== --- stable/10/lib/libc/sys/mmap.2 Sun Jul 30 08:02:06 2017 (r321716) +++ stable/10/lib/libc/sys/mmap.2 Sun Jul 30 10:36:20 2017 (r321717) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd September 17, 2014 +.Dd June 22, 2017 .Dt MMAP 2 .Os .Sh NAME @@ -173,9 +173,21 @@ In contrast, if .Dv MAP_EXCL is specified, the request will fail if a mapping already exists within the range. -.It Dv MAP_HASSEMAPHORE -Notify the kernel that the region may contain semaphores and that special -handling may be necessary. +.It Dv MAP_GUARD +Instead of a mapping, create a guard of the specified size. +Guards allow a process to create reservations in its address space, +which can later be replaced by actual mappings. +.Pp +.Fa mmap +will not create mappings in the address range of a guard unless +the request specifies +.Dv MAP_FIXED . +Guards can be destroyed with +.Xr munmap 2 . +Any memory access by a thread to the guarded range results +in the delivery of a +.Dv SIGSEGV +signal to that thread. .It Dv MAP_NOCORE Region is not included in a core file. .It Dv MAP_NOSYNC @@ -278,6 +290,7 @@ must include at least .Dv PROT_READ and .Dv PROT_WRITE . +.Pp This option creates a memory region that grows to at most .Fa len @@ -288,6 +301,12 @@ stack top is the starting address returned by the call bytes. The bottom of the stack at maximum growth is the starting address returned by the call. +.Pp +Stacks created with +.Dv MAP_STACK +automatically grow. +Guards prevent inadvertent use of the regions into which those +stacks can grow without requiring mapping the whole stack in advance. .El .Pp The @@ -375,6 +394,7 @@ were specified. .It Bq Er EINVAL None of .Dv MAP_ANON , +.Dv MAP_GUARD , .Dv MAP_PRIVATE , .Dv MAP_SHARED , or @@ -424,6 +444,25 @@ were specified, but the requested region is already us was specified, but .Dv MAP_FIXED was not. +.It Bq Er EINVAL +.Dv MAP_GUARD +was specified, but the +.Fa offset +argument was not zero, the +.Fa fd +argument was not -1, or the +.Fa prot +argument was not +.Dv PROT_NONE . +.It Bq Er EINVAL +.Dv MAP_GUARD +was specified together with one of the flags +.Dv MAP_ANON , +.Dv MAP_PREFAULT , +.Dv MAP_PREFAULT_READ , +.Dv MAP_PRIVATE , +.Dv MAP_SHARED , +.Dv MAP_STACK . .It Bq Er ENODEV .Dv MAP_ANON has not been specified and Modified: stable/10/lib/libc/sys/munmap.2 ============================================================================== --- stable/10/lib/libc/sys/munmap.2 Sun Jul 30 08:02:06 2017 (r321716) +++ stable/10/lib/libc/sys/munmap.2 Sun Jul 30 10:36:20 2017 (r321717) @@ -28,7 +28,7 @@ .\" @(#)munmap.2 8.3 (Berkeley) 5/27/94 .\" $FreeBSD$ .\" -.Dd May 27, 1994 +.Dd June 22, 2017 .Dt MUNMAP 2 .Os .Sh NAME @@ -44,7 +44,7 @@ The .Fn munmap system call -deletes the mappings for the specified address range, +deletes the mappings and guards for the specified address range, and causes further references to addresses within the range to generate invalid memory references. .Sh RETURN VALUES Modified: stable/10/sys/sys/mman.h ============================================================================== --- stable/10/sys/sys/mman.h Sun Jul 30 08:02:06 2017 (r321716) +++ stable/10/sys/sys/mman.h Sun Jul 30 10:36:20 2017 (r321717) @@ -90,6 +90,7 @@ /* * Extended flags */ +#define MAP_GUARD 0x00002000 /* reserve but don't map address range */ #define MAP_EXCL 0x00004000 /* for MAP_FIXED, fail if address is used */ #define MAP_NOCORE 0x00020000 /* dont include these pages in a coredump */ #define MAP_PREFAULT_READ 0x00040000 /* prefault mapping for reading */ Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Sun Jul 30 08:02:06 2017 (r321716) +++ stable/10/sys/sys/param.h Sun Jul 30 10:36:20 2017 (r321717) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1003515 /* Master, propagated to newvers */ +#define __FreeBSD_version 1003516 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, @@ -76,10 +76,11 @@ #undef __FreeBSD_kernel__ #define __FreeBSD_kernel__ -#ifdef _KERNEL +#if defined(_KERNEL) || defined(IN_RTLD) #define P_OSREL_SIGWAIT 700000 #define P_OSREL_SIGSEGV 700004 #define P_OSREL_MAP_ANON 800104 +#define P_OSREL_MAP_GUARD 1200035 #define P_OSREL_MAJOR(x) ((x) / 100000) #endif Modified: stable/10/sys/vm/vm.h ============================================================================== --- stable/10/sys/vm/vm.h Sun Jul 30 08:02:06 2017 (r321716) +++ stable/10/sys/vm/vm.h Sun Jul 30 10:36:20 2017 (r321717) @@ -78,6 +78,7 @@ typedef u_char vm_prot_t; /* protection codes */ #define VM_PROT_WRITE ((vm_prot_t) 0x02) #define VM_PROT_EXECUTE ((vm_prot_t) 0x04) #define VM_PROT_COPY ((vm_prot_t) 0x08) /* copy-on-read */ +#define VM_PROT_FAULT_LOOKUP ((vm_prot_t) 0x010) #define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE) #define VM_PROT_RW (VM_PROT_READ|VM_PROT_WRITE) Modified: stable/10/sys/vm/vm_fault.c ============================================================================== --- stable/10/sys/vm/vm_fault.c Sun Jul 30 08:02:06 2017 (r321716) +++ stable/10/sys/vm/vm_fault.c Sun Jul 30 10:36:20 2017 (r321717) @@ -336,7 +336,7 @@ vm_fault_hold(vm_map_t map, vm_offset_t vaddr, vm_prot vm_prot_t prot; long ahead, behind; int alloc_req, era, faultcount, nera, reqpage, result; - boolean_t dead, growstack, is_first_object_locked, wired; + boolean_t dead, is_first_object_locked, wired; vm_object_t next_object; vm_page_t marray[VM_FAULT_READ_MAX]; int hardfault; @@ -345,7 +345,6 @@ vm_fault_hold(vm_map_t map, vm_offset_t vaddr, vm_prot int locked, error; hardfault = 0; - growstack = TRUE; PCPU_INC(cnt.v_vm_faults); fs.vp = NULL; faultcount = reqpage = 0; @@ -357,17 +356,10 @@ RetryFault:; * search. */ fs.map = map; - result = vm_map_lookup(&fs.map, vaddr, fault_type, &fs.entry, - &fs.first_object, &fs.first_pindex, &prot, &wired); + result = vm_map_lookup(&fs.map, vaddr, fault_type | + VM_PROT_FAULT_LOOKUP, &fs.entry, &fs.first_object, + &fs.first_pindex, &prot, &wired); if (result != KERN_SUCCESS) { - if (growstack && result == KERN_INVALID_ADDRESS && - map != kernel_map) { - result = vm_map_growstack(curproc, vaddr); - if (result != KERN_SUCCESS) - return (KERN_FAILURE); - growstack = FALSE; - goto RetryFault; - } unlock_vp(&fs); return (result); } @@ -392,6 +384,8 @@ RetryFault:; vm_map_unlock(fs.map); goto RetryFault; } + + MPASS((fs.entry->eflags & MAP_ENTRY_GUARD) == 0); if (wired) fault_type = prot | (fault_type & VM_PROT_COPY); Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Sun Jul 30 08:02:06 2017 (r321716) +++ stable/10/sys/vm/vm_map.c Sun Jul 30 10:36:20 2017 (r321717) @@ -133,6 +133,8 @@ static void _vm_map_init(vm_map_t map, pmap_t pmap, vm static void vm_map_entry_deallocate(vm_map_entry_t entry, boolean_t system_map); static void vm_map_entry_dispose(vm_map_t map, vm_map_entry_t entry); static void vm_map_entry_unwire(vm_map_t map, vm_map_entry_t entry); +static int vm_map_growstack(vm_map_t map, vm_offset_t addr, + vm_map_entry_t gap_entry); #ifdef INVARIANTS static void vm_map_zdtor(void *mem, int size, void *arg); static void vmspace_zdtor(void *mem, int size, void *arg); @@ -1167,6 +1169,10 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_oof if (prev_entry->next != &map->header && prev_entry->next->start < end) return (KERN_NO_SPACE); + if ((cow & MAP_CREATE_GUARD) != 0 && (object != NULL || + max != VM_PROT_NONE)) + return (KERN_INVALID_ARGUMENT); + protoeflags = 0; if (cow & MAP_COPY_ON_WRITE) protoeflags |= MAP_ENTRY_COW | MAP_ENTRY_NEEDS_COPY; @@ -1182,13 +1188,19 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_oof protoeflags |= MAP_ENTRY_GROWS_UP; if (cow & MAP_VN_WRITECOUNT) protoeflags |= MAP_ENTRY_VN_WRITECNT; + if ((cow & MAP_CREATE_GUARD) != 0) + protoeflags |= MAP_ENTRY_GUARD; + if ((cow & MAP_CREATE_STACK_GAP_DN) != 0) + protoeflags |= MAP_ENTRY_STACK_GAP_DN; + if ((cow & MAP_CREATE_STACK_GAP_UP) != 0) + protoeflags |= MAP_ENTRY_STACK_GAP_UP; if (cow & MAP_INHERIT_SHARE) inheritance = VM_INHERIT_SHARE; else inheritance = VM_INHERIT_DEFAULT; cred = NULL; - if (cow & (MAP_ACC_NO_CHARGE | MAP_NOFAULT)) + if ((cow & (MAP_ACC_NO_CHARGE | MAP_NOFAULT | MAP_CREATE_GUARD)) != 0) goto charged; if ((cow & MAP_ACC_CHARGED) || ((prot & VM_PROT_WRITE) && ((protoeflags & MAP_ENTRY_NEEDS_COPY) || object == NULL))) { @@ -1237,7 +1249,8 @@ charged: if (prev_entry->inheritance == inheritance && prev_entry->protection == prot && prev_entry->max_protection == max) { - map->size += end - prev_entry->end; + if ((prev_entry->eflags & MAP_ENTRY_GUARD) == 0) + map->size += end - prev_entry->end; prev_entry->end = end; vm_map_entry_resize_free(map, prev_entry); vm_map_simplify_entry(map, prev_entry); @@ -1274,7 +1287,6 @@ charged: new_entry->eflags = protoeflags; new_entry->object.vm_object = object; new_entry->offset = offset; - new_entry->avail_ssize = 0; new_entry->inheritance = inheritance; new_entry->protection = prot; @@ -1292,7 +1304,8 @@ charged: * Insert the new entry into the list */ vm_map_entry_link(map, prev_entry, new_entry); - map->size += new_entry->end - new_entry->start; + if ((new_entry->eflags & MAP_ENTRY_GUARD) == 0) + map->size += new_entry->end - new_entry->start; /* * Try to coalesce the new entry with both the previous and next @@ -1496,6 +1509,25 @@ again: return (result); } +int +vm_map_find_min(vm_map_t map, vm_object_t object, vm_ooffset_t offset, + vm_offset_t *addr, vm_size_t length, vm_offset_t min_addr, + vm_offset_t max_addr, int find_space, vm_prot_t prot, vm_prot_t max, + int cow) +{ + vm_offset_t hint; + int rv; + + hint = *addr; + for (;;) { + rv = vm_map_find(map, object, offset, addr, length, max_addr, + find_space, prot, max, cow); + if (rv == KERN_SUCCESS || min_addr >= hint) + return (rv); + *addr = hint = min_addr; + } +} + /* * vm_map_simplify_entry: * @@ -1625,7 +1657,8 @@ _vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, * map. This is a bit of a hack, but is also about the best place to * put this improvement. */ - if (entry->object.vm_object == NULL && !map->system_map) { + if (entry->object.vm_object == NULL && !map->system_map && + (entry->eflags & MAP_ENTRY_GUARD) == 0) { vm_object_t object; object = vm_object_allocate(OBJT_DEFAULT, atop(entry->end - entry->start)); @@ -1702,7 +1735,8 @@ _vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, v * map. This is a bit of a hack, but is also about the best place to * put this improvement. */ - if (entry->object.vm_object == NULL && !map->system_map) { + if (entry->object.vm_object == NULL && !map->system_map && + (entry->eflags & MAP_ENTRY_GUARD) == 0) { vm_object_t object; object = vm_object_allocate(OBJT_DEFAULT, atop(entry->end - entry->start)); @@ -1929,8 +1963,10 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off /* * Make a first pass to check for protection violations. */ - current = entry; - while ((current != &map->header) && (current->start < end)) { + for (current = entry; current != &map->header && current->start < end; + current = current->next) { + if ((current->eflags & MAP_ENTRY_GUARD) != 0) + continue; if (current->eflags & MAP_ENTRY_IS_SUB_MAP) { vm_map_unlock(map); return (KERN_INVALID_ARGUMENT); @@ -1939,23 +1975,22 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off vm_map_unlock(map); return (KERN_PROTECTION_FAILURE); } - current = current->next; } - /* * Do an accounting pass for private read-only mappings that * now will do cow due to allowed write (e.g. debugger sets * breakpoint on text segment) */ - for (current = entry; (current != &map->header) && - (current->start < end); current = current->next) { + for (current = entry; current != &map->header && current->start < end; + current = current->next) { vm_map_clip_end(map, current, end); if (set_max || ((new_prot & ~(current->protection)) & VM_PROT_WRITE) == 0 || - ENTRY_CHARGED(current)) { + ENTRY_CHARGED(current) || + (current->eflags & MAP_ENTRY_GUARD) != 0) { continue; } @@ -2002,8 +2037,11 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off * Go back and fix up protections. [Note that clipping is not * necessary the second time.] */ - current = entry; - while ((current != &map->header) && (current->start < end)) { + for (current = entry; current != &map->header && current->start < end; + current = current->next) { + if ((current->eflags & MAP_ENTRY_GUARD) != 0) + continue; + old_prot = current->protection; if (set_max) @@ -2037,7 +2075,6 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off #undef MASK } vm_map_simplify_entry(map, current); - current = current->next; } vm_map_unlock(map); return (KERN_SUCCESS); @@ -2258,7 +2295,9 @@ vm_map_inherit(vm_map_t map, vm_offset_t start, vm_off entry = temp_entry->next; while ((entry != &map->header) && (entry->start < end)) { vm_map_clip_end(map, entry, end); - entry->inheritance = new_inheritance; + if ((entry->eflags & MAP_ENTRY_GUARD) == 0 || + new_inheritance != VM_INHERIT_ZERO) + entry->inheritance = new_inheritance; vm_map_simplify_entry(map, entry); entry = entry->next; } @@ -2864,6 +2903,15 @@ vm_map_entry_delete(vm_map_t map, vm_map_entry_t entry vm_map_entry_unlink(map, entry); object = entry->object.vm_object; + + if ((entry->eflags & MAP_ENTRY_GUARD) != 0) { + MPASS(entry->cred == NULL); + MPASS((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0); + MPASS(object == NULL); + vm_map_entry_deallocate(entry, map->system_map); + return; + } + size = entry->end - entry->start; map->size -= size; @@ -3222,6 +3270,8 @@ vmspace_map_entry_forked(const struct vmspace *vm1, st vm_size_t entrysize; vm_offset_t newend; + if ((entry->eflags & MAP_ENTRY_GUARD) != 0) + return; entrysize = entry->end - entry->start; vm2->vm_map.size += entrysize; if (entry->eflags & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP)) { @@ -3258,6 +3308,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c vm_map_entry_t new_entry, old_entry; vm_object_t object; int locked; + vm_inherit_t inh; old_map = &vm1->vm_map; /* Copy immutable fields of vm1 to vm2. */ @@ -3280,7 +3331,12 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c if (old_entry->eflags & MAP_ENTRY_IS_SUB_MAP) panic("vm_map_fork: encountered a submap"); - switch (old_entry->inheritance) { + inh = old_entry->inheritance; + if ((old_entry->eflags & MAP_ENTRY_GUARD) != 0 && + inh != VM_INHERIT_NONE) + inh = VM_INHERIT_COPY; + + switch (inh) { case VM_INHERIT_NONE: break; @@ -3413,7 +3469,6 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c new_entry->start = old_entry->start; new_entry->end = old_entry->end; - new_entry->avail_ssize = old_entry->avail_ssize; new_entry->eflags = old_entry->eflags & ~(MAP_ENTRY_USER_WIRED | MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_VN_WRITECNT); @@ -3476,30 +3531,40 @@ out: return (rv); } +static int stack_guard_page = 1; +SYSCTL_INT(_security_bsd, OID_AUTO, stack_guard_page, CTLFLAG_RWTUN, + &stack_guard_page, 0, + "Specifies the number of guard pages for a stack that grows"); + static int vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) { vm_map_entry_t new_entry, prev_entry; - vm_offset_t bot, top; - vm_size_t init_ssize; + vm_offset_t bot, gap_bot, gap_top, top; + vm_size_t init_ssize, sgp; int orient, rv; /* * The stack orientation is piggybacked with the cow argument. * Extract it into orient and mask the cow argument so that we * don't pass it around further. - * NOTE: We explicitly allow bi-directional stacks. */ - orient = cow & (MAP_STACK_GROWS_DOWN|MAP_STACK_GROWS_UP); + orient = cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP); KASSERT(orient != 0, ("No stack grow direction")); + KASSERT(orient != (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP), + ("bi-dir stack")); + sgp = (vm_size_t)stack_guard_page * PAGE_SIZE; if (addrbos < vm_map_min(map) || addrbos > vm_map_max(map) || - addrbos + max_ssize < addrbos) + addrbos + max_ssize < addrbos || + sgp >= max_ssize) return (KERN_NO_SPACE); - init_ssize = (max_ssize < growsize) ? max_ssize : growsize; + init_ssize = growsize; + if (max_ssize < init_ssize + sgp) + init_ssize = max_ssize - sgp; /* If addr is already mapped, no go */ if (vm_map_lookup_entry(map, addrbos, &prev_entry)) @@ -3507,12 +3572,6 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, /* * If we can't accomodate max_ssize in the current mapping, no go. - * However, we need to be aware that subsequent user mappings might - * map into the space we have reserved for stack, and currently this - * space is not protected. - * - * Hopefully we will at least detect this condition when we try to - * grow the stack. */ if ((prev_entry->next != &map->header) && (prev_entry->next->start < addrbos + max_ssize)) @@ -3528,58 +3587,53 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, * and cow to be 0. Possibly we should eliminate these as input * parameters, and just pass these values here in the insert call. */ - if (orient == MAP_STACK_GROWS_DOWN) + if (orient == MAP_STACK_GROWS_DOWN) { bot = addrbos + max_ssize - init_ssize; - else if (orient == MAP_STACK_GROWS_UP) + top = bot + init_ssize; + gap_bot = addrbos; + gap_top = bot; + } else /* if (orient == MAP_STACK_GROWS_UP) */ { bot = addrbos; - else - bot = round_page(addrbos + max_ssize/2 - init_ssize/2); - top = bot + init_ssize; - rv = vm_map_insert(map, NULL, 0, bot, top, prot, max, cow); - - /* Now set the avail_ssize amount. */ - if (rv == KERN_SUCCESS) { - new_entry = prev_entry->next; - if (new_entry->end != top || new_entry->start != bot) - panic("Bad entry start/end for new stack entry"); - - new_entry->avail_ssize = max_ssize - init_ssize; - KASSERT((orient & MAP_STACK_GROWS_DOWN) == 0 || - (new_entry->eflags & MAP_ENTRY_GROWS_DOWN) != 0, - ("new entry lacks MAP_ENTRY_GROWS_DOWN")); - KASSERT((orient & MAP_STACK_GROWS_UP) == 0 || - (new_entry->eflags & MAP_ENTRY_GROWS_UP) != 0, - ("new entry lacks MAP_ENTRY_GROWS_UP")); + top = bot + init_ssize; + gap_bot = top; + gap_top = addrbos + max_ssize; } - + rv = vm_map_insert(map, NULL, 0, bot, top, prot, max, cow); + if (rv != KERN_SUCCESS) + return (rv); + new_entry = prev_entry->next; + KASSERT(new_entry->end == top || new_entry->start == bot, + ("Bad entry start/end for new stack entry")); + KASSERT((orient & MAP_STACK_GROWS_DOWN) == 0 || + (new_entry->eflags & MAP_ENTRY_GROWS_DOWN) != 0, + ("new entry lacks MAP_ENTRY_GROWS_DOWN")); + KASSERT((orient & MAP_STACK_GROWS_UP) == 0 || + (new_entry->eflags & MAP_ENTRY_GROWS_UP) != 0, + ("new entry lacks MAP_ENTRY_GROWS_UP")); + rv = vm_map_insert(map, NULL, 0, gap_bot, gap_top, VM_PROT_NONE, + VM_PROT_NONE, MAP_CREATE_GUARD | (orient == MAP_STACK_GROWS_DOWN ? + MAP_CREATE_STACK_GAP_DN : MAP_CREATE_STACK_GAP_UP)); + if (rv != KERN_SUCCESS) + (void)vm_map_delete(map, bot, top); return (rv); } -static int stack_guard_page = 0; -TUNABLE_INT("security.bsd.stack_guard_page", &stack_guard_page); -SYSCTL_INT(_security_bsd, OID_AUTO, stack_guard_page, CTLFLAG_RW, - &stack_guard_page, 0, - "Insert stack guard page ahead of the growable segments."); - -/* Attempts to grow a vm stack entry. Returns KERN_SUCCESS if the - * desired address is already mapped, or if we successfully grow - * the stack. Also returns KERN_SUCCESS if addr is outside the - * stack range (this is strange, but preserves compatibility with - * the grow function in vm_machdep.c). +/* + * Attempts to grow a vm stack entry. Returns KERN_SUCCESS if we + * successfully grow the stack. */ -int -vm_map_growstack(struct proc *p, vm_offset_t addr) +static int +vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_map_entry_t gap_entry) { - vm_map_entry_t next_entry, prev_entry; - vm_map_entry_t new_entry, stack_entry; - struct vmspace *vm = p->p_vmspace; - vm_map_t map = &vm->vm_map; - vm_offset_t end; - vm_size_t growsize; - size_t grow_amount, max_grow; - rlim_t lmemlim, stacklim, vmemlim; - int is_procstack, rv; + vm_map_entry_t stack_entry; + struct proc *p; + struct vmspace *vm; struct ucred *cred; + vm_offset_t gap_end, gap_start, grow_start; + size_t grow_amount, guard, max_grow; + rlim_t lmemlim, stacklim, vmemlim; + int rv, rv1; + bool gap_deleted, grow_down, is_procstack; #ifdef notyet uint64_t limit; #endif @@ -3587,127 +3641,84 @@ vm_map_growstack(struct proc *p, vm_offset_t addr) int error; #endif -Retry: + p = curproc; + vm = p->p_vmspace; + + /* + * Disallow stack growth when the access is performed by a + * debugger or AIO daemon. The reason is that the wrong + * resource limits are applied. + */ + if (map != &p->p_vmspace->vm_map || p->p_textvp == NULL) + return (KERN_FAILURE); + + MPASS(!map->system_map); + + guard = stack_guard_page * PAGE_SIZE; PROC_LOCK(p); lmemlim = lim_cur(p, RLIMIT_MEMLOCK); stacklim = lim_cur(p, RLIMIT_STACK); vmemlim = lim_cur(p, RLIMIT_VMEM); PROC_UNLOCK(p); - - vm_map_lock_read(map); - - /* If addr is already in the entry range, no need to grow.*/ - if (vm_map_lookup_entry(map, addr, &prev_entry)) { - vm_map_unlock_read(map); +retry: + /* If addr is not in a hole for a stack grow area, no need to grow. */ + if (gap_entry == NULL && !vm_map_lookup_entry(map, addr, &gap_entry)) + return (KERN_FAILURE); + if ((gap_entry->eflags & MAP_ENTRY_GUARD) == 0) return (KERN_SUCCESS); - } - - next_entry = prev_entry->next; - if (!(prev_entry->eflags & MAP_ENTRY_GROWS_UP)) { - /* - * This entry does not grow upwards. Since the address lies - * beyond this entry, the next entry (if one exists) has to - * be a downward growable entry. The entry list header is - * never a growable entry, so it suffices to check the flags. - */ - if (!(next_entry->eflags & MAP_ENTRY_GROWS_DOWN)) { - vm_map_unlock_read(map); - return (KERN_SUCCESS); - } - stack_entry = next_entry; + if ((gap_entry->eflags & MAP_ENTRY_STACK_GAP_DN) != 0) { + stack_entry = gap_entry->next; + if ((stack_entry->eflags & MAP_ENTRY_GROWS_DOWN) == 0 || + stack_entry->start != gap_entry->end) + return (KERN_FAILURE); + grow_amount = round_page(stack_entry->start - addr); + grow_down = true; + } else if ((gap_entry->eflags & MAP_ENTRY_STACK_GAP_UP) != 0) { + stack_entry = gap_entry->prev; + if ((stack_entry->eflags & MAP_ENTRY_GROWS_UP) == 0 || + stack_entry->end != gap_entry->start) + return (KERN_FAILURE); + grow_amount = round_page(addr + 1 - stack_entry->end); + grow_down = false; } else { - /* - * This entry grows upward. If the next entry does not at - * least grow downwards, this is the entry we need to grow. - * otherwise we have two possible choices and we have to - * select one. - */ - if (next_entry->eflags & MAP_ENTRY_GROWS_DOWN) { - /* - * We have two choices; grow the entry closest to - * the address to minimize the amount of growth. - */ - if (addr - prev_entry->end <= next_entry->start - addr) - stack_entry = prev_entry; - else - stack_entry = next_entry; - } else - stack_entry = prev_entry; + return (KERN_FAILURE); } - - if (stack_entry == next_entry) { - KASSERT(stack_entry->eflags & MAP_ENTRY_GROWS_DOWN, ("foo")); - KASSERT(addr < stack_entry->start, ("foo")); - end = (prev_entry != &map->header) ? prev_entry->end : - stack_entry->start - stack_entry->avail_ssize; - grow_amount = roundup(stack_entry->start - addr, PAGE_SIZE); - max_grow = stack_entry->start - end; - } else { - KASSERT(stack_entry->eflags & MAP_ENTRY_GROWS_UP, ("foo")); - KASSERT(addr >= stack_entry->end, ("foo")); - end = (next_entry != &map->header) ? next_entry->start : - stack_entry->end + stack_entry->avail_ssize; - grow_amount = roundup(addr + 1 - stack_entry->end, PAGE_SIZE); - max_grow = end - stack_entry->end; - } - - if (grow_amount > stack_entry->avail_ssize) { - vm_map_unlock_read(map); + max_grow = gap_entry->end - gap_entry->start; + if (guard > max_grow) return (KERN_NO_SPACE); - } - - /* - * If there is no longer enough space between the entries nogo, and - * adjust the available space. Note: this should only happen if the - * user has mapped into the stack area after the stack was created, - * and is probably an error. - * - * This also effectively destroys any guard page the user might have - * intended by limiting the stack size. - */ - if (grow_amount + (stack_guard_page ? PAGE_SIZE : 0) > max_grow) { - if (vm_map_lock_upgrade(map)) - goto Retry; - - stack_entry->avail_ssize = max_grow; - - vm_map_unlock(map); + max_grow -= guard; + if (grow_amount > max_grow) return (KERN_NO_SPACE); - } - is_procstack = (addr >= (vm_offset_t)vm->vm_maxsaddr && - addr < (vm_offset_t)p->p_sysent->sv_usrstack) ? 1 : 0; - /* * If this is the main process stack, see if we're over the stack * limit. */ - if (is_procstack && (ctob(vm->vm_ssize) + grow_amount > stacklim)) { - vm_map_unlock_read(map); + is_procstack = addr >= (vm_offset_t)vm->vm_maxsaddr && + addr < (vm_offset_t)p->p_sysent->sv_usrstack; + if (is_procstack && (ctob(vm->vm_ssize) + grow_amount > stacklim)) return (KERN_NO_SPACE); - } + #ifdef RACCT if (racct_enable) { PROC_LOCK(p); if (is_procstack && racct_set(p, RACCT_STACK, ctob(vm->vm_ssize) + grow_amount)) { PROC_UNLOCK(p); - vm_map_unlock_read(map); return (KERN_NO_SPACE); } PROC_UNLOCK(p); } #endif - /* Round up the grow amount modulo sgrowsiz */ - growsize = sgrowsiz; - grow_amount = roundup(grow_amount, growsize); - if (grow_amount > stack_entry->avail_ssize) - grow_amount = stack_entry->avail_ssize; + grow_amount = roundup(grow_amount, sgrowsiz); + if (grow_amount > max_grow) + grow_amount = max_grow; if (is_procstack && (ctob(vm->vm_ssize) + grow_amount > stacklim)) { grow_amount = trunc_page((vm_size_t)stacklim) - ctob(vm->vm_ssize); } + #ifdef notyet PROC_LOCK(p); limit = racct_get_available(p, RACCT_STACK); @@ -3715,9 +3726,9 @@ Retry: if (is_procstack && (ctob(vm->vm_ssize) + grow_amount > limit)) grow_amount = limit - ctob(vm->vm_ssize); #endif - if (!old_mlock && map->flags & MAP_WIREFUTURE) { + + if (!old_mlock && (map->flags & MAP_WIREFUTURE) != 0) { if (ptoa(pmap_wired_count(map->pmap)) + grow_amount > lmemlim) { - vm_map_unlock_read(map); rv = KERN_NO_SPACE; goto out; } @@ -3727,7 +3738,6 @@ Retry: if (racct_set(p, RACCT_MEMLOCK, ptoa(pmap_wired_count(map->pmap)) + grow_amount)) { PROC_UNLOCK(p); - vm_map_unlock_read(map); rv = KERN_NO_SPACE; goto out; } @@ -3735,9 +3745,9 @@ Retry: } #endif } + /* If we would blow our VMEM resource limit, no go */ if (map->size + grow_amount > vmemlim) { - vm_map_unlock_read(map); rv = KERN_NO_SPACE; goto out; } @@ -3746,7 +3756,6 @@ Retry: PROC_LOCK(p); if (racct_set(p, RACCT_VMEM, map->size + grow_amount)) { PROC_UNLOCK(p); - vm_map_unlock_read(map); rv = KERN_NO_SPACE; goto out; } @@ -3754,62 +3763,42 @@ Retry: } #endif - if (vm_map_lock_upgrade(map)) - goto Retry; + if (vm_map_lock_upgrade(map)) { + gap_entry = NULL; + vm_map_lock_read(map); + goto retry; + } - if (stack_entry == next_entry) { - /* - * Growing downward. - */ - /* Get the preliminary new entry start value */ - addr = stack_entry->start - grow_amount; - - /* - * If this puts us into the previous entry, cut back our - * growth to the available space. Also, see the note above. - */ - if (addr < end) { - stack_entry->avail_ssize = max_grow; - addr = end; - if (stack_guard_page) - addr += PAGE_SIZE; + if (grow_down) { + grow_start = gap_entry->end - grow_amount; + if (gap_entry->start + grow_amount == gap_entry->end) { + gap_start = gap_entry->start; + gap_end = gap_entry->end; + vm_map_entry_delete(map, gap_entry); + gap_deleted = true; + } else { + MPASS(gap_entry->start < gap_entry->end - grow_amount); + gap_entry->end -= grow_amount; + vm_map_entry_resize_free(map, gap_entry); + gap_deleted = false; } - - rv = vm_map_insert(map, NULL, 0, addr, stack_entry->start, - next_entry->protection, next_entry->max_protection, + rv = vm_map_insert(map, NULL, 0, grow_start, + grow_start + grow_amount, + stack_entry->protection, stack_entry->max_protection, MAP_STACK_GROWS_DOWN); - - /* Adjust the available stack space by the amount we grew. */ - if (rv == KERN_SUCCESS) { - new_entry = prev_entry->next; - KASSERT(new_entry == stack_entry->prev, ("foo")); - KASSERT(new_entry->end == stack_entry->start, ("foo")); - KASSERT(new_entry->start == addr, ("foo")); - KASSERT((new_entry->eflags & MAP_ENTRY_GROWS_DOWN) != - 0, ("new entry lacks MAP_ENTRY_GROWS_DOWN")); - grow_amount = new_entry->end - new_entry->start; - new_entry->avail_ssize = stack_entry->avail_ssize - - grow_amount; - stack_entry->eflags &= ~MAP_ENTRY_GROWS_DOWN; + if (rv != KERN_SUCCESS) { + if (gap_deleted) { + rv1 = vm_map_insert(map, NULL, 0, gap_start, + gap_end, VM_PROT_NONE, VM_PROT_NONE, + MAP_CREATE_GUARD | MAP_CREATE_STACK_GAP_DN); + MPASS(rv1 == KERN_SUCCESS); + } else { + gap_entry->end += grow_amount; + vm_map_entry_resize_free(map, gap_entry); + } } } else { - /* - * Growing upward. - */ - addr = stack_entry->end + grow_amount; - - /* - * If this puts us into the next entry, cut back our growth - * to the available space. Also, see the note above. - */ - if (addr > end) { - stack_entry->avail_ssize = end - stack_entry->end; - addr = end; - if (stack_guard_page) - addr -= PAGE_SIZE; - } - - grow_amount = addr - stack_entry->end; + grow_start = stack_entry->end; cred = stack_entry->cred; if (cred == NULL && stack_entry->object.vm_object != NULL) cred = stack_entry->object.vm_object->cred; @@ -3821,35 +3810,32 @@ Retry: stack_entry->offset, (vm_size_t)(stack_entry->end - stack_entry->start), (vm_size_t)grow_amount, cred != NULL)) { - map->size += (addr - stack_entry->end); - /* Update the current entry. */ - stack_entry->end = addr; - stack_entry->avail_ssize -= grow_amount; + if (gap_entry->start + grow_amount == gap_entry->end) + vm_map_entry_delete(map, gap_entry); + else + gap_entry->start += grow_amount; + stack_entry->end += grow_amount; + map->size += grow_amount; vm_map_entry_resize_free(map, stack_entry); rv = KERN_SUCCESS; - - if (next_entry != &map->header) - vm_map_clip_start(map, next_entry, addr); } else rv = KERN_FAILURE; } - if (rv == KERN_SUCCESS && is_procstack) vm->vm_ssize += btoc(grow_amount); - vm_map_unlock(map); - /* * Heed the MAP_WIREFUTURE flag if it was set for this process. */ - if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE)) { - vm_map_wire(map, - (stack_entry == next_entry) ? addr : addr - grow_amount, - (stack_entry == next_entry) ? stack_entry->start : addr, + if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) { + vm_map_unlock(map); + vm_map_wire(map, grow_start, grow_start + grow_amount, (p->p_flag & P_SYSTEM) ? VM_MAP_WIRE_SYSTEM|VM_MAP_WIRE_NOHOLES : VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); - } + vm_map_lock_read(map); + } else + vm_map_lock_downgrade(map); out: #ifdef RACCT @@ -3973,10 +3959,11 @@ vm_map_lookup(vm_map_t *var_map, /* IN/OUT */ vm_size_t size; struct ucred *cred; -RetryLookup:; +RetryLookup: vm_map_lock_read(map); +RetryLookupLocked: /* * Lookup the faulting address. */ @@ -4002,7 +3989,16 @@ RetryLookup:; * Check whether this task is allowed to have this page. */ prot = entry->protection; - fault_type &= (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); + if ((fault_typea & VM_PROT_FAULT_LOOKUP) != 0) { + fault_typea &= ~VM_PROT_FAULT_LOOKUP; + if (prot == VM_PROT_NONE && map != kernel_map && + (entry->eflags & MAP_ENTRY_GUARD) != 0 && + (entry->eflags & (MAP_ENTRY_STACK_GAP_DN | + MAP_ENTRY_STACK_GAP_UP)) != 0 && + vm_map_growstack(map, vaddr, entry) == KERN_SUCCESS) + goto RetryLookupLocked; + } + fault_type &= VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE; if ((fault_type & prot) != fault_type || prot == VM_PROT_NONE) { vm_map_unlock_read(map); return (KERN_PROTECTION_FAILURE); @@ -4236,8 +4232,9 @@ vm_map_print(vm_map_t map) db_indent += 2; for (entry = map->header.next; entry != &map->header; entry = entry->next) { - db_iprintf("map entry %p: start=%p, end=%p\n", - (void *)entry, (void *)entry->start, (void *)entry->end); + db_iprintf("map entry %p: start=%p, end=%p, eflags=%#x, \n", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Sun Jul 30 10:49:15 2017 Return-Path: Delivered-To: svn-src-stable-10@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 53D62DB437F; Sun, 30 Jul 2017 10:49:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CEF16CB63; Sun, 30 Jul 2017 10:49:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6UAnE1u091571; Sun, 30 Jul 2017 10:49:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UAnEuZ091570; Sun, 30 Jul 2017 10:49:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707301049.v6UAnEuZ091570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Jul 2017 10:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321718 - stable/10/sys/vm X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/vm X-SVN-Commit-Revision: 321718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jul 2017 10:49:15 -0000 Author: kib Date: Sun Jul 30 10:49:13 2017 New Revision: 321718 URL: https://svnweb.freebsd.org/changeset/base/321718 Log: Restore layout of struct vm_map_entry after r321717, same as was done in r320889 for stable/11. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/vm/vm_map.h Modified: stable/10/sys/vm/vm_map.h ============================================================================== --- stable/10/sys/vm/vm_map.h Sun Jul 30 10:36:20 2017 (r321717) +++ stable/10/sys/vm/vm_map.h Sun Jul 30 10:49:13 2017 (r321718) @@ -103,6 +103,7 @@ struct vm_map_entry { struct vm_map_entry *right; /* right child in binary search tree */ vm_offset_t start; /* start address */ vm_offset_t end; /* end address */ + vm_offset_t pad0; vm_size_t adj_free; /* amount of adjacent free space */ vm_size_t max_free; /* max free space in subtree */ union vm_map_object object; /* object I point to */ From owner-svn-src-stable-10@freebsd.org Sun Jul 30 18:38:06 2017 Return-Path: Delivered-To: svn-src-stable-10@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 95DC5DC000B; Sun, 30 Jul 2017 18:38:06 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55BCA7D08B; Sun, 30 Jul 2017 18:38:06 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6UIc57e085408; Sun, 30 Jul 2017 18:38:05 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UIc5SA085406; Sun, 30 Jul 2017 18:38:05 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201707301838.v6UIc5SA085406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 30 Jul 2017 18:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321725 - stable/10/sys/net80211 X-SVN-Group: stable-10 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/10/sys/net80211 X-SVN-Commit-Revision: 321725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jul 2017 18:38:06 -0000 Author: avos Date: Sun Jul 30 18:38:05 2017 New Revision: 321725 URL: https://svnweb.freebsd.org/changeset/base/321725 Log: MFC r321401: net80211: do not allow to unload rate control module if it is still in use. Keep 'nrefs' counter up-to-date, so 'kldunload wlan_amrr' with 1+ active wlan(4) interface will not lead to kernel panic. Modified: stable/10/sys/net80211/ieee80211_amrr.c stable/10/sys/net80211/ieee80211_rssadapt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net80211/ieee80211_amrr.c ============================================================================== --- stable/10/sys/net80211/ieee80211_amrr.c Sun Jul 30 18:29:28 2017 (r321724) +++ stable/10/sys/net80211/ieee80211_amrr.c Sun Jul 30 18:38:05 2017 (r321725) @@ -111,6 +111,7 @@ amrr_init(struct ieee80211vap *vap) KASSERT(vap->iv_rs == NULL, ("%s called multiple times", __func__)); + nrefs++; /* XXX locking */ amrr = vap->iv_rs = malloc(sizeof(struct ieee80211_amrr), M_80211_RATECTL, M_NOWAIT|M_ZERO); if (amrr == NULL) { @@ -127,6 +128,8 @@ static void amrr_deinit(struct ieee80211vap *vap) { free(vap->iv_rs, M_80211_RATECTL); + KASSERT(nrefs > 0, ("imbalanced attach/detach")); + nrefs--; /* XXX locking */ } static int Modified: stable/10/sys/net80211/ieee80211_rssadapt.c ============================================================================== --- stable/10/sys/net80211/ieee80211_rssadapt.c Sun Jul 30 18:29:28 2017 (r321724) +++ stable/10/sys/net80211/ieee80211_rssadapt.c Sun Jul 30 18:38:05 2017 (r321725) @@ -127,7 +127,8 @@ rssadapt_init(struct ieee80211vap *vap) KASSERT(vap->iv_rs == NULL, ("%s: iv_rs already initialized", __func__)); - + + nrefs++; /* XXX locking */ vap->iv_rs = rs = malloc(sizeof(struct ieee80211_rssadapt), M_80211_RATECTL, M_NOWAIT|M_ZERO); if (rs == NULL) { @@ -143,6 +144,8 @@ static void rssadapt_deinit(struct ieee80211vap *vap) { free(vap->iv_rs, M_80211_RATECTL); + KASSERT(nrefs > 0, ("imbalanced attach/detach")); + nrefs--; /* XXX locking */ } static void From owner-svn-src-stable-10@freebsd.org Mon Jul 31 00:39:24 2017 Return-Path: Delivered-To: svn-src-stable-10@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 27390DC5D46; Mon, 31 Jul 2017 00:39:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAE53171D; Mon, 31 Jul 2017 00:39:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V0dNSA032071; Mon, 31 Jul 2017 00:39:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V0dN8J032070; Mon, 31 Jul 2017 00:39:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707310039.v6V0dN8J032070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 31 Jul 2017 00:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321740 - stable/10/sys/dev/ksyms X-SVN-Group: stable-10 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/10/sys/dev/ksyms X-SVN-Commit-Revision: 321740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 00:39:24 -0000 Author: markj Date: Mon Jul 31 00:39:22 2017 New Revision: 321740 URL: https://svnweb.freebsd.org/changeset/base/321740 Log: MFC r321639: Restrict permissions on /dev/ksyms to 0400. Modified: stable/10/sys/dev/ksyms/ksyms.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ksyms/ksyms.c ============================================================================== --- stable/10/sys/dev/ksyms/ksyms.c Mon Jul 31 00:35:21 2017 (r321739) +++ stable/10/sys/dev/ksyms/ksyms.c Mon Jul 31 00:39:22 2017 (r321740) @@ -592,7 +592,7 @@ ksyms_modevent(module_t mod __unused, int type, void * case MOD_LOAD: mtx_init(&ksyms_mtx, "KSyms mtx", NULL, MTX_DEF); ksyms_dev = make_dev(&ksyms_cdevsw, 0, UID_ROOT, GID_WHEEL, - 0444, KSYMS_DNAME); + 0400, KSYMS_DNAME); break; case MOD_UNLOAD: From owner-svn-src-stable-10@freebsd.org Mon Jul 31 00:41:07 2017 Return-Path: Delivered-To: svn-src-stable-10@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 151F4DC5F58; Mon, 31 Jul 2017 00:41:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B83B21B2D; Mon, 31 Jul 2017 00:41:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V0f56M033658; Mon, 31 Jul 2017 00:41:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V0f50X033657; Mon, 31 Jul 2017 00:41:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707310041.v6V0f50X033657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 31 Jul 2017 00:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321742 - stable/10/sys/dev/ksyms X-SVN-Group: stable-10 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/10/sys/dev/ksyms X-SVN-Commit-Revision: 321742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 00:41:07 -0000 Author: markj Date: Mon Jul 31 00:41:05 2017 New Revision: 321742 URL: https://svnweb.freebsd.org/changeset/base/321742 Log: MFC r321640: Fix style bugs in ksyms.c. Modified: stable/10/sys/dev/ksyms/ksyms.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ksyms/ksyms.c ============================================================================== --- stable/10/sys/dev/ksyms/ksyms.c Mon Jul 31 00:40:14 2017 (r321741) +++ stable/10/sys/dev/ksyms/ksyms.c Mon Jul 31 00:41:05 2017 (r321742) @@ -62,41 +62,40 @@ #define STR_SYMTAB ".symtab" #define STR_STRTAB ".strtab" -#define STR_SHSTRTAB ".shstrtab" +#define STR_SHSTRTAB ".shstrtab" #define KSYMS_DNAME "ksyms" -static d_open_t ksyms_open; -static d_read_t ksyms_read; -static d_close_t ksyms_close; -static d_ioctl_t ksyms_ioctl; -static d_mmap_t ksyms_mmap; +static d_open_t ksyms_open; +static d_read_t ksyms_read; +static d_close_t ksyms_close; +static d_ioctl_t ksyms_ioctl; +static d_mmap_t ksyms_mmap; static struct cdevsw ksyms_cdevsw = { - .d_version = D_VERSION, - .d_flags = D_TRACKCLOSE, - .d_open = ksyms_open, - .d_close = ksyms_close, - .d_read = ksyms_read, - .d_ioctl = ksyms_ioctl, - .d_mmap = ksyms_mmap, - .d_name = KSYMS_DNAME + .d_version = D_VERSION, + .d_flags = D_TRACKCLOSE, + .d_open = ksyms_open, + .d_close = ksyms_close, + .d_read = ksyms_read, + .d_ioctl = ksyms_ioctl, + .d_mmap = ksyms_mmap, + .d_name = KSYMS_DNAME }; struct ksyms_softc { LIST_ENTRY(ksyms_softc) sc_list; - vm_offset_t sc_uaddr; - size_t sc_usize; + vm_offset_t sc_uaddr; + size_t sc_usize; pmap_t sc_pmap; struct proc *sc_proc; }; -static struct mtx ksyms_mtx; -static struct cdev *ksyms_dev; -static LIST_HEAD(, ksyms_softc) ksyms_list = - LIST_HEAD_INITIALIZER(ksyms_list); +static struct mtx ksyms_mtx; +static struct cdev *ksyms_dev; +static LIST_HEAD(, ksyms_softc) ksyms_list = LIST_HEAD_INITIALIZER(ksyms_list); -static const char ksyms_shstrtab[] = +static const char ksyms_shstrtab[] = "\0" STR_SYMTAB "\0" STR_STRTAB "\0" STR_SHSTRTAB "\0"; struct ksyms_hdr { @@ -106,7 +105,7 @@ struct ksyms_hdr { Elf_Shdr kh_shdr[SHDR_NUM]; char kh_shstrtab[sizeof(ksyms_shstrtab)]; }; - + struct tsizes { size_t ts_symsz; size_t ts_strsz; @@ -123,7 +122,7 @@ static MALLOC_DEFINE(M_KSYMS, "KSYMS", "Kernel Symbol /* * Get the symbol and string table sizes for a kernel module. Add it to the - * running total. + * running total. */ static int ksyms_size_permod(linker_file_t lf, void *arg) @@ -132,35 +131,36 @@ ksyms_size_permod(linker_file_t lf, void *arg) const Elf_Sym *symtab; caddr_t strtab; long syms; - + ts = arg; - + syms = LINKER_SYMTAB_GET(lf, &symtab); ts->ts_symsz += syms * sizeof(Elf_Sym); ts->ts_strsz += LINKER_STRTAB_GET(lf, &strtab); - + return (0); } /* * For kernel module get the symbol and string table sizes, returning the - * totals in *ts. + * totals in *ts. */ -static void +static void ksyms_size_calc(struct tsizes *ts) { + ts->ts_symsz = 0; ts->ts_strsz = 0; - - (void) linker_file_foreach(ksyms_size_permod, ts); + + (void)linker_file_foreach(ksyms_size_permod, ts); } -#define KSYMS_EMIT(src, des, sz) do { \ - copyout(src, (void *)des, sz); \ - des += sz; \ - } while (0) +#define KSYMS_EMIT(src, des, sz) do { \ + copyout(src, (void *)des, sz); \ + des += sz; \ +} while (0) -#define SYMBLKSZ 256 * sizeof (Elf_Sym) +#define SYMBLKSZ (256 * sizeof(Elf_Sym)) /* * For a kernel module, add the symbol and string tables into the @@ -169,6 +169,7 @@ ksyms_size_calc(struct tsizes *ts) static int ksyms_add(linker_file_t lf, void *arg) { + char *buf; struct toffsets *to; const Elf_Sym *symtab; Elf_Sym *symp; @@ -176,43 +177,42 @@ ksyms_add(linker_file_t lf, void *arg) long symsz; size_t strsz, numsyms; linker_symval_t symval; - char *buf; int i, nsyms, len; - + to = arg; - + MOD_SLOCK; numsyms = LINKER_SYMTAB_GET(lf, &symtab); strsz = LINKER_STRTAB_GET(lf, &strtab); symsz = numsyms * sizeof(Elf_Sym); - + buf = malloc(SYMBLKSZ, M_KSYMS, M_WAITOK); - + while (symsz > 0) { len = min(SYMBLKSZ, symsz); bcopy(symtab, buf, len); - /* - * Fix up symbol table for kernel modules: - * string offsets need adjusted + /* + * Fix up symbol table for kernel modules: + * string offsets need adjusted * symbol values made absolute */ symp = (Elf_Sym *) buf; - nsyms = len / sizeof (Elf_Sym); + nsyms = len / sizeof(Elf_Sym); for (i = 0; i < nsyms; i++) { symp[i].st_name += to->to_stridx; - if (lf->id > 1 && LINKER_SYMBOL_VALUES(lf, - (c_linker_sym_t) &symtab[i], &symval) == 0) { - symp[i].st_value = (uintptr_t) symval.value; + if (lf->id > 1 && LINKER_SYMBOL_VALUES(lf, + (c_linker_sym_t)&symtab[i], &symval) == 0) { + symp[i].st_value = (uintptr_t)symval.value; } } - if (len > to->to_resid) { + if (len > to->to_resid) { MOD_SUNLOCK; free(buf, M_KSYMS); return (ENXIO); - } else - to->to_resid -= len; + } + to->to_resid -= len; KSYMS_EMIT(buf, to->to_symoff, len); symtab += nsyms; @@ -220,14 +220,13 @@ ksyms_add(linker_file_t lf, void *arg) } free(buf, M_KSYMS); MOD_SUNLOCK; - + if (strsz > to->to_resid) return (ENXIO); - else - to->to_resid -= strsz; + to->to_resid -= strsz; KSYMS_EMIT(strtab, to->to_stroff, strsz); to->to_stridx += strsz; - + return (0); } @@ -239,16 +238,14 @@ ksyms_add(linker_file_t lf, void *arg) static int ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, size_t resid) { - struct ksyms_hdr *hdr; - struct toffsets to; + struct toffsets to; int error = 0; - /* Be kernel stack friendly */ - hdr = malloc(sizeof (*hdr), M_KSYMS, M_WAITOK|M_ZERO); + hdr = malloc(sizeof(*hdr), M_KSYMS, M_WAITOK | M_ZERO); - /* - * Create the ELF header. + /* + * Create the ELF header. */ hdr->kh_ehdr.e_ident[EI_PAD] = 0; hdr->kh_ehdr.e_ident[EI_MAG0] = ELFMAG0; @@ -269,32 +266,32 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s hdr->kh_ehdr.e_flags = 0; hdr->kh_ehdr.e_ehsize = sizeof(Elf_Ehdr); hdr->kh_ehdr.e_phentsize = sizeof(Elf_Phdr); - hdr->kh_ehdr.e_phnum = 2; /* Text and Data */ + hdr->kh_ehdr.e_phnum = 2; /* Text and Data */ hdr->kh_ehdr.e_shentsize = sizeof(Elf_Shdr); hdr->kh_ehdr.e_shnum = SHDR_NUM; hdr->kh_ehdr.e_shstrndx = SHDR_SHSTRTAB; - /* - * Add both the text and data Program headers. + /* + * Add both the text and data program headers. */ hdr->kh_txtphdr.p_type = PT_LOAD; /* XXX - is there a way to put the actual .text addr/size here? */ - hdr->kh_txtphdr.p_vaddr = 0; - hdr->kh_txtphdr.p_memsz = 0; + hdr->kh_txtphdr.p_vaddr = 0; + hdr->kh_txtphdr.p_memsz = 0; hdr->kh_txtphdr.p_flags = PF_R | PF_X; - + hdr->kh_datphdr.p_type = PT_LOAD; /* XXX - is there a way to put the actual .data addr/size here? */ - hdr->kh_datphdr.p_vaddr = 0; - hdr->kh_datphdr.p_memsz = 0; + hdr->kh_datphdr.p_vaddr = 0; + hdr->kh_datphdr.p_memsz = 0; hdr->kh_datphdr.p_flags = PF_R | PF_W | PF_X; - /* - * Add the Section headers: null, symtab, strtab, shstrtab, + /* + * Add the section headers: null, symtab, strtab, shstrtab. */ /* First section header - null */ - + /* Second section header - symtab */ hdr->kh_shdr[SHDR_SYMTAB].sh_name = 1; /* String offset (skip null) */ hdr->kh_shdr[SHDR_SYMTAB].sh_type = SHT_SYMTAB; @@ -302,31 +299,31 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s hdr->kh_shdr[SHDR_SYMTAB].sh_addr = 0; hdr->kh_shdr[SHDR_SYMTAB].sh_offset = sizeof(*hdr); hdr->kh_shdr[SHDR_SYMTAB].sh_size = ts->ts_symsz; - hdr->kh_shdr[SHDR_SYMTAB].sh_link = SHDR_STRTAB; - hdr->kh_shdr[SHDR_SYMTAB].sh_info = ts->ts_symsz / sizeof(Elf_Sym); + hdr->kh_shdr[SHDR_SYMTAB].sh_link = SHDR_STRTAB; + hdr->kh_shdr[SHDR_SYMTAB].sh_info = ts->ts_symsz / sizeof(Elf_Sym); hdr->kh_shdr[SHDR_SYMTAB].sh_addralign = sizeof(long); hdr->kh_shdr[SHDR_SYMTAB].sh_entsize = sizeof(Elf_Sym); /* Third section header - strtab */ - hdr->kh_shdr[SHDR_STRTAB].sh_name = 1 + sizeof(STR_SYMTAB); + hdr->kh_shdr[SHDR_STRTAB].sh_name = 1 + sizeof(STR_SYMTAB); hdr->kh_shdr[SHDR_STRTAB].sh_type = SHT_STRTAB; hdr->kh_shdr[SHDR_STRTAB].sh_flags = 0; hdr->kh_shdr[SHDR_STRTAB].sh_addr = 0; - hdr->kh_shdr[SHDR_STRTAB].sh_offset = - hdr->kh_shdr[SHDR_SYMTAB].sh_offset + ts->ts_symsz; + hdr->kh_shdr[SHDR_STRTAB].sh_offset = + hdr->kh_shdr[SHDR_SYMTAB].sh_offset + ts->ts_symsz; hdr->kh_shdr[SHDR_STRTAB].sh_size = ts->ts_strsz; hdr->kh_shdr[SHDR_STRTAB].sh_link = 0; hdr->kh_shdr[SHDR_STRTAB].sh_info = 0; hdr->kh_shdr[SHDR_STRTAB].sh_addralign = sizeof(char); hdr->kh_shdr[SHDR_STRTAB].sh_entsize = 0; - + /* Fourth section - shstrtab */ hdr->kh_shdr[SHDR_SHSTRTAB].sh_name = 1 + sizeof(STR_SYMTAB) + sizeof(STR_STRTAB); hdr->kh_shdr[SHDR_SHSTRTAB].sh_type = SHT_STRTAB; hdr->kh_shdr[SHDR_SHSTRTAB].sh_flags = 0; hdr->kh_shdr[SHDR_SHSTRTAB].sh_addr = 0; - hdr->kh_shdr[SHDR_SHSTRTAB].sh_offset = + hdr->kh_shdr[SHDR_SHSTRTAB].sh_offset = offsetof(struct ksyms_hdr, kh_shstrtab); hdr->kh_shdr[SHDR_SHSTRTAB].sh_size = sizeof(ksyms_shstrtab); hdr->kh_shdr[SHDR_SHSTRTAB].sh_link = 0; @@ -334,9 +331,9 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s hdr->kh_shdr[SHDR_SHSTRTAB].sh_addralign = 0 /* sizeof(char) */; hdr->kh_shdr[SHDR_SHSTRTAB].sh_entsize = 0; - /* Copy shstrtab into the header */ + /* Copy shstrtab into the header. */ bcopy(ksyms_shstrtab, hdr->kh_shstrtab, sizeof(ksyms_shstrtab)); - + to.to_symoff = uaddr + hdr->kh_shdr[SHDR_SYMTAB].sh_offset; to.to_stroff = uaddr + hdr->kh_shdr[SHDR_STRTAB].sh_offset; to.to_stridx = 0; @@ -346,13 +343,13 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s } to.to_resid = resid - sizeof(struct ksyms_hdr); - /* Emit Header */ + /* emit header */ copyout(hdr, (void *)uaddr, sizeof(struct ksyms_hdr)); - + free(hdr, M_KSYMS); - /* Add symbol and string tables for each kernelmodule */ - error = linker_file_foreach(ksyms_add, &to); + /* Add symbol and string tables for each kernel module. */ + error = linker_file_foreach(ksyms_add, &to); if (to.to_resid != 0) return (ENXIO); @@ -365,7 +362,7 @@ ksyms_cdevpriv_dtr(void *data) { struct ksyms_softc *sc; - sc = (struct ksyms_softc *)data; + sc = (struct ksyms_softc *)data; mtx_lock(&ksyms_mtx); LIST_REMOVE(sc, sc_list); @@ -373,19 +370,18 @@ ksyms_cdevpriv_dtr(void *data) free(sc, M_KSYMS); } -/* ARGSUSED */ static int ksyms_open(struct cdev *dev, int flags, int fmt __unused, struct thread *td) { struct tsizes ts; + struct ksyms_softc *sc; size_t total_elf_sz; int error, try; - struct ksyms_softc *sc; - - /* - * Limit one open() per process. The process must close() - * before open()'ing again. - */ + + /* + * Limit one open() per process. The process must close() + * before open()'ing again. + */ mtx_lock(&ksyms_mtx); LIST_FOREACH(sc, &ksyms_list, sc_list) { if (sc->sc_proc == td->td_proc) { @@ -394,9 +390,7 @@ ksyms_open(struct cdev *dev, int flags, int fmt __unus } } - sc = (struct ksyms_softc *) malloc(sizeof (*sc), M_KSYMS, - M_NOWAIT|M_ZERO); - + sc = malloc(sizeof(*sc), M_KSYMS, M_NOWAIT | M_ZERO); if (sc == NULL) { mtx_unlock(&ksyms_mtx); return (ENOMEM); @@ -407,41 +401,39 @@ ksyms_open(struct cdev *dev, int flags, int fmt __unus mtx_unlock(&ksyms_mtx); error = devfs_set_cdevpriv(sc, ksyms_cdevpriv_dtr); - if (error) + if (error != 0) goto failed; /* - * MOD_SLOCK doesn't work here (because of a lock reversal with - * KLD_SLOCK). Therefore, simply try upto 3 times to get a "clean" + * MOD_SLOCK doesn't work here (because of a lock reversal with + * KLD_SLOCK). Therefore, simply try up to 3 times to get a "clean" * snapshot of the kernel symbol table. This should work fine in the * rare case of a kernel module being loaded/unloaded at the same - * time. + * time. */ - for(try = 0; try < 3; try++) { + for (try = 0; try < 3; try++) { /* - * Map a buffer in the calling process memory space and - * create a snapshot of the kernel symbol table in it. - */ - + * Map a buffer in the calling process memory space and + * create a snapshot of the kernel symbol table in it. + */ + /* Compute the size of buffer needed. */ ksyms_size_calc(&ts); - total_elf_sz = sizeof(struct ksyms_hdr) + ts.ts_symsz + - ts.ts_strsz; + total_elf_sz = sizeof(struct ksyms_hdr) + ts.ts_symsz + + ts.ts_strsz; - error = copyout_map(td, &(sc->sc_uaddr), - (vm_size_t) total_elf_sz); - if (error) + error = copyout_map(td, &sc->sc_uaddr, (vm_size_t)total_elf_sz); + if (error != 0) break; - sc->sc_usize = total_elf_sz; + sc->sc_usize = total_elf_sz; - error = ksyms_snapshot(&ts, sc->sc_uaddr, total_elf_sz); - if (!error) { - /* Successful Snapshot */ - return (0); - } - - /* Snapshot failed, unmap the memory and try again */ - (void) copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); + error = ksyms_snapshot(&ts, sc->sc_uaddr, total_elf_sz); + if (error == 0) + /* successful snapshot */ + return (0); + + /* Snapshot failed, unmap the memory and try again. */ + (void)copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); } failed: @@ -449,30 +441,28 @@ failed: return (error); } -/* ARGSUSED */ static int ksyms_read(struct cdev *dev, struct uio *uio, int flags __unused) { - int error; - size_t len, sz; struct ksyms_softc *sc; - off_t off; char *buf; + off_t off; + size_t len, sz; vm_size_t ubase; - + int error; + error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); - + off = uio->uio_offset; - len = uio->uio_resid; - + len = uio->uio_resid; + if (off < 0 || off > sc->sc_usize) return (EFAULT); - if (len > (sc->sc_usize - off)) + if (len > sc->sc_usize - off) len = sc->sc_usize - off; - if (len == 0) return (0); @@ -485,16 +475,14 @@ ksyms_read(struct cdev *dev, struct uio *uio, int flag ubase = sc->sc_uaddr + off; while (len) { - sz = min(PAGE_SIZE, len); - if (copyin((void *)ubase, buf, sz)) - error = EFAULT; + if (copyin((void *)ubase, buf, sz) != 0) + error = EFAULT; else error = uiomove(buf, sz, uio); - - if (error) + if (error != 0) break; - + len -= sz; ubase += sz; } @@ -503,27 +491,25 @@ ksyms_read(struct cdev *dev, struct uio *uio, int flag return (error); } -/* ARGSUSED */ static int ksyms_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int32_t flag __unused, struct thread *td __unused) { - int error = 0; struct ksyms_softc *sc; + int error; error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); switch (cmd) { case KIOCGSIZE: - /* + /* * Return the size (in bytes) of the symbol table * snapshot. */ *(size_t *)data = sc->sc_usize; break; - case KIOCGADDR: /* * Return the address of the symbol table snapshot. @@ -531,7 +517,6 @@ ksyms_ioctl(struct cdev *dev, u_long cmd, caddr_t data */ *(void **)data = (void *)sc->sc_uaddr; break; - default: error = ENOTTY; break; @@ -540,71 +525,64 @@ ksyms_ioctl(struct cdev *dev, u_long cmd, caddr_t data return (error); } -/* ARGUSED */ static int ksyms_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, - int prot __unused, vm_memattr_t *memattr __unused) + int prot __unused, vm_memattr_t *memattr __unused) { - struct ksyms_softc *sc; + struct ksyms_softc *sc; int error; error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); /* * XXX mmap() will actually map the symbol table into the process * address space again. */ - if (offset > round_page(sc->sc_usize) || - (*paddr = pmap_extract(sc->sc_pmap, - (vm_offset_t)sc->sc_uaddr + offset)) == 0) + if (offset > round_page(sc->sc_usize) || + (*paddr = pmap_extract(sc->sc_pmap, + (vm_offset_t)sc->sc_uaddr + offset)) == 0) return (-1); return (0); } -/* ARGUSED */ static int ksyms_close(struct cdev *dev, int flags __unused, int fmt __unused, - struct thread *td) + struct thread *td) { - int error = 0; struct ksyms_softc *sc; + int error; error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); /* Unmap the buffer from the process address space. */ - error = copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); - - return (error); + return (copyout_unmap(td, sc->sc_uaddr, sc->sc_usize)); } -/* ARGSUSED */ static int ksyms_modevent(module_t mod __unused, int type, void *data __unused) { - int error = 0; + int error; + error = 0; switch (type) { case MOD_LOAD: mtx_init(&ksyms_mtx, "KSyms mtx", NULL, MTX_DEF); ksyms_dev = make_dev(&ksyms_cdevsw, 0, UID_ROOT, GID_WHEEL, 0400, KSYMS_DNAME); break; - case MOD_UNLOAD: if (!LIST_EMPTY(&ksyms_list)) return (EBUSY); destroy_dev(ksyms_dev); mtx_destroy(&ksyms_mtx); break; - case MOD_SHUTDOWN: break; - default: error = EOPNOTSUPP; break; From owner-svn-src-stable-10@freebsd.org Mon Jul 31 03:49:09 2017 Return-Path: Delivered-To: svn-src-stable-10@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 BD122DC89D8; Mon, 31 Jul 2017 03:49:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 793C065ED6; Mon, 31 Jul 2017 03:49:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V3n8ec010308; Mon, 31 Jul 2017 03:49:08 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V3n82L010306; Mon, 31 Jul 2017 03:49:08 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707310349.v6V3n82L010306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 31 Jul 2017 03:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321752 - stable/10/sys/net X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/net X-SVN-Commit-Revision: 321752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 03:49:09 -0000 Author: sephe Date: Mon Jul 31 03:49:08 2017 New Revision: 321752 URL: https://svnweb.freebsd.org/changeset/base/321752 Log: MFC 321406 ethernet: Add ethernet interface attached event and devctl notification. ifnet_arrival_event may not be adequate under certain situation; e.g. when the LLADDR is needed. So the ethernet ifattach event is announced after all necessary bits are setup. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11617 Modified: stable/10/sys/net/ethernet.h stable/10/sys/net/if_ethersubr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/ethernet.h ============================================================================== --- stable/10/sys/net/ethernet.h Mon Jul 31 03:19:16 2017 (r321751) +++ stable/10/sys/net/ethernet.h Mon Jul 31 03:49:08 2017 (r321752) @@ -384,6 +384,12 @@ void ether_vlan_mtap(struct bpf_if *, struct mbuf *, void *, u_int); struct mbuf *ether_vlanencap(struct mbuf *, uint16_t); +#ifdef SYS_EVENTHANDLER_H +/* new ethernet interface attached event */ +typedef void (*ether_ifattach_event_handler_t)(void *, struct ifnet *); +EVENTHANDLER_DECLARE(ether_ifattach_event, ether_ifattach_event_handler_t); +#endif + #else /* _KERNEL */ #include Modified: stable/10/sys/net/if_ethersubr.c ============================================================================== --- stable/10/sys/net/if_ethersubr.c Mon Jul 31 03:19:16 2017 (r321751) +++ stable/10/sys/net/if_ethersubr.c Mon Jul 31 03:49:08 2017 (r321752) @@ -39,6 +39,8 @@ #include #include +#include +#include #include #include #include @@ -933,6 +935,11 @@ ether_ifattach(struct ifnet *ifp, const u_int8_t *lla) if_printf(ifp, "Ethernet address: %6D\n", lla, ":"); uuid_ether_add(LLADDR(sdl)); + + /* Add necessary bits are setup; announce it now. */ + EVENTHANDLER_INVOKE(ether_ifattach_event, ifp); + if (IS_DEFAULT_VNET(curvnet)) + devctl_notify("ETHERNET", ifp->if_xname, "IFATTACH", NULL); } /* From owner-svn-src-stable-10@freebsd.org Mon Jul 31 03:57:47 2017 Return-Path: Delivered-To: svn-src-stable-10@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 4ABBCDC8FE6; Mon, 31 Jul 2017 03:57:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1346866351; Mon, 31 Jul 2017 03:57:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V3vkFu014556; Mon, 31 Jul 2017 03:57:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V3vkRV014554; Mon, 31 Jul 2017 03:57:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707310357.v6V3vkRV014554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 31 Jul 2017 03:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321753 - in stable/10/share/examples/tests/tests: atf plain X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/share/examples/tests/tests: atf plain X-SVN-Commit-Revision: 321753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 03:57:47 -0000 Author: ngie Date: Mon Jul 31 03:57:45 2017 New Revision: 321753 URL: https://svnweb.freebsd.org/changeset/base/321753 Log: MFC Note: ${FILES} documentation change omitted since r299094 will not be MFCed to ^/stable/10 . MFC r320442: share/examples/tests/{atf,plain}/Makefile: tweak example Makefile snippets - Including bsd.own.mk isn't required since no MK_ knobs are being manipulated. - Update documentation to note that ${FILES} is installed via bsd.progs.mk, not bsd.prog.mk. Modified: stable/10/share/examples/tests/tests/atf/Makefile stable/10/share/examples/tests/tests/plain/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/examples/tests/tests/atf/Makefile ============================================================================== --- stable/10/share/examples/tests/tests/atf/Makefile Mon Jul 31 03:49:08 2017 (r321752) +++ stable/10/share/examples/tests/tests/atf/Makefile Mon Jul 31 03:57:45 2017 (r321753) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - # Directory into which the Kyuafile provided by this directory will be # installed. # Modified: stable/10/share/examples/tests/tests/plain/Makefile ============================================================================== --- stable/10/share/examples/tests/tests/plain/Makefile Mon Jul 31 03:49:08 2017 (r321752) +++ stable/10/share/examples/tests/tests/plain/Makefile Mon Jul 31 03:57:45 2017 (r321753) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - # Directory into which the Kyuafile provided by this directory will be # installed. # From owner-svn-src-stable-10@freebsd.org Mon Jul 31 03:59:08 2017 Return-Path: Delivered-To: svn-src-stable-10@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 8332CDC9094; Mon, 31 Jul 2017 03:59:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBC3664E9; Mon, 31 Jul 2017 03:59:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V3x7dD014736; Mon, 31 Jul 2017 03:59:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V3x73f014734; Mon, 31 Jul 2017 03:59:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707310359.v6V3x73f014734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 31 Jul 2017 03:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321755 - in stable/10: contrib/atf/atf-sh libexec/atf/atf-sh X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: contrib/atf/atf-sh libexec/atf/atf-sh X-SVN-Commit-Revision: 321755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 03:59:08 -0000 Author: ngie Date: Mon Jul 31 03:59:07 2017 New Revision: 321755 URL: https://svnweb.freebsd.org/changeset/base/321755 Log: MFC r320491: atf-sh(3): document atf_init_test_cases(3) fully The function was missing from the NAME/SYNOPSIS sections. Add a manpage link to complete the documentation reference. Modified: stable/10/contrib/atf/atf-sh/atf-sh.3 stable/10/libexec/atf/atf-sh/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/atf/atf-sh/atf-sh.3 ============================================================================== --- stable/10/contrib/atf/atf-sh/atf-sh.3 Mon Jul 31 03:58:58 2017 (r321754) +++ stable/10/contrib/atf/atf-sh/atf-sh.3 Mon Jul 31 03:59:07 2017 (r321755) @@ -40,6 +40,7 @@ .Nm atf_fail , .Nm atf_get , .Nm atf_get_srcdir , +.Nm atf_init_test_cases , .Nm atf_pass , .Nm atf_require_prog , .Nm atf_set , @@ -82,6 +83,8 @@ .Nm atf_get .Qq var_name .Nm atf_get_srcdir +.Nm atf_init_test_cases +.Qq name .Nm atf_pass .Nm atf_require_prog .Qq prog_name Modified: stable/10/libexec/atf/atf-sh/Makefile ============================================================================== --- stable/10/libexec/atf/atf-sh/Makefile Mon Jul 31 03:58:58 2017 (r321754) +++ stable/10/libexec/atf/atf-sh/Makefile Mon Jul 31 03:59:07 2017 (r321755) @@ -51,6 +51,7 @@ MLINKS+= \ atf-sh.3 atf_fail.3 \ atf-sh.3 atf_get.3 \ atf-sh.3 atf_get_srcdir.3 \ + atf-sh.3 atf_init_test_cases.3 \ atf-sh.3 atf_pass.3 \ atf-sh.3 atf_require_prog.3 \ atf-sh.3 atf_set.3 \ From owner-svn-src-stable-10@freebsd.org Mon Jul 31 06:27:44 2017 Return-Path: Delivered-To: svn-src-stable-10@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 BD526DCAE7A; Mon, 31 Jul 2017 06:27:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E69369AFF; Mon, 31 Jul 2017 06:27:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V6RhGl074862; Mon, 31 Jul 2017 06:27:43 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V6RhHh074860; Mon, 31 Jul 2017 06:27:43 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707310627.v6V6RhHh074860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 31 Jul 2017 06:27:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321759 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 321759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 06:27:44 -0000 Author: sephe Date: Mon Jul 31 06:27:43 2017 New Revision: 321759 URL: https://svnweb.freebsd.org/changeset/base/321759 Log: MFC 321407 hyperv/hn: Export VF list and VF-HN mapping The VF-HN map will be used later on to implement "transparent VF". Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11618 Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 31 05:23:32 2017 (r321758) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 31 06:27:43 2017 (r321759) @@ -69,6 +69,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -118,6 +120,8 @@ __FBSDID("$FreeBSD$"); #define HN_RING_CNT_DEF_MAX 8 +#define HN_VFMAP_SIZE_DEF 8 + /* YYY should get it from the underlying channel */ #define HN_TX_DESC_CNT 512 @@ -250,6 +254,11 @@ static int hn_ifmedia_upd(struct ifnet *); static void hn_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static void hn_ifnet_event(void *, struct ifnet *, int); +static void hn_ifaddr_event(void *, struct ifnet *); +static void hn_ifnet_attevent(void *, struct ifnet *); +static void hn_ifnet_detevent(void *, struct ifnet *); + static int hn_rndis_rxinfo(const void *, int, struct hn_rxinfo *); static void hn_rndis_rx_data(struct hn_rx_ring *, @@ -296,6 +305,9 @@ static int hn_txagg_pktmax_sysctl(SYSCTL_HANDLER_ARG static int hn_txagg_align_sysctl(SYSCTL_HANDLER_ARGS); static int hn_polling_sysctl(SYSCTL_HANDLER_ARGS); static int hn_vf_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_rxvf_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_vflist_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_vfmap_sysctl(SYSCTL_HANDLER_ARGS); static void hn_stop(struct hn_softc *, bool); static void hn_init_locked(struct hn_softc *); @@ -493,9 +505,21 @@ static int hn_tx_agg_pkts = -1; SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_pkts, CTLFLAG_RDTUN, &hn_tx_agg_pkts, 0, "Packet transmission aggregation packet limit"); +/* VF list */ +SYSCTL_PROC(_hw_hn, OID_AUTO, vflist, CTLFLAG_RD | CTLTYPE_STRING, + 0, 0, hn_vflist_sysctl, "A", "VF list"); + +/* VF mapping */ +SYSCTL_PROC(_hw_hn, OID_AUTO, vfmap, CTLFLAG_RD | CTLTYPE_STRING, + 0, 0, hn_vfmap_sysctl, "A", "VF mapping"); + static u_int hn_cpu_index; /* next CPU for channel */ static struct taskqueue **hn_tx_taskque;/* shared TX taskqueues */ +static struct rmlock hn_vfmap_lock; +static int hn_vfmap_size; +static struct ifnet **hn_vfmap; + static const uint8_t hn_rss_key_default[NDIS_HASH_KEYSIZE_TOEPLITZ] = { 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, @@ -958,7 +982,7 @@ hn_update_vf_task(void *arg, int pending __unused) { struct hn_update_vf *uv = arg; - uv->rxr->hn_vf = uv->vf; + uv->rxr->hn_rxvf_ifp = uv->vf; } static void @@ -981,37 +1005,50 @@ hn_update_vf(struct hn_softc *sc, struct ifnet *vf) uv.vf = vf; vmbus_chan_run_task(rxr->hn_chan, &task); } else { - rxr->hn_vf = vf; + rxr->hn_rxvf_ifp = vf; } } } -static void -hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool vf) +static __inline bool +hn_ismyvf(const struct hn_softc *sc, const struct ifnet *ifp) { - struct ifnet *hn_ifp; + const struct ifnet *hn_ifp; - HN_LOCK(sc); - - if (!(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)) - goto out; - hn_ifp = sc->hn_ifp; if (ifp == hn_ifp) - goto out; + return (false); if (ifp->if_alloctype != IFT_ETHER) - goto out; + return (false); /* Ignore lagg/vlan interfaces */ if (strcmp(ifp->if_dname, "lagg") == 0 || strcmp(ifp->if_dname, "vlan") == 0) - goto out; + return (false); if (bcmp(IF_LLADDR(ifp), IF_LLADDR(hn_ifp), ETHER_ADDR_LEN) != 0) + return (false); + + return (true); +} + +static void +hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool vf) +{ + struct ifnet *hn_ifp; + + HN_LOCK(sc); + + if (!(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)) goto out; + if (!hn_ismyvf(sc, ifp)) + goto out; + + hn_ifp = sc->hn_ifp; + /* Now we're sure 'ifp' is a real VF device. */ if (vf) { if (sc->hn_flags & HN_FLAG_VF) @@ -1024,7 +1061,7 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool goto out; sc->hn_flags &= ~HN_FLAG_VF; - if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) + if (hn_ifp->if_drv_flags & IFF_DRV_RUNNING) hn_rxfilter_config(sc); else hn_set_rxfilter(sc, NDIS_PACKET_TYPE_NONE); @@ -1039,7 +1076,7 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool hn_suspend_mgmt(sc); sc->hn_link_flags &= ~(HN_LINK_FLAG_LINKUP | HN_LINK_FLAG_NETCHG); - if_link_state_change(sc->hn_ifp, LINK_STATE_DOWN); + if_link_state_change(hn_ifp, LINK_STATE_DOWN); } else { hn_resume_mgmt(sc); } @@ -1069,6 +1106,85 @@ hn_ifaddr_event(void *arg, struct ifnet *ifp) hn_set_vf(arg, ifp, ifp->if_flags & IFF_UP); } +static void +hn_ifnet_attevent(void *xsc, struct ifnet *ifp) +{ + struct hn_softc *sc = xsc; + + HN_LOCK(sc); + + if (!(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)) + goto done; + + if (!hn_ismyvf(sc, ifp)) + goto done; + + if (sc->hn_vf_ifp != NULL) { + if_printf(sc->hn_ifp, "%s was attached as VF\n", + sc->hn_vf_ifp->if_xname); + goto done; + } + + rm_wlock(&hn_vfmap_lock); + + if (ifp->if_index >= hn_vfmap_size) { + struct ifnet **newmap; + int newsize; + + newsize = ifp->if_index + HN_VFMAP_SIZE_DEF; + newmap = malloc(sizeof(struct ifnet *) * newsize, M_DEVBUF, + M_WAITOK | M_ZERO); + + memcpy(newmap, hn_vfmap, + sizeof(struct ifnet *) * hn_vfmap_size); + free(hn_vfmap, M_DEVBUF); + hn_vfmap = newmap; + hn_vfmap_size = newsize; + } + KASSERT(hn_vfmap[ifp->if_index] == NULL, + ("%s: ifindex %d was mapped to %s", + ifp->if_xname, ifp->if_index, hn_vfmap[ifp->if_index]->if_xname)); + hn_vfmap[ifp->if_index] = sc->hn_ifp; + + rm_wunlock(&hn_vfmap_lock); + + sc->hn_vf_ifp = ifp; +done: + HN_UNLOCK(sc); +} + +static void +hn_ifnet_detevent(void *xsc, struct ifnet *ifp) +{ + struct hn_softc *sc = xsc; + + HN_LOCK(sc); + + if (sc->hn_vf_ifp == NULL) + goto done; + + if (!hn_ismyvf(sc, ifp)) + goto done; + + sc->hn_vf_ifp = NULL; + + rm_wlock(&hn_vfmap_lock); + + KASSERT(ifp->if_index < hn_vfmap_size, + ("ifindex %d, vfmapsize %d", ifp->if_index, hn_vfmap_size)); + if (hn_vfmap[ifp->if_index] != NULL) { + KASSERT(hn_vfmap[ifp->if_index] == sc->hn_ifp, + ("%s: ifindex %d was mapped to %s", + ifp->if_xname, ifp->if_index, + hn_vfmap[ifp->if_index]->if_xname)); + hn_vfmap[ifp->if_index] = NULL; + } + + rm_wunlock(&hn_vfmap_lock); +done: + HN_UNLOCK(sc); +} + /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */ static const struct hyperv_guid g_net_vsc_device_type = { .hv_guid = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, @@ -1300,6 +1416,9 @@ hn_attach(device_t dev) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "vf", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, hn_vf_sysctl, "A", "Virtual Function's name"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rxvf", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + hn_rxvf_sysctl, "A", "activated Virtual Function's name"); /* * Setup the ifmedia, which has been initialized earlier. @@ -1395,10 +1514,14 @@ hn_attach(device_t dev) sc->hn_ifnet_evthand = EVENTHANDLER_REGISTER(ifnet_event, hn_ifnet_event, sc, EVENTHANDLER_PRI_ANY); - sc->hn_ifaddr_evthand = EVENTHANDLER_REGISTER(ifaddr_event, hn_ifaddr_event, sc, EVENTHANDLER_PRI_ANY); + sc->hn_ifnet_atthand = EVENTHANDLER_REGISTER(ether_ifattach_event, + hn_ifnet_attevent, sc, EVENTHANDLER_PRI_ANY); + sc->hn_ifnet_dethand = EVENTHANDLER_REGISTER(ifnet_departure_event, + hn_ifnet_detevent, sc, EVENTHANDLER_PRI_ANY); + return (0); failed: if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) @@ -1411,13 +1534,26 @@ static int hn_detach(device_t dev) { struct hn_softc *sc = device_get_softc(dev); - struct ifnet *ifp = sc->hn_ifp; + struct ifnet *ifp = sc->hn_ifp, *vf_ifp; if (sc->hn_ifaddr_evthand != NULL) EVENTHANDLER_DEREGISTER(ifaddr_event, sc->hn_ifaddr_evthand); if (sc->hn_ifnet_evthand != NULL) EVENTHANDLER_DEREGISTER(ifnet_event, sc->hn_ifnet_evthand); + if (sc->hn_ifnet_atthand != NULL) { + EVENTHANDLER_DEREGISTER(ether_ifattach_event, + sc->hn_ifnet_atthand); + } + if (sc->hn_ifnet_dethand != NULL) { + EVENTHANDLER_DEREGISTER(ifnet_departure_event, + sc->hn_ifnet_dethand); + } + vf_ifp = sc->hn_vf_ifp; + __compiler_membar(); + if (vf_ifp != NULL) + hn_ifnet_detevent(sc, vf_ifp); + if (sc->hn_xact != NULL && vmbus_chan_is_revoked(sc->hn_prichan)) { /* * In case that the vmbus missed the orphan handler @@ -2315,7 +2451,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int int hash_type = M_HASHTYPE_OPAQUE; /* If the VF is active, inject the packet through the VF */ - ifp = rxr->hn_vf ? rxr->hn_vf : rxr->hn_ifp; + ifp = rxr->hn_rxvf_ifp ? rxr->hn_rxvf_ifp : rxr->hn_ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { /* @@ -3284,12 +3420,12 @@ static int hn_vf_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; - char vf_name[128]; + char vf_name[IFNAMSIZ + 1]; struct ifnet *vf; HN_LOCK(sc); vf_name[0] = '\0'; - vf = sc->hn_rx_ring[0].hn_vf; + vf = sc->hn_vf_ifp; if (vf != NULL) snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); HN_UNLOCK(sc); @@ -3297,6 +3433,110 @@ hn_vf_sysctl(SYSCTL_HANDLER_ARGS) } static int +hn_rxvf_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + char vf_name[IFNAMSIZ + 1]; + struct ifnet *vf; + + HN_LOCK(sc); + vf_name[0] = '\0'; + vf = sc->hn_rx_ring[0].hn_rxvf_ifp; + if (vf != NULL) + snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); + HN_UNLOCK(sc); + return sysctl_handle_string(oidp, vf_name, sizeof(vf_name), req); +} + +static int +hn_vflist_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct rm_priotracker pt; + struct sbuf *sb; + int error, i; + bool first; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + + sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (sb == NULL) + return (ENOMEM); + + rm_rlock(&hn_vfmap_lock, &pt); + + first = true; + for (i = 0; i < hn_vfmap_size; ++i) { + struct ifnet *ifp; + + if (hn_vfmap[i] == NULL) + continue; + + ifp = ifnet_byindex(i); + if (ifp != NULL) { + if (first) + sbuf_printf(sb, "%s", ifp->if_xname); + else + sbuf_printf(sb, " %s", ifp->if_xname); + first = false; + } + } + + rm_runlock(&hn_vfmap_lock, &pt); + + error = sbuf_finish(sb); + sbuf_delete(sb); + return (error); +} + +static int +hn_vfmap_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct rm_priotracker pt; + struct sbuf *sb; + int error, i; + bool first; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + + sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (sb == NULL) + return (ENOMEM); + + rm_rlock(&hn_vfmap_lock, &pt); + + first = true; + for (i = 0; i < hn_vfmap_size; ++i) { + struct ifnet *ifp, *hn_ifp; + + hn_ifp = hn_vfmap[i]; + if (hn_ifp == NULL) + continue; + + ifp = ifnet_byindex(i); + if (ifp != NULL) { + if (first) { + sbuf_printf(sb, "%s:%s", ifp->if_xname, + hn_ifp->if_xname); + } else { + sbuf_printf(sb, " %s:%s", ifp->if_xname, + hn_ifp->if_xname); + } + first = false; + } + } + + rm_runlock(&hn_vfmap_lock, &pt); + + error = sbuf_finish(sb); + sbuf_delete(sb); + return (error); +} + +static int hn_check_iplen(const struct mbuf *m, int hoff) { const struct ip *ip; @@ -5781,11 +6021,19 @@ hn_chan_callback(struct vmbus_channel *chan, void *xrx } static void -hn_tx_taskq_create(void *arg __unused) +hn_sysinit(void *arg __unused) { int i; /* + * Initialize VF map. + */ + rm_init_flags(&hn_vfmap_lock, "hn_vfmap", RM_SLEEPABLE); + hn_vfmap_size = HN_VFMAP_SIZE_DEF; + hn_vfmap = malloc(sizeof(struct ifnet *) * hn_vfmap_size, M_DEVBUF, + M_WAITOK | M_ZERO); + + /* * Fix the # of TX taskqueues. */ if (hn_tx_taskq_cnt <= 0) @@ -5821,11 +6069,10 @@ hn_tx_taskq_create(void *arg __unused) "hn tx%d", i); } } -SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_SECOND, - hn_tx_taskq_create, NULL); +SYSINIT(hn_sysinit, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_sysinit, NULL); static void -hn_tx_taskq_destroy(void *arg __unused) +hn_sysuninit(void *arg __unused) { if (hn_tx_taskque != NULL) { @@ -5835,6 +6082,9 @@ hn_tx_taskq_destroy(void *arg __unused) taskqueue_free(hn_tx_taskque[i]); free(hn_tx_taskque, M_DEVBUF); } + + if (hn_vfmap != NULL) + free(hn_vfmap, M_DEVBUF); + rm_destroy(&hn_vfmap_lock); } -SYSUNINIT(hn_txtq_destroy, SI_SUB_DRIVERS, SI_ORDER_SECOND, - hn_tx_taskq_destroy, NULL); +SYSUNINIT(hn_sysuninit, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_sysuninit, NULL); Modified: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Mon Jul 31 05:23:32 2017 (r321758) +++ stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Mon Jul 31 06:27:43 2017 (r321759) @@ -59,7 +59,7 @@ struct hn_tx_ring; struct hn_rx_ring { struct ifnet *hn_ifp; - struct ifnet *hn_vf; /* SR-IOV VF */ + struct ifnet *hn_rxvf_ifp; /* SR-IOV VF for RX */ struct hn_tx_ring *hn_txr; void *hn_pktbuf; int hn_pktbuf_len; @@ -175,6 +175,7 @@ struct hn_tx_ring { struct hn_softc { struct ifnet *hn_ifp; struct arpcom arpcom; + struct ifnet *hn_vf_ifp; /* SR-IOV VF */ struct ifmedia hn_media; device_t hn_dev; int hn_if_flags; @@ -239,6 +240,8 @@ struct hn_softc { eventhandler_tag hn_ifaddr_evthand; eventhandler_tag hn_ifnet_evthand; + eventhandler_tag hn_ifnet_atthand; + eventhandler_tag hn_ifnet_dethand; }; #define HN_FLAG_RXBUF_CONNECTED 0x0001 From owner-svn-src-stable-10@freebsd.org Mon Jul 31 06:40:10 2017 Return-Path: Delivered-To: svn-src-stable-10@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 DADB3DCB1E5; Mon, 31 Jul 2017 06:40:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7A6169FE8; Mon, 31 Jul 2017 06:40:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V6e9UG079299; Mon, 31 Jul 2017 06:40:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V6e976079298; Mon, 31 Jul 2017 06:40:09 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707310640.v6V6e976079298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 31 Jul 2017 06:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321760 - stable/10/sys/net X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/net X-SVN-Commit-Revision: 321760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 06:40:11 -0000 Author: sephe Date: Mon Jul 31 06:40:09 2017 New Revision: 321760 URL: https://svnweb.freebsd.org/changeset/base/321760 Log: MFC 321408 rndis: Add LINK_SPEED_CHANGE status Reviewed by: hselasky Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11650 Modified: stable/10/sys/net/rndis.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/rndis.h ============================================================================== --- stable/10/sys/net/rndis.h Mon Jul 31 06:27:43 2017 (r321759) +++ stable/10/sys/net/rndis.h Mon Jul 31 06:40:09 2017 (r321760) @@ -31,6 +31,7 @@ #define RNDIS_STATUS_PENDING 0x00000103L #define RNDIS_STATUS_MEDIA_CONNECT 0x4001000BL #define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000CL +#define RNDIS_STATUS_LINK_SPEED_CHANGE 0x40010013L #define RNDIS_STATUS_NETWORK_CHANGE 0x40010018L #define RNDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG 0x40020006L #define RNDIS_STATUS_BUFFER_OVERFLOW 0x80000005L From owner-svn-src-stable-10@freebsd.org Mon Jul 31 06:53:44 2017 Return-Path: Delivered-To: svn-src-stable-10@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 985D4DCB635; Mon, 31 Jul 2017 06:53:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 578C06A78C; Mon, 31 Jul 2017 06:53:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V6rhNx086942; Mon, 31 Jul 2017 06:53:43 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V6rh1w086941; Mon, 31 Jul 2017 06:53:43 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707310653.v6V6rh1w086941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 31 Jul 2017 06:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321761 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 321761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 06:53:44 -0000 Author: sephe Date: Mon Jul 31 06:53:43 2017 New Revision: 321761 URL: https://svnweb.freebsd.org/changeset/base/321761 Log: MFC 321409 hyperv/hn: Ignore LINK_SPEED_CHANGE status. This status will be reported if the backend NIC is wireless; it's not useful. Due to the high frequency of the reporting, this could be pretty annoying; ignore it. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11651 Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 31 06:40:09 2017 (r321760) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 31 06:53:43 2017 (r321761) @@ -5526,6 +5526,7 @@ hn_rndis_rx_status(struct hn_softc *sc, const void *da break; case RNDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG: + case RNDIS_STATUS_LINK_SPEED_CHANGE: /* Not really useful; ignore. */ break; From owner-svn-src-stable-10@freebsd.org Mon Jul 31 09:28:44 2017 Return-Path: Delivered-To: svn-src-stable-10@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 9C013DCE969; Mon, 31 Jul 2017 09:28:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 682ED6FC48; Mon, 31 Jul 2017 09:28:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V9Sh7x048773; Mon, 31 Jul 2017 09:28:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V9Sh8X048772; Mon, 31 Jul 2017 09:28:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707310928.v6V9Sh8X048772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 31 Jul 2017 09:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321775 - stable/10/usr.bin/ar X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/usr.bin/ar X-SVN-Commit-Revision: 321775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 09:28:44 -0000 Author: emaste Date: Mon Jul 31 09:28:43 2017 New Revision: 321775 URL: https://svnweb.freebsd.org/changeset/base/321775 Log: MFC r321436: ar: handle partial writes from archive_write_data libarchive may limit a single archive_write_data call to handling 0x7fffffff bytes. Add a loop to handle partial writes. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/ar/write.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/ar/write.c ============================================================================== --- stable/10/usr.bin/ar/write.c Mon Jul 31 09:18:53 2017 (r321774) +++ stable/10/usr.bin/ar/write.c Mon Jul 31 09:28:43 2017 (r321775) @@ -581,10 +581,17 @@ prefault_buffer(const char *buf, size_t s) static void write_data(struct bsdar *bsdar, struct archive *a, const void *buf, size_t s) { + ssize_t written; + prefault_buffer(buf, s); - if (archive_write_data(a, buf, s) != (ssize_t)s) - bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", - archive_error_string(a)); + while (s > 0) { + written = archive_write_data(a, buf, s); + if (written < 0) + bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", + archive_error_string(a)); + buf = (const char *)buf + written; + s -= written; + } } /* From owner-svn-src-stable-10@freebsd.org Mon Jul 31 21:34:18 2017 Return-Path: Delivered-To: svn-src-stable-10@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 0579BDBE2DE; Mon, 31 Jul 2017 21:34:18 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-wr0-x236.google.com (mail-wr0-x236.google.com [IPv6:2a00:1450:400c:c0c::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 8F2446996A; Mon, 31 Jul 2017 21:34:17 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-wr0-x236.google.com with SMTP id k71so130613617wrc.2; Mon, 31 Jul 2017 14:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ePoEDXOTV4tNbUsk7KOdRiFYKh+Me4RvGtJ7HjMjmeg=; b=kRLkNmEYPgnj/W4BAoAMPKL5zpwk0L0UMih/nWyAMv2E8c5QUXLASygBS+YwqoefLF scUrEshfj+hKgBDuzEyeEzqRCiKhGr3DldQZNXaiE9Kh7SvhR+NifsAzE6kNl0M0MBwp jIoZwNJgxme/h1VJFylYryRYM6uUqR/ItQnJr21MX4xlkPN5xk7zC23RTOvxDMTnPNAD qMGslSaTzdQ9laugaglTgzbYb9y78PpEMQ5dMFgBswRfIrTxN41GYUC6KhbYhZYp/kTM +f6Z1sHKWkLk/+XsUYC5a7yq1aHXvPxxwRLdlg/d0ceE7DBz0q5c+fCk4uWsi3GY7RYU FNmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ePoEDXOTV4tNbUsk7KOdRiFYKh+Me4RvGtJ7HjMjmeg=; b=X79DuK/PZo70T2vBozVYiIr9BRPNrP9p2oRfuzcdAJUymJXkxc4BSQl5JryouaGvdO gLJfgdMLHT6eqcRWxKCDbul9MKCmbYFsJB+D2/jqQYFqCXGRAnoB93nCmW9vlBMZgLXt z5LTTkNPNpIzLAHRprqarZnJ2UUuY6D1hbbdc35wJUFKAHlK8PUzaTUhlF8cOLFyNxkK Th3/f5I74FXjhXtyVAoE3RwzZsLBgNy7hSoBDIgKgCi7YiJwp56Dqduzac8fEYpUJgM4 1ipz0q+4TDMHWrIBxkGIYSlEc3i/SyykQTwWc5YBWfYpbZAs5/1+TsouHdIzt/sZ5Hyh UmBw== X-Gm-Message-State: AIVw111CWAPnl3Ud1Xd1vls16NJSHdwZRmY6VZu/mfRI3EFzXjAA6xiT fLvFpqU3gtW0/qUCWkbIOqxCMHsZ72ns X-Received: by 10.223.174.209 with SMTP id y75mr12381378wrc.19.1501536855005; Mon, 31 Jul 2017 14:34:15 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.28.208.3 with HTTP; Mon, 31 Jul 2017 14:34:14 -0700 (PDT) In-Reply-To: <201707172112.v6HLC2In057796@repo.freebsd.org> References: <201707172112.v6HLC2In057796@repo.freebsd.org> From: Alan Somers Date: Mon, 31 Jul 2017 15:34:14 -0600 X-Google-Sender-Auth: 51n7hh27qLUN5-gSsD8UMUSzeX4 Message-ID: Subject: Re: svn commit: r321093 - in stable/10: bin/ln bin/ln/tests etc/mtree To: Ngie Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 21:34:18 -0000 On Mon, Jul 17, 2017 at 3:12 PM, Ngie Cooper wrote: > Author: ngie > Date: Mon Jul 17 21:12:02 2017 > New Revision: 321093 > URL: https://svnweb.freebsd.org/changeset/base/321093 > > Log: > MFC r319857: > > ln(1): wordsmith -F option description > > Added: > stable/10/bin/ln/tests/ > - copied from r319714, head/bin/ln/tests/ > Modified: > stable/10/bin/ln/Makefile > stable/10/etc/mtree/BSD.tests.dist > Directory Properties: > stable/10/ (props changed) It looks like the commit message for this one was wrong, though the merge tracking info is correct. The commit message should've read: MFC r319714: Add tests for ln(1) * Verify that when creating a hard link to a symbolic link, '-L' option creates a hard link to the target of the symbolic link * Verify that when creating a hard link to a symbolic link, '-P' option creates a hard link to the symbolic link itself * Verify that if the target file already exists, '-f' option unlinks it so that link may occur * Verify that if the target file or directory is a symbolic link, '-shf' option prevents following the link * Verify that if the target file or directory is a symbolic link, '-snf' option prevents following the link * Verify that '-s' option creates a symbolic link * Verify that '-w' option produces a warning if the source of a symbolic link does not currently exist Submitted by: shivansh Reviewed by: asomers, ngie MFC after: 1 month Sponsored by: Google, Inc (GSoC 2017) Differential Revision: https://reviews.freebsd.org/D11084 From owner-svn-src-stable-10@freebsd.org Mon Jul 31 21:42:20 2017 Return-Path: Delivered-To: svn-src-stable-10@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 020D7DBE75A; Mon, 31 Jul 2017 21:42:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE94169FAC; Mon, 31 Jul 2017 21:42:19 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VLgIuj055692; Mon, 31 Jul 2017 21:42:18 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VLgIX5055691; Mon, 31 Jul 2017 21:42:18 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707312142.v6VLgIX5055691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 31 Jul 2017 21:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321819 - stable/10/bin/ln/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/10/bin/ln/tests X-SVN-Commit-Revision: 321819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 21:42:20 -0000 Author: asomers Date: Mon Jul 31 21:42:18 2017 New Revision: 321819 URL: https://svnweb.freebsd.org/changeset/base/321819 Log: MFC r319854: bin/ln: Set umask appropriately before creating files for testing These changes were missed in D11084 Submitted by: shivansh Reviewed by: asomers X-MFC-With: 319714 Sponsored by: Google, Inc (GSoC 2017) Differential Revision: https://reviews.freebsd.org/D11158 Modified: stable/10/bin/ln/tests/ln_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ln/tests/ln_test.sh ============================================================================== --- stable/10/bin/ln/tests/ln_test.sh Mon Jul 31 21:08:31 2017 (r321818) +++ stable/10/bin/ln/tests/ln_test.sh Mon Jul 31 21:42:18 2017 (r321819) @@ -98,6 +98,7 @@ target_exists_hard_head() target_exists_hard_body() { + set_umask atf_check touch A B atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ ln A B @@ -112,6 +113,7 @@ target_exists_symbolic_head() target_exists_symbolic_body() { + set_umask atf_check touch A B atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ ln -s A B @@ -171,6 +173,7 @@ sf_flag_head() sf_flag_body() { + set_umask atf_check touch A B atf_check ln -sf A B atf_check -o inline:'B: symbolic link to A\n' file B From owner-svn-src-stable-10@freebsd.org Mon Jul 31 21:52:09 2017 Return-Path: Delivered-To: svn-src-stable-10@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 B85E9DBE9C6; Mon, 31 Jul 2017 21:52:09 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 877F36A549; Mon, 31 Jul 2017 21:52:09 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VLq8N5060071; Mon, 31 Jul 2017 21:52:08 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VLq8P3060070; Mon, 31 Jul 2017 21:52:08 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707312152.v6VLq8P3060070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 31 Jul 2017 21:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321820 - stable/10/usr.sbin/makefs/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/10/usr.sbin/makefs/tests X-SVN-Commit-Revision: 321820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 21:52:09 -0000 Author: asomers Date: Mon Jul 31 21:52:08 2017 New Revision: 321820 URL: https://svnweb.freebsd.org/changeset/base/321820 Log: MFC r320163: Fix usr.sbin/makefs/makefs_ffs_tests when /etc/fstab does not exist dumpfs prints a harmless warning message (via ufs_disk_fillout(3) and getfsfile(3)), when /etc/fstab does not exist. We can ignore it. PR: 220165 Reported by: gjb Sponsored by: Spectra Logic Corp Modified: stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh ============================================================================== --- stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh Mon Jul 31 21:42:18 2017 (r321819) +++ stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh Mon Jul 31 21:52:08 2017 (r321820) @@ -182,7 +182,7 @@ o_flag_version_1_body() $MAKEFS -M 1m -o version=$ffs_version $TEST_IMAGE $TEST_INPUTS_DIR mount_image - atf_check -e empty -o match:"$ffs_label" dumpfs $TEST_MOUNT_DIR + atf_check -e ignore -o match:"$ffs_label" dumpfs $TEST_MOUNT_DIR check_ffs_image_contents } o_flag_version_1_cleanup() @@ -214,7 +214,7 @@ o_flag_version_2_body() $MAKEFS -M 1m -o version=$ffs_version $TEST_IMAGE $TEST_INPUTS_DIR mount_image - atf_check -e empty -o match:"$ffs_label" dumpfs $TEST_MOUNT_DIR + atf_check -e ignore -o match:"$ffs_label" dumpfs $TEST_MOUNT_DIR check_ffs_image_contents } o_flag_version_2_cleanup() From owner-svn-src-stable-10@freebsd.org Mon Jul 31 22:19:40 2017 Return-Path: Delivered-To: svn-src-stable-10@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 EE646DBF0A0; Mon, 31 Jul 2017 22:19:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC1D26B685; Mon, 31 Jul 2017 22:19:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VMJdFK069077; Mon, 31 Jul 2017 22:19:39 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VMJdAl069073; Mon, 31 Jul 2017 22:19:39 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201707312219.v6VMJdAl069073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 31 Jul 2017 22:19:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321825 - in stable/10: . gnu/usr.bin/groff/tmac lib/clang sys/conf X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in stable/10: . gnu/usr.bin/groff/tmac lib/clang sys/conf X-SVN-Commit-Revision: 321825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 22:19:41 -0000 Author: marius Date: Mon Jul 31 22:19:39 2017 New Revision: 321825 URL: https://svnweb.freebsd.org/changeset/base/321825 Log: Update stable/10 from 10.3-STABLE to 10.4-PRERELEASE as part of the 10.4 release cycle, also belatedly marking the official start of the code slush. Set the default mdoc(7) version to 10.4, and update the clang(1) TARGET_TRIPLE to reflect 10.4. While at it, add missing FreeBSD major versions to mdoc(7). Approved by: re (implicit) Modified: stable/10/Makefile.inc1 stable/10/gnu/usr.bin/groff/tmac/mdoc.local.in stable/10/lib/clang/clang.build.mk stable/10/sys/conf/newvers.sh Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Mon Jul 31 22:00:27 2017 (r321824) +++ stable/10/Makefile.inc1 Mon Jul 31 22:19:39 2017 (r321825) @@ -359,7 +359,7 @@ TARGET_ABI= gnueabi .else TARGET_ABI= unknown .endif -TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.0 +TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.4 XFLAGS+= -target ${TARGET_TRIPLE} .endif .endif Modified: stable/10/gnu/usr.bin/groff/tmac/mdoc.local.in ============================================================================== --- stable/10/gnu/usr.bin/groff/tmac/mdoc.local.in Mon Jul 31 22:00:27 2017 (r321824) +++ stable/10/gnu/usr.bin/groff/tmac/mdoc.local.in Mon Jul 31 22:19:39 2017 (r321825) @@ -50,7 +50,7 @@ .ds doc-str-Lb-libstdthreads C11 Threads Library (libstdthreads, \-lstdthreads) . .\" Default .Os value -.ds doc-default-operating-system FreeBSD\~10.3 +.ds doc-default-operating-system FreeBSD\~10.4 . .\" FreeBSD releases not found in doc-common .ds doc-operating-system-FreeBSD-7.4 7.4 @@ -63,7 +63,9 @@ .ds doc-operating-system-FreeBSD-10.1 10.1 .ds doc-operating-system-FreeBSD-10.2 10.2 .ds doc-operating-system-FreeBSD-10.3 10.3 +.ds doc-operating-system-FreeBSD-10.4 10.4 .ds doc-operating-system-FreeBSD-11.0 11.0 +.ds doc-operating-system-FreeBSD-11.1 11.1 . .\" Definitions for other *BSDs not (yet) in doc-common .ds doc-operating-system-NetBSD-7.0 7.0 Modified: stable/10/lib/clang/clang.build.mk ============================================================================== --- stable/10/lib/clang/clang.build.mk Mon Jul 31 22:00:27 2017 (r321824) +++ stable/10/lib/clang/clang.build.mk Mon Jul 31 22:19:39 2017 (r321825) @@ -27,8 +27,8 @@ TARGET_ABI= gnueabi TARGET_ABI= unknown .endif -TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.3 -BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd10.3 +TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.4 +BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd10.4 CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \ -DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" \ -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" Modified: stable/10/sys/conf/newvers.sh ============================================================================== --- stable/10/sys/conf/newvers.sh Mon Jul 31 22:00:27 2017 (r321824) +++ stable/10/sys/conf/newvers.sh Mon Jul 31 22:19:39 2017 (r321825) @@ -31,8 +31,8 @@ # $FreeBSD$ TYPE="FreeBSD" -REVISION="10.3" -BRANCH="STABLE" +REVISION="10.4" +BRANCH="PRERELEASE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-stable-10@freebsd.org Mon Jul 31 22:28:34 2017 Return-Path: Delivered-To: svn-src-stable-10@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 C09F4DBF338; Mon, 31 Jul 2017 22:28:34 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CD6D6BE33; Mon, 31 Jul 2017 22:28:34 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VMSXMv073208; Mon, 31 Jul 2017 22:28:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VMSXcx073206; Mon, 31 Jul 2017 22:28:33 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707312228.v6VMSXcx073206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 31 Jul 2017 22:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321827 - in stable/10/sbin/devd: . tests X-SVN-Group: stable-10 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/10/sbin/devd: . tests X-SVN-Commit-Revision: 321827 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 22:28:34 -0000 Author: asomers Date: Mon Jul 31 22:28:33 2017 New Revision: 321827 URL: https://svnweb.freebsd.org/changeset/base/321827 Log: MFC r320165-r320166 r320165: devd(8): Remove pidfile on shutdown Sponsored by: Spectra Logic Corp r320166: Require devd to be running for its ATF tests to run The ATF tests communicate with the system's running devd PR: 220169 Reported by: gjb Sponsored by: Spectra Logic Corp Modified: stable/10/sbin/devd/devd.cc stable/10/sbin/devd/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/devd/devd.cc ============================================================================== --- stable/10/sbin/devd/devd.cc Mon Jul 31 22:26:30 2017 (r321826) +++ stable/10/sbin/devd/devd.cc Mon Jul 31 22:28:33 2017 (r321827) @@ -1070,6 +1070,7 @@ event_loop(void) if (FD_ISSET(seqpacket_fd, &fds)) new_client(seqpacket_fd, SOCK_SEQPACKET); } + cfg.remove_pidfile(); close(seqpacket_fd); close(stream_fd); close(fd); Modified: stable/10/sbin/devd/tests/Makefile ============================================================================== --- stable/10/sbin/devd/tests/Makefile Mon Jul 31 22:26:30 2017 (r321826) +++ stable/10/sbin/devd/tests/Makefile Mon Jul 31 22:28:33 2017 (r321827) @@ -1,7 +1,8 @@ # $FreeBSD$ ATF_TESTS_C= client_test -TEST_METADATA.client_test= required_programs="devd" +TEST_METADATA.client_test= required_files="/var/run/devd.pid" +TEST_METADATA.client_test+= required_programs="devd" TEST_METADATA.client_test+= required_user="root" TEST_METADATA.client_test+= timeout=15 From owner-svn-src-stable-10@freebsd.org Mon Jul 31 22:36:04 2017 Return-Path: Delivered-To: svn-src-stable-10@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 CFE67DBF585; Mon, 31 Jul 2017 22:36:04 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABB786C333; Mon, 31 Jul 2017 22:36:04 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VMa38g077123; Mon, 31 Jul 2017 22:36:03 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VMa31R077121; Mon, 31 Jul 2017 22:36:03 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707312236.v6VMa31R077121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 31 Jul 2017 22:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321829 - in stable/10: lib/libc/sys share/man/man4 X-SVN-Group: stable-10 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/10: lib/libc/sys share/man/man4 X-SVN-Commit-Revision: 321829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 22:36:04 -0000 Author: asomers Date: Mon Jul 31 22:36:03 2017 New Revision: 321829 URL: https://svnweb.freebsd.org/changeset/base/321829 Log: Clarify usage of aio(4) with kqueue(2) Reviewed by: jhb MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D11299 Modified: stable/10/lib/libc/sys/kqueue.2 stable/10/share/man/man4/aio.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/kqueue.2 ============================================================================== --- stable/10/lib/libc/sys/kqueue.2 Mon Jul 31 22:32:11 2017 (r321828) +++ stable/10/lib/libc/sys/kqueue.2 Mon Jul 31 22:36:03 2017 (r321829) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2016 +.Dd June 22, 2017 .Dt KQUEUE 2 .Os .Sh NAME @@ -327,33 +327,18 @@ identical to the .Dv EVFILT_READ case. .It Dv EVFILT_AIO -The sigevent portion of the AIO request is filled in, with -.Va sigev_notify_kqueue -containing the descriptor of the kqueue that the event should -be attached to, -.Va sigev_notify_kevent_flags -containing the kevent flags which should be -.Dv EV_ONESHOT , -.Dv EV_CLEAR -or -.Dv EV_DISPATCH , -.Va sigev_value -containing the udata value, and -.Va sigev_notify -set to -.Dv SIGEV_KEVENT . -When the -.Fn aio_* -system call is made, the event will be registered -with the specified kqueue, and the -.Va ident -argument set to the -.Fa struct aiocb -returned by the -.Fn aio_* -system call. +Events for this filter are not registered with +.Fn kevent +directly but are registered via the +.Va aio_sigevent +member of an asychronous I/O request when it is scheduled via an asychronous I/O +system call such as +.Fn aio_read . The filter returns under the same conditions as .Fn aio_error . +For more details on this filter see +.Xr sigevent 3 and +.Xr aio 4 . .It Dv EVFILT_VNODE Takes a file descriptor as the identifier and the events to watch for in .Va fflags , Modified: stable/10/share/man/man4/aio.4 ============================================================================== --- stable/10/share/man/man4/aio.4 Mon Jul 31 22:32:11 2017 (r321828) +++ stable/10/share/man/man4/aio.4 Mon Jul 31 22:36:03 2017 (r321829) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2016 +.Dd June 22, 2017 .Dt AIO 4 .Os .Sh NAME @@ -59,11 +59,27 @@ field which can be used to request notification when a For .Dv SIGEV_KEVENT notifications, -the posted kevent will contain: +the +.Va sigevent +.Ap +s +.Va sigev_notify_kqueue +field should contain the descriptor of the kqueue that the event should be attached +to, its +.Va sigev_notify_kevent_flags +field may contain +.Dv EV_ONESHOT , +.Dv EV_CLEAR , and/or +.Dv EV_DISPATCH , and its +.Va sigev_notify +field should be set to +.Dv SIGEV_KEVENT . +The posted kevent will contain: .Bl -column ".Va filter" .It Sy Member Ta Sy Value .It Va ident Ta asynchronous I/O control buffer pointer .It Va filter Ta Dv EVFILT_AIO +.It Va flags Ta Dv EV_EOF .It Va udata Ta value stored in .Va aio_sigevent.sigev_value From owner-svn-src-stable-10@freebsd.org Mon Jul 31 22:57:30 2017 Return-Path: Delivered-To: svn-src-stable-10@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 1A7BEDBFB01 for ; Mon, 31 Jul 2017 22:57:30 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) (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 A2E246CB3A for ; Mon, 31 Jul 2017 22:57:29 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-wr0-x244.google.com with SMTP id o33so15420wrb.1 for ; Mon, 31 Jul 2017 15:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:cc; bh=JqI8217HcOKvtz25HaA5IzgFx3oNoSVKLWSFm/0zx2s=; b=glZgSi90WY1W27sSbgE6MSt6eRhQZLxQT5FD5eCV1hNV8uLy+cJYfxpa0xiaEE3Llj 4XmU0MuzBqZpvpKQ2WJMINex1AVVSCtFDRk0MWHfT7mUJp30Riw+eJZ1WrIz2o52lRHx 8muUNPbeLU79iX+xFlkSksi+VEbUI4sk779xi1qdyXcE9keqq7Fq6LkrxLQPJoUkLAVB OTRb9nFNYU+gwOfWmZnGJfphyI1sYNudmJ4VpWL34YJop9HigfJWkYWdbnxdICrOjdfh ER6MF/E/zeFhsWhMMJxn/ZdKSoOlrJwitohc9gyfXHYarp8p9I4wWklEjl8aHXlUT50Y 45QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:cc; bh=JqI8217HcOKvtz25HaA5IzgFx3oNoSVKLWSFm/0zx2s=; b=IvBADCJ1iTnfxTWv2f8u2IeZ3OqjHzChQb7IfiHnVsmTEaPexxYivpbrs6Ae+Gtvsq 4CJntlfto7Jpx8/nD7hoyfnktA03Ixogob5aSvPX7f37YMT2kdQlxP/Gb4Q/TwtLTR+o /pCEIxqL9Sm1zUTR7ebTNAmPoqxjP+WPImLagBymCcig5/uxDehTLWJwjYkR7HJjhKbg vR6wESx6VE8trS4LIJDBYNnqExSlmWcx5ZpblmNx0j5d/w4cbX6jhurHVHW2x/ky6na3 JRq7L6/rzhDECCVpKG38WAFedoFkHqo/Simj0Uom2EFiLMJE2vpWevHrMX3cZpuoVwPd sVsQ== X-Gm-Message-State: AIVw112grQ5wHKIo2ldTh+MHotvDzg663Q5E3m5aB1qbAQDBBhczhNn6 /I4T6spuHcDT2FhrvmJHck3mLZVI9g== X-Received: by 10.223.174.209 with SMTP id y75mt13604456wrc.19.1501541848288; Mon, 31 Jul 2017 15:57:28 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.28.208.3 with HTTP; Mon, 31 Jul 2017 15:57:27 -0700 (PDT) In-Reply-To: <201707312236.v6VMa31R077121@repo.freebsd.org> References: <201707312236.v6VMa31R077121@repo.freebsd.org> From: Alan Somers Date: Mon, 31 Jul 2017 16:57:27 -0600 X-Google-Sender-Auth: XxGll0vCoNqDwzGDrJCSrBc6RRM Message-ID: Subject: Re: svn commit: r321829 - in stable/10: lib/libc/sys share/man/man4 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 22:57:30 -0000 On Mon, Jul 31, 2017 at 4:36 PM, Alan Somers wrote: > Author: asomers > Date: Mon Jul 31 22:36:03 2017 > New Revision: 321829 > URL: https://svnweb.freebsd.org/changeset/base/321829 > > Log: > Clarify usage of aio(4) with kqueue(2) > > Reviewed by: jhb > MFC after: 3 weeks > Differential Revision: https://reviews.freebsd.org/D11299 > > Modified: > stable/10/lib/libc/sys/kqueue.2 > stable/10/share/man/man4/aio.4 > Directory Properties: > stable/10/ (props changed) Oops, I truncated the commit message. The full commit message should've been: MFC r320255: Clarify usage of aio(4) with kqueue(2) Reviewed by: jhb MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D11299 From owner-svn-src-stable-10@freebsd.org Mon Jul 31 23:03:11 2017 Return-Path: Delivered-To: svn-src-stable-10@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 80B34DBFCD3; Mon, 31 Jul 2017 23:03:11 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44C3F6CF13; Mon, 31 Jul 2017 23:03:11 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VN3AeZ089196; Mon, 31 Jul 2017 23:03:10 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VN3AMi089195; Mon, 31 Jul 2017 23:03:10 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707312303.v6VN3AMi089195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 31 Jul 2017 23:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321830 - stable/10/bin/echo/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/10/bin/echo/tests X-SVN-Commit-Revision: 321830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 23:03:11 -0000 Author: asomers Date: Mon Jul 31 23:03:10 2017 New Revision: 321830 URL: https://svnweb.freebsd.org/changeset/base/321830 Log: MFC r320269: style fixes in bin/echo/tests Submitted by: shivansh Reviewed by: asomers X-MFC-With: 319626 Sponsored by: Google, Inc (GSoC 2017) Differential Revision: https://reviews.freebsd.org/D11318 Modified: stable/10/bin/echo/tests/echo_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/echo/tests/echo_test.sh ============================================================================== --- stable/10/bin/echo/tests/echo_test.sh Mon Jul 31 22:36:03 2017 (r321829) +++ stable/10/bin/echo/tests/echo_test.sh Mon Jul 31 23:03:10 2017 (r321830) @@ -27,29 +27,33 @@ # atf_test_case n_output -n_output_head() { - atf_set "descr" "Verify that echo(1) does not print the trailing " \ - "newline character with option '-n'" +n_output_head() +{ + atf_set "descr" "Verify that echo(1) does not print the trailing " \ + "newline character with option '-n'" } -n_output_body() { - atf_check -s ignore -o inline:"Hello world" \ - /bin/echo -n "Hello world" +n_output_body() +{ + atf_check -s ignore -o inline:"Hello world" \ + /bin/echo -n "Hello world" } atf_test_case append_c_output -append_c_output_head() { - atf_set "descr" "Verify that echo(1) does not print the trailing newline " \ - "character when '\c' is appended to the end of the string" +append_c_output_head() +{ + atf_set "descr" "Verify that echo(1) does not print the trailing newline " \ + "character when '\c' is appended to the end of the string" } -append_c_output_body() { - atf_check -s ignore -o inline:"Hello world" \ - /bin/echo "Hello world\c" +append_c_output_body() +{ + atf_check -s ignore -o inline:"Hello world" \ + /bin/echo "Hello world\c" } atf_init_test_cases() { - atf_add_test_case n_output - atf_add_test_case append_c_output + atf_add_test_case n_output + atf_add_test_case append_c_output } From owner-svn-src-stable-10@freebsd.org Tue Aug 1 01:25:19 2017 Return-Path: Delivered-To: svn-src-stable-10@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 3BAF9DC306D; Tue, 1 Aug 2017 01:25:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0811F71054; Tue, 1 Aug 2017 01:25:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v711PIgU046796; Tue, 1 Aug 2017 01:25:18 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v711PIUP046795; Tue, 1 Aug 2017 01:25:18 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201708010125.v711PIUP046795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 1 Aug 2017 01:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321833 - stable/10/lib/libthr/thread X-SVN-Group: stable-10 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/10/lib/libthr/thread X-SVN-Commit-Revision: 321833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2017 01:25:19 -0000 Author: pfg Date: Tue Aug 1 01:25:18 2017 New Revision: 321833 URL: https://svnweb.freebsd.org/changeset/base/321833 Log: MFC r320990, r321011: libthr: Avoid checking for negative values in usigned count. Check for overflow instead. Modified: stable/10/lib/libthr/thread/thr_barrier.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/thread/thr_barrier.c ============================================================================== --- stable/10/lib/libthr/thread/thr_barrier.c Tue Aug 1 01:23:55 2017 (r321832) +++ stable/10/lib/libthr/thread/thr_barrier.c Tue Aug 1 01:25:18 2017 (r321833) @@ -83,7 +83,7 @@ _pthread_barrier_init(pthread_barrier_t *barrier, (void)attr; - if (barrier == NULL || count <= 0) + if (barrier == NULL || count == 0 || count > INT_MAX) return (EINVAL); bar = calloc(1, sizeof(struct pthread_barrier)); From owner-svn-src-stable-10@freebsd.org Tue Aug 1 12:40:59 2017 Return-Path: Delivered-To: svn-src-stable-10@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 0E7AEDAB3C5; Tue, 1 Aug 2017 12:40:59 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF73975639; Tue, 1 Aug 2017 12:40:58 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1dcWTi-000Jmy-74; Tue, 01 Aug 2017 15:40:50 +0300 Date: Tue, 1 Aug 2017 15:40:50 +0300 From: Slawa Olhovchenkov To: Marius Strobl Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r321825 - in stable/10: . gnu/usr.bin/groff/tmac lib/clang sys/conf Message-ID: <20170801124050.GG18123@zxy.spb.ru> References: <201707312219.v6VMJdAl069073@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201707312219.v6VMJdAl069073@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2017 12:40:59 -0000 On Mon, Jul 31, 2017 at 10:19:39PM +0000, Marius Strobl wrote: > Author: marius > Date: Mon Jul 31 22:19:39 2017 > New Revision: 321825 > URL: https://svnweb.freebsd.org/changeset/base/321825 > > Log: > Update stable/10 from 10.3-STABLE to 10.4-PRERELEASE as part of > the 10.4 release cycle, also belatedly marking the official start > of the code slush. > > Set the default mdoc(7) version to 10.4, and update the clang(1) > TARGET_TRIPLE to reflect 10.4. While at it, add missing FreeBSD > major versions to mdoc(7). > > Approved by: re (implicit) ix netmap code is broken for me in 10-STABLE. Could ypou please test and/or confirm and ask responsible ones to fix this problem before release? https://lists.freebsd.org/pipermail/svn-src-all/2017-June/147797.html From owner-svn-src-stable-10@freebsd.org Tue Aug 1 13:15:31 2017 Return-Path: Delivered-To: svn-src-stable-10@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 A0482DAD3CD; Tue, 1 Aug 2017 13:15:31 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EBE277315; Tue, 1 Aug 2017 13:15:31 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71DFUac039448; Tue, 1 Aug 2017 13:15:30 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71DFUQf039447; Tue, 1 Aug 2017 13:15:30 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201708011315.v71DFUQf039447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Tue, 1 Aug 2017 13:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321873 - stable/10/sys/netpfil/ipfw X-SVN-Group: stable-10 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/10/sys/netpfil/ipfw X-SVN-Commit-Revision: 321873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2017 13:15:31 -0000 Author: philip Date: Tue Aug 1 13:15:30 2017 New Revision: 321873 URL: https://svnweb.freebsd.org/changeset/base/321873 Log: MFC r320941: Fix GRE over IPv6 tunnels with IPFW Previously, GRE packets in IPv6 tunnels would be dropped by IPFW (unless net.inet6.ip6.fw.deny_unknown_exthdrs was unset). PR: 220640 Submitted by: Kun Xie Modified: stable/10/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw2.c Tue Aug 1 13:07:54 2017 (r321872) +++ stable/10/sys/netpfil/ipfw/ip_fw2.c Tue Aug 1 13:15:30 2017 (r321873) @@ -87,6 +87,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#include /* for struct grehdr */ + #include #include /* XXX for in_cksum */ @@ -1141,6 +1143,11 @@ do { \ case IPPROTO_PIM: /* XXX PIM header check? */ PULLUP_TO(hlen, ulp, struct pim); + break; + + case IPPROTO_GRE: /* RFC 1701 */ + /* XXX GRE header check? */ + PULLUP_TO(hlen, ulp, struct grehdr); break; case IPPROTO_CARP: From owner-svn-src-stable-10@freebsd.org Tue Aug 1 15:51:18 2017 Return-Path: Delivered-To: svn-src-stable-10@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 2387FDB138D; Tue, 1 Aug 2017 15:51:18 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE40F80510; Tue, 1 Aug 2017 15:51:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71FpHon003520; Tue, 1 Aug 2017 15:51:17 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71FpH83003519; Tue, 1 Aug 2017 15:51:17 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201708011551.v71FpH83003519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 1 Aug 2017 15:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321877 - stable/10/sys/fs/nfs X-SVN-Group: stable-10 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/10/sys/fs/nfs X-SVN-Commit-Revision: 321877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2017 15:51:18 -0000 Author: trasz Date: Tue Aug 1 15:51:16 2017 New Revision: 321877 URL: https://svnweb.freebsd.org/changeset/base/321877 Log: MFC r320359: Add vfs.nfsd.nfsd_enable_uidtostring, which works just like vfs.nfsd.nfsd_enable_stringtouid, but in reverse - when set to 1, it forces the NFSv4 server to return numeric UIDs and GIDs instead of "user@domain" strings. This helps with clients that can't translate returned identifiers, eg when rerooting. The same can be achieved by just never running nfsuserd(8), but the sysctl is useful to toggle the behaviour back and forth without rebooting. MFC r320409: Revert part of r320359, as suggested by rmacklem@. That case is only used for nfsuserd -manage-gids and shouldn't depend on sysctl. MFC r321196: Rename vfs.nfsd.enable_uidtostring to vfs.nfs.enable_uidtostring. It applies to both NFS client and NFS server, and is useful for both. This is different from vfs.nfsd.enable_stringtouid, which is specific to server side. Sponsored by: DARPA, AFRL Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Tue Aug 1 14:54:25 2017 (r321876) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Tue Aug 1 15:51:16 2017 (r321877) @@ -68,10 +68,15 @@ gid_t nfsrv_defaultgid = GID_NOGROUP; int nfsrv_lease = NFSRV_LEASE; int ncl_mbuf_mlen = MLEN; int nfsd_enable_stringtouid = 0; +static int nfs_enable_uidtostring = 0; NFSNAMEIDMUTEX; NFSSOCKMUTEX; extern int nfsrv_lughashsize; +SYSCTL_DECL(_vfs_nfs); +SYSCTL_INT(_vfs_nfs, OID_AUTO, enable_uidtostring, CTLFLAG_RW, + &nfs_enable_uidtostring, 0, "Make nfs always send numeric owner_names"); + /* * This array of structures indicates, for V4: * retfh - which of 3 types of calling args are used @@ -2576,7 +2581,7 @@ nfsv4_uidtostr(uid_t uid, u_char **cpp, int *retlenp, cnt = 0; tryagain: - if (nfsrv_dnsnamelen > 0) { + if (nfsrv_dnsnamelen > 0 && !nfs_enable_uidtostring) { /* * Always map nfsrv_defaultuid to "nobody". */ @@ -2838,7 +2843,7 @@ nfsv4_gidtostr(gid_t gid, u_char **cpp, int *retlenp, cnt = 0; tryagain: - if (nfsrv_dnsnamelen > 0) { + if (nfsrv_dnsnamelen > 0 && !nfs_enable_uidtostring) { /* * Always map nfsrv_defaultgid to "nogroup". */ From owner-svn-src-stable-10@freebsd.org Tue Aug 1 16:00:22 2017 Return-Path: Delivered-To: svn-src-stable-10@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 CB8F5DB1969; Tue, 1 Aug 2017 16:00:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A893480E40; Tue, 1 Aug 2017 16:00:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71G0Lek005319; Tue, 1 Aug 2017 16:00:21 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71G0L92005317; Tue, 1 Aug 2017 16:00:21 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201708011600.v71G0L92005317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 1 Aug 2017 16:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321878 - in stable/10: contrib/netbsd-tests/lib/libc/gen lib/libc/tests/gen X-SVN-Group: stable-10 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/10: contrib/netbsd-tests/lib/libc/gen lib/libc/tests/gen X-SVN-Commit-Revision: 321878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2017 16:00:22 -0000 Author: asomers Date: Tue Aug 1 16:00:21 2017 New Revision: 321878 URL: https://svnweb.freebsd.org/changeset/base/321878 Log: MFC r320737, r320914 r320737: Fix cleanup in lib/libc/gen/setdomainname_test ATF cleanup routines run in separate processes from the tests themselves, so they can't share global variables. Also, setdomainname_test needs to be is_exclusive because the test cases access a global resource. PR: 219967 Reviewed by: ngie Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11188 r320914: Remove an extraneous strlen from t_setdomainname.c Reported by: Coverity CID: 1377568 X-MFC-With: 320737 Sponsored by: Spectra Logic Corp Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c stable/10/lib/libc/tests/gen/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Tue Aug 1 15:51:16 2017 (r321877) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Tue Aug 1 16:00:21 2017 (r321878) @@ -34,11 +34,13 @@ __RCSID("$NetBSD: t_setdomainname.c,v 1.2 2012/03/25 0 #include #include +#include #include +#include #include #include -static char domain[MAXHOSTNAMELEN]; +#define DOMAIN_BACKUP_FILE "domain.bak" static const char domains[][MAXHOSTNAMELEN] = { "1234567890", @@ -47,6 +49,45 @@ static const char domains[][MAXHOSTNAMELEN] = { "--------------------------------------------------------------------" }; +static void +backup_domain(void) +{ + char domain[MAXHOSTNAMELEN]; + int fd; + size_t l; + ssize_t r,n = 0; + + memset(domain, 0, sizeof(domain)); + + ATF_REQUIRE_EQ(0, getdomainname(domain, sizeof(domain))); + l = strnlen(domain, MAXHOSTNAMELEN); + fd = open(DOMAIN_BACKUP_FILE, O_WRONLY | O_CREAT | O_EXCL, 0644); + ATF_REQUIRE(fd >= 0); + while ((r = write(fd, domain + n, l - n)) > 0) + n += r; + ATF_REQUIRE_EQ(0, r); + close(fd); +} + +static void +restore_domain(void) +{ + char domain[MAXHOSTNAMELEN]; + int fd; + ssize_t r, n = 0; + + memset(domain, 0, sizeof(domain)); + if ((fd = open(DOMAIN_BACKUP_FILE, O_RDONLY)) < 0) + err(1, "open"); + while ((r = read(fd, domain + n, sizeof(domain) - n)) > 0) + n += r; + if (r < 0) + err(1, "read"); + if (setdomainname(domain, n) != 0) + err(1, "setdomainname"); + close(fd); +} + ATF_TC_WITH_CLEANUP(setdomainname_basic); ATF_TC_HEAD(setdomainname_basic, tc) { @@ -59,6 +100,7 @@ ATF_TC_BODY(setdomainname_basic, tc) char name[MAXHOSTNAMELEN]; size_t i; + backup_domain(); for (i = 0; i < __arraycount(domains); i++) { (void)memset(name, 0, sizeof(name)); @@ -80,12 +122,11 @@ ATF_TC_BODY(setdomainname_basic, tc) ATF_REQUIRE(strcmp(domains[i], name) == 0); } - (void)setdomainname(domain, sizeof(domain)); } ATF_TC_CLEANUP(setdomainname_basic, tc) { - (void)setdomainname(domain, sizeof(domain)); + restore_domain(); } ATF_TC_WITH_CLEANUP(setdomainname_limit); @@ -100,6 +141,7 @@ ATF_TC_BODY(setdomainname_limit, tc) char name[MAXHOSTNAMELEN + 1]; (void)memset(name, 0, sizeof(name)); + backup_domain(); #ifdef __FreeBSD__ ATF_REQUIRE(setdomainname(name, MAXHOSTNAMELEN - 1 ) == 0); @@ -110,10 +152,10 @@ ATF_TC_BODY(setdomainname_limit, tc) ATF_TC_CLEANUP(setdomainname_limit, tc) { - (void)setdomainname(domain, sizeof(domain)); + restore_domain(); } -ATF_TC_WITH_CLEANUP(setdomainname_perm); +ATF_TC(setdomainname_perm); ATF_TC_HEAD(setdomainname_perm, tc) { atf_tc_set_md_var(tc, "descr", "Can normal user set the domain name?"); @@ -122,24 +164,16 @@ ATF_TC_HEAD(setdomainname_perm, tc) ATF_TC_BODY(setdomainname_perm, tc) { + char domain[MAXHOSTNAMELEN]; - errno = 0; + memset(domain, 0, sizeof(domain)); + errno = 0; ATF_REQUIRE_ERRNO(EPERM, setdomainname(domain, sizeof(domain)) == -1); } -ATF_TC_CLEANUP(setdomainname_perm, tc) -{ - (void)setdomainname(domain, sizeof(domain)); -} - ATF_TP_ADD_TCS(tp) { - - (void)memset(domain, 0, sizeof(domain)); - - ATF_REQUIRE(getdomainname(domain, sizeof(domain)) == 0); - ATF_TP_ADD_TC(tp, setdomainname_basic); ATF_TP_ADD_TC(tp, setdomainname_limit); ATF_TP_ADD_TC(tp, setdomainname_perm); Modified: stable/10/lib/libc/tests/gen/Makefile ============================================================================== --- stable/10/lib/libc/tests/gen/Makefile Tue Aug 1 15:51:16 2017 (r321877) +++ stable/10/lib/libc/tests/gen/Makefile Tue Aug 1 16:00:21 2017 (r321878) @@ -76,6 +76,7 @@ CFLAGS+= -I${.CURDIR} SRCS.fmtcheck2_test= fmtcheck_test.c SRCS.fnmatch2_test= fnmatch_test.c +TEST_METADATA.setdomainname_test+= is_exclusive=true TESTS_SUBDIRS= execve TESTS_SUBDIRS+= posix_spawn From owner-svn-src-stable-10@freebsd.org Tue Aug 1 16:48:35 2017 Return-Path: Delivered-To: svn-src-stable-10@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 22FF8DB3204; Tue, 1 Aug 2017 16:48:35 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E46EF8308B; Tue, 1 Aug 2017 16:48:34 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71GmXhJ026544; Tue, 1 Aug 2017 16:48:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71GmXmd026543; Tue, 1 Aug 2017 16:48:33 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201708011648.v71GmXmd026543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 1 Aug 2017 16:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321883 - stable/10/usr.bin/stdbuf X-SVN-Group: stable-10 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/10/usr.bin/stdbuf X-SVN-Commit-Revision: 321883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2017 16:48:35 -0000 Author: asomers Date: Tue Aug 1 16:48:33 2017 New Revision: 321883 URL: https://svnweb.freebsd.org/changeset/base/321883 Log: MFC r320807: stdbuf(1): Add buffer definition "B" to the usage message This option has been missing from the usage message ever since the program was first imported. Submitted by: shivansh Reviewed by: asomers Sponsored by: Google, Inc (GSoC 2017) Differential Revision: https://reviews.freebsd.org/D11529 Modified: stable/10/usr.bin/stdbuf/stdbuf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/stdbuf/stdbuf.c ============================================================================== --- stable/10/usr.bin/stdbuf/stdbuf.c Tue Aug 1 16:41:17 2017 (r321882) +++ stable/10/usr.bin/stdbuf/stdbuf.c Tue Aug 1 16:48:33 2017 (r321883) @@ -40,7 +40,7 @@ static void usage(int s) { - fprintf(stderr, "Usage: %s [-e 0|L|] [-i 0|L|] [-o 0|L|] " + fprintf(stderr, "Usage: %s [-e 0|L|B|] [-i 0|L|B|] [-o 0|L|B|] " " [args ...]\n", __progname); exit(s); } From owner-svn-src-stable-10@freebsd.org Tue Aug 1 21:41:15 2017 Return-Path: Delivered-To: svn-src-stable-10@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 8C4AADBDE72; Tue, 1 Aug 2017 21:41:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66AAB6A2FE; Tue, 1 Aug 2017 21:41:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71LfEhD054014; Tue, 1 Aug 2017 21:41:14 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71LfExB054013; Tue, 1 Aug 2017 21:41:14 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708012141.v71LfExB054013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 1 Aug 2017 21:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321895 - stable/10/usr.sbin/tzsetup X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/10/usr.sbin/tzsetup X-SVN-Commit-Revision: 321895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2017 21:41:15 -0000 Author: marius Date: Tue Aug 1 21:41:14 2017 New Revision: 321895 URL: https://svnweb.freebsd.org/changeset/base/321895 Log: MFC: r281733, r298033, r301131 - Remove set but unused variable. - Use NULL instead of 0 for pointers. - Fix tzsetup not installing /etc/localtime for UTC. Modified: stable/10/usr.sbin/tzsetup/tzsetup.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/10/usr.sbin/tzsetup/tzsetup.c Tue Aug 1 20:28:11 2017 (r321894) +++ stable/10/usr.sbin/tzsetup/tzsetup.c Tue Aug 1 21:41:14 2017 (r321895) @@ -198,6 +198,7 @@ static char *chrootenv = NULL; static void usage(void); static int confirm_zone(const char *filename); static int continent_country_menu(dialogMenuItem *); +static int install_zoneinfo(const char *zoneinfo); static int install_zoneinfo_file(const char *zoneinfo_file); static int set_zone_multi(dialogMenuItem *); static int set_zone_whole_country(dialogMenuItem *); @@ -343,7 +344,7 @@ read_iso3166_table(void) err(1, "%s", path_iso3166); lineno = 0; - while ((s = fgetln(fp, &len)) != 0) { + while ((s = fgetln(fp, &len)) != NULL) { lineno++; if (s[len - 1] != '\n') errx(1, "%s:%d: invalid format", path_iso3166, lineno); @@ -353,7 +354,7 @@ read_iso3166_table(void) /* Isolate the two-letter code. */ t = strsep(&s, "\t"); - if (t == 0 || strlen(t) != 2) + if (t == NULL || strlen(t) != 2) errx(1, "%s:%d: invalid format", path_iso3166, lineno); if (t[0] < 'A' || t[0] > 'Z' || t[1] < 'A' || t[1] > 'Z') errx(1, "%s:%d: invalid code `%s'", path_iso3166, @@ -361,10 +362,10 @@ read_iso3166_table(void) /* Now skip past the three-letter and numeric codes. */ name = strsep(&s, "\t"); /* 3-let */ - if (name == 0 || strlen(name) != 3) + if (name == NULL || strlen(name) != 3) errx(1, "%s:%d: invalid format", path_iso3166, lineno); name = strsep(&s, "\t"); /* numeric */ - if (name == 0 || strlen(name) != 3) + if (name == NULL || strlen(name) != 3) errx(1, "%s:%d: invalid format", path_iso3166, lineno); name = s; @@ -406,7 +407,7 @@ add_zone_to_country(int lineno, const char *tlc, const path_zonetab, lineno); zp = malloc(sizeof(*zp)); - if (zp == 0) + if (zp == NULL) errx(1, "malloc(%zu)", sizeof(*zp)); if (cp->nzones == 0) @@ -474,7 +475,7 @@ read_zones(void) FILE *fp; struct continent *cont; size_t len; - char *line, *tlc, *coord, *file, *descr, *p; + char *line, *tlc, *file, *descr, *p; int lineno; fp = fopen(path_zonetab, "r"); @@ -482,7 +483,7 @@ read_zones(void) err(1, "%s", path_zonetab); lineno = 0; - while ((line = fgetln(fp, &len)) != 0) { + while ((line = fgetln(fp, &len)) != NULL) { lineno++; if (line[len - 1] != '\n') errx(1, "%s:%d: invalid format", path_zonetab, lineno); @@ -494,10 +495,10 @@ read_zones(void) if (strlen(tlc) != 2) errx(1, "%s:%d: invalid country code `%s'", path_zonetab, lineno, tlc); - coord = strsep(&line, "\t"); /* Unused */ + /* coord = */ strsep(&line, "\t"); /* Unused */ file = strsep(&line, "\t"); p = strchr(file, '/'); - if (p == 0) + if (p == NULL) errx(1, "%s:%d: invalid zone name `%s'", path_zonetab, lineno, file); contbuf[0] = '\0'; @@ -557,7 +558,7 @@ make_menus(void) continent_names[i].continent->menu = malloc(sizeof(dialogMenuItem) * continent_names[i].continent->nitems); - if (continent_names[i].continent->menu == 0) + if (continent_names[i].continent->menu == NULL) errx(1, "malloc for continent menu"); continent_names[i].continent->nitems = 0; continents[i].prompt = continent_items[i].prompt; @@ -632,13 +633,13 @@ set_zone_menu(dialogMenuItem *dmi) return (DITEM_LEAVE_MENU); } -int +static int set_zone_utc(void) { if (!confirm_zone(NULL)) return (DITEM_FAILURE | DITEM_RECREATE); - return (install_zoneinfo_file(NULL)); + return (install_zoneinfo("UTC")); } static int From owner-svn-src-stable-10@freebsd.org Wed Aug 2 05:17:48 2017 Return-Path: Delivered-To: svn-src-stable-10@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 D1606DC63CF; Wed, 2 Aug 2017 05:17:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 987BB76006; Wed, 2 Aug 2017 05:17:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v725HlG2037879; Wed, 2 Aug 2017 05:17:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v725HlLc037878; Wed, 2 Aug 2017 05:17:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201708020517.v725HlLc037878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 2 Aug 2017 05:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321905 - stable/10/sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/sys/sys X-SVN-Commit-Revision: 321905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Aug 2017 05:17:48 -0000 Author: delphij Date: Wed Aug 2 05:17:47 2017 New Revision: 321905 URL: https://svnweb.freebsd.org/changeset/base/321905 Log: MFC r321713: Bump copyright year. Modified: stable/10/sys/sys/copyright.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/copyright.h ============================================================================== --- stable/10/sys/sys/copyright.h Wed Aug 2 05:17:01 2017 (r321904) +++ stable/10/sys/sys/copyright.h Wed Aug 2 05:17:47 2017 (r321905) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 1992-2016 The FreeBSD Project. All rights reserved. + * Copyright (C) 1992-2017 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-stable-10@freebsd.org Wed Aug 2 05:47:27 2017 Return-Path: Delivered-To: svn-src-stable-10@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 643D7DC6B69; Wed, 2 Aug 2017 05:47:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 261B576B9F; Wed, 2 Aug 2017 05:47:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v725lQQS050061; Wed, 2 Aug 2017 05:47:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v725lQ8G050060; Wed, 2 Aug 2017 05:47:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201708020547.v725lQ8G050060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 2 Aug 2017 05:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321907 - stable/10/sbin/init X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/sbin/init X-SVN-Commit-Revision: 321907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Aug 2017 05:47:27 -0000 Author: delphij Date: Wed Aug 2 05:47:26 2017 New Revision: 321907 URL: https://svnweb.freebsd.org/changeset/base/321907 Log: MFC r320761: - Use strlcat() instead of strncat(). - Use asprintf() and handle allocation errors. Modified: stable/10/sbin/init/init.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/init/init.c ============================================================================== --- stable/10/sbin/init/init.c Wed Aug 2 05:30:41 2017 (r321906) +++ stable/10/sbin/init/init.c Wed Aug 2 05:47:26 2017 (r321907) @@ -1278,8 +1278,8 @@ new_session(session_t *sprev, int session_index, struc sp->se_index = session_index; sp->se_flags |= SE_PRESENT; - sp->se_device = malloc(sizeof(_PATH_DEV) + strlen(typ->ty_name)); - sprintf(sp->se_device, "%s%s", _PATH_DEV, typ->ty_name); + if (asprintf(&sp->se_device, "%s%s", _PATH_DEV, typ->ty_name) < 0) + err(1, "asprintf"); /* * Attempt to open the device, if we get "device not configured" @@ -1322,8 +1322,8 @@ setupargv(session_t *sp, struct ttyent *typ) free(sp->se_getty_argv_space); free(sp->se_getty_argv); } - sp->se_getty = malloc(strlen(typ->ty_getty) + strlen(typ->ty_name) + 2); - sprintf(sp->se_getty, "%s %s", typ->ty_getty, typ->ty_name); + if (asprintf(&sp->se_getty, "%s %s", typ->ty_getty, typ->ty_name) < 0) + err(1, "asprintf"); sp->se_getty_argv_space = strdup(sp->se_getty); sp->se_getty_argv = construct_argv(sp->se_getty_argv_space); if (sp->se_getty_argv == 0) { @@ -1437,7 +1437,7 @@ start_window_system(session_t *sp) if (sp->se_type) { /* Don't use malloc after fork */ strcpy(term, "TERM="); - strncat(term, sp->se_type, sizeof(term) - 6); + strlcat(term, sp->se_type, sizeof(term)); env[0] = term; env[1] = 0; } @@ -1501,7 +1501,7 @@ start_getty(session_t *sp) if (sp->se_type) { /* Don't use malloc after fork */ strcpy(term, "TERM="); - strncat(term, sp->se_type, sizeof(term) - 6); + strlcat(term, sp->se_type, sizeof(term)); env[0] = term; env[1] = 0; } else From owner-svn-src-stable-10@freebsd.org Wed Aug 2 15:13:14 2017 Return-Path: Delivered-To: svn-src-stable-10@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 CDF27DD2E7C; Wed, 2 Aug 2017 15:13:14 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65EDA68931; Wed, 2 Aug 2017 15:13:14 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72FDDkp083977; Wed, 2 Aug 2017 15:13:13 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72FDDPa083976; Wed, 2 Aug 2017 15:13:13 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201708021513.v72FDDPa083976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 2 Aug 2017 15:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321932 - stable/10/sys/dev/ichsmb X-SVN-Group: stable-10 X-SVN-Commit-Author: gavin X-SVN-Commit-Paths: stable/10/sys/dev/ichsmb X-SVN-Commit-Revision: 321932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Aug 2017 15:13:14 -0000 Author: gavin Date: Wed Aug 2 15:13:13 2017 New Revision: 321932 URL: https://svnweb.freebsd.org/changeset/base/321932 Log: Merge r316113,316184,316413 from head: - Remove #define PCIS_SERIALBUS_SMBUS_PROGIF, unused since r200091 - Switch device_probe() from large case statement to a lookup table - Add several missing SMBus controllers Modified: stable/10/sys/dev/ichsmb/ichsmb_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/10/sys/dev/ichsmb/ichsmb_pci.c Wed Aug 2 15:11:06 2017 (r321931) +++ stable/10/sys/dev/ichsmb/ichsmb_pci.c Wed Aug 2 15:13:13 2017 (r321932) @@ -67,35 +67,89 @@ __FBSDID("$FreeBSD$"); #include /* PCI unique identifiers */ -#define ID_82801AA 0x24138086 -#define ID_82801AB 0x24238086 -#define ID_82801BA 0x24438086 -#define ID_82801CA 0x24838086 -#define ID_82801DC 0x24C38086 -#define ID_82801EB 0x24D38086 -#define ID_82801FB 0x266A8086 -#define ID_82801GB 0x27da8086 -#define ID_82801H 0x283e8086 -#define ID_82801I 0x29308086 -#define ID_82801JI 0x3a308086 -#define ID_PCH 0x3b308086 -#define ID_6300ESB 0x25a48086 -#define ID_631xESB 0x269b8086 -#define ID_DH89XXCC 0x23308086 -#define ID_PATSBURG 0x1d228086 -#define ID_CPT 0x1c228086 -#define ID_PPT 0x1e228086 -#define ID_AVOTON 0x1f3c8086 -#define ID_COLETOCRK 0x23B08086 -#define ID_LPT 0x8c228086 -#define ID_LPTLP 0x9c228086 -#define ID_WCPT 0x8ca28086 -#define ID_WCPTLP 0x9ca28086 -#define ID_WELLSBURG 0x8d228086 -#define ID_SRPT 0xa1238086 -#define ID_SRPTLP 0x9d238086 +#define PCI_VENDOR_INTEL 0x8086 +#define ID_82801AA 0x2413 +#define ID_82801AB 0x2423 +#define ID_82801BA 0x2443 +#define ID_82801CA 0x2483 +#define ID_82801DC 0x24C3 +#define ID_82801EB 0x24D3 +#define ID_82801FB 0x266A +#define ID_82801GB 0x27da +#define ID_82801H 0x283e +#define ID_82801I 0x2930 +#define ID_EP80579 0x5032 +#define ID_82801JI 0x3a30 +#define ID_82801JD 0x3a60 +#define ID_PCH 0x3b30 +#define ID_6300ESB 0x25a4 +#define ID_631xESB 0x269b +#define ID_DH89XXCC 0x2330 +#define ID_PATSBURG 0x1d22 +#define ID_CPT 0x1c22 +#define ID_PPT 0x1e22 +#define ID_AVOTON 0x1f3c +#define ID_COLETOCRK 0x23B0 +#define ID_LPT 0x8c22 +#define ID_LPTLP 0x9c22 +#define ID_WCPT 0x8ca2 +#define ID_WCPTLP 0x9ca2 +#define ID_BAYTRAIL 0x0f12 +#define ID_BRASWELL 0x2292 +#define ID_WELLSBURG 0x8d22 +#define ID_SRPT 0xa123 +#define ID_SRPTLP 0x9d23 +#define ID_DENVERTON 0x19df +#define ID_BROXTON 0x5ad4 +#define ID_LEWISBURG 0xa1a3 +#define ID_LEWISBURG2 0xa223 +#define ID_KABYLAKE 0xa2a3 -#define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 +static const struct ichsmb_device { + uint16_t id; + const char *name; +} ichsmb_devices[] = { + { ID_82801AA, "Intel 82801AA (ICH) SMBus controller" }, + { ID_82801AB, "Intel 82801AB (ICH0) SMBus controller" }, + { ID_82801BA, "Intel 82801BA (ICH2) SMBus controller" }, + { ID_82801CA, "Intel 82801CA (ICH3) SMBus controller" }, + { ID_82801DC, "Intel 82801DC (ICH4) SMBus controller" }, + { ID_82801EB, "Intel 82801EB (ICH5) SMBus controller" }, + { ID_82801FB, "Intel 82801FB (ICH6) SMBus controller" }, + { ID_82801GB, "Intel 82801GB (ICH7) SMBus controller" }, + { ID_82801H, "Intel 82801H (ICH8) SMBus controller" }, + { ID_82801I, "Intel 82801I (ICH9) SMBus controller" }, + { ID_82801GB, "Intel 82801GB (ICH7) SMBus controller" }, + { ID_82801H, "Intel 82801H (ICH8) SMBus controller" }, + { ID_82801I, "Intel 82801I (ICH9) SMBus controller" }, + { ID_EP80579, "Intel EP80579 SMBus controller" }, + { ID_82801JI, "Intel 82801JI (ICH10) SMBus controller" }, + { ID_82801JD, "Intel 82801JD (ICH10) SMBus controller" }, + { ID_PCH, "Intel PCH SMBus controller" }, + { ID_6300ESB, "Intel 6300ESB (ICH) SMBus controller" }, + { ID_631xESB, "Intel 631xESB/6321ESB (ESB2) SMBus controller" }, + { ID_DH89XXCC, "Intel DH89xxCC SMBus controller" }, + { ID_PATSBURG, "Intel Patsburg SMBus controller" }, + { ID_CPT, "Intel Cougar Point SMBus controller" }, + { ID_PPT, "Intel Panther Point SMBus controller" }, + { ID_AVOTON, "Intel Avoton SMBus controller" }, + { ID_LPT, "Intel Lynx Point SMBus controller" }, + { ID_LPTLP, "Intel Lynx Point-LP SMBus controller" }, + { ID_WCPT, "Intel Wildcat Point SMBus controller" }, + { ID_WCPTLP, "Intel Wildcat Point-LP SMBus controller" }, + { ID_BAYTRAIL, "Intel Baytrail SMBus controller" }, + { ID_BRASWELL, "Intel Braswell SMBus controller" }, + { ID_COLETOCRK, "Intel Coleto Creek SMBus controller" }, + { ID_WELLSBURG, "Intel Wellsburg SMBus controller" }, + { ID_SRPT, "Intel Sunrise Point-H SMBus controller" }, + { ID_SRPTLP, "Intel Sunrise Point-LP SMBus controller" }, + { ID_DENVERTON, "Intel Denverton SMBus controller" }, + { ID_BROXTON, "Intel Broxton SMBus controller" }, + { ID_LEWISBURG, "Intel Lewisburg SMBus controller" }, + { ID_LEWISBURG2,"Intel Lewisburg SMBus controller" }, + { ID_KABYLAKE, "Intel Kaby Lake SMBus controller" }, + { 0, NULL }, +}; /* Internal functions */ static int ichsmb_pci_probe(device_t dev); @@ -141,95 +195,19 @@ DRIVER_MODULE(ichsmb, pci, ichsmb_pci_driver, ichsmb_p static int ichsmb_pci_probe(device_t dev) { - /* Check PCI identifier */ - switch (pci_get_devid(dev)) { - case ID_82801AA: - device_set_desc(dev, "Intel 82801AA (ICH) SMBus controller"); - break; - case ID_82801AB: - device_set_desc(dev, "Intel 82801AB (ICH0) SMBus controller"); - break; - case ID_82801BA: - device_set_desc(dev, "Intel 82801BA (ICH2) SMBus controller"); - break; - case ID_82801CA: - device_set_desc(dev, "Intel 82801CA (ICH3) SMBus controller"); - break; - case ID_82801DC: - device_set_desc(dev, "Intel 82801DC (ICH4) SMBus controller"); - break; - case ID_82801EB: - device_set_desc(dev, "Intel 82801EB (ICH5) SMBus controller"); - break; - case ID_82801FB: - device_set_desc(dev, "Intel 82801FB (ICH6) SMBus controller"); - break; - case ID_82801GB: - device_set_desc(dev, "Intel 82801GB (ICH7) SMBus controller"); - break; - case ID_82801H: - device_set_desc(dev, "Intel 82801H (ICH8) SMBus controller"); - break; - case ID_82801I: - device_set_desc(dev, "Intel 82801I (ICH9) SMBus controller"); - break; - case ID_82801JI: - device_set_desc(dev, "Intel 82801JI (ICH10) SMBus controller"); - break; - case ID_PCH: - device_set_desc(dev, "Intel PCH SMBus controller"); - break; - case ID_6300ESB: - device_set_desc(dev, "Intel 6300ESB (ICH) SMBus controller"); - break; - case ID_631xESB: - device_set_desc(dev, "Intel 631xESB/6321ESB (ESB2) SMBus controller"); - break; - case ID_DH89XXCC: - device_set_desc(dev, "Intel DH89xxCC SMBus controller"); - break; - case ID_PATSBURG: - device_set_desc(dev, "Intel Patsburg SMBus controller"); - break; - case ID_CPT: - device_set_desc(dev, "Intel Cougar Point SMBus controller"); - break; - case ID_PPT: - device_set_desc(dev, "Intel Panther Point SMBus controller"); - break; - case ID_AVOTON: - device_set_desc(dev, "Intel Avoton SMBus controller"); - break; - case ID_LPT: - device_set_desc(dev, "Intel Lynx Point SMBus controller"); - break; - case ID_LPTLP: - device_set_desc(dev, "Intel Lynx Point-LP SMBus controller"); - break; - case ID_WCPT: - device_set_desc(dev, "Intel Wildcat Point SMBus controller"); - break; - case ID_WCPTLP: - device_set_desc(dev, "Intel Wildcat Point-LP SMBus controller"); - break; - case ID_COLETOCRK: - device_set_desc(dev, "Intel Coleto Creek SMBus controller"); - break; - case ID_WELLSBURG: - device_set_desc(dev, "Intel Wellsburg SMBus controller"); - break; - case ID_SRPT: - device_set_desc(dev, "Intel Sunrise Point-H SMBus controller"); - break; - case ID_SRPTLP: - device_set_desc(dev, "Intel Sunrise Point-LP SMBus controller"); - break; - default: + const struct ichsmb_device *device; + + if (pci_get_vendor(dev) != PCI_VENDOR_INTEL) return (ENXIO); + + for (device = ichsmb_devices; device->name != NULL; device++) { + if (pci_get_device(dev) == device->id) { + device_set_desc(dev, device->name); + return (ichsmb_probe(dev)); + } } - /* Done */ - return (ichsmb_probe(dev)); + return (ENXIO); } static int From owner-svn-src-stable-10@freebsd.org Wed Aug 2 20:24:29 2017 Return-Path: Delivered-To: svn-src-stable-10@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 5E422DB3B7D; Wed, 2 Aug 2017 20:24:29 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A50676697; Wed, 2 Aug 2017 20:24:29 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72KOS9m019078; Wed, 2 Aug 2017 20:24:28 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72KOSbT019077; Wed, 2 Aug 2017 20:24:28 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201708022024.v72KOSbT019077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Wed, 2 Aug 2017 20:24:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321945 - stable/10/sys/dev/isp X-SVN-Group: stable-10 X-SVN-Commit-Author: ken X-SVN-Commit-Paths: stable/10/sys/dev/isp X-SVN-Commit-Revision: 321945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Aug 2017 20:24:29 -0000 Author: ken Date: Wed Aug 2 20:24:28 2017 New Revision: 321945 URL: https://svnweb.freebsd.org/changeset/base/321945 Log: MFC r321622, r321623: ------------------------------------------------------------------------ r321622 | ken | 2017-07-27 09:33:57 -0600 (Thu, 27 Jul 2017) | 44 lines Fix probing FC targets with hard addressing turned on. This largely reverts FreeBSD SVN change 289937 from October 25th, 2015. The intent of that change was to keep loop IDs persistent across chip reinits. The problem is that the change turned on the PREVLOOP / PREV_ADDRESS bit (bit 7 in Firmware Options 2), which tells the Qlogic chip to not participate in the loop if it can't get the requested loop address. It also turned off soft addressing on 2400 (4Gb) and newer controllers. The isp(4) driver defaults to loop address 0, and the tape drives I have tested default to loop address 0 if hard addressing is turned on. So when hard loop addressing is turned on on the drive, the isp(4) driver just refuses to participate in the loop. The solution is to largely revert that change. I left some elements in place that are related to virtual ports, since they were new. This does work with IBM tape drives with hard and soft addressing turned on. I have tested it with 4Gb, 8Gb, and 16Gb controllers. sys/dev/isp.c: Largely revert FreeBSD SVN change 289937. I left the ispmbox.h changes in place. Don't use the PREV_ADDRESS bit on initialization. It tells the chip to not participate if it can't get the requested loop ID. Do use soft addressing on 2400 and newer chips. Use hard addressing when the user has requested a specific initiator ID. (hint.isp.X.iid=N in /boot/loader.conf) Leave some of the virtual port options from that change in place, but don't turn on the PREV_ADDRESS bit. Reviewed by: mav Sponsored by: Spectra Logic ------------------------------------------------------------------------ r321623 | ken | 2017-07-27 09:51:56 -0600 (Thu, 27 Jul 2017) | 6 lines Remove duplicate assignments from r321622. Submitted by: mav Sponsored by: Spectra Logic ------------------------------------------------------------------------ Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Wed Aug 2 20:24:26 2017 (r321944) +++ stable/10/sys/dev/isp/isp.c Wed Aug 2 20:24:28 2017 (r321945) @@ -1632,6 +1632,7 @@ isp_fibre_init(ispsoftc_t *isp) fcparam *fcp; isp_icb_t local, *icbp = &local; mbreg_t mbs; + int ownloopid; /* * We only support one channel on non-24XX cards @@ -1710,15 +1711,22 @@ isp_fibre_init(ispsoftc_t *isp) } icbp->icb_retry_delay = fcp->isp_retry_delay; icbp->icb_retry_count = fcp->isp_retry_count; - if (fcp->isp_loopid < LOCAL_LOOP_LIM) { - icbp->icb_hardaddr = fcp->isp_loopid; - if (isp->isp_confopts & ISP_CFG_OWNLOOPID) - icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS; - else - icbp->icb_fwoptions |= ICBOPT_PREV_ADDRESS; + icbp->icb_hardaddr = fcp->isp_loopid; + ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0; + if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) { + icbp->icb_hardaddr = 0; + ownloopid = 0; } /* + * Our life seems so much better with 2200s and later with + * the latest f/w if we set Hard Address. + */ + if (ownloopid || ISP_FW_NEWER_THAN(isp, 2, 2, 5)) { + icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS; + } + + /* * Right now we just set extended options to prefer point-to-point * over loop based upon some soft config options. * @@ -1952,6 +1960,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) isp_icb_2400_t local, *icbp = &local; mbreg_t mbs; int chan; + int ownloopid = 0; /* * Check to see whether all channels have *some* kind of role @@ -2024,14 +2033,17 @@ isp_fibre_init_2400(ispsoftc_t *isp) icbp->icb_xchgcnt >>= 1; } - if (fcp->isp_loopid < LOCAL_LOOP_LIM) { - icbp->icb_hardaddr = fcp->isp_loopid; - if (isp->isp_confopts & ISP_CFG_OWNLOOPID) - icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS; - else - icbp->icb_fwoptions1 |= ICB2400_OPT1_PREV_ADDRESS; + + ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0; + icbp->icb_hardaddr = fcp->isp_loopid; + if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) { + icbp->icb_hardaddr = 0; + ownloopid = 0; } + if (ownloopid) + icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS; + if (isp->isp_confopts & ISP_CFG_NOFCTAPE) { icbp->icb_fwoptions2 &= ~ICB2400_OPT2_FCTAPE; } @@ -2133,6 +2145,9 @@ isp_fibre_init_2400(ispsoftc_t *isp) break; } } + if (ownloopid == 0) { + icbp->icb_fwoptions3 |= ICB2400_OPT3_SOFTID; + } icbp->icb_logintime = ICB_LOGIN_TOV; if (fcp->isp_wwnn && fcp->isp_wwpn) { @@ -2245,14 +2260,13 @@ isp_fibre_init_2400(ispsoftc_t *isp) pi.vp_port_options |= ICB2400_VPOPT_INI_ENABLE; if ((fcp2->role & ISP_ROLE_TARGET) == 0) pi.vp_port_options |= ICB2400_VPOPT_TGT_DISABLE; + if (fcp2->isp_loopid < LOCAL_LOOP_LIM) { + pi.vp_port_loopid = fcp2->isp_loopid; + if (isp->isp_confopts & ISP_CFG_OWNLOOPID) + pi.vp_port_options |= ICB2400_VPOPT_HARD_ADDRESS; + } + } - if (fcp2->isp_loopid < LOCAL_LOOP_LIM) { - pi.vp_port_loopid = fcp2->isp_loopid; - if (isp->isp_confopts & ISP_CFG_OWNLOOPID) - pi.vp_port_options |= ICB2400_VPOPT_HARD_ADDRESS; - else - pi.vp_port_options |= ICB2400_VPOPT_PREV_ADDRESS; - } MAKE_NODE_NAME_FROM_WWN(pi.vp_port_portname, fcp2->isp_wwpn); MAKE_NODE_NAME_FROM_WWN(pi.vp_port_nodename, fcp2->isp_wwnn); off = fcp->isp_scratch; @@ -2330,8 +2344,6 @@ isp_fc_enable_vp(ispsoftc_t *isp, int chan) vp.vp_mod_ports[0].loopid = fcp->isp_loopid; if (isp->isp_confopts & ISP_CFG_OWNLOOPID) vp.vp_mod_ports[0].options |= ICB2400_VPOPT_HARD_ADDRESS; - else - vp.vp_mod_ports[0].options |= ICB2400_VPOPT_PREV_ADDRESS; } MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwpn, fcp->isp_wwpn); MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwnn, fcp->isp_wwnn); From owner-svn-src-stable-10@freebsd.org Wed Aug 2 20:27:32 2017 Return-Path: Delivered-To: svn-src-stable-10@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 2D3CFDB3CE1; Wed, 2 Aug 2017 20:27:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 068C376933; Wed, 2 Aug 2017 20:27:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72KRVuL019223; Wed, 2 Aug 2017 20:27:31 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72KRU9F019219; Wed, 2 Aug 2017 20:27:30 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708022027.v72KRU9F019219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 2 Aug 2017 20:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321946 - in stable/10/sys: arm/freescale/imx conf powerpc/mpc85xx X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in stable/10/sys: arm/freescale/imx conf powerpc/mpc85xx X-SVN-Commit-Revision: 321946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Aug 2017 20:27:32 -0000 Author: marius Date: Wed Aug 2 20:27:30 2017 New Revision: 321946 URL: https://svnweb.freebsd.org/changeset/base/321946 Log: Apply the other half of merges to sdhci_imx(4) and sdhci_fsl(4) that somehow stayed local when committing r318198, probably due to the associated tree conflicts. While at it, register the dependency of sdhci_fsl(4) on sdhci(4) and allow the former to be built. Modified: stable/10/sys/arm/freescale/imx/imx_sdhci.c stable/10/sys/conf/files.powerpc stable/10/sys/powerpc/mpc85xx/fsl_sdhc.c stable/10/sys/powerpc/mpc85xx/fsl_sdhc.h Modified: stable/10/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_sdhci.c Wed Aug 2 20:24:28 2017 (r321945) +++ stable/10/sys/arm/freescale/imx/imx_sdhci.c Wed Aug 2 20:27:30 2017 (r321946) @@ -59,10 +59,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include + +#include "mmcbr_if.h" #include "sdhci_if.h" struct imx_sdhci_softc { @@ -803,7 +803,6 @@ static device_method_t imx_sdhci_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, sdhci_generic_read_ivar), DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), - DEVMETHOD(bus_print_child, bus_generic_print_child), /* MMC bridge interface */ DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), @@ -822,7 +821,7 @@ static device_method_t imx_sdhci_methods[] = { DEVMETHOD(sdhci_write_4, imx_sdhci_write_4), DEVMETHOD(sdhci_write_multi_4, imx_sdhci_write_multi_4), - { 0, 0 } + DEVMETHOD_END }; static devclass_t imx_sdhci_devclass; @@ -833,7 +832,7 @@ static driver_t imx_sdhci_driver = { sizeof(struct imx_sdhci_softc), }; -DRIVER_MODULE(sdhci_imx, simplebus, imx_sdhci_driver, imx_sdhci_devclass, 0, 0); +DRIVER_MODULE(sdhci_imx, simplebus, imx_sdhci_driver, imx_sdhci_devclass, + NULL, NULL); MODULE_DEPEND(sdhci_imx, sdhci, 1, 1, 1); -DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_imx, mmc, 1, 1, 1); +MMC_DECLARE_BRIDGE(sdhci_imx); Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Wed Aug 2 20:24:28 2017 (r321945) +++ stable/10/sys/conf/files.powerpc Wed Aug 2 20:27:30 2017 (r321946) @@ -131,6 +131,7 @@ powerpc/mpc85xx/ds1553_bus_fdt.c optional ds1553 fdt powerpc/mpc85xx/ds1553_core.c optional ds1553 powerpc/mpc85xx/i2c.c optional iicbus fdt powerpc/mpc85xx/isa.c optional mpc85xx isa +powerpc/mpc85xx/fsl_sdhc.c optional mpc85xx sdhci powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx powerpc/mpc85xx/platform_mpc85xx.c optional mpc85xx Modified: stable/10/sys/powerpc/mpc85xx/fsl_sdhc.c ============================================================================== --- stable/10/sys/powerpc/mpc85xx/fsl_sdhc.c Wed Aug 2 20:24:28 2017 (r321945) +++ stable/10/sys/powerpc/mpc85xx/fsl_sdhc.c Wed Aug 2 20:27:30 2017 (r321946) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -112,7 +111,7 @@ static device_method_t fsl_sdhc_methods[] = { DEVMETHOD(mmcbr_acquire_host, fsl_sdhc_acquire_host), DEVMETHOD(mmcbr_release_host, fsl_sdhc_release_host), - {0, 0}, + DEVMETHOD_END }; /* kobj_class definition */ @@ -124,9 +123,9 @@ static driver_t fsl_sdhc_driver = { static devclass_t fsl_sdhc_devclass; -DRIVER_MODULE(sdhci, simplebus, fsl_sdhc_driver, fsl_sdhc_devclass, 0, 0); -DRIVER_MODULE(mmc, sdhci_fsl, mmc_driver, mmc_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_fsl, mmc, 1, 1, 1); +DRIVER_MODULE(sdhci, simplebus, fsl_sdhc_driver, fsl_sdhc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_fsl, sdhci, 1, 1, 1); +MMC_DECLARE_BRIDGE(sdhci_fsl); /***************************************************************************** * Private methods Modified: stable/10/sys/powerpc/mpc85xx/fsl_sdhc.h ============================================================================== --- stable/10/sys/powerpc/mpc85xx/fsl_sdhc.h Wed Aug 2 20:24:28 2017 (r321945) +++ stable/10/sys/powerpc/mpc85xx/fsl_sdhc.h Wed Aug 2 20:27:30 2017 (r321946) @@ -46,12 +46,8 @@ #include #include -#include #include -#include "mmcbr_if.h" - - /***************************************************************************** * Private defines *****************************************************************************/ @@ -112,7 +108,6 @@ struct fsl_sdhc_softc { #define FSL_SDHC_DMA_SEGMENT_SIZE (1024) #define FSL_SDHC_DMA_ALIGNMENT (4) #define FSL_SDHC_DMA_BLOCK_SIZE FSL_SDHC_MAX_BLOCK_SIZE - /* * Offsets of SD HC registers From owner-svn-src-stable-10@freebsd.org Wed Aug 2 20:43:22 2017 Return-Path: Delivered-To: svn-src-stable-10@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 435A0DB4640; Wed, 2 Aug 2017 20:43:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x22c.google.com (mail-pg0-x22c.google.com [IPv6:2607:f8b0:400e:c05::22c]) (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 0C6037738D; Wed, 2 Aug 2017 20:43:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x22c.google.com with SMTP id l64so25500360pge.5; Wed, 02 Aug 2017 13:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=l/XfYYMttiUGoq4YGghKRNUePTkZ+V1iINoXJ1Pnsy8=; b=hd7fZeeWb+vI6pw/I696H5ykHORQZZLB/6Jp7XUQM5W/3x53E7fxLYELNlAC6FSYy5 Lo/BkerhM0FL3KCtLJkybffEyeAqUa9djH8nClZH7EuzQj8TxelsaNPVNU67vvCc4zSY FXmOBbkMa8GOG2AbZpb0TUFB3T0l5DAetb5epnH7bzZQfT06CLH10qusCx60dhlTlMOq GXpjqUQ+R70DFeWTKlzHObXicVXmrO1RJ6FqaXyLPQFMDCdG2JdWgr/pON0KMX5ysnli 4NOLqMMStU1hO6kAfe7ZpDsukwwftSlbve8QpjYInRwgj4MGNJ3AS/34ea8DtdbH0DPy oayQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=l/XfYYMttiUGoq4YGghKRNUePTkZ+V1iINoXJ1Pnsy8=; b=lHsZyOjLNG1NpzKiwH1KGTXUQiWvacPoht/SUMKycxGc+8UBoG1F8C5pKOwOe8s+ii vBBLd8EPcqcgEwy/MBGj4q6UyhB7T2Uu2qlssQm0+o8KIkc5Ja/UJXLHIh8bBP7Yi7ge 7hycgvF2M/ywMAXYIyO2wcm64ZwifQJvdvVQJZNxQE3DxG4SL8f50f2IcpoiLdoB3SKf ZJmoJZqttlkO0b63vfmctGSMPkHYvhvkJCFSTIRi/0F2lqo9XINc5dFChCL2lbyqT+9r rlqYR5iwOK/2tPAr3XiGQU17mC8f/nCEk9f+qjT9EUZg4ZVpgfpbB2JrlnJyNOAZ+vy8 yTtQ== X-Gm-Message-State: AIVw113CToRPt+Ej1s6V2JUNVM0fIGsz6/bFMOK1xnRnKxlUhb5JU6ZV A+P+z7W08vIPwabFmw4= X-Received: by 10.98.58.210 with SMTP id v79mr24281916pfj.162.1501706600929; Wed, 02 Aug 2017 13:43:20 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id i133sm27545656pgc.0.2017.08.02.13.43.19 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 13:43:20 -0700 (PDT) Subject: Re: svn commit: r321093 - in stable/10: bin/ln bin/ln/tests etc/mtree Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_7A6671DF-83BA-4A91-9B05-F6BEE593163B"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Wed, 2 Aug 2017 13:43:18 -0700 Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Message-Id: References: <201707172112.v6HLC2In057796@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Aug 2017 20:43:22 -0000 --Apple-Mail=_7A6671DF-83BA-4A91-9B05-F6BEE593163B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 31, 2017, at 14:34, Alan Somers wrote: >=20 > On Mon, Jul 17, 2017 at 3:12 PM, Ngie Cooper wrote: >> Author: ngie >> Date: Mon Jul 17 21:12:02 2017 >> New Revision: 321093 >> URL: https://svnweb.freebsd.org/changeset/base/321093 >>=20 >> Log: >> MFC r319857: >>=20 >> ln(1): wordsmith -F option description >>=20 >> Added: >> stable/10/bin/ln/tests/ >> - copied from r319714, head/bin/ln/tests/ >> Modified: >> stable/10/bin/ln/Makefile >> stable/10/etc/mtree/BSD.tests.dist >> Directory Properties: >> stable/10/ (props changed) >=20 > It looks like the commit message for this one was wrong, though the > merge tracking info is correct. The commit message should've read: >=20 > MFC r319714: >=20 > Add tests for ln(1) >=20 > * Verify that when creating a hard link to a symbolic link, '-L' = option > creates a hard link to the target of the symbolic link > * Verify that when creating a hard link to a symbolic link, '-P' = option > creates a hard link to the symbolic link itself > * Verify that if the target file already exists, '-f' option unlinks = it so > that link may occur > * Verify that if the target file or directory is a symbolic link, = '-shf' > option prevents following the link > * Verify that if the target file or directory is a symbolic link, = '-snf' > option prevents following the link > * Verify that '-s' option creates a symbolic link > * Verify that '-w' option produces a warning if the source of a = symbolic > link does not currently exist >=20 > Submitted by: shivansh > Reviewed by: asomers, ngie > MFC after: 1 month > Sponsored by: Google, Inc (GSoC 2017) > Differential Revision: https://reviews.freebsd.org/D11084 Whoops =E2=80=94 yeah, I might have screwed that up by accident = :(. Thanks for the clarification! -Ngie --Apple-Mail=_7A6671DF-83BA-4A91-9B05-F6BEE593163B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZgjlnAAoJEPWDqSZpMIYVCvsQANTKrLzPfDuQD7D4mK/15WFA tRTn3S728KCy61WX1XBVhd26GCB5VKLlJOG3IxnmeVrjNfah/1E2NPW5OBTAAwm0 V360DzTs8VkJejqHsiRLv6lSSCtQfbDamH5JtyLN5p14Gu8NyUfYteJQxyKHvQUt KkAW3H/5OgqlDEua/Dg+UQa+D5pTELz1KGqYNBh7nOMPZHBDb4rL+VKrnRYuETEg udLPsuRx1rb5uQ2V9x99W8dlFhFzUa7DRIfRYrGYBlo5PW72o7GXOsle5r5nnvJD Hk6q2yeS1i7fkpNmcGdhw5cgk+sjiuDHLYeRTxwqebhGTOgX76iraN+ZRKKK4Hqb 689QB2ySZduKQc5FYi8UzWboU/811zEDJiORT2FLZD6q+TWl0wS8Nn7YlDEaA+JC qKkzZri0keDXPik8yt7PeB9azOHkU3QSgbneEFGvqnqPXvTWC06Vsi72ox4QyjxY lx+BNjfe7qGs7UQ2LtriU1Pa15WX48mJRmrM2Fz7uvfv8jx57ToFwUTdWvyBxoVM WnRBEqxup8tYNzbVanFEESThq274OnkIrOIEE2hfd77fUSd0KnlM90nVrqcXd9p5 6Fs2r4d5vY6/uK1oQ407UL59Q0t3Lr88Iue+zfWtTASBGlD5eIUmmEQ6OX3AB28H qTT60oi5ZD/xZ2wejf8K =e8C0 -----END PGP SIGNATURE----- --Apple-Mail=_7A6671DF-83BA-4A91-9B05-F6BEE593163B-- From owner-svn-src-stable-10@freebsd.org Thu Aug 3 01:40:07 2017 Return-Path: Delivered-To: svn-src-stable-10@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 18FABDBED5D; Thu, 3 Aug 2017 01:40:07 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB5A9E6; Thu, 3 Aug 2017 01:40:06 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v731e5tn047362; Thu, 3 Aug 2017 01:40:05 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v731e5fU047355; Thu, 3 Aug 2017 01:40:05 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201708030140.v731e5fU047355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 3 Aug 2017 01:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321964 - in stable/10: contrib/bmake contrib/bmake/PSD.doc contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake X-SVN-Group: stable-10 X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in stable/10: contrib/bmake contrib/bmake/PSD.doc contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake X-SVN-Commit-Revision: 321964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 01:40:07 -0000 Author: sjg Date: Thu Aug 3 01:40:05 2017 New Revision: 321964 URL: https://svnweb.freebsd.org/changeset/base/321964 Log: MFC bmake-20170720 PR: 221023 Added: stable/10/contrib/bmake/mk/files.mk - copied unchanged from r318163, head/contrib/bmake/mk/files.mk stable/10/contrib/bmake/mk/sys.debug.mk - copied unchanged from r310304, head/contrib/bmake/mk/sys.debug.mk stable/10/contrib/bmake/mk/sys.vars.mk - copied, changed from r310304, head/contrib/bmake/mk/sys.vars.mk Modified: stable/10/contrib/bmake/ChangeLog stable/10/contrib/bmake/Makefile stable/10/contrib/bmake/PSD.doc/tutorial.ms stable/10/contrib/bmake/README stable/10/contrib/bmake/arch.c stable/10/contrib/bmake/bmake.1 stable/10/contrib/bmake/bmake.cat1 stable/10/contrib/bmake/boot-strap stable/10/contrib/bmake/buf.h stable/10/contrib/bmake/compat.c stable/10/contrib/bmake/cond.c stable/10/contrib/bmake/config.h.in stable/10/contrib/bmake/configure stable/10/contrib/bmake/configure.in stable/10/contrib/bmake/dir.c stable/10/contrib/bmake/dir.h stable/10/contrib/bmake/dirname.c stable/10/contrib/bmake/for.c stable/10/contrib/bmake/getopt.c stable/10/contrib/bmake/hash.h stable/10/contrib/bmake/job.c stable/10/contrib/bmake/main.c stable/10/contrib/bmake/make-bootstrap.sh.in stable/10/contrib/bmake/make.1 stable/10/contrib/bmake/make.c stable/10/contrib/bmake/make.h stable/10/contrib/bmake/make_malloc.c stable/10/contrib/bmake/meta.c stable/10/contrib/bmake/meta.h stable/10/contrib/bmake/mk/ChangeLog stable/10/contrib/bmake/mk/FILES stable/10/contrib/bmake/mk/auto.dep.mk stable/10/contrib/bmake/mk/auto.obj.mk stable/10/contrib/bmake/mk/autodep.mk stable/10/contrib/bmake/mk/dirdeps.mk stable/10/contrib/bmake/mk/doc.mk stable/10/contrib/bmake/mk/dpadd.mk stable/10/contrib/bmake/mk/final.mk stable/10/contrib/bmake/mk/gendirdeps.mk stable/10/contrib/bmake/mk/inc.mk stable/10/contrib/bmake/mk/init.mk stable/10/contrib/bmake/mk/install-mk stable/10/contrib/bmake/mk/lib.mk stable/10/contrib/bmake/mk/libnames.mk stable/10/contrib/bmake/mk/meta.autodep.mk stable/10/contrib/bmake/mk/meta.stage.mk stable/10/contrib/bmake/mk/meta.sys.mk stable/10/contrib/bmake/mk/meta2deps.py stable/10/contrib/bmake/mk/meta2deps.sh stable/10/contrib/bmake/mk/mkopt.sh stable/10/contrib/bmake/mk/nls.mk stable/10/contrib/bmake/mk/own.mk stable/10/contrib/bmake/mk/prog.mk stable/10/contrib/bmake/mk/scripts.mk stable/10/contrib/bmake/mk/subdir.mk stable/10/contrib/bmake/mk/sys.clean-env.mk stable/10/contrib/bmake/mk/sys.dependfile.mk stable/10/contrib/bmake/mk/sys.mk stable/10/contrib/bmake/mk/sys/AIX.mk stable/10/contrib/bmake/mk/sys/Darwin.mk stable/10/contrib/bmake/mk/sys/Generic.mk stable/10/contrib/bmake/mk/sys/HP-UX.mk stable/10/contrib/bmake/mk/sys/IRIX.mk stable/10/contrib/bmake/mk/sys/Linux.mk stable/10/contrib/bmake/mk/sys/NetBSD.mk stable/10/contrib/bmake/mk/sys/OSF1.mk stable/10/contrib/bmake/mk/sys/OpenBSD.mk stable/10/contrib/bmake/mk/sys/SunOS.mk stable/10/contrib/bmake/mk/sys/UnixWare.mk stable/10/contrib/bmake/mk/warnings.mk stable/10/contrib/bmake/nonints.h stable/10/contrib/bmake/os.sh stable/10/contrib/bmake/parse.c stable/10/contrib/bmake/sprite.h stable/10/contrib/bmake/str.c stable/10/contrib/bmake/suff.c stable/10/contrib/bmake/targ.c stable/10/contrib/bmake/unit-tests/export-env.exp stable/10/contrib/bmake/unit-tests/export-env.mk stable/10/contrib/bmake/unit-tests/modmatch.exp stable/10/contrib/bmake/unit-tests/modmatch.mk stable/10/contrib/bmake/unit-tests/modts.exp stable/10/contrib/bmake/unit-tests/modts.mk stable/10/contrib/bmake/unit-tests/varmisc.exp stable/10/contrib/bmake/unit-tests/varmisc.mk stable/10/contrib/bmake/var.c stable/10/usr.bin/bmake/Makefile stable/10/usr.bin/bmake/Makefile.inc stable/10/usr.bin/bmake/config.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bmake/ChangeLog ============================================================================== --- stable/10/contrib/bmake/ChangeLog Thu Aug 3 00:38:13 2017 (r321963) +++ stable/10/contrib/bmake/ChangeLog Thu Aug 3 01:40:05 2017 (r321964) @@ -1,3 +1,296 @@ +2017-07-20 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170720 + Merge with NetBSD make, pick up + o compat.c: pass SIGINT etc onto child and wait for it to exit + before we self-terminate. + +2017-07-11 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170711 + forgot to update after merge on 20170708 ;-) + o main.c: refactor to reduce size of main function. + add -v option to always fully expand values. + o meta.c: ensure command output in meta file has ending newline + even when filemon not being used. + When matching ${.MAKE.META.IGNORE_PATTERNS} do not use + pathname via ':L' since any ':' in pathname breaks that. + Instead set a '${.p.}' to pathname in the target context and + use that. + +2017-05-10 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170510 + Merge with NetBSD make, pick up + o main.c: Main_SetObjdir: ensure buf2 is in scope + +2017-05-08 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170505 + see mk/ChangeLog + +2017-05-05 Simon J. Gerraty + + * parse.c: not everyone has stdint.h + +2017-05-01 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170501 + see mk/ChangeLog + +2017-04-21 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170421 + Merge with NetBSD make, pick up + o str.c: Str_Match: fix closure tests for [^] and add unit-test. + +2017-04-20 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170420 + Merge with NetBSD make, pick up + o main.c: only use -C arg "as is" if it contains no + relative component. + +2017-04-18 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170418 + Merge with NetBSD make, pick up + o main.c: fix Main_SetObjdir() for relative paths (eg obj). + +2017-04-17 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170417 + Merge with NetBSD make, pick up + o fixes a number of coverity complaints + - check return value of fseek, fcntl + - plug memory leak in Dir_FindFile, Var_LoopExpand, + JobPrintCommand, ParseTraditionalInclude + - use bmake_malloc() where NULL is not tollerated + - use MAKE_ATTR_UNUSED rather that kludges like + return(unused ? 0 : 0) + - use purge_cached_realpaths() rather than abuse cached_realpath() + +2017-04-13 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170413 + Merge with NetBSD make, pick up + o main.c: when setting .OBJDIR ignore '$' in paths. + + * job.c: use MALLOC_OPTIONS to set malloc_options. + +2017-04-11 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170411 + Merge with NetBSD make, pick up + o str.c: Str_Match: allow [^a-z] to behave as expected. + +2017-03-26 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170326 + Merge with NetBSD make, pick up + o main.c: purge relative paths from realpath cache when .OBJDIR + is changed. + +2017-03-11 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170311 + Merge with NetBSD make, pick up + o main.c: only use -C arg "as is" if it starts with '/'. + +2017-03-01 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170301 + Merge with NetBSD make, pick up + o main.c: use -C arg "as is" rather than getcwd() + if they identify the same directory. + o parse.c: ensure loadfile buffer is \n terminated in non-mmap case + +2017-02-01 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170201 + Merge with NetBSD make, pick up + o var.c: allow :_=var and avoid use of special context. + +2017-01-30 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170130 + Merge with NetBSD make, pick up + o var.c: add :range and :_ + o main.c: partially initialize Dir_* before MainParseArgs() + can be called. + If -V, skip Main_ExportMAKEFLAGS() + +2017-01-14 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170114 + Merge with NetBSD make, pick up + o var.c: allow specifying the utc value used by :{gm,local}time + +2016-12-12 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20161212 + Merge with NetBSD make, pick up + o main.c: look for obj.${MACHINE}-${MACHINE_ARCH} too. + +2016-12-09 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20161209 + Merge with NetBSD make, pick up + o main.c: cleanup setting of .OBJDIR + o parse.c: avoid coredump from (var)=val + +2016-11-26 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20161126 + Merge with NetBSD make, pick up + o make.c: Make_OODate: report src node name if path not set + +2016-09-26 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160926 + Merge with NetBSD make, pick up + o support for .DELETE_ON_ERROR: (remove targets that fail) + +2016-09-26 Simon J. Gerraty + + * Makefile MAN: tweak .Dt to match ${PROG} + +2016-08-18 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160818 + its a neater number; pick up whitespace fixes to man page. + +2016-08-17 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160817 + Merge with NetBSD make, pick up + o meta.c: move handling of .MAKE.META.IGNORE_* to meta_ignore() + so we can call it before adding entries to missingFiles. + Thus we do not track files we have been told to ignore. + +2016-08-15 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160815 + Merge with NetBSD make, pick up + o meta_oodate: apply .MAKE.META.IGNORE_FILTER (if defined) to + pathnames, and skip if the expansion is empty. + Useful for dirdeps.mk when checking DIRDEPS_CACHE. + +2016-08-12 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160812 + Merge with NetBSD make, pick up + o meta.c: remove all missingFiles entries that match a deleted + dir. + o main.c: set .ERROR_CMD if possible. + +2016-06-06 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160606 + Merge with NetBSD make, pick up + o dir.c: extend mtimes cache to others via cached_stat() + +2016-06-04 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160604 + Merge with NetBSD make, pick up + o meta.c: missing filemon data is only relevant if we read a + meta file. + Also do not return oodate for a missing metafile if gn->path + points to .CURDIR + +2016-06-02 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160602 + Merge with NetBSD make, pick up + o cached_realpath(): avoid hitting filesystem more than necessary. + o meta.c: refactor need_meta decision, add knobs for + missing meta file and filemon data wrt out-of-datedness. + +2016-05-28 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160528 + + * boot-strap, make-bootstrap.sh.in: Makefile now uses _MAKE_VERSION + +2016-05-12 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160512 + Merge with NetBSD make, pick up + o meta.c: ignore paths that match .MAKE.META.IGNORE_PATTERNS + this is useful for gcov builds. + o propagate errors from filemon(4). + +2016-05-09 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160509 + Merge with NetBSD make, pick up + o remove use of non-standard types u_int etc. + o meta.c: apply realpath() before matching against metaIgnorePaths + +2016-04-04 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160404 + Merge with NetBSD make, pick up + o allow makefile to set .MAKE.JOBS + + * Makefile (PROG_NAME): use ${_MAKE_VERSION} + +2016-03-15 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160315 + Merge with NetBSD make, pick up + o fix handling of archive members + +2016-03-13 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): rename variable to avoid interference + with checks for ${MAKE_VERSION} + +2016-03-10 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20160310 + Merge with NetBSD make, pick up + o meta.c: treat missing Read file same as Write, incase we Delete it. + +2016-03-07 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20160307 + Merge with NetBSD make, pick up + o var.c: fix :ts\nnn to be octal by default. + o meta.c: meta_finish() to cleanup memory. + +2016-02-26 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20160226 + Merge with NetBSD make, pick up + o meta.c: allow meta file for makeDepend if makefiles want it. + +2016-02-19 Simon J. Gerraty + + * var.c: default .MAKE.SAVE_DOLLARS to FALSE + for backwards compatability. + + * Makefile (MAKE_VERSION): 20160220 + Merge with NetBSD make, pick up + o var.c: add knob to control handling of '$$' in := + +2016-02-18 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20160218 + Merge with NetBSD make, pick up + o var.c: add .export-literal allows us to fix sys.clean-env.mk + post the changes to Var_Subst. + Var_Subst now takes flags, and does not consume '$$' in := + +2016-02-17 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20160217 + Merge with NetBSD make, pick up + o var.c: preserve '$$' in := + o parse.c: add .dinclude for handling included + makefile like .depend + 2015-12-20 Simon J. Gerraty * Makefile (MAKE_VERSION): 20151220 Modified: stable/10/contrib/bmake/Makefile ============================================================================== --- stable/10/contrib/bmake/Makefile Thu Aug 3 00:38:13 2017 (r321963) +++ stable/10/contrib/bmake/Makefile Thu Aug 3 01:40:05 2017 (r321964) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.49 2015/12/20 22:54:40 sjg Exp $ +# $Id: Makefile,v 1.95 2017/07/20 19:36:13 sjg Exp $ # Base version on src date -MAKE_VERSION= 20151220 +_MAKE_VERSION= 20170720 PROG= bmake @@ -76,7 +76,7 @@ CFLAGS+= ${CPPFLAGS} CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\" CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}} -COPTS.main.c+= "-DMAKE_VERSION=\"${MAKE_VERSION}\"" +COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\"" # meta mode can be useful even without filemon FILEMON_H ?= /usr/include/dev/filemon/filemon.h @@ -131,9 +131,9 @@ OPTIONS_DEFAULT_NO+= \ .include .if ${MK_PROG_VERSION} == "yes" -PROG_NAME= ${PROG}-${MAKE_VERSION} +PROG_NAME= ${PROG}-${_MAKE_VERSION} .if ${MK_PROG_LINK} == "yes" -SYMLINKS+= ${PROG}-${MAKE_VERSION} ${BINDIR}/${PROG} +SYMLINKS+= ${PROG_NAME} ${BINDIR}/${PROG} .endif .endif @@ -156,7 +156,10 @@ my.history: ${MAKEFILE} .NOPATH: ${MAN} ${MAN}: make.1 my.history @echo making $@ - @sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \ + @sed \ + -e '/^.Dt/s/MAKE/${PROG:tu}/' \ + -e 's/^.Nx/NetBSD/' \ + -e '/^.Nm/s/make/${PROG}/' \ -e '/^.Sh HISTORY/rmy.history' \ -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@ Modified: stable/10/contrib/bmake/PSD.doc/tutorial.ms ============================================================================== --- stable/10/contrib/bmake/PSD.doc/tutorial.ms Thu Aug 3 00:38:13 2017 (r321963) +++ stable/10/contrib/bmake/PSD.doc/tutorial.ms Thu Aug 3 01:40:05 2017 (r321964) @@ -1,4 +1,4 @@ -.\" $NetBSD: tutorial.ms,v 1.12 2014/09/30 21:33:14 christos Exp $ +.\" $NetBSD: tutorial.ms,v 1.13 2017/03/01 13:05:11 kre Exp $ .\" Copyright (c) 1988, 1989, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -117,6 +117,15 @@ .de No .br .ne 0.5i +.ie n \{\ +.nr g3 \w'NOTE ' +.po -\\n(g3u +.br +NOTE +.br +.po +\\n(g3u +.\} +.el \{\ .po -0.5i .br .mk @@ -148,12 +157,14 @@ .rt .ft \\n(g3 .ps \\n(g4 +.\} .. .de Bp .ie !\\n(.$ .IP \(bu 2 .el .IP "\&" 2 .. -.po +.3i +.ie n .po +\w'NOTE 'u +.el .po +.3i .TL PMake \*- A Tutorial .AU Modified: stable/10/contrib/bmake/README ============================================================================== --- stable/10/contrib/bmake/README Thu Aug 3 00:38:13 2017 (r321963) +++ stable/10/contrib/bmake/README Thu Aug 3 01:40:05 2017 (r321964) @@ -1,47 +1,52 @@ bmake + ***** -This directory contains a port of the BSD make tool (from NetBSD) -I have run it on SunOS,Solaris,HP-UX,AIX,IRIX,FreeBSD and Linux. +This directory contains a port of the BSD make tool (from NetBSD). +Since 1993 I have run it on AIX, BSDi, Darwin, FreeBSD, HP-UX, IRIX, +Linux, Minix, OSF, Solaris, SunOS and even UTS. +Others have run it on many more systems. -Version 3 was re-worked from scratch to better facilitate -importing newer make(1) versions from NetBSD. The original code base -was NetBSD-1.0, so version 3 was built by doing a fresh import of the -NetBSD-1.0 usr.bin/make, adding the autoconf and other portability -patches to sync it with bmake v2, and then NetBSD's make -of Feb 20, 2000 was imported and conflicts dealt with. -NetBSD's make was again imported on June 6 and December 15, 2000. +Currently each release is tested on NetBSD, FreeBSD, Solaris and Linux. -In 2003 bmake switched to a date based version (first was 20030714) +Since 2003 bmake switched to a date based version (first was 20030714) which generally represents the date it was last merged with NetBSD's make. Since then, NetBSD's make is imported within a week of any interesting changes, so that bmake tracks it very closely. -Building: +Building +======== -The preferred way to bootstrap bmake is: +The preferred way to bootstrap bmake is:: -./bmake/boot-strap + ./bmake/boot-strap there are a number of args - most of which get passed to configure, eg. +:: -./bmake/boot-strap --prefix=/opt + ./bmake/boot-strap --prefix=/opt see the boot-strap script for details. +For folk that hate to read anything, since 20121212 you can also use +the GNU standard process of:: + + ./configure; make; make install + To make much use of bmake you will need the bsd.*.mk macros or my -portable *.mk macros. See +portable *.mk macros which are included with bmake since 20121212 +and separately available from http://www.crufty.net/ftp/pub/sjg/mk.tar.gz which will be links to the latest versions. -On a non-BSD system, you would want to unpack mk[-YYYYmmdd].tar.gz in -the same directory as bmake (so ./mk and ./bmake exist), and -./bmake/boot-strap will do the rest. +Porting +======= -If you want to do it all by hand then read boot-strap first to get the -idea. +If you encounter a system that bmake does not build or work on *out of +the box*, I welcome patches. +If you can provide access to a suitable machine - even better. -Even if you have an earlier version of bmake installed, use boot-strap -to ensure that all goes well. +More info can be found at http://www.crufty.net/help/sjg/bmake.htm ---sjg +--sjg + Modified: stable/10/contrib/bmake/arch.c ============================================================================== --- stable/10/contrib/bmake/arch.c Thu Aug 3 00:38:13 2017 (r321963) +++ stable/10/contrib/bmake/arch.c Thu Aug 3 01:40:05 2017 (r321964) @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.64 2015/10/11 04:51:24 sjg Exp $ */ +/* $NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.64 2015/10/11 04:51:24 sjg Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.64 2015/10/11 04:51:24 sjg Exp $"); +__RCSID("$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -136,7 +136,6 @@ __RCSID("$NetBSD: arch.c,v 1.64 2015/10/11 04:51:24 sj #include #include #include -#include #ifdef HAVE_AR_H #include #else @@ -156,7 +155,6 @@ struct ar_hdr { #if defined(HAVE_RANLIB_H) && !(defined(__ELF__) || defined(NO_RANLIB)) #include #endif -#include #include #include #ifdef HAVE_UTIME_H @@ -254,8 +252,7 @@ ArchFree(void *ap) free(Hash_GetValue(entry)); free(a->name); - if (a->fnametab) - free(a->fnametab); + free(a->fnametab); Hash_DeleteTable(&a->members); free(a); } @@ -310,9 +307,10 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * void *freeIt; char *result; - result = Var_Parse(cp, ctxt, TRUE, TRUE, &length, &freeIt); - if (freeIt) - free(freeIt); + result = Var_Parse(cp, ctxt, VARF_UNDEFERR|VARF_WANTRES, + &length, &freeIt); + free(freeIt); + if (result == var_Error) { return(FAILURE); } else { @@ -325,7 +323,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * *cp++ = '\0'; if (subLibName) { - libName = Var_Subst(NULL, libName, ctxt, TRUE, TRUE); + libName = Var_Subst(NULL, libName, ctxt, VARF_UNDEFERR|VARF_WANTRES); } @@ -351,9 +349,10 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * void *freeIt; char *result; - result = Var_Parse(cp, ctxt, TRUE, TRUE, &length, &freeIt); - if (freeIt) - free(freeIt); + result = Var_Parse(cp, ctxt, VARF_UNDEFERR|VARF_WANTRES, + &length, &freeIt); + free(freeIt); + if (result == var_Error) { return(FAILURE); } else { @@ -404,7 +403,8 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * char *oldMemName = memName; size_t sz; - memName = Var_Subst(NULL, memName, ctxt, TRUE, TRUE); + memName = Var_Subst(NULL, memName, ctxt, + VARF_UNDEFERR|VARF_WANTRES); /* * Now form an archive spec and recurse to deal with nested @@ -726,7 +726,8 @@ ArchStatMember(char *archive, char *member, Boolean ha if (fread(memName, elen, 1, arch) != 1) goto badarch; memName[elen] = '\0'; - fseek(arch, -elen, SEEK_CUR); + if (fseek(arch, -elen, SEEK_CUR) != 0) + goto badarch; if (DEBUG(ARCH) || DEBUG(MAKE)) { fprintf(debug_file, "ArchStat: Extended format entry for %s\n", memName); } @@ -737,7 +738,8 @@ ArchStatMember(char *archive, char *member, Boolean ha Hash_SetValue(he, bmake_malloc(sizeof(struct ar_hdr))); memcpy(Hash_GetValue(he), &arh, sizeof(struct ar_hdr)); } - fseek(arch, (size + 1) & ~1, SEEK_CUR); + if (fseek(arch, (size + 1) & ~1, SEEK_CUR) != 0) + goto badarch; } fclose(arch); @@ -759,8 +761,7 @@ ArchStatMember(char *archive, char *member, Boolean ha badarch: fclose(arch); Hash_DeleteTable(&ar->members); - if (ar->fnametab) - free(ar->fnametab); + free(ar->fnametab); free(ar); return NULL; } @@ -833,7 +834,7 @@ ArchSVR4Entry(Arch *ar, char *name, size_t size, FILE } if (DEBUG(ARCH)) { fprintf(debug_file, "Found svr4 archive name table with %lu entries\n", - (u_long)entry); + (unsigned long)entry); } return 0; } @@ -851,7 +852,7 @@ ArchSVR4Entry(Arch *ar, char *name, size_t size, FILE if (entry >= ar->fnamesize) { if (DEBUG(ARCH)) { fprintf(debug_file, "SVR4 entry offset %s is greater than %lu\n", - name, (u_long)ar->fnamesize); + name, (unsigned long)ar->fnamesize); } return 2; } @@ -957,7 +958,10 @@ ArchFindMember(char *archive, char *member, struct ar_ * the file at the actual member, rather than its header, but * not here... */ - fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR); + if (fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } return (arch); } } else @@ -987,10 +991,17 @@ ArchFindMember(char *archive, char *member, struct ar_ } if (strncmp(ename, member, len) == 0) { /* Found as extended name */ - fseek(arch, -sizeof(struct ar_hdr) - elen, SEEK_CUR); + if (fseek(arch, -sizeof(struct ar_hdr) - elen, + SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } return (arch); } - fseek(arch, -elen, SEEK_CUR); + if (fseek(arch, -elen, SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } goto skip; } else #endif @@ -1003,9 +1014,12 @@ skip: * extract the size of the file from the 'size' field of the * header and round it up during the seek. */ - arhPtr->ar_size[sizeof(arhPtr->AR_SIZE)-1] = '\0'; + arhPtr->AR_SIZE[sizeof(arhPtr->AR_SIZE)-1] = '\0'; size = (int)strtol(arhPtr->AR_SIZE, NULL, 10); - fseek(arch, (size + 1) & ~1, SEEK_CUR); + if (fseek(arch, (size + 1) & ~1, SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } } } @@ -1045,10 +1059,10 @@ Arch_Touch(GNode *gn) arch = ArchFindMember(Var_Value(ARCHIVE, gn, &p1), Var_Value(MEMBER, gn, &p2), &arh, "r+"); - if (p1) - free(p1); - if (p2) - free(p2); + + free(p1); + free(p2); + snprintf(arh.AR_DATE, sizeof(arh.AR_DATE), "%-12ld", (long) now); if (arch != NULL) { @@ -1127,10 +1141,9 @@ Arch_MTime(GNode *gn) arhPtr = ArchStatMember(Var_Value(ARCHIVE, gn, &p1), Var_Value(MEMBER, gn, &p2), TRUE); - if (p1) - free(p1); - if (p2) - free(p2); + + free(p1); + free(p2); if (arhPtr != NULL) { modTime = (time_t)strtol(arhPtr->AR_DATE, NULL, 10); Modified: stable/10/contrib/bmake/bmake.1 ============================================================================== --- stable/10/contrib/bmake/bmake.1 Thu Aug 3 00:38:13 2017 (r321963) +++ stable/10/contrib/bmake/bmake.1 Thu Aug 3 01:40:05 2017 (r321964) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.249 2015/06/05 07:33:40 wiz Exp $ +.\" $NetBSD: make.1,v 1.271 2017/07/03 21:34:20 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,8 +29,8 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd June 4, 2015 -.Dt MAKE 1 +.Dd June 22, 2017 +.Dt BMAKE 1 .Os .Sh NAME .Nm bmake @@ -48,6 +48,7 @@ .Op Fl m Ar directory .Op Fl T Ar file .Op Fl V Ar variable +.Op Fl v Ar variable .Op Ar variable=value .Op Ar target ... .Sh DESCRIPTION @@ -206,7 +207,9 @@ Print debugging information about target list maintena .It Ar V Force the .Fl V -option to print raw values of variables. +option to print raw values of variables, overriding the default behavior +set via +.Va .MAKE.EXPAND_VARIABLES . .It Ar v Print debugging information about variable assignment. .It Ar x @@ -293,7 +296,7 @@ then will search for the specified file or directory named in the remaining part of the argument string. The search starts with the current directory of -the Makefile and then works upward towards the root of the filesystem. +the Makefile and then works upward towards the root of the file system. If the search is successful, then the resulting directory replaces the .Qq \&.../ specification in the @@ -334,20 +337,39 @@ for each job started and completed. Rather than re-building a target as specified in the makefile, create it or update its modification time to make it appear up-to-date. .It Fl V Ar variable -Print -.Nm Ns 's -idea of the value of -.Ar variable , -in the global context. +Print the value of +.Ar variable . Do not build any targets. Multiple instances of this option may be specified; the variables will be printed one per line, with a blank line for each null or undefined variable. +The value printed is extracted from the global context after all +makefiles have been read. +By default, the raw variable contents (which may +include additional unexpanded variable references) are shown. If .Ar variable contains a .Ql \&$ -then the value will be expanded before printing. +then the value will be recursively expanded to its complete resultant +text before printing. +The expanded value will also be printed if +.Va .MAKE.EXPAND_VARIABLES +is set to true and +the +.Fl dV +option has not been used to override it. +Note that loop-local and target-local variables, as well as values +taken temporarily by global variables during makefile processing, are +not accessible via this option. +The +.Fl dv +debug mode can be used to see these at the cost of generating +substantial extraneous output. +.It Fl v Ar variable +Like +.Fl V +but the variable is always expanded to its complete value. .It Fl W Treat any warnings during makefile parsing as errors. .It Fl w @@ -657,7 +679,7 @@ The seven local variables are as follows: .Bl -tag -width ".ARCHIVE" -offset indent .It Va .ALLSRC The list of all sources for this target; also known as -.Ql Va \&\*[Gt] . +.Ql Va \&> . .It Va .ARCHIVE The name of the archive file; also known as .Ql Va \&! . @@ -666,7 +688,7 @@ In suffix-transformation rules, the name/path of the s target is to be transformed (the .Dq implied source); also known as -.Ql Va \&\*[Lt] . +.Ql Va \&< . It is not defined in explicit rules. .It Va .MEMBER The name of the archive member; also known as @@ -685,12 +707,15 @@ or it will not be recognized. .It Va .TARGET The name of the target; also known as .Ql Va @ . +For compatibility with other makes this is an alias for +.Ic .ARCHIVE +in archive member rules. .El .Pp The shorter forms -.Ql ( Va \*[Gt] , +.Ql ( Va > , .Ql Va \&! , -.Ql Va \*[Lt] , +.Ql Va < , .Ql Va % , .Ql Va \&? , .Ql Va * , @@ -773,6 +798,10 @@ from which generated dependencies are read. A boolean that controls the default behavior of the .Fl V option. +If true, variable values printed with +.Fl V +are fully expanded; if false, the raw variable contents (which may +include additional unexpanded variable references) are shown. .It Va .MAKE.EXPORTED The list of variables exported by .Nm . @@ -843,7 +872,7 @@ Can affect the mode that .Nm runs in. It can contain a number of keywords: -.Bl -hang -width ignore-cmd +.Bl -hang -width missing-filemon=bf. .It Pa compat Like .Fl B , @@ -867,8 +896,19 @@ will not create .meta files in This can be overridden by setting .Va bf to a value which represents True. +.It Pa missing-meta= Ar bf +If +.Va bf +is True, then a missing .meta file makes the target out-of-date. +.It Pa missing-filemon= Ar bf +If +.Va bf +is True, then missing filemon data makes the target out-of-date. +.It Pa nofilemon +Do not use +.Xr filemon 4 . .It Pa env -For debugging, it can be useful to inlcude the environment +For debugging, it can be useful to include the environment in the .meta file. .It Pa verbose If in "meta" mode, print a clue about the target being built. @@ -910,6 +950,12 @@ Provides a list of path prefixes that should be ignore because the contents are expected to change over time. The default list includes: .Ql Pa /dev /etc /proc /tmp /var/run /var/tmp +.It Va .MAKE.META.IGNORE_PATTERNS +Provides a list of patterns to match against pathnames. +Ignore any that match. +.It Va .MAKE.META.IGNORE_FILTER +Provides a list of variable modifiers to apply to each pathname. +Ignore if the expansion is an empty string. .It Va .MAKE.META.PREFIX Defines the message printed for each meta file updated in "meta verbose" mode. The default value is: @@ -918,7 +964,7 @@ The default value is: This variable is used to record the names of variables assigned to on the command line, so that they may be exported as part of .Ql Ev MAKEFLAGS . -This behaviour can be disabled by assigning an empty value to +This behavior can be disabled by assigning an empty value to .Ql Va .MAKEOVERRIDES within a makefile. Extra variables can be exported from a makefile @@ -941,10 +987,35 @@ The process-id of .It Va .MAKE.PPID The parent process-id of .Nm . +.It Va .MAKE.SAVE_DOLLARS +value should be a boolean that controls whether +.Ql $$ +are preserved when doing +.Ql := +assignments. +The default is false, for backwards compatibility. +Set to true for compatability with other makes. +If set to false, +.Ql $$ +becomes +.Ql $ +per normal evaluation rules. .It Va MAKE_PRINT_VAR_ON_ERROR When .Nm -stops due to an error, it prints its name and the value of +stops due to an error, it sets +.Ql Va .ERROR_TARGET +to the name of the target that failed, +.Ql Va .ERROR_CMD +to the commands of the failed target, +and in "meta" mode, it also sets +.Ql Va .ERROR_CWD +to the +.Xr getcwd 3 , +and +.Ql Va .ERROR_META_FILE +to the path of the meta file (if any) describing the failed target. +It then prints its name and the value of .Ql Va .CURDIR as well as the value of any variables named in .Ql Va MAKE_PRINT_VAR_ON_ERROR . @@ -1044,7 +1115,7 @@ sets to the value of .Ql Ev PWD instead. -This behaviour is disabled if +This behavior is disabled if .Ql Ev MAKEOBJDIRPREFIX is set or .Ql Ev MAKEOBJDIR @@ -1114,7 +1185,7 @@ The wildcard characters may be escaped with a backslas As a consequence of the way values are split into words, matched, and then joined, a construct like .Dl ${VAR:M*} -will normalise the inter-word spacing, removing all leading and +will normalize the inter-word spacing, removing all leading and trailing space, and converting multiple consecutive spaces to single spaces. . @@ -1134,7 +1205,7 @@ Randomize words in variable. The results will be different each time you are referring to the modified variable; use the assignment with expansion .Pq Ql Cm \&:= -to prevent such behaviour. +to prevent such behavior. For example, .Bd -literal -offset indent LIST= uno due tre quattro @@ -1160,18 +1231,28 @@ safely through recursive invocations of .Nm . .It Cm \&:R Replaces each word in the variable with everything but its suffix. -.It Cm \&:gmtime +.It Cm \&:range[=count] +The value is an integer sequence representing the words of the original +value, or the supplied +.Va count . +.It Cm \&:gmtime[=utc] The value is a format string for .Xr strftime 3 , -using the current +using .Xr gmtime 3 . +If a +.Va utc +value is not provided or is 0, the current time is used. .It Cm \&:hash -Compute a 32bit hash of the value and encode it as hex digits. -.It Cm \&:localtime +Compute a 32-bit hash of the value and encode it as hex digits. +.It Cm \&:localtime[=utc] The value is a format string for .Xr strftime 3 , -using the current +using .Xr localtime 3 . +If a +.Va utc +value is not provided or is 0, the current time is used. .It Cm \&:tA Attempt to convert variable to an absolute path using .Xr realpath 3 , @@ -1232,7 +1313,7 @@ it is anchored at the end of each word. Inside .Ar new_string , an ampersand -.Pq Ql \*[Am] +.Pq Ql & is replaced by .Ar old_string (without any @@ -1371,6 +1452,27 @@ For example. .Pp However a single character variable is often more readable: .Dl ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@} +.It Cm \&:_[=var] +Save the current variable value in +.Ql $_ +or the named +.Va var +for later reference. +Example usage: +.Bd -literal -offset indent +M_cmpv.units = 1 1000 1000000 +M_cmpv = S,., ,g:_:range:@i@+ $${_:[-$$i]} \&\\ +\\* $${M_cmpv.units:[$$i]}@:S,^,expr 0 ,1:sh + +.Dv .if ${VERSION:${M_cmpv}} < ${3.1.12:L:${M_cmpv}} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Thu Aug 3 07:56:40 2017 Return-Path: Delivered-To: svn-src-stable-10@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 618A6DCF576; Thu, 3 Aug 2017 07:56:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C01E6BEC7; Thu, 3 Aug 2017 07:56:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v737udQW002192; Thu, 3 Aug 2017 07:56:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v737udi4002191; Thu, 3 Aug 2017 07:56:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708030756.v737udi4002191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 07:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321981 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/usb/wlan X-SVN-Commit-Revision: 321981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 07:56:40 -0000 Author: hselasky Date: Thu Aug 3 07:56:39 2017 New Revision: 321981 URL: https://svnweb.freebsd.org/changeset/base/321981 Log: MFC r321722: Properly range check length of parsed information elements in RSU driver. Found by: Ilja van Sprundel Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/usb/wlan/if_rsu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rsu.c Thu Aug 3 07:50:46 2017 (r321980) +++ stable/10/sys/dev/usb/wlan/if_rsu.c Thu Aug 3 07:56:39 2017 (r321981) @@ -1126,6 +1126,8 @@ rsu_disconnect(struct rsu_softc *sc) return (rsu_fw_cmd(sc, R92S_CMD_DISCONNECT, &zero, sizeof(zero))); } +CTASSERT(MCLBYTES > sizeof(struct ieee80211_frame)); + static void rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, int len) { @@ -1135,34 +1137,30 @@ rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, i struct ieee80211_channel *c; struct ndis_wlan_bssid_ex *bss; struct mbuf *m; - int pktlen; + uint32_t ieslen; + uint32_t pktlen; if (__predict_false(len < sizeof(*bss))) return; bss = (struct ndis_wlan_bssid_ex *)buf; - if (__predict_false(len < sizeof(*bss) + le32toh(bss->ieslen))) + ieslen = le32toh(bss->ieslen); + /* range check length of information element */ + if (__predict_false(ieslen > (uint32_t)(len - sizeof(*bss)))) return; DPRINTFN(2, "found BSS %s: len=%d chan=%d inframode=%d " "networktype=%d privacy=%d\n", - ether_sprintf(bss->macaddr), le32toh(bss->len), + ether_sprintf(bss->macaddr), ieslen, le32toh(bss->config.dsconfig), le32toh(bss->inframode), le32toh(bss->networktype), le32toh(bss->privacy)); /* Build a fake beacon frame to let net80211 do all the parsing. */ - pktlen = sizeof(*wh) + le32toh(bss->ieslen); - if (__predict_false(pktlen > MCLBYTES)) + if (__predict_false(ieslen > (size_t)(MCLBYTES - sizeof(*wh)))) return; - MGETHDR(m, M_NOWAIT, MT_DATA); + pktlen = sizeof(*wh) + ieslen; + m = m_get2(pktlen, M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) return; - if (pktlen > MHLEN) { - MCLGET(m, M_NOWAIT); - if (!(m->m_flags & M_EXT)) { - m_free(m); - return; - } - } wh = mtod(m, struct ieee80211_frame *); wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_BEACON; @@ -1172,7 +1170,7 @@ rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, i IEEE80211_ADDR_COPY(wh->i_addr2, bss->macaddr); IEEE80211_ADDR_COPY(wh->i_addr3, bss->macaddr); *(uint16_t *)wh->i_seq = 0; - memcpy(&wh[1], (uint8_t *)&bss[1], le32toh(bss->ieslen)); + memcpy(&wh[1], (uint8_t *)&bss[1], ieslen); /* Finalize mbuf. */ m->m_pkthdr.len = m->m_len = pktlen; @@ -2123,13 +2121,15 @@ rsu_fw_loadsection(struct rsu_softc *sc, const uint8_t return (0); } +CTASSERT(sizeof(size_t) >= sizeof(uint32_t)); + static int rsu_load_firmware(struct rsu_softc *sc) { const struct r92s_fw_hdr *hdr; struct r92s_fw_priv *dmem; const uint8_t *imem, *emem; - int imemsz, ememsz; + uint32_t imemsz, ememsz; const struct firmware *fw; size_t size; uint32_t reg; @@ -2178,7 +2178,8 @@ rsu_load_firmware(struct rsu_softc *sc) imemsz = le32toh(hdr->imemsz); ememsz = le32toh(hdr->sramsz); /* Check that all FW sections fit in image. */ - if (size < sizeof(*hdr) + imemsz + ememsz) { + if (imemsz > (size_t)(size - sizeof(*hdr)) || + ememsz > (size_t)(size - sizeof(*hdr) - imemsz)) { device_printf(sc->sc_dev, "firmware too short\n"); error = EINVAL; goto fail; From owner-svn-src-stable-10@freebsd.org Thu Aug 3 13:52:41 2017 Return-Path: Delivered-To: svn-src-stable-10@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 B65E7DBDF7E; Thu, 3 Aug 2017 13:52:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59AEC7CDD8; Thu, 3 Aug 2017 13:52:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73DqebI049673; Thu, 3 Aug 2017 13:52:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73DqeFB049672; Thu, 3 Aug 2017 13:52:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031352.v73DqeFB049672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 13:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321993 - stable/10/sys/dev/mlx5 X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5 X-SVN-Commit-Revision: 321993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 13:52:41 -0000 Author: hselasky Date: Thu Aug 3 13:52:39 2017 New Revision: 321993 URL: https://svnweb.freebsd.org/changeset/base/321993 Log: MFC r312526: Update firmware interface structures and definitions adding support for new features and commands. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_ifc.h Thu Aug 3 13:51:18 2017 (r321992) +++ stable/10/sys/dev/mlx5/mlx5_ifc.h Thu Aug 3 13:52:39 2017 (r321993) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,13 +23,8 @@ * SUCH DAMAGE. * * $FreeBSD$ + */ - Autogenerated file. - Date: 2015-04-13 14:59 - Source Document Name: Mellanox - Source Document Version: 0.28 - Generated by adb_to_c.py (EAT.ME Version: 1.0.70) -*/ #ifndef MLX5_IFC_H #define MLX5_IFC_H @@ -56,6 +51,8 @@ enum { MLX5_EVENT_TYPE_CODING_TEMP_WARNING_EVENT = 0x17, MLX5_EVENT_TYPE_REMOTE_CONFIG = 0x19, MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT = 0x1e, + MLX5_EVENT_TYPE_CODING_PPS_EVENT = 0x25, + MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT = 0x22, MLX5_EVENT_TYPE_DB_BF_CONGESTION = 0x1a, MLX5_EVENT_TYPE_STALL_EVENT = 0x1b, MLX5_EVENT_TYPE_DROPPED_PACKET_LOGGED_EVENT = 0x1f, @@ -89,6 +86,8 @@ enum { MLX5_CMD_OP_QUERY_ISSI = 0x10a, MLX5_CMD_OP_SET_ISSI = 0x10b, MLX5_CMD_OP_SET_DRIVER_VERSION = 0x10d, + MLX5_CMD_OP_QUERY_OTHER_HCA_CAP = 0x10e, + MLX5_CMD_OP_MODIFY_OTHER_HCA_CAP = 0x10f, MLX5_CMD_OP_CREATE_MKEY = 0x200, MLX5_CMD_OP_QUERY_MKEY = 0x201, MLX5_CMD_OP_DESTROY_MKEY = 0x202, @@ -190,6 +189,12 @@ enum { MLX5_CMD_OP_DELETE_L2_TABLE_ENTRY = 0x82b, MLX5_CMD_OP_SET_WOL_ROL = 0x830, MLX5_CMD_OP_QUERY_WOL_ROL = 0x831, + MLX5_CMD_OP_CREATE_LAG = 0x840, + MLX5_CMD_OP_MODIFY_LAG = 0x841, + MLX5_CMD_OP_QUERY_LAG = 0x842, + MLX5_CMD_OP_DESTROY_LAG = 0x843, + MLX5_CMD_OP_CREATE_VPORT_LAG = 0x844, + MLX5_CMD_OP_DESTROY_VPORT_LAG = 0x845, MLX5_CMD_OP_CREATE_TIR = 0x900, MLX5_CMD_OP_MODIFY_TIR = 0x901, MLX5_CMD_OP_DESTROY_TIR = 0x902, @@ -206,6 +211,8 @@ enum { MLX5_CMD_OP_MODIFY_RMP = 0x90d, MLX5_CMD_OP_DESTROY_RMP = 0x90e, MLX5_CMD_OP_QUERY_RMP = 0x90f, + MLX5_CMD_OP_SET_DELAY_DROP_PARAMS = 0x910, + MLX5_CMD_OP_QUERY_DELAY_DROP_PARAMS = 0x911, MLX5_CMD_OP_CREATE_TIS = 0x912, MLX5_CMD_OP_MODIFY_TIS = 0x913, MLX5_CMD_OP_DESTROY_TIS = 0x914, @@ -226,7 +233,10 @@ enum { MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY = 0x938, MLX5_CMD_OP_ALLOC_FLOW_COUNTER = 0x939, MLX5_CMD_OP_DEALLOC_FLOW_COUNTER = 0x93a, - MLX5_CMD_OP_QUERY_FLOW_COUNTER = 0x93b + MLX5_CMD_OP_QUERY_FLOW_COUNTER = 0x93b, + MLX5_CMD_OP_MODIFY_FLOW_TABLE = 0x93c, + MLX5_CMD_OP_ALLOC_ENCAP_HEADER = 0x93d, + MLX5_CMD_OP_DEALLOC_ENCAP_HEADER = 0x93e, }; enum { @@ -271,7 +281,11 @@ struct mlx5_ifc_flow_table_fields_supported_bits { u8 outer_gre_protocol[0x1]; u8 outer_gre_key[0x1]; u8 outer_vxlan_vni[0x1]; - u8 reserved_2[0x5]; + u8 outer_geneve_vni[0x1]; + u8 outer_geneve_oam[0x1]; + u8 outer_geneve_protocol_type[0x1]; + u8 outer_geneve_opt_len[0x1]; + u8 reserved_2[0x1]; u8 source_eswitch_port[0x1]; u8 inner_dmac[0x1]; @@ -299,10 +313,12 @@ struct mlx5_ifc_flow_table_fields_supported_bits { u8 inner_tcp_flags[0x1]; u8 reserved_5[0x9]; - u8 reserved_6[0x1f]; + u8 reserved_6[0x1a]; + u8 bth_dst_qp[0x1]; + u8 reserved_7[0x4]; u8 source_sqn[0x1]; - u8 reserved_7[0x20]; + u8 reserved_8[0x20]; }; struct mlx5_ifc_eth_discard_cntrs_grp_bits { @@ -356,7 +372,11 @@ struct mlx5_ifc_eth_discard_cntrs_grp_bits { u8 egress_stp_filter_low[0x20]; - u8 reserved_at_340[0x480]; + u8 egress_hoq_stall_high[0x20]; + + u8 egress_hoq_stall_low[0x20]; + + u8 reserved_at_340[0x440]; }; struct mlx5_ifc_flow_table_prop_layout_bits { u8 ft_support[0x1]; @@ -411,6 +431,7 @@ enum { MLX5_FLOW_CONTEXT_DEST_TYPE_VPORT = 0x0, MLX5_FLOW_CONTEXT_DEST_TYPE_FLOW_TABLE = 0x1, MLX5_FLOW_CONTEXT_DEST_TYPE_TIR = 0x2, + MLX5_FLOW_CONTEXT_DEST_TYPE_QP = 0x3, }; struct mlx5_ifc_dest_format_struct_bits { @@ -490,9 +511,14 @@ struct mlx5_ifc_fte_match_set_misc_bits { u8 reserved_6[0xc]; u8 inner_ipv6_flow_label[0x14]; - u8 reserved7[0x10]; + u8 reserved_7[0xa]; + u8 geneve_opt_len[0x6]; u8 geneve_protocol_type[0x10]; - u8 reserved8[0xc0]; + + u8 reserved_8[0x8]; + u8 bth_dst_qp[0x18]; + + u8 reserved_9[0xa0]; }; struct mlx5_ifc_cmd_pas_bits { @@ -698,7 +724,8 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_b u8 lro_psh_flag[0x1]; u8 lro_time_stamp[0x1]; u8 lro_max_msg_sz_mode[0x2]; - u8 reserved_0[0x2]; + u8 wqe_vlan_insert[0x1]; + u8 self_lb_en_modifiable[0x1]; u8 self_lb_mc[0x1]; u8 self_lb_uc[0x1]; u8 max_lso_cap[0x5]; @@ -715,7 +742,8 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_b u8 swp[0x1]; u8 swp_csum[0x1]; u8 swp_lso[0x1]; - u8 reserved_2[0x1c]; + u8 reserved_2[0x1b]; + u8 max_geneve_opt_len[0x1]; u8 tunnel_stateless_geneve_rx[0x1]; u8 reserved_3[0x10]; @@ -910,7 +938,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 vport_counters[0x1]; u8 retransmission_q_counters[0x1]; u8 debug[0x1]; - u8 reserved_16[0x2]; + u8 modify_rq_counters_set_id[0x1]; + u8 rq_delay_drop[0x1]; u8 max_qp_cnt[0xa]; u8 pkey_table_size[0x10]; @@ -980,7 +1009,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 cq_oi[0x1]; u8 cq_resize[0x1]; u8 cq_moderation[0x1]; - u8 reserved_31[0x3]; + u8 cq_period_mode_modify[0x1]; + u8 cq_invalidate[0x1]; + u8 reserved_at_225[0x1]; u8 cq_eq_remap[0x1]; u8 pg[0x1]; u8 block_lb_mc[0x1]; @@ -1068,7 +1099,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 log_max_wq_sz[0x5]; u8 nic_vport_change_event[0x1]; - u8 reserved_59[0xa]; + u8 disable_local_lb[0x1]; + u8 reserved_59[0x9]; u8 log_max_vlan_list[0x5]; u8 reserved_60[0x3]; u8 log_max_current_mc_list[0x5]; @@ -1312,6 +1344,8 @@ enum { MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_CQ_MAX_COUNT = 0x2, MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_OI = 0x4, MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_C_EQN = 0x8, + MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_CQ_PERIOD_MODE = 0x10, + MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_STATUS = 0x20, }; struct mlx5_ifc_modify_field_select_bits { @@ -2239,9 +2273,15 @@ enum { MLX5_RQC_STATE_ERR = 0x3, }; +enum { + MLX5_RQC_DROPLESS_MODE_DISABLE = 0x0, + MLX5_RQC_DROPLESS_MODE_ENABLE = 0x1, +}; + struct mlx5_ifc_rqc_bits { - u8 rlky[0x1]; - u8 reserved_0[0x2]; + u8 rlkey[0x1]; + u8 delay_drop_en[0x1]; + u8 scatter_fcs[0x1]; u8 vlan_strip_disable[0x1]; u8 mem_rq_type[0x4]; u8 state[0x4]; @@ -2293,7 +2333,9 @@ enum { struct mlx5_ifc_nic_vport_context_bits { u8 reserved_0[0x5]; u8 min_wqe_inline_mode[0x3]; - u8 reserved_1[0x17]; + u8 reserved_1[0x15]; + u8 disable_mc_local_lb[0x1]; + u8 disable_uc_local_lb[0x1]; u8 roce_en[0x1]; u8 arm_change_event[0x1]; @@ -3075,6 +3117,50 @@ struct mlx5_ifc_teardown_hca_in_bits { u8 reserved_3[0x20]; }; +struct mlx5_ifc_set_delay_drop_params_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x40]; +}; + +struct mlx5_ifc_set_delay_drop_params_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x20]; + + u8 reserved_at_60[0x10]; + u8 delay_drop_timeout[0x10]; +}; + +struct mlx5_ifc_query_delay_drop_params_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x20]; + + u8 reserved_at_60[0x10]; + u8 delay_drop_timeout[0x10]; +}; + +struct mlx5_ifc_query_delay_drop_params_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x40]; +}; + struct mlx5_ifc_suspend_qp_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -4076,31 +4162,39 @@ struct mlx5_ifc_query_q_counter_out_bits { u8 out_of_buffer[0x20]; - u8 reserved_7[0x20]; + u8 reserved_7[0x20]; u8 out_of_sequence[0x20]; - u8 reserved_8[0x20]; + u8 reserved_8[0x20]; - u8 duplicate_request[0x20]; + u8 duplicate_request[0x20]; - u8 reserved_9[0x20]; + u8 reserved_9[0x20]; - u8 rnr_nak_retry_err[0x20]; + u8 rnr_nak_retry_err[0x20]; - u8 reserved_10[0x20]; + u8 reserved_10[0x20]; - u8 packet_seq_err[0x20]; + u8 packet_seq_err[0x20]; - u8 reserved_11[0x20]; + u8 reserved_11[0x20]; - u8 implied_nak_seq_err[0x20]; + u8 implied_nak_seq_err[0x20]; - u8 reserved_12[0x20]; + u8 reserved_12[0x20]; - u8 local_ack_timeout_err[0x20]; + u8 local_ack_timeout_err[0x20]; - u8 reserved_13[0x4e0]; + u8 reserved_13[0x20]; + + u8 resp_rnr_nak[0x20]; + + u8 reserved_14[0x20]; + + u8 req_rnr_retries_exceeded[0x20]; + + u8 reserved_15[0x460]; }; struct mlx5_ifc_query_q_counter_in_bits { @@ -5204,7 +5298,9 @@ struct mlx5_ifc_modify_nic_vport_context_out_bits { }; struct mlx5_ifc_modify_nic_vport_field_select_bits { - u8 reserved_0[0x16]; + u8 reserved_0[0x14]; + u8 disable_uc_local_lb[0x1]; + u8 disable_mc_local_lb[0x1]; u8 node_guid[0x1]; u8 port_guid[0x1]; u8 min_wqe_inline_mode[0x1]; @@ -7958,6 +8054,42 @@ struct mlx5_ifc_phys_layer_cntrs_bits { u8 reserved_0[0x180]; }; +struct mlx5_ifc_phys_layer_statistical_cntrs_bits { + u8 time_since_last_clear_high[0x20]; + + u8 time_since_last_clear_low[0x20]; + + u8 phy_received_bits_high[0x20]; + + u8 phy_received_bits_low[0x20]; + + u8 phy_symbol_errors_high[0x20]; + + u8 phy_symbol_errors_low[0x20]; + + u8 phy_corrected_bits_high[0x20]; + + u8 phy_corrected_bits_low[0x20]; + + u8 phy_corrected_bits_lane0_high[0x20]; + + u8 phy_corrected_bits_lane0_low[0x20]; + + u8 phy_corrected_bits_lane1_high[0x20]; + + u8 phy_corrected_bits_lane1_low[0x20]; + + u8 phy_corrected_bits_lane2_high[0x20]; + + u8 phy_corrected_bits_lane2_low[0x20]; + + u8 phy_corrected_bits_lane3_high[0x20]; + + u8 phy_corrected_bits_lane3_low[0x20]; + + u8 reserved_at_200[0x5c0]; +}; + struct mlx5_ifc_infiniband_port_cntrs_bits { u8 symbol_error_counter[0x10]; u8 link_error_recovery_counter[0x8]; @@ -9187,6 +9319,7 @@ union mlx5_ifc_eth_cntrs_grp_data_layout_auto_bits { struct mlx5_ifc_eth_discard_cntrs_grp_bits eth_discard_cntrs_grp; struct mlx5_ifc_eth_per_prio_grp_data_layout_bits eth_per_prio_grp_data_layout; struct mlx5_ifc_phys_layer_cntrs_bits phys_layer_cntrs; + struct mlx5_ifc_phys_layer_statistical_cntrs_bits phys_layer_statistical_cntrs; struct mlx5_ifc_infiniband_port_cntrs_bits infiniband_port_cntrs; u8 reserved_0[0x7c0]; }; From owner-svn-src-stable-10@freebsd.org Thu Aug 3 13:57:19 2017 Return-Path: Delivered-To: svn-src-stable-10@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 5A48BDBE319; Thu, 3 Aug 2017 13:57:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3681F7D1D0; Thu, 3 Aug 2017 13:57:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73DvIna050100; Thu, 3 Aug 2017 13:57:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73DvI1S050096; Thu, 3 Aug 2017 13:57:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031357.v73DvI1S050096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 13:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321996 - in stable/10/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Commit-Revision: 321996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 13:57:19 -0000 Author: hselasky Date: Thu Aug 3 13:57:17 2017 New Revision: 321996 URL: https://svnweb.freebsd.org/changeset/base/321996 Log: MFC r312527: Add runtime support for modifying the SQ and RQ completion event moderation mode. The presence of this feature is indicated through the firmware capabilities. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/cq.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/cq.h ============================================================================== --- stable/10/sys/dev/mlx5/cq.h Thu Aug 3 13:55:39 2017 (r321995) +++ stable/10/sys/dev/mlx5/cq.h Thu Aug 3 13:57:17 2017 (r321996) @@ -88,6 +88,7 @@ enum { MLX5_CQ_MODIFY_PERIOD = 1 << 0, MLX5_CQ_MODIFY_COUNT = 1 << 1, MLX5_CQ_MODIFY_OVERRUN = 1 << 2, + MLX5_CQ_MODIFY_PERIOD_MODE = 1 << 4, }; enum { @@ -165,6 +166,11 @@ int mlx5_core_modify_cq(struct mlx5_core_dev *dev, str int mlx5_core_modify_cq_moderation(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, u16 cq_period, u16 cq_max_count); +int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev, + struct mlx5_core_cq *cq, + u16 cq_period, + u16 cq_max_count, + u8 cq_mode); int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c Thu Aug 3 13:55:39 2017 (r321995) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c Thu Aug 3 13:57:17 2017 (r321996) @@ -266,6 +266,28 @@ int mlx5_core_modify_cq_moderation(struct mlx5_core_de return mlx5_core_modify_cq(dev, cq, &in, sizeof(in)); } +int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev, + struct mlx5_core_cq *cq, + u16 cq_period, + u16 cq_max_count, + u8 cq_mode) +{ + struct mlx5_modify_cq_mbox_in in; + + memset(&in, 0, sizeof(in)); + + in.cqn = cpu_to_be32(cq->cqn); + in.ctx.cq_period = cpu_to_be16(cq_period); + in.ctx.cq_max_count = cpu_to_be16(cq_max_count); + in.ctx.cqe_sz_flags = (cq_mode & 2) >> 1; + in.ctx.st = (cq_mode & 1) << 7; + in.field_select = cpu_to_be32(MLX5_CQ_MODIFY_PERIOD | + MLX5_CQ_MODIFY_COUNT | + MLX5_CQ_MODIFY_PERIOD_MODE); + + return mlx5_core_modify_cq(dev, cq, &in, sizeof(in)); +} + int mlx5_init_cq_table(struct mlx5_core_dev *dev) { struct mlx5_cq_table *table = &dev->priv.cq_table; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 13:55:39 2017 (r321995) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 13:57:17 2017 (r321996) @@ -92,6 +92,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) { struct mlx5e_priv *priv = arg1; uint64_t value; + int mode_modify; int was_opened; int error; @@ -114,6 +115,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) goto done; } was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state); + mode_modify = MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify); switch (MLX5_PARAM_OFFSET(arg[arg2])) { case MLX5_PARAM_OFFSET(rx_coalesce_usecs): @@ -266,7 +268,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) case MLX5_PARAM_OFFSET(rx_coalesce_mode): /* network interface must be down */ - if (was_opened) + if (was_opened != 0 && mode_modify == 0) mlx5e_close_locked(priv->ifp); /* import RX coalesce mode */ @@ -276,13 +278,17 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) priv->params_ethtool.rx_coalesce_mode; /* restart network interface, if any */ - if (was_opened) - mlx5e_open_locked(priv->ifp); + if (was_opened != 0) { + if (mode_modify == 0) + mlx5e_open_locked(priv->ifp); + else + error = mlx5e_refresh_channel_params(priv); + } break; case MLX5_PARAM_OFFSET(tx_coalesce_mode): /* network interface must be down */ - if (was_opened) + if (was_opened != 0 && mode_modify == 0) mlx5e_close_locked(priv->ifp); /* import TX coalesce mode */ @@ -292,8 +298,12 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) priv->params_ethtool.tx_coalesce_mode; /* restart network interface, if any */ - if (was_opened) - mlx5e_open_locked(priv->ifp); + if (was_opened != 0) { + if (mode_modify == 0) + mlx5e_open_locked(priv->ifp); + else + error = mlx5e_refresh_channel_params(priv); + } break; case MLX5_PARAM_OFFSET(hw_lro): Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 13:55:39 2017 (r321995) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 13:57:17 2017 (r321996) @@ -1787,6 +1787,25 @@ mlx5e_close_channels(struct mlx5e_priv *priv) static int mlx5e_refresh_sq_params(struct mlx5e_priv *priv, struct mlx5e_sq *sq) { + + if (MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify)) { + uint8_t cq_mode; + + switch (priv->params.tx_cq_moderation_mode) { + case 0: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + default: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; + break; + } + + return (mlx5_core_modify_cq_moderation_mode(priv->mdev, &sq->cq.mcq, + priv->params.tx_cq_moderation_usec, + priv->params.tx_cq_moderation_pkts, + cq_mode)); + } + return (mlx5_core_modify_cq_moderation(priv->mdev, &sq->cq.mcq, priv->params.tx_cq_moderation_usec, priv->params.tx_cq_moderation_pkts)); @@ -1795,6 +1814,28 @@ mlx5e_refresh_sq_params(struct mlx5e_priv *priv, struc static int mlx5e_refresh_rq_params(struct mlx5e_priv *priv, struct mlx5e_rq *rq) { + + if (MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify)) { + uint8_t cq_mode; + int retval; + + switch (priv->params.rx_cq_moderation_mode) { + case 0: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + default: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; + break; + } + + retval = mlx5_core_modify_cq_moderation_mode(priv->mdev, &rq->cq.mcq, + priv->params.rx_cq_moderation_usec, + priv->params.rx_cq_moderation_pkts, + cq_mode); + + return (retval); + } + return (mlx5_core_modify_cq_moderation(priv->mdev, &rq->cq.mcq, priv->params.rx_cq_moderation_usec, priv->params.rx_cq_moderation_pkts)); From owner-svn-src-stable-10@freebsd.org Thu Aug 3 14:01:26 2017 Return-Path: Delivered-To: svn-src-stable-10@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 A260FDBE64E; Thu, 3 Aug 2017 14:01:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6452F7D6A4; Thu, 3 Aug 2017 14:01:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73E1Po0054198; Thu, 3 Aug 2017 14:01:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73E1PYJ054195; Thu, 3 Aug 2017 14:01:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031401.v73E1PYJ054195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321998 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 321998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 14:01:26 -0000 Author: hselasky Date: Thu Aug 3 14:01:25 2017 New Revision: 321998 URL: https://svnweb.freebsd.org/changeset/base/321998 Log: MFC r312528: Make draining a sendqueue more robust. Add own state variable to track if a sendqueue is stopped or not. This will prevent traffic from entering the sendqueue while it is being destroyed. Update drain function to wait for traffic to be transmitted before returning when the link state is active. Add extra checks in transmit path for stopped SQ's. While at it: - Use likely() for a mbuf pointer check. - Remove redundant IFF_DRV_RUNNING check. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:00:26 2017 (r321997) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:01:25 2017 (r321998) @@ -517,10 +517,11 @@ struct mlx5e_sq { u16 bf_offset; u16 cev_counter; /* completion event counter */ u16 cev_factor; /* completion event factor */ - u32 cev_next_state; /* next completion event state */ + u16 cev_next_state; /* next completion event state */ #define MLX5E_CEV_STATE_INITIAL 0 /* timer not started */ #define MLX5E_CEV_STATE_SEND_NOPS 1 /* send NOPs */ #define MLX5E_CEV_STATE_HOLD_NOPS 2 /* don't send NOPs yet */ + u16 stopped; /* set if SQ is stopped */ struct callout cev_callout; union { u32 d32[2]; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:00:26 2017 (r321997) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:01:25 2017 (r321998) @@ -1240,8 +1240,25 @@ mlx5e_sq_cev_timeout(void *arg) void mlx5e_drain_sq(struct mlx5e_sq *sq) { + int error; + /* + * Check if already stopped. + * + * NOTE: The "stopped" variable is only written when both the + * priv's configuration lock and the SQ's lock is locked. It + * can therefore safely be read when only one of the two locks + * is locked. This function is always called when the priv's + * configuration lock is locked. + */ + if (sq->stopped != 0) + return; + mtx_lock(&sq->lock); + + /* don't put more packets into the SQ */ + sq->stopped = 1; + /* teardown event factor timer, if any */ sq->cev_next_state = MLX5E_CEV_STATE_HOLD_NOPS; callout_stop(&sq->cev_callout); @@ -1253,14 +1270,29 @@ mlx5e_drain_sq(struct mlx5e_sq *sq) /* make sure it is safe to free the callout */ callout_drain(&sq->cev_callout); + /* wait till SQ is empty or link is down */ + mtx_lock(&sq->lock); + while (sq->cc != sq->pc && + (sq->priv->media_status_last & IFM_ACTIVE) != 0) { + mtx_unlock(&sq->lock); + msleep(1); + sq->cq.mcq.comp(&sq->cq.mcq); + mtx_lock(&sq->lock); + } + mtx_unlock(&sq->lock); + /* error out remaining requests */ - mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR); + error = mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR); + if (error != 0) { + if_printf(sq->ifp, + "mlx5e_modify_sq() from RDY to ERR failed: %d\n", error); + } /* wait till SQ is empty */ mtx_lock(&sq->lock); while (sq->cc != sq->pc) { mtx_unlock(&sq->lock); - msleep(4); + msleep(1); sq->cq.mcq.comp(&sq->cq.mcq); mtx_lock(&sq->lock); } Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 14:00:26 2017 (r321997) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 14:01:25 2017 (r321998) @@ -81,11 +81,15 @@ static struct mlx5e_sq * mlx5e_select_queue(struct ifnet *ifp, struct mbuf *mb) { struct mlx5e_priv *priv = ifp->if_softc; + struct mlx5e_channel * volatile *ppch; + struct mlx5e_channel *pch; u32 ch; u32 tc; + ppch = priv->channel; + /* check if channels are successfully opened */ - if (unlikely(priv->channel == NULL)) + if (unlikely(ppch == NULL)) return (NULL); /* obtain VLAN information if present */ @@ -123,11 +127,11 @@ mlx5e_select_queue(struct ifnet *ifp, struct mbuf *mb) #endif } - /* check if channel is allocated */ - if (unlikely(priv->channel[ch] == NULL)) - return (NULL); - - return (&priv->channel[ch]->sq[tc]); + /* check if channel is allocated and not stopped */ + pch = ppch[ch]; + if (likely(pch != NULL && pch->sq[tc].stopped == 0)) + return (&pch->sq[tc]); + return (NULL); } static inline u16 @@ -445,19 +449,22 @@ mlx5e_xmit_locked(struct ifnet *ifp, struct mlx5e_sq * struct mbuf *next; int err = 0; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - if (mb) - err = drbr_enqueue(ifp, sq->br, mb); - return (err); - } - - if (mb != NULL) + if (likely(mb != NULL)) { /* * If we can't insert mbuf into drbr, try to xmit anyway. * We keep the error we got so we could return that after xmit. */ err = drbr_enqueue(ifp, sq->br, mb); + } + /* + * Check if the network interface is closed or if the SQ is + * being stopped: + */ + if (unlikely((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + sq->stopped != 0)) + return (err); + /* Process the queue */ while ((next = drbr_peek(ifp, sq->br)) != NULL) { if (mlx5e_sq_xmit(sq, &next) != 0) { @@ -470,8 +477,6 @@ mlx5e_xmit_locked(struct ifnet *ifp, struct mlx5e_sq * break; } drbr_advance(ifp, sq->br); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) - break; } /* Check if we need to write the doorbell */ if (likely(sq->doorbell.d64 != 0)) { From owner-svn-src-stable-10@freebsd.org Thu Aug 3 14:05:05 2017 Return-Path: Delivered-To: svn-src-stable-10@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 08950DBEB72; Thu, 3 Aug 2017 14:05:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D36D77DB30; Thu, 3 Aug 2017 14:05:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73E53DV054477; Thu, 3 Aug 2017 14:05:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73E534G054473; Thu, 3 Aug 2017 14:05:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031405.v73E534G054473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322000 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 322000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 14:05:05 -0000 Author: hselasky Date: Thu Aug 3 14:05:03 2017 New Revision: 322000 URL: https://svnweb.freebsd.org/changeset/base/322000 Log: MFC r312536: Allow transmit packet bufring in software to be disabled. - Add new sysctl node to control the transmit packet bufring. - Add optimised version of the transmit routine which output packets directly to the DMA ring instead of using bufring in case the transmit lock is congested. This can reduce the number of taskswitches which in turn influence the overall system CPU usage, depending on the workload. - Add " TX" suffix to debug name for transmit mutexes to silence some witness warnings about aquiring duplicate locks having same name. Sponsored by: Mellanox Technologies Suggested by: gallatin @ Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:03:48 2017 (r321999) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:05:03 2017 (r322000) @@ -408,6 +408,7 @@ struct mlx5e_params { m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ + m(+1, u64 tx_bufring_disable, "tx_bufring_disable", "0: Enable bufring 1: Disable bufring") \ m(+1, u64 tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \ m(+1, u64 tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 14:03:48 2017 (r321999) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 14:05:03 2017 (r322000) @@ -352,6 +352,18 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) mlx5e_open_locked(priv->ifp); break; + case MLX5_PARAM_OFFSET(tx_bufring_disable): + /* rangecheck input value */ + priv->params_ethtool.tx_bufring_disable = + priv->params_ethtool.tx_bufring_disable ? 1 : 0; + + /* reconfigure the sendqueues, if any */ + if (was_opened) { + mlx5e_close_locked(priv->ifp); + mlx5e_open_locked(priv->ifp); + } + break; + case MLX5_PARAM_OFFSET(tx_completion_fact): /* network interface must be down */ if (was_opened) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:03:48 2017 (r321999) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:05:03 2017 (r322000) @@ -439,7 +439,8 @@ mlx5e_update_stats_work(struct work_struct *work) tso_packets += sq_stats->tso_packets; tso_bytes += sq_stats->tso_bytes; tx_queue_dropped += sq_stats->dropped; - tx_queue_dropped += sq_br->br_drops; + if (sq_br != NULL) + tx_queue_dropped += sq_br->br_drops; tx_defragged += sq_stats->defragged; tx_offload_none += sq_stats->csum_offload_none; } @@ -1008,34 +1009,37 @@ mlx5e_create_sq(struct mlx5e_channel *c, sq->priv = priv; sq->tc = tc; - sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN, - M_WAITOK, &sq->lock); - if (sq->br == NULL) { - if_printf(c->ifp, "%s: Failed allocating sq drbr buffer\n", - __func__); - err = -ENOMEM; - goto err_free_sq_db; - } + /* check if we should allocate a second packet buffer */ + if (priv->params_ethtool.tx_bufring_disable == 0) { + sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN, + M_WAITOK, &sq->lock); + if (sq->br == NULL) { + if_printf(c->ifp, "%s: Failed allocating sq drbr buffer\n", + __func__); + err = -ENOMEM; + goto err_free_sq_db; + } - sq->sq_tq = taskqueue_create_fast("mlx5e_que", M_WAITOK, - taskqueue_thread_enqueue, &sq->sq_tq); - if (sq->sq_tq == NULL) { - if_printf(c->ifp, "%s: Failed allocating taskqueue\n", - __func__); - err = -ENOMEM; - goto err_free_drbr; - } + sq->sq_tq = taskqueue_create_fast("mlx5e_que", M_WAITOK, + taskqueue_thread_enqueue, &sq->sq_tq); + if (sq->sq_tq == NULL) { + if_printf(c->ifp, "%s: Failed allocating taskqueue\n", + __func__); + err = -ENOMEM; + goto err_free_drbr; + } - TASK_INIT(&sq->sq_task, 0, mlx5e_tx_que, sq); + TASK_INIT(&sq->sq_task, 0, mlx5e_tx_que, sq); #ifdef RSS - cpu_id = rss_getcpu(c->ix % rss_getnumbuckets()); - CPU_SETOF(cpu_id, &cpu_mask); - taskqueue_start_threads_cpuset(&sq->sq_tq, 1, PI_NET, &cpu_mask, - "%s TX SQ%d.%d CPU%d", c->ifp->if_xname, c->ix, tc, cpu_id); + cpu_id = rss_getcpu(c->ix % rss_getnumbuckets()); + CPU_SETOF(cpu_id, &cpu_mask); + taskqueue_start_threads_cpuset(&sq->sq_tq, 1, PI_NET, &cpu_mask, + "%s TX SQ%d.%d CPU%d", c->ifp->if_xname, c->ix, tc, cpu_id); #else - taskqueue_start_threads(&sq->sq_tq, 1, PI_NET, - "%s TX SQ%d.%d", c->ifp->if_xname, c->ix, tc); + taskqueue_start_threads(&sq->sq_tq, 1, PI_NET, + "%s TX SQ%d.%d", c->ifp->if_xname, c->ix, tc); #endif + } snprintf(buffer, sizeof(buffer), "txstat%dtc%d", c->ix, tc); mlx5e_create_stats(&sq->stats.ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), buffer, mlx5e_sq_stats_desc, MLX5E_SQ_STATS_NUM, @@ -1068,9 +1072,12 @@ mlx5e_destroy_sq(struct mlx5e_sq *sq) mlx5e_free_sq_db(sq); mlx5_wq_destroy(&sq->wq_ctrl); mlx5_unmap_free_uar(sq->priv->mdev, &sq->uar); - taskqueue_drain(sq->sq_tq, &sq->sq_task); - taskqueue_free(sq->sq_tq); - buf_ring_free(sq->br, M_MLX5EN); + if (sq->sq_tq != NULL) { + taskqueue_drain(sq->sq_tq, &sq->sq_task); + taskqueue_free(sq->sq_tq); + } + if (sq->br != NULL) + buf_ring_free(sq->br, M_MLX5EN); } int @@ -1518,9 +1525,10 @@ mlx5e_chan_mtx_init(struct mlx5e_channel *c) for (tc = 0; tc < c->num_tc; tc++) { struct mlx5e_sq *sq = c->sq + tc; - mtx_init(&sq->lock, "mlx5tx", MTX_NETWORK_LOCK, MTX_DEF); - mtx_init(&sq->comp_lock, "mlx5comp", MTX_NETWORK_LOCK, - MTX_DEF); + mtx_init(&sq->lock, "mlx5tx", + MTX_NETWORK_LOCK " TX", MTX_DEF); + mtx_init(&sq->comp_lock, "mlx5comp", + MTX_NETWORK_LOCK " TX", MTX_DEF); callout_init_mtx(&sq->cev_callout, &sq->lock, 0); Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 14:03:48 2017 (r321999) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 14:05:03 2017 (r322000) @@ -439,7 +439,8 @@ mlx5e_poll_tx_cq(struct mlx5e_sq *sq, int budget) sq->cc = sqcc; - if (atomic_cmpset_int(&sq->queue_state, MLX5E_SQ_FULL, MLX5E_SQ_READY)) + if (sq->sq_tq != NULL && + atomic_cmpset_int(&sq->queue_state, MLX5E_SQ_FULL, MLX5E_SQ_READY)) taskqueue_enqueue(sq->sq_tq, &sq->sq_task); } @@ -498,6 +499,45 @@ mlx5e_xmit_locked(struct ifnet *ifp, struct mlx5e_sq * return (err); } +static int +mlx5e_xmit_locked_no_br(struct ifnet *ifp, struct mlx5e_sq *sq, struct mbuf *mb) +{ + int err = 0; + + if (unlikely((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + sq->stopped != 0)) { + m_freem(mb); + return (ENETDOWN); + } + + /* Do transmit */ + if (mlx5e_sq_xmit(sq, &mb) != 0) { + /* NOTE: m_freem() is NULL safe */ + m_freem(mb); + err = ENOBUFS; + } + + /* Check if we need to write the doorbell */ + if (likely(sq->doorbell.d64 != 0)) { + mlx5e_tx_notify_hw(sq, sq->doorbell.d32, 0); + sq->doorbell.d64 = 0; + } + + /* + * Check if we need to start the event timer which flushes the + * transmit ring on timeout: + */ + if (unlikely(sq->cev_next_state == MLX5E_CEV_STATE_INITIAL && + sq->cev_factor != 1)) { + /* start the timer */ + mlx5e_sq_cev_timeout(sq); + } else { + /* don't send NOPs yet */ + sq->cev_next_state = MLX5E_CEV_STATE_HOLD_NOPS; + } + return (err); +} + int mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) { @@ -510,7 +550,13 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) m_freem(mb); return (ENXIO); } - if (mtx_trylock(&sq->lock)) { + + if (unlikely(sq->br == NULL)) { + /* rate limited traffic */ + mtx_lock(&sq->lock); + ret = mlx5e_xmit_locked_no_br(ifp, sq, mb); + mtx_unlock(&sq->lock); + } else if (mtx_trylock(&sq->lock)) { ret = mlx5e_xmit_locked(ifp, sq, mb); mtx_unlock(&sq->lock); } else { From owner-svn-src-stable-10@freebsd.org Thu Aug 3 14:07:15 2017 Return-Path: Delivered-To: svn-src-stable-10@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 71CC1DBED97; Thu, 3 Aug 2017 14:07:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 405537DDEC; Thu, 3 Aug 2017 14:07:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73E7Eob054669; Thu, 3 Aug 2017 14:07:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73E7EV2054668; Thu, 3 Aug 2017 14:07:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031407.v73E7EV2054668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322002 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 322002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 14:07:15 -0000 Author: hselasky Date: Thu Aug 3 14:07:14 2017 New Revision: 322002 URL: https://svnweb.freebsd.org/changeset/base/322002 Log: MFC r312537: Remove superfluous return statement. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:06:22 2017 (r322001) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:07:14 2017 (r322002) @@ -1212,7 +1212,6 @@ done: mlx5e_tx_notify_hw(sq, sq->doorbell.d32, 0); sq->doorbell.d64 = 0; } - return; } void From owner-svn-src-stable-10@freebsd.org Thu Aug 3 14:09:37 2017 Return-Path: Delivered-To: svn-src-stable-10@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 C167ADBEFD1; Thu, 3 Aug 2017 14:09:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DCAD7E176; Thu, 3 Aug 2017 14:09:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73E9aOL054905; Thu, 3 Aug 2017 14:09:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73E9aWR054904; Thu, 3 Aug 2017 14:09:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031409.v73E9aWR054904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322005 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 322005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 14:09:37 -0000 Author: hselasky Date: Thu Aug 3 14:09:36 2017 New Revision: 322005 URL: https://svnweb.freebsd.org/changeset/base/322005 Log: MFC r312865: Enforce reading the consumer and producer counters once to ensure consistent return values from the mlx5e_sq_has_room_for() function. The two counters are incremented by different threads under different locks. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:08:39 2017 (r322004) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:09:36 2017 (r322005) @@ -556,8 +556,10 @@ struct mlx5e_sq { static inline bool mlx5e_sq_has_room_for(struct mlx5e_sq *sq, u16 n) { - return ((sq->wq.sz_m1 & (sq->cc - sq->pc)) >= n || - sq->cc == sq->pc); + u16 cc = sq->cc; + u16 pc = sq->pc; + + return ((sq->wq.sz_m1 & (cc - pc)) >= n || cc == pc); } struct mlx5e_channel { From owner-svn-src-stable-10@freebsd.org Thu Aug 3 14:14:14 2017 Return-Path: Delivered-To: svn-src-stable-10@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 E21EBDBF5AF; Thu, 3 Aug 2017 14:14:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5BC87E726; Thu, 3 Aug 2017 14:14:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73EEDea058946; Thu, 3 Aug 2017 14:14:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73EEDSt058939; Thu, 3 Aug 2017 14:14:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031414.v73EEDSt058939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322007 - in stable/10/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5 X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5 X-SVN-Commit-Revision: 322007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 14:14:15 -0000 Author: hselasky Date: Thu Aug 3 14:14:13 2017 New Revision: 322007 URL: https://svnweb.freebsd.org/changeset/base/322007 Log: MFC r312872: Add support for reading advanced diagnostic counters. By default reading the diagnostic counters is disabled. The firmware decides which counters are supported and only those supported show up in the dev.mce.X.diagnostics sysctl tree. To enable reading of diagnostic counters set one or more of the following sysctls to one: dev.mce.X.conf.diag_general_enable=1 dev.mce.X.conf.diag_pci_enable=1 Sponsored by: Mellanox Technologies Added: stable/10/sys/dev/mlx5/diagnostics.h - copied unchanged from r312872, head/sys/dev/mlx5/diagnostics.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c - copied unchanged from r312872, head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c Modified: stable/10/sys/conf/files stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/modules/mlx5/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu Aug 3 14:12:23 2017 (r322006) +++ stable/10/sys/conf/files Thu Aug 3 14:14:13 2017 (r322007) @@ -3939,6 +3939,8 @@ dev/mlx5/mlx5_core/mlx5_cmd.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_cq.c optional mlx5 pci \ compile-with "${OFED_C}" +dev/mlx5/mlx5_core/mlx5_diagnostics.c optional mlx5 pci \ + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_eq.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_flow_table.c optional mlx5 pci \ Copied: stable/10/sys/dev/mlx5/diagnostics.h (from r312872, head/sys/dev/mlx5/diagnostics.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/mlx5/diagnostics.h Thu Aug 3 14:14:13 2017 (r322007, copy of r312872, head/sys/dev/mlx5/diagnostics.h) @@ -0,0 +1,138 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef MLX5_CORE_DIAGNOSTICS_H +#define MLX5_CORE_DIAGNOSTICS_H + +#define MLX5_CORE_DIAGNOSTICS_NUM(n, s, t) n +#define MLX5_CORE_DIAGNOSTICS_STRUCT(n, s, t) s, +#define MLX5_CORE_DIAGNOSTICS_ENTRY(n, s, t) { #s, (t) }, + +struct mlx5_core_diagnostics_entry { + const char *const desc; + u16 counter_id; +}; + +#define MLX5_CORE_PCI_DIAGNOSTICS(m) \ +m(+1, pxd_ready_bp, 0x0401) \ +m(+1, pci_write_bp, 0x0402) \ +m(+1, pci_read_bp, 0x0403) \ +m(+1, pci_read_stuck_no_completion_buffer, 0x0404) \ +m(+1, max_pci_bw, 0x0405) \ +m(+1, used_pci_bw, 0x0406) \ +m(+1, rx_pci_errors, 0) \ +m(+1, tx_pci_errors, 0) \ +m(+1, tx_pci_correctable_errors, 0) \ +m(+1, tx_pci_non_fatal_errors, 0) \ +m(+1, tx_pci_fatal_errors, 0) + +#define MLX5_CORE_PCI_DIAGNOSTICS_NUM \ + (0 MLX5_CORE_PCI_DIAGNOSTICS(MLX5_CORE_DIAGNOSTICS_NUM)) + +union mlx5_core_pci_diagnostics { + u64 array[MLX5_CORE_PCI_DIAGNOSTICS_NUM]; + struct { + u64 MLX5_CORE_PCI_DIAGNOSTICS( + MLX5_CORE_DIAGNOSTICS_STRUCT) dummy[0]; + } counter; +}; + +extern const struct mlx5_core_diagnostics_entry + mlx5_core_pci_diagnostics_table[MLX5_CORE_PCI_DIAGNOSTICS_NUM]; + +#define MLX5_CORE_GENERAL_DIAGNOSTICS(m) \ +m(+1, l0_mtt_miss, 0x0801) \ +m(+1, l0_mtt_hit, 0x0802) \ +m(+1, l1_mtt_miss, 0x0803) \ +m(+1, l1_mtt_hit, 0x0804) \ +m(+1, l0_mpt_miss, 0x0805) \ +m(+1, l0_mpt_hit, 0x0806) \ +m(+1, l1_mpt_miss, 0x0807) \ +m(+1, l1_mpt_hit, 0x0808) \ +m(+1, rxb_no_slow_path_credits, 0x0c01) \ +m(+1, rxb_no_fast_path_credits, 0x0c02) \ +m(+1, rxb_rxt_no_slow_path_cred_perf_count, 0x0c03) \ +m(+1, rxb_rxt_no_fast_path_cred_perf_count, 0x0c04) \ +m(+1, rxt_ctrl_perf_slice_load_slow, 0x1001) \ +m(+1, rxt_ctrl_perf_slice_load_fast, 0x1002) \ +m(+1, rxt_steering_perf_count_steering0_rse_work_rate, 0x1003) \ +m(+1, rxt_steering_perf_count_steering1_rse_work_rate, 0x1004) \ +m(+1, perf_count_tpt_credit, 0x1401) \ +m(+1, perf_wb_miss, 0x1402) \ +m(+1, perf_wb_hit, 0x1403) \ +m(+1, rxw_perf_rx_l1_slow_miss_ldb, 0x1404) \ +m(+1, rxw_perf_rx_l1_slow_hit_ldb, 0x1405) \ +m(+1, rxw_perf_rx_l1_fast_miss_ldb, 0x1406) \ +m(+1, rxw_perf_rx_l1_fast_hit_ldb, 0x1407) \ +m(+1, rxw_perf_l2_cache_read_miss_ldb, 0x1408) \ +m(+1, rxw_perf_l2_cache_read_hit_ldb, 0x1409) \ +m(+1, rxw_perf_rx_l1_slow_miss_reqsl, 0x140a) \ +m(+1, rxw_perf_rx_l1_slow_hit_reqsl, 0x140b) \ +m(+1, rxw_perf_rx_l1_fast_miss_reqsl, 0x140c) \ +m(+1, rxw_perf_rx_l1_fast_hit_reqsl, 0x140d) \ +m(+1, rxw_perf_l2_cache_read_miss_reqsl, 0x140e) \ +m(+1, rxw_perf_l2_cache_read_hit_reqsl, 0x140f) \ +m(+1, rxs_no_pxt_credits, 0x1801) \ +m(+1, rxc_eq_all_slices_busy, 0x1c01) \ +m(+1, rxc_cq_all_slices_busy, 0x1c02) \ +m(+1, rxc_msix_all_slices_busy, 0x1c03) \ +m(+1, sxw_qp_done_due_to_vl_limited, 0x2001) \ +m(+1, sxw_qp_done_due_to_desched, 0x2002) \ +m(+1, sxw_qp_done_due_to_work_done, 0x2003) \ +m(+1, sxw_qp_done_due_to_limited, 0x2004) \ +m(+1, sxw_qp_done_due_to_e2e_credits, 0x2005) \ +m(+1, sxw_packet_send_sxw2sxp_go_vld, 0x2006) \ +m(+1, sxw_perf_count_steering_hit, 0x2007) \ +m(+1, sxw_perf_count_steering_miss, 0x2008) \ +m(+1, sxw_perf_count_steering_rse_0, 0x2009) \ +m(+1, sxd_no_sched_credits, 0x2401) \ +m(+1, sxd_no_slow_path_sched_credits, 0x2402) \ +m(+1, tpt_indirect_mem_key, 0x2801) + +#define MLX5_CORE_GENERAL_DIAGNOSTICS_NUM \ + (0 MLX5_CORE_GENERAL_DIAGNOSTICS(MLX5_CORE_DIAGNOSTICS_NUM)) + +union mlx5_core_general_diagnostics { + u64 array[MLX5_CORE_GENERAL_DIAGNOSTICS_NUM]; + struct { + u64 MLX5_CORE_GENERAL_DIAGNOSTICS( + MLX5_CORE_DIAGNOSTICS_STRUCT) dummy[0]; + } counter; +}; + +extern const struct mlx5_core_diagnostics_entry + mlx5_core_general_diagnostics_table[MLX5_CORE_GENERAL_DIAGNOSTICS_NUM]; + +/* function prototypes */ +int mlx5_core_set_diagnostics_full(struct mlx5_core_dev *mdev, + u8 enable_pci, u8 enable_general); +int mlx5_core_get_diagnostics_full(struct mlx5_core_dev *mdev, + union mlx5_core_pci_diagnostics *ppci, + union mlx5_core_general_diagnostics *pgen); +int mlx5_core_supports_diagnostics(struct mlx5_core_dev *mdev, u16 counter_id); + +#endif /* MLX5_CORE_DIAGNOSTICS_H */ Copied: stable/10/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c (from r312872, head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c Thu Aug 3 14:14:13 2017 (r322007, copy of r312872, head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c) @@ -0,0 +1,286 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +const struct mlx5_core_diagnostics_entry + mlx5_core_pci_diagnostics_table[ + MLX5_CORE_PCI_DIAGNOSTICS_NUM] = { + MLX5_CORE_PCI_DIAGNOSTICS(MLX5_CORE_DIAGNOSTICS_ENTRY) +}; + +const struct mlx5_core_diagnostics_entry + mlx5_core_general_diagnostics_table[ + MLX5_CORE_GENERAL_DIAGNOSTICS_NUM] = { + MLX5_CORE_GENERAL_DIAGNOSTICS(MLX5_CORE_DIAGNOSTICS_ENTRY) +}; + +static int mlx5_core_get_index_of_diag_counter( + const struct mlx5_core_diagnostics_entry *entry, + int size, u16 counter_id) +{ + int x; + + /* check for invalid counter ID */ + if (counter_id == 0) + return -1; + + /* lookup counter ID in table */ + for (x = 0; x != size; x++) { + if (entry[x].counter_id == counter_id) + return x; + } + return -1; +} + +static void mlx5_core_put_diag_counter( + const struct mlx5_core_diagnostics_entry *entry, + u64 *array, int size, u16 counter_id, u64 value) +{ + int x; + + /* check for invalid counter ID */ + if (counter_id == 0) + return; + + /* lookup counter ID in table */ + for (x = 0; x != size; x++) { + if (entry[x].counter_id == counter_id) { + array[x] = value; + break; + } + } +} + +int mlx5_core_set_diagnostics_full(struct mlx5_core_dev *dev, + u8 enable_pci, u8 enable_general) +{ + void *diag_params_ctx; + void *in; + int numcounters; + int inlen; + int err; + int x; + int y; + + if (MLX5_CAP_GEN(dev, debug) == 0) + return 0; + + numcounters = MLX5_CAP_GEN(dev, num_of_diagnostic_counters); + if (numcounters == 0) + return 0; + + inlen = MLX5_ST_SZ_BYTES(set_diagnostic_params_in) + + MLX5_ST_SZ_BYTES(diagnostic_counter) * numcounters; + in = mlx5_vzalloc(inlen); + if (in == NULL) + return -ENOMEM; + + diag_params_ctx = MLX5_ADDR_OF(set_diagnostic_params_in, in, + diagnostic_params_ctx); + + MLX5_SET(diagnostic_params_context, diag_params_ctx, + enable, enable_pci || enable_general); + MLX5_SET(diagnostic_params_context, diag_params_ctx, + single, 1); + MLX5_SET(diagnostic_params_context, diag_params_ctx, + on_demand, 1); + + /* collect the counters we want to enable */ + for (x = y = 0; x != numcounters; x++) { + u16 counter_id = + MLX5_CAP_DEBUG(dev, diagnostic_counter[x].counter_id); + int index = -1; + + if (index < 0 && enable_pci != 0) { + /* check if counter ID exists in local table */ + index = mlx5_core_get_index_of_diag_counter( + mlx5_core_pci_diagnostics_table, + MLX5_CORE_PCI_DIAGNOSTICS_NUM, + counter_id); + } + if (index < 0 && enable_general != 0) { + /* check if counter ID exists in local table */ + index = mlx5_core_get_index_of_diag_counter( + mlx5_core_general_diagnostics_table, + MLX5_CORE_GENERAL_DIAGNOSTICS_NUM, + counter_id); + } + if (index < 0) + continue; + + MLX5_SET(diagnostic_params_context, + diag_params_ctx, + counter_id[y].counter_id, + counter_id); + y++; + } + + /* recompute input length */ + inlen = MLX5_ST_SZ_BYTES(set_diagnostic_params_in) + + MLX5_ST_SZ_BYTES(diagnostic_counter) * y; + + /* set number of counters */ + MLX5_SET(diagnostic_params_context, diag_params_ctx, + num_of_counters, y); + + /* execute firmware command */ + err = mlx5_set_diagnostic_params(dev, in, inlen); + + kvfree(in); + + return err; +} + +int mlx5_core_get_diagnostics_full(struct mlx5_core_dev *dev, + union mlx5_core_pci_diagnostics *pdiag, + union mlx5_core_general_diagnostics *pgen) +{ + void *out; + void *in; + int numcounters; + int outlen; + int inlen; + int err; + int x; + + if (MLX5_CAP_GEN(dev, debug) == 0) + return 0; + + numcounters = MLX5_CAP_GEN(dev, num_of_diagnostic_counters); + if (numcounters == 0) + return 0; + + outlen = MLX5_ST_SZ_BYTES(query_diagnostic_counters_out) + + MLX5_ST_SZ_BYTES(diagnostic_counter) * numcounters; + + out = mlx5_vzalloc(outlen); + if (out == NULL) + return -ENOMEM; + + err = mlx5_query_diagnostic_counters(dev, 1, 0, out, outlen); + if (err == 0) { + for (x = 0; x != numcounters; x++) { + u16 counter_id = MLX5_GET( + query_diagnostic_counters_out, + out, diag_counter[x].counter_id); + u64 counter_value = MLX5_GET64( + query_diagnostic_counters_out, + out, diag_counter[x].counter_value_h); + + if (pdiag != NULL) { + mlx5_core_put_diag_counter( + mlx5_core_pci_diagnostics_table, + pdiag->array, + MLX5_CORE_PCI_DIAGNOSTICS_NUM, + counter_id, counter_value); + } + if (pgen != NULL) { + mlx5_core_put_diag_counter( + mlx5_core_general_diagnostics_table, + pgen->array, + MLX5_CORE_GENERAL_DIAGNOSTICS_NUM, + counter_id, counter_value); + } + } + } + kvfree(out); + + if (pdiag != NULL) { + inlen = MLX5_ST_SZ_BYTES(mpcnt_reg); + outlen = MLX5_ST_SZ_BYTES(mpcnt_reg); + + in = mlx5_vzalloc(inlen); + if (in == NULL) + return -ENOMEM; + + out = mlx5_vzalloc(outlen); + if (out == NULL) { + kvfree(in); + return -ENOMEM; + } + MLX5_SET(mpcnt_reg, in, grp, + MLX5_PCIE_PERFORMANCE_COUNTERS_GROUP); + + err = mlx5_core_access_reg(dev, in, inlen, out, outlen, + MLX5_REG_MPCNT, 0, 0); + if (err == 0) { + void *pcounters = MLX5_ADDR_OF(mpcnt_reg, out, + counter_set.pcie_performance_counters_data_layout); + + pdiag->counter.rx_pci_errors = + MLX5_GET(pcie_performance_counters_data_layout, + pcounters, rx_errors); + pdiag->counter.tx_pci_errors = + MLX5_GET(pcie_performance_counters_data_layout, + pcounters, tx_errors); + } + MLX5_SET(mpcnt_reg, in, grp, + MLX5_PCIE_TIMERS_AND_STATES_COUNTERS_GROUP); + + err = mlx5_core_access_reg(dev, in, inlen, out, outlen, + MLX5_REG_MPCNT, 0, 0); + if (err == 0) { + void *pcounters = MLX5_ADDR_OF(mpcnt_reg, out, + counter_set.pcie_timers_and_states_data_layout); + + pdiag->counter.tx_pci_non_fatal_errors = + MLX5_GET(pcie_timers_and_states_data_layout, + pcounters, non_fatal_err_msg_sent); + pdiag->counter.tx_pci_fatal_errors = + MLX5_GET(pcie_timers_and_states_data_layout, + pcounters, fatal_err_msg_sent); + } + kvfree(in); + kvfree(out); + } + return 0; +} + +int mlx5_core_supports_diagnostics(struct mlx5_core_dev *dev, u16 counter_id) +{ + int numcounters; + int x; + + if (MLX5_CAP_GEN(dev, debug) == 0) + return 0; + + /* check for any counter */ + if (counter_id == 0) + return 1; + + numcounters = MLX5_CAP_GEN(dev, num_of_diagnostic_counters); + + /* check if counter ID exists in debug capability */ + for (x = 0; x != numcounters; x++) { + if (MLX5_CAP_DEBUG(dev, diagnostic_counter[x].counter_id) == + counter_id) + return 1; + } + return 0; /* not supported counter */ +} Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:12:23 2017 (r322006) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:14:13 2017 (r322007) @@ -69,6 +69,7 @@ #include #include #include +#include #include #include @@ -412,7 +413,9 @@ struct mlx5e_params { m(+1, u64 tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \ m(+1, u64 tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ - m(+1, u64 cqe_zipping, "cqe_zipping", "0 : CQE zipping disabled") + m(+1, u64 cqe_zipping, "cqe_zipping", "0 : CQE zipping disabled") \ + m(+1, u64 diag_pci_enable, "diag_pci_enable", "0: Disabled 1: Enabled") \ + m(+1, u64 diag_general_enable, "diag_general_enable", "0: Disabled 1: Enabled") #define MLX5E_PARAMS_NUM (0 MLX5E_PARAMS(MLX5E_STATS_COUNT)) @@ -670,6 +673,8 @@ struct mlx5e_priv { struct mlx5e_params params; struct mlx5e_params_ethtool params_ethtool; + union mlx5_core_pci_diagnostics params_pci; + union mlx5_core_general_diagnostics params_general; struct mtx async_events_mtx; /* sync hw events */ struct work_struct update_stats_work; struct work_struct update_carrier_work; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 14:12:23 2017 (r322006) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 14:14:13 2017 (r322007) @@ -377,6 +377,24 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) mlx5e_open_locked(priv->ifp); break; + case MLX5_PARAM_OFFSET(diag_pci_enable): + priv->params_ethtool.diag_pci_enable = + priv->params_ethtool.diag_pci_enable ? 1 : 0; + + error = -mlx5_core_set_diagnostics_full(priv->mdev, + priv->params_ethtool.diag_pci_enable, + priv->params_ethtool.diag_general_enable); + break; + + case MLX5_PARAM_OFFSET(diag_general_enable): + priv->params_ethtool.diag_general_enable = + priv->params_ethtool.diag_general_enable ? 1 : 0; + + error = -mlx5_core_set_diagnostics_full(priv->mdev, + priv->params_ethtool.diag_pci_enable, + priv->params_ethtool.diag_general_enable); + break; + default: break; } @@ -624,6 +642,45 @@ mlx5e_ethtool_debug_stats(SYSCTL_HANDLER_ARGS) return (error); } +static void +mlx5e_create_diagnostics(struct mlx5e_priv *priv) +{ + struct mlx5_core_diagnostics_entry entry; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *node; + int x; + + /* sysctl context we are using */ + ctx = &priv->sysctl_ctx; + + /* create root node */ + node = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(priv->sysctl_ifnet), OID_AUTO, + "diagnostics", CTLFLAG_RD, NULL, "Diagnostics"); + if (node == NULL) + return; + + /* create PCI diagnostics */ + for (x = 0; x != MLX5_CORE_PCI_DIAGNOSTICS_NUM; x++) { + entry = mlx5_core_pci_diagnostics_table[x]; + if (mlx5_core_supports_diagnostics(priv->mdev, entry.counter_id) == 0) + continue; + SYSCTL_ADD_UQUAD(ctx, SYSCTL_CHILDREN(node), OID_AUTO, + entry.desc, CTLFLAG_RD, priv->params_pci.array + x, + "PCI diagnostics counter"); + } + + /* create general diagnostics */ + for (x = 0; x != MLX5_CORE_GENERAL_DIAGNOSTICS_NUM; x++) { + entry = mlx5_core_general_diagnostics_table[x]; + if (mlx5_core_supports_diagnostics(priv->mdev, entry.counter_id) == 0) + continue; + SYSCTL_ADD_UQUAD(ctx, SYSCTL_CHILDREN(node), OID_AUTO, + entry.desc, CTLFLAG_RD, priv->params_general.array + x, + "General diagnostics counter"); + } +} + void mlx5e_create_ethtool(struct mlx5e_priv *priv) { @@ -705,4 +762,7 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(node), OID_AUTO, "eeprom_info", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, priv, 0, mlx5e_read_eeprom, "I", "EEPROM information"); + + /* Diagnostics support */ + mlx5e_create_diagnostics(priv); } Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:12:23 2017 (r322006) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:14:13 2017 (r322007) @@ -573,6 +573,16 @@ mlx5e_update_stats_work(struct work_struct *work) free_out: kvfree(out); + + /* Update diagnostics, if any */ + if (priv->params_ethtool.diag_pci_enable || + priv->params_ethtool.diag_general_enable) { + int error = mlx5_core_get_diagnostics_full(mdev, + priv->params_ethtool.diag_pci_enable ? &priv->params_pci : NULL, + priv->params_ethtool.diag_general_enable ? &priv->params_general : NULL); + if (error != 0) + if_printf(priv->ifp, "Failed reading diagnostics: %d\n", error); + } PRIV_UNLOCK(priv); } Modified: stable/10/sys/modules/mlx5/Makefile ============================================================================== --- stable/10/sys/modules/mlx5/Makefile Thu Aug 3 14:12:23 2017 (r322006) +++ stable/10/sys/modules/mlx5/Makefile Thu Aug 3 14:14:13 2017 (r322007) @@ -6,6 +6,7 @@ SRCS= \ mlx5_alloc.c \ mlx5_cmd.c \ mlx5_cq.c \ +mlx5_diagnostics.c \ mlx5_eq.c \ mlx5_eswitch_vacl.c \ mlx5_flow_table.c \ From owner-svn-src-stable-10@freebsd.org Thu Aug 3 14:17:26 2017 Return-Path: Delivered-To: svn-src-stable-10@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 9D13DDBF849; Thu, 3 Aug 2017 14:17:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 795AE7EA10; Thu, 3 Aug 2017 14:17:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73EHPX4059187; Thu, 3 Aug 2017 14:17:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73EHPmP059185; Thu, 3 Aug 2017 14:17:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031417.v73EHPmP059185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322009 - in stable/10/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 322009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 14:17:26 -0000 Author: hselasky Date: Thu Aug 3 14:17:25 2017 New Revision: 322009 URL: https://svnweb.freebsd.org/changeset/base/322009 Log: MFC r312876: Use ffs() to scan for first bit instead of using a for() loop. Minor code refactor while at it. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/driver.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/driver.h ============================================================================== --- stable/10/sys/dev/mlx5/driver.h Thu Aug 3 14:16:31 2017 (r322008) +++ stable/10/sys/dev/mlx5/driver.h Thu Aug 3 14:17:25 2017 (r322009) @@ -859,7 +859,7 @@ void mlx5_cq_completion(struct mlx5_core_dev *dev, u32 void mlx5_rsc_event(struct mlx5_core_dev *dev, u32 rsn, int event_type); void mlx5_srq_event(struct mlx5_core_dev *dev, u32 srqn, int event_type); struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_core_dev *dev, u32 srqn); -void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector); +void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector); void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type); int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx, int nent, u64 mask, const char *name, struct mlx5_uar *uar); Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Aug 3 14:16:31 2017 (r322008) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Aug 3 14:17:25 2017 (r322009) @@ -760,7 +760,7 @@ static void cmd_work_handler(struct work_struct *work) poll_timeout(ent); /* make sure we read the descriptor after ownership is SW */ rmb(); - mlx5_cmd_comp_handler(dev, 1UL << ent->idx); + mlx5_cmd_comp_handler(dev, 1U << ent->idx); } } @@ -1104,7 +1104,7 @@ static void free_msg(struct mlx5_core_dev *dev, struct } } -void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector) +void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector) { struct mlx5_cmd *cmd = &dev->cmd; struct mlx5_cmd_work_ent *ent; @@ -1112,60 +1112,63 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, void *context; int err; int i; + struct semaphore *sem; s64 ds; struct mlx5_cmd_stats *stats; unsigned long flags; - for (i = 0; i < (1 << cmd->log_sz); i++) { - if (test_bit(i, &vector)) { - struct semaphore *sem; - - ent = cmd->ent_arr[i]; - if (ent->page_queue) - sem = &cmd->pages_sem; + while (vector != 0) { + i = ffs(vector) - 1; + vector &= ~(1U << i); + ent = cmd->ent_arr[i]; + if (ent->page_queue) + sem = &cmd->pages_sem; + else + sem = &cmd->sem; + ent->ts2 = ktime_get_ns(); + memcpy(ent->out->first.data, ent->lay->out, + sizeof(ent->lay->out)); + dump_command(dev, ent, 0); + if (!ent->ret) { + if (!cmd->checksum_disabled) + ent->ret = verify_signature(ent); else - sem = &cmd->sem; - ent->ts2 = ktime_get_ns(); - memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out)); - dump_command(dev, ent, 0); - if (!ent->ret) { - if (!cmd->checksum_disabled) - ent->ret = verify_signature(ent); - else - ent->ret = 0; - ent->status = ent->lay->status_own >> 1; - mlx5_core_dbg(dev, "command completed. ret 0x%x, delivery status %s(0x%x)\n", - ent->ret, deliv_status_to_str(ent->status), ent->status); + ent->ret = 0; + ent->status = ent->lay->status_own >> 1; + mlx5_core_dbg(dev, + "FW command ret 0x%x, status %s(0x%x)\n", + ent->ret, + deliv_status_to_str(ent->status), + ent->status); + } + free_ent(cmd, ent->idx); + if (ent->callback) { + ds = ent->ts2 - ent->ts1; + if (ent->op < ARRAY_SIZE(cmd->stats)) { + stats = &cmd->stats[ent->op]; + spin_lock_irqsave(&stats->lock, flags); + stats->sum += ds; + ++stats->n; + spin_unlock_irqrestore(&stats->lock, flags); } - free_ent(cmd, ent->idx); - if (ent->callback) { - ds = ent->ts2 - ent->ts1; - if (ent->op < ARRAY_SIZE(cmd->stats)) { - stats = &cmd->stats[ent->op]; - spin_lock_irqsave(&stats->lock, flags); - stats->sum += ds; - ++stats->n; - spin_unlock_irqrestore(&stats->lock, flags); - } - callback = ent->callback; - context = ent->context; - err = ent->ret; - if (!err) - err = mlx5_copy_from_msg(ent->uout, - ent->out, - ent->uout_size); + callback = ent->callback; + context = ent->context; + err = ent->ret; + if (!err) + err = mlx5_copy_from_msg(ent->uout, + ent->out, + ent->uout_size); - mlx5_free_cmd_msg(dev, ent->out); - free_msg(dev, ent->in); + mlx5_free_cmd_msg(dev, ent->out); + free_msg(dev, ent->in); - free_cmd(ent); - callback(err, context); - } else { - complete(&ent->done); - } - up(sem); + free_cmd(ent); + callback(err, context); + } else { + complete(&ent->done); } + up(sem); } } EXPORT_SYMBOL(mlx5_cmd_comp_handler); From owner-svn-src-stable-10@freebsd.org Thu Aug 3 14:20:20 2017 Return-Path: Delivered-To: svn-src-stable-10@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 A7FF2DBFB73; Thu, 3 Aug 2017 14:20:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 732917ED9B; Thu, 3 Aug 2017 14:20:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73EKJRr059439; Thu, 3 Aug 2017 14:20:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73EKJIV059438; Thu, 3 Aug 2017 14:20:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031420.v73EKJIV059438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322011 - stable/10/sys/dev/mlx5 X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5 X-SVN-Commit-Revision: 322011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 14:20:20 -0000 Author: hselasky Date: Thu Aug 3 14:20:19 2017 New Revision: 322011 URL: https://svnweb.freebsd.org/changeset/base/322011 Log: MFC r312983: Make "desc" pointer non-constant inside the mlx5_core_diagnostics_entry structure. This fixes compilation with amd64-xtoolchain-gcc. PR: 216588 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/diagnostics.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/diagnostics.h ============================================================================== --- stable/10/sys/dev/mlx5/diagnostics.h Thu Aug 3 14:19:26 2017 (r322010) +++ stable/10/sys/dev/mlx5/diagnostics.h Thu Aug 3 14:20:19 2017 (r322011) @@ -33,7 +33,7 @@ #define MLX5_CORE_DIAGNOSTICS_ENTRY(n, s, t) { #s, (t) }, struct mlx5_core_diagnostics_entry { - const char *const desc; + const char *desc; u16 counter_id; }; From owner-svn-src-stable-10@freebsd.org Thu Aug 3 14:22:49 2017 Return-Path: Delivered-To: svn-src-stable-10@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 64C22DBFF81; Thu, 3 Aug 2017 14:22:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32D847F23E; Thu, 3 Aug 2017 14:22:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73EMmI9063094; Thu, 3 Aug 2017 14:22:48 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73EMmd5063093; Thu, 3 Aug 2017 14:22:48 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201708031422.v73EMmd5063093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 3 Aug 2017 14:22:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322012 - in stable: 10/contrib/ipfilter 11/contrib/ipfilter X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter 11/contrib/ipfilter X-SVN-Commit-Revision: 322012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 14:22:49 -0000 Author: cy Date: Thu Aug 3 14:22:48 2017 New Revision: 322012 URL: https://svnweb.freebsd.org/changeset/base/322012 Log: MFC r321605: As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024. (This implementation of arc4rand(9) is used by the userland ipftest utility as it approximates ipfilter kernelspace in userspace.) PR: 217920 Submitted by: codarren@hackers.mu Reviewed by: emaste, cem Approved by: so (implicit, in r315225) Differential Revision: D11747 Patterned after: r315225 Modified: stable/10/contrib/ipfilter/arc4random.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ipfilter/arc4random.c Directory Properties: stable/11/ (props changed) Modified: stable/10/contrib/ipfilter/arc4random.c ============================================================================== --- stable/10/contrib/ipfilter/arc4random.c Thu Aug 3 14:20:19 2017 (r322011) +++ stable/10/contrib/ipfilter/arc4random.c Thu Aug 3 14:22:48 2017 (r322012) @@ -109,9 +109,9 @@ arc4_randomstir (void) /* * Throw away the first N words of output, as suggested in the * paper "Weaknesses in the Key Scheduling Algorithm of RC4" - * by Fluher, Mantin, and Shamir. (N = 256 in our case.) + * by Fluher, Mantin, and Shamir. (N = 768 in our case.) */ - for (n = 0; n < 256*4; n++) + for (n = 0; n < 768*4; n++) arc4_randbyte(); MUTEX_EXIT(&arc4_mtx); } From owner-svn-src-stable-10@freebsd.org Fri Aug 4 08:25:04 2017 Return-Path: Delivered-To: svn-src-stable-10@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 7C728DCCEA8; Fri, 4 Aug 2017 08:25:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43332837F2; Fri, 4 Aug 2017 08:25:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v748P3oL020262; Fri, 4 Aug 2017 08:25:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v748P3HP020261; Fri, 4 Aug 2017 08:25:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708040825.v748P3HP020261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Aug 2017 08:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322046 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/ufs/ffs X-SVN-Commit-Revision: 322046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2017 08:25:04 -0000 Author: kib Date: Fri Aug 4 08:25:03 2017 New Revision: 322046 URL: https://svnweb.freebsd.org/changeset/base/322046 Log: MFC r321347: Account for lock recursion when transfering snaplock to the vnode lock in ffs_snapremove(). Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:20:26 2017 (r322045) +++ stable/10/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:25:03 2017 (r322046) @@ -1607,7 +1607,7 @@ ffs_snapremove(vp) struct buf *ibp; struct fs *fs; ufs2_daddr_t numblks, blkno, dblk; - int error, loc, last; + int error, i, last, loc; struct snapdata *sn; ip = VTOI(vp); @@ -1627,10 +1627,14 @@ ffs_snapremove(vp) ip->i_nextsnap.tqe_prev = 0; VI_UNLOCK(devvp); lockmgr(&vp->v_lock, LK_EXCLUSIVE, NULL); + for (i = 0; i < sn->sn_lock.lk_recurse; i++) + lockmgr(&vp->v_lock, LK_EXCLUSIVE, NULL); KASSERT(vp->v_vnlock == &sn->sn_lock, ("ffs_snapremove: lost lock mutation")); vp->v_vnlock = &vp->v_lock; VI_LOCK(devvp); + while (sn->sn_lock.lk_recurse > 0) + lockmgr(&sn->sn_lock, LK_RELEASE, NULL); lockmgr(&sn->sn_lock, LK_RELEASE, NULL); try_free_snapdata(devvp); } else From owner-svn-src-stable-10@freebsd.org Fri Aug 4 08:26:20 2017 Return-Path: Delivered-To: svn-src-stable-10@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 AE962DCCFAD; Fri, 4 Aug 2017 08:26:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C33E83950; Fri, 4 Aug 2017 08:26:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v748QJ66020356; Fri, 4 Aug 2017 08:26:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v748QJmk020355; Fri, 4 Aug 2017 08:26:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708040826.v748QJmk020355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Aug 2017 08:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322047 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/ufs/ffs X-SVN-Commit-Revision: 322047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2017 08:26:20 -0000 Author: kib Date: Fri Aug 4 08:26:19 2017 New Revision: 322047 URL: https://svnweb.freebsd.org/changeset/base/322047 Log: MFC r321348: Unlock correct lock in ffs_snapblkfree(). Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:25:03 2017 (r322046) +++ stable/10/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:26:19 2017 (r322047) @@ -1944,7 +1944,7 @@ retry: */ if (error != 0 && wkhd != NULL) softdep_freework(wkhd); - lockmgr(vp->v_vnlock, LK_RELEASE, NULL); + lockmgr(&sn->sn_lock, LK_RELEASE, NULL); return (error); } From owner-svn-src-stable-10@freebsd.org Fri Aug 4 08:27:35 2017 Return-Path: Delivered-To: svn-src-stable-10@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 BEACDDCD09C; Fri, 4 Aug 2017 08:27:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BC7D83A91; Fri, 4 Aug 2017 08:27:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v748RYiN020450; Fri, 4 Aug 2017 08:27:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v748RYQV020449; Fri, 4 Aug 2017 08:27:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708040827.v748RYQV020449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Aug 2017 08:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322048 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/ufs/ffs X-SVN-Commit-Revision: 322048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2017 08:27:35 -0000 Author: kib Date: Fri Aug 4 08:27:34 2017 New Revision: 322048 URL: https://svnweb.freebsd.org/changeset/base/322048 Log: MFC r321349: Improve publication of the newly allocated snapdata. Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:26:19 2017 (r322047) +++ stable/10/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:27:34 2017 (r322048) @@ -2643,8 +2643,8 @@ try_free_snapdata(struct vnode *devvp) static struct snapdata * ffs_snapdata_acquire(struct vnode *devvp) { - struct snapdata *nsn; - struct snapdata *sn; + struct snapdata *nsn, *sn; + int error; /* * Allocate a free snapdata. This is done before acquiring the @@ -2652,23 +2652,37 @@ ffs_snapdata_acquire(struct vnode *devvp) * held. */ nsn = ffs_snapdata_alloc(); - /* - * If there snapshots already exist on this filesystem grab a - * reference to the shared lock. Otherwise this is the first - * snapshot on this filesystem and we need to use our - * pre-allocated snapdata. - */ - VI_LOCK(devvp); - if (devvp->v_rdev->si_snapdata == NULL) { - devvp->v_rdev->si_snapdata = nsn; - nsn = NULL; + + for (;;) { + VI_LOCK(devvp); + sn = devvp->v_rdev->si_snapdata; + if (sn == NULL) { + /* + * This is the first snapshot on this + * filesystem and we use our pre-allocated + * snapdata. Publish sn with the sn_lock + * owned by us, to avoid the race. + */ + error = lockmgr(&nsn->sn_lock, LK_EXCLUSIVE | + LK_NOWAIT, NULL); + if (error != 0) + panic("leaked sn, lockmgr error %d", error); + sn = devvp->v_rdev->si_snapdata = nsn; + VI_UNLOCK(devvp); + nsn = NULL; + break; + } + + /* + * There is a snapshots which already exists on this + * filesystem, grab a reference to the common lock. + */ + error = lockmgr(&sn->sn_lock, LK_INTERLOCK | + LK_EXCLUSIVE | LK_SLEEPFAIL, VI_MTX(devvp)); + if (error == 0) + break; } - sn = devvp->v_rdev->si_snapdata; - /* - * Acquire the snapshot lock. - */ - lockmgr(&sn->sn_lock, - LK_INTERLOCK | LK_EXCLUSIVE | LK_RETRY, VI_MTX(devvp)); + /* * Free any unused snapdata. */ From owner-svn-src-stable-10@freebsd.org Fri Aug 4 20:24:24 2017 Return-Path: Delivered-To: svn-src-stable-10@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 74F64DC7421; Fri, 4 Aug 2017 20:24:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41EA276F94; Fri, 4 Aug 2017 20:24:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v74KONV3018118; Fri, 4 Aug 2017 20:24:23 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74KON0t018115; Fri, 4 Aug 2017 20:24:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201708042024.v74KON0t018115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 4 Aug 2017 20:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322061 - stable/10/sys/net80211 X-SVN-Group: stable-10 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/10/sys/net80211 X-SVN-Commit-Revision: 322061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2017 20:24:24 -0000 Author: pfg Date: Fri Aug 4 20:24:23 2017 New Revision: 322061 URL: https://svnweb.freebsd.org/changeset/base/322061 Log: MFC r321838: sys/net8021: Add missing braces in setcurchan(). Also fix some indentation. Obtained from: DragonFlyBSD (git c69e37d6) Modified: stable/10/sys/net80211/ieee80211_ioctl.c stable/10/sys/net80211/ieee80211_mesh.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net80211/ieee80211_ioctl.c ============================================================================== --- stable/10/sys/net80211/ieee80211_ioctl.c Fri Aug 4 20:22:43 2017 (r322060) +++ stable/10/sys/net80211/ieee80211_ioctl.c Fri Aug 4 20:24:23 2017 (r322061) @@ -1970,9 +1970,10 @@ setcurchan(struct ieee80211vap *vap, struct ieee80211_ /* XXX need state machine for other vap's to follow */ ieee80211_setcurchan(ic, vap->iv_des_chan); vap->iv_bss->ni_chan = ic->ic_curchan; - } else + } else { ic->ic_curchan = vap->iv_des_chan; ic->ic_rt = ieee80211_get_ratetable(ic->ic_curchan); + } } else { /* * Need to go through the state machine in case we Modified: stable/10/sys/net80211/ieee80211_mesh.c ============================================================================== --- stable/10/sys/net80211/ieee80211_mesh.c Fri Aug 4 20:22:43 2017 (r322060) +++ stable/10/sys/net80211/ieee80211_mesh.c Fri Aug 4 20:24:23 2017 (r322061) @@ -2653,7 +2653,7 @@ mesh_recv_action_meshgate(struct ieee80211_node *ni, /* popagate only if decremented ttl >= 1 && forwarding is enabled */ if ((ie.gann_ttl - 1) < 1 && !(ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) return 0; - pgann.gann_flags = ie.gann_flags; /* Reserved */ + pgann.gann_flags = ie.gann_flags; /* Reserved */ pgann.gann_hopcount = ie.gann_hopcount + 1; pgann.gann_ttl = ie.gann_ttl - 1; IEEE80211_ADDR_COPY(pgann.gann_addr, ie.gann_addr); From owner-svn-src-stable-10@freebsd.org Fri Aug 4 21:38:35 2017 Return-Path: Delivered-To: svn-src-stable-10@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 8C333DCA42B; Fri, 4 Aug 2017 21:38:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8147CFBA; Fri, 4 Aug 2017 21:38:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v74LcYpT046694; Fri, 4 Aug 2017 21:38:34 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74LcYBd046693; Fri, 4 Aug 2017 21:38:34 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708042138.v74LcYBd046693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Fri, 4 Aug 2017 21:38:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322063 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/10/sys/amd64/amd64 X-SVN-Commit-Revision: 322063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2017 21:38:35 -0000 Author: marius Date: Fri Aug 4 21:38:34 2017 New Revision: 322063 URL: https://svnweb.freebsd.org/changeset/base/322063 Log: MFC: r290156, r318354 pmap_change_attr: Only fixup DMAP for DMAPed ranges Modified: stable/10/sys/amd64/amd64/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Fri Aug 4 21:06:47 2017 (r322062) +++ stable/10/sys/amd64/amd64/pmap.c Fri Aug 4 21:38:34 2017 (r322063) @@ -6559,7 +6559,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size */ for (tmpva = base; tmpva < base + size; ) { pdpe = pmap_pdpe(kernel_pmap, tmpva); - if (*pdpe == 0) + if (pdpe == NULL || *pdpe == 0) return (EINVAL); if (*pdpe & PG_PS) { /* @@ -6632,7 +6632,8 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size X86_PG_PDE_CACHE); changed = TRUE; } - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { + if (tmpva >= VM_MIN_KERNEL_ADDRESS && + (*pdpe & PG_PS_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ pa_start = *pdpe & PG_PS_FRAME; @@ -6661,7 +6662,8 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size X86_PG_PDE_CACHE); changed = TRUE; } - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { + if (tmpva >= VM_MIN_KERNEL_ADDRESS && + (*pde & PG_PS_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ pa_start = *pde & PG_PS_FRAME; @@ -6688,7 +6690,8 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size X86_PG_PTE_CACHE); changed = TRUE; } - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { + if (tmpva >= VM_MIN_KERNEL_ADDRESS && + (*pte & PG_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ pa_start = *pte & PG_FRAME; From owner-svn-src-stable-10@freebsd.org Fri Aug 4 23:34:41 2017 Return-Path: Delivered-To: svn-src-stable-10@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 4FD5DDCEE50; Fri, 4 Aug 2017 23:34:41 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B009804E3; Fri, 4 Aug 2017 23:34:41 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v74NYewo095400; Fri, 4 Aug 2017 23:34:40 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74NYeEV095398; Fri, 4 Aug 2017 23:34:40 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201708042334.v74NYeEV095398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 4 Aug 2017 23:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322072 - stable/10/contrib/libarchive/libarchive X-SVN-Group: stable-10 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: stable/10/contrib/libarchive/libarchive X-SVN-Commit-Revision: 322072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2017 23:34:41 -0000 Author: mm Date: Fri Aug 4 23:34:39 2017 New Revision: 322072 URL: https://svnweb.freebsd.org/changeset/base/322072 Log: MFH r321674: Sync libarchive with vendor. Relevant vendor changes: PR #926: ensure ar strtab is null terminated PR: 220462 Modified: stable/10/contrib/libarchive/libarchive/archive_cryptor_private.h stable/10/contrib/libarchive/libarchive/archive_write_set_format_ar.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/libarchive/archive_cryptor_private.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_cryptor_private.h Fri Aug 4 23:34:25 2017 (r322071) +++ stable/10/contrib/libarchive/libarchive/archive_cryptor_private.h Fri Aug 4 23:34:39 2017 (r322072) @@ -64,7 +64,7 @@ typedef struct { } archive_crypto_ctx; #elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H) -#include +#include /* Common in other bcrypt implementations, but missing from VS2008. */ #ifndef BCRYPT_SUCCESS Modified: stable/10/contrib/libarchive/libarchive/archive_write_set_format_ar.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write_set_format_ar.c Fri Aug 4 23:34:25 2017 (r322071) +++ stable/10/contrib/libarchive/libarchive/archive_write_set_format_ar.c Fri Aug 4 23:34:39 2017 (r322072) @@ -374,13 +374,14 @@ archive_write_ar_data(struct archive_write *a, const v return (ARCHIVE_WARN); } - ar->strtab = (char *)malloc(s); + ar->strtab = (char *)malloc(s + 1); if (ar->strtab == NULL) { archive_set_error(&a->archive, ENOMEM, "Can't allocate strtab buffer"); return (ARCHIVE_FATAL); } - strncpy(ar->strtab, buff, s); + memcpy(ar->strtab, buff, s); + ar->strtab[s] = '\0'; ar->has_strtab = 1; } From owner-svn-src-stable-10@freebsd.org Sat Aug 5 08:36:05 2017 Return-Path: Delivered-To: svn-src-stable-10@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 D3287DC659B; Sat, 5 Aug 2017 08:36:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A17946B23F; Sat, 5 Aug 2017 08:36:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v758a4Xi017696; Sat, 5 Aug 2017 08:36:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v758a45b017695; Sat, 5 Aug 2017 08:36:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708050836.v758a45b017695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 5 Aug 2017 08:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322079 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-10 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 322079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Aug 2017 08:36:05 -0000 Author: mav Date: Sat Aug 5 08:36:04 2017 New Revision: 322079 URL: https://svnweb.freebsd.org/changeset/base/322079 Log: MFC r321921: Add compat shim part missed at r305197. This fixes compatibility between old kernel and new ZFS tools. It seems to be tradition to forget it. PR: 221112 Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Sat Aug 5 08:35:13 2017 (r322078) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Sat Aug 5 08:36:04 2017 (r322079) @@ -74,6 +74,9 @@ zcmd_ioctl(int fd, int request, zfs_cmd_t *zc) if (zfs_ioctl_version >= ZFS_IOCVER_DEADMAN) { switch (zfs_ioctl_version) { + case ZFS_IOCVER_INLANES: + cflag = ZFS_CMD_COMPAT_INLANES; + break; case ZFS_IOCVER_RESUME: cflag = ZFS_CMD_COMPAT_RESUME; break; From owner-svn-src-stable-10@freebsd.org Sat Aug 5 08:37:39 2017 Return-Path: Delivered-To: svn-src-stable-10@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 AE644DC67EA; Sat, 5 Aug 2017 08:37:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DD0E6B576; Sat, 5 Aug 2017 08:37:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v758bcQe017903; Sat, 5 Aug 2017 08:37:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v758bc2Q017902; Sat, 5 Aug 2017 08:37:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708050837.v758bc2Q017902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 5 Aug 2017 08:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322081 - stable/10/sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/10/sys/sys X-SVN-Commit-Revision: 322081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Aug 2017 08:37:39 -0000 Author: mav Date: Sat Aug 5 08:37:38 2017 New Revision: 322081 URL: https://svnweb.freebsd.org/changeset/base/322081 Log: MFC r321685: Fix IORDY bits definition. According to the ATA specs, IORDYDIS should be bit 10, IORDY -- bit 11. PR: 221049 Submitted by: aaron.styx@baesystems.com Modified: stable/10/sys/sys/ata.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/ata.h ============================================================================== --- stable/10/sys/sys/ata.h Sat Aug 5 08:37:08 2017 (r322080) +++ stable/10/sys/sys/ata.h Sat Aug 5 08:37:38 2017 (r322081) @@ -68,8 +68,8 @@ struct ata_params { /*049*/ u_int16_t capabilities1; #define ATA_SUPPORT_DMA 0x0100 #define ATA_SUPPORT_LBA 0x0200 -#define ATA_SUPPORT_IORDY 0x0400 -#define ATA_SUPPORT_IORDYDIS 0x0800 +#define ATA_SUPPORT_IORDYDIS 0x0400 +#define ATA_SUPPORT_IORDY 0x0800 #define ATA_SUPPORT_OVERLAP 0x4000 /*050*/ u_int16_t capabilities2; From owner-svn-src-stable-10@freebsd.org Sat Aug 5 12:33:02 2017 Return-Path: Delivered-To: svn-src-stable-10@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 DB244DD39D4; Sat, 5 Aug 2017 12:33:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4B1573A87; Sat, 5 Aug 2017 12:33:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75CX1Pi016179; Sat, 5 Aug 2017 12:33:01 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75CX1GJ016171; Sat, 5 Aug 2017 12:33:01 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708051233.v75CX1GJ016171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 5 Aug 2017 12:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322094 - in stable/10: . gnu/usr.bin lib share/mk tools/build/mk tools/build/options usr.bin usr.sbin X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in stable/10: . gnu/usr.bin lib share/mk tools/build/mk tools/build/options usr.bin usr.sbin X-SVN-Commit-Revision: 322094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Aug 2017 12:33:03 -0000 Author: marius Date: Sat Aug 5 12:33:00 2017 New Revision: 322094 URL: https://svnweb.freebsd.org/changeset/base/322094 Log: MFC: r306375 Add a WITHOUT_DIALOG src.conf(5) knob. It also turns off dependencies (bsdinstall, bsdconfig, dpv, tzsetup). Added: stable/10/tools/build/options/WITHOUT_DIALOG - copied unchanged from r306375, head/tools/build/options/WITHOUT_DIALOG Modified: stable/10/Makefile.inc1 stable/10/gnu/usr.bin/Makefile stable/10/lib/Makefile stable/10/share/mk/bsd.own.mk stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.bin/Makefile stable/10/usr.sbin/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Sat Aug 5 10:03:47 2017 (r322093) +++ stable/10/Makefile.inc1 Sat Aug 5 12:33:00 2017 (r322094) @@ -1713,13 +1713,17 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ ${_cddl_lib_libzfs_core} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_lib_libldns} \ - ${_secure_lib_libssh} ${_secure_lib_libssl} \ - gnu/lib/libdialog + ${_secure_lib_libssh} ${_secure_lib_libssl} .if ${MK_GNUCXX} != no _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++ gnu/lib/libstdc++__L: lib/msun__L .endif +.if ${MK_DIALOG} != "no" +_prebuild_libs+= gnu/lib/libdialog +gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L +.endif + .if ${MK_LIBCPLUSPLUS} != "no" _prebuild_libs+= lib/libc++ .endif @@ -1850,8 +1854,6 @@ _lib_libypclnt= lib/libypclnt .if ${MK_OPENSSL} == "no" lib/libradius__L: lib/libmd__L .endif - -gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L .for _lib in ${_prereq_libs} ${_lib}__PL: .PHONY .MAKE Modified: stable/10/gnu/usr.bin/Makefile ============================================================================== --- stable/10/gnu/usr.bin/Makefile Sat Aug 5 10:03:47 2017 (r322093) +++ stable/10/gnu/usr.bin/Makefile Sat Aug 5 12:33:00 2017 (r322094) @@ -4,7 +4,7 @@ SUBDIR= ${_binutils} \ ${_cc} \ - dialog \ + ${_dialog} \ diff \ diff3 \ ${_dtc} \ @@ -24,6 +24,10 @@ _gperf= gperf .if ${MK_GROFF} != "no" _groff= groff .endif +.endif + +.if ${MK_DIALOG} != "no" +_dialog= dialog .endif .if ${MK_GPL_DTC} != "no" Modified: stable/10/lib/Makefile ============================================================================== --- stable/10/lib/Makefile Sat Aug 5 10:03:47 2017 (r322093) +++ stable/10/lib/Makefile Sat Aug 5 12:33:00 2017 (r322094) @@ -40,7 +40,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libdevctl \ libdevinfo \ libdevstat \ - libdpv \ + ${_libdpv} \ libdwarf \ libedit \ ${_libefi} \ @@ -162,6 +162,10 @@ _libbsnmp= libbsnmp .if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT) _clang= clang +.endif + +.if ${MK_DIALOG} != "no" +_libdpv= libdpv .endif .if ${MK_FILE} != "no" Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Sat Aug 5 10:03:47 2017 (r322093) +++ stable/10/share/mk/bsd.own.mk Sat Aug 5 12:33:00 2017 (r322094) @@ -288,6 +288,7 @@ __DEFAULT_YES_OPTIONS = \ CRYPT \ CTM \ CXX \ + DIALOG \ DICT \ DYNAMICROOT \ ED_CRYPTO \ @@ -549,6 +550,10 @@ MK_KERBEROS:= no .if ${MK_CXX} == "no" MK_CLANG:= no MK_GROFF:= no +.endif + +.if ${MK_DIALOG} == "no" +MK_BSDINSTALL:= no .endif .if ${MK_MAIL} == "no" Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Aug 5 10:03:47 2017 (r322093) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Aug 5 12:33:00 2017 (r322094) @@ -1057,6 +1057,27 @@ OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/libexec/cc1plus .endif +.if ${MK_DIALOG} == no +OLD_FILES+=usr/bin/dialog +OLD_FILES+=usr/bin/dpv +OLD_FILES+=usr/lib/libdialog.a +OLD_FILES+=usr/lib/libdialog.so +OLD_FILES+=usr/lib/libdialog.so.8 +OLD_FILES+=usr/lib/libdialog_p.a +OLD_FILES+=usr/lib/libdpv.a +OLD_FILES+=usr/lib/libdpv.so +OLD_FILES+=usr/lib/libdpv.so.1 +OLD_FILES+=usr/lib/libdpv_p.a +OLD_FILES+=usr/sbin/bsdconfig +OLD_FILES+=usr/sbin/tzsetup +OLD_FILES+=usr/share/man/man1/dialog.1.gz +OLD_FILES+=usr/share/man/man1/dpv.1.gz +OLD_FILES+=usr/share/man/man3/dialog.3.gz +OLD_FILES+=usr/share/man/man3/dpv.3.gz +OLD_FILES+=usr/share/man/man8/tzsetup.8.gz +OLD_FILES+=usr/share/man/man8/bsdconfig.8.gz +.endif + .if ${MK_FMTREE} == no OLD_FILES+=usr/sbin/fmtree OLD_FILES+=usr/share/man/man8/fmtree.8.gz Copied: stable/10/tools/build/options/WITHOUT_DIALOG (from r306375, head/tools/build/options/WITHOUT_DIALOG) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_DIALOG Sat Aug 5 12:33:00 2017 (r322094, copy of r306375, head/tools/build/options/WITHOUT_DIALOG) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build dialog(1), dialog(1,3), and dpv(1,3). Modified: stable/10/usr.bin/Makefile ============================================================================== --- stable/10/usr.bin/Makefile Sat Aug 5 10:03:47 2017 (r322093) +++ stable/10/usr.bin/Makefile Sat Aug 5 12:33:00 2017 (r322094) @@ -37,7 +37,7 @@ SUBDIR= alias \ ctlstat \ cut \ dirname \ - dpv \ + ${_dpv} \ du \ elf2aout \ elfdump \ @@ -225,6 +225,10 @@ SUBDIR+= calendar .if ${MK_CLANG} != "no" _clang= clang +.endif + +.if ${MK_DIALOG} != "no" +_dpv= dpv .endif .if ${MK_EE} != "no" Modified: stable/10/usr.sbin/Makefile ============================================================================== --- stable/10/usr.sbin/Makefile Sat Aug 5 10:03:47 2017 (r322093) +++ stable/10/usr.sbin/Makefile Sat Aug 5 12:33:00 2017 (r322094) @@ -6,7 +6,7 @@ SUBDIR= adduser \ arp \ binmiscctl \ - bsdconfig \ + ${_bsdconfig} \ camdd \ cdcontrol \ chkgrp \ @@ -89,7 +89,7 @@ SUBDIR= adduser \ tcpdump \ traceroute \ trpt \ - tzsetup \ + ${_tzsetup} \ uefisign \ ugidfw \ vigr \ @@ -150,6 +150,11 @@ SUBDIR+= ctm .if ${MK_CXGBETOOL} != "no" SUBDIR+= cxgbetool +.endif + +.if ${MK_DIALOG} != "no" +_bsdconfig= bsdconfig +_tzsetup= tzsetup .endif .if ${MK_FLOPPY} != "no" From owner-svn-src-stable-10@freebsd.org Sat Aug 5 12:34:33 2017 Return-Path: Delivered-To: svn-src-stable-10@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 0B728DD3B0C; Sat, 5 Aug 2017 12:34:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE55673BF9; Sat, 5 Aug 2017 12:34:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75CYVZP016264; Sat, 5 Aug 2017 12:34:31 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75CYV3P016263; Sat, 5 Aug 2017 12:34:31 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708051234.v75CYV3P016263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 5 Aug 2017 12:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322095 - stable/10/share/man/man5 X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/10/share/man/man5 X-SVN-Commit-Revision: 322095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Aug 2017 12:34:33 -0000 Author: marius Date: Sat Aug 5 12:34:31 2017 New Revision: 322095 URL: https://svnweb.freebsd.org/changeset/base/322095 Log: Regenerate src.conf.5 after r322094. Modified: stable/10/share/man/man5/src.conf.5 Modified: stable/10/share/man/man5/src.conf.5 ============================================================================== --- stable/10/share/man/man5/src.conf.5 Sat Aug 5 12:33:00 2017 (r322094) +++ stable/10/share/man/man5/src.conf.5 Sat Aug 5 12:34:31 2017 (r322095) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: stable/10/tools/build/options/makeman 318614 2017-05-22 06:08:20Z ngie .\" $FreeBSD$ -.Dd July 5, 2017 +.Dd August 5, 2017 .Dt SRC.CONF 5 .Os .Sh NAME @@ -371,6 +371,15 @@ The debug files will be placed in a subdirectory of .Pa /usr/lib/debug and are located automatically by .Xr gdb 1 . +.It Va WITHOUT_DIALOG +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_DIALOG 322094 2017-08-05 12:33:00Z marius +Set to not build dialog(1), dialog(1,3), and dpv(1,3). +When set, it also enforces the following options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_BSDINSTALL +.El .It Va WITHOUT_DICT .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru Set to not build the Webster dictionary files. From owner-svn-src-stable-10@freebsd.org Sat Aug 5 12:54:09 2017 Return-Path: Delivered-To: svn-src-stable-10@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 14915DD4C0C; Sat, 5 Aug 2017 12:54:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D531874748; Sat, 5 Aug 2017 12:54:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75Cs8kY024504; Sat, 5 Aug 2017 12:54:08 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75Cs789024498; Sat, 5 Aug 2017 12:54:07 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708051254.v75Cs789024498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 5 Aug 2017 12:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322096 - in stable/10: tools/build/mk usr.sbin usr.sbin/bsdconfig/timezone usr.sbin/tzsetup X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in stable/10: tools/build/mk usr.sbin usr.sbin/bsdconfig/timezone usr.sbin/tzsetup X-SVN-Commit-Revision: 322096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Aug 2017 12:54:09 -0000 Author: marius Date: Sat Aug 5 12:54:07 2017 New Revision: 322096 URL: https://svnweb.freebsd.org/changeset/base/322096 Log: MFC: r274394, r274399, r307802 - Default `bsdconfig timezone' and `tzsetup' to `-s' in a VM. - Hide dialog specific code behind HAVE_DIALOG. It allows to build a stripped down version (missing the dialog UI) but perfectly function tzsetup when world is built WITHOUT_DIALOG. Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.sbin/Makefile stable/10/usr.sbin/bsdconfig/timezone/timezone stable/10/usr.sbin/tzsetup/Makefile stable/10/usr.sbin/tzsetup/tzsetup.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Aug 5 12:34:31 2017 (r322095) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Aug 5 12:54:07 2017 (r322096) @@ -1069,12 +1069,10 @@ OLD_FILES+=usr/lib/libdpv.so OLD_FILES+=usr/lib/libdpv.so.1 OLD_FILES+=usr/lib/libdpv_p.a OLD_FILES+=usr/sbin/bsdconfig -OLD_FILES+=usr/sbin/tzsetup OLD_FILES+=usr/share/man/man1/dialog.1.gz OLD_FILES+=usr/share/man/man1/dpv.1.gz OLD_FILES+=usr/share/man/man3/dialog.3.gz OLD_FILES+=usr/share/man/man3/dpv.3.gz -OLD_FILES+=usr/share/man/man8/tzsetup.8.gz OLD_FILES+=usr/share/man/man8/bsdconfig.8.gz .endif Modified: stable/10/usr.sbin/Makefile ============================================================================== --- stable/10/usr.sbin/Makefile Sat Aug 5 12:34:31 2017 (r322095) +++ stable/10/usr.sbin/Makefile Sat Aug 5 12:54:07 2017 (r322096) @@ -89,7 +89,7 @@ SUBDIR= adduser \ tcpdump \ traceroute \ trpt \ - ${_tzsetup} \ + tzsetup \ uefisign \ ugidfw \ vigr \ @@ -154,7 +154,6 @@ SUBDIR+= cxgbetool .if ${MK_DIALOG} != "no" _bsdconfig= bsdconfig -_tzsetup= tzsetup .endif .if ${MK_FLOPPY} != "no" Modified: stable/10/usr.sbin/bsdconfig/timezone/timezone ============================================================================== --- stable/10/usr.sbin/bsdconfig/timezone/timezone Sat Aug 5 12:34:31 2017 (r322095) +++ stable/10/usr.sbin/bsdconfig/timezone/timezone Sat Aug 5 12:54:07 2017 (r322096) @@ -62,7 +62,7 @@ _PATH_WALL_CMOS_CLOCK="/etc/wall_cmos_clock" REALLYDOIT=1 REINSTALL= USEDIALOG=1 -SKIPUTC= +SKIPUTC= # See MAIN VERBOSE= TZ_OR_FAIL= CHROOTENV= @@ -118,6 +118,9 @@ dialog_menu_main() } ############################################################ MAIN + +# Skip initial question regarding UTC v. Wall-Clock time if run in VM +[ "$( sysctl -n kern.vm_guest 2> /dev/null )" = "none" ] || SKIPUTC=1 # Incorporate rc-file if it exists [ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" Modified: stable/10/usr.sbin/tzsetup/Makefile ============================================================================== --- stable/10/usr.sbin/tzsetup/Makefile Sat Aug 5 12:34:31 2017 (r322095) +++ stable/10/usr.sbin/tzsetup/Makefile Sat Aug 5 12:54:07 2017 (r322096) @@ -1,16 +1,18 @@ # $FreeBSD$ +.include + PROG= tzsetup MAN= tzsetup.8 -CFLAGS+= -I${.CURDIR}/../../contrib/dialog -I. +CFLAGS+= -I. +.if ${MK_DIALOG} != no WARNS?= 3 - +CFLAGS+= -I${.CURDIR}/../../contrib/dialog -DHAVE_DIALOG DPADD= ${LIBDIALOG} ${LIBM} LDADD= -ldialog -lm - -.include +.endif .if ${MK_NCURSESW} == "no" DPADD+= ${LIBNCURSES} Modified: stable/10/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/10/usr.sbin/tzsetup/tzsetup.c Sat Aug 5 12:34:31 2017 (r322095) +++ stable/10/usr.sbin/tzsetup/tzsetup.c Sat Aug 5 12:54:07 2017 (r322096) @@ -47,8 +47,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#ifdef HAVE_DIALOG #include +#endif #define _PATH_ZONETAB "/usr/share/zoneinfo/zone.tab" #define _PATH_ISO3166 "/usr/share/misc/iso3166" @@ -71,6 +74,19 @@ __FBSDID("$FreeBSD$"); #define DITEM_LEAVE_MENU (1 << 16) #define DITEM_RECREATE (1 << 18) +static char path_zonetab[MAXPATHLEN], path_iso3166[MAXPATHLEN], + path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], + path_db[MAXPATHLEN], path_wall_cmos_clock[MAXPATHLEN]; + +static int reallydoit = 1; +static int reinstall = 0; +static char *chrootenv = NULL; + +static void usage(void); +static int install_zoneinfo(const char *zoneinfo); +static int install_zoneinfo_file(const char *zoneinfo_file); + +#ifdef HAVE_DIALOG /* for use in describing more exotic behaviors */ typedef struct dialogMenuItem { char *prompt; @@ -186,20 +202,10 @@ again: return result; } -static char path_zonetab[MAXPATHLEN], path_iso3166[MAXPATHLEN], - path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], - path_db[MAXPATHLEN], path_wall_cmos_clock[MAXPATHLEN]; - -static int reallydoit = 1; -static int reinstall = 0; static int usedialog = 1; -static char *chrootenv = NULL; -static void usage(void); static int confirm_zone(const char *filename); static int continent_country_menu(dialogMenuItem *); -static int install_zoneinfo(const char *zoneinfo); -static int install_zoneinfo_file(const char *zoneinfo_file); static int set_zone_multi(dialogMenuItem *); static int set_zone_whole_country(dialogMenuItem *); static int set_zone_menu(dialogMenuItem *); @@ -643,6 +649,53 @@ set_zone_utc(void) } static int +confirm_zone(const char *filename) +{ + char title[64], prompt[64]; + time_t t = time(0); + struct tm *tm; + int rv; + + setenv("TZ", filename == NULL ? "" : filename, 1); + tzset(); + tm = localtime(&t); + + snprintf(title, sizeof(title), "Confirmation"); + snprintf(prompt, sizeof(prompt), + "Does the abbreviation `%s' look reasonable?", tm->tm_zone); + rv = !dialog_yesno(title, prompt, 5, 72); + return (rv); +} + +static int +set_zone_multi(dialogMenuItem *dmi) +{ + struct zone *zp = dmi->data; + int rv; + + if (!confirm_zone(zp->filename)) + return (DITEM_FAILURE | DITEM_RECREATE); + + rv = install_zoneinfo(zp->filename); + return (rv); +} + +static int +set_zone_whole_country(dialogMenuItem *dmi) +{ + struct country *cp = dmi->data; + int rv; + + if (!confirm_zone(cp->filename)) + return (DITEM_FAILURE | DITEM_RECREATE); + + rv = install_zoneinfo(cp->filename); + return (rv); +} + +#endif + +static int install_zoneinfo_file(const char *zoneinfo_file) { char buf[1024]; @@ -671,9 +724,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Creating symbolic link %s to %s", path_localtime, zoneinfo_file); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); #endif @@ -684,9 +739,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Could not delete %s: %s", path_localtime, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); @@ -696,9 +753,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Could not delete %s: %s", path_db, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); @@ -707,9 +766,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(title, sizeof(title), "Done"); snprintf(prompt, sizeof(prompt), "Removed %s", path_localtime); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); #endif return (DITEM_LEAVE_MENU); @@ -722,9 +783,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Could not open %s: %s", zoneinfo_file, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -733,10 +796,12 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Could not unlink %s: %s", path_localtime, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) { snprintf(title, sizeof(title), "Error"); dialog_msgbox(title, prompt, 8, 72, 1); } else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -748,9 +813,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Could not open %s: %s", path_localtime, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -764,9 +831,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Error copying %s to %s %s", zoneinfo_file, path_localtime, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); /* Better to leave none than a corrupt one. */ unlink(path_localtime); @@ -780,9 +849,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Cannot access %s: %s", zoneinfo_file, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -790,10 +861,12 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Could not unlink %s: %s", path_localtime, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) { snprintf(title, sizeof(title), "Error"); dialog_msgbox(title, prompt, 8, 72, 1); } else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -803,9 +876,11 @@ install_zoneinfo_file(const char *zoneinfo_file) "Cannot create symbolic link %s to %s: %s", path_localtime, zoneinfo_file, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -821,9 +896,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Created symbolic link from %s to %s", zoneinfo_file, path_localtime); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); #endif } /* reallydoit */ @@ -854,51 +931,6 @@ install_zoneinfo(const char *zoneinfo) return (rv); } -static int -confirm_zone(const char *filename) -{ - char title[64], prompt[64]; - time_t t = time(0); - struct tm *tm; - int rv; - - setenv("TZ", filename == NULL ? "" : filename, 1); - tzset(); - tm = localtime(&t); - - snprintf(title, sizeof(title), "Confirmation"); - snprintf(prompt, sizeof(prompt), - "Does the abbreviation `%s' look reasonable?", tm->tm_zone); - rv = !dialog_yesno(title, prompt, 5, 72); - return (rv); -} - -static int -set_zone_multi(dialogMenuItem *dmi) -{ - struct zone *zp = dmi->data; - int rv; - - if (!confirm_zone(zp->filename)) - return (DITEM_FAILURE | DITEM_RECREATE); - - rv = install_zoneinfo(zp->filename); - return (rv); -} - -static int -set_zone_whole_country(dialogMenuItem *dmi) -{ - struct country *cp = dmi->data; - int rv; - - if (!confirm_zone(cp->filename)) - return (DITEM_FAILURE | DITEM_RECREATE); - - rv = install_zoneinfo(cp->filename); - return (rv); -} - static void usage(void) { @@ -911,10 +943,21 @@ usage(void) int main(int argc, char **argv) { +#ifdef HAVE_DIALOG char title[64], prompt[128]; - int c, fd, rv, skiputc; + int fd; +#endif + int c, rv, skiputc; + char vm_guest[16] = ""; + size_t len = sizeof(vm_guest); skiputc = 0; + + /* Default skiputc to 1 for VM guests */ + if (sysctlbyname("kern.vm_guest", vm_guest, &len, NULL, 0) == 0 && + strcmp(vm_guest, "none") != 0) + skiputc = 1; + while ((c = getopt(argc, argv, "C:nrs")) != -1) { switch(c) { case 'C': @@ -925,7 +968,9 @@ main(int argc, char **argv) break; case 'r': reinstall = 1; +#ifdef HAVE_DIALOG usedialog = 0; +#endif break; case 's': skiputc = 1; @@ -989,12 +1034,15 @@ main(int argc, char **argv) struct stat sb; if (stat(argv[optind], &sb) != 0) { +#ifdef HAVE_DIALOG usedialog = 0; +#endif rv = install_zoneinfo(argv[optind]); exit(rv & ~DITEM_LEAVE_MENU); } /* FALLTHROUGH */ } +#ifdef HAVE_DIALOG read_iso3166_table(); read_zones(); @@ -1055,5 +1103,8 @@ main(int argc, char **argv) dlg_clear(); end_dialog(); +#else + usage(); +#endif return (0); } From owner-svn-src-stable-10@freebsd.org Sat Aug 5 14:49:42 2017 Return-Path: Delivered-To: svn-src-stable-10@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 086E1DAB76F; Sat, 5 Aug 2017 14:49:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C12D27793D; Sat, 5 Aug 2017 14:49:41 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75Enewk068903; Sat, 5 Aug 2017 14:49:40 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75EneLs068902; Sat, 5 Aug 2017 14:49:40 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708051449.v75EneLs068902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 5 Aug 2017 14:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322098 - stable/10/usr.sbin/tzsetup X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/10/usr.sbin/tzsetup X-SVN-Commit-Revision: 322098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Aug 2017 14:49:42 -0000 Author: marius Date: Sat Aug 5 14:49:40 2017 New Revision: 322098 URL: https://svnweb.freebsd.org/changeset/base/322098 Log: Fix a stable/10-specific mismerge in r322096; the MK_NCURSESW handling should be within the MK_DIALOG block as libncurses{,w} isn't required when building tzsetup(8) without dialog(3) support. Modified: stable/10/usr.sbin/tzsetup/Makefile Modified: stable/10/usr.sbin/tzsetup/Makefile ============================================================================== --- stable/10/usr.sbin/tzsetup/Makefile Sat Aug 5 12:59:03 2017 (r322097) +++ stable/10/usr.sbin/tzsetup/Makefile Sat Aug 5 14:49:40 2017 (r322098) @@ -12,14 +12,13 @@ WARNS?= 3 CFLAGS+= -I${.CURDIR}/../../contrib/dialog -DHAVE_DIALOG DPADD= ${LIBDIALOG} ${LIBM} LDADD= -ldialog -lm -.endif - .if ${MK_NCURSESW} == "no" DPADD+= ${LIBNCURSES} LDADD+= -lncurses .else DPADD+= ${LIBNCURSESW} LDADD+= -lncursesw +.endif .endif .include From owner-svn-src-stable-10@freebsd.org Sat Aug 5 16:55:08 2017 Return-Path: Delivered-To: svn-src-stable-10@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 C44F6DBD5B5; Sat, 5 Aug 2017 16:55:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A05447F1C9; Sat, 5 Aug 2017 16:55:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75Gt7Up021045; Sat, 5 Aug 2017 16:55:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75Gt7uv021039; Sat, 5 Aug 2017 16:55:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708051655.v75Gt7uv021039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 5 Aug 2017 16:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322100 - in stable/10: etc/mtree share/mk share/zoneinfo share/zoneinfo/tests tools/build/options X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc/mtree share/mk share/zoneinfo share/zoneinfo/tests tools/build/options X-SVN-Commit-Revision: 322100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Aug 2017 16:55:08 -0000 Author: ngie Date: Sat Aug 5 16:55:07 2017 New Revision: 322100 URL: https://svnweb.freebsd.org/changeset/base/322100 Log: MFC r320702,r320703: r320702: Formalize LEAPSECONDS and OLDTIMEZONES in share/zoneinfo/... as `MK_ZONEINFO_LEAPSECONDS_SUPPORT == yes` and `MK_ZONEINFO_OLD_TIMEZONES_SUPPORT == yes`. Keep `LEAPSECONDS` and `OLDTIMEZONES` for backwards compatibility, but print out a warning notifying users that they should use the new variables, in an effort to migrate them to the variables. This is being done mostly for automated build tools, etc, that might rely on these variables being set. The variables will be removed in the future on ^/head, e.g., after ^/stable/12 is cut. Relnotes: yes r320703: Add tests to help verify Links functionality for .../contrib/tzdata/backwards MFC with: r320702 Added: stable/10/share/zoneinfo/tests/ - copied from r320703, head/share/zoneinfo/tests/ stable/10/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT - copied unchanged from r320702, head/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT stable/10/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT - copied unchanged from r320702, head/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/share/mk/bsd.own.mk stable/10/share/zoneinfo/Makefile stable/10/share/zoneinfo/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Sat Aug 5 16:44:31 2017 (r322099) +++ stable/10/etc/mtree/BSD.tests.dist Sat Aug 5 16:55:07 2017 (r322100) @@ -374,6 +374,8 @@ .. .. .. + zoneinfo + .. .. sys acl Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Sat Aug 5 16:44:31 2017 (r322099) +++ stable/10/share/mk/bsd.own.mk Sat Aug 5 16:55:07 2017 (r322100) @@ -411,8 +411,11 @@ __DEFAULT_NO_OPTIONS = \ SHARED_TOOLCHAIN \ SVN \ TESTS \ - USB_GADGET_EXAMPLES + USB_GADGET_EXAMPLES \ + ZONEINFO_LEAPSECONDS_SUPPORT \ + ZONEINFO_OLD_TIMEZONES_SUPPORT \ + # # Default behaviour of some options depends on the architecture. Unfortunately # this means that we have to test TARGET_ARCH (the buildworld case) as well @@ -584,6 +587,11 @@ MK_BINUTILS:= no MK_CLANG:= no MK_GCC:= no MK_GDB:= no +.endif + +.if ${MK_ZONEINFO} == "no" +MK_ZONEINFO_LEAPSECONDS_SUPPORT:= no +MK_ZONEINFO_OLD_TIMEZONES_SUPPORT:= no .endif .if ${MK_CLANG} == "no" Modified: stable/10/share/zoneinfo/Makefile ============================================================================== --- stable/10/share/zoneinfo/Makefile Sat Aug 5 16:44:31 2017 (r322099) +++ stable/10/share/zoneinfo/Makefile Sat Aug 5 16:55:07 2017 (r322100) @@ -28,12 +28,24 @@ # $ svn update # Commit message: "MFV of tzdata2008X" # +.include + CLEANFILES+= yearistype CLEANDIRS+= builddir CONTRIBDIR= ${.CURDIR}/../../contrib/tzdata/ .PATH: ${CONTRIBDIR} .if defined(LEAPSECONDS) +.warning "Using backwards compatibility variable for LEAPSECONDS; please use WITH_ZONEINFO_LEAPSECONDS_SUPPORT instead" +MK_ZONEINFO_LEAPSECONDS_SUPPORT= yes +.endif + +.if defined(OLDTIMEZONES) +.warning "Using backwards compatibility variable for OLDTIMEZONES; please use WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT instead" +MK_ZONEINFO_OLD_TIMEZONES_SUPPORT= yes +.endif + +.if ${MK_ZONEINFO_LEAPSECONDS_SUPPORT} != "no" LEAPFILE= -L ${CONTRIBDIR}leapseconds .else LEAPFILE= @@ -43,7 +55,7 @@ TZFILES= africa antarctica asia australasia etcetera e factory northamerica southamerica POSIXRULES= America/New_York -.if defined(OLDTIMEZONES) +.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no" TZFILES+= backward systemv .endif @@ -67,7 +79,7 @@ TZBUILDSUBDIRS= \ Pacific \ SystemV -.if defined(OLDTIMEZONES) +.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no" TZBUILDSUBDIRS+= US Mexico Chile Canada Brazil .endif @@ -110,5 +122,9 @@ afterinstall: else \ echo "Run tzsetup(8) manually to update /etc/localtime."; \ fi + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Modified: stable/10/share/zoneinfo/tests/Makefile ============================================================================== --- head/share/zoneinfo/tests/Makefile Thu Jul 6 04:30:06 2017 (r320703) +++ stable/10/share/zoneinfo/tests/Makefile Sat Aug 5 16:55:07 2017 (r322100) @@ -1,11 +1,10 @@ # $FreeBSD$ -.include +.include .PATH: ${SRCTOP}/contrib/tzdata -PACKAGE= tests - +FILESGROUPS= FILES FILESGROUPS+= TESTFILES .if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no" @@ -14,7 +13,6 @@ TESTFILES+= backward .endif TESTFILES+= zoneinfo_common.sh -TESTFILESPACKAGE= ${PACKAGE} TESTFILESDIR= ${TESTSDIR} .include Copied: stable/10/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT (from r320702, head/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT Sat Aug 5 16:55:07 2017 (r322100, copy of r320702, head/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build leapsecond information in to the timezone database. Copied: stable/10/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT (from r320702, head/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT Sat Aug 5 16:55:07 2017 (r322100, copy of r320702, head/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build backward compatibility timezone aliases in to the timezone +database. From owner-svn-src-stable-10@freebsd.org Sat Aug 5 17:01:01 2017 Return-Path: Delivered-To: svn-src-stable-10@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 CDE77DBDDB2; Sat, 5 Aug 2017 17:01:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A6397F982; Sat, 5 Aug 2017 17:01:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75H10W8022312; Sat, 5 Aug 2017 17:01:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75H102u022311; Sat, 5 Aug 2017 17:01:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708051701.v75H102u022311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 5 Aug 2017 17:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322103 - stable/10/share/man/man5 X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/share/man/man5 X-SVN-Commit-Revision: 322103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Aug 2017 17:01:01 -0000 Author: ngie Date: Sat Aug 5 17:01:00 2017 New Revision: 322103 URL: https://svnweb.freebsd.org/changeset/base/322103 Log: Regenerate src.conf(5) per r322100 Modified: stable/10/share/man/man5/src.conf.5 Modified: stable/10/share/man/man5/src.conf.5 ============================================================================== --- stable/10/share/man/man5/src.conf.5 Sat Aug 5 17:00:22 2017 (r322102) +++ stable/10/share/man/man5/src.conf.5 Sat Aug 5 17:01:00 2017 (r322103) @@ -1213,6 +1213,21 @@ Set to not build ZFS file system. .It Va WITHOUT_ZONEINFO .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ZONEINFO 235342 2012-05-12 16:12:36Z gjb Set to not build the timezone database. +When set, it also enforces the following options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_ZONEINFO_LEAPSECONDS_SUPPORT +.It +.Va WITHOUT_ZONEINFO_OLD_TIMEZONES_SUPPORT +.El +.It Va WITH_ZONEINFO_LEAPSECONDS_SUPPORT +.\" from FreeBSD: stable/10/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT 322100 2017-08-05 16:54:40Z ngie +Set to build leapsecond information in to the timezone database. +.It Va WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT +.\" from FreeBSD: stable/10/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT 322100 2017-08-05 16:54:40Z ngie +Set to build backward compatibility timezone aliases in to the timezone +database. .El .Sh FILES .Bl -tag -compact -width Pa From owner-svn-src-stable-10@freebsd.org Sat Aug 5 17:02:55 2017 Return-Path: Delivered-To: svn-src-stable-10@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 5127DDBE3F1; Sat, 5 Aug 2017 17:02:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF35B7FF5A; Sat, 5 Aug 2017 17:02:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75H2s7d025361; Sat, 5 Aug 2017 17:02:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75H2s9u025360; Sat, 5 Aug 2017 17:02:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708051702.v75H2s9u025360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 5 Aug 2017 17:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322105 - stable/10/lib/libcrypt X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libcrypt X-SVN-Commit-Revision: 322105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Aug 2017 17:02:55 -0000 Author: ngie Date: Sat Aug 5 17:02:53 2017 New Revision: 322105 URL: https://svnweb.freebsd.org/changeset/base/322105 Log: MFC r321915: Remove bogus bsd.subdir.mk .include bsd.subdir.mk is included from bsd.obj.mk, which is included via bsd.lib.mk. Modified: stable/10/lib/libcrypt/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcrypt/Makefile ============================================================================== --- stable/10/lib/libcrypt/Makefile Sat Aug 5 17:01:58 2017 (r322104) +++ stable/10/lib/libcrypt/Makefile Sat Aug 5 17:02:53 2017 (r322105) @@ -45,4 +45,3 @@ SUBDIR+= tests .endif .include -.include