From owner-svn-src-head@freebsd.org Sun Jan 3 00:28:58 2016 Return-Path: Delivered-To: svn-src-head@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 D160AA530C6 for ; Sun, 3 Jan 2016 00:28:58 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 A74D31D9E for ; Sun, 3 Jan 2016 00:28:58 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sun, 3 Jan 2016 00:29:26 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id u030StfE026951; Sat, 2 Jan 2016 17:28:55 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1451780934.1369.129.camel@freebsd.org> Subject: Re: svn commit: r293064 - head/sys/boot/uboot/lib From: Ian Lepore To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 02 Jan 2016 17:28:54 -0700 In-Reply-To: <20160103101219.C1033@besplex.bde.org> References: <201601022255.u02Mtxe4043921@repo.freebsd.org> <20160103101219.C1033@besplex.bde.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 00:28:58 -0000 On Sun, 2016-01-03 at 10:59 +1100, Bruce Evans wrote: > On Sat, 2 Jan 2016, Ian Lepore wrote: > > > Log: > > Cast pointer through uintptr_t on the way to uint64_t to squelch a warning. > > > > Modified: head/sys/boot/uboot/lib/copy.c > > ============================================================================== > > --- head/sys/boot/uboot/lib/copy.c Sat Jan 2 22:31:14 2016 (r293063) > > +++ head/sys/boot/uboot/lib/copy.c Sat Jan 2 22:55:59 2016 (r293064) > > @@ -100,7 +100,7 @@ uboot_loadaddr(u_int type, void *data, u > > > > biggest_block = 0; > > biggest_size = 0; > > - subldr = rounddown2((uint64_t)_start, KERN_ALIGN); > > + subldr = rounddown2((uint64_t)(uintptr_t)_start, KERN_ALIGN); > > eubldr = roundup2((uint64_t)uboot_heap_end, KERN_ALIGN); > > for (i = 0; i < si->mr_no; i++) { > > if (si->mr[i].flags != MR_ATTR_DRAM) > > This gives 1 more bogus cast here: > - _start is a function pointer, so it should be cast to uintfptr_t > - rounddown2() acts on any integer and subldr is an integer, and both of the > integers are unsigned, and KERN_ALIGN is a small signed int, and so there > is no need for any further cast, except possibily on arches with > uintfptr_t larger than uint64_t or the type of subldr where the compiler > warns about downwards cast, but then the downcast may be a bug since it > just breaks the warning > > - if there is a need for a further cast, then it should be of rounddown2(), > not of one of its args, so that the args and the internals of rounddown2() > don't have to be analysed for promotions. I did some of did analysis > above -- KERN_ALIGN is a small int, so its promotion is int and that is > presumably smaller than uintfptr_t. > > rounddown2() is of course undocumented, but everyone knows that macros > like it are supposed to mix the args without any casts and end up with > a type related to the arg types. > > - subldr actually has type uintptr_t, so the old cast to uint64_t was > just a double type mismatch (mismatched with both the source and target) > and leaving it makes it just change the correct type to a wrong one > before converting back to the correct type. Since you cast to uintptr_t > and not uintfptr_t and KERN_ALIGN is small int, the rvalue would already > have the same type as the lvalue unless it is messed up by the uint64_t > cast. > > - not quite similarly on the next line: > - the lvalue has type uintptr_t > - casting to uint64_t is wrong, as in the new version of the previous > line. uboot_heap_end already has type uintptr_t, and casting it to > uint64_t just breaks it or complicates the analysis: > - if uintptr_t is 64 bits, then casting to uint64_t has no effect > - if uintptr_t is 128 bits, then casting to uint64_t just breaks things > - if uintptr_t is 32, bits, then casting to uint64_t doesn't even > break things. > > There is an overflow problem in theory, but the bogus cast doesn't > fix the problem. roundup2() normally overflows if the address is > at a nonzero offset on the last "page" (of size KERN_ALIGN bytes > here). Then roundup2() should overflow to 0. On 32-bit arches, > the bogus cast avoids the overflow and gives a result of > 0x100000000. But since the rvalue has type uintptr_t, it cannot > represent this result, and the value overflows to 0 on assignment > instead of in roundup2(). > > roundup2() and its overflow problems are of course undocumented. > This analysis is at least partly wrong because you've missed the fact that the prior commit (that caused the warning I had to fix) changed the type of subldr, eubdlr, and friends to uint64_t. With the uintptr_t types, the theoretical overflow you mention was in fact an actual overflow on 32-bit hardware people use, which is why I'm fixing it (however ineptly). So while a rigorous analysis would have to conclude that rounddown2() can't create the overflow and thus the cast of its arg to 64 bits is unneeded, I wasn't really thinking that way at the time so I just cast the args in both of the rounding invocations to 64 bits. I had no idea there was such a thing as uintfptr_t, it does seem like that's the right one to use on _start. -- Ian From owner-svn-src-head@freebsd.org Sun Jan 3 01:24:53 2016 Return-Path: Delivered-To: svn-src-head@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 1F0D1A5F10F; Sun, 3 Jan 2016 01:24:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 955C7147B; Sun, 3 Jan 2016 01:24:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 24C931045F9D; Sun, 3 Jan 2016 12:24:45 +1100 (AEDT) Date: Sun, 3 Jan 2016 12:24:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293053 - head/sys/boot/uboot/lib In-Reply-To: <201601021816.u02IGOXQ060620@repo.freebsd.org> Message-ID: <20160103112530.Q1220@besplex.bde.org> References: <201601021816.u02IGOXQ060620@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=uh6MPLOrl7Xpo6US5dgA:9 a=9R64MTe1H_08cVun:21 a=cwHEBaPuE8GakeBG:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 01:24:53 -0000 On Sat, 2 Jan 2016, Ian Lepore wrote: > Log: > Use 64-bit math when finding a block of ram to hold the kernel. This fixes > a problem on 32-bit systems which have ram occupying the end of the physical > address space -- for example, a block of ram at 0x80000000 with a size of > 0x80000000 was overflowing 32 bit math and ending up with a calculated size > of zero. > > This is a fix for one of the two problems mentioned in the PR. Something > similar will need to be done on the kernel side before the PR is closed. I don't like this. It gives a type morass, and has no effect if uintptr_t has 64 bits, and is just broken when uintptr_t has more that 64-bits. The corresponding hack for 64-bit arches is to use uint128_t, and for 128-bit arches to use uint256_t, and that is more obviously excessive and more likely to expose type errors (for example, __uint128_t compiles, but is unprintable since printf() hasn't dreamed of its existence yet, and its existence breaks uintmax_t since it is larger than uintmax_t). I see that you committed related changes in many places. Only the one in arm/physmem.c looks right -- don't change types, but handle the top page specially. I once looked at vm to see how it handles this. It seemed to use (offset, size) pairs a lot where it would simpler to use offset+size except for the problem that this would overflow. This would avoid most problems with the top page. Eventually I decided that it didn't really care about the top page but was just doing this because it was over-engineered. > Modified: head/sys/boot/uboot/lib/copy.c > ============================================================================== > --- head/sys/boot/uboot/lib/copy.c Sat Jan 2 18:15:10 2016 (r293052) > +++ head/sys/boot/uboot/lib/copy.c Sat Jan 2 18:16:24 2016 (r293053) > @@ -69,11 +69,11 @@ uint64_t > uboot_loadaddr(u_int type, void *data, uint64_t addr) > { > struct sys_info *si; > - uintptr_t sblock, eblock, subldr, eubldr; > - uintptr_t biggest_block, this_block; > - size_t biggest_size, this_size; > + uint64_t sblock, eblock, subldr, eubldr; > + uint64_t biggest_block, this_block; > + uint64_t biggest_size, this_size; This obviously breaks the 128-bit case. I replied out of order about a fixup for the type morass created by this, and said that subldr and euldr have type uintptr_t. They only had this correct (less incorrect) type before this change. Making everything 64-bit mostly avoids the type morass but gives a lot of bloat in the 32-bit case. It doesn't completely avoid the type morass since sizeof() still gives type uint32_t in the 32-bit case. > @@ -100,14 +100,15 @@ uboot_loadaddr(u_int type, void *data, u > > biggest_block = 0; > biggest_size = 0; > - subldr = rounddown2((uintptr_t)_start, KERN_ALIGN); My previous reply was about this. This was correct except for using uintptr_t instead of uintfptr_t. > - eubldr = roundup2(uboot_heap_end, KERN_ALIGN); > + subldr = rounddown2((uint64_t)_start, KERN_ALIGN); This has various type errors -- see previous reply. > + eubldr = roundup2((uint64_t)uboot_heap_end, KERN_ALIGN); Most of the uintptr_t types were also wrong. vm_offset_t or vm_addr_t or vm_paddr_t or vm_size_t would be better (I think the boot code is low enough level to use these instead of Standard "portable" types). Except vm_addr_t doesn't exist. vm has its own type morass, but not enough complications to express the difference beteen offsets and addresses in the type (virtual addresses have to abuse vm_offset_t and physical offsets have to abuse vm_physaddr_t). OTOH, all these types except vm_paddr_t are the same, so it is too easy to misuse vm_size_t for an address of offset. Using uintptr_t was wrong since it is just a C type large enough to represent pointers. It has little relation to virtual addresses and no relation to physical addresses. It tends to be large enough to represent virtual addresses since it has to be large enough to represent all C pointers uniquely. But this is not required. Perhaps a general pointer has 36 bits but C pointers have only 32 bits, or C pointers have 36 bits but can be encoded uniquely in 32 bits and casting them to uint32_t does the encoding. Boot code and vm should operate at a lower level than C pointers and use raw offsets (probably represented as raw bits). Even casting pointers to uintptr_t is technically wrong. If this cast does special encoding, then it is probably not what is wanted. A recalcitrant implement of C could use the simple encoding of reversing all the bits. The resulting uintptr_t's would be useless for most existing (ab)uses of the result. Boot and vm code is low enough level to be honestly unportable and convert the bits using a type pun, or better memcpy(), or better still, portable using a conversion function that usually just casts through uintptr_t for virtual addresses. Bruce From owner-svn-src-head@freebsd.org Sun Jan 3 02:47:57 2016 Return-Path: Delivered-To: svn-src-head@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 99B67A5F13D for ; Sun, 3 Jan 2016 02:47:57 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (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 2EB8918D5 for ; Sun, 3 Jan 2016 02:47:56 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-wm0-x232.google.com with SMTP id f206so170809302wmf.0 for ; Sat, 02 Jan 2016 18:47:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=cOnX6bIqJ36lNThzoX6g/ewsV094UlgFIahdjLmUYYc=; b=Bk1tMTAOhDqTf8JYgdjT9i6qHGlTxyIGDBAhpyxQvp4A8uAazegJaMA40wUO2Bc+C2 QTSAnuF7sGE/ZiR1K9rpFST/TDk7bXjje8KzSH2NWeIOBTc3+8VWXruREmt7o626SFZd PsdTE1D2rD/A7rihFZc0dYRVl/kaB3VlwtWsKFTevQx/eNzgTsttZiygdo5ofhHF87NJ JFpSScNzdZl6G6gI6EaA5wZOdSY0EkAH1Sl6Vjct0POVv/wzLDDSeS4uP59QSQQIKU8p iLRddFvvjRvMXhg+hoqK7o5OAeptx64dVl55MsuqFNRSZcU1xWF8oIzwuopHFQhZm1gf KTVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=cOnX6bIqJ36lNThzoX6g/ewsV094UlgFIahdjLmUYYc=; b=DGCTMbdm6Dmhxts1fO2qUzTzDGEJv0S6DWHczPVOBr0wXRRQoArjU+mGK416/CffwU KWHws+sqka8zlnp4i68HixpbiXO68ZD4mGPo4z6I80MWHkKdmWpzP/1odLg0I/1P1SOq lTic1mHbA2G5bRec6iVGPtmI8JaG5KxlLS2nzekLyKjw9W9tBQX6P59sh27WqBd/h2Gv mIFsozMFX1Mdu0/pbQhxKLLvvnWcLyLyHTillAKtvv6NWLHGdTJYzYfUrWz9BWJllrvz oA+0gDKu2bCa712iKm5HaoBOvImc47Cwr0VwDdCGO+TeAXPI8M5w8/YWuBw+vJ25UGOV WmhA== X-Gm-Message-State: ALoCoQnwr47p1LxwW3KRsUtR8L1oubSPOeu5Uqp4//B5as6kVDZ9nEP455g8c8sd7bLMrQqzi35nJbBM1DBP1LrlCd/XwnjzFo0c9s8EDar/RoWX/ZnCcSg= MIME-Version: 1.0 X-Received: by 10.28.222.5 with SMTP id v5mr45556601wmg.94.1451789274961; Sat, 02 Jan 2016 18:47:54 -0800 (PST) Received: by 10.27.39.195 with HTTP; Sat, 2 Jan 2016 18:47:54 -0800 (PST) Received: by 10.27.39.195 with HTTP; Sat, 2 Jan 2016 18:47:54 -0800 (PST) In-Reply-To: <1451774206.1369.109.camel@freebsd.org> References: <201601022231.u02MVEb5037283@repo.freebsd.org> <1451774206.1369.109.camel@freebsd.org> Date: Sat, 2 Jan 2016 18:47:54 -0800 Message-ID: Subject: Re: svn commit: r293063 - head/sys/arm/arm From: Maxim Sobolev To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 02:47:57 -0000 Don't save commit message and just exit your editor. That should make it abort. Works with CVS, git and svn all the same. Killing your editor with -9 should do as well, as long it doesn't do periodic autosave of some sort. On Jan 2, 2016 2:37 PM, "Ian Lepore" wrote: > On Sat, 2016-01-02 at 22:31 +0000, Ian Lepore wrote: > > Author: ian > > Date: Sat Jan 2 22:31:14 2016 > > New Revision: 293063 > > URL: https://svnweb.freebsd.org/changeset/base/293063 > > > > Log: > > Work around problems that happen when there is ram at the end of the > > physical address space. > > > > Modified: > > head/sys/arm/arm/physmem.c > > > > Modified: head/sys/arm/arm/physmem.c > > > ============================================================================== > > --- head/sys/arm/arm/physmem.c> > Sat Jan 2 22:04:37 2016> > > (r293062) > > +++ head/sys/arm/arm/physmem.c> > Sat Jan 2 22:31:14 2016> > > (r293063) > > @@ -280,10 +280,24 @@ arm_physmem_hardware_region(vm_paddr_t p > > > > /* > > > > * Filter out the page at PA 0x00000000. The VM can't handle > it, as > > > > * pmap_extract() == 0 means failure. > > +> > * > > +> > * Also filter out the page at the end of the physical address > space -- > > +> > * if addr is non-zero and addr+size is zero that means we > wrapped to > > +> > * the next byte beyond what vm_paddr_t can express. The > calculations > > +> > * in vm_page_startup() are going to have the same problem, so > just work > > +> > * around it by leaving the last page out. > > +> > * > > +> > * XXX This just in: subtract out a whole megabyte, not just 1 > page. > > +> > * Reducing the size by anything less than 1MB results in a NULL > pointer > > +> > * deref in _vm_map_lock_read() very early in startup. Better > to give > > +> > * up a whole megabyte than leave some folks with an unusable > system > > +> > * while we investigate. > > > > */ > > > > if (pa == 0) { > > > > > pa = PAGE_SIZE; > > > > > sz -= PAGE_SIZE; > > +> > } else if (pa + sz == 0) { > > +> > > sz -= 1024 * 1024; > > > > } > > > > > > /* > > > > Bah. This is not what I intended to commit, I was going to reword that > comment block to better match what I found while testing. I was > editing the commit message when I decided to do that, so I hit ^C in > the shell that was waiting for me to finish editing in emacs, and to my > surprise it sent the commit instead of cancelling. What's the right > way to change your mind at this late stage of a commit? > > -- Ian > > From owner-svn-src-head@freebsd.org Sun Jan 3 03:40:25 2016 Return-Path: Delivered-To: svn-src-head@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 9DD35A601C4; Sun, 3 Jan 2016 03:40:25 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::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 750CF1189; Sun, 3 Jan 2016 03:40:25 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x236.google.com with SMTP id ho8so419428pac.2; Sat, 02 Jan 2016 19:40:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=EI1lwv93deZtqiIAgJJVu0k3KY7z/xkPsxlHgoMC8Cw=; b=CGcpZGHhkWHnQak7TSnLALC1m/ggt05tkmr3CBfgky3fZPuy59yEyHMYGEeBn98hzE bfTWYpoTsZsTxNtlZ3ML4p1N0Et1Ov6fNdJgA6vWtqCgpktNe9rWCxwBU6H1QB8eaV/S Fr6pEdbtIGGTYgzwQzVueDdFheE3gTq4+mEmngJCbIwqkOR2bHIX417vlZIZznGJDIV9 pS+lM/YNIOAejw4wPJljuk253SbHOlXhSEmrMmPsvJ971aU7oSdV3+6m8fRxPQF4eMkp SzpjzwWaggkbd53ey5BXTtBzlQN8Dx+8iSropKUdWADX+tIdkrL0yrCNRpkzAp2QTptX 5aHg== X-Received: by 10.66.252.136 with SMTP id zs8mr43974457pac.110.1451792425096; Sat, 02 Jan 2016 19:40:25 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:44c7:137c:1c65:f048? ([2601:601:800:126d:44c7:137c:1c65:f048]) by smtp.gmail.com with ESMTPSA id x22sm99173024pfa.82.2016.01.02.19.40.23 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 02 Jan 2016 19:40:23 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293063 - head/sys/arm/arm From: NGie Cooper In-Reply-To: Date: Sat, 2 Jan 2016 19:40:21 -0800 Cc: Ian Lepore , src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201601022231.u02MVEb5037283@repo.freebsd.org> <1451774206.1369.109.camel@freebsd.org> To: Maxim Sobolev X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 03:40:25 -0000 > On Jan 2, 2016, at 18:47, Maxim Sobolev wrote: >=20 > Don't save commit message and just exit your editor. That should make = it abort. Works with CVS, git and svn all the same. Killing your editor = with -9 should do as well, as long it doesn't do periodic autosave of = some sort. `killall -9 svn; svn cleanup` works every time! Cheers, -NGie= From owner-svn-src-head@freebsd.org Sun Jan 3 04:32:04 2016 Return-Path: Delivered-To: svn-src-head@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 6D093A5329B; Sun, 3 Jan 2016 04:32:04 +0000 (UTC) (envelope-from imp@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 2EBC118F2; Sun, 3 Jan 2016 04:32:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u034W3Zi043548; Sun, 3 Jan 2016 04:32:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u034W25Y043537; Sun, 3 Jan 2016 04:32:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601030432.u034W25Y043537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 Jan 2016 04:32:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293066 - in head/libexec/rtld-elf: . aarch64 amd64 arm i386 mips powerpc powerpc64 sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 04:32:04 -0000 Author: imp Date: Sun Jan 3 04:32:02 2016 New Revision: 293066 URL: https://svnweb.freebsd.org/changeset/base/293066 Log: Create a generalized exec hook that different architectures can hook into if they need to, but default to no action. Differential Review: https://reviews.freebsd.org/D2718 Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h head/libexec/rtld-elf/amd64/rtld_machdep.h head/libexec/rtld-elf/arm/reloc.c head/libexec/rtld-elf/arm/rtld_machdep.h head/libexec/rtld-elf/i386/rtld_machdep.h head/libexec/rtld-elf/mips/rtld_machdep.h head/libexec/rtld-elf/paths.h head/libexec/rtld-elf/powerpc/rtld_machdep.h head/libexec/rtld-elf/powerpc64/rtld_machdep.h head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/sparc64/rtld_machdep.h Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/aarch64/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/aarch64/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -80,4 +80,6 @@ extern void *__tls_get_addr(tls_index *t #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC +#define md_abi_variant_hook(x) + #endif Modified: head/libexec/rtld-elf/amd64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/amd64/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/amd64/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -79,4 +79,6 @@ void *__tls_get_addr(tls_index *ti) __ex #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC +#define md_abi_variant_hook(x) + #endif Modified: head/libexec/rtld-elf/arm/reloc.c ============================================================================== --- head/libexec/rtld-elf/arm/reloc.c Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/arm/reloc.c Sun Jan 3 04:32:02 2016 (r293066) @@ -18,6 +18,41 @@ __FBSDID("$FreeBSD$"); #include "paths.h" void +arm_abi_variant_hook(Elf_Auxinfo **aux_info) +{ + Elf_Word ehdr; + + /* + * If we're running an old kernel that doesn't provide any data fail + * safe by doing nothing. + */ + if (aux_info[AT_EHDRFLAGS] == NULL) + return; + ehdr = aux_info[AT_EHDRFLAGS]->a_un.a_val; + + /* + * Hard float ABI binaries are the default, and use the default paths + * and such. + */ + if ((ehdr & EF_ARM_VFP_FLOAT) != 0) + return; + + /* + * This is a soft float ABI binary. We need to use the soft float + * settings. For the moment, the standard library path includes the hard + * float paths as well. When upgrading, we need to execute the wrong + * kind of binary until we've installed the new binaries. We could go + * off whether or not /libsoft exists, but the simplicity of having it + * in the path wins. + */ + ld_elf_hints_default = _PATH_SOFT_ELF_HINTS; + ld_path_libmap_conf = _PATH_SOFT_LIBMAP_CONF; + ld_path_rtld = _PATH_SOFT_RTLD; + ld_standard_library_path = SOFT_STANDARD_LIBRARY_PATH; + ld_env_prefix = LD_SOFT_; +} + +void init_pltgot(Obj_Entry *obj) { if (obj->pltgot != NULL) { Modified: head/libexec/rtld-elf/arm/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/arm/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/arm/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -75,4 +75,9 @@ extern void *__tls_get_addr(tls_index *t #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC +extern void arm_abi_variant_hook(Elf_Auxinfo **); + +#define md_abi_variant_hook(x) arm_abi_variant_hook(x) +#define RTLD_VARIANT_ENV_NAMES + #endif Modified: head/libexec/rtld-elf/i386/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/i386/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/i386/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -80,4 +80,6 @@ void *__tls_get_addr(tls_index *ti) __ex #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC +#define md_abi_variant_hook(x) + #endif Modified: head/libexec/rtld-elf/mips/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/mips/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/mips/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -75,4 +75,6 @@ extern void *__tls_get_addr(tls_index *t #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC +#define md_abi_variant_hook(x) + #endif Modified: head/libexec/rtld-elf/paths.h ============================================================================== --- head/libexec/rtld-elf/paths.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/paths.h Sun Jan 3 04:32:02 2016 (r293066) @@ -1,8 +1,6 @@ /*- * Copyright 1996, 1997, 1998, 1999, 2000 John D. Polstra. * Copyright 2003 Alexander Kabaev . - * Copyright 2009-2012 Konstantin Belousov . - * Copyright 2012 John Marino . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -61,7 +59,13 @@ #define LD_ "LD_" #endif -extern char *ld_path_elf_hints; +#define _PATH_SOFT_ELF_HINTS "/var/run/ld-elf-soft.so.hints" +#define _PATH_SOFT_LIBMAP_CONF "/etc/libmap-soft.conf" +#define _PATH_SOFT_RTLD "/libexec/ld-elf.so.1" +#define SOFT_STANDARD_LIBRARY_PATH "/libsoft:/usr/libsoft:/lib:/usr/lib" +#define LD_SOFT_ "LD_SOFT_" + +extern char *ld_elf_hints_default; extern char *ld_path_libmap_conf; extern char *ld_path_rtld; extern char *ld_standard_library_path; Modified: head/libexec/rtld-elf/powerpc/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/powerpc/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/powerpc/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -90,4 +90,6 @@ extern void *__tls_get_addr(tls_index* t #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC +#define md_abi_variant_hook(x) + #endif Modified: head/libexec/rtld-elf/powerpc64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/powerpc64/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/powerpc64/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -82,4 +82,6 @@ extern void *__tls_get_addr(tls_index* t #define RTLD_DEFAULT_STACK_PF_EXEC PF_X #define RTLD_DEFAULT_STACK_EXEC PROT_EXEC +#define md_abi_variant_hook(x) + #endif Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/rtld.c Sun Jan 3 04:32:02 2016 (r293066) @@ -419,6 +419,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ trust = !issetugid(); + md_abi_variant_hook(aux_info); + ld_bind_now = getenv(_LD("BIND_NOW")); /* * If the process is tainted, then we un-set the dangerous environment Modified: head/libexec/rtld-elf/sparc64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/sparc64/rtld_machdep.h Sat Jan 2 23:14:52 2016 (r293065) +++ head/libexec/rtld-elf/sparc64/rtld_machdep.h Sun Jan 3 04:32:02 2016 (r293066) @@ -71,4 +71,6 @@ extern void *__tls_get_addr(tls_index *t #define RTLD_DEFAULT_STACK_PF_EXEC 0 #define RTLD_DEFAULT_STACK_EXEC 0 +#define md_abi_variant_hook(x) + #endif From owner-svn-src-head@freebsd.org Sun Jan 3 04:32:05 2016 Return-Path: Delivered-To: svn-src-head@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 832A1A532A3; Sun, 3 Jan 2016 04:32:05 +0000 (UTC) (envelope-from imp@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 541BA18F4; Sun, 3 Jan 2016 04:32:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u034W485043591; Sun, 3 Jan 2016 04:32:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u034W47r043590; Sun, 3 Jan 2016 04:32:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601030432.u034W47r043590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 Jan 2016 04:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293067 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 04:32:05 -0000 Author: imp Date: Sun Jan 3 04:32:04 2016 New Revision: 293067 URL: https://svnweb.freebsd.org/changeset/base/293067 Log: Add new LIBSOFT option. This is similar to the LIB32 option, except for libraries that follow the soft float ABI. It's only supported on armv6 as a transition to the new hard float ABI, so mark as broken everywhere else. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sun Jan 3 04:32:02 2016 (r293066) +++ head/share/mk/src.opts.mk Sun Jan 3 04:32:04 2016 (r293067) @@ -180,6 +180,7 @@ __DEFAULT_NO_OPTIONS = \ DTRACE_TESTS \ EISA \ HESIOD \ + LIBSOFT \ NAND \ OFED \ OPENLDAP \ @@ -248,6 +249,10 @@ __DEFAULT_NO_OPTIONS+=LLDB .if ${__T} == "arm" || ${__T} == "armeb" BROKEN_OPTIONS+=LLDB .endif +# Only doing soft float API stuff on armv6 +.if ${__T} != "armv6" +BROKEN_OPTIONS+=LIBSOFT +.endif .include From owner-svn-src-head@freebsd.org Sun Jan 3 04:32:07 2016 Return-Path: Delivered-To: svn-src-head@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 936C8A532C1; Sun, 3 Jan 2016 04:32:07 +0000 (UTC) (envelope-from imp@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 493431938; Sun, 3 Jan 2016 04:32:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u034W68u043636; Sun, 3 Jan 2016 04:32:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u034W6en043633; Sun, 3 Jan 2016 04:32:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601030432.u034W6en043633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 Jan 2016 04:32:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293068 - in head/etc: . mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 04:32:07 -0000 Author: imp Date: Sun Jan 3 04:32:05 2016 New Revision: 293068 URL: https://svnweb.freebsd.org/changeset/base/293068 Log: Add libsoft to the tree, just like lib32. Added: head/etc/mtree/BSD.libsoft.dist - copied, changed from r293067, head/etc/mtree/BSD.lib32.dist Modified: head/etc/Makefile head/etc/mtree/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sun Jan 3 04:32:04 2016 (r293067) +++ head/etc/Makefile Sun Jan 3 04:32:05 2016 (r293068) @@ -154,6 +154,9 @@ MTREE= BSD.debug.dist BSD.include.dist B .if ${MK_LIB32} != "no" MTREE+= BSD.lib32.dist .endif +.if ${MK_LIBSOFT} != "no" +MTREE+= BSD.libsoft.dist +.endif .if ${MK_TESTS} != "no" MTREE+= BSD.tests.dist .endif @@ -354,6 +357,10 @@ MTREES+= mtree/BSD.groff.dist /usr MTREES+= mtree/BSD.lib32.dist /usr MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr .endif +.if ${MK_LIBSOFT} != "no" +MTREES+= mtree/BSD.libsoft.dist /usr +MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr +.endif .if ${MK_TESTS} != "no" MTREES+= mtree/BSD.tests.dist ${TESTSBASE} MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE} Copied and modified: head/etc/mtree/BSD.libsoft.dist (from r293067, head/etc/mtree/BSD.lib32.dist) ============================================================================== --- head/etc/mtree/BSD.lib32.dist Sun Jan 3 04:32:04 2016 (r293067, copy source) +++ head/etc/mtree/BSD.libsoft.dist Sun Jan 3 04:32:05 2016 (r293068) @@ -5,7 +5,7 @@ /set type=dir uname=root gname=wheel mode=0755 . - lib32 + libsoft dtrace .. i18n Modified: head/etc/mtree/Makefile ============================================================================== --- head/etc/mtree/Makefile Sun Jan 3 04:32:04 2016 (r293067) +++ head/etc/mtree/Makefile Sun Jan 3 04:32:05 2016 (r293068) @@ -6,6 +6,7 @@ FILES= ${_BSD.debug.dist} \ BSD.include.dist \ BSD.root.dist \ ${_BSD.lib32.dist} \ + ${_BSD.libsoft.dist} \ ${_BSD.sendmail.dist} \ ${_BSD.tests.dist} \ BSD.usr.dist \ @@ -20,6 +21,9 @@ _BSD.groff.dist= BSD.groff.dist .if ${MK_LIB32} != "no" _BSD.lib32.dist= BSD.lib32.dist .endif +.if ${MK_LIBSOFT} != "no" +_BSD.libsoft.dist= BSD.libsoft.dist +.endif .if ${MK_SENDMAIL} != "no" _BSD.sendmail.dist= BSD.sendmail.dist .endif From owner-svn-src-head@freebsd.org Sun Jan 3 04:32:15 2016 Return-Path: Delivered-To: svn-src-head@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 362B2A53335; Sun, 3 Jan 2016 04:32:15 +0000 (UTC) (envelope-from imp@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 DF9E91C20; Sun, 3 Jan 2016 04:32:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u034WE7K043684; Sun, 3 Jan 2016 04:32:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u034WDnl043683; Sun, 3 Jan 2016 04:32:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601030432.u034WDnl043683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 Jan 2016 04:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293069 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 04:32:15 -0000 Author: imp Date: Sun Jan 3 04:32:13 2016 New Revision: 293069 URL: https://svnweb.freebsd.org/changeset/base/293069 Log: If md_exec_hook is defined, provide a way to create the strings for the environment variables we look up at runtime. Otherwise, there's no way they will change, optimize it at compile time. Differential Review: https://reviews.freebsd.org/D2718 Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sun Jan 3 04:32:05 2016 (r293068) +++ head/libexec/rtld-elf/rtld.c Sun Jan 3 04:32:13 2016 (r293069) @@ -204,8 +204,6 @@ extern Elf_Dyn _DYNAMIC; #define RTLD_IS_DYNAMIC() (&_DYNAMIC != NULL) #endif -#define _LD(x) LD_ x - int dlclose(void *) __exported; char *dlerror(void) __exported; void *dlopen(const char *, int) __exported; @@ -325,6 +323,24 @@ ld_utrace_log(int event, void *handle, v utrace(&ut, sizeof(ut)); } +#ifdef RTLD_VARIANT_ENV_NAMES +/* + * construct the env variable based on the type of binary that's + * running. + */ +static inline const char * +_LD(const char *var) +{ + static char buffer[128]; + + strlcpy(buffer, ld_env_prefix, sizeof(buffer)); + strlcat(buffer, var, sizeof(buffer)); + return (buffer); +} +#else +#define _LD(x) LD_ x +#endif + /* * Main entry point for dynamic linking. The first argument is the * stack pointer. The stack is expected to be laid out as described From owner-svn-src-head@freebsd.org Sun Jan 3 04:38:18 2016 Return-Path: Delivered-To: svn-src-head@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 E0991A5375C; Sun, 3 Jan 2016 04:38:18 +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 B1460121E; Sun, 3 Jan 2016 04:38:18 +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 u034cHUD043935; Sun, 3 Jan 2016 04:38:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u034cHSP043934; Sun, 3 Jan 2016 04:38:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601030438.u034cHSP043934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 3 Jan 2016 04:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293070 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 04:38:19 -0000 Author: ngie Date: Sun Jan 3 04:38:17 2016 New Revision: 293070 URL: https://svnweb.freebsd.org/changeset/base/293070 Log: Add "options ZFS" to NOTES so this will be tested with the LINT KERNCONF when "make tinderbox" is run This will help ensure that "options ZFS" will not be accidentally regressed, as the current LINT configuration tests the zfs module MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Jan 3 04:32:13 2016 (r293069) +++ head/sys/conf/NOTES Sun Jan 3 04:38:17 2016 (r293070) @@ -3012,3 +3012,6 @@ options EM_MULTIQUEUE # Activate multiq # zlib I/O stream support # This enables support for compressed core dumps. options GZIO + +# ZFS (Zeta File System) support +options ZFS From owner-svn-src-head@freebsd.org Sun Jan 3 06:02:58 2016 Return-Path: Delivered-To: svn-src-head@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 44A5FA5FF2C; Sun, 3 Jan 2016 06:02:58 +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 07B3C1293; Sun, 3 Jan 2016 06:02:57 +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 u0362vKu070409; Sun, 3 Jan 2016 06:02:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0362u4H070401; Sun, 3 Jan 2016 06:02:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601030602.u0362u4H070401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 3 Jan 2016 06:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293073 - head/tools/regression/geom_mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 06:02:58 -0000 Author: ngie Date: Sun Jan 3 06:02:56 2016 New Revision: 293073 URL: https://svnweb.freebsd.org/changeset/base/293073 Log: - Use attach_md instead of hardcoding md(4) provider unit numbers - Implement a gmirror_test_cleanup function, which in turn calls geom_test_cleanup to clean up all md(4) providers allocated in the test run. - Remove duplicate logic in test scripts for removing md(4) providers. - Don't create files in /tmp (outside the kyua sandbox); use the current directory instead MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/geom_mirror/conf.sh head/tools/regression/geom_mirror/test-1.t head/tools/regression/geom_mirror/test-2.t head/tools/regression/geom_mirror/test-3.t head/tools/regression/geom_mirror/test-4.t head/tools/regression/geom_mirror/test-5.t head/tools/regression/geom_mirror/test-6.t head/tools/regression/geom_mirror/test-7.t Modified: head/tools/regression/geom_mirror/conf.sh ============================================================================== --- head/tools/regression/geom_mirror/conf.sh Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/conf.sh Sun Jan 3 06:02:56 2016 (r293073) @@ -5,4 +5,11 @@ name="$(mktemp -u mirror.XXXXXX)" class="mirror" base=`basename $0` +gmirror_test_cleanup() +{ + [ -c /dev/$class/$name ] && gmirror destroy $name + geom_test_cleanup +} +trap gmirror_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh Modified: head/tools/regression/geom_mirror/test-1.t ============================================================================== --- head/tools/regression/geom_mirror/test-1.t Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/test-1.t Sun Jan 3 06:02:56 2016 (r293073) @@ -5,15 +5,11 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` - -mdconfig -a -t malloc -s 1M -u $us0 || exit 1 -mdconfig -a -t malloc -s 2M -u $us1 || exit 1 -mdconfig -a -t malloc -s 3M -u $us2 || exit 1 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -gmirror label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait # Size of created device should be 1MB - 512b. @@ -25,10 +21,3 @@ if [ $size -eq 1048064 ]; then else echo "not ok 1" fi - -gmirror remove $name md${us0} -gmirror remove $name md${us1} -gmirror remove $name md${us2} -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 Modified: head/tools/regression/geom_mirror/test-2.t ============================================================================== --- head/tools/regression/geom_mirror/test-2.t Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/test-2.t Sun Jan 3 06:02:56 2016 (r293073) @@ -6,22 +6,19 @@ echo "1..4" balance="round-robin" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -32,28 +29,24 @@ if [ `md5 -q ${src}` != `md5 -q ${dst}` else echo "ok 1" fi -dd if=/dev/md${us0} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us0} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" else echo "ok 2" fi -dd if=/dev/md${us1} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us1} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" else echo "ok 3" fi -dd if=/dev/md${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" else echo "ok 4" fi -gmirror remove $name md${us0} md${us1} md${us2} -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_mirror/test-3.t ============================================================================== --- head/tools/regression/geom_mirror/test-3.t Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/test-3.t Sun Jan 3 06:02:56 2016 (r293073) @@ -6,22 +6,19 @@ echo "1..5" balance="round-robin" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -64,7 +61,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_mirror/test-4.t ============================================================================== --- head/tools/regression/geom_mirror/test-4.t Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/test-4.t Sun Jan 3 06:02:56 2016 (r293073) @@ -6,22 +6,19 @@ echo "1..5" balance="load" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -57,6 +54,8 @@ else echo "ok 4" fi +gmirror destroy $name + # mirror/${name} should be removed. if [ -c /dev/${name} ]; then echo "not ok 5" @@ -64,7 +63,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_mirror/test-5.t ============================================================================== --- head/tools/regression/geom_mirror/test-5.t Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/test-5.t Sun Jan 3 06:02:56 2016 (r293073) @@ -6,22 +6,19 @@ echo "1..5" balance="split" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=8192 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -64,7 +61,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_mirror/test-6.t ============================================================================== --- head/tools/regression/geom_mirror/test-6.t Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/test-6.t Sun Jan 3 06:02:56 2016 (r293073) @@ -6,26 +6,23 @@ echo "1..2" balance="split" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=8192 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} || exit 1 +gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/${us0} /dev/${us1} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -dd if=/dev/zero of=/dev/md${us2} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us2} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then @@ -35,18 +32,14 @@ else fi # Connect disk to the mirror. -gmirror insert ${name} md${us2} +gmirror insert ${name} ${us2} # Wait for synchronization. sleep 1 -dd if=/dev/md${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" else echo "ok 2" fi -gmirror remove $name md${us0} md${us1} md${us2} -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_mirror/test-7.t ============================================================================== --- head/tools/regression/geom_mirror/test-7.t Sun Jan 3 05:39:19 2016 (r293072) +++ head/tools/regression/geom_mirror/test-7.t Sun Jan 3 06:02:56 2016 (r293073) @@ -6,22 +6,19 @@ echo "1..5" balance="prefer" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -64,7 +61,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} From owner-svn-src-head@freebsd.org Sun Jan 3 08:38:10 2016 Return-Path: Delivered-To: svn-src-head@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 CF75EA6076D; Sun, 3 Jan 2016 08:38:10 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 91CA11BCF; Sun, 3 Jan 2016 08:38:09 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 108D225D386D; Sun, 3 Jan 2016 08:38:00 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 35AB9C76FED; Sun, 3 Jan 2016 08:38:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id RkuFwt8f2-HE; Sun, 3 Jan 2016 08:37:58 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:cd32:511d:f40b:c35] (unknown [IPv6:fde9:577b:c1a9:4410:cd32:511d:f40b:c35]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 61A51C76FEC; Sun, 3 Jan 2016 08:37:58 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293070 - head/sys/conf From: "Bjoern A. Zeeb" In-Reply-To: <201601030438.u034cHSP043934@repo.freebsd.org> Date: Sun, 3 Jan 2016 08:37:38 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201601030438.u034cHSP043934@repo.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 08:38:10 -0000 > On 03 Jan 2016, at 04:38 , Garrett Cooper wrote: >=20 > Author: ngie > Date: Sun Jan 3 04:38:17 2016 > New Revision: 293070 > URL: https://svnweb.freebsd.org/changeset/base/293070 >=20 > Log: > Add "options ZFS" to NOTES so this will be tested with the LINT > KERNCONF when "make tinderbox" is run >=20 > This will help ensure that "options ZFS" will not be accidentally > regressed, as the current LINT configuration tests the zfs module >=20 and it broke the build. linking kernel inflate.o: In function `inflate': /scratch/tmp/bz/head.svn/sys/kern/inflate.c:(.text+0x0): multiple = definition of `inflate' inflate.o:/scratch/tmp/bz/head.svn/sys/kern/inflate.c:(.text+0x0): first = defined here zmod.o: In function `z_uncompress': = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0x63): undefined reference to `z_inflateInit2_' = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0x78): undefined reference to `z_inflate' = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0x92): undefined reference to `z_inflateEnd' = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0xa0): undefined reference to `z_inflateEnd' --- kernel --- *** [kernel] Error code 1 /bz= From owner-svn-src-head@freebsd.org Sun Jan 3 08:48:25 2016 Return-Path: Delivered-To: svn-src-head@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 073CAA60A4D; Sun, 3 Jan 2016 08:48:25 +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 C10171254; Sun, 3 Jan 2016 08:48:24 +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 u038mNM9019792; Sun, 3 Jan 2016 08:48:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u038mN1d019791; Sun, 3 Jan 2016 08:48:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601030848.u038mN1d019791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 3 Jan 2016 08:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293091 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 08:48:25 -0000 Author: ngie Date: Sun Jan 3 08:48:23 2016 New Revision: 293091 URL: https://svnweb.freebsd.org/changeset/base/293091 Log: Revert r293070 It seems that `options GZIP` and `options ZFS` collide because they both define inconsistent definitions for inflate, etc Fixing this will require upgrading zlib in the kernel, as suggested in r245102. Pointyhat to: ngie Reported by: bz Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Jan 3 08:30:18 2016 (r293090) +++ head/sys/conf/NOTES Sun Jan 3 08:48:23 2016 (r293091) @@ -3012,6 +3012,3 @@ options EM_MULTIQUEUE # Activate multiq # zlib I/O stream support # This enables support for compressed core dumps. options GZIO - -# ZFS (Zeta File System) support -options ZFS From owner-svn-src-head@freebsd.org Sun Jan 3 08:55:15 2016 Return-Path: Delivered-To: svn-src-head@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 A764AA60D1F; Sun, 3 Jan 2016 08:55:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com [IPv6:2607:f8b0:4003:c01::230]) (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 72A7817FA; Sun, 3 Jan 2016 08:55:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-ob0-x230.google.com with SMTP id bx1so203790580obb.0; Sun, 03 Jan 2016 00:55:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=LTFDUFl0qNUOIXyDXIO0WKGac9CpuyoKuaS7bOM++2Y=; b=ZjU3fuSv2fJkUrl7ITu0uUBWvaAhYzv9a/W4kuMlhg5QP/n4N7zi6QObDzbcBmPUN4 xSYObX8d8ecv8mTxtGRgV1QuwdKvahBPyxMVHy8knT0hR4yZnrYPSuh4OE0sXEG8qHjU OgbRwAvgFTuopyl5M1HGsVKQ3upgL62Qf9Vz8EXr5ccVgBvHhk8Rw1bploD6l4An4+da K1MaIgp6Pq7H4bLOasW7pJPoXkxDZWOaV0KYa6trX52jB2HJ9uJL9Yr8l+Qf1Bef+6uX 4XTfePlv9/OA2ULBbwVggw7I1CzVtytATTFOGPAcPOiizkBZdC8JlZYKGigkNWSb2pf9 qMlg== X-Received: by 10.60.146.237 with SMTP id tf13mr30260799oeb.70.1451811314751; Sun, 03 Jan 2016 00:55:14 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:44c7:137c:1c65:f048? ([2601:601:800:126d:44c7:137c:1c65:f048]) by smtp.gmail.com with ESMTPSA id sd7sm27856011oec.13.2016.01.03.00.55.12 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jan 2016 00:55:13 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293070 - head/sys/conf From: NGie Cooper In-Reply-To: Date: Sun, 3 Jan 2016 00:55:11 -0800 Cc: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <825B9C10-92B8-40FE-B34A-34EF285D6844@gmail.com> References: <201601030438.u034cHSP043934@repo.freebsd.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 08:55:15 -0000 > On Jan 3, 2016, at 00:37, Bjoern A. Zeeb = wrote: >=20 >> On 03 Jan 2016, at 04:38 , Garrett Cooper wrote: >>=20 >> Author: ngie >> Date: Sun Jan 3 04:38:17 2016 >> New Revision: 293070 >> URL: https://svnweb.freebsd.org/changeset/base/293070 >>=20 >> Log: >> Add "options ZFS" to NOTES so this will be tested with the LINT >> KERNCONF when "make tinderbox" is run >>=20 >> This will help ensure that "options ZFS" will not be accidentally >> regressed, as the current LINT configuration tests the zfs module >>=20 >=20 > and it broke the build. >=20 > linking kernel > inflate.o: In function `inflate': > /scratch/tmp/bz/head.svn/sys/kern/inflate.c:(.text+0x0): multiple = definition of `inflate' > inflate.o:/scratch/tmp/bz/head.svn/sys/kern/inflate.c:(.text+0x0): = first defined here > zmod.o: In function `z_uncompress': > = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0x63): undefined reference to `z_inflateInit2_' > = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0x78): undefined reference to `z_inflate' > = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0x92): undefined reference to `z_inflateEnd' > = /scratch/tmp/bz/head.svn/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod= .c:(.text+0xa0): undefined reference to `z_inflateEnd' > --- kernel --- > *** [kernel] Error code 1 Thank you for the report ;(... I=E2=80=99ve reverted r293091 and have = filed this bug to track the issue: = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D205822 . -NGie= From owner-svn-src-head@freebsd.org Sun Jan 3 09:54:04 2016 Return-Path: Delivered-To: svn-src-head@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 8CF57A600C6; Sun, 3 Jan 2016 09:54:04 +0000 (UTC) (envelope-from melifaro@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 4ECBE1783; Sun, 3 Jan 2016 09:54:04 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u039s3jk041112; Sun, 3 Jan 2016 09:54:03 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u039s3fS041109; Sun, 3 Jan 2016 09:54:03 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601030954.u039s3fS041109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 3 Jan 2016 09:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293098 - in head/sys: net netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 09:54:04 -0000 Author: melifaro Date: Sun Jan 3 09:54:03 2016 New Revision: 293098 URL: https://svnweb.freebsd.org/changeset/base/293098 Log: Handle IPV6_PATHMTU option by spliting ip6_getpmtu_ctl() from ip6_getpmtu(). Add ro_mtu field to 'struct route' to be able to pass lookup MTU back to the caller. Currently, ip6_getpmtu() has 2 totally different use cases: 1) control plane (IPV6_PATHMTU req), where we just need to calculate MTU and return it, w/o any reusability. 2) Actual ip6_output() data path where we (nearly) always use the provided route lookup data. If this data is not 'valid' we need to perform another lookup and save the result (which cannot be re-used by ip6_output()). Given that, handle 1) by calling separate function doing rte lookup itself. Resulting MTU is calculated by (newly-added) ip6_calcmtu() used by both ip6_getpmtu_ctl() and ip6_getpmtu(). For 2) instead of storing ref'ed rte, store mtu (the only needed data from the lookup result) inside newly-added ro_mtu field. 'struct route' was shrinked by 8(or 4 bytes) in r292978. Grow it again by 4 bytes. New ro_mtu field will be used in other places like ip/tcp_output (EMSGSIZE handling from output routines). Reviewed by: ae Modified: head/sys/net/route.h head/sys/netinet6/in6.h head/sys/netinet6/ip6_output.c Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sun Jan 3 09:44:26 2016 (r293097) +++ head/sys/net/route.h Sun Jan 3 09:54:03 2016 (r293098) @@ -44,16 +44,17 @@ */ /* - * A route consists of a destination address, a reference - * to a routing entry, and a reference to an llentry. - * These are often held by protocols in their control - * blocks, e.g. inpcb. + * Struct route consiste of a destination address, + * a route entry pointer, link-layer prepend data pointer along + * with its length. */ struct route { struct rtentry *ro_rt; char *ro_prepend; uint16_t ro_plen; uint16_t ro_flags; + uint16_t ro_mtu; /* saved ro_rt mtu */ + uint16_t spare; struct sockaddr ro_dst; }; Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Sun Jan 3 09:44:26 2016 (r293097) +++ head/sys/netinet6/in6.h Sun Jan 3 09:54:03 2016 (r293098) @@ -378,6 +378,8 @@ struct route_in6 { char *ro_prepend; uint16_t ro_plen; uint16_t ro_flags; + uint16_t ro_mtu; /* saved ro_rt mtu */ + uint16_t spare; struct sockaddr_in6 ro_dst; }; #endif Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sun Jan 3 09:44:26 2016 (r293097) +++ head/sys/netinet6/ip6_output.c Sun Jan 3 09:54:03 2016 (r293098) @@ -147,8 +147,11 @@ static int ip6_insertfraghdr(struct mbuf struct ip6_frag **); static int ip6_insert_jumboopt(struct ip6_exthdrs *, u_int32_t); static int ip6_splithdr(struct mbuf *, struct ip6_exthdrs *); -static int ip6_getpmtu(struct route_in6 *, struct route_in6 *, +static int ip6_getpmtu(struct route_in6 *, int, struct ifnet *, struct in6_addr *, u_long *, int *, u_int); +static int ip6_calcmtu(struct ifnet *, const struct in6_addr *, u_long, + u_long *, int *); +static int ip6_getpmtu_ctl(u_int, struct in6_addr *, u_long *); static int copypktopts(struct ip6_pktopts *, struct ip6_pktopts *, int); @@ -712,7 +715,7 @@ again: *ifpp = ifp; /* Determine path MTU. */ - if ((error = ip6_getpmtu(ro_pmtu, ro, ifp, &finaldst, &mtu, + if ((error = ip6_getpmtu(ro_pmtu, ro != ro_pmtu, ifp, &finaldst, &mtu, &alwaysfrag, fibnum)) != 0) goto bad; @@ -1045,8 +1048,6 @@ sendorfree: done: if (ro == &ip6route) RO_RTFREE(ro); - if (ro_pmtu == &ip6route) - RO_RTFREE(ro_pmtu); return (error); freehdrs: @@ -1215,35 +1216,104 @@ ip6_insertfraghdr(struct mbuf *m0, struc return (0); } +/* + * Calculates IPv6 path mtu for destination @dst. + * Resulting MTU is stored in @mtup. + * + * Returns 0 on success. + */ +static int +ip6_getpmtu_ctl(u_int fibnum, struct in6_addr *dst, u_long *mtup) +{ + struct route_in6 ro_pmtu; + struct ifnet *ifp; + struct sockaddr_in6 *sa6_dst; + u_long mtu; + + sa6_dst = (struct sockaddr_in6 *)&ro_pmtu.ro_dst; + bzero(sa6_dst, sizeof(*sa6_dst)); + sa6_dst->sin6_family = AF_INET6; + sa6_dst->sin6_len = sizeof(struct sockaddr_in6); + sa6_dst->sin6_addr = *dst; + + in6_rtalloc(&ro_pmtu, fibnum); + + if (ro_pmtu.ro_rt == NULL) + return (EHOSTUNREACH); + + ifp = ro_pmtu.ro_rt->rt_ifp; + mtu = ro_pmtu.ro_rt->rt_mtu; + RO_RTFREE(&ro_pmtu); + + return (ip6_calcmtu(ifp, dst, mtu, mtup, NULL)); +} + +/* + * Calculates IPv6 path MTU for @dst based on transmit @ifp, + * and cached data in @ro_pmtu. + * MTU from (successful) route lookup is saved (along with dst) + * inside @ro_pmtu to avoid subsequent route lookups after packet + * filter processing. + * + * Stores mtu and always-frag value into @mtup and @alwaysfragp. + * Returns 0 on success. + */ static int -ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro, +ip6_getpmtu(struct route_in6 *ro_pmtu, int do_lookup, struct ifnet *ifp, struct in6_addr *dst, u_long *mtup, int *alwaysfragp, u_int fibnum) { - u_int32_t mtu = 0; - int alwaysfrag = 0; - int error = 0; + struct sockaddr_in6 *sa6_dst; + u_long mtu; - if (ro_pmtu != ro) { - /* The first hop and the final destination may differ. */ - struct sockaddr_in6 *sa6_dst = - (struct sockaddr_in6 *)&ro_pmtu->ro_dst; - if (ro_pmtu->ro_rt && - ((ro_pmtu->ro_rt->rt_flags & RTF_UP) == 0 || - !IN6_ARE_ADDR_EQUAL(&sa6_dst->sin6_addr, dst))) { - RTFREE(ro_pmtu->ro_rt); - ro_pmtu->ro_rt = (struct rtentry *)NULL; - } - if (ro_pmtu->ro_rt == NULL) { + mtu = 0; + if (do_lookup) { + + /* + * Here ro_pmtu has final destination address, while + * ro might represent immediate destination. + * Use ro_pmtu destination since mtu might differ. + */ + sa6_dst = (struct sockaddr_in6 *)&ro_pmtu->ro_dst; + if (!IN6_ARE_ADDR_EQUAL(&sa6_dst->sin6_addr, dst)) + ro_pmtu->ro_mtu = 0; + + if (ro_pmtu->ro_mtu == 0) { bzero(sa6_dst, sizeof(*sa6_dst)); sa6_dst->sin6_family = AF_INET6; sa6_dst->sin6_len = sizeof(struct sockaddr_in6); sa6_dst->sin6_addr = *dst; in6_rtalloc(ro_pmtu, fibnum); + if (ro_pmtu->ro_rt) { + mtu = ro_pmtu->ro_rt->rt_mtu; + RO_RTFREE(ro_pmtu); + } } } - if (ro_pmtu->ro_rt) { + + if (ro_pmtu->ro_rt) + mtu = ro_pmtu->ro_rt->rt_mtu; + + return (ip6_calcmtu(ifp, dst, mtu, mtup, alwaysfragp)); +} + +/* + * Calculate MTU based on transmit @ifp, route mtu @rt_mtu and + * hostcache data for @dst. + * Stores mtu and always-frag value into @mtup and @alwaysfragp. + * + * Returns 0 on success. + */ +static int +ip6_calcmtu(struct ifnet *ifp, const struct in6_addr *dst, u_long rt_mtu, + u_long *mtup, int *alwaysfragp) +{ + u_long mtu = 0; + int alwaysfrag = 0; + int error = 0; + + if (rt_mtu > 0) { u_int32_t ifmtu; struct in_conninfo inc; @@ -1251,14 +1321,12 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, s inc.inc_flags |= INC_ISIPV6; inc.inc6_faddr = *dst; - if (ifp == NULL) - ifp = ro_pmtu->ro_rt->rt_ifp; ifmtu = IN6_LINKMTU(ifp); mtu = tcp_hc_getmtu(&inc); if (mtu) - mtu = min(mtu, ro_pmtu->ro_rt->rt_mtu); + mtu = min(mtu, rt_mtu); else - mtu = ro_pmtu->ro_rt->rt_mtu; + mtu = rt_mtu; if (mtu == 0) mtu = ifmtu; else if (mtu < IPV6_MMTU) { @@ -1936,9 +2004,6 @@ do { \ { u_long pmtu = 0; struct ip6_mtuinfo mtuinfo; - struct route_in6 sro; - - bzero(&sro, sizeof(sro)); if (!(so->so_state & SS_ISCONNECTED)) return (ENOTCONN); @@ -1947,11 +2012,8 @@ do { \ * routing, or optional information to specify * the outgoing interface. */ - error = ip6_getpmtu(&sro, NULL, NULL, - &in6p->in6p_faddr, &pmtu, NULL, - so->so_fibnum); - if (sro.ro_rt) - RTFREE(sro.ro_rt); + error = ip6_getpmtu_ctl(so->so_fibnum, + &in6p->in6p_faddr, &pmtu); if (error) break; if (pmtu > IPV6_MAXPACKET) From owner-svn-src-head@freebsd.org Sun Jan 3 10:06:11 2016 Return-Path: Delivered-To: svn-src-head@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 A0522A60771; Sun, 3 Jan 2016 10:06:11 +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 619D91282; Sun, 3 Jan 2016 10:06:11 +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 u03A6AhC044539; Sun, 3 Jan 2016 10:06:10 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03A6AfT044536; Sun, 3 Jan 2016 10:06:10 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601031006.u03A6AfT044536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 3 Jan 2016 10:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293099 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 10:06:11 -0000 Author: avos Date: Sun Jan 3 10:06:10 2016 New Revision: 293099 URL: https://svnweb.freebsd.org/changeset/base/293099 Log: iwm: reorganize if_iwmvar.h - Change order of data in if_iwmvar.h (like it is in other drivers: defines, data structures, vap/node structures, softc struct and locks); use indentation. - Fix IWM_LOCK(_sc) / IWM_UNLOCK(_sc) macro. - Add IWM_LOCK_INIT / DESTROY(sc) + fix mtx_init() usage. - Wrap iwm_node casts into IWM_NODE() macro. - Drop some fields: * wt_hwqueue from Tx radiotap header; * macaddr[6] from iwm_vap; Approved by: adrian Differential Revision: https://reviews.freebsd.org/D4753 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_mac_ctxt.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sun Jan 3 09:54:03 2016 (r293098) +++ head/sys/dev/iwm/if_iwm.c Sun Jan 3 10:06:10 2016 (r293099) @@ -2649,7 +2649,7 @@ iwm_tx(struct iwm_softc *sc, struct mbuf { struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - struct iwm_node *in = (struct iwm_node *)ni; + struct iwm_node *in = IWM_NODE(ni); struct iwm_tx_ring *ring; struct iwm_tx_data *data; struct iwm_tfd *desc; @@ -2706,7 +2706,6 @@ iwm_tx(struct iwm_softc *sc, struct mbuf tap->wt_chan_freq = htole16(ni->ni_chan->ic_freq); tap->wt_chan_flags = htole16(ni->ni_chan->ic_flags); tap->wt_rate = rinfo->rate; - tap->wt_hwqueue = ac; if (k != NULL) tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; ieee80211_radiotap_tx(vap, m); @@ -3182,7 +3181,7 @@ iwm_auth(struct ieee80211vap *vap, struc * freed from underneath us. Grr. */ ni = ieee80211_ref_node(vap->iv_bss); - in = (struct iwm_node *) ni; + in = IWM_NODE(ni); IWM_DPRINTF(sc, IWM_DEBUG_RESET | IWM_DEBUG_STATE, "%s: called; vap=%p, bss ni=%p\n", __func__, @@ -3289,7 +3288,7 @@ out: static int iwm_assoc(struct ieee80211vap *vap, struct iwm_softc *sc) { - struct iwm_node *in = (struct iwm_node *)vap->iv_bss; + struct iwm_node *in = IWM_NODE(vap->iv_bss); int error; if ((error = iwm_mvm_update_sta(sc, in)) != 0) { @@ -3515,7 +3514,7 @@ iwm_newstate(struct ieee80211vap *vap, e if (vap->iv_state == IEEE80211_S_RUN && nstate != vap->iv_state) { iwm_mvm_disable_beacon_filter(sc); - if (((in = (void *)vap->iv_bss) != NULL)) + if (((in = IWM_NODE(vap->iv_bss)) != NULL)) in->in_assoc = 0; iwm_release(sc, NULL); @@ -3591,7 +3590,7 @@ iwm_newstate(struct ieee80211vap *vap, e break; } - in = (struct iwm_node *)vap->iv_bss; + in = IWM_NODE(vap->iv_bss); iwm_mvm_power_mac_update_mode(sc, in); iwm_mvm_enable_beacon_filter(sc, in); iwm_mvm_update_quotas(sc, in); @@ -4596,7 +4595,7 @@ iwm_attach(device_t dev) int txq_i, i; sc->sc_dev = dev; - mtx_init(&sc->sc_mtx, "iwm_mtx", MTX_DEF, 0); + IWM_LOCK_INIT(sc); mbufq_init(&sc->sc_snd, ifqmaxlen); callout_init_mtx(&sc->sc_watchdog_to, &sc->sc_mtx, 0); TASK_INIT(&sc->sc_es_task, 0, iwm_endscan_cb, sc); @@ -4985,7 +4984,7 @@ iwm_detach_local(struct iwm_softc *sc, i iwm_pci_detach(dev); mbufq_drain(&sc->sc_snd); - mtx_destroy(&sc->sc_mtx); + IWM_LOCK_DESTROY(sc); return (0); } Modified: head/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- head/sys/dev/iwm/if_iwm_mac_ctxt.c Sun Jan 3 09:54:03 2016 (r293098) +++ head/sys/dev/iwm/if_iwm_mac_ctxt.c Sun Jan 3 10:06:10 2016 (r293099) @@ -426,7 +426,7 @@ iwm_mvm_mac_ctxt_cmd_station(struct iwm_ uint32_t action) { struct ieee80211_node *ni = vap->iv_bss; - struct iwm_node *in = (struct iwm_node *) ni; + struct iwm_node *in = IWM_NODE(ni); struct iwm_mac_ctx_cmd cmd; IWM_DPRINTF(sc, IWM_DEBUG_RESET, Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Sun Jan 3 09:54:03 2016 (r293098) +++ head/sys/dev/iwm/if_iwmvar.h Sun Jan 3 10:06:10 2016 (r293099) @@ -129,7 +129,6 @@ struct iwm_tx_radiotap_header { uint8_t wt_rate; uint16_t wt_chan_freq; uint16_t wt_chan_flags; - uint8_t wt_hwqueue; } __packed; #define IWM_TX_RADIOTAP_PRESENT \ @@ -152,9 +151,6 @@ struct iwm_tx_radiotap_header { #define IWM_FW_STATUS_INPROGRESS 1 #define IWM_FW_STATUS_DONE 2 -#define IWM_LOCK(_sc) mtx_lock(&sc->sc_mtx) -#define IWM_UNLOCK(_sc) mtx_unlock(&sc->sc_mtx) - enum iwm_ucode_type { IWM_UCODE_TYPE_INIT, IWM_UCODE_TYPE_REGULAR, @@ -244,12 +240,12 @@ struct iwm_dma_info { #define IWM_TX_RING_HIMARK 224 struct iwm_tx_data { - bus_dmamap_t map; - bus_addr_t cmd_paddr; - bus_addr_t scratch_paddr; - struct mbuf *m; - struct iwm_node *in; - int done; + bus_dmamap_t map; + bus_addr_t cmd_paddr; + bus_addr_t scratch_paddr; + struct mbuf *m; + struct iwm_node *in; + int done; }; struct iwm_tx_ring { @@ -295,12 +291,6 @@ struct iwm_rx_ring { int cur; }; -#define IWM_FLAG_USE_ICT 0x01 -#define IWM_FLAG_HW_INITED 0x02 -#define IWM_FLAG_STOPPED 0x04 -#define IWM_FLAG_RFKILL 0x08 -#define IWM_FLAG_BUSY 0x10 - struct iwm_ucode_status { uint32_t uc_error_event_table; uint32_t uc_log_event_table; @@ -371,68 +361,97 @@ struct iwm_bf_data { }; struct iwm_vap { - struct ieee80211vap iv_vap; - uint8_t macaddr[IEEE80211_ADDR_LEN]; - int is_uploaded; + struct ieee80211vap iv_vap; + int is_uploaded; + + int (*iv_newstate)(struct ieee80211vap *, + enum ieee80211_state, int); +}; +#define IWM_VAP(_vap) ((struct iwm_vap *)(_vap)) + +struct iwm_node { + struct ieee80211_node in_ni; + struct iwm_mvm_phy_ctxt *in_phyctxt; + + /* status "bits" */ + int in_assoc; + + struct iwm_lq_cmd in_lq; - int (*iv_newstate)(struct ieee80211vap *, enum ieee80211_state, int); + uint8_t in_ridx[IEEE80211_RATE_MAXSIZE]; }; +#define IWM_NODE(_ni) ((struct iwm_node *)(_ni)) + +#define IWM_STATION_ID 0 + +#define IWM_DEFAULT_MACID 0 +#define IWM_DEFAULT_COLOR 0 +#define IWM_DEFAULT_TSFID 0 -#define IWM_VAP(_vap) ((struct iwm_vap *)(_vap)) +#define IWM_ICT_SIZE 4096 +#define IWM_ICT_COUNT (IWM_ICT_SIZE / sizeof (uint32_t)) +#define IWM_ICT_PADDR_SHIFT 12 struct iwm_softc { + device_t sc_dev; + uint32_t sc_debug; + struct mtx sc_mtx; struct mbufq sc_snd; struct ieee80211com sc_ic; - device_t sc_dev; + + int sc_flags; +#define IWM_FLAG_USE_ICT (1 << 0) +#define IWM_FLAG_HW_INITED (1 << 1) +#define IWM_FLAG_STOPPED (1 << 2) +#define IWM_FLAG_RFKILL (1 << 3) +#define IWM_FLAG_BUSY (1 << 4) struct intr_config_hook sc_preinit_hook; - struct callout sc_watchdog_to; + struct callout sc_watchdog_to; struct task init_task; - struct resource *sc_irq; - struct resource *sc_mem; - bus_space_tag_t sc_st; - bus_space_handle_t sc_sh; - bus_size_t sc_sz; - bus_dma_tag_t sc_dmat; - void *sc_ih; + struct resource *sc_irq; + struct resource *sc_mem; + bus_space_tag_t sc_st; + bus_space_handle_t sc_sh; + bus_size_t sc_sz; + bus_dma_tag_t sc_dmat; + void *sc_ih; /* TX scheduler rings. */ - struct iwm_dma_info sched_dma; - uint32_t sched_base; + struct iwm_dma_info sched_dma; + uint32_t sched_base; /* TX/RX rings. */ - struct iwm_tx_ring txq[IWM_MVM_MAX_QUEUES]; - struct iwm_rx_ring rxq; - int qfullmsk; + struct iwm_tx_ring txq[IWM_MVM_MAX_QUEUES]; + struct iwm_rx_ring rxq; + int qfullmsk; - int sc_sf_state; + int sc_sf_state; /* ICT table. */ struct iwm_dma_info ict_dma; int ict_cur; - int sc_hw_rev; - int sc_hw_id; + int sc_hw_rev; + int sc_hw_id; - struct iwm_dma_info kw_dma; - struct iwm_dma_info fw_dma; + struct iwm_dma_info kw_dma; + struct iwm_dma_info fw_dma; - int sc_fw_chunk_done; - int sc_init_complete; + int sc_fw_chunk_done; + int sc_init_complete; - struct iwm_ucode_status sc_uc; - enum iwm_ucode_type sc_uc_current; - int sc_fwver; + struct iwm_ucode_status sc_uc; + enum iwm_ucode_type sc_uc_current; + int sc_fwver; - int sc_capaflags; - int sc_capa_max_probe_len; + int sc_capaflags; + int sc_capa_max_probe_len; - int sc_intmask; - int sc_flags; - uint32_t sc_debug; + int sc_intmask; /* * So why do we need a separate stopped flag and a generation? @@ -443,86 +462,63 @@ struct iwm_softc { * the device from interrupt context when it craps out, so we * don't have the luxury of waiting for quiescense. */ - int sc_generation; + int sc_generation; - const char *sc_fwname; - bus_size_t sc_fwdmasegsz; - struct iwm_fw_info sc_fw; - int sc_fw_phy_config; + const char *sc_fwname; + bus_size_t sc_fwdmasegsz; + struct iwm_fw_info sc_fw; + int sc_fw_phy_config; struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX]; - struct iwm_nvm_data sc_nvm; - struct iwm_phy_db sc_phy_db; + struct iwm_nvm_data sc_nvm; + struct iwm_phy_db sc_phy_db; - struct iwm_bf_data sc_bf; + struct iwm_bf_data sc_bf; - int sc_tx_timer; + int sc_tx_timer; - struct iwm_scan_cmd *sc_scan_cmd; - size_t sc_scan_cmd_len; - int sc_scan_last_antenna; - int sc_scanband; + struct iwm_scan_cmd *sc_scan_cmd; + size_t sc_scan_cmd_len; + int sc_scan_last_antenna; + int sc_scanband; - int sc_auth_prot; + int sc_auth_prot; - int sc_fixed_ridx; + int sc_fixed_ridx; - int sc_staid; - int sc_nodecolor; + int sc_staid; + int sc_nodecolor; - uint8_t sc_cmd_resp[IWM_CMD_RESP_MAX]; - int sc_wantresp; + uint8_t sc_cmd_resp[IWM_CMD_RESP_MAX]; + int sc_wantresp; - struct taskqueue *sc_tq; - struct task sc_es_task; + struct taskqueue *sc_tq; + struct task sc_es_task; - struct iwm_rx_phy_info sc_last_phy_info; - int sc_ampdu_ref; + struct iwm_rx_phy_info sc_last_phy_info; + int sc_ampdu_ref; - struct iwm_int_sta sc_aux_sta; + struct iwm_int_sta sc_aux_sta; /* phy contexts. we only use the first one */ - struct iwm_mvm_phy_ctxt sc_phyctxt[IWM_NUM_PHY_CTX]; + struct iwm_mvm_phy_ctxt sc_phyctxt[IWM_NUM_PHY_CTX]; struct iwm_notif_statistics sc_stats; - int sc_noise; + int sc_noise; - int host_interrupt_operation_mode; + int host_interrupt_operation_mode; caddr_t sc_drvbpf; - union { - struct iwm_rx_radiotap_header th; - uint8_t pad[IEEE80211_RADIOTAP_HDRLEN]; - } sc_rxtapu; -#define sc_rxtap sc_rxtapu.th - - union { - struct iwm_tx_radiotap_header th; - uint8_t pad[IEEE80211_RADIOTAP_HDRLEN]; - } sc_txtapu; -#define sc_txtap sc_txtapu.th - - int sc_max_rssi; -}; - -#define IWM_DEFAULT_MACID 0 -#define IWM_DEFAULT_COLOR 0 -#define IWM_DEFAULT_TSFID 0 - -struct iwm_node { - struct ieee80211_node in_ni; - struct iwm_mvm_phy_ctxt *in_phyctxt; - - /* status "bits" */ - int in_assoc; - - struct iwm_lq_cmd in_lq; + struct iwm_rx_radiotap_header sc_rxtap; + struct iwm_tx_radiotap_header sc_txtap; - uint8_t in_ridx[IEEE80211_RATE_MAXSIZE]; + int sc_max_rssi; }; -#define IWM_STATION_ID 0 -#define IWM_ICT_SIZE 4096 -#define IWM_ICT_COUNT (IWM_ICT_SIZE / sizeof (uint32_t)) -#define IWM_ICT_PADDR_SHIFT 12 +#define IWM_LOCK_INIT(_sc) \ + mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->sc_dev), \ + MTX_NETWORK_LOCK, MTX_DEF); +#define IWM_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define IWM_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define IWM_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx) From owner-svn-src-head@freebsd.org Sun Jan 3 10:10:13 2016 Return-Path: Delivered-To: svn-src-head@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 2EFD7A60897; Sun, 3 Jan 2016 10:10:13 +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 09387149C; Sun, 3 Jan 2016 10:10:12 +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 u03AACt3044713; Sun, 3 Jan 2016 10:10:12 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03AACwR044712; Sun, 3 Jan 2016 10:10:12 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601031010.u03AACwR044712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 3 Jan 2016 10:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293100 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 10:10:13 -0000 Author: avos Date: Sun Jan 3 10:10:11 2016 New Revision: 293100 URL: https://svnweb.freebsd.org/changeset/base/293100 Log: iwm: convert to ieee80211_tx_complete() Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4755 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sun Jan 3 10:06:10 2016 (r293099) +++ head/sys/dev/iwm/if_iwm.c Sun Jan 3 10:10:11 2016 (r293100) @@ -270,7 +270,7 @@ static void iwm_mvm_rx_rx_phy_cmd(struct static int iwm_get_noise(const struct iwm_mvm_statistics_rx_non_phy *); static void iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct iwm_rx_packet *, struct iwm_rx_data *); -static void iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, +static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *, struct iwm_node *); static void iwm_mvm_rx_tx_cmd(struct iwm_softc *, struct iwm_rx_packet *, @@ -2400,12 +2400,13 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, IWM_LOCK(sc); } -static void +static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct iwm_rx_packet *pkt, struct iwm_node *in) { struct iwm_mvm_tx_resp *tx_resp = (void *)pkt->data; - struct ieee80211vap *vap = in->in_ni.ni_vap; + struct ieee80211_node *ni = &in->in_ni; + struct ieee80211vap *vap = ni->ni_vap; int status = le16toh(tx_resp->status.status) & IWM_TX_STATUS_MSK; int failack = tx_resp->failure_frame; @@ -2414,14 +2415,13 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_soft /* Update rate control statistics. */ if (status != IWM_TX_STATUS_SUCCESS && status != IWM_TX_STATUS_DIRECT_DONE) { - if_inc_counter(vap->iv_ifp, IFCOUNTER_OERRORS, 1); - ieee80211_ratectl_tx_complete(vap, &in->in_ni, + ieee80211_ratectl_tx_complete(vap, ni, IEEE80211_RATECTL_TX_FAILURE, &failack, NULL); + return (1); } else { - if_inc_counter(vap->iv_ifp, IFCOUNTER_OPACKETS, 1); - ieee80211_ratectl_tx_complete(vap, &in->in_ni, + ieee80211_ratectl_tx_complete(vap, ni, IEEE80211_RATECTL_TX_SUCCESS, &failack, NULL); - + return (0); } } @@ -2435,33 +2435,30 @@ iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, struct iwm_tx_ring *ring = &sc->txq[qid]; struct iwm_tx_data *txd = &ring->data[idx]; struct iwm_node *in = txd->in; + struct mbuf *m = txd->m; + int status; + + KASSERT(txd->done == 0, ("txd not done")); + KASSERT(txd->in != NULL, ("txd without node")); + KASSERT(txd->m != NULL, ("txd without mbuf")); - if (txd->done) { - device_printf(sc->sc_dev, - "%s: got tx interrupt that's already been handled!\n", - __func__); - return; - } bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); sc->sc_tx_timer = 0; - iwm_mvm_rx_tx_cmd_single(sc, pkt, in); + status = iwm_mvm_rx_tx_cmd_single(sc, pkt, in); /* Unmap and free mbuf. */ bus_dmamap_sync(ring->data_dmat, txd->map, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(ring->data_dmat, txd->map); - m_freem(txd->m); IWM_DPRINTF(sc, IWM_DEBUG_XMIT, "free txd %p, in %p\n", txd, txd->in); - KASSERT(txd->done == 0, ("txd not done")); txd->done = 1; - KASSERT(txd->in, ("txd without node")); - txd->m = NULL; txd->in = NULL; - ieee80211_free_node((struct ieee80211_node *)in); + + ieee80211_tx_complete(&in->in_ni, m, status); if (--ring->queued < IWM_TX_RING_LOMARK) { sc->qfullmsk &= ~(1 << ring->qid); From owner-svn-src-head@freebsd.org Sun Jan 3 10:43:25 2016 Return-Path: Delivered-To: svn-src-head@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 A95C8A5F58B; Sun, 3 Jan 2016 10:43:25 +0000 (UTC) (envelope-from melifaro@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 6A41F19A3; Sun, 3 Jan 2016 10:43:25 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03AhOx6056481; Sun, 3 Jan 2016 10:43:24 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03AhNha056474; Sun, 3 Jan 2016 10:43:23 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601031043.u03AhNha056474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 3 Jan 2016 10:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293101 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 10:43:25 -0000 Author: melifaro Date: Sun Jan 3 10:43:23 2016 New Revision: 293101 URL: https://svnweb.freebsd.org/changeset/base/293101 Log: Remove 'struct route_int6' argument from in6_selectsrc() and in6_selectif(). The main task of in6_selectsrc() is to return IPv6 SAS (along with output interface used for scope checks). No data-path code uses route argument for caching. The only users are icmp6 (reflect code), ND6 ns/na generation code. All this fucntions are control-plane, so there is no reason to try to 'optimize' something by passing cached route into to ip6_output(). Given that, simplify code by eliminating in6_selectsrc() 'struct route_in6' argument. Since in6_selectif() is used only by in6_selectsrc(), eliminate its 'struct route_in6' argument, too. While here, reshape rte-related code inside in6_selectif() to free lookup result immediately after saving all the needed fields. Modified: head/sys/netinet6/icmp6.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_src.c head/sys/netinet6/ip6_var.h head/sys/netinet6/nd6_nbr.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Sun Jan 3 10:10:11 2016 (r293100) +++ head/sys/netinet6/icmp6.c Sun Jan 3 10:43:23 2016 (r293101) @@ -2184,7 +2184,6 @@ icmp6_reflect(struct mbuf *m, size_t off if (srcp == NULL) { int e; struct sockaddr_in6 sin6; - struct route_in6 ro; /* * This case matches to multicasts, our anycast, or unicasts @@ -2196,10 +2195,7 @@ icmp6_reflect(struct mbuf *m, size_t off sin6.sin6_len = sizeof(sin6); sin6.sin6_addr = ip6->ip6_dst; /* zone ID should be embedded */ - bzero(&ro, sizeof(ro)); - e = in6_selectsrc(&sin6, NULL, NULL, &ro, NULL, &outif, &src); - if (ro.ro_rt) - RTFREE(ro.ro_rt); /* XXX: we could use this */ + e = in6_selectsrc(&sin6, NULL, NULL, NULL, &outif, &src); if (e) { char ip6buf[INET6_ADDRSTRLEN]; nd6log((LOG_DEBUG, Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Sun Jan 3 10:10:11 2016 (r293100) +++ head/sys/netinet6/in6_pcb.c Sun Jan 3 10:43:23 2016 (r293101) @@ -359,7 +359,7 @@ in6_pcbladdr(register struct inpcb *inp, return (error); error = in6_selectsrc(sin6, inp->in6p_outputopts, - inp, NULL, inp->inp_cred, &ifp, &in6a); + inp, inp->inp_cred, &ifp, &in6a); if (error) return (error); Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Sun Jan 3 10:10:11 2016 (r293100) +++ head/sys/netinet6/in6_src.c Sun Jan 3 10:43:23 2016 (r293101) @@ -134,7 +134,7 @@ static int selectroute(struct sockaddr_i struct ip6_moptions *, struct route_in6 *, struct ifnet **, struct rtentry **, int, u_int); static int in6_selectif(struct sockaddr_in6 *, struct ip6_pktopts *, - struct ip6_moptions *, struct route_in6 *ro, struct ifnet **, + struct ip6_moptions *, struct ifnet **, struct ifnet *, u_int); static struct in6_addrpolicy *lookup_addrsel_policy(struct sockaddr_in6 *); @@ -177,7 +177,7 @@ static struct in6_addrpolicy *match_addr int in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, - struct inpcb *inp, struct route_in6 *ro, struct ucred *cred, + struct inpcb *inp, struct ucred *cred, struct ifnet **ifpp, struct in6_addr *srcp) { struct rm_priotracker in6_ifa_tracker; @@ -227,7 +227,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso struct in6_ifaddr *ia6; /* get the outgoing interface */ - if ((error = in6_selectif(dstsock, opts, mopts, ro, &ifp, oifp, + if ((error = in6_selectif(dstsock, opts, mopts, &ifp, oifp, (inp != NULL) ? inp->inp_inc.inc_fibnum : RT_DEFAULT_FIB)) != 0) return (error); @@ -293,7 +293,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso * the outgoing interface and the destination address. */ /* get the outgoing interface */ - if ((error = in6_selectif(dstsock, opts, mopts, ro, &ifp, oifp, + if ((error = in6_selectif(dstsock, opts, mopts, &ifp, oifp, (inp != NULL) ? inp->inp_inc.inc_fibnum : RT_DEFAULT_FIB)) != 0) return (error); @@ -761,24 +761,27 @@ selectroute(struct sockaddr_in6 *dstsock static int in6_selectif(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, - struct ip6_moptions *mopts, struct route_in6 *ro, struct ifnet **retifp, + struct ip6_moptions *mopts, struct ifnet **retifp, struct ifnet *oifp, u_int fibnum) { int error; struct route_in6 sro; struct rtentry *rt = NULL; + int rt_flags; KASSERT(retifp != NULL, ("%s: retifp is NULL", __func__)); - if (ro == NULL) { - bzero(&sro, sizeof(sro)); - ro = &sro; - } + bzero(&sro, sizeof(sro)); + rt_flags = 0; + + error = selectroute(dstsock, opts, mopts, &sro, retifp, &rt, 1, fibnum); + + if (rt) + rt_flags = rt->rt_flags; + if (rt && rt == sro.ro_rt) + RTFREE(rt); - if ((error = selectroute(dstsock, opts, mopts, ro, retifp, - &rt, 1, fibnum)) != 0) { - if (ro == &sro && rt && rt == sro.ro_rt) - RTFREE(rt); + if (error != 0) { /* Help ND. See oifp comment in in6_selectsrc(). */ if (oifp != NULL && fibnum == RT_DEFAULT_FIB) { *retifp = oifp; @@ -804,16 +807,12 @@ in6_selectif(struct sockaddr_in6 *dstsoc * Although this may not be very harmful, it should still be confusing. * We thus reject the case here. */ - if (rt && (rt->rt_flags & (RTF_REJECT | RTF_BLACKHOLE))) { - int flags = (rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH); - if (ro == &sro && rt && rt == sro.ro_rt) - RTFREE(rt); - return (flags); + if (rt_flags & (RTF_REJECT | RTF_BLACKHOLE)) { + error = (rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH); + return (error); } - if (ro == &sro && rt && rt == sro.ro_rt) - RTFREE(rt); return (0); } Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Sun Jan 3 10:10:11 2016 (r293100) +++ head/sys/netinet6/ip6_var.h Sun Jan 3 10:43:23 2016 (r293101) @@ -419,7 +419,7 @@ int dest6_input(struct mbuf **, int *, i int none_input(struct mbuf **, int *, int); int in6_selectsrc(struct sockaddr_in6 *, struct ip6_pktopts *, - struct inpcb *inp, struct route_in6 *, struct ucred *cred, + struct inpcb *inp, struct ucred *cred, struct ifnet **, struct in6_addr *); int in6_selectroute(struct sockaddr_in6 *, struct ip6_pktopts *, struct ip6_moptions *, struct route_in6 *, struct ifnet **, Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Sun Jan 3 10:10:11 2016 (r293100) +++ head/sys/netinet6/nd6_nbr.c Sun Jan 3 10:43:23 2016 (r293101) @@ -408,7 +408,6 @@ nd6_ns_output_fib(struct ifnet *ifp, con int icmp6len; int maxlen; caddr_t mac; - struct route_in6 ro; if (IN6_IS_ADDR_MULTICAST(taddr6)) return; @@ -428,8 +427,6 @@ nd6_ns_output_fib(struct ifnet *ifp, con return; M_SETFIB(m, fibnum); - bzero(&ro, sizeof(ro)); - if (daddr6 == NULL || IN6_IS_ADDR_MULTICAST(daddr6)) { m->m_flags |= M_MCAST; im6o.im6o_multicast_ifp = ifp; @@ -497,7 +494,7 @@ nd6_ns_output_fib(struct ifnet *ifp, con oifp = ifp; error = in6_selectsrc(&dst_sa, NULL, - NULL, &ro, NULL, &oifp, &src_in); + NULL, NULL, &oifp, &src_in); if (error) { char ip6buf[INET6_ADDRSTRLEN]; nd6log((LOG_DEBUG, "%s: source can't be " @@ -585,21 +582,15 @@ nd6_ns_output_fib(struct ifnet *ifp, con m_tag_prepend(m, mtag); } - ip6_output(m, NULL, &ro, (nonce != NULL) ? IPV6_UNSPECSRC : 0, + ip6_output(m, NULL, NULL, (nonce != NULL) ? IPV6_UNSPECSRC : 0, &im6o, NULL, NULL); icmp6_ifstat_inc(ifp, ifs6_out_msg); icmp6_ifstat_inc(ifp, ifs6_out_neighborsolicit); ICMP6STAT_INC(icp6s_outhist[ND_NEIGHBOR_SOLICIT]); - /* We don't cache this route. */ - RO_RTFREE(&ro); - return; bad: - if (ro.ro_rt) { - RTFREE(ro.ro_rt); - } m_freem(m); return; } @@ -960,9 +951,6 @@ nd6_na_output_fib(struct ifnet *ifp, con struct sockaddr_in6 dst_sa; int icmp6len, maxlen, error; caddr_t mac = NULL; - struct route_in6 ro; - - bzero(&ro, sizeof(ro)); daddr6 = *daddr6_0; /* make a local copy for modification */ @@ -1020,9 +1008,8 @@ nd6_na_output_fib(struct ifnet *ifp, con /* * Select a source whose scope is the same as that of the dest. */ - bcopy(&dst_sa, &ro.ro_dst, sizeof(dst_sa)); oifp = ifp; - error = in6_selectsrc(&dst_sa, NULL, NULL, &ro, NULL, &oifp, &src); + error = in6_selectsrc(&dst_sa, NULL, NULL, NULL, &oifp, &src); if (error) { char ip6buf[INET6_ADDRSTRLEN]; nd6log((LOG_DEBUG, "nd6_na_output: source can't be " @@ -1093,20 +1080,14 @@ nd6_na_output_fib(struct ifnet *ifp, con m_tag_prepend(m, mtag); } - ip6_output(m, NULL, &ro, 0, &im6o, NULL, NULL); + ip6_output(m, NULL, NULL, 0, &im6o, NULL, NULL); icmp6_ifstat_inc(ifp, ifs6_out_msg); icmp6_ifstat_inc(ifp, ifs6_out_neighboradvert); ICMP6STAT_INC(icp6s_outhist[ND_NEIGHBOR_ADVERT]); - /* We don't cache this route. */ - RO_RTFREE(&ro); - return; bad: - if (ro.ro_rt) { - RTFREE(ro.ro_rt); - } m_freem(m); return; } Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Sun Jan 3 10:10:11 2016 (r293100) +++ head/sys/netinet6/raw_ip6.c Sun Jan 3 10:43:23 2016 (r293101) @@ -460,7 +460,7 @@ rip6_output(struct mbuf *m, struct socke /* * Source address selection. */ - error = in6_selectsrc(dstsock, optp, in6p, NULL, so->so_cred, + error = in6_selectsrc(dstsock, optp, in6p, so->so_cred, &oifp, &in6a); if (error) goto bad; @@ -814,7 +814,7 @@ rip6_connect(struct socket *so, struct s INP_WLOCK(inp); /* Source address selection. XXX: need pcblookup? */ error = in6_selectsrc(addr, inp->in6p_outputopts, - inp, NULL, so->so_cred, &ifp, &in6a); + inp, so->so_cred, &ifp, &in6a); if (error) { INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_ripcbinfo); Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Sun Jan 3 10:10:11 2016 (r293100) +++ head/sys/netinet6/udp6_usrreq.c Sun Jan 3 10:43:23 2016 (r293101) @@ -731,7 +731,7 @@ udp6_output(struct inpcb *inp, struct mb } if (!IN6_IS_ADDR_V4MAPPED(faddr)) { - error = in6_selectsrc(sin6, optp, inp, NULL, + error = in6_selectsrc(sin6, optp, inp, td->td_ucred, &oifp, &in6a); if (error) goto release; From owner-svn-src-head@freebsd.org Sun Jan 3 11:22:16 2016 Return-Path: Delivered-To: svn-src-head@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 B9F1DA602D3; Sun, 3 Jan 2016 11:22:16 +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 8662119CA; Sun, 3 Jan 2016 11:22:16 +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 u03BMFcU067991; Sun, 3 Jan 2016 11:22:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03BMFl0067990; Sun, 3 Jan 2016 11:22:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601031122.u03BMFl0067990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 3 Jan 2016 11:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293102 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 11:22:16 -0000 Author: ngie Date: Sun Jan 3 11:22:15 2016 New Revision: 293102 URL: https://svnweb.freebsd.org/changeset/base/293102 Log: Add sys/types.h for for size_t, etc stable/10 requires it due to header pollution MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libnv/tests/dnv_tests.cc Modified: head/lib/libnv/tests/dnv_tests.cc ============================================================================== --- head/lib/libnv/tests/dnv_tests.cc Sun Jan 3 10:43:23 2016 (r293101) +++ head/lib/libnv/tests/dnv_tests.cc Sun Jan 3 11:22:15 2016 (r293102) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include From owner-svn-src-head@freebsd.org Sun Jan 3 14:42:29 2016 Return-Path: Delivered-To: svn-src-head@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 7549AA60981; Sun, 3 Jan 2016 14:42:29 +0000 (UTC) (envelope-from ian@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 434D61FA0; Sun, 3 Jan 2016 14:42:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03EgSjl028559; Sun, 3 Jan 2016 14:42:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03EgSZq028558; Sun, 3 Jan 2016 14:42:28 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601031442.u03EgSZq028558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 3 Jan 2016 14:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293104 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 14:42:29 -0000 Author: ian Date: Sun Jan 3 14:42:28 2016 New Revision: 293104 URL: https://svnweb.freebsd.org/changeset/base/293104 Log: Store the pointer to the bootloader-provided env data in a static var for use in debug printing. Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Jan 3 12:25:57 2016 (r293103) +++ head/sys/arm/arm/machdep.c Sun Jan 3 14:42:28 2016 (r293104) @@ -194,6 +194,8 @@ int _min_bzero_size = 0; extern int *end; #ifdef FDT +static char *loader_envp; + vm_paddr_t pmap_pa; #ifdef ARM_NEW_PMAP @@ -1110,7 +1112,8 @@ freebsd_parse_boot_param(struct arm_boot return 0; boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); - init_static_kenv(MD_FETCH(kmdp, MODINFOMD_ENVP, char *), 0); + loader_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); + init_static_kenv(loader_envp, 0); lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t); #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); @@ -1433,13 +1436,13 @@ print_kenv(void) char *cp; debugf("loader passed (static) kenv:\n"); - if (kern_envp == NULL) { + if (loader_envp == NULL) { debugf(" no env, null ptr\n"); return; } - debugf(" kern_envp = 0x%08x\n", (uint32_t)kern_envp); + debugf(" loader_envp = 0x%08x\n", (uint32_t)loader_envp); - for (cp = kern_envp; cp != NULL; cp = kenv_next(cp)) + for (cp = loader_envp; cp != NULL; cp = kenv_next(cp)) debugf(" %x %s\n", (uint32_t)cp, cp); } From owner-svn-src-head@freebsd.org Sun Jan 3 14:46:21 2016 Return-Path: Delivered-To: svn-src-head@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 1670DA60B95; Sun, 3 Jan 2016 14:46:21 +0000 (UTC) (envelope-from ian@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 D808014A5; Sun, 3 Jan 2016 14:46:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03EkJT5029160; Sun, 3 Jan 2016 14:46:19 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03EkJdH029159; Sun, 3 Jan 2016 14:46:19 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601031446.u03EkJdH029159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 3 Jan 2016 14:46:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293105 - head/sys/dev/rt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 14:46:21 -0000 Author: ian Date: Sun Jan 3 14:46:19 2016 New Revision: 293105 URL: https://svnweb.freebsd.org/changeset/base/293105 Log: Eliminate code for walking through the early static env data. This code is called from a device attach routine, and thus cannot be called before the cutover from static to dynamic kernel env. Modified: head/sys/dev/rt/if_rt.c Modified: head/sys/dev/rt/if_rt.c ============================================================================== --- head/sys/dev/rt/if_rt.c Sun Jan 3 14:42:28 2016 (r293104) +++ head/sys/dev/rt/if_rt.c Sun Jan 3 14:46:19 2016 (r293105) @@ -227,20 +227,6 @@ macaddr_atoi(const char *str, uint8_t *m } #ifdef USE_GENERATED_MAC_ADDRESS -static char * -kernenv_next(char *cp) -{ - - if (cp != NULL) { - while (*cp != 0) - cp++; - cp++; - if (*cp == 0) - cp = NULL; - } - return (cp); -} - /* * generate_mac(uin8_t *mac) * This is MAC address generator for cases when real device MAC address @@ -259,14 +245,8 @@ generate_mac(uint8_t *mac) uint32_t crc = 0xffffffff; /* Generate CRC32 on kenv */ - if (dynamic_kenv) { - for (cp = kenvp[0]; cp != NULL; cp = kenvp[++i]) { - crc = calculate_crc32c(crc, cp, strlen(cp) + 1); - } - } else { - for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) { - crc = calculate_crc32c(crc, cp, strlen(cp) + 1); - } + for (cp = kenvp[0]; cp != NULL; cp = kenvp[++i]) { + crc = calculate_crc32c(crc, cp, strlen(cp) + 1); } crc = ~crc; From owner-svn-src-head@freebsd.org Sun Jan 3 15:24:59 2016 Return-Path: Delivered-To: svn-src-head@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 3E0A1A5F9A1; Sun, 3 Jan 2016 15:24:59 +0000 (UTC) (envelope-from jhibbits@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 001C41D13; Sun, 3 Jan 2016 15:24:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03FOw7h041545; Sun, 3 Jan 2016 15:24:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03FOwgC041544; Sun, 3 Jan 2016 15:24:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201601031524.u03FOwgC041544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 3 Jan 2016 15:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293106 - head/sys/powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 15:24:59 -0000 Author: jhibbits Date: Sun Jan 3 15:24:57 2016 New Revision: 293106 URL: https://svnweb.freebsd.org/changeset/base/293106 Log: Add error interrupt handler for Freescale PCI errors This eliminates a 'interrupt storm' warning spam with the P5020. Obtained from: Semihalf Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sun Jan 3 14:46:19 2016 (r293105) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sun Jan 3 15:24:57 2016 (r293106) @@ -94,6 +94,29 @@ __FBSDID("$FreeBSD$"); #define REG_PEX_ERR_DR 0x0e00 #define REG_PEX_ERR_EN 0x0e08 +#define REG_PEX_ERR_DR 0x0e00 +#define REG_PEX_ERR_DR_ME 0x80000000 +#define REG_PEX_ERR_DR_PCT 0x800000 +#define REG_PEX_ERR_DR_PAT 0x400000 +#define REG_PEX_ERR_DR_PCAC 0x200000 +#define REG_PEX_ERR_DR_PNM 0x100000 +#define REG_PEX_ERR_DR_CDNSC 0x80000 +#define REG_PEX_ERR_DR_CRSNC 0x40000 +#define REG_PEX_ERR_DR_ICCA 0x20000 +#define REG_PEX_ERR_DR_IACA 0x10000 +#define REG_PEX_ERR_DR_CRST 0x8000 +#define REG_PEX_ERR_DR_MIS 0x4000 +#define REG_PEX_ERR_DR_IOIS 0x2000 +#define REG_PEX_ERR_DR_CIS 0x1000 +#define REG_PEX_ERR_DR_CIEP 0x800 +#define REG_PEX_ERR_DR_IOIEP 0x400 +#define REG_PEX_ERR_DR_OAC 0x200 +#define REG_PEX_ERR_DR_IOIA 0x100 +#define REG_PEX_ERR_DR_IMBA 0x80 +#define REG_PEX_ERR_DR_IIOBA 0x40 +#define REG_PEX_ERR_DR_LDDE 0x20 +#define REG_PEX_ERR_EN 0x0e08 + #define PCIR_LTSSM 0x404 #define LTSSM_STAT_L0 0x16 @@ -113,6 +136,9 @@ struct fsl_pcib_softc { bus_space_tag_t sc_bst; int sc_rid; + struct resource *sc_irq_res; + void *sc_ih; + int sc_busnr; int sc_pcie; uint8_t sc_pcie_capreg; /* PCI-E Capability Reg Set */ @@ -122,6 +148,34 @@ struct fsl_pcib_softc { int sc_devfn_via_ide; }; +struct fsl_pcib_err_dr { + const char *msg; + uint32_t err_dr_mask; +}; + +static const struct fsl_pcib_err_dr pci_err[] = { + {"ME", REG_PEX_ERR_DR_ME}, + {"PCT", REG_PEX_ERR_DR_PCT}, + {"PAT", REG_PEX_ERR_DR_PAT}, + {"PCAC", REG_PEX_ERR_DR_PCAC}, + {"PNM", REG_PEX_ERR_DR_PNM}, + {"CDNSC", REG_PEX_ERR_DR_CDNSC}, + {"CRSNC", REG_PEX_ERR_DR_CRSNC}, + {"ICCA", REG_PEX_ERR_DR_ICCA}, + {"IACA", REG_PEX_ERR_DR_IACA}, + {"CRST", REG_PEX_ERR_DR_CRST}, + {"MIS", REG_PEX_ERR_DR_MIS}, + {"IOIS", REG_PEX_ERR_DR_IOIS}, + {"CIS", REG_PEX_ERR_DR_CIS}, + {"CIEP", REG_PEX_ERR_DR_CIEP}, + {"IOIEP", REG_PEX_ERR_DR_IOIEP}, + {"OAC", REG_PEX_ERR_DR_OAC}, + {"IOIA", REG_PEX_ERR_DR_IOIA}, + {"IMBA", REG_PEX_ERR_DR_IMBA}, + {"IIOBA", REG_PEX_ERR_DR_IIOBA}, + {"LDDE", REG_PEX_ERR_DR_LDDE} +}; + /* Local forward declerations. */ static uint32_t fsl_pcib_cfgread(struct fsl_pcib_softc *, u_int, u_int, u_int, u_int, int); @@ -173,6 +227,35 @@ DEFINE_CLASS_1(pcib, fsl_pcib_driver, fs DRIVER_MODULE(pcib, ofwbus, fsl_pcib_driver, fsl_pcib_devclass, 0, 0); static int +fsl_pcib_err_intr(void *v) +{ + struct fsl_pcib_softc *sc; + device_t dev; + uint32_t err_reg, clear_reg; + uint8_t i; + + dev = (device_t)v; + sc = device_get_softc(dev); + + clear_reg = 0; + err_reg = bus_space_read_4(sc->sc_bst, sc->sc_bsh, REG_PEX_ERR_DR); + + /* Check which one error occurred */ + for (i = 0; i < sizeof(pci_err)/sizeof(struct fsl_pcib_err_dr); i++) { + if (err_reg & pci_err[i].err_dr_mask) { + device_printf(dev, "PCI %d: report %s error\n", + device_get_unit(dev), pci_err[i].msg); + clear_reg |= pci_err[i].err_dr_mask; + } + } + + /* Clear pending errors */ + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_PEX_ERR_DR, clear_reg); + + return (0); +} + +static int fsl_pcib_probe(device_t dev) { @@ -198,7 +281,7 @@ fsl_pcib_attach(device_t dev) struct fsl_pcib_softc *sc; phandle_t node; uint32_t cfgreg; - int maxslot, error; + int error, maxslot, rid; uint8_t ltssm, capptr; sc = device_get_softc(dev); @@ -279,6 +362,34 @@ fsl_pcib_attach(device_t dev) } } + /* Allocate irq */ + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE | RF_SHAREABLE); + if (sc->sc_irq_res == NULL) { + error = fsl_pcib_detach(dev); + if (error != 0) { + device_printf(dev, + "Detach of the driver failed with error %d\n", + error); + } + return (ENXIO); + } + + /* Setup interrupt handler */ + error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, (driver_intr_t *)fsl_pcib_err_intr, dev, &sc->sc_ih); + if (error != 0) { + device_printf(dev, "Could not setup irq, %d\n", error); + sc->sc_ih = NULL; + error = fsl_pcib_detach(dev); + if (error != 0) { + device_printf(dev, + "Detach of the driver failed with error %d\n", + error); + } + return (ENXIO); + } + fsl_pcib_err_init(dev); return (ofw_pci_attach(dev)); From owner-svn-src-head@freebsd.org Sun Jan 3 15:35:02 2016 Return-Path: Delivered-To: svn-src-head@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 57A35A5FCDD; Sun, 3 Jan 2016 15:35:02 +0000 (UTC) (envelope-from jhibbits@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 24F741151; Sun, 3 Jan 2016 15:35:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03FZ18x044359; Sun, 3 Jan 2016 15:35:01 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03FZ188044358; Sun, 3 Jan 2016 15:35:01 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201601031535.u03FZ188044358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 3 Jan 2016 15:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293107 - head/sys/powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 15:35:02 -0000 Author: jhibbits Date: Sun Jan 3 15:35:01 2016 New Revision: 293107 URL: https://svnweb.freebsd.org/changeset/base/293107 Log: Initialize the rid for input. Left uninitialized, random rid causes the IRQ setup to fail, and the PCI device to not be attached. Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sun Jan 3 15:24:57 2016 (r293106) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sun Jan 3 15:35:01 2016 (r293107) @@ -363,6 +363,7 @@ fsl_pcib_attach(device_t dev) } /* Allocate irq */ + rid = 0; sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE | RF_SHAREABLE); if (sc->sc_irq_res == NULL) { From owner-svn-src-head@freebsd.org Sun Jan 3 16:13:05 2016 Return-Path: Delivered-To: svn-src-head@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 02586A607A8; Sun, 3 Jan 2016 16:13:05 +0000 (UTC) (envelope-from melifaro@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 BC46A1169; Sun, 3 Jan 2016 16:13:04 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03GD31J057209; Sun, 3 Jan 2016 16:13:03 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03GD3mG057208; Sun, 3 Jan 2016 16:13:03 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601031613.u03GD3mG057208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 3 Jan 2016 16:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293108 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 16:13:05 -0000 Author: melifaro Date: Sun Jan 3 16:13:03 2016 New Revision: 293108 URL: https://svnweb.freebsd.org/changeset/base/293108 Log: Fix fib4_lookup_nh_ext() flags/flowid order messed up while merging. Modified: head/sys/netinet/in_fib.c Modified: head/sys/netinet/in_fib.c ============================================================================== --- head/sys/netinet/in_fib.c Sun Jan 3 15:35:01 2016 (r293107) +++ head/sys/netinet/in_fib.c Sun Jan 3 16:13:03 2016 (r293108) @@ -175,8 +175,8 @@ fib4_lookup_nh_basic(uint32_t fibnum, st * - howewer mtu from "transmit" interface will be returned. */ int -fib4_lookup_nh_ext(uint32_t fibnum, struct in_addr dst, uint32_t flowid, - uint32_t flags, struct nhop4_extended *pnh4) +fib4_lookup_nh_ext(uint32_t fibnum, struct in_addr dst, uint32_t flags, + uint32_t flowid, struct nhop4_extended *pnh4) { struct radix_node_head *rh; struct radix_node *rn; From owner-svn-src-head@freebsd.org Sun Jan 3 17:38:22 2016 Return-Path: Delivered-To: svn-src-head@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 18337A607A4; Sun, 3 Jan 2016 17:38:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D478E18CC; Sun, 3 Jan 2016 17:38:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::8c53:746d:a745:9178] (unknown [IPv6:2001:7b8:3a7:0:8c53:746d:a745:9178]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id EB45B15323; Sun, 3 Jan 2016 18:38:17 +0100 (CET) Subject: Re: svn commit: r293063 - head/sys/arm/arm Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_81799234-ABAC-430F-ABDC-8FBB58FAD3BF"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: <1451774206.1369.109.camel@freebsd.org> Date: Sun, 3 Jan 2016 18:39:21 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <11380830-624D-437F-B305-902C3BBA4C4C@FreeBSD.org> References: <201601022231.u02MVEb5037283@repo.freebsd.org> <1451774206.1369.109.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 17:38:22 -0000 --Apple-Mail=_81799234-ABAC-430F-ABDC-8FBB58FAD3BF Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 02 Jan 2016, at 23:36, Ian Lepore wrote: > > On Sat, 2016-01-02 at 22:31 +0000, Ian Lepore wrote: ... > > Bah. This is not what I intended to commit, I was going to reword that > comment block to better match what I found while testing. I was > editing the commit message when I decided to do that, so I hit ^C in > the shell that was waiting for me to finish editing in emacs, and to my > surprise it sent the commit instead of cancelling. What's the right > way to change your mind at this late stage of a commit? Ensure that the temporary file created by Subversion is either completely empty, or deleted. This will abort the commit. Alternatively, type a commit message at leisure before committing, save it in a file, and use: svn ci -F commit-message.txt This is what I do. I almost never let Subversion start an editor for me, that is. -Dimitry --Apple-Mail=_81799234-ABAC-430F-ABDC-8FBB58FAD3BF 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----- Version: GnuPG/MacGPG2 v2.0.29 iEYEARECAAYFAlaJXNcACgkQsF6jCi4glqOQCQCgxPT9hVTLKZvjR0fCCIKsle+F EsUAnAo71dBKBiY6TNNSV7DunCI9AxgO =E9bg -----END PGP SIGNATURE----- --Apple-Mail=_81799234-ABAC-430F-ABDC-8FBB58FAD3BF-- From owner-svn-src-head@freebsd.org Sun Jan 3 17:40:18 2016 Return-Path: Delivered-To: svn-src-head@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 E2598A60847; Sun, 3 Jan 2016 17:40:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A932D1A87; Sun, 3 Jan 2016 17:40:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::8c53:746d:a745:9178] (unknown [IPv6:2001:7b8:3a7:0:8c53:746d:a745:9178]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id A2D991532A; Sun, 3 Jan 2016 18:40:16 +0100 (CET) Subject: Re: svn commit: r293068 - in head/etc: . mtree Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_9B8EE1A0-FFC2-456D-94D0-301835FEF65E"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: <201601030432.u034W6en043633@repo.freebsd.org> Date: Sun, 3 Jan 2016 18:41:33 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201601030432.u034W6en043633@repo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 17:40:19 -0000 --Apple-Mail=_9B8EE1A0-FFC2-456D-94D0-301835FEF65E Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 03 Jan 2016, at 05:32, Warner Losh wrote: > > Author: imp > Date: Sun Jan 3 04:32:05 2016 > New Revision: 293068 > URL: https://svnweb.freebsd.org/changeset/base/293068 > > Log: > Add libsoft to the tree, just like lib32. Hmm, are there going to be more of these "multilib" things? :) -Dimitry --Apple-Mail=_9B8EE1A0-FFC2-456D-94D0-301835FEF65E 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----- Version: GnuPG/MacGPG2 v2.0.29 iEYEARECAAYFAlaJXU0ACgkQsF6jCi4glqMM2gCeMocczNkWHua2Ul9qruXkxfhq MNUAniODwOwH5wEvzkLD+DfdfvW4VS4D =a2qY -----END PGP SIGNATURE----- --Apple-Mail=_9B8EE1A0-FFC2-456D-94D0-301835FEF65E-- From owner-svn-src-head@freebsd.org Sun Jan 3 17:58:12 2016 Return-Path: Delivered-To: svn-src-head@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 7C21BA60119; Sun, 3 Jan 2016 17:58:12 +0000 (UTC) (envelope-from adrian@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 3CD201F42; Sun, 3 Jan 2016 17:58:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03HwBlO088502; Sun, 3 Jan 2016 17:58:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03HwBuU088500; Sun, 3 Jan 2016 17:58:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201601031758.u03HwBuU088500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 Jan 2016 17:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293111 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 17:58:12 -0000 Author: adrian Date: Sun Jan 3 17:58:11 2016 New Revision: 293111 URL: https://svnweb.freebsd.org/changeset/base/293111 Log: [ath] remove the inline version of the register access macros. These are going to be much more efficient on low end embedded systems but unfortunately they make it .. less convenient to implement correct bus barriers and debugging. They also didn't implement the register serialisation workaround required for Owl (AR5416.) So, just remove them for now. Later on I'll just inline the routines from ah_osdep.c. Modified: head/sys/dev/ath/ah_osdep.c head/sys/dev/ath/ah_osdep.h Modified: head/sys/dev/ath/ah_osdep.c ============================================================================== --- head/sys/dev/ath/ah_osdep.c Sun Jan 3 17:23:16 2016 (r293110) +++ head/sys/dev/ath/ah_osdep.c Sun Jan 3 17:58:11 2016 (r293111) @@ -270,12 +270,14 @@ ath_hal_reg_write(struct ath_hal *ah, u_ bus_space_tag_t tag = BUSTAG(ah); bus_space_handle_t h = ah->ah_sh; +#ifdef AH_DEBUG /* Debug - complain if we haven't fully waken things up */ if (! ath_hal_reg_whilst_asleep(ah, reg) && ah->ah_powerMode != HAL_PM_AWAKE) { ath_hal_printf(ah, "%s: reg=0x%08x, val=0x%08x, pm=%d\n", __func__, reg, val, ah->ah_powerMode); } +#endif if (ath_hal_alq) { struct ale *ale = ath_hal_alq_get(ah); @@ -303,12 +305,14 @@ ath_hal_reg_read(struct ath_hal *ah, u_i bus_space_handle_t h = ah->ah_sh; u_int32_t val; +#ifdef AH_DEBUG /* Debug - complain if we haven't fully waken things up */ if (! ath_hal_reg_whilst_asleep(ah, reg) && ah->ah_powerMode != HAL_PM_AWAKE) { ath_hal_printf(ah, "%s: reg=0x%08x, pm=%d\n", __func__, reg, ah->ah_powerMode); } +#endif if (ah->ah_config.ah_serialise_reg_war) mtx_lock_spin(&ah_regser_mtx); @@ -345,7 +349,8 @@ OS_MARK(struct ath_hal *ah, u_int id, u_ } } } -#elif defined(AH_DEBUG) || defined(AH_REGOPS_FUNC) +#else /* AH_DEBUG_ALQ */ + /* * Memory-mapped device register read/write. These are here * as routines when debugging support is enabled and/or when @@ -363,12 +368,14 @@ ath_hal_reg_write(struct ath_hal *ah, u_ bus_space_tag_t tag = BUSTAG(ah); bus_space_handle_t h = ah->ah_sh; +#ifdef AH_DEBUG /* Debug - complain if we haven't fully waken things up */ if (! ath_hal_reg_whilst_asleep(ah, reg) && ah->ah_powerMode != HAL_PM_AWAKE) { ath_hal_printf(ah, "%s: reg=0x%08x, val=0x%08x, pm=%d\n", __func__, reg, val, ah->ah_powerMode); } +#endif if (ah->ah_config.ah_serialise_reg_war) mtx_lock_spin(&ah_regser_mtx); @@ -385,12 +392,14 @@ ath_hal_reg_read(struct ath_hal *ah, u_i bus_space_handle_t h = ah->ah_sh; u_int32_t val; +#ifdef AH_DEBUG /* Debug - complain if we haven't fully waken things up */ if (! ath_hal_reg_whilst_asleep(ah, reg) && ah->ah_powerMode != HAL_PM_AWAKE) { ath_hal_printf(ah, "%s: reg=0x%08x, pm=%d\n", __func__, reg, ah->ah_powerMode); } +#endif if (ah->ah_config.ah_serialise_reg_war) mtx_lock_spin(&ah_regser_mtx); @@ -400,7 +409,7 @@ ath_hal_reg_read(struct ath_hal *ah, u_i mtx_unlock_spin(&ah_regser_mtx); return val; } -#endif /* AH_DEBUG || AH_REGOPS_FUNC */ +#endif /* AH_DEBUG_ALQ */ #ifdef AH_ASSERT void Modified: head/sys/dev/ath/ah_osdep.h ============================================================================== --- head/sys/dev/ath/ah_osdep.h Sun Jan 3 17:23:16 2016 (r293110) +++ head/sys/dev/ath/ah_osdep.h Sun Jan 3 17:58:11 2016 (r293111) @@ -131,26 +131,14 @@ struct ath_hal; OS_BUS_BARRIER((_ah), (_reg), 4, (_t)) /* - * Register read/write operations are either handled through - * platform-dependent routines (or when debugging is enabled - * with AH_DEBUG); or they are inline expanded using the macros - * defined below. + * Register read/write operations are handled through + * platform-dependent routines. */ -#if defined(AH_DEBUG) || defined(AH_REGOPS_FUNC) || defined(AH_DEBUG_ALQ) #define OS_REG_WRITE(_ah, _reg, _val) ath_hal_reg_write(_ah, _reg, _val) #define OS_REG_READ(_ah, _reg) ath_hal_reg_read(_ah, _reg) extern void ath_hal_reg_write(struct ath_hal *ah, u_int reg, u_int32_t val); extern u_int32_t ath_hal_reg_read(struct ath_hal *ah, u_int reg); -#else -/* XXX TODO: enforce barriers */ -#define OS_REG_WRITE(_ah, _reg, _val) \ - bus_space_write_4((bus_space_tag_t)(_ah)->ah_st, \ - (bus_space_handle_t)(_ah)->ah_sh, (_reg), (_val)) -#define OS_REG_READ(_ah, _reg) \ - bus_space_read_4((bus_space_tag_t)(_ah)->ah_st, \ - (bus_space_handle_t)(_ah)->ah_sh, (_reg)) -#endif #ifdef AH_DEBUG_ALQ extern void OS_MARK(struct ath_hal *, u_int id, u_int32_t value); From owner-svn-src-head@freebsd.org Sun Jan 3 18:09:48 2016 Return-Path: Delivered-To: svn-src-head@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 4F168A60596; Sun, 3 Jan 2016 18:09:48 +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 1E0501601; Sun, 3 Jan 2016 18:09:48 +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 u03I9lBZ091472; Sun, 3 Jan 2016 18:09:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03I9lNJ091471; Sun, 3 Jan 2016 18:09:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601031809.u03I9lNJ091471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 3 Jan 2016 18:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293112 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 18:09:48 -0000 Author: ngie Date: Sun Jan 3 18:09:46 2016 New Revision: 293112 URL: https://svnweb.freebsd.org/changeset/base/293112 Log: Fix ixl(4) compilation with PCI_IOV pre-r266974 stable/10 doesn't have the if_getdrvflags(9) KPI. Reference the field in the structure directly if the __FreeBSD_version is < 1100022, so the driver can be built with PCI_IOV support on stable/10, without backporting all of r266974 (which requires additional changes due to projects/ifnet, etc) Differential Revision: https://reviews.freebsd.org/D4759 Reviewed by: erj, sbruno Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Sun Jan 3 17:58:11 2016 (r293111) +++ head/sys/dev/ixl/if_ixl.c Sun Jan 3 18:09:46 2016 (r293112) @@ -6606,7 +6606,11 @@ ixl_iov_uninit(device_t dev) pf->veb_seid = 0; } +#if __FreeBSD_version > 1100022 if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) +#else + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) +#endif ixl_disable_intr(vsi); vfs = pf->vfs; From owner-svn-src-head@freebsd.org Sun Jan 3 19:18:49 2016 Return-Path: Delivered-To: svn-src-head@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 CCBEAA5F9A5; Sun, 3 Jan 2016 19:18:49 +0000 (UTC) (envelope-from imp@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 90F53193A; Sun, 3 Jan 2016 19:18:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03JImKS012183; Sun, 3 Jan 2016 19:18:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03JImBs012182; Sun, 3 Jan 2016 19:18:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601031918.u03JImBs012182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 Jan 2016 19:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293115 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 19:18:49 -0000 Author: imp Date: Sun Jan 3 19:18:48 2016 New Revision: 293115 URL: https://svnweb.freebsd.org/changeset/base/293115 Log: Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked up and can cause issues on boot with the prompts. Fix the read-only root case with horrible kludge of mounting rw removing the files, then mounting ro. But since that's no more horrible than the kludge of using marker files in /. With this change, NanoBSD configs can safely use /firstboot + growfs to produce minimal images that grow to the size of the card. Modified: head/etc/rc Modified: head/etc/rc ============================================================================== --- head/etc/rc Sun Jan 3 19:06:17 2016 (r293114) +++ head/etc/rc Sun Jan 3 19:18:48 2016 (r293115) @@ -131,11 +131,14 @@ done # Remove the firstboot sentinel, and reboot if it was requested. if [ -e ${firstboot_sentinel} ]; then - rm ${firstboot_sentinel} + [ ${root_rw_mount} = "yes" ] || mount -uw / + /bin/rm ${firstboot_sentinel} if [ -e ${firstboot_sentinel}-reboot ]; then - rm ${firstboot_sentinel}-reboot + /bin/rm ${firstboot_sentinel}-reboot + [ ${root_rw_mount} = "yes" ] || mount -ur / kill -INT 1 fi + [ ${root_rw_mount} = "yes" ] || mount -ur / fi echo '' From owner-svn-src-head@freebsd.org Sun Jan 3 19:28:04 2016 Return-Path: Delivered-To: svn-src-head@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 70592A5FD7F for ; Sun, 3 Jan 2016 19:28:04 +0000 (UTC) (envelope-from bounces+73574-9504-svn-src-head=freebsd.org@sendgrid.net) Received: from o1.l99.sendgrid.net (o1.l99.sendgrid.net [198.37.153.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23D6B1DCC for ; Sun, 3 Jan 2016 19:28:03 +0000 (UTC) (envelope-from bounces+73574-9504-svn-src-head=freebsd.org@sendgrid.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=subject:to:references:from:mime-version:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=K/PKTfjtgrR/75ccGQ5VpfMFaHw=; b=C1foAMtWeyX5gkRFzS krjvHjnON0+VPPzZsOhvkeKvwsUslayYml8HIJNk1n2/Bmqbrx4O7SH5xlt4h4H6 SoJuYSY+nN55gKc+4zvx7Zs9lm4KsiMyGJ1FoCWOxd5+B5LElsENDEasemFoM8/L C6cDpsGLMfkE/0DGvkDvojvfM= Received: by filter0805p1mdw1.sendgrid.net with SMTP id filter0805p1mdw1.7072.5689763C37 2016-01-03 19:27:56.99517716 +0000 UTC Received: from mail.tarsnap.com (ec2-54-86-246-204.compute-1.amazonaws.com [54.86.246.204]) by ismtpd0006p1iad1.sendgrid.net (SG) with ESMTP id eebfvpqmQ_GTw4FqcgWG-Q for ; Sun, 03 Jan 2016 19:27:56.677 +0000 (UTC) Received: (qmail 84900 invoked from network); 3 Jan 2016 19:25:43 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 3 Jan 2016 19:25:43 -0000 Received: (qmail 98101 invoked from network); 3 Jan 2016 19:27:30 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 3 Jan 2016 19:27:30 -0000 Subject: Re: svn commit: r293115 - head/etc To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601031918.u03JImBs012182@repo.freebsd.org> From: Colin Percival Message-ID: <56897621.6080505@freebsd.org> Date: Sun, 3 Jan 2016 11:27:29 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201601031918.u03JImBs012182@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SG-EID: EvYvoie/qnEezyq2t4eRKjDm9X7ZKbCMt75WvXA+XNERlt/+tTHBguJQkLHfxog2hymAQmIIwmnnBy RealoZgjo0CwCLe5Eg8qntdX8GZAzUx5KI9jk7iGvPkp7ikoGxAEm9o53nCaDDiiOMfVLmo/mNyHQm cj9Sa3cgwtGpkFkvEzR8+13hRjNthgw+0t2KdY3jJIDueICTwclgV26uPSBcvI94rs3r0KKTojpjYR s= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 19:28:04 -0000 On 01/03/16 11:18, Warner Losh wrote: > Log: > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked > up and can cause issues on boot with the prompts. Huh, I never realized that could be a problem. > Fix the read-only > root case with horrible kludge of mounting rw removing the files, then > mounting ro. The solution I intended when I introduced this (and used elsewhere) was to set $firstboot_sentinel in /etc(/defaults)?/rc.conf. This case is precisely why it's a shell variable, in fact. Colin Percival > Modified: head/etc/rc > ============================================================================== > --- head/etc/rc Sun Jan 3 19:06:17 2016 (r293114) > +++ head/etc/rc Sun Jan 3 19:18:48 2016 (r293115) > @@ -131,11 +131,14 @@ done > > # Remove the firstboot sentinel, and reboot if it was requested. > if [ -e ${firstboot_sentinel} ]; then > - rm ${firstboot_sentinel} > + [ ${root_rw_mount} = "yes" ] || mount -uw / > + /bin/rm ${firstboot_sentinel} > if [ -e ${firstboot_sentinel}-reboot ]; then > - rm ${firstboot_sentinel}-reboot > + /bin/rm ${firstboot_sentinel}-reboot > + [ ${root_rw_mount} = "yes" ] || mount -ur / > kill -INT 1 > fi > + [ ${root_rw_mount} = "yes" ] || mount -ur / > fi > > echo '' -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Sun Jan 3 21:30:24 2016 Return-Path: Delivered-To: svn-src-head@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 48686A608B8; Sun, 3 Jan 2016 21:30:24 +0000 (UTC) (envelope-from jilles@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 EF8A01DE9; Sun, 3 Jan 2016 21:30:23 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03LUNgX051104; Sun, 3 Jan 2016 21:30:23 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03LUMj9051102; Sun, 3 Jan 2016 21:30:22 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601032130.u03LUMj9051102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 3 Jan 2016 21:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293118 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 21:30:24 -0000 Author: jilles Date: Sun Jan 3 21:30:22 2016 New Revision: 293118 URL: https://svnweb.freebsd.org/changeset/base/293118 Log: sh: Reduce size of builtins table. Modified: head/bin/sh/exec.c head/bin/sh/mkbuiltins Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Sun Jan 3 20:41:35 2016 (r293117) +++ head/bin/sh/exec.c Sun Jan 3 21:30:22 2016 (r293118) @@ -439,12 +439,14 @@ success: int find_builtin(const char *name, int *special) { - const struct builtincmd *bp; + const unsigned char *bp; + size_t len; - for (bp = builtincmd ; bp->name ; bp++) { - if (*bp->name == *name && equal(bp->name, name)) { - *special = bp->special; - return bp->code; + len = strlen(name); + for (bp = builtincmd ; *bp ; bp += 2 + bp[0]) { + if (bp[0] == len && memcmp(bp + 2, name, len) == 0) { + *special = (bp[1] & BUILTIN_SPECIAL) != 0; + return bp[1] & ~BUILTIN_SPECIAL; } } return -1; Modified: head/bin/sh/mkbuiltins ============================================================================== --- head/bin/sh/mkbuiltins Sun Jan 3 20:41:35 2016 (r293117) +++ head/bin/sh/mkbuiltins Sun Jan 3 21:30:22 2016 (r293118) @@ -62,17 +62,16 @@ echo 'int (*const builtinfunc[])(int, ch awk '/^[^#]/ { printf "\t%s,\n", $1}' $temp echo '}; -const struct builtincmd builtincmd[] = {' +const unsigned char builtincmd[] = {' awk '{ for (i = 2 ; i <= NF ; i++) { if ($i == "-s") { spc = 1; } else { - printf "\t{ \"%s\", %d, %d },\n", $i, NR-1, spc + printf "\t\"\\%03o\\%03o%s\"\n", length($i), (spc ? 128 : 0) + NR-1, $i spc = 0; } }}' $temp -echo ' { NULL, 0, 0 } -};' +echo '};' exec > builtins.h cat <<\! @@ -85,14 +84,10 @@ cat <<\! tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ < $temp | awk '{ printf "#define %s %d\n", $1, NR-1}' echo ' -struct builtincmd { - const char *name; - int code; - int special; -}; +#define BUILTIN_SPECIAL 0x80 extern int (*const builtinfunc[])(int, char **); -extern const struct builtincmd builtincmd[]; +extern const unsigned char builtincmd[]; ' awk '{ printf "int %s(int, char **);\n", $1}' $temp rm -f $temp From owner-svn-src-head@freebsd.org Sun Jan 3 21:32:49 2016 Return-Path: Delivered-To: svn-src-head@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 1946CA60A30; Sun, 3 Jan 2016 21:32:49 +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 C4BD911B7; Sun, 3 Jan 2016 21:32:48 +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 u03LWlO3053659; Sun, 3 Jan 2016 21:32:47 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03LWlia053658; Sun, 3 Jan 2016 21:32:47 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601032132.u03LWlia053658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 3 Jan 2016 21:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293119 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 21:32:49 -0000 Author: avos Date: Sun Jan 3 21:32:47 2016 New Revision: 293119 URL: https://svnweb.freebsd.org/changeset/base/293119 Log: iwm: use m_collapse() to defragment a mbuf chain - Simplify defragmentation code. - Use proper number of dma segments for data. Approved by: adrian (mentor) Obtained from: DragonFlyBSD (mostly) Differential Revision: https://reviews.freebsd.org/D4754 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sun Jan 3 21:30:22 2016 (r293118) +++ head/sys/dev/iwm/if_iwm.c Sun Jan 3 21:32:47 2016 (r293119) @@ -956,7 +956,7 @@ iwm_alloc_tx_ring(struct iwm_softc *sc, error = bus_dma_tag_create(sc->sc_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, - IWM_MAX_SCATTER - 1, MCLBYTES, 0, NULL, NULL, &ring->data_dmat); + IWM_MAX_SCATTER - 2, MCLBYTES, 0, NULL, NULL, &ring->data_dmat); if (error != 0) { device_printf(sc->sc_dev, "could not create TX buf DMA tag\n"); goto fail; @@ -2778,23 +2778,15 @@ iwm_tx(struct iwm_softc *sc, struct mbuf return error; } /* Too many DMA segments, linearize mbuf. */ - MGETHDR(m1, M_NOWAIT, MT_DATA); + m1 = m_collapse(m, M_NOWAIT, IWM_MAX_SCATTER - 2); if (m1 == NULL) { + device_printf(sc->sc_dev, + "%s: could not defrag mbuf\n", __func__); m_freem(m); - return ENOBUFS; - } - if (m->m_pkthdr.len > MHLEN) { - MCLGET(m1, M_NOWAIT); - if (!(m1->m_flags & M_EXT)) { - m_freem(m); - m_freem(m1); - return ENOBUFS; - } + return (ENOBUFS); } - m_copydata(m, 0, m->m_pkthdr.len, mtod(m1, void *)); - m1->m_pkthdr.len = m1->m_len = m->m_pkthdr.len; - m_freem(m); m = m1; + error = bus_dmamap_load_mbuf_sg(ring->data_dmat, data->map, m, segs, &nsegs, BUS_DMA_NOWAIT); if (error != 0) { From owner-svn-src-head@freebsd.org Sun Jan 3 22:16:29 2016 Return-Path: Delivered-To: svn-src-head@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 3E0BCA6084C; Sun, 3 Jan 2016 22:16:29 +0000 (UTC) (envelope-from jilles@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 0B67A1630; Sun, 3 Jan 2016 22:16:28 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03MGSLP066223; Sun, 3 Jan 2016 22:16:28 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03MGSOL066222; Sun, 3 Jan 2016 22:16:28 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601032216.u03MGSOL066222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 3 Jan 2016 22:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293120 - head/bin/sh/tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 22:16:29 -0000 Author: jilles Date: Sun Jan 3 22:16:27 2016 New Revision: 293120 URL: https://svnweb.freebsd.org/changeset/base/293120 Log: sh: Link tests/builtins/getopts9.0 to the build. This was forgotten in r273700. Modified: head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Sun Jan 3 21:32:47 2016 (r293119) +++ head/bin/sh/tests/builtins/Makefile Sun Jan 3 22:16:27 2016 (r293120) @@ -94,6 +94,7 @@ FILES+= getopts5.0 FILES+= getopts6.0 FILES+= getopts7.0 FILES+= getopts8.0 getopts8.0.stdout +FILES+= getopts9.0 getopts9.0.stdout FILES+= hash1.0 hash1.0.stdout FILES+= hash2.0 hash2.0.stdout FILES+= hash3.0 hash3.0.stdout From owner-svn-src-head@freebsd.org Mon Jan 4 01:33:08 2016 Return-Path: Delivered-To: svn-src-head@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 EEFD4A61E38; Mon, 4 Jan 2016 01:33:08 +0000 (UTC) (envelope-from jhibbits@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 BCDC51551; Mon, 4 Jan 2016 01:33:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u041X7Rd027570; Mon, 4 Jan 2016 01:33:07 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u041X7eM027569; Mon, 4 Jan 2016 01:33:07 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201601040133.u041X7eM027569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 4 Jan 2016 01:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293128 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 01:33:09 -0000 Author: jhibbits Date: Mon Jan 4 01:33:07 2016 New Revision: 293128 URL: https://svnweb.freebsd.org/changeset/base/293128 Log: Set the cacheline size before calling powerpc_init() powerpc_init() initializes the mmu. Since this may clear pages via pmap_zero_page(), set the cacheline size before calling into it, so pmap_zero_page() has the right cacheline size. This isn't completely necessary now, but will be when 64-bit book-e is completed. Modified: head/sys/powerpc/booke/booke_machdep.c Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Mon Jan 4 01:16:32 2016 (r293127) +++ head/sys/powerpc/booke/booke_machdep.c Mon Jan 4 01:33:07 2016 (r293128) @@ -316,8 +316,6 @@ booke_init(uint32_t arg1, uint32_t arg2) else /* U-Boot */ mdp = NULL; - ret = powerpc_init(dtbp, 0, 0, mdp); - /* Default to 32 byte cache line size. */ switch ((mfpvr()) >> 16) { case FSL_E500mc: @@ -327,6 +325,8 @@ booke_init(uint32_t arg1, uint32_t arg2) break; } + ret = powerpc_init(dtbp, 0, 0, mdp); + /* Enable caches */ booke_enable_l1_cache(); booke_enable_l2_cache(); From owner-svn-src-head@freebsd.org Mon Jan 4 02:20:16 2016 Return-Path: Delivered-To: svn-src-head@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 25ADFA60AF7; Mon, 4 Jan 2016 02:20:16 +0000 (UTC) (envelope-from jhibbits@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 E93DC1A87; Mon, 4 Jan 2016 02:20:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u042KFqo042109; Mon, 4 Jan 2016 02:20:15 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u042KF56042108; Mon, 4 Jan 2016 02:20:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201601040220.u042KF56042108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 4 Jan 2016 02:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293129 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 02:20:16 -0000 Author: jhibbits Date: Mon Jan 4 02:20:14 2016 New Revision: 293129 URL: https://svnweb.freebsd.org/changeset/base/293129 Log: Make arguments for booke_init() u_long, to match register width. On powerpc64, pointers are 64 bits, so casting from uint32_t changes the integer width. The alternative was to use register_t, but I didn't see register_t used as argument type for any other functions, though didn't look too closely. u_long was an acceptable alternative. On 64-bit it's 64 bits, on 32-bit it's 32 bits. Modified: head/sys/powerpc/booke/booke_machdep.c Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Mon Jan 4 01:33:07 2016 (r293128) +++ head/sys/powerpc/booke/booke_machdep.c Mon Jan 4 02:20:14 2016 (r293129) @@ -173,7 +173,7 @@ uint32_t *bootinfo; void print_kernel_section_addr(void); void print_kenv(void); -uintptr_t booke_init(uint32_t, uint32_t); +uintptr_t booke_init(u_long, u_long); void ivor_setup(void); extern void *interrupt_vector_base; @@ -268,7 +268,7 @@ booke_check_for_fdt(uint32_t arg1, vm_of } uintptr_t -booke_init(uint32_t arg1, uint32_t arg2) +booke_init(u_long arg1, u_long arg2) { uintptr_t ret; void *mdp; From owner-svn-src-head@freebsd.org Mon Jan 4 03:02:45 2016 Return-Path: Delivered-To: svn-src-head@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 884A4A616C1; Mon, 4 Jan 2016 03:02:45 +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 4C42E1D9A; Mon, 4 Jan 2016 03:02:45 +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 u0432iip057407; Mon, 4 Jan 2016 03:02:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0432ifw057406; Mon, 4 Jan 2016 03:02:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040302.u0432ifw057406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 03:02:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293130 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 03:02:45 -0000 Author: ngie Date: Mon Jan 4 03:02:44 2016 New Revision: 293130 URL: https://svnweb.freebsd.org/changeset/base/293130 Log: Rename nitems and string variables to avoid collisions Rename the `nitems` variable to `num_items` to avoid collisions with the macro in sys/param.h for counting elements in an array Similarly, rename `string` to `string_arr` to avoid future collisions with potential keywords, as well as make it clear that `string_arr` isn't a char* value, but instead a char** value. Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libnv/tests/nv_array_tests.cc Modified: head/lib/libnv/tests/nv_array_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 02:20:14 2016 (r293129) +++ head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 03:02:44 2016 (r293130) @@ -50,7 +50,7 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__ba const bool *const_result; bool *result; nvlist_t *nvl; - size_t nitems; + size_t num_items; unsigned int i; const char *key; @@ -69,16 +69,16 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__ba ATF_REQUIRE(nvlist_exists_bool_array(nvl, key)); ATF_REQUIRE(nvlist_exists_bool_array(nvl, "nvl/bool")); - const_result = nvlist_get_bool_array(nvl, key, &nitems); - ATF_REQUIRE_EQ(nitems, 16); + const_result = nvlist_get_bool_array(nvl, key, &num_items); + ATF_REQUIRE_EQ(num_items, 16); ATF_REQUIRE(const_result != NULL); - for (i = 0; i < nitems; i++) + for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(const_result[i], testbool[i]); - result = nvlist_take_bool_array(nvl, key, &nitems); - ATF_REQUIRE_EQ(nitems, 16); + result = nvlist_take_bool_array(nvl, key, &num_items); + ATF_REQUIRE_EQ(num_items, 16); ATF_REQUIRE(const_result != NULL); - for (i = 0; i < nitems; i++) + for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(result[i], testbool[i]); ATF_REQUIRE(!nvlist_exists_bool_array(nvl, key)); @@ -95,10 +95,10 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ const char * const *const_result; char **result; nvlist_t *nvl; - size_t nitems; + size_t num_items; unsigned int i; const char *key; - const char *string[8] = { "a", "b", "kot", "foo", + const char *string_arr[8] = { "a", "b", "kot", "foo", "tests", "nice test", "", "abcdef" }; key = "nvl/string"; @@ -107,32 +107,33 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); - nvlist_add_string_array(nvl, key, string, 8); + nvlist_add_string_array(nvl, key, string_arr, 8); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_string_array(nvl, key)); ATF_REQUIRE(nvlist_exists_string_array(nvl, "nvl/string")); - const_result = nvlist_get_string_array(nvl, key, &nitems); + const_result = nvlist_get_string_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(nitems == 8); - for (i = 0; i < nitems; i++) { - if (string[i] != NULL) { - ATF_REQUIRE(strcmp(const_result[i], string[i]) == 0); + ATF_REQUIRE(num_items == 8); + for (i = 0; i < num_items; i++) { + if (string_arr[i] != NULL) { + ATF_REQUIRE(strcmp(const_result[i], + string_arr[i]) == 0); } else { - ATF_REQUIRE(const_result[i] == string[i]); + ATF_REQUIRE(const_result[i] == string_arr[i]); } } - result = nvlist_take_string_array(nvl, key, &nitems); + result = nvlist_take_string_array(nvl, key, &num_items); ATF_REQUIRE(result != NULL); - ATF_REQUIRE_EQ(nitems, 8); - for (i = 0; i < nitems; i++) { - if (string[i] != NULL) { - ATF_REQUIRE_EQ(strcmp(result[i], string[i]), 0); + ATF_REQUIRE_EQ(num_items, 8); + for (i = 0; i < num_items; i++) { + if (string_arr[i] != NULL) { + ATF_REQUIRE_EQ(strcmp(result[i], string_arr[i]), 0); } else { - ATF_REQUIRE_EQ(result[i], string[i]); + ATF_REQUIRE_EQ(result[i], string_arr[i]); } } @@ -152,7 +153,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr int fd[32], *result; const int *const_result; nvlist_t *nvl; - size_t nitems; + size_t num_items; unsigned int i; const char *key; @@ -173,20 +174,20 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr ATF_REQUIRE(nvlist_exists_descriptor_array(nvl, key)); ATF_REQUIRE(nvlist_exists_descriptor_array(nvl, "nvl/descriptor")); - const_result = nvlist_get_descriptor_array(nvl, key, &nitems); + const_result = nvlist_get_descriptor_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(nitems == 32); - for (i = 0; i < nitems; i++) { + ATF_REQUIRE(num_items == 32); + for (i = 0; i < num_items; i++) { ATF_REQUIRE(fd_is_valid(const_result[i])); if (i > 0) ATF_REQUIRE(const_result[i] != const_result[i - 1]); } - result = nvlist_take_descriptor_array(nvl, key, &nitems); + result = nvlist_take_descriptor_array(nvl, key, &num_items); ATF_REQUIRE(result != NULL); - ATF_REQUIRE_EQ(nitems, 32); - for (i = 0; i < nitems; i++) { + ATF_REQUIRE_EQ(num_items, 32); + for (i = 0; i < num_items; i++) { ATF_REQUIRE(fd_is_valid(result[i])); if (i > 0) ATF_REQUIRE(const_result[i] != const_result[i - 1]); @@ -196,7 +197,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); - for (i = 0; i < nitems; i++) { + for (i = 0; i < num_items; i++) { close(result[i]); close(fd[i]); } @@ -210,7 +211,7 @@ ATF_TEST_CASE_BODY(nvlist_number_array__ const uint64_t *const_result; uint64_t *result; nvlist_t *nvl; - size_t nitems; + size_t num_items; unsigned int i; const char *key; const uint64_t number[8] = { 0, UINT_MAX, 7, 123, 90, @@ -228,17 +229,17 @@ ATF_TEST_CASE_BODY(nvlist_number_array__ ATF_REQUIRE(nvlist_exists_number_array(nvl, key)); ATF_REQUIRE(nvlist_exists_number_array(nvl, "nvl/number")); - const_result = nvlist_get_number_array(nvl, key, &nitems); + const_result = nvlist_get_number_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(nitems == 8); - for (i = 0; i < nitems; i++) + ATF_REQUIRE(num_items == 8); + for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(const_result[i], number[i]); - result = nvlist_take_number_array(nvl, key, &nitems); + result = nvlist_take_number_array(nvl, key, &num_items); ATF_REQUIRE(result != NULL); - ATF_REQUIRE_EQ(nitems, 8); - for (i = 0; i < nitems; i++) + ATF_REQUIRE_EQ(num_items, 8); + for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(result[i], number[i]); ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); @@ -256,7 +257,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ const nvlist_t * const *const_result; nvlist_t **result; nvlist_t *nvl; - size_t nitems; + size_t num_items; unsigned int i; const char *somestr[8] = { "a", "b", "c", "d", "e", "f", "g", "h" }; const char *key; @@ -282,14 +283,14 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ ATF_REQUIRE(nvlist_exists_nvlist_array(nvl, key)); ATF_REQUIRE(nvlist_exists_nvlist_array(nvl, "nvl/nvlist")); - const_result = nvlist_get_nvlist_array(nvl, key, &nitems); + const_result = nvlist_get_nvlist_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(nitems == 8); + ATF_REQUIRE(num_items == 8); - for (i = 0; i < nitems; i++) { + for (i = 0; i < num_items; i++) { ATF_REQUIRE_EQ(nvlist_error(const_result[i]), 0); - if (i < nitems - 1) { + if (i < num_items - 1) { ATF_REQUIRE(nvlist_get_array_next(const_result[i]) == const_result[i + 1]); } else { @@ -304,10 +305,10 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ "nvl/string"), somestr[i]) == 0); } - result = nvlist_take_nvlist_array(nvl, key, &nitems); + result = nvlist_take_nvlist_array(nvl, key, &num_items); ATF_REQUIRE(result != NULL); - ATF_REQUIRE_EQ(nitems, 8); - for (i = 0; i < nitems; i++) { + ATF_REQUIRE_EQ(num_items, 8); + for (i = 0; i < num_items; i++) { ATF_REQUIRE_EQ(nvlist_error(result[i]), 0); ATF_REQUIRE(nvlist_get_array_next(result[i]) == NULL); ATF_REQUIRE(nvlist_get_array_next(const_result[i]) == NULL); @@ -335,8 +336,8 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) const nvlist_t *nvl; bool testbool[16]; int testfd[16]; - size_t i, nitems; - const char *string[8] = { "a", "b", "kot", "foo", + size_t i, num_items; + const char *string_arr[8] = { "a", "b", "kot", "foo", "tests", "nice test", "", "abcdef" }; const char *somestr[8] = { "a", "b", "c", "d", "e", "f", "g", "h" }; const uint64_t number[8] = { 0, UINT_MAX, 7, 123, 90, @@ -363,7 +364,7 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) ATF_REQUIRE(nvlist_exists_bool_array(src, "nvl/bool")); ATF_REQUIRE(!nvlist_exists_string_array(src, "nvl/string")); - nvlist_add_string_array(src, "nvl/string", string, 8); + nvlist_add_string_array(src, "nvl/string", string_arr, 8); ATF_REQUIRE_EQ(nvlist_error(src), 0); ATF_REQUIRE(nvlist_exists_string_array(src, "nvl/string")); @@ -387,52 +388,52 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) ATF_REQUIRE(dst != NULL); ATF_REQUIRE(nvlist_exists_bool_array(dst, "nvl/bool")); - (void) nvlist_get_bool_array(dst, "nvl/bool", &nitems); - ATF_REQUIRE_EQ(nitems, 16); - for (i = 0; i < nitems; i++) { + (void) nvlist_get_bool_array(dst, "nvl/bool", &num_items); + ATF_REQUIRE_EQ(num_items, 16); + for (i = 0; i < num_items; i++) { ATF_REQUIRE( - nvlist_get_bool_array(dst, "nvl/bool", &nitems)[i] == - nvlist_get_bool_array(src, "nvl/bool", &nitems)[i]); + nvlist_get_bool_array(dst, "nvl/bool", &num_items)[i] == + nvlist_get_bool_array(src, "nvl/bool", &num_items)[i]); } ATF_REQUIRE(nvlist_exists_string_array(dst, "nvl/string")); - (void) nvlist_get_string_array(dst, "nvl/string", &nitems); - ATF_REQUIRE_EQ(nitems, 8); - for (i = 0; i < nitems; i++) { + (void) nvlist_get_string_array(dst, "nvl/string", &num_items); + ATF_REQUIRE_EQ(num_items, 8); + for (i = 0; i < num_items; i++) { if (nvlist_get_string_array(dst, "nvl/string", - &nitems)[i] == NULL) { + &num_items)[i] == NULL) { ATF_REQUIRE(nvlist_get_string_array(dst, "nvl/string", - &nitems)[i] == nvlist_get_string_array(src, - "nvl/string", &nitems)[i]); + &num_items)[i] == nvlist_get_string_array(src, + "nvl/string", &num_items)[i]); } else { ATF_REQUIRE(strcmp(nvlist_get_string_array(dst, - "nvl/string", &nitems)[i], nvlist_get_string_array( - src, "nvl/string", &nitems)[i]) == 0); + "nvl/string", &num_items)[i], nvlist_get_string_array( + src, "nvl/string", &num_items)[i]) == 0); } } ATF_REQUIRE(nvlist_exists_descriptor_array(dst, "nvl/fd")); - (void) nvlist_get_descriptor_array(dst, "nvl/fd", &nitems); - ATF_REQUIRE_EQ(nitems, 16); - for (i = 0; i < nitems; i++) { + (void) nvlist_get_descriptor_array(dst, "nvl/fd", &num_items); + ATF_REQUIRE_EQ(num_items, 16); + for (i = 0; i < num_items; i++) { ATF_REQUIRE(fd_is_valid( - nvlist_get_descriptor_array(dst, "nvl/fd", &nitems)[i])); + nvlist_get_descriptor_array(dst, "nvl/fd", &num_items)[i])); } ATF_REQUIRE(nvlist_exists_number_array(dst, "nvl/number")); - (void) nvlist_get_number_array(dst, "nvl/number", &nitems); - ATF_REQUIRE_EQ(nitems, 8); + (void) nvlist_get_number_array(dst, "nvl/number", &num_items); + ATF_REQUIRE_EQ(num_items, 8); - for (i = 0; i < nitems; i++) { + for (i = 0; i < num_items; i++) { ATF_REQUIRE( - nvlist_get_number_array(dst, "nvl/number", &nitems)[i] == - nvlist_get_number_array(src, "nvl/number", &nitems)[i]); + nvlist_get_number_array(dst, "nvl/number", &num_items)[i] == + nvlist_get_number_array(src, "nvl/number", &num_items)[i]); } ATF_REQUIRE(nvlist_exists_nvlist_array(dst, "nvl/array")); - (void) nvlist_get_nvlist_array(dst, "nvl/array", &nitems); - ATF_REQUIRE_EQ(nitems, 8); - for (i = 0; i < nitems; i++) { - nvl = nvlist_get_nvlist_array(dst, "nvl/array", &nitems)[i]; + (void) nvlist_get_nvlist_array(dst, "nvl/array", &num_items); + ATF_REQUIRE_EQ(num_items, 8); + for (i = 0; i < num_items; i++) { + nvl = nvlist_get_nvlist_array(dst, "nvl/array", &num_items)[i]; ATF_REQUIRE(nvlist_exists_string(nvl, "nvl/nvl/teststr")); ATF_REQUIRE(strcmp(nvlist_get_string(nvl, "nvl/nvl/teststr"), somestr[i]) == 0); @@ -454,7 +455,7 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__mo bool *testbool; const bool *const_result; nvlist_t *nvl; - size_t nitems, count; + size_t num_items, count; unsigned int i; const char *key; @@ -475,11 +476,11 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__mo ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_bool_array(nvl, key)); - const_result = nvlist_get_bool_array(nvl, key, &nitems); - ATF_REQUIRE_EQ(nitems, count); + const_result = nvlist_get_bool_array(nvl, key, &num_items); + ATF_REQUIRE_EQ(num_items, count); ATF_REQUIRE(const_result != NULL); ATF_REQUIRE(const_result == testbool); - for (i = 0; i < nitems; i++) + for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(const_result[i], (i % 2 == 0)); nvlist_destroy(nvl); @@ -491,7 +492,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ char **teststr; const char * const *const_result; nvlist_t *nvl; - size_t nitems, count; + size_t num_items, count; unsigned int i; const char *key; @@ -516,11 +517,11 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_string_array(nvl, key)); - const_result = nvlist_get_string_array(nvl, key, &nitems); - ATF_REQUIRE_EQ(nitems, count); + const_result = nvlist_get_string_array(nvl, key, &num_items); + ATF_REQUIRE_EQ(num_items, count); ATF_REQUIRE(const_result != NULL); ATF_REQUIRE((intptr_t)const_result == (intptr_t)teststr); - for (i = 0; i < nitems; i++) { + for (i = 0; i < num_items; i++) { ATF_REQUIRE_EQ(const_result[i][0], (char)('a' + i)); ATF_REQUIRE_EQ(const_result[i][1], '\0'); } @@ -534,7 +535,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ nvlist **testnv; const nvlist * const *const_result; nvlist_t *nvl; - size_t nitems, count; + size_t num_items, count; unsigned int i; const char *key; @@ -557,14 +558,14 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_nvlist_array(nvl, key)); - const_result = nvlist_get_nvlist_array(nvl, key, &nitems); - ATF_REQUIRE_EQ(nitems, count); + const_result = nvlist_get_nvlist_array(nvl, key, &num_items); + ATF_REQUIRE_EQ(num_items, count); ATF_REQUIRE(const_result != NULL); ATF_REQUIRE((intptr_t)const_result == (intptr_t)testnv); - for (i = 0; i < nitems; i++) { + for (i = 0; i < num_items; i++) { ATF_REQUIRE_EQ(nvlist_error(const_result[i]), 0); ATF_REQUIRE(nvlist_empty(const_result[i])); - if (i < nitems - 1) { + if (i < num_items - 1) { ATF_REQUIRE(nvlist_get_array_next(const_result[i]) == const_result[i + 1]); } else { @@ -584,7 +585,7 @@ ATF_TEST_CASE_BODY(nvlist_number_array__ uint64_t *testnumber; const uint64_t *const_result; nvlist_t *nvl; - size_t nitems, count; + size_t num_items, count; unsigned int i; const char *key; @@ -605,11 +606,11 @@ ATF_TEST_CASE_BODY(nvlist_number_array__ ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_number_array(nvl, key)); - const_result = nvlist_get_number_array(nvl, key, &nitems); - ATF_REQUIRE_EQ(nitems, count); + const_result = nvlist_get_number_array(nvl, key, &num_items); + ATF_REQUIRE_EQ(num_items, count); ATF_REQUIRE(const_result != NULL); ATF_REQUIRE(const_result == testnumber); - for (i = 0; i < nitems; i++) + for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(const_result[i], i); nvlist_destroy(nvl); @@ -621,7 +622,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr int *testfd; const int *const_result; nvlist_t *nvl; - size_t nitems, count; + size_t num_items, count; unsigned int i; const char *key; @@ -644,11 +645,11 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_descriptor_array(nvl, key)); - const_result = nvlist_get_descriptor_array(nvl, key, &nitems); - ATF_REQUIRE_EQ(nitems, count); + const_result = nvlist_get_descriptor_array(nvl, key, &num_items); + ATF_REQUIRE_EQ(num_items, count); ATF_REQUIRE(const_result != NULL); ATF_REQUIRE(const_result == testfd); - for (i = 0; i < nitems; i++) + for (i = 0; i < num_items; i++) ATF_REQUIRE(fd_is_valid(const_result[i])); nvlist_destroy(nvl); @@ -988,7 +989,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr { nvlist_t *nvl; const char *key; - size_t nitems; + size_t num_items; unsigned int i; const int *const_result; int desc[32], fd, socks[2]; @@ -1021,7 +1022,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr ATF_REQUIRE(nvlist_send(fd, nvl) >= 0); - for (i = 0; i < nitems; i++) + for (i = 0; i < num_items; i++) close(desc[i]); } else { /* Parent */ @@ -1034,10 +1035,10 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(nvlist_exists_descriptor_array(nvl, key)); - const_result = nvlist_get_descriptor_array(nvl, key, &nitems); + const_result = nvlist_get_descriptor_array(nvl, key, &num_items); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE_EQ(nitems, 32); - for (i = 0; i < nitems; i++) + ATF_REQUIRE_EQ(num_items, 32); + for (i = 0; i < num_items; i++) ATF_REQUIRE(fd_is_valid(const_result[i])); atf::utils::wait(pid, 0, "", ""); @@ -1096,7 +1097,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ const nvlist_t * const *const_result; nvlist_t **result; nvlist_t *nvl; - size_t nitems, packed_size; + size_t num_items, packed_size; unsigned int i; void *packed; const char *somestr[8] = { "a", "b", "c", "d", "e", "f", "g", "h" }; @@ -1130,12 +1131,12 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ ATF_REQUIRE_EQ(nvlist_error(unpacked), 0); ATF_REQUIRE(nvlist_exists_nvlist_array(unpacked, key)); - const_result = nvlist_get_nvlist_array(unpacked, key, &nitems); + const_result = nvlist_get_nvlist_array(unpacked, key, &num_items); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE_EQ(nitems, 8); - for (i = 0; i < nitems; i++) { + ATF_REQUIRE_EQ(num_items, 8); + for (i = 0; i < num_items; i++) { ATF_REQUIRE_EQ(nvlist_error(const_result[i]), 0); - if (i < nitems - 1) { + if (i < num_items - 1) { ATF_REQUIRE(nvlist_get_array_next(const_result[i]) == const_result[i + 1]); } else { From owner-svn-src-head@freebsd.org Mon Jan 4 03:06:01 2016 Return-Path: Delivered-To: svn-src-head@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 966D5A61764 for ; Mon, 4 Jan 2016 03:06:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x229.google.com (mail-qg0-x229.google.com [IPv6:2607:f8b0:400d:c04::229]) (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 4C3AC1F33 for ; Mon, 4 Jan 2016 03:06:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x229.google.com with SMTP id o11so246357214qge.2 for ; Sun, 03 Jan 2016 19:06:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=EPnTteQ+ExW22v9qgagVCGvQG+qaWDWKKXMKs4MZDQo=; b=sMwu0BsAGBiOk0nzUf76pjXjIzlM+PbmiRSAbBhDtG1wbTytfTyQkyZxCf4rsHKD/D d8DIYKBeTAgfQPScRqiB/cXUZ+wLqCmrvAtlMLh+08p3mF4gGmc+zHUGoMovseuNF1YC YDz5kDKJpnG96sA0qKZ4M8DNsxQbluVheicybrlmII7nxNX8mxJJ2Lxtdz97Pz+9NDbO HUWLN7w2fjx7L6j5C4Ulbvl/df0MIBhKdZbJBHx4HQoDuAYDy7KMOR5bDbjhuXBehwu7 qQiLlWIXvh6cOJ5xG0VdyNm32+/wfFNbMSIh5HTOGmsV0sLiMwWhtZGGptVn7ng5UIsr Dv0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=EPnTteQ+ExW22v9qgagVCGvQG+qaWDWKKXMKs4MZDQo=; b=aAdzPKYMrI6iRwNhM9rA4G7l4/yzLtWyDrmb/SLgk7S3vLruD8lI9i3go8+dBv/9kT kTEYbDT0qG7sdykdHRG2nQOZj5VCf88hnKrMMHY6EJghd3kH2LN7Dws9O/Ii/8rK5ZyJ b8Qzsa8asYunBSKaZTKDbEKN4QNhlZC9kCqezS+XxZGyr79ZCM2guuWOnLeL38lbmIjZ J7mb85JVmSfenUn5WqKxalduT36h0cxHERd+FaXD6KA9xD2FhETge/X06MsGxcq77YFp IooK0L3qh9u2twtvhKYvwcJ+Anc2JX1OhQTfoVkhpAASg5/KMSnfMT9jBfVxRZP54bsW Y0iw== X-Gm-Message-State: ALoCoQmj0mT4zKsyT4cAsCNg4JpNVX3bWSUNf8vRzqiqtl+TGlaaH28tBccilwp3iwhwgaylKCY6ZTm0zLyRRqvNUXLNWWvOaQ== MIME-Version: 1.0 X-Received: by 10.140.93.77 with SMTP id c71mr77721866qge.46.1451876759928; Sun, 03 Jan 2016 19:05:59 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Sun, 3 Jan 2016 19:05:59 -0800 (PST) X-Originating-IP: [2607:fb90:190f:beae:0:4b:58f4:e301] Received: by 10.140.27.181 with HTTP; Sun, 3 Jan 2016 19:05:59 -0800 (PST) In-Reply-To: References: <201601030432.u034W6en043633@repo.freebsd.org> Date: Sun, 3 Jan 2016 20:05:59 -0700 X-Google-Sender-Auth: wvGz0yuNfV4IbOZb8fpGRzOuyic Message-ID: Subject: Re: svn commit: r293068 - in head/etc: . mtree From: Warner Losh To: Dimitry Andric Cc: src-committers , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Warner Losh Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 03:06:01 -0000 Perhaps. Do you have any advice? Warner On Jan 3, 2016 10:40 AM, "Dimitry Andric" wrote: > On 03 Jan 2016, at 05:32, Warner Losh wrote: > > > > Author: imp > > Date: Sun Jan 3 04:32:05 2016 > > New Revision: 293068 > > URL: https://svnweb.freebsd.org/changeset/base/293068 > > > > Log: > > Add libsoft to the tree, just like lib32. > > Hmm, are there going to be more of these "multilib" things? :) > > -Dimitry > > From owner-svn-src-head@freebsd.org Mon Jan 4 03:12:19 2016 Return-Path: Delivered-To: svn-src-head@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 EB616A619A7; Mon, 4 Jan 2016 03:12:19 +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 BC3FB1346; Mon, 4 Jan 2016 03:12:19 +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 u043CInQ004511; Mon, 4 Jan 2016 03:12:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u043CIW9004510; Mon, 4 Jan 2016 03:12:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040312.u043CIW9004510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 03:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293131 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 03:12:20 -0000 Author: ngie Date: Mon Jan 4 03:12:18 2016 New Revision: 293131 URL: https://svnweb.freebsd.org/changeset/base/293131 Log: Convert another `string` variable to `string_arr` missed in r293130 Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libnv/tests/nv_array_tests.cc Modified: head/lib/libnv/tests/nv_array_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 03:02:44 2016 (r293130) +++ head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 03:12:18 2016 (r293131) @@ -1057,7 +1057,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ void *packed; unsigned int i; const char * const *const_result; - const char *string[8] = { "a", "b", "kot", "foo", + const char *string_arr[8] = { "a", "b", "kot", "foo", "tests", "nice test", "", "abcdef" }; key = "nvl/string"; @@ -1066,7 +1066,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); - nvlist_add_string_array(nvl, key, string, 8); + nvlist_add_string_array(nvl, key, string_arr, 8); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_string_array(nvl, key)); @@ -1082,7 +1082,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ const_result = nvlist_get_string_array(unpacked, key, &count); ATF_REQUIRE_EQ(count, 8); for (i = 0; i < count; i++) { - ATF_REQUIRE_EQ(strcmp(string[i], const_result[i]), 0); + ATF_REQUIRE_EQ(strcmp(string_arr[i], const_result[i]), 0); } nvlist_destroy(nvl); From owner-svn-src-head@freebsd.org Mon Jan 4 03:26:37 2016 Return-Path: Delivered-To: svn-src-head@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 EFCA4A61D78; Mon, 4 Jan 2016 03:26:37 +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 BB3E41E04; Mon, 4 Jan 2016 03:26:37 +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 u043Qae5007718; Mon, 4 Jan 2016 03:26:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u043Qa46007717; Mon, 4 Jan 2016 03:26:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040326.u043Qa46007717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 03:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293134 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 03:26:38 -0000 Author: ngie Date: Mon Jan 4 03:26:36 2016 New Revision: 293134 URL: https://svnweb.freebsd.org/changeset/base/293134 Log: Use `nitems(x)` macro instead of using hardcoded numbers for indices into the nvlists Convert some of the variables from int to unsigned int to squelch -Wsign-compare warnings when converting hardcoded values to nitems(..) Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libnv/tests/nv_array_tests.cc Modified: head/lib/libnv/tests/nv_array_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 03:22:06 2016 (r293133) +++ head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 03:26:36 2016 (r293134) @@ -27,8 +27,9 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include +#include #include #include @@ -107,7 +108,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); - nvlist_add_string_array(nvl, key, string_arr, 8); + nvlist_add_string_array(nvl, key, string_arr, nitems(string_arr)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_string_array(nvl, key)); @@ -116,7 +117,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ const_result = nvlist_get_string_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(num_items == 8); + ATF_REQUIRE(num_items == nitems(string_arr)); for (i = 0; i < num_items; i++) { if (string_arr[i] != NULL) { ATF_REQUIRE(strcmp(const_result[i], @@ -128,7 +129,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ result = nvlist_take_string_array(nvl, key, &num_items); ATF_REQUIRE(result != NULL); - ATF_REQUIRE_EQ(num_items, 8); + ATF_REQUIRE_EQ(num_items, nitems(string_arr)); for (i = 0; i < num_items; i++) { if (string_arr[i] != NULL) { ATF_REQUIRE_EQ(strcmp(result[i], string_arr[i]), 0); @@ -141,7 +142,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); - for (i = 0; i < 8; i++) + for (i = 0; i < num_items; i++) free(result[i]); free(result); nvlist_destroy(nvl); @@ -157,7 +158,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr unsigned int i; const char *key; - for (i = 0; i < 32; i++) { + for (i = 0; i < nitems(fd); i++) { fd[i] = dup(STDERR_FILENO); ATF_REQUIRE(fd_is_valid(fd[i])); } @@ -168,7 +169,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_descriptor_array(nvl, key)); - nvlist_add_descriptor_array(nvl, key, fd, 32); + nvlist_add_descriptor_array(nvl, key, fd, nitems(fd)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_descriptor_array(nvl, key)); @@ -177,7 +178,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr const_result = nvlist_get_descriptor_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(num_items == 32); + ATF_REQUIRE(num_items == nitems(fd)); for (i = 0; i < num_items; i++) { ATF_REQUIRE(fd_is_valid(const_result[i])); if (i > 0) @@ -186,7 +187,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr result = nvlist_take_descriptor_array(nvl, key, &num_items); ATF_REQUIRE(result != NULL); - ATF_REQUIRE_EQ(num_items, 32); + ATF_REQUIRE_EQ(num_items, nitems(fd)); for (i = 0; i < num_items; i++) { ATF_REQUIRE(fd_is_valid(result[i])); if (i > 0) @@ -223,7 +224,7 @@ ATF_TEST_CASE_BODY(nvlist_number_array__ ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); - nvlist_add_number_array(nvl, key, number, 8); + nvlist_add_number_array(nvl, key, number, nitems(number)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_number_array(nvl, key)); @@ -232,13 +233,13 @@ ATF_TEST_CASE_BODY(nvlist_number_array__ const_result = nvlist_get_number_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(num_items == 8); + ATF_REQUIRE(num_items == nitems(number)); for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(const_result[i], number[i]); result = nvlist_take_number_array(nvl, key, &num_items); ATF_REQUIRE(result != NULL); - ATF_REQUIRE_EQ(num_items, 8); + ATF_REQUIRE_EQ(num_items, nitems(number)); for (i = 0; i < num_items; i++) ATF_REQUIRE_EQ(result[i], number[i]); @@ -286,7 +287,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ const_result = nvlist_get_nvlist_array(nvl, key, &num_items); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE(num_items == 8); + ATF_REQUIRE(num_items == nitems(testnvl)); for (i = 0; i < num_items; i++) { ATF_REQUIRE_EQ(nvlist_error(const_result[i]), 0); @@ -343,12 +344,12 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) const uint64_t number[8] = { 0, UINT_MAX, 7, 123, 90, 100000, 8, 1 }; - for (i = 0; i < 16; i++) { + for (i = 0; i < nitems(testfd); i++) { testbool[i] = (i % 2 == 0); testfd[i] = dup(STDERR_FILENO); ATF_REQUIRE(fd_is_valid(testfd[i])); } - for (i = 0; i < 8; i++) { + for (i = 0; i < nitems(testnvl); i++) { testnvl[i] = nvlist_create(0); ATF_REQUIRE(nvlist_error(testnvl[i]) == 0); nvlist_add_string(testnvl[i], "nvl/nvl/teststr", somestr[i]); @@ -359,28 +360,30 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) ATF_REQUIRE(nvlist_error(src) == 0); ATF_REQUIRE(!nvlist_exists_bool_array(src, "nvl/bool")); - nvlist_add_bool_array(src, "nvl/bool", testbool, 16); + nvlist_add_bool_array(src, "nvl/bool", testbool, nitems(testbool)); ATF_REQUIRE_EQ(nvlist_error(src), 0); ATF_REQUIRE(nvlist_exists_bool_array(src, "nvl/bool")); ATF_REQUIRE(!nvlist_exists_string_array(src, "nvl/string")); - nvlist_add_string_array(src, "nvl/string", string_arr, 8); + nvlist_add_string_array(src, "nvl/string", string_arr, + nitems(string_arr)); ATF_REQUIRE_EQ(nvlist_error(src), 0); ATF_REQUIRE(nvlist_exists_string_array(src, "nvl/string")); ATF_REQUIRE(!nvlist_exists_descriptor_array(src, "nvl/fd")); - nvlist_add_descriptor_array(src, "nvl/fd", testfd, 16); + nvlist_add_descriptor_array(src, "nvl/fd", testfd, nitems(testfd)); ATF_REQUIRE_EQ(nvlist_error(src), 0); ATF_REQUIRE(nvlist_exists_descriptor_array(src, "nvl/fd")); ATF_REQUIRE(!nvlist_exists_number_array(src, "nvl/number")); - nvlist_add_number_array(src, "nvl/number", number, 8); + nvlist_add_number_array(src, "nvl/number", number, + nitems(number)); ATF_REQUIRE_EQ(nvlist_error(src), 0); ATF_REQUIRE(nvlist_exists_number_array(src, "nvl/number")); ATF_REQUIRE(!nvlist_exists_nvlist_array(src, "nvl/array")); nvlist_add_nvlist_array(src, "nvl/array", - (const nvlist_t * const *)testnvl, 8); + (const nvlist_t * const *)testnvl, nitems(testnvl)); ATF_REQUIRE_EQ(nvlist_error(src), 0); ATF_REQUIRE(nvlist_exists_nvlist_array(src, "nvl/array")); @@ -389,7 +392,7 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) ATF_REQUIRE(nvlist_exists_bool_array(dst, "nvl/bool")); (void) nvlist_get_bool_array(dst, "nvl/bool", &num_items); - ATF_REQUIRE_EQ(num_items, 16); + ATF_REQUIRE_EQ(num_items, nitems(testbool)); for (i = 0; i < num_items; i++) { ATF_REQUIRE( nvlist_get_bool_array(dst, "nvl/bool", &num_items)[i] == @@ -398,7 +401,7 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) ATF_REQUIRE(nvlist_exists_string_array(dst, "nvl/string")); (void) nvlist_get_string_array(dst, "nvl/string", &num_items); - ATF_REQUIRE_EQ(num_items, 8); + ATF_REQUIRE_EQ(num_items, nitems(string_arr)); for (i = 0; i < num_items; i++) { if (nvlist_get_string_array(dst, "nvl/string", &num_items)[i] == NULL) { @@ -414,14 +417,14 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) ATF_REQUIRE(nvlist_exists_descriptor_array(dst, "nvl/fd")); (void) nvlist_get_descriptor_array(dst, "nvl/fd", &num_items); - ATF_REQUIRE_EQ(num_items, 16); + ATF_REQUIRE_EQ(num_items, nitems(testfd)); for (i = 0; i < num_items; i++) { ATF_REQUIRE(fd_is_valid( nvlist_get_descriptor_array(dst, "nvl/fd", &num_items)[i])); } ATF_REQUIRE(nvlist_exists_number_array(dst, "nvl/number")); (void) nvlist_get_number_array(dst, "nvl/number", &num_items); - ATF_REQUIRE_EQ(num_items, 8); + ATF_REQUIRE_EQ(num_items, nitems(number)); for (i = 0; i < num_items; i++) { ATF_REQUIRE( @@ -431,7 +434,7 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) ATF_REQUIRE(nvlist_exists_nvlist_array(dst, "nvl/array")); (void) nvlist_get_nvlist_array(dst, "nvl/array", &num_items); - ATF_REQUIRE_EQ(num_items, 8); + ATF_REQUIRE_EQ(num_items, nitems(testnvl)); for (i = 0; i < num_items; i++) { nvl = nvlist_get_nvlist_array(dst, "nvl/array", &num_items)[i]; ATF_REQUIRE(nvlist_exists_string(nvl, "nvl/nvl/teststr")); @@ -439,11 +442,11 @@ ATF_TEST_CASE_BODY(nvlist_clone_array) somestr[i]) == 0); } - for (i = 0; i < 16; i++) { + for (i = 0; i < nitems(testfd); i++) { close(testfd[i]); - if (i < 8) { - nvlist_destroy(testnvl[i]); - } + } + for (i = 0; i < nitems(testnvl); i++) { + nvlist_destroy(testnvl[i]); } nvlist_destroy(src); nvlist_destroy(dst); @@ -765,11 +768,12 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ { nvlist_t *nvl, *test[5], *nasted; const nvlist_t *travel; - void *cookie; - int index, i, type; const char *name; + void *cookie; + int type; + unsigned int i, index; - for (i = 0; i < 5; i++) { + for (i = 0; i < nitems(test); i++) { test[i] = nvlist_create(0); ATF_REQUIRE(test[i] != NULL); nvlist_add_number(test[i], "nvl/number", i); @@ -777,11 +781,12 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ } nvl = nvlist_create(0); ATF_REQUIRE(nvl != NULL); - nvlist_add_nvlist_array(nvl, "nvl/nvlist_array", test, 5); + nvlist_add_nvlist_array(nvl, "nvl/nvlist_array", test, nitems(test)); ATF_REQUIRE(nvlist_error(nvl) == 0); nasted = nvlist_create(0); ATF_REQUIRE(nasted != NULL); - nvlist_add_nvlist_array(nasted, "nvl/nvl/nvlist_array", test, 5); + nvlist_add_nvlist_array(nasted, "nvl/nvl/nvlist_array", test, + nitems(test)); ATF_REQUIRE(nvlist_error(nasted) == 0); nvlist_move_nvlist(nvl, "nvl/nvl", nasted); ATF_REQUIRE(nvlist_error(nvl) == 0); @@ -795,15 +800,16 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ while ((name = nvlist_next(travel, &type, &cookie)) != NULL) { if (index == 0) { ATF_REQUIRE(type == NV_TYPE_NVLIST_ARRAY); - } else if (index >= 1 && index <= 5) { + } else if (index >= 1 && index <= nitems(test)) { ATF_REQUIRE(type == NV_TYPE_NUMBER); - } else if (index == 6) { + } else if (index == nitems(test) + 1) { ATF_REQUIRE(type == NV_TYPE_NVLIST); - } else if (index == 7) { + } else if (index == nitems(test) + 2) { ATF_REQUIRE(type == NV_TYPE_NVLIST_ARRAY); - } else if (index >= 8 && index <= 12) { + } else if (index >= nitems(test) + 3 && + index <= 2 * nitems(test) + 2) { ATF_REQUIRE(type == NV_TYPE_NUMBER); - } else if (index == 13) { + } else if (index == 2 * nitems(test) + 3) { ATF_REQUIRE(type == NV_TYPE_STRING); } @@ -819,7 +825,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ } } while ((travel = nvlist_get_pararr(travel, &cookie)) != NULL); - for (i = 0; i < 5; i++) + for (i = 0; i < nitems(test); i++) nvlist_destroy(test[i]); nvlist_destroy(nvl); @@ -909,7 +915,7 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__pa const bool *const_result; bool testbool[16]; - for (i = 0; i < 16; i++) + for (i = 0; i < nitems(testbool); i++) testbool[i] = (i % 2 == 0); key = "nvl/bool"; @@ -918,7 +924,7 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__pa ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); - nvlist_add_bool_array(nvl, key, testbool, 16); + nvlist_add_bool_array(nvl, key, testbool, nitems(testbool)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_bool_array(nvl, key)); @@ -932,7 +938,7 @@ ATF_TEST_CASE_BODY(nvlist_bool_array__pa ATF_REQUIRE(nvlist_exists_bool_array(unpacked, key)); const_result = nvlist_get_bool_array(unpacked, key, &count); - ATF_REQUIRE_EQ(count, 16); + ATF_REQUIRE_EQ(count, nitems(testbool)); for (i = 0; i < count; i++) { ATF_REQUIRE_EQ(testbool[i], const_result[i]); } @@ -974,7 +980,7 @@ ATF_TEST_CASE_BODY(nvlist_number_array__ ATF_REQUIRE(nvlist_exists_number_array(unpacked, key)); const_result = nvlist_get_number_array(unpacked, key, &count); - ATF_REQUIRE_EQ(count, 8); + ATF_REQUIRE_EQ(count, nitems(number)); for (i = 0; i < count; i++) { ATF_REQUIRE_EQ(number[i], const_result[i]); } @@ -1005,7 +1011,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr /* Child. */ fd = socks[0]; close(socks[1]); - for (i = 0; i < 32; i++) { + for (i = 0; i < nitems(desc); i++) { desc[i] = dup(STDERR_FILENO); ATF_REQUIRE(fd_is_valid(desc[i])); } @@ -1015,14 +1021,14 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_descriptor_array(nvl, key)); - nvlist_add_descriptor_array(nvl, key, desc, 32); + nvlist_add_descriptor_array(nvl, key, desc, nitems(desc)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_descriptor_array(nvl, key)); ATF_REQUIRE(nvlist_send(fd, nvl) >= 0); - for (i = 0; i < num_items; i++) + for (i = 0; i < nitems(desc); i++) close(desc[i]); } else { /* Parent */ @@ -1037,7 +1043,7 @@ ATF_TEST_CASE_BODY(nvlist_descriptor_arr const_result = nvlist_get_descriptor_array(nvl, key, &num_items); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE_EQ(num_items, 32); + ATF_REQUIRE_EQ(num_items, nitems(desc)); for (i = 0; i < num_items; i++) ATF_REQUIRE(fd_is_valid(const_result[i])); @@ -1066,7 +1072,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ ATF_REQUIRE(nvlist_empty(nvl)); ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); - nvlist_add_string_array(nvl, key, string_arr, 8); + nvlist_add_string_array(nvl, key, string_arr, nitems(string_arr)); ATF_REQUIRE_EQ(nvlist_error(nvl), 0); ATF_REQUIRE(!nvlist_empty(nvl)); ATF_REQUIRE(nvlist_exists_string_array(nvl, key)); @@ -1080,7 +1086,7 @@ ATF_TEST_CASE_BODY(nvlist_string_array__ ATF_REQUIRE(nvlist_exists_string_array(unpacked, key)); const_result = nvlist_get_string_array(unpacked, key, &count); - ATF_REQUIRE_EQ(count, 8); + ATF_REQUIRE_EQ(count, nitems(string_arr)); for (i = 0; i < count; i++) { ATF_REQUIRE_EQ(strcmp(string_arr[i], const_result[i]), 0); } @@ -1103,7 +1109,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ const char *somestr[8] = { "a", "b", "c", "d", "e", "f", "g", "h" }; const char *key; - for (i = 0; i < 8; i++) { + for (i = 0; i < nitems(testnvl); i++) { testnvl[i] = nvlist_create(0); ATF_REQUIRE(testnvl[i] != NULL); ATF_REQUIRE_EQ(nvlist_error(testnvl[i]), 0); @@ -1133,7 +1139,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ const_result = nvlist_get_nvlist_array(unpacked, key, &num_items); ATF_REQUIRE(const_result != NULL); - ATF_REQUIRE_EQ(num_items, 8); + ATF_REQUIRE_EQ(num_items, nitems(testnvl)); for (i = 0; i < num_items; i++) { ATF_REQUIRE_EQ(nvlist_error(const_result[i]), 0); if (i < num_items - 1) { @@ -1151,7 +1157,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ "nvl/string"), somestr[i]) == 0); } - for (i = 0; i < 8; i++) + for (i = 0; i < nitems(testnvl); i++) nvlist_destroy(testnvl[i]); free(result); nvlist_destroy(nvl); From owner-svn-src-head@freebsd.org Mon Jan 4 03:32:14 2016 Return-Path: Delivered-To: svn-src-head@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 D77B1A61F21; Mon, 4 Jan 2016 03:32:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22d.google.com (mail-pf0-x22d.google.com [IPv6:2607:f8b0:400e:c00::22d]) (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 B9EA1122F; Mon, 4 Jan 2016 03:32:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22d.google.com with SMTP id 65so149986246pff.3; Sun, 03 Jan 2016 19:32:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=QjaW5m4AQBreCUxzvRZwG8JHn5S4Evf/25Jq0rFnRK0=; b=CHXAifx2/EpSvcf9l6efZbtOdWHaR4ZVfT7J6g+Wh+TCEGxHqzjkGME6K3Yzoh6V7r KFAGzikMbpR61GxT0FummpwCg9tt4x/q6Dkkknz1t/q21KCoUY/ZTvaWW243mOW782Mz 7fUCR5IV8Mt12idsArUI+sHEvAiEq2ISwChcNewHA55MMABpEu7SleGohP2DRTRm+TJJ IC/Wh5EdAuHDYKi6r/8oL/7qoMM0jq/uC6kkjh57pNP6yaJ68dnBWUUspjdgdS2i1cu/ 1Vb3bfL1HzhnoMgYqUiJOF7ioD1mSIo1kxn1NspFcj5QnoKcXnwVXqQkmIG/0JbUZ4u8 iUkQ== X-Received: by 10.98.17.3 with SMTP id z3mr105927929pfi.166.1451878334344; Sun, 03 Jan 2016 19:32:14 -0800 (PST) Received: from [192.168.20.7] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id fi16sm48690748pac.12.2016.01.03.19.32.12 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jan 2016 19:32:13 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293134 - head/lib/libnv/tests From: NGie Cooper In-Reply-To: <201601040326.u043Qa46007717@repo.freebsd.org> Date: Sun, 3 Jan 2016 19:32:11 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4C70AA03-F9C7-44A7-B9DE-5A6ABF108FC9@gmail.com> References: <201601040326.u043Qa46007717@repo.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 03:32:14 -0000 > On Jan 3, 2016, at 19:26, Garrett Cooper wrote: >=20 > Author: ngie > Date: Mon Jan 4 03:26:36 2016 > New Revision: 293134 > URL: https://svnweb.freebsd.org/changeset/base/293134 >=20 > Log: > Use `nitems(x)` macro instead of using hardcoded numbers for indices = into > the nvlists >=20 > Convert some of the variables from int to unsigned int to squelch = -Wsign-compare > warnings when converting hardcoded values to nitems(..) >=20 > Differential Revision: https://reviews.freebsd.org/D4769 (part of = larger diff) > MFC after: 5 days > Reviewed by: oshogbo > Sponsored by: EMC / Isilon Storage Division ... > - for (i =3D 0; i < num_items; i++) > + for (i =3D 0; i < nitems(desc); i++) This portion of the change also fixed an out-of-bounds memory access on = stable/10 that oshogbo spent some time poring over why this testcase (in = particular) kept on crashing as num_items was never properly initialized = in this code path. Reported by: cppcheck Thanks! -NGie= From owner-svn-src-head@freebsd.org Mon Jan 4 03:34:23 2016 Return-Path: Delivered-To: svn-src-head@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 D80FFA60009; Mon, 4 Jan 2016 03:34:23 +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 AB44715D7; Mon, 4 Jan 2016 03:34:23 +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 u043YMKg010675; Mon, 4 Jan 2016 03:34:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u043YM2p010674; Mon, 4 Jan 2016 03:34:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040334.u043YM2p010674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 03:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293135 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 03:34:23 -0000 Author: ngie Date: Mon Jan 4 03:34:22 2016 New Revision: 293135 URL: https://svnweb.freebsd.org/changeset/base/293135 Log: Remove free'ing of an uninitialized variable Just remove it completely from the test as it's initialized but unused apart from the free(3) call Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reported by: cppcheck Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libnv/tests/nv_array_tests.cc Modified: head/lib/libnv/tests/nv_array_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 03:26:36 2016 (r293134) +++ head/lib/libnv/tests/nv_array_tests.cc Mon Jan 4 03:34:22 2016 (r293135) @@ -1101,7 +1101,6 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ { nvlist_t *testnvl[8], *unpacked; const nvlist_t * const *const_result; - nvlist_t **result; nvlist_t *nvl; size_t num_items, packed_size; unsigned int i; @@ -1159,7 +1158,6 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__ for (i = 0; i < nitems(testnvl); i++) nvlist_destroy(testnvl[i]); - free(result); nvlist_destroy(nvl); nvlist_destroy(unpacked); free(packed); From owner-svn-src-head@freebsd.org Mon Jan 4 14:47:43 2016 Return-Path: Delivered-To: svn-src-head@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 B1FF8A600A1 for ; Mon, 4 Jan 2016 14:47:43 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: from vfemail.net (onethreetwo.vfemail.net [199.16.11.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 725D11E56 for ; Mon, 4 Jan 2016 14:47:43 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: (qmail 67977 invoked by uid 89); 4 Jan 2016 14:46:11 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 4 Jan 2016 14:46:09 -0000 Received: (qmail 75282 invoked by uid 89); 4 Jan 2016 08:44:58 -0000 Received: by simscan 1.3.1 ppid: 75274, pid: 75278, t: 0.0042s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 4 Jan 2016 08:44:57 -0000 Received: (qmail 28155 invoked by uid 89); 4 Jan 2016 08:44:57 -0000 Received: by simscan 1.4.0 ppid: 28140, pid: 28152, t: 0.4530s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by mail.vfemail.net with ESMTPA; 4 Jan 2016 08:44:57 -0000 From: Jan Beich To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293115 - head/etc References: <201601031918.u03JImBs012182@repo.freebsd.org> Date: Mon, 04 Jan 2016 09:44:28 +0100 In-Reply-To: <201601031918.u03JImBs012182@repo.freebsd.org> (Warner Losh's message of "Sun, 3 Jan 2016 19:18:48 +0000 (UTC)") Message-ID: <7fjp-lonn-wny@vfemail.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 14:47:43 -0000 --=-=-= Content-Type: text/plain Warner Losh writes: > Author: imp > Date: Sun Jan 3 19:18:48 2016 > New Revision: 293115 > URL: https://svnweb.freebsd.org/changeset/base/293115 > > Log: > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked > up and can cause issues on boot with the prompts. Why do you have ~/.profile stuff leaking into rc* boot sequence? And maybe use |command| instead. $ alias rm=foo /bin/rm=foo $ rm sh: foo: not found $ /bin/rm sh: foo: not found $ command rm usage: rm [-f | -i] [-dIPRrvWx] file ... unlink file ~/.profile may also contain syntax allowed by bash e.g., $ rm() { bar; }; /bin/rm() { bar; } $ rm bash: bar: command not found $ /bin/rm bash: bar: command not found $ command rm rm: missing operand Try 'rm --help' for more information. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQF8BAEBCgBmBQJWijDtXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3bB20IAJgh8Lp7nqvutDUmojFxjY9+ 6VQQAUbsWTGllsT0yMAst6Q3xZEVq9t5nSmSsdlrcYNRPb9jdASprK3Iwtx623O4 d2MBFKPQD+El0Rb1KTPXKpkJeI/fh4U+/bgtvsBzqs3qyccX2MaqfYZhkKwijgul gMGORHtjrfj0hhsVI0AyXYwBKjOMwOZ+LeeRrjiXyWNhDZXrBNTJ2gISScoww3TH NHoktzBfGPJWz25OJeqbMylECq3rdNjGiKXAS3f2pzRukVaTCO1/qnRssm/AsBed ulDKdMJqiFYRRwPazhcjsMXDSFhdP2FXBbNC/APTG2d0SMA0xgiesp01XO91E+w= =vGlv -----END PGP SIGNATURE----- --=-=-=-- From owner-svn-src-head@freebsd.org Mon Jan 4 14:56:56 2016 Return-Path: Delivered-To: svn-src-head@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 061B6A606C0; Mon, 4 Jan 2016 14:56:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB22C13DF; Mon, 4 Jan 2016 14:56:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 61A49B979; Mon, 4 Jan 2016 09:56:54 -0500 (EST) From: John Baldwin To: Garrett Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293112 - head/sys/dev/ixl Date: Sun, 03 Jan 2016 14:23:05 -0800 Message-ID: <1740114.0GzEsp8E6P@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201601031809.u03I9lNJ091471@repo.freebsd.org> References: <201601031809.u03I9lNJ091471@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 Jan 2016 09:56:54 -0500 (EST) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 14:56:56 -0000 On Sunday, January 03, 2016 06:09:47 PM Garrett Cooper wrote: > Author: ngie > Date: Sun Jan 3 18:09:46 2016 > New Revision: 293112 > URL: https://svnweb.freebsd.org/changeset/base/293112 > > Log: > Fix ixl(4) compilation with PCI_IOV pre-r266974 > > stable/10 doesn't have the if_getdrvflags(9) KPI. Reference the field in the > structure directly if the __FreeBSD_version is < 1100022, so the driver can > be built with PCI_IOV support on stable/10, without backporting all of > r266974 (which requires additional changes due to projects/ifnet, etc) > > Differential Revision: https://reviews.freebsd.org/D4759 > Reviewed by: erj, sbruno > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/dev/ixl/if_ixl.c > > Modified: head/sys/dev/ixl/if_ixl.c > ============================================================================== > --- head/sys/dev/ixl/if_ixl.c Sun Jan 3 17:58:11 2016 (r293111) > +++ head/sys/dev/ixl/if_ixl.c Sun Jan 3 18:09:46 2016 (r293112) > @@ -6606,7 +6606,11 @@ ixl_iov_uninit(device_t dev) > pf->veb_seid = 0; > } > > +#if __FreeBSD_version > 1100022 > if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) > +#else > + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) > +#endif > ixl_disable_intr(vsi); FWIW, it is probably simpler to do something like this in an ixl header instead: #if __FreeBSD_version <= 1100022 #define if_getdrvflags(ifp) (ifp)->if_drv_flags #endif In the past when the Intel drivers have used compat shims they have preferred this method (defining compat macros for "new" APIs on old OS versions) instead of using #ifdef's in the code itself. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Jan 4 15:03:22 2016 Return-Path: Delivered-To: svn-src-head@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 BCA0EA60BC6; Mon, 4 Jan 2016 15:03:22 +0000 (UTC) (envelope-from melifaro@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 87E261B0F; Mon, 4 Jan 2016 15:03:22 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04F3LxS031320; Mon, 4 Jan 2016 15:03:21 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04F3Lps031314; Mon, 4 Jan 2016 15:03:21 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601041503.u04F3Lps031314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 4 Jan 2016 15:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293159 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 15:03:22 -0000 Author: melifaro Date: Mon Jan 4 15:03:20 2016 New Revision: 293159 URL: https://svnweb.freebsd.org/changeset/base/293159 Log: Add rib_lookup_info() to provide API for retrieving individual route entries data in unified format. There are control plane functions that require information other than just next-hop data (e.g. individual rtentry fields like flags or prefix/mask). Given that the goal is to avoid rte reference/refcounting, re-use rt_addrinfo structure to store most rte fields. If caller wants to retrieve key/mask or gateway (which are sockaddrs and are allocated separately), it needs to provide sufficient-sized sockaddrs structures w/ ther pointers saved in passed rt_addrinfo. Convert: * lltable new records checks (in_lltable_rtcheck(), nd6_is_new_addr_neighbor(). * rtsock pre-add/change route check. * IPv6 NS ND-proxy check (RADIX_MPATH code was eliminated because 1) we don't support RTF_ANNOUNCE ND-proxy for networks and there should not be multiple host routes for such hosts 2) if we have multiple routes we should inspect them (which is not done). 3) the entire idea of abusing KRT as storage for ND proxy seems odd. Userland programs should be used for that purpose). Modified: head/sys/net/route.c head/sys/net/route.h head/sys/net/rtsock.c head/sys/netinet/in.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Jan 4 09:58:16 2016 (r293158) +++ head/sys/net/route.c Mon Jan 4 15:03:20 2016 (r293159) @@ -147,6 +147,8 @@ static void rt_notifydelete(struct rtent static struct radix_node *rt_mpath_unlink(struct radix_node_head *rnh, struct rt_addrinfo *info, struct rtentry *rto, int *perror); #endif +static int rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *info, + int flags); struct if_mtuinfo { @@ -832,6 +834,147 @@ rtrequest_fib(int req, /* + * Copy most of @rt data into @info. + * + * If @flags contains NHR_COPY, copies dst,netmask and gw to the + * pointers specified by @info structure. Assume such pointers + * are zeroed sockaddr-like structures with sa_len field initialized + * to reflect size of the provided buffer. if no NHR_COPY is specified, + * point dst,netmask and gw @info fields to appropriate @rt values. + * + * if @flags contains NHR_REF, do refcouting on rt_ifp. + * + * Returns 0 on success. + */ +int +rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *info, int flags) +{ + struct rt_metrics *rmx; + struct sockaddr *src, *dst; + int sa_len; + + if (flags & NHR_COPY) { + /* Copy destination if dst is non-zero */ + src = rt_key(rt); + dst = info->rti_info[RTAX_DST]; + sa_len = src->sa_len; + if (src != NULL && dst != NULL) { + if (src->sa_len > dst->sa_len) + return (ENOMEM); + memcpy(dst, src, src->sa_len); + info->rti_addrs |= RTA_DST; + } + + /* Copy mask if set && dst is non-zero */ + src = rt_mask(rt); + dst = info->rti_info[RTAX_NETMASK]; + if (src != NULL && dst != NULL) { + + /* + * Radix stores different value in sa_len, + * assume rt_mask() to have the same length + * as rt_key() + */ + if (sa_len > dst->sa_len) + return (ENOMEM); + memcpy(dst, src, src->sa_len); + info->rti_addrs |= RTA_NETMASK; + } + + /* Copy gateway is set && dst is non-zero */ + src = rt->rt_gateway; + dst = info->rti_info[RTAX_GATEWAY]; + if ((rt->rt_flags & RTF_GATEWAY) && src != NULL && dst != NULL){ + if (src->sa_len > dst->sa_len) + return (ENOMEM); + memcpy(dst, src, src->sa_len); + info->rti_addrs |= RTA_GATEWAY; + } + } else { + info->rti_info[RTAX_DST] = rt_key(rt); + info->rti_addrs |= RTA_DST; + if (rt_mask(rt) != NULL) { + info->rti_info[RTAX_NETMASK] = rt_mask(rt); + info->rti_addrs |= RTA_NETMASK; + } + if (rt->rt_flags & RTF_GATEWAY) { + info->rti_info[RTAX_GATEWAY] = rt->rt_gateway; + info->rti_addrs |= RTA_GATEWAY; + } + } + + rmx = info->rti_rmx; + if (rmx != NULL) { + info->rti_mflags |= RTV_MTU; + rmx->rmx_mtu = rt->rt_mtu; + } + + info->rti_flags = rt->rt_flags; + info->rti_ifp = rt->rt_ifp; + info->rti_ifa = rt->rt_ifa; + + if (flags & NHR_REF) { + /* Do 'traditional' refcouting */ + if_ref(info->rti_ifp); + } + + return (0); +} + +/* + * Lookups up route entry for @dst in RIB database for fib @fibnum. + * Exports entry data to @info using rt_exportinfo(). + * + * if @flags contains NHR_REF, refcouting is performed on rt_ifp. + * All references can be released later by calling rib_free_info() + * + * Returns 0 on success. + * Returns ENOENT for lookup failure, ENOMEM for export failure. + */ +int +rib_lookup_info(uint32_t fibnum, const struct sockaddr *dst, uint32_t flags, + uint32_t flowid, struct rt_addrinfo *info) +{ + struct radix_node_head *rh; + struct radix_node *rn; + struct rtentry *rt; + int error; + + KASSERT((fibnum < rt_numfibs), ("rib_lookup_rte: bad fibnum")); + rh = rt_tables_get_rnh(fibnum, dst->sa_family); + if (rh == NULL) + return (ENOENT); + + RADIX_NODE_HEAD_RLOCK(rh); + rn = rh->rnh_matchaddr(__DECONST(void *, dst), rh); + if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) { + rt = RNTORT(rn); + /* Ensure route & ifp is UP */ + if (RT_LINK_IS_UP(rt->rt_ifp)) { + flags = (flags & NHR_REF) | NHR_COPY; + error = rt_exportinfo(rt, info, flags); + RADIX_NODE_HEAD_RUNLOCK(rh); + + return (error); + } + } + RADIX_NODE_HEAD_RUNLOCK(rh); + + return (ENOENT); +} + +/* + * Releases all references acquired by rib_lookup_info() when + * called with NHR_REF flags. + */ +void +rib_free_info(struct rt_addrinfo *info) +{ + + if_rele(info->rti_ifp); +} + +/* * Iterates over all existing fibs in system calling * @setwa_f function prior to traversing each fib. * Calls @wa_f function for each element in current fib. Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Mon Jan 4 09:58:16 2016 (r293158) +++ head/sys/net/route.h Mon Jan 4 15:03:20 2016 (r293159) @@ -197,6 +197,9 @@ struct rtentry { #define NHR_IFAIF 0x01 /* Return ifa_ifp interface */ #define NHR_REF 0x02 /* For future use */ +/* Control plane route request flags */ +#define NHR_COPY 0x100 /* Copy rte data */ + /* rte<>nhop translation */ static inline uint16_t fib_rte_to_nh_flags(int rt_flags) @@ -460,6 +463,9 @@ void rtredirect_fib(struct sockaddr *, int rtrequest_fib(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); int rtrequest1_fib(int, struct rt_addrinfo *, struct rtentry **, u_int); +int rib_lookup_info(uint32_t, const struct sockaddr *, uint32_t, uint32_t, + struct rt_addrinfo *); +void rib_free_info(struct rt_addrinfo *info); #include typedef void (*rtevent_redirect_fn)(void *, struct rtentry *, struct rtentry *, struct sockaddr *); Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Mon Jan 4 09:58:16 2016 (r293158) +++ head/sys/net/rtsock.c Mon Jan 4 15:03:20 2016 (r293159) @@ -614,11 +614,16 @@ route_output(struct mbuf *m, struct sock */ if (info.rti_info[RTAX_GATEWAY] != NULL && info.rti_info[RTAX_GATEWAY]->sa_family != AF_LINK) { - struct route gw_ro; + struct rt_addrinfo ginfo; + struct sockaddr *gdst; + + bzero(&ginfo, sizeof(ginfo)); + bzero(&ss, sizeof(ss)); + ss.ss_len = sizeof(ss); + + ginfo.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&ss; + gdst = info.rti_info[RTAX_GATEWAY]; - bzero(&gw_ro, sizeof(gw_ro)); - gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY]; - rtalloc_ign_fib(&gw_ro, 0, fibnum); /* * A host route through the loopback interface is * installed for each interface adddress. In pre 8.0 @@ -629,14 +634,14 @@ route_output(struct mbuf *m, struct sock * AF_LINK sa_family type of the rt_gateway, and the * rt_ifp has the IFF_LOOPBACK flag set. */ - if (gw_ro.ro_rt != NULL && - gw_ro.ro_rt->rt_gateway->sa_family == AF_LINK && - gw_ro.ro_rt->rt_ifp->if_flags & IFF_LOOPBACK) { - info.rti_flags &= ~RTF_GATEWAY; - info.rti_flags |= RTF_GWFLAG_COMPAT; + if (rib_lookup_info(fibnum, gdst, NHR_REF, 0, &ginfo) == 0) { + if (ss.ss_family == AF_LINK && + ginfo.rti_ifp->if_flags & IFF_LOOPBACK) { + info.rti_flags &= ~RTF_GATEWAY; + info.rti_flags |= RTF_GWFLAG_COMPAT; + } + rib_free_info(&ginfo); } - if (gw_ro.ro_rt != NULL) - RTFREE(gw_ro.ro_rt); } switch (rtm->rtm_type) { Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Mon Jan 4 09:58:16 2016 (r293158) +++ head/sys/netinet/in.c Mon Jan 4 15:03:20 2016 (r293159) @@ -1106,34 +1106,48 @@ in_lltable_free_entry(struct lltable *ll static int in_lltable_rtcheck(struct ifnet *ifp, u_int flags, const struct sockaddr *l3addr) { - struct rtentry *rt; + struct rt_addrinfo info; + struct sockaddr_in rt_key, rt_mask; + struct sockaddr rt_gateway; + int rt_flags; KASSERT(l3addr->sa_family == AF_INET, ("sin_family %d", l3addr->sa_family)); - /* XXX rtalloc1_fib should take a const param */ - rt = rtalloc1_fib(__DECONST(struct sockaddr *, l3addr), 0, 0, - ifp->if_fib); + bzero(&rt_key, sizeof(rt_key)); + rt_key.sin_len = sizeof(rt_key); + bzero(&rt_mask, sizeof(rt_mask)); + rt_mask.sin_len = sizeof(rt_mask); + bzero(&rt_gateway, sizeof(rt_gateway)); + rt_gateway.sa_len = sizeof(rt_gateway); + + bzero(&info, sizeof(info)); + info.rti_info[RTAX_DST] = (struct sockaddr *)&rt_key; + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&rt_mask; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&rt_gateway; - if (rt == NULL) + if (rib_lookup_info(ifp->if_fib, l3addr, NHR_REF, 0, &info) != 0) return (EINVAL); + rt_flags = info.rti_flags; + /* * If the gateway for an existing host route matches the target L3 * address, which is a special route inserted by some implementation * such as MANET, and the interface is of the correct type, then * allow for ARP to proceed. */ - if (rt->rt_flags & RTF_GATEWAY) { - if (!(rt->rt_flags & RTF_HOST) || !rt->rt_ifp || - rt->rt_ifp->if_type != IFT_ETHER || - (rt->rt_ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) != 0 || - memcmp(rt->rt_gateway->sa_data, l3addr->sa_data, + if (rt_flags & RTF_GATEWAY) { + if (!(rt_flags & RTF_HOST) || !info.rti_ifp || + info.rti_ifp->if_type != IFT_ETHER || + (info.rti_ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) != 0 || + memcmp(rt_gateway.sa_data, l3addr->sa_data, sizeof(in_addr_t)) != 0) { - RTFREE_LOCKED(rt); + rib_free_info(&info); return (EINVAL); } } + rib_free_info(&info); /* * Make sure that at least the destination address is covered @@ -1142,21 +1156,19 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ * on one interface and the corresponding outgoing packet leaves * another interface. */ - if (!(rt->rt_flags & RTF_HOST) && rt->rt_ifp != ifp) { + if (!(rt_flags & RTF_HOST) && info.rti_ifp != ifp) { const char *sa, *mask, *addr, *lim; int len; - mask = (const char *)rt_mask(rt); + mask = (const char *)&rt_mask; /* * Just being extra cautious to avoid some custom * code getting into trouble. */ - if (mask == NULL) { - RTFREE_LOCKED(rt); + if ((info.rti_addrs & RTA_NETMASK) == 0) return (EINVAL); - } - sa = (const char *)rt_key(rt); + sa = (const char *)&rt_key; addr = (const char *)l3addr; len = ((const struct sockaddr_in *)l3addr)->sin_len; lim = addr + len; @@ -1167,13 +1179,11 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ log(LOG_INFO, "IPv4 address: \"%s\" is not on the network\n", inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr)); #endif - RTFREE_LOCKED(rt); return (EINVAL); } } } - RTFREE_LOCKED(rt); return (0); } Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Jan 4 09:58:16 2016 (r293158) +++ head/sys/netinet6/nd6.c Mon Jan 4 15:03:20 2016 (r293159) @@ -1210,6 +1210,10 @@ nd6_is_new_addr_neighbor(const struct so { struct nd_prefix *pr; struct ifaddr *dstaddr; + struct rt_addrinfo info; + struct sockaddr_in6 rt_key; + struct sockaddr *dst6; + int fibnum; /* * A link-local address is always a neighbor. @@ -1234,6 +1238,13 @@ nd6_is_new_addr_neighbor(const struct so return (0); } + bzero(&rt_key, sizeof(rt_key)); + bzero(&info, sizeof(info)); + info.rti_info[RTAX_DST] = (struct sockaddr *)&rt_key; + + /* Always use the default FIB here. XXME - why? */ + fibnum = RT_DEFAULT_FIB; + /* * If the address matches one of our addresses, * it should be a neighbor. @@ -1245,12 +1256,13 @@ nd6_is_new_addr_neighbor(const struct so continue; if (!(pr->ndpr_stateflags & NDPRF_ONLINK)) { - struct rtentry *rt; /* Always use the default FIB here. */ - rt = in6_rtalloc1((struct sockaddr *)&pr->ndpr_prefix, - 0, 0, RT_DEFAULT_FIB); - if (rt == NULL) + dst6 = (struct sockaddr *)&pr->ndpr_prefix; + + /* Restore length field before retrying lookup */ + rt_key.sin6_len = sizeof(rt_key); + if (rib_lookup_info(fibnum, dst6, 0, 0, &info) != 0) continue; /* * This is the case where multiple interfaces @@ -1263,11 +1275,8 @@ nd6_is_new_addr_neighbor(const struct so * differ. */ if (!IN6_ARE_ADDR_EQUAL(&pr->ndpr_prefix.sin6_addr, - &((struct sockaddr_in6 *)rt_key(rt))->sin6_addr)) { - RTFREE_LOCKED(rt); + &rt_key.sin6_addr)) continue; - } - RTFREE_LOCKED(rt); } if (IN6_ARE_MASKED_ADDR_EQUAL(&pr->ndpr_prefix.sin6_addr, Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Mon Jan 4 09:58:16 2016 (r293158) +++ head/sys/netinet6/nd6_nbr.c Mon Jan 4 15:03:20 2016 (r293159) @@ -248,37 +248,35 @@ nd6_ns_input(struct mbuf *m, int off, in /* (2) check. */ if (ifa == NULL) { - struct route_in6 ro; - int need_proxy; - - bzero(&ro, sizeof(ro)); - ro.ro_dst.sin6_len = sizeof(struct sockaddr_in6); - ro.ro_dst.sin6_family = AF_INET6; - ro.ro_dst.sin6_addr = taddr6; + struct sockaddr_dl rt_gateway; + struct rt_addrinfo info; + struct sockaddr_in6 dst6; + + bzero(&dst6, sizeof(dst6)); + dst6.sin6_len = sizeof(struct sockaddr_in6); + dst6.sin6_family = AF_INET6; + dst6.sin6_addr = taddr6; + + bzero(&rt_gateway, sizeof(rt_gateway)); + rt_gateway.sdl_len = sizeof(rt_gateway); + bzero(&info, sizeof(info)); + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&rt_gateway; /* Always use the default FIB. */ -#ifdef RADIX_MPATH - rtalloc_mpath_fib((struct route *)&ro, ntohl(taddr6.s6_addr32[3]), - RT_DEFAULT_FIB); -#else - in6_rtalloc(&ro, RT_DEFAULT_FIB); -#endif - need_proxy = (ro.ro_rt && - (ro.ro_rt->rt_flags & RTF_ANNOUNCE) != 0 && - ro.ro_rt->rt_gateway->sa_family == AF_LINK); - if (ro.ro_rt != NULL) { - if (need_proxy) - proxydl = *SDL(ro.ro_rt->rt_gateway); - RTFREE(ro.ro_rt); - } - if (need_proxy) { - /* - * proxy NDP for single entry - */ - ifa = (struct ifaddr *)in6ifa_ifpforlinklocal(ifp, - IN6_IFF_NOTREADY|IN6_IFF_ANYCAST); - if (ifa) - proxy = 1; + if (rib_lookup_info(RT_DEFAULT_FIB, (struct sockaddr *)&dst6, + 0, 0, &info) == 0) { + if ((info.rti_flags & RTF_ANNOUNCE) != 0 && + rt_gateway.sdl_family == AF_LINK) { + + /* + * proxy NDP for single entry + */ + proxydl = *SDL(&rt_gateway); + ifa = (struct ifaddr *)in6ifa_ifpforlinklocal( + ifp, IN6_IFF_NOTREADY|IN6_IFF_ANYCAST); + if (ifa) + proxy = 1; + } } } if (ifa == NULL) { From owner-svn-src-head@freebsd.org Mon Jan 4 15:47:44 2016 Return-Path: Delivered-To: svn-src-head@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 C582EA61062; Mon, 4 Jan 2016 15:47:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A48D91BD6; Mon, 4 Jan 2016 15:47:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A548FB91E; Mon, 4 Jan 2016 10:47:43 -0500 (EST) From: John Baldwin To: Adrian Chadd Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r293022 - head/sys/net80211 Date: Mon, 04 Jan 2016 07:47:39 -0800 Message-ID: <2558363.cYPdmfTgJ4@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201601010021.u010L7sW006625@repo.freebsd.org> <5919271.R3YaC4QkYh@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 Jan 2016 10:47:43 -0500 (EST) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 15:47:44 -0000 On Friday, January 01, 2016 07:41:42 PM Adrian Chadd wrote: > yup. all of this is ... terrible atm. > > I do need to be able to give a bounds though. :( The _sbt variants let you specify a bounds for the "fuzzy". You give the deadline time as one value ('sbt') and an upper bound on how long to delay extra as the second ('pr'). The wait will timeout sometime between 'sbt' and 'sbt + pr'. Alternatively, you can leave 'pr' as 0 and encode the precision via the C_PREL() flags instead as described in callout(9). (I think how to use sbintime_t should probably be broken out into a separate sbintime(9) manpage that callout(9) and other consumers reference rather than being buried in callout(9) to make it easier to figure out how to use these. The same manpage can also talk about the SBT_* constants and how to generate sbintime_t values from known reference times.) -- John Baldwin From owner-svn-src-head@freebsd.org Mon Jan 4 16:21:59 2016 Return-Path: Delivered-To: svn-src-head@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 5B1C7A61D1C; Mon, 4 Jan 2016 16:21:59 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (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 2BA6D109B; Mon, 4 Jan 2016 16:21:59 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x242.google.com with SMTP id k127so28699848iok.1; Mon, 04 Jan 2016 08:21:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=zzjDfCW2KPHNA7MrwlZxv+vgcu/0laClQEC6qa9yl+I=; b=yuQcrBIC7FY9vR8eI24vUVmTnoZtSGyZuy26ZQNy0ykHkRrsoyfxo3GyQQxJxhtkox wvxbLo80+XaHjxuPCcOqFy7GpOSNoVwd7JoT1Ybj3mW+J1kq/p801dwv3UhocATMrWKZ tM+AAybxR7TChH7OiQKaieRDI0VmLxjqgOVCVoe5DSGY0UTfK0TlvflvwzhK09Eeg6Iy UmkqKff6HNVFDK471WvlbWQ6CBgOZLZEFIeXAiKxV7oIUKTd4SzK+Gn4XC1CjC8u+hsb 8pbFYCRRZMmpIOb85bO9C0bXTCI2RSyqR3PUz4NEIIIBX6y3pxipRyKXkLWjverVoO/j yYqw== MIME-Version: 1.0 X-Received: by 10.107.10.217 with SMTP id 86mr68702036iok.75.1451924518361; Mon, 04 Jan 2016 08:21:58 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.121.202 with HTTP; Mon, 4 Jan 2016 08:21:58 -0800 (PST) In-Reply-To: <2558363.cYPdmfTgJ4@ralph.baldwin.cx> References: <201601010021.u010L7sW006625@repo.freebsd.org> <5919271.R3YaC4QkYh@ralph.baldwin.cx> <2558363.cYPdmfTgJ4@ralph.baldwin.cx> Date: Mon, 4 Jan 2016 08:21:58 -0800 X-Google-Sender-Auth: D-jnHT0MsfaS5VbI12agitnnwLw Message-ID: Subject: Re: svn commit: r293022 - head/sys/net80211 From: Adrian Chadd To: John Baldwin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 16:21:59 -0000 On 4 January 2016 at 07:47, John Baldwin wrote: > On Friday, January 01, 2016 07:41:42 PM Adrian Chadd wrote: >> yup. all of this is ... terrible atm. >> >> I do need to be able to give a bounds though. :( > > The _sbt variants let you specify a bounds for the "fuzzy". You > give the deadline time as one value ('sbt') and an upper bound on > how long to delay extra as the second ('pr'). The wait will > timeout sometime between 'sbt' and 'sbt + pr'. > > Alternatively, you can leave 'pr' as 0 and encode the precision > via the C_PREL() flags instead as described in callout(9). (I > think how to use sbintime_t should probably be broken out into > a separate sbintime(9) manpage that callout(9) and other consumers > reference rather than being buried in callout(9) to make it easier > to figure out how to use these. The same manpage can also talk > about the SBT_* constants and how to generate sbintime_t values > from known reference times.) I dug into it a few months ago and found it was .. not quite as bounded fuzzy :( -a From owner-svn-src-head@freebsd.org Mon Jan 4 16:50:02 2016 Return-Path: Delivered-To: svn-src-head@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 7E205A627DA for ; Mon, 4 Jan 2016 16:50:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d:c09::22e]) (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 3C7C814DD for ; Mon, 4 Jan 2016 16:50:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk0-x22e.google.com with SMTP id p187so250316135qkd.1 for ; Mon, 04 Jan 2016 08:50:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=mRlt2BfieutsqXFfcyQxhEShUC+QC+wprHluuS0L3KI=; b=SsMf7LNkYXsIxFSSGi2PT4qAUc+cN4M+cr6s1jFyttXRW/KV0rL25VkQk66rAP5I20 f4f1h6swO1vhaxGQQ3OHedYGAw7be+l8lWZTRcc7T8Ey6RGznMvhYxJNz7s4Y3EYG9Vn h9ZxLUNJm3rbyUIFzBfsUR3+krWw3Ejdq+yjUM4D8Kpa3WWd4nK5oHw+DQGQPlfTMI3+ sIKzvhnubK/H08kxcCQSkX/hMIZKMPCLSnwYYzt8A9mOhDcw7wxqttPkyPR524/EwRYT VoXqcXOU18eMLlBJabQ78cUu4RrygD+o1HuxZfVSONR3Twf06hJbgOgmoMxrWNM+3On4 rWXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=mRlt2BfieutsqXFfcyQxhEShUC+QC+wprHluuS0L3KI=; b=kD/oTwIbzqUm1aXi5ES8OiFP8wf4e93U3AlvxiTZP2ucJdbI/gj2AyBukkJgT8uXFX YQuqHHMs5NKryfxEj7qTKmUN1AcLL8smwLaCVMHUQS5KTmUUQreoAcVX3mbfVkPGPEyE hzRlh62iSsn1ijxff/Y+6TgA24lAUj/ahFocNBAFJG7Vb7jCRnykGCLXw2BPkYhm5fe3 axTOSxKioHMLA9toi0/2ieB8oQYe5QvK29KHUlQ9/nxOL65qs+fsRjuQVa+AQxMinYUU CTCBdCEwMNPA+BcKoFBDcwdPZiwbLNdlXAfWMJ7l0KdYG5uT7vxv/PnhOsru/S/k1jBa hu/w== X-Gm-Message-State: ALoCoQkFLR8Kd5EP9KaYFV91TO9ImRASuPU7I7PKCkgrsCa4yAwbaCa7mb3FVeb4Y1HiRSWSeJYmJurkkTkuELLZo36uLI/SvQ== MIME-Version: 1.0 X-Received: by 10.55.81.87 with SMTP id f84mr15319800qkb.10.1451926200908; Mon, 04 Jan 2016 08:50:00 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 4 Jan 2016 08:50:00 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <7fjp-lonn-wny@vfemail.net> References: <201601031918.u03JImBs012182@repo.freebsd.org> <7fjp-lonn-wny@vfemail.net> Date: Mon, 4 Jan 2016 09:50:00 -0700 X-Google-Sender-Auth: EjZrYL9EiV2XcbVCoy1XDE4i3G8 Message-ID: Subject: Re: svn commit: r293115 - head/etc From: Warner Losh To: Jan Beich Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 16:50:02 -0000 On Mon, Jan 4, 2016 at 1:44 AM, Jan Beich wrote: > Warner Losh writes: > > > Author: imp > > Date: Sun Jan 3 19:18:48 2016 > > New Revision: 293115 > > URL: https://svnweb.freebsd.org/changeset/base/293115 > > > > Log: > > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked > > up and can cause issues on boot with the prompts. > > Why do you have ~/.profile stuff leaking into rc* boot sequence? > Because I though they were in /root/.profile. I was going to quote them here. Also, all other instances of rm in the rc files I noticed with a quick grep has /bin/rm. Turns out it is simply rm's default behavior w/o -f to prompt, I think. Warner From owner-svn-src-head@freebsd.org Mon Jan 4 16:53:03 2016 Return-Path: Delivered-To: svn-src-head@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 B4702A629E0; Mon, 4 Jan 2016 16:53:03 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 94C931BFB; Mon, 4 Jan 2016 16:53:03 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id A6D4BD87C; Mon, 4 Jan 2016 16:52:57 +0000 (UTC) Subject: Re: svn commit: r293115 - head/etc To: Warner Losh , Jan Beich References: <201601031918.u03JImBs012182@repo.freebsd.org> <7fjp-lonn-wny@vfemail.net> Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Allan Jude Message-ID: <568AA373.3060004@freebsd.org> Date: Mon, 4 Jan 2016 11:53:07 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NMpxjmCoHAUh12H45JLx05HD1O1Rul5G0" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 16:53:03 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NMpxjmCoHAUh12H45JLx05HD1O1Rul5G0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-01-04 11:50, Warner Losh wrote: >=20 >=20 > On Mon, Jan 4, 2016 at 1:44 AM, Jan Beich > wrote: >=20 > Warner Losh writes: >=20 > > Author: imp > > Date: Sun Jan 3 19:18:48 2016 > > New Revision: 293115 > > URL: https://svnweb.freebsd.org/changeset/base/293115 > > > > Log: > > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is pic= ked > > up and can cause issues on boot with the prompts. >=20 > Why do you have ~/.profile stuff leaking into rc* boot sequence? >=20 >=20 > Because I though they were in /root/.profile. I was going to quote > them here. Also, all other instances of rm in the rc files I noticed > with a quick grep has /bin/rm. >=20 > Turns out it is simply rm's default behavior w/o -f to prompt, I think.= >=20 > Warner Prompting is not the default behaviour, but also check /etc/profile --=20 Allan Jude --NMpxjmCoHAUh12H45JLx05HD1O1Rul5G0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJWiqN2AAoJEBmVNT4SmAt+TU0QAJkVN7KvoNLE2k+d5PABfOaH RhgObJe9T+ujt0YrHNxd66tCR4Bl1SuYK2uZ0DgHHVqx8UL9nv5Tdwg9bYSAZuKi KPEONGaqpsCrJwF6h/Xb+fCSs2fwpB4C4dFGmMhsQSahJQEoZ9XJ5BoOfgu6+ENq wnK8eijX12IpnXMV1mYuT9wCoyTU/UXCkWQ0a5SFcjibyCWrmcpeH0qySYIMgROu e3O12uJxcb7nNJzlZU0q69YDG+oB5N6AooovbHaXj/eA9y2ghb6etc2ZjmLvCtdy NOCg0dw08bq2DTExmGQ+coPjAsqbLHAGVxNHUHf8omk1+MB+j7ZJZZ0tPOv3HXXQ T51hzsCqZWxisSVvOuO2+4Bb/9lCYc2aqTE1n3oaaFfbG6hIcQ5A4hweZSCLDXS4 KXobV66WlZeUrJqR5S+HOD6sTIiifU1mzwuDtkJbbCVM0j5LEKQJBg/uhKiiGy+D +3yvFsvscTNzGK1dkF5zFJwMcWLSJIdYw1CBKR3Y/v5O9PGBfdJGZ2d3iL8aq9qh 0eEOrL6a1j7B8FSYt3SKIxuVb91mU7jc48BODKh3x0Srme5Bl5zqRAb6VPMtNqXN I+D6SMtTjQ1V8DyM96NK/NVg7G1v7cLQ4NC3Iq7CWBLUnwkmcuG0fp7tfHZFMuPT uTeGC6Ngi5A5+LXTCLy3 =M84s -----END PGP SIGNATURE----- --NMpxjmCoHAUh12H45JLx05HD1O1Rul5G0-- From owner-svn-src-head@freebsd.org Mon Jan 4 16:56:31 2016 Return-Path: Delivered-To: svn-src-head@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 06FE6A62B11 for ; Mon, 4 Jan 2016 16:56:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x231.google.com (mail-qg0-x231.google.com [IPv6:2607:f8b0:400d:c04::231]) (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 B19281DEA for ; Mon, 4 Jan 2016 16:56:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x231.google.com with SMTP id e32so167869435qgf.3 for ; Mon, 04 Jan 2016 08:56:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=YacNuTbVOKiZJUaGS20btzTEc0YTf5GKZgd1f7SpJSg=; b=vEo+lghVtwCtPkHDgoiypS/L04sbp5oRP70T1b92j6kPrv6Yw5N8ow/L17GkkSBodA yVq3BK1uovbJ4VQaSlrrYQSRml3oego2bH2x7d2+GxY8rZui3S83AAtTYuogomgqQIGX HSGB+P9YnuL/PfdknxDdp8t/6sHxmah/C6BmD+Z5xcCGAMsrThQRX+1o6WLMlyLEJoON C1uSizDskjQNy6Z5cxYnM8OHKlu8lV5075TJtlHLEqCdoELYtkzhA/fOftzGKE3pdC3O z1txtbqWvzK7IWOz4/HWCJ+IfavKuNb+ryFeBs9C2AhR3IaPVwFi/JmpEvHisNjc+OVM +9HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=YacNuTbVOKiZJUaGS20btzTEc0YTf5GKZgd1f7SpJSg=; b=XOgAnGETagNg64OcMA5+oCkxODSX2RCjutGrXZj664y+gDRc5yOlQktj5an8m9I5eL MOQ74xPaOe/Kp24C6oVDlcduuEhF/xAblzOAPXyVq0B8gypY/X67VTU7SkqiLvzvc1zZ bJYac8S75qS68ZDXOAwJ4PMUj0N5ZGPxzClgXGajSXFIk3+lKpH/gcl/AQ7IO6UdjjK1 HKo+sT0RfxPM/9Adi1iNO/xnfWAQBASepciwzJbLXvg/XK6cErW3c2YHJqLg2eFnC7c3 twN7GisfCPi9rcUCIVS/u6GXFZae/Qm17YMjtdt3lSjkB3E8R2KUA3NhTjccNU/9dL93 zI+Q== X-Gm-Message-State: ALoCoQl/s9w2Pl8CveHXh21y9Zndn7sjpjAmuFWcqr6VIZcDt7CCiPgnVCkVxhuDDFsg+99wPWRgpDO064Exk4UBpPth8X5z4Q== MIME-Version: 1.0 X-Received: by 10.140.30.197 with SMTP id d63mr116300544qgd.81.1451926589731; Mon, 04 Jan 2016 08:56:29 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 4 Jan 2016 08:56:29 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <568AA373.3060004@freebsd.org> References: <201601031918.u03JImBs012182@repo.freebsd.org> <7fjp-lonn-wny@vfemail.net> <568AA373.3060004@freebsd.org> Date: Mon, 4 Jan 2016 09:56:29 -0700 X-Google-Sender-Auth: jGMc290xKDXFHtOLw0aGIrjR_Gk Message-ID: Subject: Re: svn commit: r293115 - head/etc From: Warner Losh To: Allan Jude Cc: Jan Beich , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 16:56:31 -0000 On Mon, Jan 4, 2016 at 9:53 AM, Allan Jude wrote: > On 2016-01-04 11:50, Warner Losh wrote: > > > > > > On Mon, Jan 4, 2016 at 1:44 AM, Jan Beich > > wrote: > > > > Warner Losh writes: > > > > > Author: imp > > > Date: Sun Jan 3 19:18:48 2016 > > > New Revision: 293115 > > > URL: https://svnweb.freebsd.org/changeset/base/293115 > > > > > > Log: > > > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is > picked > > > up and can cause issues on boot with the prompts. > > > > Why do you have ~/.profile stuff leaking into rc* boot sequence? > > > > > > Because I though they were in /root/.profile. I was going to quote > > them here. Also, all other instances of rm in the rc files I noticed > > with a quick grep has /bin/rm. > > > > Turns out it is simply rm's default behavior w/o -f to prompt, I think. > > > > Warner > > Prompting is not the default behaviour, but also check /etc/profile > I specifically did before sending. There's nothing in /etc/profile on the affected system. Nor in /root/.profile. However, the files were on a read-only filesystem which is why rm's default behavior of prompting for files it can't delete kicked in. I though there was a stray alias rm rm -i floating around, but was bad and didn't actually look to confirm until a few minutes ago. Warner From owner-svn-src-head@freebsd.org Mon Jan 4 17:09:01 2016 Return-Path: Delivered-To: svn-src-head@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 BC305A61045 for ; Mon, 4 Jan 2016 17:09:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x236.google.com (mail-qg0-x236.google.com [IPv6:2607:f8b0:400d:c04::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 7616A1C0D for ; Mon, 4 Jan 2016 17:09:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x236.google.com with SMTP id 6so180383055qgy.1 for ; Mon, 04 Jan 2016 09:09:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=/fGWm9Dquj4lxDdkOIIHqJTCMVWiZay2DsVlt61cwuQ=; b=XwFvNp2Lk7tZWxJBdiU1JezjPY/8HfVjMMa+70nJpm1jJfclvPzT/sZq9eCEX6fx/x P0oWuQPDHrl7dsGves18hMJxnOm8DXtvLVt3zQAgcsIbSo5BfjuS55nSoGL9JK+CJ9tA qCNaRSGtv5Kjo4AfucvlFA34Brb9dZmHCwOpuJ1ofaKE/QfuoKNQqggBxS/GHYI83QVk qsMZrbJEdYSnrdzsFLWmNGEdH7Gr6v9U48xyK2g790nX2OZ4hdJZwHUV4xLHsbDlspkH e3nEpIZSWYJhaeUWd/h4FxynSHrZ3yiNRa/TJWQ4zBLgbiQ8hI9hUBM+4bPSwtx3ez/g uJDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=/fGWm9Dquj4lxDdkOIIHqJTCMVWiZay2DsVlt61cwuQ=; b=kG8uAeWZlc/mHnCPshftOC6MrqZHvXLCrp2KiEp/HclIcxeKJjssCTyudyv6YLxBeL 0+vb1xVowJtDO6iEYiF7gfXr49BeMRCmY6ONguYxWfEJIWAouMYExHWUO2VRVE8DtWYk zNDlpCYjp3g9SpRaEma7Z/Zleoo2/vDdCxdHKNjDkZGpOmFCxkcHgsHXTLgZC0wP+/ZA HsUoDYWZXff1CICs8kAozf1osUQ8PgN4K9sbWHYD/ahcKoliRNy2rtHxQS+kQ9WgVRF0 UKulaFrPl4N68SEM41SJ1UWkV5rmwitp/R7m+Udu+SE2aHczlPrVo8t1Hnmuy7Ub4BTA JzdA== X-Gm-Message-State: ALoCoQnVDROV6npbMIiiaBuICZUs+OC0Ru6Kj+RO4W2ZibuOTOR7GMGTcjVHUxvG98S6+yiytMxheiTeZdzhe/UWGMyZ9LBytA== MIME-Version: 1.0 X-Received: by 10.140.141.138 with SMTP id 132mr14429013qhn.74.1451927340411; Mon, 04 Jan 2016 09:09:00 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 4 Jan 2016 09:09:00 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <000001520d9553a7-b3ef495a-89d6-44ec-91c1-c4f9afc2c55b-000000@email.amazonses.com> References: <201601031918.u03JImBs012182@repo.freebsd.org> <000001520d9553a7-b3ef495a-89d6-44ec-91c1-c4f9afc2c55b-000000@email.amazonses.com> Date: Mon, 4 Jan 2016 10:09:00 -0700 X-Google-Sender-Auth: HW5l5CK01HQTVlpQkVDodX2-Or8 Message-ID: Subject: Re: svn commit: r293115 - head/etc From: Warner Losh To: Colin Percival Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:09:01 -0000 On Mon, Jan 4, 2016 at 10:00 AM, Colin Percival wrote: > On 01/03/16 11:18, Warner Losh wrote: > > Log: > > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked > > up and can cause issues on boot with the prompts. > > Huh, I never realized that could be a problem. It can, but it was a false positive here. /bin/sh always sources them, so if you'd added an alias, it would be hit here. > > > Fix the read-only > > root case with horrible kludge of mounting rw removing the files, then > > mounting ro. > > The solution I intended when I introduced this (and used elsewhere) was to > set $firstboot_sentinel in /etc(/defaults)?/rc.conf. This case is > precisely > why it's a shell variable, in fact. Except that's not exactly useful. NanoBSD boots with no filesystems writable that are permanent. So I could set it to /var/firstboot or something like that, and the error would go away. However, that wouldn't solve the problem because /var is repopulated from base seed files every boot with NanoBSD so we'd get firstboot behavior on every single boot. Or, we could remount / rw and remove the file and remount it ro when a read-only root was requested. I wondered to myself why we didn't use the same mechanism as nextboot for this feature. Do you know? Warner From owner-svn-src-head@freebsd.org Mon Jan 4 17:13:54 2016 Return-Path: Delivered-To: svn-src-head@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 105CCA6128C for ; Mon, 4 Jan 2016 17:13:54 +0000 (UTC) (envelope-from 000001520d954b29-7a1f5e1b-bca2-4d83-ac45-f2188bc22806-000000@amazonses.com) Received: from a9-100.smtp-out.amazonses.com (a9-100.smtp-out.amazonses.com [54.240.9.100]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE17D1FD3 for ; Mon, 4 Jan 2016 17:13:53 +0000 (UTC) (envelope-from 000001520d954b29-7a1f5e1b-bca2-4d83-ac45-f2188bc22806-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=dqtolf56kk3wpt62c3jnwboqvr7iedax; d=tarsnap.com; t=1451926834; h=From:Subject:To:References:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=GSV3k0QuTaj1YWAchXOmcjDljyx0EUQMZ+hOy7aX6BY=; b=nMLlpTmV6O4F+PxFLrPwyCG3LRBuvWhEMBozhyFECrznWgfr6egS7iy4kyF8eiD/ CX505foYwsHF9OUwkCXk+3+8/eSwNxCybo6YhPtz+h/vExM+SrhOxYb9GMFg7vY8/bs 9OYGYADDIbFBS8vwD1u1rGEreV9BiCNw1smSHcUE= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1451926834; h=From:Subject:To:References:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=GSV3k0QuTaj1YWAchXOmcjDljyx0EUQMZ+hOy7aX6BY=; b=l1IwslDwrBXpp2Cw8ejaSxOBXFWHDvnTDpCFihgDxrKoU/RQBlvSBzt8yheRQoRf UryODIcLoe92HQ4LyHjpK2JvULvFh+FZ0wYmaiSu4tg/GFmM+L8Qx7prOYgNsMI6C22 fMuxUa6SCeUDI+JqtN31OPZlSillb7tWFxTNMKyo= From: Colin Percival Subject: Re: svn commit: r293115 - head/etc To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601031918.u03JImBs012182@repo.freebsd.org> Message-ID: <000001520d954b29-7a1f5e1b-bca2-4d83-ac45-f2188bc22806-000000@email.amazonses.com> Date: Mon, 4 Jan 2016 17:00:34 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201601031918.u03JImBs012182@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2016.01.04-54.240.9.100 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:13:54 -0000 On 01/03/16 11:18, Warner Losh wrote: > Log: > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked > up and can cause issues on boot with the prompts. Huh, I never realized that could be a problem. > Fix the read-only > root case with horrible kludge of mounting rw removing the files, then > mounting ro. The solution I intended when I introduced this (and used elsewhere) was to set $firstboot_sentinel in /etc(/defaults)?/rc.conf. This case is precisely why it's a shell variable, in fact. Colin Percival > Modified: head/etc/rc > ============================================================================== > --- head/etc/rc Sun Jan 3 19:06:17 2016 (r293114) > +++ head/etc/rc Sun Jan 3 19:18:48 2016 (r293115) > @@ -131,11 +131,14 @@ done > > # Remove the firstboot sentinel, and reboot if it was requested. > if [ -e ${firstboot_sentinel} ]; then > - rm ${firstboot_sentinel} > + [ ${root_rw_mount} = "yes" ] || mount -uw / > + /bin/rm ${firstboot_sentinel} > if [ -e ${firstboot_sentinel}-reboot ]; then > - rm ${firstboot_sentinel}-reboot > + /bin/rm ${firstboot_sentinel}-reboot > + [ ${root_rw_mount} = "yes" ] || mount -ur / > kill -INT 1 > fi > + [ ${root_rw_mount} = "yes" ] || mount -ur / > fi > > echo '' -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Mon Jan 4 17:17:08 2016 Return-Path: Delivered-To: svn-src-head@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 56963A613EA; Mon, 4 Jan 2016 17:17:08 +0000 (UTC) (envelope-from adrian@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 2414810F9; Mon, 4 Jan 2016 17:17:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04HH7f9074529; Mon, 4 Jan 2016 17:17:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04HH7Mi074528; Mon, 4 Jan 2016 17:17:07 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201601041717.u04HH7Mi074528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 4 Jan 2016 17:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293164 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:17:08 -0000 Author: adrian Date: Mon Jan 4 17:17:06 2016 New Revision: 293164 URL: https://svnweb.freebsd.org/changeset/base/293164 Log: [net80211] fix duration field; it's unsigned, but not long. Submitted by: Imre Vadasz Obtained from: DragonflyBSD Modified: head/sys/net80211/ieee80211_scan_sw.c Modified: head/sys/net80211/ieee80211_scan_sw.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sw.c Mon Jan 4 16:51:56 2016 (r293163) +++ head/sys/net80211/ieee80211_scan_sw.c Mon Jan 4 17:17:06 2016 (r293164) @@ -359,7 +359,7 @@ ieee80211_swscan_bg_scan(const struct ie duration = IEEE80211_SCAN_OFFCHANNEL; IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, - "%s: %s scan, ticks %u duration %lu\n", __func__, + "%s: %s scan, ticks %u duration %u\n", __func__, ss->ss_flags & IEEE80211_SCAN_ACTIVE ? "active" : "passive", ticks, duration); From owner-svn-src-head@freebsd.org Mon Jan 4 17:22:07 2016 Return-Path: Delivered-To: svn-src-head@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 81D6BA61697; Mon, 4 Jan 2016 17:22:07 +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 4E377162D; Mon, 4 Jan 2016 17:22:07 +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 u04HM61H078252; Mon, 4 Jan 2016 17:22:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04HM6oA078251; Mon, 4 Jan 2016 17:22:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601041722.u04HM6oA078251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 4 Jan 2016 17:22:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293165 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:22:07 -0000 Author: emaste Date: Mon Jan 4 17:22:06 2016 New Revision: 293165 URL: https://svnweb.freebsd.org/changeset/base/293165 Log: loader.efi: support non-contiguous console modes Submitted by: Toomas Soome MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4760 Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Mon Jan 4 17:17:06 2016 (r293164) +++ head/sys/boot/efi/loader/main.c Mon Jan 4 17:22:06 2016 (r293165) @@ -359,10 +359,11 @@ command_mode(int argc, char *argv[]) return (CMD_OK); } - for (i = 0; ; i++) { + printf("Current mode: %d\n", conout->Mode->Mode); + for (i = 0; i <= conout->Mode->MaxMode; i++) { status = conout->QueryMode(conout, i, &cols, &rows); if (EFI_ERROR(status)) - break; + continue; printf("Mode %d: %u columns, %u rows\n", i, (unsigned)cols, (unsigned)rows); } From owner-svn-src-head@freebsd.org Mon Jan 4 17:23:11 2016 Return-Path: Delivered-To: svn-src-head@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 A952FA61713; Mon, 4 Jan 2016 17:23:11 +0000 (UTC) (envelope-from melifaro@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 7704B18EB; Mon, 4 Jan 2016 17:23:11 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04HNAqR078940; Mon, 4 Jan 2016 17:23:10 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04HNAxG078939; Mon, 4 Jan 2016 17:23:10 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601041723.u04HNAxG078939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 4 Jan 2016 17:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293166 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:23:11 -0000 Author: melifaro Date: Mon Jan 4 17:23:10 2016 New Revision: 293166 URL: https://svnweb.freebsd.org/changeset/base/293166 Log: Maintain consistent behavior: make fib4_lookup_nh_ext() return rt_ifp pointer by default, as done by other fib lookup functions. Modified: head/sys/netinet/in_fib.c Modified: head/sys/netinet/in_fib.c ============================================================================== --- head/sys/netinet/in_fib.c Mon Jan 4 17:22:06 2016 (r293165) +++ head/sys/netinet/in_fib.c Mon Jan 4 17:23:10 2016 (r293166) @@ -97,7 +97,10 @@ fib4_rte_to_nh_extended(struct rtentry * struct sockaddr_in *gw; struct in_ifaddr *ia; - pnh4->nh_ifp = rte->rt_ifa->ifa_ifp; + if ((flags & NHR_IFAIF) != 0) + pnh4->nh_ifp = rte->rt_ifa->ifa_ifp; + else + pnh4->nh_ifp = rte->rt_ifp; pnh4->nh_mtu = min(rte->rt_mtu, rte->rt_ifp->if_mtu); if (rte->rt_flags & RTF_GATEWAY) { gw = (struct sockaddr_in *)rte->rt_gateway; From owner-svn-src-head@freebsd.org Mon Jan 4 17:25:33 2016 Return-Path: Delivered-To: svn-src-head@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 74DAAA61869; Mon, 4 Jan 2016 17:25:33 +0000 (UTC) (envelope-from melifaro@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 4767B1BC2; Mon, 4 Jan 2016 17:25:33 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04HPWhj079170; Mon, 4 Jan 2016 17:25:32 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04HPWV4079169; Mon, 4 Jan 2016 17:25:32 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601041725.u04HPWV4079169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 4 Jan 2016 17:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293167 - head/sys/netgraph/netflow X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:25:33 -0000 Author: melifaro Date: Mon Jan 4 17:25:32 2016 New Revision: 293167 URL: https://svnweb.freebsd.org/changeset/base/293167 Log: Fix route lookup condition: do IPv6 route lookup for source based on NG_NETFLOW_CONF_NOSRCLOOKUP instead of NG_NETFLOW_CONF_NODSTLOOKUP. Modified: head/sys/netgraph/netflow/netflow.c Modified: head/sys/netgraph/netflow/netflow.c ============================================================================== --- head/sys/netgraph/netflow/netflow.c Mon Jan 4 17:23:10 2016 (r293166) +++ head/sys/netgraph/netflow/netflow.c Mon Jan 4 17:25:32 2016 (r293167) @@ -451,7 +451,7 @@ hash6_insert(priv_p priv, struct flow_ha } } - if ((flags & NG_NETFLOW_CONF_NODSTLOOKUP) == 0) { + if ((flags & NG_NETFLOW_CONF_NOSRCLOOKUP) == 0) { /* Do route lookup on source address, to fill in src_mask. */ bzero(&rin6, sizeof(struct route_in6)); src = (struct sockaddr_in6 *)&rin6.ro_dst; From owner-svn-src-head@freebsd.org Mon Jan 4 17:41:23 2016 Return-Path: Delivered-To: svn-src-head@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 70551A61DE1 for ; Mon, 4 Jan 2016 17:41:23 +0000 (UTC) (envelope-from 000001520dbaa2ff-ae816bbe-034d-417e-a719-809d1614db70-000000@amazonses.com) Received: from a9-121.smtp-out.amazonses.com (a9-121.smtp-out.amazonses.com [54.240.9.121]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35A52157F for ; Mon, 4 Jan 2016 17:41:22 +0000 (UTC) (envelope-from 000001520dbaa2ff-ae816bbe-034d-417e-a719-809d1614db70-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=dqtolf56kk3wpt62c3jnwboqvr7iedax; d=tarsnap.com; t=1451929281; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=A0OpwxBHpxI3McOcuL0s1rPa14kh/Z0XACCtwEgZVGE=; b=g5iWINCuuDTF0dR/TdJMFTjQsvr9mbIbUXqihXgVEc50dd/Saup/q1yWRQGh04gz FN5xsfsZIP56RhgPK4rnXBgsR2AquPxiZGIE+KJpcWLgcQMZWe5RRbYuQ+LiuR2aFft Qk3eCmJxMko1B8Yz82gc3CyWwpNhGZI5AEu3ytEE= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1451929281; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=A0OpwxBHpxI3McOcuL0s1rPa14kh/Z0XACCtwEgZVGE=; b=iWG17Q1RiJl0urUj/uV/MnQT4K2XSqKJxYPsO5rgEGaIuZDZrF4X4eOGWoq6vX9k MrzMoxocPBIVjUtDUYaXuQHgOpQDQaDMYt0ilUSyLpIAJLWIEaAjJPlvNkBhuzJX8b5 oIA9Ht2VXTarAEJVgq1UkUyvkz8MwChEi51MeHMg= Subject: Re: svn commit: r293115 - head/etc To: Warner Losh References: <201601031918.u03JImBs012182@repo.freebsd.org> <000001520d9553a7-b3ef495a-89d6-44ec-91c1-c4f9afc2c55b-000000@email.amazonses.com> Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Colin Percival Message-ID: <000001520dbaa2ff-ae816bbe-034d-417e-a719-809d1614db70-000000@email.amazonses.com> Date: Mon, 4 Jan 2016 17:41:21 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2016.01.04-54.240.9.121 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:41:23 -0000 On 01/04/16 09:09, Warner Losh wrote: > On Mon, Jan 4, 2016 at 10:00 AM, Colin Percival > wrote: > On 01/03/16 11:18, Warner Losh wrote: > > Fix the read-only > > root case with horrible kludge of mounting rw removing the files, then > > mounting ro. > > The solution I intended when I introduced this (and used elsewhere) was to > set $firstboot_sentinel in /etc(/defaults)?/rc.conf. This case is precisely > why it's a shell variable, in fact. > > Except that's not exactly useful. NanoBSD boots with no filesystems writable > that are permanent. So I could set it to /var/firstboot or something like that, > and the error would go away. However, that wouldn't solve the problem > because /var is repopulated from base seed files every boot with NanoBSD > so we'd get firstboot behavior on every single boot. Or, we could remount > / rw and remove the file and remount it ro when a read-only root was > requested. Huh, ok. I assumed that you had a /conf/ or something like that for storing persistent configuration data. > I wondered to myself why we didn't use the same mechanism as nextboot > for this feature. Do you know? Doesn't that still write to the filesystem? -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Mon Jan 4 17:42:13 2016 Return-Path: Delivered-To: svn-src-head@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 A8F72A61E26; Mon, 4 Jan 2016 17:42:13 +0000 (UTC) (envelope-from dfr@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 7D5121623; Mon, 4 Jan 2016 17:42:13 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04HgC8U085262; Mon, 4 Jan 2016 17:42:12 GMT (envelope-from dfr@FreeBSD.org) Received: (from dfr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04HgCZ7085261; Mon, 4 Jan 2016 17:42:12 GMT (envelope-from dfr@FreeBSD.org) Message-Id: <201601041742.u04HgCZ7085261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dfr set sender to dfr@FreeBSD.org using -f From: Doug Rabson Date: Mon, 4 Jan 2016 17:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293168 - head/lib/libgssapi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:42:13 -0000 Author: dfr Date: Mon Jan 4 17:42:12 2016 New Revision: 293168 URL: https://svnweb.freebsd.org/changeset/base/293168 Log: Fix a memory leak in gss_release_oid_set Modified: head/lib/libgssapi/gss_release_oid_set.c Modified: head/lib/libgssapi/gss_release_oid_set.c ============================================================================== --- head/lib/libgssapi/gss_release_oid_set.c Mon Jan 4 17:25:32 2016 (r293167) +++ head/lib/libgssapi/gss_release_oid_set.c Mon Jan 4 17:42:12 2016 (r293168) @@ -32,15 +32,25 @@ OM_uint32 gss_release_oid_set(OM_uint32 *minor_status, - gss_OID_set *set) + gss_OID_set *setp) { + gss_OID_set set; + gss_OID o; + size_t i; *minor_status = 0; - if (set && *set) { - if ((*set)->elements) - free((*set)->elements); - free(*set); - *set = GSS_C_NO_OID_SET; + if (setp) { + set = *setp; + if (set) { + for (i = 0; i < set->count; i++) { + o = &set->elements[i]; + if (o->elements) + free(o->elements); + } + free(set->elements); + free(set); + *setp = GSS_C_NO_OID_SET; + } } return (GSS_S_COMPLETE); } From owner-svn-src-head@freebsd.org Mon Jan 4 17:55:32 2016 Return-Path: Delivered-To: svn-src-head@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 B8189A62342; Mon, 4 Jan 2016 17:55:32 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8538B1DA8; Mon, 4 Jan 2016 17:55:32 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id C34B9B8090; Mon, 4 Jan 2016 18:55:29 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id AD5E028494; Mon, 4 Jan 2016 18:55:29 +0100 (CET) Date: Mon, 4 Jan 2016 18:55:29 +0100 From: Jilles Tjoelker To: Warner Losh Cc: Colin Percival , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r293115 - head/etc Message-ID: <20160104175529.GA10000@stack.nl> References: <201601031918.u03JImBs012182@repo.freebsd.org> <000001520d9553a7-b3ef495a-89d6-44ec-91c1-c4f9afc2c55b-000000@email.amazonses.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 17:55:32 -0000 On Mon, Jan 04, 2016 at 10:09:00AM -0700, Warner Losh wrote: > On Mon, Jan 4, 2016 at 10:00 AM, Colin Percival > wrote: > > On 01/03/16 11:18, Warner Losh wrote: > > > Log: > > > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked > > > up and can cause issues on boot with the prompts. > > Huh, I never realized that could be a problem. > It can, but it was a false positive here. /bin/sh always sources them, > so if you'd added an alias, it would be hit here. A non-interactive non-login sh does not source any startup files. Login shells source /etc/profile and ~/.profile and interactive shells source the file whose name is in the ENV environment variable. The prompt comes from trying to remove an existing file which is not writable. It can be suppressed by using rm -f instead of rm. -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Mon Jan 4 18:32:25 2016 Return-Path: Delivered-To: svn-src-head@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 6F5C2A60245; Mon, 4 Jan 2016 18:32:25 +0000 (UTC) (envelope-from melifaro@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 2625D1852; Mon, 4 Jan 2016 18:32:25 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04IWOlh001032; Mon, 4 Jan 2016 18:32:24 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04IWOSQ001031; Mon, 4 Jan 2016 18:32:24 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601041832.u04IWOSQ001031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 4 Jan 2016 18:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293169 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 18:32:25 -0000 Author: melifaro Date: Mon Jan 4 18:32:24 2016 New Revision: 293169 URL: https://svnweb.freebsd.org/changeset/base/293169 Log: Finish r293098: make ip6_getpmtu() and ip6_getpmtu_ctl() use new routing API Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Mon Jan 4 17:42:12 2016 (r293168) +++ head/sys/netinet6/ip6_output.c Mon Jan 4 18:32:24 2016 (r293169) @@ -97,6 +97,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1225,27 +1226,24 @@ ip6_insertfraghdr(struct mbuf *m0, struc static int ip6_getpmtu_ctl(u_int fibnum, struct in6_addr *dst, u_long *mtup) { - struct route_in6 ro_pmtu; + struct nhop6_extended nh6; + struct in6_addr kdst; + uint32_t scopeid; struct ifnet *ifp; - struct sockaddr_in6 *sa6_dst; u_long mtu; + int error; - sa6_dst = (struct sockaddr_in6 *)&ro_pmtu.ro_dst; - bzero(sa6_dst, sizeof(*sa6_dst)); - sa6_dst->sin6_family = AF_INET6; - sa6_dst->sin6_len = sizeof(struct sockaddr_in6); - sa6_dst->sin6_addr = *dst; - - in6_rtalloc(&ro_pmtu, fibnum); - - if (ro_pmtu.ro_rt == NULL) + in6_splitscope(dst, &kdst, &scopeid); + if (fib6_lookup_nh_ext(fibnum, &kdst, scopeid, NHR_REF, 0, &nh6) != 0) return (EHOSTUNREACH); - ifp = ro_pmtu.ro_rt->rt_ifp; - mtu = ro_pmtu.ro_rt->rt_mtu; - RO_RTFREE(&ro_pmtu); + ifp = nh6.nh_ifp; + mtu = nh6.nh_mtu; - return (ip6_calcmtu(ifp, dst, mtu, mtup, NULL)); + error = ip6_calcmtu(ifp, dst, mtu, mtup, NULL); + fib6_free_nh_ext(fibnum, &nh6); + + return (error); } /* @@ -1263,6 +1261,9 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, i struct ifnet *ifp, struct in6_addr *dst, u_long *mtup, int *alwaysfragp, u_int fibnum) { + struct nhop6_basic nh6; + struct in6_addr kdst; + uint32_t scopeid; struct sockaddr_in6 *sa6_dst; u_long mtu; @@ -1284,12 +1285,13 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, i sa6_dst->sin6_len = sizeof(struct sockaddr_in6); sa6_dst->sin6_addr = *dst; - in6_rtalloc(ro_pmtu, fibnum); - if (ro_pmtu->ro_rt) { - mtu = ro_pmtu->ro_rt->rt_mtu; - RO_RTFREE(ro_pmtu); - } + in6_splitscope(dst, &kdst, &scopeid); + if (fib6_lookup_nh_basic(fibnum, &kdst, scopeid, 0, 0, + &nh6) == 0) + ro_pmtu->ro_mtu = nh6.nh_mtu; } + + mtu = ro_pmtu->ro_mtu; } if (ro_pmtu->ro_rt) From owner-svn-src-head@freebsd.org Mon Jan 4 18:34:28 2016 Return-Path: Delivered-To: svn-src-head@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 92F3EA603A9; Mon, 4 Jan 2016 18:34:28 +0000 (UTC) (envelope-from brueffer@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 63C6B1B1B; Mon, 4 Jan 2016 18:34:28 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04IYR3T001154; Mon, 4 Jan 2016 18:34:27 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04IYRQY001153; Mon, 4 Jan 2016 18:34:27 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201601041834.u04IYRQY001153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 4 Jan 2016 18:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293170 - head/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 18:34:28 -0000 Author: brueffer Date: Mon Jan 4 18:34:27 2016 New Revision: 293170 URL: https://svnweb.freebsd.org/changeset/base/293170 Log: Add rtwn(4) to the hardware list. Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Jan 4 18:32:24 2016 (r293169) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Jan 4 18:34:27 2016 (r293170) @@ -1017,6 +1017,9 @@ &hwlist.rsu; + Realtek RTL8188CE based PCIe IEEE 802.11b/g/n wireless network + adapters (&man.rtwn.4; driver) + &hwlist.rum; &hwlist.run; From owner-svn-src-head@freebsd.org Mon Jan 4 19:04:34 2016 Return-Path: Delivered-To: svn-src-head@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 3DF00A60CCB; Mon, 4 Jan 2016 19:04:34 +0000 (UTC) (envelope-from brueffer@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 0A69418FE; Mon, 4 Jan 2016 19:04:33 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04J4X1w009996; Mon, 4 Jan 2016 19:04:33 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04J4XZa009995; Mon, 4 Jan 2016 19:04:33 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201601041904.u04J4XZa009995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 4 Jan 2016 19:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293171 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 19:04:34 -0000 Author: brueffer Date: Mon Jan 4 19:04:33 2016 New Revision: 293171 URL: https://svnweb.freebsd.org/changeset/base/293171 Log: Don't build rtwnfw if building without binary blobs. rtwnfw got added in r293009 and depends on source-less and non-free microcode in sys/contrib/dev/rtwn. PR: 205874 Submitted by: Fabian Keil Obtained from: ElectroBSD Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Jan 4 18:34:27 2016 (r293170) +++ head/sys/modules/Makefile Mon Jan 4 19:04:33 2016 (r293171) @@ -312,7 +312,7 @@ SUBDIR= \ reiserfs \ rl \ rtwn \ - rtwnfw \ + ${_rtwnfw} \ ${_s3} \ ${_safe} \ ${_sbni} \ @@ -484,6 +484,7 @@ _fxp= fxp _ispfw= ispfw _mwlfw= mwlfw _ralfw= ralfw +_rtwnfw= rtwnfw _sf= sf _ti= ti _txp= txp From owner-svn-src-head@freebsd.org Mon Jan 4 19:38:46 2016 Return-Path: Delivered-To: svn-src-head@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 185BBA618AD; Mon, 4 Jan 2016 19:38:46 +0000 (UTC) (envelope-from gjb@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 DC6191A3F; Mon, 4 Jan 2016 19:38:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04JcieV018898; Mon, 4 Jan 2016 19:38:44 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04JciwF018897; Mon, 4 Jan 2016 19:38:44 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201601041938.u04JciwF018897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 4 Jan 2016 19:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293173 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 19:38:46 -0000 Author: gjb Date: Mon Jan 4 19:38:44 2016 New Revision: 293173 URL: https://svnweb.freebsd.org/changeset/base/293173 Log: Fix path to include .OBJDIR to avoid polluting the source tree during 'make release'. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Mon Jan 4 19:19:48 2016 (r293172) +++ head/release/Makefile Mon Jan 4 19:38:44 2016 (r293173) @@ -281,7 +281,7 @@ ftp: packagesystem cp *.txz MANIFEST ftp release: real-release vm-release cloudware-release - touch ${.TARGET} + touch ${.OBJDIR}/${.TARGET} real-release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj From owner-svn-src-head@freebsd.org Mon Jan 4 20:21:18 2016 Return-Path: Delivered-To: svn-src-head@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 3065FA62757 for ; Mon, 4 Jan 2016 20:21:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk0-x22d.google.com (mail-qk0-x22d.google.com [IPv6:2607:f8b0:400d:c09::22d]) (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 D95DD15C6 for ; Mon, 4 Jan 2016 20:21:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk0-x22d.google.com with SMTP id q19so77839062qke.3 for ; Mon, 04 Jan 2016 12:21:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Fpvihg7NHki7Op/1ikS3zqRl5S+BCzOPSSvkwCPfxqI=; b=ebsSWTqwHrgDPwNDXTIum3h6hSwE/LYg+BEUhQEEGOeErE+ae3ze/4TG9EeyR4Qw2Z tIud8sjtCF0vH9oT7EZiUGG/cY+zosyxnmtvqfbl3EEzQHDA1itGJaMJ2T06PsF0ab9g 7d9wylJsIwrt8Z4u/snU+wdEZSKersSN6yrXgRYfhCl/X746tRayQz7IerIt4pvHvAPC 7LZ4v91Oun52WQOUBOYA25ZwGbjgdm3KrUUZj6SAelyy+lOLEnNCqShajH2zEu3m0UFT TIqxmWlJ1L35ozW7tGIQn3Wup0hS0J5ipEW8kNkshsP1i1o4Gjb/tRIM93xi4/IdjHxk WniA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Fpvihg7NHki7Op/1ikS3zqRl5S+BCzOPSSvkwCPfxqI=; b=JNpO1MBa8CgfLGb43qdi8mMztGEYgFoMmBsREmWEDp1+sFqjKE3UqRmgFY2255uHwa +9RMu6xZ77vzj2Ffm2tv2IqDD/8mRhhQhHop1VUWtRHB+BAmOC8IIn5Cb1HEJAupXT95 fU+/wnGgy0yB/3xHJTGebZxJX/87OI0MaZF0T82ggomQEQoJwuE9ze94VLuGU4x4AJr4 5a/FZMw84deSbBQOBD2vuMhaMop7KoV/x05TpRaEHu44HbFrVKvgY9NeO4Bdpv3Es04D 4VdLOrkq0S9053y0h+yjF20Gp4ggvCFgqCnbnt/h0e/TvTyRANT1yA/thiLR9F7GftmC Xy4Q== X-Gm-Message-State: ALoCoQl/u4yrnaXvc5IAe5N6r5reZ6bkFIMuhJG1a5n2HZLs3L+++eRljeJMb1mxVLA6KEDTrAP34R1y7nJZTwyCQ2zAAm7SnA== MIME-Version: 1.0 X-Received: by 10.55.81.87 with SMTP id f84mr16660872qkb.10.1451938876824; Mon, 04 Jan 2016 12:21:16 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 4 Jan 2016 12:21:16 -0800 (PST) X-Originating-IP: [2601:280:4900:3700:a51c:df79:65a:a353] In-Reply-To: <000001520dbaad1a-55cdc7aa-a009-4672-a226-cb140785c55c-000000@email.amazonses.com> References: <201601031918.u03JImBs012182@repo.freebsd.org> <000001520d9553a7-b3ef495a-89d6-44ec-91c1-c4f9afc2c55b-000000@email.amazonses.com> <000001520dbaad1a-55cdc7aa-a009-4672-a226-cb140785c55c-000000@email.amazonses.com> Date: Mon, 4 Jan 2016 13:21:16 -0700 X-Google-Sender-Auth: YyJgoVTOtpfT-mXb2YFEUHB5xr0 Message-ID: Subject: Re: svn commit: r293115 - head/etc From: Warner Losh To: Colin Percival Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 20:21:18 -0000 On Mon, Jan 4, 2016 at 10:41 AM, Colin Percival wrote: > On 01/04/16 09:09, Warner Losh wrote: > > On Mon, Jan 4, 2016 at 10:00 AM, Colin Percival > > wrote: > > On 01/03/16 11:18, Warner Losh wrote: > > > Fix the read-only > > > root case with horrible kludge of mounting rw removing the > files, then > > > mounting ro. > > > > The solution I intended when I introduced this (and used elsewhere) > was to > > set $firstboot_sentinel in /etc(/defaults)?/rc.conf. This case is > precisely > > why it's a shell variable, in fact. > > > > Except that's not exactly useful. NanoBSD boots with no filesystems > writable > > that are permanent. So I could set it to /var/firstboot or something > like that, > > and the error would go away. However, that wouldn't solve the problem > > because /var is repopulated from base seed files every boot with NanoBSD > > so we'd get firstboot behavior on every single boot. Or, we could remount > > / rw and remove the file and remount it ro when a read-only root was > > requested. > > Huh, ok. I assumed that you had a /conf/ or something like that for > storing > persistent configuration data. > It does. But all that's mirrored in a MFS and it takes an explicit command to write it all back. This is poorly matched with where the firstboot files are actually removed. > > I wondered to myself why we didn't use the same mechanism as nextboot > > for this feature. Do you know? > > Doesn't that still write to the filesystem? > So it does. I thought it mucked about with flags and such. Warner From owner-svn-src-head@freebsd.org Mon Jan 4 20:34:41 2016 Return-Path: Delivered-To: svn-src-head@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 A0FDCA62CB2; Mon, 4 Jan 2016 20:34:41 +0000 (UTC) (envelope-from tuexen@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 6FA9E17F7; Mon, 4 Jan 2016 20:34:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04KYeIg036177; Mon, 4 Jan 2016 20:34:40 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04KYenm036176; Mon, 4 Jan 2016 20:34:40 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601042034.u04KYenm036176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 4 Jan 2016 20:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293176 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 20:34:41 -0000 Author: tuexen Date: Mon Jan 4 20:34:40 2016 New Revision: 293176 URL: https://svnweb.freebsd.org/changeset/base/293176 Log: Get struct sctp_net_route in sync with struct route again. Modified: head/sys/netinet/sctp_structs.h Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Mon Jan 4 20:31:09 2016 (r293175) +++ head/sys/netinet/sctp_structs.h Mon Jan 4 20:34:40 2016 (r293176) @@ -189,9 +189,11 @@ struct iterator_control { struct sctp_net_route { sctp_rtentry_t *ro_rt; - void *ro_lle; - void *ro_ia; - int ro_flags; + char *ro_prepend; + uint16_t ro_plen; + uint16_t ro_flags; + uint16_t ro_mtu; + uint16_t spare; union sctp_sockstore _l_addr; /* remote peer addr */ struct sctp_ifa *_s_addr; /* our selected src addr */ }; From owner-svn-src-head@freebsd.org Mon Jan 4 21:03:02 2016 Return-Path: Delivered-To: svn-src-head@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 97179A6188D; Mon, 4 Jan 2016 21:03:02 +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 55A821A41; Mon, 4 Jan 2016 21:03:02 +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 u04L31xa044850; Mon, 4 Jan 2016 21:03:01 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04L31iS044848; Mon, 4 Jan 2016 21:03:01 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601042103.u04L31iS044848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 4 Jan 2016 21:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293177 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 21:03:02 -0000 Author: avos Date: Mon Jan 4 21:03:01 2016 New Revision: 293177 URL: https://svnweb.freebsd.org/changeset/base/293177 Log: iwm: store pointer for 'struct firmware' instead of 'size_t' and 'void *' pair. Approved by: adrian (mentor) Obtained from: DragonFlyBSD Differential Revision: https://reviews.freebsd.org/D4765 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Jan 4 20:34:40 2016 (r293176) +++ head/sys/dev/iwm/if_iwm.c Mon Jan 4 21:03:01 2016 (r293177) @@ -423,9 +423,8 @@ iwm_set_default_calib(struct iwm_softc * static void iwm_fw_info_free(struct iwm_fw_info *fw) { - firmware_put(fw->fw_rawdata, FIRMWARE_UNLOAD); - fw->fw_rawdata = NULL; - fw->fw_rawsize = 0; + firmware_put(fw->fw_fp, FIRMWARE_UNLOAD); + fw->fw_fp = NULL; /* don't touch fw->fw_status */ memset(fw->fw_sects, 0, sizeof(fw->fw_sects)); } @@ -450,32 +449,30 @@ iwm_read_firmware(struct iwm_softc *sc, msleep(&sc->sc_fw, &sc->sc_mtx, 0, "iwmfwp", 0); fw->fw_status = IWM_FW_STATUS_INPROGRESS; - if (fw->fw_rawdata != NULL) + if (fw->fw_fp != NULL) iwm_fw_info_free(fw); /* * Load firmware into driver memory. - * fw_rawdata and fw_rawsize will be set. + * fw_fp will be set. */ IWM_UNLOCK(sc); fwp = firmware_get(sc->sc_fwname); + IWM_LOCK(sc); if (fwp == NULL) { device_printf(sc->sc_dev, "could not read firmware %s (error %d)\n", sc->sc_fwname, error); - IWM_LOCK(sc); goto out; } - IWM_LOCK(sc); - fw->fw_rawdata = fwp->data; - fw->fw_rawsize = fwp->datasize; + fw->fw_fp = fwp; /* * Parse firmware contents */ - uhdr = (const void *)fw->fw_rawdata; - if (*(const uint32_t *)fw->fw_rawdata != 0 + uhdr = (const void *)fw->fw_fp->data; + if (*(const uint32_t *)fw->fw_fp->data != 0 || le32toh(uhdr->magic) != IWM_TLV_UCODE_MAGIC) { device_printf(sc->sc_dev, "invalid firmware %s\n", sc->sc_fwname); @@ -485,7 +482,7 @@ iwm_read_firmware(struct iwm_softc *sc, sc->sc_fwver = le32toh(uhdr->ver); data = uhdr->data; - len = fw->fw_rawsize - sizeof(*uhdr); + len = fw->fw_fp->datasize - sizeof(*uhdr); while (len >= sizeof(tlv)) { size_t tlv_len; @@ -684,7 +681,7 @@ iwm_read_firmware(struct iwm_softc *sc, out: if (error) { fw->fw_status = IWM_FW_STATUS_NONE; - if (fw->fw_rawdata != NULL) + if (fw->fw_fp != NULL) iwm_fw_info_free(fw); } else fw->fw_status = IWM_FW_STATUS_DONE; @@ -4957,7 +4954,7 @@ iwm_detach_local(struct iwm_softc *sc, i iwm_free_tx_ring(sc, &sc->txq[i]); /* Free firmware */ - if (fw->fw_rawdata != NULL) + if (fw->fw_fp != NULL) iwm_fw_info_free(fw); /* free scheduler */ Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Mon Jan 4 20:34:40 2016 (r293176) +++ head/sys/dev/iwm/if_iwmvar.h Mon Jan 4 21:03:01 2016 (r293177) @@ -159,8 +159,7 @@ enum iwm_ucode_type { }; struct iwm_fw_info { - const void *fw_rawdata; - size_t fw_rawsize; + const struct firmware *fw_fp; int fw_status; struct iwm_fw_sects { From owner-svn-src-head@freebsd.org Mon Jan 4 21:07:10 2016 Return-Path: Delivered-To: svn-src-head@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 144F4A61A3E; Mon, 4 Jan 2016 21:07:10 +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 D94E41D73; Mon, 4 Jan 2016 21:07:09 +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 u04L79GR045158; Mon, 4 Jan 2016 21:07:09 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04L78vS045157; Mon, 4 Jan 2016 21:07:08 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601042107.u04L78vS045157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 4 Jan 2016 21:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293178 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 21:07:10 -0000 Author: avos Date: Mon Jan 4 21:07:08 2016 New Revision: 293178 URL: https://svnweb.freebsd.org/changeset/base/293178 Log: iwm: free firmware related resources after uploading it to the hardware iwn(4) / wpi(4) works in the same way (read_firmware() -> hw_init() -> firmware_put()) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4766 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Jan 4 21:03:01 2016 (r293177) +++ head/sys/dev/iwm/if_iwm.c Mon Jan 4 21:07:08 2016 (r293178) @@ -2041,6 +2041,7 @@ iwm_mvm_load_ucode_wait_alive(struct iwm sc->sc_uc_current = ucode_type; error = iwm_start_fw(sc, ucode_type); + iwm_fw_info_free(&sc->sc_fw); if (error) { sc->sc_uc_current = old_type; return error; @@ -4936,7 +4937,6 @@ iwm_suspend(device_t dev) static int iwm_detach_local(struct iwm_softc *sc, int do_net80211) { - struct iwm_fw_info *fw = &sc->sc_fw; device_t dev = sc->sc_dev; int i; @@ -4953,11 +4953,7 @@ iwm_detach_local(struct iwm_softc *sc, i for (i = 0; i < nitems(sc->txq); i++) iwm_free_tx_ring(sc, &sc->txq[i]); - /* Free firmware */ - if (fw->fw_fp != NULL) - iwm_fw_info_free(fw); - - /* free scheduler */ + /* Free scheduler */ iwm_free_sched(sc); if (sc->ict_dma.vaddr != NULL) iwm_free_ict(sc); From owner-svn-src-head@freebsd.org Mon Jan 4 21:11:29 2016 Return-Path: Delivered-To: svn-src-head@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 41B49A61E28; Mon, 4 Jan 2016 21:11:29 +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 EB0EC1270; Mon, 4 Jan 2016 21:11:28 +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 u04LBS4b045498; Mon, 4 Jan 2016 21:11:28 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04LBScr045497; Mon, 4 Jan 2016 21:11:28 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601042111.u04LBScr045497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 4 Jan 2016 21:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293179 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 21:11:29 -0000 Author: avos Date: Mon Jan 4 21:11:27 2016 New Revision: 293179 URL: https://svnweb.freebsd.org/changeset/base/293179 Log: iwn: reduce code duplication in iwn_read_firmware() - Separate 'firmware_put(sc->fw_fp, FIRMWARE_UNLOAD); sc->fw_fp = NULL;' into iwn_unload_firmware(). - Move error handling to the end of iwn_read_firmware(). No functional changes. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4768 Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Jan 4 21:07:08 2016 (r293178) +++ head/sys/dev/iwn/if_iwn.c Mon Jan 4 21:11:27 2016 (r293179) @@ -318,6 +318,7 @@ static int iwn_read_firmware_leg(struct static int iwn_read_firmware_tlv(struct iwn_softc *, struct iwn_fw_info *, uint16_t); static int iwn_read_firmware(struct iwn_softc *); +static void iwn_unload_firmware(struct iwn_softc *); static int iwn_clock_wait(struct iwn_softc *); static int iwn_apm_init(struct iwn_softc *); static void iwn_apm_stop_master(struct iwn_softc *); @@ -8200,9 +8201,8 @@ iwn_read_firmware(struct iwn_softc *sc) if (fw->size < sizeof (uint32_t)) { device_printf(sc->sc_dev, "%s: firmware too short: %zu bytes\n", __func__, fw->size); - firmware_put(sc->fw_fp, FIRMWARE_UNLOAD); - sc->fw_fp = NULL; - return EINVAL; + error = EINVAL; + goto fail; } /* Retrieve text and data sections. */ @@ -8214,9 +8214,7 @@ iwn_read_firmware(struct iwn_softc *sc) device_printf(sc->sc_dev, "%s: could not read firmware sections, error %d\n", __func__, error); - firmware_put(sc->fw_fp, FIRMWARE_UNLOAD); - sc->fw_fp = NULL; - return error; + goto fail; } device_printf(sc->sc_dev, "%s: ucode rev=0x%08x\n", __func__, sc->ucode_rev); @@ -8230,13 +8228,22 @@ iwn_read_firmware(struct iwn_softc *sc) (fw->boot.textsz & 3) != 0) { device_printf(sc->sc_dev, "%s: firmware sections too large\n", __func__); - firmware_put(sc->fw_fp, FIRMWARE_UNLOAD); - sc->fw_fp = NULL; - return EINVAL; + error = EINVAL; + goto fail; } /* We can proceed with loading the firmware. */ return 0; + +fail: iwn_unload_firmware(sc); + return error; +} + +static void +iwn_unload_firmware(struct iwn_softc *sc) +{ + firmware_put(sc->fw_fp, FIRMWARE_UNLOAD); + sc->fw_fp = NULL; } static int @@ -8724,8 +8731,7 @@ iwn_init_locked(struct iwn_softc *sc) /* Initialize hardware and upload firmware. */ error = iwn_hw_init(sc); - firmware_put(sc->fw_fp, FIRMWARE_UNLOAD); - sc->fw_fp = NULL; + iwn_unload_firmware(sc); if (error != 0) { device_printf(sc->sc_dev, "%s: could not initialize hardware, error %d\n", __func__, From owner-svn-src-head@freebsd.org Mon Jan 4 21:16:51 2016 Return-Path: Delivered-To: svn-src-head@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 66C10A61F3B; Mon, 4 Jan 2016 21:16:51 +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 16A7018AD; Mon, 4 Jan 2016 21:16:51 +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 u04LGo35048244; Mon, 4 Jan 2016 21:16:50 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04LGotR048242; Mon, 4 Jan 2016 21:16:50 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601042116.u04LGotR048242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 4 Jan 2016 21:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293180 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 21:16:51 -0000 Author: avos Date: Mon Jan 4 21:16:49 2016 New Revision: 293180 URL: https://svnweb.freebsd.org/changeset/base/293180 Log: urtwn: add bits for R92C_HWSEQ_CTRL and R92C_TXPAUSE registers Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4770 Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Mon Jan 4 21:11:27 2016 (r293179) +++ head/sys/dev/usb/wlan/if_urtwn.c Mon Jan 4 21:16:49 2016 (r293180) @@ -2277,7 +2277,7 @@ urtwn_newstate(struct ieee80211vap *vap, case IEEE80211_S_SCAN: /* Pause AC Tx queues. */ urtwn_write_1(sc, R92C_TXPAUSE, - urtwn_read_1(sc, R92C_TXPAUSE) | 0x0f); + urtwn_read_1(sc, R92C_TXPAUSE) | R92C_TX_QUEUE_AC); break; case IEEE80211_S_AUTH: urtwn_set_chan(sc, ic->ic_curchan, NULL); @@ -4425,7 +4425,7 @@ urtwn_lc_calib(struct urtwn_softc *sc) } } else { /* Block all Tx queues. */ - urtwn_write_1(sc, R92C_TXPAUSE, 0xff); + urtwn_write_1(sc, R92C_TXPAUSE, R92C_TX_QUEUE_ALL); } /* Start calibration. */ urtwn_rf_write(sc, 0, R92C_RF_CHNLBW, @@ -4640,7 +4640,7 @@ urtwn_init(struct urtwn_softc *sc) ieee80211_runtask(ic, &sc->cmdq_task); /* Enable hardware sequence numbering. */ - urtwn_write_1(sc, R92C_HWSEQ_CTRL, 0xff); + urtwn_write_1(sc, R92C_HWSEQ_CTRL, R92C_TX_QUEUE_ALL); /* Enable per-packet TX report. */ if (sc->chip & URTWN_CHIP_88E) { Modified: head/sys/dev/usb/wlan/if_urtwnreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnreg.h Mon Jan 4 21:11:27 2016 (r293179) +++ head/sys/dev/usb/wlan/if_urtwnreg.h Mon Jan 4 21:16:49 2016 (r293180) @@ -496,6 +496,24 @@ #define R92C_EDCA_PARAM_TXOP_M 0xffff0000 #define R92C_EDCA_PARAM_TXOP_S 16 +/* Bits for R92C_HWSEQ_CTRL / R92C_TXPAUSE. */ +#define R92C_TX_QUEUE_VO 0x01 +#define R92C_TX_QUEUE_VI 0x02 +#define R92C_TX_QUEUE_BE 0x04 +#define R92C_TX_QUEUE_BK 0x08 +#define R92C_TX_QUEUE_MGT 0x10 +#define R92C_TX_QUEUE_HIGH 0x20 +#define R92C_TX_QUEUE_BCN 0x40 + +/* Shortcuts. */ +#define R92C_TX_QUEUE_AC \ + (R92C_TX_QUEUE_VO | R92C_TX_QUEUE_VI | \ + R92C_TX_QUEUE_BE | R92C_TX_QUEUE_BK) + +#define R92C_TX_QUEUE_ALL \ + (R92C_TX_QUEUE_AC | R92C_TX_QUEUE_MGT | \ + R92C_TX_QUEUE_HIGH | R92C_TX_QUEUE_BCN | 0x80) /* XXX */ + /* Bits for R92C_BCN_CTRL. */ #define R92C_BCN_CTRL_EN_MBSSID 0x02 #define R92C_BCN_CTRL_TXBCN_RPT 0x04 From owner-svn-src-head@freebsd.org Mon Jan 4 21:41:04 2016 Return-Path: Delivered-To: svn-src-head@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 51B23A626A7; Mon, 4 Jan 2016 21:41:04 +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 0EC7F1606; Mon, 4 Jan 2016 21:41:03 +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 u04Lf3rN056301; Mon, 4 Jan 2016 21:41:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04Lf2hx056294; Mon, 4 Jan 2016 21:41:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601042141.u04Lf2hx056294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 4 Jan 2016 21:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293183 - head/contrib/llvm/projects/libunwind/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 21:41:04 -0000 Author: emaste Date: Mon Jan 4 21:41:02 2016 New Revision: 293183 URL: https://svnweb.freebsd.org/changeset/base/293183 Log: Merge LLVM libunwind revision 256779 Modified: head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp head/contrib/llvm/projects/libunwind/src/DwarfParser.hpp head/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S head/contrib/llvm/projects/libunwind/src/config.h head/contrib/llvm/projects/libunwind/src/libunwind.cpp Modified: head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp ============================================================================== --- head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp Mon Jan 4 21:31:59 2016 (r293182) +++ head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp Mon Jan 4 21:41:02 2016 (r293183) @@ -35,7 +35,11 @@ namespace libunwind { #include "Registers.hpp" #if _LIBUNWIND_ARM_EHABI -#ifdef __linux__ +#if defined(__FreeBSD__) + +typedef void *_Unwind_Ptr; + +#elif defined(__linux__) typedef long unsigned int *_Unwind_Ptr; extern "C" _Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr addr, int *len); Modified: head/contrib/llvm/projects/libunwind/src/DwarfParser.hpp ============================================================================== --- head/contrib/llvm/projects/libunwind/src/DwarfParser.hpp Mon Jan 4 21:31:59 2016 (r293182) +++ head/contrib/llvm/projects/libunwind/src/DwarfParser.hpp Mon Jan 4 21:41:02 2016 (r293183) @@ -380,7 +380,9 @@ bool CFI_Parser::parseInstructions(A uint64_t length; uint8_t opcode = addressSpace.get8(p); uint8_t operand; +#if !defined(_LIBUNWIND_NO_HEAP) PrologInfoStackEntry *entry; +#endif ++p; switch (opcode) { case DW_CFA_nop: @@ -492,6 +494,7 @@ bool CFI_Parser::parseInstructions(A fprintf(stderr, "DW_CFA_register(reg=%" PRIu64 ", reg2=%" PRIu64 ")\n", reg, reg2); break; +#if !defined(_LIBUNWIND_NO_HEAP) case DW_CFA_remember_state: // avoid operator new, because that would be an upward dependency entry = (PrologInfoStackEntry *)malloc(sizeof(PrologInfoStackEntry)); @@ -517,6 +520,7 @@ bool CFI_Parser::parseInstructions(A if (logDwarf) fprintf(stderr, "DW_CFA_restore_state\n"); break; +#endif case DW_CFA_def_cfa: reg = addressSpace.getULEB128(p, instructionsEnd); offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd); Modified: head/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp ============================================================================== --- head/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp Mon Jan 4 21:31:59 2016 (r293182) +++ head/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp Mon Jan 4 21:41:02 2016 (r293183) @@ -114,6 +114,7 @@ typename A::pint_t DwarfFDECache::fin template void DwarfFDECache::add(pint_t mh, pint_t ip_start, pint_t ip_end, pint_t fde) { +#if !defined(_LIBUNWIND_NO_HEAP) _LIBUNWIND_LOG_NON_ZERO(::pthread_rwlock_wrlock(&_lock)); if (_bufferUsed >= _bufferEnd) { size_t oldSize = (size_t)(_bufferEnd - _buffer); @@ -139,6 +140,7 @@ void DwarfFDECache::add(pint_t mh, pi } #endif _LIBUNWIND_LOG_NON_ZERO(::pthread_rwlock_unlock(&_lock)); +#endif } template Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S ============================================================================== --- head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Mon Jan 4 21:31:59 2016 (r293182) +++ head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Mon Jan 4 21:41:02 2016 (r293183) @@ -87,6 +87,15 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext xorl %eax, %eax # return UNW_ESUCCESS ret +# elif defined(__mips__) + +# +# extern int unw_getcontext(unw_context_t* thread_state) +# +# Just trap for the time being. +DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) + teq $0, $0 + #elif defined(__ppc__) ; Modified: head/contrib/llvm/projects/libunwind/src/config.h ============================================================================== --- head/contrib/llvm/projects/libunwind/src/config.h Mon Jan 4 21:31:59 2016 (r293182) +++ head/contrib/llvm/projects/libunwind/src/config.h Mon Jan 4 21:41:02 2016 (r293183) @@ -41,7 +41,8 @@ #define _LIBUNWIND_BUILD_ZERO_COST_APIS (defined(__i386__) || \ defined(__x86_64__) || \ - defined(__arm64__)) + defined(__arm64__) || \ + defined(__mips__)) #define _LIBUNWIND_BUILD_SJLJ_APIS defined(__arm__) #define _LIBUNWIND_SUPPORT_FRAME_APIS (defined(__i386__) || \ defined(__x86_64__)) Modified: head/contrib/llvm/projects/libunwind/src/libunwind.cpp ============================================================================== --- head/contrib/llvm/projects/libunwind/src/libunwind.cpp Mon Jan 4 21:31:59 2016 (r293182) +++ head/contrib/llvm/projects/libunwind/src/libunwind.cpp Mon Jan 4 21:41:02 2016 (r293183) @@ -64,6 +64,8 @@ _LIBUNWIND_EXPORT int unw_init_local(unw #elif defined(__or1k__) new ((void *)cursor) UnwindCursor( context, LocalAddressSpace::sThisAddressSpace); +#elif defined(__mips__) +#warning The MIPS architecture is not supported. #else #error Architecture not supported #endif From owner-svn-src-head@freebsd.org Mon Jan 4 22:45:51 2016 Return-Path: Delivered-To: svn-src-head@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 71150A61ABB; Mon, 4 Jan 2016 22:45:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lb0-x241.google.com (mail-lb0-x241.google.com [IPv6:2a00:1450:4010:c04::241]) (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 E9DA51811; Mon, 4 Jan 2016 22:45:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lb0-x241.google.com with SMTP id bc4so10017277lbc.0; Mon, 04 Jan 2016 14:45:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=MVMc3TkZz0Ls/AnfSP4cLaaPBGvW07/3q8qeSA8oUB0=; b=vHW4cJcvk8LvkxtZMO4gVc2OWDbPv//VKv+scGCk2x8d4iA9lcwN6EQM8Mbc9dPXi5 hV/NeCwMm9v53ndT+/1H9u95JNEnsGPOLwnZs09+3fvK1uduCGuxQeXMAxRelGPa0NW6 SzCgbuIZatgrsGw5fBnfNT77liNvv/WLoLrud5IClXL7ZXrA2noySJ2uQvb94owTlHpK l/BTAN181UjbCpW86ovqeIgi5LA3XF3I4RmIaWt3E3cKR0Hq29FiSM/yX83y6eUCdtC/ Mt65Bw66owurzjKfYaPPqIfD3yMhL2u9dIwonZYGGCXreG7ga8FuqhEk05cccHn9C6xl 1YYA== MIME-Version: 1.0 X-Received: by 10.112.97.176 with SMTP id eb16mr32893730lbb.138.1451947549052; Mon, 04 Jan 2016 14:45:49 -0800 (PST) Received: by 10.112.160.133 with HTTP; Mon, 4 Jan 2016 14:45:49 -0800 (PST) In-Reply-To: <1740114.0GzEsp8E6P@ralph.baldwin.cx> References: <201601031809.u03I9lNJ091471@repo.freebsd.org> <1740114.0GzEsp8E6P@ralph.baldwin.cx> Date: Mon, 4 Jan 2016 14:45:49 -0800 Message-ID: Subject: Re: svn commit: r293112 - head/sys/dev/ixl From: NGie Cooper To: John Baldwin Cc: Garrett Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 22:45:51 -0000 On Sun, Jan 3, 2016 at 2:23 PM, John Baldwin wrote: ... > FWIW, it is probably simpler to do something like this in an ixl header instead: > > #if __FreeBSD_version <= 1100022 > #define if_getdrvflags(ifp) (ifp)->if_drv_flags > #endif > > In the past when the Intel drivers have used compat shims they have preferred this > method (defining compat macros for "new" APIs on old OS versions) instead of using > #ifdef's in the code itself. You're right. What I did was incredibly ugly and only fixes one potential instance (of which more might appear later).. I'll send out a CR moving the definition to a header file and commit the change. Thanks! -NGie From owner-svn-src-head@freebsd.org Mon Jan 4 23:36:13 2016 Return-Path: Delivered-To: svn-src-head@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 31955A62A8D for ; Mon, 4 Jan 2016 23:36:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x235.google.com (mail-qg0-x235.google.com [IPv6:2607:f8b0:400d:c04::235]) (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 DEF721F69 for ; Mon, 4 Jan 2016 23:36:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x235.google.com with SMTP id 6so188413512qgy.1 for ; Mon, 04 Jan 2016 15:36:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=dr7JrpOzA8jLNFQd2f1cGOT/uhElsv6CWf0JRMKgBY0=; b=JBu+9ZKinE3Q4f2ImC/zJDHYsM3+E7Czrla/8RCb/FhdrFz4Dffz6nj2yZnhRtblHK FpgVLaSD13YvzSg+UqFVCY5weFhN0O2od4IcQvadGbybRc2z9ycR9URQ9yWYzyqGzCaf mRC8v0wFLlQ/UhiEnnwns72E3lIsINsT3g5j+lGPPUKM2FHU0s4ZUOiHqRboWdPVKa6R BlAhe7n0qWjeWkrIncZ9to5Vnf6dw9QZW6zlUXCD/kPJlTFYcZqg5egYeH91xVji4fUu kUaepEAxfCT42nMrsTWn/476U7g4Gt5LT5bCpzqFtifrUPWHZNz1zdpNsgyL8Juqtu50 e9CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=dr7JrpOzA8jLNFQd2f1cGOT/uhElsv6CWf0JRMKgBY0=; b=Fe4E5oxH4kipcLZnWMnP1wem5i5DosluwbSORrffCX4SA1kgVRmvCQZ/9uqKxt/VzT +dbTxSWjFcYVj85PvwL/EvFtmrStQDvIqBQyQeoo/7EchA4c8JvgUwkyq3R+UK05Tu4z Bx78Hpq8+nP3tuP7EKBUiC0AIlYLe9x+MWh3gJwQYV3I9KYqzNzPQYBszFS+qnSPGO4k jCu0hU+/q2OOlCs7M8iVwgwCFaXeFQCqtpxGPGcr4zns0TYt0AU3YmcATcMz2ZuujyPQ 1TpXq5X/J9EFM3C4+RLfr+On1lpENs9DexI5ONeOeQuXyVxffpOv9n8BW8YVLHGcr6Bi h3Yw== X-Gm-Message-State: ALoCoQldIE34KKiTNDW8WwSFt5NVzlw5t6E/s4vMhuh+SdR8SEtifPjPsFawLyDx+jM9KOlGGByBOO6fKIqWyjXiejkawRhyLQ== MIME-Version: 1.0 X-Received: by 10.140.250.70 with SMTP id v67mr127292793qhc.43.1451950571943; Mon, 04 Jan 2016 15:36:11 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 4 Jan 2016 15:36:11 -0800 (PST) X-Originating-IP: [2601:280:4900:3700:a51c:df79:65a:a353] In-Reply-To: <1451429489.1369.35.camel@freebsd.org> References: <201512272304.tBRN4C5D034464@repo.freebsd.org> <41508412.yspAtSoPCD@ralph.baldwin.cx> <2345870.SHMMVrpc1D@ralph.baldwin.cx> <1451429489.1369.35.camel@freebsd.org> Date: Mon, 4 Jan 2016 16:36:11 -0700 X-Google-Sender-Auth: xICLtk_G3QOMjn6Sk6XKvmpTm_Y Message-ID: Subject: Re: svn commit: r292809 - head/lib/libc/stdio From: Warner Losh To: Ian Lepore Cc: John Baldwin , src-committers , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Warner Losh Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 23:36:13 -0000 Be my guest to implement these things. I don't think it matters much, and adds a lot of complexity to avoid a single roundup call. And if we have more-strict alignment for glue than ALIGNBYTES, we're already doomed. We don't do that today. Warner On Tue, Dec 29, 2015 at 3:51 PM, Ian Lepore wrote: > On Tue, 2015-12-29 at 11:37 -0800, John Baldwin wrote: > > On Monday, December 28, 2015 01:01:26 PM Warner Losh wrote: > > > I'll look at that, but I don't think posix_memalign is the right > > > way to go. > > > The alignment of FILE is more strict than posix_memalign will > > > return. Ian's > > > idea of __alignof__ is the way to go. We allocate them in one block > > > on > > > purpose for performance, and posix_memalign would be a one at a > > > time affair. > > > > posix_memalign gives you whatever alignment you ask for. Using > > __alignof__ > > to determine the alignment instead of hardcoding sizeof(int64_t) > > would > > certainly be an improvement. If you move the glue after the FILE > > objects > > then you can use posix_memalign() directly as so: > > > > void *mem; > > int error; > > > > error = posix_memalign(&mem, MAX(ALIGNBYTES, > > __alignof__(mbstate_t)), > > n * sizeof(FILE) + sizeof(*g)); > > if (error) > > return (NULL); > > p = (FILE *)mem; > > g = (struct glue *)(p + n); > > g->next = NULL; > > g->niobs = n; > > g->iobs = p; > > ... > > > > (This presumes that the requested alignment of 'struct glue' is less > > than > > the alignment needed by FILE which should be true.) > > > > If there's going to be an assumption that __alignof__(glue) <= > __alignof__(FILE), it might be nice to have a static_assert() of that > to prevent a future time bomb similar to the one that exploded on arm > when it turned out the opposite assumption was wrong. > > -- Ian > > From owner-svn-src-head@freebsd.org Mon Jan 4 23:49:20 2016 Return-Path: Delivered-To: svn-src-head@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 86E0FA62E08 for ; Mon, 4 Jan 2016 23:49:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x22f.google.com (mail-qg0-x22f.google.com [IPv6:2607:f8b0:400d:c04::22f]) (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 3EE5E1580 for ; Mon, 4 Jan 2016 23:49:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x22f.google.com with SMTP id b35so136987374qge.0 for ; Mon, 04 Jan 2016 15:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=IlOSlfinkiemEf2IasfuFXgbT4P5YC0pF1GSOIuTUMM=; b=HwpuXVxtjcjhuwZwOR//Ipzykg/CmOSbJnwE28JIRmTW2Xoi6Ed7uXB0G/eRoO/TW6 +a6IL6ezGBiQqbxXxzO79ESGq73QUs2bsJImRBCb/wiIHW8nPYIiDZRfPBLf10rl4cK7 CL8iXghOeGObycHJWF/ArN5qeYhzBIf5UOLUSskglWYmF1LPdeY+7DruY/MNoC+fzbNx sxMaBF0Ok0uQf2F+XmLEAzm1v8Jf0VJWjk/j5lNsmLltJvxX3ZpUyCEAoAsPSTfibfHe GCSqbJTTXWsglNUBBk1wEIGdGsX8AjoZ8d1yQpay1SOU3qiFVz+DkTVRv4qV7UO+YPo8 jpIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=IlOSlfinkiemEf2IasfuFXgbT4P5YC0pF1GSOIuTUMM=; b=Y3J1tQVm6/1mqjaZjVGBhWjVHgG41gJgxYbuX3GXDF0dHnuRjzb1q0AqI6lpcbgMuk 7aGB4DNQaJMGTDL8ee2MZ6p2xP/74YTXGi9vuTL/Kv1P30VuR4BMCXKIkNPXUnns3Wvh XjVU60BV6hTh1SMqXap/DVbBtHPLFN80VYp8Auzk16lln6Ugk6nSm6wn33vTBPWNCINv jUAJPHL0ooTDIcwl3Hb+6YTHu8PrE5VyRWCa7gjFWtnTbAAzzDoap/mxIapMiZC+LLXs uyvOMFI0BezBO2HL5k3CIPOMHZSb4p1FLroO+9Muyp+lJ2ZSJN/hRuwdMz0bM2cqngTr nKzg== X-Gm-Message-State: ALoCoQn066/sgmey9aGEKwX8/Hd55nSINU7w6GTmOdK3f5TNPRB0Zd57dmwZXMoM6aA8zq1aoiP1yR+RrV/bN6E7hdwqgpGlDQ== MIME-Version: 1.0 X-Received: by 10.140.29.131 with SMTP id b3mr117291688qgb.50.1451951359360; Mon, 04 Jan 2016 15:49:19 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 4 Jan 2016 15:49:19 -0800 (PST) X-Originating-IP: [2601:280:4900:3700:a51c:df79:65a:a353] In-Reply-To: <1777356.pH0Cpe84Od@ralph.baldwin.cx> References: <201512191901.tBJJ1hEP013786@repo.freebsd.org> <1777356.pH0Cpe84Od@ralph.baldwin.cx> Date: Mon, 4 Jan 2016 16:49:19 -0700 X-Google-Sender-Auth: 89I1P63UPnRdn7SxxwrVH5obVKY Message-ID: Subject: Re: svn commit: r292472 - in head/sys: amd64/amd64 sys From: Warner Losh To: John Baldwin Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 23:49:20 -0000 On Mon, Dec 21, 2015 at 1:38 PM, John Baldwin wrote: > On Saturday, December 19, 2015 07:01:43 PM Warner Losh wrote: > > Author: imp > > Date: Sat Dec 19 19:01:43 2015 > > New Revision: 292472 > > URL: https://svnweb.freebsd.org/changeset/base/292472 > > > > Log: > > Save the physical address passed into the kernel of the UEFI system > > table. > > > > Modified: > > head/sys/amd64/amd64/machdep.c > > head/sys/sys/efi.h > > > > Modified: head/sys/amd64/amd64/machdep.c > > > ============================================================================== > > --- head/sys/amd64/amd64/machdep.c Sat Dec 19 19:01:42 2015 > (r292471) > > +++ head/sys/amd64/amd64/machdep.c Sat Dec 19 19:01:43 2015 > (r292472) > > @@ -1615,6 +1622,8 @@ hammer_time(u_int64_t modulep, u_int64_t > > /* > > * Use vt(4) by default for UEFI boot (during the sc(4)/vt(4) > > * transition). > > + * Once bootblocks have updated, we can test directly for > > + * efi_systbl != NULL here... > > */ > > if (preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP) > > != NULL) > > This part doesn't seem worth changing since the EFI map is always going to > be > there and works for both old and new loaders? > Just a simpler test. This code suffers from too much complexity, but maybe compat will keep us from doing this for a long time. Warner From owner-svn-src-head@freebsd.org Tue Jan 5 00:05:37 2016 Return-Path: Delivered-To: svn-src-head@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 2596FA616EA for ; Tue, 5 Jan 2016 00:05:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x22d.google.com (mail-qg0-x22d.google.com [IPv6:2607:f8b0:400d:c04::22d]) (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 D38061F36 for ; Tue, 5 Jan 2016 00:05:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x22d.google.com with SMTP id b35so137225261qge.0 for ; Mon, 04 Jan 2016 16:05:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=kFw5no4yElKFsgkb4J0kIidb0S1eS6xl5dBTyMYPcLA=; b=1D7g65y94JQyVniU33N7rWYTolbUoD7cNJty4m1N7o2htyd9Td5WGQ4u0wFyW4yERN ZP4bV9KdbiOYjGN1siHhcl8J/VFt97GpciulB5C1NV7KFjDClnyXi3+F9KO5BGvzS/tS 0Ct7PNVg8sC6vpGNFbT/AtvYYffy89Ms1J0j7B6gJZPSkIV2iVSkN3tRcmlCSrz7WoCV F4+K8Nq6J1Cc9hu2HuedtNbFOjCYNCZSHC+CWZxYajeKVzu18JS5cvm/wCoVzmBkC8tP afJ+9ADw/booR+wXQD6+hwmb7v4W8GJqA+ZtI5zNamR72R9e7WxA123MZNG106epH42n RFrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=kFw5no4yElKFsgkb4J0kIidb0S1eS6xl5dBTyMYPcLA=; b=foqwa046uAlcap9s3P5ARToWe7l42ndf8crpSZTZCuH0Zx0wdkYL2s2qhGGLXfCsYe XsqrulC7MBCCtSUOtQr0sArOT8BX4sKzaig2UZigyC+f7w+xDPYeMDvW0TUSVd9Ob4u7 MFpot6wq/NtfpoiR3BFdzqZDK+nPpb1PcOuHVNzFUzr/6/xdTuydihD9zkcOpVdhecDO P/kDfmm1fyPbAju8w+P5wo5zx8pxMWNih6z4mcmFHkCPZcVgB20JUGG9/+JTy1uBZo+N d1qF5CJ/4IfVfZ5QOithIw/XIqH8ap3Z4qd+HtbEpWUwUIMt5daTFYaiDgOwDy3TNI+t ROKA== X-Gm-Message-State: ALoCoQkvhwntltJe/aGyqvwjj7+sAx00bUk+xYLM45hc9PIb9iuES0UXtHY95jKrTDSFcskvnFIcxsrx+bLrmPMc1ijPIjp4ug== MIME-Version: 1.0 X-Received: by 10.140.93.77 with SMTP id c71mr84261207qge.46.1451952336006; Mon, 04 Jan 2016 16:05:36 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 4 Jan 2016 16:05:35 -0800 (PST) X-Originating-IP: [2601:280:4900:3700:a51c:df79:65a:a353] In-Reply-To: <1450903312.25138.212.camel@freebsd.org> References: <201512230649.tBN6nJsJ023270@repo.freebsd.org> <1450903312.25138.212.camel@freebsd.org> Date: Mon, 4 Jan 2016 17:05:35 -0700 X-Google-Sender-Auth: RLalXls_HtbT6W_hVUg5TE4PRdg Message-ID: Subject: Re: svn commit: r292644 - head/tools/tools/nanobsd/embedded From: Warner Losh To: Ian Lepore Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 00:05:37 -0000 Thanks Ian. I'll adjust. The dtb files don't hurt anything, and it would be extra config to have some platforms do it and not others (something I'm trying to avoid). I'll document it for later. However, if there's no point to the uenv file, that's easy to just remove. Warner On Wed, Dec 23, 2015 at 1:41 PM, Ian Lepore wrote: > On Wed, 2015-12-23 at 06:49 +0000, Warner Losh wrote: > > Author: imp > > Date: Wed Dec 23 06:49:18 2015 > > New Revision: 292644 > > URL: https://svnweb.freebsd.org/changeset/base/292644 > > > > Log: > > Copy all the dtb files that we build as part of the kernel build > > from > > boot/dtb to the fat partition. They seem to be needed. > > Create an empty uEnv.txt file > > Of all the arm platforms we support, only RPi and RPi2 require the dtb > files to be in the fat partition. > > The only advantage to an empty uEnv.txt file is that it will suppress a > warning about not being able to read it. There's no way to suppress a > similar warning about a bad saved-environment checksum that u-boot > emits if you've never changed anything and done a saveenv. > > -- Ian > > From owner-svn-src-head@freebsd.org Tue Jan 5 01:32:41 2016 Return-Path: Delivered-To: svn-src-head@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 4A72FA61058; Tue, 5 Jan 2016 01:32:41 +0000 (UTC) (envelope-from np@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 1C0941199; Tue, 5 Jan 2016 01:32:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u051WeCL022721; Tue, 5 Jan 2016 01:32:40 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u051Wequ022720; Tue, 5 Jan 2016 01:32:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201601050132.u051Wequ022720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 5 Jan 2016 01:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293185 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 01:32:41 -0000 Author: np Date: Tue Jan 5 01:32:40 2016 New Revision: 293185 URL: https://svnweb.freebsd.org/changeset/base/293185 Log: iw_cxgbe: Shut down the socket but do not close the fd in case of error. The fd is closed later in this case. This fixes a "SS_NOFDREF on enter" panic. Submitted by: Krishnamraju Eraparaju @ Chelsio Reviewed by: Steve Wise @ Open Grid Computing Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Jan 4 22:32:37 2016 (r293184) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Tue Jan 5 01:32:40 2016 (r293185) @@ -474,7 +474,7 @@ process_conn_error(struct c4iw_ep *ep) if (state != ABORTING) { CTR2(KTR_IW_CXGBE, "%s:pce1 %p", __func__, ep); - close_socket(&ep->com, 1); + close_socket(&ep->com, 0); state_set(&ep->com, DEAD); c4iw_put_ep(&ep->com); } From owner-svn-src-head@freebsd.org Tue Jan 5 01:58:32 2016 Return-Path: Delivered-To: svn-src-head@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 13A9DA6172C; Tue, 5 Jan 2016 01:58:32 +0000 (UTC) (envelope-from np@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 D94FC1DF0; Tue, 5 Jan 2016 01:58:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u051wUTr029073; Tue, 5 Jan 2016 01:58:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u051wULh029072; Tue, 5 Jan 2016 01:58:30 GMT (envelope-from np@FreeBSD.org) Message-Id: <201601050158.u051wULh029072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 5 Jan 2016 01:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293186 - head/sys/contrib/rdma/krping X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 01:58:32 -0000 Author: np Date: Tue Jan 5 01:58:30 2016 New Revision: 293186 URL: https://svnweb.freebsd.org/changeset/base/293186 Log: Have krping use IB_ACCESS_LOCAL_WRITE because it's required for remote write or remote atomic operations. Submitted by: Krishnamraju Eraparaju @ Chelsio Modified: head/sys/contrib/rdma/krping/krping.c Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Tue Jan 5 01:32:40 2016 (r293185) +++ head/sys/contrib/rdma/krping/krping.c Tue Jan 5 01:58:30 2016 (r293186) @@ -640,6 +640,7 @@ static int krping_setup_buffers(struct k buf.size = cb->size; iovbase = cb->rdma_dma_addr; cb->rdma_mr = ib_reg_phys_mr(cb->pd, &buf, 1, + IB_ACCESS_LOCAL_WRITE| IB_ACCESS_REMOTE_READ| IB_ACCESS_REMOTE_WRITE, &iovbase); @@ -675,8 +676,10 @@ static int krping_setup_buffers(struct k if (cb->mem == MR || cb->mem == MW) { unsigned flags = IB_ACCESS_REMOTE_READ; - if (cb->wlat || cb->rlat || cb->bw) - flags |= IB_ACCESS_REMOTE_WRITE; + if (cb->wlat || cb->rlat || cb->bw) { + flags |= IB_ACCESS_LOCAL_WRITE | + IB_ACCESS_REMOTE_WRITE; + } buf.addr = cb->start_dma_addr; buf.size = cb->size; From owner-svn-src-head@freebsd.org Tue Jan 5 02:21:58 2016 Return-Path: Delivered-To: svn-src-head@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 B3E34A61F22; Tue, 5 Jan 2016 02:21:58 +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 8599C1A65; Tue, 5 Jan 2016 02:21:58 +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 u052LvXk037608; Tue, 5 Jan 2016 02:21:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u052LvpV037607; Tue, 5 Jan 2016 02:21:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601050221.u052LvpV037607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 5 Jan 2016 02:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293187 - head/libexec/rtld-elf/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 02:21:58 -0000 Author: emaste Date: Tue Jan 5 02:21:57 2016 New Revision: 293187 URL: https://svnweb.freebsd.org/changeset/base/293187 Log: rtld: wrap a comment to 80 columns Modified: head/libexec/rtld-elf/amd64/reloc.c Modified: head/libexec/rtld-elf/amd64/reloc.c ============================================================================== --- head/libexec/rtld-elf/amd64/reloc.c Tue Jan 5 01:58:30 2016 (r293186) +++ head/libexec/rtld-elf/amd64/reloc.c Tue Jan 5 02:21:57 2016 (r293187) @@ -228,8 +228,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry /* * These are deferred until all other relocations have * been done. All we do here is make sure that the COPY - * relocation is not in a shared library. They are allowed - * only in executable files. + * relocation is not in a shared library. They are + * allowed only in executable files. */ if (!obj->mainprog) { _rtld_error("%s: Unexpected R_X86_64_COPY " From owner-svn-src-head@freebsd.org Tue Jan 5 03:20:47 2016 Return-Path: Delivered-To: svn-src-head@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 80499A62E94; Tue, 5 Jan 2016 03:20:47 +0000 (UTC) (envelope-from gjb@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 5A0EA12B9; Tue, 5 Jan 2016 03:20:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u053Kkmk052596; Tue, 5 Jan 2016 03:20:46 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u053KkrA052592; Tue, 5 Jan 2016 03:20:46 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201601050320.u053KkrA052592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 Jan 2016 03:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293188 - in head/release: amd64 arm64 i386 powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 03:20:47 -0000 Author: gjb Date: Tue Jan 5 03:20:45 2016 New Revision: 293188 URL: https://svnweb.freebsd.org/changeset/base/293188 Log: Prevent memstick installation medium from attempting to mount the root filesystem read-write. This causes problems booting the memstick installation medium from write-protected USB flash drives. Submitted by: A.J. Kehoe IV [1], Oliver Jones [2] PR: 187161 [1], 205886 [2] MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/release/amd64/make-memstick.sh head/release/arm64/make-memstick.sh head/release/i386/make-memstick.sh head/release/powerpc/make-memstick.sh Modified: head/release/amd64/make-memstick.sh ============================================================================== --- head/release/amd64/make-memstick.sh Tue Jan 5 02:21:57 2016 (r293187) +++ head/release/amd64/make-memstick.sh Tue Jan 5 03:20:45 2016 (r293188) @@ -29,12 +29,14 @@ if [ -e ${2} ]; then fi echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab +echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local makefs -B little -o label=FreeBSD_Install ${2}.part ${1} if [ $? -ne 0 ]; then echo "makefs failed" exit 1 fi rm ${1}/etc/fstab +rm ${1}/etc/rc.conf.local mkimg -s gpt -b ${1}/boot/pmbr -p efi:=${1}/boot/boot1.efifat -p freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2} rm ${2}.part Modified: head/release/arm64/make-memstick.sh ============================================================================== --- head/release/arm64/make-memstick.sh Tue Jan 5 02:21:57 2016 (r293187) +++ head/release/arm64/make-memstick.sh Tue Jan 5 03:20:45 2016 (r293188) @@ -29,12 +29,14 @@ if [ -e ${2} ]; then fi echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab +echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local makefs -B little -o label=FreeBSD_Install ${2}.part ${1} if [ $? -ne 0 ]; then echo "makefs failed" exit 1 fi rm ${1}/etc/fstab +rm ${1}/etc/rc.conf.local mkimg -s mbr -p efi:=${1}/boot/boot1.efifat -p freebsd:=${2}.part -o ${2} rm ${2}.part Modified: head/release/i386/make-memstick.sh ============================================================================== --- head/release/i386/make-memstick.sh Tue Jan 5 02:21:57 2016 (r293187) +++ head/release/i386/make-memstick.sh Tue Jan 5 03:20:45 2016 (r293188) @@ -29,12 +29,14 @@ if [ -e ${2} ]; then fi echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab +echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local makefs -B little -o label=FreeBSD_Install ${2}.part ${1} if [ $? -ne 0 ]; then echo "makefs failed" exit 1 fi rm ${1}/etc/fstab +rm ${1}/etc/rc.conf.local mkimg -s gpt -b ${1}/boot/pmbr -p freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2} rm ${2}.part Modified: head/release/powerpc/make-memstick.sh ============================================================================== --- head/release/powerpc/make-memstick.sh Tue Jan 5 02:21:57 2016 (r293187) +++ head/release/powerpc/make-memstick.sh Tue Jan 5 03:20:45 2016 (r293188) @@ -33,6 +33,7 @@ if [ -e ${2} ]; then fi echo '/dev/da0s3 / ufs ro,noatime 1 1' > ${1}/etc/fstab +echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local rm -f ${tempfile} makefs -B big ${tempfile} ${1} if [ $? -ne 0 ]; then @@ -40,6 +41,7 @@ if [ $? -ne 0 ]; then exit 1 fi rm ${1}/etc/fstab +rm ${1}/etc/rc.conf.local mkimg -s apm -p freebsd-boot:=${1}/boot/boot1.hfs -p freebsd-ufs/FreeBSD_Install:=${tempfile} -o ${2} From owner-svn-src-head@freebsd.org Tue Jan 5 05:25:18 2016 Return-Path: Delivered-To: svn-src-head@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 92DD6A61CF4; Tue, 5 Jan 2016 05:25:18 +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 2C6D91E92; Tue, 5 Jan 2016 05:25:18 +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 u055PHRh090294; Tue, 5 Jan 2016 05:25:17 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u055PGY8090283; Tue, 5 Jan 2016 05:25:16 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601050525.u055PGY8090283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 5 Jan 2016 05:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293190 - in head: contrib/less usr.bin/less X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 05:25:18 -0000 Author: delphij Date: Tue Jan 5 05:25:16 2016 New Revision: 293190 URL: https://svnweb.freebsd.org/changeset/base/293190 Log: MFV r293125: less v481. MFC after: 1 month Relnotes: yes Added: head/contrib/less/compose.uni - copied unchanged from r293126, vendor/less/dist/compose.uni head/contrib/less/mkutable - copied unchanged from r293126, vendor/less/dist/mkutable head/contrib/less/ubin.uni - copied unchanged from r293126, vendor/less/dist/ubin.uni head/contrib/less/wide.uni - copied unchanged from r293126, vendor/less/dist/wide.uni Modified: head/contrib/less/LICENSE head/contrib/less/NEWS head/contrib/less/README head/contrib/less/brac.c head/contrib/less/ch.c head/contrib/less/charset.c head/contrib/less/charset.h head/contrib/less/cmd.h head/contrib/less/cmdbuf.c head/contrib/less/command.c head/contrib/less/cvt.c head/contrib/less/decode.c head/contrib/less/edit.c head/contrib/less/filename.c head/contrib/less/forwback.c head/contrib/less/funcs.h head/contrib/less/help.c head/contrib/less/ifile.c head/contrib/less/input.c head/contrib/less/jump.c head/contrib/less/less.h head/contrib/less/less.hlp head/contrib/less/less.nro head/contrib/less/lessecho.c head/contrib/less/lessecho.nro head/contrib/less/lesskey.c head/contrib/less/lesskey.h head/contrib/less/lesskey.nro head/contrib/less/lglob.h head/contrib/less/line.c head/contrib/less/linenum.c head/contrib/less/lsystem.c head/contrib/less/main.c head/contrib/less/mark.c head/contrib/less/mkhelp.c head/contrib/less/optfunc.c head/contrib/less/option.c head/contrib/less/option.h head/contrib/less/opttbl.c head/contrib/less/os.c head/contrib/less/output.c head/contrib/less/pattern.c head/contrib/less/pattern.h head/contrib/less/pckeys.h head/contrib/less/position.c head/contrib/less/position.h head/contrib/less/prompt.c head/contrib/less/regexp.c head/contrib/less/screen.c head/contrib/less/scrsize.c head/contrib/less/search.c head/contrib/less/signal.c head/contrib/less/tags.c head/contrib/less/ttyin.c head/contrib/less/version.c head/usr.bin/less/defines.h Directory Properties: head/contrib/less/ (props changed) Modified: head/contrib/less/LICENSE ============================================================================== --- head/contrib/less/LICENSE Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/LICENSE Tue Jan 5 05:25:16 2016 (r293190) @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2012 Mark Nudelman +Copyright (C) 1984-2015 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: head/contrib/less/NEWS ============================================================================== --- head/contrib/less/NEWS Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/NEWS Tue Jan 5 05:25:16 2016 (r293190) @@ -7,7 +7,44 @@ http://www.greenwoodsoftware.com/less You can also download the latest version of less from there. - To report bugs, suggestions or comments, send email to bug-less@gnu.org. + To report bugs, suggestions or comments, send email to bug-less@gnu.org + +====================================================================== + + Major changes between "less" versions 458 and 481 + +* Don't overwrite history file; just append to it. + +* New command ESC-G goes to end of currently buffered data in a pipe. + +* Disable history feature when compiled with LESSHISTFILE set to "-". + +* In more-compatible mode, make the -p option apply to every file opened, + not just the first one. + +* In more-compatible mode, change the -e option to work like -E, not -EF. + +* Treat multiple CRs before LF are like one CR (all the CRs are hidden). + +* Allow "extra" string in lesskey file to append to a multi-char command + (like a search pattern), without executing the command. + +* Ignore -u/-U setting while viewing help file, so that + underline and bold chars are displayed correctly. + +* Improve detection of "binary" files in UTF-8 mode. + +* Fix bug with ++ commands. + +* Fix bug where prompt was sometimes not displayed with +G. + +* Fix possible memory corruption + +* Fix bugs and improve performance in ampersand filtering. + +* Automate construction of Unicode tables from Unicode database. + +* Allow %% escape sequence in LESSOPEN variable. ====================================================================== Modified: head/contrib/less/README ============================================================================== --- head/contrib/less/README Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/README Tue Jan 5 05:25:16 2016 (r293190) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 458 + Less, version 481 - This is the distribution of less, version 458, released 04 Apr 2013. + This is the distribution of less, version 481, released 31 Aug 2015. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -53,8 +53,9 @@ INSTALLATION (Unix systems only): Specifies the regular expression library used by less for pattern matching. The default is "auto", which means the configure program finds a regular expression library automatically. Other values are: - posix Use the POSIX-compatible regcomp. + gnu Use the GNU regex library. pcre Use the PCRE library. + posix Use the POSIX-compatible regcomp. regcmp Use the regcmp library. re_comp Use the re_comp library. regcomp Use the V8-compatible regcomp. Modified: head/contrib/less/brac.c ============================================================================== --- head/contrib/less/brac.c Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/brac.c Tue Jan 5 05:25:16 2016 (r293190) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/ch.c ============================================================================== --- head/contrib/less/ch.c Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/ch.c Tue Jan 5 05:25:16 2016 (r293190) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -54,7 +54,7 @@ struct buf { * The file state is maintained in a filestate structure. * A pointer to the filestate is kept in the ifile structure. */ -#define BUFHASH_SIZE 64 +#define BUFHASH_SIZE 1024 struct filestate { struct bufnode buflist; struct bufnode hashtbl[BUFHASH_SIZE]; @@ -323,13 +323,16 @@ ch_get() #if HAVE_STAT_INO if (follow_mode == FOLLOW_NAME) { - /* See whether the file's i-number has changed. + /* See whether the file's i-number has changed, + * or the file has shrunk. * If so, force the file to be closed and * reopened. */ struct stat st; + POSITION curr_pos = ch_tell(); int r = stat(get_filename(curr_ifile), &st); if (r == 0 && (st.st_ino != curr_ino || - st.st_dev != curr_dev)) + st.st_dev != curr_dev || + (curr_pos != NULL_POSITION && st.st_size < curr_pos))) { /* screen_trashed=2 causes * make_display to reopen the file. */ @@ -536,6 +539,32 @@ ch_end_seek() } /* + * Seek to the last position in the file that is currently buffered. + */ + public int +ch_end_buffer_seek() +{ + register struct buf *bp; + register struct bufnode *bn; + POSITION buf_pos; + POSITION end_pos; + + if (thisfile == NULL || (ch_flags & CH_CANSEEK)) + return (ch_end_seek()); + + end_pos = 0; + FOR_BUFS(bn) + { + bp = bufnode_buf(bn); + buf_pos = (bp->block * LBUFSIZE) + bp->datasize; + if (buf_pos > end_pos) + end_pos = buf_pos; + } + + return (ch_seek(end_pos)); +} + +/* * Seek to the beginning of the file, or as close to it as we can get. * We may not be able to seek there if input is a pipe and the * beginning of the pipe is no longer buffered. Modified: head/contrib/less/charset.c ============================================================================== --- head/contrib/less/charset.c Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/charset.c Tue Jan 5 05:25:16 2016 (r293190) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -466,36 +466,15 @@ prutfchar(ch) else SNPRINTF1(buf, sizeof(buf), binfmt, (char) ch); } else if (is_ubin_char(ch)) + { SNPRINTF1(buf, sizeof(buf), utfbinfmt, ch); - else + } else { - int len; + char *p = buf; if (ch >= 0x80000000) - { - len = 3; - ch = 0xFFFD; - } else - { - len = (ch < 0x80) ? 1 - : (ch < 0x800) ? 2 - : (ch < 0x10000) ? 3 - : (ch < 0x200000) ? 4 - : (ch < 0x4000000) ? 5 - : 6; - } - buf[len] = '\0'; - if (len == 1) - *buf = (char) ch; - else - { - *buf = ((1 << len) - 1) << (8 - len); - while (--len > 0) - { - buf[len] = (char) (0x80 | (ch & 0x3F)); - ch >>= 6; - } - *buf |= ch; - } + ch = 0xFFFD; /* REPLACEMENT CHARACTER */ + put_wchar(&p, ch); + *p = '\0'; } return (buf); } @@ -524,11 +503,12 @@ utf_len(ch) } /* - * Is a UTF-8 character well-formed? + * Does the parameter point to the lead byte of a well-formed UTF-8 character? */ public int -is_utf8_well_formed(s) +is_utf8_well_formed(s, slen) unsigned char *s; + int slen; { int i; int len; @@ -537,6 +517,8 @@ is_utf8_well_formed(s) return (0); len = utf_len((char) s[0]); + if (len > slen) + return (0); if (len == 1) return (1); if (len == 2) @@ -558,6 +540,35 @@ is_utf8_well_formed(s) } /* + * Return number of invalid UTF-8 sequences found in a buffer. + */ + public int +utf_bin_count(data, len) + unsigned char *data; + int len; +{ + int bin_count = 0; + while (len > 0) + { + if (is_utf8_well_formed(data, len)) + { + int clen = utf_len(*data); + data += clen; + len -= clen; + } else + { + /* Skip to next lead byte. */ + bin_count++; + do { + ++data; + --len; + } while (len > 0 && !IS_UTF8_LEAD(*data)); + } + } + return (bin_count); +} + +/* * Get the value of a UTF-8 character. */ public LWCHAR @@ -706,411 +717,51 @@ step_char(pp, dir, limit) /* * Unicode characters data + * Actual data is in the generated *.uni files. */ -struct wchar_range { LWCHAR first, last; }; -/* - * Characters with general category values - * Mn: Mark, Nonspacing - * Me: Mark, Enclosing - * Last synched with - * - * dated 2005-11-30T00:58:48Z - */ -static struct wchar_range comp_table[] = { - { 0x0300, 0x036F} /* Mn */, { 0x0483, 0x0486} /* Mn */, - { 0x0488, 0x0489} /* Me */, - { 0x0591, 0x05BD} /* Mn */, { 0x05BF, 0x05BF} /* Mn */, - { 0x05C1, 0x05C2} /* Mn */, { 0x05C4, 0x05C5} /* Mn */, - { 0x05C7, 0x05C7} /* Mn */, { 0x0610, 0x0615} /* Mn */, - { 0x064B, 0x065E} /* Mn */, { 0x0670, 0x0670} /* Mn */, - { 0x06D6, 0x06DC} /* Mn */, - { 0x06DE, 0x06DE} /* Me */, - { 0x06DF, 0x06E4} /* Mn */, { 0x06E7, 0x06E8} /* Mn */, - { 0x06EA, 0x06ED} /* Mn */, { 0x0711, 0x0711} /* Mn */, - { 0x0730, 0x074A} /* Mn */, { 0x07A6, 0x07B0} /* Mn */, - { 0x07EB, 0x07F3} /* Mn */, { 0x0901, 0x0902} /* Mn */, - { 0x093C, 0x093C} /* Mn */, { 0x0941, 0x0948} /* Mn */, - { 0x094D, 0x094D} /* Mn */, { 0x0951, 0x0954} /* Mn */, - { 0x0962, 0x0963} /* Mn */, { 0x0981, 0x0981} /* Mn */, - { 0x09BC, 0x09BC} /* Mn */, { 0x09C1, 0x09C4} /* Mn */, - { 0x09CD, 0x09CD} /* Mn */, { 0x09E2, 0x09E3} /* Mn */, - { 0x0A01, 0x0A02} /* Mn */, { 0x0A3C, 0x0A3C} /* Mn */, - { 0x0A41, 0x0A42} /* Mn */, { 0x0A47, 0x0A48} /* Mn */, - { 0x0A4B, 0x0A4D} /* Mn */, { 0x0A70, 0x0A71} /* Mn */, - { 0x0A81, 0x0A82} /* Mn */, { 0x0ABC, 0x0ABC} /* Mn */, - { 0x0AC1, 0x0AC5} /* Mn */, { 0x0AC7, 0x0AC8} /* Mn */, - { 0x0ACD, 0x0ACD} /* Mn */, { 0x0AE2, 0x0AE3} /* Mn */, - { 0x0B01, 0x0B01} /* Mn */, { 0x0B3C, 0x0B3C} /* Mn */, - { 0x0B3F, 0x0B3F} /* Mn */, { 0x0B41, 0x0B43} /* Mn */, - { 0x0B4D, 0x0B4D} /* Mn */, { 0x0B56, 0x0B56} /* Mn */, - { 0x0B82, 0x0B82} /* Mn */, { 0x0BC0, 0x0BC0} /* Mn */, - { 0x0BCD, 0x0BCD} /* Mn */, { 0x0C3E, 0x0C40} /* Mn */, - { 0x0C46, 0x0C48} /* Mn */, { 0x0C4A, 0x0C4D} /* Mn */, - { 0x0C55, 0x0C56} /* Mn */, { 0x0CBC, 0x0CBC} /* Mn */, - { 0x0CBF, 0x0CBF} /* Mn */, { 0x0CC6, 0x0CC6} /* Mn */, - { 0x0CCC, 0x0CCD} /* Mn */, { 0x0CE2, 0x0CE3} /* Mn */, - { 0x0D41, 0x0D43} /* Mn */, { 0x0D4D, 0x0D4D} /* Mn */, - { 0x0DCA, 0x0DCA} /* Mn */, { 0x0DD2, 0x0DD4} /* Mn */, - { 0x0DD6, 0x0DD6} /* Mn */, { 0x0E31, 0x0E31} /* Mn */, - { 0x0E34, 0x0E3A} /* Mn */, { 0x0E47, 0x0E4E} /* Mn */, - { 0x0EB1, 0x0EB1} /* Mn */, { 0x0EB4, 0x0EB9} /* Mn */, - { 0x0EBB, 0x0EBC} /* Mn */, { 0x0EC8, 0x0ECD} /* Mn */, - { 0x0F18, 0x0F19} /* Mn */, { 0x0F35, 0x0F35} /* Mn */, - { 0x0F37, 0x0F37} /* Mn */, { 0x0F39, 0x0F39} /* Mn */, - { 0x0F71, 0x0F7E} /* Mn */, { 0x0F80, 0x0F84} /* Mn */, - { 0x0F86, 0x0F87} /* Mn */, { 0x0F90, 0x0F97} /* Mn */, - { 0x0F99, 0x0FBC} /* Mn */, { 0x0FC6, 0x0FC6} /* Mn */, - { 0x102D, 0x1030} /* Mn */, { 0x1032, 0x1032} /* Mn */, - { 0x1036, 0x1037} /* Mn */, { 0x1039, 0x1039} /* Mn */, - { 0x1058, 0x1059} /* Mn */, { 0x135F, 0x135F} /* Mn */, - { 0x1712, 0x1714} /* Mn */, { 0x1732, 0x1734} /* Mn */, - { 0x1752, 0x1753} /* Mn */, { 0x1772, 0x1773} /* Mn */, - { 0x17B7, 0x17BD} /* Mn */, { 0x17C6, 0x17C6} /* Mn */, - { 0x17C9, 0x17D3} /* Mn */, { 0x17DD, 0x17DD} /* Mn */, - { 0x180B, 0x180D} /* Mn */, { 0x18A9, 0x18A9} /* Mn */, - { 0x1920, 0x1922} /* Mn */, { 0x1927, 0x1928} /* Mn */, - { 0x1932, 0x1932} /* Mn */, { 0x1939, 0x193B} /* Mn */, - { 0x1A17, 0x1A18} /* Mn */, { 0x1B00, 0x1B03} /* Mn */, - { 0x1B34, 0x1B34} /* Mn */, { 0x1B36, 0x1B3A} /* Mn */, - { 0x1B3C, 0x1B3C} /* Mn */, { 0x1B42, 0x1B42} /* Mn */, - { 0x1B6B, 0x1B73} /* Mn */, { 0x1DC0, 0x1DCA} /* Mn */, - { 0x1DFE, 0x1DFF} /* Mn */, { 0x20D0, 0x20DC} /* Mn */, - { 0x20DD, 0x20E0} /* Me */, - { 0x20E1, 0x20E1} /* Mn */, - { 0x20E2, 0x20E4} /* Me */, - { 0x20E5, 0x20EF} /* Mn */, { 0x302A, 0x302F} /* Mn */, - { 0x3099, 0x309A} /* Mn */, { 0xA806, 0xA806} /* Mn */, - { 0xA80B, 0xA80B} /* Mn */, { 0xA825, 0xA826} /* Mn */, - { 0xFB1E, 0xFB1E} /* Mn */, { 0xFE00, 0xFE0F} /* Mn */, - { 0xFE20, 0xFE23} /* Mn */, { 0x10A01, 0x10A03} /* Mn */, - { 0x10A05, 0x10A06} /* Mn */, { 0x10A0C, 0x10A0F} /* Mn */, - { 0x10A38, 0x10A3A} /* Mn */, { 0x10A3F, 0x10A3F} /* Mn */, - { 0x1D167, 0x1D169} /* Mn */, { 0x1D17B, 0x1D182} /* Mn */, - { 0x1D185, 0x1D18B} /* Mn */, { 0x1D1AA, 0x1D1AD} /* Mn */, - { 0x1D242, 0x1D244} /* Mn */, { 0xE0100, 0xE01EF} /* Mn */, -}; +#define DECLARE_RANGE_TABLE_START(name) \ + static struct wchar_range name##_array[] = { +#define DECLARE_RANGE_TABLE_END(name) \ + }; struct wchar_range_table name##_table = { name##_array, sizeof(name##_array)/sizeof(*name##_array) }; -/* - * Special pairs, not ranges. - */ +DECLARE_RANGE_TABLE_START(compose) +#include "compose.uni" +DECLARE_RANGE_TABLE_END(compose) + +DECLARE_RANGE_TABLE_START(ubin) +#include "ubin.uni" +DECLARE_RANGE_TABLE_END(ubin) + +DECLARE_RANGE_TABLE_START(wide) +#include "wide.uni" +DECLARE_RANGE_TABLE_END(wide) + +/* comb_table is special pairs, not ranges. */ static struct wchar_range comb_table[] = { {0x0644,0x0622}, {0x0644,0x0623}, {0x0644,0x0625}, {0x0644,0x0627}, }; -/* - * Characters with general category values - * Cc: Other, Control - * Cf: Other, Format - * Cs: Other, Surrogate - * Co: Other, Private Use - * Cn: Other, Not Assigned - * Zl: Separator, Line - * Zp: Separator, Paragraph - * Last synched with - * - * dated 2005-11-30T00:58:48Z - */ -static struct wchar_range ubin_table[] = { - { 0x0000, 0x0007} /* Cc */, - { 0x000B, 0x000C} /* Cc */, - { 0x000E, 0x001A} /* Cc */, - { 0x001C, 0x001F} /* Cc */, - { 0x007F, 0x009F} /* Cc */, -#if 0 - { 0x00AD, 0x00AD} /* Cf */, -#endif - { 0x0370, 0x0373} /* Cn */, { 0x0376, 0x0379} /* Cn */, - { 0x037F, 0x0383} /* Cn */, { 0x038B, 0x038B} /* Cn */, - { 0x038D, 0x038D} /* Cn */, { 0x03A2, 0x03A2} /* Cn */, - { 0x03CF, 0x03CF} /* Cn */, { 0x0487, 0x0487} /* Cn */, - { 0x0514, 0x0530} /* Cn */, { 0x0557, 0x0558} /* Cn */, - { 0x0560, 0x0560} /* Cn */, { 0x0588, 0x0588} /* Cn */, - { 0x058B, 0x0590} /* Cn */, { 0x05C8, 0x05CF} /* Cn */, - { 0x05EB, 0x05EF} /* Cn */, { 0x05F5, 0x05FF} /* Cn */, -#if 0 - { 0x0600, 0x0603} /* Cf */, -#endif - { 0x0604, 0x060A} /* Cn */, { 0x0616, 0x061A} /* Cn */, - { 0x061C, 0x061D} /* Cn */, { 0x0620, 0x0620} /* Cn */, - { 0x063B, 0x063F} /* Cn */, { 0x065F, 0x065F} /* Cn */, -#if 0 - { 0x06DD, 0x06DD} /* Cf */, -#endif - { 0x070E, 0x070E} /* Cn */, -#if 0 - { 0x070F, 0x070F} /* Cf */, -#endif - { 0x074B, 0x074C} /* Cn */, { 0x076E, 0x077F} /* Cn */, - { 0x07B2, 0x07BF} /* Cn */, { 0x07FB, 0x0900} /* Cn */, - { 0x093A, 0x093B} /* Cn */, { 0x094E, 0x094F} /* Cn */, - { 0x0955, 0x0957} /* Cn */, { 0x0971, 0x097A} /* Cn */, - { 0x0980, 0x0980} /* Cn */, { 0x0984, 0x0984} /* Cn */, - { 0x098D, 0x098E} /* Cn */, { 0x0991, 0x0992} /* Cn */, - { 0x09A9, 0x09A9} /* Cn */, { 0x09B1, 0x09B1} /* Cn */, - { 0x09B3, 0x09B5} /* Cn */, { 0x09BA, 0x09BB} /* Cn */, - { 0x09C5, 0x09C6} /* Cn */, { 0x09C9, 0x09CA} /* Cn */, - { 0x09CF, 0x09D6} /* Cn */, { 0x09D8, 0x09DB} /* Cn */, - { 0x09DE, 0x09DE} /* Cn */, { 0x09E4, 0x09E5} /* Cn */, - { 0x09FB, 0x0A00} /* Cn */, { 0x0A04, 0x0A04} /* Cn */, - { 0x0A0B, 0x0A0E} /* Cn */, { 0x0A11, 0x0A12} /* Cn */, - { 0x0A29, 0x0A29} /* Cn */, { 0x0A31, 0x0A31} /* Cn */, - { 0x0A34, 0x0A34} /* Cn */, { 0x0A37, 0x0A37} /* Cn */, - { 0x0A3A, 0x0A3B} /* Cn */, { 0x0A3D, 0x0A3D} /* Cn */, - { 0x0A43, 0x0A46} /* Cn */, { 0x0A49, 0x0A4A} /* Cn */, - { 0x0A4E, 0x0A58} /* Cn */, { 0x0A5D, 0x0A5D} /* Cn */, - { 0x0A5F, 0x0A65} /* Cn */, { 0x0A75, 0x0A80} /* Cn */, - { 0x0A84, 0x0A84} /* Cn */, { 0x0A8E, 0x0A8E} /* Cn */, - { 0x0A92, 0x0A92} /* Cn */, { 0x0AA9, 0x0AA9} /* Cn */, - { 0x0AB1, 0x0AB1} /* Cn */, { 0x0AB4, 0x0AB4} /* Cn */, - { 0x0ABA, 0x0ABB} /* Cn */, { 0x0AC6, 0x0AC6} /* Cn */, - { 0x0ACA, 0x0ACA} /* Cn */, { 0x0ACE, 0x0ACF} /* Cn */, - { 0x0AD1, 0x0ADF} /* Cn */, { 0x0AE4, 0x0AE5} /* Cn */, - { 0x0AF0, 0x0AF0} /* Cn */, { 0x0AF2, 0x0B00} /* Cn */, - { 0x0B04, 0x0B04} /* Cn */, { 0x0B0D, 0x0B0E} /* Cn */, - { 0x0B11, 0x0B12} /* Cn */, { 0x0B29, 0x0B29} /* Cn */, - { 0x0B31, 0x0B31} /* Cn */, { 0x0B34, 0x0B34} /* Cn */, - { 0x0B3A, 0x0B3B} /* Cn */, { 0x0B44, 0x0B46} /* Cn */, - { 0x0B49, 0x0B4A} /* Cn */, { 0x0B4E, 0x0B55} /* Cn */, - { 0x0B58, 0x0B5B} /* Cn */, { 0x0B5E, 0x0B5E} /* Cn */, - { 0x0B62, 0x0B65} /* Cn */, { 0x0B72, 0x0B81} /* Cn */, - { 0x0B84, 0x0B84} /* Cn */, { 0x0B8B, 0x0B8D} /* Cn */, - { 0x0B91, 0x0B91} /* Cn */, { 0x0B96, 0x0B98} /* Cn */, - { 0x0B9B, 0x0B9B} /* Cn */, { 0x0B9D, 0x0B9D} /* Cn */, - { 0x0BA0, 0x0BA2} /* Cn */, { 0x0BA5, 0x0BA7} /* Cn */, - { 0x0BAB, 0x0BAD} /* Cn */, { 0x0BBA, 0x0BBD} /* Cn */, - { 0x0BC3, 0x0BC5} /* Cn */, { 0x0BC9, 0x0BC9} /* Cn */, - { 0x0BCE, 0x0BD6} /* Cn */, { 0x0BD8, 0x0BE5} /* Cn */, - { 0x0BFB, 0x0C00} /* Cn */, { 0x0C04, 0x0C04} /* Cn */, - { 0x0C0D, 0x0C0D} /* Cn */, { 0x0C11, 0x0C11} /* Cn */, - { 0x0C29, 0x0C29} /* Cn */, { 0x0C34, 0x0C34} /* Cn */, - { 0x0C3A, 0x0C3D} /* Cn */, { 0x0C45, 0x0C45} /* Cn */, - { 0x0C49, 0x0C49} /* Cn */, { 0x0C4E, 0x0C54} /* Cn */, - { 0x0C57, 0x0C5F} /* Cn */, { 0x0C62, 0x0C65} /* Cn */, - { 0x0C70, 0x0C81} /* Cn */, { 0x0C84, 0x0C84} /* Cn */, - { 0x0C8D, 0x0C8D} /* Cn */, { 0x0C91, 0x0C91} /* Cn */, - { 0x0CA9, 0x0CA9} /* Cn */, { 0x0CB4, 0x0CB4} /* Cn */, - { 0x0CBA, 0x0CBB} /* Cn */, { 0x0CC5, 0x0CC5} /* Cn */, - { 0x0CC9, 0x0CC9} /* Cn */, { 0x0CCE, 0x0CD4} /* Cn */, - { 0x0CD7, 0x0CDD} /* Cn */, { 0x0CDF, 0x0CDF} /* Cn */, - { 0x0CE4, 0x0CE5} /* Cn */, { 0x0CF0, 0x0CF0} /* Cn */, - { 0x0CF3, 0x0D01} /* Cn */, { 0x0D04, 0x0D04} /* Cn */, - { 0x0D0D, 0x0D0D} /* Cn */, { 0x0D11, 0x0D11} /* Cn */, - { 0x0D29, 0x0D29} /* Cn */, { 0x0D3A, 0x0D3D} /* Cn */, - { 0x0D44, 0x0D45} /* Cn */, { 0x0D49, 0x0D49} /* Cn */, - { 0x0D4E, 0x0D56} /* Cn */, { 0x0D58, 0x0D5F} /* Cn */, - { 0x0D62, 0x0D65} /* Cn */, { 0x0D70, 0x0D81} /* Cn */, - { 0x0D84, 0x0D84} /* Cn */, { 0x0D97, 0x0D99} /* Cn */, - { 0x0DB2, 0x0DB2} /* Cn */, { 0x0DBC, 0x0DBC} /* Cn */, - { 0x0DBE, 0x0DBF} /* Cn */, { 0x0DC7, 0x0DC9} /* Cn */, - { 0x0DCB, 0x0DCE} /* Cn */, { 0x0DD5, 0x0DD5} /* Cn */, - { 0x0DD7, 0x0DD7} /* Cn */, { 0x0DE0, 0x0DF1} /* Cn */, - { 0x0DF5, 0x0E00} /* Cn */, { 0x0E3B, 0x0E3E} /* Cn */, - { 0x0E5C, 0x0E80} /* Cn */, { 0x0E83, 0x0E83} /* Cn */, - { 0x0E85, 0x0E86} /* Cn */, { 0x0E89, 0x0E89} /* Cn */, - { 0x0E8B, 0x0E8C} /* Cn */, { 0x0E8E, 0x0E93} /* Cn */, - { 0x0E98, 0x0E98} /* Cn */, { 0x0EA0, 0x0EA0} /* Cn */, - { 0x0EA4, 0x0EA4} /* Cn */, { 0x0EA6, 0x0EA6} /* Cn */, - { 0x0EA8, 0x0EA9} /* Cn */, { 0x0EAC, 0x0EAC} /* Cn */, - { 0x0EBA, 0x0EBA} /* Cn */, { 0x0EBE, 0x0EBF} /* Cn */, - { 0x0EC5, 0x0EC5} /* Cn */, { 0x0EC7, 0x0EC7} /* Cn */, - { 0x0ECE, 0x0ECF} /* Cn */, { 0x0EDA, 0x0EDB} /* Cn */, - { 0x0EDE, 0x0EFF} /* Cn */, { 0x0F48, 0x0F48} /* Cn */, - { 0x0F6B, 0x0F70} /* Cn */, { 0x0F8C, 0x0F8F} /* Cn */, - { 0x0F98, 0x0F98} /* Cn */, { 0x0FBD, 0x0FBD} /* Cn */, - { 0x0FCD, 0x0FCE} /* Cn */, { 0x0FD2, 0x0FFF} /* Cn */, - { 0x1022, 0x1022} /* Cn */, { 0x1028, 0x1028} /* Cn */, - { 0x102B, 0x102B} /* Cn */, { 0x1033, 0x1035} /* Cn */, - { 0x103A, 0x103F} /* Cn */, { 0x105A, 0x109F} /* Cn */, - { 0x10C6, 0x10CF} /* Cn */, { 0x10FD, 0x10FF} /* Cn */, - { 0x115A, 0x115E} /* Cn */, { 0x11A3, 0x11A7} /* Cn */, - { 0x11FA, 0x11FF} /* Cn */, { 0x1249, 0x1249} /* Cn */, - { 0x124E, 0x124F} /* Cn */, { 0x1257, 0x1257} /* Cn */, - { 0x1259, 0x1259} /* Cn */, { 0x125E, 0x125F} /* Cn */, - { 0x1289, 0x1289} /* Cn */, { 0x128E, 0x128F} /* Cn */, - { 0x12B1, 0x12B1} /* Cn */, { 0x12B6, 0x12B7} /* Cn */, - { 0x12BF, 0x12BF} /* Cn */, { 0x12C1, 0x12C1} /* Cn */, - { 0x12C6, 0x12C7} /* Cn */, { 0x12D7, 0x12D7} /* Cn */, - { 0x1311, 0x1311} /* Cn */, { 0x1316, 0x1317} /* Cn */, - { 0x135B, 0x135E} /* Cn */, { 0x137D, 0x137F} /* Cn */, - { 0x139A, 0x139F} /* Cn */, { 0x13F5, 0x1400} /* Cn */, - { 0x1677, 0x167F} /* Cn */, { 0x169D, 0x169F} /* Cn */, - { 0x16F1, 0x16FF} /* Cn */, { 0x170D, 0x170D} /* Cn */, - { 0x1715, 0x171F} /* Cn */, { 0x1737, 0x173F} /* Cn */, - { 0x1754, 0x175F} /* Cn */, { 0x176D, 0x176D} /* Cn */, - { 0x1771, 0x1771} /* Cn */, { 0x1774, 0x177F} /* Cn */, -#if 0 - { 0x17B4, 0x17B5} /* Cf */, -#endif - { 0x17DE, 0x17DF} /* Cn */, { 0x17EA, 0x17EF} /* Cn */, - { 0x17FA, 0x17FF} /* Cn */, { 0x180F, 0x180F} /* Cn */, - { 0x181A, 0x181F} /* Cn */, { 0x1878, 0x187F} /* Cn */, - { 0x18AA, 0x18FF} /* Cn */, { 0x191D, 0x191F} /* Cn */, - { 0x192C, 0x192F} /* Cn */, { 0x193C, 0x193F} /* Cn */, - { 0x1941, 0x1943} /* Cn */, { 0x196E, 0x196F} /* Cn */, - { 0x1975, 0x197F} /* Cn */, { 0x19AA, 0x19AF} /* Cn */, - { 0x19CA, 0x19CF} /* Cn */, { 0x19DA, 0x19DD} /* Cn */, - { 0x1A1C, 0x1A1D} /* Cn */, { 0x1A20, 0x1AFF} /* Cn */, - { 0x1B4C, 0x1B4F} /* Cn */, { 0x1B7D, 0x1CFF} /* Cn */, - { 0x1DCB, 0x1DFD} /* Cn */, { 0x1E9C, 0x1E9F} /* Cn */, - { 0x1EFA, 0x1EFF} /* Cn */, { 0x1F16, 0x1F17} /* Cn */, - { 0x1F1E, 0x1F1F} /* Cn */, { 0x1F46, 0x1F47} /* Cn */, - { 0x1F4E, 0x1F4F} /* Cn */, { 0x1F58, 0x1F58} /* Cn */, - { 0x1F5A, 0x1F5A} /* Cn */, { 0x1F5C, 0x1F5C} /* Cn */, - { 0x1F5E, 0x1F5E} /* Cn */, { 0x1F7E, 0x1F7F} /* Cn */, - { 0x1FB5, 0x1FB5} /* Cn */, { 0x1FC5, 0x1FC5} /* Cn */, - { 0x1FD4, 0x1FD5} /* Cn */, { 0x1FDC, 0x1FDC} /* Cn */, - { 0x1FF0, 0x1FF1} /* Cn */, { 0x1FF5, 0x1FF5} /* Cn */, - { 0x1FFF, 0x1FFF} /* Cn */, - { 0x200B, 0x200F} /* Cf */, - { 0x2028, 0x2028} /* Zl */, - { 0x2029, 0x2029} /* Zp */, - { 0x202A, 0x202E} /* Cf */, - { 0x2060, 0x2063} /* Cf */, - { 0x2064, 0x2069} /* Cn */, - { 0x206A, 0x206F} /* Cf */, - { 0x2072, 0x2073} /* Cn */, { 0x208F, 0x208F} /* Cn */, - { 0x2095, 0x209F} /* Cn */, { 0x20B6, 0x20CF} /* Cn */, - { 0x20F0, 0x20FF} /* Cn */, { 0x214F, 0x2152} /* Cn */, - { 0x2185, 0x218F} /* Cn */, { 0x23E8, 0x23FF} /* Cn */, - { 0x2427, 0x243F} /* Cn */, { 0x244B, 0x245F} /* Cn */, - { 0x269D, 0x269F} /* Cn */, { 0x26B3, 0x2700} /* Cn */, - { 0x2705, 0x2705} /* Cn */, { 0x270A, 0x270B} /* Cn */, - { 0x2728, 0x2728} /* Cn */, { 0x274C, 0x274C} /* Cn */, - { 0x274E, 0x274E} /* Cn */, { 0x2753, 0x2755} /* Cn */, - { 0x2757, 0x2757} /* Cn */, { 0x275F, 0x2760} /* Cn */, - { 0x2795, 0x2797} /* Cn */, { 0x27B0, 0x27B0} /* Cn */, - { 0x27BF, 0x27BF} /* Cn */, { 0x27CB, 0x27CF} /* Cn */, - { 0x27EC, 0x27EF} /* Cn */, { 0x2B1B, 0x2B1F} /* Cn */, - { 0x2B24, 0x2BFF} /* Cn */, { 0x2C2F, 0x2C2F} /* Cn */, - { 0x2C5F, 0x2C5F} /* Cn */, { 0x2C6D, 0x2C73} /* Cn */, - { 0x2C78, 0x2C7F} /* Cn */, { 0x2CEB, 0x2CF8} /* Cn */, - { 0x2D26, 0x2D2F} /* Cn */, { 0x2D66, 0x2D6E} /* Cn */, - { 0x2D70, 0x2D7F} /* Cn */, { 0x2D97, 0x2D9F} /* Cn */, - { 0x2DA7, 0x2DA7} /* Cn */, { 0x2DAF, 0x2DAF} /* Cn */, - { 0x2DB7, 0x2DB7} /* Cn */, { 0x2DBF, 0x2DBF} /* Cn */, - { 0x2DC7, 0x2DC7} /* Cn */, { 0x2DCF, 0x2DCF} /* Cn */, - { 0x2DD7, 0x2DD7} /* Cn */, { 0x2DDF, 0x2DFF} /* Cn */, - { 0x2E18, 0x2E1B} /* Cn */, { 0x2E1E, 0x2E7F} /* Cn */, - { 0x2E9A, 0x2E9A} /* Cn */, { 0x2EF4, 0x2EFF} /* Cn */, - { 0x2FD6, 0x2FEF} /* Cn */, { 0x2FFC, 0x2FFF} /* Cn */, - { 0x3040, 0x3040} /* Cn */, { 0x3097, 0x3098} /* Cn */, - { 0x3100, 0x3104} /* Cn */, { 0x312D, 0x3130} /* Cn */, - { 0x318F, 0x318F} /* Cn */, { 0x31B8, 0x31BF} /* Cn */, - { 0x31D0, 0x31EF} /* Cn */, { 0x321F, 0x321F} /* Cn */, - { 0x3244, 0x324F} /* Cn */, { 0x32FF, 0x32FF} /* Cn */, - { 0x4DB6, 0x4DBF} /* Cn */, { 0x9FBC, 0x9FFF} /* Cn */, - { 0xA48D, 0xA48F} /* Cn */, { 0xA4C7, 0xA6FF} /* Cn */, - { 0xA71B, 0xA71F} /* Cn */, { 0xA722, 0xA7FF} /* Cn */, - { 0xA82C, 0xA83F} /* Cn */, { 0xA878, 0xABFF} /* Cn */, - { 0xD7A4, 0xD7FF} /* Cn */, - { 0xD800, 0xDFFF} /* Cs */, - { 0xE000, 0xF8FF} /* Co */, - { 0xFA2E, 0xFA2F} /* Cn */, { 0xFA6B, 0xFA6F} /* Cn */, - { 0xFADA, 0xFAFF} /* Cn */, { 0xFB07, 0xFB12} /* Cn */, - { 0xFB18, 0xFB1C} /* Cn */, { 0xFB37, 0xFB37} /* Cn */, - { 0xFB3D, 0xFB3D} /* Cn */, { 0xFB3F, 0xFB3F} /* Cn */, - { 0xFB42, 0xFB42} /* Cn */, { 0xFB45, 0xFB45} /* Cn */, - { 0xFBB2, 0xFBD2} /* Cn */, { 0xFD40, 0xFD4F} /* Cn */, - { 0xFD90, 0xFD91} /* Cn */, { 0xFDC8, 0xFDEF} /* Cn */, - { 0xFDFE, 0xFDFF} /* Cn */, { 0xFE1A, 0xFE1F} /* Cn */, - { 0xFE24, 0xFE2F} /* Cn */, { 0xFE53, 0xFE53} /* Cn */, - { 0xFE67, 0xFE67} /* Cn */, { 0xFE6C, 0xFE6F} /* Cn */, - { 0xFE75, 0xFE75} /* Cn */, { 0xFEFD, 0xFEFE} /* Cn */, - { 0xFEFF, 0xFEFF} /* Cf */, - { 0xFF00, 0xFF00} /* Cn */, { 0xFFBF, 0xFFC1} /* Cn */, - { 0xFFC8, 0xFFC9} /* Cn */, { 0xFFD0, 0xFFD1} /* Cn */, - { 0xFFD8, 0xFFD9} /* Cn */, { 0xFFDD, 0xFFDF} /* Cn */, - { 0xFFE7, 0xFFE7} /* Cn */, { 0xFFEF, 0xFFF8} /* Cn */, - { 0xFFF9, 0xFFFB} /* Cf */, - { 0xFFFE, 0xFFFF} /* Cn */, { 0x1000C, 0x1000C} /* Cn */, - { 0x10027, 0x10027} /* Cn */, { 0x1003B, 0x1003B} /* Cn */, - { 0x1003E, 0x1003E} /* Cn */, { 0x1004E, 0x1004F} /* Cn */, - { 0x1005E, 0x1007F} /* Cn */, { 0x100FB, 0x100FF} /* Cn */, - { 0x10103, 0x10106} /* Cn */, { 0x10134, 0x10136} /* Cn */, - { 0x1018B, 0x102FF} /* Cn */, { 0x1031F, 0x1031F} /* Cn */, - { 0x10324, 0x1032F} /* Cn */, { 0x1034B, 0x1037F} /* Cn */, - { 0x1039E, 0x1039E} /* Cn */, { 0x103C4, 0x103C7} /* Cn */, - { 0x103D6, 0x103FF} /* Cn */, - { 0x1049E, 0x1049F} /* Cn */, { 0x104AA, 0x107FF} /* Cn */, - { 0x10806, 0x10807} /* Cn */, { 0x10809, 0x10809} /* Cn */, - { 0x10836, 0x10836} /* Cn */, { 0x10839, 0x1083B} /* Cn */, - { 0x1083D, 0x1083E} /* Cn */, { 0x10840, 0x108FF} /* Cn */, - { 0x1091A, 0x1091E} /* Cn */, { 0x10920, 0x109FF} /* Cn */, - { 0x10A04, 0x10A04} /* Cn */, { 0x10A07, 0x10A0B} /* Cn */, - { 0x10A14, 0x10A14} /* Cn */, { 0x10A18, 0x10A18} /* Cn */, - { 0x10A34, 0x10A37} /* Cn */, { 0x10A3B, 0x10A3E} /* Cn */, - { 0x10A48, 0x10A4F} /* Cn */, { 0x10A59, 0x11FFF} /* Cn */, - { 0x1236F, 0x123FF} /* Cn */, { 0x12463, 0x1246F} /* Cn */, - { 0x12474, 0x1CFFF} /* Cn */, { 0x1D0F6, 0x1D0FF} /* Cn */, - { 0x1D127, 0x1D129} /* Cn */, - { 0x1D173, 0x1D17A} /* Cf */, - { 0x1D1DE, 0x1D1FF} /* Cn */, { 0x1D246, 0x1D2FF} /* Cn */, - { 0x1D357, 0x1D35F} /* Cn */, { 0x1D372, 0x1D3FF} /* Cn */, - { 0x1D455, 0x1D455} /* Cn */, { 0x1D49D, 0x1D49D} /* Cn */, - { 0x1D4A0, 0x1D4A1} /* Cn */, { 0x1D4A3, 0x1D4A4} /* Cn */, - { 0x1D4A7, 0x1D4A8} /* Cn */, { 0x1D4AD, 0x1D4AD} /* Cn */, - { 0x1D4BA, 0x1D4BA} /* Cn */, { 0x1D4BC, 0x1D4BC} /* Cn */, - { 0x1D4C4, 0x1D4C4} /* Cn */, { 0x1D506, 0x1D506} /* Cn */, - { 0x1D50B, 0x1D50C} /* Cn */, { 0x1D515, 0x1D515} /* Cn */, - { 0x1D51D, 0x1D51D} /* Cn */, { 0x1D53A, 0x1D53A} /* Cn */, - { 0x1D53F, 0x1D53F} /* Cn */, { 0x1D545, 0x1D545} /* Cn */, - { 0x1D547, 0x1D549} /* Cn */, { 0x1D551, 0x1D551} /* Cn */, - { 0x1D6A6, 0x1D6A7} /* Cn */, { 0x1D7CC, 0x1D7CD} /* Cn */, - { 0x1D800, 0x1FFFF} /* Cn */, { 0x2A6D7, 0x2F7FF} /* Cn */, - { 0x2FA1E, 0xE0000} /* Cn */, - { 0xE0001, 0xE0001} /* Cf */, - { 0xE0002, 0xE001F} /* Cn */, - { 0xE0020, 0xE007F} /* Cf */, - { 0xE0080, 0xE00FF} /* Cn */, { 0xE01F0, 0xEFFFF} /* Cn */, - { 0xF0000, 0xFFFFD} /* Co */, - { 0xFFFFE, 0xFFFFF} /* Cn */, - {0x100000,0x10FFFD} /* Co */, - {0x10FFFE,0x10FFFF} /* Cn */, - {0x110000,0x7FFFFFFF} /* ISO 10646?? */ -}; - -/* - * Double width characters - * W: East Asian Wide - * F: East Asian Full-width - * Unassigned code points may be included when they allow ranges to be merged. - * Last synched with - * - * dated 2005-11-08T01:32:56Z - */ -static struct wchar_range wide_table[] = { - { 0x1100, 0x115F} /* W */, { 0x2329, 0x232A} /* W */, - { 0x2E80, 0x2FFB} /* W */, - { 0x3000, 0x3000} /* F */, - { 0x3001, 0x303E} /* W */, { 0x3041, 0x4DB5} /* W */, - { 0x4E00, 0x9FBB} /* W */, { 0xA000, 0xA4C6} /* W */, - { 0xAC00, 0xD7A3} /* W */, { 0xF900, 0xFAD9} /* W */, - { 0xFE10, 0xFE19} /* W */, { 0xFE30, 0xFE6B} /* W */, - { 0xFF01, 0xFF60} /* F */, { 0xFFE0, 0xFFE6} /* F */, - { 0x20000, 0x2FFFD} /* W */, { 0x30000, 0x3FFFD} /* W */, -}; static int -is_in_table(ch, table, tsize) +is_in_table(ch, table) LWCHAR ch; - struct wchar_range table[]; - int tsize; + struct wchar_range_table *table; { int hi; int lo; /* Binary search in the table. */ - if (ch < table[0].first) + if (ch < table->table[0].first) return 0; lo = 0; - hi = tsize - 1; + hi = table->count - 1; while (lo <= hi) { int mid = (lo + hi) / 2; - if (ch > table[mid].last) + if (ch > table->table[mid].last) lo = mid + 1; - else if (ch < table[mid].first) + else if (ch < table->table[mid].first) hi = mid - 1; else return 1; @@ -1126,7 +777,7 @@ is_in_table(ch, table, tsize) is_composing_char(ch) LWCHAR ch; { - return is_in_table(ch, comp_table, (sizeof(comp_table) / sizeof(*comp_table))); + return is_in_table(ch, &compose_table); } /* @@ -1136,7 +787,7 @@ is_composing_char(ch) is_ubin_char(ch) LWCHAR ch; { - return is_in_table(ch, ubin_table, (sizeof(ubin_table) / sizeof(*ubin_table))); + return is_in_table(ch, &ubin_table); } /* @@ -1146,7 +797,7 @@ is_ubin_char(ch) is_wide_char(ch) LWCHAR ch; { - return is_in_table(ch, wide_table, (sizeof(wide_table) / sizeof(*wide_table))); + return is_in_table(ch, &wide_table); } /* Modified: head/contrib/less/charset.h ============================================================================== --- head/contrib/less/charset.h Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/charset.h Tue Jan 5 05:25:16 2016 (r293190) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/cmd.h ============================================================================== --- head/contrib/less/cmd.h Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/cmd.h Tue Jan 5 05:25:16 2016 (r293190) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -66,6 +66,7 @@ #define A_PREV_TAG 54 #define A_FILTER 55 #define A_F_UNTIL_HILITE 56 +#define A_GOEND_BUF 57 #define A_INVALID 100 #define A_NOACTION 101 Modified: head/contrib/less/cmdbuf.c ============================================================================== --- head/contrib/less/cmdbuf.c Tue Jan 5 03:22:10 2016 (r293189) +++ head/contrib/less/cmdbuf.c Tue Jan 5 05:25:16 2016 (r293190) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -203,7 +203,7 @@ cmd_step_common(p, ch, len, pwidth, bswi pr = prchar((int) ch); if (pwidth != NULL || bswidth != NULL) { - int len = strlen(pr); + int len = (int) strlen(pr); if (pwidth != NULL) *pwidth = len; if (bswidth != NULL) @@ -222,7 +222,7 @@ cmd_step_common(p, ch, len, pwidth, bswi *bswidth = 0; } else if (is_ubin_char(ch)) { - int len = strlen(pr); + int len = (int) strlen(pr); if (pwidth != NULL) *pwidth = len; if (bswidth != NULL) @@ -375,7 +375,7 @@ cmd_lshift() s = ns; } - cmd_offset = s - cmdbuf; + cmd_offset = (int) (s - cmdbuf); save_cp = cp; cmd_home(); cmd_repaint(save_cp); @@ -405,7 +405,7 @@ cmd_rshift() cols += width; } - cmd_offset = s - cmdbuf; + cmd_offset = (int) (s - cmdbuf); save_cp = cp; cmd_home(); cmd_repaint(save_cp); @@ -535,7 +535,7 @@ cmd_erase() */ s = cp; cmd_left(); - clen = s - cp; + clen = (int) (s - cp); /* * Remove the char from the buffer (shift the buffer left). @@ -701,7 +701,7 @@ cmd_updown(action) if (updown_match < 0) { - updown_match = cp - cmdbuf; + updown_match = (int) (cp - cmdbuf); } /* @@ -744,12 +744,13 @@ cmd_updown(action) #endif /* - * Add a string to a history list. + * Add a string to an mlist. */ public void -cmd_addhist(mlist, cmd) +cmd_addhist(mlist, cmd, modified) struct mlist *mlist; char *cmd; + int modified; { #if CMD_HISTORY struct mlist *ml; @@ -773,6 +774,7 @@ cmd_addhist(mlist, cmd) */ ml = (struct mlist *) ecalloc(1, sizeof(struct mlist)); ml->string = save(cmd); + ml->modified = modified; ml->next = mlist; ml->prev = mlist->prev; mlist->prev->next = ml; @@ -799,7 +801,7 @@ cmd_accept() */ if (curr_mlist == NULL) return; - cmd_addhist(curr_mlist, cmdbuf); + cmd_addhist(curr_mlist, cmdbuf, 1); curr_mlist->modified = 1; #endif } @@ -965,7 +967,7 @@ delimit_word() int delim_quoted = 0; int meta_quoted = 0; char *esc = get_meta_escape(); - int esclen = strlen(esc); + int esclen = (int) strlen(esc); #endif /* @@ -1262,7 +1264,7 @@ cmd_char(c) cmd_mbc_buf[cmd_mbc_buf_index++] = c; if (cmd_mbc_buf_index < cmd_mbc_buf_len) return (CC_OK); - if (!is_utf8_well_formed(cmd_mbc_buf)) + if (!is_utf8_well_formed(cmd_mbc_buf, cmd_mbc_buf_index)) { /* complete, but not well formed (non-shortest form), sequence */ cmd_mbc_buf_len = 0; @@ -1359,6 +1361,18 @@ cmd_lastpattern() #if CMD_HISTORY /* + */ + static int +mlist_size(ml) + struct mlist *ml; +{ + int size = 0; + for (ml = ml->next; ml->string != NULL; ml = ml->next) + ++size; + return size; +} + +/* * Get the name of the history file. */ static char * @@ -1378,6 +1392,10 @@ histfile_name() return (save(name)); } + /* See if history file is disabled in the build. */ + if (strcmp(LESSHISTFILE, "") == 0 || strcmp(LESSHISTFILE, "-") == 0) + return (NULL); + /* Otherwise, file is in $HOME. */ home = lgetenv("HOME"); if (home == NULL || *home == '\0') @@ -1388,25 +1406,28 @@ histfile_name() #endif return (NULL); } - len = strlen(home) + strlen(LESSHISTFILE) + 2; + len = (int) (strlen(home) + strlen(LESSHISTFILE) + 2); name = (char *) ecalloc(len, sizeof(char)); SNPRINTF2(name, len, "%s/%s", home, LESSHISTFILE); return (name); } -#endif /* CMD_HISTORY */ /* - * Initialize history from a .lesshist file. + * Read a .lesshst file and call a callback for each line in the file. */ - public void -init_cmdhist() + static void +read_cmdhist2(action, uparam, skip_search, skip_shell) + void (*action)(void*,struct mlist*,char*); + void *uparam; + int skip_search; + int skip_shell; { -#if CMD_HISTORY struct mlist *ml = NULL; char line[CMDBUF_SIZE]; char *filename; FILE *f; char *p; + int *skip = NULL; filename = histfile_name(); if (filename == NULL) @@ -1432,84 +1453,170 @@ init_cmdhist() } } if (strcmp(line, HISTFILE_SEARCH_SECTION) == 0) + { ml = &mlist_search; - else if (strcmp(line, HISTFILE_SHELL_SECTION) == 0) + skip = &skip_search; + } else if (strcmp(line, HISTFILE_SHELL_SECTION) == 0) { #if SHELL_ESCAPE || PIPEC ml = &mlist_shell; + skip = &skip_shell; #else ml = NULL; + skip = NULL; #endif } else if (*line == '"') { if (ml != NULL) - cmd_addhist(ml, line+1); + { + if (skip != NULL && *skip > 0) + --(*skip); + else + (*action)(uparam, ml, line+1); + } } } fclose(f); +} + + static void +read_cmdhist(action, uparam, skip_search, skip_shell) + void (*action)(void*,struct mlist*,char*); + void *uparam; + int skip_search; + int skip_shell; +{ + read_cmdhist2(action, uparam, skip_search, skip_shell); + (*action)(uparam, NULL, NULL); /* signal end of file */ +} + + static void +addhist_init(void *uparam, struct mlist *ml, char *string) +{ + if (ml == NULL || string == NULL) + return; + cmd_addhist(ml, string, 0); +} +#endif /* CMD_HISTORY */ + +/* + * Initialize history from a .lesshist file. + */ + public void +init_cmdhist() *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jan 5 09:18:45 2016 Return-Path: Delivered-To: svn-src-head@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 69201A5F639; Tue, 5 Jan 2016 09:18:45 +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 195911CC4; Tue, 5 Jan 2016 09:18:45 +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 u059IiSv058931; Tue, 5 Jan 2016 09:18:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u059IiBY058930; Tue, 5 Jan 2016 09:18:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601050918.u059IiBY058930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 Jan 2016 09:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293192 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 09:18:45 -0000 Author: hselasky Date: Tue Jan 5 09:18:43 2016 New Revision: 293192 URL: https://svnweb.freebsd.org/changeset/base/293192 Log: Fix for directly connected FULL or LOW speed USB devices. Found by: Sebastian Huber MFC after: 1 week Modified: head/sys/dev/usb/controller/dwc_otg.c Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Tue Jan 5 08:10:06 2016 (r293191) +++ head/sys/dev/usb/controller/dwc_otg.c Tue Jan 5 09:18:43 2016 (r293192) @@ -456,6 +456,18 @@ dwc_otg_init_fifo(struct dwc_otg_softc * return (0); } +static uint8_t +dwc_otg_uses_split(struct usb_device *udev) +{ + /* + * When a LOW or FULL speed device is connected directly to + * the USB port we don't use split transactions: + */ + return (udev->speed != USB_SPEED_HIGH && + udev->parent_hs_hub != NULL && + udev->parent_hs_hub->parent_hub != NULL); +} + static void dwc_otg_update_host_frame_interval(struct dwc_otg_softc *sc) { @@ -3329,16 +3341,16 @@ dwc_otg_setup_standard_chain(struct usb_ else hcchar |= (td->ep_type << HCCHAR_EPTYPE_SHIFT); - if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_LOW) - hcchar |= HCCHAR_LSPDDEV; if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) hcchar |= HCCHAR_EPDIR_IN; switch (xfer->xroot->udev->speed) { - case USB_SPEED_FULL: case USB_SPEED_LOW: + hcchar |= HCCHAR_LSPDDEV; + /* FALLTHROUGH */ + case USB_SPEED_FULL: /* check if root HUB port is running High Speed */ - if (xfer->xroot->udev->parent_hs_hub != NULL) { + if (dwc_otg_uses_split(xfer->xroot->udev)) { hcsplt = HCSPLT_SPLTENA | (xfer->xroot->udev->hs_port_no << HCSPLT_PRTADDR_SHIFT) | @@ -4160,7 +4172,10 @@ dwc_otg_device_isoc_start(struct usb_xfe framenum = DSTS_SOFFN_GET(temp); } - if (xfer->xroot->udev->parent_hs_hub != NULL) + /* + * Check if port is doing 8000 or 1000 frames per second: + */ + if (sc->sc_flags.status_high_speed) framenum /= 8; framenum &= DWC_OTG_FRAME_MASK; @@ -4837,7 +4852,7 @@ dwc_otg_xfer_setup(struct usb_setup_para td = USB_ADD_BYTES(parm->buf, parm->size[0]); /* compute shared bandwidth resource index for TT */ - if (parm->udev->parent_hs_hub != NULL && parm->udev->speed != USB_SPEED_HIGH) { + if (dwc_otg_uses_split(parm->udev)) { if (parm->udev->parent_hs_hub->ddesc.bDeviceProtocol == UDPROTO_HSHUBMTT) td->tt_index = parm->udev->device_index; else From owner-svn-src-head@freebsd.org Tue Jan 5 10:25:24 2016 Return-Path: Delivered-To: svn-src-head@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 1D978A60F7F; Tue, 5 Jan 2016 10:25:24 +0000 (UTC) (envelope-from uqs@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 E23DE1B25; Tue, 5 Jan 2016 10:25:23 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05APMls079492; Tue, 5 Jan 2016 10:25:22 GMT (envelope-from uqs@FreeBSD.org) Received: (from uqs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05APMcf079491; Tue, 5 Jan 2016 10:25:22 GMT (envelope-from uqs@FreeBSD.org) Message-Id: <201601051025.u05APMcf079491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: uqs set sender to uqs@FreeBSD.org using -f From: Ulrich Spoerlein Date: Tue, 5 Jan 2016 10:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293193 - head/sys/dev/asmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 10:25:24 -0000 Author: uqs Date: Tue Jan 5 10:25:22 2016 New Revision: 293193 URL: https://svnweb.freebsd.org/changeset/base/293193 Log: Fix undefined behavior when using asmc_fan_getstring() It was returning a pointer to stack-allocated memory, so make the allocation at the caller instead. Found by: clang static analyzer Coverity: CID 1245774 Reviewed by: ed, rpaulo Review URL: https://reviews.freebsd.org/D4740 Modified: head/sys/dev/asmc/asmc.c Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Tue Jan 5 09:18:43 2016 (r293192) +++ head/sys/dev/asmc/asmc.c Tue Jan 5 10:25:22 2016 (r293193) @@ -963,14 +963,13 @@ asmc_fan_getvalue(device_t dev, const ch } static char* -asmc_fan_getstring(device_t dev, const char *key, int fan) +asmc_fan_getstring(device_t dev, const char *key, int fan, uint8_t *buf, uint8_t buflen) { - uint8_t buf[16]; char fankey[5]; char* desc; snprintf(fankey, sizeof(fankey), key, fan); - if (asmc_key_read(dev, fankey, buf, sizeof buf) < 0) + if (asmc_key_read(dev, fankey, buf, buflen) < 0) return (NULL); desc = buf+4; @@ -1012,12 +1011,13 @@ asmc_mb_sysctl_fanspeed(SYSCTL_HANDLER_A static int asmc_mb_sysctl_fanid(SYSCTL_HANDLER_ARGS) { + uint8_t buf[16]; device_t dev = (device_t) arg1; int fan = arg2; int error = true; char* desc; - desc = asmc_fan_getstring(dev, ASMC_KEY_FANID, fan); + desc = asmc_fan_getstring(dev, ASMC_KEY_FANID, fan, buf, sizeof(buf)); if (desc != NULL) error = sysctl_handle_string(oidp, desc, 0, req); From owner-svn-src-head@freebsd.org Tue Jan 5 12:22:46 2016 Return-Path: Delivered-To: svn-src-head@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 C4170A6343E; Tue, 5 Jan 2016 12:22:46 +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 84A251A3E; Tue, 5 Jan 2016 12:22:46 +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 u05CMjEg014847; Tue, 5 Jan 2016 12:22:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05CMjq5014845; Tue, 5 Jan 2016 12:22:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601051222.u05CMjq5014845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 Jan 2016 12:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293194 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 12:22:46 -0000 Author: hselasky Date: Tue Jan 5 12:22:45 2016 New Revision: 293194 URL: https://svnweb.freebsd.org/changeset/base/293194 Log: Implement RCU mechanism using shared exclusive locks. MFC after: 1 week Sponsored by: Mellanox Technologies Added: head/sys/compat/linuxkpi/common/include/linux/rcupdate.h (contents, props changed) Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Added: head/sys/compat/linuxkpi/common/include/linux/rcupdate.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/rcupdate.h Tue Jan 5 12:22:45 2016 (r293194) @@ -0,0 +1,76 @@ +/*- + * Copyright (c) 2016 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 unmodified, 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 THE AUTHOR ``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 THE AUTHOR 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 _LINUX_RCUPDATE_H_ +#define _LINUX_RCUPDATE_H_ + +#include +#include +#include + +extern struct sx linux_global_rcu_lock; + +struct rcu_head { +}; + +typedef void (*rcu_callback_t)(struct rcu_head *); + +static inline void +call_rcu(struct rcu_head *ptr, rcu_callback_t func) +{ + sx_xlock(&linux_global_rcu_lock); + func(ptr); + sx_xunlock(&linux_global_rcu_lock); +} + +static inline void +rcu_read_lock(void) +{ + sx_slock(&linux_global_rcu_lock); +} + +static inline void +rcu_read_unlock(void) +{ + sx_sunlock(&linux_global_rcu_lock); +} + +static inline void +rcu_barrier(void) +{ + sx_xlock(&linux_global_rcu_lock); + sx_xunlock(&linux_global_rcu_lock); +} + +static inline void +synchronize_rcu(void) +{ + sx_xlock(&linux_global_rcu_lock); + sx_xunlock(&linux_global_rcu_lock); +} + +#endif /* _LINUX_RCUPDATE_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Tue Jan 5 10:25:22 2016 (r293193) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Tue Jan 5 12:22:45 2016 (r293194) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -84,6 +85,7 @@ struct list_head pci_drivers; struct list_head pci_devices; struct net init_net; spinlock_t pci_lock; +struct sx linux_global_rcu_lock; unsigned long linux_timer_hz_mask; @@ -1142,6 +1144,8 @@ linux_compat_init(void *arg) struct sysctl_oid *rootoid; int i; + sx_init(&linux_global_rcu_lock, "LinuxGlobalRCU"); + rootoid = SYSCTL_ADD_ROOT_NODE(NULL, OID_AUTO, "sys", CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, "sys"); kobject_init(&linux_class_root, &linux_class_ktype); @@ -1171,6 +1175,9 @@ linux_compat_uninit(void *arg) linux_kobject_kfree_name(&linux_class_root); linux_kobject_kfree_name(&linux_root_device.kobj); linux_kobject_kfree_name(&linux_class_misc.kobj); + + synchronize_rcu(); + sx_destroy(&linux_global_rcu_lock); } SYSUNINIT(linux_compat, SI_SUB_DRIVERS, SI_ORDER_SECOND, linux_compat_uninit, NULL); From owner-svn-src-head@freebsd.org Tue Jan 5 14:48:42 2016 Return-Path: Delivered-To: svn-src-head@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 14679A63102; Tue, 5 Jan 2016 14:48:42 +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 B7D7015F1; Tue, 5 Jan 2016 14:48:41 +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 u05EmeT8057407; Tue, 5 Jan 2016 14:48:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05Eme83057405; Tue, 5 Jan 2016 14:48:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601051448.u05Eme83057405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 5 Jan 2016 14:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293197 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 14:48:42 -0000 Author: kib Date: Tue Jan 5 14:48:40 2016 New Revision: 293197 URL: https://svnweb.freebsd.org/changeset/base/293197 Log: Two fixes for excessive iterations after r292326. Advance the logical block number to the lblkno of the found block plus one, instead of incrementing the block number which was used for lookup. This change skips sparcely populated buffer ranges, similar to r292325, instead of doing useless lookups. Do not restart the bnoreuselist() from the start of the range if buffer lock cannot be obtained without sleep. Only retry lookup and lock for the same queue and same logical block number. Reported by: benno Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/vfs_default.c head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Tue Jan 5 14:21:02 2016 (r293196) +++ head/sys/kern/vfs_default.c Tue Jan 5 14:48:40 2016 (r293197) @@ -1080,15 +1080,9 @@ vop_stdadvise(struct vop_advise_args *ap bsize = vp->v_bufobj.bo_bsize; startn = ap->a_start / bsize; endn = ap->a_end / bsize; - for (;;) { - error = bnoreuselist(&bo->bo_clean, bo, startn, endn); - if (error == EAGAIN) - continue; + error = bnoreuselist(&bo->bo_clean, bo, startn, endn); + if (error == 0) error = bnoreuselist(&bo->bo_dirty, bo, startn, endn); - if (error == EAGAIN) - continue; - break; - } BO_RUNLOCK(bo); VOP_UNLOCK(vp, 0); break; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Jan 5 14:21:02 2016 (r293196) +++ head/sys/kern/vfs_subr.c Tue Jan 5 14:48:40 2016 (r293197) @@ -1669,7 +1669,8 @@ bnoreuselist(struct bufv *bufv, struct b ASSERT_BO_LOCKED(bo); - for (lblkno = startn;; lblkno++) { + for (lblkno = startn;;) { +again: bp = BUF_PCTRIE_LOOKUP_GE(&bufv->bv_root, lblkno); if (bp == NULL || bp->b_lblkno >= endn) break; @@ -1677,11 +1678,14 @@ bnoreuselist(struct bufv *bufv, struct b LK_INTERLOCK, BO_LOCKPTR(bo), "brlsfl", 0, 0); if (error != 0) { BO_RLOCK(bo); - return (error != ENOLCK ? error : EAGAIN); + if (error == ENOLCK) + goto again; + return (error); } KASSERT(bp->b_bufobj == bo, ("bp %p wrong b_bufobj %p should be %p", bp, bp->b_bufobj, bo)); + lblkno = bp->b_lblkno + 1; if ((bp->b_flags & B_MANAGED) == 0) bremfree(bp); bp->b_flags |= B_RELBUF; From owner-svn-src-head@freebsd.org Tue Jan 5 15:52:18 2016 Return-Path: Delivered-To: svn-src-head@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 247D4A6241A; Tue, 5 Jan 2016 15:52:18 +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 E47841A26; Tue, 5 Jan 2016 15:52:17 +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 u05FqHhT078075; Tue, 5 Jan 2016 15:52:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05FqHhe078074; Tue, 5 Jan 2016 15:52:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601051552.u05FqHhe078074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 5 Jan 2016 15:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293201 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 15:52:18 -0000 Author: emaste Date: Tue Jan 5 15:52:16 2016 New Revision: 293201 URL: https://svnweb.freebsd.org/changeset/base/293201 Log: rtld: populate DT_DEBUG iff DYNAMIC segment is writable MIPS has/had a read-only DYNAMIC segment, and uses an extra level of indirection (through MIPS_RLD_MAP) to locate the debugger rendezvous data. Some linkers (e.g. LLVM's lld) may produce MIPS binaries with a writable DYNAMIC segment, which would allow us to eventually drop a special case. Therefore, instead of hardcoding knowledge that DYNAMIC is not writable on MIPS just check the permissions on the segment. Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4791 Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Jan 5 15:50:50 2016 (r293200) +++ head/libexec/rtld-elf/rtld.c Tue Jan 5 15:52:16 2016 (r293201) @@ -1144,13 +1144,13 @@ digest_dynamic1(Obj_Entry *obj, int earl * is mapped read-only. DT_MIPS_RLD_MAP is used instead. */ -#ifndef __mips__ case DT_DEBUG: + if (!obj->writable_dynamic) + break; if (!early) dbg("Filling in DT_DEBUG entry"); ((Elf_Dyn*)dynp)->d_un.d_ptr = (Elf_Addr) &r_debug; break; -#endif case DT_FLAGS: if (dynp->d_un.d_val & DF_ORIGIN) @@ -1331,6 +1331,8 @@ digest_phdr(const Elf_Phdr *phdr, int ph break; case PT_DYNAMIC: + if (ph->p_flags & PROT_WRITE) + obj->writable_dynamic = true; obj->dynamic = (const Elf_Dyn *)(ph->p_vaddr + obj->relocbase); break; From owner-svn-src-head@freebsd.org Tue Jan 5 15:55:46 2016 Return-Path: Delivered-To: svn-src-head@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 87A12A62540; Tue, 5 Jan 2016 15:55:46 +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 54C401C3F; Tue, 5 Jan 2016 15:55:46 +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 u05FtjHO078234; Tue, 5 Jan 2016 15:55:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05FtjDY078233; Tue, 5 Jan 2016 15:55:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601051555.u05FtjDY078233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 5 Jan 2016 15:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293202 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 15:55:46 -0000 Author: emaste Date: Tue Jan 5 15:55:45 2016 New Revision: 293202 URL: https://svnweb.freebsd.org/changeset/base/293202 Log: rtld: populate DT_DEBUG iff DYNAMIC segment is writable rtld.h was accidentally missed in r293201 Modified: head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Tue Jan 5 15:52:16 2016 (r293201) +++ head/libexec/rtld-elf/rtld.h Tue Jan 5 15:55:45 2016 (r293202) @@ -264,6 +264,7 @@ typedef struct Struct_Obj_Entry { bool valid_hash_sysv : 1; /* A valid System V hash hash tag is available */ bool valid_hash_gnu : 1; /* A valid GNU hash tag is available */ bool dlopened : 1; /* dlopen()-ed (vs. load statically) */ + bool writable_dynamic : 1; /* PT_DYNAMIC is writable */ struct link_map linkmap; /* For GDB and dlinfo() */ Objlist dldags; /* Object belongs to these dlopened DAGs (%) */ From owner-svn-src-head@freebsd.org Tue Jan 5 16:21:22 2016 Return-Path: Delivered-To: svn-src-head@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 255D8A62E6A; Tue, 5 Jan 2016 16:21:22 +0000 (UTC) (envelope-from jilles@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 0253E1CCC; Tue, 5 Jan 2016 16:21:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05GLLgA084753; Tue, 5 Jan 2016 16:21:21 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05GLKUf084749; Tue, 5 Jan 2016 16:21:20 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601051621.u05GLKUf084749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 5 Jan 2016 16:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293204 - in head: include lib/libc/gen usr.sbin/cron/crontab X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 16:21:22 -0000 Author: jilles Date: Tue Jan 5 16:21:20 2016 New Revision: 293204 URL: https://svnweb.freebsd.org/changeset/base/293204 Log: Add sbin and /usr/local directories to _PATH_DEFPATH. Set _PATH_DEFPATH to /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin. This is the path in the default class in the default /etc/login.conf, excluding ~/bin which would not be expanded properly in a string constant. For normal logins, _PATH_DEFPATH is overridden by /etc/login.conf, ~/.login_conf or shell startup files. _PATH_DEFPATH is still used as a default by execlp(), execvp(), posix_spawnp() and sh if PATH is not set, and by cron. Especially the latter is a common trap (most recently in PR 204813). PR: 204813 Reviewed by: secteam (delphij), alfred Modified: head/include/paths.h head/lib/libc/gen/exec.3 head/lib/libc/gen/posix_spawn.3 head/usr.sbin/cron/crontab/crontab.5 Modified: head/include/paths.h ============================================================================== --- head/include/paths.h Tue Jan 5 16:08:26 2016 (r293203) +++ head/include/paths.h Tue Jan 5 16:21:20 2016 (r293204) @@ -36,7 +36,7 @@ #include /* Default search path. */ -#define _PATH_DEFPATH "/usr/bin:/bin" +#define _PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" /* All standard utilities path. */ #define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" /* Locate system binaries. */ @@ -108,7 +108,7 @@ __END_DECLS #ifdef RESCUE #undef _PATH_DEFPATH -#define _PATH_DEFPATH "/rescue:/usr/bin:/bin" +#define _PATH_DEFPATH "/rescue:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" #undef _PATH_STDPATH #define _PATH_STDPATH "/rescue:/usr/bin:/bin:/usr/sbin:/sbin" #undef _PATH_SYSPATH Modified: head/lib/libc/gen/exec.3 ============================================================================== --- head/lib/libc/gen/exec.3 Tue Jan 5 16:08:26 2016 (r293203) +++ head/lib/libc/gen/exec.3 Tue Jan 5 16:21:20 2016 (r293204) @@ -28,7 +28,7 @@ .\" @(#)exec.3 8.3 (Berkeley) 1/24/94 .\" $FreeBSD$ .\" -.Dd December 12, 2015 +.Dd January 5, 2016 .Dt EXEC 3 .Os .Sh NAME @@ -161,7 +161,7 @@ the default path is set according to the definition in .In paths.h , which is set to -.Dq Ev /usr/bin:/bin . +.Dq Ev /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin . For .Fn execvP , the search path is specified as an argument to the function. Modified: head/lib/libc/gen/posix_spawn.3 ============================================================================== --- head/lib/libc/gen/posix_spawn.3 Tue Jan 5 16:08:26 2016 (r293203) +++ head/lib/libc/gen/posix_spawn.3 Tue Jan 5 16:21:20 2016 (r293204) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 17, 2011 +.Dd January 5, 2016 .Dt POSIX_SPAWN 3 .Os .Sh NAME @@ -126,7 +126,7 @@ the default path is set according to the definition in .In paths.h , which is set to -.Dq Ev /usr/bin:/bin . +.Dq Ev /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin . .Pp If .Fa file_actions Modified: head/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- head/usr.sbin/cron/crontab/crontab.5 Tue Jan 5 16:08:26 2016 (r293203) +++ head/usr.sbin/cron/crontab/crontab.5 Tue Jan 5 16:21:20 2016 (r293204) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 28, 2012 +.Dd January 5, 2016 .Dt CRONTAB 5 .Os .Sh NAME @@ -74,7 +74,7 @@ is set to .Pa /bin/sh , .Ev PATH is set to -.Pa /usr/bin:/bin , +.Pa /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin , and .Ev LOGNAME and From owner-svn-src-head@freebsd.org Tue Jan 5 20:09:28 2016 Return-Path: Delivered-To: svn-src-head@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 1DFE6A6326C; Tue, 5 Jan 2016 20:09:28 +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 E1D7117CB; Tue, 5 Jan 2016 20:09:27 +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 u05K9QHS053909; Tue, 5 Jan 2016 20:09:27 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05K9QxK053908; Tue, 5 Jan 2016 20:09:26 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601052009.u05K9QxK053908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 5 Jan 2016 20:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293219 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 20:09:28 -0000 Author: avos Date: Tue Jan 5 20:09:26 2016 New Revision: 293219 URL: https://svnweb.freebsd.org/changeset/base/293219 Log: iwm: revert r293178 This optimization is not proper (and causes kernel panic), since driver checks fw_status to optimize away parsing stage if it was already done. Reported by: dchagin Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Tue Jan 5 19:52:16 2016 (r293218) +++ head/sys/dev/iwm/if_iwm.c Tue Jan 5 20:09:26 2016 (r293219) @@ -2041,7 +2041,6 @@ iwm_mvm_load_ucode_wait_alive(struct iwm sc->sc_uc_current = ucode_type; error = iwm_start_fw(sc, ucode_type); - iwm_fw_info_free(&sc->sc_fw); if (error) { sc->sc_uc_current = old_type; return error; @@ -4937,6 +4936,7 @@ iwm_suspend(device_t dev) static int iwm_detach_local(struct iwm_softc *sc, int do_net80211) { + struct iwm_fw_info *fw = &sc->sc_fw; device_t dev = sc->sc_dev; int i; @@ -4953,6 +4953,10 @@ iwm_detach_local(struct iwm_softc *sc, i for (i = 0; i < nitems(sc->txq); i++) iwm_free_tx_ring(sc, &sc->txq[i]); + /* Free firmware */ + if (fw->fw_fp != NULL) + iwm_fw_info_free(fw); + /* Free scheduler */ iwm_free_sched(sc); if (sc->ict_dma.vaddr != NULL) From owner-svn-src-head@freebsd.org Tue Jan 5 20:42:21 2016 Return-Path: Delivered-To: svn-src-head@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 36F94A63C3F; Tue, 5 Jan 2016 20:42:21 +0000 (UTC) (envelope-from cem@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 E10811B9E; Tue, 5 Jan 2016 20:42:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05KgJ59065245; Tue, 5 Jan 2016 20:42:19 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05KgJmr065241; Tue, 5 Jan 2016 20:42:19 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201601052042.u05KgJmr065241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 5 Jan 2016 20:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293221 - in head: share/man/man4 sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 20:42:21 -0000 Author: cem Date: Tue Jan 5 20:42:19 2016 New Revision: 293221 URL: https://svnweb.freebsd.org/changeset/base/293221 Log: ioat(4): Add ioat_get_max_io_size() KPI Consumers need to know the permitted IO size to send maximally sized chunks to the hardware. Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/ioat.4 head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat.h Modified: head/share/man/man4/ioat.4 ============================================================================== --- head/share/man/man4/ioat.4 Tue Jan 5 20:37:36 2016 (r293220) +++ head/share/man/man4/ioat.4 Tue Jan 5 20:42:19 2016 (r293221) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 17, 2015 +.Dd January 5, 2016 .Dt IOAT 4 .Os .Sh NAME @@ -65,6 +65,8 @@ In .Fn ioat_put_dmaengine "bus_dmaengine_t dmaengine" .Ft int .Fn ioat_get_hwversion "bus_dmaengine_t dmaengine" +.Ft size_t +.Fn ioat_get_max_io_size "bus_dmaengine_t dmaengine" .Ft int .Fn ioat_set_interrupt_coalesce "bus_dmaengine_t dmaengine" "uint16_t delay" .Ft uint16_t Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Tue Jan 5 20:37:36 2016 (r293220) +++ head/sys/dev/ioat/ioat.c Tue Jan 5 20:42:19 2016 (r293221) @@ -744,6 +744,15 @@ ioat_get_hwversion(bus_dmaengine_t dmaen return (ioat->version); } +size_t +ioat_get_max_io_size(bus_dmaengine_t dmaengine) +{ + struct ioat_softc *ioat; + + ioat = to_ioat_softc(dmaengine); + return (ioat->max_xfer_size); +} + int ioat_set_interrupt_coalesce(bus_dmaengine_t dmaengine, uint16_t delay) { Modified: head/sys/dev/ioat/ioat.h ============================================================================== --- head/sys/dev/ioat/ioat.h Tue Jan 5 20:37:36 2016 (r293220) +++ head/sys/dev/ioat/ioat.h Tue Jan 5 20:42:19 2016 (r293221) @@ -70,6 +70,7 @@ void ioat_put_dmaengine(bus_dmaengine_t /* Check the DMA engine's HW version */ int ioat_get_hwversion(bus_dmaengine_t dmaengine); +size_t ioat_get_max_io_size(bus_dmaengine_t dmaengine); /* * Set interrupt coalescing on a DMA channel. From owner-svn-src-head@freebsd.org Tue Jan 5 21:05:19 2016 Return-Path: Delivered-To: svn-src-head@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 392BEA62514; Tue, 5 Jan 2016 21:05:19 +0000 (UTC) (envelope-from gjb@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 0AE4D19DE; Tue, 5 Jan 2016 21:05:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05L5Icf071602; Tue, 5 Jan 2016 21:05:18 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05L5HLi071593; Tue, 5 Jan 2016 21:05:17 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201601052105.u05L5HLi071593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 Jan 2016 21:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 21:05:19 -0000 Author: gjb Date: Tue Jan 5 21:05:17 2016 New Revision: 293223 URL: https://svnweb.freebsd.org/changeset/base/293223 Log: Merge ^/projects/release-install-debug: - Rework MANIFEST generation and parsing via bsdinstall(8). - Allow selecting debugging distribution sets during install. - Rework bsdinstall(8) to fetch remote debug distribution sets when they are not available on the local install medium. - Allow selecting additional non-GENERIC kernels during install. At present, GENERIC is still required, and installed by default. Tested with: head@r293203 Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 head/release/Makefile head/release/amd64/mkisoimages.sh head/release/i386/mkisoimages.sh head/release/pc98/mkisoimages.sh head/release/powerpc/mkisoimages.sh head/release/scripts/make-manifest.sh head/release/sparc64/mkisoimages.sh head/usr.sbin/bsdinstall/scripts/auto Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jan 5 20:53:59 2016 (r293222) +++ head/Makefile.inc1 Tue Jan 5 21:05:17 2016 (r293223) @@ -1284,27 +1284,43 @@ packagekernel: .if defined(NO_ROOT) .if !defined(NO_INSTALLKERNEL) cd ${DESTDIR}/${DISTDIR}/kernel; \ - tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \ + tar cvf - --exclude '*.debug' \ + @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif + cd ${DESTDIR}/${DISTDIR}/kernel; \ + tar cvf - --include '*/*/*.debug' \ + @${DESTDIR}/${DISTDIR}/kernel.meta | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz .if ${BUILDKERNELS:[#]} > 1 .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ - tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ + tar cvf - --exclude '*.debug' \ + @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz + cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ + tar cvf - --include '*/*/*.debug' \ + @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz .endfor .endif .else .if !defined(NO_INSTALLKERNEL) cd ${DESTDIR}/${DISTDIR}/kernel; \ - tar cvf - . | \ + tar cvf - --exclude '*.debug' . | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif + cd ${DESTDIR}/${DISTDIR}/kernel; \ + tar cvf - --include '*/*/*.debug' $$(eval find .) | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz .if ${BUILDKERNELS:[#]} > 1 .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ - tar cvf - . | \ + tar cvf - --exclude '*.debug' . | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz + cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ + tar cvf - --include '*/*/*.debug' $$(eval find .) | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz .endfor .endif .endif Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Jan 5 20:53:59 2016 (r293222) +++ head/release/Makefile Tue Jan 5 21:05:17 2016 (r293223) @@ -176,7 +176,7 @@ disc1: packagesystem MK_DEBUG_FILES=no # Copy distfiles mkdir -p ${.TARGET}/usr/freebsd-dist - for dist in MANIFEST $$(ls *.txz | grep -v -- '-dbg'); \ + for dist in MANIFEST $$(ls *.txz | grep -vE -- '(base|lib32)-dbg'); \ do cp $${dist} ${.TARGET}/usr/freebsd-dist; \ done # Copy documentation, if generated @@ -225,7 +225,7 @@ dvd: packagesystem MK_TESTS=no MK_DEBUG_FILES=no # Copy distfiles mkdir -p ${.TARGET}/usr/freebsd-dist - for dist in MANIFEST $$(ls *.txz | grep -v -- '-dbg'); \ + for dist in MANIFEST $$(ls *.txz | grep -v -- '(base|lib32)-dbg'); \ do cp $${dist} ${.TARGET}/usr/freebsd-dist; \ done # Copy documentation, if generated Modified: head/release/amd64/mkisoimages.sh ============================================================================== --- head/release/amd64/mkisoimages.sh Tue Jan 5 20:53:59 2016 (r293222) +++ head/release/amd64/mkisoimages.sh Tue Jan 5 21:05:17 2016 (r293223) @@ -56,5 +56,5 @@ NAME="$1"; shift publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab" makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@" -rm "$1/etc/fstab" +rm -f "$1/etc/fstab" rm -f efiboot.img Modified: head/release/i386/mkisoimages.sh ============================================================================== --- head/release/i386/mkisoimages.sh Tue Jan 5 20:53:59 2016 (r293222) +++ head/release/i386/mkisoimages.sh Tue Jan 5 21:05:17 2016 (r293223) @@ -42,4 +42,4 @@ NAME="$1"; shift publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab" makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@" -rm "$1/etc/fstab" +rm -f "$1/etc/fstab" Modified: head/release/pc98/mkisoimages.sh ============================================================================== --- head/release/pc98/mkisoimages.sh Tue Jan 5 20:53:59 2016 (r293222) +++ head/release/pc98/mkisoimages.sh Tue Jan 5 21:05:17 2016 (r293223) @@ -42,4 +42,4 @@ NAME="$1"; shift publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab" makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@" -rm "$1/etc/fstab" +rm -f "$1/etc/fstab" Modified: head/release/powerpc/mkisoimages.sh ============================================================================== --- head/release/powerpc/mkisoimages.sh Tue Jan 5 20:53:59 2016 (r293222) +++ head/release/powerpc/mkisoimages.sh Tue Jan 5 21:05:17 2016 (r293223) @@ -64,6 +64,6 @@ NAME="$1"; shift publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab" makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@" -rm "$1/etc/fstab" -rm /tmp/hfs-boot-block +rm -f "$1/etc/fstab" +rm -f /tmp/hfs-boot-block rm -rf "$1/ppc" Modified: head/release/scripts/make-manifest.sh ============================================================================== --- head/release/scripts/make-manifest.sh Tue Jan 5 20:53:59 2016 (r293222) +++ head/release/scripts/make-manifest.sh Tue Jan 5 21:05:17 2016 (r293223) @@ -9,18 +9,64 @@ # # $FreeBSD$ -desc_base="Base system (MANDATORY)" -desc_kernel="Kernel (MANDATORY)" -desc_doc="Additional documentation" -doc_default=off -desc_lib32="32-bit compatibility libraries" -desc_ports="Ports tree" -desc_src="System source code" -desc_tests="Test suite" -src_default=off -tests_default=off +base="Base system" +doc="Additional Documentation" +kernel="Kernel" +ports="Ports tree" +src="System source tree" +lib32="32-bit compatibility libraries" +tests="Test suite" -for i in $*; do - echo "`basename $i` `sha256 -q $i` `tar tvf $i | wc -l | tr -d ' '` `basename $i .txz` \"`eval echo \\\$desc_$(basename $i .txz)`\" `eval echo \\\${$(basename $i .txz)_default:-on}`" +desc_base="${base} (MANDATORY)" +desc_base_dbg="${base} (Debugging)" +desc_doc="${doc}" +desc_kernel="${kernel} (MANDATORY)" +desc_kernel_dbg="${kernel} (Debugging)" +desc_kernel_alt="Alternate ${kernel}" +desc_kernel_alt_dbg="Alternate ${kernel} (Debugging)" +desc_lib32="${lib32}" +desc_lib32_dbg="${lib32} (Debugging)" +desc_ports="${ports}" +desc_src="${src}" +desc_tests="${tests}" + +default_doc=off +default_src=off +default_tests=off +default_base_dbg=off +default_lib32_dbg=off +default_kernel_alt=off +default_kernel_dbg=on +default_kernel_alt_dbg=off + +for i in ${*}; do + dist="${i}" + distname="${i%%.txz}" + distname="$(echo ${distname} | tr '-' '_')" + distname="$(echo ${distname} | tr 'kernel.' 'kernel_')" + hash="$(sha256 -q ${i})" + nfiles="$(tar tvf ${i} | wc -l | tr -d ' ')" + default="$(eval echo \${default_${distname}:-on})" + desc="$(eval echo \"\${desc_${distname}}\")" + + case ${i} in + kernel-dbg.txz) + desc="${desc_kernel_dbg}" + ;; + kernel.*-dbg.txz) + desc="$(eval echo \"${desc_kernel_alt_dbg}\")" + desc="${desc}: $(eval echo ${i%%-dbg.txz} | cut -f 2 -d '.')" + default="$(eval echo \"${default_kernel_alt_dbg}\")" + ;; + kernel.*.txz) + desc="$(eval echo \"${desc_kernel_alt}\")" + desc="${desc}: $(eval echo ${i%%.txz} | cut -f 2 -d '.')" + default="$(eval echo \"${default_kernel_alt}\")" + ;; + *) + ;; + esac + + printf "${dist}\t${hash}\t${nfiles}\t${distname}\t\"${desc}\"\t${default}\n" done Modified: head/release/sparc64/mkisoimages.sh ============================================================================== --- head/release/sparc64/mkisoimages.sh Tue Jan 5 20:53:59 2016 (r293222) +++ head/release/sparc64/mkisoimages.sh Tue Jan 5 21:05:17 2016 (r293223) @@ -38,7 +38,7 @@ BASEBITSDIR="$1" publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$BASEBITSDIR/etc/fstab" makefs -t cd9660 -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME.tmp" "$@" -rm "$BASEBITSDIR/etc/fstab" +rm -f "$BASEBITSDIR/etc/fstab" if [ "x$BOPT" != "x-b" ]; then mv "$NAME.tmp" "$NAME" Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Tue Jan 5 20:53:59 2016 (r293222) +++ head/usr.sbin/bsdinstall/scripts/auto Tue Jan 5 21:05:17 2016 (r293223) @@ -115,7 +115,8 @@ bsdinstall hostname || error "Set hostna export DISTRIBUTIONS="base.txz kernel.txz" if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then - DISTMENU=`awk -F'\t' '!/^(kernel|base)/{print $4,$5,$6}' $BSDINSTALL_DISTDIR/MANIFEST` + DISTMENU=`awk -F'\t' '!/^(kernel\.txz|base\.txz)/{print $1,$5,$6}' $BSDINSTALL_DISTDIR/MANIFEST` + DISTMENU="$(echo ${DISTMENU} | sed -E 's/\.txz//g')" exec 3>&1 EXTRA_DISTS=$( eval dialog \ @@ -129,16 +130,20 @@ if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; done fi +LOCAL_DISTRIBUTIONS="MANIFEST" FETCH_DISTRIBUTIONS="" for dist in $DISTRIBUTIONS; do if [ ! -f $BSDINSTALL_DISTDIR/$dist ]; then FETCH_DISTRIBUTIONS="$FETCH_DISTRIBUTIONS $dist" + else + LOCAL_DISTRIBUTIONS="$LOCAL_DISTRIBUTIONS $dist" fi done +LOCAL_DISTRIBUTIONS=`echo $LOCAL_DISTRIBUTIONS` # Trim white space FETCH_DISTRIBUTIONS=`echo $FETCH_DISTRIBUTIONS` # Trim white space if [ -n "$FETCH_DISTRIBUTIONS" -a -n "$BSDINSTALL_CONFIGCURRENT" ]; then - dialog --backtitle "FreeBSD Installer" --title "Network Installation" --msgbox "No installation files were found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0 + dialog --backtitle "FreeBSD Installer" --title "Network Installation" --msgbox "Some installation files were not found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0 bsdinstall netconfig || error NETCONFIG_DONE=yes fi @@ -299,6 +304,7 @@ esac if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then ALL_DISTRIBUTIONS="$DISTRIBUTIONS" + WANT_DEBUG= # Download to a directory in the new system as scratch space BSDINSTALL_FETCHDEST="$BSDINSTALL_CHROOT/usr/freebsd-dist" @@ -310,15 +316,65 @@ if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then DISTDIR_IS_UNIONFS=1 mount_nullfs -o union "$BSDINSTALL_FETCHDEST" "$BSDINSTALL_DISTDIR" else - export DISTRIBUTIONS="$ALL_DISTRIBUTIONS" + export DISTRIBUTIONS="$FETCH_DISTRIBUTIONS" export BSDINSTALL_DISTDIR="$BSDINSTALL_FETCHDEST" fi export FTP_PASSIVE_MODE=YES - bsdinstall distfetch || error "Failed to fetch distribution" + # Iterate through the distribution list and set a flag if debugging + # distributions have been selected. + for _DISTRIBUTION in $DISTRIBUTIONS; do + case $_DISTRIBUTION in + *-dbg.*) + [ -e $BSDINSTALL_DISTDIR/$_DISTRIBUTION ] \ + && continue + WANT_DEBUG=1 + DEBUG_LIST="\n$DEBUG_LIST\n$_DISTRIBUTION" + ;; + *) + ;; + esac + done + + # Fetch the distributions. + bsdinstall distfetch + rc=$? + + if [ $rc -ne 0 ]; then + # If unable to fetch the remote distributions, recommend + # deselecting the debugging distributions, and retrying the + # installation, since failure to fetch *-dbg.txz should not + # be considered a fatal installation error. + msg="Failed to fetch remote distribution" + if [ ! -z "$WANT_DEBUG" ]; then + # Trim leading and trailing newlines. + DEBUG_LIST="${DEBUG_LIST%%\n}" + DEBUG_LIST="${DEBUG_LIST##\n}" + msg="$msg\n\nPlease deselect the following distributions" + msg="$msg and retry the installation:" + msg="$msg\n$DEBUG_LIST" + fi + error "$msg" + fi export DISTRIBUTIONS="$ALL_DISTRIBUTIONS" fi +if [ ! -z "$LOCAL_DISTRIBUTIONS" ]; then + # Download to a directory in the new system as scratch space + BSDINSTALL_FETCHDEST="$BSDINSTALL_CHROOT/usr/freebsd-dist" + mkdir -p "$BSDINSTALL_FETCHDEST" || error "Could not create directory $BSDINSTALL_FETCHDEST" + # Try to use any existing distfiles + if [ -d $BSDINSTALL_DISTDIR ]; then + DISTDIR_IS_UNIONFS=1 + mount_nullfs -o union "$BSDINSTALL_FETCHDEST" "$BSDINSTALL_DISTDIR" + export BSDINSTALL_DISTDIR="$BSDINSTALL_FETCHDEST" + fi + env DISTRIBUTIONS="$LOCAL_DISTRIBUTIONS" \ + BSDINSTALL_DISTSITE="file:///usr/freebsd-dist" \ + bsdinstall distfetch || \ + error "Failed to fetch distribution from local media" +fi + bsdinstall checksum || error "Distribution checksum failed" bsdinstall distextract || error "Distribution extract failed" bsdinstall rootpass || error "Could not set root password" From owner-svn-src-head@freebsd.org Tue Jan 5 21:20:47 2016 Return-Path: Delivered-To: svn-src-head@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 C0120A62A53; Tue, 5 Jan 2016 21:20:47 +0000 (UTC) (envelope-from imp@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 8D3351275; Tue, 5 Jan 2016 21:20:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05LKkrj074875; Tue, 5 Jan 2016 21:20:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05LKkvv074874; Tue, 5 Jan 2016 21:20:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601052120.u05LKkvv074874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 5 Jan 2016 21:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293226 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 21:20:47 -0000 Author: imp Date: Tue Jan 5 21:20:46 2016 New Revision: 293226 URL: https://svnweb.freebsd.org/changeset/base/293226 Log: Disable abi variant hook until strangeness with packages can be sorted out. Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Jan 5 21:12:49 2016 (r293225) +++ head/libexec/rtld-elf/rtld.c Tue Jan 5 21:20:46 2016 (r293226) @@ -435,7 +435,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ trust = !issetugid(); - md_abi_variant_hook(aux_info); +/* md_abi_variant_hook(aux_info); */ ld_bind_now = getenv(_LD("BIND_NOW")); /* From owner-svn-src-head@freebsd.org Tue Jan 5 21:20:48 2016 Return-Path: Delivered-To: svn-src-head@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 8EDBFA62A5B; Tue, 5 Jan 2016 21:20:48 +0000 (UTC) (envelope-from imp@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 623671278; Tue, 5 Jan 2016 21:20:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05LKlTF074920; Tue, 5 Jan 2016 21:20:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05LKlQw074919; Tue, 5 Jan 2016 21:20:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601052120.u05LKlQw074919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 5 Jan 2016 21:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293227 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 21:20:48 -0000 Author: imp Date: Tue Jan 5 21:20:47 2016 New Revision: 293227 URL: https://svnweb.freebsd.org/changeset/base/293227 Log: Use the more proper -f. Leave /bin/rm in place since that's what other rc scripts have, though it isn't strictly necessary. Modified: head/etc/rc Modified: head/etc/rc ============================================================================== --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226) +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) @@ -132,9 +132,9 @@ done # Remove the firstboot sentinel, and reboot if it was requested. if [ -e ${firstboot_sentinel} ]; then [ ${root_rw_mount} = "yes" ] || mount -uw / - /bin/rm ${firstboot_sentinel} + /bin/rm -f ${firstboot_sentinel} if [ -e ${firstboot_sentinel}-reboot ]; then - /bin/rm ${firstboot_sentinel}-reboot + /bin/rm -f ${firstboot_sentinel}-reboot [ ${root_rw_mount} = "yes" ] || mount -ur / kill -INT 1 fi From owner-svn-src-head@freebsd.org Wed Jan 6 00:00:08 2016 Return-Path: Delivered-To: svn-src-head@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 3A895A63C6D for ; Wed, 6 Jan 2016 00:00:08 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 1DBD810B1 for ; Wed, 6 Jan 2016 00:00:07 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 6 Jan 2016 00:00:39 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id u06004SN002360; Tue, 5 Jan 2016 17:00:04 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452038404.1320.46.camel@freebsd.org> Subject: Re: svn commit: r293227 - head/etc From: Ian Lepore To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 05 Jan 2016 17:00:04 -0700 In-Reply-To: <201601052120.u05LKlQw074919@repo.freebsd.org> References: <201601052120.u05LKlQw074919@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 00:00:08 -0000 On Tue, 2016-01-05 at 21:20 +0000, Warner Losh wrote: > Author: imp > Date: Tue Jan 5 21:20:47 2016 > New Revision: 293227 > URL: https://svnweb.freebsd.org/changeset/base/293227 > > Log: > Use the more proper -f. Leave /bin/rm in place since that's what > other rc scripts have, though it isn't strictly necessary. > > Modified: > head/etc/rc > > Modified: head/etc/rc > ===================================================================== > ========= > --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226) > +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) > @@ -132,9 +132,9 @@ done > # Remove the firstboot sentinel, and reboot if it was requested. > if [ -e ${firstboot_sentinel} ]; then > [ ${root_rw_mount} = "yes" ] || mount -uw / > - /bin/rm ${firstboot_sentinel} > + /bin/rm -f ${firstboot_sentinel} > if [ -e ${firstboot_sentinel}-reboot ]; then > - /bin/rm ${firstboot_sentinel}-reboot > + /bin/rm -f ${firstboot_sentinel}-reboot > [ ${root_rw_mount} = "yes" ] || mount -ur / > kill -INT 1 > fi > Using rm -f to suppress an error message seems like a bad idea here -- if the sentinel file can't be removed that implies it's going to do firstboot behavior every time it boots, and that's the sort of error that should be in-your-face. Especially on the reboot one because you're going to be stuck in a reboot loop with no error message. -- Ian From owner-svn-src-head@freebsd.org Wed Jan 6 00:00:13 2016 Return-Path: Delivered-To: svn-src-head@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 2682AA63C9A; Wed, 6 Jan 2016 00:00:13 +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 B5CAA110A; Wed, 6 Jan 2016 00:00:12 +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 u0600Ba4021623; Wed, 6 Jan 2016 00:00:11 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0600Bat021616; Wed, 6 Jan 2016 00:00:11 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201601060000.u0600Bat021616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 6 Jan 2016 00:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293229 - in head: etc/mtree usr.sbin/rpcbind usr.sbin/rpcbind/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 00:00:13 -0000 Author: asomers Date: Wed Jan 6 00:00:11 2016 New Revision: 293229 URL: https://svnweb.freebsd.org/changeset/base/293229 Log: "source routing" in rpcbind Fix a bug in rpcbind for multihomed hosts. If the server had interfaces on two separate subnets, and a client on the first subnet contacted rpcbind at the address on the second subnet, rpcbind would advertise addresses on the first subnet. This is a bug, because it should prefer to advertise the address where it was contacted. The requested service might be firewalled off from the address on the first subnet, for example. usr.sbin/rpcbind/check_bound.c If the address on which a request was received is known, pass that to addrmerge as the clnt_uaddr parameter. That is what addrmerge's comment indicates the parameter is supposed to mean. The previous behavior is that clnt_uaddr would contain the address from which the client sent the request. usr.sbin/rpcbind/util.c Modify addrmerge to prefer to use an IP that is equal to clnt_uaddr, if one is found. Refactor the relevant portion of the function for clarity, and to reduce the number of ifdefs. etc/mtree/BSD.tests.dist usr.sbin/rpcbind/tests/Makefile usr.sbin/rpcbind/tests/addrmerge_test.c Add unit tests for usr.sbin/rpcbind/util.c:addrmerge. usr.sbin/rpcbind/check_bound.c usr.sbin/rpcbind/rpcbind.h usr.sbin/rpcbind/util.c Constify some function arguments Reviewed by: imp MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4690 Added: head/usr.sbin/rpcbind/tests/ head/usr.sbin/rpcbind/tests/Makefile (contents, props changed) head/usr.sbin/rpcbind/tests/addrmerge_test.c (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.sbin/rpcbind/Makefile head/usr.sbin/rpcbind/check_bound.c head/usr.sbin/rpcbind/rpcbind.h head/usr.sbin/rpcbind/util.c Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Tue Jan 5 22:27:34 2016 (r293228) +++ head/etc/mtree/BSD.tests.dist Wed Jan 6 00:00:11 2016 (r293229) @@ -622,6 +622,8 @@ .. pw .. + rpcbind + .. sa .. .. Modified: head/usr.sbin/rpcbind/Makefile ============================================================================== --- head/usr.sbin/rpcbind/Makefile Tue Jan 5 22:27:34 2016 (r293228) +++ head/usr.sbin/rpcbind/Makefile Wed Jan 6 00:00:11 2016 (r293229) @@ -14,6 +14,10 @@ CFLAGS+= -DPORTMAP -DLIBWRAP CFLAGS+= -DINET6 .endif +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + WARNS?= 1 LIBADD= wrap Modified: head/usr.sbin/rpcbind/check_bound.c ============================================================================== --- head/usr.sbin/rpcbind/check_bound.c Tue Jan 5 22:27:34 2016 (r293228) +++ head/usr.sbin/rpcbind/check_bound.c Wed Jan 6 00:00:11 2016 (r293229) @@ -50,6 +50,7 @@ static char sccsid[] = "@(#)check_bound. #include #include #include +#include #include #include #include @@ -159,6 +160,7 @@ char * mergeaddr(SVCXPRT *xprt, char *netid, char *uaddr, char *saddr) { struct fdlist *fdl; + struct svc_dg_data *dg_data; char *c_uaddr, *s_uaddr, *m_uaddr, *allocated_uaddr = NULL; for (fdl = fdhead; fdl; fdl = fdl->next) @@ -170,11 +172,20 @@ mergeaddr(SVCXPRT *xprt, char *netid, ch /* that server died */ return (nullstring); /* + * Try to determine the local address on which the client contacted us, + * so we can send a reply from the same address. If it's unknown, then + * try to determine which address the client used, and pick a nearby + * local address. + * * If saddr is not NULL, the remote client may have included the * address by which it contacted us. Use that for the "client" uaddr, * otherwise use the info from the SVCXPRT. */ - if (saddr != NULL) { + dg_data = (struct svc_dg_data*)xprt->xp_p2; + if (dg_data != NULL && dg_data->su_srcaddr.buf != NULL) { + c_uaddr = taddr2uaddr(fdl->nconf, &dg_data->su_srcaddr); + } + else if (saddr != NULL) { c_uaddr = saddr; } else { c_uaddr = taddr2uaddr(fdl->nconf, svc_getrpccaller(xprt)); @@ -217,7 +228,7 @@ mergeaddr(SVCXPRT *xprt, char *netid, ch * structure should not be freed. */ struct netconfig * -rpcbind_get_conf(char *netid) +rpcbind_get_conf(const char *netid) { struct fdlist *fdl; Modified: head/usr.sbin/rpcbind/rpcbind.h ============================================================================== --- head/usr.sbin/rpcbind/rpcbind.h Tue Jan 5 22:27:34 2016 (r293228) +++ head/usr.sbin/rpcbind/rpcbind.h Wed Jan 6 00:00:11 2016 (r293229) @@ -85,7 +85,7 @@ extern char *tcp_uaddr; /* Universal TC int add_bndlist(struct netconfig *, struct netbuf *); bool_t is_bound(char *, char *); char *mergeaddr(SVCXPRT *, char *, char *, char *); -struct netconfig *rpcbind_get_conf(char *); +struct netconfig *rpcbind_get_conf(const char *); void rpcbs_init(void); void rpcbs_procinfo(rpcvers_t, rpcproc_t); @@ -134,8 +134,8 @@ extern void pmap_service(struct svc_req void write_warmstart(void); void read_warmstart(void); -char *addrmerge(struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr, - char *netid); +char *addrmerge(struct netbuf *caller, const char *serv_uaddr, + const char *clnt_uaddr, char const *netid); int listen_addr(const struct sockaddr *sa); void network_init(void); struct sockaddr *local_sa(int); Added: head/usr.sbin/rpcbind/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/rpcbind/tests/Makefile Wed Jan 6 00:00:11 2016 (r293229) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +.include + +.PATH: ${.CURDIR}/.. + +ATF_TESTS_C= addrmerge_test +CFLAGS+= -I${.CURDIR}/.. -Wno-cast-qual +SRCS.addrmerge_test= addrmerge_test.c util.c + +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+= -DINET6 +.endif + +WARNS?= 3 + +.include Added: head/usr.sbin/rpcbind/tests/addrmerge_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/rpcbind/tests/addrmerge_test.c Wed Jan 6 00:00:11 2016 (r293229) @@ -0,0 +1,849 @@ +/*- + * Copyright (c) 2014 Spectra Logic Corporation + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include + +#include "rpcbind.h" + +#define MAX_IFADDRS 16 + +int debugging = false; + +/* Data for mocking getifaddrs */ +struct ifaddr_storage { + struct ifaddrs ifaddr; + struct sockaddr_storage addr; + struct sockaddr_storage mask; + struct sockaddr_storage bcast; +} mock_ifaddr_storage[MAX_IFADDRS]; +struct ifaddrs *mock_ifaddrs = NULL; +int ifaddr_count = 0; + +/* Data for mocking listen_addr */ +int bind_address_count = 0; +struct sockaddr* bind_addresses[MAX_IFADDRS]; + +/* Stub library functions */ +void +freeifaddrs(struct ifaddrs *ifp __unused) +{ + return ; +} + +int +getifaddrs(struct ifaddrs **ifap) +{ + *ifap = mock_ifaddrs; + return (0); +} + +static void +mock_ifaddr4(const char* name, const char* addr, const char* mask, + const char* bcast, unsigned int flags, bool bind) +{ + struct ifaddrs *ifaddr = &mock_ifaddr_storage[ifaddr_count].ifaddr; + struct sockaddr_in *in = (struct sockaddr_in*) + &mock_ifaddr_storage[ifaddr_count].addr; + struct sockaddr_in *mask_in = (struct sockaddr_in*) + &mock_ifaddr_storage[ifaddr_count].mask; + struct sockaddr_in *bcast_in = (struct sockaddr_in*) + &mock_ifaddr_storage[ifaddr_count].bcast; + + in->sin_family = AF_INET; + in->sin_port = 0; + in->sin_len = sizeof(in); + in->sin_addr.s_addr = inet_addr(addr); + mask_in->sin_family = AF_INET; + mask_in->sin_port = 0; + mask_in->sin_len = sizeof(mask_in); + mask_in->sin_addr.s_addr = inet_addr(mask); + bcast_in->sin_family = AF_INET; + bcast_in->sin_port = 0; + bcast_in->sin_len = sizeof(bcast_in); + bcast_in->sin_addr.s_addr = inet_addr(bcast); + *ifaddr = (struct ifaddrs) { + .ifa_next = NULL, + .ifa_name = (char*) name, + .ifa_flags = flags, + .ifa_addr = (struct sockaddr*) in, + .ifa_netmask = (struct sockaddr*) mask_in, + .ifa_broadaddr = (struct sockaddr*) bcast_in, + .ifa_data = NULL, /* addrmerge doesn't care*/ + }; + + if (ifaddr_count > 0) + mock_ifaddr_storage[ifaddr_count - 1].ifaddr.ifa_next = ifaddr; + ifaddr_count++; + mock_ifaddrs = &mock_ifaddr_storage[0].ifaddr; + + /* Optionally simulate binding an ip ala "rpcbind -h foo" */ + if (bind) { + bind_addresses[bind_address_count] = (struct sockaddr*)in; + bind_address_count++; + } +} + +#ifdef INET6 +static void +mock_ifaddr6(const char* name, const char* addr, const char* mask, + const char* bcast, unsigned int flags, uint32_t scope_id, bool bind) +{ + struct ifaddrs *ifaddr = &mock_ifaddr_storage[ifaddr_count].ifaddr; + struct sockaddr_in6 *in6 = (struct sockaddr_in6*) + &mock_ifaddr_storage[ifaddr_count].addr; + struct sockaddr_in6 *mask_in6 = (struct sockaddr_in6*) + &mock_ifaddr_storage[ifaddr_count].mask; + struct sockaddr_in6 *bcast_in6 = (struct sockaddr_in6*) + &mock_ifaddr_storage[ifaddr_count].bcast; + + in6->sin6_family = AF_INET6; + in6->sin6_port = 0; + in6->sin6_len = sizeof(*in6); + in6->sin6_scope_id = scope_id; + ATF_REQUIRE_EQ(1, inet_pton(AF_INET6, addr, (void*)&in6->sin6_addr)); + mask_in6->sin6_family = AF_INET6; + mask_in6->sin6_port = 0; + mask_in6->sin6_len = sizeof(*mask_in6); + mask_in6->sin6_scope_id = scope_id; + ATF_REQUIRE_EQ(1, inet_pton(AF_INET6, mask, + (void*)&mask_in6->sin6_addr)); + bcast_in6->sin6_family = AF_INET6; + bcast_in6->sin6_port = 0; + bcast_in6->sin6_len = sizeof(*bcast_in6); + bcast_in6->sin6_scope_id = scope_id; + ATF_REQUIRE_EQ(1, inet_pton(AF_INET6, bcast, + (void*)&bcast_in6->sin6_addr)); + *ifaddr = (struct ifaddrs) { + .ifa_next = NULL, + .ifa_name = (char*) name, + .ifa_flags = flags, + .ifa_addr = (struct sockaddr*) in6, + .ifa_netmask = (struct sockaddr*) mask_in6, + .ifa_broadaddr = (struct sockaddr*) bcast_in6, + .ifa_data = NULL, /* addrmerge doesn't care*/ + }; + + if (ifaddr_count > 0) + mock_ifaddr_storage[ifaddr_count - 1].ifaddr.ifa_next = ifaddr; + ifaddr_count++; + mock_ifaddrs = &mock_ifaddr_storage[0].ifaddr; + + /* Optionally simulate binding an ip ala "rpcbind -h foo" */ + if (bind) { + bind_addresses[bind_address_count] = (struct sockaddr*)in6; + bind_address_count++; + } +} +#else +static void +mock_ifaddr6(const char* name __unused, const char* addr __unused, + const char* mask __unused, const char* bcast __unused, + unsigned int flags __unused, uint32_t scope_id __unused, bool bind __unused) +{ +} +#endif /*INET6 */ + +static void +mock_lo0(void) +{ + /* + * This broadcast address looks wrong, but it's what getifaddrs(2) + * actually returns. It's invalid because IFF_BROADCAST is not set + */ + mock_ifaddr4("lo0", "127.0.0.1", "255.0.0.0", "127.0.0.1", + IFF_LOOPBACK | IFF_UP | IFF_RUNNING | IFF_MULTICAST, false); + mock_ifaddr6("lo0", "::1", "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", + "::1", + IFF_LOOPBACK | IFF_UP | IFF_RUNNING | IFF_MULTICAST, 0, false); +} + +static void +mock_igb0(void) +{ + mock_ifaddr4("igb0", "192.0.2.2", "255.255.255.128", "192.0.2.127", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + false); + mock_ifaddr6("igb0", "2001:db8::2", "ffff:ffff:ffff:ffff::", + "2001:db8::ffff:ffff:ffff:ffff", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + 0, false); + /* Link local address */ + mock_ifaddr6("igb0", "fe80::2", "ffff:ffff:ffff:ffff::", + "fe80::ffff:ffff:ffff:ffff", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + 2, false); +} + +/* On the same subnet as igb0 */ +static void +mock_igb1(bool bind) +{ + mock_ifaddr4("igb1", "192.0.2.3", "255.255.255.128", "192.0.2.127", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + bind); + mock_ifaddr6("igb1", "2001:db8::3", "ffff:ffff:ffff:ffff::", + "2001:db8::ffff:ffff:ffff:ffff", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + 0, bind); + /* Link local address */ + mock_ifaddr6("igb1", "fe80::3", "ffff:ffff:ffff:ffff::", + "fe80::ffff:ffff:ffff:ffff", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + 3, bind); +} + +/* igb2 is on a different subnet than igb0 */ +static void +mock_igb2(void) +{ + mock_ifaddr4("igb2", "192.0.2.130", "255.255.255.128", "192.0.2.255", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + false); + mock_ifaddr6("igb2", "2001:db8:1::2", "ffff:ffff:ffff:ffff::", + "2001:db8:1:0:ffff:ffff:ffff:ffff", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + 0, false); +} + +/* tun0 is a P2P interface */ +static void +mock_tun0(void) +{ + mock_ifaddr4("tun0", "192.0.2.5", "255.255.255.255", "192.0.2.6", + IFF_UP | IFF_RUNNING | IFF_POINTOPOINT | IFF_MULTICAST, false); + mock_ifaddr6("tun0", "2001:db8::5", + "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", + "2001:db8::6", + IFF_UP | IFF_RUNNING | IFF_POINTOPOINT | IFF_MULTICAST, 0, false); +} + + +/* Stub rpcbind functions */ +int +listen_addr(const struct sockaddr *sa) +{ + int i; + + if (bind_address_count == 0) + return (1); + + for (i = 0; i < bind_address_count; i++) { + if (bind_addresses[i]->sa_family != sa->sa_family) + continue; + + if (0 == memcmp(bind_addresses[i]->sa_data, sa->sa_data, + sa->sa_len)) + return (1); + } + return (0); +} + +struct netconfig* +rpcbind_get_conf(const char* netid __unused) +{ + /* Use static variables so we can return pointers to them */ + static char* lookups = NULL; + static struct netconfig nconf_udp; +#ifdef INET6 + static struct netconfig nconf_udp6; +#endif /* INET6 */ + + nconf_udp.nc_netid = "udp"; //netid_storage; + nconf_udp.nc_semantics = NC_TPI_CLTS; + nconf_udp.nc_flag = NC_VISIBLE; + nconf_udp.nc_protofmly = (char*)"inet"; + nconf_udp.nc_proto = (char*)"udp"; + nconf_udp.nc_device = (char*)"-"; + nconf_udp.nc_nlookups = 0; + nconf_udp.nc_lookups = &lookups; + +#ifdef INET6 + nconf_udp6.nc_netid = "udp6"; //netid_storage; + nconf_udp6.nc_semantics = NC_TPI_CLTS; + nconf_udp6.nc_flag = NC_VISIBLE; + nconf_udp6.nc_protofmly = (char*)"inet6"; + nconf_udp6.nc_proto = (char*)"udp6"; + nconf_udp6.nc_device = (char*)"-"; + nconf_udp6.nc_nlookups = 0; + nconf_udp6.nc_lookups = &lookups; +#endif /* INET6 */ + + if (0 == strncmp("udp", netid, sizeof("udp"))) + return (&nconf_udp); +#ifdef INET6 + else if (0 == strncmp("udp6", netid, sizeof("udp6"))) + return (&nconf_udp6); +#endif /* INET6 */ + else + return (NULL); +} + +/* + * Helper function used by most test cases + * param recvdstaddr If non-null, the uaddr on which the request was received + */ +static char* +do_addrmerge4(const char* recvdstaddr) +{ + struct netbuf caller; + struct sockaddr_in caller_in; + const char *serv_uaddr, *clnt_uaddr, *netid; + + /* caller contains the client's IP address */ + caller.maxlen = sizeof(struct sockaddr_storage); + caller.len = sizeof(caller_in); + caller_in.sin_family = AF_INET; + caller_in.sin_len = sizeof(caller_in); + caller_in.sin_port = 1234; + caller_in.sin_addr.s_addr = inet_addr("192.0.2.1"); + caller.buf = (void*)&caller_in; + if (recvdstaddr != NULL) + clnt_uaddr = recvdstaddr; + else + clnt_uaddr = "192.0.2.1.3.46"; + + /* assume server is bound in INADDR_ANY port 814 */ + serv_uaddr = "0.0.0.0.3.46"; + + netid = "udp"; + return (addrmerge(&caller, serv_uaddr, clnt_uaddr, netid)); +} + +#ifdef INET6 +/* + * Variant of do_addrmerge4 where the caller has an IPv6 address + * param recvdstaddr If non-null, the uaddr on which the request was received + */ +static char* +do_addrmerge6(const char* recvdstaddr) +{ + struct netbuf caller; + struct sockaddr_in6 caller_in6; + const char *serv_uaddr, *clnt_uaddr, *netid; + + /* caller contains the client's IP address */ + caller.maxlen = sizeof(struct sockaddr_storage); + caller.len = sizeof(caller_in6); + caller_in6.sin6_family = AF_INET6; + caller_in6.sin6_len = sizeof(caller_in6); + caller_in6.sin6_port = 1234; + ATF_REQUIRE_EQ(1, inet_pton(AF_INET6, "2001:db8::1", + (void*)&caller_in6.sin6_addr)); + caller.buf = (void*)&caller_in6; + if (recvdstaddr != NULL) + clnt_uaddr = recvdstaddr; + else + clnt_uaddr = "2001:db8::1.3.46"; + + /* assume server is bound in INADDR_ANY port 814 */ + serv_uaddr = "::1.3.46"; + + netid = "udp6"; + return (addrmerge(&caller, serv_uaddr, clnt_uaddr, netid)); +} + +/* Variant of do_addrmerge6 where the caller uses a link local address */ +static char* +do_addrmerge6_ll(void) +{ + struct netbuf caller; + struct sockaddr_in6 caller_in6; + const char *serv_uaddr, *clnt_uaddr, *netid; + + /* caller contains the client's IP address */ + caller.maxlen = sizeof(struct sockaddr_storage); + caller.len = sizeof(caller_in6); + caller_in6.sin6_family = AF_INET6; + caller_in6.sin6_len = sizeof(caller_in6); + caller_in6.sin6_port = 1234; + caller_in6.sin6_scope_id = 2; /* same as igb0 */ + ATF_REQUIRE_EQ(1, inet_pton(AF_INET6, "fe80::beef", + (void*)&caller_in6.sin6_addr)); + caller.buf = (void*)&caller_in6; + clnt_uaddr = "fe80::beef.3.46"; + + /* assume server is bound in INADDR_ANY port 814 */ + serv_uaddr = "::1.3.46"; + + netid = "udp6"; + return (addrmerge(&caller, serv_uaddr, clnt_uaddr, netid)); +} +#endif /* INET6 */ + +ATF_TC_WITHOUT_HEAD(addrmerge_noifaddrs); +ATF_TC_BODY(addrmerge_noifaddrs, tc) +{ + char* maddr; + + maddr = do_addrmerge4(NULL); + + /* Since getifaddrs returns null, addrmerge must too */ + ATF_CHECK_EQ(NULL, maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_localhost_only); +ATF_TC_BODY(addrmerge_localhost_only, tc) +{ + char *maddr; + + /* getifaddrs will return localhost only */ + mock_lo0(); + + maddr = do_addrmerge4(NULL); + + /* We must return localhost if there is nothing better */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("127.0.0.1.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_singlehomed); +ATF_TC_BODY(addrmerge_singlehomed, tc) +{ + char *maddr; + + /* getifaddrs will return one public address */ + mock_lo0(); + mock_igb0(); + + maddr = do_addrmerge4(NULL); + + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_one_addr_on_each_subnet); +ATF_TC_BODY(addrmerge_one_addr_on_each_subnet, tc) +{ + char *maddr; + + mock_lo0(); + mock_igb0(); + mock_igb2(); + + maddr = do_addrmerge4(NULL); + + /* We must return the address on the caller's subnet */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); +} + + +/* + * Like addrmerge_one_addr_on_each_subnet, but getifaddrs returns a different + * order + */ +ATF_TC_WITHOUT_HEAD(addrmerge_one_addr_on_each_subnet_rev); +ATF_TC_BODY(addrmerge_one_addr_on_each_subnet_rev, tc) +{ + char *maddr; + + /* getifaddrs will return one public address on each of two subnets */ + mock_igb2(); + mock_igb0(); + mock_lo0(); + + maddr = do_addrmerge4(NULL); + + /* We must return the address on the caller's subnet */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_point2point); +ATF_TC_BODY(addrmerge_point2point, tc) +{ + char *maddr; + + /* getifaddrs will return one normal and one p2p address */ + mock_lo0(); + mock_igb2(); + mock_tun0(); + + maddr = do_addrmerge4(NULL); + + /* addrmerge should disprefer P2P interfaces */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.130.3.46", maddr); +} + +/* Like addrerge_point2point, but getifaddrs returns a different order */ +ATF_TC_WITHOUT_HEAD(addrmerge_point2point_rev); +ATF_TC_BODY(addrmerge_point2point_rev, tc) +{ + char *maddr; + + /* getifaddrs will return one normal and one p2p address */ + mock_tun0(); + mock_igb2(); + mock_lo0(); + + maddr = do_addrmerge4(NULL); + + /* addrmerge should disprefer P2P interfaces */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.130.3.46", maddr); +} + +/* + * Simulate using rpcbind -h to select just one ip when the subnet has + * multiple + */ +ATF_TC_WITHOUT_HEAD(addrmerge_bindip); +ATF_TC_BODY(addrmerge_bindip, tc) +{ + char *maddr; + + /* getifaddrs will return one public address on each of two subnets */ + mock_lo0(); + mock_igb0(); + mock_igb1(true); + + maddr = do_addrmerge4(NULL); + + /* We must return the address to which we are bound */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.3.3.46", maddr); +} + +/* Like addrmerge_bindip, but getifaddrs returns a different order */ +ATF_TC_WITHOUT_HEAD(addrmerge_bindip_rev); +ATF_TC_BODY(addrmerge_bindip_rev, tc) +{ + char *maddr; + + /* getifaddrs will return one public address on each of two subnets */ + mock_igb1(true); + mock_igb0(); + mock_lo0(); + + maddr = do_addrmerge4(NULL); + + /* We must return the address to which we are bound */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.3.3.46", maddr); +} + +/* + * The address on which the request was received is known, and is provided as + * the hint. + */ +ATF_TC_WITHOUT_HEAD(addrmerge_recvdstaddr); +ATF_TC_BODY(addrmerge_recvdstaddr, tc) +{ + char *maddr; + + mock_lo0(); + mock_igb0(); + mock_igb1(false); + + maddr = do_addrmerge4("192.0.2.2.3.46"); + + /* We must return the address on which the request was received */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_recvdstaddr_rev); +ATF_TC_BODY(addrmerge_recvdstaddr_rev, tc) +{ + char *maddr; + + mock_igb1(false); + mock_igb0(); + mock_lo0(); + + maddr = do_addrmerge4("192.0.2.2.3.46"); + + /* We must return the address on which the request was received */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("192.0.2.2.3.46", maddr); +} + +#ifdef INET6 +ATF_TC_WITHOUT_HEAD(addrmerge_localhost_only6); +ATF_TC_BODY(addrmerge_localhost_only6, tc) +{ + char *maddr; + + /* getifaddrs will return localhost only */ + mock_lo0(); + + maddr = do_addrmerge6(NULL); + + /* We must return localhost if there is nothing better */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("::1.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_singlehomed6); +ATF_TC_BODY(addrmerge_singlehomed6, tc) +{ + char *maddr; + + /* getifaddrs will return one public address */ + mock_lo0(); + mock_igb0(); + + maddr = do_addrmerge6(NULL); + + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_one_addr_on_each_subnet6); +ATF_TC_BODY(addrmerge_one_addr_on_each_subnet6, tc) +{ + char *maddr; + + mock_lo0(); + mock_igb0(); + mock_igb2(); + + maddr = do_addrmerge6(NULL); + + /* We must return the address on the caller's subnet */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); +} + + +/* + * Like addrmerge_one_addr_on_each_subnet6, but getifaddrs returns a different + * order + */ +ATF_TC_WITHOUT_HEAD(addrmerge_one_addr_on_each_subnet6_rev); +ATF_TC_BODY(addrmerge_one_addr_on_each_subnet6_rev, tc) +{ + char *maddr; + + /* getifaddrs will return one public address on each of two subnets */ + mock_igb2(); + mock_igb0(); + mock_lo0(); + + maddr = do_addrmerge6(NULL); + + /* We must return the address on the caller's subnet */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_point2point6); +ATF_TC_BODY(addrmerge_point2point6, tc) +{ + char *maddr; + + /* getifaddrs will return one normal and one p2p address */ + mock_lo0(); + mock_igb2(); + mock_tun0(); + + maddr = do_addrmerge6(NULL); + + /* addrmerge should disprefer P2P interfaces */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8:1::2.3.46", maddr); +} + +/* Like addrerge_point2point, but getifaddrs returns a different order */ +ATF_TC_WITHOUT_HEAD(addrmerge_point2point6_rev); +ATF_TC_BODY(addrmerge_point2point6_rev, tc) +{ + char *maddr; + + /* getifaddrs will return one normal and one p2p address */ + mock_tun0(); + mock_igb2(); + mock_lo0(); + + maddr = do_addrmerge6(NULL); + + /* addrmerge should disprefer P2P interfaces */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8:1::2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_bindip6); +ATF_TC_BODY(addrmerge_bindip6, tc) +{ + char *maddr; + + /* getifaddrs will return one public address on each of two subnets */ + mock_lo0(); + mock_igb0(); + mock_igb1(true); + + maddr = do_addrmerge6(NULL); + + /* We must return the address to which we are bound */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8::3.3.46", maddr); +} + +/* Like addrerge_bindip, but getifaddrs returns a different order */ +ATF_TC_WITHOUT_HEAD(addrmerge_bindip6_rev); +ATF_TC_BODY(addrmerge_bindip6_rev, tc) +{ + char *maddr; + + /* getifaddrs will return one public address on each of two subnets */ + mock_igb1(true); + mock_igb0(); + mock_lo0(); + + maddr = do_addrmerge6(NULL); + + /* We must return the address to which we are bound */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8::3.3.46", maddr); +} + +/* + * IPv6 Link Local addresses with the same scope id as the caller, if the caller + * is also a link local address, should be preferred + */ +ATF_TC_WITHOUT_HEAD(addrmerge_ipv6_linklocal); +ATF_TC_BODY(addrmerge_ipv6_linklocal, tc) +{ + char *maddr; + + /* + * getifaddrs will return two link local addresses with the same netmask + * and prefix but different scope IDs + */ + mock_igb1(false); + mock_igb0(); + mock_lo0(); + + maddr = do_addrmerge6_ll(); + + /* We must return the address to which we are bound */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("fe80::2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_ipv6_linklocal_rev); +ATF_TC_BODY(addrmerge_ipv6_linklocal_rev, tc) +{ + char *maddr; + + /* + * getifaddrs will return two link local addresses with the same netmask + * and prefix but different scope IDs + */ + mock_lo0(); + mock_igb0(); + mock_igb1(false); + + maddr = do_addrmerge6_ll(); + + /* We must return the address to which we are bound */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("fe80::2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_recvdstaddr6); +ATF_TC_BODY(addrmerge_recvdstaddr6, tc) +{ + char *maddr; + + mock_lo0(); + mock_igb0(); + mock_igb1(false); + + maddr = do_addrmerge6("2001:db8::2.3.46"); + + /* We must return the address on which the request was received */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); +} + +ATF_TC_WITHOUT_HEAD(addrmerge_recvdstaddr6_rev); +ATF_TC_BODY(addrmerge_recvdstaddr6_rev, tc) +{ + char *maddr; + + mock_igb1(false); + mock_igb0(); + mock_lo0(); + + maddr = do_addrmerge6("2001:db8::2.3.46"); + + /* We must return the address on which the request was received */ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); +} +#endif /* INET6 */ + + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, addrmerge_noifaddrs); + ATF_TP_ADD_TC(tp, addrmerge_localhost_only); + ATF_TP_ADD_TC(tp, addrmerge_singlehomed); + ATF_TP_ADD_TC(tp, addrmerge_one_addr_on_each_subnet); + ATF_TP_ADD_TC(tp, addrmerge_one_addr_on_each_subnet_rev); + ATF_TP_ADD_TC(tp, addrmerge_point2point); + ATF_TP_ADD_TC(tp, addrmerge_point2point_rev); + ATF_TP_ADD_TC(tp, addrmerge_bindip); + ATF_TP_ADD_TC(tp, addrmerge_bindip_rev); + ATF_TP_ADD_TC(tp, addrmerge_recvdstaddr); + ATF_TP_ADD_TC(tp, addrmerge_recvdstaddr_rev); +#ifdef INET6 + ATF_TP_ADD_TC(tp, addrmerge_localhost_only6); + ATF_TP_ADD_TC(tp, addrmerge_singlehomed6); + ATF_TP_ADD_TC(tp, addrmerge_one_addr_on_each_subnet6); + ATF_TP_ADD_TC(tp, addrmerge_one_addr_on_each_subnet6_rev); + ATF_TP_ADD_TC(tp, addrmerge_point2point6); + ATF_TP_ADD_TC(tp, addrmerge_point2point6_rev); + ATF_TP_ADD_TC(tp, addrmerge_bindip6); + ATF_TP_ADD_TC(tp, addrmerge_bindip6_rev); + ATF_TP_ADD_TC(tp, addrmerge_ipv6_linklocal); + ATF_TP_ADD_TC(tp, addrmerge_ipv6_linklocal_rev); + ATF_TP_ADD_TC(tp, addrmerge_recvdstaddr6); + ATF_TP_ADD_TC(tp, addrmerge_recvdstaddr6_rev); +#endif + + return (atf_no_error()); +} Modified: head/usr.sbin/rpcbind/util.c ============================================================================== --- head/usr.sbin/rpcbind/util.c Tue Jan 5 22:27:34 2016 (r293228) +++ head/usr.sbin/rpcbind/util.c Wed Jan 6 00:00:11 2016 (r293229) @@ -56,7 +56,7 @@ static struct sockaddr_in *local_in4; static struct sockaddr_in6 *local_in6; #endif -static int bitmaskcmp(void *, void *, void *, int); +static int bitmaskcmp(struct sockaddr *, struct sockaddr *, struct sockaddr *); /* * For all bits set in "mask", compare the corresponding bits in @@ -64,10 +64,34 @@ static int bitmaskcmp(void *, void *, vo * match. */ static int -bitmaskcmp(void *dst, void *src, void *mask, int bytelen) +bitmaskcmp(struct sockaddr *dst, struct sockaddr *src, struct sockaddr *mask) { int i; - u_int8_t *p1 = dst, *p2 = src, *netmask = mask; + u_int8_t *p1, *p2, *netmask; + int bytelen; + + if (dst->sa_family != src->sa_family || + dst->sa_family != mask->sa_family) + return (1); + + switch (dst->sa_family) { + case AF_INET: + p1 = (uint8_t*) &SA2SINADDR(dst); + p2 = (uint8_t*) &SA2SINADDR(src); + netmask = (uint8_t*) &SA2SINADDR(mask); + bytelen = sizeof(struct in_addr); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jan 6 00:16:54 2016 Return-Path: Delivered-To: svn-src-head@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 97F40A6331B; Wed, 6 Jan 2016 00:16:54 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 897951C4A; Wed, 6 Jan 2016 00:16:54 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:63311 helo=tinkerbell.pixel8networks.com) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1aGTT9-000LYO-6w; Tue, 05 Jan 2016 07:24:19 -0800 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293227 - head/etc From: Devin Teske In-Reply-To: <1452038404.1320.46.camel@freebsd.org> Date: Tue, 5 Jan 2016 16:16:49 -0800 Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske Content-Transfer-Encoding: 7bit Message-Id: <1A1BB09D-2FB4-4E50-9F86-62B772855224@freebsd.org> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2104) Sender: devin@shxd.cx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 00:16:54 -0000 > On Jan 5, 2016, at 4:00 PM, Ian Lepore wrote: > > On Tue, 2016-01-05 at 21:20 +0000, Warner Losh wrote: >> Author: imp >> Date: Tue Jan 5 21:20:47 2016 >> New Revision: 293227 >> URL: https://svnweb.freebsd.org/changeset/base/293227 >> >> Log: >> Use the more proper -f. Leave /bin/rm in place since that's what >> other rc scripts have, though it isn't strictly necessary. >> >> Modified: >> head/etc/rc >> >> Modified: head/etc/rc >> ===================================================================== >> ========= >> --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226) >> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) >> @@ -132,9 +132,9 @@ done >> # Remove the firstboot sentinel, and reboot if it was requested. >> if [ -e ${firstboot_sentinel} ]; then >> [ ${root_rw_mount} = "yes" ] || mount -uw / >> - /bin/rm ${firstboot_sentinel} >> + /bin/rm -f ${firstboot_sentinel} >> if [ -e ${firstboot_sentinel}-reboot ]; then >> - /bin/rm ${firstboot_sentinel}-reboot >> + /bin/rm -f ${firstboot_sentinel}-reboot >> [ ${root_rw_mount} = "yes" ] || mount -ur / >> kill -INT 1 >> fi >> > > Using rm -f to suppress an error message seems like a bad idea here -- > if the sentinel file can't be removed that implies it's going to do > firstboot behavior every time it boots, and that's the sort of error > that should be in-your-face. Especially on the reboot one because > you're going to be stuck in a reboot loop with no error message. > Leaving off -f so that the user gets prompted isn't quite as helpful as, say, using -f but then testing to make sure the file is really gone (if it still exists after a silent "rm -f", put up an informative warning instead of asking the user if they would like to delete it). The end-result of having something thrown in your face seems desirable. Having a prompt that asks you if you'd like to delete it (even if there is an error immediately above it explaining it could not be deleted) seems nonsensical. -- Devin From owner-svn-src-head@freebsd.org Wed Jan 6 00:18:22 2016 Return-Path: Delivered-To: svn-src-head@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 AD681A633AC; Wed, 6 Jan 2016 00:18:22 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 8FF811DDF; Wed, 6 Jan 2016 00:18:22 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [192.168.1.1] (unknown [192.168.1.1]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 9ADAADCEE; Wed, 6 Jan 2016 00:18:21 +0000 (UTC) Subject: Re: svn commit: r293227 - head/etc To: Devin Teske , Ian Lepore References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <1A1BB09D-2FB4-4E50-9F86-62B772855224@freebsd.org> Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Allan Jude Message-ID: <568C5D49.9090502@freebsd.org> Date: Tue, 5 Jan 2016 19:18:17 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <1A1BB09D-2FB4-4E50-9F86-62B772855224@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 00:18:22 -0000 On 2016-01-05 19:16, Devin Teske wrote: > >> On Jan 5, 2016, at 4:00 PM, Ian Lepore wrote: >> >> On Tue, 2016-01-05 at 21:20 +0000, Warner Losh wrote: >>> Author: imp >>> Date: Tue Jan 5 21:20:47 2016 >>> New Revision: 293227 >>> URL: https://svnweb.freebsd.org/changeset/base/293227 >>> >>> Log: >>> Use the more proper -f. Leave /bin/rm in place since that's what >>> other rc scripts have, though it isn't strictly necessary. >>> >>> Modified: >>> head/etc/rc >>> >>> Modified: head/etc/rc >>> ===================================================================== >>> ========= >>> --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226) >>> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) >>> @@ -132,9 +132,9 @@ done >>> # Remove the firstboot sentinel, and reboot if it was requested. >>> if [ -e ${firstboot_sentinel} ]; then >>> [ ${root_rw_mount} = "yes" ] || mount -uw / >>> - /bin/rm ${firstboot_sentinel} >>> + /bin/rm -f ${firstboot_sentinel} >>> if [ -e ${firstboot_sentinel}-reboot ]; then >>> - /bin/rm ${firstboot_sentinel}-reboot >>> + /bin/rm -f ${firstboot_sentinel}-reboot >>> [ ${root_rw_mount} = "yes" ] || mount -ur / >>> kill -INT 1 >>> fi >>> >> >> Using rm -f to suppress an error message seems like a bad idea here -- >> if the sentinel file can't be removed that implies it's going to do >> firstboot behavior every time it boots, and that's the sort of error >> that should be in-your-face. Especially on the reboot one because >> you're going to be stuck in a reboot loop with no error message. >> > > Leaving off -f so that the user gets prompted isn't quite as helpful > as, say, using -f but then testing to make sure the file is really gone > (if it still exists after a silent "rm -f", put up an informative warning > instead of asking the user if they would like to delete it). > > The end-result of having something thrown in your face seems > desirable. Having a prompt that asks you if you'd like to delete it > (even if there is an error immediately above it explaining it could > not be deleted) seems nonsensical. > More specifically, firstboot is most likely run in situations where no one will be at the console, so an interactive prompt stopping the system from coming up is bad. -- Allan Jude From owner-svn-src-head@freebsd.org Wed Jan 6 00:27:56 2016 Return-Path: Delivered-To: svn-src-head@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 37C8DA6369B for ; Wed, 6 Jan 2016 00:27:56 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 0CCDF12D6 for ; Wed, 6 Jan 2016 00:27:55 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 6 Jan 2016 00:28:23 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id u060RqLP002403; Tue, 5 Jan 2016 17:27:53 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452040072.1320.49.camel@freebsd.org> Subject: Re: svn commit: r293227 - head/etc From: Ian Lepore To: Allan Jude , Devin Teske Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 05 Jan 2016 17:27:52 -0700 In-Reply-To: <568C5D49.9090502@freebsd.org> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <1A1BB09D-2FB4-4E50-9F86-62B772855224@freebsd.org> <568C5D49.9090502@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 00:27:56 -0000 On Tue, 2016-01-05 at 19:18 -0500, Allan Jude wrote: > On 2016-01-05 19:16, Devin Teske wrote: > > > > > On Jan 5, 2016, at 4:00 PM, Ian Lepore wrote: > > > > > > On Tue, 2016-01-05 at 21:20 +0000, Warner Losh wrote: > > > > Author: imp > > > > Date: Tue Jan 5 21:20:47 2016 > > > > New Revision: 293227 > > > > URL: https://svnweb.freebsd.org/changeset/base/293227 > > > > > > > > Log: > > > > Use the more proper -f. Leave /bin/rm in place since that's > > > > what > > > > other rc scripts have, though it isn't strictly necessary. > > > > > > > > Modified: > > > > head/etc/rc > > > > > > > > Modified: head/etc/rc > > > > =============================================================== > > > > ====== > > > > ========= > > > > --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226 > > > > ) > > > > +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227 > > > > ) > > > > @@ -132,9 +132,9 @@ done > > > > # Remove the firstboot sentinel, and reboot if it was > > > > requested. > > > > if [ -e ${firstboot_sentinel} ]; then > > > > [ ${root_rw_mount} = "yes" ] || mount -uw / > > > > - /bin/rm ${firstboot_sentinel} > > > > + /bin/rm -f ${firstboot_sentinel} > > > > if [ -e ${firstboot_sentinel}-reboot ]; then > > > > - /bin/rm ${firstboot_sentinel}-reboot > > > > + /bin/rm -f ${firstboot_sentinel}-reboot > > > > [ ${root_rw_mount} = "yes" ] || mount -ur / > > > > kill -INT 1 > > > > fi > > > > > > > > > > Using rm -f to suppress an error message seems like a bad idea > > > here -- > > > if the sentinel file can't be removed that implies it's going to > > > do > > > firstboot behavior every time it boots, and that's the sort of > > > error > > > that should be in-your-face. Especially on the reboot one > > > because > > > you're going to be stuck in a reboot loop with no error message. > > > > > > > Leaving off -f so that the user gets prompted isn't quite as > > helpful > > as, say, using -f but then testing to make sure the file is really > > gone > > (if it still exists after a silent "rm -f", put up an informative > > warning > > instead of asking the user if they would like to delete it). > > > > The end-result of having something thrown in your face seems > > desirable. Having a prompt that asks you if you'd like to delete it > > (even if there is an error immediately above it explaining it could > > not be deleted) seems nonsensical. > > > > More specifically, firstboot is most likely run in situations where > no > one will be at the console, so an interactive prompt stopping the > system > from coming up is bad. > I couldn't possibly disagree more. If you're not paying attention to what happens the first time you boot a freshly installed system, you deserve whatever happens to you. On the other hand it's about the worst to have everything silently seem to work right, and the actual error is going to happen *next* time you boot (which is when it's really likely you're not paying attention because everything seemed to be okay the first time). -- Ian From owner-svn-src-head@freebsd.org Wed Jan 6 00:35:53 2016 Return-Path: Delivered-To: svn-src-head@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 31838A63989; Wed, 6 Jan 2016 00:35:53 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BE951839; Wed, 6 Jan 2016 00:35:53 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:63646 helo=tinkerbell.pixel8networks.com) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1aGTlb-000M9T-5E; Tue, 05 Jan 2016 07:43:23 -0800 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293227 - head/etc From: Devin Teske In-Reply-To: <1452040072.1320.49.camel@freebsd.org> Date: Tue, 5 Jan 2016 16:35:53 -0800 Cc: Allan Jude , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske Message-Id: <19DAF4A2-00E8-41D5-9DB5-65854DF5D58A@freebsd.org> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <1A1BB09D-2FB4-4E50-9F86-62B772855224@freebsd.org> <568C5D49.9090502@freebsd.org> <1452040072.1320.49.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2104) Sender: devin@shxd.cx Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 00:35:53 -0000 > On Jan 5, 2016, at 4:27 PM, Ian Lepore wrote: > > On Tue, 2016-01-05 at 19:18 -0500, Allan Jude wrote: >> On 2016-01-05 19:16, Devin Teske wrote: >>> >>>> On Jan 5, 2016, at 4:00 PM, Ian Lepore wrote: >>>> >>>> On Tue, 2016-01-05 at 21:20 +0000, Warner Losh wrote: >>>>> Author: imp >>>>> Date: Tue Jan 5 21:20:47 2016 >>>>> New Revision: 293227 >>>>> URL: https://svnweb.freebsd.org/changeset/base/293227 >>>>> >>>>> Log: >>>>> Use the more proper -f. Leave /bin/rm in place since that's >>>>> what >>>>> other rc scripts have, though it isn't strictly necessary. >>>>> >>>>> Modified: >>>>> head/etc/rc >>>>> >>>>> Modified: head/etc/rc >>>>> =============================================================== >>>>> ====== >>>>> ========= >>>>> --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226 >>>>> ) >>>>> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227 >>>>> ) >>>>> @@ -132,9 +132,9 @@ done >>>>> # Remove the firstboot sentinel, and reboot if it was >>>>> requested. >>>>> if [ -e ${firstboot_sentinel} ]; then >>>>> [ ${root_rw_mount} = "yes" ] || mount -uw / >>>>> - /bin/rm ${firstboot_sentinel} >>>>> + /bin/rm -f ${firstboot_sentinel} >>>>> if [ -e ${firstboot_sentinel}-reboot ]; then >>>>> - /bin/rm ${firstboot_sentinel}-reboot >>>>> + /bin/rm -f ${firstboot_sentinel}-reboot >>>>> [ ${root_rw_mount} = "yes" ] || mount -ur / >>>>> kill -INT 1 >>>>> fi >>>>> >>>> >>>> Using rm -f to suppress an error message seems like a bad idea >>>> here -- >>>> if the sentinel file can't be removed that implies it's going to >>>> do >>>> firstboot behavior every time it boots, and that's the sort of >>>> error >>>> that should be in-your-face. Especially on the reboot one >>>> because >>>> you're going to be stuck in a reboot loop with no error message. >>>> >>> >>> Leaving off -f so that the user gets prompted isn't quite as >>> helpful >>> as, say, using -f but then testing to make sure the file is really >>> gone >>> (if it still exists after a silent "rm -f", put up an informative >>> warning >>> instead of asking the user if they would like to delete it). >>> >>> The end-result of having something thrown in your face seems >>> desirable. Having a prompt that asks you if you'd like to delete it >>> (even if there is an error immediately above it explaining it could >>> not be deleted) seems nonsensical. >>> >> >> More specifically, firstboot is most likely run in situations where >> no >> one will be at the console, so an interactive prompt stopping the >> system >> from coming up is bad. >> > > I couldn't possibly disagree more. If you're not paying attention to > what happens the first time you boot a freshly installed system, you > deserve whatever happens to you. What if you are in New York and the server is alone in Siberia? ... Got SSH? (not if your boot stopped, you don't) -- Devin From owner-svn-src-head@freebsd.org Wed Jan 6 01:18:29 2016 Return-Path: Delivered-To: svn-src-head@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 D54BBA6376B for ; Wed, 6 Jan 2016 01:18:29 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 B3E381D4F for ; Wed, 6 Jan 2016 01:18:29 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 6 Jan 2016 01:19:01 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id u061IQnG002478; Tue, 5 Jan 2016 18:18:26 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1452043106.1320.52.camel@freebsd.org> Subject: Re: svn commit: r293227 - head/etc From: Ian Lepore To: Devin Teske Cc: Allan Jude , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 05 Jan 2016 18:18:26 -0700 In-Reply-To: <19DAF4A2-00E8-41D5-9DB5-65854DF5D58A@freebsd.org> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <1A1BB09D-2FB4-4E50-9F86-62B772855224@freebsd.org> <568C5D49.9090502@freebsd.org> <1452040072.1320.49.camel@freebsd.org> <19DAF4A2-00E8-41D5-9DB5-65854DF5D58A@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 01:18:30 -0000 On Tue, 2016-01-05 at 16:35 -0800, Devin Teske wrote: > > On Jan 5, 2016, at 4:27 PM, Ian Lepore wrote: > > > > On Tue, 2016-01-05 at 19:18 -0500, Allan Jude wrote: > > > On 2016-01-05 19:16, Devin Teske wrote: > > > > > > > > > On Jan 5, 2016, at 4:00 PM, Ian Lepore > > > > > wrote: > > > > > > > > > > On Tue, 2016-01-05 at 21:20 +0000, Warner Losh wrote: > > > > > > Author: imp > > > > > > Date: Tue Jan 5 21:20:47 2016 > > > > > > New Revision: 293227 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/293227 > > > > > > > > > > > > Log: > > > > > > Use the more proper -f. Leave /bin/rm in place since > > > > > > that's > > > > > > what > > > > > > other rc scripts have, though it isn't strictly necessary. > > > > > > > > > > > > Modified: > > > > > > head/etc/rc > > > > > > > > > > > > Modified: head/etc/rc > > > > > > =========================================================== > > > > > > ==== > > > > > > ====== > > > > > > ========= > > > > > > --- head/etc/rc Tue Jan 5 21:20:46 2016 (r29 > > > > > > 3226 > > > > > > ) > > > > > > +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r29 > > > > > > 3227 > > > > > > ) > > > > > > @@ -132,9 +132,9 @@ done > > > > > > # Remove the firstboot sentinel, and reboot if it was > > > > > > requested. > > > > > > if [ -e ${firstboot_sentinel} ]; then > > > > > > [ ${root_rw_mount} = "yes" ] || mount -uw / > > > > > > - /bin/rm ${firstboot_sentinel} > > > > > > + /bin/rm -f ${firstboot_sentinel} > > > > > > if [ -e ${firstboot_sentinel}-reboot ]; then > > > > > > - /bin/rm ${firstboot_sentinel}-reboot > > > > > > + /bin/rm -f ${firstboot_sentinel}-reboot > > > > > > [ ${root_rw_mount} = "yes" ] || mount -ur / > > > > > > kill -INT 1 > > > > > > fi > > > > > > > > > > > > > > > > Using rm -f to suppress an error message seems like a bad > > > > > idea > > > > > here -- > > > > > if the sentinel file can't be removed that implies it's going > > > > > to > > > > > do > > > > > firstboot behavior every time it boots, and that's the sort > > > > > of > > > > > error > > > > > that should be in-your-face. Especially on the reboot one > > > > > because > > > > > you're going to be stuck in a reboot loop with no error > > > > > message. > > > > > > > > > > > > > Leaving off -f so that the user gets prompted isn't quite as > > > > helpful > > > > as, say, using -f but then testing to make sure the file is > > > > really > > > > gone > > > > (if it still exists after a silent "rm -f", put up an > > > > informative > > > > warning > > > > instead of asking the user if they would like to delete it). > > > > > > > > The end-result of having something thrown in your face seems > > > > desirable. Having a prompt that asks you if you'd like to > > > > delete it > > > > (even if there is an error immediately above it explaining it > > > > could > > > > not be deleted) seems nonsensical. > > > > > > > > > > More specifically, firstboot is most likely run in situations > > > where > > > no > > > one will be at the console, so an interactive prompt stopping the > > > system > > > from coming up is bad. > > > > > > > I couldn't possibly disagree more. If you're not paying attention > > to > > what happens the first time you boot a freshly installed system, > > you > > deserve whatever happens to you. > > What if you are in New York and the server is alone in Siberia? > > ... Got SSH? (not if your boot stopped, you don't) Unh huh. And what are you going to do when the server goes unresponsive because it silently failed to delete firstboot-reboot and now it's just in an endless reboot loop? Silent failure is only a viable option for expected errors you can recover from without intervention. -- Ian From owner-svn-src-head@freebsd.org Wed Jan 6 01:48:57 2016 Return-Path: Delivered-To: svn-src-head@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 8666AA631A9; Wed, 6 Jan 2016 01:48:57 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 741821D68; Wed, 6 Jan 2016 01:48:57 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:53910 helo=tinkerbell.pixel8networks.com) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1aGUuJ-000OUS-1n; Tue, 05 Jan 2016 08:56:27 -0800 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293227 - head/etc From: Devin Teske In-Reply-To: <1452043106.1320.52.camel@freebsd.org> Date: Tue, 5 Jan 2016 17:48:55 -0800 Cc: Allan Jude , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske Message-Id: References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <1A1BB09D-2FB4-4E50-9F86-62B772855224@freebsd.org> <568C5D49.9090502@freebsd.org> <1452040072.1320.49.camel@freebsd.org> <19DAF4A2-00E8-41D5-9DB5-65854DF5D58A@freebsd.org> <1452043106.1320.52.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2104) Sender: devin@shxd.cx Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 01:48:57 -0000 > On Jan 5, 2016, at 5:18 PM, Ian Lepore wrote: >=20 > On Tue, 2016-01-05 at 16:35 -0800, Devin Teske wrote: >>> On Jan 5, 2016, at 4:27 PM, Ian Lepore wrote: >>>=20 >>> On Tue, 2016-01-05 at 19:18 -0500, Allan Jude wrote: >>>> On 2016-01-05 19:16, Devin Teske wrote: >>>>>=20 >>>>>> On Jan 5, 2016, at 4:00 PM, Ian Lepore >>>>>> wrote: >>>>>>=20 >>>>>> On Tue, 2016-01-05 at 21:20 +0000, Warner Losh wrote: >>>>>>> Author: imp >>>>>>> Date: Tue Jan 5 21:20:47 2016 >>>>>>> New Revision: 293227 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/293227 >>>>>>>=20 >>>>>>> Log: >>>>>>> Use the more proper -f. Leave /bin/rm in place since >>>>>>> that's >>>>>>> what >>>>>>> other rc scripts have, though it isn't strictly necessary. >>>>>>>=20 >>>>>>> Modified: >>>>>>> head/etc/rc >>>>>>>=20 >>>>>>> Modified: head/etc/rc >>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>>>> =3D=3D=3D=3D >>>>>>> =3D=3D=3D=3D=3D=3D >>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>>>> --- head/etc/rc Tue Jan 5 21:20:46 2016 (r29 >>>>>>> 3226 >>>>>>> ) >>>>>>> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r29 >>>>>>> 3227 >>>>>>> ) >>>>>>> @@ -132,9 +132,9 @@ done >>>>>>> # Remove the firstboot sentinel, and reboot if it was >>>>>>> requested. >>>>>>> if [ -e ${firstboot_sentinel} ]; then >>>>>>> [ ${root_rw_mount} =3D "yes" ] || mount -uw / >>>>>>> - /bin/rm ${firstboot_sentinel} >>>>>>> + /bin/rm -f ${firstboot_sentinel} >>>>>>> if [ -e ${firstboot_sentinel}-reboot ]; then >>>>>>> - /bin/rm ${firstboot_sentinel}-reboot >>>>>>> + /bin/rm -f ${firstboot_sentinel}-reboot >>>>>>> [ ${root_rw_mount} =3D "yes" ] || mount -ur / >>>>>>> kill -INT 1 >>>>>>> fi >>>>>>>=20 >>>>>>=20 >>>>>> Using rm -f to suppress an error message seems like a bad >>>>>> idea >>>>>> here -- >>>>>> if the sentinel file can't be removed that implies it's going >>>>>> to >>>>>> do >>>>>> firstboot behavior every time it boots, and that's the sort >>>>>> of >>>>>> error >>>>>> that should be in-your-face. Especially on the reboot one >>>>>> because >>>>>> you're going to be stuck in a reboot loop with no error >>>>>> message. >>>>>>=20 >>>>>=20 >>>>> Leaving off -f so that the user gets prompted isn't quite as >>>>> helpful >>>>> as, say, using -f but then testing to make sure the file is >>>>> really >>>>> gone >>>>> (if it still exists after a silent "rm -f", put up an >>>>> informative >>>>> warning >>>>> instead of asking the user if they would like to delete it). >>>>>=20 >>>>> The end-result of having something thrown in your face seems >>>>> desirable. Having a prompt that asks you if you'd like to >>>>> delete it >>>>> (even if there is an error immediately above it explaining it >>>>> could >>>>> not be deleted) seems nonsensical. >>>>>=20 >>>>=20 >>>> More specifically, firstboot is most likely run in situations >>>> where >>>> no=20 >>>> one will be at the console, so an interactive prompt stopping the >>>> system=20 >>>> from coming up is bad. >>>>=20 >>>=20 >>> I couldn't possibly disagree more. If you're not paying attention >>> to >>> what happens the first time you boot a freshly installed system, >>> you >>> deserve whatever happens to you. >>=20 >> What if you are in New York and the server is alone in Siberia? >>=20 >> ... Got SSH? (not if your boot stopped, you don't) >=20 > Unh huh. And what are you going to do when the server goes > unresponsive because it silently failed to delete firstboot-reboot and > now it's just in an endless reboot loop? >=20 > Silent failure is only a viable option for expected errors you can > recover from without intervention. >=20 Your point is valid. However, I think it unwise to rely on this: dteske@porridge wwwww $ rm foo override rw-rw-r-- dteske/dteske schg,uarch for foo? y rm: foo: Operation not permitted As you can see above, the prompt put forth by rm really has nothing to = do with "failure" but rather it has performed a cursory check and is = asking you if it is OK to proceed. The condition in which rm puts forth the prompt is _NOT_ the condition = in which you want to halt the boot process. You're absolutely right that we ought to prevent an infinite = reboot-cycle. Relying on rm to do it by not using "-f" is the wrong approach. This is the right approach: rm -f "${firstboot_sentinel}-reboot" if [ -e "${firstboot_sentinel}-reboot" ]; then read -p "Ruh roh; I smell an infinite reboot in your = future!" IGNORED fi (if lovable Scooby Doo had coded it) Funny error message aside, I earnestly think that's the approach we = should take. ... Quick note, should the code be updated to handle this: $ mkdir $firstboot_sentinel $ mkdir !$-reboot $ reboot This too: $ touch $firstboot_sentinel $ chflags schg !$ $ touch !$-reboot $ chflags schg !$ $ reboot Both of which would lead to infinite reboot cycle. --=20 Devin= From owner-svn-src-head@freebsd.org Wed Jan 6 02:48:46 2016 Return-Path: Delivered-To: svn-src-head@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 59677A6352A; Wed, 6 Jan 2016 02:48:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 237D91B81; Wed, 6 Jan 2016 02:48:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id CE3D11A3008; Wed, 6 Jan 2016 13:48:37 +1100 (AEDT) Date: Wed, 6 Jan 2016 13:48:36 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293227 - head/etc In-Reply-To: <1452038404.1320.46.camel@freebsd.org> Message-ID: <20160106125617.E968@besplex.bde.org> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=R4L+YolX c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=F8TLbMH91mOxZ-GJiaoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 02:48:46 -0000 On Tue, 5 Jan 2016, Ian Lepore wrote: >> Log: >> Use the more proper -f. Leave /bin/rm in place since that's what >> other rc scripts have, though it isn't strictly necessary. "proper -f" is hard to parse. I think you mean: Use 'rm -f' to turn off -i in case rm is broken and is an alias which has -i (and perhaps actually even something resembling rm) in it. More precisely, use 'rm -f /usr/bin' to partly defend against the same bug in /bin/rm (where it would be larger). Keep using /usr/rm instead of restoring the use of plain rm since that is what other rc scripts have. The previous change to use /bin/rm instead of plain rm was neither necessary nor sufficient for fixing the bug. Neither is this one, but it gets closer. It is a little-known bug in aliases that even absolute pathnames can be aliased. So /bin/rm might be aliased to 'rm -ri /'. Appending -f would accidentally help for that too, by turning it into a syntax error, instead of accidentally making it more forceful by turning -ri into -rf. Hopefully this is all FUD. Non-interactive scripts shouldn't source any files that are not mentioned in the script. /etc/rc depends on a secure environment being set up by init and probably gets it since init doesn't set up much. sh(1) documents closing the security hole of sourcing the script in $ENV for non-interactive shells, but was never a problem for /etc/rc since init must be trusted to not put security holes in $ENV. But users could put security holes in a sourced config file like /etc/rc.conf.local. >> Modified: head/etc/rc >> ===================================================================== >> ========= >> --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226) >> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) >> @@ -132,9 +132,9 @@ done >> # Remove the firstboot sentinel, and reboot if it was requested. >> if [ -e ${firstboot_sentinel} ]; then >> [ ${root_rw_mount} = "yes" ] || mount -uw / >> - /bin/rm ${firstboot_sentinel} >> + /bin/rm -f ${firstboot_sentinel} >> if [ -e ${firstboot_sentinel}-reboot ]; then >> - /bin/rm ${firstboot_sentinel}-reboot >> + /bin/rm -f ${firstboot_sentinel}-reboot >> [ ${root_rw_mount} = "yes" ] || mount -ur / >> kill -INT 1 >> fi > > Using rm -f to suppress an error message seems like a bad idea here -- > if the sentinel file can't be removed that implies it's going to do > firstboot behavior every time it boots, and that's the sort of error > that should be in-your-face. Especially on the reboot one because > you're going to be stuck in a reboot loop with no error message. Er, -f on rm only turns off -i and supresses the warning message for failing to remove nonexistent files. But we just tested that the file exists, and in the impossible even of a race making it not exist by the time that it runs, we have more problems than the failure of rm since we use the file's existence as a control for other things. So the only effect of this -f is to turn off -i, which can only be set if the FUD was justified. The correct fix seems to be 'unalias -a'. Bruce From owner-svn-src-head@freebsd.org Wed Jan 6 03:19:12 2016 Return-Path: Delivered-To: svn-src-head@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 C74DFA63EAE; Wed, 6 Jan 2016 03:19:12 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9C4F1EB8; Wed, 6 Jan 2016 03:19:12 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:54795 helo=[172.16.10.54]) by shxd.cx with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1aGWJe-0001Ma-0d; Tue, 05 Jan 2016 10:26:42 -0800 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable From: Devin Teske Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r293227 - head/etc Date: Tue, 5 Jan 2016 19:16:32 -0800 Message-Id: <5360EA7A-399F-4679-B58F-62D0112EA481@shxd.cx> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <20160106125617.E968@besplex.bde.org> Cc: Ian Lepore , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske In-Reply-To: <20160106125617.E968@besplex.bde.org> To: Bruce Evans X-Mailer: iPhone Mail (13C75) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 03:19:13 -0000 This e-mail is extremely hard to parse and I think you are mistaken. The -f flag is more than just a counter to a possible -i Try to rm a file that has schg You will get a prompt without -i Adding -f will abate the prompt to attempt override of schg flag. There are more conditions in rm that lead to a prompt than simply those cond= itions involving -i and adding -f abates them all. --=20 Devin > On Jan 5, 2016, at 6:48 PM, Bruce Evans wrote: >=20 > On Tue, 5 Jan 2016, Ian Lepore wrote: >=20 >>> Log: >>> Use the more proper -f. Leave /bin/rm in place since that's what >>> other rc scripts have, though it isn't strictly necessary. >=20 > "proper -f" is hard to parse. I think you mean: >=20 > Use 'rm -f' to turn off -i in case rm is broken and is an alias which > has -i (and perhaps actually even something resembling rm) in it. More > precisely, use 'rm -f /usr/bin' to partly defend against the same bug > in /bin/rm (where it would be larger). Keep using /usr/rm instead of > restoring the use of plain rm since that is what other rc scripts have. > The previous change to use /bin/rm instead of plain rm was neither > necessary nor sufficient for fixing the bug. Neither is this one, but > it gets closer. It is a little-known bug in aliases that even absolute > pathnames can be aliased. So /bin/rm might be aliased to 'rm -ri /'. > Appending -f would accidentally help for that too, by turning it into > a syntax error, instead of accidentally making it more forceful by > turning -ri into -rf. >=20 > Hopefully this is all FUD. Non-interactive scripts shouldn't source any > files that are not mentioned in the script. /etc/rc depends on a secure > environment being set up by init and probably gets it since init doesn't > set up much. sh(1) documents closing the security hole of sourcing the > script in $ENV for non-interactive shells, but was never a problem for > /etc/rc since init must be trusted to not put security holes in $ENV. > But users could put security holes in a sourced config file like > /etc/rc.conf.local. >=20 >>> Modified: head/etc/rc >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D >>> --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226) >>> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) >>> @@ -132,9 +132,9 @@ done >>> # Remove the firstboot sentinel, and reboot if it was requested. >>> if [ -e ${firstboot_sentinel} ]; then >>> [ ${root_rw_mount} =3D "yes" ] || mount -uw / >>> - /bin/rm ${firstboot_sentinel} >>> + /bin/rm -f ${firstboot_sentinel} >>> if [ -e ${firstboot_sentinel}-reboot ]; then >>> - /bin/rm ${firstboot_sentinel}-reboot >>> + /bin/rm -f ${firstboot_sentinel}-reboot >>> [ ${root_rw_mount} =3D "yes" ] || mount -ur / >>> kill -INT 1 >>> fi >>=20 >> Using rm -f to suppress an error message seems like a bad idea here -- >> if the sentinel file can't be removed that implies it's going to do >> firstboot behavior every time it boots, and that's the sort of error >> that should be in-your-face. Especially on the reboot one because >> you're going to be stuck in a reboot loop with no error message. >=20 > Er, -f on rm only turns off -i and supresses the warning message for > failing to remove nonexistent files. But we just tested that the file > exists, and in the impossible even of a race making it not exist by > the time that it runs, we have more problems than the failure of rm > since we use the file's existence as a control for other things. >=20 > So the only effect of this -f is to turn off -i, which can only be set > if the FUD was justified. >=20 > The correct fix seems to be 'unalias -a'. >=20 > Bruce >=20 From owner-svn-src-head@freebsd.org Wed Jan 6 03:21:38 2016 Return-Path: Delivered-To: svn-src-head@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 450B5A63F56; Wed, 6 Jan 2016 03:21:38 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 22B2E11BE; Wed, 6 Jan 2016 03:21:37 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 23C1CD082; Wed, 6 Jan 2016 03:21:36 +0000 (UTC) Subject: Re: svn commit: r293227 - head/etc To: Devin Teske , Bruce Evans References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <20160106125617.E968@besplex.bde.org> <5360EA7A-399F-4679-B58F-62D0112EA481@shxd.cx> Cc: Ian Lepore , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske From: Allan Jude Message-ID: <568C883C.5050006@freebsd.org> Date: Tue, 5 Jan 2016 22:21:32 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <5360EA7A-399F-4679-B58F-62D0112EA481@shxd.cx> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="m5L3ieEH5FU8s8RU5N9QKFcgohTotomt9" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 03:21:38 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --m5L3ieEH5FU8s8RU5N9QKFcgohTotomt9 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016-01-05 22:16, Devin Teske wrote: > This e-mail is extremely hard to parse and I think you are mistaken. >=20 > The -f flag is more than just a counter to a possible -i >=20 > Try to rm a file that has schg > You will get a prompt without -i > Adding -f will abate the prompt to attempt override of schg flag. >=20 > There are more conditions in rm that lead to a prompt than simply those= conditions involving -i and adding -f abates them all. >=20 I think this is kind of a poor UI design of rm(1) honestly. It seems like what we need is a 'never be interactive' flag, that won't surpress the error message about the schg'd file, or read-only file system, but won't try to prompt for it. Although adding a new flag to rm(1) at this point probably doesn't make sense. --=20 Allan Jude --m5L3ieEH5FU8s8RU5N9QKFcgohTotomt9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJWjIg/AAoJEBmVNT4SmAt+9wgP/0ZK2iSoqxqII/vzDgKGGaMN +T6CAyTfQBv35krGOUh/0yOEzbkSalBrc2lWYgnc2VEtTyGs860bELynEXz2viMq pqyKK1wnC+QJEbJd/rfZYpVIvtXQISNLEyWXxHlaXlrLdNTJCFGQS5jievuXZrnf CnpCQ7djEGxu6xFrgUtyF0nJ/VeUHIfi8ab91mWg6bOWtV57YMAsWTC9AFGjLT4/ swV9YFEtu5eHbhiM5nqbPuT8NcUPBuWE8ad9US19kM2me0gYQPTTwsjZ1OJf4/2r zQBj9wcn8R3z/8GSoBEDbuW3NCpHrAIw5deB6LoUxP03AYA6Ozynv9ghu0JRr05s A7wrsA98VPCyIzEf/Nhu5YWNc2y91gE8bMJK/N90MDRAOxj0Fx8nsBK+sXoJ5T4c Q++XYRwTUiI3+7e9cBDiSEjJKVmbtLv7aTVS5VyVNWmNkUV5lwuHUst0+0dwhxzN zxqwmC2epxTNZ2SUjlvWZfp/npLk5yJtyL2TZR0441TKmaC8YYRTimMr0LcVzCRD TpxylF7Hx0Jis547EGUOEsgy6HwnTn3E3mBh56m+KVSrX8S3/3FGuf2qUnE8makG gMnPHgv90pva6PiT+juFmb0IeXhleS5N8yMM9dPkh8HIFHK8BwTeGhaovMuMR1Nl BqGu26uz5pk7u1kyyW84 =kgWr -----END PGP SIGNATURE----- --m5L3ieEH5FU8s8RU5N9QKFcgohTotomt9-- From owner-svn-src-head@freebsd.org Wed Jan 6 04:09:13 2016 Return-Path: Delivered-To: svn-src-head@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 6632FA6497B for ; Wed, 6 Jan 2016 04:09:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x236.google.com (mail-qg0-x236.google.com [IPv6:2607:f8b0:400d:c04::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 01BFA1860 for ; Wed, 6 Jan 2016 04:09:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x236.google.com with SMTP id b35so164931109qge.0 for ; Tue, 05 Jan 2016 20:09:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=n/rDpO9XPbLTcNBXluthFTzsTTCCquKp1WjQgDl6hWM=; b=glOhL0uMtamtW3aTwSh3E20z/mFf/XXZM3nD8HRub76G/IkjfGTEu9I9FgK90MHb8P ZN5nrVbbJ8Q005O4L2rv0PSGnR4NlHT2V295MCi8IVWrb+ER4hL6LvTjZkYDIY3uI9zf GASJPzFHzKxZeZUnEZbY3Gu3AMnyNaekaPGnEip8FiFt8OzvKQkHutsYM+dNuSoSYf06 mvfcHXcS6Ex7pBVKZWAo39EyZnOLYBvueM3KMWAtthd6zq3Rk7jFywmV81cXpz/iwwtB /7Hu9B7dhCkMTnTwfNb5dpeTyq6WI+zRKVETId0TapMDjIOU7Pr9WSm4erznXMZ2ek3K An3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=n/rDpO9XPbLTcNBXluthFTzsTTCCquKp1WjQgDl6hWM=; b=D9IWfhvqIP8/a3Ztm5kFnw8GgeF6LfNsBziOLexgDv0F6iRph5FR4bTrcZDMLWMZ2L vBOU5YbVli2VrWSUUonUzmxoS/ur08Rzh7AGvlgVTKGJnYwSdJl0xUMolECDXbI40uag +heq8MTQvV/kWZBP7R9QzU+5gU+VvX2clOISRmTnaHtEr+ckzWszZtVMiedGE8NZOK0s ZbTKGYVFNap0O/ay1PDrCETep+NuWgewl45CDRNhsUOwyuPZW1Mo8mvrpNnTYs9BIp0Q aVp7n63CeevwOCM4tOLKUVk0GkRYhnvSY9sfxFN2ldONxBQPiIHKzbOfn1qwVeST9TBy 8QLg== X-Gm-Message-State: ALoCoQkn3+JLXap6BQ5znfNvn/vKDNTR8Zwf6cFNDej17Lv8+klU6cY5RRGvMVUyXBKLmNwyAeaghoEiQh1SMzCCiMIHiwRXvA== MIME-Version: 1.0 X-Received: by 10.140.109.247 with SMTP id l110mr70660799qgf.52.1452053351666; Tue, 05 Jan 2016 20:09:11 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Tue, 5 Jan 2016 20:09:11 -0800 (PST) X-Originating-IP: [2601:280:4900:3700:e564:ecab:50db:6e5f] In-Reply-To: <5360EA7A-399F-4679-B58F-62D0112EA481@shxd.cx> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <20160106125617.E968@besplex.bde.org> <5360EA7A-399F-4679-B58F-62D0112EA481@shxd.cx> Date: Tue, 5 Jan 2016 21:09:11 -0700 X-Google-Sender-Auth: OHf0O02Uwt76UJBZzBKHXa5DDVY Message-ID: Subject: Re: svn commit: r293227 - head/etc From: Warner Losh To: Devin Teske Cc: Bruce Evans , Ian Lepore , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Devin Teske Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 04:09:13 -0000 The correct fix is chflags -R 0 firstboot rm -rf firstboot If you still can't remove it, too bad. Checking to make sure it worked really isn't the unix way. Sometimes when you do stupid things, stupid results happen. Warner On Tue, Jan 5, 2016 at 8:16 PM, Devin Teske wrote: > This e-mail is extremely hard to parse and I think you are mistaken. > > The -f flag is more than just a counter to a possible -i > > Try to rm a file that has schg > You will get a prompt without -i > Adding -f will abate the prompt to attempt override of schg flag. > > There are more conditions in rm that lead to a prompt than simply those > conditions involving -i and adding -f abates them all. > > -- > Devin > > > On Jan 5, 2016, at 6:48 PM, Bruce Evans wrote: > > > > On Tue, 5 Jan 2016, Ian Lepore wrote: > > > >>> Log: > >>> Use the more proper -f. Leave /bin/rm in place since that's what > >>> other rc scripts have, though it isn't strictly necessary. > > > > "proper -f" is hard to parse. I think you mean: > > > > Use 'rm -f' to turn off -i in case rm is broken and is an alias which > > has -i (and perhaps actually even something resembling rm) in it. More > > precisely, use 'rm -f /usr/bin' to partly defend against the same bug > > in /bin/rm (where it would be larger). Keep using /usr/rm instead of > > restoring the use of plain rm since that is what other rc scripts have. > > The previous change to use /bin/rm instead of plain rm was neither > > necessary nor sufficient for fixing the bug. Neither is this one, but > > it gets closer. It is a little-known bug in aliases that even absolute > > pathnames can be aliased. So /bin/rm might be aliased to 'rm -ri /'. > > Appending -f would accidentally help for that too, by turning it into > > a syntax error, instead of accidentally making it more forceful by > > turning -ri into -rf. > > > > Hopefully this is all FUD. Non-interactive scripts shouldn't source any > > files that are not mentioned in the script. /etc/rc depends on a secure > > environment being set up by init and probably gets it since init doesn't > > set up much. sh(1) documents closing the security hole of sourcing the > > script in $ENV for non-interactive shells, but was never a problem for > > /etc/rc since init must be trusted to not put security holes in $ENV. > > But users could put security holes in a sourced config file like > > /etc/rc.conf.local. > > > >>> Modified: head/etc/rc > >>> ===================================================================== > >>> ========= > >>> --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226) > >>> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) > >>> @@ -132,9 +132,9 @@ done > >>> # Remove the firstboot sentinel, and reboot if it was requested. > >>> if [ -e ${firstboot_sentinel} ]; then > >>> [ ${root_rw_mount} = "yes" ] || mount -uw / > >>> - /bin/rm ${firstboot_sentinel} > >>> + /bin/rm -f ${firstboot_sentinel} > >>> if [ -e ${firstboot_sentinel}-reboot ]; then > >>> - /bin/rm ${firstboot_sentinel}-reboot > >>> + /bin/rm -f ${firstboot_sentinel}-reboot > >>> [ ${root_rw_mount} = "yes" ] || mount -ur / > >>> kill -INT 1 > >>> fi > >> > >> Using rm -f to suppress an error message seems like a bad idea here -- > >> if the sentinel file can't be removed that implies it's going to do > >> firstboot behavior every time it boots, and that's the sort of error > >> that should be in-your-face. Especially on the reboot one because > >> you're going to be stuck in a reboot loop with no error message. > > > > Er, -f on rm only turns off -i and supresses the warning message for > > failing to remove nonexistent files. But we just tested that the file > > exists, and in the impossible even of a race making it not exist by > > the time that it runs, we have more problems than the failure of rm > > since we use the file's existence as a control for other things. > > > > So the only effect of this -f is to turn off -i, which can only be set > > if the FUD was justified. > > > > The correct fix seems to be 'unalias -a'. > > > > Bruce > > > From owner-svn-src-head@freebsd.org Wed Jan 6 05:12:43 2016 Return-Path: Delivered-To: svn-src-head@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 9C6EDA638AB; Wed, 6 Jan 2016 05:12:43 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 892801158; Wed, 6 Jan 2016 05:12:43 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=54947 helo=[10.0.0.108]) by shxd.cx with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1aGY5U-0004u8-UY; Tue, 05 Jan 2016 12:20:13 -0800 From: Devin Teske Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r293227 - head/etc Date: Tue, 5 Jan 2016 21:10:52 -0800 Message-Id: References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <20160106125617.E968@besplex.bde.org> <5360EA7A-399F-4679-B58F-62D0112EA481@shxd.cx> Cc: Bruce Evans , Ian Lepore , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Devin Teske In-Reply-To: To: Warner Losh X-Mailer: iPhone Mail (13C75) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 05:12:43 -0000 > On Jan 5, 2016, at 8:09 PM, Warner Losh wrote: >=20 > The correct fix is >=20 > > chflags -R 0 firstboot > rm -rf firstboot > >=20 > If you still can't remove it, too bad. Checking to make sure it worked rea= lly isn't > the unix way. Sometimes when you do stupid things, stupid results happen. >=20 You forgot to drop the mic and walk out. Looks good to me. --=20 Devin > Warner >=20 >> On Tue, Jan 5, 2016 at 8:16 PM, Devin Teske wrote: >> This e-mail is extremely hard to parse and I think you are mistaken. >>=20 >> The -f flag is more than just a counter to a possible -i >>=20 >> Try to rm a file that has schg >> You will get a prompt without -i >> Adding -f will abate the prompt to attempt override of schg flag. >>=20 >> There are more conditions in rm that lead to a prompt than simply those c= onditions involving -i and adding -f abates them all. >>=20 >> -- >> Devin >>=20 >> > On Jan 5, 2016, at 6:48 PM, Bruce Evans wrote: >> > >> > On Tue, 5 Jan 2016, Ian Lepore wrote: >> > >> >>> Log: >> >>> Use the more proper -f. Leave /bin/rm in place since that's what >> >>> other rc scripts have, though it isn't strictly necessary. >> > >> > "proper -f" is hard to parse. I think you mean: >> > >> > Use 'rm -f' to turn off -i in case rm is broken and is an alias which >> > has -i (and perhaps actually even something resembling rm) in it. More= >> > precisely, use 'rm -f /usr/bin' to partly defend against the same bug >> > in /bin/rm (where it would be larger). Keep using /usr/rm instead of >> > restoring the use of plain rm since that is what other rc scripts have.= >> > The previous change to use /bin/rm instead of plain rm was neither >> > necessary nor sufficient for fixing the bug. Neither is this one, but >> > it gets closer. It is a little-known bug in aliases that even absolute= >> > pathnames can be aliased. So /bin/rm might be aliased to 'rm -ri /'. >> > Appending -f would accidentally help for that too, by turning it into >> > a syntax error, instead of accidentally making it more forceful by >> > turning -ri into -rf. >> > >> > Hopefully this is all FUD. Non-interactive scripts shouldn't source an= y >> > files that are not mentioned in the script. /etc/rc depends on a secur= e >> > environment being set up by init and probably gets it since init doesn'= t >> > set up much. sh(1) documents closing the security hole of sourcing the= >> > script in $ENV for non-interactive shells, but was never a problem for >> > /etc/rc since init must be trusted to not put security holes in $ENV. >> > But users could put security holes in a sourced config file like >> > /etc/rc.conf.local. >> > >> >>> Modified: head/etc/rc >> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D >> >>> --- head/etc/rc Tue Jan 5 21:20:46 2016 (r293226) >> >>> +++ head/etc/rc Tue Jan 5 21:20:47 2016 (r293227) >> >>> @@ -132,9 +132,9 @@ done >> >>> # Remove the firstboot sentinel, and reboot if it was requested. >> >>> if [ -e ${firstboot_sentinel} ]; then >> >>> [ ${root_rw_mount} =3D "yes" ] || mount -uw / >> >>> - /bin/rm ${firstboot_sentinel} >> >>> + /bin/rm -f ${firstboot_sentinel} >> >>> if [ -e ${firstboot_sentinel}-reboot ]; then >> >>> - /bin/rm ${firstboot_sentinel}-reboot >> >>> + /bin/rm -f ${firstboot_sentinel}-reboot >> >>> [ ${root_rw_mount} =3D "yes" ] || mount -ur / >> >>> kill -INT 1 >> >>> fi >> >> >> >> Using rm -f to suppress an error message seems like a bad idea here --= >> >> if the sentinel file can't be removed that implies it's going to do >> >> firstboot behavior every time it boots, and that's the sort of error >> >> that should be in-your-face. Especially on the reboot one because >> >> you're going to be stuck in a reboot loop with no error message. >> > >> > Er, -f on rm only turns off -i and supresses the warning message for >> > failing to remove nonexistent files. But we just tested that the file >> > exists, and in the impossible even of a race making it not exist by >> > the time that it runs, we have more problems than the failure of rm >> > since we use the file's existence as a control for other things. >> > >> > So the only effect of this -f is to turn off -i, which can only be set >> > if the FUD was justified. >> > >> > The correct fix seems to be 'unalias -a'. >> > >> > Bruce >> > >=20 From owner-svn-src-head@freebsd.org Wed Jan 6 05:23:26 2016 Return-Path: Delivered-To: svn-src-head@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 88E71A64B49; Wed, 6 Jan 2016 05:23:26 +0000 (UTC) (envelope-from gjb@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 583F21C43; Wed, 6 Jan 2016 05:23:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u065NPFY021089; Wed, 6 Jan 2016 05:23:25 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u065NPLQ021088; Wed, 6 Jan 2016 05:23:25 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201601060523.u065NPLQ021088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 6 Jan 2016 05:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293231 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 05:23:26 -0000 Author: gjb Date: Wed Jan 6 05:23:25 2016 New Revision: 293231 URL: https://svnweb.freebsd.org/changeset/base/293231 Log: Add a new target to touch the ${.OBJDIR}/release file, which indicates the 'release' target has run (in order to prevent subsequent invocations that may clobber original build output). As is, the 'release' target is a dummy target that does nothing more than depend on subsequent targets. Unless 'make obj' is invoked prior to 'make release', .OBJDIR and .CURDIR will always be '/usr/src/release' (or wherever /usr/src is located). When 'make release' invokes 'make real-release' (and subsequent targets), .OBJDIR is not updated, which still leads to src/ tree pollution. While arguably a hack, 'make release' will invoke the original dummy targets as originally intended, but instead of touching an empty file (or returing @true), will call a 'release-done' target that will trigger the behavior that was intended to prevent a subsequent invocation. Discussed with: hrs MFC after: 3 days X-MFC-With: r293173 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Wed Jan 6 00:52:55 2016 (r293230) +++ head/release/Makefile Wed Jan 6 05:23:25 2016 (r293231) @@ -281,7 +281,11 @@ ftp: packagesystem cp *.txz MANIFEST ftp release: real-release vm-release cloudware-release - touch ${.OBJDIR}/${.TARGET} + ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} release-done + true + +release-done: + touch release real-release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj From owner-svn-src-head@freebsd.org Wed Jan 6 07:03:18 2016 Return-Path: Delivered-To: svn-src-head@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 9BEF3A6418C; Wed, 6 Jan 2016 07:03:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 606A219E3; Wed, 6 Jan 2016 07:03:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 991BE784CAF; Wed, 6 Jan 2016 17:40:17 +1100 (AEDT) Date: Wed, 6 Jan 2016 17:40:16 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Allan Jude cc: Devin Teske , Bruce Evans , Ian Lepore , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske Subject: Re: svn commit: r293227 - head/etc In-Reply-To: <568C883C.5050006@freebsd.org> Message-ID: <20160106163237.L1563@besplex.bde.org> References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <20160106125617.E968@besplex.bde.org> <5360EA7A-399F-4679-B58F-62D0112EA481@shxd.cx> <568C883C.5050006@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=_9Kpg5vkrs-okR2GLKYA:9 a=-uQxRxpSkNZysZvc:21 a=Gk-SUihwnLnGPLte:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 07:03:18 -0000 On Tue, 5 Jan 2016, Allan Jude wrote: > On 2016-01-05 22:16, Devin Teske wrote: >> This e-mail is extremely hard to parse and I think you are mistaken. >> >> The -f flag is more than just a counter to a possible -i >> >> Try to rm a file that has schg >> You will get a prompt without -i >> Adding -f will abate the prompt to attempt override of schg flag. I forgot about the permissions check. Normally root has permission to write anything, but some file flags change this. The schg flag is handled bogusly: rm prompts without -f, but schg prevents removal if you answer 'y'. The uchg flag is handled better. rm has special undocumented code to handle it, mainly so that rm -rf blows it away. Without -f, rm prompts but the the special code removes uchg so that removal is possible. The permissions check only applies to the file. Removal doesn't depend on the file's permissions. It only depends on the file's flags and the directory's permissions and flags. rm agrees with its man page and doesn't prompt if the file is writable but the directory is unwritable. The directory permissions don't stop root either, but immutable directories do. Since there is no prompt, -f has no effect on anyone in this case. >> There are more conditions in rm that lead to a prompt than simply those conditions involving -i and adding -f abates them all. It isn't clear what these are. POSIX only says that there is a prompt without -i for files which don't have write permission (to themselves). FreeBSD's man page should say more about how this extended for file flags, but actually says nothing for file flags and is less clear than POSIX for ordinary permissions. > I think this is kind of a poor UI design of rm(1) honestly. It seems > like what we need is a 'never be interactive' flag, that won't surpress > the error message about the schg'd file, or read-only file system, but > won't try to prompt for it. > > Although adding a new flag to rm(1) at this point probably doesn't make > sense. It already has this flag, namely -f. This is what I started out to say. -f never suppresses errors except ENOENT for a non-existent file. What it suppresses is prompts. Since the uchg hack involves a prompt, -f also changes the semantics for removing user-immutable files. The file flags hack includes uappnd together with uchg, but not the newfangled uunlnk. That has only been available for annoying sysadmins since 1997. Apparently its name is to confusing for it to be used. Bruce From owner-svn-src-head@freebsd.org Wed Jan 6 11:52:41 2016 Return-Path: Delivered-To: svn-src-head@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 A5FD1A65242; Wed, 6 Jan 2016 11:52:41 +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 66FFA12A3; Wed, 6 Jan 2016 11:52:41 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aGmdi-000Adi-M2; Wed, 06 Jan 2016 14:52:30 +0300 Date: Wed, 6 Jan 2016 14:52:30 +0300 From: Slawa Olhovchenkov To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts Message-ID: <20160106115230.GJ70867@zxy.spb.ru> References: <201601052105.u05L5HLi071593@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601052105.u05L5HLi071593@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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 11:52:41 -0000 On Tue, Jan 05, 2016 at 09:05:17PM +0000, Glen Barber wrote: > Author: gjb > Date: Tue Jan 5 21:05:17 2016 > New Revision: 293223 > URL: https://svnweb.freebsd.org/changeset/base/293223 > > Log: > Merge ^/projects/release-install-debug: > > - Rework MANIFEST generation and parsing via bsdinstall(8). > - Allow selecting debugging distribution sets during install. > - Rework bsdinstall(8) to fetch remote debug distribution sets > when they are not available on the local install medium. > - Allow selecting additional non-GENERIC kernels during install. > At present, GENERIC is still required, and installed by default. > > Tested with: head@r293203 > Sponsored by: The FreeBSD Foundation MFC planed? > Modified: > head/Makefile.inc1 > head/release/Makefile > head/release/amd64/mkisoimages.sh > head/release/i386/mkisoimages.sh > head/release/pc98/mkisoimages.sh > head/release/powerpc/mkisoimages.sh > head/release/scripts/make-manifest.sh > head/release/sparc64/mkisoimages.sh > head/usr.sbin/bsdinstall/scripts/auto > From owner-svn-src-head@freebsd.org Wed Jan 6 12:34:32 2016 Return-Path: Delivered-To: svn-src-head@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 8D925A644C6; Wed, 6 Jan 2016 12:34:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 7EA671770; Wed, 6 Jan 2016 12:34:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id D66471616; Wed, 6 Jan 2016 12:34:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Wed, 6 Jan 2016 12:34:29 +0000 From: Glen Barber To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts Message-ID: <20160106123429.GA26378@FreeBSD.org> References: <201601052105.u05L5HLi071593@repo.freebsd.org> <20160106115230.GJ70867@zxy.spb.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="envbJBWh7q8WU6mo" Content-Disposition: inline In-Reply-To: <20160106115230.GJ70867@zxy.spb.ru> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 12:34:32 -0000 --envbJBWh7q8WU6mo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 06, 2016 at 02:52:30PM +0300, Slawa Olhovchenkov wrote: > On Tue, Jan 05, 2016 at 09:05:17PM +0000, Glen Barber wrote: >=20 > > Author: gjb > > Date: Tue Jan 5 21:05:17 2016 > > New Revision: 293223 > > URL: https://svnweb.freebsd.org/changeset/base/293223 > >=20 > > Log: > > Merge ^/projects/release-install-debug: > > =20 > > - Rework MANIFEST generation and parsing via bsdinstall(8). > > - Allow selecting debugging distribution sets during install. > > - Rework bsdinstall(8) to fetch remote debug distribution sets > > when they are not available on the local install medium. > > - Allow selecting additional non-GENERIC kernels during install. > > At present, GENERIC is still required, and installed by default. > > =20 > > Tested with: head@r293203 > > Sponsored by: The FreeBSD Foundation >=20 > MFC planed? >=20 Not before 10.3-RELEASE, no. Perhaps after that. Glen --envbJBWh7q8WU6mo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWjQnVAAoJEAMUWKVHj+KTEsMQAIHd1FWPeQPah+WkHt1NAWKY FzF5Cl8gXtVZu+kx/n/bzNj2M1DWFB+YlKXc0nf6Gghf8gehcrexr/EQCqBS7y4o Q1mnEJZdr0Ar+DNIpukofVbR6zB6uPNi4CD07pItnX040yh3xBxSqQxCgSUMhrMV cBDQV3HzKroMz2pQLGFs+68xdCDJoOM0whO8cI7vHgiRj8DFtN+svJvk/qRkwEhP /HnfqB9KaK7WEt9UfC7yQdgHi8R7Zj3QObGulyefwDTyy0bmIZ58baO1/5O9v8vL VDxddWy3mFkDC4dJnile2pB9gHCOY4z9RYTsl2D9L5RjkSO00JC2RAmp80A3/mIj hzkNAZktHVRHmn1UdpTa6x1m1ac5w5Q+VDt6MEEeB6uNh6jKyoT/ECpzb8Hp3AT8 fbjmElwjhyBcC7XTcOLVlyexNl4WXku+LrM6Ugoyj7GnPxAMtG0VhjGj4VphTD0+ GVTgvDHc5/jDwIgQNtll5XBpl7JPPetTJk3cxS9iukbhul7BnmTs1AtVuxCeZLyV K2EU5zrAg7mT/1KFBffn3BkHYxwLbXkltkMV/OwbfzwWJRxSi4TZPAKqV32wJjKE DQR1NJ0RpahhLw0aZLm5H3ep0x/Y25sks8xwgsudNH6BHGRZcaYA2eWDvssMglma 3Xbj3oZxaSLhIkqVE8h5 =MWO4 -----END PGP SIGNATURE----- --envbJBWh7q8WU6mo-- From owner-svn-src-head@freebsd.org Wed Jan 6 13:02:18 2016 Return-Path: Delivered-To: svn-src-head@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 E3719A64F1D; Wed, 6 Jan 2016 13:02:18 +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 A356A17EB; Wed, 6 Jan 2016 13:02:18 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aGnjB-000C39-Pz; Wed, 06 Jan 2016 16:02:13 +0300 Date: Wed, 6 Jan 2016 16:02:13 +0300 From: Slawa Olhovchenkov To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts Message-ID: <20160106130213.GI4535@zxy.spb.ru> References: <201601052105.u05L5HLi071593@repo.freebsd.org> <20160106115230.GJ70867@zxy.spb.ru> <20160106123429.GA26378@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160106123429.GA26378@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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 13:02:19 -0000 On Wed, Jan 06, 2016 at 12:34:29PM +0000, Glen Barber wrote: > On Wed, Jan 06, 2016 at 02:52:30PM +0300, Slawa Olhovchenkov wrote: > > On Tue, Jan 05, 2016 at 09:05:17PM +0000, Glen Barber wrote: > > > > > Author: gjb > > > Date: Tue Jan 5 21:05:17 2016 > > > New Revision: 293223 > > > URL: https://svnweb.freebsd.org/changeset/base/293223 > > > > > > Log: > > > Merge ^/projects/release-install-debug: > > > > > > - Rework MANIFEST generation and parsing via bsdinstall(8). > > > - Allow selecting debugging distribution sets during install. > > > - Rework bsdinstall(8) to fetch remote debug distribution sets > > > when they are not available on the local install medium. > > > - Allow selecting additional non-GENERIC kernels during install. > > > At present, GENERIC is still required, and installed by default. > > > > > > Tested with: head@r293203 > > > Sponsored by: The FreeBSD Foundation > > > > MFC planed? > > > > Not before 10.3-RELEASE, no. Perhaps after that. Somehow not done? Can I use this as patch for custom intallation images? From owner-svn-src-head@freebsd.org Wed Jan 6 13:26:55 2016 Return-Path: Delivered-To: svn-src-head@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 6A8F4A635F0; Wed, 6 Jan 2016 13:26:55 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 5A98A10C6; Wed, 6 Jan 2016 13:26:55 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id B36781213; Wed, 6 Jan 2016 13:26:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Wed, 6 Jan 2016 13:26:53 +0000 From: Glen Barber To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts Message-ID: <20160106132653.GC26378@FreeBSD.org> References: <201601052105.u05L5HLi071593@repo.freebsd.org> <20160106115230.GJ70867@zxy.spb.ru> <20160106123429.GA26378@FreeBSD.org> <20160106130213.GI4535@zxy.spb.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sHrvAb52M6C8blB9" Content-Disposition: inline In-Reply-To: <20160106130213.GI4535@zxy.spb.ru> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 13:26:55 -0000 --sHrvAb52M6C8blB9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 06, 2016 at 04:02:13PM +0300, Slawa Olhovchenkov wrote: > On Wed, Jan 06, 2016 at 12:34:29PM +0000, Glen Barber wrote: >=20 > > On Wed, Jan 06, 2016 at 02:52:30PM +0300, Slawa Olhovchenkov wrote: > > > On Tue, Jan 05, 2016 at 09:05:17PM +0000, Glen Barber wrote: > > >=20 > > > > Author: gjb > > > > Date: Tue Jan 5 21:05:17 2016 > > > > New Revision: 293223 > > > > URL: https://svnweb.freebsd.org/changeset/base/293223 > > > >=20 > > > > Log: > > > > Merge ^/projects/release-install-debug: > > > > =20 > > > > - Rework MANIFEST generation and parsing via bsdinstall(8). > > > > - Allow selecting debugging distribution sets during install. > > > > - Rework bsdinstall(8) to fetch remote debug distribution sets > > > > when they are not available on the local install medium. > > > > - Allow selecting additional non-GENERIC kernels during install. > > > > At present, GENERIC is still required, and installed by default. > > > > =20 > > > > Tested with: head@r293203 > > > > Sponsored by: The FreeBSD Foundation > > >=20 > > > MFC planed? > > >=20 > >=20 > > Not before 10.3-RELEASE, no. Perhaps after that. >=20 > Somehow not done? I'm sorry, I do not understand what you mean. > Can I use this as patch for custom intallation images? >=20 It should mostly apply, yes. There are likely sharp edges, though, which is why I will not merge it before 10.3-RELEASE. Glen --sHrvAb52M6C8blB9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWjRYdAAoJEAMUWKVHj+KTmacP/je33EgpjZtpJ1gGE2k69j6S c1UMo582YGH063s7jFKGZhZEB/UCykQpN5JwDBWxvm6CZ7puaDNLwgfKRY0iwEAO yw3SJxYItQyUnNXnJYZDNWjUOWn6Dl/tlDjUq9YmJBtKoTfw3GmbcBRK7OgM2l9E 2f+ieimvbPMxMjSRnoDP/NvZT9Ex/lrbPF/NoI4OuYLYz4eV8rLCjoqP/hSKDnE8 kDS1TjX9nEbLBTGxzgmuxNszrdg9pzFKv0p2cHaTQJ8c4b1B45EAcRLlpuCGZxw0 bLrS45uVRc3jom619Dm1PfNDvi0KYr0N6y0N6GkUmuLx+f4DB+gixQUA0SQwOFWM iG7RAyxCJ6VDw+XsPl9yav6jNqN4LkDMYHQPvITFRkWDl9abkHlokGOqxljq0+0x jsVirl7+k2YdWxl08z7qt5FVOTgW2vTf9Pma8PxlrNbavx0DYgD68YswnY4TfCYO Q3ICn9R9nQtcksE4/kmYlkvYrDNgK7/r9qLG8hzi4SYGKFMRvYagBrl8ZWP6f4gI c5xxnx+LYmwQhOh1oI92fjVRxAsiRdB2E73WipY2KbJZX0OzBF65Qe82tl+mud30 IeRvPUfWvb5dAoH9fmbWIV2Xxp0R7bZqK/aef0+mmFHLPewABKPKwnG6DxOYdrHD 7VJo/WkBdwECMQHKPuh5 =R0Bl -----END PGP SIGNATURE----- --sHrvAb52M6C8blB9-- From owner-svn-src-head@freebsd.org Wed Jan 6 13:39:42 2016 Return-Path: Delivered-To: svn-src-head@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 89BD6A63C4C; Wed, 6 Jan 2016 13:39:42 +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 4841219D7; Wed, 6 Jan 2016 13:39:42 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aGoJQ-000D0E-8R; Wed, 06 Jan 2016 16:39:40 +0300 Date: Wed, 6 Jan 2016 16:39:40 +0300 From: Slawa Olhovchenkov To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts Message-ID: <20160106133940.GJ4535@zxy.spb.ru> References: <201601052105.u05L5HLi071593@repo.freebsd.org> <20160106115230.GJ70867@zxy.spb.ru> <20160106123429.GA26378@FreeBSD.org> <20160106130213.GI4535@zxy.spb.ru> <20160106132653.GC26378@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160106132653.GC26378@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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 13:39:42 -0000 On Wed, Jan 06, 2016 at 01:26:53PM +0000, Glen Barber wrote: > On Wed, Jan 06, 2016 at 04:02:13PM +0300, Slawa Olhovchenkov wrote: > > On Wed, Jan 06, 2016 at 12:34:29PM +0000, Glen Barber wrote: > > > > > On Wed, Jan 06, 2016 at 02:52:30PM +0300, Slawa Olhovchenkov wrote: > > > > On Tue, Jan 05, 2016 at 09:05:17PM +0000, Glen Barber wrote: > > > > > > > > > Author: gjb > > > > > Date: Tue Jan 5 21:05:17 2016 > > > > > New Revision: 293223 > > > > > URL: https://svnweb.freebsd.org/changeset/base/293223 > > > > > > > > > > Log: > > > > > Merge ^/projects/release-install-debug: > > > > > > > > > > - Rework MANIFEST generation and parsing via bsdinstall(8). > > > > > - Allow selecting debugging distribution sets during install. > > > > > - Rework bsdinstall(8) to fetch remote debug distribution sets > > > > > when they are not available on the local install medium. > > > > > - Allow selecting additional non-GENERIC kernels during install. > > > > > At present, GENERIC is still required, and installed by default. > > > > > > > > > > Tested with: head@r293203 > > > > > Sponsored by: The FreeBSD Foundation > > > > > > > > MFC planed? > > > > > > > > > > Not before 10.3-RELEASE, no. Perhaps after that. > > > > Somehow not done? > > I'm sorry, I do not understand what you mean. Sorry for my english. Do you planed for some commit to head before MFC planed? > > Can I use this as patch for custom intallation images? > > > > It should mostly apply, yes. There are likely sharp edges, though, > which is why I will not merge it before 10.3-RELEASE. > > Glen > From owner-svn-src-head@freebsd.org Wed Jan 6 13:42:02 2016 Return-Path: Delivered-To: svn-src-head@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 83AA4A63ECB; Wed, 6 Jan 2016 13:42:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 734FB1E80; Wed, 6 Jan 2016 13:42:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id C880D17A6; Wed, 6 Jan 2016 13:42:01 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Wed, 6 Jan 2016 13:42:00 +0000 From: Glen Barber To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts Message-ID: <20160106134200.GG26378@FreeBSD.org> References: <201601052105.u05L5HLi071593@repo.freebsd.org> <20160106115230.GJ70867@zxy.spb.ru> <20160106123429.GA26378@FreeBSD.org> <20160106130213.GI4535@zxy.spb.ru> <20160106132653.GC26378@FreeBSD.org> <20160106133940.GJ4535@zxy.spb.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="+1TulI7fc0PCHNy3" Content-Disposition: inline In-Reply-To: <20160106133940.GJ4535@zxy.spb.ru> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 13:42:02 -0000 --+1TulI7fc0PCHNy3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 06, 2016 at 04:39:40PM +0300, Slawa Olhovchenkov wrote: > On Wed, Jan 06, 2016 at 01:26:53PM +0000, Glen Barber wrote: > > On Wed, Jan 06, 2016 at 04:02:13PM +0300, Slawa Olhovchenkov wrote: > > > Somehow not done? > >=20 > > I'm sorry, I do not understand what you mean. >=20 > Sorry for my english. Your english is fine. :) I was not sure if you meant this particular commit, or something else. > Do you planed for some commit to head before MFC planed? >=20 Bug fixes, mainly. I am sure I have missed something, regardless of how much testing was done. Glen --+1TulI7fc0PCHNy3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWjRmoAAoJEAMUWKVHj+KTsjcP/AvZNEhNrHmjweglYOsNDK4g xWEXffQLgxZ48VGnfgBvRYWe33uxScCeRqUWW95CN5rdhuenMhSrJXs3J3s7ZDVD CiCI5pBYjFQzPF94DQpnyB1BKF/vFb5QH4UVm3oVLaVamkM3DIo4uQK36xgA2eUG XSG0ZdAGwb5RI0CNOQXp98TAqJcChtQtUjjllcGaSoHtdepJvPeCQ3ryFo/nHi05 zMM34FyO9vHcUJKFikyO0eGDmrLK+1Fb7ak3VLYHDExWX30G/9Z8XawsInmqI9Rf QSZ0F9L0J4BA8ZuooXaeoXIKeCSSOPrxpoVt7+sRTkUmAwYnkcEO18HMTeL2Q+uf 30Oketic6gzQ8HieScrgf9NdDqb9PQXEZGWDuZxFgPiNv/vPJgtg2RgdJmDJ61xb C7thWSDIFQTZfql0nmbJk6s6ZlkGQNA8aa/CTpHWXplsl/C37SszlokwmQ3YLLgR 7smKcbbM954uoTewFp7yJxjYPm7c+NOX6tAQsu7SWqRGJFgoT/FMwj7rvh3Pevml /ViwR6JYA5PeHZ3V5Y953t/kB3M9q93/4wgi61Jj12O4u5m4VkDpcfjcHH5cXacg hF9fjFYNc/hSc9FuVsYDOwNkSKRzO9cWDq4KcBbtLz3U0sYo5/xGMnBqcMS+L6IS c/8dieg1EDLynFicfC4J =EX8+ -----END PGP SIGNATURE----- --+1TulI7fc0PCHNy3-- From owner-svn-src-head@freebsd.org Wed Jan 6 13:49:00 2016 Return-Path: Delivered-To: svn-src-head@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 BA63CA650C1; Wed, 6 Jan 2016 13:49:00 +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 781C511CD; Wed, 6 Jan 2016 13:49:00 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aGoSQ-000DCp-GW; Wed, 06 Jan 2016 16:48:58 +0300 Date: Wed, 6 Jan 2016 16:48:58 +0300 From: Slawa Olhovchenkov To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293223 - in head: . release release/amd64 release/i386 release/pc98 release/powerpc release/scripts release/sparc64 usr.sbin/bsdinstall/scripts Message-ID: <20160106134858.GK4535@zxy.spb.ru> References: <201601052105.u05L5HLi071593@repo.freebsd.org> <20160106115230.GJ70867@zxy.spb.ru> <20160106123429.GA26378@FreeBSD.org> <20160106130213.GI4535@zxy.spb.ru> <20160106132653.GC26378@FreeBSD.org> <20160106133940.GJ4535@zxy.spb.ru> <20160106134200.GG26378@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160106134200.GG26378@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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 13:49:00 -0000 On Wed, Jan 06, 2016 at 01:42:00PM +0000, Glen Barber wrote: > On Wed, Jan 06, 2016 at 04:39:40PM +0300, Slawa Olhovchenkov wrote: > > On Wed, Jan 06, 2016 at 01:26:53PM +0000, Glen Barber wrote: > > > On Wed, Jan 06, 2016 at 04:02:13PM +0300, Slawa Olhovchenkov wrote: > > > > Somehow not done? > > > > > > I'm sorry, I do not understand what you mean. > > > > Sorry for my english. > > Your english is fine. :) > > I was not sure if you meant this particular commit, or something else. > > > Do you planed for some commit to head before MFC planed? > > > > Bug fixes, mainly. I am sure I have missed something, regardless of how > much testing was done. Thanks, I will try. From owner-svn-src-head@freebsd.org Wed Jan 6 15:38:41 2016 Return-Path: Delivered-To: svn-src-head@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 EDC9EA4E612; Wed, 6 Jan 2016 15:38:40 +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 B0C5114A0; Wed, 6 Jan 2016 15:38:40 +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 u06FcdSZ001010; Wed, 6 Jan 2016 15:38:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06FcdOe001006; Wed, 6 Jan 2016 15:38:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601061538.u06FcdOe001006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Jan 2016 15:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293233 - in head/sys/boot: efi/libefi efi/loader ficl/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 15:38:41 -0000 Author: emaste Date: Wed Jan 6 15:38:39 2016 New Revision: 293233 URL: https://svnweb.freebsd.org/changeset/base/293233 Log: loader.efi: add terminal emulation support This is based on the vidconsole implementation. Submitted by: Toomas Soome Reviewed by: adrian MFC after: 2 weeks Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D4797 Modified: head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/libefi/efi_console.c head/sys/boot/efi/loader/main.c head/sys/boot/ficl/amd64/sysdep.c Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Wed Jan 6 09:56:06 2016 (r293232) +++ head/sys/boot/efi/libefi/Makefile Wed Jan 6 15:38:39 2016 (r293233) @@ -21,5 +21,6 @@ CFLAGS+= -I${.CURDIR}/../../common # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} +CFLAGS+= -DTERM_EMU .include Modified: head/sys/boot/efi/libefi/efi_console.c ============================================================================== --- head/sys/boot/efi/libefi/efi_console.c Wed Jan 6 09:56:06 2016 (r293232) +++ head/sys/boot/efi/libefi/efi_console.c Wed Jan 6 15:38:39 2016 (r293233) @@ -35,6 +35,69 @@ __FBSDID("$FreeBSD$"); static SIMPLE_TEXT_OUTPUT_INTERFACE *conout; static SIMPLE_INPUT_INTERFACE *conin; +#ifdef TERM_EMU +#define DEFAULT_FGCOLOR EFI_LIGHTGRAY +#define DEFAULT_BGCOLOR EFI_BLACK + +#define MAXARGS 8 +static int args[MAXARGS], argc; +static int fg_c, bg_c, curx, cury; +static int esc; + +void get_pos(int *x, int *y); +void curs_move(int *_x, int *_y, int x, int y); +static void CL(int); +#endif + +static void efi_cons_probe(struct console *); +static int efi_cons_init(int); +void efi_cons_putchar(int); +int efi_cons_getchar(void); +void efi_cons_efiputchar(int); +int efi_cons_poll(void); + +struct console efi_console = { + "efi", + "EFI console", + 0, + efi_cons_probe, + efi_cons_init, + efi_cons_putchar, + efi_cons_getchar, + efi_cons_poll +}; + +#ifdef TERM_EMU + +/* Get cursor position. */ +void +get_pos(int *x, int *y) +{ + *x = conout->Mode->CursorColumn; + *y = conout->Mode->CursorRow; +} + +/* Move cursor to x rows and y cols (0-based). */ +void +curs_move(int *_x, int *_y, int x, int y) +{ + conout->SetCursorPosition(conout, x, y); + if (_x != NULL) + *_x = conout->Mode->CursorColumn; + if (_y != NULL) + *_y = conout->Mode->CursorRow; +} + +/* Clear internal state of the terminal emulation code. */ +void +end_term(void) +{ + esc = 0; + argc = -1; +} + +#endif + static void efi_cons_probe(struct console *cp) { @@ -46,22 +109,314 @@ efi_cons_probe(struct console *cp) static int efi_cons_init(int arg) { - conout->SetAttribute(conout, EFI_TEXT_ATTR(EFI_LIGHTGRAY, EFI_BLACK)); + conout->SetAttribute(conout, EFI_TEXT_ATTR(DEFAULT_FGCOLOR, + DEFAULT_BGCOLOR)); +#ifdef TERM_EMU + end_term(); + get_pos(&curx, &cury); + curs_move(&curx, &cury, curx, cury); + fg_c = DEFAULT_FGCOLOR; + bg_c = DEFAULT_BGCOLOR; +#endif + conout->EnableCursor(conout, TRUE); return 0; } +static void +efi_cons_rawputchar(int c) +{ + int i; + UINTN x, y; + conout->QueryMode(conout, conout->Mode->Mode, &x, &y); + + if (c == '\t') + /* XXX lame tab expansion */ + for (i = 0; i < 8; i++) + efi_cons_rawputchar(' '); + else { +#ifndef TERM_EMU + if (c == '\n') + efi_cons_efiputchar('\r'); + else + efi_cons_efiputchar(c); +#else + switch (c) { + case '\r': + curx = 0; + curs_move(&curx, &cury, curx, cury); + return; + case '\n': + cury++; + if (cury >= y) { + efi_cons_efiputchar('\n'); + cury--; + } else + curs_move(&curx, &cury, curx, cury); + return; + case '\b': + if (curx > 0) { + curx--; + curs_move(&curx, &cury, curx, cury); + } + return; + default: + efi_cons_efiputchar(c); + curx++; + if (curx > x-1) { + curx = 0; + cury++; + } + if (cury > y-1) { + curx = 0; + cury--; + } + } + curs_move(&curx, &cury, curx, cury); +#endif + } +} + +/* Gracefully exit ESC-sequence processing in case of misunderstanding. */ +static void +bail_out(int c) +{ + char buf[16], *ch; + int i; + + if (esc) { + efi_cons_rawputchar('\033'); + if (esc != '\033') + efi_cons_rawputchar(esc); + for (i = 0; i <= argc; ++i) { + sprintf(buf, "%d", args[i]); + ch = buf; + while (*ch) + efi_cons_rawputchar(*ch++); + } + } + efi_cons_rawputchar(c); + end_term(); +} + +/* Clear display from current position to end of screen. */ +static void +CD(void) { + int i; + UINTN x, y; + + get_pos(&curx, &cury); + if (curx == 0 && cury == 0) { + conout->ClearScreen(conout); + end_term(); + return; + } + + conout->QueryMode(conout, conout->Mode->Mode, &x, &y); + CL(0); /* clear current line from cursor to end */ + for (i = cury + 1; i < y-1; i++) { + curs_move(NULL, NULL, 0, i); + CL(0); + } + curs_move(NULL, NULL, curx, cury); + end_term(); +} + +/* + * Absolute cursor move to args[0] rows and args[1] columns + * (the coordinates are 1-based). + */ +static void +CM(void) +{ + if (args[0] > 0) + args[0]--; + if (args[1] > 0) + args[1]--; + curs_move(&curx, &cury, args[1], args[0]); + end_term(); +} + +/* Home cursor (left top corner), also called from mode command. */ void -efi_cons_putchar(int c) +HO(void) { - CHAR16 buf[2]; + argc = 1; + args[0] = args[1] = 1; + CM(); +} - if (c == '\n') - efi_cons_putchar('\r'); +/* Clear line from current position to end of line */ +static void +CL(int direction) +{ + int i, len; + UINTN x, y; + CHAR16 *line; - buf[0] = c; - buf[1] = 0; + conout->QueryMode(conout, conout->Mode->Mode, &x, &y); + switch (direction) { + case 0: /* from cursor to end */ + len = x - curx + 1; + break; + case 1: /* from beginning to cursor */ + len = curx; + break; + case 2: /* entire line */ + len = x; + break; + } - conout->OutputString(conout, buf); + if (cury == y - 1) + len--; + + line = malloc(len * sizeof (CHAR16)); + if (line == NULL) { + printf("out of memory\n"); + return; + } + for (i = 0; i < len; i++) + line[i] = ' '; + line[len-1] = 0; + + if (direction != 0) + curs_move(NULL, NULL, 0, cury); + + conout->OutputString(conout, line); + /* restore cursor position */ + curs_move(NULL, NULL, curx, cury); + free(line); + end_term(); +} + +static void +get_arg(int c) +{ + if (argc < 0) + argc = 0; + args[argc] *= 10; + args[argc] += c - '0'; +} + +/* Emulate basic capabilities of cons25 terminal */ +static void +efi_term_emu(int c) +{ + static int ansi_col[] = { + 0, 4, 2, 6, 1, 5, 3, 7 + }; + int t, i; + + switch (esc) { + case 0: + switch (c) { + case '\033': + esc = c; + break; + default: + efi_cons_rawputchar(c); + break; + } + break; + case '\033': + switch (c) { + case '[': + esc = c; + args[0] = 0; + argc = -1; + break; + default: + bail_out(c); + break; + } + break; + case '[': + switch (c) { + case ';': + if (argc < 0) + argc = 0; + else if (argc + 1 >= MAXARGS) + bail_out(c); + else + args[++argc] = 0; + break; + case 'H': /* ho = \E[H */ + if (argc < 0) + HO(); + else if (argc == 1) + CM(); + else + bail_out(c); + break; + case 'J': /* cd = \E[J */ + if (argc < 0) + CD(); + else + bail_out(c); + break; + case 'm': + if (argc < 0) { + fg_c = DEFAULT_FGCOLOR; + bg_c = DEFAULT_BGCOLOR; + } + for (i = 0; i <= argc; ++i) { + switch (args[i]) { + case 0: /* back to normal */ + fg_c = DEFAULT_FGCOLOR; + bg_c = DEFAULT_BGCOLOR; + break; + case 1: /* bold */ + fg_c |= 0x8; + break; + case 4: /* underline */ + case 5: /* blink */ + bg_c |= 0x8; + break; + case 7: /* reverse */ + t = fg_c; + fg_c = bg_c; + bg_c = t; + break; + case 30: case 31: case 32: case 33: + case 34: case 35: case 36: case 37: + fg_c = ansi_col[args[i] - 30]; + break; + case 39: /* normal */ + fg_c = DEFAULT_FGCOLOR; + break; + case 40: case 41: case 42: case 43: + case 44: case 45: case 46: case 47: + bg_c = ansi_col[args[i] - 40]; + break; + case 49: /* normal */ + bg_c = DEFAULT_BGCOLOR; + break; + } + } + conout->SetAttribute(conout, EFI_TEXT_ATTR(fg_c, bg_c)); + end_term(); + break; + default: + if (isdigit(c)) + get_arg(c); + else + bail_out(c); + break; + } + break; + default: + bail_out(c); + break; + } +} + +void +efi_cons_putchar(int c) +{ +#ifdef TERM_EMU + efi_term_emu(c); +#else + efi_cons_rawputchar(c); +#endif } int @@ -77,6 +432,12 @@ efi_cons_getchar() BS->WaitForEvent(1, &conin->WaitForKey, &junk); status = conin->ReadKeyStroke(conin, &key); } + switch (key.ScanCode) { + case 0x17: /* ESC */ + return (0x1b); /* esc */ + } + + /* this can return */ return (key.UnicodeChar); } @@ -87,13 +448,36 @@ efi_cons_poll() return (BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS); } -struct console efi_console = { - "efi", - "EFI console", - 0, - efi_cons_probe, - efi_cons_init, - efi_cons_putchar, - efi_cons_getchar, - efi_cons_poll -}; +/* Plain direct access to EFI OutputString(). */ +void +efi_cons_efiputchar(int c) +{ + CHAR16 buf[2]; + + /* + * translate box chars to unicode + */ + switch (c) { + /* single frame */ + case 0xb3: buf[0] = BOXDRAW_VERTICAL; break; + case 0xbf: buf[0] = BOXDRAW_DOWN_LEFT; break; + case 0xc0: buf[0] = BOXDRAW_UP_RIGHT; break; + case 0xc4: buf[0] = BOXDRAW_HORIZONTAL; break; + case 0xda: buf[0] = BOXDRAW_DOWN_RIGHT; break; + case 0xd9: buf[0] = BOXDRAW_UP_LEFT; break; + + /* double frame */ + case 0xba: buf[0] = BOXDRAW_DOUBLE_VERTICAL; break; + case 0xbb: buf[0] = BOXDRAW_DOUBLE_DOWN_LEFT; break; + case 0xbc: buf[0] = BOXDRAW_DOUBLE_UP_LEFT; break; + case 0xc8: buf[0] = BOXDRAW_DOUBLE_UP_RIGHT; break; + case 0xc9: buf[0] = BOXDRAW_DOUBLE_DOWN_RIGHT; break; + case 0xcd: buf[0] = BOXDRAW_DOUBLE_HORIZONTAL; break; + + default: + buf[0] = c; + } + buf[1] = 0; /* terminate string */ + + conout->OutputString(conout, buf); +} Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Wed Jan 6 09:56:06 2016 (r293232) +++ head/sys/boot/efi/loader/main.c Wed Jan 6 15:38:39 2016 (r293233) @@ -334,6 +334,7 @@ command_mode(int argc, char *argv[]) char rowenv[8]; EFI_STATUS status; SIMPLE_TEXT_OUTPUT_INTERFACE *conout; + extern void HO(void); conout = ST->ConOut; @@ -355,7 +356,7 @@ command_mode(int argc, char *argv[]) } sprintf(rowenv, "%u", (unsigned)rows); setenv("LINES", rowenv, 1); - + HO(); /* set cursor */ return (CMD_OK); } Modified: head/sys/boot/ficl/amd64/sysdep.c ============================================================================== --- head/sys/boot/ficl/amd64/sysdep.c Wed Jan 6 09:56:06 2016 (r293232) +++ head/sys/boot/ficl/amd64/sysdep.c Wed Jan 6 15:38:39 2016 (r293233) @@ -55,7 +55,7 @@ void ficlTextOut(FICL_VM *pVM, char *ms IGNORE(pVM); while(*msg != 0) - putchar(*(msg++)); + putchar((unsigned char)*(msg++)); if (fNewline) putchar('\n'); From owner-svn-src-head@freebsd.org Wed Jan 6 15:50:23 2016 Return-Path: Delivered-To: svn-src-head@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 79F56A4EAB8; Wed, 6 Jan 2016 15:50:23 +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 2D3081C24; Wed, 6 Jan 2016 15:50:23 +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 u06FoMMf004023; Wed, 6 Jan 2016 15:50:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06FoMGa004020; Wed, 6 Jan 2016 15:50:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601061550.u06FoMGa004020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Jan 2016 15:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293234 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 15:50:23 -0000 Author: emaste Date: Wed Jan 6 15:50:21 2016 New Revision: 293234 URL: https://svnweb.freebsd.org/changeset/base/293234 Log: Enable the beastie menu for the UEFI console As of r293233 the UEFI console includes basic terminal emulator support. MFC after: 2 weeks Relnotes: Yes Modified: head/sys/boot/forth/beastie.4th head/sys/boot/forth/beastie.4th.8 head/sys/boot/forth/loader.conf.5 Modified: head/sys/boot/forth/beastie.4th ============================================================================== --- head/sys/boot/forth/beastie.4th Wed Jan 6 15:38:39 2016 (r293233) +++ head/sys/boot/forth/beastie.4th Wed Jan 6 15:50:21 2016 (r293234) @@ -85,11 +85,6 @@ variable logoY also support-functions : beastie-start ( -- ) \ starts the menu - s" console" getenv dup -1 <> if - s" efi" 2swap contains? if - s" set beastie_disable=YES" evaluate - then - else drop then s" beastie_disable" getenv dup -1 <> if s" YES" compare-insensitive 0= if any_conf_read? if Modified: head/sys/boot/forth/beastie.4th.8 ============================================================================== --- head/sys/boot/forth/beastie.4th.8 Wed Jan 6 15:38:39 2016 (r293233) +++ head/sys/boot/forth/beastie.4th.8 Wed Jan 6 15:50:21 2016 (r293234) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2014 +.Dd January 6, 2016 .Dt BEASTIE.4TH 8 .Os .Sh NAME @@ -119,8 +119,7 @@ Sets the desired row position of the log If set to .Dq YES , the beastie boot menu will be skipped. -The beastie boot menu is always skipped if booting UEFI or running non-x86 -hardware. +The beastie boot menu is always skipped if running non-x86 hardware. .It Va loader_delay If set to a number higher than zero, introduces a delay before starting the beastie boot menu. During the delay the user can press either Ctrl-C to skip Modified: head/sys/boot/forth/loader.conf.5 ============================================================================== --- head/sys/boot/forth/loader.conf.5 Wed Jan 6 15:38:39 2016 (r293233) +++ head/sys/boot/forth/loader.conf.5 Wed Jan 6 15:50:21 2016 (r293234) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 27, 2014 +.Dd January 6, 2016 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -236,8 +236,7 @@ be displayed. If set to .Dq YES , the beastie boot menu will be skipped. -The beastie boot menu is always skipped if booting UEFI or running non-x86 -hardware. +The beastie boot menu is always skipped if running non-x86 hardware. .It Va loader_logo Pq Dq Li orbbw Selects a desired logo in the beastie boot menu. Possible values are: From owner-svn-src-head@freebsd.org Wed Jan 6 16:10:57 2016 Return-Path: Delivered-To: svn-src-head@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 D80A3A6238D; Wed, 6 Jan 2016 16:10:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 568901C06; Wed, 6 Jan 2016 16:10:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u06GAkiV018633 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 6 Jan 2016 18:10:47 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u06GAkiV018633 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u06GAkhf018632; Wed, 6 Jan 2016 18:10:46 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 6 Jan 2016 18:10:46 +0200 From: Konstantin Belousov To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293226 - head/libexec/rtld-elf Message-ID: <20160106161046.GP3625@kib.kiev.ua> References: <201601052120.u05LKkvv074874@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601052120.u05LKkvv074874@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 16:10:57 -0000 On Tue, Jan 05, 2016 at 09:20:46PM +0000, Warner Losh wrote: > Author: imp > Date: Tue Jan 5 21:20:46 2016 > New Revision: 293226 > URL: https://svnweb.freebsd.org/changeset/base/293226 > > Log: > Disable abi variant hook until strangeness with packages can be sorted > out. > > Modified: > head/libexec/rtld-elf/rtld.c > > Modified: head/libexec/rtld-elf/rtld.c > ============================================================================== > --- head/libexec/rtld-elf/rtld.c Tue Jan 5 21:12:49 2016 (r293225) > +++ head/libexec/rtld-elf/rtld.c Tue Jan 5 21:20:46 2016 (r293226) > @@ -435,7 +435,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ > > trust = !issetugid(); > > - md_abi_variant_hook(aux_info); > +/* md_abi_variant_hook(aux_info); */ > > ld_bind_now = getenv(_LD("BIND_NOW")); > /* The ARM hook resets the default paths to the libsoft variants. It cannot work while /lib, /usr/lib and /usr/local/lib are populated with soft-fp libraries. I thought that you are going to switch the default target_arch to armv6hf immediately after the commit to rtld. And then, looking into the issue, IMO the way forward is to leave softfp libraries where they are, but install v6hf somewhere in /lib/armv6hf etc. From owner-svn-src-head@freebsd.org Wed Jan 6 17:01:28 2016 Return-Path: Delivered-To: svn-src-head@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 2E52AA65743 for ; Wed, 6 Jan 2016 17:01:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x236.google.com (mail-qg0-x236.google.com [IPv6:2607:f8b0:400d:c04::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 F3E2B124C for ; Wed, 6 Jan 2016 17:01:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x236.google.com with SMTP id b35so177035666qge.0 for ; Wed, 06 Jan 2016 09:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=70h4flNR7FPnQpv1DVV34yLgEdkxF75tFHz9TiMCU6c=; b=mMAxLNcvllloKBK/uhuAQA0Z/Fs4ZaV4H10/iNmkyF7ZB+4eKCdkVMUInZUl+rTIi9 bLBzYS9ZFIRnMPTM7Mj+7JDX0OPEQj2nG6iJNC0dWbTwZniksox9duro+DG7Hmk/fL1J xXmvTgei0GGVmXnHvYxilD+UBNSsX+bqWAXTZtDrXx/AGbgNky+K7bjawNsmPrldQuKj phJZ+HvE5+tvC4FRNGtxa4KVFiumPkj85t7kQByHx2/WgtUnCliFcb2y5LoaLwbnd15r zHLzaUWSZ3jysVBJE6wtwMtu+aUQcwMP2MzxXli1P1nnkr1aQozWN3kGbbA069y89CwH h21w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=70h4flNR7FPnQpv1DVV34yLgEdkxF75tFHz9TiMCU6c=; b=Ucarz7f0MoUsW9d7Yy3t70EQdB1/KwMQgEiRJ5rPgX14QM2EuIHTwG48GKc64TT5gO Q1579NPwkNRwVZMSGClQpbEe1mgTBKrI3dZvNqVSXxYlFuFobNW8NxY9zgQIBNQR+rr6 uS1Prc4DjcVzfEyPa1wLA64qsY2FQxjauizDI1nmoqEBT/6GvXV1rXRGLvy15dYAZtPJ zIlbOgaHf5HQkTjSNF9PKenHM3qYUsvMwIBVotYqieY7TF7qRmuyAKRTQFYaQpODQXc4 ZvmqId7K/NhdYl3GqH7m7irZuUNY1fVMltyGhyzWLKHVyQWhGpGPgwvfNMr7SWSHDkMQ Fexw== X-Gm-Message-State: ALoCoQn0GZM/oy0vV15S7KQbrJJn6ioRh0OKTwsO+deFaaYynDVDiToutbIU/fbTNaNwV+h5tmHmtJIymxflzHPOYEQzQ9i/EQ== MIME-Version: 1.0 X-Received: by 10.140.141.138 with SMTP id 132mr29597798qhn.74.1452099686455; Wed, 06 Jan 2016 09:01:26 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Wed, 6 Jan 2016 09:01:26 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <20160106161046.GP3625@kib.kiev.ua> References: <201601052120.u05LKkvv074874@repo.freebsd.org> <20160106161046.GP3625@kib.kiev.ua> Date: Wed, 6 Jan 2016 10:01:26 -0700 X-Google-Sender-Auth: KVUoYdMIKnz6vNAtD8ZJWDiI0p0 Message-ID: Subject: Re: svn commit: r293226 - head/libexec/rtld-elf From: Warner Losh To: Konstantin Belousov Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 17:01:28 -0000 On Wed, Jan 6, 2016 at 9:10 AM, Konstantin Belousov wrote: > On Tue, Jan 05, 2016 at 09:20:46PM +0000, Warner Losh wrote: > > Author: imp > > Date: Tue Jan 5 21:20:46 2016 > > New Revision: 293226 > > URL: https://svnweb.freebsd.org/changeset/base/293226 > > > > Log: > > Disable abi variant hook until strangeness with packages can be sorted > > out. > > > > Modified: > > head/libexec/rtld-elf/rtld.c > > > > Modified: head/libexec/rtld-elf/rtld.c > > > ============================================================================== > > --- head/libexec/rtld-elf/rtld.c Tue Jan 5 21:12:49 2016 > (r293225) > > +++ head/libexec/rtld-elf/rtld.c Tue Jan 5 21:20:46 2016 > (r293226) > > @@ -435,7 +435,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ > > > > trust = !issetugid(); > > > > - md_abi_variant_hook(aux_info); > > +/* md_abi_variant_hook(aux_info); */ > > > > ld_bind_now = getenv(_LD("BIND_NOW")); > > /* > The ARM hook resets the default paths to the libsoft variants. It cannot > work while /lib, /usr/lib and /usr/local/lib are populated with soft-fp > libraries. I thought that you are going to switch the default target_arch > to armv6hf immediately after the commit to rtld. > That analysis isn't quite right. I'll throw the replacement switch very soon. The problem is that it highlighted was things were incomplete, not that I'd left soft float libraries where I did for a short period of time. > And then, looking into the issue, IMO the way forward is to leave softfp > libraries where they are, but install v6hf somewhere in /lib/armv6hf etc. > No. That's even worse. We're not doing that. Warner From owner-svn-src-head@freebsd.org Wed Jan 6 17:13:41 2016 Return-Path: Delivered-To: svn-src-head@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 70466A65C07; Wed, 6 Jan 2016 17:13:41 +0000 (UTC) (envelope-from imp@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 3F8221C87; Wed, 6 Jan 2016 17:13:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06HDeMM032984; Wed, 6 Jan 2016 17:13:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06HDeTS032983; Wed, 6 Jan 2016 17:13:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601061713.u06HDeTS032983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 6 Jan 2016 17:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293240 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 17:13:41 -0000 Author: imp Date: Wed Jan 6 17:13:40 2016 New Revision: 293240 URL: https://svnweb.freebsd.org/changeset/base/293240 Log: Try a little harder to remove firstboot and firstboot-reboot files in case they accidentally get created as directories or with flags that prevent their removal. While I wouldn't normally go the extra mile here and let the normal unix rules prevail, the effects of failure are large enough that extra care is warranted. Modified: head/etc/rc Modified: head/etc/rc ============================================================================== --- head/etc/rc Wed Jan 6 16:35:30 2016 (r293239) +++ head/etc/rc Wed Jan 6 17:13:40 2016 (r293240) @@ -130,11 +130,17 @@ for _rc_elem in ${files}; do done # Remove the firstboot sentinel, and reboot if it was requested. +# Be a bit paranoid about removing it to handle the common failure +# modes since the consequence of failure can be big. +# Note: this assumes firstboot_sentinel is on / when we have +# a read-only /, or that it is on media that's writable. if [ -e ${firstboot_sentinel} ]; then [ ${root_rw_mount} = "yes" ] || mount -uw / - /bin/rm -f ${firstboot_sentinel} + chflags -R 0 ${firstboot_sentinel} + rm -rf ${firstboot_sentinel} if [ -e ${firstboot_sentinel}-reboot ]; then - /bin/rm -f ${firstboot_sentinel}-reboot + chflags -R 0 ${firstboot_sentinel}-reboot + rm -rf ${firstboot_sentinel}-reboot [ ${root_rw_mount} = "yes" ] || mount -ur / kill -INT 1 fi From owner-svn-src-head@freebsd.org Wed Jan 6 17:33:34 2016 Return-Path: Delivered-To: svn-src-head@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 3E822A64256; Wed, 6 Jan 2016 17:33:34 +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 0F68D182C; Wed, 6 Jan 2016 17:33:33 +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 u06HXX09038934; Wed, 6 Jan 2016 17:33:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06HXXAW038933; Wed, 6 Jan 2016 17:33:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601061733.u06HXXAW038933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Jan 2016 17:33:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293241 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 17:33:34 -0000 Author: emaste Date: Wed Jan 6 17:33:32 2016 New Revision: 293241 URL: https://svnweb.freebsd.org/changeset/base/293241 Log: Add fls() to libstand Although we don't use it in tree yet libstand is installed as user- facing /usr/liblibstand.a, and some work in progress makes use of it. Instead of conflicting with ongoing libstand Makefile deduplication, just add it now. Modified: head/lib/libstand/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Wed Jan 6 17:13:40 2016 (r293240) +++ head/lib/libstand/Makefile Wed Jan 6 17:33:32 2016 (r293241) @@ -38,8 +38,9 @@ SRCS+= ntoh.c # string functions from libc .PATH: ${LIBC_SRC}/string -SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ - memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ +SRCS+= bcmp.c bcopy.c bzero.c ffs.c fls.c \ + memccpy.c memchr.c memcmp.c memcpy.c memmove.c memset.c \ + qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .if ${MACHINE_CPUARCH} == "arm" From owner-svn-src-head@freebsd.org Wed Jan 6 17:49:58 2016 Return-Path: Delivered-To: svn-src-head@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 35239A6488F for ; Wed, 6 Jan 2016 17:49:58 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::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 CA61913BD for ; Wed, 6 Jan 2016 17:49:57 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x236.google.com with SMTP id f206so68697481wmf.0 for ; Wed, 06 Jan 2016 09:49:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=ztei9KdAD5zl7g4bpo2MHk8Brt7qDXTJsRHyWDys148=; b=dDlXuveaalLtQpWpM+4f3wg4EDinsObJhlhqxtCRY/+ICS5/JWVi/qoMDx+W3/1sFy n3eLSR305Chujj0P4Hd1crDB5cETQ5NrK3ut7n9qm+6d538PBAgPBctckMvNiBdW0xgQ 21FVxJsSzYyBVtgwATjlzDwpuk+Bf8xpdaV97IPbrNX9Kxk3FH0/NXuW/Ujl/Y/FEhOo /8B9DQiq3uLOlvpbk2tBUpUDti44//FAdT01s1RbmcK38SJfU4BvaZW/p1Th0/N0vA4x 3dElvcdC/u39Vzwgji9KLuFYRSSbGjNQnyWZfQvZrBaRx8X9uej0ofr3httkavBd9tXA 1y4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=ztei9KdAD5zl7g4bpo2MHk8Brt7qDXTJsRHyWDys148=; b=QlDUkVp676/6tkm1ARRh+v26/+73h2K8fDe5dfqDJMCRUTNZPoog6caJLNWte57ahi U9uzqNl0wy/zTE730gTdX9ncx/nQjRr1Fsr0holoIDdqYTcYMa2CVM6PLHR23VDw7Y7k cMyfFNukkZc7niDwrSwD3mFqTfPWgUFN1kWr6/mlB1QumeVeXNSjErd5748OD/1cO/XX JsvuTQX1wsGQIJZQb9a9qjXr8vRDm2Ik52rMns3Tcbyq4dA+qFg6R+ZY+ZcFF8vzUXW3 4UnDcSZprCQktwJFY5ZHq1NeWSXE0unFD24FUQ1AnrOVApLmEZI2vHmKZKo/UOKDq0hJ eWjA== X-Gm-Message-State: ALoCoQm8FjkkCmyScC6NHjUQVuCOQRNVHIKWliLqh+xfpiuPlFqsQ/xCUjVNbvfPTSEgt8gn2bx/Oi3fjj7i96rpAGj73zC7gw== X-Received: by 10.194.80.65 with SMTP id p1mr81365678wjx.152.1452102595888; Wed, 06 Jan 2016 09:49:55 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id p9sm41704389wjy.41.2016.01.06.09.49.54 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Jan 2016 09:49:54 -0800 (PST) Subject: Re: svn commit: r293234 - head/sys/boot/forth To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601061550.u06FoMGa004020@repo.freebsd.org> From: Steven Hartland Message-ID: <568D53CC.8000600@multiplay.co.uk> Date: Wed, 6 Jan 2016 17:50:04 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <201601061550.u06FoMGa004020@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 17:49:58 -0000 Awesome work, just back ported this to our internal 10.2 build along size the ZFS EFI and I'm pleased to report all is working as expected :) Regards Steve On 06/01/2016 15:50, Ed Maste wrote: > Author: emaste > Date: Wed Jan 6 15:50:21 2016 > New Revision: 293234 > URL: https://svnweb.freebsd.org/changeset/base/293234 > > Log: > Enable the beastie menu for the UEFI console > > As of r293233 the UEFI console includes basic terminal emulator support. > > MFC after: 2 weeks > Relnotes: Yes > > Modified: > head/sys/boot/forth/beastie.4th > head/sys/boot/forth/beastie.4th.8 > head/sys/boot/forth/loader.conf.5 > > Modified: head/sys/boot/forth/beastie.4th > ============================================================================== > --- head/sys/boot/forth/beastie.4th Wed Jan 6 15:38:39 2016 (r293233) > +++ head/sys/boot/forth/beastie.4th Wed Jan 6 15:50:21 2016 (r293234) > @@ -85,11 +85,6 @@ variable logoY > also support-functions > > : beastie-start ( -- ) \ starts the menu > - s" console" getenv dup -1 <> if > - s" efi" 2swap contains? if > - s" set beastie_disable=YES" evaluate > - then > - else drop then > s" beastie_disable" getenv dup -1 <> if > s" YES" compare-insensitive 0= if > any_conf_read? if > > Modified: head/sys/boot/forth/beastie.4th.8 > ============================================================================== > --- head/sys/boot/forth/beastie.4th.8 Wed Jan 6 15:38:39 2016 (r293233) > +++ head/sys/boot/forth/beastie.4th.8 Wed Jan 6 15:50:21 2016 (r293234) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd April 27, 2014 > +.Dd January 6, 2016 > .Dt BEASTIE.4TH 8 > .Os > .Sh NAME > @@ -119,8 +119,7 @@ Sets the desired row position of the log > If set to > .Dq YES , > the beastie boot menu will be skipped. > -The beastie boot menu is always skipped if booting UEFI or running non-x86 > -hardware. > +The beastie boot menu is always skipped if running non-x86 hardware. > .It Va loader_delay > If set to a number higher than zero, introduces a delay before starting the > beastie boot menu. During the delay the user can press either Ctrl-C to skip > > Modified: head/sys/boot/forth/loader.conf.5 > ============================================================================== > --- head/sys/boot/forth/loader.conf.5 Wed Jan 6 15:38:39 2016 (r293233) > +++ head/sys/boot/forth/loader.conf.5 Wed Jan 6 15:50:21 2016 (r293234) > @@ -23,7 +23,7 @@ > .\" SUCH DAMAGE. > .\" > .\" $FreeBSD$ > -.Dd April 27, 2014 > +.Dd January 6, 2016 > .Dt LOADER.CONF 5 > .Os > .Sh NAME > @@ -236,8 +236,7 @@ be displayed. > If set to > .Dq YES , > the beastie boot menu will be skipped. > -The beastie boot menu is always skipped if booting UEFI or running non-x86 > -hardware. > +The beastie boot menu is always skipped if running non-x86 hardware. > .It Va loader_logo Pq Dq Li orbbw > Selects a desired logo in the beastie boot menu. > Possible values are: > From owner-svn-src-head@freebsd.org Wed Jan 6 19:15:17 2016 Return-Path: Delivered-To: svn-src-head@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 C0024A655F2; Wed, 6 Jan 2016 19:15:17 +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 823161CB3; Wed, 6 Jan 2016 19:15:17 +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 u06JFGEU069386; Wed, 6 Jan 2016 19:15:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06JFGBs069380; Wed, 6 Jan 2016 19:15:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601061915.u06JFGBs069380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Jan 2016 19:15:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293244 - in head/sys/boot/efi: boot1 include loader loader/arch/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 19:15:17 -0000 Author: emaste Date: Wed Jan 6 19:15:16 2016 New Revision: 293244 URL: https://svnweb.freebsd.org/changeset/base/293244 Log: Introduce and use new EFI_ERROR_CODE macro for EFI errors Submitted by: smh MFC after: 1 week Modified: head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/include/efierr.h head/sys/boot/efi/loader/arch/amd64/framebuffer.c head/sys/boot/efi/loader/bootinfo.c head/sys/boot/efi/loader/copy.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Wed Jan 6 17:53:51 2016 (r293243) +++ head/sys/boot/efi/boot1/boot1.c Wed Jan 6 19:15:16 2016 (r293244) @@ -331,20 +331,20 @@ load(const char *fname) buffer, bufsize, &loaderhandle); if (EFI_ERROR(status)) printf("LoadImage failed with error %lu\n", - status & ~EFI_ERROR_MASK); + EFI_ERROR_CODE(status)); status = systab->BootServices->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image); if (EFI_ERROR(status)) printf("HandleProtocol failed with error %lu\n", - status & ~EFI_ERROR_MASK); + EFI_ERROR_CODE(status)); loaded_image->DeviceHandle = bootdevhandle; status = systab->BootServices->StartImage(loaderhandle, NULL, NULL); if (EFI_ERROR(status)) printf("StartImage failed with error %lu\n", - status & ~EFI_ERROR_MASK); + EFI_ERROR_CODE(status)); } static void Modified: head/sys/boot/efi/include/efierr.h ============================================================================== --- head/sys/boot/efi/include/efierr.h Wed Jan 6 17:53:51 2016 (r293243) +++ head/sys/boot/efi/include/efierr.h Wed Jan 6 19:15:16 2016 (r293244) @@ -30,7 +30,8 @@ Revision History #define EFIWARN(a) (a) -#define EFI_ERROR(a) (((INTN) a) < 0) +#define EFI_ERROR(a) (((INTN) a) < 0) +#define EFI_ERROR_CODE(a) (a & ~EFI_ERROR_MASK) #define EFI_SUCCESS 0 Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/framebuffer.c Wed Jan 6 17:53:51 2016 (r293243) +++ head/sys/boot/efi/loader/arch/amd64/framebuffer.c Wed Jan 6 19:15:16 2016 (r293244) @@ -178,7 +178,7 @@ efifb_uga_find_pixel(EFI_UGA_DRAW_PROTOC printf("No change detected in frame buffer"); fail: - printf(" -- error %lu\n", status & ~EFI_ERROR_MASK); + printf(" -- error %lu\n", EFI_ERROR_CODE(status)); free(data1); return (-1); } @@ -473,7 +473,7 @@ command_gop(int argc, char *argv[]) status = BS->LocateProtocol(&gop_guid, NULL, (VOID **)&gop); if (EFI_ERROR(status)) { sprintf(command_errbuf, "%s: Graphics Output Protocol not " - "present (error=%lu)", argv[0], status & ~EFI_ERROR_MASK); + "present (error=%lu)", argv[0], EFI_ERROR_CODE(status)); return (CMD_ERROR); } @@ -494,7 +494,7 @@ command_gop(int argc, char *argv[]) if (EFI_ERROR(status)) { sprintf(command_errbuf, "%s: Unable to set mode to " "%u (error=%lu)", argv[0], mode, - status & ~EFI_ERROR_MASK); + EFI_ERROR_CODE(status)); return (CMD_ERROR); } } else if (!strcmp(argv[1], "get")) { @@ -541,7 +541,7 @@ command_uga(int argc, char *argv[]) status = BS->LocateProtocol(&uga_guid, NULL, (VOID **)&uga); if (EFI_ERROR(status)) { sprintf(command_errbuf, "%s: UGA Protocol not present " - "(error=%lu)", argv[0], status & ~EFI_ERROR_MASK); + "(error=%lu)", argv[0], EFI_ERROR_CODE(status)); return (CMD_ERROR); } Modified: head/sys/boot/efi/loader/bootinfo.c ============================================================================== --- head/sys/boot/efi/loader/bootinfo.c Wed Jan 6 17:53:51 2016 (r293243) +++ head/sys/boot/efi/loader/bootinfo.c Wed Jan 6 19:15:16 2016 (r293244) @@ -290,7 +290,7 @@ bi_load_efi_data(struct preloaded_file * pages, &addr); if (EFI_ERROR(status)) { printf("%s: AllocatePages error %lu\n", __func__, - (unsigned long)(status & ~EFI_ERROR_MASK)); + EFI_ERROR_CODE(status)); return (ENOMEM); } @@ -306,7 +306,7 @@ bi_load_efi_data(struct preloaded_file * status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &mmsz, &mmver); if (EFI_ERROR(status)) { printf("%s: GetMemoryMap error %lu\n", __func__, - (unsigned long)(status & ~EFI_ERROR_MASK)); + EFI_ERROR_CODE(status)); return (EINVAL); } status = BS->ExitBootServices(IH, efi_mapkey); @@ -320,8 +320,7 @@ bi_load_efi_data(struct preloaded_file * } BS->FreePages(addr, pages); } - printf("ExitBootServices error %lu\n", - (unsigned long)(status & ~EFI_ERROR_MASK)); + printf("ExitBootServices error %lu\n", EFI_ERROR_CODE(status)); return (EINVAL); } Modified: head/sys/boot/efi/loader/copy.c ============================================================================== --- head/sys/boot/efi/loader/copy.c Wed Jan 6 17:53:51 2016 (r293243) +++ head/sys/boot/efi/loader/copy.c Wed Jan 6 19:15:16 2016 (r293244) @@ -56,7 +56,7 @@ efi_copy_init(void) STAGE_PAGES, &staging); if (EFI_ERROR(status)) { printf("failed to allocate staging area: %lu\n", - (unsigned long)(status & EFI_ERROR_MASK)); + EFI_ERROR_CODE(status)); return (status); } staging_end = staging + STAGE_PAGES * EFI_PAGE_SIZE; From owner-svn-src-head@freebsd.org Wed Jan 6 19:18:45 2016 Return-Path: Delivered-To: svn-src-head@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 EE88DA6575C; Wed, 6 Jan 2016 19:18: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 C9DCA1EFE; Wed, 6 Jan 2016 19:18: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 u06JIhHl069536; Wed, 6 Jan 2016 19:18:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06JIhft069535; Wed, 6 Jan 2016 19:18:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601061918.u06JIhft069535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Jan 2016 19:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293245 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 19:18:45 -0000 Author: emaste Date: Wed Jan 6 19:18:43 2016 New Revision: 293245 URL: https://svnweb.freebsd.org/changeset/base/293245 Log: loader.efi style(9) cleanup Submitted by: smh Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Wed Jan 6 19:15:16 2016 (r293244) +++ head/sys/boot/efi/loader/main.c Wed Jan 6 19:18:43 2016 (r293245) @@ -227,50 +227,47 @@ command_memmap(int argc, char *argv[]) status = BS->GetMemoryMap(&sz, 0, &key, &dsz, &dver); if (status != EFI_BUFFER_TOO_SMALL) { printf("Can't determine memory map size\n"); - return CMD_ERROR; + return (CMD_ERROR); } map = malloc(sz); status = BS->GetMemoryMap(&sz, map, &key, &dsz, &dver); if (EFI_ERROR(status)) { printf("Can't read memory map\n"); - return CMD_ERROR; + return (CMD_ERROR); } ndesc = sz / dsz; printf("%23s %12s %12s %8s %4s\n", - "Type", "Physical", "Virtual", "#Pages", "Attr"); + "Type", "Physical", "Virtual", "#Pages", "Attr"); for (i = 0, p = map; i < ndesc; i++, p = NextMemoryDescriptor(p, dsz)) { - printf("%23s %012lx %012lx %08lx ", - types[p->Type], - p->PhysicalStart, - p->VirtualStart, - p->NumberOfPages); - if (p->Attribute & EFI_MEMORY_UC) - printf("UC "); - if (p->Attribute & EFI_MEMORY_WC) - printf("WC "); - if (p->Attribute & EFI_MEMORY_WT) - printf("WT "); - if (p->Attribute & EFI_MEMORY_WB) - printf("WB "); - if (p->Attribute & EFI_MEMORY_UCE) - printf("UCE "); - if (p->Attribute & EFI_MEMORY_WP) - printf("WP "); - if (p->Attribute & EFI_MEMORY_RP) - printf("RP "); - if (p->Attribute & EFI_MEMORY_XP) - printf("XP "); - printf("\n"); + printf("%23s %012lx %012lx %08lx ", types[p->Type], + p->PhysicalStart, p->VirtualStart, p->NumberOfPages); + if (p->Attribute & EFI_MEMORY_UC) + printf("UC "); + if (p->Attribute & EFI_MEMORY_WC) + printf("WC "); + if (p->Attribute & EFI_MEMORY_WT) + printf("WT "); + if (p->Attribute & EFI_MEMORY_WB) + printf("WB "); + if (p->Attribute & EFI_MEMORY_UCE) + printf("UCE "); + if (p->Attribute & EFI_MEMORY_WP) + printf("WP "); + if (p->Attribute & EFI_MEMORY_RP) + printf("RP "); + if (p->Attribute & EFI_MEMORY_XP) + printf("XP "); + printf("\n"); } - return CMD_OK; + return (CMD_OK); } -COMMAND_SET(configuration, "configuration", - "print configuration tables", command_configuration); +COMMAND_SET(configuration, "configuration", "print configuration tables", + command_configuration); static const char * guid_to_string(EFI_GUID *guid) @@ -318,7 +315,7 @@ command_configuration(int argc, char *ar printf(" at %p\n", ST->ConfigurationTable[i].VendorTable); } - return CMD_OK; + return (CMD_OK); } @@ -395,20 +392,17 @@ command_nvram(int argc, char *argv[]) status = RS->GetNextVariableName(&varsz, NULL, NULL); for (; status != EFI_NOT_FOUND; ) { - status = RS->GetNextVariableName(&varsz, var, - &varguid); + status = RS->GetNextVariableName(&varsz, var, &varguid); //if (EFI_ERROR(status)) //break; conout->OutputString(conout, var); printf("="); datasz = 0; - status = RS->GetVariable(var, &varguid, NULL, &datasz, - NULL); + status = RS->GetVariable(var, &varguid, NULL, &datasz, NULL); /* XXX: check status */ data = malloc(datasz); - status = RS->GetVariable(var, &varguid, NULL, &datasz, - data); + status = RS->GetVariable(var, &varguid, NULL, &datasz, data); if (EFI_ERROR(status)) printf(""); else { From owner-svn-src-head@freebsd.org Wed Jan 6 19:41:08 2016 Return-Path: Delivered-To: svn-src-head@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 3107BA65F4B; Wed, 6 Jan 2016 19:41:08 +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 F3F601C44; Wed, 6 Jan 2016 19:41:07 +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 u06Jf73R078108; Wed, 6 Jan 2016 19:41:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06Jf7np078107; Wed, 6 Jan 2016 19:41:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601061941.u06Jf7np078107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Jan 2016 19:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293247 - head/contrib/llvm/projects/libunwind/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 19:41:08 -0000 Author: emaste Date: Wed Jan 6 19:41:06 2016 New Revision: 293247 URL: https://svnweb.freebsd.org/changeset/base/293247 Log: libunwind: Include header for dl_unwind_find_exidx for ARM EHABI Modified: head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp Modified: head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp ============================================================================== --- head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp Wed Jan 6 19:40:37 2016 (r293246) +++ head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp Wed Jan 6 19:41:06 2016 (r293247) @@ -37,6 +37,7 @@ namespace libunwind { #if _LIBUNWIND_ARM_EHABI #if defined(__FreeBSD__) +#include typedef void *_Unwind_Ptr; #elif defined(__linux__) From owner-svn-src-head@freebsd.org Wed Jan 6 20:22:30 2016 Return-Path: Delivered-To: svn-src-head@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 557B1A6634D; Wed, 6 Jan 2016 20:22:30 +0000 (UTC) (envelope-from smh@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 2D7F81DF7; Wed, 6 Jan 2016 20:22:30 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06KMTHH090923; Wed, 6 Jan 2016 20:22:29 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06KMTPe090920; Wed, 6 Jan 2016 20:22:29 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601062022.u06KMTPe090920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 6 Jan 2016 20:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293268 - in head/sys/boot/efi/include: amd64 arm64 i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:22:30 -0000 Author: smh Date: Wed Jan 6 20:22:28 2016 New Revision: 293268 URL: https://svnweb.freebsd.org/changeset/base/293268 Log: Fix _MSC_EXTENSIONS checks Use #ifdef instead of #if checks to prevent warnings generated by checks to be enabled shortly. MFC after: 2 weeks Sponsored by: Multiplay Modified: head/sys/boot/efi/include/amd64/efibind.h head/sys/boot/efi/include/arm64/efibind.h head/sys/boot/efi/include/i386/efibind.h Modified: head/sys/boot/efi/include/amd64/efibind.h ============================================================================== --- head/sys/boot/efi/include/amd64/efibind.h Wed Jan 6 20:21:40 2016 (r293267) +++ head/sys/boot/efi/include/amd64/efibind.h Wed Jan 6 20:22:28 2016 (r293268) @@ -39,7 +39,7 @@ Revision History // No ANSI C 1999/2000 stdint.h integer width declarations - #if _MSC_EXTENSIONS + #ifdef _MSC_EXTENSIONS // Use Microsoft C compiler integer width declarations @@ -164,7 +164,7 @@ typedef uint64_t UINTN; #endif #ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options - #if _MSC_EXTENSIONS + #ifdef _MSC_EXTENSIONS #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler #else #define EFIAPI // Substitute expresion to force C calling convention @@ -265,7 +265,7 @@ typedef uint64_t UINTN; #endif #endif /* __FreeBSD__ */ -#if _MSC_EXTENSIONS +#ifdef _MSC_EXTENSIONS #pragma warning ( disable : 4731 ) // Suppress warnings about modification of EBP #endif Modified: head/sys/boot/efi/include/arm64/efibind.h ============================================================================== --- head/sys/boot/efi/include/arm64/efibind.h Wed Jan 6 20:21:40 2016 (r293267) +++ head/sys/boot/efi/include/arm64/efibind.h Wed Jan 6 20:22:28 2016 (r293268) @@ -39,7 +39,7 @@ Revision History // No ANSI C 1999/2000 stdint.h integer width declarations - #if _MSC_EXTENSIONS + #ifdef _MSC_EXTENSIONS // Use Microsoft C compiler integer width declarations @@ -159,7 +159,7 @@ typedef uint64_t UINTN; // #ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options - #if _MSC_EXTENSIONS + #ifdef _MSC_EXTENSIONS #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler #else #define EFIAPI // Substitute expresion to force C calling convention Modified: head/sys/boot/efi/include/i386/efibind.h ============================================================================== --- head/sys/boot/efi/include/i386/efibind.h Wed Jan 6 20:21:40 2016 (r293267) +++ head/sys/boot/efi/include/i386/efibind.h Wed Jan 6 20:22:28 2016 (r293268) @@ -39,7 +39,7 @@ Revision History // No ANSI C 1999/2000 stdint.h integer width declarations - #if _MSC_EXTENSIONS + #ifdef _MSC_EXTENSIONS // Use Microsoft C compiler integer width declarations @@ -160,7 +160,7 @@ typedef uint32_t UINTN; // #ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options - #if _MSC_EXTENSIONS + #ifdef _MSC_EXTENSIONS #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler #else #define EFIAPI // Substitute expresion to force C calling convention @@ -261,7 +261,7 @@ typedef uint32_t UINTN; #endif #endif /* __FreeBSD__ */ -#if _MSC_EXTENSIONS +#ifdef _MSC_EXTENSIONS #pragma warning ( disable : 4731 ) // Suppress warnings about modification of EBP #endif From owner-svn-src-head@freebsd.org Wed Jan 6 20:25:42 2016 Return-Path: Delivered-To: svn-src-head@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 A9EBAA6642C; Wed, 6 Jan 2016 20:25:42 +0000 (UTC) (envelope-from smh@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 7B2081F9A; Wed, 6 Jan 2016 20:25:42 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06KPfg7091141; Wed, 6 Jan 2016 20:25:41 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06KPfWS091140; Wed, 6 Jan 2016 20:25:41 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601062025.u06KPfWS091140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 6 Jan 2016 20:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293269 - head/sys/boot/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:25:42 -0000 Author: smh Date: Wed Jan 6 20:25:41 2016 New Revision: 293269 URL: https://svnweb.freebsd.org/changeset/base/293269 Log: Fix return from zfs_probe_dev Ensure zfs_probe_dev returns the correct value. Also fix a style(9) trailing whitespace issue while here. MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Modified: head/sys/boot/zfs/zfs.c Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Wed Jan 6 20:22:28 2016 (r293268) +++ head/sys/boot/zfs/zfs.c Wed Jan 6 20:25:41 2016 (r293269) @@ -154,7 +154,7 @@ zfs_read(struct open_file *f, void *star n = size; if (fp->f_seekp + n > sb.st_size) n = sb.st_size - fp->f_seekp; - + rc = dnode_read(spa, &fp->f_dnode, fp->f_seekp, start, n); if (rc) return (rc); @@ -507,7 +507,7 @@ zfs_probe_dev(const char *devname, uint6 } } close(pa.fd); - return (0); + return (ret); } /* From owner-svn-src-head@freebsd.org Wed Jan 6 20:28:10 2016 Return-Path: Delivered-To: svn-src-head@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 3BCCBA66525; Wed, 6 Jan 2016 20:28:10 +0000 (UTC) (envelope-from smh@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 0EC2A1342; Wed, 6 Jan 2016 20:28:09 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06KS9HK091350; Wed, 6 Jan 2016 20:28:09 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06KS97L091349; Wed, 6 Jan 2016 20:28:09 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601062028.u06KS97L091349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 6 Jan 2016 20:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293271 - head/sys/cddl/boot/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:28:10 -0000 Author: smh Date: Wed Jan 6 20:28:09 2016 New Revision: 293271 URL: https://svnweb.freebsd.org/changeset/base/293271 Log: Fix const conversion warning in lz4_decompress Fix const conversion warning in lz4_decompress which shows when warnings are enabled (to be done later). MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Modified: head/sys/cddl/boot/zfs/lz4.c Modified: head/sys/cddl/boot/zfs/lz4.c ============================================================================== --- head/sys/cddl/boot/zfs/lz4.c Wed Jan 6 20:27:55 2016 (r293270) +++ head/sys/cddl/boot/zfs/lz4.c Wed Jan 6 20:28:09 2016 (r293271) @@ -52,7 +52,7 @@ lz4_decompress(void *s_start, void *d_st * Returns 0 on success (decompression function returned non-negative) * and non-zero on failure (decompression function returned negative). */ - return (LZ4_uncompress_unknownOutputSize(s_start + 4, d_start, bufsiz, + return (LZ4_uncompress_unknownOutputSize((const char *)s_start + 4, d_start, bufsiz, d_len) < 0); } From owner-svn-src-head@freebsd.org Wed Jan 6 20:48:30 2016 Return-Path: Delivered-To: svn-src-head@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 93896A66C45; Wed, 6 Jan 2016 20:48:30 +0000 (UTC) (envelope-from smh@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 645EF142A; Wed, 6 Jan 2016 20:48:30 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06KmTXK097566; Wed, 6 Jan 2016 20:48:29 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06KmTrt097564; Wed, 6 Jan 2016 20:48:29 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601062048.u06KmTrt097564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 6 Jan 2016 20:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293274 - in head/sys/boot/efi: boot1 loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:48:30 -0000 Author: smh Date: Wed Jan 6 20:48:29 2016 New Revision: 293274 URL: https://svnweb.freebsd.org/changeset/base/293274 Log: style(9) fixes for EFI boot Fix some style(9) nits for EFI boot code, no functional changes. MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Modified: head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/loader/devicename.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Wed Jan 6 20:43:41 2016 (r293273) +++ head/sys/boot/efi/boot1/boot1.c Wed Jan 6 20:48:29 2016 (r293274) @@ -132,8 +132,7 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, E conout->Reset(conout, TRUE); max_dim = best_mode = 0; for (i = 0; ; i++) { - status = conout->QueryMode(conout, i, - &cols, &rows); + status = conout->QueryMode(conout, i, &cols, &rows); if (EFI_ERROR(status)) break; if (cols * rows > max_dim) { Modified: head/sys/boot/efi/loader/devicename.c ============================================================================== --- head/sys/boot/efi/loader/devicename.c Wed Jan 6 20:43:41 2016 (r293273) +++ head/sys/boot/efi/loader/devicename.c Wed Jan 6 20:48:29 2016 (r293274) @@ -147,7 +147,7 @@ efi_fmtdev(void *vdev) break; } - return(buf); + return (buf); } /* @@ -161,7 +161,7 @@ efi_setcurrdev(struct env_var *ev, int f rv = efi_parsedev(&ncurr, value, NULL); if (rv != 0) - return(rv); + return (rv); free(ncurr); env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); From owner-svn-src-head@freebsd.org Wed Jan 6 21:47:50 2016 Return-Path: Delivered-To: svn-src-head@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 A99F5A65FF2; Wed, 6 Jan 2016 21:47:50 +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 82E811BA3; Wed, 6 Jan 2016 21:47:50 +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 u06Lln2q016411; Wed, 6 Jan 2016 21:47:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06LlnMK016409; Wed, 6 Jan 2016 21:47:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601062147.u06LlnMK016409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Jan 2016 21:47:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293281 - in head/share: man/man7 misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 21:47:50 -0000 Author: emaste Date: Wed Jan 6 21:47:49 2016 New Revision: 293281 URL: https://svnweb.freebsd.org/changeset/base/293281 Log: Use standard name for ASCII LF and FF control codes PR: 205778 MFC after: 2 weeks Modified: head/share/man/man7/ascii.7 head/share/misc/ascii (contents, props changed) Modified: head/share/man/man7/ascii.7 ============================================================================== --- head/share/man/man7/ascii.7 Wed Jan 6 21:31:07 2016 (r293280) +++ head/share/man/man7/ascii.7 Wed Jan 6 21:47:49 2016 (r293281) @@ -28,7 +28,7 @@ .\" @(#)ascii.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd January 6, 2016 .Dt ASCII 7 .Os .Sh NAME @@ -42,7 +42,7 @@ The set: .Bd -literal -offset left 000 NUL 001 SOH 002 STX 003 ETX 004 EOT 005 ENQ 006 ACK 007 BEL -010 BS 011 HT 012 NL 013 VT 014 NP 015 CR 016 SO 017 SI +010 BS 011 HT 012 LF 013 VT 014 FF 015 CR 016 SO 017 SI 020 DLE 021 DC1 022 DC2 023 DC3 024 DC4 025 NAK 026 SYN 027 ETB 030 CAN 031 EM 032 SUB 033 ESC 034 FS 035 GS 036 RS 037 US 040 SP 041 ! 042 " 043 # 044 $ 045 % 046 & 047 ' @@ -64,7 +64,7 @@ The set: .Bd -literal -offset left 00 NUL 01 SOH 02 STX 03 ETX 04 EOT 05 ENQ 06 ACK 07 BEL -08 BS 09 HT 0A NL 0B VT 0C NP 0D CR 0E SO 0F SI +08 BS 09 HT 0A LF 0B VT 0C FF 0D CR 0E SO 0F SI 10 DLE 11 DC1 12 DC2 13 DC3 14 DC4 15 NAK 16 SYN 17 ETB 18 CAN 19 EM 1A SUB 1B ESC 1C FS 1D GS 1E RS 1F US 20 SP 21 ! 22 " 23 # 24 $ 25 % 26 & 27 ' @@ -86,7 +86,7 @@ The set: .Bd -literal -offset left 0 NUL 1 SOH 2 STX 3 ETX 4 EOT 5 ENQ 6 ACK 7 BEL - 8 BS 9 HT 10 NL 11 VT 12 NP 13 CR 14 SO 15 SI + 8 BS 9 HT 10 LF 11 VT 12 FF 13 CR 14 SO 15 SI 16 DLE 17 DC1 18 DC2 19 DC3 20 DC4 21 NAK 22 SYN 23 ETB 24 CAN 25 EM 26 SUB 27 ESC 28 FS 29 GS 30 RS 31 US 32 SP 33 ! 34 " 35 # 36 $ 37 % 38 & 39 ' Modified: head/share/misc/ascii ============================================================================== --- head/share/misc/ascii Wed Jan 6 21:31:07 2016 (r293280) +++ head/share/misc/ascii Wed Jan 6 21:47:49 2016 (r293281) @@ -1,5 +1,5 @@ |000 nul|001 soh|002 stx|003 etx|004 eot|005 enq|006 ack|007 bel| -|010 bs |011 ht |012 nl |013 vt |014 np |015 cr |016 so |017 si | +|010 bs |011 ht |012 lf |013 vt |014 ff |015 cr |016 so |017 si | |020 dle|021 dc1|022 dc2|023 dc3|024 dc4|025 nak|026 syn|027 etb| |030 can|031 em |032 sub|033 esc|034 fs |035 gs |036 rs |037 us | |040 sp |041 ! |042 " |043 # |044 $ |045 % |046 & |047 ' | @@ -16,7 +16,7 @@ |170 x |171 y |172 z |173 { |174 | |175 } |176 ~ |177 del| | 00 nul| 01 soh| 02 stx| 03 etx| 04 eot| 05 enq| 06 ack| 07 bel| -| 08 bs | 09 ht | 0a nl | 0b vt | 0c np | 0d cr | 0e so | 0f si | +| 08 bs | 09 ht | 0a lf | 0b vt | 0c ff | 0d cr | 0e so | 0f si | | 10 dle| 11 dc1| 12 dc2| 13 dc3| 14 dc4| 15 nak| 16 syn| 17 etb| | 18 can| 19 em | 1a sub| 1b esc| 1c fs | 1d gs | 1e rs | 1f us | | 20 sp | 21 ! | 22 " | 23 # | 24 $ | 25 % | 26 & | 27 ' | @@ -33,7 +33,7 @@ | 78 x | 79 y | 7a z | 7b { | 7c | | 7d } | 7e ~ | 7f del| | 0 nul| 1 soh| 2 stx| 3 etx| 4 eot| 5 enq| 6 ack| 7 bel| -| 8 bs | 9 ht | 10 nl | 11 vt | 12 np | 13 cr | 14 so | 15 si | +| 8 bs | 9 ht | 10 lf | 11 vt | 12 ff | 13 cr | 14 so | 15 si | | 16 dle| 17 dc1| 18 dc2| 19 dc3| 20 dc4| 21 nak| 22 syn| 23 etb| | 24 can| 25 em | 26 sub| 27 esc| 28 fs | 29 gs | 30 rs | 31 us | | 32 sp | 33 ! | 34 " | 35 # | 36 $ | 37 % | 38 & | 39 ' | From owner-svn-src-head@freebsd.org Wed Jan 6 21:58:46 2016 Return-Path: Delivered-To: svn-src-head@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 EF5E8A663E2; Wed, 6 Jan 2016 21:58:46 +0000 (UTC) (envelope-from glebius@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 A69EA1249; Wed, 6 Jan 2016 21:58:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06LwjVi019456; Wed, 6 Jan 2016 21:58:45 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06LwjFB019455; Wed, 6 Jan 2016 21:58:45 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601062158.u06LwjFB019455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 6 Jan 2016 21:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293282 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 21:58:47 -0000 Author: glebius Date: Wed Jan 6 21:58:45 2016 New Revision: 293282 URL: https://svnweb.freebsd.org/changeset/base/293282 Log: Provide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF won't be installed, only the first one would. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jan 6 21:47:49 2016 (r293281) +++ head/Makefile.inc1 Wed Jan 6 21:58:45 2016 (r293282) @@ -1230,7 +1230,7 @@ reinstallkernel reinstallkernel.debug: _ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} .endif -.if ${BUILDKERNELS:[#]} > 1 +.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) .for _kernel in ${BUILDKERNELS:[2..-1]} @echo "--------------------------------------------------------------" @echo ">>> Installing kernel ${_kernel}" @@ -1261,7 +1261,7 @@ distributekernel distributekernel.debug: ${DESTDIR}/${DISTDIR}/kernel.meta .endif .endif -.if ${BUILDKERNELS:[#]} > 1 +.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) .for _kernel in ${BUILDKERNELS:[2..-1]} .if defined(NO_ROOT) echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta @@ -1292,7 +1292,7 @@ packagekernel: tar cvf - --include '*/*/*.debug' \ @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz -.if ${BUILDKERNELS:[#]} > 1 +.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - --exclude '*.debug' \ @@ -1313,7 +1313,7 @@ packagekernel: cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - --include '*/*/*.debug' $$(eval find .) | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz -.if ${BUILDKERNELS:[#]} > 1 +.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - --exclude '*.debug' . | \ From owner-svn-src-head@freebsd.org Thu Jan 7 00:14:44 2016 Return-Path: Delivered-To: svn-src-head@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 50065A64EDA; Thu, 7 Jan 2016 00:14:44 +0000 (UTC) (envelope-from glebius@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 2037110EC; Thu, 7 Jan 2016 00:14:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u070EhBR059888; Thu, 7 Jan 2016 00:14:43 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u070EgW1059880; Thu, 7 Jan 2016 00:14:42 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601070014.u070EgW1059880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Jan 2016 00:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293284 - in head/sys: dev/cxgb/ulp/tom dev/cxgbe/tom netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 00:14:44 -0000 Author: glebius Date: Thu Jan 7 00:14:42 2016 New Revision: 293284 URL: https://svnweb.freebsd.org/changeset/base/293284 Log: Historically we have two fields in tcpcb to describe sender MSS: t_maxopd, and t_maxseg. This dualism emerged with T/TCP, but was not properly cleaned up after T/TCP removal. After all permutations over the years the result is that t_maxopd stores a minimum of peer offered MSS and MTU reduced by minimum protocol header. And t_maxseg stores (t_maxopd - TCPOLEN_TSTAMP_APPA) if timestamps are in action, or is equal to t_maxopd otherwise. That's a very rough estimate of MSS reduced by options length. Throughout the code it was used in places, where preciseness was not important, like cwnd or ssthresh calculations. With this change: - t_maxopd goes away. - t_maxseg now stores MSS not adjusted by options. - new function tcp_maxseg() is provided, that calculates MSS reduced by options length. The functions gives a better estimate, since it takes into account SACK state as well. Reviewed by: jtl Differential Revision: https://reviews.freebsd.org/D3593 Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Jan 6 22:02:08 2016 (r293283) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Thu Jan 7 00:14:42 2016 (r293284) @@ -1536,14 +1536,13 @@ assign_rxopt(struct tcpcb *tp, uint16_t struct toepcb *toep = tp->t_toe; struct adapter *sc = toep->tp_tod->tod_softc; - tp->t_maxseg = tp->t_maxopd = sc->params.mtus[G_TCPOPT_MSS(tcpopt)] - 40; + tp->t_maxseg = sc->params.mtus[G_TCPOPT_MSS(tcpopt)] - 40; if (G_TCPOPT_TSTAMP(tcpopt)) { tp->t_flags |= TF_RCVD_TSTMP; tp->t_flags |= TF_REQ_TSTMP; /* forcibly set */ tp->ts_recent = 0; /* XXX */ tp->ts_recent_age = tcp_ts_getticks(); - tp->t_maxseg -= TCPOLEN_TSTAMP_APPA; } if (G_TCPOPT_SACK(tcpopt)) Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jan 6 22:02:08 2016 (r293283) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Jan 7 00:14:42 2016 (r293284) @@ -221,7 +221,7 @@ assign_rxopt(struct tcpcb *tp, unsigned n = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); else n = sizeof(struct ip) + sizeof(struct tcphdr); - tp->t_maxseg = tp->t_maxopd = sc->params.mtus[G_TCPOPT_MSS(opt)] - n; + tp->t_maxseg = sc->params.mtus[G_TCPOPT_MSS(opt)] - n; CTR4(KTR_CXGBE, "%s: tid %d, mtu_idx %u (%u)", __func__, toep->tid, G_TCPOPT_MSS(opt), sc->params.mtus[G_TCPOPT_MSS(opt)]); @@ -230,7 +230,6 @@ assign_rxopt(struct tcpcb *tp, unsigned tp->t_flags |= TF_RCVD_TSTMP; /* timestamps ok */ tp->ts_recent = 0; /* hmmm */ tp->ts_recent_age = tcp_ts_getticks(); - tp->t_maxseg -= TCPOLEN_TSTAMP_APPA; } if (G_TCPOPT_SACK(opt)) Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Jan 6 22:02:08 2016 (r293283) +++ head/sys/netinet/tcp_input.c Thu Jan 7 00:14:42 2016 (r293284) @@ -290,7 +290,7 @@ cc_ack_received(struct tcpcb *tp, struct if (type == CC_ACK) { if (tp->snd_cwnd > tp->snd_ssthresh) { tp->t_bytes_acked += min(tp->ccv->bytes_this_ack, - V_tcp_abc_l_var * tp->t_maxseg); + V_tcp_abc_l_var * tcp_maxseg(tp)); if (tp->t_bytes_acked >= tp->snd_cwnd) { tp->t_bytes_acked -= tp->snd_cwnd; tp->ccv->flags |= CCF_ABC_SENTAWND; @@ -313,11 +313,13 @@ cc_conn_init(struct tcpcb *tp) { struct hc_metrics_lite metrics; struct inpcb *inp = tp->t_inpcb; + u_int maxseg; int rtt; INP_WLOCK_ASSERT(tp->t_inpcb); tcp_hc_get(&inp->inp_inc, &metrics); + maxseg = tcp_maxseg(tp); if (tp->t_srtt == 0 && (rtt = metrics.rmx_rtt)) { tp->t_srtt = rtt; @@ -342,7 +344,7 @@ cc_conn_init(struct tcpcb *tp) * the slow start threshhold, but set the * threshold to no less than 2*mss. */ - tp->snd_ssthresh = max(2 * tp->t_maxseg, metrics.rmx_ssthresh); + tp->snd_ssthresh = max(2 * maxseg, metrics.rmx_ssthresh); TCPSTAT_INC(tcps_usedssthresh); } @@ -359,21 +361,20 @@ cc_conn_init(struct tcpcb *tp) * requiring us to be cautious. */ if (tp->snd_cwnd == 1) - tp->snd_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */ + tp->snd_cwnd = maxseg; /* SYN(-ACK) lost */ else if (V_tcp_initcwnd_segments) - tp->snd_cwnd = min(V_tcp_initcwnd_segments * tp->t_maxseg, - max(2 * tp->t_maxseg, V_tcp_initcwnd_segments * 1460)); + tp->snd_cwnd = min(V_tcp_initcwnd_segments * maxseg, + max(2 * maxseg, V_tcp_initcwnd_segments * 1460)); else if (V_tcp_do_rfc3390) - tp->snd_cwnd = min(4 * tp->t_maxseg, - max(2 * tp->t_maxseg, 4380)); + tp->snd_cwnd = min(4 * maxseg, max(2 * maxseg, 4380)); else { /* Per RFC5681 Section 3.1 */ - if (tp->t_maxseg > 2190) - tp->snd_cwnd = 2 * tp->t_maxseg; - else if (tp->t_maxseg > 1095) - tp->snd_cwnd = 3 * tp->t_maxseg; + if (maxseg > 2190) + tp->snd_cwnd = 2 * maxseg; + else if (maxseg > 1095) + tp->snd_cwnd = 3 * maxseg; else - tp->snd_cwnd = 4 * tp->t_maxseg; + tp->snd_cwnd = 4 * maxseg; } if (CC_ALGO(tp)->conn_init != NULL) @@ -383,6 +384,8 @@ cc_conn_init(struct tcpcb *tp) void inline cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type) { + u_int maxseg; + INP_WLOCK_ASSERT(tp->t_inpcb); switch(type) { @@ -402,12 +405,13 @@ cc_cong_signal(struct tcpcb *tp, struct } break; case CC_RTO: + maxseg = tcp_maxseg(tp); tp->t_dupacks = 0; tp->t_bytes_acked = 0; EXIT_RECOVERY(tp->t_flags); tp->snd_ssthresh = max(2, min(tp->snd_wnd, tp->snd_cwnd) / 2 / - tp->t_maxseg) * tp->t_maxseg; - tp->snd_cwnd = tp->t_maxseg; + maxseg) * maxseg; + tp->snd_cwnd = maxseg; break; case CC_RTO_ERR: TCPSTAT_INC(tcps_sndrexmitbad); @@ -469,13 +473,11 @@ tcp_signature_verify_input(struct mbuf * * the ack that opens up a 0-sized window. * - LRO wasn't used for this segment. We make sure by checking that the * segment size is not larger than the MSS. - * - Delayed acks are enabled or this is a half-synchronized T/TCP - * connection. */ #define DELAY_ACK(tp, tlen) \ ((!tcp_timer_active(tp, TT_DELACK) && \ (tp->t_flags & TF_RXWIN0SENT) == 0) && \ - (tlen <= tp->t_maxopd) && \ + (tlen <= tp->t_maxseg) && \ (V_tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN))) static void inline @@ -2481,6 +2483,9 @@ tcp_do_segment(struct mbuf *m, struct tc hhook_run_tcp_est_in(tp, th, &to); if (SEQ_LEQ(th->th_ack, tp->snd_una)) { + u_int maxseg; + + maxseg = tcp_maxseg(tp); if (tlen == 0 && (tiwin == tp->snd_wnd || (tp->t_flags & TF_SACK_PERMIT))) { @@ -2560,12 +2565,12 @@ tcp_do_segment(struct mbuf *m, struct tc tp->sackhint.sack_bytes_rexmit; if (awnd < tp->snd_ssthresh) { - tp->snd_cwnd += tp->t_maxseg; + tp->snd_cwnd += maxseg; if (tp->snd_cwnd > tp->snd_ssthresh) tp->snd_cwnd = tp->snd_ssthresh; } } else - tp->snd_cwnd += tp->t_maxseg; + tp->snd_cwnd += maxseg; (void) tp->t_fb->tfb_tcp_output(tp); goto drop; } else if (tp->t_dupacks == tcprexmtthresh) { @@ -2599,18 +2604,18 @@ tcp_do_segment(struct mbuf *m, struct tc TCPSTAT_INC( tcps_sack_recovery_episode); tp->sack_newdata = tp->snd_nxt; - tp->snd_cwnd = tp->t_maxseg; + tp->snd_cwnd = maxseg; (void) tp->t_fb->tfb_tcp_output(tp); goto drop; } tp->snd_nxt = th->th_ack; - tp->snd_cwnd = tp->t_maxseg; + tp->snd_cwnd = maxseg; (void) tp->t_fb->tfb_tcp_output(tp); KASSERT(tp->snd_limited <= 2, ("%s: tp->snd_limited too big", __func__)); tp->snd_cwnd = tp->snd_ssthresh + - tp->t_maxseg * + maxseg * (tp->t_dupacks - tp->snd_limited); if (SEQ_GT(onxt, tp->snd_nxt)) tp->snd_nxt = onxt; @@ -2641,7 +2646,7 @@ tcp_do_segment(struct mbuf *m, struct tc tp->snd_cwnd = (tp->snd_nxt - tp->snd_una) + (tp->t_dupacks - tp->snd_limited) * - tp->t_maxseg; + maxseg; /* * Only call tcp_output when there * is new data available to be sent. @@ -2654,10 +2659,10 @@ tcp_do_segment(struct mbuf *m, struct tc if (avail > 0) (void) tp->t_fb->tfb_tcp_output(tp); sent = tp->snd_max - oldsndmax; - if (sent > tp->t_maxseg) { + if (sent > maxseg) { KASSERT((tp->t_dupacks == 2 && tp->snd_limited == 0) || - (sent == tp->t_maxseg + 1 && + (sent == maxseg + 1 && tp->t_flags & TF_SENTFIN), ("%s: sent too much", __func__)); @@ -3510,11 +3515,9 @@ tcp_xmit_timer(struct tcpcb *tp, int rtt * While looking at the routing entry, we also initialize other path-dependent * parameters from pre-set or cached values in the routing entry. * - * Also take into account the space needed for options that we - * send regularly. Make maxseg shorter by that amount to assure - * that we can send maxseg amount of data even when the options - * are present. Store the upper limit of the length of options plus - * data in maxopd. + * NOTE that resulting t_maxseg doesn't include space for TCP options or + * IP options, e.g. IPSEC data, since length of this data may vary, and + * thus it is calculated for every segment separately in tcp_output(). * * NOTE that this routine is only called when we process an incoming * segment, or an ICMP need fragmentation datagram. Outgoing SYN/ACK MSS @@ -3528,7 +3531,6 @@ tcp_mss_update(struct tcpcb *tp, int off u_long maxmtu = 0; struct inpcb *inp = tp->t_inpcb; struct hc_metrics_lite metrics; - int origoffer; #ifdef INET6 int isipv6 = ((inp->inp_vflag & INP_IPV6) != 0) ? 1 : 0; size_t min_protoh = isipv6 ? @@ -3544,13 +3546,12 @@ tcp_mss_update(struct tcpcb *tp, int off KASSERT(offer == -1, ("%s: conflict", __func__)); offer = mtuoffer - min_protoh; } - origoffer = offer; /* Initialize. */ #ifdef INET6 if (isipv6) { maxmtu = tcp_maxmtu6(&inp->inp_inc, cap); - tp->t_maxopd = tp->t_maxseg = V_tcp_v6mssdflt; + tp->t_maxseg = V_tcp_v6mssdflt; } #endif #if defined(INET) && defined(INET6) @@ -3559,7 +3560,7 @@ tcp_mss_update(struct tcpcb *tp, int off #ifdef INET { maxmtu = tcp_maxmtu(&inp->inp_inc, cap); - tp->t_maxopd = tp->t_maxseg = V_tcp_mssdflt; + tp->t_maxseg = V_tcp_mssdflt; } #endif @@ -3583,9 +3584,9 @@ tcp_mss_update(struct tcpcb *tp, int off /* * Offer == 0 means that there was no MSS on the SYN * segment, in this case we use tcp_mssdflt as - * already assigned to t_maxopd above. + * already assigned to t_maxseg above. */ - offer = tp->t_maxopd; + offer = tp->t_maxseg; break; case -1: @@ -3657,31 +3658,15 @@ tcp_mss_update(struct tcpcb *tp, int off mss = min(mss, offer); /* - * Sanity check: make sure that maxopd will be large + * Sanity check: make sure that maxseg will be large * enough to allow some data on segments even if the * all the option space is used (40bytes). Otherwise * funny things may happen in tcp_output. + * + * XXXGL: shouldn't we reserve space for IP/IPv6 options? */ mss = max(mss, 64); - /* - * maxopd stores the maximum length of data AND options - * in a segment; maxseg is the amount of data in a normal - * segment. We need to store this value (maxopd) apart - * from maxseg, because now every segment carries options - * and thus we normally have somewhat less data in segments. - */ - tp->t_maxopd = mss; - - /* - * origoffer==-1 indicates that no segments were received yet. - * In this case we just guess. - */ - if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP && - (origoffer == -1 || - (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP)) - mss -= TCPOLEN_TSTAMP_APPA; - tp->t_maxseg = mss; } @@ -3804,7 +3789,8 @@ void tcp_newreno_partial_ack(struct tcpcb *tp, struct tcphdr *th) { tcp_seq onxt = tp->snd_nxt; - u_long ocwnd = tp->snd_cwnd; + u_long ocwnd = tp->snd_cwnd; + u_int maxseg = tcp_maxseg(tp); INP_WLOCK_ASSERT(tp->t_inpcb); @@ -3815,7 +3801,7 @@ tcp_newreno_partial_ack(struct tcpcb *tp * Set snd_cwnd to one segment beyond acknowledged offset. * (tp->snd_una has not yet been updated when this function is called.) */ - tp->snd_cwnd = tp->t_maxseg + BYTES_THIS_ACK(tp, th); + tp->snd_cwnd = maxseg + BYTES_THIS_ACK(tp, th); tp->t_flags |= TF_ACKNOW; (void) tp->t_fb->tfb_tcp_output(tp); tp->snd_cwnd = ocwnd; @@ -3829,7 +3815,7 @@ tcp_newreno_partial_ack(struct tcpcb *tp tp->snd_cwnd -= BYTES_THIS_ACK(tp, th); else tp->snd_cwnd = 0; - tp->snd_cwnd += tp->t_maxseg; + tp->snd_cwnd += maxseg; } int Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Wed Jan 6 22:02:08 2016 (r293283) +++ head/sys/netinet/tcp_output.c Thu Jan 7 00:14:42 2016 (r293284) @@ -830,11 +830,11 @@ send: /* * Adjust data length if insertion of options will - * bump the packet length beyond the t_maxopd length. + * bump the packet length beyond the t_maxseg length. * Clear the FIN bit because we cut off the tail of * the segment. */ - if (len + optlen + ipoptlen > tp->t_maxopd) { + if (len + optlen + ipoptlen > tp->t_maxseg) { flags &= ~TH_FIN; if (tso) { @@ -937,7 +937,7 @@ send: * fractional unless the send sockbuf can be * emptied: */ - max_len = (tp->t_maxopd - optlen); + max_len = (tp->t_maxseg - optlen); if ((off + len) < sbavail(&so->so_snd)) { moff = len % max_len; if (moff != 0) { @@ -967,7 +967,7 @@ send: sendalot = 1; } else { - len = tp->t_maxopd - optlen - ipoptlen; + len = tp->t_maxseg - optlen - ipoptlen; sendalot = 1; } } else @@ -1277,10 +1277,10 @@ send: * The TCP pseudo header checksum is always provided. */ if (tso) { - KASSERT(len > tp->t_maxopd - optlen, + KASSERT(len > tp->t_maxseg - optlen, ("%s: len <= tso_segsz", __func__)); m->m_pkthdr.csum_flags |= CSUM_TSO; - m->m_pkthdr.tso_segsz = tp->t_maxopd - optlen; + m->m_pkthdr.tso_segsz = tp->t_maxseg - optlen; } #ifdef IPSEC @@ -1348,7 +1348,7 @@ send: */ ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(*ip6)); - if (V_path_mtu_discovery && tp->t_maxopd > V_tcp_minmss) + if (V_path_mtu_discovery && tp->t_maxseg > V_tcp_minmss) tp->t_flags2 |= TF2_PLPMTU_PMTUD; else tp->t_flags2 &= ~TF2_PLPMTU_PMTUD; @@ -1394,7 +1394,7 @@ send: * * NB: Don't set DF on small MTU/MSS to have a safe fallback. */ - if (V_path_mtu_discovery && tp->t_maxopd > V_tcp_minmss) { + if (V_path_mtu_discovery && tp->t_maxseg > V_tcp_minmss) { ip->ip_off |= htons(IP_DF); tp->t_flags2 |= TF2_PLPMTU_PMTUD; } else { Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Jan 6 22:02:08 2016 (r293283) +++ head/sys/netinet/tcp_subr.c Thu Jan 7 00:14:42 2016 (r293284) @@ -1087,7 +1087,7 @@ tcp_newtcpcb(struct inpcb *inp) #endif tp->t_timers = &tm->tt; /* LIST_INIT(&tp->t_segq); */ /* XXX covered by M_ZERO */ - tp->t_maxseg = tp->t_maxopd = + tp->t_maxseg = #ifdef INET6 isipv6 ? V_tcp_v6mssdflt : #endif /* INET6 */ @@ -1901,7 +1901,7 @@ tcp_ctlinput(int cmd, struct sockaddr *s * Only process the offered MTU if it * is smaller than the current one. */ - if (mtu < tp->t_maxopd + + if (mtu < tp->t_maxseg + sizeof(struct tcpiphdr)) { bzero(&inc, sizeof(inc)); inc.inc_faddr = faddr; @@ -2283,6 +2283,59 @@ tcp_maxmtu6(struct in_conninfo *inc, str } #endif /* INET6 */ +/* + * Calculate effective SMSS per RFC5681 definition for a given TCP + * connection at its current state, taking into account SACK and etc. + */ +u_int +tcp_maxseg(const struct tcpcb *tp) +{ + u_int optlen; + + if (tp->t_flags & TF_NOOPT) + return (tp->t_maxseg); + + /* + * Here we have a simplified code from tcp_addoptions(), + * without a proper loop, and having most of paddings hardcoded. + * We might make mistakes with padding here in some edge cases, + * but this is harmless, since result of tcp_maxseg() is used + * only in cwnd and ssthresh estimations. + */ +#define PAD(len) ((((len) / 4) + !!((len) % 4)) * 4) + if (TCPS_HAVEESTABLISHED(tp->t_state)) { + if (tp->t_flags & TF_RCVD_TSTMP) + optlen = TCPOLEN_TSTAMP_APPA; + else + optlen = 0; +#ifdef TCP_SIGNATURE + if (tp->t_flags & TF_SIGNATURE) + optlen += PAD(TCPOLEN_SIGNATURE); +#endif + if ((tp->t_flags & TF_SACK_PERMIT) && tp->rcv_numsacks > 0) { + optlen += TCPOLEN_SACKHDR; + optlen += tp->rcv_numsacks * TCPOLEN_SACK; + optlen = PAD(optlen); + } + } else { + if (tp->t_flags & TF_REQ_TSTMP) + optlen = TCPOLEN_TSTAMP_APPA; + else + optlen = PAD(TCPOLEN_MAXSEG); + if (tp->t_flags & TF_REQ_SCALE) + optlen += PAD(TCPOLEN_WINDOW); +#ifdef TCP_SIGNATURE + if (tp->t_flags & TF_SIGNATURE) + optlen += PAD(TCPOLEN_SIGNATURE); +#endif + if (tp->t_flags & TF_SACK_PERMIT) + optlen += PAD(TCPOLEN_SACK_PERMITTED); + } +#undef PAD + optlen = min(optlen, TCP_MAXOLEN); + return (tp->t_maxseg - optlen); +} + #ifdef IPSEC /* compute ESP/AH header size for TCP, including outer IP header. */ size_t Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Wed Jan 6 22:02:08 2016 (r293283) +++ head/sys/netinet/tcp_timer.c Thu Jan 7 00:14:42 2016 (r293284) @@ -660,7 +660,6 @@ tcp_timer_rexmt(void * xtp) */ if (V_tcp_pmtud_blackhole_detect && (((tp->t_state == TCPS_ESTABLISHED)) || (tp->t_state == TCPS_FIN_WAIT_1))) { - int optlen; #ifdef INET6 int isipv6; #endif @@ -684,8 +683,7 @@ tcp_timer_rexmt(void * xtp) tp->t_flags2 |= TF2_PLPMTU_BLACKHOLE; /* Keep track of previous MSS. */ - optlen = tp->t_maxopd - tp->t_maxseg; - tp->t_pmtud_saved_maxopd = tp->t_maxopd; + tp->t_pmtud_saved_maxseg = tp->t_maxseg; /* * Reduce the MSS to blackhole value or to the default @@ -694,13 +692,13 @@ tcp_timer_rexmt(void * xtp) #ifdef INET6 isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) ? 1 : 0; if (isipv6 && - tp->t_maxopd > V_tcp_v6pmtud_blackhole_mss) { + tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss) { /* Use the sysctl tuneable blackhole MSS. */ - tp->t_maxopd = V_tcp_v6pmtud_blackhole_mss; + tp->t_maxseg = V_tcp_v6pmtud_blackhole_mss; V_tcp_pmtud_blackhole_activated++; } else if (isipv6) { /* Use the default MSS. */ - tp->t_maxopd = V_tcp_v6mssdflt; + tp->t_maxseg = V_tcp_v6mssdflt; /* * Disable Path MTU Discovery when we switch to * minmss. @@ -713,13 +711,13 @@ tcp_timer_rexmt(void * xtp) else #endif #ifdef INET - if (tp->t_maxopd > V_tcp_pmtud_blackhole_mss) { + if (tp->t_maxseg > V_tcp_pmtud_blackhole_mss) { /* Use the sysctl tuneable blackhole MSS. */ - tp->t_maxopd = V_tcp_pmtud_blackhole_mss; + tp->t_maxseg = V_tcp_pmtud_blackhole_mss; V_tcp_pmtud_blackhole_activated++; } else { /* Use the default MSS. */ - tp->t_maxopd = V_tcp_mssdflt; + tp->t_maxseg = V_tcp_mssdflt; /* * Disable Path MTU Discovery when we switch to * minmss. @@ -728,7 +726,6 @@ tcp_timer_rexmt(void * xtp) V_tcp_pmtud_blackhole_activated_min_mss++; } #endif - tp->t_maxseg = tp->t_maxopd - optlen; /* * Reset the slow-start flight size * as it may depend on the new MSS. @@ -748,9 +745,7 @@ tcp_timer_rexmt(void * xtp) (tp->t_rxtshift > 6)) { tp->t_flags2 |= TF2_PLPMTU_PMTUD; tp->t_flags2 &= ~TF2_PLPMTU_BLACKHOLE; - optlen = tp->t_maxopd - tp->t_maxseg; - tp->t_maxopd = tp->t_pmtud_saved_maxopd; - tp->t_maxseg = tp->t_maxopd - optlen; + tp->t_maxseg = tp->t_pmtud_saved_maxseg; V_tcp_pmtud_blackhole_failed++; /* * Reset the slow-start flight size as it Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Jan 6 22:02:08 2016 (r293283) +++ head/sys/netinet/tcp_usrreq.c Thu Jan 7 00:14:42 2016 (r293284) @@ -904,8 +904,7 @@ tcp_usr_send(struct socket *so, int flag /* * Do implied connect if not yet connected, * initialize window to default value, and - * initialize maxseg/maxopd using peer's cached - * MSS. + * initialize maxseg using peer's cached MSS. */ #ifdef INET6 if (isipv6) @@ -964,8 +963,7 @@ tcp_usr_send(struct socket *so, int flag /* * Do implied connect if not yet connected, * initialize window to default value, and - * initialize maxseg/maxopd using peer's cached - * MSS. + * initialize maxseg using peer's cached MSS. */ #ifdef INET6 if (isipv6) @@ -2208,8 +2206,8 @@ db_print_tcpcb(struct tcpcb *tp, const c "0x%08x\n", tp->snd_ssthresh, tp->snd_recover); db_print_indent(indent); - db_printf("t_maxopd: %u t_rcvtime: %u t_startime: %u\n", - tp->t_maxopd, tp->t_rcvtime, tp->t_starttime); + db_printf("t_rcvtime: %u t_startime: %u\n", + tp->t_rcvtime, tp->t_starttime); db_print_indent(indent); db_printf("t_rttime: %u t_rtsq: 0x%08x\n", Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Wed Jan 6 22:02:08 2016 (r293283) +++ head/sys/netinet/tcp_var.h Thu Jan 7 00:14:42 2016 (r293284) @@ -180,8 +180,6 @@ struct tcpcb { u_long snd_spare2; /* unused */ tcp_seq snd_recover; /* for use in NewReno Fast Recovery */ - u_int t_maxopd; /* mss plus options */ - u_int t_rcvtime; /* inactivity time */ u_int t_starttime; /* time connection was established */ u_int t_rtttime; /* RTT measurement start time */ @@ -192,6 +190,7 @@ struct tcpcb { int t_rxtcur; /* current retransmit value (ticks) */ u_int t_maxseg; /* maximum segment size */ + u_int t_pmtud_saved_maxseg; /* pre-blackhole MSS */ int t_srtt; /* smoothed round-trip time */ int t_rttvar; /* variance in round-trip time */ @@ -251,7 +250,6 @@ struct tcpcb { u_int t_tsomax; /* TSO total burst length limit in bytes */ u_int t_tsomaxsegcount; /* TSO maximum segment count */ u_int t_tsomaxsegsize; /* TSO maximum segment size in bytes */ - u_int t_pmtud_saved_maxopd; /* pre-blackhole MSS */ u_int t_flags2; /* More tcpcb flags storage */ #if defined(_KERNEL) && defined(TCP_RFC7413) uint32_t t_ispare[6]; /* 5 UTO, 1 TBD */ @@ -775,6 +773,7 @@ int tcp_default_ctloutput(struct socket u_long tcp_maxmtu(struct in_conninfo *, struct tcp_ifcap *); u_long tcp_maxmtu6(struct in_conninfo *, struct tcp_ifcap *); +u_int tcp_maxseg(const struct tcpcb *); void tcp_mss_update(struct tcpcb *, int, int, struct hc_metrics_lite *, struct tcp_ifcap *); void tcp_mss(struct tcpcb *, int); From owner-svn-src-head@freebsd.org Thu Jan 7 00:15:03 2016 Return-Path: Delivered-To: svn-src-head@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 4562AA64F20; Thu, 7 Jan 2016 00:15:03 +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 1899C1296; Thu, 7 Jan 2016 00:15:03 +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 u070F2Le059952; Thu, 7 Jan 2016 00:15:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u070F2j1059951; Thu, 7 Jan 2016 00:15:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601070015.u070F2j1059951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 00:15:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293285 - head/gnu/usr.bin/binutils/ld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 00:15:03 -0000 Author: emaste Date: Thu Jan 7 00:15:02 2016 New Revision: 293285 URL: https://svnweb.freebsd.org/changeset/base/293285 Log: Switch GNU ld to be installed as ld.bfd and linked as ld We intend to replace GNU ld with LLVM's lld, and on the path to there we'll experiment with having lld installed or linked as /usr/bin/ld. Thus, make ld.bfd the primary install target for GNU ld, to later facilitate making the ld link optional. Reviewed by: davide, dim Differential Revision: https://reviews.freebsd.org/D4790 Modified: head/gnu/usr.bin/binutils/ld/Makefile Modified: head/gnu/usr.bin/binutils/ld/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/ld/Makefile Thu Jan 7 00:14:42 2016 (r293284) +++ head/gnu/usr.bin/binutils/ld/Makefile Thu Jan 7 00:15:02 2016 (r293285) @@ -6,7 +6,8 @@ ELF_SCR_EXT= x xbn xc xd xdc xdw xn xr x .PATH: ${SRCDIR}/ld -PROG= ld +PROG= ld.bfd +MAN= ld.1 SCRIPTDIR= /usr/libdata/ldscripts SRCS+= ldcref.c \ ldctor.c \ @@ -48,7 +49,7 @@ CLEANFILES+= ldemul-list.h stringify.sed FILES= ${LDSCRIPTS:S|^|ldscripts/|} FILESDIR= ${SCRIPTDIR} -LINKS= ${BINDIR}/ld ${BINDIR}/ld.bfd +LINKS= ${BINDIR}/ld.bfd ${BINDIR}/ld HOST= ${TARGET_TUPLE} LIBSEARCHPATH= \"=/lib\":\"=/usr/lib\" From owner-svn-src-head@freebsd.org Thu Jan 7 00:19:04 2016 Return-Path: Delivered-To: svn-src-head@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 BE60EA650A4; Thu, 7 Jan 2016 00:19:04 +0000 (UTC) (envelope-from bdrewery@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 7BFDF155E; Thu, 7 Jan 2016 00:19:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u070J3G3060136; Thu, 7 Jan 2016 00:19:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u070J3KI060134; Thu, 7 Jan 2016 00:19:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601070019.u070J3KI060134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 Jan 2016 00:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293286 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 00:19:04 -0000 Author: bdrewery Date: Thu Jan 7 00:19:03 2016 New Revision: 293286 URL: https://svnweb.freebsd.org/changeset/base/293286 Log: Move the MAKEOBJDIRPREFIX value guard to sys.mk and expand to MAKEOBJDIR. This will ensure that the variable was not set as a make override, in make.conf, src.conf or src-env.conf. It allows setting the value in src-env.conf when using WITH_AUTO_OBJ since that case properly handles changing .OBJDIR (except if MAKEOBJDIRPREFIX does not yet exist which is being discussed to be changed). This change allows setting a default MAKEOBJDIRPREFIX via local.sys.env.mk. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile head/share/mk/sys.mk Modified: head/Makefile ============================================================================== --- head/Makefile Thu Jan 7 00:15:02 2016 (r293285) +++ head/Makefile Thu Jan 7 00:19:03 2016 (r293286) @@ -143,13 +143,6 @@ TGTS+= ${BITGTS} PATH= /sbin:/bin:/usr/sbin:/usr/bin MAKEOBJDIRPREFIX?= /usr/obj -_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} \ - ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \ - -f /dev/null -V MAKEOBJDIRPREFIX dummy -.if !empty(_MAKEOBJDIRPREFIX) -.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ - (in make.conf(5)) or command-line variable. -.endif # We often need to use the tree's version of make to build it. # Choices add to complexity though. Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Thu Jan 7 00:15:02 2016 (r293285) +++ head/share/mk/sys.mk Thu Jan 7 00:19:03 2016 (r293286) @@ -33,6 +33,13 @@ __ENV_ONLY_OPTIONS:= \ ${__DEFAULT_YES_OPTIONS} \ ${__DEFAULT_DEPENDENT_OPTIONS:H} +__ENV_ONLY_VARS= \ + MAKEOBJDIR \ + MAKEOBJDIRPREFIX +.for _var in ${__ENV_ONLY_VARS} +_pre_includes_${_var:tl}:= ${${_var}:U__null} +.endfor + # early include for customization # see local.sys.mk below # Not included when building in fmake compatibility mode (still needed @@ -50,6 +57,9 @@ __ENV_ONLY_OPTIONS:= \ .endif .endif .if ${MK_AUTO_OBJ} == "yes" +# Reset, since it is allowed to be set from src-env.conf included before this. +_pre_includes_makeobjdirprefix:= ${MAKEOBJDIRPREFIX:U__null} +_pre_includes_makeobjdir:= ${MAKEOBJDIR:U__null} # This needs to be done early - before .PATH is computed # Don't do this for 'make showconfig' as it enables all options where meta mode # is not expected. @@ -410,6 +420,15 @@ __MAKE_SHELL?=/bin/sh path=${__MAKE_SHELL} .endif +# Ensure MAKEOBJDIRPREFIX was not incorrectly set. +.for _var in ${__ENV_ONLY_VARS} +.if ${.MAKEOVERRIDES:M${_var}} || (defined(${_var}) && \ + ${${_var}} != ${_pre_includes_${_var:tl}}) +.error ${_var} can only be set in environment, not as a global (in make.conf(5)) or command-line variable. +.endif +.undef _pre_includes_${_var:tl} +.endfor + # Hack for ports compatibility. Historically, ports makefiles have # assumed they can examine MACHINE_CPU without including anything # because this was automatically included in sys.mk. For /usr/src, From owner-svn-src-head@freebsd.org Thu Jan 7 00:19:31 2016 Return-Path: Delivered-To: svn-src-head@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 89E58A6512C; Thu, 7 Jan 2016 00:19:31 +0000 (UTC) (envelope-from bdrewery@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 56A5A17C4; Thu, 7 Jan 2016 00:19:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u070JUqK060194; Thu, 7 Jan 2016 00:19:30 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u070JUT2060192; Thu, 7 Jan 2016 00:19:30 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601070019.u070JUT2060192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 Jan 2016 00:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293287 - in head: lib/libsysdecode targets/pseudo/userland/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 00:19:31 -0000 Author: bdrewery Date: Thu Jan 7 00:19:30 2016 New Revision: 293287 URL: https://svnweb.freebsd.org/changeset/base/293287 Log: Add in DIRDEPS_BUILD support. Sponsored by: EMC / Isilon Storage Division Added: head/lib/libsysdecode/Makefile.depend (contents, props changed) Modified: head/targets/pseudo/userland/lib/Makefile.depend Added: head/lib/libsysdecode/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsysdecode/Makefile.depend Thu Jan 7 00:19:30 2016 (r293287) @@ -0,0 +1,22 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/rpc \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +ioctl.So: ioctl.c +ioctl.o: ioctl.c +ioctl.po: ioctl.c +.endif Modified: head/targets/pseudo/userland/lib/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/lib/Makefile.depend Thu Jan 7 00:19:03 2016 (r293286) +++ head/targets/pseudo/userland/lib/Makefile.depend Thu Jan 7 00:19:30 2016 (r293287) @@ -136,6 +136,7 @@ DIRDEPS = \ lib/libstand \ lib/libstdbuf \ lib/libstdthreads \ + lib/libsysdecode \ lib/libtacplus \ lib/libtelnet \ lib/libthr \ From owner-svn-src-head@freebsd.org Thu Jan 7 00:20:49 2016 Return-Path: Delivered-To: svn-src-head@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 3EBC3A651CB; Thu, 7 Jan 2016 00:20:49 +0000 (UTC) (envelope-from bdrewery@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 EA5B319AF; Thu, 7 Jan 2016 00:20:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u070Kmr8060289; Thu, 7 Jan 2016 00:20:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u070KlJC060287; Thu, 7 Jan 2016 00:20:47 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601070020.u070KlJC060287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 Jan 2016 00:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293288 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 00:20:49 -0000 Author: bdrewery Date: Thu Jan 7 00:20:47 2016 New Revision: 293288 URL: https://svnweb.freebsd.org/changeset/base/293288 Log: Revert r293286. It was not intended to come in yet. Modified: head/Makefile head/share/mk/sys.mk Modified: head/Makefile ============================================================================== --- head/Makefile Thu Jan 7 00:19:30 2016 (r293287) +++ head/Makefile Thu Jan 7 00:20:47 2016 (r293288) @@ -143,6 +143,13 @@ TGTS+= ${BITGTS} PATH= /sbin:/bin:/usr/sbin:/usr/bin MAKEOBJDIRPREFIX?= /usr/obj +_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} \ + ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \ + -f /dev/null -V MAKEOBJDIRPREFIX dummy +.if !empty(_MAKEOBJDIRPREFIX) +.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ + (in make.conf(5)) or command-line variable. +.endif # We often need to use the tree's version of make to build it. # Choices add to complexity though. Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Thu Jan 7 00:19:30 2016 (r293287) +++ head/share/mk/sys.mk Thu Jan 7 00:20:47 2016 (r293288) @@ -33,13 +33,6 @@ __ENV_ONLY_OPTIONS:= \ ${__DEFAULT_YES_OPTIONS} \ ${__DEFAULT_DEPENDENT_OPTIONS:H} -__ENV_ONLY_VARS= \ - MAKEOBJDIR \ - MAKEOBJDIRPREFIX -.for _var in ${__ENV_ONLY_VARS} -_pre_includes_${_var:tl}:= ${${_var}:U__null} -.endfor - # early include for customization # see local.sys.mk below # Not included when building in fmake compatibility mode (still needed @@ -57,9 +50,6 @@ _pre_includes_${_var:tl}:= ${${_var}:U__ .endif .endif .if ${MK_AUTO_OBJ} == "yes" -# Reset, since it is allowed to be set from src-env.conf included before this. -_pre_includes_makeobjdirprefix:= ${MAKEOBJDIRPREFIX:U__null} -_pre_includes_makeobjdir:= ${MAKEOBJDIR:U__null} # This needs to be done early - before .PATH is computed # Don't do this for 'make showconfig' as it enables all options where meta mode # is not expected. @@ -420,15 +410,6 @@ __MAKE_SHELL?=/bin/sh path=${__MAKE_SHELL} .endif -# Ensure MAKEOBJDIRPREFIX was not incorrectly set. -.for _var in ${__ENV_ONLY_VARS} -.if ${.MAKEOVERRIDES:M${_var}} || (defined(${_var}) && \ - ${${_var}} != ${_pre_includes_${_var:tl}}) -.error ${_var} can only be set in environment, not as a global (in make.conf(5)) or command-line variable. -.endif -.undef _pre_includes_${_var:tl} -.endfor - # Hack for ports compatibility. Historically, ports makefiles have # assumed they can examine MACHINE_CPU without including anything # because this was automatically included in sys.mk. For /usr/src, From owner-svn-src-head@freebsd.org Thu Jan 7 00:32:41 2016 Return-Path: Delivered-To: svn-src-head@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 8CE6AA65747; Thu, 7 Jan 2016 00:32:41 +0000 (UTC) (envelope-from bdrewery@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 5CDF61285; Thu, 7 Jan 2016 00:32:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u070WeHO065810; Thu, 7 Jan 2016 00:32:40 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u070Wemv065809; Thu, 7 Jan 2016 00:32:40 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601070032.u070Wemv065809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 Jan 2016 00:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293289 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 00:32:41 -0000 Author: bdrewery Date: Thu Jan 7 00:32:40 2016 New Revision: 293289 URL: https://svnweb.freebsd.org/changeset/base/293289 Log: Update dependencies after r292622 moved the ioctl script. Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/truss/Makefile.depend.amd64 Modified: head/usr.bin/truss/Makefile.depend.amd64 ============================================================================== --- head/usr.bin/truss/Makefile.depend.amd64 Thu Jan 7 00:20:47 2016 (r293288) +++ head/usr.bin/truss/Makefile.depend.amd64 Thu Jan 7 00:32:40 2016 (r293289) @@ -6,7 +6,6 @@ DIRDEPS = \ gnu/lib/libgcc \ include \ include/arpa \ - include/rpc \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ @@ -26,6 +25,4 @@ amd64-freebsd32.o: freebsd32_syscalls.h amd64-freebsd32.po: freebsd32_syscalls.h amd64-linux32.o: amd64-linux32_syscalls.h amd64-linux32.po: amd64-linux32_syscalls.h -ioctl.o: ioctl.c -ioctl.po: ioctl.c .endif From owner-svn-src-head@freebsd.org Thu Jan 7 02:04:19 2016 Return-Path: Delivered-To: svn-src-head@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 05E6AA650DB; Thu, 7 Jan 2016 02:04:19 +0000 (UTC) (envelope-from mjg@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 B8BA21D92; Thu, 7 Jan 2016 02:04:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0724Hp9092413; Thu, 7 Jan 2016 02:04:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0724H5q092412; Thu, 7 Jan 2016 02:04:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201601070204.u0724H5q092412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 7 Jan 2016 02:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293295 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 02:04:19 -0000 Author: mjg Date: Thu Jan 7 02:04:17 2016 New Revision: 293295 URL: https://svnweb.freebsd.org/changeset/base/293295 Log: cache: ansify functions and fix some style issues No functional changes. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Jan 7 01:50:50 2016 (r293294) +++ head/sys/kern/vfs_cache.c Thu Jan 7 02:04:17 2016 (r293295) @@ -288,7 +288,7 @@ static u_long nummiss; STATNODE(CTLFLAG_ "Number of cache misses"); static u_long nummisszap; STATNODE(CTLFLAG_RD, nummisszap, &nummisszap, "Number of cache misses we do not want to cache"); -static u_long numposzaps; STATNODE(CTLFLAG_RD, numposzaps, &numposzaps, +static u_long numposzaps; STATNODE(CTLFLAG_RD, numposzaps, &numposzaps, "Number of cache hits (positive) we do not want to cache"); static u_long numposhits; STATNODE(CTLFLAG_RD, numposhits, &numposhits, "Number of cache hits (positive)"); @@ -303,8 +303,6 @@ SYSCTL_OPAQUE(_vfs_cache, OID_AUTO, nchs &nchstats, sizeof(nchstats), "LU", "VFS cache effectiveness statistics"); - - static void cache_zap(struct namecache *ncp); static int vn_vptocnp_locked(struct vnode **vp, struct ucred *cred, char *buf, u_int *buflen); @@ -410,8 +408,7 @@ SYSCTL_PROC(_debug_hashstat, OID_AUTO, n * pointer to a vnode or if it is just a negative cache entry. */ static void -cache_zap(ncp) - struct namecache *ncp; +cache_zap(struct namecache *ncp) { struct vnode *vp; @@ -446,7 +443,7 @@ cache_zap(ncp) } numcache--; cache_free(ncp); - if (vp) + if (vp != NULL) vdrop(vp); } @@ -468,12 +465,8 @@ cache_zap(ncp) */ int -cache_lookup(dvp, vpp, cnp, tsp, ticksp) - struct vnode *dvp; - struct vnode **vpp; - struct componentname *cnp; - struct timespec *tsp; - int *ticksp; +cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, + struct timespec *tsp, int *ticksp) { struct namecache *ncp; uint32_t hash; @@ -701,12 +694,8 @@ unlock: * Add an entry to the cache. */ void -cache_enter_time(dvp, vp, cnp, tsp, dtsp) - struct vnode *dvp; - struct vnode *vp; - struct componentname *cnp; - struct timespec *tsp; - struct timespec *dtsp; +cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, + struct timespec *tsp, struct timespec *dtsp) { struct namecache *ncp, *n2; struct namecache_ts *n3; @@ -836,9 +825,9 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp * has populated v_cache_dd pointer already. */ if (dvp->v_cache_dd != NULL) { - CACHE_WUNLOCK(); - cache_free(ncp); - return; + CACHE_WUNLOCK(); + cache_free(ncp); + return; } KASSERT(vp == NULL || vp->v_type == VDIR, ("wrong vnode type %p", vp)); @@ -846,7 +835,7 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp } numcache++; - if (!vp) { + if (vp == NULL) { numneg++; if (cnp->cn_flags & ISWHITEOUT) ncp->nc_flag |= NCF_WHITE; @@ -884,7 +873,7 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp * "negative" cache queue, otherwise, we place it into the * destination vnode's cache entries queue. */ - if (vp) { + if (vp != NULL) { TAILQ_INSERT_HEAD(&vp->v_cache_dst, ncp, nc_dst); SDT_PROBE3(vfs, namecache, enter, done, dvp, nc_get_name(ncp), vp); @@ -975,8 +964,7 @@ cache_changesize(int newmaxvnodes) * Invalidate all entries to a particular vnode. */ void -cache_purge(vp) - struct vnode *vp; +cache_purge(struct vnode *vp) { CTR1(KTR_VFS, "cache_purge(%p)", vp); @@ -999,8 +987,7 @@ cache_purge(vp) * Invalidate all negative entries for a particular directory vnode. */ void -cache_purge_negative(vp) - struct vnode *vp; +cache_purge_negative(struct vnode *vp) { struct namecache *cp, *ncp; @@ -1018,8 +1005,7 @@ cache_purge_negative(vp) * Flush all entries referencing a particular filesystem. */ void -cache_purgevfs(mp) - struct mount *mp; +cache_purgevfs(struct mount *mp) { struct nchashhead *ncpp; struct namecache *ncp, *nnp; @@ -1042,12 +1028,7 @@ cache_purgevfs(mp) */ int -vfs_cache_lookup(ap) - struct vop_lookup_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - } */ *ap; +vfs_cache_lookup(struct vop_lookup_args *ap) { struct vnode *dvp; int error; @@ -1088,9 +1069,7 @@ SYSCTL_INT(_debug, OID_AUTO, disablecwd, /* Implementation of the getcwd syscall. */ int -sys___getcwd(td, uap) - struct thread *td; - struct __getcwd_args *uap; +sys___getcwd(struct thread *td, struct __getcwd_args *uap) { return (kern___getcwd(td, uap->buf, UIO_USERSPACE, uap->buflen, From owner-svn-src-head@freebsd.org Thu Jan 7 02:20:53 2016 Return-Path: Delivered-To: svn-src-head@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 B0B6AA6593C; Thu, 7 Jan 2016 02:20:53 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lf0-x233.google.com (mail-lf0-x233.google.com [IPv6:2a00:1450:4010:c07::233]) (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 5587519F2; Thu, 7 Jan 2016 02:20:53 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lf0-x233.google.com with SMTP id c192so147846214lfe.2; Wed, 06 Jan 2016 18:20:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=A8E8P3KhwrNVqydE3znJE392jz/rSgFAqfCQWVMVwb8=; b=ZVr+I3L4V3+oPeqVjf9Ig3DsxFZurB7LELtTaOpXa720llzkjDkOUhtl/hCg6zYgHf rv3dqO1e1SYL8iMEU+qNvxk1Kx/8BWMHaHShv/KZ+HLsjUn4nDlr0A74NDHl1zdMCjFj nmaLnoXVb+IOry4O8QV8uve3WQ+KTDOPe2z3fhrg8r7jGcURFJIQkNjlCVbO/+bRTZ/I Vij8cl5yTrg101MGdtAwPsfGyvjwYJJKK/XsngudVwhILfqRGsMo52hd+WkHW4IS3InW EMZx7Hxqqgf7g2s5dDQkRigegnE30pZkjunv0dxdX65HDKcYU5Db1j8oodxxBCeZs4sh U2cQ== MIME-Version: 1.0 X-Received: by 10.25.208.213 with SMTP id h204mr27254931lfg.112.1452133250506; Wed, 06 Jan 2016 18:20:50 -0800 (PST) Received: by 10.112.160.133 with HTTP; Wed, 6 Jan 2016 18:20:50 -0800 (PST) In-Reply-To: <201601070014.u070EgW1059880@repo.freebsd.org> References: <201601070014.u070EgW1059880@repo.freebsd.org> Date: Wed, 6 Jan 2016 18:20:50 -0800 Message-ID: Subject: Re: svn commit: r293284 - in head/sys: dev/cxgb/ulp/tom dev/cxgbe/tom netinet From: NGie Cooper To: Gleb Smirnoff Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 02:20:53 -0000 On Wed, Jan 6, 2016 at 4:14 PM, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Jan 7 00:14:42 2016 > New Revision: 293284 > URL: https://svnweb.freebsd.org/changeset/base/293284 > > Log: > Historically we have two fields in tcpcb to describe sender MSS: t_maxopd, > and t_maxseg. This dualism emerged with T/TCP, but was not properly cleaned > up after T/TCP removal. After all permutations over the years the result is > that t_maxopd stores a minimum of peer offered MSS and MTU reduced by minimum > protocol header. And t_maxseg stores (t_maxopd - TCPOLEN_TSTAMP_APPA) if > timestamps are in action, or is equal to t_maxopd otherwise. That's a very > rough estimate of MSS reduced by options length. Throughout the code it > was used in places, where preciseness was not important, like cwnd or > ssthresh calculations. > > With this change: > > - t_maxopd goes away. > - t_maxseg now stores MSS not adjusted by options. > - new function tcp_maxseg() is provided, that calculates MSS reduced by > options length. The functions gives a better estimate, since it takes > into account SACK state as well. > > Reviewed by: jtl > Differential Revision: https://reviews.freebsd.org/D3593 This broke the build. >From https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/2053/ : /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:481:6: error: no member named 't_maxopd' in 'struct tcpcb' --- all_subdir_sound --- --- all_subdir_sb8 --- ===> sound/driver/sb8 (all) --- all_subdir_tcp/fastpath --- if (DELAY_ACK(tp, tlen)) { ^ ~~ /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:167:19: note: expanded from macro 'DELAY_ACK' (tlen <= tp->t_maxopd) && \ ^ /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:606:8: error: no member named 't_maxopd' in 'struct tcpcb' if (DELAY_ACK(tp, tlen) && tlen != 0) ^ ~~ /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:167:19: note: expanded from macro 'DELAY_ACK' (tlen <= tp->t_maxopd) && \ ^ --- all_subdir_sound --- --- all_subdir_sb16 --- ctfconvert -L VERSION -g sb16.o --- all_subdir_tcp/fastpath --- /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:1545:8: error: no member named 't_maxopd' in 'struct tcpcb' if (DELAY_ACK(tp, tlen)) ^ ~~ /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:167:19: note: expanded from macro 'DELAY_ACK' (tlen <= tp->t_maxopd) && \ ^ 3 errors generated. *** [fastpath.o] Error code 1 From owner-svn-src-head@freebsd.org Thu Jan 7 05:34:40 2016 Return-Path: Delivered-To: svn-src-head@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 52F86A65C14; Thu, 7 Jan 2016 05:34:40 +0000 (UTC) (envelope-from jpaetzel@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 3070E19CD; Thu, 7 Jan 2016 05:34:40 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u075YdC0056892; Thu, 7 Jan 2016 05:34:39 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u075Yd85056890; Thu, 7 Jan 2016 05:34:39 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201601070534.u075Yd85056890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 7 Jan 2016 05:34:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293305 - head/usr.sbin/mountd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 05:34:40 -0000 Author: jpaetzel Date: Thu Jan 7 05:34:39 2016 New Revision: 293305 URL: https://svnweb.freebsd.org/changeset/base/293305 Log: Allow /etc/exports to contain usernames/groups with spaces in them. If you are getting your users/groups from a directory service such as LDAP or AD it's possible for those usernames or groupnames to contain spaces. Submitted by: Sean E. Fagan Reviewed by: rmacklem MFC after: 1 week Sponsored by: iXsystems Modified: head/usr.sbin/mountd/exports.5 head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/exports.5 ============================================================================== --- head/usr.sbin/mountd/exports.5 Thu Jan 7 04:02:37 2016 (r293304) +++ head/usr.sbin/mountd/exports.5 Thu Jan 7 05:34:39 2016 (r293305) @@ -131,6 +131,7 @@ The credential includes all the groups t on the local machine (see .Xr id 1 ) . The user may be specified by name or number. +The user string may be quoted, or use backslash escaping. .Pp .Sm off .Fl maproot Li = Sy user:group1:group2:... @@ -140,6 +141,7 @@ to be used for remote access by root. The elements of the list may be either names or numbers. Note that user: should be used to distinguish a credential containing no groups from a complete credential for that user. +The group names may be quoted, or use backslash escaping. .Pp .Sm off .Fl mapall Li = Sy user Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Thu Jan 7 04:02:37 2016 (r293304) +++ head/usr.sbin/mountd/mountd.c Thu Jan 7 05:34:39 2016 (r293305) @@ -174,6 +174,7 @@ static int check_options(struct dirlist static int checkmask(struct sockaddr *sa); static int chk_host(struct dirlist *, struct sockaddr *, int *, int *, int *, int **); +static char *strsep_quote(char **stringp, const char *delim); static int create_service(struct netconfig *nconf); static void complete_service(struct netconfig *nconf, char *port_str); static void clearout_service(void); @@ -278,6 +279,73 @@ static int debug = 0; #endif /* + * Similar to strsep(), but it allows for quoted strings + * and escaped characters. + * + * It returns the string (or NULL, if *stringp is NULL), + * which is a de-quoted version of the string if necessary. + * + * It modifies *stringp in place. + */ +static char * +strsep_quote(char **stringp, const char *delim) +{ + char *srcptr, *dstptr, *retval; + char quot = 0; + + if (stringp == NULL || *stringp == NULL) + return (NULL); + + srcptr = dstptr = retval = *stringp; + + while (*srcptr) { + /* + * We're looking for several edge cases here. + * First: if we're in quote state (quot != 0), + * then we ignore the delim characters, but otherwise + * process as normal, unless it is the quote character. + * Second: if the current character is a backslash, + * we take the next character as-is, without checking + * for delim, quote, or backslash. Exception: if the + * next character is a NUL, that's the end of the string. + * Third: if the character is a quote character, we toggle + * quote state. + * Otherwise: check the current character for NUL, or + * being in delim, and end the string if either is true. + */ + if (*srcptr == '\\') { + srcptr++; + /* + * The edge case here is if the next character + * is NUL, we want to stop processing. But if + * it's not NUL, then we simply want to copy it. + */ + if (*srcptr) { + *dstptr++ = *srcptr++; + } + continue; + } + if (quot == 0 && (*srcptr == '\'' || *srcptr == '"')) { + quot = *srcptr++; + continue; + } + if (quot && *srcptr == quot) { + /* End of the quoted part */ + quot = 0; + srcptr++; + continue; + } + if (!quot && strchr(delim, *srcptr)) + break; + *dstptr++ = *srcptr++; + } + + *dstptr = 0; /* Terminate the string */ + *stringp = (*srcptr == '\0') ? NULL : srcptr + 1; + return (retval); +} + +/* * Mountd server for NFS mount protocol as described in: * NFS: Network File System Protocol Specification, RFC1094, Appendix A * The optional arguments are the exports file name @@ -2831,8 +2899,9 @@ parsecred(char *namelist, struct xucred /* * Get the user's password table entry. */ - names = strsep(&namelist, " \t\n"); + names = strsep_quote(&namelist, " \t\n"); name = strsep(&names, ":"); + /* Bug? name could be NULL here */ if (isdigit(*name) || *name == '-') pw = getpwuid(atoi(name)); else From owner-svn-src-head@freebsd.org Thu Jan 7 05:47:37 2016 Return-Path: Delivered-To: svn-src-head@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 044DEA65FD2; Thu, 7 Jan 2016 05:47:37 +0000 (UTC) (envelope-from allanjude@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 BC6551EB9; Thu, 7 Jan 2016 05:47:36 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u075lZvr061614; Thu, 7 Jan 2016 05:47:35 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u075lZWV061603; Thu, 7 Jan 2016 05:47:35 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201601070547.u075lZWV061603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 7 Jan 2016 05:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293306 - in head: sbin/geom/class/eli sys/conf sys/geom/eli sys/modules/geom/geom_eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 05:47:37 -0000 Author: allanjude Date: Thu Jan 7 05:47:34 2016 New Revision: 293306 URL: https://svnweb.freebsd.org/changeset/base/293306 Log: Make additional parts of sys/geom/eli more usable in userspace The upcoming GELI support in the loader reuses parts of this code Some ifdefs are added, and some code is moved outside of existing ifdefs The HMAC parts of GELI are broken out into their own file, to separate them from the kernel crypto/openssl dependant parts that are replaced in the boot code. Passed the GELI regression suite (tools/regression/geom/eli) Files=20 Tests=14996 Result: PASS Reviewed by: pjd, delphij MFC after: 1 week Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D4699 Added: head/sys/geom/eli/g_eli_hmac.c - copied, changed from r292238, head/sys/geom/eli/g_eli_crypto.c Modified: head/sbin/geom/class/eli/Makefile head/sys/conf/files head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli.h head/sys/geom/eli/g_eli_crypto.c head/sys/geom/eli/g_eli_key_cache.c head/sys/geom/eli/pkcs5v2.c head/sys/modules/geom/geom_eli/Makefile Modified: head/sbin/geom/class/eli/Makefile ============================================================================== --- head/sbin/geom/class/eli/Makefile Thu Jan 7 05:34:39 2016 (r293305) +++ head/sbin/geom/class/eli/Makefile Thu Jan 7 05:47:34 2016 (r293306) @@ -4,6 +4,7 @@ GEOM_CLASS= eli SRCS= g_eli_crypto.c +SRCS+= g_eli_hmac.c SRCS+= g_eli_key.c SRCS+= pkcs5v2.c SRCS+= sha256c.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jan 7 05:34:39 2016 (r293305) +++ head/sys/conf/files Thu Jan 7 05:47:34 2016 (r293306) @@ -2994,6 +2994,7 @@ geom/concat/g_concat.c optional geom_co geom/eli/g_eli.c optional geom_eli geom/eli/g_eli_crypto.c optional geom_eli geom/eli/g_eli_ctl.c optional geom_eli +geom/eli/g_eli_hmac.c optional geom_eli geom/eli/g_eli_integrity.c optional geom_eli geom/eli/g_eli_key.c optional geom_eli geom/eli/g_eli_key_cache.c optional geom_eli Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Thu Jan 7 05:34:39 2016 (r293305) +++ head/sys/geom/eli/g_eli.c Thu Jan 7 05:47:34 2016 (r293306) @@ -571,40 +571,6 @@ again: } } -/* - * Here we generate IV. It is unique for every sector. - */ -void -g_eli_crypto_ivgen(struct g_eli_softc *sc, off_t offset, u_char *iv, - size_t size) -{ - uint8_t off[8]; - - if ((sc->sc_flags & G_ELI_FLAG_NATIVE_BYTE_ORDER) != 0) - bcopy(&offset, off, sizeof(off)); - else - le64enc(off, (uint64_t)offset); - - switch (sc->sc_ealgo) { - case CRYPTO_AES_XTS: - bcopy(off, iv, sizeof(off)); - bzero(iv + sizeof(off), size - sizeof(off)); - break; - default: - { - u_char hash[SHA256_DIGEST_LENGTH]; - SHA256_CTX ctx; - - /* Copy precalculated SHA256 context for IV-Key. */ - bcopy(&sc->sc_ivctx, &ctx, sizeof(ctx)); - SHA256_Update(&ctx, off, sizeof(off)); - SHA256_Final(hash, &ctx); - bcopy(hash, iv, MIN(sizeof(hash), size)); - break; - } - } -} - int g_eli_read_metadata(struct g_class *mp, struct g_provider *pp, struct g_eli_metadata *md) @@ -751,44 +717,9 @@ g_eli_create(struct gctl_req *req, struc else gp->access = g_std_access; - sc->sc_version = md->md_version; - sc->sc_inflight = 0; - sc->sc_crypto = G_ELI_CRYPTO_UNKNOWN; - sc->sc_flags = md->md_flags; - /* Backward compatibility. */ - if (md->md_version < G_ELI_VERSION_04) - sc->sc_flags |= G_ELI_FLAG_NATIVE_BYTE_ORDER; - if (md->md_version < G_ELI_VERSION_05) - sc->sc_flags |= G_ELI_FLAG_SINGLE_KEY; - if (md->md_version < G_ELI_VERSION_06 && - (sc->sc_flags & G_ELI_FLAG_AUTH) != 0) { - sc->sc_flags |= G_ELI_FLAG_FIRST_KEY; - } - if (md->md_version < G_ELI_VERSION_07) - sc->sc_flags |= G_ELI_FLAG_ENC_IVKEY; - sc->sc_ealgo = md->md_ealgo; + eli_metadata_softc(sc, md, bpp->sectorsize, bpp->mediasize); sc->sc_nkey = nkey; - if (sc->sc_flags & G_ELI_FLAG_AUTH) { - sc->sc_akeylen = sizeof(sc->sc_akey) * 8; - sc->sc_aalgo = md->md_aalgo; - sc->sc_alen = g_eli_hashlen(sc->sc_aalgo); - - sc->sc_data_per_sector = bpp->sectorsize - sc->sc_alen; - /* - * Some hash functions (like SHA1 and RIPEMD160) generates hash - * which length is not multiple of 128 bits, but we want data - * length to be multiple of 128, so we can encrypt without - * padding. The line below rounds down data length to multiple - * of 128 bits. - */ - sc->sc_data_per_sector -= sc->sc_data_per_sector % 16; - - sc->sc_bytes_per_sector = - (md->md_sectorsize - 1) / sc->sc_data_per_sector + 1; - sc->sc_bytes_per_sector *= bpp->sectorsize; - } - gp->softc = sc; sc->sc_geom = gp; @@ -831,22 +762,10 @@ g_eli_create(struct gctl_req *req, struc goto failed; } - sc->sc_sectorsize = md->md_sectorsize; - sc->sc_mediasize = bpp->mediasize; - if (!(sc->sc_flags & G_ELI_FLAG_ONETIME)) - sc->sc_mediasize -= bpp->sectorsize; - if (!(sc->sc_flags & G_ELI_FLAG_AUTH)) - sc->sc_mediasize -= (sc->sc_mediasize % sc->sc_sectorsize); - else { - sc->sc_mediasize /= sc->sc_bytes_per_sector; - sc->sc_mediasize *= sc->sc_sectorsize; - } - /* * Remember the keys in our softc structure. */ g_eli_mkey_propagate(sc, mkey); - sc->sc_ekeylen = md->md_keylen; LIST_INIT(&sc->sc_workers); Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Thu Jan 7 05:34:39 2016 (r293305) +++ head/sys/geom/eli/g_eli.h Thu Jan 7 05:47:34 2016 (r293306) @@ -40,8 +40,6 @@ #include #include #include -#include -#include #include #else #include @@ -49,6 +47,8 @@ #include #include #endif +#include +#include #ifndef _OpenSSL_ #include #endif @@ -132,15 +132,15 @@ /* Switch data encryption key every 2^20 blocks. */ #define G_ELI_KEY_SHIFT 20 +#define G_ELI_CRYPTO_UNKNOWN 0 +#define G_ELI_CRYPTO_HW 1 +#define G_ELI_CRYPTO_SW 2 + #ifdef _KERNEL extern int g_eli_debug; extern u_int g_eli_overwrites; extern u_int g_eli_batch; -#define G_ELI_CRYPTO_UNKNOWN 0 -#define G_ELI_CRYPTO_HW 1 -#define G_ELI_CRYPTO_SW 2 - #define G_ELI_DEBUG(lvl, ...) do { \ if (g_eli_debug >= (lvl)) { \ printf("GEOM_ELI"); \ @@ -173,6 +173,8 @@ struct g_eli_worker { LIST_ENTRY(g_eli_worker) w_next; }; +#endif /* _KERNEL */ + struct g_eli_softc { struct g_geom *sc_geom; u_int sc_version; @@ -200,15 +202,35 @@ struct g_eli_softc { size_t sc_sectorsize; u_int sc_bytes_per_sector; u_int sc_data_per_sector; +#ifndef _KERNEL + int sc_cpubind; +#else /* _KERNEL */ boolean_t sc_cpubind; /* Only for software cryptography. */ struct bio_queue_head sc_queue; struct mtx sc_queue_mtx; LIST_HEAD(, g_eli_worker) sc_workers; +#endif /* _KERNEL */ }; #define sc_name sc_geom->name -#endif /* _KERNEL */ + +#define G_ELI_KEY_MAGIC 0xe11341c + +struct g_eli_key { + /* Key value, must be first in the structure. */ + uint8_t gek_key[G_ELI_DATAKEYLEN]; + /* Magic. */ + int gek_magic; + /* Key number. */ + uint64_t gek_keyno; + /* Reference counter. */ + int gek_count; + /* Keeps keys sorted by most recent use. */ + TAILQ_ENTRY(g_eli_key) gek_next; + /* Keeps keys sorted by number. */ + RB_ENTRY(g_eli_key) gek_link; +}; struct g_eli_metadata { char md_magic[16]; /* Magic value. */ @@ -569,6 +591,60 @@ g_eli_hashlen(u_int algo) return (0); } +static __inline void +eli_metadata_softc(struct g_eli_softc *sc, const struct g_eli_metadata *md, + u_int sectorsize, off_t mediasize) +{ + + sc->sc_version = md->md_version; + sc->sc_inflight = 0; + sc->sc_crypto = G_ELI_CRYPTO_UNKNOWN; + sc->sc_flags = md->md_flags; + /* Backward compatibility. */ + if (md->md_version < G_ELI_VERSION_04) + sc->sc_flags |= G_ELI_FLAG_NATIVE_BYTE_ORDER; + if (md->md_version < G_ELI_VERSION_05) + sc->sc_flags |= G_ELI_FLAG_SINGLE_KEY; + if (md->md_version < G_ELI_VERSION_06 && + (sc->sc_flags & G_ELI_FLAG_AUTH) != 0) { + sc->sc_flags |= G_ELI_FLAG_FIRST_KEY; + } + if (md->md_version < G_ELI_VERSION_07) + sc->sc_flags |= G_ELI_FLAG_ENC_IVKEY; + sc->sc_ealgo = md->md_ealgo; + + if (sc->sc_flags & G_ELI_FLAG_AUTH) { + sc->sc_akeylen = sizeof(sc->sc_akey) * 8; + sc->sc_aalgo = md->md_aalgo; + sc->sc_alen = g_eli_hashlen(sc->sc_aalgo); + + sc->sc_data_per_sector = sectorsize - sc->sc_alen; + /* + * Some hash functions (like SHA1 and RIPEMD160) generates hash + * which length is not multiple of 128 bits, but we want data + * length to be multiple of 128, so we can encrypt without + * padding. The line below rounds down data length to multiple + * of 128 bits. + */ + sc->sc_data_per_sector -= sc->sc_data_per_sector % 16; + + sc->sc_bytes_per_sector = + (md->md_sectorsize - 1) / sc->sc_data_per_sector + 1; + sc->sc_bytes_per_sector *= sectorsize; + } + sc->sc_sectorsize = md->md_sectorsize; + sc->sc_mediasize = mediasize; + if (!(sc->sc_flags & G_ELI_FLAG_ONETIME)) + sc->sc_mediasize -= sectorsize; + if (!(sc->sc_flags & G_ELI_FLAG_AUTH)) + sc->sc_mediasize -= (sc->sc_mediasize % sc->sc_sectorsize); + else { + sc->sc_mediasize /= sc->sc_bytes_per_sector; + sc->sc_mediasize *= sc->sc_sectorsize; + } + sc->sc_ekeylen = md->md_keylen; +} + #ifdef _KERNEL int g_eli_read_metadata(struct g_class *mp, struct g_provider *pp, struct g_eli_metadata *md); @@ -583,8 +659,6 @@ void g_eli_config(struct gctl_req *req, void g_eli_read_done(struct bio *bp); void g_eli_write_done(struct bio *bp); int g_eli_crypto_rerun(struct cryptop *crp); -void g_eli_crypto_ivgen(struct g_eli_softc *sc, off_t offset, u_char *iv, - size_t size); void g_eli_crypto_read(struct g_eli_softc *sc, struct bio *bp, boolean_t fromworker); void g_eli_crypto_run(struct g_eli_worker *wr, struct bio *bp); @@ -592,6 +666,8 @@ void g_eli_crypto_run(struct g_eli_worke void g_eli_auth_read(struct g_eli_softc *sc, struct bio *bp); void g_eli_auth_run(struct g_eli_worker *wr, struct bio *bp); #endif +void g_eli_crypto_ivgen(struct g_eli_softc *sc, off_t offset, u_char *iv, + size_t size); void g_eli_mkey_hmac(unsigned char *mkey, const unsigned char *key); int g_eli_mkey_decrypt(const struct g_eli_metadata *md, @@ -620,6 +696,8 @@ void g_eli_crypto_hmac_final(struct hmac void g_eli_crypto_hmac(const uint8_t *hkey, size_t hkeysize, const uint8_t *data, size_t datasize, uint8_t *md, size_t mdsize); +void g_eli_key_fill(struct g_eli_softc *sc, struct g_eli_key *key, + uint64_t keyno); #ifdef _KERNEL void g_eli_key_init(struct g_eli_softc *sc); void g_eli_key_destroy(struct g_eli_softc *sc); Modified: head/sys/geom/eli/g_eli_crypto.c ============================================================================== --- head/sys/geom/eli/g_eli_crypto.c Thu Jan 7 05:34:39 2016 (r293305) +++ head/sys/geom/eli/g_eli_crypto.c Thu Jan 7 05:47:34 2016 (r293306) @@ -221,75 +221,3 @@ g_eli_crypto_decrypt(u_int algo, u_char return (g_eli_crypto_cipher(algo, 0, data, datasize, key, keysize)); } - -void -g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const uint8_t *hkey, - size_t hkeylen) -{ - u_char k_ipad[128], key[128]; - SHA512_CTX lctx; - u_int i; - - bzero(key, sizeof(key)); - if (hkeylen == 0) - ; /* do nothing */ - else if (hkeylen <= 128) - bcopy(hkey, key, hkeylen); - else { - /* If key is longer than 128 bytes reset it to key = SHA512(key). */ - SHA512_Init(&lctx); - SHA512_Update(&lctx, hkey, hkeylen); - SHA512_Final(key, &lctx); - } - - /* XOR key with ipad and opad values. */ - for (i = 0; i < sizeof(key); i++) { - k_ipad[i] = key[i] ^ 0x36; - ctx->k_opad[i] = key[i] ^ 0x5c; - } - bzero(key, sizeof(key)); - /* Perform inner SHA512. */ - SHA512_Init(&ctx->shactx); - SHA512_Update(&ctx->shactx, k_ipad, sizeof(k_ipad)); - bzero(k_ipad, sizeof(k_ipad)); -} - -void -g_eli_crypto_hmac_update(struct hmac_ctx *ctx, const uint8_t *data, - size_t datasize) -{ - - SHA512_Update(&ctx->shactx, data, datasize); -} - -void -g_eli_crypto_hmac_final(struct hmac_ctx *ctx, uint8_t *md, size_t mdsize) -{ - u_char digest[SHA512_MDLEN]; - SHA512_CTX lctx; - - SHA512_Final(digest, &ctx->shactx); - /* Perform outer SHA512. */ - SHA512_Init(&lctx); - SHA512_Update(&lctx, ctx->k_opad, sizeof(ctx->k_opad)); - bzero(ctx, sizeof(*ctx)); - SHA512_Update(&lctx, digest, sizeof(digest)); - SHA512_Final(digest, &lctx); - bzero(&lctx, sizeof(lctx)); - /* mdsize == 0 means "Give me the whole hash!" */ - if (mdsize == 0) - mdsize = SHA512_MDLEN; - bcopy(digest, md, mdsize); - bzero(digest, sizeof(digest)); -} - -void -g_eli_crypto_hmac(const uint8_t *hkey, size_t hkeysize, const uint8_t *data, - size_t datasize, uint8_t *md, size_t mdsize) -{ - struct hmac_ctx ctx; - - g_eli_crypto_hmac_init(&ctx, hkey, hkeysize); - g_eli_crypto_hmac_update(&ctx, data, datasize); - g_eli_crypto_hmac_final(&ctx, md, mdsize); -} Copied and modified: head/sys/geom/eli/g_eli_hmac.c (from r292238, head/sys/geom/eli/g_eli_crypto.c) ============================================================================== --- head/sys/geom/eli/g_eli_crypto.c Tue Dec 15 00:40:04 2015 (r292238, copy source) +++ head/sys/geom/eli/g_eli_hmac.c Thu Jan 7 05:47:34 2016 (r293306) @@ -43,185 +43,6 @@ __FBSDID("$FreeBSD$"); #endif #include -#ifdef _KERNEL -MALLOC_DECLARE(M_ELI); - -static int -g_eli_crypto_done(struct cryptop *crp) -{ - - crp->crp_opaque = (void *)crp; - wakeup(crp); - return (0); -} - -static int -g_eli_crypto_cipher(u_int algo, int enc, u_char *data, size_t datasize, - const u_char *key, size_t keysize) -{ - struct cryptoini cri; - struct cryptop *crp; - struct cryptodesc *crd; - uint64_t sid; - u_char *p; - int error; - - KASSERT(algo != CRYPTO_AES_XTS, - ("%s: CRYPTO_AES_XTS unexpected here", __func__)); - - bzero(&cri, sizeof(cri)); - cri.cri_alg = algo; - cri.cri_key = __DECONST(void *, key); - cri.cri_klen = keysize; - error = crypto_newsession(&sid, &cri, CRYPTOCAP_F_SOFTWARE); - if (error != 0) - return (error); - p = malloc(sizeof(*crp) + sizeof(*crd), M_ELI, M_NOWAIT | M_ZERO); - if (p == NULL) { - crypto_freesession(sid); - return (ENOMEM); - } - crp = (struct cryptop *)p; p += sizeof(*crp); - crd = (struct cryptodesc *)p; p += sizeof(*crd); - - crd->crd_skip = 0; - crd->crd_len = datasize; - crd->crd_flags = CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; - if (enc) - crd->crd_flags |= CRD_F_ENCRYPT; - crd->crd_alg = algo; - crd->crd_key = __DECONST(void *, key); - crd->crd_klen = keysize; - bzero(crd->crd_iv, sizeof(crd->crd_iv)); - crd->crd_next = NULL; - - crp->crp_sid = sid; - crp->crp_ilen = datasize; - crp->crp_olen = datasize; - crp->crp_opaque = NULL; - crp->crp_callback = g_eli_crypto_done; - crp->crp_buf = (void *)data; - crp->crp_flags = CRYPTO_F_CBIFSYNC; - crp->crp_desc = crd; - - error = crypto_dispatch(crp); - if (error == 0) { - while (crp->crp_opaque == NULL) - tsleep(crp, PRIBIO, "geli", hz / 5); - error = crp->crp_etype; - } - - free(crp, M_ELI); - crypto_freesession(sid); - return (error); -} -#else /* !_KERNEL */ -static int -g_eli_crypto_cipher(u_int algo, int enc, u_char *data, size_t datasize, - const u_char *key, size_t keysize) -{ - EVP_CIPHER_CTX ctx; - const EVP_CIPHER *type; - u_char iv[keysize]; - int outsize; - - assert(algo != CRYPTO_AES_XTS); - - switch (algo) { - case CRYPTO_NULL_CBC: - type = EVP_enc_null(); - break; - case CRYPTO_AES_CBC: - switch (keysize) { - case 128: - type = EVP_aes_128_cbc(); - break; - case 192: - type = EVP_aes_192_cbc(); - break; - case 256: - type = EVP_aes_256_cbc(); - break; - default: - return (EINVAL); - } - break; - case CRYPTO_BLF_CBC: - type = EVP_bf_cbc(); - break; -#ifndef OPENSSL_NO_CAMELLIA - case CRYPTO_CAMELLIA_CBC: - switch (keysize) { - case 128: - type = EVP_camellia_128_cbc(); - break; - case 192: - type = EVP_camellia_192_cbc(); - break; - case 256: - type = EVP_camellia_256_cbc(); - break; - default: - return (EINVAL); - } - break; -#endif - case CRYPTO_3DES_CBC: - type = EVP_des_ede3_cbc(); - break; - default: - return (EINVAL); - } - - EVP_CIPHER_CTX_init(&ctx); - - EVP_CipherInit_ex(&ctx, type, NULL, NULL, NULL, enc); - EVP_CIPHER_CTX_set_key_length(&ctx, keysize / 8); - EVP_CIPHER_CTX_set_padding(&ctx, 0); - bzero(iv, sizeof(iv)); - EVP_CipherInit_ex(&ctx, NULL, NULL, key, iv, enc); - - if (EVP_CipherUpdate(&ctx, data, &outsize, data, datasize) == 0) { - EVP_CIPHER_CTX_cleanup(&ctx); - return (EINVAL); - } - assert(outsize == (int)datasize); - - if (EVP_CipherFinal_ex(&ctx, data + outsize, &outsize) == 0) { - EVP_CIPHER_CTX_cleanup(&ctx); - return (EINVAL); - } - assert(outsize == 0); - - EVP_CIPHER_CTX_cleanup(&ctx); - return (0); -} -#endif /* !_KERNEL */ - -int -g_eli_crypto_encrypt(u_int algo, u_char *data, size_t datasize, - const u_char *key, size_t keysize) -{ - - /* We prefer AES-CBC for metadata protection. */ - if (algo == CRYPTO_AES_XTS) - algo = CRYPTO_AES_CBC; - - return (g_eli_crypto_cipher(algo, 1, data, datasize, key, keysize)); -} - -int -g_eli_crypto_decrypt(u_int algo, u_char *data, size_t datasize, - const u_char *key, size_t keysize) -{ - - /* We prefer AES-CBC for metadata protection. */ - if (algo == CRYPTO_AES_XTS) - algo = CRYPTO_AES_CBC; - - return (g_eli_crypto_cipher(algo, 0, data, datasize, key, keysize)); -} - void g_eli_crypto_hmac_init(struct hmac_ctx *ctx, const uint8_t *hkey, size_t hkeylen) @@ -293,3 +114,37 @@ g_eli_crypto_hmac(const uint8_t *hkey, s g_eli_crypto_hmac_update(&ctx, data, datasize); g_eli_crypto_hmac_final(&ctx, md, mdsize); } + +/* + * Here we generate IV. It is unique for every sector. + */ +void +g_eli_crypto_ivgen(struct g_eli_softc *sc, off_t offset, u_char *iv, + size_t size) +{ + uint8_t off[8]; + + if ((sc->sc_flags & G_ELI_FLAG_NATIVE_BYTE_ORDER) != 0) + bcopy(&offset, off, sizeof(off)); + else + le64enc(off, (uint64_t)offset); + + switch (sc->sc_ealgo) { + case CRYPTO_AES_XTS: + bcopy(off, iv, sizeof(off)); + bzero(iv + sizeof(off), size - sizeof(off)); + break; + default: + { + u_char hash[SHA256_DIGEST_LENGTH]; + SHA256_CTX ctx; + + /* Copy precalculated SHA256 context for IV-Key. */ + bcopy(&sc->sc_ivctx, &ctx, sizeof(ctx)); + SHA256_Update(&ctx, off, sizeof(off)); + SHA256_Final(hash, &ctx); + bcopy(hash, iv, MIN(sizeof(hash), size)); + break; + } + } +} Modified: head/sys/geom/eli/g_eli_key_cache.c ============================================================================== --- head/sys/geom/eli/g_eli_key_cache.c Thu Jan 7 05:34:39 2016 (r293305) +++ head/sys/geom/eli/g_eli_key_cache.c Thu Jan 7 05:47:34 2016 (r293306) @@ -28,17 +28,20 @@ __FBSDID("$FreeBSD$"); #include +#ifdef _KERNEL #include #include -#include #include #include +#endif /* _KERNEL */ +#include #include #include #include +#ifdef _KERNEL MALLOC_DECLARE(M_ELI); SYSCTL_DECL(_kern_geom_eli); @@ -56,22 +59,7 @@ static uint64_t g_eli_key_cache_misses; SYSCTL_UQUAD(_kern_geom_eli, OID_AUTO, key_cache_misses, CTLFLAG_RW, &g_eli_key_cache_misses, 0, "Key cache misses"); -#define G_ELI_KEY_MAGIC 0xe11341c - -struct g_eli_key { - /* Key value, must be first in the structure. */ - uint8_t gek_key[G_ELI_DATAKEYLEN]; - /* Magic. */ - int gek_magic; - /* Key number. */ - uint64_t gek_keyno; - /* Reference counter. */ - int gek_count; - /* Keeps keys sorted by most recent use. */ - TAILQ_ENTRY(g_eli_key) gek_next; - /* Keeps keys sorted by number. */ - RB_ENTRY(g_eli_key) gek_link; -}; +#endif /* _KERNEL */ static int g_eli_key_cmp(const struct g_eli_key *a, const struct g_eli_key *b) @@ -84,10 +72,7 @@ g_eli_key_cmp(const struct g_eli_key *a, return (0); } -RB_PROTOTYPE(g_eli_key_tree, g_eli_key, gek_link, g_eli_key_cmp); -RB_GENERATE(g_eli_key_tree, g_eli_key, gek_link, g_eli_key_cmp); - -static void +void g_eli_key_fill(struct g_eli_softc *sc, struct g_eli_key *key, uint64_t keyno) { const uint8_t *ekey; @@ -110,6 +95,10 @@ g_eli_key_fill(struct g_eli_softc *sc, s key->gek_magic = G_ELI_KEY_MAGIC; } +#ifdef _KERNEL +RB_PROTOTYPE(g_eli_key_tree, g_eli_key, gek_link, g_eli_key_cmp); +RB_GENERATE(g_eli_key_tree, g_eli_key, gek_link, g_eli_key_cmp); + static struct g_eli_key * g_eli_key_allocate(struct g_eli_softc *sc, uint64_t keyno) { @@ -350,3 +339,4 @@ g_eli_key_drop(struct g_eli_softc *sc, u } mtx_unlock(&sc->sc_ekeys_lock); } +#endif /* _KERNEL */ Modified: head/sys/geom/eli/pkcs5v2.c ============================================================================== --- head/sys/geom/eli/pkcs5v2.c Thu Jan 7 05:34:39 2016 (r293305) +++ head/sys/geom/eli/pkcs5v2.c Thu Jan 7 05:47:34 2016 (r293306) @@ -83,6 +83,7 @@ pkcs5v2_genkey(uint8_t *key, unsigned ke } #ifndef _KERNEL +#ifndef _STAND /* * Return the number of microseconds needed for 'interations' iterations. */ @@ -120,4 +121,5 @@ pkcs5v2_calculate(int usecs) } return (((intmax_t)iterations * (intmax_t)usecs) / v); } +#endif /* !_STAND */ #endif /* !_KERNEL */ Modified: head/sys/modules/geom/geom_eli/Makefile ============================================================================== --- head/sys/modules/geom/geom_eli/Makefile Thu Jan 7 05:34:39 2016 (r293305) +++ head/sys/modules/geom/geom_eli/Makefile Thu Jan 7 05:47:34 2016 (r293306) @@ -6,6 +6,7 @@ KMOD= geom_eli SRCS= g_eli.c SRCS+= g_eli_crypto.c SRCS+= g_eli_ctl.c +SRCS+= g_eli_hmac.c SRCS+= g_eli_integrity.c SRCS+= g_eli_key.c SRCS+= g_eli_key_cache.c From owner-svn-src-head@freebsd.org Thu Jan 7 08:07:19 2016 Return-Path: Delivered-To: svn-src-head@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 2B491A66A75; Thu, 7 Jan 2016 08:07:19 +0000 (UTC) (envelope-from melifaro@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 DD86F1B37; Thu, 7 Jan 2016 08:07:18 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0787IrV003411; Thu, 7 Jan 2016 08:07:18 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0787H7I003407; Thu, 7 Jan 2016 08:07:17 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601070807.u0787H7I003407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 7 Jan 2016 08:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293309 - in head/sys/dev: cxgb/ulp/iw_cxgb cxgb/ulp/tom cxgbe/iw_cxgbe cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 08:07:19 -0000 Author: melifaro Date: Thu Jan 7 08:07:17 2016 New Revision: 293309 URL: https://svnweb.freebsd.org/changeset/base/293309 Log: Convert cxgb/cxgbe to the new routing API. Discussed with: np Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c head/sys/dev/cxgb/ulp/tom/cxgb_listen.c head/sys/dev/cxgbe/iw_cxgbe/cm.c head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Thu Jan 7 08:06:43 2016 (r293308) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Thu Jan 7 08:07:17 2016 (r293309) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -264,20 +265,14 @@ void __free_ep(struct iwch_ep_common *ep free(epc, M_DEVBUF); } -static struct rtentry * +static int find_route(__be32 local_ip, __be32 peer_ip, __be16 local_port, - __be16 peer_port, u8 tos) + __be16 peer_port, u8 tos, struct nhop4_extended *pnh4) { - struct route iproute; - struct sockaddr_in *dst = (struct sockaddr_in *)&iproute.ro_dst; - - bzero(&iproute, sizeof iproute); - dst->sin_family = AF_INET; - dst->sin_len = sizeof *dst; - dst->sin_addr.s_addr = peer_ip; - - rtalloc(&iproute); - return iproute.ro_rt; + struct in_addr addr; + + addr.s_addr = peer_ip; + return (fib4_lookup_nh_ext(RT_DEFAULT_FIB, addr, NHR_REF, 0, pnh4)); } static void @@ -1293,7 +1288,7 @@ iwch_connect(struct iw_cm_id *cm_id, str int err = 0; struct iwch_dev *h = to_iwch_dev(cm_id->device); struct iwch_ep *ep; - struct rtentry *rt; + struct nhop4_extended nh4; struct toedev *tdev; if (is_loopback_dst(cm_id)) { @@ -1329,28 +1324,28 @@ iwch_connect(struct iw_cm_id *cm_id, str goto fail2; /* find a route */ - rt = find_route(cm_id->local_addr.sin_addr.s_addr, + err = find_route(cm_id->local_addr.sin_addr.s_addr, cm_id->remote_addr.sin_addr.s_addr, cm_id->local_addr.sin_port, - cm_id->remote_addr.sin_port, IPTOS_LOWDELAY); - if (!rt) { + cm_id->remote_addr.sin_port, IPTOS_LOWDELAY, &nh4); + if (err) { printf("%s - cannot find route.\n", __FUNCTION__); err = EHOSTUNREACH; goto fail2; } - if (!(rt->rt_ifp->if_flags & IFCAP_TOE)) { + if (!(nh4.nh_ifp->if_flags & IFCAP_TOE)) { printf("%s - interface not TOE capable.\n", __FUNCTION__); - RTFREE(rt); + fib4_free_nh_ext(RT_DEFAULT_FIB, &nh4); goto fail2; } - tdev = TOEDEV(rt->rt_ifp); + tdev = TOEDEV(nh4.nh_ifp); if (tdev == NULL) { printf("%s - No toedev for interface.\n", __FUNCTION__); - RTFREE(rt); + fib4_free_nh_ext(RT_DEFAULT_FIB, &nh4); goto fail2; } - RTFREE(rt); + fib4_free_nh_ext(RT_DEFAULT_FIB, &nh4); state_set(&ep->com, CONNECTING); ep->com.local_addr = cm_id->local_addr; Modified: head/sys/dev/cxgb/ulp/tom/cxgb_listen.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_listen.c Thu Jan 7 08:06:43 2016 (r293308) +++ head/sys/dev/cxgb/ulp/tom/cxgb_listen.c Thu Jan 7 08:07:17 2016 (r293309) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -480,8 +481,8 @@ do_pass_accept_req(struct sge_qset *qs, unsigned int tid = GET_TID(req); struct listen_ctx *lctx = lookup_stid(&td->tid_maps, stid); struct l2t_entry *e = NULL; + struct nhop4_basic nh4; struct sockaddr_in nam; - struct rtentry *rt; struct inpcb *inp; struct socket *so; struct port_info *pi; @@ -525,18 +526,12 @@ do_pass_accept_req(struct sge_qset *qs, nam.sin_len = sizeof(nam); nam.sin_family = AF_INET; nam.sin_addr = inc.inc_faddr; - rt = rtalloc1((struct sockaddr *)&nam, 0, 0); - if (rt == NULL) + if (fib4_lookup_nh_basic(RT_DEFAULT_FIB, nam.sin_addr, 0, 0, &nh4) != 0) REJECT_PASS_ACCEPT(); else { - struct sockaddr *nexthop; - - RT_UNLOCK(rt); - nexthop = rt->rt_flags & RTF_GATEWAY ? rt->rt_gateway : - (struct sockaddr *)&nam; - if (rt->rt_ifp == ifp) - e = t3_l2t_get(pi, rt->rt_ifp, nexthop); - RTFREE(rt); + nam.sin_addr = nh4.nh_addr; + if (nh4.nh_ifp == ifp) + e = t3_l2t_get(pi, ifp, (struct sockaddr *)&nam); if (e == NULL) REJECT_PASS_ACCEPT(); /* no l2te, or ifp mismatch */ } Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Thu Jan 7 08:06:43 2016 (r293308) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Thu Jan 7 08:07:17 2016 (r293309) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -86,8 +87,8 @@ static void __state_set(struct c4iw_ep_c static void state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state tostate); static void *alloc_ep(int size, gfp_t flags); void __free_ep(struct c4iw_ep_common *epc); -static struct rtentry * find_route(__be32 local_ip, __be32 peer_ip, __be16 local_port, - __be16 peer_port, u8 tos); +static int find_route(__be32 local_ip, __be32 peer_ip, __be16 local_port, + __be16 peer_port, u8 tos, struct nhop4_extended *pnh4); static int close_socket(struct c4iw_ep_common *epc, int close); static int shutdown_socket(struct c4iw_ep_common *epc); static void abort_socket(struct c4iw_ep *ep); @@ -201,23 +202,21 @@ done: } -static struct rtentry * +static int find_route(__be32 local_ip, __be32 peer_ip, __be16 local_port, - __be16 peer_port, u8 tos) + __be16 peer_port, u8 tos, struct nhop4_extended *pnh4) { - struct route iproute; - struct sockaddr_in *dst = (struct sockaddr_in *)&iproute.ro_dst; + struct in_addr addr; + int err; CTR5(KTR_IW_CXGBE, "%s:frtB %x, %x, %d, %d", __func__, local_ip, peer_ip, ntohs(local_port), ntohs(peer_port)); - bzero(&iproute, sizeof iproute); - dst->sin_family = AF_INET; - dst->sin_len = sizeof *dst; - dst->sin_addr.s_addr = peer_ip; - - rtalloc(&iproute); - CTR2(KTR_IW_CXGBE, "%s:frtE %p", __func__, (uint64_t)iproute.ro_rt); - return iproute.ro_rt; + + addr.s_addr = peer_ip; + err = fib4_lookup_nh_ext(RT_DEFAULT_FIB, addr, NHR_REF, 0, pnh4); + + CTR2(KTR_IW_CXGBE, "%s:frtE %d", __func__, err); + return err; } static int @@ -2012,7 +2011,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, int err = 0; struct c4iw_dev *dev = to_c4iw_dev(cm_id->device); struct c4iw_ep *ep = NULL; - struct rtentry *rt; + struct nhop4_extended nh4; struct toedev *tdev; CTR2(KTR_IW_CXGBE, "%s:ccB %p", __func__, cm_id); @@ -2068,13 +2067,13 @@ int c4iw_connect(struct iw_cm_id *cm_id, init_sock(&ep->com); /* find a route */ - rt = find_route( + err = find_route( cm_id->local_addr.sin_addr.s_addr, cm_id->remote_addr.sin_addr.s_addr, cm_id->local_addr.sin_port, - cm_id->remote_addr.sin_port, 0); + cm_id->remote_addr.sin_port, 0, &nh4); - if (!rt) { + if (err) { CTR2(KTR_IW_CXGBE, "%s:cc7 %p", __func__, ep); printk(KERN_ERR MOD "%s - cannot find route.\n", __func__); @@ -2082,7 +2081,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, goto fail2; } - if (!(rt->rt_ifp->if_capenable & IFCAP_TOE)) { + if (!(nh4.nh_ifp->if_capenable & IFCAP_TOE)) { CTR2(KTR_IW_CXGBE, "%s:cc8 %p", __func__, ep); printf("%s - interface not TOE capable.\n", __func__); @@ -2090,7 +2089,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, err = -ENOPROTOOPT; goto fail3; } - tdev = TOEDEV(rt->rt_ifp); + tdev = TOEDEV(nh4.nh_ifp); if (tdev == NULL) { @@ -2098,7 +2097,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, printf("%s - No toedev for interface.\n", __func__); goto fail3; } - RTFREE(rt); + fib4_free_nh_ext(RT_DEFAULT_FIB, &nh4); state_set(&ep->com, CONNECTING); ep->tos = 0; @@ -2117,7 +2116,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, fail3: CTR2(KTR_IW_CXGBE, "%s:ccb %p", __func__, ep); - RTFREE(rt); + fib4_free_nh_ext(RT_DEFAULT_FIB, &nh4); fail2: cm_id->rem_ref(cm_id); c4iw_put_ep(&ep->com); Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Thu Jan 7 08:06:43 2016 (r293308) +++ head/sys/dev/cxgbe/tom/t4_listen.c Thu Jan 7 08:07:17 2016 (r293309) @@ -49,9 +49,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include #include @@ -1095,46 +1097,44 @@ static struct l2t_entry * get_l2te_for_nexthop(struct port_info *pi, struct ifnet *ifp, struct in_conninfo *inc) { - struct rtentry *rt; struct l2t_entry *e; struct sockaddr_in6 sin6; struct sockaddr *dst = (void *)&sin6; if (inc->inc_flags & INC_ISIPV6) { + struct nhop6_basic nh6; + + bzero(dst, sizeof(struct sockaddr_in6)); dst->sa_len = sizeof(struct sockaddr_in6); dst->sa_family = AF_INET6; - ((struct sockaddr_in6 *)dst)->sin6_addr = inc->inc6_faddr; if (IN6_IS_ADDR_LINKLOCAL(&inc->inc6_laddr)) { /* no need for route lookup */ e = t4_l2t_get(pi, ifp, dst); return (e); } + + if (fib6_lookup_nh_basic(RT_DEFAULT_FIB, &inc->inc6_faddr, + 0, 0, 0, &nh6) != 0) + return (NULL); + if (nh6.nh_ifp != ifp) + return (NULL); + ((struct sockaddr_in6 *)dst)->sin6_addr = nh6.nh_addr; } else { + struct nhop4_basic nh4; + dst->sa_len = sizeof(struct sockaddr_in); dst->sa_family = AF_INET; - ((struct sockaddr_in *)dst)->sin_addr = inc->inc_faddr; - } - rt = rtalloc1(dst, 0, 0); - if (rt == NULL) - return (NULL); - else { - struct sockaddr *nexthop; - - RT_UNLOCK(rt); - if (rt->rt_ifp != ifp) - e = NULL; - else { - if (rt->rt_flags & RTF_GATEWAY) - nexthop = rt->rt_gateway; - else - nexthop = dst; - e = t4_l2t_get(pi, ifp, nexthop); - } - RTFREE(rt); + if (fib4_lookup_nh_basic(RT_DEFAULT_FIB, inc->inc_faddr, 0, 0, + &nh4) != 0) + return (NULL); + if (nh4.nh_ifp != ifp) + return (NULL); + ((struct sockaddr_in *)dst)->sin_addr = nh4.nh_addr; } + e = t4_l2t_get(pi, ifp, dst); return (e); } From owner-svn-src-head@freebsd.org Thu Jan 7 09:24:34 2016 Return-Path: Delivered-To: svn-src-head@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 9F86CA65B16; Thu, 7 Jan 2016 09:24:34 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv158.fwdcdn.com (frv158.fwdcdn.com [212.42.77.158]) (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 6296E1E56; Thu, 7 Jan 2016 09:24:34 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=mv9ztdeWCPLuAFidRQUD7lWJSY3vAUxL6XguTKJoIe8=; b=gt5OvezXZTJlb1zSKILe6iB6IguV2RYgYr8cG/XciryC/dNU79wuKvgyYMPONUtrnazBSc/CPIFAK9OP/Z3TFzTi9MKMn94g1AkvrY75/HZttTUqsBbrWtaj7WzIo978aFMt2dEJSpHGOZRzzciVn4ptiSs6GfseIMcLBwQkZOc=; Received: from [178.137.139.189] (helo=nonamehost.local) by frv158.fwdcdn.com with esmtpsa ID 1aH6o1-000LZL-Sn ; Thu, 07 Jan 2016 11:24:29 +0200 Date: Thu, 7 Jan 2016 11:24:24 +0200 From: Ivan Klymenko To: NGie Cooper Cc: Gleb Smirnoff , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r293284 - in head/sys: dev/cxgb/ulp/tom dev/cxgbe/tom netinet Message-ID: <20160107112424.701146a9@nonamehost.local> In-Reply-To: References: <201601070014.u070EgW1059880@repo.freebsd.org> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=178.137.139.189; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 09:24:34 -0000 On Wed, 6 Jan 2016 18:20:50 -0800 NGie Cooper wrote: > On Wed, Jan 6, 2016 at 4:14 PM, Gleb Smirnoff > wrote: > > Author: glebius > > Date: Thu Jan 7 00:14:42 2016 > > New Revision: 293284 > > URL: https://svnweb.freebsd.org/changeset/base/293284 > > > > Log: > > Historically we have two fields in tcpcb to describe sender MSS: > > t_maxopd, and t_maxseg. This dualism emerged with T/TCP, but was > > not properly cleaned up after T/TCP removal. After all permutations > > over the years the result is that t_maxopd stores a minimum of peer > > offered MSS and MTU reduced by minimum protocol header. And > > t_maxseg stores (t_maxopd - TCPOLEN_TSTAMP_APPA) if timestamps are > > in action, or is equal to t_maxopd otherwise. That's a very rough > > estimate of MSS reduced by options length. Throughout the code it > > was used in places, where preciseness was not important, like cwnd > > or ssthresh calculations. > > > > With this change: > > > > - t_maxopd goes away. > > - t_maxseg now stores MSS not adjusted by options. > > - new function tcp_maxseg() is provided, that calculates MSS > > reduced by options length. The functions gives a better estimate, > > since it takes into account SACK state as well. > > > > Reviewed by: jtl > > Differential Revision: https://reviews.freebsd.org/D3593 > > This broke the build. > > From https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/2053/ : > > /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:481:6: > error: no member named 't_maxopd' in 'struct tcpcb' > --- all_subdir_sound --- > --- all_subdir_sb8 --- > ===> sound/driver/sb8 (all) > --- all_subdir_tcp/fastpath --- > if (DELAY_ACK(tp, tlen)) { > ^ ~~ > /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:167:19: > note: expanded from macro 'DELAY_ACK' > (tlen <= tp->t_maxopd) > && \ ^ > /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:606:8: > error: no member named 't_maxopd' in 'struct tcpcb' > if (DELAY_ACK(tp, tlen) && tlen != 0) > ^ ~~ > /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:167:19: > note: expanded from macro 'DELAY_ACK' > (tlen <= tp->t_maxopd) > && \ ^ > --- all_subdir_sound --- > --- all_subdir_sb16 --- > ctfconvert -L VERSION -g sb16.o > --- all_subdir_tcp/fastpath --- > /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:1545:8: > error: no member named 't_maxopd' in 'struct tcpcb' > if (DELAY_ACK(tp, tlen)) > ^ ~~ > /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:167:19: > note: expanded from macro 'DELAY_ACK' > (tlen <= tp->t_maxopd) > && \ ^ > 3 errors generated. > *** [fastpath.o] Error code 1 amd64 also ... --- dragon_saver.o --- /usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 --sysroot=/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin -O2 -pipe -march=native -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include /media/da0s1/obj/usr/src/sys/mk11/opt_global.h -I. -I/usr/src/sys -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/media/da0s1/obj/usr/src/sys/mk11 -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-v alue -fvectorize -fslp-vectorize -fblocks -fcolor-diagnostics -mno-aes -mno-avx -std=iso9899:1999 -c /usr/src/sys/modules/syscons/dragon/../../../dev/syscons/dragon/dragon_saver.c -o dragon_saver.o --- all_subdir_tcp/fastpath --- /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:481:6: error: no member named 't_maxopd' in 'struct tcpcb' if (DELAY_ACK(tp, tlen)) { ^ ~~ /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:167:19: note: expanded from macro 'DELAY_ACK' (tlen <= tp->t_maxopd) && \ ^ /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:606:8: error: no member named 't_maxopd' in 'struct tcpcb' if (DELAY_ACK(tp, tlen) && tlen != 0) ^ ~~ /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:167:19: note: expanded from macro 'DELAY_ACK' (tlen <= tp->t_maxopd) && \ ^ /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:1545:8: error: no member named 't_maxopd' in 'struct tcpcb' if (DELAY_ACK(tp, tlen)) ^ ~~ /usr/src/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:167:19: note: expanded from macro 'DELAY_ACK' (tlen <= tp->t_maxopd) && \ ^ 3 errors generated. *** [fastpath.o] Error code 1 make[4]: stopped in /usr/src/sys/modules/tcp/fastpath 1 error make[4]: stopped in /usr/src/sys/modules/tcp/fastpath *** [all_subdir_tcp/fastpath] Error code 2 make[3]: stopped in /usr/src/sys/modules --- all_subdir_sound --- A failure has been detected in another branch of the parallel make make[6]: stopped in /usr/src/sys/modules/sound/driver/ich *** [all_subdir_ich] Error code 2 make[5]: stopped in /usr/src/sys/modules/sound/driver 1 error make[5]: stopped in /usr/src/sys/modules/sound/driver *** [all_subdir_driver] Error code 2 make[4]: stopped in /usr/src/sys/modules/sound 1 error make[4]: stopped in /usr/src/sys/modules/sound *** [all_subdir_sound] Error code 2 make[3]: stopped in /usr/src/sys/modules --- all_subdir_syscons --- A failure has been detected in another branch of the parallel make make[5]: stopped in /usr/src/sys/modules/syscons/dragon *** [all_subdir_dragon] Error code 2 make[4]: stopped in /usr/src/sys/modules/syscons 1 error make[4]: stopped in /usr/src/sys/modules/syscons *** [all_subdir_syscons] Error code 2 make[3]: stopped in /usr/src/sys/modules --- all_subdir_sysvipc --- A failure has been detected in another branch of the parallel make make[5]: stopped in /usr/src/sys/modules/sysvipc/sysvshm *** [all_subdir_sysvshm] Error code 2 make[4]: stopped in /usr/src/sys/modules/sysvipc 1 error make[4]: stopped in /usr/src/sys/modules/sysvipc *** [all_subdir_sysvipc] Error code 2 make[3]: stopped in /usr/src/sys/modules 4 errors make[3]: stopped in /usr/src/sys/modules *** [modules-all] Error code 2 make[2]: stopped in /media/da0s1/obj/usr/src/sys/mk11 1 error make[2]: stopped in /media/da0s1/obj/usr/src/sys/mk11 *** [buildkernel] Error code 2 make[1]: stopped in /usr/src 1 error make[1]: stopped in /usr/src *** [buildkernel] Error code 2 make: stopped in /usr/src 1 error make: stopped in /usr/src From owner-svn-src-head@freebsd.org Thu Jan 7 09:31:03 2016 Return-Path: Delivered-To: svn-src-head@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 8D6E1A65EA4; Thu, 7 Jan 2016 09:31:03 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BDAF11A7; Thu, 7 Jan 2016 09:31:02 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from chd.heemeyer.club ([78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id u079Uwf8021635 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Jan 2016 09:31:00 GMT (envelope-from dchagin@chd.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host [78.107.232.239] claimed to be chd.heemeyer.club Received: from chd.heemeyer.club (localhost [127.0.0.1]) by chd.heemeyer.club (8.15.2/8.15.1) with ESMTPS id u079Uwrf045664 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 7 Jan 2016 12:30:58 +0300 (MSK) (envelope-from dchagin@chd.heemeyer.club) Received: (from dchagin@localhost) by chd.heemeyer.club (8.15.2/8.15.1/Submit) id u079Uvfa045658; Thu, 7 Jan 2016 12:30:57 +0300 (MSK) (envelope-from dchagin) Date: Thu, 7 Jan 2016 12:30:57 +0300 From: Chagin Dmitry To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281829 - in head/sys: compat/linux kern sys Message-ID: <20160107093057.GA40473@chd.heemeyer.club> References: <201504211355.t3LDtOen059543@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201504211355.t3LDtOen059543@svn.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 09:31:03 -0000 On Tue, Apr 21, 2015 at 01:55:24PM +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Tue Apr 21 13:55:24 2015 > New Revision: 281829 > URL: https://svnweb.freebsd.org/changeset/base/281829 > > Log: > Modify kern___getcwd() to take max pathlen limit as an additional > argument. This will be used for the Linux emulation layer - for Linux, > PATH_MAX is 4096 and not 1024. > > Differential Revision: https://reviews.freebsd.org/D2335 > Reviewed by: kib@ > MFC after: 1 month > Sponsored by: The FreeBSD Foundation hi, do you plan to merge it some time? > > Modified: > head/sys/compat/linux/linux_getcwd.c > head/sys/compat/linux/linux_misc.h > head/sys/kern/vfs_cache.c > head/sys/sys/syscallsubr.h > > Modified: head/sys/compat/linux/linux_getcwd.c > ============================================================================== > --- head/sys/compat/linux/linux_getcwd.c Tue Apr 21 11:50:31 2015 (r281828) > +++ head/sys/compat/linux/linux_getcwd.c Tue Apr 21 13:55:24 2015 (r281829) > @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #endif > +#include > #include > > #include > @@ -423,14 +424,14 @@ linux_getcwd(struct thread *td, struct l > > len = args->bufsize; > > - if (len > MAXPATHLEN*4) > - len = MAXPATHLEN*4; > + if (len > LINUX_PATH_MAX) > + len = LINUX_PATH_MAX; > else if (len < 2) > return ERANGE; > > path = malloc(len, M_TEMP, M_WAITOK); > > - error = kern___getcwd(td, path, UIO_SYSSPACE, len); > + error = kern___getcwd(td, path, UIO_SYSSPACE, len, LINUX_PATH_MAX); > if (!error) { > lenused = strlen(path) + 1; > if (lenused <= args->bufsize) { > > Modified: head/sys/compat/linux/linux_misc.h > ============================================================================== > --- head/sys/compat/linux/linux_misc.h Tue Apr 21 11:50:31 2015 (r281828) > +++ head/sys/compat/linux/linux_misc.h Tue Apr 21 13:55:24 2015 (r281829) > @@ -55,6 +55,8 @@ > #define LINUX_MREMAP_MAYMOVE 1 > #define LINUX_MREMAP_FIXED 2 > > +#define LINUX_PATH_MAX 4096 > + > extern const char *linux_platform; > > /* > > Modified: head/sys/kern/vfs_cache.c > ============================================================================== > --- head/sys/kern/vfs_cache.c Tue Apr 21 11:50:31 2015 (r281828) > +++ head/sys/kern/vfs_cache.c Tue Apr 21 13:55:24 2015 (r281829) > @@ -1053,11 +1053,13 @@ sys___getcwd(td, uap) > struct __getcwd_args *uap; > { > > - return (kern___getcwd(td, uap->buf, UIO_USERSPACE, uap->buflen)); > + return (kern___getcwd(td, uap->buf, UIO_USERSPACE, uap->buflen, > + MAXPATHLEN)); > } > > int > -kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg, u_int buflen) > +kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg, u_int buflen, > + u_int path_max) > { > char *bp, *tmpbuf; > struct filedesc *fdp; > @@ -1068,8 +1070,8 @@ kern___getcwd(struct thread *td, char *b > return (ENODEV); > if (buflen < 2) > return (EINVAL); > - if (buflen > MAXPATHLEN) > - buflen = MAXPATHLEN; > + if (buflen > path_max) > + buflen = path_max; > > tmpbuf = malloc(buflen, M_TEMP, M_WAITOK); > fdp = td->td_proc->p_fd; > > Modified: head/sys/sys/syscallsubr.h > ============================================================================== > --- head/sys/sys/syscallsubr.h Tue Apr 21 11:50:31 2015 (r281828) > +++ head/sys/sys/syscallsubr.h Tue Apr 21 13:55:24 2015 (r281829) > @@ -58,7 +58,7 @@ struct thr_param; > struct __wrusage; > > int kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg, > - u_int buflen); > + u_int buflen, u_int path_max); > int kern_accept(struct thread *td, int s, struct sockaddr **name, > socklen_t *namelen, struct file **fp); > int kern_accept4(struct thread *td, int s, struct sockaddr **name, -- Have fun! chd From owner-svn-src-head@freebsd.org Thu Jan 7 09:40:21 2016 Return-Path: Delivered-To: svn-src-head@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 3EB06A66313; Thu, 7 Jan 2016 09:40:21 +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 E815D19A3; Thu, 7 Jan 2016 09:40: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 u079eKr8029641; Thu, 7 Jan 2016 09:40:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u079eKXk029640; Thu, 7 Jan 2016 09:40:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601070940.u079eKXk029640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Jan 2016 09:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293310 - head/sys/ofed/include/rdma X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 09:40:21 -0000 Author: hselasky Date: Thu Jan 7 09:40:19 2016 New Revision: 293310 URL: https://svnweb.freebsd.org/changeset/base/293310 Log: Remove unused file. Deleted: head/sys/ofed/include/rdma/Kbuild From owner-svn-src-head@freebsd.org Thu Jan 7 10:20:05 2016 Return-Path: Delivered-To: svn-src-head@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 04F14A651D4; Thu, 7 Jan 2016 10:20:05 +0000 (UTC) (envelope-from melifaro@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 BA0741959; Thu, 7 Jan 2016 10:20:04 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07AK3kn042055; Thu, 7 Jan 2016 10:20:03 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07AK3L1042054; Thu, 7 Jan 2016 10:20:03 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601071020.u07AK3L1042054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 7 Jan 2016 10:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293311 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 10:20:05 -0000 Author: melifaro Date: Thu Jan 7 10:20:03 2016 New Revision: 293311 URL: https://svnweb.freebsd.org/changeset/base/293311 Log: Convert pf(4) to the new routing API. Differential Revision: https://reviews.freebsd.org/D4763 Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Thu Jan 7 09:40:19 2016 (r293310) +++ head/sys/netpfil/pf/pf.c Thu Jan 7 10:20:03 2016 (r293311) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -94,6 +95,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #endif /* INET6 */ #include @@ -2985,49 +2988,35 @@ static u_int16_t pf_calc_mss(struct pf_addr *addr, sa_family_t af, int rtableid, u_int16_t offer) { #ifdef INET - struct sockaddr_in *dst; - struct route ro; + struct nhop4_basic nh4; #endif /* INET */ #ifdef INET6 - struct sockaddr_in6 *dst6; - struct route_in6 ro6; + struct nhop6_basic nh6; + struct in6_addr dst6; + uint32_t scopeid; #endif /* INET6 */ - struct rtentry *rt = NULL; int hlen = 0; - u_int16_t mss = V_tcp_mssdflt; + uint16_t mss = 0; switch (af) { #ifdef INET case AF_INET: hlen = sizeof(struct ip); - bzero(&ro, sizeof(ro)); - dst = (struct sockaddr_in *)&ro.ro_dst; - dst->sin_family = AF_INET; - dst->sin_len = sizeof(*dst); - dst->sin_addr = addr->v4; - in_rtalloc_ign(&ro, 0, rtableid); - rt = ro.ro_rt; + if (fib4_lookup_nh_basic(rtableid, addr->v4, 0, 0, &nh4) == 0) + mss = nh4.nh_mtu - hlen - sizeof(struct tcphdr); break; #endif /* INET */ #ifdef INET6 case AF_INET6: hlen = sizeof(struct ip6_hdr); - bzero(&ro6, sizeof(ro6)); - dst6 = (struct sockaddr_in6 *)&ro6.ro_dst; - dst6->sin6_family = AF_INET6; - dst6->sin6_len = sizeof(*dst6); - dst6->sin6_addr = addr->v6; - in6_rtalloc_ign(&ro6, 0, rtableid); - rt = ro6.ro_rt; + in6_splitscope(&addr->v6, &dst6, &scopeid); + if (fib6_lookup_nh_basic(rtableid, &dst6, scopeid, 0,0,&nh6)==0) + mss = nh6.nh_mtu - hlen - sizeof(struct tcphdr); break; #endif /* INET6 */ } - if (rt && rt->rt_ifp) { - mss = rt->rt_ifp->if_mtu - hlen - sizeof(struct tcphdr); - mss = max(V_tcp_mssdflt, mss); - RTFREE(rt); - } + mss = max(V_tcp_mssdflt, mss); mss = min(mss, offer); mss = max(mss, 64); /* sanity - at least max opt space */ return (mss); @@ -5194,13 +5183,12 @@ pf_pull_hdr(struct mbuf *m, int off, voi return (p); } -int -pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *kif, +#ifdef RADIX_MPATH +static int +pf_routable_oldmpath(struct pf_addr *addr, sa_family_t af, struct pfi_kif *kif, int rtableid) { -#ifdef RADIX_MPATH struct radix_node_head *rnh; -#endif struct sockaddr_in *dst; int ret = 1; int check_mpath; @@ -5215,12 +5203,10 @@ pf_routable(struct pf_addr *addr, sa_fam struct ifnet *ifp; check_mpath = 0; -#ifdef RADIX_MPATH /* XXX: stick to table 0 for now */ rnh = rt_tables_get_rnh(0, af); if (rnh != NULL && rn_mpath_capable(rnh)) check_mpath = 1; -#endif bzero(&ro, sizeof(ro)); switch (af) { case AF_INET: @@ -5283,9 +5269,7 @@ pf_routable(struct pf_addr *addr, sa_fam if (kif->pfik_ifp == ifp) ret = 1; -#ifdef RADIX_MPATH rn = rn_mpath_next(rn); -#endif } while (check_mpath == 1 && rn != NULL && ret == 0); } else ret = 0; @@ -5294,6 +5278,72 @@ out: RTFREE(ro.ro_rt); return (ret); } +#endif + +int +pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *kif, + int rtableid) +{ +#ifdef INET + struct nhop4_basic nh4; +#endif +#ifdef INET6 + struct nhop6_basic nh6; +#endif + struct ifnet *ifp; +#ifdef RADIX_MPATH + struct radix_node_head *rnh; + + /* XXX: stick to table 0 for now */ + rnh = rt_tables_get_rnh(0, af); + if (rnh != NULL && rn_mpath_capable(rnh)) + return (pf_routable_oldmpath(addr, af, kif, rtableid)); +#endif + /* + * Skip check for addresses with embedded interface scope, + * as they would always match anyway. + */ + if (af == AF_INET6 && IN6_IS_SCOPE_EMBED(&addr->v6)) + return (1); + + if (af != AF_INET && af != AF_INET6) + return (0); + + /* Skip checks for ipsec interfaces */ + if (kif != NULL && kif->pfik_ifp->if_type == IFT_ENC) + return (1); + + ifp = NULL; + + switch (af) { +#ifdef INET6 + case AF_INET6: + if (fib6_lookup_nh_basic(rtableid, &addr->v6, 0, 0, 0, &nh6)!=0) + return (0); + ifp = nh6.nh_ifp; + break; +#endif +#ifdef INET + case AF_INET: + if (fib4_lookup_nh_basic(rtableid, addr->v4, 0, 0, &nh4) != 0) + return (0); + ifp = nh4.nh_ifp; + break; +#endif + } + + /* No interface given, this is a no-route check */ + if (kif == NULL) + return (1); + + if (kif->pfik_ifp == NULL) + return (0); + + /* Perform uRPF check if passed input interface */ + if (kif->pfik_ifp == ifp) + return (1); + return (0); +} #ifdef INET static void @@ -5344,23 +5394,20 @@ pf_route(struct mbuf **m, struct pf_rule dst.sin_addr = ip->ip_dst; if (r->rt == PF_FASTROUTE) { - struct rtentry *rt; + struct nhop4_basic nh4; if (s) PF_STATE_UNLOCK(s); - rt = rtalloc1_fib(sintosa(&dst), 0, 0, M_GETFIB(m0)); - if (rt == NULL) { + + if (fib4_lookup_nh_basic(M_GETFIB(m0), ip->ip_dst, 0, + m0->m_pkthdr.flowid, &nh4) != 0) { KMOD_IPSTAT_INC(ips_noroute); error = EHOSTUNREACH; goto bad; } - ifp = rt->rt_ifp; - counter_u64_add(rt->rt_pksent, 1); - - if (rt->rt_flags & RTF_GATEWAY) - bcopy(satosin(rt->rt_gateway), &dst, sizeof(dst)); - RTFREE_LOCKED(rt); + ifp = nh4.nh_ifp; + dst.sin_addr = nh4.nh_addr; } else { if (TAILQ_EMPTY(&r->rpool.list)) { DPFPRINTF(PF_DEBUG_URGENT, From owner-svn-src-head@freebsd.org Thu Jan 7 10:39:14 2016 Return-Path: Delivered-To: svn-src-head@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 BC0CFA658B7; Thu, 7 Jan 2016 10:39:14 +0000 (UTC) (envelope-from garga@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 7CCEE127D; Thu, 7 Jan 2016 10:39:14 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07AdD5Y047900; Thu, 7 Jan 2016 10:39:13 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07AdDSM047898; Thu, 7 Jan 2016 10:39:13 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201601071039.u07AdDSM047898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Thu, 7 Jan 2016 10:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293312 - in head: usr.bin/cap_mkdb usr.sbin/services_mkdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 10:39:14 -0000 Author: garga (ports committer) Date: Thu Jan 7 10:39:13 2016 New Revision: 293312 URL: https://svnweb.freebsd.org/changeset/base/293312 Log: Make cap_mkdb and services_mkdb file operations sync Similar fix was done for passwd and group operations in r285050. When a temporary file is created and then renamed to replace official file there are no checks to make sure data was written to disk and if a power cycle happens at this time, system can end up with a 0 length file Approved by: bapt MFC after: 1 week Sponsored by: Netgate Differential Revision: https://reviews.freebsd.org/D2982 Modified: head/usr.bin/cap_mkdb/cap_mkdb.c head/usr.sbin/services_mkdb/services_mkdb.c Modified: head/usr.bin/cap_mkdb/cap_mkdb.c ============================================================================== --- head/usr.bin/cap_mkdb/cap_mkdb.c Thu Jan 7 10:20:03 2016 (r293311) +++ head/usr.bin/cap_mkdb/cap_mkdb.c Thu Jan 7 10:39:13 2016 (r293312) @@ -119,7 +119,7 @@ main(int argc, char *argv[]) (void)snprintf(buf, sizeof(buf), "%s.db", capname ? capname : *argv); if ((capname = strdup(buf)) == NULL) errx(1, "strdup failed"); - if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR, + if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR | O_SYNC, DEFFILEMODE, DB_HASH, &openinfo)) == NULL) err(1, "%s", buf); Modified: head/usr.sbin/services_mkdb/services_mkdb.c ============================================================================== --- head/usr.sbin/services_mkdb/services_mkdb.c Thu Jan 7 10:20:03 2016 (r293311) +++ head/usr.sbin/services_mkdb/services_mkdb.c Thu Jan 7 10:39:13 2016 (r293312) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -91,6 +92,8 @@ main(int argc, char *argv[]) size_t cnt = 0; StringList *sl, ***svc; size_t port, proto; + char *dbname_dir; + int dbname_dir_fd = -1; setprogname(argv[0]); @@ -138,7 +141,7 @@ main(int argc, char *argv[]) err(1, "Cannot install exit handler"); (void)snprintf(tname, sizeof(tname), "%s.tmp", dbname); - db = dbopen(tname, O_RDWR | O_CREAT | O_EXCL, + db = dbopen(tname, O_RDWR | O_CREAT | O_EXCL | O_SYNC, (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH), DB_HASH, &hinfo); if (!db) err(1, "Error opening temporary database `%s'", tname); @@ -164,8 +167,21 @@ main(int argc, char *argv[]) if ((db->close)(db)) err(1, "Error closing temporary database `%s'", tname); - if (rename(tname, dbname) == -1) + /* + * Make sure file is safe on disk. To improve performance we will call + * fsync() to the directory where file lies + */ + if (rename(tname, dbname) == -1 || + (dbname_dir = dirname(dbname)) == NULL || + (dbname_dir_fd = open(dbname_dir, O_RDONLY|O_DIRECTORY)) == -1 || + fsync(dbname_dir_fd) != 0) { + if (dbname_dir_fd != -1) + close(dbname_dir_fd); err(1, "Cannot rename `%s' to `%s'", tname, dbname); + } + + if (dbname_dir_fd != -1) + close(dbname_dir_fd); return 0; } From owner-svn-src-head@freebsd.org Thu Jan 7 11:54:21 2016 Return-Path: Delivered-To: svn-src-head@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 53ED0A664CF; Thu, 7 Jan 2016 11:54:21 +0000 (UTC) (envelope-from jtl@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 26FBF1C7B; Thu, 7 Jan 2016 11:54:21 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07BsKri073548; Thu, 7 Jan 2016 11:54:20 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07BsKUt073547; Thu, 7 Jan 2016 11:54:20 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201601071154.u07BsKUt073547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Thu, 7 Jan 2016 11:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293313 - head/sys/netinet/tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 11:54:21 -0000 Author: jtl Date: Thu Jan 7 11:54:20 2016 New Revision: 293313 URL: https://svnweb.freebsd.org/changeset/base/293313 Log: Apply the changes from r293284 to one additional file. Discussed with: glebius Modified: head/sys/netinet/tcp_stacks/fastpath.c Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Thu Jan 7 10:39:13 2016 (r293312) +++ head/sys/netinet/tcp_stacks/fastpath.c Thu Jan 7 11:54:20 2016 (r293313) @@ -158,13 +158,11 @@ static void tcp_do_segment_fastack(stru * the ack that opens up a 0-sized window. * - LRO wasn't used for this segment. We make sure by checking that the * segment size is not larger than the MSS. - * - Delayed acks are enabled or this is a half-synchronized T/TCP - * connection. */ #define DELAY_ACK(tp, tlen) \ ((!tcp_timer_active(tp, TT_DELACK) && \ (tp->t_flags & TF_RXWIN0SENT) == 0) && \ - (tlen <= tp->t_maxopd) && \ + (tlen <= tp->t_maxseg) && \ (V_tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN))) /* From owner-svn-src-head@freebsd.org Thu Jan 7 12:22:31 2016 Return-Path: Delivered-To: svn-src-head@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 2B580A6489A; Thu, 7 Jan 2016 12:22:31 +0000 (UTC) (envelope-from melifaro@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 D70DE115D; Thu, 7 Jan 2016 12:22:30 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07CMUd5082529; Thu, 7 Jan 2016 12:22:30 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07CMU3F082528; Thu, 7 Jan 2016 12:22:30 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601071222.u07CMU3F082528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 7 Jan 2016 12:22:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293315 - head/sys/netgraph/netflow X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 12:22:31 -0000 Author: melifaro Date: Thu Jan 7 12:22:29 2016 New Revision: 293315 URL: https://svnweb.freebsd.org/changeset/base/293315 Log: Do not use 'struct route_in6' inside hash6_insert(). rin6 was used only as sockaddr_in6 storage. Make rtalloc1_fib() use on-stack sin6 and return rtenry directly, instead of doing useless work with 'struct route_in6'. Modified: head/sys/netgraph/netflow/netflow.c Modified: head/sys/netgraph/netflow/netflow.c ============================================================================== --- head/sys/netgraph/netflow/netflow.c Thu Jan 7 12:08:15 2016 (r293314) +++ head/sys/netgraph/netflow/netflow.c Thu Jan 7 12:22:29 2016 (r293315) @@ -395,9 +395,8 @@ hash6_insert(priv_p priv, struct flow_ha int plen, uint8_t flags, uint8_t tcp_flags) { struct flow6_entry *fle6; - struct sockaddr_in6 *src, *dst; + struct sockaddr_in6 sin6; struct rtentry *rt; - struct route_in6 rin6; mtx_assert(&hsh6->mtx, MA_OWNED); @@ -425,16 +424,14 @@ hash6_insert(priv_p priv, struct flow_ha * fill in out_ifx, dst_mask, nexthop, and dst_as in future releases. */ if ((flags & NG_NETFLOW_CONF_NODSTLOOKUP) == 0) { - bzero(&rin6, sizeof(struct route_in6)); - dst = (struct sockaddr_in6 *)&rin6.ro_dst; - dst->sin6_len = sizeof(struct sockaddr_in6); - dst->sin6_family = AF_INET6; - dst->sin6_addr = r->dst.r_dst6; + bzero(&sin6, sizeof(struct sockaddr_in6)); + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_family = AF_INET6; + sin6.sin6_addr = r->dst.r_dst6; - rin6.ro_rt = rtalloc1_fib((struct sockaddr *)dst, 0, 0, r->fib); + rt = rtalloc1_fib((struct sockaddr *)&sin6, 0, 0, r->fib); - if (rin6.ro_rt != NULL) { - rt = rin6.ro_rt; + if (rt != NULL) { fle6->f.fle_o_ifx = rt->rt_ifp->if_index; if (rt->rt_flags & RTF_GATEWAY && @@ -453,17 +450,14 @@ hash6_insert(priv_p priv, struct flow_ha if ((flags & NG_NETFLOW_CONF_NOSRCLOOKUP) == 0) { /* Do route lookup on source address, to fill in src_mask. */ - bzero(&rin6, sizeof(struct route_in6)); - src = (struct sockaddr_in6 *)&rin6.ro_dst; - src->sin6_len = sizeof(struct sockaddr_in6); - src->sin6_family = AF_INET6; - src->sin6_addr = r->src.r_src6; + bzero(&sin6, sizeof(struct sockaddr_in6)); + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_family = AF_INET6; + sin6.sin6_addr = r->src.r_src6; - rin6.ro_rt = rtalloc1_fib((struct sockaddr *)src, 0, 0, r->fib); - - if (rin6.ro_rt != NULL) { - rt = rin6.ro_rt; + rt = rtalloc1_fib((struct sockaddr *)&sin6, 0, 0, r->fib); + if (rt != NULL) { if (rt_mask(rt)) fle6->f.src_mask = RT_MASK6(rt); else From owner-svn-src-head@freebsd.org Thu Jan 7 12:28:23 2016 Return-Path: Delivered-To: svn-src-head@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 C65D2A64B4B; Thu, 7 Jan 2016 12:28:23 +0000 (UTC) (envelope-from jtl@freebsd.org) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0113.outbound.protection.outlook.com [157.56.110.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFC4215D2; Thu, 7 Jan 2016 12:28:22 +0000 (UTC) (envelope-from jtl@freebsd.org) Received: from SN1PR05CA0006.namprd05.prod.outlook.com (10.163.68.144) by BY2PR05MB061.namprd05.prod.outlook.com (10.242.34.141) with Microsoft SMTP Server (TLS) id 15.1.361.13; Thu, 7 Jan 2016 12:28:20 +0000 Received: from BL2FFO11FD008.protection.gbl (2a01:111:f400:7c09::163) by SN1PR05CA0006.outlook.office365.com (2a01:111:e400:5197::16) with Microsoft SMTP Server (TLS) id 15.1.365.19 via Frontend Transport; Thu, 7 Jan 2016 12:28:20 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=freebsd.org; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=freebsd.org; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning freebsd.org discourages use of 66.129.239.19 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.19) by BL2FFO11FD008.mail.protection.outlook.com (10.173.161.4) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Thu, 7 Jan 2016 12:28:19 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 7 Jan 2016 03:58:25 -0800 Received: from [172.29.33.113] (rgugliemino-sslvpn-nc.jnpr.net [172.29.33.113]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u07BwMD74218; Thu, 7 Jan 2016 03:58:22 -0800 (PST) (envelope-from jtl@freebsd.org) User-Agent: Microsoft-MacOutlook/14.5.9.151119 Date: Thu, 7 Jan 2016 06:58:21 -0500 Subject: Re: svn commit: r293284 - in head/sys: dev/cxgb/ulp/tom dev/cxgbe/tom netinet From: "Jonathan T. Looney" Sender: Jonathan Looney To: Ivan Klymenko , NGie Cooper CC: Gleb Smirnoff , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Message-ID: Thread-Topic: svn commit: r293284 - in head/sys: dev/cxgb/ulp/tom dev/cxgbe/tom netinet References: <201601070014.u070EgW1059880@repo.freebsd.org> <20160107112424.701146a9@nonamehost.local> In-Reply-To: <20160107112424.701146a9@nonamehost.local> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD008; 1:LXlk4jS1nIh009CSmf0aPNBRGtQ2gKCk+APfTuLM7lRf8FExunW/EzemolxSjDdALITiiaX+yQT3Rj25idAghvLqT2C1tPF0Ro3GDnp7apOTemloLcPsT3gyWDjuuY06XOq+wB8TmmMrmOueENH2zeVfCBjRfWtgsLmAIdoHVKKYB1m3IHhDv8U6dCi2ddTDuBXbJCD+ZjG5trUAqXYs9TxSkiKSQaXMrkXzTCAzPe4zEcO3CUDtbjHL/OAc/k5aTRSPlHbLI8eBv+tdbVASa0fEaPdfKMbs/g4zyVtfmjKQkStE/ZWL+gOWck/BumpRKbUvJqeNY0v3H8QXoQPS9ixQ6Ckxj47UxIpH1ggXqzPzu4WE87NWfzGC5+oBQViGH7KtYCKMQltz9GwG3AdZpg== X-Forefront-Antispam-Report: CIP:66.129.239.19; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(479174004)(377454003)(189002)(24454002)(199003)(1220700001)(23726003)(586003)(54356999)(69596002)(16796002)(19580395003)(1096002)(11100500001)(5001770100001)(86362001)(46406003)(19580405001)(50986999)(4001350100001)(76176999)(105596002)(81156007)(106466001)(97736004)(92566002)(36756003)(15975445007)(77096005)(87936001)(189998001)(5001960100002)(50466002)(47776003)(6806005)(230700001)(2950100001)(4326007)(2906002)(83506001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR05MB061; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB061; 2:erE0+g7xbr3mieSBbmuutUJTGh5TkJIgsiPXkH0Ue4WT8tfMbBXPs+9mVtPtgwsy+F7fCu8VrbnH8DNp1gDkKTDGw780hX37H7dokh1sib/Ddcv+0n056Wrmro8ru6n7HUh2HtwJdJtLca7vHHadfA==; 3:zZqfTy61J76sIYAoNmGPMcP2i8kprFQGuid8DeaQnnk6fHepcLg47rZ97LXjYB5WzRnTEDxflP07Xn9ba9uhQ5I8872tscTm7j9y96qkw4XMGRdzX2+OJG0eYLWIzbU6nEnbg6LCahwRW8gFW7gxbsrD9RD5qMPGhjwEcWQE9hcmNytv3ea3VZKNt3TkeeTSwv2rzQ/BlHQWiaLWdhxfWGuDPWdY+Ng4BT0UuApIwz8=; 25:CznT6cg70zY2J9jVvRJwPZKCVPRY5lheTRD851j6g6b2LMZ+v2Slh1jPcD18zH5Xmfk91dqoC1q96QS9/6rEG5iOo9QbZSPANPL0toRjMHt49V1SlL1kSbz4LyLaAf+v3qVIv9CsPkjh9hP1x5tK7W1OW3BXAG5c2eGzGlvmait2QBSJnQN8YLm1vJJUEj1vdu8KVyVZ1yxUk0jZWxDF1m2/t8JO5OeUrjWmPc7uYyk7Gxx/Bjbe6M+UcamV0dFD X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR05MB061; X-MS-Office365-Filtering-Correlation-Id: 631c3d1d-d66b-48ae-44b2-08d3175e0714 X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB061; 20:9RBNCddYMuyhD9Ei5hl251J0Mv/NvbNeLqMnvrF/nRJmBH30YKfhUCPAIVvkI5zJYp7XRdo9/qmvAI+nd5ruO4ORphswh8Eu6Ui5U6Sxv3K2KxYMNnq3673YbiLetjp892N6mDhXHkCaqQaLuZaoq11AjtsacNIZJHv79Idx4Wwf7OdbIPmDw99s7za05uCRa2Wn9UBrwP4JfT/+gIFzn/1a0eOjdj5NJtolC1aUAQelaZh/eNAxXbmfyDjWUPslzOPjG726rxRCWQz/9KafMMJIBOQAuq54Fxir/dmQxF+DLgEjzs70v/cgv1wwZoTzp/w95Pk80xLC08nA59LgLIY/pdVKjQFD8KjuyNxne6dZmIoEZCSa6q7Kx5pa0YqjWrpfkzrQpCcaOcf4rzyiCMgLbrLXnX4YLq/y3lsnCX8rDAF8vnNtb/jcSt/3d18aYU/r2eIvA+umrybCmaLpvjFf+ZfXp1AQvsmo/ycsyfApDDy8R0rX0HYFk/yboNoi; 4:H9u47bVpJnkKLAAxjJdJiPtlS587w+lw7pZZVta3RJYaCaHcIXHQl1xniH18vrNJyV41HR7eX8QK1Cbbl8hSYwlRsgNsTbl74w1jjFrsejcb8VA4s2fQBz9R1vRjNeNXutuSQF7de/d2VZiRcpBkFJ9NqNAg8IMRD39VbFWxqrBiCl44sGHR3IKR9bXk+RRY+3zu1wnowsegU7Dd8voprnPFjquIjPp22eypYjbkRGKJjqyyl08VIC0OHK5dpPReVG4dyQvPZtEZgqg2r+PfPrpDIR5XAa4TL2kFghOIWuiMODU0k4u77xWpSe0MzO4cnjO8imoq3N53SnkFTUuod76SfdFz5UnVeIYIoTt5gjSliBvU9d4jCVuD6FPBIifykosAdlFTsVLqgSeBfkDwNw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(13016025)(8121501046)(10201501046)(3002001); SRVR:BY2PR05MB061; BCL:0; PCL:0; RULEID:; SRVR:BY2PR05MB061; X-Forefront-PRVS: 0814A2C7A3 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR05MB061; 23:sYpeq/RHjDDfrYj/eTDiD/UreJTEZYU26CdvhqYtRU?= =?us-ascii?Q?kIvYfN0TeUKAOTovw5FwznRC6X/aVN5Q45GpzWBbhLOO3GlSRb/EdfJ2aKXS?= =?us-ascii?Q?LfDyHA+3oyI5tyqCkM3Lefjw681XjfxNfYGBiI9Ra/Cv72KyN+k+UHE1lQEW?= =?us-ascii?Q?6MW09NUp1tuzOfijcXbzOSCvRnqLuqjAoFCsQSg/IMUVjesxz+BEscpk6nb9?= =?us-ascii?Q?4bYVkMfNPET4axTlIBuWlkpNGWWcCRBbF3lS8Y4KBf0fXU2QKEDRFa6BIkof?= =?us-ascii?Q?tt9vaAPV6sz/35QVt9X9t2yEtyRgMiatCGhg0SlWCp+2Iq12ZSql4iqY1mtH?= =?us-ascii?Q?F3vDHjYLhrT9A10oo/QmJcBiJOuh57F2MAl4i/3DtbozptPjkySKPunlk40g?= =?us-ascii?Q?jcxM94BU0q2GZ6UTccTcW13kj52qrG9gUvdJG3FJqv/Mk+3aSxIIknSQCMUG?= =?us-ascii?Q?9GQEH3mPqmijrWp4wSWVmzOXGxdJAdMhmcqzVdYhxwhCQUHK02HHgoMvU2Bj?= =?us-ascii?Q?5RAMYVj6PqKWPOFg7yxBcqDgL5OE3NltmRcTraOkGbKIhAmwpkJObK3MgslV?= =?us-ascii?Q?K/RRYJAuxoawNYrxidf7srXcL8wEeBa5YfXg344R8jIWEKTfDgeiksheChWl?= =?us-ascii?Q?/8E9ZRTLuVTGaZZCfn+R7OJwm1ee5Ad4LCWLkslEEkHYS36L5gohylN+JfBR?= =?us-ascii?Q?+eFIZkjfaSOEKI3FYSSFHLhMgrKlk7K324RrVdLMyb9If92gXLwzraacdyER?= =?us-ascii?Q?zSLyzvsB7k8BnjgydOYXpRp6Kw8LvpZ8tewHgh+J4I8VzK54BJwAnXgV0b3+?= =?us-ascii?Q?sWYGfZQUqSGqd9radFTgq2d8Pa78p1Mr+oX7jwFTN64CTIZ8mfaQzbjMsUDs?= =?us-ascii?Q?Ig4Spv//6QXZu8eQ0YyT3xdcEZQ7Rm1CdfQuM1iYeHV0/d/NyHhvpphMdwKd?= =?us-ascii?Q?gDxN2aCXBW86hi/Sl4nIxUX7YJ8sesjKmFknSLTVr61Gz5CCqJqoB/HDu2Q3?= =?us-ascii?Q?6f6J1kmr47swUgOb2a26wPJNj3X+YL0L6zF/QIWwmQbz/xGrBsZXIpcFgz9Z?= =?us-ascii?Q?PAYC0W1ZxP/rZLoBev8b98lgmOh/PudiDW2Jp1yXJ8xf0o/7iexpOzOUAHgm?= =?us-ascii?Q?DWqw9077x+AC5nvNlWrePRPjRIKOgx?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB061; 5:hkxuWZjPgkNgbIQqKPEuzmHeqF16AX3tWPAUhWnDfhemvoT9PKl+Fn8wQS7yKDVfWUOmV9ZnjkA1SnFMcIY3eV/w4dyFHtI/1KJnJBa99kirE+dDsUqczQDct/exFCACAPW0t+SdszCCVqq+aJqC3Q==; 24:OwD6eDEKzWHN91qkYJXpXlD1dqyWw5hBo9vECc6TCg4fEaAGdy3lli9yz98saaXo8eXid2aVTHNrq9DpPhlBifBs2vz0Qs/YH/iIyTt7rGM= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2016 12:28:19.8917 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.19]; Helo=[p-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR05MB061 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 12:28:23 -0000 On 1/7/16, 4:24 AM, "owner-src-committers@freebsd.org on behalf of Ivan Klymenko" wrote: >On Wed, 6 Jan 2016 18:20:50 -0800 >NGie Cooper wrote: > >> On Wed, Jan 6, 2016 at 4:14 PM, Gleb Smirnoff >> wrote: >> > Author: glebius >> > Date: Thu Jan 7 00:14:42 2016 >> > New Revision: 293284 >> > URL: https://svnweb.freebsd.org/changeset/base/293284 >> > [...] >>This broke the build. >> >>[...] >amd64 also r293313 should fix the build breaks. Jonathan From owner-svn-src-head@freebsd.org Thu Jan 7 12:31:51 2016 Return-Path: Delivered-To: svn-src-head@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 3EED7A64D04; Thu, 7 Jan 2016 12:31:51 +0000 (UTC) (envelope-from skra@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 0FADF1A3E; Thu, 7 Jan 2016 12:31:50 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07CVomQ084990; Thu, 7 Jan 2016 12:31:50 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07CVoUx084989; Thu, 7 Jan 2016 12:31:50 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201601071231.u07CVoUx084989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Thu, 7 Jan 2016 12:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293316 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 12:31:51 -0000 Author: skra Date: Thu Jan 7 12:31:49 2016 New Revision: 293316 URL: https://svnweb.freebsd.org/changeset/base/293316 Log: Print curpmap in "show pcpu" command. Approved by: kib (mentor) Modified: head/sys/arm/arm/db_interface.c Modified: head/sys/arm/arm/db_interface.c ============================================================================== --- head/sys/arm/arm/db_interface.c Thu Jan 7 12:22:29 2016 (r293315) +++ head/sys/arm/arm/db_interface.c Thu Jan 7 12:31:49 2016 (r293316) @@ -152,6 +152,10 @@ int db_frame(struct db_variable *vp, db_ void db_show_mdpcpu(struct pcpu *pc) { + +#if __ARM_ARCH >= 6 + db_printf("curpmap = %p\n", pc->pc_curpmap); +#endif } int db_validate_address(vm_offset_t addr) From owner-svn-src-head@freebsd.org Thu Jan 7 13:03:31 2016 Return-Path: Delivered-To: svn-src-head@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 C5851A65CA4; Thu, 7 Jan 2016 13:03:31 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9ED421222; Thu, 7 Jan 2016 13:03:30 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from chd.heemeyer.club ([78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id u07D3QEB022171 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Jan 2016 13:03:27 GMT (envelope-from dchagin@chd.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host [78.107.232.239] claimed to be chd.heemeyer.club Received: from chd.heemeyer.club (localhost [127.0.0.1]) by chd.heemeyer.club (8.15.2/8.15.1) with ESMTPS id u07D3PnT062407 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 7 Jan 2016 16:03:25 +0300 (MSK) (envelope-from dchagin@chd.heemeyer.club) Received: (from dchagin@localhost) by chd.heemeyer.club (8.15.2/8.15.1/Submit) id u07D3PZS062406; Thu, 7 Jan 2016 16:03:25 +0300 (MSK) (envelope-from dchagin) Date: Thu, 7 Jan 2016 16:03:25 +0300 From: Chagin Dmitry To: Jilles Tjoelker Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r277610 - in head: bin/ln lib/libc/include lib/libc/sys share/man/man4 sys/compat/freebsd32 sys/kern sys/sys usr.bin/kdump Message-ID: <20160107130325.GA62399@chd.heemeyer.club> References: <201501232107.t0NL79a8099736@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201501232107.t0NL79a8099736@svn.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 13:03:31 -0000 On Fri, Jan 23, 2015 at 09:07:09PM +0000, Jilles Tjoelker wrote: > Author: jilles > Date: Fri Jan 23 21:07:08 2015 > New Revision: 277610 > URL: https://svnweb.freebsd.org/changeset/base/277610 > > Log: > Add futimens and utimensat system calls. > > The core kernel part is patch file utimes.2008.4.diff from > pluknet@FreeBSD.org. I updated the code for API changes, added the manual > page and added compatibility code for old kernels. There is also audit and > Capsicum support. > > A new UTIME_* constant might allow setting birthtimes in future. > > Differential Revision: https://reviews.freebsd.org/D1426 > Submitted by: pluknet (partially) > Reviewed by: delphij, pluknet, rwatson > Relnotes: yes any chances that it will be merged to 10? if not, can I merge kernel part only? thanks! From owner-svn-src-head@freebsd.org Thu Jan 7 13:39:58 2016 Return-Path: Delivered-To: svn-src-head@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 1D0B3A66A97; Thu, 7 Jan 2016 13:39:58 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D13C113A1; Thu, 7 Jan 2016 13:39:57 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from chd.heemeyer.club ([78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id u07Ddsia022334 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Jan 2016 13:39:56 GMT (envelope-from dchagin@chd.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host [78.107.232.239] claimed to be chd.heemeyer.club Received: from chd.heemeyer.club (localhost [127.0.0.1]) by chd.heemeyer.club (8.15.2/8.15.1) with ESMTPS id u07Dds2N062564 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 7 Jan 2016 16:39:54 +0300 (MSK) (envelope-from dchagin@chd.heemeyer.club) Received: (from dchagin@localhost) by chd.heemeyer.club (8.15.2/8.15.1/Submit) id u07DdsGC062563; Thu, 7 Jan 2016 16:39:54 +0300 (MSK) (envelope-from dchagin) Date: Thu, 7 Jan 2016 16:39:53 +0300 From: Chagin Dmitry To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r275121 - in head/sys: compat/linux compat/svr4 fs/procfs kern sys Message-ID: <20160107133953.GA62554@chd.heemeyer.club> References: <201411261410.sAQEA0JO071065@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411261410.sAQEA0JO071065@svn.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 13:39:58 -0000 On Wed, Nov 26, 2014 at 02:10:00PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Wed Nov 26 14:10:00 2014 > New Revision: 275121 > URL: https://svnweb.freebsd.org/changeset/base/275121 > > Log: > The process spin lock currently has the following distinct uses: > > - Threads lifetime cycle, in particular, counting of the threads in > the process, and interlocking with process mutex and thread lock. > The main reason of this is that turnstile locks are after thread > locks, so you e.g. cannot unlock blockable mutex (think process > mutex) while owning thread lock. > > - Virtual and profiling itimers, since the timers activation is done > from the clock interrupt context. Replace the p_slock by p_itimmtx > and PROC_ITIMLOCK(). > > - Profiling code (profil(2)), for similar reason. Replace the p_slock > by p_profmtx and PROC_PROFLOCK(). > > - Resource usage accounting. Need for the spinlock there is subtle, > my understanding is that spinlock blocks context switching for the > current thread, which prevents td_runtime and similar fields from > changing (updates are done at the mi_switch()). Replace the p_slock > by p_statmtx and PROC_STATLOCK(). > > The split is done mostly for code clarity, and should not affect > scalability. > > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 1 week hi, any chance to merge it? From owner-svn-src-head@freebsd.org Thu Jan 7 15:37:10 2016 Return-Path: Delivered-To: svn-src-head@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 0168AA668A2; Thu, 7 Jan 2016 15:37:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 762851D50; Thu, 7 Jan 2016 15:37:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u07Fb3kn062625 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 7 Jan 2016 17:37:03 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u07Fb3kn062625 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u07Fb380062624; Thu, 7 Jan 2016 17:37:03 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 7 Jan 2016 17:37:03 +0200 From: Konstantin Belousov To: Chagin Dmitry Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r275121 - in head/sys: compat/linux compat/svr4 fs/procfs kern sys Message-ID: <20160107153703.GV3625@kib.kiev.ua> References: <201411261410.sAQEA0JO071065@svn.freebsd.org> <20160107133953.GA62554@chd.heemeyer.club> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160107133953.GA62554@chd.heemeyer.club> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 15:37:10 -0000 On Thu, Jan 07, 2016 at 04:39:53PM +0300, Chagin Dmitry wrote: > On Wed, Nov 26, 2014 at 02:10:00PM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Wed Nov 26 14:10:00 2014 > > New Revision: 275121 > > URL: https://svnweb.freebsd.org/changeset/base/275121 > > > > Log: > > The process spin lock currently has the following distinct uses: > > > > - Threads lifetime cycle, in particular, counting of the threads in > > the process, and interlocking with process mutex and thread lock. > > The main reason of this is that turnstile locks are after thread > > locks, so you e.g. cannot unlock blockable mutex (think process > > mutex) while owning thread lock. > > > > - Virtual and profiling itimers, since the timers activation is done > > from the clock interrupt context. Replace the p_slock by p_itimmtx > > and PROC_ITIMLOCK(). > > > > - Profiling code (profil(2)), for similar reason. Replace the p_slock > > by p_profmtx and PROC_PROFLOCK(). > > > > - Resource usage accounting. Need for the spinlock there is subtle, > > my understanding is that spinlock blocks context switching for the > > current thread, which prevents td_runtime and similar fields from > > changing (updates are done at the mi_switch()). Replace the p_slock > > by p_statmtx and PROC_STATLOCK(). > > > > The split is done mostly for code clarity, and should not affect > > scalability. > > > > Tested by: pho > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > hi, any chance to merge it? I do not want to merge the split, for many reasons. I suppose the merge conflicts due to the replace of PROC_SLOCK() by PROC_*LOCK() are what you are looking after, am I right ? What could be done, is to merge the syntax changes from the patch. I mean, provide the PROC_*LOCK() macros and merge all changes to use new macros, but internal implementation would still lock the same proc spinlock. From owner-svn-src-head@freebsd.org Thu Jan 7 15:55:42 2016 Return-Path: Delivered-To: svn-src-head@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 BCD75A66F4D; Thu, 7 Jan 2016 15:55:42 +0000 (UTC) (envelope-from jimharris@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 8ED801A63; Thu, 7 Jan 2016 15:55:42 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07FtfUI047029; Thu, 7 Jan 2016 15:55:41 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07Ftf4U047028; Thu, 7 Jan 2016 15:55:41 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601071555.u07Ftf4U047028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 7 Jan 2016 15:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293319 - head/sys/dev/nvd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 15:55:42 -0000 Author: jimharris Date: Thu Jan 7 15:55:41 2016 New Revision: 293319 URL: https://svnweb.freebsd.org/changeset/base/293319 Log: nvd: set DISKFLAG_DIRECT_COMPLETION Submitted by: gallatin MFC after: 3 days Modified: head/sys/dev/nvd/nvd.c Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Thu Jan 7 15:37:17 2016 (r293318) +++ head/sys/dev/nvd/nvd.c Thu Jan 7 15:55:41 2016 (r293319) @@ -287,7 +287,7 @@ nvd_new_disk(struct nvme_namespace *ns, disk->d_unit = TAILQ_LAST(&disk_head, disk_list)->disk->d_unit + 1; - disk->d_flags = 0; + disk->d_flags = DISKFLAG_DIRECT_COMPLETION; if (nvme_ns_get_flags(ns) & NVME_NS_DEALLOCATE_SUPPORTED) disk->d_flags |= DISKFLAG_CANDELETE; From owner-svn-src-head@freebsd.org Thu Jan 7 15:57:19 2016 Return-Path: Delivered-To: svn-src-head@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 19E7DA66FE9; Thu, 7 Jan 2016 15:57:19 +0000 (UTC) (envelope-from jimharris@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 DF1D71C0D; Thu, 7 Jan 2016 15:57:18 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07FvIFs047121; Thu, 7 Jan 2016 15:57:18 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07FvIMT047120; Thu, 7 Jan 2016 15:57:18 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601071557.u07FvIMT047120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 7 Jan 2016 15:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293320 - head/sys/dev/nvd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 15:57:19 -0000 Author: jimharris Date: Thu Jan 7 15:57:17 2016 New Revision: 293320 URL: https://svnweb.freebsd.org/changeset/base/293320 Log: nvd: do not wait for previous bios before submitting ordered bio Still wait until all in-flight bios (including the ordered bio) complete before processing more bios from the queue. MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvd/nvd.c Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Thu Jan 7 15:55:41 2016 (r293319) +++ head/sys/dev/nvd/nvd.c Thu Jan 7 15:57:17 2016 (r293320) @@ -204,19 +204,6 @@ nvd_bioq_process(void *arg, int pending) if (bp == NULL) break; -#ifdef BIO_ORDERED - /* - * BIO_ORDERED flag dictates that all outstanding bios - * must be completed before processing the bio with - * BIO_ORDERED flag set. - */ - if (bp->bio_flags & BIO_ORDERED) { - while (ndisk->cur_depth > 0) { - pause("nvd flush", 1); - } - } -#endif - bp->bio_driver1 = NULL; atomic_add_int(&ndisk->cur_depth, 1); From owner-svn-src-head@freebsd.org Thu Jan 7 15:58:45 2016 Return-Path: Delivered-To: svn-src-head@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 6125AA67083; Thu, 7 Jan 2016 15:58:45 +0000 (UTC) (envelope-from jimharris@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 300E31D83; Thu, 7 Jan 2016 15:58:45 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07Fwido047207; Thu, 7 Jan 2016 15:58:44 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07FwifD047206; Thu, 7 Jan 2016 15:58:44 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601071558.u07FwifD047206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 7 Jan 2016 15:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293321 - head/sys/dev/nvd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 15:58:45 -0000 Author: jimharris Date: Thu Jan 7 15:58:44 2016 New Revision: 293321 URL: https://svnweb.freebsd.org/changeset/base/293321 Log: nvd: skip BIO_ORDERED logic when bio fails submission This ensures the bio flags are not read after biodone(). The ordering will still be enforced, after the bio is submitted successfully. MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvd/nvd.c Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Thu Jan 7 15:57:17 2016 (r293320) +++ head/sys/dev/nvd/nvd.c Thu Jan 7 15:58:44 2016 (r293321) @@ -215,6 +215,7 @@ nvd_bioq_process(void *arg, int pending) bp->bio_flags |= BIO_ERROR; bp->bio_resid = bp->bio_bcount; biodone(bp); + continue; } #ifdef BIO_ORDERED From owner-svn-src-head@freebsd.org Thu Jan 7 15:59:53 2016 Return-Path: Delivered-To: svn-src-head@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 47875A670EF; Thu, 7 Jan 2016 15:59:53 +0000 (UTC) (envelope-from jimharris@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 F39CA1F00; Thu, 7 Jan 2016 15:59:52 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07FxqAY047381; Thu, 7 Jan 2016 15:59:52 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07Fxqbb047380; Thu, 7 Jan 2016 15:59:52 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601071559.u07Fxqbb047380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 7 Jan 2016 15:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293322 - head/sys/dev/nvd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 15:59:53 -0000 Author: jimharris Date: Thu Jan 7 15:59:51 2016 New Revision: 293322 URL: https://svnweb.freebsd.org/changeset/base/293322 Log: nvd: break out submission logic into separate function This enables a future patch using this same logic to submit I/O directly bypassing the taskqueue. MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvd/nvd.c Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Thu Jan 7 15:58:44 2016 (r293321) +++ head/sys/dev/nvd/nvd.c Thu Jan 7 15:59:51 2016 (r293322) @@ -47,6 +47,8 @@ struct nvd_disk; static disk_ioctl_t nvd_ioctl; static disk_strategy_t nvd_strategy; +static void nvd_done(void *arg, const struct nvme_completion *cpl); + static void *nvd_new_disk(struct nvme_namespace *ns, void *ctrlr); static void destroy_geom_disk(struct nvd_disk *ndisk); @@ -148,6 +150,26 @@ nvd_unload() nvme_unregister_consumer(consumer_handle); } +static int +nvd_bio_submit(struct nvd_disk *ndisk, struct bio *bp) +{ + int err; + + bp->bio_driver1 = NULL; + atomic_add_int(&ndisk->cur_depth, 1); + err = nvme_ns_bio_process(ndisk->ns, bp, nvd_done); + if (err) { + atomic_add_int(&ndisk->cur_depth, -1); + bp->bio_error = err; + bp->bio_flags |= BIO_ERROR; + bp->bio_resid = bp->bio_bcount; + biodone(bp); + return (-1); + } + + return (0); +} + static void nvd_strategy(struct bio *bp) { @@ -195,7 +217,6 @@ nvd_bioq_process(void *arg, int pending) { struct nvd_disk *ndisk = arg; struct bio *bp; - int err; for (;;) { mtx_lock(&ndisk->bioqlock); @@ -204,17 +225,7 @@ nvd_bioq_process(void *arg, int pending) if (bp == NULL) break; - bp->bio_driver1 = NULL; - atomic_add_int(&ndisk->cur_depth, 1); - - err = nvme_ns_bio_process(ndisk->ns, bp, nvd_done); - - if (err) { - atomic_add_int(&ndisk->cur_depth, -1); - bp->bio_error = err; - bp->bio_flags |= BIO_ERROR; - bp->bio_resid = bp->bio_bcount; - biodone(bp); + if (nvd_bio_submit(ndisk, bp) != 0) { continue; } From owner-svn-src-head@freebsd.org Thu Jan 7 16:06:24 2016 Return-Path: Delivered-To: svn-src-head@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 8618FA673C0; Thu, 7 Jan 2016 16:06:24 +0000 (UTC) (envelope-from jimharris@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 3AD3D178A; Thu, 7 Jan 2016 16:06:24 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07G6NFx050264; Thu, 7 Jan 2016 16:06:23 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07G6NvJ050263; Thu, 7 Jan 2016 16:06:23 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601071606.u07G6NvJ050263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 7 Jan 2016 16:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293323 - head/sys/dev/nvd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 16:06:24 -0000 Author: jimharris Date: Thu Jan 7 16:06:23 2016 New Revision: 293323 URL: https://svnweb.freebsd.org/changeset/base/293323 Log: nvd: submit bios directly when BIO_ORDERED not set or in flight This significantly improves parallelism in the most common case. The taskqueue is still used whenever BIO_ORDERED bios are in flight. This patch is based heavily on a patch from gallatin@. MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvd/nvd.c Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Thu Jan 7 15:59:51 2016 (r293322) +++ head/sys/dev/nvd/nvd.c Thu Jan 7 16:06:23 2016 (r293323) @@ -73,6 +73,7 @@ struct nvd_disk { struct nvme_namespace *ns; uint32_t cur_depth; + uint32_t ordered_in_flight; TAILQ_ENTRY(nvd_disk) global_tailq; TAILQ_ENTRY(nvd_disk) ctrlr_tailq; @@ -160,6 +161,8 @@ nvd_bio_submit(struct nvd_disk *ndisk, s err = nvme_ns_bio_process(ndisk->ns, bp, nvd_done); if (err) { atomic_add_int(&ndisk->cur_depth, -1); + if (__predict_false(bp->bio_flags & BIO_ORDERED)) + atomic_add_int(&ndisk->ordered_in_flight, -1); bp->bio_error = err; bp->bio_flags |= BIO_ERROR; bp->bio_resid = bp->bio_bcount; @@ -177,6 +180,18 @@ nvd_strategy(struct bio *bp) ndisk = (struct nvd_disk *)bp->bio_disk->d_drv1; + if (__predict_false(bp->bio_flags & BIO_ORDERED)) + atomic_add_int(&ndisk->ordered_in_flight, 1); + + if (__predict_true(ndisk->ordered_in_flight == 0)) { + nvd_bio_submit(ndisk, bp); + return; + } + + /* + * There are ordered bios in flight, so we need to submit + * bios through the task queue to enforce ordering. + */ mtx_lock(&ndisk->bioqlock); bioq_insert_tail(&ndisk->bioq, bp); mtx_unlock(&ndisk->bioqlock); @@ -208,6 +223,8 @@ nvd_done(void *arg, const struct nvme_co ndisk = bp->bio_disk->d_drv1; atomic_add_int(&ndisk->cur_depth, -1); + if (__predict_false(bp->bio_flags & BIO_ORDERED)) + atomic_add_int(&ndisk->ordered_in_flight, -1); biodone(bp); } @@ -316,6 +333,7 @@ nvd_new_disk(struct nvme_namespace *ns, ndisk->ns = ns; ndisk->disk = disk; ndisk->cur_depth = 0; + ndisk->ordered_in_flight = 0; mtx_init(&ndisk->bioqlock, "NVD bioq lock", NULL, MTX_DEF); bioq_init(&ndisk->bioq); From owner-svn-src-head@freebsd.org Thu Jan 7 16:08:06 2016 Return-Path: Delivered-To: svn-src-head@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 227F3A67448; Thu, 7 Jan 2016 16:08:06 +0000 (UTC) (envelope-from jimharris@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 CFBC4199B; Thu, 7 Jan 2016 16:08:05 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07G84dV050358; Thu, 7 Jan 2016 16:08:04 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07G84UQ050357; Thu, 7 Jan 2016 16:08:04 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601071608.u07G84UQ050357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 7 Jan 2016 16:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293324 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 16:08:06 -0000 Author: jimharris Date: Thu Jan 7 16:08:04 2016 New Revision: 293324 URL: https://svnweb.freebsd.org/changeset/base/293324 Log: nvme: simplify some of the nested ifs in interrupt setup code This prepares for some follow-up commits which do more work in this area. MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:06:23 2016 (r293323) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:08:04 2016 (r293324) @@ -999,7 +999,9 @@ nvme_ctrlr_construct(struct nvme_control if (pci_msix_count(dev) < 2) { ctrlr->msix_enabled = 0; goto intx; - } else if (pci_msix_count(dev) < num_vectors_requested) { + } + + if (pci_msix_count(dev) < num_vectors_requested) { ctrlr->per_cpu_io_queues = FALSE; ctrlr->num_io_queues = 1; num_vectors_requested = 2; /* one for admin, one for I/O */ @@ -1009,26 +1011,28 @@ nvme_ctrlr_construct(struct nvme_control if (pci_alloc_msix(dev, &num_vectors_allocated) != 0) { ctrlr->msix_enabled = 0; goto intx; - } else if (num_vectors_allocated < num_vectors_requested) { + } + + if (num_vectors_allocated < num_vectors_requested) { if (num_vectors_allocated < 2) { pci_release_msi(dev); ctrlr->msix_enabled = 0; goto intx; - } else { - ctrlr->per_cpu_io_queues = FALSE; - ctrlr->num_io_queues = 1; - /* - * Release whatever vectors were allocated, and just - * reallocate the two needed for the admin and single - * I/O qpair. - */ - num_vectors_allocated = 2; - pci_release_msi(dev); - if (pci_alloc_msix(dev, &num_vectors_allocated) != 0) - panic("could not reallocate any vectors\n"); - if (num_vectors_allocated != 2) - panic("could not reallocate 2 vectors\n"); } + + ctrlr->per_cpu_io_queues = FALSE; + ctrlr->num_io_queues = 1; + /* + * Release whatever vectors were allocated, and just + * reallocate the two needed for the admin and single + * I/O qpair. + */ + num_vectors_allocated = 2; + pci_release_msi(dev); + if (pci_alloc_msix(dev, &num_vectors_allocated) != 0) + panic("could not reallocate any vectors\n"); + if (num_vectors_allocated != 2) + panic("could not reallocate 2 vectors\n"); } /* From owner-svn-src-head@freebsd.org Thu Jan 7 16:09:58 2016 Return-Path: Delivered-To: svn-src-head@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 41BADA67582; Thu, 7 Jan 2016 16:09:58 +0000 (UTC) (envelope-from jimharris@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 049C21E12; Thu, 7 Jan 2016 16:09:57 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07G9veP050871; Thu, 7 Jan 2016 16:09:57 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07G9v81050869; Thu, 7 Jan 2016 16:09:57 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601071609.u07G9v81050869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 7 Jan 2016 16:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293325 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 16:09:58 -0000 Author: jimharris Date: Thu Jan 7 16:09:56 2016 New Revision: 293325 URL: https://svnweb.freebsd.org/changeset/base/293325 Log: nvme: remove per_cpu_io_queues from struct nvme_controller Instead just use num_io_queues to make this determination. This prepares for some future changes enabling use of multiple queues when we do not have enough queues or MSI-X vectors for one queue per CPU. MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_private.h Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:08:04 2016 (r293324) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:09:56 2016 (r293325) @@ -160,7 +160,7 @@ nvme_ctrlr_construct_io_qpairs(struct nv num_trackers, ctrlr); - if (ctrlr->per_cpu_io_queues) + if (ctrlr->num_io_queues > 1) bus_bind_intr(ctrlr->dev, qpair->res, i); } @@ -402,7 +402,6 @@ nvme_ctrlr_set_num_qpairs(struct nvme_co nvme_io_qpair_destroy(&ctrlr->ioq[i]); ctrlr->num_io_queues = 1; - ctrlr->per_cpu_io_queues = 0; } return (0); @@ -779,7 +778,6 @@ nvme_ctrlr_configure_intx(struct nvme_co { ctrlr->num_io_queues = 1; - ctrlr->per_cpu_io_queues = 0; ctrlr->rid = 0; ctrlr->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, &ctrlr->rid, RF_SHAREABLE | RF_ACTIVE); @@ -969,9 +967,8 @@ nvme_ctrlr_construct(struct nvme_control per_cpu_io_queues = 1; TUNABLE_INT_FETCH("hw.nvme.per_cpu_io_queues", &per_cpu_io_queues); - ctrlr->per_cpu_io_queues = per_cpu_io_queues ? TRUE : FALSE; - if (ctrlr->per_cpu_io_queues) + if (per_cpu_io_queues) ctrlr->num_io_queues = mp_ncpus; else ctrlr->num_io_queues = 1; @@ -1002,7 +999,6 @@ nvme_ctrlr_construct(struct nvme_control } if (pci_msix_count(dev) < num_vectors_requested) { - ctrlr->per_cpu_io_queues = FALSE; ctrlr->num_io_queues = 1; num_vectors_requested = 2; /* one for admin, one for I/O */ } @@ -1020,7 +1016,6 @@ nvme_ctrlr_construct(struct nvme_control goto intx; } - ctrlr->per_cpu_io_queues = FALSE; ctrlr->num_io_queues = 1; /* * Release whatever vectors were allocated, and just @@ -1192,7 +1187,7 @@ nvme_ctrlr_submit_io_request(struct nvme { struct nvme_qpair *qpair; - if (ctrlr->per_cpu_io_queues) + if (ctrlr->num_io_queues > 1) qpair = &ctrlr->ioq[curcpu]; else qpair = &ctrlr->ioq[0]; Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Thu Jan 7 16:08:04 2016 (r293324) +++ head/sys/dev/nvme/nvme_private.h Thu Jan 7 16:09:56 2016 (r293325) @@ -265,7 +265,6 @@ struct nvme_controller { uint32_t enable_aborts; uint32_t num_io_queues; - boolean_t per_cpu_io_queues; /* Fields for tracking progress during controller initialization. */ struct intr_config_hook config_hook; From owner-svn-src-head@freebsd.org Thu Jan 7 16:11:33 2016 Return-Path: Delivered-To: svn-src-head@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 30BB6A67646; Thu, 7 Jan 2016 16:11:33 +0000 (UTC) (envelope-from jimharris@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 0C5A7109C; Thu, 7 Jan 2016 16:11:32 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07GBWX8053435; Thu, 7 Jan 2016 16:11:32 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07GBVe8053432; Thu, 7 Jan 2016 16:11:31 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601071611.u07GBVe8053432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 7 Jan 2016 16:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293326 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 16:11:33 -0000 Author: jimharris Date: Thu Jan 7 16:11:31 2016 New Revision: 293326 URL: https://svnweb.freebsd.org/changeset/base/293326 Log: nvme: do not pre-allocate MSI-X IRQ resources The issue referenced here was resolved by other changes in recent commits, so this code is no longer needed. MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:09:56 2016 (r293325) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:11:31 2016 (r293326) @@ -929,7 +929,7 @@ nvme_ctrlr_construct(struct nvme_control { union cap_lo_register cap_lo; union cap_hi_register cap_hi; - int i, per_cpu_io_queues, rid; + int per_cpu_io_queues; int num_vectors_requested, num_vectors_allocated; int status, timeout_period; @@ -1030,41 +1030,6 @@ nvme_ctrlr_construct(struct nvme_control panic("could not reallocate 2 vectors\n"); } - /* - * On earlier FreeBSD releases, there are reports that - * pci_alloc_msix() can return successfully with all vectors - * requested, but a subsequent bus_alloc_resource_any() - * for one of those vectors fails. This issue occurs more - * readily with multiple devices using per-CPU vectors. - * To workaround this issue, try to allocate the resources now, - * and fall back to INTx if we cannot allocate all of them. - * This issue cannot be reproduced on more recent versions of - * FreeBSD which have increased the maximum number of MSI-X - * vectors, but adding the workaround makes it easier for - * vendors wishing to import this driver into kernels based on - * older versions of FreeBSD. - */ - for (i = 0; i < num_vectors_allocated; i++) { - rid = i + 1; - ctrlr->msi_res[i] = bus_alloc_resource_any(ctrlr->dev, - SYS_RES_IRQ, &rid, RF_ACTIVE); - - if (ctrlr->msi_res[i] == NULL) { - ctrlr->msix_enabled = 0; - while (i > 0) { - i--; - bus_release_resource(ctrlr->dev, - SYS_RES_IRQ, - rman_get_rid(ctrlr->msi_res[i]), - ctrlr->msi_res[i]); - } - pci_release_msi(dev); - nvme_printf(ctrlr, "could not obtain all MSI-X " - "resources, reverting to intx\n"); - break; - } - } - intx: if (!ctrlr->msix_enabled) Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Thu Jan 7 16:09:56 2016 (r293325) +++ head/sys/dev/nvme/nvme_private.h Thu Jan 7 16:11:31 2016 (r293326) @@ -275,8 +275,6 @@ struct nvme_controller { struct task fail_req_task; struct taskqueue *taskqueue; - struct resource *msi_res[MAXCPU + 1]; - /* For shared legacy interrupt. */ int rid; struct resource *res; Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Thu Jan 7 16:09:56 2016 (r293325) +++ head/sys/dev/nvme/nvme_qpair.c Thu Jan 7 16:11:31 2016 (r293326) @@ -479,8 +479,9 @@ nvme_qpair_construct(struct nvme_qpair * * the queue's vector to get the corresponding rid to use. */ qpair->rid = vector + 1; - qpair->res = ctrlr->msi_res[vector]; + qpair->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, + &qpair->rid, RF_ACTIVE); bus_setup_intr(ctrlr->dev, qpair->res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, nvme_qpair_msix_handler, qpair, &qpair->tag); From owner-svn-src-head@freebsd.org Thu Jan 7 16:12:43 2016 Return-Path: Delivered-To: svn-src-head@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 84188A6776C; Thu, 7 Jan 2016 16:12:43 +0000 (UTC) (envelope-from jimharris@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 45F651446; Thu, 7 Jan 2016 16:12:43 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07GCgF7053513; Thu, 7 Jan 2016 16:12:42 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07GCgnA053512; Thu, 7 Jan 2016 16:12:42 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601071612.u07GCgnA053512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 7 Jan 2016 16:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293327 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 16:12:43 -0000 Author: jimharris Date: Thu Jan 7 16:12:42 2016 New Revision: 293327 URL: https://svnweb.freebsd.org/changeset/base/293327 Log: nvme: break out interrupt setup code into a separate function MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:11:31 2016 (r293326) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:12:42 2016 (r293327) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); static void nvme_ctrlr_construct_and_submit_aer(struct nvme_controller *ctrlr, struct nvme_async_event_request *aer); +static void nvme_ctrlr_setup_interrupts(struct nvme_controller *ctrlr); static int nvme_ctrlr_allocate_bar(struct nvme_controller *ctrlr) @@ -777,6 +778,7 @@ static int nvme_ctrlr_configure_intx(struct nvme_controller *ctrlr) { + ctrlr->msix_enabled = 0; ctrlr->num_io_queues = 1; ctrlr->rid = 0; ctrlr->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, @@ -924,80 +926,35 @@ static struct cdevsw nvme_ctrlr_cdevsw = .d_ioctl = nvme_ctrlr_ioctl }; -int -nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev) +static void +nvme_ctrlr_setup_interrupts(struct nvme_controller *ctrlr) { - union cap_lo_register cap_lo; - union cap_hi_register cap_hi; - int per_cpu_io_queues; - int num_vectors_requested, num_vectors_allocated; - int status, timeout_period; - - ctrlr->dev = dev; - - mtx_init(&ctrlr->lock, "nvme ctrlr lock", NULL, MTX_DEF); - - status = nvme_ctrlr_allocate_bar(ctrlr); - - if (status != 0) - return (status); - - /* - * Software emulators may set the doorbell stride to something - * other than zero, but this driver is not set up to handle that. - */ - cap_hi.raw = nvme_mmio_read_4(ctrlr, cap_hi); - if (cap_hi.bits.dstrd != 0) - return (ENXIO); - - ctrlr->min_page_size = 1 << (12 + cap_hi.bits.mpsmin); - - /* Get ready timeout value from controller, in units of 500ms. */ - cap_lo.raw = nvme_mmio_read_4(ctrlr, cap_lo); - ctrlr->ready_timeout_in_ms = cap_lo.bits.to * 500; - - timeout_period = NVME_DEFAULT_TIMEOUT_PERIOD; - TUNABLE_INT_FETCH("hw.nvme.timeout_period", &timeout_period); - timeout_period = min(timeout_period, NVME_MAX_TIMEOUT_PERIOD); - timeout_period = max(timeout_period, NVME_MIN_TIMEOUT_PERIOD); - ctrlr->timeout_period = timeout_period; - - nvme_retry_count = NVME_DEFAULT_RETRY_COUNT; - TUNABLE_INT_FETCH("hw.nvme.retry_count", &nvme_retry_count); + device_t dev; + int per_cpu_io_queues; + int num_vectors_requested, num_vectors_allocated; + dev = ctrlr->dev; per_cpu_io_queues = 1; TUNABLE_INT_FETCH("hw.nvme.per_cpu_io_queues", &per_cpu_io_queues); - if (per_cpu_io_queues) - ctrlr->num_io_queues = mp_ncpus; - else - ctrlr->num_io_queues = 1; - ctrlr->force_intx = 0; TUNABLE_INT_FETCH("hw.nvme.force_intx", &ctrlr->force_intx); - ctrlr->enable_aborts = 0; - TUNABLE_INT_FETCH("hw.nvme.enable_aborts", &ctrlr->enable_aborts); + if (ctrlr->force_intx || pci_msix_count(dev) < 2) { + nvme_ctrlr_configure_intx(ctrlr); + return; + } ctrlr->msix_enabled = 1; - if (ctrlr->force_intx) { - ctrlr->msix_enabled = 0; - goto intx; - } + if (per_cpu_io_queues) + ctrlr->num_io_queues = mp_ncpus; + else + ctrlr->num_io_queues = 1; /* One vector per IO queue, plus one vector for admin queue. */ num_vectors_requested = ctrlr->num_io_queues + 1; - /* - * If we cannot even allocate 2 vectors (one for admin, one for - * I/O), then revert to INTx. - */ - if (pci_msix_count(dev) < 2) { - ctrlr->msix_enabled = 0; - goto intx; - } - if (pci_msix_count(dev) < num_vectors_requested) { ctrlr->num_io_queues = 1; num_vectors_requested = 2; /* one for admin, one for I/O */ @@ -1005,15 +962,15 @@ nvme_ctrlr_construct(struct nvme_control num_vectors_allocated = num_vectors_requested; if (pci_alloc_msix(dev, &num_vectors_allocated) != 0) { - ctrlr->msix_enabled = 0; - goto intx; + nvme_ctrlr_configure_intx(ctrlr); + return; } if (num_vectors_allocated < num_vectors_requested) { if (num_vectors_allocated < 2) { pci_release_msi(dev); - ctrlr->msix_enabled = 0; - goto intx; + nvme_ctrlr_configure_intx(ctrlr); + return; } ctrlr->num_io_queues = 1; @@ -1029,11 +986,51 @@ nvme_ctrlr_construct(struct nvme_control if (num_vectors_allocated != 2) panic("could not reallocate 2 vectors\n"); } +} + +int +nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev) +{ + union cap_lo_register cap_lo; + union cap_hi_register cap_hi; + int status, timeout_period; -intx: + ctrlr->dev = dev; - if (!ctrlr->msix_enabled) - nvme_ctrlr_configure_intx(ctrlr); + mtx_init(&ctrlr->lock, "nvme ctrlr lock", NULL, MTX_DEF); + + status = nvme_ctrlr_allocate_bar(ctrlr); + + if (status != 0) + return (status); + + /* + * Software emulators may set the doorbell stride to something + * other than zero, but this driver is not set up to handle that. + */ + cap_hi.raw = nvme_mmio_read_4(ctrlr, cap_hi); + if (cap_hi.bits.dstrd != 0) + return (ENXIO); + + ctrlr->min_page_size = 1 << (12 + cap_hi.bits.mpsmin); + + /* Get ready timeout value from controller, in units of 500ms. */ + cap_lo.raw = nvme_mmio_read_4(ctrlr, cap_lo); + ctrlr->ready_timeout_in_ms = cap_lo.bits.to * 500; + + timeout_period = NVME_DEFAULT_TIMEOUT_PERIOD; + TUNABLE_INT_FETCH("hw.nvme.timeout_period", &timeout_period); + timeout_period = min(timeout_period, NVME_MAX_TIMEOUT_PERIOD); + timeout_period = max(timeout_period, NVME_MIN_TIMEOUT_PERIOD); + ctrlr->timeout_period = timeout_period; + + nvme_retry_count = NVME_DEFAULT_RETRY_COUNT; + TUNABLE_INT_FETCH("hw.nvme.retry_count", &nvme_retry_count); + + ctrlr->enable_aborts = 0; + TUNABLE_INT_FETCH("hw.nvme.enable_aborts", &ctrlr->enable_aborts); + + nvme_ctrlr_setup_interrupts(ctrlr); ctrlr->max_xfer_size = NVME_MAX_XFER_SIZE; nvme_ctrlr_construct_admin_qpair(ctrlr); From owner-svn-src-head@freebsd.org Thu Jan 7 16:18:34 2016 Return-Path: Delivered-To: svn-src-head@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 75978A67937; Thu, 7 Jan 2016 16:18:34 +0000 (UTC) (envelope-from jimharris@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 31A531A87; Thu, 7 Jan 2016 16:18:34 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07GIXKZ054150; Thu, 7 Jan 2016 16:18:33 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07GIXdd054147; Thu, 7 Jan 2016 16:18:33 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601071618.u07GIXdd054147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 7 Jan 2016 16:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293328 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 16:18:34 -0000 Author: jimharris Date: Thu Jan 7 16:18:32 2016 New Revision: 293328 URL: https://svnweb.freebsd.org/changeset/base/293328 Log: nvme: do not revert o single I/O queue when per-CPU queues not possible Previously nvme(4) would revert to a signle I/O queue if it could not allocate enought interrupt vectors or NVMe submission/completion queues to have one I/O queue per core. This patch determines how to utilize a smaller number of available interrupt vectors, and assigns (as closely as possible) an equal number of cores to each associated I/O queue. MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_private.h Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Thu Jan 7 16:12:42 2016 (r293327) +++ head/sys/dev/nvme/nvme.c Thu Jan 7 16:18:32 2016 (r293328) @@ -270,8 +270,6 @@ nvme_attach(device_t dev) return (status); } - nvme_sysctl_initialize_ctrlr(ctrlr); - pci_enable_busmaster(dev); ctrlr->config_hook.ich_func = nvme_ctrlr_start_config_hook; Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:12:42 2016 (r293327) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:18:32 2016 (r293328) @@ -42,6 +42,12 @@ __FBSDID("$FreeBSD$"); #include "nvme_private.h" +/* + * Used for calculating number of CPUs to assign to each core and number of I/O + * queues to allocate per controller. + */ +#define NVME_CEILING(num, div) ((((num) - 1) / (div)) + 1) + static void nvme_ctrlr_construct_and_submit_aer(struct nvme_controller *ctrlr, struct nvme_async_event_request *aer); static void nvme_ctrlr_setup_interrupts(struct nvme_controller *ctrlr); @@ -141,6 +147,13 @@ nvme_ctrlr_construct_io_qpairs(struct nv */ num_trackers = min(num_trackers, (num_entries-1)); + /* + * This was calculated previously when setting up interrupts, but + * a controller could theoretically support fewer I/O queues than + * MSI-X vectors. So calculate again here just to be safe. + */ + ctrlr->num_cpus_per_ioq = NVME_CEILING(mp_ncpus, ctrlr->num_io_queues); + ctrlr->ioq = malloc(ctrlr->num_io_queues * sizeof(struct nvme_qpair), M_NVME, M_ZERO | M_WAITOK); @@ -161,8 +174,13 @@ nvme_ctrlr_construct_io_qpairs(struct nv num_trackers, ctrlr); + /* + * Do not bother binding interrupts if we only have one I/O + * interrupt thread for this controller. + */ if (ctrlr->num_io_queues > 1) - bus_bind_intr(ctrlr->dev, qpair->res, i); + bus_bind_intr(ctrlr->dev, qpair->res, + i * ctrlr->num_cpus_per_ioq); } return (0); @@ -307,8 +325,15 @@ nvme_ctrlr_hw_reset(struct nvme_controll int i; nvme_admin_qpair_disable(&ctrlr->adminq); - for (i = 0; i < ctrlr->num_io_queues; i++) - nvme_io_qpair_disable(&ctrlr->ioq[i]); + /* + * I/O queues are not allocated before the initial HW + * reset, so do not try to disable them. Use is_initialized + * to determine if this is the initial HW reset. + */ + if (ctrlr->is_initialized) { + for (i = 0; i < ctrlr->num_io_queues; i++) + nvme_io_qpair_disable(&ctrlr->ioq[i]); + } DELAY(100*1000); @@ -364,7 +389,7 @@ static int nvme_ctrlr_set_num_qpairs(struct nvme_controller *ctrlr) { struct nvme_completion_poll_status status; - int cq_allocated, i, sq_allocated; + int cq_allocated, sq_allocated; status.done = FALSE; nvme_ctrlr_cmd_set_num_queues(ctrlr, ctrlr->num_io_queues, @@ -385,25 +410,12 @@ nvme_ctrlr_set_num_qpairs(struct nvme_co cq_allocated = (status.cpl.cdw0 >> 16) + 1; /* - * Check that the controller was able to allocate the number of - * queues we requested. If not, revert to one IO queue pair. + * Controller may allocate more queues than we requested, + * so use the minimum of the number requested and what was + * actually allocated. */ - if (sq_allocated < ctrlr->num_io_queues || - cq_allocated < ctrlr->num_io_queues) { - - /* - * Destroy extra IO queue pairs that were created at - * controller construction time but are no longer - * needed. This will only happen when a controller - * supports fewer queues than MSI-X vectors. This - * is not the normal case, but does occur with the - * Chatham prototype board. - */ - for (i = 1; i < ctrlr->num_io_queues; i++) - nvme_io_qpair_destroy(&ctrlr->ioq[i]); - - ctrlr->num_io_queues = 1; - } + ctrlr->num_io_queues = min(ctrlr->num_io_queues, sq_allocated); + ctrlr->num_io_queues = min(ctrlr->num_io_queues, cq_allocated); return (0); } @@ -687,9 +699,20 @@ static void nvme_ctrlr_start(void *ctrlr_arg) { struct nvme_controller *ctrlr = ctrlr_arg; + uint32_t old_num_io_queues; int i; - nvme_qpair_reset(&ctrlr->adminq); + /* + * Only reset adminq here when we are restarting the + * controller after a reset. During initialization, + * we have already submitted admin commands to get + * the number of I/O queues supported, so cannot reset + * the adminq again here. + */ + if (ctrlr->is_resetting) { + nvme_qpair_reset(&ctrlr->adminq); + } + for (i = 0; i < ctrlr->num_io_queues; i++) nvme_qpair_reset(&ctrlr->ioq[i]); @@ -700,11 +723,25 @@ nvme_ctrlr_start(void *ctrlr_arg) return; } + /* + * The number of qpairs are determined during controller initialization, + * including using NVMe SET_FEATURES/NUMBER_OF_QUEUES to determine the + * HW limit. We call SET_FEATURES again here so that it gets called + * after any reset for controllers that depend on the driver to + * explicit specify how many queues it will use. This value should + * never change between resets, so panic if somehow that does happen. + */ + old_num_io_queues = ctrlr->num_io_queues; if (nvme_ctrlr_set_num_qpairs(ctrlr) != 0) { nvme_ctrlr_fail(ctrlr); return; } + if (old_num_io_queues != ctrlr->num_io_queues) { + panic("num_io_queues changed from %u to %u", old_num_io_queues, + ctrlr->num_io_queues); + } + if (nvme_ctrlr_create_qpairs(ctrlr) != 0) { nvme_ctrlr_fail(ctrlr); return; @@ -727,7 +764,16 @@ nvme_ctrlr_start_config_hook(void *arg) { struct nvme_controller *ctrlr = arg; - nvme_ctrlr_start(ctrlr); + nvme_qpair_reset(&ctrlr->adminq); + nvme_admin_qpair_enable(&ctrlr->adminq); + + if (nvme_ctrlr_set_num_qpairs(ctrlr) == 0 && + nvme_ctrlr_construct_io_qpairs(ctrlr) == 0) + nvme_ctrlr_start(ctrlr); + else + nvme_ctrlr_fail(ctrlr); + + nvme_sysctl_initialize_ctrlr(ctrlr); config_intrhook_disestablish(&ctrlr->config_hook); ctrlr->is_initialized = 1; @@ -780,6 +826,7 @@ nvme_ctrlr_configure_intx(struct nvme_co ctrlr->msix_enabled = 0; ctrlr->num_io_queues = 1; + ctrlr->num_cpus_per_ioq = mp_ncpus; ctrlr->rid = 0; ctrlr->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, &ctrlr->rid, RF_SHAREABLE | RF_ACTIVE); @@ -932,6 +979,7 @@ nvme_ctrlr_setup_interrupts(struct nvme_ device_t dev; int per_cpu_io_queues; int num_vectors_requested, num_vectors_allocated; + int num_vectors_available; dev = ctrlr->dev; per_cpu_io_queues = 1; @@ -940,52 +988,55 @@ nvme_ctrlr_setup_interrupts(struct nvme_ ctrlr->force_intx = 0; TUNABLE_INT_FETCH("hw.nvme.force_intx", &ctrlr->force_intx); - if (ctrlr->force_intx || pci_msix_count(dev) < 2) { + /* + * FreeBSD currently cannot allocate more than about 190 vectors at + * boot, meaning that systems with high core count and many devices + * requesting per-CPU interrupt vectors will not get their full + * allotment. So first, try to allocate as many as we may need to + * understand what is available, then immediately release them. + * Then figure out how many of those we will actually use, based on + * assigning an equal number of cores to each I/O queue. + */ + + /* One vector for per core I/O queue, plus one vector for admin queue. */ + num_vectors_available = min(pci_msix_count(dev), mp_ncpus + 1); + if (pci_alloc_msix(dev, &num_vectors_available) != 0) { + num_vectors_available = 0; + } + pci_release_msi(dev); + + if (ctrlr->force_intx || num_vectors_available < 2) { nvme_ctrlr_configure_intx(ctrlr); return; } - ctrlr->msix_enabled = 1; - if (per_cpu_io_queues) - ctrlr->num_io_queues = mp_ncpus; + ctrlr->num_cpus_per_ioq = NVME_CEILING(mp_ncpus, num_vectors_available + 1); else - ctrlr->num_io_queues = 1; + ctrlr->num_cpus_per_ioq = mp_ncpus; - /* One vector per IO queue, plus one vector for admin queue. */ + ctrlr->num_io_queues = NVME_CEILING(mp_ncpus, ctrlr->num_cpus_per_ioq); num_vectors_requested = ctrlr->num_io_queues + 1; - - if (pci_msix_count(dev) < num_vectors_requested) { - ctrlr->num_io_queues = 1; - num_vectors_requested = 2; /* one for admin, one for I/O */ - } - num_vectors_allocated = num_vectors_requested; + + /* + * Now just allocate the number of vectors we need. This should + * succeed, since we previously called pci_alloc_msix() + * successfully returning at least this many vectors, but just to + * be safe, if something goes wrong just revert to INTx. + */ if (pci_alloc_msix(dev, &num_vectors_allocated) != 0) { nvme_ctrlr_configure_intx(ctrlr); return; } if (num_vectors_allocated < num_vectors_requested) { - if (num_vectors_allocated < 2) { - pci_release_msi(dev); - nvme_ctrlr_configure_intx(ctrlr); - return; - } - - ctrlr->num_io_queues = 1; - /* - * Release whatever vectors were allocated, and just - * reallocate the two needed for the admin and single - * I/O qpair. - */ - num_vectors_allocated = 2; pci_release_msi(dev); - if (pci_alloc_msix(dev, &num_vectors_allocated) != 0) - panic("could not reallocate any vectors\n"); - if (num_vectors_allocated != 2) - panic("could not reallocate 2 vectors\n"); + nvme_ctrlr_configure_intx(ctrlr); + return; } + + ctrlr->msix_enabled = 1; } int @@ -1034,10 +1085,6 @@ nvme_ctrlr_construct(struct nvme_control ctrlr->max_xfer_size = NVME_MAX_XFER_SIZE; nvme_ctrlr_construct_admin_qpair(ctrlr); - status = nvme_ctrlr_construct_io_qpairs(ctrlr); - - if (status != 0) - return (status); ctrlr->cdev = make_dev(&nvme_ctrlr_cdevsw, device_get_unit(dev), UID_ROOT, GID_WHEEL, 0600, "nvme%d", device_get_unit(dev)); @@ -1149,11 +1196,7 @@ nvme_ctrlr_submit_io_request(struct nvme { struct nvme_qpair *qpair; - if (ctrlr->num_io_queues > 1) - qpair = &ctrlr->ioq[curcpu]; - else - qpair = &ctrlr->ioq[0]; - + qpair = &ctrlr->ioq[curcpu / ctrlr->num_cpus_per_ioq]; nvme_qpair_submit_request(qpair, req); } Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Thu Jan 7 16:12:42 2016 (r293327) +++ head/sys/dev/nvme/nvme_private.h Thu Jan 7 16:18:32 2016 (r293328) @@ -265,6 +265,7 @@ struct nvme_controller { uint32_t enable_aborts; uint32_t num_io_queues; + uint32_t num_cpus_per_ioq; /* Fields for tracking progress during controller initialization. */ struct intr_config_hook config_hook; From owner-svn-src-head@freebsd.org Thu Jan 7 16:20:57 2016 Return-Path: Delivered-To: svn-src-head@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 1E9DDA679E8; Thu, 7 Jan 2016 16:20:57 +0000 (UTC) (envelope-from sbruno@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 D11131C93; Thu, 7 Jan 2016 16:20:56 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07GKtgs054280; Thu, 7 Jan 2016 16:20:55 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07GKts7054279; Thu, 7 Jan 2016 16:20:55 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201601071620.u07GKts7054279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 7 Jan 2016 16:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293329 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 16:20:57 -0000 Author: sbruno Date: Thu Jan 7 16:20:55 2016 New Revision: 293329 URL: https://svnweb.freebsd.org/changeset/base/293329 Log: Switch em(4) to the extended RX descriptor format. This matches the e1000/e1000e split in linux. MFC after: 2 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D3447 Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jan 7 16:18:32 2016 (r293328) +++ head/sys/dev/e1000/if_em.c Thu Jan 7 16:20:55 2016 (r293329) @@ -3733,29 +3733,38 @@ em_transmit_checksum_setup(struct tx_rin offload |= CSUM_TCP; tucss = hdr_len; tucso = hdr_len + offsetof(struct tcphdr, th_sum); - /* - * Setting up new checksum offload context for every frames - * takes a lot of processing time for hardware. This also - * reduces performance a lot for small sized frames so avoid - * it if driver can use previously configured checksum - * offload context. - */ - if (txr->last_hw_offload == offload) { - if (offload & CSUM_IP) { - if (txr->last_hw_ipcss == ipcss && - txr->last_hw_ipcso == ipcso && - txr->last_hw_tucss == tucss && - txr->last_hw_tucso == tucso) - return; - } else { - if (txr->last_hw_tucss == tucss && - txr->last_hw_tucso == tucso) - return; - } - } - txr->last_hw_offload = offload; - txr->last_hw_tucss = tucss; - txr->last_hw_tucso = tucso; + /* + * The 82574L can only remember the *last* context used + * regardless of queue that it was use for. We cannot reuse + * contexts on this hardware platform and must generate a new + * context every time. 82574L hardware spec, section 7.2.6, + * second note. + */ + if (adapter->num_queues < 2) { + /* + * Setting up new checksum offload context for every + * frames takes a lot of processing time for hardware. + * This also reduces performance a lot for small sized + * frames so avoid it if driver can use previously + * configured checksum offload context. + */ + if (txr->last_hw_offload == offload) { + if (offload & CSUM_IP) { + if (txr->last_hw_ipcss == ipcss && + txr->last_hw_ipcso == ipcso && + txr->last_hw_tucss == tucss && + txr->last_hw_tucso == tucso) + return; + } else { + if (txr->last_hw_tucss == tucss && + txr->last_hw_tucso == tucso) + return; + } + } + txr->last_hw_offload = offload; + txr->last_hw_tucss = tucss; + txr->last_hw_tucso = tucso; + } /* * Start offset for payload checksum calculation. * End offset for payload checksum calculation. @@ -3771,29 +3780,38 @@ em_transmit_checksum_setup(struct tx_rin *txd_upper |= E1000_TXD_POPTS_TXSM << 8; tucss = hdr_len; tucso = hdr_len + offsetof(struct udphdr, uh_sum); - /* - * Setting up new checksum offload context for every frames - * takes a lot of processing time for hardware. This also - * reduces performance a lot for small sized frames so avoid - * it if driver can use previously configured checksum - * offload context. - */ - if (txr->last_hw_offload == offload) { - if (offload & CSUM_IP) { - if (txr->last_hw_ipcss == ipcss && - txr->last_hw_ipcso == ipcso && - txr->last_hw_tucss == tucss && - txr->last_hw_tucso == tucso) - return; - } else { - if (txr->last_hw_tucss == tucss && - txr->last_hw_tucso == tucso) - return; + /* + * The 82574L can only remember the *last* context used + * regardless of queue that it was use for. We cannot reuse + * contexts on this hardware platform and must generate a new + * context every time. 82574L hardware spec, section 7.2.6, + * second note. + */ + if (adapter->num_queues < 2) { + /* + * Setting up new checksum offload context for every + * frames takes a lot of processing time for hardware. + * This also reduces performance a lot for small sized + * frames so avoid it if driver can use previously + * configured checksum offload context. + */ + if (txr->last_hw_offload == offload) { + if (offload & CSUM_IP) { + if (txr->last_hw_ipcss == ipcss && + txr->last_hw_ipcso == ipcso && + txr->last_hw_tucss == tucss && + txr->last_hw_tucso == tucso) + return; + } else { + if (txr->last_hw_tucss == tucss && + txr->last_hw_tucso == tucso) + return; + } } - } - txr->last_hw_offload = offload; - txr->last_hw_tucss = tucss; - txr->last_hw_tucso = tucso; + txr->last_hw_offload = offload; + txr->last_hw_tucss = tucss; + txr->last_hw_tucso = tucso; + } /* * Start offset for header checksum calculation. * End offset for header checksum calculation. From owner-svn-src-head@freebsd.org Thu Jan 7 16:24:19 2016 Return-Path: Delivered-To: svn-src-head@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 D9FAEA67B5A; Thu, 7 Jan 2016 16:24:19 +0000 (UTC) (envelope-from sbruno@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 998AB1FEC; Thu, 7 Jan 2016 16:24:19 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07GOIFY056909; Thu, 7 Jan 2016 16:24:18 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07GOIfr056908; Thu, 7 Jan 2016 16:24:18 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201601071624.u07GOIfr056908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 7 Jan 2016 16:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293330 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 16:24:19 -0000 Author: sbruno Date: Thu Jan 7 16:24:18 2016 New Revision: 293330 URL: https://svnweb.freebsd.org/changeset/base/293330 Log: Wow, um ... sorry about that. The commit log for this code should have read that it was for EM_MULTIQUEUE. Revert this and try again. Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jan 7 16:20:55 2016 (r293329) +++ head/sys/dev/e1000/if_em.c Thu Jan 7 16:24:18 2016 (r293330) @@ -3733,38 +3733,29 @@ em_transmit_checksum_setup(struct tx_rin offload |= CSUM_TCP; tucss = hdr_len; tucso = hdr_len + offsetof(struct tcphdr, th_sum); - /* - * The 82574L can only remember the *last* context used - * regardless of queue that it was use for. We cannot reuse - * contexts on this hardware platform and must generate a new - * context every time. 82574L hardware spec, section 7.2.6, - * second note. - */ - if (adapter->num_queues < 2) { - /* - * Setting up new checksum offload context for every - * frames takes a lot of processing time for hardware. - * This also reduces performance a lot for small sized - * frames so avoid it if driver can use previously - * configured checksum offload context. - */ - if (txr->last_hw_offload == offload) { - if (offload & CSUM_IP) { - if (txr->last_hw_ipcss == ipcss && - txr->last_hw_ipcso == ipcso && - txr->last_hw_tucss == tucss && - txr->last_hw_tucso == tucso) - return; - } else { - if (txr->last_hw_tucss == tucss && - txr->last_hw_tucso == tucso) - return; - } - } - txr->last_hw_offload = offload; - txr->last_hw_tucss = tucss; - txr->last_hw_tucso = tucso; - } + /* + * Setting up new checksum offload context for every frames + * takes a lot of processing time for hardware. This also + * reduces performance a lot for small sized frames so avoid + * it if driver can use previously configured checksum + * offload context. + */ + if (txr->last_hw_offload == offload) { + if (offload & CSUM_IP) { + if (txr->last_hw_ipcss == ipcss && + txr->last_hw_ipcso == ipcso && + txr->last_hw_tucss == tucss && + txr->last_hw_tucso == tucso) + return; + } else { + if (txr->last_hw_tucss == tucss && + txr->last_hw_tucso == tucso) + return; + } + } + txr->last_hw_offload = offload; + txr->last_hw_tucss = tucss; + txr->last_hw_tucso = tucso; /* * Start offset for payload checksum calculation. * End offset for payload checksum calculation. @@ -3780,38 +3771,29 @@ em_transmit_checksum_setup(struct tx_rin *txd_upper |= E1000_TXD_POPTS_TXSM << 8; tucss = hdr_len; tucso = hdr_len + offsetof(struct udphdr, uh_sum); - /* - * The 82574L can only remember the *last* context used - * regardless of queue that it was use for. We cannot reuse - * contexts on this hardware platform and must generate a new - * context every time. 82574L hardware spec, section 7.2.6, - * second note. - */ - if (adapter->num_queues < 2) { - /* - * Setting up new checksum offload context for every - * frames takes a lot of processing time for hardware. - * This also reduces performance a lot for small sized - * frames so avoid it if driver can use previously - * configured checksum offload context. - */ - if (txr->last_hw_offload == offload) { - if (offload & CSUM_IP) { - if (txr->last_hw_ipcss == ipcss && - txr->last_hw_ipcso == ipcso && - txr->last_hw_tucss == tucss && - txr->last_hw_tucso == tucso) - return; - } else { - if (txr->last_hw_tucss == tucss && - txr->last_hw_tucso == tucso) - return; - } + /* + * Setting up new checksum offload context for every frames + * takes a lot of processing time for hardware. This also + * reduces performance a lot for small sized frames so avoid + * it if driver can use previously configured checksum + * offload context. + */ + if (txr->last_hw_offload == offload) { + if (offload & CSUM_IP) { + if (txr->last_hw_ipcss == ipcss && + txr->last_hw_ipcso == ipcso && + txr->last_hw_tucss == tucss && + txr->last_hw_tucso == tucso) + return; + } else { + if (txr->last_hw_tucss == tucss && + txr->last_hw_tucso == tucso) + return; } - txr->last_hw_offload = offload; - txr->last_hw_tucss = tucss; - txr->last_hw_tucso = tucso; - } + } + txr->last_hw_offload = offload; + txr->last_hw_tucss = tucss; + txr->last_hw_tucso = tucso; /* * Start offset for header checksum calculation. * End offset for header checksum calculation. From owner-svn-src-head@freebsd.org Thu Jan 7 16:27:36 2016 Return-Path: Delivered-To: svn-src-head@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 20D67A67C39; Thu, 7 Jan 2016 16:27:36 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EA4112A7; Thu, 7 Jan 2016 16:27:36 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from [192.168.1.4] (c-24-6-178-251.hsd1.ca.comcast.net [24.6.178.251]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O0L00DU6CDYVL00@mr11p00im-asmtp003.me.com>; Thu, 07 Jan 2016 16:27:35 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-01-07_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1601070287 User-Agent: Microsoft-MacOutlook/0.0.0.151217 Date: Thu, 07 Jan 2016 08:27:34 -0800 Subject: Re: svn commit: r293328 - head/sys/dev/nvme From: Ravi Pokala Sender: "Pokala, Ravi" To: Jim Harris , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <6496C054-6FED-4B41-8EF8-8067E8B6C866@panasas.com> Thread-topic: svn commit: r293328 - head/sys/dev/nvme References: <201601071618.u07GIXdd054147@repo.freebsd.org> In-reply-to: <201601071618.u07GIXdd054147@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 16:27:36 -0000 -----Original Message----- From: on behalf of Jim Harris Date: 2016-01-07, Thursday at 08:18 To: , , Subject: svn commit: r293328 - head/sys/dev/nvme >Author: jimharris >Date: Thu Jan 7 16:18:32 2016 >New Revision: 293328 >URL: https://svnweb.freebsd.org/changeset/base/293328 > >... > >Modified: head/sys/dev/nvme/nvme_ctrlr.c >============================================================================== >--- head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:12:42 2016 (r293327) >+++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:18:32 2016 (r293328) >@@ -42,6 +42,12 @@ __FBSDID("$FreeBSD$"); > > #include "nvme_private.h" > >+/* >+ * Used for calculating number of CPUs to assign to each core and number of I/O >+ * queues to allocate per controller. >+ */ >+#define NVME_CEILING(num, div) ((((num) - 1) / (div)) + 1) >+ > >... I'm surprised that this isn't in , along with roundup()/rounddown()/etc. Finding the ceiling like this is probably pretty common, so shouldn't it be added to the common header so everyone can use it? -Ravi (rpokala@) From owner-svn-src-head@freebsd.org Thu Jan 7 16:42:49 2016 Return-Path: Delivered-To: svn-src-head@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 B9D8CA660B7; Thu, 7 Jan 2016 16:42:49 +0000 (UTC) (envelope-from sbruno@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 865A81D15; Thu, 7 Jan 2016 16:42:49 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07GgmdH062909; Thu, 7 Jan 2016 16:42:48 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07GgmRt062906; Thu, 7 Jan 2016 16:42:48 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201601071642.u07GgmRt062906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 7 Jan 2016 16:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293331 - in head/sys/dev: e1000 netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 16:42:49 -0000 Author: sbruno Date: Thu Jan 7 16:42:48 2016 New Revision: 293331 URL: https://svnweb.freebsd.org/changeset/base/293331 Log: Switch em(4) to the extended RX descriptor format. This matches the e1000/e1000e split in linux. Split rxbuffer and txbuffer apart to support the new RX descriptor format structures. Move rxbuffer manipulation to em_setup_rxdesc() to unify the new behavior changes. Add a RSSKEYLEN macro for help in generating the RSSKEY data structures in the card. Change em_receive_checksum() to process the new rxdescriptor format status bit. MFC after: 2 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D3447 Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h head/sys/dev/netmap/if_em_netmap.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jan 7 16:24:18 2016 (r293330) +++ head/sys/dev/e1000/if_em.c Thu Jan 7 16:42:48 2016 (r293331) @@ -260,7 +260,9 @@ static bool em_rxeof(struct rx_ring *, i #ifndef __NO_STRICT_ALIGNMENT static int em_fixup_rx(struct rx_ring *); #endif -static void em_receive_checksum(struct e1000_rx_desc *, struct mbuf *); +static void em_setup_rxdesc(union e1000_rx_desc_extended *, + const struct em_rxbuffer *rxbuf); +static void em_receive_checksum(uint32_t status, struct mbuf *); static void em_transmit_checksum_setup(struct tx_ring *, struct mbuf *, int, struct ip *, u32 *, u32 *); static void em_tso_setup(struct tx_ring *, struct mbuf *, int, struct ip *, @@ -631,7 +633,7 @@ em_attach(device_t dev) } else adapter->num_tx_desc = em_txd; - if (((em_rxd * sizeof(struct e1000_rx_desc)) % EM_DBA_ALIGN) != 0 || + if (((em_rxd * sizeof(union e1000_rx_desc_extended)) % EM_DBA_ALIGN) != 0 || (em_rxd > EM_MAX_RXD) || (em_rxd < EM_MIN_RXD)) { device_printf(dev, "Using %d RX descriptors instead of %d!\n", EM_DEFAULT_RXD, em_rxd); @@ -1872,7 +1874,7 @@ em_xmit(struct tx_ring *txr, struct mbuf struct adapter *adapter = txr->adapter; bus_dma_segment_t segs[EM_MAX_SCATTER]; bus_dmamap_t map; - struct em_buffer *tx_buffer, *tx_buffer_mapped; + struct em_txbuffer *tx_buffer, *tx_buffer_mapped; struct e1000_tx_desc *ctxd = NULL; struct mbuf *m_head; struct ether_header *eh; @@ -3296,7 +3298,7 @@ em_allocate_queues(struct adapter *adapt * Next the RX queues... */ rsize = roundup2(adapter->num_rx_desc * - sizeof(struct e1000_rx_desc), EM_DBA_ALIGN); + sizeof(union e1000_rx_desc_extended), EM_DBA_ALIGN); for (int i = 0; i < adapter->num_queues; i++, rxconf++) { rxr = &adapter->rx_rings[i]; rxr->adapter = adapter; @@ -3314,7 +3316,7 @@ em_allocate_queues(struct adapter *adapt error = ENOMEM; goto err_rx_desc; } - rxr->rx_base = (struct e1000_rx_desc *)rxr->rxdma.dma_vaddr; + rxr->rx_base = (union e1000_rx_desc_extended *)rxr->rxdma.dma_vaddr; bzero((void *)rxr->rx_base, rsize); /* Allocate receive buffers for the ring*/ @@ -3357,7 +3359,7 @@ em_allocate_transmit_buffers(struct tx_r { struct adapter *adapter = txr->adapter; device_t dev = adapter->dev; - struct em_buffer *txbuf; + struct em_txbuffer *txbuf; int error, i; /* @@ -3380,7 +3382,7 @@ em_allocate_transmit_buffers(struct tx_r } if (!(txr->tx_buffers = - (struct em_buffer *) malloc(sizeof(struct em_buffer) * + (struct em_txbuffer *) malloc(sizeof(struct em_txbuffer) * adapter->num_tx_desc, M_DEVBUF, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate tx_buffer memory\n"); error = ENOMEM; @@ -3413,7 +3415,7 @@ static void em_setup_transmit_ring(struct tx_ring *txr) { struct adapter *adapter = txr->adapter; - struct em_buffer *txbuf; + struct em_txbuffer *txbuf; int i; #ifdef DEV_NETMAP struct netmap_slot *slot; @@ -3632,7 +3634,7 @@ static void em_free_transmit_buffers(struct tx_ring *txr) { struct adapter *adapter = txr->adapter; - struct em_buffer *txbuf; + struct em_txbuffer *txbuf; INIT_DEBUGOUT("free_transmit_ring: begin"); @@ -3699,7 +3701,7 @@ em_transmit_checksum_setup(struct tx_rin { struct adapter *adapter = txr->adapter; struct e1000_context_desc *TXD = NULL; - struct em_buffer *tx_buffer; + struct em_txbuffer *tx_buffer; int cur, hdr_len; u32 cmd = 0; u16 offload = 0; @@ -3836,7 +3838,7 @@ em_tso_setup(struct tx_ring *txr, struct { struct adapter *adapter = txr->adapter; struct e1000_context_desc *TXD; - struct em_buffer *tx_buffer; + struct em_txbuffer *tx_buffer; int cur, hdr_len; /* @@ -3914,7 +3916,7 @@ em_txeof(struct tx_ring *txr) { struct adapter *adapter = txr->adapter; int first, last, done, processed; - struct em_buffer *tx_buffer; + struct em_txbuffer *tx_buffer; struct e1000_tx_desc *tx_desc, *eop_desc; if_t ifp = adapter->ifp; @@ -4020,7 +4022,6 @@ em_txeof(struct tx_ring *txr) txr->busy = EM_TX_IDLE; } - /********************************************************************* * * Refresh RX descriptor mbufs from system mbuf buffer pool. @@ -4031,8 +4032,8 @@ em_refresh_mbufs(struct rx_ring *rxr, in { struct adapter *adapter = rxr->adapter; struct mbuf *m; - bus_dma_segment_t segs[1]; - struct em_buffer *rxbuf; + bus_dma_segment_t segs; + struct em_rxbuffer *rxbuf; int i, j, error, nsegs; bool cleaned = FALSE; @@ -4067,7 +4068,7 @@ em_refresh_mbufs(struct rx_ring *rxr, in /* Use bus_dma machinery to setup the memory mapping */ error = bus_dmamap_load_mbuf_sg(rxr->rxtag, rxbuf->map, - m, segs, &nsegs, BUS_DMA_NOWAIT); + m, &segs, &nsegs, BUS_DMA_NOWAIT); if (error != 0) { printf("Refresh mbufs: hdr dmamap load" " failure - %d\n", error); @@ -4076,9 +4077,10 @@ em_refresh_mbufs(struct rx_ring *rxr, in goto update; } rxbuf->m_head = m; + rxbuf->paddr = segs.ds_addr; bus_dmamap_sync(rxr->rxtag, rxbuf->map, BUS_DMASYNC_PREREAD); - rxr->rx_base[i].buffer_addr = htole64(segs[0].ds_addr); + em_setup_rxdesc(&rxr->rx_base[i], rxbuf); cleaned = TRUE; i = j; /* Next is precalulated for us */ @@ -4113,10 +4115,10 @@ em_allocate_receive_buffers(struct rx_ri { struct adapter *adapter = rxr->adapter; device_t dev = adapter->dev; - struct em_buffer *rxbuf; + struct em_rxbuffer *rxbuf; int error; - rxr->rx_buffers = malloc(sizeof(struct em_buffer) * + rxr->rx_buffers = malloc(sizeof(struct em_rxbuffer) * adapter->num_rx_desc, M_DEVBUF, M_NOWAIT | M_ZERO); if (rxr->rx_buffers == NULL) { device_printf(dev, "Unable to allocate rx_buffer memory\n"); @@ -4169,7 +4171,7 @@ static int em_setup_receive_ring(struct rx_ring *rxr) { struct adapter *adapter = rxr->adapter; - struct em_buffer *rxbuf; + struct em_rxbuffer *rxbuf; bus_dma_segment_t seg[1]; int rsize, nsegs, error = 0; #ifdef DEV_NETMAP @@ -4181,7 +4183,7 @@ em_setup_receive_ring(struct rx_ring *rx /* Clear the ring contents */ EM_RX_LOCK(rxr); rsize = roundup2(adapter->num_rx_desc * - sizeof(struct e1000_rx_desc), EM_DBA_ALIGN); + sizeof(union e1000_rx_desc_extended), EM_DBA_ALIGN); bzero((void *)rxr->rx_base, rsize); #ifdef DEV_NETMAP slot = netmap_reset(na, NR_RX, rxr->me, 0); @@ -4212,8 +4214,7 @@ em_setup_receive_ring(struct rx_ring *rx addr = PNMB(na, slot + si, &paddr); netmap_load_map(na, rxr->rxtag, rxbuf->map, addr); - /* Update descriptor */ - rxr->rx_base[j].buffer_addr = htole64(paddr); + em_setup_rxdesc(&rxr->rx_base[j], rxbuf); continue; } #endif /* DEV_NETMAP */ @@ -4239,8 +4240,8 @@ em_setup_receive_ring(struct rx_ring *rx bus_dmamap_sync(rxr->rxtag, rxbuf->map, BUS_DMASYNC_PREREAD); - /* Update descriptor */ - rxr->rx_base[j].buffer_addr = htole64(seg[0].ds_addr); + rxbuf->paddr = seg[0].ds_addr; + em_setup_rxdesc(&rxr->rx_base[j], rxbuf); } rxr->next_to_check = 0; rxr->next_to_refresh = 0; @@ -4277,7 +4278,7 @@ fail: for (int i = 0; i < q; ++i) { rxr = &adapter->rx_rings[i]; for (int n = 0; n < adapter->num_rx_desc; n++) { - struct em_buffer *rxbuf; + struct em_rxbuffer *rxbuf; rxbuf = &rxr->rx_buffers[n]; if (rxbuf->m_head != NULL) { bus_dmamap_sync(rxr->rxtag, rxbuf->map, @@ -4324,7 +4325,7 @@ static void em_free_receive_buffers(struct rx_ring *rxr) { struct adapter *adapter = rxr->adapter; - struct em_buffer *rxbuf = NULL; + struct em_rxbuffer *rxbuf = NULL; INIT_DEBUGOUT("free_receive_buffers: begin"); @@ -4366,11 +4367,10 @@ em_free_receive_buffers(struct rx_ring * static void em_initialize_receive_unit(struct adapter *adapter) { - struct rx_ring *rxr = adapter->rx_rings; + struct rx_ring *rxr = adapter->rx_rings; if_t ifp = adapter->ifp; struct e1000_hw *hw = &adapter->hw; - u64 bus_addr; - u32 rctl, rxcsum; + u32 rctl, rxcsum, rfctl; INIT_DEBUGOUT("em_initialize_receive_units: begin"); @@ -4383,6 +4383,25 @@ em_initialize_receive_unit(struct adapte if ((hw->mac.type != e1000_82574) && (hw->mac.type != e1000_82583)) E1000_WRITE_REG(hw, E1000_RCTL, rctl & ~E1000_RCTL_EN); + /* Setup the Receive Control Register */ + rctl &= ~(3 << E1000_RCTL_MO_SHIFT); + rctl |= E1000_RCTL_EN | E1000_RCTL_BAM | + E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF | + (hw->mac.mc_filter_type << E1000_RCTL_MO_SHIFT); + + /* Do not store bad packets */ + rctl &= ~E1000_RCTL_SBP; + + /* Enable Long Packet receive */ + if (if_getmtu(ifp) > ETHERMTU) + rctl |= E1000_RCTL_LPE; + else + rctl &= ~E1000_RCTL_LPE; + + /* Strip the CRC */ + if (!em_disable_crc_stripping) + rctl |= E1000_RCTL_SECRC; + E1000_WRITE_REG(&adapter->hw, E1000_RADV, adapter->rx_abs_int_delay.value); @@ -4394,20 +4413,21 @@ em_initialize_receive_unit(struct adapte */ E1000_WRITE_REG(hw, E1000_ITR, DEFAULT_ITR); + /* Use extended rx descriptor formats */ + rfctl = E1000_READ_REG(hw, E1000_RFCTL); + rfctl |= E1000_RFCTL_EXTEN; /* ** When using MSIX interrupts we need to throttle ** using the EITR register (82574 only) */ if (hw->mac.type == e1000_82574) { - u32 rfctl; for (int i = 0; i < 4; i++) E1000_WRITE_REG(hw, E1000_EITR_82574(i), DEFAULT_ITR); /* Disable accelerated acknowledge */ - rfctl = E1000_READ_REG(hw, E1000_RFCTL); rfctl |= E1000_RFCTL_ACK_DIS; - E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); } + E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); if (if_getcapenable(ifp) & IFCAP_RXCSUM) { @@ -4424,38 +4444,44 @@ em_initialize_receive_unit(struct adapte E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); #ifdef EM_MULTIQUEUE +#define RSSKEYLEN 10 if (adapter->num_queues > 1) { - uint32_t rss_key[10]; - uint32_t reta; + uint8_t rss_key[4 * RSSKEYLEN]; + uint32_t reta = 0; int i; /* * Configure RSS key */ arc4rand(rss_key, sizeof(rss_key), 0); - for (i = 0; i < 10; ++i) - E1000_WRITE_REG_ARRAY(hw,E1000_RSSRK(0), i, rss_key[i]); + for (i = 0; i < RSSKEYLEN; ++i) { + uint32_t rssrk = 0; + + rssrk = EM_RSSRK_VAL(rss_key, i); + E1000_WRITE_REG(hw,E1000_RSSRK(i), rssrk); + } /* * Configure RSS redirect table in following fashion: * (hash & ring_cnt_mask) == rdr_table[(hash & rdr_table_mask)] */ - reta = 0; - for (i = 0; i < 4; ++i) { + for (i = 0; i < sizeof(reta); ++i) { uint32_t q; + q = (i % adapter->num_queues) << 7; reta |= q << (8 * i); } - for (i = 0; i < 32; ++i) + + for (i = 0; i < 32; ++i) { E1000_WRITE_REG(hw, E1000_RETA(i), reta); + } E1000_WRITE_REG(hw, E1000_MRQC, E1000_MRQC_RSS_ENABLE_2Q | E1000_MRQC_RSS_FIELD_IPV4_TCP | E1000_MRQC_RSS_FIELD_IPV4 | E1000_MRQC_RSS_FIELD_IPV6_TCP_EX | E1000_MRQC_RSS_FIELD_IPV6_EX | - E1000_MRQC_RSS_FIELD_IPV6 | - E1000_MRQC_RSS_FIELD_IPV6_TCP); + E1000_MRQC_RSS_FIELD_IPV6); } #endif /* @@ -4470,11 +4496,11 @@ em_initialize_receive_unit(struct adapte for (int i = 0; i < adapter->num_queues; i++, rxr++) { /* Setup the Base and Length of the Rx Descriptor Ring */ + u64 bus_addr = rxr->rxdma.dma_paddr; u32 rdt = adapter->num_rx_desc - 1; /* default */ - bus_addr = rxr->rxdma.dma_paddr; E1000_WRITE_REG(hw, E1000_RDLEN(i), - adapter->num_rx_desc * sizeof(struct e1000_rx_desc)); + adapter->num_rx_desc * sizeof(union e1000_rx_desc_extended)); E1000_WRITE_REG(hw, E1000_RDBAH(i), (u32)(bus_addr >> 32)); E1000_WRITE_REG(hw, E1000_RDBAL(i), (u32)bus_addr); /* Setup the Head and Tail Descriptor Pointers */ @@ -4505,14 +4531,13 @@ em_initialize_receive_unit(struct adapte (if_getmtu(ifp) > ETHERMTU)) { u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(0)); E1000_WRITE_REG(hw, E1000_RXDCTL(0), rxdctl | 3); - } else if ((adapter->hw.mac.type == e1000_82574) && - (if_getmtu(ifp) > ETHERMTU)) { + } else if (adapter->hw.mac.type == e1000_82574) { for (int i = 0; i < adapter->num_queues; i++) { u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(i)); - rxdctl |= 0x20; /* PTHRESH */ - rxdctl |= 4 << 8; /* HTHRESH */ - rxdctl |= 4 << 16;/* WTHRESH */ + rxdctl |= 0x20; /* PTHRESH */ + rxdctl |= 4 << 8; /* HTHRESH */ + rxdctl |= 4 << 16;/* WTHRESH */ rxdctl |= 1 << 24; /* Switch to granularity */ E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } @@ -4525,19 +4550,8 @@ em_initialize_receive_unit(struct adapte e1000_lv_jumbo_workaround_ich8lan(hw, FALSE); } - /* Setup the Receive Control Register */ - rctl &= ~(3 << E1000_RCTL_MO_SHIFT); - rctl |= E1000_RCTL_EN | E1000_RCTL_BAM | - E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF | - (hw->mac.mc_filter_type << E1000_RCTL_MO_SHIFT); - - /* Strip the CRC */ - if (!em_disable_crc_stripping) - rctl |= E1000_RCTL_SECRC; - /* Make sure VLAN Filters are off */ rctl &= ~E1000_RCTL_VFE; - rctl &= ~E1000_RCTL_SBP; if (adapter->rx_mbuf_sz == MCLBYTES) rctl |= E1000_RCTL_SZ_2048; @@ -4546,11 +4560,8 @@ em_initialize_receive_unit(struct adapte else if (adapter->rx_mbuf_sz > MJUMPAGESIZE) rctl |= E1000_RCTL_SZ_8192 | E1000_RCTL_BSEX; - if (if_getmtu(ifp) > ETHERMTU) - rctl |= E1000_RCTL_LPE; - else - rctl &= ~E1000_RCTL_LPE; - + /* ensure we clear use DTYPE of 00 here */ + rctl &= ~0x00000C00; /* Write out the settings */ E1000_WRITE_REG(hw, E1000_RCTL, rctl); @@ -4575,11 +4586,11 @@ em_rxeof(struct rx_ring *rxr, int count, struct adapter *adapter = rxr->adapter; if_t ifp = adapter->ifp; struct mbuf *mp, *sendmp; - u8 status = 0; + u32 status = 0; u16 len; int i, processed, rxdone = 0; bool eop; - struct e1000_rx_desc *cur; + union e1000_rx_desc_extended *cur; EM_RX_LOCK(rxr); @@ -4596,21 +4607,20 @@ em_rxeof(struct rx_ring *rxr, int count, #endif /* DEV_NETMAP */ for (i = rxr->next_to_check, processed = 0; count != 0;) { - if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) break; cur = &rxr->rx_base[i]; - status = cur->status; + status = le32toh(cur->wb.upper.status_error); mp = sendmp = NULL; if ((status & E1000_RXD_STAT_DD) == 0) break; - len = le16toh(cur->length); + len = le16toh(cur->wb.upper.length); eop = (status & E1000_RXD_STAT_EOP) != 0; - if ((cur->errors & E1000_RXD_ERR_FRAME_ERR_MASK) || + if ((status & E1000_RXDEXT_ERR_FRAME_ERR_MASK) || (rxr->discard == TRUE)) { adapter->dropped_pkts++; ++rxr->rx_discarded; @@ -4647,7 +4657,7 @@ em_rxeof(struct rx_ring *rxr, int count, sendmp = rxr->fmp; if_setrcvif(sendmp, ifp); if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - em_receive_checksum(cur, sendmp); + em_receive_checksum(status, sendmp); #ifndef __NO_STRICT_ALIGNMENT if (adapter->hw.mac.max_frame_size > (MCLBYTES - ETHER_ALIGN) && @@ -4656,7 +4666,7 @@ em_rxeof(struct rx_ring *rxr, int count, #endif if (status & E1000_RXD_STAT_VP) { if_setvtag(sendmp, - le16toh(cur->special)); + le16toh(cur->wb.upper.vlan)); sendmp->m_flags |= M_VLANTAG; } #ifndef __NO_STRICT_ALIGNMENT @@ -4670,7 +4680,7 @@ next_desc: BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* Zero out the receive descriptors status. */ - cur->status = 0; + cur->wb.upper.status_error &= htole32(~0xFF); ++rxdone; /* cumulative for POLL */ ++processed; @@ -4709,7 +4719,7 @@ next_desc: static __inline void em_rx_discard(struct rx_ring *rxr, int i) { - struct em_buffer *rbuf; + struct em_rxbuffer *rbuf; rbuf = &rxr->rx_buffers[i]; bus_dmamap_unload(rxr->rxtag, rbuf->map); @@ -4781,6 +4791,14 @@ em_fixup_rx(struct rx_ring *rxr) } #endif +static void +em_setup_rxdesc(union e1000_rx_desc_extended *rxd, const struct em_rxbuffer *rxbuf) +{ + rxd->read.buffer_addr = htole64(rxbuf->paddr); + /* DD bits must be cleared */ + rxd->wb.upper.status_error= 0; +} + /********************************************************************* * * Verify that the hardware indicated that the checksum is valid. @@ -4789,23 +4807,27 @@ em_fixup_rx(struct rx_ring *rxr) * *********************************************************************/ static void -em_receive_checksum(struct e1000_rx_desc *rx_desc, struct mbuf *mp) +em_receive_checksum(uint32_t status, struct mbuf *mp) { mp->m_pkthdr.csum_flags = 0; /* Ignore Checksum bit is set */ - if (rx_desc->status & E1000_RXD_STAT_IXSM) + if (status & E1000_RXD_STAT_IXSM) return; - if (rx_desc->errors & (E1000_RXD_ERR_TCPE | E1000_RXD_ERR_IPE)) - return; - - /* IP Checksum Good? */ - if (rx_desc->status & E1000_RXD_STAT_IPCS) + /* If the IP checksum exists and there is no IP Checksum error */ + if ((status & (E1000_RXD_STAT_IPCS | E1000_RXDEXT_STATERR_IPE)) == + E1000_RXD_STAT_IPCS) { mp->m_pkthdr.csum_flags = (CSUM_IP_CHECKED | CSUM_IP_VALID); + } /* TCP or UDP checksum */ - if (rx_desc->status & (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS)) { + if ((status & (E1000_RXD_STAT_TCPCS | E1000_RXDEXT_STATERR_TCPE)) == + E1000_RXD_STAT_TCPCS) { + mp->m_pkthdr.csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + mp->m_pkthdr.csum_data = htons(0xffff); + } + if (status & E1000_RXD_STAT_UDPCS) { mp->m_pkthdr.csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); mp->m_pkthdr.csum_data = htons(0xffff); } Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Thu Jan 7 16:24:18 2016 (r293330) +++ head/sys/dev/e1000/if_em.h Thu Jan 7 16:42:48 2016 (r293331) @@ -330,7 +330,7 @@ struct tx_ring { struct taskqueue *tq; u32 next_avail_desc; u32 next_to_clean; - struct em_buffer *tx_buffers; + struct em_txbuffer *tx_buffers; volatile u16 tx_avail; u32 tx_tso; /* last tx was tso */ u16 last_hw_offload; @@ -362,11 +362,11 @@ struct rx_ring { u32 payload; struct task rx_task; struct taskqueue *tq; - struct e1000_rx_desc *rx_base; + union e1000_rx_desc_extended *rx_base; struct em_dma_alloc rxdma; u32 next_to_refresh; u32 next_to_check; - struct em_buffer *rx_buffers; + struct em_rxbuffer *rx_buffers; struct mbuf *fmp; struct mbuf *lmp; @@ -499,12 +499,19 @@ typedef struct _em_vendor_info_t { unsigned int index; } em_vendor_info_t; -struct em_buffer { +struct em_txbuffer { int next_eop; /* Index of the desc to watch */ struct mbuf *m_head; bus_dmamap_t map; /* bus_dma map for packet */ }; +struct em_rxbuffer { + int next_eop; /* Index of the desc to watch */ + struct mbuf *m_head; + bus_dmamap_t map; /* bus_dma map for packet */ + bus_addr_t paddr; +}; + /* ** Find the number of unrefreshed RX descriptors @@ -541,4 +548,9 @@ e1000_rx_unrefreshed(struct rx_ring *rxr #define EM_TX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->tx_mtx, MA_OWNED) #define EM_RX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->rx_mtx, MA_OWNED) +#define EM_RSSRK_SIZE 4 +#define EM_RSSRK_VAL(key, i) (key[(i) * EM_RSSRK_SIZE] | \ + key[(i) * EM_RSSRK_SIZE + 1] << 8 | \ + key[(i) * EM_RSSRK_SIZE + 2] << 16 | \ + key[(i) * EM_RSSRK_SIZE + 3] << 24) #endif /* _EM_H_DEFINED_ */ Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Thu Jan 7 16:24:18 2016 (r293330) +++ head/sys/dev/netmap/if_em_netmap.h Thu Jan 7 16:42:48 2016 (r293331) @@ -148,7 +148,7 @@ em_netmap_txsync(struct netmap_kring *kr /* device-specific */ struct e1000_tx_desc *curr = &txr->tx_base[nic_i]; - struct em_buffer *txbuf = &txr->tx_buffers[nic_i]; + struct em_txbuffer *txbuf = &txr->tx_buffers[nic_i]; int flags = (slot->flags & NS_REPORT || nic_i == 0 || nic_i == report_frequency) ? E1000_TXD_CMD_RS : 0; @@ -239,12 +239,12 @@ em_netmap_rxsync(struct netmap_kring *kr nm_i = netmap_idx_n2k(kring, nic_i); for (n = 0; ; n++) { // XXX no need to count - struct e1000_rx_desc *curr = &rxr->rx_base[nic_i]; - uint32_t staterr = le32toh(curr->status); + union e1000_rx_desc_extended *curr = &rxr->rx_base[nic_i]; + uint32_t staterr = le32toh(curr->wb.upper.status_error); if ((staterr & E1000_RXD_STAT_DD) == 0) break; - ring->slot[nm_i].len = le16toh(curr->length); + ring->slot[nm_i].len = le16toh(curr->wb.upper.length); ring->slot[nm_i].flags = slot_flags; bus_dmamap_sync(rxr->rxtag, rxr->rx_buffers[nic_i].map, BUS_DMASYNC_POSTREAD); @@ -271,19 +271,19 @@ em_netmap_rxsync(struct netmap_kring *kr uint64_t paddr; void *addr = PNMB(na, slot, &paddr); - struct e1000_rx_desc *curr = &rxr->rx_base[nic_i]; - struct em_buffer *rxbuf = &rxr->rx_buffers[nic_i]; + union e1000_rx_desc_extended *curr = &rxr->rx_base[nic_i]; + struct em_rxbuffer *rxbuf = &rxr->rx_buffers[nic_i]; if (addr == NETMAP_BUF_BASE(na)) /* bad buf */ goto ring_reset; if (slot->flags & NS_BUF_CHANGED) { /* buffer has changed, reload map */ - curr->buffer_addr = htole64(paddr); + curr->read.buffer_addr = htole64(paddr); netmap_reload_map(na, rxr->rxtag, rxbuf->map, addr); slot->flags &= ~NS_BUF_CHANGED; } - curr->status = 0; + curr->wb.upper.status_error = 0; bus_dmamap_sync(rxr->rxtag, rxbuf->map, BUS_DMASYNC_PREREAD); nm_i = nm_next(nm_i, lim); From owner-svn-src-head@freebsd.org Thu Jan 7 16:48:49 2016 Return-Path: Delivered-To: svn-src-head@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 2395CA6626E; Thu, 7 Jan 2016 16:48:49 +0000 (UTC) (envelope-from sbruno@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 D58A2132A; Thu, 7 Jan 2016 16:48:48 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07Gmlv7063502; Thu, 7 Jan 2016 16:48:47 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07Gmlvm063501; Thu, 7 Jan 2016 16:48:47 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201601071648.u07Gmlvm063501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 7 Jan 2016 16:48:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293332 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 16:48:49 -0000 Author: sbruno Date: Thu Jan 7 16:48:47 2016 New Revision: 293332 URL: https://svnweb.freebsd.org/changeset/base/293332 Log: Disable the reuse of checksum offload context descriptors in the case of multiple queues in em(4). Document errata in the code. MFC after: 2 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D3995 Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jan 7 16:42:48 2016 (r293331) +++ head/sys/dev/e1000/if_em.c Thu Jan 7 16:48:47 2016 (r293332) @@ -3735,29 +3735,38 @@ em_transmit_checksum_setup(struct tx_rin offload |= CSUM_TCP; tucss = hdr_len; tucso = hdr_len + offsetof(struct tcphdr, th_sum); - /* - * Setting up new checksum offload context for every frames - * takes a lot of processing time for hardware. This also - * reduces performance a lot for small sized frames so avoid - * it if driver can use previously configured checksum - * offload context. - */ - if (txr->last_hw_offload == offload) { - if (offload & CSUM_IP) { - if (txr->last_hw_ipcss == ipcss && - txr->last_hw_ipcso == ipcso && - txr->last_hw_tucss == tucss && - txr->last_hw_tucso == tucso) - return; - } else { - if (txr->last_hw_tucss == tucss && - txr->last_hw_tucso == tucso) - return; - } - } - txr->last_hw_offload = offload; - txr->last_hw_tucss = tucss; - txr->last_hw_tucso = tucso; + /* + * The 82574L can only remember the *last* context used + * regardless of queue that it was use for. We cannot reuse + * contexts on this hardware platform and must generate a new + * context every time. 82574L hardware spec, section 7.2.6, + * second note. + */ + if (adapter->num_queues < 2) { + /* + * Setting up new checksum offload context for every + * frames takes a lot of processing time for hardware. + * This also reduces performance a lot for small sized + * frames so avoid it if driver can use previously + * configured checksum offload context. + */ + if (txr->last_hw_offload == offload) { + if (offload & CSUM_IP) { + if (txr->last_hw_ipcss == ipcss && + txr->last_hw_ipcso == ipcso && + txr->last_hw_tucss == tucss && + txr->last_hw_tucso == tucso) + return; + } else { + if (txr->last_hw_tucss == tucss && + txr->last_hw_tucso == tucso) + return; + } + } + txr->last_hw_offload = offload; + txr->last_hw_tucss = tucss; + txr->last_hw_tucso = tucso; + } /* * Start offset for payload checksum calculation. * End offset for payload checksum calculation. @@ -3773,29 +3782,38 @@ em_transmit_checksum_setup(struct tx_rin *txd_upper |= E1000_TXD_POPTS_TXSM << 8; tucss = hdr_len; tucso = hdr_len + offsetof(struct udphdr, uh_sum); - /* - * Setting up new checksum offload context for every frames - * takes a lot of processing time for hardware. This also - * reduces performance a lot for small sized frames so avoid - * it if driver can use previously configured checksum - * offload context. - */ - if (txr->last_hw_offload == offload) { - if (offload & CSUM_IP) { - if (txr->last_hw_ipcss == ipcss && - txr->last_hw_ipcso == ipcso && - txr->last_hw_tucss == tucss && - txr->last_hw_tucso == tucso) - return; - } else { - if (txr->last_hw_tucss == tucss && - txr->last_hw_tucso == tucso) - return; + /* + * The 82574L can only remember the *last* context used + * regardless of queue that it was use for. We cannot reuse + * contexts on this hardware platform and must generate a new + * context every time. 82574L hardware spec, section 7.2.6, + * second note. + */ + if (adapter->num_queues < 2) { + /* + * Setting up new checksum offload context for every + * frames takes a lot of processing time for hardware. + * This also reduces performance a lot for small sized + * frames so avoid it if driver can use previously + * configured checksum offload context. + */ + if (txr->last_hw_offload == offload) { + if (offload & CSUM_IP) { + if (txr->last_hw_ipcss == ipcss && + txr->last_hw_ipcso == ipcso && + txr->last_hw_tucss == tucss && + txr->last_hw_tucso == tucso) + return; + } else { + if (txr->last_hw_tucss == tucss && + txr->last_hw_tucso == tucso) + return; + } } - } - txr->last_hw_offload = offload; - txr->last_hw_tucss = tucss; - txr->last_hw_tucso = tucso; + txr->last_hw_offload = offload; + txr->last_hw_tucss = tucss; + txr->last_hw_tucso = tucso; + } /* * Start offset for header checksum calculation. * End offset for header checksum calculation. From owner-svn-src-head@freebsd.org Thu Jan 7 17:02:05 2016 Return-Path: Delivered-To: svn-src-head@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 B6F9DA66A92; Thu, 7 Jan 2016 17:02:05 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 7A6691329; Thu, 7 Jan 2016 17:02:05 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [192.168.1.1] (unknown [192.168.1.1]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id B93AEDB50; Thu, 7 Jan 2016 17:02:04 +0000 (UTC) Subject: Re: svn commit: r293227 - head/etc To: Bruce Evans References: <201601052120.u05LKlQw074919@repo.freebsd.org> <1452038404.1320.46.camel@freebsd.org> <20160106125617.E968@besplex.bde.org> <5360EA7A-399F-4679-B58F-62D0112EA481@shxd.cx> <568C883C.5050006@freebsd.org> <20160106163237.L1563@besplex.bde.org> Cc: Devin Teske , Ian Lepore , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske From: Allan Jude Message-ID: <568E9A06.8090500@freebsd.org> Date: Thu, 7 Jan 2016 12:01:58 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160106163237.L1563@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 17:02:05 -0000 On 2016-01-06 01:40, Bruce Evans wrote: > On Tue, 5 Jan 2016, Allan Jude wrote: > >> On 2016-01-05 22:16, Devin Teske wrote: >>> This e-mail is extremely hard to parse and I think you are mistaken. >>> >>> The -f flag is more than just a counter to a possible -i >>> >>> Try to rm a file that has schg >>> You will get a prompt without -i >>> Adding -f will abate the prompt to attempt override of schg flag. > > I forgot about the permissions check. Normally root has permission to > write anything, but some file flags change this. The schg flag is > handled bogusly: rm prompts without -f, but schg prevents removal if > you answer 'y'. The uchg flag is handled better. rm has special > undocumented code to handle it, mainly so that rm -rf blows it away. > Without -f, rm prompts but the the special code removes uchg so that > removal is possible. > > The permissions check only applies to the file. Removal doesn't > depend on the file's permissions. It only depends on the file's flags > and the directory's permissions and flags. rm agrees with its man > page and doesn't prompt if the file is writable but the directory is > unwritable. The directory permissions don't stop root either, but > immutable directories do. Since there is no prompt, -f has no effect > on anyone in this case. > >>> There are more conditions in rm that lead to a prompt than simply >>> those conditions involving -i and adding -f abates them all. > > It isn't clear what these are. POSIX only says that there is a prompt > without -i for files which don't have write permission (to themselves). > FreeBSD's man page should say more about how this extended for file > flags, but actually says nothing for file flags and is less clear than > POSIX for ordinary permissions. > >> I think this is kind of a poor UI design of rm(1) honestly. It seems >> like what we need is a 'never be interactive' flag, that won't surpress >> the error message about the schg'd file, or read-only file system, but >> won't try to prompt for it. >> >> Although adding a new flag to rm(1) at this point probably doesn't make >> sense. > > It already has this flag, namely -f. This is what I started out to say. > -f never suppresses errors except ENOENT for a non-existent file. What it > suppresses is prompts. Since the uchg hack involves a prompt, -f also > changes the semantics for removing user-immutable files. > > The file flags hack includes uappnd together with uchg, but not the > newfangled uunlnk. That has only been available for annoying sysadmins > since 1997. Apparently its name is to confusing for it to be used. > > Bruce > In most of the cases involved in the firstboot script, the cause of the prompt is that the file system is mounted readonly. So Warner's solution of mounting the filesystem rw, doing the rm, then reverting it to readonly would seem to work, although I wonder if there is a case where the file system was NOT readonly at the start of the script, and ends up read only at the end. -- Allan Jude From owner-svn-src-head@freebsd.org Thu Jan 7 17:02:35 2016 Return-Path: Delivered-To: svn-src-head@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 56691A66AFA; Thu, 7 Jan 2016 17:02:35 +0000 (UTC) (envelope-from sbruno@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 333E51618; Thu, 7 Jan 2016 17:02:35 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07H2Y6e069901; Thu, 7 Jan 2016 17:02:34 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07H2Y9J069900; Thu, 7 Jan 2016 17:02:34 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201601071702.u07H2Y9J069900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 7 Jan 2016 17:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293334 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 17:02:35 -0000 Author: sbruno Date: Thu Jan 7 17:02:34 2016 New Revision: 293334 URL: https://svnweb.freebsd.org/changeset/base/293334 Log: Fixup SFP module insertion on the 82599 when insertion happens after the system is booted and running. Add PHY detection logic to ixgbe_handle_mod() and add locking to ixgbe_handle_msf() as well. PR: 150251 Submitted by: aboyer@averesystems.com MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3188 Modified: head/sys/dev/ixgbe/if_ix.c Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Thu Jan 7 17:00:35 2016 (r293333) +++ head/sys/dev/ixgbe/if_ix.c Thu Jan 7 17:02:34 2016 (r293334) @@ -2947,12 +2947,7 @@ ixgbe_config_link(struct adapter *adapte sfp = ixgbe_is_sfp(hw); if (sfp) { - if (hw->phy.multispeed_fiber) { - hw->mac.ops.setup_sfp(hw); - ixgbe_enable_tx_laser(hw); - taskqueue_enqueue(adapter->tq, &adapter->msf_task); - } else - taskqueue_enqueue(adapter->tq, &adapter->mod_task); + taskqueue_enqueue(adapter->tq, &adapter->mod_task); } else { if (hw->mac.ops.check_link) err = ixgbe_check_link(hw, &adapter->link_speed, @@ -3758,23 +3753,66 @@ ixgbe_handle_mod(void *context, int pend { struct adapter *adapter = context; struct ixgbe_hw *hw = &adapter->hw; + enum ixgbe_phy_type orig_type = hw->phy.type; device_t dev = adapter->dev; u32 err; + IXGBE_CORE_LOCK(adapter); + + /* Check to see if the PHY type changed */ + if (hw->phy.ops.identify) { + hw->phy.type = ixgbe_phy_unknown; + hw->phy.ops.identify(hw); + } + + if (hw->phy.type != orig_type) { + device_printf(dev, "Detected phy_type %d\n", hw->phy.type); + + if (hw->phy.type == ixgbe_phy_none) { + hw->phy.sfp_type = ixgbe_sfp_type_unknown; + goto out; + } + + /* Try to do the initialization that was skipped before */ + if (hw->phy.ops.init) + hw->phy.ops.init(hw); + if (hw->phy.ops.reset) + hw->phy.ops.reset(hw); + } + err = hw->phy.ops.identify_sfp(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Unsupported SFP+ module type was detected.\n"); - return; + goto out; } err = hw->mac.ops.setup_sfp(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Setup failure - unsupported SFP+ module type.\n"); - return; + goto out; + } + if (hw->phy.multispeed_fiber) + taskqueue_enqueue(adapter->tq, &adapter->msf_task); +out: + /* Update media type */ + switch (hw->mac.ops.get_media_type(hw)) { + case ixgbe_media_type_fiber: + adapter->optics = IFM_10G_SR; + break; + case ixgbe_media_type_copper: + adapter->optics = IFM_10G_TWINAX; + break; + case ixgbe_media_type_cx4: + adapter->optics = IFM_10G_CX4; + break; + default: + adapter->optics = 0; + break; } - taskqueue_enqueue(adapter->tq, &adapter->msf_task); + + IXGBE_CORE_UNLOCK(adapter); return; } @@ -3790,6 +3828,7 @@ ixgbe_handle_msf(void *context, int pend u32 autoneg; bool negotiate; + IXGBE_CORE_LOCK(adapter); /* get_supported_phy_layer will call hw->phy.ops.identify_sfp() */ adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); @@ -3802,6 +3841,7 @@ ixgbe_handle_msf(void *context, int pend /* Adjust media types shown in ifconfig */ ifmedia_removeall(&adapter->media); ixgbe_add_media_types(adapter); + IXGBE_CORE_UNLOCK(adapter); return; } From owner-svn-src-head@freebsd.org Thu Jan 7 17:40:02 2016 Return-Path: Delivered-To: svn-src-head@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 22605A65C74; Thu, 7 Jan 2016 17:40:02 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward8o.cmail.yandex.net (forward8o.cmail.yandex.net [IPv6:2a02:6b8:0:1a72::293]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A8BA1162; Thu, 7 Jan 2016 17:40:01 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from web3o.yandex.ru (web3o.yandex.ru [IPv6:2a02:6b8:0:1a2d::5:103]) by forward8o.cmail.yandex.net (Yandex) with ESMTP id AFB4B218B6; Thu, 7 Jan 2016 20:39:57 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web3o.yandex.ru (Yandex) with ESMTP id D145F2400DB6; Thu, 7 Jan 2016 20:39:56 +0300 (MSK) Received: by web3o.yandex.ru with HTTP; Thu, 07 Jan 2016 20:39:55 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: Sean Bruno , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <201601071702.u07H2Y9J069900@repo.freebsd.org> References: null <201601071702.u07H2Y9J069900@repo.freebsd.org> Subject: Re: svn commit: r293334 - head/sys/dev/ixgbe MIME-Version: 1.0 Message-Id: <687511452188395@web3o.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Thu, 07 Jan 2016 20:39:55 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 17:40:02 -0000 07.01.2016, 20:02, "Sean Bruno" : > Author: sbruno > Date: Thu Jan 7 17:02:34 2016 > New Revision: 293334 > URL: https://svnweb.freebsd.org/changeset/base/293334 > > Log: > ššFixup SFP module insertion on the 82599 when insertion happens after > ššthe system is booted and running. > > ššAdd PHY detection logic to ixgbe_handle_mod() and add locking to > ššixgbe_handle_msf() as well. Thanks for checking/committing this! I always wanted to do that but never managed to push local patches.. > > ššPR: 150251 > ššSubmitted by: aboyer@averesystems.com > ššMFC after: 2 weeks > ššDifferential Revision: https://reviews.freebsd.org/D3188 > > Modified: > ššhead/sys/dev/ixgbe/if_ix.c > > Modified: head/sys/dev/ixgbe/if_ix.c > ============================================================================== > --- head/sys/dev/ixgbe/if_ix.c Thu Jan 7 17:00:35 2016 (r293333) > +++ head/sys/dev/ixgbe/if_ix.c Thu Jan 7 17:02:34 2016 (r293334) > @@ -2947,12 +2947,7 @@ ixgbe_config_link(struct adapter *adapte > šššššššššsfp = ixgbe_is_sfp(hw); > > šššššššššif (sfp) { > - if (hw->phy.multispeed_fiber) { > - hw->mac.ops.setup_sfp(hw); > - ixgbe_enable_tx_laser(hw); > - taskqueue_enqueue(adapter->tq, &adapter->msf_task); > - } else > - taskqueue_enqueue(adapter->tq, &adapter->mod_task); > + taskqueue_enqueue(adapter->tq, &adapter->mod_task); > ššššššššš} else { > šššššššššššššššššif (hw->mac.ops.check_link) > šššššššššššššššššššššššššerr = ixgbe_check_link(hw, &adapter->link_speed, > @@ -3758,23 +3753,66 @@ ixgbe_handle_mod(void *context, int pend > š{ > šššššššššstruct adapter *adapter = context; > šššššššššstruct ixgbe_hw *hw = &adapter->hw; > + enum ixgbe_phy_type orig_type = hw->phy.type; > šššššššššdevice_t dev = adapter->dev; > šššššššššu32 err; > > + IXGBE_CORE_LOCK(adapter); > + > + /* Check to see if the PHY type changed */ > + if (hw->phy.ops.identify) { > + hw->phy.type = ixgbe_phy_unknown; > + hw->phy.ops.identify(hw); > + } > + > + if (hw->phy.type != orig_type) { > + device_printf(dev, "Detected phy_type %d\n", hw->phy.type); > + > + if (hw->phy.type == ixgbe_phy_none) { > + hw->phy.sfp_type = ixgbe_sfp_type_unknown; > + goto out; > + } > + > + /* Try to do the initialization that was skipped before */ > + if (hw->phy.ops.init) > + hw->phy.ops.init(hw); > + if (hw->phy.ops.reset) > + hw->phy.ops.reset(hw); > + } > + > šššššššššerr = hw->phy.ops.identify_sfp(hw); > šššššššššif (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { > šššššššššššššššššdevice_printf(dev, > ššššššššššššššššššššš"Unsupported SFP+ module type was detected.\n"); > - return; > + goto out; > ššššššššš} > > šššššššššerr = hw->mac.ops.setup_sfp(hw); > šššššššššif (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { > šššššššššššššššššdevice_printf(dev, > ššššššššššššššššššššš"Setup failure - unsupported SFP+ module type.\n"); > - return; > + goto out; > + } > + if (hw->phy.multispeed_fiber) > + taskqueue_enqueue(adapter->tq, &adapter->msf_task); > +out: > + /* Update media type */ > + switch (hw->mac.ops.get_media_type(hw)) { > + case ixgbe_media_type_fiber: > + adapter->optics = IFM_10G_SR; > + break; > + case ixgbe_media_type_copper: > + adapter->optics = IFM_10G_TWINAX; > + break; > + case ixgbe_media_type_cx4: > + adapter->optics = IFM_10G_CX4; > + break; > + default: > + adapter->optics = 0; > + break; > ššššššššš} > - taskqueue_enqueue(adapter->tq, &adapter->msf_task); > + > + IXGBE_CORE_UNLOCK(adapter); > šššššššššreturn; > š} > > @@ -3790,6 +3828,7 @@ ixgbe_handle_msf(void *context, int pend > šššššššššu32 autoneg; > šššššššššbool negotiate; > > + IXGBE_CORE_LOCK(adapter); > ššššššššš/* get_supported_phy_layer will call hw->phy.ops.identify_sfp() */ > šššššššššadapter->phy_layer = ixgbe_get_supported_physical_layer(hw); > > @@ -3802,6 +3841,7 @@ ixgbe_handle_msf(void *context, int pend > ššššššššš/* Adjust media types shown in ifconfig */ > šššššššššifmedia_removeall(&adapter->media); > šššššššššixgbe_add_media_types(adapter); > + IXGBE_CORE_UNLOCK(adapter); > šššššššššreturn; > š} From owner-svn-src-head@freebsd.org Thu Jan 7 18:34:58 2016 Return-Path: Delivered-To: svn-src-head@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 40FB8A671FA; Thu, 7 Jan 2016 18:34:58 +0000 (UTC) (envelope-from sbruno@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 103AD122F; Thu, 7 Jan 2016 18:34:57 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07IYvtM096391; Thu, 7 Jan 2016 18:34:57 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07IYvxP096390; Thu, 7 Jan 2016 18:34:57 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201601071834.u07IYvxP096390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 7 Jan 2016 18:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293338 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 18:34:58 -0000 Author: sbruno Date: Thu Jan 7 18:34:56 2016 New Revision: 293338 URL: https://svnweb.freebsd.org/changeset/base/293338 Log: Fix VF handling of VLANs. This helps immensily with our ability to operate in the Amazon Cloud. Discussed on Intel Networking Community call this morning. Submitted by: Jarrod Petz(petz@nisshoko.net) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D4788 Modified: head/sys/dev/ixgbe/if_ixv.c Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Thu Jan 7 18:24:24 2016 (r293337) +++ head/sys/dev/ixgbe/if_ixv.c Thu Jan 7 18:34:56 2016 (r293338) @@ -1664,7 +1664,7 @@ ixv_initialize_receive_units(struct adap /* Disable the queue */ rxdctl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)); - rxdctl &= ~(IXGBE_RXDCTL_ENABLE | IXGBE_RXDCTL_VME); + rxdctl &= ~IXGBE_RXDCTL_ENABLE; IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), rxdctl); for (int j = 0; j < 10; j++) { if (IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)) & @@ -1698,8 +1698,7 @@ ixv_initialize_receive_units(struct adap rxr->tail = IXGBE_VFRDT(rxr->me); /* Do the queue enabling last */ - rxdctl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)); - rxdctl |= IXGBE_RXDCTL_ENABLE; + rxdctl |= IXGBE_RXDCTL_ENABLE | IXGBE_RXDCTL_VME; IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), rxdctl); for (int k = 0; k < 10; k++) { if (IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)) & From owner-svn-src-head@freebsd.org Thu Jan 7 18:41:06 2016 Return-Path: Delivered-To: svn-src-head@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 CAF47A67376; Thu, 7 Jan 2016 18:41: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 9767E1622; Thu, 7 Jan 2016 18:41: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 u07If5a2098683; Thu, 7 Jan 2016 18:41:05 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07If4X3098663; Thu, 7 Jan 2016 18:41:04 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601071841.u07If4X3098663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 7 Jan 2016 18:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293339 - in head/sys/dev: bwi if_ndis iwi malo otus ral rtwn usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 18:41:07 -0000 Author: avos Date: Thu Jan 7 18:41:03 2016 New Revision: 293339 URL: https://svnweb.freebsd.org/changeset/base/293339 Log: net80211 drivers: fix ieee80211_init_channels() usage Fix out-of-bounds read (all) / write (11n capable) for drivers that are using ieee80211_init_channels() to initialize channel list. Tested with: * RTL8188EU, STA mode. * RTL8188CUS, STA mode. * WUSB54GC, HOSTAP mode. Approved by: adrian (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D4818 Modified: head/sys/dev/bwi/if_bwi.c head/sys/dev/if_ndis/if_ndis.c head/sys/dev/iwi/if_iwi.c head/sys/dev/malo/if_malo.c head/sys/dev/otus/if_otus.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/ral/rt2860.c head/sys/dev/rtwn/if_rtwn.c head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/bwi/if_bwi.c Thu Jan 7 18:41:03 2016 (r293339) @@ -356,8 +356,8 @@ bwi_attach(struct bwi_softc *sc) device_t dev = sc->sc_dev; struct bwi_mac *mac; struct bwi_phy *phy; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; int i, error; - uint8_t bands; BWI_LOCK_INIT(sc); @@ -453,15 +453,15 @@ bwi_attach(struct bwi_softc *sc) /* * Setup ratesets, phytype, channels and get MAC address */ - bands = 0; + memset(bands, 0, sizeof(bands)); if (phy->phy_mode == IEEE80211_MODE_11B || phy->phy_mode == IEEE80211_MODE_11G) { - setbit(&bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11B); if (phy->phy_mode == IEEE80211_MODE_11B) { ic->ic_phytype = IEEE80211_T_DS; } else { ic->ic_phytype = IEEE80211_T_OFDM; - setbit(&bands, IEEE80211_MODE_11G); + setbit(bands, IEEE80211_MODE_11G); } bwi_get_eaddr(sc, BWI_SPROM_11BG_EADDR, ic->ic_macaddr); @@ -475,7 +475,7 @@ bwi_attach(struct bwi_softc *sc) } } else if (phy->phy_mode == IEEE80211_MODE_11A) { /* TODO:11A */ - setbit(&bands, IEEE80211_MODE_11A); + setbit(bands, IEEE80211_MODE_11A); error = ENXIO; goto fail; } else { @@ -487,7 +487,7 @@ bwi_attach(struct bwi_softc *sc) BWI_SPROM_CARD_INFO_LOCALE); DPRINTF(sc, BWI_DBG_ATTACH, "locale: %d\n", sc->sc_locale); /* XXX use locale */ - ieee80211_init_channels(ic, NULL, &bands); + ieee80211_init_channels(ic, NULL, bands); ic->ic_softc = sc; ic->ic_name = device_get_nameunit(dev); Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/if_ndis/if_ndis.c Thu Jan 7 18:41:03 2016 (r293339) @@ -724,8 +724,8 @@ ndis_80211attach(struct ndis_softc *sc) ndis_80211_rates_ex rates; struct ndis_80211_nettype_list *ntl; uint32_t arg; - int mode, i, r, len; - uint8_t bands = 0; + int mode, i, r, len, nonettypes = 1; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)] = { 0 }; callout_init(&sc->ndis_scan_callout, 1); @@ -751,8 +751,9 @@ ndis_80211attach(struct ndis_softc *sc) for (i = 0; i < ntl->ntl_items; i++) { mode = ndis_nettype_mode(ntl->ntl_type[i]); if (mode) { + nonettypes = 0; setbit(ic->ic_modecaps, mode); - setbit(&bands, mode); + setbit(bands, mode); } else device_printf(sc->ndis_dev, "Unknown nettype %d\n", ntl->ntl_type[i]); @@ -760,9 +761,9 @@ ndis_80211attach(struct ndis_softc *sc) free(ntl, M_DEVBUF); nonettypes: /* Default to 11b channels if the card did not supply any */ - if (bands == 0) { + if (nonettypes) { setbit(ic->ic_modecaps, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11B); } len = sizeof(rates); bzero((char *)&rates, len); @@ -859,7 +860,7 @@ nonettypes: #undef INCRATE #undef TESTSETRATE - ieee80211_init_channels(ic, NULL, &bands); + ieee80211_init_channels(ic, NULL, bands); /* * To test for WPA support, we need to see if we can Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/iwi/if_iwi.c Thu Jan 7 18:41:03 2016 (r293339) @@ -271,8 +271,8 @@ iwi_attach(device_t dev) struct iwi_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint16_t val; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; int i, error; - uint8_t bands; sc->sc_dev = dev; @@ -373,13 +373,13 @@ iwi_attach(device_t dev) val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 2); ic->ic_macaddr[4] = val & 0xff; ic->ic_macaddr[5] = val >> 8; - - bands = 0; - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); + + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); if (pci_get_device(dev) >= 0x4223) - setbit(&bands, IEEE80211_MODE_11A); - ieee80211_init_channels(ic, NULL, &bands); + setbit(bands, IEEE80211_MODE_11A); + ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); /* override default methods */ Modified: head/sys/dev/malo/if_malo.c ============================================================================== --- head/sys/dev/malo/if_malo.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/malo/if_malo.c Thu Jan 7 18:41:03 2016 (r293339) @@ -173,7 +173,7 @@ malo_attach(uint16_t devid, struct malo_ struct ieee80211com *ic = &sc->malo_ic; struct malo_hal *mh; int error; - uint8_t bands; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; MALO_LOCK_INIT(sc); callout_init_mtx(&sc->malo_watchdog_timer, &sc->malo_mtx, 0); @@ -222,10 +222,10 @@ malo_attach(uint16_t devid, struct malo_ sc->malo_hwspecs.wcbbase[2], sc->malo_hwspecs.wcbbase[3]); /* NB: firmware looks that it does not export regdomain info API. */ - bands = 0; - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); - ieee80211_init_channels(ic, NULL, &bands); + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + ieee80211_init_channels(ic, NULL, bands); sc->malo_txantenna = 0x2; /* h/w default */ sc->malo_rxantenna = 0xffff; /* h/w default */ Modified: head/sys/dev/otus/if_otus.c ============================================================================== --- head/sys/dev/otus/if_otus.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/otus/if_otus.c Thu Jan 7 18:41:03 2016 (r293339) @@ -624,8 +624,8 @@ otus_attachhook(struct otus_softc *sc) struct ieee80211com *ic = &sc->sc_ic; usb_device_request_t req; uint32_t in, out; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; int error; - uint8_t bands; /* Not locked */ error = otus_load_firmware(sc, "otusfw_init", AR_FW_INIT_ADDR); @@ -743,19 +743,19 @@ otus_attachhook(struct otus_softc *sc) otus_get_chanlist(sc); #else /* Set supported .11b and .11g rates. */ - bands = 0; + memset(bands, 0, sizeof(bands)); if (sc->eeprom.baseEepHeader.opCapFlags & AR5416_OPFLAGS_11G) { - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); } if (sc->eeprom.baseEepHeader.opCapFlags & AR5416_OPFLAGS_11A) { - setbit(&bands, IEEE80211_MODE_11A); + setbit(bands, IEEE80211_MODE_11A); } #if 0 if (sc->sc_ht) - setbit(&bands, IEEE80211_MODE_11NG); + setbit(bands, IEEE80211_MODE_11NG); #endif - ieee80211_init_channels(ic, NULL, &bands); + ieee80211_init_channels(ic, NULL, bands); #endif ieee80211_ifattach(ic); Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/ral/rt2560.c Thu Jan 7 18:41:03 2016 (r293339) @@ -199,7 +199,7 @@ rt2560_attach(device_t dev, int id) { struct rt2560_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; int error; sc->sc_dev = dev; @@ -278,12 +278,12 @@ rt2560_attach(device_t dev, int id) #endif ; - bands = 0; - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); if (sc->rf_rev == RT2560_RF_5222) - setbit(&bands, IEEE80211_MODE_11A); - ieee80211_init_channels(ic, NULL, &bands); + setbit(bands, IEEE80211_MODE_11A); + ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); ic->ic_raw_xmit = rt2560_raw_xmit; Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/ral/rt2661.c Thu Jan 7 18:41:03 2016 (r293339) @@ -199,8 +199,8 @@ rt2661_attach(device_t dev, int id) struct rt2661_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint32_t val; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; int error, ac, ntries; - uint8_t bands; sc->sc_id = id; sc->sc_dev = dev; @@ -279,12 +279,12 @@ rt2661_attach(device_t dev, int id) #endif ; - bands = 0; - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); if (sc->rf_rev == RT2661_RF_5225 || sc->rf_rev == RT2661_RF_5325) - setbit(&bands, IEEE80211_MODE_11A); - ieee80211_init_channels(ic, NULL, &bands); + setbit(bands, IEEE80211_MODE_11A); + ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); #if 0 Modified: head/sys/dev/ral/rt2860.c ============================================================================== --- head/sys/dev/ral/rt2860.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/ral/rt2860.c Thu Jan 7 18:41:03 2016 (r293339) @@ -232,8 +232,8 @@ rt2860_attach(device_t dev, int id) struct rt2860_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint32_t tmp; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; int error, ntries, qid; - uint8_t bands; sc->sc_dev = dev; sc->sc_debug = 0; @@ -319,12 +319,12 @@ rt2860_attach(device_t dev, int id) | IEEE80211_C_WME /* 802.11e */ ; - bands = 0; - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850) - setbit(&bands, IEEE80211_MODE_11A); - ieee80211_init_channels(ic, NULL, &bands); + setbit(bands, IEEE80211_MODE_11A); + ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/rtwn/if_rtwn.c Thu Jan 7 18:41:03 2016 (r293339) @@ -251,7 +251,7 @@ rtwn_attach(device_t dev) struct rtwn_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint32_t lcsr; - uint8_t bands; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; int i, count, error, rid; sc->sc_dev = dev; @@ -353,10 +353,10 @@ rtwn_attach(device_t dev) | IEEE80211_C_WME /* 802.11e */ ; - bands = 0; - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); - ieee80211_init_channels(ic, NULL, &bands); + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/usb/wlan/if_rsu.c Thu Jan 7 18:41:03 2016 (r293339) @@ -403,7 +403,8 @@ rsu_attach(device_t self) struct rsu_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; int error; - uint8_t iface_index, bands; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t iface_index; struct usb_interface *iface; const char *rft; @@ -531,12 +532,12 @@ rsu_attach(device_t self) } /* Set supported .11b and .11g rates. */ - bands = 0; - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); if (sc->sc_ht) - setbit(&bands, IEEE80211_MODE_11NG); - ieee80211_init_channels(ic, NULL, &bands); + setbit(bands, IEEE80211_MODE_11NG); + ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); ic->ic_raw_xmit = rsu_raw_xmit; Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/usb/wlan/if_rum.c Thu Jan 7 18:41:03 2016 (r293339) @@ -468,8 +468,9 @@ rum_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); struct rum_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; - uint8_t iface_index, bands; uint32_t tmp; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t iface_index; int error, ntries; device_set_usb_desc(self); @@ -537,12 +538,12 @@ rum_attach(device_t self) IEEE80211_CRYPTO_TKIPMIC | IEEE80211_CRYPTO_TKIP; - bands = 0; - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); if (sc->rf_rev == RT2573_RF_5225 || sc->rf_rev == RT2573_RF_5226) - setbit(&bands, IEEE80211_MODE_11A); - ieee80211_init_channels(ic, NULL, &bands); + setbit(bands, IEEE80211_MODE_11A); + ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); ic->ic_update_promisc = rum_update_promisc; Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/usb/wlan/if_run.c Thu Jan 7 18:41:03 2016 (r293339) @@ -704,8 +704,9 @@ run_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); struct ieee80211com *ic = &sc->sc_ic; uint32_t ver; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t iface_index; int ntries, error; - uint8_t iface_index, bands; device_set_usb_desc(self); sc->sc_udev = uaa->device; @@ -785,14 +786,14 @@ run_attach(device_t self) ic->ic_flags |= IEEE80211_F_DATAPAD; ic->ic_flags_ext |= IEEE80211_FEXT_SWBMISS; - bands = 0; - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850 || sc->rf_rev == RT3070_RF_3052 || sc->rf_rev == RT3593_RF_3053 || sc->rf_rev == RT5592_RF_5592) - setbit(&bands, IEEE80211_MODE_11A); - ieee80211_init_channels(ic, NULL, &bands); + setbit(bands, IEEE80211_MODE_11A); + ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/usb/wlan/if_uath.c Thu Jan 7 18:41:03 2016 (r293339) @@ -328,7 +328,8 @@ uath_attach(device_t dev) struct uath_softc *sc = device_get_softc(dev); struct usb_attach_arg *uaa = device_get_ivars(dev); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands, iface_index = UATH_IFACE_INDEX; /* XXX */ + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t iface_index = UATH_IFACE_INDEX; /* XXX */ usb_error_t error; sc->sc_dev = dev; @@ -431,13 +432,13 @@ uath_attach(device_t dev) /* put a regulatory domain to reveal informations. */ uath_regdomain = sc->sc_devcap.regDomain; - bands = 0; - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); if ((sc->sc_devcap.analog5GhzRevision & 0xf0) == 0x30) - setbit(&bands, IEEE80211_MODE_11A); + setbit(bands, IEEE80211_MODE_11A); /* XXX turbo */ - ieee80211_init_channels(ic, NULL, &bands); + ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); ic->ic_raw_xmit = uath_raw_xmit; Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/usb/wlan/if_upgt.c Thu Jan 7 18:41:03 2016 (r293339) @@ -243,7 +243,8 @@ upgt_attach(device_t dev) struct upgt_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; struct usb_attach_arg *uaa = device_get_ivars(dev); - uint8_t bands, iface_index = UPGT_IFACE_INDEX; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t iface_index = UPGT_IFACE_INDEX; int error; sc->sc_dev = dev; @@ -337,10 +338,10 @@ upgt_attach(device_t dev) | IEEE80211_C_WPA /* 802.11i */ ; - bands = 0; - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); - ieee80211_init_channels(ic, NULL, &bands); + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); ic->ic_raw_xmit = upgt_raw_xmit; Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/usb/wlan/if_ural.c Thu Jan 7 18:41:03 2016 (r293339) @@ -424,7 +424,8 @@ ural_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); struct ural_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; - uint8_t iface_index, bands; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t iface_index; int error; device_set_usb_desc(self); @@ -473,12 +474,12 @@ ural_attach(device_t self) | IEEE80211_C_WPA /* 802.11i */ ; - bands = 0; - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); if (sc->rf_rev == RAL_RF_5222) - setbit(&bands, IEEE80211_MODE_11A); - ieee80211_init_channels(ic, NULL, &bands); + setbit(bands, IEEE80211_MODE_11A); + ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); ic->ic_update_promisc = ural_update_promisc; Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/usb/wlan/if_urtw.c Thu Jan 7 18:41:03 2016 (r293339) @@ -785,7 +785,8 @@ urtw_attach(device_t dev) struct urtw_softc *sc = device_get_softc(dev); struct usb_attach_arg *uaa = device_get_ivars(dev); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands, iface_index = URTW_IFACE_INDEX; /* XXX */ + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t iface_index = URTW_IFACE_INDEX; /* XXX */ uint16_t n_setup; uint32_t data; usb_error_t error; @@ -876,10 +877,10 @@ urtw_attach(device_t dev) IEEE80211_C_BGSCAN | /* capable of bg scanning */ IEEE80211_C_WPA; /* 802.11i */ - bands = 0; - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); - ieee80211_init_channels(ic, NULL, &bands); + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); ic->ic_raw_xmit = urtw_raw_xmit; Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/usb/wlan/if_urtwn.c Thu Jan 7 18:41:03 2016 (r293339) @@ -439,7 +439,7 @@ urtwn_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); struct urtwn_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; int error; device_set_usb_desc(self); @@ -525,10 +525,10 @@ urtwn_attach(device_t self) IEEE80211_CRYPTO_TKIP | IEEE80211_CRYPTO_AES_CCM; - bands = 0; - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); - ieee80211_init_channels(ic, NULL, &bands); + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); ic->ic_raw_xmit = urtwn_raw_xmit; Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Thu Jan 7 18:34:56 2016 (r293338) +++ head/sys/dev/usb/wlan/if_zyd.c Thu Jan 7 18:41:03 2016 (r293339) @@ -334,7 +334,8 @@ zyd_attach(device_t dev) struct usb_attach_arg *uaa = device_get_ivars(dev); struct zyd_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; - uint8_t iface_index, bands; + uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t iface_index; int error; if (uaa->info.bcdDevice < 0x4330) { @@ -387,10 +388,10 @@ zyd_attach(device_t dev) | IEEE80211_C_WPA /* 802.11i */ ; - bands = 0; - setbit(&bands, IEEE80211_MODE_11B); - setbit(&bands, IEEE80211_MODE_11G); - ieee80211_init_channels(ic, NULL, &bands); + memset(bands, 0, sizeof(bands)); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); ic->ic_raw_xmit = zyd_raw_xmit; From owner-svn-src-head@freebsd.org Thu Jan 7 18:50:03 2016 Return-Path: Delivered-To: svn-src-head@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 96E3BA67659; Thu, 7 Jan 2016 18:50:03 +0000 (UTC) (envelope-from dteske@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 67CDF1BF0; Thu, 7 Jan 2016 18:50:03 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07Io2XB099639; Thu, 7 Jan 2016 18:50:02 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07Io2Ec099638; Thu, 7 Jan 2016 18:50:02 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601071850.u07Io2Ec099638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 7 Jan 2016 18:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293340 - head/lib/libdpv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 18:50:03 -0000 Author: dteske Date: Thu Jan 7 18:50:02 2016 New Revision: 293340 URL: https://svnweb.freebsd.org/changeset/base/293340 Log: Increase maximum buffer size for `-x cmd' value MFC after: 3 days X-MFC-to: stable/10 Modified: head/lib/libdpv/util.h Modified: head/lib/libdpv/util.h ============================================================================== --- head/lib/libdpv/util.h Thu Jan 7 18:41:03 2016 (r293339) +++ head/lib/libdpv/util.h Thu Jan 7 18:50:02 2016 (r293340) @@ -41,7 +41,7 @@ #define PATH_SHELL "/bin/sh" #endif -#define CMDBUFMAX 4096 +#define CMDBUFMAX 65536 __BEGIN_DECLS int shell_spawn_pipecmd(const char *_cmd, const char *_label, pid_t *_pid); From owner-svn-src-head@freebsd.org Thu Jan 7 19:19:24 2016 Return-Path: Delivered-To: svn-src-head@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 D3BF1A6605A; Thu, 7 Jan 2016 19:19:24 +0000 (UTC) (envelope-from bdrewery@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 A0FD71D44; Thu, 7 Jan 2016 19:19:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07JJNmH009198; Thu, 7 Jan 2016 19:19:23 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07JJNFT009196; Thu, 7 Jan 2016 19:19:23 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601071919.u07JJNFT009196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 Jan 2016 19:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293341 - in head: lib/libstand sys/boot/libstand32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 19:19:24 -0000 Author: bdrewery Date: Thu Jan 7 19:19:23 2016 New Revision: 293341 URL: https://svnweb.freebsd.org/changeset/base/293341 Log: Don't install /usr/include/stand.h twice after r293040. Only install it from lib/libstand. Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libstand/Makefile head/sys/boot/libstand32/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Thu Jan 7 18:50:02 2016 (r293340) +++ head/lib/libstand/Makefile Thu Jan 7 19:19:23 2016 (r293341) @@ -17,7 +17,7 @@ LIBC_SRC= ${LIBSTAND_SRC}/../libc LIB= stand NO_PIC= -INCS= stand.h +INCS?= stand.h MAN?= libstand.3 WARNS?= 0 Modified: head/sys/boot/libstand32/Makefile ============================================================================== --- head/sys/boot/libstand32/Makefile Thu Jan 7 18:50:02 2016 (r293340) +++ head/sys/boot/libstand32/Makefile Thu Jan 7 19:19:23 2016 (r293341) @@ -10,6 +10,7 @@ LIBSTAND_CPUARCH=${MACHINE_CPUARCH} .endif LIBC_SRC= ${LIBSTAND_SRC}/../libc INTERNALLIB= +INCS= MAN= .PATH: ${LIBSTAND_SRC} From owner-svn-src-head@freebsd.org Thu Jan 7 19:33:23 2016 Return-Path: Delivered-To: svn-src-head@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 2097AA66777 for ; Thu, 7 Jan 2016 19:33:23 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (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 AEF5519A8 for ; Thu, 7 Jan 2016 19:33:22 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x234.google.com with SMTP id f206so110176792wmf.0 for ; Thu, 07 Jan 2016 11:33:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=GQyGzsD2toJMmaNMvpDlHP3A1Wo+zUMvtXJG0oBzsLg=; b=Wp4geBenhgeAs+L2e0guSZrW9eH5AL+rnbP1ZcnDYsn+sZzwoefiSBkblGh9IF+rzH B5Yvnwm6SAtU+Yd0KaisDx8sHPTfRd+qkB9ZOBUwJoT2Ywz16uXcYPzj0dlH2YowS4ZD BpeJv5ODaaQa2Ztrn2lQogQcQ9mAJEO8fNFyWuo7c1qqdA0i54vXSjBr9gm7C+TPp6mh CRrFRTC1vtPubV31mObR/I4XFYakOnj//0jKCUWHiKd+wLG6ZK6lc8Xibtn4NgYvAGzi 8LjGW+0k8nAV1ScWulR7VQjECrxQAZweYvCpYahIjwhA4vXcF0g6W/GR7ZdLHhK4huqB CmLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=GQyGzsD2toJMmaNMvpDlHP3A1Wo+zUMvtXJG0oBzsLg=; b=AfwRrCFQLmrTuoORRyMIeDXbBRoM/fnhhF/21i2ZgXNXrZ2/ZKuyYSsjv6hypDxFZr xvNOCloZxmTazxrcLYPGFSllow0Wc9042wc1iZXx6yLrhXzgVOY2K5cDtf8p+6e8CnXT p/8tXfigGBEM3aRFXsM096daSk0zJwwLvGzvuv7qe5YkB50/ndrna7pdgN3YfOVrHb6C 3hJOQneOqysHiy4MLv9OLaPwXmKcpXGfT5mskgn2SStwONYOJWwx+s8ogU9BbSTlSIwH WaSZBK5NKthVPabUCc/771syhP2L2LuC6exWcaDJSiHwXoz6mM4FZPx1VVxlQXgdPzWw pjLA== X-Gm-Message-State: ALoCoQlt+wlFk/KC9ou6nIEIwX1NU07W2rqH7Nd1JGcHzzz61W8ZPXRHXQ7N/SHgFBj95xDGWsQ2QWV8CRH/oxKFm9EcXD/QTiHqm4NGiCB57oeB9mRsoII= MIME-Version: 1.0 X-Received: by 10.194.202.163 with SMTP id kj3mr110906648wjc.93.1452195201210; Thu, 07 Jan 2016 11:33:21 -0800 (PST) Received: by 10.194.85.167 with HTTP; Thu, 7 Jan 2016 11:33:21 -0800 (PST) In-Reply-To: <201508031627.t73GRbTB092225@repo.freebsd.org> References: <201508031627.t73GRbTB092225@repo.freebsd.org> Date: Thu, 7 Jan 2016 20:33:21 +0100 Message-ID: Subject: Re: svn commit: r286234 - head/sys/boot/common From: Oliver Pinter To: Edward Tomasz Napierala Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 19:33:23 -0000 On Mon, Aug 3, 2015 at 6:27 PM, Edward Tomasz Napierala wrote: > Author: trasz > Date: Mon Aug 3 16:27:36 2015 > New Revision: 286234 > URL: https://svnweb.freebsd.org/changeset/base/286234 > > Log: > Fix a problem which made loader(8) load non-kld files twice. > > For example, without this patch, the following three lines > in /boot/loader.conf would result in /boot/root.img being preloaded > twice, and two md(4) devices - md0 and md1 - being created. > > initmd_load="YES" > initmd_type="md_image" > initmd_name="/boot/root.img" > > Reviewed by: marcel@ > MFC after: 1 month Do you still plan to MFC this commit to 10-STABLE / 10.3? > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D3204 > > Modified: > head/sys/boot/common/module.c > > Modified: head/sys/boot/common/module.c > ============================================================================== > --- head/sys/boot/common/module.c Mon Aug 3 14:58:46 2015 (r286233) > +++ head/sys/boot/common/module.c Mon Aug 3 16:27:36 2015 (r286234) > @@ -102,6 +102,7 @@ COMMAND_SET(load, "load", "load a kernel > static int > command_load(int argc, char *argv[]) > { > + struct preloaded_file *fp; > char *typestr; > int dofile, dokld, ch, error; > > @@ -139,6 +140,13 @@ command_load(int argc, char *argv[]) > command_errmsg = "invalid load type"; > return(CMD_ERROR); > } > + > + fp = file_findfile(argv[1], typestr); > + if (fp) { > + sprintf(command_errbuf, "warning: file '%s' already loaded", argv[1]); > + return (CMD_ERROR); > + } > + > return (file_loadraw(argv[1], typestr, 1) ? CMD_OK : CMD_ERROR); > } > /* > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Thu Jan 7 19:37:12 2016 Return-Path: Delivered-To: svn-src-head@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 9A78EA6693A; Thu, 7 Jan 2016 19:37:12 +0000 (UTC) (envelope-from bdrewery@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 64D4B1CCD; Thu, 7 Jan 2016 19:37:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07JbBen015070; Thu, 7 Jan 2016 19:37:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07JbBbQ015069; Thu, 7 Jan 2016 19:37:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601071937.u07JbBbQ015069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 Jan 2016 19:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293342 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 19:37:12 -0000 Author: bdrewery Date: Thu Jan 7 19:37:11 2016 New Revision: 293342 URL: https://svnweb.freebsd.org/changeset/base/293342 Log: Always try to upgrade to bmake if not already using it. This is mostly targetting stable/10 which requires bmake to build and has issues upgrading from <10. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division PR: 198062 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Thu Jan 7 19:19:23 2016 (r293341) +++ head/Makefile Thu Jan 7 19:37:11 2016 (r293342) @@ -205,7 +205,7 @@ _TARGET_ARCH?= ${MACHINE_ARCH} # The user can define ALWAYS_CHECK_MAKE to have this check performed # for all targets. # -.if defined(ALWAYS_CHECK_MAKE) +.if defined(ALWAYS_CHECK_MAKE) || !defined(.PARSEDIR) ${TGTS}: upgrade_checks .else buildworld: upgrade_checks From owner-svn-src-head@freebsd.org Thu Jan 7 19:47:27 2016 Return-Path: Delivered-To: svn-src-head@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 BFF89A66E50; Thu, 7 Jan 2016 19:47:27 +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 977E017A4; Thu, 7 Jan 2016 19:47:27 +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 u07JlQ2b018543; Thu, 7 Jan 2016 19:47:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07JlQw1018540; Thu, 7 Jan 2016 19:47:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601071947.u07JlQw1018540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 19:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293343 - in head/sys: amd64/include i386/include x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 19:47:27 -0000 Author: emaste Date: Thu Jan 7 19:47:26 2016 New Revision: 293343 URL: https://svnweb.freebsd.org/changeset/base/293343 Log: Move amd64 metadata.h to x86 and share with i386 MFC after: 1 week Added: head/sys/x86/include/metadata.h - copied unchanged from r293342, head/sys/amd64/include/metadata.h Replaced: head/sys/amd64/include/metadata.h - copied, changed from r293342, head/sys/i386/include/metadata.h Modified: head/sys/i386/include/metadata.h Copied and modified: head/sys/amd64/include/metadata.h (from r293342, head/sys/i386/include/metadata.h) ============================================================================== --- head/sys/i386/include/metadata.h Thu Jan 7 19:37:11 2016 (r293342, copy source) +++ head/sys/amd64/include/metadata.h Thu Jan 7 19:47:26 2016 (r293343) @@ -1,37 +1,6 @@ /*- - * Copyright (c) 2003 Peter Wemm - * 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 THE 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 THE 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$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_METADATA_H_ -#define _MACHINE_METADATA_H_ - -#define MODINFOMD_SMAP 0x1001 -#define MODINFOMD_SMAP_XATTR 0x1002 -#define MODINFOMD_DTBP 0x1003 -#define MODINFOMD_MODULEP 0x1006 - -#endif /* !_MACHINE_METADATA_H_ */ +#include Modified: head/sys/i386/include/metadata.h ============================================================================== --- head/sys/i386/include/metadata.h Thu Jan 7 19:37:11 2016 (r293342) +++ head/sys/i386/include/metadata.h Thu Jan 7 19:47:26 2016 (r293343) @@ -1,37 +1,6 @@ /*- - * Copyright (c) 2003 Peter Wemm - * 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 THE 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 THE 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$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_METADATA_H_ -#define _MACHINE_METADATA_H_ - -#define MODINFOMD_SMAP 0x1001 -#define MODINFOMD_SMAP_XATTR 0x1002 -#define MODINFOMD_DTBP 0x1003 -#define MODINFOMD_MODULEP 0x1006 - -#endif /* !_MACHINE_METADATA_H_ */ +#include Copied: head/sys/x86/include/metadata.h (from r293342, head/sys/amd64/include/metadata.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/include/metadata.h Thu Jan 7 19:47:26 2016 (r293343, copy of r293342, head/sys/amd64/include/metadata.h) @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2003 Peter Wemm + * 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 THE 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 THE 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 _MACHINE_METADATA_H_ +#define _MACHINE_METADATA_H_ + +#define MODINFOMD_SMAP 0x1001 +#define MODINFOMD_SMAP_XATTR 0x1002 +#define MODINFOMD_DTBP 0x1003 +#define MODINFOMD_EFI_MAP 0x1004 +#define MODINFOMD_EFI_FB 0x1005 +#define MODINFOMD_MODULEP 0x1006 + +struct efi_map_header { + uint64_t memory_size; + uint64_t descriptor_size; + uint32_t descriptor_version; +}; + +struct efi_fb { + uint64_t fb_addr; + uint64_t fb_size; + uint32_t fb_height; + uint32_t fb_width; + uint32_t fb_stride; + uint32_t fb_mask_red; + uint32_t fb_mask_green; + uint32_t fb_mask_blue; + uint32_t fb_mask_reserved; +}; + +#endif /* !_MACHINE_METADATA_H_ */ From owner-svn-src-head@freebsd.org Thu Jan 7 19:56:32 2016 Return-Path: Delivered-To: svn-src-head@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 A7B71A672E8; Thu, 7 Jan 2016 19:56:32 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x22a.google.com (mail-ig0-x22a.google.com [IPv6:2607:f8b0:4001:c05::22a]) (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 79C461FEB; Thu, 7 Jan 2016 19:56:32 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ig0-x22a.google.com with SMTP id z14so41910747igp.1; Thu, 07 Jan 2016 11:56:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=7JQcvFXNZ5TKbymL2y2aMafLaCN25mC0XbgClhPMf5w=; b=ifusEmrJLlkT7qR73sNb+Ovn54H1dMYj8PzSGHzQikKj2lQz0lVd/+3gB8vMubWUY4 mSWtGniIhpIcIwK+yIQ6qae6NIsX6+zc5igC1+j8dXAdURSGpaWcg/EZdTtW8IUfENgK czd1syBcnQ6BaphFqJjkPw8Wktat1NWWozFQJvTgnuU1UtjPFjTg7qg8y2uc4aVrR3Qh fX6YPQQW+l5P0FbSFOZ3WGAn3luREakr5Fy8xBLpeEACbUOahPg6jGnUFPOpJTsaoH9q Lsk8adKstSNC/L8fU8EmMWXncss1ncB4pg58ZrtInrVnGyURm4xEjTH2p8V3JsYCFjAx y3xg== X-Received: by 10.50.43.228 with SMTP id z4mr16773508igl.33.1452196591863; Thu, 07 Jan 2016 11:56:31 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.39.66 with HTTP; Thu, 7 Jan 2016 11:56:12 -0800 (PST) In-Reply-To: <201601071919.u07JJNFT009196@repo.freebsd.org> References: <201601071919.u07JJNFT009196@repo.freebsd.org> From: Ed Maste Date: Thu, 7 Jan 2016 14:56:12 -0500 X-Google-Sender-Auth: z92OtHUXhkyqay3MrITUazfD0hY Message-ID: Subject: Re: svn commit: r293341 - in head: lib/libstand sys/boot/libstand32 To: Bryan Drewery Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 19:56:32 -0000 On 7 January 2016 at 14:19, Bryan Drewery wrote: > Author: bdrewery > Date: Thu Jan 7 19:19:23 2016 > New Revision: 293341 > URL: https://svnweb.freebsd.org/changeset/base/293341 > > Log: > Don't install /usr/include/stand.h twice after r293040. > > Only install it from lib/libstand. Sorry, thanks for catching that. From owner-svn-src-head@freebsd.org Thu Jan 7 19:58:26 2016 Return-Path: Delivered-To: svn-src-head@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 DE705A6737D; Thu, 7 Jan 2016 19:58:25 +0000 (UTC) (envelope-from bdrewery@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 B593A1217; Thu, 7 Jan 2016 19:58:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07JwOVC021662; Thu, 7 Jan 2016 19:58:24 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07JwO2a021653; Thu, 7 Jan 2016 19:58:24 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601071958.u07JwO2a021653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 Jan 2016 19:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293345 - in head: lib/libmd sys/boot/libstand32 sys/boot/userboot/test usr.bin/kdump usr.bin/nfsstat usr.sbin/jls usr.sbin/sesutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 19:58:26 -0000 Author: bdrewery Date: Thu Jan 7 19:58:23 2016 New Revision: 293345 URL: https://svnweb.freebsd.org/changeset/base/293345 Log: DIRDEPS_BUILD: Update dependencies. Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libmd/Makefile.depend head/sys/boot/libstand32/Makefile.depend head/sys/boot/userboot/test/Makefile.depend head/usr.bin/kdump/Makefile.depend head/usr.bin/nfsstat/Makefile.depend head/usr.sbin/jls/Makefile.depend head/usr.sbin/sesutil/Makefile.depend Modified: head/lib/libmd/Makefile.depend ============================================================================== --- head/lib/libmd/Makefile.depend Thu Jan 7 19:52:17 2016 (r293344) +++ head/lib/libmd/Makefile.depend Thu Jan 7 19:58:23 2016 (r293345) @@ -33,6 +33,9 @@ sha1hl.po: sha1hl.c sha256hl.So: sha256hl.c sha256hl.o: sha256hl.c sha256hl.po: sha256hl.c +sha384hl.So: sha384hl.c +sha384hl.o: sha384hl.c +sha384hl.po: sha384hl.c sha512hl.So: sha512hl.c sha512hl.o: sha512hl.c sha512hl.po: sha512hl.c Modified: head/sys/boot/libstand32/Makefile.depend ============================================================================== --- head/sys/boot/libstand32/Makefile.depend Thu Jan 7 19:52:17 2016 (r293344) +++ head/sys/boot/libstand32/Makefile.depend Thu Jan 7 19:58:23 2016 (r293345) @@ -6,7 +6,6 @@ DIRDEPS = \ include/arpa \ include/xlocale \ lib/libbz2 \ - lib/libstand \ .include Modified: head/sys/boot/userboot/test/Makefile.depend ============================================================================== --- head/sys/boot/userboot/test/Makefile.depend Thu Jan 7 19:52:17 2016 (r293344) +++ head/sys/boot/userboot/test/Makefile.depend Thu Jan 7 19:58:23 2016 (r293345) @@ -8,7 +8,6 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ - lib/libc_nonshared \ lib/libcompiler_rt \ Modified: head/usr.bin/kdump/Makefile.depend ============================================================================== --- head/usr.bin/kdump/Makefile.depend Thu Jan 7 19:52:17 2016 (r293344) +++ head/usr.bin/kdump/Makefile.depend Thu Jan 7 19:58:23 2016 (r293345) @@ -6,7 +6,6 @@ DIRDEPS = \ gnu/lib/libgcc \ include \ include/arpa \ - include/rpc \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ @@ -20,8 +19,6 @@ DIRDEPS = \ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree -ioctl.o: ioctl.c -ioctl.po: ioctl.c kdump.o: kdump_subr.h kdump.o: linux32_syscalls.c kdump.o: linux_syscalls.c Modified: head/usr.bin/nfsstat/Makefile.depend ============================================================================== --- head/usr.bin/nfsstat/Makefile.depend Thu Jan 7 19:52:17 2016 (r293344) +++ head/usr.bin/nfsstat/Makefile.depend Thu Jan 7 19:58:23 2016 (r293345) @@ -9,8 +9,6 @@ DIRDEPS = \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - lib/libelf \ - lib/libkvm \ .include Modified: head/usr.sbin/jls/Makefile.depend ============================================================================== --- head/usr.sbin/jls/Makefile.depend Thu Jan 7 19:52:17 2016 (r293344) +++ head/usr.sbin/jls/Makefile.depend Thu Jan 7 19:58:23 2016 (r293345) @@ -11,6 +11,8 @@ DIRDEPS = \ lib/libc \ lib/libcompiler_rt \ lib/libjail \ + lib/libutil \ + lib/libxo \ .include Modified: head/usr.sbin/sesutil/Makefile.depend ============================================================================== --- head/usr.sbin/sesutil/Makefile.depend Thu Jan 7 19:52:17 2016 (r293344) +++ head/usr.sbin/sesutil/Makefile.depend Thu Jan 7 19:58:23 2016 (r293345) @@ -9,6 +9,7 @@ DIRDEPS = \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ + lib/libsbuf \ .include From owner-svn-src-head@freebsd.org Thu Jan 7 20:08:04 2016 Return-Path: Delivered-To: svn-src-head@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 211DAA67802; Thu, 7 Jan 2016 20:08: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 DFD821C68; Thu, 7 Jan 2016 20:08:03 +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 u07K83iJ025460; Thu, 7 Jan 2016 20:08:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07K82AD025456; Thu, 7 Jan 2016 20:08:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601072008.u07K82AD025456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 7 Jan 2016 20:08:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293346 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 20:08:04 -0000 Author: kib Date: Thu Jan 7 20:08:02 2016 New Revision: 293346 URL: https://svnweb.freebsd.org/changeset/base/293346 Log: Provide yet another KPI for cdev creation, make_dev_s(9). Immediate problem fixed by the new KPI is the long-standing race between device creation and assignments to cdev->si_drv1 and cdev->si_drv2, which allows the window where cdevsw methods might be called with si_drv1,2 fields not yet set. Devices typically checked for NULL and returned spurious errors to usermode, and often left some methods unchecked. The new function interface is designed to be extensible, which should allow to add more features to make_dev_s(9) without inventing yet another name for function to create devices, while maintaining KPI and even KBI backward-compatibility. Reviewed by: hps, jhb Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D4746 Modified: head/share/man/man9/Makefile head/share/man/man9/make_dev.9 head/sys/kern/kern_conf.c head/sys/sys/conf.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Jan 7 19:58:23 2016 (r293345) +++ head/share/man/man9/Makefile Thu Jan 7 20:08:02 2016 (r293346) @@ -1013,7 +1013,8 @@ MLINKS+=make_dev.9 destroy_dev.9 \ make_dev.9 make_dev_alias_p.9 \ make_dev.9 make_dev_cred.9 \ make_dev.9 make_dev_credf.9 \ - make_dev.9 make_dev_p.9 + make_dev.9 make_dev_p.9 \ + make_dev.9 make_dev_s.9 MLINKS+=malloc.9 free.9 \ malloc.9 MALLOC_DECLARE.9 \ malloc.9 MALLOC_DEFINE.9 \ Modified: head/share/man/man9/make_dev.9 ============================================================================== --- head/share/man/man9/make_dev.9 Thu Jan 7 19:58:23 2016 (r293345) +++ head/share/man/man9/make_dev.9 Thu Jan 7 20:08:02 2016 (r293346) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Dec 22, 2012 +.Dd Jan 3, 2016 .Dt MAKE_DEV 9 .Os .Sh NAME @@ -32,6 +32,7 @@ .Nm make_dev_cred , .Nm make_dev_credf , .Nm make_dev_p , +.Nm make_dev_s , .Nm make_dev_alias , .Nm make_dev_alias_p , .Nm destroy_dev , @@ -45,16 +46,10 @@ and DEVFS registration for devices .Sh SYNOPSIS .In sys/param.h .In sys/conf.h -.Ft struct cdev * -.Fn make_dev "struct cdevsw *cdevsw" "int unit" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ... -.Ft struct cdev * -.Fn make_dev_cred "struct cdevsw *cdevsw" "int unit" "struct ucred *cr" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ... -.Ft struct cdev * -.Fn make_dev_credf "int flags" "struct cdevsw *cdevsw" "int unit" "struct ucred *cr" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ... +.Ft void +.Fn make_dev_args_init "struct make_dev_args *args" .Ft int -.Fn make_dev_p "int flags" "struct cdev **cdev" "struct cdevsw *devsw" "struct ucred *cr" "uid_t uid" "gid_t gid" "int mode" "const char *fmt" ... -.Ft struct cdev * -.Fn make_dev_alias "struct cdev *pdev" "const char *fmt" ... +.Fn make_dev_s "struct make_dev_args *args" "struct cdev **cdev" "const char *fmt" ... .Ft int .Fn make_dev_alias_p "int flags" "struct cdev **cdev" "struct cdev *pdev" "const char *fmt" ... .Ft void @@ -67,12 +62,26 @@ and DEVFS registration for devices .Fn destroy_dev_drain "struct cdevsw *csw" .Ft void .Fn dev_depends "struct cdev *pdev" "struct cdev *cdev" +.Pp +LEGACY INTERFACES +.Ft struct cdev * +.Fn make_dev "struct cdevsw *cdevsw" "int unit" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ... +.Ft struct cdev * +.Fn make_dev_cred "struct cdevsw *cdevsw" "int unit" "struct ucred *cr" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ... +.Ft struct cdev * +.Fn make_dev_credf "int flags" "struct cdevsw *cdevsw" "int unit" "struct ucred *cr" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ... +.Ft int +.Fn make_dev_p "int flags" "struct cdev **cdev" "struct cdevsw *devsw" "struct ucred *cr" "uid_t uid" "gid_t gid" "int mode" "const char *fmt" ... +.Ft struct cdev * +.Fn make_dev_alias "struct cdev *pdev" "const char *fmt" ... .Sh DESCRIPTION The -.Fn make_dev_credf +.Fn make_dev_s function creates a .Fa cdev -structure for a new device. +structure for a new device, which is returned into the +.Fa cdev +argument. It also notifies .Xr devfs 5 of the presence of the new device, that causes corresponding nodes @@ -80,10 +89,34 @@ to be created. Besides this, a .Xr devctl 4 notification is sent. -The device will be owned by -.Va uid , +The function takes the structure +.Va struct make_dev_args args , +which specifies the parameters for the device creation: +.Pp +.Bd -literal -offset indent -compact +struct make_dev_args { + size_t mda_size; + int mda_flags; + struct cdevsw *mda_devsw; + struct ucred *mda_cr; + uid_t mda_uid; + gid_t mda_gid; + int mda_mode; + int mda_unit; + void *mda_si_drv1; + void *mda_si_drv2; +}; +.Ed +Before use and filling with the desired values, the structure must be +initialized by the +.Fn make_dev_args_init +function, which ensures that future kernel interface expansion does +not affect driver source code or binary interface. +.Pp +The created device will be owned by +.Va args.mda_uid , with the group ownership as -.Va gid . +.Va args.mda_gid . The name is the expansion of .Va fmt and following arguments as @@ -97,7 +130,7 @@ mount point and may contain slash .Ql / characters to denote subdirectories. The permissions of the file specified in -.Va perms +.Va args.mda_mode are defined in .In sys/stat.h : .Pp @@ -126,29 +159,28 @@ are defined in .Ed .Pp The -.Va cr +.Va args.mda_cr argument specifies credentials that will be stored in the .Fa si_cred member of the initialized .Fa struct cdev . +.Pp The -.Va flags +.Va args.mda_flags argument alters the operation of -.Fn make_dev_credf -or -.Fn make_dev_p . +.Fn make_dev_s. The following values are currently accepted: .Pp -.Bl -tag -width "MAKEDEV_CHECKNAME" -compact -offset indent -.It MAKEDEV_REF +.Bl -tag -width "It Dv MAKEDEV_CHECKNAME" -compact -offset indent +.It Dv MAKEDEV_REF reference the created device -.It MAKEDEV_NOWAIT +.It Dv MAKEDEV_NOWAIT do not sleep, the call may fail -.It MAKEDEV_WAITOK +.It Dv MAKEDEV_WAITOK allow the function to sleep to satisfy malloc -.It MAKEDEV_ETERNAL +.It Dv MAKEDEV_ETERNAL created device will be never destroyed -.It MAKEDEV_CHECKNAME +.It Dv MAKEDEV_CHECKNAME return an error if the device name is invalid or already exists .El .Pp @@ -189,10 +221,49 @@ For the convenience, use the flag for the code that can be compiled into kernel or loaded (and unloaded) as loadable module. .Pp -A panic will occur if the MAKEDEV_CHECKNAME flag is not specified +A panic will occur if the +.Dv MAKEDEV_CHECKNAME +flag is not specified and the device name is invalid or already exists. .Pp The +.Fn make_dev_p +use of the form +.Bd -literal -offset indent +struct cdev *dev; +int res; +res = make_dev_p(flags, &dev, cdevsw, cred, uid, gid, perms, name); +.Ed +is equivalent to the code +.Bd -literal -offset indent +struct cdev *dev; +struct make_dev_args args; +int res; + +make_dev_args_init(&args); +args.mda_flags = flags; +args.mda_devsw = cdevsw; +args.mda_cred = cred; +args.mda_uid = uid; +args.mda_gid = gid; +args.mda_mode = perms; +res = make_dev_s(&args, &dev, name); +.Ed +.Pp +Similarly, the +.Fn make_dev_credf +function call is equivalent to +.Bd -literal -offset indent + (void) make_dev_s(&args, &dev, name); +.Ed +In other words, +.Fn make_dev_credf +does not allow the caller to obtain the return value, and in +kernels compiled with the +.Va INVARIANTS +options, the function asserts that the device creation succeeded. +.Pp +The .Fn make_dev_cred function is equivalent to the call .Bd -literal -offset indent @@ -207,45 +278,55 @@ make_dev_credf(0, cdevsw, unit, NULL, ui .Ed .Pp The -.Fn make_dev_p -function is similar to -.Fn make_dev_credf -but it may return an error number and takes a pointer to the resulting -.Ft *cdev -as an argument. -.Pp -The -.Fn make_dev_alias +.Fn make_dev_alias_p function takes the returned .Ft cdev from .Fn make_dev and makes another (aliased) name for this device. It is an error to call -.Fn make_dev_alias +.Fn make_dev_alias_p prior to calling .Fn make_dev . .Pp -.Fn make_dev_alias_p +The +.Fn make_dev_alias function is similar to .Fn make_dev_alias -but it takes a pointer to the resulting +but it returns the resulting aliasing .Ft *cdev -as an argument and may return an error. +and may not return an error. .Pp The .Fa cdev returned by -.Fn make_dev +.Fn make_dev_s and -.Fn make_dev_alias +.Fn make_dev_alias_p has two fields, .Fa si_drv1 and .Fa si_drv2 , that are available to store state. Both fields are of type -.Ft void * . +.Ft void * , +and can be initialized simultaneously with the +.Va cdev +allocation by filling +.Va args.mda_si_drv1 +and +.Va args.mda_si_drv2 +members of the +.Fn make_dev_s +argument structure, or filled after the +.Va cdev +is allocated, if using legacy interfaces. +In the latter case, the driver should handle the race of +accessing uninitialized +.Va si_drv1 +and +.Va si_drv2 +itself. These are designed to replace the .Fa unit argument to @@ -331,8 +412,10 @@ unload until is actually finished for all of them. .Sh RETURN VALUES If successful, +.Fn make_dev_s +and .Fn make_dev_p -will return 0, otherwise it will return an error. +will return 0, otherwise they will return an error. If successful, .Fn make_dev_credf will return a valid @@ -341,10 +424,11 @@ pointer, otherwise it will return .Dv NULL . .Sh ERRORS The +.Fn make_dev_s , .Fn make_dev_p and .Fn make_dev_alias_p -call will fail and the device will be not registered if: +calls will fail and the device will be not registered if: .Bl -tag -width Er .It Bq Er ENOMEM The @@ -403,3 +487,7 @@ The function .Fn make_dev_p first appeared in .Fx 8.2 . +The function +.Fn make_dev_s +first appeared in +.Fx 11.0 . Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Thu Jan 7 19:58:23 2016 (r293345) +++ head/sys/kern/kern_conf.c Thu Jan 7 20:08:02 2016 (r293346) @@ -566,22 +566,26 @@ notify_destroy(struct cdev *dev) } static struct cdev * -newdev(struct cdevsw *csw, int unit, struct cdev *si) +newdev(struct make_dev_args *args, struct cdev *si) { struct cdev *si2; + struct cdevsw *csw; mtx_assert(&devmtx, MA_OWNED); + csw = args->mda_devsw; if (csw->d_flags & D_NEEDMINOR) { /* We may want to return an existing device */ LIST_FOREACH(si2, &csw->d_devs, si_list) { - if (dev2unit(si2) == unit) { + if (dev2unit(si2) == args->mda_unit) { dev_free_devlocked(si); return (si2); } } } - si->si_drv0 = unit; + si->si_drv0 = args->mda_unit; si->si_devsw = csw; + si->si_drv1 = args->mda_si_drv1; + si->si_drv2 = args->mda_si_drv2; LIST_INSERT_HEAD(&csw->d_devs, si, si_list); return (si); } @@ -737,33 +741,46 @@ prep_devname(struct cdev *dev, const cha return (0); } +void +make_dev_args_init_impl(struct make_dev_args *args, size_t sz) +{ + + bzero(args, sz); + args->mda_size = sz; +} + static int -make_dev_credv(int flags, struct cdev **dres, struct cdevsw *devsw, int unit, - struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt, - va_list ap) +make_dev_sv(struct make_dev_args *args1, struct cdev **dres, + const char *fmt, va_list ap) { struct cdev *dev, *dev_new; + struct make_dev_args args; int res; - KASSERT((flags & MAKEDEV_WAITOK) == 0 || (flags & MAKEDEV_NOWAIT) == 0, - ("make_dev_credv: both WAITOK and NOWAIT specified")); - dev_new = devfs_alloc(flags); + bzero(&args, sizeof(args)); + if (sizeof(args) < args1->mda_size) + return (EINVAL); + bcopy(args1, &args, args1->mda_size); + KASSERT((args.mda_flags & MAKEDEV_WAITOK) == 0 || + (args.mda_flags & MAKEDEV_NOWAIT) == 0, + ("make_dev_sv: both WAITOK and NOWAIT specified")); + dev_new = devfs_alloc(args.mda_flags); if (dev_new == NULL) return (ENOMEM); dev_lock(); - res = prep_cdevsw(devsw, flags); + res = prep_cdevsw(args.mda_devsw, args.mda_flags); if (res != 0) { dev_unlock(); devfs_free(dev_new); return (res); } - dev = newdev(devsw, unit, dev_new); + dev = newdev(&args, dev_new); if ((dev->si_flags & SI_NAMED) == 0) { res = prep_devname(dev, fmt, ap); if (res != 0) { - if ((flags & MAKEDEV_CHECKNAME) == 0) { + if ((args.mda_flags & MAKEDEV_CHECKNAME) == 0) { panic( - "make_dev_credv: bad si_name (error=%d, si_name=%s)", + "make_dev_sv: bad si_name (error=%d, si_name=%s)", res, dev->si_name); } if (dev == dev_new) { @@ -775,9 +792,9 @@ make_dev_credv(int flags, struct cdev ** return (res); } } - if (flags & MAKEDEV_REF) + if ((args.mda_flags & MAKEDEV_REF) != 0) dev_refl(dev); - if (flags & MAKEDEV_ETERNAL) + if ((args.mda_flags & MAKEDEV_ETERNAL) != 0) dev->si_flags |= SI_ETERNAL; if (dev->si_flags & SI_CHEAPCLONE && dev->si_flags & SI_NAMED) { @@ -792,24 +809,55 @@ make_dev_credv(int flags, struct cdev ** } KASSERT(!(dev->si_flags & SI_NAMED), ("make_dev() by driver %s on pre-existing device (min=%x, name=%s)", - devsw->d_name, dev2unit(dev), devtoname(dev))); + args.mda_devsw->d_name, dev2unit(dev), devtoname(dev))); dev->si_flags |= SI_NAMED; - if (cr != NULL) - dev->si_cred = crhold(cr); - dev->si_uid = uid; - dev->si_gid = gid; - dev->si_mode = mode; + if (args.mda_cr != NULL) + dev->si_cred = crhold(args.mda_cr); + dev->si_uid = args.mda_uid; + dev->si_gid = args.mda_gid; + dev->si_mode = args.mda_mode; devfs_create(dev); clean_unrhdrl(devfs_inos); dev_unlock_and_free(); - notify_create(dev, flags); + notify_create(dev, args.mda_flags); *dres = dev; return (0); } +int +make_dev_s(struct make_dev_args *args, struct cdev **dres, + const char *fmt, ...) +{ + va_list ap; + int res; + + va_start(ap, fmt); + res = make_dev_sv(args, dres, fmt, ap); + va_end(ap); + return (res); +} + +static int +make_dev_credv(int flags, struct cdev **dres, struct cdevsw *devsw, int unit, + struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt, + va_list ap) +{ + struct make_dev_args args; + + make_dev_args_init(&args); + args.mda_flags = flags; + args.mda_devsw = devsw; + args.mda_cr = cr; + args.mda_uid = uid; + args.mda_gid = gid; + args.mda_mode = mode; + args.mda_unit = unit; + return (make_dev_sv(&args, dres, fmt, ap)); +} + struct cdev * make_dev(struct cdevsw *devsw, int unit, uid_t uid, gid_t gid, int mode, const char *fmt, ...) @@ -1247,6 +1295,7 @@ clone_create(struct clonedevs **cdp, str { struct clonedevs *cd; struct cdev *dev, *ndev, *dl, *de; + struct make_dev_args args; int unit, low, u; KASSERT(*cdp != NULL, @@ -1298,7 +1347,10 @@ clone_create(struct clonedevs **cdp, str } if (unit == -1) unit = low & CLONE_UNITMASK; - dev = newdev(csw, unit | extra, ndev); + make_dev_args_init(&args); + args.mda_unit = unit | extra; + args.mda_devsw = csw; + dev = newdev(&args, ndev); if (dev->si_flags & SI_CLONELIST) { printf("dev %p (%s) is on clonelist\n", dev, dev->si_name); printf("unit=%d, low=%d, extra=0x%x\n", unit, low, extra); Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Thu Jan 7 19:58:23 2016 (r293345) +++ head/sys/sys/conf.h Thu Jan 7 20:08:02 2016 (r293346) @@ -226,6 +226,28 @@ void clone_cleanup(struct clonedevs **); #define CLONE_FLAG0 (CLONE_UNITMASK + 1) int clone_create(struct clonedevs **, struct cdevsw *, int *unit, struct cdev **dev, int extra); +#define MAKEDEV_REF 0x01 +#define MAKEDEV_WHTOUT 0x02 +#define MAKEDEV_NOWAIT 0x04 +#define MAKEDEV_WAITOK 0x08 +#define MAKEDEV_ETERNAL 0x10 +#define MAKEDEV_CHECKNAME 0x20 +struct make_dev_args { + size_t mda_size; + int mda_flags; + struct cdevsw *mda_devsw; + struct ucred *mda_cr; + uid_t mda_uid; + gid_t mda_gid; + int mda_mode; + int mda_unit; + void *mda_si_drv1; + void *mda_si_drv2; +}; +void make_dev_args_init_impl(struct make_dev_args *_args, size_t _sz); +#define make_dev_args_init(a) \ + make_dev_args_init_impl((a), sizeof(struct make_dev_args)) + int count_dev(struct cdev *_dev); void delist_dev(struct cdev *_dev); void destroy_dev(struct cdev *_dev); @@ -245,12 +267,6 @@ struct cdev *make_dev(struct cdevsw *_de struct cdev *make_dev_cred(struct cdevsw *_devsw, int _unit, struct ucred *_cr, uid_t _uid, gid_t _gid, int _perms, const char *_fmt, ...) __printflike(7, 8); -#define MAKEDEV_REF 0x01 -#define MAKEDEV_WHTOUT 0x02 -#define MAKEDEV_NOWAIT 0x04 -#define MAKEDEV_WAITOK 0x08 -#define MAKEDEV_ETERNAL 0x10 -#define MAKEDEV_CHECKNAME 0x20 struct cdev *make_dev_credf(int _flags, struct cdevsw *_devsw, int _unit, struct ucred *_cr, uid_t _uid, gid_t _gid, int _mode, @@ -258,6 +274,8 @@ struct cdev *make_dev_credf(int _flags, int make_dev_p(int _flags, struct cdev **_cdev, struct cdevsw *_devsw, struct ucred *_cr, uid_t _uid, gid_t _gid, int _mode, const char *_fmt, ...) __printflike(8, 9); +int make_dev_s(struct make_dev_args *_args, struct cdev **_cdev, + const char *_fmt, ...) __printflike(3, 4); struct cdev *make_dev_alias(struct cdev *_pdev, const char *_fmt, ...) __printflike(2, 3); int make_dev_alias_p(int _flags, struct cdev **_cdev, struct cdev *_pdev, From owner-svn-src-head@freebsd.org Thu Jan 7 20:15:10 2016 Return-Path: Delivered-To: svn-src-head@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 E2BB4A67AEB; Thu, 7 Jan 2016 20:15:10 +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 A5E6D12BC; Thu, 7 Jan 2016 20:15:10 +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 u07KF9MT028922; Thu, 7 Jan 2016 20:15:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07KF923028920; Thu, 7 Jan 2016 20:15:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601072015.u07KF923028920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 7 Jan 2016 20:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293349 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 20:15:11 -0000 Author: kib Date: Thu Jan 7 20:15:09 2016 New Revision: 293349 URL: https://svnweb.freebsd.org/changeset/base/293349 Log: Convert tty common code to use make_dev_s(). Tty.c was untypical in that it handled the si_drv1 issue consistently and correctly, by always checking for si_drv1 being non-NULL and sleeping if NULL. The removed code also illustrated unneeded complications in drivers which are eliminated by the use of new KPI. Reviewed by: hps, jhb Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D4746 Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Thu Jan 7 20:15:05 2016 (r293348) +++ head/sys/kern/tty.c Thu Jan 7 20:15:09 2016 (r293349) @@ -237,14 +237,10 @@ static int ttydev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { struct tty *tp; - int error = 0; - - while ((tp = dev->si_drv1) == NULL) { - error = tsleep(&dev->si_drv1, PCATCH, "ttdrv1", 1); - if (error != EWOULDBLOCK) - return (error); - } + int error; + tp = dev->si_drv1; + error = 0; tty_lock(tp); if (tty_gone(tp)) { /* Device is already gone. */ @@ -755,13 +751,10 @@ static int ttyil_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { struct tty *tp; - int error = 0; + int error; - while ((tp = dev->si_drv1) == NULL) { - error = tsleep(&dev->si_drv1, PCATCH, "ttdrv1", 1); - if (error != EWOULDBLOCK) - return (error); - } + tp = dev->si_drv1; + error = 0; tty_lock(tp); if (tty_gone(tp)) error = ENODEV; @@ -1189,6 +1182,7 @@ tty_makedevf(struct tty *tp, struct ucre const char *fmt, ...) { va_list ap; + struct make_dev_args args; struct cdev *dev, *init, *lock, *cua, *cinit, *clock; const char *prefix = "tty"; char name[SPECNAMELEN - 3]; /* for "tty" and "cua". */ @@ -1221,71 +1215,72 @@ tty_makedevf(struct tty *tp, struct ucre flags |= MAKEDEV_CHECKNAME; /* Master call-in device. */ - error = make_dev_p(flags, &dev, &ttydev_cdevsw, cred, uid, gid, mode, - "%s%s", prefix, name); - if (error) + make_dev_args_init(&args); + args.mda_flags = flags; + args.mda_devsw = &ttydev_cdevsw; + args.mda_cr = cred; + args.mda_uid = uid; + args.mda_gid = gid; + args.mda_mode = mode; + args.mda_si_drv1 = tp; + error = make_dev_s(&args, &dev, "%s%s", prefix, name); + if (error != 0) return (error); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); tp->t_dev = dev; init = lock = cua = cinit = clock = NULL; /* Slave call-in devices. */ if (tp->t_flags & TF_INITLOCK) { - error = make_dev_p(flags, &init, &ttyil_cdevsw, cred, uid, - gid, mode, "%s%s.init", prefix, name); - if (error) + args.mda_devsw = &ttyil_cdevsw; + args.mda_unit = TTYUNIT_INIT; + args.mda_si_drv1 = tp; + args.mda_si_drv2 = &tp->t_termios_init_in; + error = make_dev_s(&args, &init, "%s%s.init", prefix, name); + if (error != 0) goto fail; dev_depends(dev, init); - dev2unit(init) = TTYUNIT_INIT; - init->si_drv1 = tp; - wakeup(&init->si_drv1); - init->si_drv2 = &tp->t_termios_init_in; - error = make_dev_p(flags, &lock, &ttyil_cdevsw, cred, uid, - gid, mode, "%s%s.lock", prefix, name); - if (error) + args.mda_unit = TTYUNIT_LOCK; + args.mda_si_drv2 = &tp->t_termios_lock_in; + error = make_dev_s(&args, &lock, "%s%s.lock", prefix, name); + if (error != 0) goto fail; dev_depends(dev, lock); - dev2unit(lock) = TTYUNIT_LOCK; - lock->si_drv1 = tp; - wakeup(&lock->si_drv1); - lock->si_drv2 = &tp->t_termios_lock_in; } /* Call-out devices. */ if (tp->t_flags & TF_CALLOUT) { - error = make_dev_p(flags, &cua, &ttydev_cdevsw, cred, - UID_UUCP, GID_DIALER, 0660, "cua%s", name); - if (error) + make_dev_args_init(&args); + args.mda_flags = flags; + args.mda_devsw = &ttydev_cdevsw; + args.mda_cr = cred; + args.mda_uid = UID_UUCP; + args.mda_gid = GID_DIALER; + args.mda_mode = 0660; + args.mda_unit = TTYUNIT_CALLOUT; + args.mda_si_drv1 = tp; + error = make_dev_s(&args, &cua, "cua%s", name); + if (error != 0) goto fail; dev_depends(dev, cua); - dev2unit(cua) = TTYUNIT_CALLOUT; - cua->si_drv1 = tp; - wakeup(&cua->si_drv1); /* Slave call-out devices. */ if (tp->t_flags & TF_INITLOCK) { - error = make_dev_p(flags, &cinit, &ttyil_cdevsw, cred, - UID_UUCP, GID_DIALER, 0660, "cua%s.init", name); - if (error) + args.mda_devsw = &ttyil_cdevsw; + args.mda_unit = TTYUNIT_CALLOUT | TTYUNIT_INIT; + args.mda_si_drv2 = &tp->t_termios_init_out; + error = make_dev_s(&args, &cinit, "cua%s.init", name); + if (error != 0) goto fail; dev_depends(dev, cinit); - dev2unit(cinit) = TTYUNIT_CALLOUT | TTYUNIT_INIT; - cinit->si_drv1 = tp; - wakeup(&cinit->si_drv1); - cinit->si_drv2 = &tp->t_termios_init_out; - error = make_dev_p(flags, &clock, &ttyil_cdevsw, cred, - UID_UUCP, GID_DIALER, 0660, "cua%s.lock", name); - if (error) + args.mda_unit = TTYUNIT_CALLOUT | TTYUNIT_LOCK; + args.mda_si_drv2 = &tp->t_termios_lock_out; + error = make_dev_s(&args, &clock, "cua%s.lock", name); + if (error != 0) goto fail; dev_depends(dev, clock); - dev2unit(clock) = TTYUNIT_CALLOUT | TTYUNIT_LOCK; - clock->si_drv1 = tp; - wakeup(&clock->si_drv1); - clock->si_drv2 = &tp->t_termios_lock_out; } } From owner-svn-src-head@freebsd.org Thu Jan 7 20:17:40 2016 Return-Path: Delivered-To: svn-src-head@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 D3120A67BC8; Thu, 7 Jan 2016 20:17:40 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E9E71625; Thu, 7 Jan 2016 20:17:40 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 9EE76B80AA; Thu, 7 Jan 2016 21:17:37 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 8A8FF28494; Thu, 7 Jan 2016 21:17:37 +0100 (CET) Date: Thu, 7 Jan 2016 21:17:37 +0100 From: Jilles Tjoelker To: Chagin Dmitry Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r277610 - in head: bin/ln lib/libc/include lib/libc/sys share/man/man4 sys/compat/freebsd32 sys/kern sys/sys usr.bin/kdump Message-ID: <20160107201737.GA51187@stack.nl> References: <201501232107.t0NL79a8099736@svn.freebsd.org> <20160107130325.GA62399@chd.heemeyer.club> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160107130325.GA62399@chd.heemeyer.club> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 20:17:40 -0000 On Thu, Jan 07, 2016 at 04:03:25PM +0300, Chagin Dmitry wrote: > On Fri, Jan 23, 2015 at 09:07:09PM +0000, Jilles Tjoelker wrote: > > Author: jilles > > Date: Fri Jan 23 21:07:08 2015 > > New Revision: 277610 > > URL: https://svnweb.freebsd.org/changeset/base/277610 > > Log: > > Add futimens and utimensat system calls. > > The core kernel part is patch file utimes.2008.4.diff from > > pluknet@FreeBSD.org. I updated the code for API changes, added the manual > > page and added compatibility code for old kernels. There is also audit and > > Capsicum support. > > A new UTIME_* constant might allow setting birthtimes in future. > > Differential Revision: https://reviews.freebsd.org/D1426 > > Submitted by: pluknet (partially) > > Reviewed by: delphij, pluknet, rwatson > > Relnotes: yes > any chances that it will be merged to 10? if not, can I merge kernel > part only? I don't plan an MFC because I don't think the trouble of not being able to run a binary compiled on a newer stable/10 on an older stable/10 is worth it. I have no objection to a partial MFC that does not expose the new functions to build systems of ports and other third party software. -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Thu Jan 7 20:20:43 2016 Return-Path: Delivered-To: svn-src-head@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 BF5BCA67D64; Thu, 7 Jan 2016 20:20:43 +0000 (UTC) (envelope-from jim.harris@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (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 904B618E2; Thu, 7 Jan 2016 20:20:43 +0000 (UTC) (envelope-from jim.harris@gmail.com) Received: by mail-io0-x229.google.com with SMTP id g73so66562908ioe.3; Thu, 07 Jan 2016 12:20:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=NxgxOxkIqQCmFz4kZMu4oThiXJg7CMi0eBBp0yUc8+k=; b=AmxFXsT/DTbULMeFUrwvZXaHIyiJNfpDHhFhpHl7qcyLIFaRjGte3XQXZianTfQ4IZ /bKec4m2DVMocw7EnnoPbksfv/30vx0HLksG5G/Gm2pdXTTGhbcUK3rZZGQi5ZbwnGcf m48wwroH+aEfQ/sRbMz8B2TPZDBCR7UScONkXETd2XBpVpDdT4/azaIe5GfZVNhWyWZH FnGJUm56sKzoEJNYw9VCUNd4Ht0ZcmgIqvc4OSyVooNl4iW+VCLQlLstusubJkuGd5dk VEabj09J22p1PP87P/XjwfIZrHWgSM36bR531aTG6nhw+TyQ6zH1TjsAke+lIK+kQazh 6w/A== MIME-Version: 1.0 X-Received: by 10.107.184.67 with SMTP id i64mr112685587iof.4.1452198042906; Thu, 07 Jan 2016 12:20:42 -0800 (PST) Received: by 10.64.241.228 with HTTP; Thu, 7 Jan 2016 12:20:42 -0800 (PST) In-Reply-To: <6496C054-6FED-4B41-8EF8-8067E8B6C866@panasas.com> References: <201601071618.u07GIXdd054147@repo.freebsd.org> <6496C054-6FED-4B41-8EF8-8067E8B6C866@panasas.com> Date: Thu, 7 Jan 2016 13:20:42 -0700 Message-ID: Subject: Re: svn commit: r293328 - head/sys/dev/nvme From: Jim Harris To: Ravi Pokala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 20:20:43 -0000 On Thu, Jan 7, 2016 at 9:27 AM, Ravi Pokala wrote: > -----Original Message----- > > > From: on behalf of Jim Harris > > Date: 2016-01-07, Thursday at 08:18 > To: , , < > svn-src-head@freebsd.org> > Subject: svn commit: r293328 - head/sys/dev/nvme > > >Author: jimharris > >Date: Thu Jan 7 16:18:32 2016 > >New Revision: 293328 > >URL: https://svnweb.freebsd.org/changeset/base/293328 > > > >... > > > >Modified: head/sys/dev/nvme/nvme_ctrlr.c > > >============================================================================== > >--- head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:12:42 2016 > (r293327) > >+++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:18:32 2016 > (r293328) > >@@ -42,6 +42,12 @@ __FBSDID("$FreeBSD$"); > > > > #include "nvme_private.h" > > > >+/* > >+ * Used for calculating number of CPUs to assign to each core and number > of I/O > >+ * queues to allocate per controller. > >+ */ > >+#define NVME_CEILING(num, div) ((((num) - 1) / (div)) + 1) > >+ > > > >... > > I'm surprised that this isn't in , along with > roundup()/rounddown()/etc. Finding the ceiling like this is probably pretty > common, so shouldn't it be added to the common header so everyone can use > it? > Good catch. howmany() does exactly this, just expressed differently. I'll switch over to that. Thanks! -Jim > > -Ravi (rpokala@) > > From owner-svn-src-head@freebsd.org Thu Jan 7 20:22:57 2016 Return-Path: Delivered-To: svn-src-head@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 7DEE3A67E97; Thu, 7 Jan 2016 20:22:57 +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 465651DDE; Thu, 7 Jan 2016 20:22:57 +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 u07KMuaS031980; Thu, 7 Jan 2016 20:22:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07KMtxs031973; Thu, 7 Jan 2016 20:22:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601072022.u07KMtxs031973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 7 Jan 2016 20:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293350 - in head/sys/cam: ctl scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 20:22:57 -0000 Author: kib Date: Thu Jan 7 20:22:55 2016 New Revision: 293350 URL: https://svnweb.freebsd.org/changeset/base/293350 Log: Convert sys/cam to use make_dev_s(). Reviewed by: hps, jhb Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D4746 Modified: head/sys/cam/ctl/ctl.c head/sys/cam/scsi/scsi_ch.c head/sys/cam/scsi/scsi_enc.c head/sys/cam/scsi/scsi_pass.c head/sys/cam/scsi/scsi_pt.c head/sys/cam/scsi/scsi_sa.c head/sys/cam/scsi/scsi_sg.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Jan 7 20:15:09 2016 (r293349) +++ head/sys/cam/ctl/ctl.c Thu Jan 7 20:22:55 2016 (r293350) @@ -1778,6 +1778,7 @@ ctl_ha_role_sysctl(SYSCTL_HANDLER_ARGS) static int ctl_init(void) { + struct make_dev_args args; struct ctl_softc *softc; void *other_pool; int i, error; @@ -1785,9 +1786,17 @@ ctl_init(void) softc = control_softc = malloc(sizeof(*control_softc), M_DEVBUF, M_WAITOK | M_ZERO); - softc->dev = make_dev(&ctl_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0600, - "cam/ctl"); - softc->dev->si_drv1 = softc; + make_dev_args_init(&args); + args.mda_devsw = &ctl_cdevsw; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0600; + args.mda_si_drv1 = softc; + error = make_dev_s(&args, &softc->dev, "cam/ctl"); + if (error != 0) { + free(control_softc, M_DEVBUF); + return (error); + } sysctl_ctx_init(&softc->sysctl_ctx); softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, Modified: head/sys/cam/scsi/scsi_ch.c ============================================================================== --- head/sys/cam/scsi/scsi_ch.c Thu Jan 7 20:15:09 2016 (r293349) +++ head/sys/cam/scsi/scsi_ch.c Thu Jan 7 20:22:55 2016 (r293350) @@ -372,6 +372,8 @@ chregister(struct cam_periph *periph, vo struct ch_softc *softc; struct ccb_getdev *cgd; struct ccb_pathinq cpi; + struct make_dev_args args; + int error; cgd = (struct ccb_getdev *)arg; if (cgd == NULL) { @@ -431,11 +433,20 @@ chregister(struct cam_periph *periph, vo /* Register the device */ - softc->dev = make_dev(&ch_cdevsw, periph->unit_number, UID_ROOT, - GID_OPERATOR, 0600, "%s%d", periph->periph_name, - periph->unit_number); + make_dev_args_init(&args); + args.mda_devsw = &ch_cdevsw; + args.mda_unit = periph->unit_number; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0600; + args.mda_si_drv1 = periph; + error = make_dev_s(&args, &softc->dev, "%s%d", periph->periph_name, + periph->unit_number); cam_periph_lock(periph); - softc->dev->si_drv1 = periph; + if (error != 0) { + cam_periph_release_locked(periph); + return (CAM_REQ_CMP_ERR); + } /* * Add an async callback so that we get @@ -507,8 +518,6 @@ chclose(struct cdev *dev, int flag, int struct mtx *mtx; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return(ENXIO); mtx = cam_periph_mtx(periph); mtx_lock(mtx); @@ -754,9 +763,6 @@ chioctl(struct cdev *dev, u_long cmd, ca int error; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return(ENXIO); - cam_periph_lock(periph); CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering chioctl\n")); Modified: head/sys/cam/scsi/scsi_enc.c ============================================================================== --- head/sys/cam/scsi/scsi_enc.c Thu Jan 7 20:15:09 2016 (r293349) +++ head/sys/cam/scsi/scsi_enc.c Thu Jan 7 20:22:55 2016 (r293350) @@ -264,10 +264,6 @@ enc_open(struct cdev *dev, int flags, in int error = 0; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) { - return (ENXIO); - } - if (cam_periph_acquire(periph) != CAM_REQ_CMP) return (ENXIO); @@ -302,8 +298,6 @@ enc_close(struct cdev *dev, int flag, in struct mtx *mtx; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); mtx = cam_periph_mtx(periph); mtx_lock(mtx); @@ -364,9 +358,6 @@ enc_ioctl(struct cdev *dev, u_long cmd, addr = NULL; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering encioctl\n")); cam_periph_lock(periph); @@ -905,6 +896,7 @@ enc_ctor(struct cam_periph *periph, void enc_softc_t *enc; struct ccb_getdev *cgd; char *tname; + struct make_dev_args args; cgd = (struct ccb_getdev *)arg; if (cgd == NULL) { @@ -987,12 +979,20 @@ enc_ctor(struct cam_periph *periph, void return (CAM_REQ_CMP_ERR); } - enc->enc_dev = make_dev(&enc_cdevsw, periph->unit_number, - UID_ROOT, GID_OPERATOR, 0600, "%s%d", - periph->periph_name, periph->unit_number); - + make_dev_args_init(&args); + args.mda_devsw = &enc_cdevsw; + args.mda_unit = periph->unit_number; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0600; + args.mda_si_drv1 = periph; + err = make_dev_s(&args, &enc->enc_dev, "%s%d", periph->periph_name, + periph->unit_number); cam_periph_lock(periph); - enc->enc_dev->si_drv1 = periph; + if (err != 0) { + cam_periph_release_locked(periph); + return (CAM_REQ_CMP_ERR); + } enc->enc_flags |= ENC_FLAG_INITIALIZED; Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Thu Jan 7 20:15:09 2016 (r293349) +++ head/sys/cam/scsi/scsi_pass.c Thu Jan 7 20:22:55 2016 (r293350) @@ -548,7 +548,8 @@ passregister(struct cam_periph *periph, struct pass_softc *softc; struct ccb_getdev *cgd; struct ccb_pathinq cpi; - int no_tags; + struct make_dev_args args; + int error, no_tags; cgd = (struct ccb_getdev *)arg; if (cgd == NULL) { @@ -648,9 +649,20 @@ passregister(struct cam_periph *periph, } /* Register the device */ - softc->dev = make_dev(&pass_cdevsw, periph->unit_number, - UID_ROOT, GID_OPERATOR, 0600, "%s%d", - periph->periph_name, periph->unit_number); + make_dev_args_init(&args); + args.mda_devsw = &pass_cdevsw; + args.mda_unit = periph->unit_number; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0600; + args.mda_si_drv1 = periph; + error = make_dev_s(&args, &softc->dev, "%s%d", periph->periph_name, + periph->unit_number); + if (error != 0) { + cam_periph_lock(periph); + cam_periph_release_locked(periph); + return (CAM_REQ_CMP_ERR); + } /* * Hold a reference to the periph before we create the physical @@ -664,7 +676,6 @@ passregister(struct cam_periph *periph, } cam_periph_lock(periph); - softc->dev->si_drv1 = periph; TASK_INIT(&softc->add_physpath_task, /*priority*/0, pass_add_physpath, periph); @@ -754,8 +765,6 @@ passclose(struct cdev *dev, int flag, in struct mtx *mtx; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); mtx = cam_periph_mtx(periph); mtx_lock(mtx); @@ -1759,9 +1768,6 @@ passdoioctl(struct cdev *dev, u_long cmd uint32_t priority; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return(ENXIO); - cam_periph_lock(periph); softc = (struct pass_softc *)periph->softc; @@ -2068,9 +2074,6 @@ passpoll(struct cdev *dev, int poll_even int revents; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - softc = (struct pass_softc *)periph->softc; revents = poll_events & (POLLOUT | POLLWRNORM); @@ -2095,9 +2098,6 @@ passkqfilter(struct cdev *dev, struct kn struct pass_softc *softc; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - softc = (struct pass_softc *)periph->softc; kn->kn_hook = (caddr_t)periph; Modified: head/sys/cam/scsi/scsi_pt.c ============================================================================== --- head/sys/cam/scsi/scsi_pt.c Thu Jan 7 20:15:09 2016 (r293349) +++ head/sys/cam/scsi/scsi_pt.c Thu Jan 7 20:22:55 2016 (r293350) @@ -173,9 +173,6 @@ ptclose(struct cdev *dev, int flag, int struct pt_softc *softc; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - softc = (struct pt_softc *)periph->softc; cam_periph_lock(periph); @@ -252,6 +249,8 @@ ptctor(struct cam_periph *periph, void * struct pt_softc *softc; struct ccb_getdev *cgd; struct ccb_pathinq cpi; + struct make_dev_args args; + int error; cgd = (struct ccb_getdev *)arg; if (cgd == NULL) { @@ -282,6 +281,21 @@ ptctor(struct cam_periph *periph, void * xpt_action((union ccb *)&cpi); cam_periph_unlock(periph); + + make_dev_args_init(&args); + args.mda_devsw = &pt_cdevsw; + args.mda_unit = periph->unit_number; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0600; + args.mda_si_drv1 = periph; + error = make_dev_s(&args, &softc->dev, "%s%d", periph->periph_name, + periph->unit_number); + if (error != 0) { + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } + softc->device_stats = devstat_new_entry("pt", periph->unit_number, 0, DEVSTAT_NO_BLOCKSIZE, @@ -289,11 +303,7 @@ ptctor(struct cam_periph *periph, void * XPORT_DEVSTAT_TYPE(cpi.transport), DEVSTAT_PRIORITY_OTHER); - softc->dev = make_dev(&pt_cdevsw, periph->unit_number, UID_ROOT, - GID_OPERATOR, 0600, "%s%d", periph->periph_name, - periph->unit_number); cam_periph_lock(periph); - softc->dev->si_drv1 = periph; /* * Add async callbacks for bus reset and @@ -571,9 +581,6 @@ ptioctl(struct cdev *dev, u_long cmd, ca int error = 0; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return(ENXIO); - softc = (struct pt_softc *)periph->softc; cam_periph_lock(periph); Modified: head/sys/cam/scsi/scsi_sa.c ============================================================================== --- head/sys/cam/scsi/scsi_sa.c Thu Jan 7 20:15:09 2016 (r293349) +++ head/sys/cam/scsi/scsi_sa.c Thu Jan 7 20:22:55 2016 (r293350) @@ -731,9 +731,6 @@ saclose(struct cdev *dev, int flag, int mode = SAMODE(dev); periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - cam_periph_lock(periph); softc = (struct sa_softc *)periph->softc; @@ -906,10 +903,6 @@ sastrategy(struct bio *bp) return; } periph = (struct cam_periph *)bp->bio_dev->si_drv1; - if (periph == NULL) { - biofinish(bp, NULL, ENXIO); - return; - } cam_periph_lock(periph); softc = (struct sa_softc *)periph->softc; @@ -1517,9 +1510,6 @@ saioctl(struct cdev *dev, u_long cmd, ca spaceop = 0; /* shut up gcc */ periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - cam_periph_lock(periph); softc = (struct sa_softc *)periph->softc; @@ -2285,7 +2275,7 @@ saasync(void *callback_arg, u_int32_t co static void sasetupdev(struct sa_softc *softc, struct cdev *dev) { - dev->si_drv1 = softc->periph; + dev->si_iosize_max = softc->maxio; dev->si_flags |= softc->si_flags; /* @@ -2347,8 +2337,10 @@ saregister(struct cam_periph *periph, vo struct sa_softc *softc; struct ccb_getdev *cgd; struct ccb_pathinq cpi; + struct make_dev_args args; caddr_t match; char tmpstr[80]; + int error; cgd = (struct ccb_getdev *)arg; if (cgd == NULL) { @@ -2506,25 +2498,48 @@ saregister(struct cam_periph *periph, vo return (CAM_REQ_CMP_ERR); } - softc->devs.ctl_dev = make_dev(&sa_cdevsw, SAMINOR(SA_CTLDEV, - SA_ATYPE_R), UID_ROOT, GID_OPERATOR, - 0660, "%s%d.ctl", periph->periph_name, periph->unit_number); + make_dev_args_init(&args); + args.mda_devsw = &sa_cdevsw; + args.mda_si_drv1 = softc->periph; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0660; + + args.mda_unit = SAMINOR(SA_CTLDEV, SA_ATYPE_R); + error = make_dev_s(&args, &softc->devs.ctl_dev, "%s%d.ctl", + periph->periph_name, periph->unit_number); + if (error != 0) { + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } sasetupdev(softc, softc->devs.ctl_dev); - softc->devs.r_dev = make_dev(&sa_cdevsw, SAMINOR(SA_NOT_CTLDEV, - SA_ATYPE_R), UID_ROOT, GID_OPERATOR, - 0660, "%s%d", periph->periph_name, periph->unit_number); + args.mda_unit = SAMINOR(SA_NOT_CTLDEV, SA_ATYPE_R); + error = make_dev_s(&args, &softc->devs.r_dev, "%s%d", + periph->periph_name, periph->unit_number); + if (error != 0) { + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } sasetupdev(softc, softc->devs.r_dev); - softc->devs.nr_dev = make_dev(&sa_cdevsw, SAMINOR(SA_NOT_CTLDEV, - SA_ATYPE_NR), UID_ROOT, GID_OPERATOR, - 0660, "n%s%d", periph->periph_name, periph->unit_number); + args.mda_unit = SAMINOR(SA_NOT_CTLDEV, SA_ATYPE_NR); + error = make_dev_s(&args, &softc->devs.nr_dev, "n%s%d", + periph->periph_name, periph->unit_number); + if (error != 0) { + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } sasetupdev(softc, softc->devs.nr_dev); - softc->devs.er_dev = make_dev(&sa_cdevsw, SAMINOR(SA_NOT_CTLDEV, - SA_ATYPE_ER), UID_ROOT, GID_OPERATOR, - 0660, "e%s%d", periph->periph_name, periph->unit_number); - sasetupdev(softc, softc->devs.er_dev); + args.mda_unit = SAMINOR(SA_NOT_CTLDEV, SA_ATYPE_ER); + error = make_dev_s(&args, &softc->devs.er_dev, "e%s%d", + periph->periph_name, periph->unit_number); + if (error != 0) { + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } + sasetupdev(softc, softc->devs.er_dev); cam_periph_lock(periph); Modified: head/sys/cam/scsi/scsi_sg.c ============================================================================== --- head/sys/cam/scsi/scsi_sg.c Thu Jan 7 20:15:09 2016 (r293349) +++ head/sys/cam/scsi/scsi_sg.c Thu Jan 7 20:22:55 2016 (r293350) @@ -300,7 +300,8 @@ sgregister(struct cam_periph *periph, vo struct sg_softc *softc; struct ccb_getdev *cgd; struct ccb_pathinq cpi; - int no_tags; + struct make_dev_args args; + int no_tags, error; cgd = (struct ccb_getdev *)arg; if (cgd == NULL) { @@ -361,9 +362,20 @@ sgregister(struct cam_periph *periph, vo } /* Register the device */ - softc->dev = make_dev(&sg_cdevsw, periph->unit_number, - UID_ROOT, GID_OPERATOR, 0600, "%s%d", - periph->periph_name, periph->unit_number); + make_dev_args_init(&args); + args.mda_devsw = &sg_cdevsw; + args.mda_unit = periph->unit_number; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0600; + args.mda_si_drv1 = periph; + error = make_dev_s(&args, &softc->dev, "%s%d", + periph->periph_name, periph->unit_number); + if (error != 0) { + cam_periph_lock(periph); + cam_periph_release_locked(periph); + return (CAM_REQ_CMP_ERR); + } if (periph->unit_number < 26) { (void)make_dev_alias(softc->dev, "sg%c", periph->unit_number + 'a'); @@ -373,7 +385,6 @@ sgregister(struct cam_periph *periph, vo (periph->unit_number % 26) + 'a'); } cam_periph_lock(periph); - softc->dev->si_drv1 = periph; /* * Add as async callback so that we get @@ -429,9 +440,6 @@ sgopen(struct cdev *dev, int flags, int int error = 0; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - if (cam_periph_acquire(periph) != CAM_REQ_CMP) return (ENXIO); @@ -468,8 +476,6 @@ sgclose(struct cdev *dev, int flag, int struct mtx *mtx; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); mtx = cam_periph_mtx(periph); mtx_lock(mtx); @@ -506,9 +512,6 @@ sgioctl(struct cdev *dev, u_long cmd, ca int dir, error; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - cam_periph_lock(periph); softc = (struct sg_softc *)periph->softc; From owner-svn-src-head@freebsd.org Thu Jan 7 20:25:30 2016 Return-Path: Delivered-To: svn-src-head@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 D56DEA67F42; Thu, 7 Jan 2016 20:25:30 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f180.google.com (mail-yk0-f180.google.com [209.85.160.180]) (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 9B6AE10CF; Thu, 7 Jan 2016 20:25:30 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yk0-f180.google.com with SMTP id x67so341988855ykd.2; Thu, 07 Jan 2016 12:25:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=6BIHxZJRs1h48XI1LufgeOmoEqrM6G0R0roELwKPUg0=; b=BC01pBUWticvmvkGGyACvwHGgXQVg2HPdGLanIP+/qzjcmx/u1tacAguuUK/ZY5suE /dSuP7xDAlXPxwYnX465R5v6zKNWdAoruEPOa/kTd3SDUrgyW9Bh2LQePq8uEtCtwCVq tcIvqMcwWfZMwR0FvCiey8Kmw106Bc5vQ8/K42tXP4bnBkYeJfxNzgO5dja0oG+HtZsg kmoreislM26SAEYEPg+4dMXlW2GEh03FzkTTXb12qAx+v5njDmxEELo+9SBq4j0/pLtF qb8INaHlBli/sorblEayUjDTQ72eEuiaMvTYfFq1zQMRlIaqSO0bAQgNDHun6vErAvkm HkoA== X-Received: by 10.129.54.16 with SMTP id d16mr77304975ywa.41.1452197837801; Thu, 07 Jan 2016 12:17:17 -0800 (PST) Received: from mail-yk0-f178.google.com (mail-yk0-f178.google.com. [209.85.160.178]) by smtp.gmail.com with ESMTPSA id t128sm85909135ywa.55.2016.01.07.12.17.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jan 2016 12:17:17 -0800 (PST) Received: by mail-yk0-f178.google.com with SMTP id k129so319100533yke.0; Thu, 07 Jan 2016 12:17:17 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.153.129 with SMTP id q123mr87933925ywg.281.1452197837245; Thu, 07 Jan 2016 12:17:17 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.4.69 with HTTP; Thu, 7 Jan 2016 12:17:17 -0800 (PST) In-Reply-To: <6496C054-6FED-4B41-8EF8-8067E8B6C866@panasas.com> References: <201601071618.u07GIXdd054147@repo.freebsd.org> <6496C054-6FED-4B41-8EF8-8067E8B6C866@panasas.com> Date: Thu, 7 Jan 2016 12:17:17 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r293328 - head/sys/dev/nvme From: Conrad Meyer To: Ravi Pokala Cc: Jim Harris , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 20:25:30 -0000 I believe it's spelled "howmany()." On Thu, Jan 7, 2016 at 8:27 AM, Ravi Pokala wrote: > -----Original Message----- > > > From: on behalf of Jim Harris > Date: 2016-01-07, Thursday at 08:18 > To: , , > Subject: svn commit: r293328 - head/sys/dev/nvme > >>Author: jimharris >>Date: Thu Jan 7 16:18:32 2016 >>New Revision: 293328 >>URL: https://svnweb.freebsd.org/changeset/base/293328 >> >>... >> >>Modified: head/sys/dev/nvme/nvme_ctrlr.c >>============================================================================== >>--- head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:12:42 2016 (r293327) >>+++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 16:18:32 2016 (r293328) >>@@ -42,6 +42,12 @@ __FBSDID("$FreeBSD$"); >> >> #include "nvme_private.h" >> >>+/* >>+ * Used for calculating number of CPUs to assign to each core and number of I/O >>+ * queues to allocate per controller. >>+ */ >>+#define NVME_CEILING(num, div) ((((num) - 1) / (div)) + 1) >>+ >> >>... > > I'm surprised that this isn't in , along with roundup()/rounddown()/etc. Finding the ceiling like this is probably pretty common, so shouldn't it be added to the common header so everyone can use it? > > -Ravi (rpokala@) > > From owner-svn-src-head@freebsd.org Thu Jan 7 20:32:06 2016 Return-Path: Delivered-To: svn-src-head@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 E2B57A6633F; Thu, 7 Jan 2016 20:32:05 +0000 (UTC) (envelope-from jimharris@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 9D16715A5; Thu, 7 Jan 2016 20:32:05 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07KW4nT034720; Thu, 7 Jan 2016 20:32:04 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07KW4V5034717; Thu, 7 Jan 2016 20:32:04 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601072032.u07KW4V5034717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 7 Jan 2016 20:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293352 - in head: share/man/man4 sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 20:32:06 -0000 Author: jimharris Date: Thu Jan 7 20:32:04 2016 New Revision: 293352 URL: https://svnweb.freebsd.org/changeset/base/293352 Log: nvme: add hw.nvme.min_cpus_per_ioq tunable Due to FreeBSD system-wide limits on number of MSI-X vectors (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199321), it may be desirable to allocate fewer than the maximum number of vectors for an NVMe device, in order to save vectors for other devices (usually Ethernet) that can take better advantage of them and may be probed after NVMe. This tunable is expressed in terms of minimum number of CPUs per I/O queue instead of max number of queues per controller, to allow for a more even distribution of CPUs per queue. This avoids cases where some number of CPUs have a dedicated queue, but other CPUs need to share queues. Ideally the PR referenced above will eventually be fixed and the mechanism implemented here becomes obsolete anyways. While here, fix a bug in the CPUs per I/O queue calculation to properly account for the admin queue's MSI-X vector. Reviewed by: gallatin MFC after: 3 days Sponsored by: Intel Modified: head/share/man/man4/nvme.4 head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_sysctl.c Modified: head/share/man/man4/nvme.4 ============================================================================== --- head/share/man/man4/nvme.4 Thu Jan 7 20:24:30 2016 (r293351) +++ head/share/man/man4/nvme.4 Thu Jan 7 20:32:04 2016 (r293352) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2012-2014 Intel Corporation +.\" Copyright (c) 2012-2016 Intel Corporation .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2014 +.Dd January 7, 2016 .Dt NVME 4 .Os .Sh NAME @@ -89,7 +89,10 @@ not 0, and this driver follows that conv By default, .Nm will create an I/O queue pair for each CPU, provided enough MSI-X vectors -can be allocated. +and NVMe queue pairs can be allocated. If not enough vectors or queue +pairs are available, nvme(4) will use a smaller number of queue pairs and +assign multiple CPUs per queue pair. +.Pp To force a single I/O queue pair shared by all CPUs, set the following tunable value in .Xr loader.conf 5 : @@ -97,6 +100,13 @@ tunable value in hw.nvme.per_cpu_io_queues=0 .Ed .Pp +To assign more than one CPU per I/O queue pair, thereby reducing the number +of MSI-X vectors consumed by the device, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.nvme.min_cpus_per_ioq=X +.Ed +.Pp To force legacy interrupts for all .Nm driver instances, set the following tunable value in @@ -109,6 +119,8 @@ Note that use of INTx implies disabling .Sh SYSCTL VARIABLES The following controller-level sysctls are currently implemented: .Bl -tag -width indent +.It Va dev.nvme.0.num_cpus_per_ioq +(R) Number of CPUs associated with each I/O queue pair. .It Va dev.nvme.0.int_coal_time (R/W) Interrupt coalescing timer period in microseconds. Set to 0 to disable. Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 20:24:30 2016 (r293351) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 20:32:04 2016 (r293352) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012-2015 Intel Corporation + * Copyright (C) 2012-2016 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -978,13 +978,27 @@ nvme_ctrlr_setup_interrupts(struct nvme_ { device_t dev; int per_cpu_io_queues; + int min_cpus_per_ioq; int num_vectors_requested, num_vectors_allocated; int num_vectors_available; dev = ctrlr->dev; + min_cpus_per_ioq = 1; + TUNABLE_INT_FETCH("hw.nvme.min_cpus_per_ioq", &min_cpus_per_ioq); + + if (min_cpus_per_ioq < 1) { + min_cpus_per_ioq = 1; + } else if (min_cpus_per_ioq > mp_ncpus) { + min_cpus_per_ioq = mp_ncpus; + } + per_cpu_io_queues = 1; TUNABLE_INT_FETCH("hw.nvme.per_cpu_io_queues", &per_cpu_io_queues); + if (per_cpu_io_queues == 0) { + min_cpus_per_ioq = mp_ncpus; + } + ctrlr->force_intx = 0; TUNABLE_INT_FETCH("hw.nvme.force_intx", &ctrlr->force_intx); @@ -1010,10 +1024,12 @@ nvme_ctrlr_setup_interrupts(struct nvme_ return; } - if (per_cpu_io_queues) - ctrlr->num_cpus_per_ioq = NVME_CEILING(mp_ncpus, num_vectors_available + 1); - else - ctrlr->num_cpus_per_ioq = mp_ncpus; + /* + * Do not use all vectors for I/O queues - one must be saved for the + * admin queue. + */ + ctrlr->num_cpus_per_ioq = max(min_cpus_per_ioq, + NVME_CEILING(mp_ncpus, num_vectors_available - 1)); ctrlr->num_io_queues = NVME_CEILING(mp_ncpus, ctrlr->num_cpus_per_ioq); num_vectors_requested = ctrlr->num_io_queues + 1; Modified: head/sys/dev/nvme/nvme_sysctl.c ============================================================================== --- head/sys/dev/nvme/nvme_sysctl.c Thu Jan 7 20:24:30 2016 (r293351) +++ head/sys/dev/nvme/nvme_sysctl.c Thu Jan 7 20:32:04 2016 (r293352) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012-2013 Intel Corporation + * Copyright (C) 2012-2016 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -267,6 +267,10 @@ nvme_sysctl_initialize_ctrlr(struct nvme ctrlr_tree = device_get_sysctl_tree(ctrlr->dev); ctrlr_list = SYSCTL_CHILDREN(ctrlr_tree); + SYSCTL_ADD_UINT(ctrlr_ctx, ctrlr_list, OID_AUTO, "num_cpus_per_ioq", + CTLFLAG_RD, &ctrlr->num_cpus_per_ioq, 0, + "Number of CPUs assigned per I/O queue pair"); + SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, "int_coal_time", CTLTYPE_UINT | CTLFLAG_RW, ctrlr, 0, nvme_sysctl_int_coal_time, "IU", From owner-svn-src-head@freebsd.org Thu Jan 7 20:35:27 2016 Return-Path: Delivered-To: svn-src-head@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 C9C8EA66514; Thu, 7 Jan 2016 20:35:27 +0000 (UTC) (envelope-from jimharris@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 7DBCB1A58; Thu, 7 Jan 2016 20:35:27 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07KZQS7034968; Thu, 7 Jan 2016 20:35:26 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07KZQm3034967; Thu, 7 Jan 2016 20:35:26 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601072035.u07KZQm3034967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 7 Jan 2016 20:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293354 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 20:35:27 -0000 Author: jimharris Date: Thu Jan 7 20:35:26 2016 New Revision: 293354 URL: https://svnweb.freebsd.org/changeset/base/293354 Log: nvme: replace NVME_CEILING macro with howmany() Suggested by: rpokala MFC after: 3 days Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 20:34:06 2016 (r293353) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jan 7 20:35:26 2016 (r293354) @@ -42,12 +42,6 @@ __FBSDID("$FreeBSD$"); #include "nvme_private.h" -/* - * Used for calculating number of CPUs to assign to each core and number of I/O - * queues to allocate per controller. - */ -#define NVME_CEILING(num, div) ((((num) - 1) / (div)) + 1) - static void nvme_ctrlr_construct_and_submit_aer(struct nvme_controller *ctrlr, struct nvme_async_event_request *aer); static void nvme_ctrlr_setup_interrupts(struct nvme_controller *ctrlr); @@ -152,7 +146,7 @@ nvme_ctrlr_construct_io_qpairs(struct nv * a controller could theoretically support fewer I/O queues than * MSI-X vectors. So calculate again here just to be safe. */ - ctrlr->num_cpus_per_ioq = NVME_CEILING(mp_ncpus, ctrlr->num_io_queues); + ctrlr->num_cpus_per_ioq = howmany(mp_ncpus, ctrlr->num_io_queues); ctrlr->ioq = malloc(ctrlr->num_io_queues * sizeof(struct nvme_qpair), M_NVME, M_ZERO | M_WAITOK); @@ -1029,9 +1023,9 @@ nvme_ctrlr_setup_interrupts(struct nvme_ * admin queue. */ ctrlr->num_cpus_per_ioq = max(min_cpus_per_ioq, - NVME_CEILING(mp_ncpus, num_vectors_available - 1)); + howmany(mp_ncpus, num_vectors_available - 1)); - ctrlr->num_io_queues = NVME_CEILING(mp_ncpus, ctrlr->num_cpus_per_ioq); + ctrlr->num_io_queues = howmany(mp_ncpus, ctrlr->num_cpus_per_ioq); num_vectors_requested = ctrlr->num_io_queues + 1; num_vectors_allocated = num_vectors_requested; From owner-svn-src-head@freebsd.org Thu Jan 7 20:37:19 2016 Return-Path: Delivered-To: svn-src-head@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 86F38A665D8; Thu, 7 Jan 2016 20:37:19 +0000 (UTC) (envelope-from garga@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 52A541DE5; Thu, 7 Jan 2016 20:37:19 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07KbI6T035184; Thu, 7 Jan 2016 20:37:18 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07KbIJU035183; Thu, 7 Jan 2016 20:37:18 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201601072037.u07KbIJU035183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Thu, 7 Jan 2016 20:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293357 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 20:37:19 -0000 Author: garga (ports committer) Date: Thu Jan 7 20:37:18 2016 New Revision: 293357 URL: https://svnweb.freebsd.org/changeset/base/293357 Log: Obsolete inetd related files when WITHOUT_INETD is set Reviewed by: bapt Approved by: gnn MFC after: 1 week Sponsored by: Rubiconn Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D4742 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jan 7 20:37:07 2016 (r293356) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jan 7 20:37:18 2016 (r293357) @@ -2834,6 +2834,13 @@ OLD_FILES+=usr/share/man/man8/traceroute OLD_FILES+=rescue/ping6 .endif +.if ${MK_INETD} == no +OLD_FILES+=etc/rc.d/inetd +OLD_FILES+=usr/sbin/inetd +OLD_FILES+=usr/share/man/man5/inetd.conf.5.gz +OLD_FILES+=usr/share/man/man8/inetd.8.gz +.endif + .if ${MK_IPFILTER} == no OLD_FILES+=etc/periodic/security/510.ipfdenied OLD_FILES+=etc/periodic/security/610.ipf6denied From owner-svn-src-head@freebsd.org Thu Jan 7 20:48:26 2016 Return-Path: Delivered-To: svn-src-head@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 3FFA0A669BD; Thu, 7 Jan 2016 20:48:26 +0000 (UTC) (envelope-from jilles@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 119341454; Thu, 7 Jan 2016 20:48:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07KmPL4038270; Thu, 7 Jan 2016 20:48:25 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07KmOqI038267; Thu, 7 Jan 2016 20:48:24 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601072048.u07KmOqI038267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 7 Jan 2016 20:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293359 - in head/bin/sh: . tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 20:48:26 -0000 Author: jilles Date: Thu Jan 7 20:48:24 2016 New Revision: 293359 URL: https://svnweb.freebsd.org/changeset/base/293359 Log: sh: Ensure OPTIND=1 in subshell without forking does not affect outer env. Command substitutions containing a single simple command and here-document expansion are performed in a subshell environment, but may not fork. Any modified state of the shell environment should be restored afterward. The state that OPTIND=1 had been done was not saved and restored here. Note that the other parts of shellparam need not be saved and restored, since they are not modified in these situations (a fork is done before such modifications). Added: head/bin/sh/tests/builtins/getopts10.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Thu Jan 7 20:43:45 2016 (r293358) +++ head/bin/sh/eval.c Thu Jan 7 20:48:24 2016 (r293359) @@ -496,10 +496,12 @@ exphere(union node *redir, struct arglis struct jmploc *savehandler; struct localvar *savelocalvars; int need_longjmp = 0; + unsigned char saveoptreset; redir->nhere.expdoc = ""; savelocalvars = localvars; localvars = NULL; + saveoptreset = shellparam.reset; forcelocal++; savehandler = handler; if (setjmp(jmploc.loc)) @@ -514,6 +516,7 @@ exphere(union node *redir, struct arglis forcelocal--; poplocalvars(); localvars = savelocalvars; + shellparam.reset = saveoptreset; if (need_longjmp) longjmp(handler->loc, 1); INTON; @@ -647,6 +650,7 @@ evalbackcmd(union node *n, struct backcm struct jmploc jmploc; struct jmploc *savehandler; struct localvar *savelocalvars; + unsigned char saveoptreset; result->fd = -1; result->buf = NULL; @@ -661,6 +665,7 @@ evalbackcmd(union node *n, struct backcm if (is_valid_fast_cmdsubst(n)) { savelocalvars = localvars; localvars = NULL; + saveoptreset = shellparam.reset; forcelocal++; savehandler = handler; if (setjmp(jmploc.loc)) { @@ -671,6 +676,7 @@ evalbackcmd(union node *n, struct backcm forcelocal--; poplocalvars(); localvars = savelocalvars; + shellparam.reset = saveoptreset; longjmp(handler->loc, 1); } } else { @@ -681,6 +687,7 @@ evalbackcmd(union node *n, struct backcm forcelocal--; poplocalvars(); localvars = savelocalvars; + shellparam.reset = saveoptreset; } else { if (pipe(pip) < 0) error("Pipe call failed: %s", strerror(errno)); Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Thu Jan 7 20:43:45 2016 (r293358) +++ head/bin/sh/tests/builtins/Makefile Thu Jan 7 20:48:24 2016 (r293359) @@ -95,6 +95,7 @@ FILES+= getopts6.0 FILES+= getopts7.0 FILES+= getopts8.0 getopts8.0.stdout FILES+= getopts9.0 getopts9.0.stdout +FILES+= getopts10.0 FILES+= hash1.0 hash1.0.stdout FILES+= hash2.0 hash2.0.stdout FILES+= hash3.0 hash3.0.stdout Added: head/bin/sh/tests/builtins/getopts10.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/getopts10.0 Thu Jan 7 20:48:24 2016 (r293359) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +set -- -x arg +opt=not +getopts x opt +r1=$? OPTIND1=$OPTIND opt1=$opt +: $(: $((OPTIND = 1))) +getopts x opt +r2=$? OPTIND2=$OPTIND +[ "$r1" = 0 ] && [ "$OPTIND1" = 2 ] && [ "$opt1" = x ] && [ "$r2" != 0 ] && + [ "$OPTIND2" = 2 ] From owner-svn-src-head@freebsd.org Thu Jan 7 20:52:37 2016 Return-Path: Delivered-To: svn-src-head@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 4F218A66CB0; Thu, 7 Jan 2016 20:52:37 +0000 (UTC) (envelope-from bdrewery@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 1AAED1B93; Thu, 7 Jan 2016 20:52:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07Kqatc041282; Thu, 7 Jan 2016 20:52:36 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07KqaCi041281; Thu, 7 Jan 2016 20:52:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601072052.u07KqaCi041281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 Jan 2016 20:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293361 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 20:52:37 -0000 Author: bdrewery Date: Thu Jan 7 20:52:35 2016 New Revision: 293361 URL: https://svnweb.freebsd.org/changeset/base/293361 Log: Allow libnv to be built externally using GCC. GCC does not define _VA_LIST_DECLARED. It defines _VA_LIST_ and others. This was causing the prototype to not be defined and leading to an error later due to using nvlist_add_stringv(3) without a prototype in nvlist_add_stringf(3). This uses the same check as other va_list prototypes in the original change in r279438. Modified: head/sys/sys/nv.h Modified: head/sys/sys/nv.h ============================================================================== --- head/sys/sys/nv.h Thu Jan 7 20:50:03 2016 (r293360) +++ head/sys/sys/nv.h Thu Jan 7 20:52:35 2016 (r293361) @@ -146,7 +146,7 @@ void nvlist_add_bool(nvlist_t *nvl, cons void nvlist_add_number(nvlist_t *nvl, const char *name, uint64_t value); void nvlist_add_string(nvlist_t *nvl, const char *name, const char *value); void nvlist_add_stringf(nvlist_t *nvl, const char *name, const char *valuefmt, ...) __printflike(3, 4); -#ifdef _VA_LIST_DECLARED +#if !defined(_KERNEL) || defined(_VA_LIST_DECLARED) void nvlist_add_stringv(nvlist_t *nvl, const char *name, const char *valuefmt, va_list valueap) __printflike(3, 0); #endif void nvlist_add_nvlist(nvlist_t *nvl, const char *name, const nvlist_t *value); From owner-svn-src-head@freebsd.org Thu Jan 7 21:16:45 2016 Return-Path: Delivered-To: svn-src-head@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 D66BCA674BF; Thu, 7 Jan 2016 21:16:45 +0000 (UTC) (envelope-from jimharris@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 A5D9D109F; Thu, 7 Jan 2016 21:16:45 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07LGiao048248; Thu, 7 Jan 2016 21:16:44 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07LGi6j048247; Thu, 7 Jan 2016 21:16:44 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601072116.u07LGi6j048247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 7 Jan 2016 21:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293369 - head/sys/dev/ismt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 21:16:45 -0000 Author: jimharris Date: Thu Jan 7 21:16:44 2016 New Revision: 293369 URL: https://svnweb.freebsd.org/changeset/base/293369 Log: ismt: fix ISMT_DESC_ADDR_RW macro Submitted by: Masanobu SAITOH MFC after: 3 days Modified: head/sys/dev/ismt/ismt.c Modified: head/sys/dev/ismt/ismt.c ============================================================================== --- head/sys/dev/ismt/ismt.c Thu Jan 7 21:02:29 2016 (r293368) +++ head/sys/dev/ismt/ismt.c Thu Jan 7 21:16:44 2016 (r293369) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #define ISMT_DESC_LPR 0x80 /* Large Packet Received */ /* Macros */ -#define ISMT_DESC_ADDR_RW(addr, is_read) ((addr) | (is_read)) +#define ISMT_DESC_ADDR_RW(addr, is_read) ((addr << 1) | (is_read)) /* iSMT General Register address offsets (SMBBAR + ) */ #define ISMT_GR_GCTRL 0x000 /* General Control */ From owner-svn-src-head@freebsd.org Thu Jan 7 21:43:44 2016 Return-Path: Delivered-To: svn-src-head@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 980BAA67E52; Thu, 7 Jan 2016 21:43:44 +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 65E991788; Thu, 7 Jan 2016 21:43:44 +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 u07Lhh7V057998; Thu, 7 Jan 2016 21:43:43 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07LhhVo057997; Thu, 7 Jan 2016 21:43:43 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601072143.u07LhhVo057997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 7 Jan 2016 21:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293370 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 21:43:44 -0000 Author: pfg Date: Thu Jan 7 21:43:43 2016 New Revision: 293370 URL: https://svnweb.freebsd.org/changeset/base/293370 Log: ext2fs: reading mmaped file in Ext4 causes panic Always call brelse(path.ep_bp), fixing reading EXT4 files using mmap(). Patch by Damjan Jovanovic. PR: 205938 MFC after: 1 week Modified: head/sys/fs/ext2fs/ext2_bmap.c Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Thu Jan 7 21:16:44 2016 (r293369) +++ head/sys/fs/ext2fs/ext2_bmap.c Thu Jan 7 21:43:43 2016 (r293370) @@ -96,6 +96,7 @@ ext4_bmapext(struct vnode *vp, int32_t b struct ext4_extent *ep; struct ext4_extent_path path = { .ep_bp = NULL }; daddr_t lbn; + int ret = 0; ip = VTOI(vp); fs = ip->i_e2fs; @@ -113,15 +114,21 @@ ext4_bmapext(struct vnode *vp, int32_t b ext4_ext_find_extent(fs, ip, lbn, &path); ep = path.ep_ext; if (ep == NULL) - return (EIO); + ret = EIO; + else { + *bnp = fsbtodb(fs, lbn - ep->e_blk + + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); - *bnp = fsbtodb(fs, lbn - ep->e_blk + - (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); + if (*bnp == 0) + *bnp = -1; + } - if (*bnp == 0) - *bnp = -1; + if (path.ep_bp != NULL) { + brelse(path.ep_bp); + path.ep_bp = NULL; + } - return (0); + return (ret); } /* From owner-svn-src-head@freebsd.org Thu Jan 7 21:46:09 2016 Return-Path: Delivered-To: svn-src-head@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 74959A67F85; Thu, 7 Jan 2016 21:46:09 +0000 (UTC) (envelope-from jilles@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 40B3D1A0E; Thu, 7 Jan 2016 21:46:09 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07Lk8dO058257; Thu, 7 Jan 2016 21:46:08 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07Lk85x058253; Thu, 7 Jan 2016 21:46:08 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601072146.u07Lk85x058253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 7 Jan 2016 21:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293371 - head/bin/sh/tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 21:46:09 -0000 Author: jilles Date: Thu Jan 7 21:46:07 2016 New Revision: 293371 URL: https://svnweb.freebsd.org/changeset/base/293371 Log: sh: Add a test for 'cd -'. Redirect 'cd -' output to /dev/null since POSIX requires it to write the new directory name even if not interactive, but we currently only write it if interactive. Added: head/bin/sh/tests/builtins/cd9.0 (contents, props changed) head/bin/sh/tests/builtins/cd9.0.stdout (contents, props changed) Modified: head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Thu Jan 7 21:43:43 2016 (r293370) +++ head/bin/sh/tests/builtins/Makefile Thu Jan 7 21:46:07 2016 (r293371) @@ -48,6 +48,7 @@ FILES+= cd5.0 FILES+= cd6.0 FILES+= cd7.0 FILES+= cd8.0 +FILES+= cd9.0 cd9.0.stdout FILES+= command1.0 FILES+= command2.0 FILES+= command3.0 Added: head/bin/sh/tests/builtins/cd9.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/cd9.0 Thu Jan 7 21:46:07 2016 (r293371) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +cd /dev +cd /bin +cd - >/dev/null +pwd +cd - >/dev/null +pwd Added: head/bin/sh/tests/builtins/cd9.0.stdout ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/cd9.0.stdout Thu Jan 7 21:46:07 2016 (r293371) @@ -0,0 +1,2 @@ +/dev +/bin From owner-svn-src-head@freebsd.org Thu Jan 7 22:13:18 2016 Return-Path: Delivered-To: svn-src-head@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 6A8B5A66BDF; Thu, 7 Jan 2016 22:13:18 +0000 (UTC) (envelope-from dteske@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 3D33D19AC; Thu, 7 Jan 2016 22:13:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07MDHfG069007; Thu, 7 Jan 2016 22:13:17 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07MDH69069006; Thu, 7 Jan 2016 22:13:17 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601072213.u07MDH69069006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 7 Jan 2016 22:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293379 - head/lib/libdpv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 22:13:18 -0000 Author: dteske Date: Thu Jan 7 22:13:17 2016 New Revision: 293379 URL: https://svnweb.freebsd.org/changeset/base/293379 Log: Bump copyright (forgotten part of r293340) MFC after: 3 days X-MFC-to: stable/10 X-MFC-with: r293340 Modified: head/lib/libdpv/util.h Modified: head/lib/libdpv/util.h ============================================================================== --- head/lib/libdpv/util.h Thu Jan 7 22:13:16 2016 (r293378) +++ head/lib/libdpv/util.h Thu Jan 7 22:13:17 2016 (r293379) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2016 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@freebsd.org Thu Jan 7 23:02:17 2016 Return-Path: Delivered-To: svn-src-head@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 487F7A6626C; Thu, 7 Jan 2016 23:02:17 +0000 (UTC) (envelope-from cem@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 1F34D1648; Thu, 7 Jan 2016 23:02:17 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07N2G4n085495; Thu, 7 Jan 2016 23:02:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07N2FsR085492; Thu, 7 Jan 2016 23:02:15 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201601072302.u07N2FsR085492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 7 Jan 2016 23:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293390 - in head: share/man/man4 sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 23:02:17 -0000 Author: cem Date: Thu Jan 7 23:02:15 2016 New Revision: 293390 URL: https://svnweb.freebsd.org/changeset/base/293390 Log: ioat(4): Add ioat_acquire_reserve() KPI ioat_acquire_reserve() is an extended version of ioat_acquire(). It allows users to reserve space in the channel for some number of descriptors. If this succeeds, it guarantees that at least submission of N valid descriptors will succeed. Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/ioat.4 head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat.h Modified: head/share/man/man4/ioat.4 ============================================================================== --- head/share/man/man4/ioat.4 Thu Jan 7 22:59:09 2016 (r293389) +++ head/share/man/man4/ioat.4 Thu Jan 7 23:02:15 2016 (r293390) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 5, 2016 +.Dd January 7, 2016 .Dt IOAT 4 .Os .Sh NAME @@ -73,6 +73,8 @@ In .Fn ioat_get_max_coalesce_period "bus_dmaengine_t dmaengine" .Ft void .Fn ioat_acquire "bus_dmaengine_t dmaengine" +.Ft int +.Fn ioat_acquire_reserve "bus_dmaengine_t dmaengine" "uint32_t n" "int mflags" .Ft void .Fn ioat_release "bus_dmaengine_t dmaengine" .Ft struct bus_dmadesc * @@ -178,6 +180,14 @@ When the user wants to offload a copy, t the .Ar bus_dmaengine_t object for exclusive access to enqueue operations on that channel. +Optionally, the user can reserve space by using +.Fn ioat_acquire_reserve +instead. +If +.Fn ioat_acquire_reserve +succeeds, there is guaranteed to be room for +.Fa N +new operations in the internal ring buffer. Then, they will submit one or more operations using .Fn ioat_blockfill , .Fn ioat_copy , Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Thu Jan 7 22:59:09 2016 (r293389) +++ head/sys/dev/ioat/ioat.c Thu Jan 7 23:02:15 2016 (r293390) @@ -789,6 +789,21 @@ ioat_acquire(bus_dmaengine_t dmaengine) CTR0(KTR_IOAT, __func__); } +int +ioat_acquire_reserve(bus_dmaengine_t dmaengine, unsigned n, int mflags) +{ + struct ioat_softc *ioat; + int error; + + ioat = to_ioat_softc(dmaengine); + ioat_acquire(dmaengine); + + error = ioat_reserve_space(ioat, n, mflags); + if (error != 0) + ioat_release(dmaengine); + return (error); +} + void ioat_release(bus_dmaengine_t dmaengine) { Modified: head/sys/dev/ioat/ioat.h ============================================================================== --- head/sys/dev/ioat/ioat.h Thu Jan 7 22:59:09 2016 (r293389) +++ head/sys/dev/ioat/ioat.h Thu Jan 7 23:02:15 2016 (r293390) @@ -96,13 +96,26 @@ uint16_t ioat_get_max_coalesce_period(bu /* * Acquire must be called before issuing an operation to perform. Release is - * called after. Multiple operations can be issued within the context of one + * called after. Multiple operations can be issued within the context of one * acquire and release */ void ioat_acquire(bus_dmaengine_t dmaengine); void ioat_release(bus_dmaengine_t dmaengine); /* + * Acquire_reserve can be called to ensure there is room for N descriptors. If + * it succeeds, the next N valid operations will successfully enqueue. + * + * It may fail with: + * - ENXIO if the channel is in an errored state, or the driver is being + * unloaded + * - EAGAIN if mflags included M_NOWAIT + * + * On failure, the caller does not hold the dmaengine. + */ +int ioat_acquire_reserve(bus_dmaengine_t dmaengine, unsigned n, int mflags); + +/* * Issue a blockfill operation. The 64-bit pattern 'fillpattern' is written to * 'len' physically contiguous bytes at 'dst'. * From owner-svn-src-head@freebsd.org Thu Jan 7 23:13:22 2016 Return-Path: Delivered-To: svn-src-head@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 80560A66612; Thu, 7 Jan 2016 23:13:22 +0000 (UTC) (envelope-from jilles@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 52A161E00; Thu, 7 Jan 2016 23:13:22 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07NDLiD088559; Thu, 7 Jan 2016 23:13:21 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07NDLNH088555; Thu, 7 Jan 2016 23:13:21 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601072313.u07NDLNH088555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 7 Jan 2016 23:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293392 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 23:13:22 -0000 Author: jilles Date: Thu Jan 7 23:13:20 2016 New Revision: 293392 URL: https://svnweb.freebsd.org/changeset/base/293392 Log: sh: Reduce size of options table. Modified: head/bin/sh/expand.c head/bin/sh/options.c head/bin/sh/options.h head/bin/sh/var.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Thu Jan 7 23:10:44 2016 (r293391) +++ head/bin/sh/expand.c Thu Jan 7 23:13:20 2016 (r293392) @@ -951,8 +951,8 @@ varvalue(const char *name, int quoted, i case '-': p = buf; for (i = 0 ; i < NSHORTOPTS ; i++) { - if (optlist[i].val) - *p++ = optlist[i].letter; + if (optval[i]) + *p++ = optletter[i]; } *p = '\0'; strtodest(buf, flag, subtype, quoted, dst); Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Thu Jan 7 23:10:44 2016 (r293391) +++ head/bin/sh/options.c Thu Jan 7 23:13:20 2016 (r293392) @@ -91,7 +91,7 @@ procargs(int argc, char **argv) if (argc > 0) argptr++; for (i = 0; i < NOPTS; i++) - optlist[i].val = 2; + optval[i] = 2; privileged = (getuid() != geteuid() || getgid() != getegid()); options(1); if (*argptr == NULL && minusc == NULL) @@ -104,8 +104,8 @@ procargs(int argc, char **argv) if (mflag == 2) mflag = iflag; for (i = 0; i < NOPTS; i++) - if (optlist[i].val == 2) - optlist[i].val = 0; + if (optval[i] == 2) + optval[i] = 0; arg0 = argv[0]; if (sflag == 0 && minusc == NULL) { scriptname = *argptr++; @@ -250,26 +250,29 @@ static void minus_o(char *name, int val) { int i; + const unsigned char *on; + size_t len; if (name == NULL) { if (val) { /* "Pretty" output. */ out1str("Current option settings\n"); - for (i = 0; i < NOPTS; i++) - out1fmt("%-16s%s\n", optlist[i].name, - optlist[i].val ? "on" : "off"); + for (i = 0, on = optname; i < NOPTS; i++, on += *on + 1) + out1fmt("%-16.*s%s\n", *on, on + 1, + optval[i] ? "on" : "off"); } else { /* Output suitable for re-input to shell. */ - for (i = 0; i < NOPTS; i++) - out1fmt("%s %co %s%s", + for (i = 0, on = optname; i < NOPTS; i++, on += *on + 1) + out1fmt("%s %co %.*s%s", i % 6 == 0 ? "set" : "", - optlist[i].val ? '-' : '+', - optlist[i].name, + optval[i] ? '-' : '+', + *on, on + 1, i % 6 == 5 || i == NOPTS - 1 ? "\n" : ""); } } else { - for (i = 0; i < NOPTS; i++) - if (equal(name, optlist[i].name)) { + len = strlen(name); + for (i = 0, on = optname; i < NOPTS; i++, on += *on + 1) + if (*on == len && memcmp(on + 1, name, len) == 0) { setoptionbyindex(i, val); return; } @@ -281,18 +284,18 @@ minus_o(char *name, int val) static void setoptionbyindex(int idx, int val) { - if (optlist[idx].letter == 'p' && !val && privileged) { + if (optletter[idx] == 'p' && !val && privileged) { if (setgid(getgid()) == -1) error("setgid"); if (setuid(getuid()) == -1) error("setuid"); } - optlist[idx].val = val; + optval[idx] = val; if (val) { /* #%$ hack for ksh semantics */ - if (optlist[idx].letter == 'V') + if (optletter[idx] == 'V') Eflag = 0; - else if (optlist[idx].letter == 'E') + else if (optletter[idx] == 'E') Vflag = 0; } } @@ -303,7 +306,7 @@ setoption(int flag, int val) int i; for (i = 0; i < NSHORTOPTS; i++) - if (optlist[i].letter == flag) { + if (optletter[i] == flag) { setoptionbyindex(i, val); return; } Modified: head/bin/sh/options.h ============================================================================== --- head/bin/sh/options.h Thu Jan 7 23:10:44 2016 (r293391) +++ head/bin/sh/options.h Thu Jan 7 23:13:20 2016 (r293392) @@ -45,60 +45,57 @@ struct shparam { -#define eflag optlist[0].val -#define fflag optlist[1].val -#define Iflag optlist[2].val -#define iflag optlist[3].val -#define mflag optlist[4].val -#define nflag optlist[5].val -#define sflag optlist[6].val -#define xflag optlist[7].val -#define vflag optlist[8].val -#define Vflag optlist[9].val -#define Eflag optlist[10].val -#define Cflag optlist[11].val -#define aflag optlist[12].val -#define bflag optlist[13].val -#define uflag optlist[14].val -#define privileged optlist[15].val -#define Tflag optlist[16].val -#define Pflag optlist[17].val -#define hflag optlist[18].val -#define nologflag optlist[19].val +#define eflag optval[0] +#define fflag optval[1] +#define Iflag optval[2] +#define iflag optval[3] +#define mflag optval[4] +#define nflag optval[5] +#define sflag optval[6] +#define xflag optval[7] +#define vflag optval[8] +#define Vflag optval[9] +#define Eflag optval[10] +#define Cflag optval[11] +#define aflag optval[12] +#define bflag optval[13] +#define uflag optval[14] +#define privileged optval[15] +#define Tflag optval[16] +#define Pflag optval[17] +#define hflag optval[18] +#define nologflag optval[19] #define NSHORTOPTS 19 #define NOPTS 20 -struct optent { - const char *name; - const char letter; - char val; -}; - -extern struct optent optlist[NOPTS]; +extern char optval[NOPTS]; +extern const char optletter[NSHORTOPTS]; #ifdef DEFINE_OPTIONS -struct optent optlist[NOPTS] = { - { "errexit", 'e', 0 }, - { "noglob", 'f', 0 }, - { "ignoreeof", 'I', 0 }, - { "interactive",'i', 0 }, - { "monitor", 'm', 0 }, - { "noexec", 'n', 0 }, - { "stdin", 's', 0 }, - { "xtrace", 'x', 0 }, - { "verbose", 'v', 0 }, - { "vi", 'V', 0 }, - { "emacs", 'E', 0 }, - { "noclobber", 'C', 0 }, - { "allexport", 'a', 0 }, - { "notify", 'b', 0 }, - { "nounset", 'u', 0 }, - { "privileged", 'p', 0 }, - { "trapsasync", 'T', 0 }, - { "physical", 'P', 0 }, - { "trackall", 'h', 0 }, - { "nolog", '\0', 0 }, -}; +char optval[NOPTS]; +const char optletter[NSHORTOPTS] = "efIimnsxvVECabupTPh"; +static const unsigned char optname[] = + "\007errexit" + "\006noglob" + "\011ignoreeof" + "\013interactive" + "\007monitor" + "\006noexec" + "\005stdin" + "\006xtrace" + "\007verbose" + "\002vi" + "\005emacs" + "\011noclobber" + "\011allexport" + "\006notify" + "\007nounset" + "\012privileged" + "\012trapsasync" + "\010physical" + "\010trackall" + "\005nolog" +; #endif Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Thu Jan 7 23:10:44 2016 (r293391) +++ head/bin/sh/var.c Thu Jan 7 23:13:20 2016 (r293392) @@ -754,8 +754,8 @@ mklocal(char *name) INTOFF; lvp = ckmalloc(sizeof (struct localvar)); if (name[0] == '-' && name[1] == '\0') { - lvp->text = ckmalloc(sizeof optlist); - memcpy(lvp->text, optlist, sizeof optlist); + lvp->text = ckmalloc(sizeof optval); + memcpy(lvp->text, optval, sizeof optval); vp = NULL; } else { vp = find_var(name, &vpp, NULL); @@ -797,7 +797,7 @@ poplocalvars(void) localvars = lvp->next; vp = lvp->vp; if (vp == NULL) { /* $- saved */ - memcpy(optlist, lvp->text, sizeof optlist); + memcpy(optval, lvp->text, sizeof optval); ckfree(lvp->text); optschanged(); } else if ((lvp->flags & (VUNSET|VSTRFIXED)) == VUNSET) { From owner-svn-src-head@freebsd.org Fri Jan 8 00:05:29 2016 Return-Path: Delivered-To: svn-src-head@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 53BD8A67B74; Fri, 8 Jan 2016 00:05:29 +0000 (UTC) (envelope-from imp@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 272631EA0; Fri, 8 Jan 2016 00:05:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0805Sha003711; Fri, 8 Jan 2016 00:05:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0805Siw003710; Fri, 8 Jan 2016 00:05:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601080005.u0805Siw003710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 8 Jan 2016 00:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293398 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 00:05:29 -0000 Author: imp Date: Fri Jan 8 00:05:28 2016 New Revision: 293398 URL: https://svnweb.freebsd.org/changeset/base/293398 Log: Setup /pkg as a spot for pkg to operate. This is for testing purposes only. You need to remount / rw and export TMPDIR=/pkg/tmp. pkg will then work. It's slow though: 15 minutes to pkg install git on an RPi 2 with a decently fast SD card. Since this is for testing, we set DEFAULT_ALWAYS_YES and ASSUME_ALWAYS_YES to YES. Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Fri Jan 8 00:05:20 2016 (r293397) +++ head/tools/tools/nanobsd/embedded/common Fri Jan 8 00:05:28 2016 (r293398) @@ -449,6 +449,28 @@ typical_embedded ( ) ( ) customize_cmd typical_embedded +fix_pkg ( ) ( + chdir ${NANO_WORLDDIR} + mkdir -p pkg + mkdir -p pkg/db + mkdir -p pkg/cache + mkdir -p pkg/tmp # Needed for pkg bootstrap + mkdir -p usr/local/etc # Will get moved to local/etc + ( + echo 'PKG_DBDIR = "/pkg/db"' + echo 'PKG_CACHEDIR = "/pkg/cache"' + echo 'DEFAULT_ALWAYS_YES = "yes"' + echo 'ASSUME_ALWAYS_YES = "yes"' + ) >> usr/local/etc/pkg.conf + [ -z ${NANO_NOPRIV_BUILD} ] || ( + echo "./pkg type=dir uname=root gname=wheel mode=0755" + echo "./pkg/cache type=dir uname=root gname=wheel mode=0755" + echo "./pkg/db type=dir uname=root gname=wheel mode=0755" + echo "./pkg/tmp type=dir uname=root gname=wheel mode=0755" + ) >> ${NANO_METALOG} +) +customize_cmd fix_pkg + save_build ( ) ( VERSION_FILE=${NANO_WORLDDIR}/etc/version if [ "${SVNREVISION}" = "${REVISION}" ]; then From owner-svn-src-head@freebsd.org Fri Jan 8 00:05:48 2016 Return-Path: Delivered-To: svn-src-head@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 41F70A67BCA; Fri, 8 Jan 2016 00:05:48 +0000 (UTC) (envelope-from imp@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 165D7101A; Fri, 8 Jan 2016 00:05:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0805l0e003761; Fri, 8 Jan 2016 00:05:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0805lJG003760; Fri, 8 Jan 2016 00:05:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601080005.u0805lJG003760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 8 Jan 2016 00:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293399 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 00:05:48 -0000 Author: imp Date: Fri Jan 8 00:05:47 2016 New Revision: 293399 URL: https://svnweb.freebsd.org/changeset/base/293399 Log: Make sure that the /set directive gets put at the top of the file, instead of in sort order. Slash sorts after period. Modified: head/tools/tools/nanobsd/defaults.sh (contents, props changed) Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Fri Jan 8 00:05:28 2016 (r293398) +++ head/tools/tools/nanobsd/defaults.sh Fri Jan 8 00:05:47 2016 (r293399) @@ -500,10 +500,9 @@ fixup_before_diskimage ( ) ( if [ -n "${NANO_METALOG}" ]; then pprint 2 "Fixing metalog" cp ${NANO_METALOG} ${NANO_METALOG}.pre - (echo "/set uname=${NANO_DEF_UNAME} gname=${NANO_DEF_GNAME}" && - cat ${NANO_METALOG}.pre) | \ - ${NANO_TOOLS}/mtree-dedup.awk | \ - sed -e 's/ size=[0-9][0-9]*//' | sort > ${NANO_METALOG} + echo "/set uname=${NANO_DEF_UNAME} gname=${NANO_DEF_GNAME}" > ${NANO_METALOG} + cat ${NANO_METALOG}.pre | ${NANO_TOOLS}/mtree-dedup.awk | \ + sed -e 's/ size=[0-9][0-9]*//' | sort >> ${NANO_METALOG} fi ) From owner-svn-src-head@freebsd.org Fri Jan 8 00:56:43 2016 Return-Path: Delivered-To: svn-src-head@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 52406A66193; Fri, 8 Jan 2016 00:56:43 +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 0776E10D4; Fri, 8 Jan 2016 00:56:42 +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 u080ugD3019386; Fri, 8 Jan 2016 00:56:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u080ugYK019384; Fri, 8 Jan 2016 00:56:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601080056.u080ugYK019384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 8 Jan 2016 00:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293403 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 00:56:43 -0000 Author: emaste Date: Fri Jan 8 00:56:41 2016 New Revision: 293403 URL: https://svnweb.freebsd.org/changeset/base/293403 Log: Revert r293201, r293202 (rtld: populate DT_DEBUG iff DYNAMIC segment is writable) It turns out MIPS binaries may have other oddities that can trigger a fault at startup. PR: 206017 Reported by: ray Modified: head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Jan 8 00:46:28 2016 (r293402) +++ head/libexec/rtld-elf/rtld.c Fri Jan 8 00:56:41 2016 (r293403) @@ -1144,13 +1144,13 @@ digest_dynamic1(Obj_Entry *obj, int earl * is mapped read-only. DT_MIPS_RLD_MAP is used instead. */ +#ifndef __mips__ case DT_DEBUG: - if (!obj->writable_dynamic) - break; if (!early) dbg("Filling in DT_DEBUG entry"); ((Elf_Dyn*)dynp)->d_un.d_ptr = (Elf_Addr) &r_debug; break; +#endif case DT_FLAGS: if (dynp->d_un.d_val & DF_ORIGIN) @@ -1331,8 +1331,6 @@ digest_phdr(const Elf_Phdr *phdr, int ph break; case PT_DYNAMIC: - if (ph->p_flags & PROT_WRITE) - obj->writable_dynamic = true; obj->dynamic = (const Elf_Dyn *)(ph->p_vaddr + obj->relocbase); break; Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Fri Jan 8 00:46:28 2016 (r293402) +++ head/libexec/rtld-elf/rtld.h Fri Jan 8 00:56:41 2016 (r293403) @@ -264,7 +264,6 @@ typedef struct Struct_Obj_Entry { bool valid_hash_sysv : 1; /* A valid System V hash hash tag is available */ bool valid_hash_gnu : 1; /* A valid GNU hash tag is available */ bool dlopened : 1; /* dlopen()-ed (vs. load statically) */ - bool writable_dynamic : 1; /* PT_DYNAMIC is writable */ struct link_map linkmap; /* For GDB and dlinfo() */ Objlist dldags; /* Object belongs to these dlopened DAGs (%) */ From owner-svn-src-head@freebsd.org Fri Jan 8 01:16:05 2016 Return-Path: Delivered-To: svn-src-head@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 384CBA669A7; Fri, 8 Jan 2016 01:16:05 +0000 (UTC) (envelope-from glebius@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 086651E3C; Fri, 8 Jan 2016 01:16:04 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u081G4cR025387; Fri, 8 Jan 2016 01:16:04 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u081G4Uj025386; Fri, 8 Jan 2016 01:16:04 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601080116.u081G4Uj025386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 8 Jan 2016 01:16:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293405 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 01:16:05 -0000 Author: glebius Date: Fri Jan 8 01:16:03 2016 New Revision: 293405 URL: https://svnweb.freebsd.org/changeset/base/293405 Log: For SOCK_STREAM socket use sbappendstream() instead of sbappend(). Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Jan 8 01:12:27 2016 (r293404) +++ head/sys/kern/uipc_usrreq.c Fri Jan 8 01:16:03 2016 (r293405) @@ -981,7 +981,7 @@ uipc_send(struct socket *so, int flags, control)) control = NULL; } else - sbappend_locked(&so2->so_rcv, m); + sbappendstream_locked(&so2->so_rcv, m, flags); break; case SOCK_SEQPACKET: { From owner-svn-src-head@freebsd.org Fri Jan 8 02:29:24 2016 Return-Path: Delivered-To: svn-src-head@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 E6461A67EB5; Fri, 8 Jan 2016 02:29:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id B256314C0; Fri, 8 Jan 2016 02:29:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 183931047079; Fri, 8 Jan 2016 13:29:12 +1100 (AEDT) Date: Fri, 8 Jan 2016 13:29:11 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293349 - head/sys/kern In-Reply-To: <201601072015.u07KF923028920@repo.freebsd.org> Message-ID: <20160108122739.Q1067@besplex.bde.org> References: <201601072015.u07KF923028920@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=RFhqBy9yd6zAWdrPR_wA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 02:29:24 -0000 On Thu, 7 Jan 2016, Konstantin Belousov wrote: > Log: > Convert tty common code to use make_dev_s(). > > Tty.c was untypical in that it handled the si_drv1 issue consistently > and correctly, by always checking for si_drv1 being non-NULL and > sleeping if NULL. The removed code also illustrated unneeded > complications in drivers which are eliminated by the use of new KPI. Actually, the handling was consistently incorrect. In the case where si_drv1 is actually NULL, it usually returned EWOULDBLOCK instead of 0 for successful opens. This is a rare case and I haven't seen it so I'm not sure how to recover from it. revoke() of the device should work. Even open() followed by a "last" close() would probably work. > Reviewed by: hps, jhb > Discussed with: bde There seem to further old and unfixed problems. Sorry I didn't look at your patch very closely. I will reply privately the complicated details of this. > Modified: head/sys/kern/tty.c > ============================================================================== > --- head/sys/kern/tty.c Thu Jan 7 20:15:05 2016 (r293348) > +++ head/sys/kern/tty.c Thu Jan 7 20:15:09 2016 (r293349) > @@ -237,14 +237,10 @@ static int > ttydev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) > { > struct tty *tp; > - int error = 0; This code used to be just 2 style bugs: - initialization in declaration - use of the initialization much later. It is to get the variable initialized for code starting about 50 lines later, in case that code falls through an if ladder to th return another 40 lines later. > - > - while ((tp = dev->si_drv1) == NULL) { > - error = tsleep(&dev->si_drv1, PCATCH, "ttdrv1", 1); > - if (error != EWOULDBLOCK) > - return (error); > - } The initialization became not just a style bug when the si_drv1 handling corrupted it. Urk, the handling was almost completely incorrect: - the timeout shouldn't be needed. There is a wakeup when si_drv1 is initialized. - if the wakeup actually works, then its handling is very broken. Then tsleep() returns 0. This is treated as an error, and the function returns 0, which means success, but the devie has not been opened. - PCATCH shouldn't be needed either, but is not harmful like the buggy check for the unnecessary timeout. > + int error; > > + tp = dev->si_drv1; > + error = 0; The initialization is now correct and only 40 lines before it is needed. > tty_lock(tp); > if (tty_gone(tp)) { > /* Device is already gone. */ In my version, 'error' is initialized by more complicated checks on entry that naturally set it to 0 when they succeed. After returning when error != 0 early, it would be unnatural to set it to 0 again later. > @@ -1221,71 +1215,72 @@ tty_makedevf(struct tty *tp, struct ucre > flags |= MAKEDEV_CHECKNAME; > > /* Master call-in device. */ > - error = make_dev_p(flags, &dev, &ttydev_cdevsw, cred, uid, gid, mode, > - "%s%s", prefix, name); > - if (error) > + make_dev_args_init(&args); > + args.mda_flags = flags; > + args.mda_devsw = &ttydev_cdevsw; > + args.mda_cr = cred; > + args.mda_uid = uid; > + args.mda_gid = gid; > + args.mda_mode = mode; > + args.mda_si_drv1 = tp; > + error = make_dev_s(&args, &dev, "%s%s", prefix, name); > + if (error != 0) > return (error); > - dev->si_drv1 = tp; > - wakeup(&dev->si_drv1); Wakeups like this should have made the timeout unnecessary. However, it would be better to not have them. This wakeup seems to give an instant race, while the timeout will often be delayed long enough for the initialization to complete. > tp->t_dev = dev; The new version presumably fixes the initialiation order for dev->si_drv1, but it doesn't change this. This is delicate. The details are too large for this reply. Bruce From owner-svn-src-head@freebsd.org Fri Jan 8 05:09:57 2016 Return-Path: Delivered-To: svn-src-head@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 76F9AA66D10; Fri, 8 Jan 2016 05:09:57 +0000 (UTC) (envelope-from allanjude@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 326221527; Fri, 8 Jan 2016 05:09:57 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0859uUv096970; Fri, 8 Jan 2016 05:09:56 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0859uSh096968; Fri, 8 Jan 2016 05:09:56 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201601080509.u0859uSh096968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 8 Jan 2016 05:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293414 - in head/sys/boot: i386/loader userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 05:09:57 -0000 Author: allanjude Date: Fri Jan 8 05:09:55 2016 New Revision: 293414 URL: https://svnweb.freebsd.org/changeset/base/293414 Log: Add support for ZFS Boot Environments to userboot (for bhyve and others) While here, also fix a possible null pointer Reported by: lattera MFC after: 3 days Sponsored by: ScaleEngine Inc. Modified: head/sys/boot/i386/loader/main.c head/sys/boot/userboot/userboot/main.c Modified: head/sys/boot/i386/loader/main.c ============================================================================== --- head/sys/boot/i386/loader/main.c Fri Jan 8 03:45:28 2016 (r293413) +++ head/sys/boot/i386/loader/main.c Fri Jan 8 05:09:55 2016 (r293414) @@ -321,7 +321,8 @@ init_zfs_bootenv(char *currdev) currdev++; /* Remove the last element (current bootenv) */ beroot = strrchr(currdev, '/'); - beroot[0] = '\0'; + if (beroot != NULL) + beroot[0] = '\0'; beroot = currdev; Modified: head/sys/boot/userboot/userboot/main.c ============================================================================== --- head/sys/boot/userboot/userboot/main.c Fri Jan 8 03:45:28 2016 (r293413) +++ head/sys/boot/userboot/userboot/main.c Fri Jan 8 05:09:55 2016 (r293414) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); static void userboot_zfs_probe(void); static int userboot_zfs_found; +static void init_zfs_bootenv(char *currdev); #endif #define USERBOOT_VERSION USERBOOT_VERSION_3 @@ -190,6 +191,10 @@ extract_currdev(void) dev.d_unit = 0; } +#if defined(USERBOOT_ZFS_SUPPORT) + init_zfs_bootenv(zfs_fmtdev(&dev)); +#endif + env_setenv("currdev", EV_VOLATILE, userboot_fmtdev(&dev), userboot_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, userboot_fmtdev(&dev), @@ -198,6 +203,29 @@ extract_currdev(void) #if defined(USERBOOT_ZFS_SUPPORT) static void +init_zfs_bootenv(char *currdev) +{ + char *beroot; + + /* Remove the trailing : */ + currdev[strlen(currdev) - 1] = '\0'; + setenv("zfs_be_active", currdev, 1); + /* Do not overwrite if already set */ + setenv("vfs.root.mountfrom", currdev, 0); + /* Forward past zfs: */ + currdev = strchr(currdev, ':'); + currdev++; + /* Remove the last element (current bootenv) */ + beroot = strrchr(currdev, '/'); + if (beroot != NULL) + beroot[0] = '\0'; + + beroot = currdev; + + setenv("zfs_be_root", beroot, 1); +} + +static void userboot_zfs_probe(void) { char devname[32]; @@ -237,6 +265,33 @@ command_lszfs(int argc, char *argv[]) } return (CMD_OK); } + +COMMAND_SET(reloadbe, "reloadbe", "refresh the list of ZFS Boot Environments", + command_reloadbe); + +static int +command_reloadbe(int argc, char *argv[]) +{ + int err; + + if (argc > 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } + + if (argc == 2) { + err = zfs_bootenv(argv[1]); + } else { + err = zfs_bootenv(getenv("zfs_be_root")); + } + + if (err != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } + + return (CMD_OK); +} #endif /* USERBOOT_ZFS_SUPPORT */ COMMAND_SET(quit, "quit", "exit the loader", command_quit); From owner-svn-src-head@freebsd.org Fri Jan 8 06:05:07 2016 Return-Path: Delivered-To: svn-src-head@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 3DDD1A67C78; Fri, 8 Jan 2016 06:05:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 0709A1BBF; Fri, 8 Jan 2016 06:05:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 5725B782395; Fri, 8 Jan 2016 17:04:57 +1100 (AEDT) Date: Fri, 8 Jan 2016 17:04:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jim Harris cc: Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293328 - head/sys/dev/nvme In-Reply-To: Message-ID: <20160108160312.Y1626@besplex.bde.org> References: <201601071618.u07GIXdd054147@repo.freebsd.org> <6496C054-6FED-4B41-8EF8-8067E8B6C866@panasas.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=n-kJSqksAAAA:8 a=Ra8JCSpROcCdkStrUYgA:9 a=V9_opou4x4dvQzEj:21 a=LaXgxn80HHdOZiGp:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 06:05:07 -0000 On Thu, 7 Jan 2016, Jim Harris wrote: > On Thu, Jan 7, 2016 at 9:27 AM, Ravi Pokala wrote: > ... >>> + * Used for calculating number of CPUs to assign to each core and number >> of I/O >>> + * queues to allocate per controller. >>> + */ >>> +#define NVME_CEILING(num, div) ((((num) - 1) / (div)) + 1) >>> + >>> >>> ... >> >> I'm surprised that this isn't in , along with >> roundup()/rounddown()/etc. Finding the ceiling like this is probably pretty >> common, so shouldn't it be added to the common header so everyone can use >> it? > > Good catch. howmany() does exactly this, just expressed differently. I'll > switch over to that. Thanks! howmany() doesn't do exactly this. It has diferent bugs / range of applicability, I see about 10. Subtracting 1 instead of adding more than 1 gives overflow in different cases. Even the simple and not unreasonable case num = 0 gives overflow in NVME_CEILING() if div happens to be unsigned and not 1: NVME_CEILING(0, 2U) = UINTMAX / 2 + 1 = 0x80000000 with 32-bit ints. Getting to 10 different bugs requires considering unreasonable cases with negative div or num, and nonsense cases with div = 0, and reasonable but unsupported cases with floating point args. C's broken division for negative integer values makes the details large. NVME_CEILING() is closer to supporting negative values than howmany() -- the magic 1 that it adds is to adjust for division of non-negative values rounding down. For division of negative values, the adjustment should be by -1 or 0, depending on the C bug and on whether you want to round negative results towards 0 or minus infinity. Howmany() is undocumented so its bugs are harder to see than in your own macro. Another one is that it is an unsafe macro with the name of a safe function-like API. This naming convention is more important for undocumented APIs. NVME_CEILING() follows it in reverse. Subtracting 1 instead of adding (div) - 1 is less robust but avoids multiple evaluation of div. Bruce From owner-svn-src-head@freebsd.org Fri Jan 8 08:09:11 2016 Return-Path: Delivered-To: svn-src-head@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 BC642A67515; Fri, 8 Jan 2016 08:09:11 +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 729401FE6; Fri, 8 Jan 2016 08:09:11 +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 u0889Ad7049638; Fri, 8 Jan 2016 08:09:10 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0889AVu049637; Fri, 8 Jan 2016 08:09:10 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601080809.u0889AVu049637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 8 Jan 2016 08:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293417 - head/contrib/ntp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 08:09:11 -0000 Author: delphij Date: Fri Jan 8 08:09:10 2016 New Revision: 293417 URL: https://svnweb.freebsd.org/changeset/base/293417 Log: mergeinfo fixup. Modified: Directory Properties: head/contrib/ntp/ (props changed) From owner-svn-src-head@freebsd.org Fri Jan 8 10:04:20 2016 Return-Path: Delivered-To: svn-src-head@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 9F8BEA67162; Fri, 8 Jan 2016 10:04: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 7CB8B1A52; Fri, 8 Jan 2016 10:04: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 u08A4JdO086066; Fri, 8 Jan 2016 10:04:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08A4JSO086061; Fri, 8 Jan 2016 10:04:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601081004.u08A4JSO086061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 8 Jan 2016 10:04:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293419 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 10:04:20 -0000 Author: hselasky Date: Fri Jan 8 10:04:19 2016 New Revision: 293419 URL: https://svnweb.freebsd.org/changeset/base/293419 Log: LinuxKPI style changes: - Properly prefix internal functions with "linux_" instead of only a single underscore to avoid future namespace collisions. - Make some functions global instead of inline to ease debugging and to avoid unnecessary code duplication. - Remove no longer existing kthread_create() function's prototype. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h head/sys/compat/linuxkpi/common/include/linux/interrupt.h head/sys/compat/linuxkpi/common/include/linux/kthread.h head/sys/compat/linuxkpi/common/include/linux/netdevice.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/gfp.h Fri Jan 8 09:56:28 2016 (r293418) +++ head/sys/compat/linuxkpi/common/include/linux/gfp.h Fri Jan 8 10:04:19 2016 (r293419) @@ -66,15 +66,15 @@ page_address(struct page *page) } static inline unsigned long -_get_page(gfp_t mask) +linux_get_page(gfp_t mask) { return kmem_malloc(kmem_arena, PAGE_SIZE, mask); } -#define get_zeroed_page(mask) _get_page((mask) | M_ZERO) -#define alloc_page(mask) virt_to_page(_get_page((mask))) -#define __get_free_page(mask) _get_page((mask)) +#define get_zeroed_page(mask) linux_get_page((mask) | M_ZERO) +#define alloc_page(mask) virt_to_page(linux_get_page((mask))) +#define __get_free_page(mask) linux_get_page((mask)) static inline void free_page(unsigned long page) Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri Jan 8 09:56:28 2016 (r293418) +++ head/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri Jan 8 10:04:19 2016 (r293419) @@ -54,24 +54,17 @@ struct irq_ent { }; static inline int -_irq_rid(struct device *dev, int irq) +linux_irq_rid(struct device *dev, int irq) { if (irq == dev->irq) return (0); return irq - dev->msix + 1; } -static inline void -_irq_handler(void *ent) -{ - struct irq_ent *irqe; - - irqe = ent; - irqe->handler(irqe->irq, irqe->arg); -} +extern void linux_irq_handler(void *); static inline struct irq_ent * -_irq_ent(struct device *dev, int irq) +linux_irq_ent(struct device *dev, int irq) { struct irq_ent *irqe; @@ -95,7 +88,7 @@ request_irq(unsigned int irq, irq_handle dev = _pci_find_irq_dev(irq); if (dev == NULL) return -ENXIO; - rid = _irq_rid(dev, irq); + rid = linux_irq_rid(dev, irq); res = bus_alloc_resource_any(dev->bsddev, SYS_RES_IRQ, &rid, flags | RF_ACTIVE); if (res == NULL) @@ -107,7 +100,7 @@ request_irq(unsigned int irq, irq_handle irqe->handler = handler; irqe->irq = irq; error = bus_setup_intr(dev->bsddev, res, INTR_TYPE_NET | INTR_MPSAFE, - NULL, _irq_handler, irqe, &irqe->tag); + NULL, linux_irq_handler, irqe, &irqe->tag); if (error) { bus_release_resource(dev->bsddev, SYS_RES_IRQ, rid, irqe->res); kfree(irqe); @@ -128,7 +121,7 @@ bind_irq_to_cpu(unsigned int irq, int cp if (dev == NULL) return (-ENOENT); - irqe = _irq_ent(dev, irq); + irqe = linux_irq_ent(dev, irq); if (irqe == NULL) return (-ENOENT); @@ -145,8 +138,8 @@ free_irq(unsigned int irq, void *device) dev = _pci_find_irq_dev(irq); if (dev == NULL) return; - rid = _irq_rid(dev, irq); - irqe = _irq_ent(dev, irq); + rid = linux_irq_rid(dev, irq); + irqe = linux_irq_ent(dev, irq); if (irqe == NULL) return; bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); Modified: head/sys/compat/linuxkpi/common/include/linux/kthread.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kthread.h Fri Jan 8 09:56:28 2016 (r293418) +++ head/sys/compat/linuxkpi/common/include/linux/kthread.h Fri Jan 8 10:04:19 2016 (r293419) @@ -42,7 +42,7 @@ #include static inline void -_kthread_fn(void *arg) +linux_kthread_fn(void *arg) { struct task_struct *task; @@ -58,7 +58,7 @@ _kthread_fn(void *arg) } static inline struct task_struct * -_kthread_create(int (*threadfn)(void *data), void *data) +linux_kthread_create(int (*threadfn)(void *data), void *data) { struct task_struct *task; @@ -69,17 +69,12 @@ _kthread_create(int (*threadfn)(void *da return (task); } -struct task_struct *kthread_create(int (*threadfn)(void *data), - void *data, - const char namefmt[], ...) - __attribute__((format(printf, 3, 4))); - #define kthread_run(fn, data, fmt, ...) \ ({ \ struct task_struct *_task; \ \ - _task = _kthread_create((fn), (data)); \ - if (kthread_add(_kthread_fn, _task, NULL, &_task->task_thread, \ + _task = linux_kthread_create((fn), (data)); \ + if (kthread_add(linux_kthread_fn, _task, NULL, &_task->task_thread, \ 0, 0, fmt, ## __VA_ARGS__)) { \ kfree(_task); \ _task = NULL; \ Modified: head/sys/compat/linuxkpi/common/include/linux/netdevice.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/netdevice.h Fri Jan 8 09:56:28 2016 (r293418) +++ head/sys/compat/linuxkpi/common/include/linux/netdevice.h Fri Jan 8 10:04:19 2016 (r293419) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -69,103 +69,10 @@ netdev_priv(const struct net_device *dev return (dev->if_softc); } -static inline void -_handle_ifnet_link_event(void *arg, struct ifnet *ifp, int linkstate) -{ - struct notifier_block *nb; - - nb = arg; - if (linkstate == LINK_STATE_UP) - nb->notifier_call(nb, NETDEV_UP, ifp); - else - nb->notifier_call(nb, NETDEV_DOWN, ifp); -} - -static inline void -_handle_ifnet_arrival_event(void *arg, struct ifnet *ifp) -{ - struct notifier_block *nb; - - nb = arg; - nb->notifier_call(nb, NETDEV_REGISTER, ifp); -} - -static inline void -_handle_ifnet_departure_event(void *arg, struct ifnet *ifp) -{ - struct notifier_block *nb; - - nb = arg; - nb->notifier_call(nb, NETDEV_UNREGISTER, ifp); -} - -static inline void -_handle_iflladdr_event(void *arg, struct ifnet *ifp) -{ - struct notifier_block *nb; - - nb = arg; - nb->notifier_call(nb, NETDEV_CHANGEADDR, ifp); -} - -static inline void -_handle_ifaddr_event(void *arg, struct ifnet *ifp) -{ - struct notifier_block *nb; - - nb = arg; - nb->notifier_call(nb, NETDEV_CHANGEIFADDR, ifp); -} - -static inline int -register_netdevice_notifier(struct notifier_block *nb) -{ - - nb->tags[NETDEV_UP] = EVENTHANDLER_REGISTER( - ifnet_link_event, _handle_ifnet_link_event, nb, 0); - nb->tags[NETDEV_REGISTER] = EVENTHANDLER_REGISTER( - ifnet_arrival_event, _handle_ifnet_arrival_event, nb, 0); - nb->tags[NETDEV_UNREGISTER] = EVENTHANDLER_REGISTER( - ifnet_departure_event, _handle_ifnet_departure_event, nb, 0); - nb->tags[NETDEV_CHANGEADDR] = EVENTHANDLER_REGISTER( - iflladdr_event, _handle_iflladdr_event, nb, 0); - - return (0); -} - -static inline int -register_inetaddr_notifier(struct notifier_block *nb) -{ - - nb->tags[NETDEV_CHANGEIFADDR] = EVENTHANDLER_REGISTER( - ifaddr_event, _handle_ifaddr_event, nb, 0); - return (0); -} - -static inline int -unregister_netdevice_notifier(struct notifier_block *nb) -{ - - EVENTHANDLER_DEREGISTER(ifnet_link_event, nb->tags[NETDEV_UP]); - EVENTHANDLER_DEREGISTER(ifnet_arrival_event, nb->tags[NETDEV_REGISTER]); - EVENTHANDLER_DEREGISTER(ifnet_departure_event, - nb->tags[NETDEV_UNREGISTER]); - EVENTHANDLER_DEREGISTER(iflladdr_event, - nb->tags[NETDEV_CHANGEADDR]); - - return (0); -} - -static inline int -unregister_inetaddr_notifier(struct notifier_block *nb) -{ - - EVENTHANDLER_DEREGISTER(ifaddr_event, - nb->tags[NETDEV_CHANGEIFADDR]); - - return (0); -} - +int register_netdevice_notifier(struct notifier_block *); +int register_inetaddr_notifier(struct notifier_block *); +int unregister_netdevice_notifier(struct notifier_block *); +int unregister_inetaddr_notifier(struct notifier_block *); #define rtnl_lock() #define rtnl_unlock() Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Jan 8 09:56:28 2016 (r293418) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Jan 8 10:04:19 2016 (r293419) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -1139,6 +1140,114 @@ const struct kobj_type linux_cdev_static }; static void +linux_handle_ifnet_link_event(void *arg, struct ifnet *ifp, int linkstate) +{ + struct notifier_block *nb; + + nb = arg; + if (linkstate == LINK_STATE_UP) + nb->notifier_call(nb, NETDEV_UP, ifp); + else + nb->notifier_call(nb, NETDEV_DOWN, ifp); +} + +static void +linux_handle_ifnet_arrival_event(void *arg, struct ifnet *ifp) +{ + struct notifier_block *nb; + + nb = arg; + nb->notifier_call(nb, NETDEV_REGISTER, ifp); +} + +static void +linux_handle_ifnet_departure_event(void *arg, struct ifnet *ifp) +{ + struct notifier_block *nb; + + nb = arg; + nb->notifier_call(nb, NETDEV_UNREGISTER, ifp); +} + +static void +linux_handle_iflladdr_event(void *arg, struct ifnet *ifp) +{ + struct notifier_block *nb; + + nb = arg; + nb->notifier_call(nb, NETDEV_CHANGEADDR, ifp); +} + +static void +linux_handle_ifaddr_event(void *arg, struct ifnet *ifp) +{ + struct notifier_block *nb; + + nb = arg; + nb->notifier_call(nb, NETDEV_CHANGEIFADDR, ifp); +} + +int +register_netdevice_notifier(struct notifier_block *nb) +{ + + nb->tags[NETDEV_UP] = EVENTHANDLER_REGISTER( + ifnet_link_event, linux_handle_ifnet_link_event, nb, 0); + nb->tags[NETDEV_REGISTER] = EVENTHANDLER_REGISTER( + ifnet_arrival_event, linux_handle_ifnet_arrival_event, nb, 0); + nb->tags[NETDEV_UNREGISTER] = EVENTHANDLER_REGISTER( + ifnet_departure_event, linux_handle_ifnet_departure_event, nb, 0); + nb->tags[NETDEV_CHANGEADDR] = EVENTHANDLER_REGISTER( + iflladdr_event, linux_handle_iflladdr_event, nb, 0); + + return (0); +} + +int +register_inetaddr_notifier(struct notifier_block *nb) +{ + + nb->tags[NETDEV_CHANGEIFADDR] = EVENTHANDLER_REGISTER( + ifaddr_event, linux_handle_ifaddr_event, nb, 0); + return (0); +} + +int +unregister_netdevice_notifier(struct notifier_block *nb) +{ + + EVENTHANDLER_DEREGISTER(ifnet_link_event, + nb->tags[NETDEV_UP]); + EVENTHANDLER_DEREGISTER(ifnet_arrival_event, + nb->tags[NETDEV_REGISTER]); + EVENTHANDLER_DEREGISTER(ifnet_departure_event, + nb->tags[NETDEV_UNREGISTER]); + EVENTHANDLER_DEREGISTER(iflladdr_event, + nb->tags[NETDEV_CHANGEADDR]); + + return (0); +} + +int +unregister_inetaddr_notifier(struct notifier_block *nb) +{ + + EVENTHANDLER_DEREGISTER(ifaddr_event, + nb->tags[NETDEV_CHANGEIFADDR]); + + return (0); +} + +void +linux_irq_handler(void *ent) +{ + struct irq_ent *irqe; + + irqe = ent; + irqe->handler(irqe->irq, irqe->arg); +} + +static void linux_compat_init(void *arg) { struct sysctl_oid *rootoid; From owner-svn-src-head@freebsd.org Fri Jan 8 11:54:26 2016 Return-Path: Delivered-To: svn-src-head@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 BE5AEA674AE; Fri, 8 Jan 2016 11:54:26 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail-out.smeets.xyz (mail-out.smeets.xyz [IPv6:2a01:4f8:160:918a::25:11]) (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 55A731D06; Fri, 8 Jan 2016 11:54:26 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail.smeets.xyz (mail.smeets.xyz [IPv6:2a01:4f8:160:918a::25:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-out.smeets.xyz (Postfix) with ESMTPS id 4BC7D1054; Fri, 8 Jan 2016 12:54:14 +0100 (CET) Received: from amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:160:918a::aa:4]) by mail.smeets.xyz (Postfix) with ESMTP id 181829CC20; Fri, 8 Jan 2016 12:54:14 +0100 (CET) Authentication-Results: mail.smeets.xyz; dkim=pass (1024-bit key; unprotected) header.d=smeets.xyz header.i=@smeets.xyz header.b=Y/MCwhcP X-Virus-Scanned: amavisd-new at smeets.xyz Received: from mail.smeets.xyz ([IPv6:2a01:4f8:160:918a::25:3]) by amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:160:918a::aa:4]) (amavisd-new, port 10025) with ESMTP id 4yBR3YcuNqhb; Fri, 8 Jan 2016 12:54:07 +0100 (CET) Received: from nibbler-wlan.home.lan (unknown [IPv6:2001:4dd0:fd65:d00d:144d:1bcd:817c:6547]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.smeets.xyz (Postfix) with ESMTPSA id 265E39CC1D; Fri, 8 Jan 2016 12:54:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=smeets.xyz; s=default; t=1452254047; bh=8xut07L8joUHBb8OTM1sAdCtnRNRVUNcnUvYTrAv32g=; h=Subject:To:References:From:Date:In-Reply-To; b=Y/MCwhcP2YhbYga82nariYFTZBnY0Ajc/1VMnzHxPBnGqyRQfPl/hIh6FFqtsEr0J o5TBNELeRNZyg1+T2dyeZfdg5ZyxlEQDPl189j7LEvg9sa6a621vjyP2fcosNVbgEG aoi/DmGI3huXJL4y9XjDgs+fFiO3lLK/bnjIOVks= Subject: Re: svn commit: r293414 - in head/sys/boot: i386/loader userboot/userboot To: Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601080509.u0859uSh096968@repo.freebsd.org> From: Florian Smeets X-Enigmail-Draft-Status: N1110 Message-ID: <568FA359.8010705@smeets.xyz> Date: Fri, 8 Jan 2016 12:54:01 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:43.0) Gecko/20100101 Thunderbird/43.0 MIME-Version: 1.0 In-Reply-To: <201601080509.u0859uSh096968@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DicbTIfaTmH71Orl7o4aigKlc5EMSsERl" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 11:54:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DicbTIfaTmH71Orl7o4aigKlc5EMSsERl Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 08.01.16 06:09, Allan Jude wrote: > Author: allanjude > Date: Fri Jan 8 05:09:55 2016 > New Revision: 293414 > URL: https://svnweb.freebsd.org/changeset/base/293414 >=20 > Log: > Add support for ZFS Boot Environments to userboot (for bhyve and othe= rs) > =20 > While here, also fix a possible null pointer > =20 > Reported by: lattera > MFC after: 3 days > Sponsored by: ScaleEngine Inc. >=20 Hi Allan, this commit causes bhyveload to segfault for me. After reverting this commit and reinstalling userboot.so I can successfully start byhve VMs again. My bhyves use a zvol as backingstore, this is how I start them /usr/share/examples/bhyve/vmrun.sh -d /dev/zvol/zroot/bhyve/xxx -t tap0 -c 1 xxx Let me know if you need anything else. Florian --DicbTIfaTmH71Orl7o4aigKlc5EMSsERl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQJ8BAEBCgBmBQJWj6NdXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNzAxMDMyMDNCQ0FCNDRBOThGRUM4NDRF NzA1M0RGOUZGODZGMDc2AAoJEOcFPfn/hvB2BzQQAOHSdbElsNbpx+EITUx5BZrU rSOwWjToJbqeji3bDiPduwm1vkSBKxkq8+pyXYN88bxoWVhwcaauQUSoc+LQWP0M VxvXh39OkP9VFZDTquLZTggjqxcAQESAos0E/O+Qj/vy3GttUd9fYbQU/KqOS7CF Ma/JuckjQNs/RqaVgRsCXaO5CaegvsMtUwTGSJjGr9BTHWfRRpbFtvJng4es/IN7 xYSB6MJn6JR59F0Gl3h8p3EYbGmIiQ0ZZuVEU9ypL7Rcx6IP9Q6MNUwz7asVvPBI guBteZYgCg5YiSw/v69YgtCI1jozdfIH2pE5BoHDJwQ8yzE4cnptTRpTHyEiaqrS 32YLExeX8Q4D2LbnaKcjMcB5sO8WjQDw5HXlKe+n+Mc+dHYoLWq7c463URMY2bqj 8Kbny6ioBe/xK1Z0GsY/S0bEwyf7ORvKXvyzQbMmmRZgG1z+Cjq3kfcApK+6XP/3 /fufUFFHZ+bfjosAtVDl7JSgWdACg8gFc0/zW9jDtji35NQxvciu7rR1riReyuuI 78/4be+P1aOIuP3dBUct36Rj8HAQUbNCRAFTByIfETF+vfwIxPG5zbg7z+dgCYwb coW+L8X3jXXdyOH0RWBS5uGguw/89+I2DCgswFEUTiElwUOCVLYep/CTKPg6dvnL ccqBq5Lzos4Ru3LUazZ4 =2399 -----END PGP SIGNATURE----- --DicbTIfaTmH71Orl7o4aigKlc5EMSsERl-- From owner-svn-src-head@freebsd.org Fri Jan 8 13:33:24 2016 Return-Path: Delivered-To: svn-src-head@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 05BB9A668DF; Fri, 8 Jan 2016 13:33:24 +0000 (UTC) (envelope-from brueffer@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 BC6F81B44; Fri, 8 Jan 2016 13:33:23 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u08DXMix047445; Fri, 8 Jan 2016 13:33:22 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08DXMjk047441; Fri, 8 Jan 2016 13:33:22 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201601081333.u08DXMjk047441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 8 Jan 2016 13:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293421 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 13:33:24 -0000 Author: brueffer Date: Fri Jan 8 13:33:22 2016 New Revision: 293421 URL: https://svnweb.freebsd.org/changeset/base/293421 Log: Fix issues found by mandoc -Tlint. MFC after: 1 week Modified: head/share/man/man9/DEVICE_PROBE.9 head/share/man/man9/kern_testfrwk.9 head/share/man/man9/malloc.9 head/share/man/man9/timeout.9 Modified: head/share/man/man9/DEVICE_PROBE.9 ============================================================================== --- head/share/man/man9/DEVICE_PROBE.9 Fri Jan 8 10:35:57 2016 (r293420) +++ head/share/man/man9/DEVICE_PROBE.9 Fri Jan 8 13:33:22 2016 (r293421) @@ -100,7 +100,8 @@ This is for source or binary drivers tha tree. Its use in the base OS is prohibited. .It BUS_PROBE_DEFAULT -The device is a normal device matching some plug and play ID. This is +The device is a normal device matching some plug and play ID. +This is the normal return value for drivers to use. It is intended that nearly all of the drivers in the tree should return this value. Modified: head/share/man/man9/kern_testfrwk.9 ============================================================================== --- head/share/man/man9/kern_testfrwk.9 Fri Jan 8 10:35:57 2016 (r293420) +++ head/share/man/man9/kern_testfrwk.9 Fri Jan 8 13:33:22 2016 (r293421) @@ -65,7 +65,6 @@ When your test loads, you register your You do that through a call to .Fn kern_testframework_register . Usually this is done at the module load event as shown below: -.Pp .Bd -literal -offset indent switch (type) { case MOD_LOAD: @@ -122,7 +121,6 @@ field is a test-specific set of informat It is passed in from user space and has a maximum size of 256 bytes. You can pass arbitrary test input in the space. In the case of callout_test we reshape that to: -.Pp .Bd -literal -offset indent struct callout_test { int number_of_callouts; @@ -133,7 +131,6 @@ struct callout_test { So the first lines of .Fn run_callout_test does the following to get at the user specific data: -.Pp .\" This is a bad example and violates strict aliasing. It should be replaced. .Bd -literal -offset indent struct callout_test *u; Modified: head/share/man/man9/malloc.9 ============================================================================== --- head/share/man/man9/malloc.9 Fri Jan 8 10:35:57 2016 (r293420) +++ head/share/man/man9/malloc.9 Fri Jan 8 13:33:22 2016 (r293421) @@ -229,7 +229,7 @@ may sleep when called with never sleeps. However, .Fn malloc , -.Fn realloc, +.Fn realloc , .Fn reallocf and .Fn free Modified: head/share/man/man9/timeout.9 ============================================================================== --- head/share/man/man9/timeout.9 Fri Jan 8 10:35:57 2016 (r293420) +++ head/share/man/man9/timeout.9 Fri Jan 8 13:33:22 2016 (r293421) @@ -261,7 +261,7 @@ returns zero it will arrange for the fun .Fa drain to be called using the same argument given to the .Fn callout_reset -function. +function. .Fn callout_async_drain If the callout has an associated lock, then that lock must be held when this function is called. From owner-svn-src-head@freebsd.org Fri Jan 8 13:58:38 2016 Return-Path: Delivered-To: svn-src-head@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 DC666A67232; Fri, 8 Jan 2016 13:58:37 +0000 (UTC) (envelope-from smh@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 B54A519CC; Fri, 8 Jan 2016 13:58:37 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u08Dwarr053631; Fri, 8 Jan 2016 13:58:36 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08Dwa3n053627; Fri, 8 Jan 2016 13:58:36 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601081358.u08Dwa3n053627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 8 Jan 2016 13:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293422 - head/sys/boot/efi/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 13:58:38 -0000 Author: smh Date: Fri Jan 8 13:58:36 2016 New Revision: 293422 URL: https://svnweb.freebsd.org/changeset/base/293422 Log: Update generated efi boot image templates r279533 increased the boot1 size from 64k to 128k but didn't regenerate the fat templates, hence the change was never activated. With recent and upcoming changes the efi boot1 binary is now > 64k. To avoid fat corruption in the created boot images regenerate the templates to activate the boot1 size increase. MFC after: 2 weeks X-MFC-With: r293268 Modified: head/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu head/sys/boot/efi/boot1/fat-arm.tmpl.bz2.uu head/sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu head/sys/boot/efi/boot1/fat-i386.tmpl.bz2.uu Modified: head/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu ============================================================================== --- head/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu Fri Jan 8 13:33:22 2016 (r293421) +++ head/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu Fri Jan 8 13:58:36 2016 (r293422) @@ -2,19 +2,25 @@ FAT template boot filesystem created by DO NOT EDIT $FreeBSD$ begin 644 fat-amd64.tmpl.bz2 -M0EIH.3%!629362AK*D(`&I+____[ZZKJZ_^N_ZO^Z_Z_OJ[L`4`!7I0$#&$" -M0$!$3&(I-DTU,)ZAZ0VA-!M0T'J`>H#"9 -M'I#0-H&HQI&0&3&FH>H>*`JHHU3V]1%/4/2``T#0`!H``#0`````#1H,@``6 -M'1&G'&@?$6[T#A)?X8$A160"20BO#")0J4TB1*4GXF$B4I,&>43+=_?K=#3* -M6]R"ZNKJZI,9*68E8*E2Q -M4J5*E3'(1830A"$(12A-"<(0A#]VD)H0A"$,>I0FA"$(0I\>P^=F5:M6K5JU -M:DI3:64UN;[7%5B]Y-^\]@_K@B:N\/,5F%&H<\G#IXQXAEFC&D?![6%0'6MR -MX1@@%FC"FD`M7,/SXFNG:2`'-0<-C$8^+$N.7M1B,^6)9,DV9,0A\OL<:C"L -ML1V&,<\9YRB>XV#BG")'6NKRK^("UF2XO?_L!#29">MGDF$R3).!PX&%E,4C -M''=(FL1.`_3?CN@-IB2PI3!FF\<8X.X@D,>CA90I)#M$XRPNDFJELL<3=1?8 -M2B7\5Z64,!7Z;EEBW-MXN-4IJ@W$462]-*\YCR,-B,5[W?=3&L/U>SX,WV#\ -M\B`:I"'0Z)5"$1B.E)(K[5I4RS`%R$>Y\D0NR*,;<9CZ:^V3P(I?D0`&T#_____ZZKJ[_^N_^O^Z_Z[OJ_NJ^JK^KZNKNNJ +MZ^KNZOJ^P`+\&$`!D#0T:`80&@T#`@`-`:9`:`P"`R::```:8)II@@,FC(-& +M$`!D,(:9`E5%&3_]*J?ZHC(--&@::#3)HQ#0`&C330,"9,F$::9!D#`F30#3 +M3)H9-&1DTR`R:,3"`&0-#1H!A`:#0,"``T!ID!H#`(#)IH``!I@FFF"`R:,@ +MT80`&0PAID!5)$)Y0@R&HQ#3U-I--,@-&0R-&@T-`&FF@9-!IIIH-&1ILHTT +M&ADQ#-$\B;1-/2-H93$\4\34Q9ZDM*M:U49"2K6F0C'21$(GD$1$085)7RB( +M00A7Q'^3"!"&CM$T+&UM5A49]7/"3^:EK7GMDVS9MRWK=+E>.(OG-?ZZMDA: +MR74C/HR\T0"$,Y+,YBA.JO&6C*K-DV26*@S24I%*E-2I4J5*JH43)*%"A0H4 +M*5-"E)2E2I4J5+!RPP]&&&&&&,P(9X]&&&&&&.IMKISQPX<.'#AP@0A"$(0A +M"$(0A"(MX]&&&&&&&$(0A"$(0(0A"$(?ME2N'#APX<.'"+EZ,,,,,,,($(0A +M"$0>NEGIM!8-(Y6FM$:.>9*3D219:RJKD^H2>1%9\LD8O.X4EIVM=.HDTT1'B:J=8;[A9NLU +M"OX%C.X>0U/WZ^E74T&IHJ3EG))(^U[S\6_?HX;B.,Y*]7SGN@PV*_(O+^9# +M+^Q,N_S1'42+=METV+CK9;+US'.8#H,%B,9Y*RD-/)TYXB8XQHI(RLF')')< +MI>OZHTTR!IH::#$ -M-`Q`:`/2:::&)IDP"/0$T:>IFD]$R8---3HUK2*K9].C:!IWS-2UK9M.3@8,&#!@P8(0A"$(0@0A"$(0[;_L-&C1HT:-&B+YP -M,&#!@P8,$"$(0A"-?NW$*YY:V9IQ,:B93+AX^A7B),5HN_4JV=2\Y,:-+W'Q -MKQKVU7KA+YR'.:*V#48N-"7<`%:TT4D`/;N;SZM9X,V(@!D'=P==+O)9*\H8 -MI8WIM*Q<2E)KFG;%M&U;INV]<)Q%^P'*<]T6R; -M^7`P.+I+N(HA%=#(^Q0WVV0]=$2=5)>-XWKW7!95E7$<5QW) +MGO'8M.]!X[V'QO:?6V;6L=^[<.#;YP\P:^3CD9VR(!"&?G@>`JM8+J&<8C-- +M];XRRIPJ9DN7++ERY7SNPOB]>O7KUZ]0HHHHHHHHHHHHHHHHY&)5555555444444444**** +M***,/F?'O7KUZ]>O7J-;*JJJJJJJA1111111B\A/&6:##:%^>;:*3FK;$R_" +M49GMN<56Z-+L4QW:7AO-:E[[YFN;)^C(;II,,-/FH[0Z.`"W`TDD`/"Q-3ZO +ML:*<*(`<"YB#/:ER\1,(YK`,_;8S*FLEB8#_>+FWU[;5/F:QL'WOT8[^6Z,U3YVK?8UK[7X-H_=D-NW;>OD/OR+$,[IK&Q^A$8LFH>@V#PVR9YG +MFT;5MG].4;EO&2ZIF9'12_Z38G,2C$ENY1LWXMH_5^S1,=D-NW#Z6[;QY[BG +M]^GM3.Q$O,EW$F/D[:TW.P$RAD.J;=[[^WP-PW+=/];QL62_YE,0WLF5+)EC +EROH:6QGY19C1`(0F`#*M6RUZ60C(?^+N2*<*$A&HRA,``` ` end Modified: head/sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu ============================================================================== --- head/sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu Fri Jan 8 13:33:22 2016 (r293421) +++ head/sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu Fri Jan 8 13:58:36 2016 (r293422) @@ -2,25 +2,25 @@ FAT template boot filesystem created by DO NOT EDIT $FreeBSD$ begin 644 fat-arm64.tmpl.bz2 -M0EIH.3%!62936:2BH:(`&T#_____ZZKJ[_^N_ZO_J_Z[OJ_NJ^JK^KZNKNNJ -MZNKNZOJ^P`+\```"``:`9,@T&F3$,@!B`,AIHP$#0-`T``,09--&31IH9#)D -M,(#$T&)B!A``-`,F0:#3)B&0`Q`&0TT8"!H&@:``&(,FFC)HTT,ADR&$!B:# -M$Q`P@`&@&3(-!IDQ#(`8@#(::,!`T#0-``#$&331DT::&0R9#"`Q-!B8@8"J -M*0GY$I&GH"-&AZ@T```T`:`!HT```&@&@-,C0`-`#U,(-`&)ZF(PGIJ>IO;U -M^=&QL3`-\E@Q+$(RTHB$7I"(B(-W:73$0@A#;S##$3$`A#FL\LAF,;&8;[CE -M&D=@ON\:9IWHO):QK7LL=LFN;1M6Y:%F>-1G^&O-A*(@0AQ,\#H*KRCJF>9Q -MFF_,RWU4X-,R6K5EJU:M6L"JMB5555555JVJU*U-JU:M6MUB*I555555;XHJ -ME555555YM='L;(N7+ERY_!^S^F[=KA#3YJ.S-)`!>O]K)`#-ZO -MU=9T,X(@!H',-+,1Q'-6'#ZNQORGURS=]_O%.6SF5G,PC`G#X_@7W$RC>2Q) -M9MW3P&G:AJFA?`^AKWXOV?R_QDL9F^`=5H>$UWWT9K&Q/HS.!KXB)U)9$6,) -M*/!EJ7>+W2L65_C\&LP69G$?'M$18.(LL.G:AZ;%>TUKYF.V+9/W9AMF[&^]HFB?J_AM6V;ANF2RG7,61I)?])L352^EX5C12BSAX@$(3`!EWEZ6P2R$9#_Q=R13A0D*2B -"H:(` +M0EIH.3%!629360E-\T``&T#_____ZZKJ[__N_^O^J_Z[OJ_NJ^JK^KZNKNNJ +MZNKNZOJ^P`+<#$``@`-#(T9!IIIH:-&F@&)D--,C0T#$,3(--````:-#$TT& +MC1@@:9#(!HQ,1II@E532,_]2J?ZH!!IIH:,1HQ-#$T-!HTQ,1B#`"`R8C)DR +M`:8(T9-&3$--&$P$&F$&0:8@`-#(T9!IIIH:-&F@&)D--,C0T#$,3(--```` +M:-#$TT&C1@@:9#(!HQ,1II@511(>21,:&D:`])Z0-`T&FC30:&1D`R:!IDT: +M#30&FC1ZFC1H::8FF3$VB,(TTT])@38C)J85-B +M+YQG-=.Q@NI[!'1T;V8B`A#*STN3J4K5GURR"X8UC&+5'4IF2M6HK5JU:M:* +ME5"52I4J5*E:NI6E6FM6K5JU_:JDJE2I4J5,6ME42J5*E2I4^'O-]9BRLK*R +MLFC1`A"$(0A"$(0A"$;QR<#!@P8,&#!"$(0A"$"$(0A"';?U+1HT:-&C1HB^ +M<#!@P8,&#!`A"$(0C7[MQ"N?8V[-.'W]RCNJ:$RX4HQWHVBV4YY+0IC2I>VU +M;7-BVR](F$9BP +M=730QJVW4L?8<[K';9##R%A9U.GI9677RQN6E'U1%+!E3+1M(]9JFL:Y=-DW +M"]<)Q'^O^<]E5STS6]5E-YO[9<7=KN-9:1>$M0B%N4(U$KQIE.=8Z5C+VGUV +ME&,M6TD7VI5 +M2V,1&=T5*WVNYREJSRSML52\#%Y_8Z:M;5U&@JL4EQ*4FP:ELFU?FW3=M\X+ +MAKYQW+8+";,W_'H0Z33T+W;(C)2?.^->O:?NNUVX;BN,Y+EK]SV&\=CI&UCK7,O.*CXI1_F'QM)8+^]$RAQV +M@PXZ:3Z7)W*[T]0YDF(D\UI%&H:I\KI&Q?FW+,N`_U_S`9%EL9H,?D -M+[=S7F7N=K>6VVB(EK"J(J71=U(].36-&M9]E)+CJ[>NMXBU.`OW%#X"4"I`L0*`H@*982S&"L)%`M'-HP#B!/4PH$;I)EK" -M?`??(&!3=]_K])6G70T%+BT8F221>O8;!LVT?HV[=-ZWZ_<-QW, +MAHF"/4]33TFT:38F)J8U%A.A7-:J,G*K6J(1D)1$(HD(B(@PZ3)3$0@A#)1' +M+J"!"&@RZI"SN;E96#/+%WZCR4ZAIFK:Y[S9MPVC>N*WZ_(RZV6C*LHLU!X3CCCCCCB!"$(0A"$(0A"$( +MS<*`88888880A"$(0A`A"$(0C!3?!<<<<<<<<1=P#######"!"$(0A$;FH,M +M4SUDT*]Z%WLG;45$RXTHRWG]PKJ/#2TR8U"7MOD;%M7Z+QQ%\P&&T]D'NVD> +M::.`"BPT\D`+78Z_9=Y-6(`9AVD&;V+LXB81H+`NJ*C*K&[E:V#G9QG[;'MM +M5=5EG[E08DLK+SGIJ[5M8V"X?@W:\<9?/]?\Q6:9VWUUQF=]P[%:=76W7"JQ +MKR7KHA<:*4;Z(Z`RE9'L2V#5*/!9R5AV-79U;6BLW$C)R?`UCYUJVC;MR_9P +M'$7R_ Delivered-To: svn-src-head@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 14955A67222; Fri, 8 Jan 2016 15:29:41 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id EAE451946; Fri, 8 Jan 2016 15:29:40 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 944AED7CD; Fri, 8 Jan 2016 15:29:39 +0000 (UTC) Subject: Re: svn commit: r293414 - in head/sys/boot: i386/loader userboot/userboot To: Florian Smeets , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601080509.u0859uSh096968@repo.freebsd.org> <568FA359.8010705@smeets.xyz> From: Allan Jude Message-ID: <568FD5EA.5070805@freebsd.org> Date: Fri, 8 Jan 2016 10:29:46 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <568FA359.8010705@smeets.xyz> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dcNpkmAUFHrwPLl919B26b5du7TQPS1w5" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 15:29:41 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --dcNpkmAUFHrwPLl919B26b5du7TQPS1w5 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016-01-08 06:54, Florian Smeets wrote: > On 08.01.16 06:09, Allan Jude wrote: >> Author: allanjude >> Date: Fri Jan 8 05:09:55 2016 >> New Revision: 293414 >> URL: https://svnweb.freebsd.org/changeset/base/293414 >> >> Log: >> Add support for ZFS Boot Environments to userboot (for bhyve and oth= ers) >> =20 >> While here, also fix a possible null pointer >> =20 >> Reported by: lattera >> MFC after: 3 days >> Sponsored by: ScaleEngine Inc. >> >=20 > Hi Allan, >=20 > this commit causes bhyveload to segfault for me. After reverting this > commit and reinstalling userboot.so I can successfully start byhve VMs > again. >=20 > My bhyves use a zvol as backingstore, this is how I start them >=20 > /usr/share/examples/bhyve/vmrun.sh -d /dev/zvol/zroot/bhyve/xxx -t tap0= > -c 1 xxx >=20 > Let me know if you need anything else. >=20 > Florian >=20 I am not seeing this crash on my system. Do you have any other information? Like a backtrace or something? --=20 Allan Jude --dcNpkmAUFHrwPLl919B26b5du7TQPS1w5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJWj9XuAAoJEBmVNT4SmAt+YFQQAJR0/BPSgtd2ZsMbJCW9trqI hctJy2nxL8D4VxpX/fbOB0l4hWt0ZhJ9ZdQklXLd/rCgug90N1I12pwMVHYk99DK a6lb2YuDVx5NJm60isy+f1MxMUw6EATa0oiEDT3uX65QCfwClWSk118K22qRoyjz /8C3oY0u7JvswKz1li+nJmQO6LjlAPOk5hn9sow9ePGHyiOhZfYpvEAWWLiqaFHr iWSfqI/Z2pizVjXJJZcB9RvtY0ZJEAO1VKc7Qe/b69ICTRCP8q0ALcTaLoQTTusj DtBsV8eF5i7QH35oOqLM5YSHNYLcKoCii2R9CUGcx1twRYMcb/2PlDyA+evxR8kz NTJhTdfL5wc4jJdEzXuOSnQWPGn7nGiokf6a7o6xKviyEvqhX114SqvZuGubHMgj 6NxcEXBIKdHsWBu191W7ce2Idbx5wiEkPw6qz6u/EpoEYOoVGinnRByRxeG8IB2r W86X6YXgwWgv/fi6yIOJU5avK5BtawJXRZUev7I5idd2v0RfW9Mw6ZP+Espy+GKi 8hH+XHQsmycAU8Ps4yVKIWtrbJOj5t8qq/6i6U7HJFFOQcMDuEViRW1HEzBDzlzA zsYaWwbRJYKqb0eMk3wHR5VGyC+Ikh68tiP4WUQqMSSymxLiC8UKs3h0LXUKN7EJ GyRdy410oJB6CVOJ/7+c =TB9Y -----END PGP SIGNATURE----- --dcNpkmAUFHrwPLl919B26b5du7TQPS1w5-- From owner-svn-src-head@freebsd.org Fri Jan 8 15:53:51 2016 Return-Path: Delivered-To: svn-src-head@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 07636A67A55; Fri, 8 Jan 2016 15:53:51 +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 8C1261864; Fri, 8 Jan 2016 15:53:50 +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 u08Frn2u089836; Fri, 8 Jan 2016 15:53:49 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08Frn4X089833; Fri, 8 Jan 2016 15:53:49 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601081553.u08Frn4X089833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 8 Jan 2016 15:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293423 - in head: contrib/ntp contrib/ntp/html contrib/ntp/include contrib/ntp/lib/isc contrib/ntp/lib/isc/win32 contrib/ntp/libntp contrib/ntp/libparse contrib/ntp/ntpd contrib/ntp/nt... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 15:53:51 -0000 Author: delphij Date: Fri Jan 8 15:53:48 2016 New Revision: 293423 URL: https://svnweb.freebsd.org/changeset/base/293423 Log: MFV r293415: ntp 4.2.8p5 Reviewed by: cy, roberto Relnotes: yes Differential Revision: https://reviews.freebsd.org/D4828 Added: head/contrib/ntp/include/safecast.h - copied unchanged from r293415, vendor/ntp/dist/include/safecast.h Modified: head/contrib/ntp/ChangeLog head/contrib/ntp/CommitLog head/contrib/ntp/NEWS head/contrib/ntp/configure head/contrib/ntp/html/miscopt.html head/contrib/ntp/include/Makefile.am head/contrib/ntp/include/Makefile.in head/contrib/ntp/include/ntp_refclock.h head/contrib/ntp/include/ntp_stdlib.h head/contrib/ntp/include/ntp_worker.h head/contrib/ntp/include/ntpd.h head/contrib/ntp/lib/isc/backtrace.c head/contrib/ntp/lib/isc/buffer.c head/contrib/ntp/lib/isc/inet_aton.c head/contrib/ntp/lib/isc/inet_pton.c head/contrib/ntp/lib/isc/log.c head/contrib/ntp/lib/isc/netaddr.c head/contrib/ntp/lib/isc/sockaddr.c head/contrib/ntp/lib/isc/task.c head/contrib/ntp/lib/isc/win32/interfaceiter.c head/contrib/ntp/lib/isc/win32/net.c head/contrib/ntp/libntp/a_md5encrypt.c head/contrib/ntp/libntp/atolfp.c head/contrib/ntp/libntp/authkeys.c head/contrib/ntp/libntp/authreadkeys.c head/contrib/ntp/libntp/authusekey.c head/contrib/ntp/libntp/dolfptoa.c head/contrib/ntp/libntp/hextolfp.c head/contrib/ntp/libntp/mstolfp.c head/contrib/ntp/libntp/msyslog.c head/contrib/ntp/libntp/ntp_crypto_rnd.c head/contrib/ntp/libntp/ntp_lineedit.c head/contrib/ntp/libntp/ntp_rfc2553.c head/contrib/ntp/libntp/ntp_worker.c head/contrib/ntp/libntp/snprintf.c head/contrib/ntp/libntp/socktohost.c head/contrib/ntp/libntp/systime.c head/contrib/ntp/libntp/work_thread.c head/contrib/ntp/libparse/clk_computime.c head/contrib/ntp/libparse/clk_dcf7000.c head/contrib/ntp/libparse/clk_hopf6021.c head/contrib/ntp/libparse/clk_meinberg.c head/contrib/ntp/libparse/clk_rawdcf.c head/contrib/ntp/libparse/clk_rcc8000.c head/contrib/ntp/libparse/clk_schmid.c head/contrib/ntp/libparse/clk_trimtaip.c head/contrib/ntp/libparse/clk_varitext.c head/contrib/ntp/libparse/clk_wharton.c head/contrib/ntp/libparse/parse.c head/contrib/ntp/ntpd/invoke-ntp.conf.texi head/contrib/ntp/ntpd/invoke-ntp.keys.texi head/contrib/ntp/ntpd/invoke-ntpd.texi head/contrib/ntp/ntpd/ntp.conf.5man head/contrib/ntp/ntpd/ntp.conf.5mdoc head/contrib/ntp/ntpd/ntp.conf.html head/contrib/ntp/ntpd/ntp.conf.man.in head/contrib/ntp/ntpd/ntp.conf.mdoc.in head/contrib/ntp/ntpd/ntp.keys.5man head/contrib/ntp/ntpd/ntp.keys.5mdoc head/contrib/ntp/ntpd/ntp.keys.html head/contrib/ntp/ntpd/ntp.keys.man.in head/contrib/ntp/ntpd/ntp.keys.mdoc.in head/contrib/ntp/ntpd/ntp_control.c head/contrib/ntp/ntpd/ntp_crypto.c head/contrib/ntp/ntpd/ntp_io.c head/contrib/ntp/ntpd/ntp_loopfilter.c head/contrib/ntp/ntpd/ntp_parser.c head/contrib/ntp/ntpd/ntp_proto.c head/contrib/ntp/ntpd/ntp_refclock.c head/contrib/ntp/ntpd/ntp_request.c head/contrib/ntp/ntpd/ntp_restrict.c head/contrib/ntp/ntpd/ntp_signd.c head/contrib/ntp/ntpd/ntp_timer.c head/contrib/ntp/ntpd/ntp_util.c head/contrib/ntp/ntpd/ntpd-opts.c head/contrib/ntp/ntpd/ntpd-opts.h head/contrib/ntp/ntpd/ntpd.1ntpdman head/contrib/ntp/ntpd/ntpd.1ntpdmdoc head/contrib/ntp/ntpd/ntpd.c head/contrib/ntp/ntpd/ntpd.html head/contrib/ntp/ntpd/ntpd.man.in head/contrib/ntp/ntpd/ntpd.mdoc.in head/contrib/ntp/ntpd/refclock_local.c head/contrib/ntp/ntpd/refclock_parse.c head/contrib/ntp/ntpd/refclock_shm.c head/contrib/ntp/ntpd/refclock_true.c head/contrib/ntp/ntpd/refclock_tsyncpci.c head/contrib/ntp/ntpdate/ntpdate.c head/contrib/ntp/ntpdc/invoke-ntpdc.texi head/contrib/ntp/ntpdc/ntpdc-opts.c head/contrib/ntp/ntpdc/ntpdc-opts.h head/contrib/ntp/ntpdc/ntpdc.1ntpdcman head/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc head/contrib/ntp/ntpdc/ntpdc.c head/contrib/ntp/ntpdc/ntpdc.h head/contrib/ntp/ntpdc/ntpdc.html head/contrib/ntp/ntpdc/ntpdc.man.in head/contrib/ntp/ntpdc/ntpdc.mdoc.in head/contrib/ntp/ntpdc/ntpdc_ops.c head/contrib/ntp/ntpq/invoke-ntpq.texi head/contrib/ntp/ntpq/libntpq.c head/contrib/ntp/ntpq/libntpq.h head/contrib/ntp/ntpq/libntpq_subs.c head/contrib/ntp/ntpq/ntpq-opts.c head/contrib/ntp/ntpq/ntpq-opts.h head/contrib/ntp/ntpq/ntpq-subs.c head/contrib/ntp/ntpq/ntpq.1ntpqman head/contrib/ntp/ntpq/ntpq.1ntpqmdoc head/contrib/ntp/ntpq/ntpq.c head/contrib/ntp/ntpq/ntpq.h head/contrib/ntp/ntpq/ntpq.html head/contrib/ntp/ntpq/ntpq.man.in head/contrib/ntp/ntpq/ntpq.mdoc.in head/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc head/contrib/ntp/ntpsnmpd/ntpsnmpd.html head/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in head/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in head/contrib/ntp/packageinfo.sh head/contrib/ntp/scripts/calc_tickadj/Makefile.am head/contrib/ntp/scripts/calc_tickadj/Makefile.in head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in head/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi head/contrib/ntp/scripts/invoke-plot_summary.texi head/contrib/ntp/scripts/invoke-summary.texi head/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi head/contrib/ntp/scripts/ntp-wait/ntp-wait-opts head/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman head/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc head/contrib/ntp/scripts/ntp-wait/ntp-wait.html head/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in head/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in head/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi head/contrib/ntp/scripts/ntpsweep/ntpsweep-opts head/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman head/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc head/contrib/ntp/scripts/ntpsweep/ntpsweep.html head/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in head/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in head/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi head/contrib/ntp/scripts/ntptrace/ntptrace-opts head/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman head/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc head/contrib/ntp/scripts/ntptrace/ntptrace.html head/contrib/ntp/scripts/ntptrace/ntptrace.man.in head/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in head/contrib/ntp/scripts/plot_summary-opts head/contrib/ntp/scripts/plot_summary.1plot_summaryman head/contrib/ntp/scripts/plot_summary.1plot_summarymdoc head/contrib/ntp/scripts/plot_summary.html head/contrib/ntp/scripts/plot_summary.man.in head/contrib/ntp/scripts/plot_summary.mdoc.in head/contrib/ntp/scripts/summary-opts head/contrib/ntp/scripts/summary.1summaryman head/contrib/ntp/scripts/summary.1summarymdoc head/contrib/ntp/scripts/summary.html head/contrib/ntp/scripts/summary.man.in head/contrib/ntp/scripts/summary.mdoc.in head/contrib/ntp/scripts/update-leap/invoke-update-leap.texi head/contrib/ntp/scripts/update-leap/update-leap-opts head/contrib/ntp/scripts/update-leap/update-leap.1update-leapman head/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc head/contrib/ntp/scripts/update-leap/update-leap.html head/contrib/ntp/scripts/update-leap/update-leap.man.in head/contrib/ntp/scripts/update-leap/update-leap.mdoc.in head/contrib/ntp/sntp/configure head/contrib/ntp/sntp/include/version.def head/contrib/ntp/sntp/include/version.texi head/contrib/ntp/sntp/invoke-sntp.texi head/contrib/ntp/sntp/m4/ntp_libevent.m4 head/contrib/ntp/sntp/m4/ntp_problemtests.m4 head/contrib/ntp/sntp/m4/version.m4 head/contrib/ntp/sntp/networking.c head/contrib/ntp/sntp/sntp-opts.c head/contrib/ntp/sntp/sntp-opts.h head/contrib/ntp/sntp/sntp.1sntpman head/contrib/ntp/sntp/sntp.1sntpmdoc head/contrib/ntp/sntp/sntp.html head/contrib/ntp/sntp/sntp.man.in head/contrib/ntp/sntp/sntp.mdoc.in head/contrib/ntp/sntp/tests/keyFile.c head/contrib/ntp/sntp/tests/kodDatabase.c head/contrib/ntp/sntp/tests/kodFile.c head/contrib/ntp/sntp/tests/run-kodDatabase.c head/contrib/ntp/sntp/tests/run-t-log.c head/contrib/ntp/sntp/tests/t-log.c head/contrib/ntp/sntp/tests/utilities.c head/contrib/ntp/sntp/unity/unity_internals.h head/contrib/ntp/sntp/version.c head/contrib/ntp/tests/bug-2803/bug-2803.c head/contrib/ntp/tests/bug-2803/run-bug-2803.c head/contrib/ntp/tests/libntp/a_md5encrypt.c head/contrib/ntp/tests/libntp/authkeys.c head/contrib/ntp/tests/libntp/buftvtots.c head/contrib/ntp/tests/libntp/calendar.c head/contrib/ntp/tests/libntp/caljulian.c head/contrib/ntp/tests/libntp/clocktime.c head/contrib/ntp/tests/libntp/decodenetnum.c head/contrib/ntp/tests/libntp/humandate.c head/contrib/ntp/tests/libntp/lfpfunc.c head/contrib/ntp/tests/libntp/lfptostr.c head/contrib/ntp/tests/libntp/modetoa.c head/contrib/ntp/tests/libntp/msyslog.c head/contrib/ntp/tests/libntp/netof.c head/contrib/ntp/tests/libntp/numtoa.c head/contrib/ntp/tests/libntp/numtohost.c head/contrib/ntp/tests/libntp/octtoint.c head/contrib/ntp/tests/libntp/prettydate.c head/contrib/ntp/tests/libntp/recvbuff.c head/contrib/ntp/tests/libntp/refidsmear.c head/contrib/ntp/tests/libntp/refnumtoa.c head/contrib/ntp/tests/libntp/run-a_md5encrypt.c head/contrib/ntp/tests/libntp/run-calendar.c head/contrib/ntp/tests/libntp/run-decodenetnum.c head/contrib/ntp/tests/libntp/run-humandate.c head/contrib/ntp/tests/libntp/run-lfpfunc.c head/contrib/ntp/tests/libntp/run-lfptostr.c head/contrib/ntp/tests/libntp/run-modetoa.c head/contrib/ntp/tests/libntp/run-msyslog.c head/contrib/ntp/tests/libntp/run-netof.c head/contrib/ntp/tests/libntp/run-numtoa.c head/contrib/ntp/tests/libntp/run-numtohost.c head/contrib/ntp/tests/libntp/run-prettydate.c head/contrib/ntp/tests/libntp/run-refnumtoa.c head/contrib/ntp/tests/libntp/run-sfptostr.c head/contrib/ntp/tests/libntp/run-socktoa.c head/contrib/ntp/tests/libntp/run-statestr.c head/contrib/ntp/tests/libntp/run-strtolfp.c head/contrib/ntp/tests/libntp/run-timespecops.c head/contrib/ntp/tests/libntp/run-timevalops.c head/contrib/ntp/tests/libntp/run-uglydate.c head/contrib/ntp/tests/libntp/sfptostr.c head/contrib/ntp/tests/libntp/socktoa.c head/contrib/ntp/tests/libntp/statestr.c head/contrib/ntp/tests/libntp/strtolfp.c head/contrib/ntp/tests/libntp/timespecops.c head/contrib/ntp/tests/libntp/timevalops.c head/contrib/ntp/tests/libntp/uglydate.c head/contrib/ntp/tests/ntpd/leapsec.c head/contrib/ntp/tests/ntpd/ntp_prio_q.c head/contrib/ntp/tests/ntpd/ntp_restrict.c head/contrib/ntp/tests/ntpd/rc_cmdlength.c head/contrib/ntp/tests/ntpd/run-leapsec.c head/contrib/ntp/tests/ntpd/run-ntp_restrict.c head/contrib/ntp/tests/ntpd/run-rc_cmdlength.c head/contrib/ntp/tests/ntpd/run-t-ntp_signd.c head/contrib/ntp/tests/ntpd/t-ntp_scanner.c head/contrib/ntp/tests/ntpd/t-ntp_signd.c head/contrib/ntp/tests/sandbox/run-uglydate.c head/contrib/ntp/tests/sandbox/smeartest.c head/contrib/ntp/tests/sandbox/uglydate.c head/contrib/ntp/tests/sec-2853/sec-2853.c head/contrib/ntp/util/invoke-ntp-keygen.texi head/contrib/ntp/util/ntp-keygen-opts.c head/contrib/ntp/util/ntp-keygen-opts.h head/contrib/ntp/util/ntp-keygen.1ntp-keygenman head/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc head/contrib/ntp/util/ntp-keygen.c head/contrib/ntp/util/ntp-keygen.html head/contrib/ntp/util/ntp-keygen.man.in head/contrib/ntp/util/ntp-keygen.mdoc.in head/usr.sbin/ntp/config.h head/usr.sbin/ntp/doc/ntp-keygen.8 head/usr.sbin/ntp/doc/ntp.conf.5 head/usr.sbin/ntp/doc/ntp.keys.5 head/usr.sbin/ntp/doc/ntpd.8 head/usr.sbin/ntp/doc/ntpdc.8 head/usr.sbin/ntp/doc/ntpq.8 head/usr.sbin/ntp/doc/sntp.8 Directory Properties: head/contrib/ntp/ (props changed) Modified: head/contrib/ntp/ChangeLog ============================================================================== --- head/contrib/ntp/ChangeLog Fri Jan 8 13:58:36 2016 (r293422) +++ head/contrib/ntp/ChangeLog Fri Jan 8 15:53:48 2016 (r293423) @@ -1,4 +1,61 @@ --- +(4.2.8p5) 2016/01/07 Released by Harlan Stenn + +* [Sec 2956] small-step/big-step. Close the panic gate earlier. HStenn. +* CID 1339955: Free allocated memory in caljulian test. HStenn. +* CID 1339962: Explicitly initialize variable in caljulian test. HStenn. +* CID 1341527: Quiet a CHECKED_RETURN in sntp/tests/t-log.c. HStenn. +* CID 1341533: Missing assertion in sntp/tests/t-log.c. HStenn. +* CID 1341534: Resource leak in tests/ntpd/t-ntp_signd.c. HStenn. +* CID 1341535: Resource leak in tests/ntpd/t-ntp_signd.c. HStenn. +* CID 1341536: Resource leak in tests/ntpd/t-ntp_signd.c. HStenn. +* CID 1341537: Resource leak in tests/ntpd/t-ntp_signd.c. HStenn. +* CID 1341538: Memory leak in tests/ntpd/ntp_prio_q.c:262. HStenn. +* CID 1341677: Nits in sntp/tests/keyFile.c. HStenn. +* CID 1341678: Nits in sntp/tests/keyFile.c. HStenn. +* CID 1341679: Nits in sntp/tests/keyFile.c. HStenn. +* CID 1341680: Nits in sntp/tests/keyFile.c. HStenn. +* CID 1341681: Nits in sntp/tests/keyFile.c. HStenn. +* CID 1341682: Nit in libntp/authreadkeys.c. HStenn. +* CID 1341684: Nit in tests/ntpd/t-ntp_signd.c. HStenn. +* [Bug 2829] Look at pipe_fds in ntpd.c (did so. perlinger@ntp.org) +* [Bug 2887] stratum -1 config results as showing value 99 + - fudge stratum should only accept values [0..16]. perlinger@ntp.org +* [Bug 2932] Update leapsecond file info in miscopt.html. CWoodbury, HStenn. +* [Bug 2934] tests/ntpd/t-ntp_scanner.c has a magic constant wired in. HMurray +* [Bug 2944] errno is not preserved properly in ntpdate after sendto call. + - applied patch by Christos Zoulas. perlinger@ntp.org +* [Bug 2952] Symmetric active/passive mode is broken. HStenn. +* [Bug 2954] Version 4.2.8p4 crashes on startup with sig fault + - fixed data race conditions in threaded DNS worker. perlinger@ntp.org + - limit threading warm-up to linux; FreeBSD bombs on it. perlinger@ntp.org +* [Bug 2957] 'unsigned int' vs 'size_t' format clash. perlinger@ntp.org + - accept key file only if there are no parsing errors + - fixed size_t/u_int format clash + - fixed wrong use of 'strlcpy' +* [Bug 2958] ntpq: fatal error messages need a final newline. Craig Leres. +* [Bug 2962] truncation of size_t/ptrdiff_t on 64bit targets. perlinger@ntp.org + - fixed several other warnings (cast-alignment, missing const, missing prototypes) + - promote use of 'size_t' for values that express a size + - use ptr-to-const for read-only arguments + - make sure SOCKET values are not truncated (win32-specific) + - format string fixes +* [Bug 2965] Local clock didn't work since 4.2.8p4. Martin Burnicki. +* [Bug 2967] ntpdate command suffers an assertion failure + - fixed ntp_rfc2553.c to return proper address length. perlinger@ntp.org +* [Bug 2969] Seg fault from ntpq/mrulist when looking at server with + lots of clients. perlinger@ntp.org +* [Bug 2971] ntpq bails on ^C: select fails: Interrupted system call + - changed stacked/nested handling of CTRL-C. perlinger@ntp.org +* Unity cleanup for FreeBSD-6.4. Harlan Stenn. +* Unity test cleanup. Harlan Stenn. +* Libevent autoconf pthread fixes for FreeBSD-10. Harlan Stenn. +* Header cleanup in tests/sandbox/uglydate.c. Harlan Stenn. +* Header cleanup in tests/libntp/sfptostr.c. Harlan Stenn. +* Quiet a warning from clang. Harlan Stenn. +* Update the NEWS file. Harlan Stenn. +* Update scripts/calc_tickadj/Makefile.am. Harlan Stenn. +--- (4.2.8p4) 2015/10/21 Released by Harlan Stenn (4.2.8p4-RC1) 2015/10/06 Released by Harlan Stenn Modified: head/contrib/ntp/CommitLog ============================================================================== --- head/contrib/ntp/CommitLog Fri Jan 8 13:58:36 2016 (r293422) +++ head/contrib/ntp/CommitLog Fri Jan 8 15:53:48 2016 (r293423) @@ -1,3 +1,1480 @@ +ChangeSet@1.3623, 2016-01-07 23:33:11+00:00, stenn@deacon.udel.edu + NTP_4_2_8P5 + TAG: NTP_4_2_8P5 + + ChangeLog@1.1791 +1 -0 + NTP_4_2_8P5 + + ntpd/invoke-ntp.conf.texi@1.194 +1 -1 + NTP_4_2_8P5 + + ntpd/invoke-ntp.keys.texi@1.186 +1 -1 + NTP_4_2_8P5 + + ntpd/invoke-ntpd.texi@1.503 +2 -2 + NTP_4_2_8P5 + + ntpd/ntp.conf.5man@1.228 +3 -3 + NTP_4_2_8P5 + + ntpd/ntp.conf.5mdoc@1.228 +2 -2 + NTP_4_2_8P5 + + ntpd/ntp.conf.html@1.182 +1 -1 + NTP_4_2_8P5 + + ntpd/ntp.conf.man.in@1.228 +3 -3 + NTP_4_2_8P5 + + ntpd/ntp.conf.mdoc.in@1.228 +2 -2 + NTP_4_2_8P5 + + ntpd/ntp.keys.5man@1.220 +2 -2 + NTP_4_2_8P5 + + ntpd/ntp.keys.5mdoc@1.220 +2 -2 + NTP_4_2_8P5 + + ntpd/ntp.keys.html@1.182 +1 -1 + NTP_4_2_8P5 + + ntpd/ntp.keys.man.in@1.220 +2 -2 + NTP_4_2_8P5 + + ntpd/ntp.keys.mdoc.in@1.220 +2 -2 + NTP_4_2_8P5 + + ntpd/ntpd-opts.c@1.525 +7 -7 + NTP_4_2_8P5 + + ntpd/ntpd-opts.h@1.524 +3 -3 + NTP_4_2_8P5 + + ntpd/ntpd.1ntpdman@1.332 +3 -3 + NTP_4_2_8P5 + + ntpd/ntpd.1ntpdmdoc@1.332 +2 -2 + NTP_4_2_8P5 + + ntpd/ntpd.html@1.176 +2 -2 + NTP_4_2_8P5 + + ntpd/ntpd.man.in@1.332 +3 -3 + NTP_4_2_8P5 + + ntpd/ntpd.mdoc.in@1.332 +2 -2 + NTP_4_2_8P5 + + ntpdc/invoke-ntpdc.texi@1.500 +2 -2 + NTP_4_2_8P5 + + ntpdc/ntpdc-opts.c@1.518 +7 -7 + NTP_4_2_8P5 + + ntpdc/ntpdc-opts.h@1.517 +3 -3 + NTP_4_2_8P5 + + ntpdc/ntpdc.1ntpdcman@1.331 +3 -3 + NTP_4_2_8P5 + + ntpdc/ntpdc.1ntpdcmdoc@1.331 +2 -2 + NTP_4_2_8P5 + + ntpdc/ntpdc.html@1.344 +2 -2 + NTP_4_2_8P5 + + ntpdc/ntpdc.man.in@1.331 +3 -3 + NTP_4_2_8P5 + + ntpdc/ntpdc.mdoc.in@1.331 +2 -2 + NTP_4_2_8P5 + + ntpq/invoke-ntpq.texi@1.507 +2 -2 + NTP_4_2_8P5 + + ntpq/ntpq-opts.c@1.524 +7 -7 + NTP_4_2_8P5 + + ntpq/ntpq-opts.h@1.522 +3 -3 + NTP_4_2_8P5 + + ntpq/ntpq.1ntpqman@1.335 +3 -3 + NTP_4_2_8P5 + + ntpq/ntpq.1ntpqmdoc@1.335 +2 -2 + NTP_4_2_8P5 + + ntpq/ntpq.html@1.173 +2 -2 + NTP_4_2_8P5 + + ntpq/ntpq.man.in@1.335 +3 -3 + NTP_4_2_8P5 + + ntpq/ntpq.mdoc.in@1.335 +2 -2 + NTP_4_2_8P5 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.502 +2 -2 + NTP_4_2_8P5 + + ntpsnmpd/ntpsnmpd-opts.c@1.520 +7 -7 + NTP_4_2_8P5 + + ntpsnmpd/ntpsnmpd-opts.h@1.519 +3 -3 + NTP_4_2_8P5 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.331 +3 -3 + NTP_4_2_8P5 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.331 +2 -2 + NTP_4_2_8P5 + + ntpsnmpd/ntpsnmpd.html@1.171 +1 -1 + NTP_4_2_8P5 + + ntpsnmpd/ntpsnmpd.man.in@1.331 +3 -3 + NTP_4_2_8P5 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.331 +2 -2 + NTP_4_2_8P5 + + packageinfo.sh@1.522 +2 -2 + NTP_4_2_8P5 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.92 +3 -3 + NTP_4_2_8P5 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.93 +2 -2 + NTP_4_2_8P5 + + scripts/calc_tickadj/calc_tickadj.html@1.94 +1 -1 + NTP_4_2_8P5 + + scripts/calc_tickadj/calc_tickadj.man.in@1.91 +3 -3 + NTP_4_2_8P5 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.93 +2 -2 + NTP_4_2_8P5 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.96 +1 -1 + NTP_4_2_8P5 + + scripts/invoke-plot_summary.texi@1.113 +2 -2 + NTP_4_2_8P5 + + scripts/invoke-summary.texi@1.113 +2 -2 + NTP_4_2_8P5 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.323 +2 -2 + NTP_4_2_8P5 + + scripts/ntp-wait/ntp-wait-opts@1.59 +2 -2 + NTP_4_2_8P5 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.320 +3 -3 + NTP_4_2_8P5 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.321 +2 -2 + NTP_4_2_8P5 + + scripts/ntp-wait/ntp-wait.html@1.340 +2 -2 + NTP_4_2_8P5 + + scripts/ntp-wait/ntp-wait.man.in@1.320 +3 -3 + NTP_4_2_8P5 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.321 +2 -2 + NTP_4_2_8P5 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.111 +2 -2 + NTP_4_2_8P5 + + scripts/ntpsweep/ntpsweep-opts@1.61 +2 -2 + NTP_4_2_8P5 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.99 +3 -3 + NTP_4_2_8P5 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.99 +2 -2 + NTP_4_2_8P5 + + scripts/ntpsweep/ntpsweep.html@1.112 +2 -2 + NTP_4_2_8P5 + + scripts/ntpsweep/ntpsweep.man.in@1.99 +3 -3 + NTP_4_2_8P5 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.100 +2 -2 + NTP_4_2_8P5 + + scripts/ntptrace/invoke-ntptrace.texi@1.112 +2 -2 + NTP_4_2_8P5 + + scripts/ntptrace/ntptrace-opts@1.61 +2 -2 + NTP_4_2_8P5 + + scripts/ntptrace/ntptrace.1ntptraceman@1.99 +3 -3 + NTP_4_2_8P5 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.100 +2 -2 + NTP_4_2_8P5 + + scripts/ntptrace/ntptrace.html@1.113 +2 -2 + NTP_4_2_8P5 + + scripts/ntptrace/ntptrace.man.in@1.99 +3 -3 + NTP_4_2_8P5 + + scripts/ntptrace/ntptrace.mdoc.in@1.101 +2 -2 + NTP_4_2_8P5 + + scripts/plot_summary-opts@1.61 +2 -2 + NTP_4_2_8P5 + + scripts/plot_summary.1plot_summaryman@1.111 +3 -3 + NTP_4_2_8P5 + + scripts/plot_summary.1plot_summarymdoc@1.111 +2 -2 + NTP_4_2_8P5 + + scripts/plot_summary.html@1.114 +2 -2 + NTP_4_2_8P5 + + scripts/plot_summary.man.in@1.111 +3 -3 + NTP_4_2_8P5 + + scripts/plot_summary.mdoc.in@1.111 +2 -2 + NTP_4_2_8P5 + + scripts/summary-opts@1.61 +2 -2 + NTP_4_2_8P5 + + scripts/summary.1summaryman@1.111 +3 -3 + NTP_4_2_8P5 + + scripts/summary.1summarymdoc@1.111 +2 -2 + NTP_4_2_8P5 + + scripts/summary.html@1.114 +2 -2 + NTP_4_2_8P5 + + scripts/summary.man.in@1.111 +3 -3 + NTP_4_2_8P5 + + scripts/summary.mdoc.in@1.111 +2 -2 + NTP_4_2_8P5 + + scripts/update-leap/invoke-update-leap.texi@1.12 +1 -1 + NTP_4_2_8P5 + + scripts/update-leap/update-leap-opts@1.12 +2 -2 + NTP_4_2_8P5 + + scripts/update-leap/update-leap.1update-leapman@1.12 +3 -3 + NTP_4_2_8P5 + + scripts/update-leap/update-leap.1update-leapmdoc@1.12 +2 -2 + NTP_4_2_8P5 + + scripts/update-leap/update-leap.html@1.12 +1 -1 + NTP_4_2_8P5 + + scripts/update-leap/update-leap.man.in@1.12 +3 -3 + NTP_4_2_8P5 + + scripts/update-leap/update-leap.mdoc.in@1.12 +2 -2 + NTP_4_2_8P5 + + sntp/invoke-sntp.texi@1.500 +2 -2 + NTP_4_2_8P5 + + sntp/sntp-opts.c@1.519 +7 -7 + NTP_4_2_8P5 + + sntp/sntp-opts.h@1.517 +3 -3 + NTP_4_2_8P5 + + sntp/sntp.1sntpman@1.335 +3 -3 + NTP_4_2_8P5 + + sntp/sntp.1sntpmdoc@1.335 +2 -2 + NTP_4_2_8P5 + + sntp/sntp.html@1.515 +2 -2 + NTP_4_2_8P5 + + sntp/sntp.man.in@1.335 +3 -3 + NTP_4_2_8P5 + + sntp/sntp.mdoc.in@1.335 +2 -2 + NTP_4_2_8P5 + + util/invoke-ntp-keygen.texi@1.503 +2 -2 + NTP_4_2_8P5 + + util/ntp-keygen-opts.c@1.521 +7 -7 + NTP_4_2_8P5 + + util/ntp-keygen-opts.h@1.519 +3 -3 + NTP_4_2_8P5 + + util/ntp-keygen.1ntp-keygenman@1.331 +3 -3 + NTP_4_2_8P5 + + util/ntp-keygen.1ntp-keygenmdoc@1.331 +2 -2 + NTP_4_2_8P5 + + util/ntp-keygen.html@1.177 +2 -2 + NTP_4_2_8P5 + + util/ntp-keygen.man.in@1.331 +3 -3 + NTP_4_2_8P5 + + util/ntp-keygen.mdoc.in@1.331 +2 -2 + NTP_4_2_8P5 + +ChangeSet@1.3622, 2016-01-07 17:52:24-05:00, stenn@deacon.udel.edu + ntp-4.2.8p5 + + packageinfo.sh@1.521 +1 -1 + ntp-4.2.8p5 + +ChangeSet@1.3621, 2016-01-07 22:20:05+00:00, stenn@psp-at1.ntp.org + cleanup + + NEWS@1.152 +2 -2 + cleanup + +ChangeSet@1.3620, 2016-01-07 09:33:11+00:00, stenn@psp-at1.ntp.org + typo in ntp_proto.c - leap smear. Reported by Martin Burnicki + + ntpd/ntp_proto.c@1.371 +1 -1 + typo in ntp_proto.c - leap smear. Reported by Martin Burnicki + +ChangeSet@1.3619, 2016-01-07 06:33:08+00:00, stenn@psp-at1.ntp.org + Update scripts/calc_tickadj/Makefile.am. Harlan Stenn. + + ChangeLog@1.1790 +1 -0 + Update scripts/calc_tickadj/Makefile.am. Harlan Stenn. + + scripts/calc_tickadj/Makefile.am@1.11 +2 -0 + Update scripts/calc_tickadj/Makefile.am. Harlan Stenn. + +ChangeSet@1.3616.1.1, 2016-01-05 10:57:45+00:00, stenn@psp-at1.ntp.org + Bug 2952 fixes + + ChangeLog@1.1787.1.1 +1 -0 + Bug 2952 fixes + + ntpd/ntp_proto.c@1.370 +165 -152 + Bug 2952 fixes + +ChangeSet@1.3617, 2016-01-05 09:56:31+00:00, stenn@psp-at1.ntp.org + ntp-4.2.8p5 prep + + ChangeLog@1.1788 +2 -1 + ntp-4.2.8p5 prep + + NEWS@1.151 +104 -3 + ntp-4.2.8p5 prep + +ChangeSet@1.3616, 2015-12-06 11:20:02+00:00, stenn@psp-deb1.ntp.org + Quiet a warning from clang. Harlan Stenn. + + ChangeLog@1.1787 +1 -0 + Quiet a warning from clang. Harlan Stenn. + + libntp/ntp_rfc2553.c@1.50 +3 -2 + Quiet a warning from clang. Harlan Stenn. + +ChangeSet@1.3615, 2015-12-05 10:41:51+00:00, stenn@psp-at1.ntp.org + CID 1341677: Nits in sntp/tests/keyFile.c. HStenn. + + ChangeLog@1.1786 +1 -0 + CID 1341677: Nits in sntp/tests/keyFile.c. HStenn. + + sntp/tests/keyFile.c@1.12 +5 -2 + CID 1341677: Nits in sntp/tests/keyFile.c. HStenn. + +ChangeSet@1.3614, 2015-12-05 10:38:28+00:00, stenn@psp-at1.ntp.org + CID 1341678: Nits in sntp/tests/keyFile.c. HStenn. + + ChangeLog@1.1785 +1 -0 + CID 1341678: Nits in sntp/tests/keyFile.c. HStenn. + + sntp/tests/keyFile.c@1.11 +5 -1 + CID 1341678: Nits in sntp/tests/keyFile.c. HStenn. + +ChangeSet@1.3613, 2015-12-05 10:31:39+00:00, stenn@psp-at1.ntp.org + CID 1341679: Nits in sntp/tests/keyFile.c. HStenn. + + ChangeLog@1.1784 +1 -0 + CID 1341679: Nits in sntp/tests/keyFile.c. HStenn. + + sntp/tests/keyFile.c@1.10 +4 -2 + CID 1341679: Nits in sntp/tests/keyFile.c. HStenn. + +ChangeSet@1.3612, 2015-12-05 10:27:40+00:00, stenn@psp-at1.ntp.org + CID 1341680: Nits in sntp/tests/keyFile.c. HStenn. + + ChangeLog@1.1783 +1 -0 + CID 1341680: Nits in sntp/tests/keyFile.c. HStenn. + + sntp/tests/keyFile.c@1.9 +4 -2 + CID 1341680: Nits in sntp/tests/keyFile.c. HStenn. + +ChangeSet@1.3611, 2015-12-05 10:21:07+00:00, stenn@psp-at1.ntp.org + CID 1341681: Nits in sntp/tests/keyFile.c. HStenn. + + ChangeLog@1.1782 +1 -0 + CID 1341681: Nits in sntp/tests/keyFile.c. HStenn. + +ChangeSet@1.3610, 2015-12-05 10:18:23+00:00, stenn@psp-at1.ntp.org + sntp/tests/keyFile.c lint + + sntp/tests/keyFile.c@1.8 +4 -2 + sntp/tests/keyFile.c lint + +ChangeSet@1.3609, 2015-12-05 10:01:47+00:00, stenn@psp-at1.ntp.org + CID 1341682: Nit in libntp/authreadkeys.c. HStenn. + + ChangeLog@1.1781 +1 -0 + CID 1341682: Nit in libntp/authreadkeys.c. HStenn. + + libntp/authreadkeys.c@1.24 +3 -4 + CID 1341682: Nit in libntp/authreadkeys.c. HStenn. + +ChangeSet@1.3608, 2015-12-05 09:40:44+00:00, stenn@psp-at1.ntp.org + CID 1341684: Nit in tests/ntpd/t-ntp_signd.c. HStenn. + + ChangeLog@1.1780 +1 -0 + CID 1341684: Nit in tests/ntpd/t-ntp_signd.c. HStenn. + + tests/ntpd/t-ntp_signd.c@1.15 +4 -0 + CID 1341684: Nit in tests/ntpd/t-ntp_signd.c. HStenn. + +ChangeSet@1.3607, 2015-12-03 12:07:30+00:00, stenn@psp-at1.ntp.org + Update some test runners + + tests/libntp/run-sfptostr.c@1.7 +9 -8 + update + + tests/sandbox/run-uglydate.c@1.7 +2 -1 + update + +ChangeSet@1.3606, 2015-12-03 03:28:15-08:00, cov-build@cov7.ntfo.org + Header cleanup in tests/libntp/sfptostr.c. Harlan Stenn. + + ChangeLog@1.1779 +1 -0 + Header cleanup in tests/libntp/sfptostr.c. Harlan Stenn. + + tests/libntp/sfptostr.c@1.5 +1 -0 + Header cleanup in tests/libntp/sfptostr.c. Harlan Stenn. + +ChangeSet@1.3605, 2015-12-03 03:26:50-08:00, cov-build@cov7.ntfo.org + Header cleanup in tests/sandbox/uglydate.c. Harlan Stenn. + + ChangeLog@1.1778 +1 -0 + Header cleanup in tests/sandbox/uglydate.c. Harlan Stenn. + + tests/sandbox/uglydate.c@1.6 +2 -1 + Header cleanup in tests/sandbox/uglydate.c. Harlan Stenn. + +ChangeSet@1.3604, 2015-12-03 02:16:02-08:00, cov-build@cov7.ntfo.org + CID 1341527: Quiet a CHECKED_RETURN in sntp/tests/t-log.c. HStenn. + + ChangeLog@1.1777 +1 -0 + CID 1341527: Quiet a CHECKED_RETURN in sntp/tests/t-log.c. HStenn. + + sntp/tests/t-log.c@1.7 +1 -1 + CID 1341527: Quiet a CHECKED_RETURN in sntp/tests/t-log.c. HStenn. + +ChangeSet@1.3603, 2015-12-03 02:00:58-08:00, cov-build@cov7.ntfo.org + CID 1341533: Missing assertion in sntp/tests/t-log.c. HStenn. + + ChangeLog@1.1776 +1 -0 + CID 1341533: Missing assertion in sntp/tests/t-log.c. HStenn. + + sntp/tests/t-log.c@1.6 +2 -0 + CID 1341533: Missing assertion in sntp/tests/t-log.c. HStenn. + +ChangeSet@1.3602, 2015-12-03 01:50:11-08:00, cov-build@cov7.ntfo.org + CID 134534-134537: Resource leaks in tests/ntpd/t-ntp_signd.c. HStenn. + + ChangeLog@1.1775 +4 -0 + CID 134534-134537: Resource leaks in tests/ntpd/t-ntp_signd.c. HStenn. + + tests/ntpd/t-ntp_signd.c@1.14 +9 -0 + CID 134534-134537: Resource leaks in tests/ntpd/t-ntp_signd.c. HStenn. + +ChangeSet@1.3601, 2015-12-03 01:22:22-08:00, cov-build@cov7.ntfo.org + CID 1341538: Memory leak in tests/ntpd/ntp_prio_q.c:262. HStenn. + + ChangeLog@1.1774 +1 -0 + CID 1341538: Memory leak in tests/ntpd/ntp_prio_q.c:262. HStenn. + + tests/ntpd/ntp_prio_q.c@1.3 +1 -0 + CID 1341538: Memory leak in tests/ntpd/ntp_prio_q.c:262. HStenn. + +ChangeSet@1.3597.4.1, 2015-11-30 06:03:47+01:00, jnperlin@hydra.localnet + [Bug 2829] Look at pipe_fds in ntpd.c (initial value issue) + + ChangeLog@1.1770.4.1 +1 -0 + [Bug 2829] Look at pipe_fds in ntpd.c + + ntpd/ntpd.c@1.167 +3 -0 + [Bug 2829] Look at pipe_fds in ntpd.c (initial value issue) + +ChangeSet@1.3597.3.1, 2015-11-29 13:03:58+01:00, jnperlin@hydra.localnet + [Bug 2887] stratum -1 config results as showing value 99 + - fudge stratum only accepts values [0..16]. + + ChangeLog@1.1770.3.1 +2 -0 + [Bug 2887] stratum -1 config results as showing value 99 + - fudge stratum only accepts values [0..16]. + + ntpd/ntp_parser.c@1.100 +178 -171 + [Bug 2887] stratum -1 config results as showing value 99 + - fudge stratum only accepts values [0..16]. (file regenerated by bison & trimmed manually) + + ntpd/ntp_parser.y@1.90 +8 -1 + [Bug 2887] stratum -1 config results as showing value 99 + - fudge stratum only accepts values [0..16], gives error otherwise + +ChangeSet@1.3597.2.1, 2015-11-28 22:59:39+01:00, jnperlin@hydra.localnet + [Bug 2944] errno is not preserved properly in ntpdate after sendto call. + - applied patch by Christos Zoulas. + + ChangeLog@1.1770.2.1 +2 -0 + [Bug 2944] errno is not preserved properly in ntpdate after sendto call. + - applied patch by Christos Zoulas. + + libntp/socktohost.c@1.16 +10 -2 + [Bug 2944] errno is not preserved properly in ntpdate after sendto call. + - save errno around calls to getnameinfo/getaddrinfo (patch by Christos Zoulas) + +ChangeSet@1.3597.1.4, 2015-11-28 19:09:53+01:00, jnperlin@hydra.localnet + Bug 2971 - ntpq bails on ^C: select fails: Interrupted system call + - changed stacked/nested handling of CTRL-C. + + ChangeLog@1.1770.1.2 +2 -0 + Bug 2971 - ntpq bails on ^C: select fails: Interrupted system call + - changed stacked/nested handling of CTRL-C. + + ntpq/ntpq-subs.c@1.114 +11 -8 + Bug 2971 - ntpq bails on ^C: select fails: Interrupted system call + - changed stacked/nested handling of CTRL-C. + + ntpq/ntpq.c@1.165 +57 -8 + Bug 2971 - ntpq bails on ^C: select fails: Interrupted system call + - changed stacked/nested handling of CTRL-C. + + ntpq/ntpq.h@1.31 +4 -0 + Bug 2971 - ntpq bails on ^C: select fails: Interrupted system call + - changed stacked/nested handling of CTRL-C. + +ChangeSet@1.3597.1.3, 2015-11-25 22:10:45-08:00, harlan@max.pfcs.com + Libevent autoconf pthread fixes for FreeBSD-10. Harlan Stenn. + + ChangeLog@1.1770.1.1 +1 -0 + Libevent autoconf pthread fixes for FreeBSD-10. Harlan Stenn. + + sntp/m4/ntp_libevent.m4@1.16 +2 -1 + Libevent autoconf pthread fixes for FreeBSD-10. Harlan Stenn. + +ChangeSet@1.3597.1.2, 2015-11-25 12:23:40+00:00, stenn@psp-at1.ntp.org + Unity test cleanup. Harlan Stenn. + + tests/ntpd/run-t-ntp_signd.c@1.11 +6 -6 + Unity test cleanup. Harlan Stenn. + + tests/ntpd/t-ntp_signd.c@1.13 +19 -5 + Unity test cleanup. Harlan Stenn. + +ChangeSet@1.3597.1.1, 2015-11-25 11:50:51+00:00, stenn@psp-at1.ntp.org + Unity test cleanup. Harlan Stenn. + + sntp/unity/unity_internals.h@1.5 +13 -1 + Unity test cleanup. Harlan Stenn. + + tests/libntp/calendar.c@1.12 +8 -3 + Unity test cleanup. Harlan Stenn. + + tests/ntpd/leapsec.c@1.4 +241 -82 + Unity test cleanup. Harlan Stenn. + + tests/ntpd/run-leapsec.c@1.6 +33 -33 + Unity test cleanup. Harlan Stenn. + + tests/ntpd/run-t-ntp_signd.c@1.10 +6 -6 + Unity test cleanup. Harlan Stenn. + + tests/ntpd/t-ntp_signd.c@1.12 +40 -13 + Unity test cleanup. Harlan Stenn. + + tests/sandbox/smeartest.c@1.10 +3 -0 + Unity test cleanup. Harlan Stenn. + +ChangeSet@1.3598, 2015-11-24 08:06:41+01:00, jnperlin@hydra.localnet + [Bug 2967] ntpdate command suffers an assertion failure + - fixed ntp_rfc2553.c to return proper address length. + + ChangeLog@1.1771 +2 -0 + [Bug 2967] ntpdate command suffers an assertion failure + - fixed ntp_rfc2553.c to return proper address length. + + libntp/ntp_rfc2553.c@1.49 +2 -1 + [Bug 2967] ntpdate command suffers an assertion failure + - fix do_nodename() to return the proper address length when name is NULL. + +ChangeSet@1.3597, 2015-11-23 10:55:16+00:00, stenn@psp-at1.ntp.org + ChangeLog, caljulian.c: + * CID 1339955: Free allocated memory in caljulian test. HStenn. + * CID 1339962: Explicitly initialize variable in caljulian test. HStenn. + + ChangeLog@1.1770 +2 -0 + * CID 1339955: Free allocated memory in caljulian test. HStenn. + * CID 1339962: Explicitly initialize variable in caljulian test. HStenn. + + tests/libntp/caljulian.c@1.14 +16 -10 + * CID 1339955: Free allocated memory in caljulian test. HStenn. + * CID 1339962: Explicitly initialize variable in caljulian test. HStenn. + +ChangeSet@1.3596, 2015-11-20 20:16:24-08:00, harlan@hms-mbp11.pfcs.com + Unity test cleanup. Harlan Stenn. + + sntp/tests/kodDatabase.c@1.9 +0 -4 + Unity test cleanup. Harlan Stenn. + + sntp/tests/run-kodDatabase.c@1.9 +5 -5 + Unity test cleanup. Harlan Stenn. + +ChangeSet@1.3595, 2015-11-20 19:41:16-08:00, harlan@hms-mbp11.pfcs.com + Unity test cleanup. Harlan Stenn. + + sntp/tests/kodDatabase.c@1.8 +6 -0 + Unity test cleanup. Harlan Stenn. + + sntp/tests/kodFile.c@1.9 +1 -0 + Unity test cleanup. Harlan Stenn. + + sntp/tests/run-kodDatabase.c@1.8 +6 -5 + Unity test cleanup. Harlan Stenn. + + sntp/tests/run-t-log.c@1.5 +3 -3 + Unity test cleanup. Harlan Stenn. + + sntp/tests/t-log.c@1.5 +32 -16 + Unity test cleanup. Harlan Stenn. + + tests/libntp/calendar.c@1.11 +11 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/caljulian.c@1.13 +1 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/decodenetnum.c@1.10 +10 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/humandate.c@1.7 +10 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/lfptostr.c@1.8 +9 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/modetoa.c@1.8 +10 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/msyslog.c@1.7 +10 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/netof.c@1.9 +10 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/numtoa.c@1.7 +11 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/numtohost.c@1.7 +11 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/prettydate.c@1.6 +10 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/recvbuff.c@1.7 +3 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/refidsmear.c@1.7 +10 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/refnumtoa.c@1.7 +10 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-calendar.c@1.11 +15 -15 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-decodenetnum.c@1.10 +6 -6 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-humandate.c@1.7 +2 -2 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-lfptostr.c@1.8 +11 -11 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-modetoa.c@1.12 +2 -2 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-msyslog.c@1.9 +8 -8 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-netof.c@1.8 +4 -4 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-numtoa.c@1.11 +2 -2 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-numtohost.c@1.11 +1 -1 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-prettydate.c@1.6 +1 -1 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-refidsmear.c@1.8 +1 -1 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-refnumtoa.c@1.9 +2 -2 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-sfptostr.c@1.6 +8 -8 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-socktoa.c@1.13 +6 -6 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-statestr.c@1.11 +4 -4 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-strtolfp.c@1.6 +7 -7 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-timespecops.c@1.11 +28 -28 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-timevalops.c@1.13 +28 -28 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-uglydate.c@1.11 +1 -1 + Unity test cleanup. Harlan Stenn. + + tests/libntp/sfptostr.c@1.4 +10 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/socktoa.c@1.11 +11 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/statestr.c@1.6 +11 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/strtolfp.c@1.7 +10 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/timespecops.c@1.10 +10 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/timevalops.c@1.13 +10 -0 + Unity test cleanup. Harlan Stenn. + + tests/libntp/uglydate.c@1.10 +13 -1 + Unity test cleanup. Harlan Stenn. + + tests/sandbox/run-uglydate.c@1.6 +1 -1 + Unity test cleanup. Harlan Stenn. + + tests/sandbox/smeartest.c@1.9 +2 -0 + Unity test cleanup. Harlan Stenn. + + tests/sandbox/uglydate.c@1.5 +11 -0 + Unity test cleanup. Harlan Stenn. + +ChangeSet@1.3594, 2015-11-20 07:40:57+00:00, stenn@psp-at1.ntp.org + [Bug 2958] ntpq: fatal error messages need a final newline. Craig Leres. + + ChangeLog@1.1769 +1 -0 + [Bug 2958] ntpq: fatal error messages need a final newline. Craig Leres. + + ntpq/ntpq.c@1.164 +1 -1 + [Bug 2958] ntpq: fatal error messages need a final newline. Craig Leres. + +ChangeSet@1.3593, 2015-11-20 07:27:27+00:00, stenn@psp-at1.ntp.org + Unity test cleanup. Harlan Stenn. + + tests/libntp/authkeys.c@1.13 +36 -10 + Unity test cleanup. Harlan Stenn. + + tests/libntp/buftvtots.c@1.6 +18 -6 + Unity test cleanup. Harlan Stenn. + + tests/libntp/calendar.c@1.10 +100 -47 + Unity test cleanup. Harlan Stenn. + + tests/libntp/caljulian.c@1.12 +27 -9 + Unity test cleanup. Harlan Stenn. + + tests/libntp/clocktime.c@1.9 +48 -24 + Unity test cleanup. Harlan Stenn. + + tests/libntp/humandate.c@1.6 +6 -2 + Unity test cleanup. Harlan Stenn. + + tests/libntp/lfpfunc.c@1.15 +113 -69 + Unity test cleanup. Harlan Stenn. + + tests/libntp/netof.c@1.8 +22 -7 + Unity test cleanup. Harlan Stenn. + + tests/libntp/numtohost.c@1.6 +1 -1 + Unity test cleanup. Harlan Stenn. + + tests/libntp/octtoint.c@1.7 +36 -14 + Unity test cleanup. Harlan Stenn. + + tests/libntp/refidsmear.c@1.6 +1 -4 + Unity test cleanup. Harlan Stenn. + + tests/libntp/refnumtoa.c@1.6 +5 -5 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-lfpfunc.c@1.18 +9 -9 + Unity test cleanup. Harlan Stenn. + + tests/libntp/run-refidsmear.c@1.7 +1 -1 + Unity test cleanup. Harlan Stenn. + + tests/libntp/timespecops.c@1.9 +173 -48 + Unity test cleanup. Harlan Stenn. + + tests/libntp/timestructs.h@1.3 +22 -22 + Unity test cleanup. Harlan Stenn. + + tests/libntp/timevalops.c@1.12 +168 -52 + Unity test cleanup. Harlan Stenn. + +ChangeSet@1.3592, 2015-11-20 02:57:37+01:00, jnperlin@nemesis.localnet + [Bug 2969] Seg fault from ntpq/mrulist when looking at server with lots of clients + + ChangeLog@1.1768 +2 -0 + [Bug 2969] Seg fault from ntpq/mrulist when looking at server with lots of clients + + lib/isc/sockaddr.c@1.14 +1 -1 + [Bug 2969] Seg fault from ntpq/mrulist when looking at server with lots of clients + - cast fro size_t to u_int (no overflow danger); not related the bug, found while double-checking changes + + ntpq/ntpq-subs.c@1.113 +1 -1 + [Bug 2969] Seg fault from ntpq/mrulist when looking at server with lots of clients + - make end-of-buffer test unsigned-safe + +ChangeSet@1.3591, 2015-11-17 11:12:02+00:00, stenn@psp-at1.ntp.org + [Bug 2932] Update leapsecond file info in miscopt.html. CWoodbury, HStenn. + + ChangeLog@1.1767 +1 -0 + [Bug 2932] Update leapsecond file info in miscopt.html. CWoodbury, HStenn. + + html/miscopt.html@1.84 +3 -3 + [Bug 2932] Update leapsecond file info in miscopt.html. CWoodbury, HStenn. + +ChangeSet@1.3588, 2015-11-17 05:02:10+00:00, stenn@psp-at1.ntp.org + Credit Martin for 2965 + + ChangeLog@1.1764.1.3 +1 -1 + Credit Martin for 2965 + +ChangeSet@1.3587, 2015-11-17 04:53:39+00:00, stenn@psp-at1.ntp.org + cleanup + + ChangeLog@1.1764.1.2 +1 -1 + cleanup + +ChangeSet@1.3584.2.1, 2015-11-16 11:59:55+01:00, burnicki@pc-martin4. + [Bug 2965] Local clock didn't work since 4.2.8p4 + + ChangeLog@1.1764.1.1 +1 -0 + [Bug 2965] Local clock didn't work since 4.2.8p4 + + ntpd/refclock_local.c@1.22 +1 -0 + [Bug 2965] Local clock didn't work since 4.2.8p4 + +ChangeSet@1.3584.1.2, 2015-11-14 01:01:05+01:00, jnperlin@hydra.localnet + [Bug 2962] truncation of size_t/ptrdiff_t on 64bit targets + - fix warnings in test cases + + tests/libntp/a_md5encrypt.c@1.14 +23 -15 + [Bug 2962] truncation of size_t/ptrdiff_t on 64bit targets + - fix terrible const/noconst and alignment mess + + tests/libntp/authkeys.c@1.12 +1 -1 + [Bug 2962] truncation of size_t/ptrdiff_t on 64bit targets + - fixed cast to const cast + + tests/libntp/run-a_md5encrypt.c@1.15 +5 -5 + [Bug 2962] truncation of size_t/ptrdiff_t on 64bit targets + - update generated file + + tests/ntpd/rc_cmdlength.c@1.3 +1 -0 + [Bug 2962] truncation of size_t/ptrdiff_t on 64bit targets + - add header to get prototype + + tests/ntpd/run-rc_cmdlength.c@1.4 +2 -1 + [Bug 2962] truncation of size_t/ptrdiff_t on 64bit targets + +ChangeSet@1.3584.1.1, 2015-11-13 22:54:35+01:00, jnperlin@hydra.localnet + [Bug 2962] truncation of size_t/ptrdiff_t on 64bit targets + - fixed several other warnings (cast-alignment, missing const, missing prorotypes) + - promote use of 'size_t' for values that express a size + - use ptr-to-const for read-only arguments + - make sure SOCKET values are not truncated (win32-specific) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Jan 8 16:01:35 2016 Return-Path: Delivered-To: svn-src-head@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 2CB41A67BDF; Fri, 8 Jan 2016 16:01:35 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail-out.smeets.xyz (mail-out.smeets.xyz [IPv6:2a01:4f8:160:918a::25:11]) (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 B7FEC1C20; Fri, 8 Jan 2016 16:01:34 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail.smeets.xyz (mail.smeets.xyz [IPv6:2a01:4f8:160:918a::25:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-out.smeets.xyz (Postfix) with ESMTPS id D98E3108E; Fri, 8 Jan 2016 17:01:29 +0100 (CET) Received: from amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:160:918a::aa:4]) by mail.smeets.xyz (Postfix) with ESMTP id 2F07D9CC20; Fri, 8 Jan 2016 17:01:30 +0100 (CET) Authentication-Results: mail.smeets.xyz; dkim=pass (1024-bit key; unprotected) header.d=smeets.xyz header.i=@smeets.xyz header.b=UjrkuTyn X-Virus-Scanned: amavisd-new at smeets.xyz Received: from mail.smeets.xyz ([IPv6:2a01:4f8:160:918a::25:3]) by amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:160:918a::aa:4]) (amavisd-new, port 10025) with ESMTP id fz8SFxRaUJ26; Fri, 8 Jan 2016 17:01:29 +0100 (CET) Received: from nibbler-wlan.home.lan (unknown [IPv6:2001:4dd0:fd65:d00d:144d:1bcd:817c:6547]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.smeets.xyz (Postfix) with ESMTPSA id 8DAD89CC1D; Fri, 8 Jan 2016 17:01:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=smeets.xyz; s=default; t=1452268889; bh=CvxwHkpT/vU9p6TpPFKBGdgBFGwCo0g+B4JbcyOTOtU=; h=Subject:To:References:From:Date:In-Reply-To; b=UjrkuTynXeQBiRLa5K4ioK0N46/mrRtZJT2OVOmtQpeTNg56Q+8LITjPFNZ6M9tAw LYtBiepDRbVQ6y3qboLHJhm/gO7RKy1S3JWQ/c6tUIf0iUSLmZrpUeKBda0bzvvJQG eMFR8rvb4/bXafYdnqoQd9mGZtTBIJ+7eBIbdzNo= Subject: Re: svn commit: r293414 - in head/sys/boot: i386/loader userboot/userboot To: Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601080509.u0859uSh096968@repo.freebsd.org> <568FA359.8010705@smeets.xyz> <568FD5EA.5070805@freebsd.org> From: Florian Smeets X-Enigmail-Draft-Status: N1110 Message-ID: <568FDD4D.8040103@smeets.xyz> Date: Fri, 8 Jan 2016 17:01:17 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:43.0) Gecko/20100101 Thunderbird/43.0 MIME-Version: 1.0 In-Reply-To: <568FD5EA.5070805@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QiuvhtgejjN4VSL3XpalqSd0a2ANwwR3D" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 16:01:35 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QiuvhtgejjN4VSL3XpalqSd0a2ANwwR3D Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 08.01.16 16:29, Allan Jude wrote: >> >> this commit causes bhyveload to segfault for me. After reverting this >> commit and reinstalling userboot.so I can successfully start byhve VMs= >> again. >> >> My bhyves use a zvol as backingstore, this is how I start them >> >> /usr/share/examples/bhyve/vmrun.sh -d /dev/zvol/zroot/bhyve/xxx -t tap= 0 >> -c 1 xxx >> >=20 > I am not seeing this crash on my system. Do you have any other > information? Like a backtrace or something? >=20 Yes, sure. (gdb) where #0 0x00000009c1c35f10 in strrchr () from /boot/userboot.so #1 0x00000009c1c0e8ec in loader_main (cb=3D, arg=3D, version=3D, ndisks=3D) at /usr/src/sys/boot/userboot/userboot/main.c:219 #2 0x0000000000401c09 in main (argc=3D, argv=3D) at /usr/src/usr.sbin/bhyveload/bhyveload.c:768 FWIW, the VMs use UFS for boot/root, maybe the disk layout will help you?= # gpart show =3D> 40 83886000 vtbd0 GPT (40G) 40 128 1 freebsd-boot (64K) 168 81788720 2 freebsd-ufs (39G) 81788888 2097152 - free - (1.0G) HTH, Florian --QiuvhtgejjN4VSL3XpalqSd0a2ANwwR3D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQJ8BAEBCgBmBQJWj91SXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNzAxMDMyMDNCQ0FCNDRBOThGRUM4NDRF NzA1M0RGOUZGODZGMDc2AAoJEOcFPfn/hvB2b4wP/0NNYezDqOtENq1oUmI/nXxj oXvd8/ANnZsz2o+UJfGhVqAkHJKP05f6MIRj+ESlDGf2JGtfsNF3Us40Ze76PlkC 6qEPjWysHSQzJMFtXkozkEdzeRodHuo3beiUWJbWaErGnov6LeOaBZu8QKkY97s/ hfcLuHacZxJGLhGdIy3Qwq28K5bulj5d72Tnoyw8Zh3WSbgLa6HBuDNmREhREyWi ztVf4cbv57egu0pUxZ8aWy5ikBoPdSuAHBNMy5Qkbj/W4rwE93Tz6qObp8eL/k3U m6wWN9X5rpf+vkXIaYQumaB0pwx0sSbNfF5DvR5MiKVnbZBR4DkyGcjIxGtcAVbx 9gaste1WZhGCXKoqkoZhxVc87GbrVhLJF7NPDTQSHB9kXM8CvW7FVUr5jQvGF/xx Wczsg+4ChpVUtjEi/WC8Cz3QhqBhxH/RPd5nGpW+2Z3u99ss4P7MBH06SDdWwwyl El6NTgtbmcNgWvi0dALO5wIRcT1DQU67ov8kOzy8bq5Yu6GiKzVW7D4uayQWWTQT JQ53VaB3GZGJr8rMgW47lqOtpjAmWWXAm8M+A8SDdF5onrUGDgV0EVDc3yOde9W9 XbDvbo38A0f6jhFD57gjECnqVqRyHPwDtjGB80Z2m/HseHnjzVtEokm0+Oyt7K74 r3R/i5/H58GhYvdmf7Uf =MLri -----END PGP SIGNATURE----- --QiuvhtgejjN4VSL3XpalqSd0a2ANwwR3D-- From owner-svn-src-head@freebsd.org Fri Jan 8 16:25:12 2016 Return-Path: Delivered-To: svn-src-head@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 DA21BA68364; Fri, 8 Jan 2016 16:25:12 +0000 (UTC) (envelope-from melifaro@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 9A2AF179A; Fri, 8 Jan 2016 16:25:12 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u08GPBYr099151; Fri, 8 Jan 2016 16:25:11 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08GPBgY099150; Fri, 8 Jan 2016 16:25:11 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601081625.u08GPBgY099150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Fri, 8 Jan 2016 16:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293424 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 16:25:12 -0000 Author: melifaro Date: Fri Jan 8 16:25:11 2016 New Revision: 293424 URL: https://svnweb.freebsd.org/changeset/base/293424 Log: Do more fine-grained locking in rtrequest1_fib(). Last consumer using RTF_RNH_LOCKED flag was eliminated in r291643. Restrict passing RTF_RNH_LOCKED to rtrequest1_fib() and do better locking for RTM_ADD / RTM_DELETE cases. Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Fri Jan 8 15:53:48 2016 (r293423) +++ head/sys/net/route.c Fri Jan 8 16:25:11 2016 (r293424) @@ -754,7 +754,7 @@ ifa_ifwithroute(int flags, const struct if (ifa == NULL) ifa = ifa_ifwithnet(gateway, 0, fibnum); if (ifa == NULL) { - struct rtentry *rt = rtalloc1_fib(gateway, 0, RTF_RNH_LOCKED, fibnum); + struct rtentry *rt = rtalloc1_fib(gateway, 0, 0, fibnum); if (rt == NULL) return (NULL); /* @@ -1575,7 +1575,7 @@ int rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, u_int fibnum) { - int error = 0, needlock = 0; + int error = 0; struct rtentry *rt, *rt_old; #ifdef FLOWTABLE struct rtentry *rt0; @@ -1585,9 +1585,9 @@ rtrequest1_fib(int req, struct rt_addrin struct ifaddr *ifa; struct sockaddr *ndst; struct sockaddr_storage mdst; -#define senderr(x) { error = x ; goto bad; } KASSERT((fibnum < rt_numfibs), ("rtrequest1_fib: bad fibnum")); + KASSERT((flags & RTF_RNH_LOCKED) == 0, ("rtrequest1_fib: locked")); switch (dst->sa_family) { case AF_INET6: case AF_INET: @@ -1604,12 +1604,7 @@ rtrequest1_fib(int req, struct rt_addrin rnh = rt_tables_get_rnh(fibnum, dst->sa_family); if (rnh == NULL) return (EAFNOSUPPORT); - needlock = ((flags & RTF_RNH_LOCKED) == 0); - flags &= ~RTF_RNH_LOCKED; - if (needlock) - RADIX_NODE_HEAD_LOCK(rnh); - else - RADIX_NODE_HEAD_LOCK_ASSERT(rnh); + /* * If we are adding a host route then we don't want to put * a netmask in the tree, nor do we want to clone it. @@ -1624,9 +1619,11 @@ rtrequest1_fib(int req, struct rt_addrin dst = (struct sockaddr *)&mdst; } + RADIX_NODE_HEAD_LOCK(rnh); rt = rt_unlinkrte(rnh, info, &error); + RADIX_NODE_HEAD_UNLOCK(rnh); if (error != 0) - goto bad; + return (error); rt_notifydelete(rt, info); @@ -1649,33 +1646,32 @@ rtrequest1_fib(int req, struct rt_addrin break; case RTM_ADD: if ((flags & RTF_GATEWAY) && !gateway) - senderr(EINVAL); + return (EINVAL); if (dst && gateway && (dst->sa_family != gateway->sa_family) && (gateway->sa_family != AF_UNSPEC) && (gateway->sa_family != AF_LINK)) - senderr(EINVAL); + return (EINVAL); if (info->rti_ifa == NULL) { error = rt_getifa_fib(info, fibnum); if (error) - senderr(error); + return (error); } else ifa_ref(info->rti_ifa); ifa = info->rti_ifa; rt = uma_zalloc(V_rtzone, M_NOWAIT); if (rt == NULL) { ifa_free(ifa); - senderr(ENOBUFS); + return (ENOBUFS); } rt->rt_flags = RTF_UP | flags; rt->rt_fibnum = fibnum; /* * Add the gateway. Possibly re-malloc-ing the storage for it. */ - RT_LOCK(rt); if ((error = rt_setgate(rt, dst, gateway)) != 0) { ifa_free(ifa); uma_zfree(V_rtzone, rt); - senderr(error); + return (error); } /* @@ -1702,14 +1698,18 @@ rtrequest1_fib(int req, struct rt_addrin rt_setmetrics(info, rt); + RADIX_NODE_HEAD_LOCK(rnh); + RT_LOCK(rt); #ifdef RADIX_MPATH /* do not permit exactly the same dst/mask/gw pair */ if (rn_mpath_capable(rnh) && rt_mpath_conflict(rnh, rt, netmask)) { + RADIX_NODE_HEAD_UNLOCK(rnh); + ifa_free(rt->rt_ifa); R_Free(rt_key(rt)); uma_zfree(V_rtzone, rt); - senderr(EEXIST); + return (EEXIST); } #endif @@ -1738,6 +1738,7 @@ rtrequest1_fib(int req, struct rt_addrin rn = rnh->rnh_addaddr(ndst, netmask, rnh, rt->rt_nodes); } + RADIX_NODE_HEAD_UNLOCK(rnh); if (rt_old != NULL) RT_UNLOCK(rt_old); @@ -1754,7 +1755,7 @@ rtrequest1_fib(int req, struct rt_addrin if (rt0 != NULL) RTFREE(rt0); #endif - senderr(EEXIST); + return (EEXIST); } #ifdef FLOWTABLE else if (rt0 != NULL) { @@ -1786,16 +1787,15 @@ rtrequest1_fib(int req, struct rt_addrin RT_UNLOCK(rt); break; case RTM_CHANGE: + RADIX_NODE_HEAD_LOCK(rnh); error = rtrequest1_fib_change(rnh, info, ret_nrt, fibnum); + RADIX_NODE_HEAD_UNLOCK(rnh); break; default: error = EOPNOTSUPP; } -bad: - if (needlock) - RADIX_NODE_HEAD_UNLOCK(rnh); + return (error); -#undef senderr } #undef dst @@ -1945,15 +1945,7 @@ rt_setgate(struct rtentry *rt, struct so { /* XXX dst may be overwritten, can we move this to below */ int dlen = SA_SIZE(dst), glen = SA_SIZE(gate); -#ifdef INVARIANTS - struct radix_node_head *rnh; - rnh = rt_tables_get_rnh(rt->rt_fibnum, dst->sa_family); -#endif - - RT_LOCK_ASSERT(rt); - RADIX_NODE_HEAD_LOCK_ASSERT(rnh); - /* * Prepare to store the gateway in rt->rt_gateway. * Both dst and gateway are stored one after the other in the same From owner-svn-src-head@freebsd.org Fri Jan 8 16:37:24 2016 Return-Path: Delivered-To: svn-src-head@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 54A2DA687A1; Fri, 8 Jan 2016 16:37:24 +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 088981EA7; Fri, 8 Jan 2016 16:37:23 +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 u08GbNse002550; Fri, 8 Jan 2016 16:37:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08GbM7S002548; Fri, 8 Jan 2016 16:37:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601081637.u08GbM7S002548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 8 Jan 2016 16:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293425 - head/sys/boot/efi/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 16:37:24 -0000 Author: emaste Date: Fri Jan 8 16:37:22 2016 New Revision: 293425 URL: https://svnweb.freebsd.org/changeset/base/293425 Log: Add safety belt for boot1.efi file size Reviewed by: smh Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4833 Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/boot1/generate-fat.sh Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Fri Jan 8 16:25:11 2016 (r293424) +++ head/sys/boot/efi/boot1/Makefile Fri Jan 8 16:37:22 2016 (r293425) @@ -79,8 +79,15 @@ boot1.o: ${.CURDIR}/../../common/ufsread # created by generate-fat.sh .include "${.CURDIR}/Makefile.fat" +BOOT1_MAXSIZE?= 131072 boot1.efifat: boot1.efi + @set -- `ls -l boot1.efi`; \ + x=$$(($$5-${BOOT1_MAXSIZE})); \ + if [ $$x -ge 0 ]; then \ + echo "boot1 $$x bytes too large; regenerate FAT templates?" >&2 ;\ + exit 1; \ + fi echo ${.OBJDIR} uudecode ${.CURDIR}/fat-${MACHINE}.tmpl.bz2.uu mv fat-${MACHINE}.tmpl.bz2 ${.TARGET}.bz2 Modified: head/sys/boot/efi/boot1/generate-fat.sh ============================================================================== --- head/sys/boot/efi/boot1/generate-fat.sh Fri Jan 8 16:25:11 2016 (r293424) +++ head/sys/boot/efi/boot1/generate-fat.sh Fri Jan 8 16:37:22 2016 (r293425) @@ -55,9 +55,20 @@ BOOT1_OFFSET=$(hd $OUTPUT_FILE | grep 'B # Convert to number of blocks BOOT1_OFFSET=$(echo 0x$BOOT1_OFFSET | awk '{printf("%x\n",$1/512);}') +# Record maximum boot1 size in bytes +case $BOOT1_SIZE in +*k) + BOOT1_MAXSIZE=$(expr ${BOOT1_SIZE%k} '*' 1024) + ;; +*) + BOOT1_MAXSIZE=$BOOT1_SIZE + ;; +esac + echo '# This file autogenerated by generate-fat.sh - DO NOT EDIT' > Makefile.fat echo '# $FreeBSD$' >> Makefile.fat echo "BOOT1_OFFSET=0x$BOOT1_OFFSET" >> Makefile.fat +echo "BOOT1_MAXSIZE=$BOOT1_MAXSIZE" >> Makefile.fat bzip2 $OUTPUT_FILE echo 'FAT template boot filesystem created by generate-fat.sh' > $OUTPUT_FILE.bz2.uu From owner-svn-src-head@freebsd.org Fri Jan 8 16:56:00 2016 Return-Path: Delivered-To: svn-src-head@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 8F901A68CB2; Fri, 8 Jan 2016 16:56:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (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 5E1151C59; Fri, 8 Jan 2016 16:56:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22b.google.com with SMTP id g73so94476863ioe.3; Fri, 08 Jan 2016 08:56:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=55AyKWDrVyiq2Zn4vSYDxktH24QXHGh9RWqKL9YWy9E=; b=iYh3L+WgEaBHmsLuzbrci6nVom19647aaazuOj7uX4wFQ+r0LFGRxDDII6Z6WOP47V 47PmNHFw50Ge+fW18AKZy8ANi4/98tnpdaJ6TKTyOZhgCYCwUmKVX1x08Or+kawAaSE3 Bbw1L3uAfWpYU95zpKO+P58dY0NX3dB9TYXD1NpBktiTs06YaBpj7dgnR8vf4C7YPAR4 oKefLyAFLaTjFQhGRSdLogc/Xe0WogSuyjH06Ue1e0g8gQtP7iIGAntseu0rxe13Re3+ 1eCBmVyn07WRlvyHZ7Md4TIePKCREG/Ty7J7rjGI4saCaEt9mKPZBGZzAsNBa8P0c0sg zJBw== MIME-Version: 1.0 X-Received: by 10.107.11.162 with SMTP id 34mr98018157iol.165.1452272159860; Fri, 08 Jan 2016 08:55:59 -0800 (PST) Received: by 10.36.121.202 with HTTP; Fri, 8 Jan 2016 08:55:59 -0800 (PST) In-Reply-To: <201601080116.u081G4Uj025386@repo.freebsd.org> References: <201601080116.u081G4Uj025386@repo.freebsd.org> Date: Fri, 8 Jan 2016 08:55:59 -0800 Message-ID: Subject: Re: svn commit: r293405 - head/sys/kern From: Adrian Chadd To: Gleb Smirnoff Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 16:56:00 -0000 there's been reported panics with this :( -a On 7 January 2016 at 17:16, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Jan 8 01:16:03 2016 > New Revision: 293405 > URL: https://svnweb.freebsd.org/changeset/base/293405 > > Log: > For SOCK_STREAM socket use sbappendstream() instead of sbappend(). > > Modified: > head/sys/kern/uipc_usrreq.c > > Modified: head/sys/kern/uipc_usrreq.c > ============================================================================== > --- head/sys/kern/uipc_usrreq.c Fri Jan 8 01:12:27 2016 (r293404) > +++ head/sys/kern/uipc_usrreq.c Fri Jan 8 01:16:03 2016 (r293405) > @@ -981,7 +981,7 @@ uipc_send(struct socket *so, int flags, > control)) > control = NULL; > } else > - sbappend_locked(&so2->so_rcv, m); > + sbappendstream_locked(&so2->so_rcv, m, flags); > break; > > case SOCK_SEQPACKET: { > From owner-svn-src-head@freebsd.org Fri Jan 8 17:27:24 2016 Return-Path: Delivered-To: svn-src-head@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 9F5A6A67AD2; Fri, 8 Jan 2016 17:27:24 +0000 (UTC) (envelope-from glebius@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 700561275; Fri, 8 Jan 2016 17:27:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u08HRN4Q018063; Fri, 8 Jan 2016 17:27:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08HRNmw018062; Fri, 8 Jan 2016 17:27:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601081727.u08HRNmw018062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 8 Jan 2016 17:27:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293427 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 17:27:24 -0000 Author: glebius Date: Fri Jan 8 17:27:23 2016 New Revision: 293427 URL: https://svnweb.freebsd.org/changeset/base/293427 Log: Revert r293405: it breaks socket buffer INVARIANTS when sending control data over local sockets. Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Jan 8 16:50:04 2016 (r293426) +++ head/sys/kern/uipc_usrreq.c Fri Jan 8 17:27:23 2016 (r293427) @@ -981,7 +981,7 @@ uipc_send(struct socket *so, int flags, control)) control = NULL; } else - sbappendstream_locked(&so2->so_rcv, m, flags); + sbappend_locked(&so2->so_rcv, m); break; case SOCK_SEQPACKET: { From owner-svn-src-head@freebsd.org Fri Jan 8 17:33:35 2016 Return-Path: Delivered-To: svn-src-head@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 77F3DA67DE0; Fri, 8 Jan 2016 17:33:35 +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 466AB198B; Fri, 8 Jan 2016 17:33:35 +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 u08HXYLa020927; Fri, 8 Jan 2016 17:33:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08HXYm1020926; Fri, 8 Jan 2016 17:33:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601081733.u08HXYm1020926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 8 Jan 2016 17:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293429 - head/sys/boot/efi/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 17:33:35 -0000 Author: emaste Date: Fri Jan 8 17:33:34 2016 New Revision: 293429 URL: https://svnweb.freebsd.org/changeset/base/293429 Log: Avoid unintended $FreeBSD$ expansion in generate-fat.sh Modified: head/sys/boot/efi/boot1/generate-fat.sh Modified: head/sys/boot/efi/boot1/generate-fat.sh ============================================================================== --- head/sys/boot/efi/boot1/generate-fat.sh Fri Jan 8 17:32:42 2016 (r293428) +++ head/sys/boot/efi/boot1/generate-fat.sh Fri Jan 8 17:33:34 2016 (r293429) @@ -66,14 +66,14 @@ case $BOOT1_SIZE in esac echo '# This file autogenerated by generate-fat.sh - DO NOT EDIT' > Makefile.fat -echo '# $FreeBSD$' >> Makefile.fat +echo "# \$FreeBSD\$" >> Makefile.fat echo "BOOT1_OFFSET=0x$BOOT1_OFFSET" >> Makefile.fat echo "BOOT1_MAXSIZE=$BOOT1_MAXSIZE" >> Makefile.fat bzip2 $OUTPUT_FILE echo 'FAT template boot filesystem created by generate-fat.sh' > $OUTPUT_FILE.bz2.uu echo 'DO NOT EDIT' >> $OUTPUT_FILE.bz2.uu -echo '$FreeBSD$' >> $OUTPUT_FILE.bz2.uu +echo "\$FreeBSD\$" >> $OUTPUT_FILE.bz2.uu uuencode $OUTPUT_FILE.bz2 $OUTPUT_FILE.bz2 >> $OUTPUT_FILE.bz2.uu rm $OUTPUT_FILE.bz2 From owner-svn-src-head@freebsd.org Fri Jan 8 19:03:21 2016 Return-Path: Delivered-To: svn-src-head@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 DA9B9A68364; Fri, 8 Jan 2016 19:03:21 +0000 (UTC) (envelope-from glebius@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 9D2F61D21; Fri, 8 Jan 2016 19:03:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u08J3KUX048676; Fri, 8 Jan 2016 19:03:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08J3KFW048671; Fri, 8 Jan 2016 19:03:20 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601081903.u08J3KFW048671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 8 Jan 2016 19:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293432 - in head/sys: kern netgraph/bluetooth/socket ofed/drivers/infiniband/ulp/sdp sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 19:03:22 -0000 Author: glebius Date: Fri Jan 8 19:03:20 2016 New Revision: 293432 URL: https://svnweb.freebsd.org/changeset/base/293432 Log: Make it possible for sbappend() to preserve M_NOTREADY on mbufs, just like sbappendstream() does. Although, M_NOTREADY may appear only on SOCK_STREAM sockets, due to sendfile(2) supporting only the latter, there is a corner case of AF_UNIX/SOCK_STREAM socket, that still uses records for the sake of control data, albeit being stream socket. Provide private version of m_clrprotoflags(), which understands PRUS_NOTREADY, similar to m_demote(). Modified: head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_usrreq.c head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c head/sys/sys/sockbuf.h Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Fri Jan 8 19:02:54 2016 (r293431) +++ head/sys/kern/uipc_sockbuf.c Fri Jan 8 19:03:20 2016 (r293432) @@ -69,6 +69,23 @@ static struct mbuf *sbcut_internal(struc static void sbflush_internal(struct sockbuf *sb); /* + * Our own version of m_clrprotoflags(), that can preserve M_NOTREADY. + */ +static void +sbm_clrprotoflags(struct mbuf *m, int flags) +{ + int mask; + + mask = ~M_PROTOFLAGS; + if (flags & PRUS_NOTREADY) + mask |= M_NOTREADY; + while (m) { + m->m_flags &= mask; + m = m->m_next; + } +} + +/* * Mark ready "count" mbufs starting with "m". */ int @@ -569,7 +586,7 @@ sblastmbufchk(struct sockbuf *sb, const * are discarded and mbufs are compacted where possible. */ void -sbappend_locked(struct sockbuf *sb, struct mbuf *m) +sbappend_locked(struct sockbuf *sb, struct mbuf *m, int flags) { struct mbuf *n; @@ -577,7 +594,7 @@ sbappend_locked(struct sockbuf *sb, stru if (m == 0) return; - m_clrprotoflags(m); + sbm_clrprotoflags(m, flags); SBLASTRECORDCHK(sb); n = sb->sb_mb; if (n) { @@ -620,11 +637,11 @@ sbappend_locked(struct sockbuf *sb, stru * are discarded and mbufs are compacted where possible. */ void -sbappend(struct sockbuf *sb, struct mbuf *m) +sbappend(struct sockbuf *sb, struct mbuf *m, int flags) { SOCKBUF_LOCK(sb); - sbappend_locked(sb, m); + sbappend_locked(sb, m, flags); SOCKBUF_UNLOCK(sb); } Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Jan 8 19:02:54 2016 (r293431) +++ head/sys/kern/uipc_usrreq.c Fri Jan 8 19:03:20 2016 (r293432) @@ -981,7 +981,7 @@ uipc_send(struct socket *so, int flags, control)) control = NULL; } else - sbappend_locked(&so2->so_rcv, m); + sbappend_locked(&so2->so_rcv, m, flags); break; case SOCK_SEQPACKET: { Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Fri Jan 8 19:02:54 2016 (r293431) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Fri Jan 8 19:03:20 2016 (r293432) @@ -972,7 +972,7 @@ ng_btsocket_rfcomm_send(struct socket *s } /* Put the packet on the socket's send queue and wakeup RFCOMM task */ - sbappend(&pcb->so->so_snd, m); + sbappend(&pcb->so->so_snd, m, flags); m = NULL; if (!(pcb->flags & NG_BTSOCKET_RFCOMM_DLC_SENDING)) { @@ -2396,7 +2396,7 @@ ng_btsocket_rfcomm_receive_uih(ng_btsock error = ENOBUFS; } else { /* Append packet to the socket receive queue */ - sbappend(&pcb->so->so_rcv, m0); + sbappend(&pcb->so->so_rcv, m0, 0); m0 = NULL; sorwakeup(pcb->so); Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jan 8 19:02:54 2016 (r293431) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Fri Jan 8 19:03:20 2016 (r293432) @@ -242,7 +242,7 @@ sdp_sock_queue_rcv_mb(struct socket *sk, SOCKBUF_LOCK(&sk->so_rcv); if (unlikely(h->flags & SDP_OOB_PRES)) sdp_urg(ssk, mb); - sbappend_locked(&sk->so_rcv, mb); + sbappend_locked(&sk->so_rcv, mb, 0); sorwakeup_locked(sk); return mb; } Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Fri Jan 8 19:02:54 2016 (r293431) +++ head/sys/sys/sockbuf.h Fri Jan 8 19:03:20 2016 (r293432) @@ -129,8 +129,8 @@ struct sockbuf { #define M_BLOCKED M_PROTO2 /* M_NOTREADY in front of m */ #define M_NOTAVAIL (M_NOTREADY | M_BLOCKED) -void sbappend(struct sockbuf *sb, struct mbuf *m); -void sbappend_locked(struct sockbuf *sb, struct mbuf *m); +void sbappend(struct sockbuf *sb, struct mbuf *m, int flags); +void sbappend_locked(struct sockbuf *sb, struct mbuf *m, int flags); void sbappendstream(struct sockbuf *sb, struct mbuf *m, int flags); void sbappendstream_locked(struct sockbuf *sb, struct mbuf *m, int flags); int sbappendaddr(struct sockbuf *sb, const struct sockaddr *asa, From owner-svn-src-head@freebsd.org Fri Jan 8 19:10:53 2016 Return-Path: Delivered-To: svn-src-head@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 CCDFEA685FB; Fri, 8 Jan 2016 19:10:53 +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 A42131339; Fri, 8 Jan 2016 19:10:53 +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 u08JAqsI049162; Fri, 8 Jan 2016 19:10:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08JAqxb049159; Fri, 8 Jan 2016 19:10:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601081910.u08JAqxb049159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 8 Jan 2016 19:10:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293434 - head/tools/regression/geom_concat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 19:10:54 -0000 Author: ngie Date: Fri Jan 8 19:10:52 2016 New Revision: 293434 URL: https://svnweb.freebsd.org/changeset/base/293434 Log: - Use attach_md for memory disks so they can be tracked. - Add a geom_concat specific cleanup function and trap on that function at exit so things are cleaned up properly - Don't hardcode /tmp for temporary files, which violates the kyua sandbox MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/geom_concat/conf.sh head/tools/regression/geom_concat/test-1.t head/tools/regression/geom_concat/test-2.t Modified: head/tools/regression/geom_concat/conf.sh ============================================================================== --- head/tools/regression/geom_concat/conf.sh Fri Jan 8 19:08:57 2016 (r293433) +++ head/tools/regression/geom_concat/conf.sh Fri Jan 8 19:10:52 2016 (r293434) @@ -5,4 +5,11 @@ name="$(mktemp -u concat.XXXXXX)" class="concat" base=`basename $0` +gconcat_test_cleanup() +{ + [ -c /dev/$class/$name ] && gconcat destroy $name + geom_test_cleanup +} +trap gconcat_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh Modified: head/tools/regression/geom_concat/test-1.t ============================================================================== --- head/tools/regression/geom_concat/test-1.t Fri Jan 8 19:08:57 2016 (r293433) +++ head/tools/regression/geom_concat/test-1.t Fri Jan 8 19:10:52 2016 (r293434) @@ -5,13 +5,11 @@ echo '1..1' -us=45 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 -mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 - -gconcat create $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +gconcat create $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait # Size of created device should be 1MB + 2MB + 3MB. @@ -23,8 +21,3 @@ if [ $size -eq 6291456 ]; then else echo "not ok - Size is 6291456" fi - -gconcat destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` Modified: head/tools/regression/geom_concat/test-2.t ============================================================================== --- head/tools/regression/geom_concat/test-2.t Fri Jan 8 19:08:57 2016 (r293433) +++ head/tools/regression/geom_concat/test-2.t Fri Jan 8 19:10:52 2016 (r293434) @@ -5,18 +5,17 @@ echo '1..1' -us=45 tsize=6 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 -mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 +dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 -gconcat create $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +gconcat create $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait dd if=${src} of=/dev/concat/${name} bs=1m count=$tsize >/dev/null 2>&1 @@ -28,8 +27,4 @@ else echo "ok - md5 checksum comparison" fi -gconcat destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` rm -f ${src} ${dst} From owner-svn-src-head@freebsd.org Fri Jan 8 19:12:28 2016 Return-Path: Delivered-To: svn-src-head@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 18EEDA68732; Fri, 8 Jan 2016 19:12:28 +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 CBE17177C; Fri, 8 Jan 2016 19:12:27 +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 u08JCQIH051832; Fri, 8 Jan 2016 19:12:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08JCQ48051831; Fri, 8 Jan 2016 19:12:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601081912.u08JCQ48051831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 8 Jan 2016 19:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293435 - head/sys/boot/userboot/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 19:12:28 -0000 Author: emaste Date: Fri Jan 8 19:12:26 2016 New Revision: 293435 URL: https://svnweb.freebsd.org/changeset/base/293435 Log: Reduce libstand Makefile duplication Userboot's copy of the libstand Makefile had more extensive changes compared to the one in sys/boot/libstand32, but it turns out these are not intentional and we can just include lib/libstand/Makefile as done for libstand32 in r293040. Reviewed by: imp, jhb Tested by: allanjude MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4793 Modified: head/sys/boot/userboot/libstand/Makefile Modified: head/sys/boot/userboot/libstand/Makefile ============================================================================== --- head/sys/boot/userboot/libstand/Makefile Fri Jan 8 19:10:52 2016 (r293434) +++ head/sys/boot/userboot/libstand/Makefile Fri Jan 8 19:12:26 2016 (r293435) @@ -1,136 +1,12 @@ # $FreeBSD$ -# Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $ -# -# Notes: -# - We don't use the libc strerror/sys_errlist because the string table is -# quite large. -# -MAN= - -.include -MK_SSP= no +.include LIBSTAND_SRC= ${.CURDIR}/../../../../lib/libstand -LIBC_SRC= ${LIBSTAND_SRC}/../libc -.PATH: ${LIBSTAND_SRC} -LIB= stand INTERNALLIB= -MK_PROFILE= no -NO_PIC= - -WARNS?= 0 - -# standalone components and stuff we have modified locally -SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ - globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ - sbrk.c twiddle.c zalloc.c zalloc_malloc.c - -# private (pruned) versions of libc string functions -SRCS+= strcasecmp.c - -.PATH: ${LIBC_SRC}/net - -SRCS+= ntoh.c - -# string functions from libc -.PATH: ${LIBC_SRC}/string -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \ - ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "arm" -SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ - memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ - strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \ - strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c -.endif -.if ${MACHINE_CPUARCH} == "arm" -.PATH: ${LIBC_SRC}/arm/gen -SRCS+= divsi3.S -.endif -.if ${MACHINE_CPUARCH} == "powerpc" -.PATH: ${LIBC_SRC}/quad -SRCS+= ashldi3.c ashrdi3.c -.PATH: ${LIBC_SRC}/powerpc/gen -SRCS+= syncicache.c -.endif - -# uuid functions from libc -.PATH: ${LIBC_SRC}/uuid -SRCS+= uuid_equal.c uuid_is_nil.c - -# _setjmp/_longjmp -.if ${MACHINE_CPUARCH} == "amd64" -.PATH: ${LIBSTAND_SRC}/amd64 -.elif ${MACHINE_ARCH} == "powerpc64" -.PATH: ${LIBSTAND_SRC}/powerpc -.else -.PATH: ${LIBSTAND_SRC}/${MACHINE_CPUARCH} -.endif -SRCS+= _setjmp.S - -# decompression functionality from libbz2 -# NOTE: to actually test this functionality after libbz2 upgrade compile -# loader(8) with LOADER_BZIP2_SUPPORT defined -.PATH: ${LIBSTAND_SRC}/../../contrib/bzip2 -CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS -SRCS+= libstand_bzlib_private.h - -.for file in bzlib.c crctable.c decompress.c huffman.c randtable.c -SRCS+= _${file} -CLEANFILES+= _${file} - -_${file}: ${file} - sed "s|bzlib_private\.h|libstand_bzlib_private.h|" \ - ${.ALLSRC} > ${.TARGET} -.endfor - -CLEANFILES+= libstand_bzlib_private.h -libstand_bzlib_private.h: bzlib_private.h - sed -e 's||"stand.h"|' \ - ${.ALLSRC} > ${.TARGET} - -# decompression functionality from libz -.PATH: ${LIBSTAND_SRC}/../libz -CFLAGS+=-DHAVE_MEMCPY -I${LIBSTAND_SRC}/../libz -SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h - -.for file in infback.c inffast.c inflate.c inftrees.c zutil.c -SRCS+= _${file} -CLEANFILES+= _${file} - -_${file}: ${file} - sed -e "s|zutil\.h|libstand_zutil.h|" \ - -e "s|gzguts\.h|libstand_gzguts.h|" \ - ${.ALLSRC} > ${.TARGET} -.endfor - -# depend on stand.h being able to be included multiple times -.for file in zutil.h gzguts.h -CLEANFILES+= libstand_${file} -libstand_${file}: ${file} - sed -e 's||"stand.h"|' \ - -e 's||"stand.h"|' \ - -e 's||"stand.h"|' \ - -e 's||"stand.h"|' \ - -e 's||"stand.h"|' \ - ${.ALLSRC} > ${.TARGET} -.endfor - -# io routines -SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \ - fstat.c close.c lseek.c open.c read.c write.c readdir.c - -# network routines -SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c - -# network info services: -SRCS+= bootp.c rarp.c bootparam.c - -# boot filesystems -SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c -SRCS+= dosfs.c ext2fs.c -SRCS+= splitfs.c +INCS= +MAN= +.PATH: ${LIBSTAND_SRC} -.include -.include +.include "${LIBSTAND_SRC}/Makefile" From owner-svn-src-head@freebsd.org Fri Jan 8 19:39:02 2016 Return-Path: Delivered-To: svn-src-head@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 C6FB0A68E7D; Fri, 8 Jan 2016 19:39:02 +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 92F9A143C; Fri, 8 Jan 2016 19:39:02 +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 u08Jd1gg057821; Fri, 8 Jan 2016 19:39:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08JcxK2057794; Fri, 8 Jan 2016 19:38:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601081938.u08JcxK2057794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 8 Jan 2016 19:38:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293436 - head/tools/regression/geom_eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 19:39:03 -0000 Author: ngie Date: Fri Jan 8 19:38:59 2016 New Revision: 293436 URL: https://svnweb.freebsd.org/changeset/base/293436 Log: - Add a conf.sh file for executing common functions with geli -- Use linear probing to find the first unique md(4) device, unlike the other code which uses attach_md, as geli(8) allocates the md(4) devices itself - Don't hardcode /tmp for temporary files, which violates the kyua sandbox MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Added: head/tools/regression/geom_eli/conf.sh (contents, props changed) Modified: head/tools/regression/geom_eli/attach-d.t head/tools/regression/geom_eli/configure-b-B.t head/tools/regression/geom_eli/delkey.t head/tools/regression/geom_eli/detach-l.t head/tools/regression/geom_eli/init-B.t head/tools/regression/geom_eli/init-J.t head/tools/regression/geom_eli/init-a.t head/tools/regression/geom_eli/init-i-P.t head/tools/regression/geom_eli/init.t head/tools/regression/geom_eli/integrity-copy.t head/tools/regression/geom_eli/integrity-data.t head/tools/regression/geom_eli/integrity-hmac.t head/tools/regression/geom_eli/kill.t head/tools/regression/geom_eli/nokey.t head/tools/regression/geom_eli/onetime-a.t head/tools/regression/geom_eli/onetime-d.t head/tools/regression/geom_eli/onetime.t head/tools/regression/geom_eli/readonly.t head/tools/regression/geom_eli/resize.t head/tools/regression/geom_eli/setkey.t Modified: head/tools/regression/geom_eli/attach-d.t ============================================================================== --- head/tools/regression/geom_eli/attach-d.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/attach-d.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,10 +1,11 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..3" @@ -34,5 +35,4 @@ else echo "not ok 3" fi -mdconfig -d -u $no rm -f $keyfile Added: head/tools/regression/geom_eli/conf.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/geom_eli/conf.sh Fri Jan 8 19:38:59 2016 (r293436) @@ -0,0 +1,21 @@ +#!/bin/sh +# $FreeBSD$ + +class="eli" +base=`basename $0` + +# We need to use linear probing in order to detect the first available md(4) +# device instead of using mdconfig -a -t, because geli(8) attachs md(4) devices +no=0 +while [ -c /dev/md$no ]; do + : $(( no += 1 )) +done + +geli_test_cleanup() +{ + [ -c /dev/md${no}.eli ] && geli detach md${no}.eli + mdconfig -d -u $no +} +trap geli_test_cleanup ABRT EXIT INT TERM + +. `dirname $0`/../geom_subr.sh Modified: head/tools/regression/geom_eli/configure-b-B.t ============================================================================== --- head/tools/regression/geom_eli/configure-b-B.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/configure-b-B.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 @@ -126,5 +127,3 @@ if [ $? -eq 0 ]; then else echo "not ok 17" fi - -mdconfig -d -u $no Modified: head/tools/regression/geom_eli/delkey.t ============================================================================== --- head/tools/regression/geom_eli/delkey.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/delkey.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,13 +1,14 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile2=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile3=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile4=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +keyfile2=`mktemp $base.XXXXXX` || exit 1 +keyfile3=`mktemp $base.XXXXXX` || exit 1 +keyfile4=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..14" @@ -136,5 +137,4 @@ else echo "not ok 14" fi -mdconfig -d -u $no rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 Modified: head/tools/regression/geom_eli/detach-l.t ============================================================================== --- head/tools/regression/geom_eli/detach-l.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/detach-l.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,10 +1,11 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..4" @@ -40,5 +41,4 @@ else echo "not ok 4" fi -mdconfig -d -u $no rm -f $keyfile Modified: head/tools/regression/geom_eli/init-B.t ============================================================================== --- head/tools/regression/geom_eli/init-B.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/init-B.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,11 +1,12 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -backupfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 +backupfile=`mktemp $base.XXXXXX` || exit 1 echo "1..13" @@ -99,8 +100,5 @@ if [ -c /dev/md${no}.eli ]; then else echo "not ok 13 - -B file" fi -geli detach md${no} -rm -f $backupfile -mdconfig -d -u $no -rm -f $keyfile +rm -f $backupfile $keyfile Modified: head/tools/regression/geom_eli/init-J.t ============================================================================== --- head/tools/regression/geom_eli/init-J.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/init-J.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,13 +1,14 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile0=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 -passfile0=`mktemp /tmp/$base.XXXXXX` || exit 1 -passfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile0=`mktemp $base.XXXXXX` || exit 1 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +passfile0=`mktemp $base.XXXXXX` || exit 1 +passfile1=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..150" @@ -122,5 +123,4 @@ for iter in -1 0 64; do echo "ok ${i}"; i=$((i+1)) done -mdconfig -d -u $no rm -f ${keyfile0} ${keyfile1} ${passfile0} ${passfile1} Modified: head/tools/regression/geom_eli/init-a.t ============================================================================== --- head/tools/regression/geom_eli/init-a.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/init-a.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,10 +1,11 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 echo "1..1380" @@ -26,7 +27,7 @@ for cipher in aes:0 aes:128 aes:256 \ keylen=${cipher##*:} for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp /tmp/$base.XXXXXX` || exit 1 + rnd=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 Modified: head/tools/regression/geom_eli/init-i-P.t ============================================================================== --- head/tools/regression/geom_eli/init-i-P.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/init-i-P.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,10 +1,11 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..1" @@ -18,5 +19,4 @@ else echo "not ok 1" fi -mdconfig -d -u $no rm -f $keyfile Modified: head/tools/regression/geom_eli/init.t ============================================================================== --- head/tools/regression/geom_eli/init.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/init.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,10 +1,11 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 echo "1..460" @@ -25,7 +26,7 @@ for cipher in aes:0 aes:128 aes:256 \ ealgo=${cipher%%:*} keylen=${cipher##*:} for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp /tmp/$base.XXXXXX` || exit 1 + rnd=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1 Modified: head/tools/regression/geom_eli/integrity-copy.t ============================================================================== --- head/tools/regression/geom_eli/integrity-copy.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/integrity-copy.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,11 +1,12 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -sector=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 +sector=`mktemp $base.XXXXXX` || exit 1 echo "1..5520" Modified: head/tools/regression/geom_eli/integrity-data.t ============================================================================== --- head/tools/regression/geom_eli/integrity-data.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/integrity-data.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,11 +1,12 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -sector=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 +sector=`mktemp $base.XXXXXX` || exit 1 echo "1..2760" Modified: head/tools/regression/geom_eli/integrity-hmac.t ============================================================================== --- head/tools/regression/geom_eli/integrity-hmac.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/integrity-hmac.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,11 +1,12 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -sector=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 +sector=`mktemp $base.XXXXXX` || exit 1 echo "1..2760" Modified: head/tools/regression/geom_eli/kill.t ============================================================================== --- head/tools/regression/geom_eli/kill.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/kill.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,11 +1,12 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile2=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +keyfile2=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..9" @@ -93,5 +94,4 @@ else echo "not ok 9" fi -mdconfig -d -u $no rm -f $keyfile1 $keyfile2 Modified: head/tools/regression/geom_eli/nokey.t ============================================================================== --- head/tools/regression/geom_eli/nokey.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/nokey.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,10 +1,11 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..8" @@ -61,5 +62,4 @@ else echo "not ok 8" fi -mdconfig -d -u $no rm -f $keyfile Modified: head/tools/regression/geom_eli/onetime-a.t ============================================================================== --- head/tools/regression/geom_eli/onetime-a.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/onetime-a.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 echo "1..1380" @@ -25,7 +26,7 @@ for cipher in aes:0 aes:128 aes:256 \ keylen=${cipher##*:} for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp /tmp/$base.XXXXXX` || exit 1 + rnd=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $secsize \* $sectors + 512`b -u $no || exit 1 geli onetime -a $aalgo -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null Modified: head/tools/regression/geom_eli/onetime-d.t ============================================================================== --- head/tools/regression/geom_eli/onetime-d.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/onetime-d.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 mdconfig -a -t malloc -s $sectors -u $no || exit 1 Modified: head/tools/regression/geom_eli/onetime.t ============================================================================== --- head/tools/regression/geom_eli/onetime.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/onetime.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,8 +1,9 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 echo "1..460" @@ -24,7 +25,7 @@ for cipher in aes:0 aes:128 aes:256 \ ealgo=${cipher%%:*} keylen=${cipher##*:} for secsize in 512 1024 2048 4096 8192; do - rnd=`mktemp /tmp/$base.XXXXXX` || exit 1 + rnd=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $secsize \* $sectors`b -u $no || exit 1 geli onetime -e $ealgo -l $keylen -s $secsize md${no} 2>/dev/null Modified: head/tools/regression/geom_eli/readonly.t ============================================================================== --- head/tools/regression/geom_eli/readonly.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/readonly.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,10 +1,11 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1 +keyfile=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..11" Modified: head/tools/regression/geom_eli/resize.t ============================================================================== --- head/tools/regression/geom_eli/resize.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/resize.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,7 +1,8 @@ -#! /bin/sh -# +#!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + echo 1..27 BLK=512 @@ -22,8 +23,6 @@ setsize() { # Initialise -kldload geom_eli >/dev/null 2>&1 - setsize 10 40 || echo -n "not " echo ok $i - "Sized ${md}a to 10m" i=$((i + 1)) @@ -145,6 +144,5 @@ echo ok $i - "Attached ${md}p1.eli" i=$((i + 1)) geli detach ${md}p1.eli -mdconfig -du$unit rm tmp.* Modified: head/tools/regression/geom_eli/setkey.t ============================================================================== --- head/tools/regression/geom_eli/setkey.t Fri Jan 8 19:12:26 2016 (r293435) +++ head/tools/regression/geom_eli/setkey.t Fri Jan 8 19:38:59 2016 (r293436) @@ -1,15 +1,16 @@ #!/bin/sh # $FreeBSD$ +. $(dirname $0)/conf.sh + base=`basename $0` -no=45 sectors=100 -rnd=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile1=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile2=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile3=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile4=`mktemp /tmp/$base.XXXXXX` || exit 1 -keyfile5=`mktemp /tmp/$base.XXXXXX` || exit 1 +rnd=`mktemp $base.XXXXXX` || exit 1 +keyfile1=`mktemp $base.XXXXXX` || exit 1 +keyfile2=`mktemp $base.XXXXXX` || exit 1 +keyfile3=`mktemp $base.XXXXXX` || exit 1 +keyfile4=`mktemp $base.XXXXXX` || exit 1 +keyfile5=`mktemp $base.XXXXXX` || exit 1 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1 echo "1..16" @@ -152,5 +153,4 @@ else echo "not ok 16" fi -mdconfig -d -u $no rm -f $keyfile1 $keyfile2 $keyfile3 $keyfile4 $keyfile5 From owner-svn-src-head@freebsd.org Fri Jan 8 19:43:20 2016 Return-Path: Delivered-To: svn-src-head@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 37803A66189; Fri, 8 Jan 2016 19:43:20 +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 EC04F1A5A; Fri, 8 Jan 2016 19:43:19 +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 u08JhJdn060552; Fri, 8 Jan 2016 19:43:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08JhIkf060549; Fri, 8 Jan 2016 19:43:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601081943.u08JhIkf060549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 8 Jan 2016 19:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293437 - head/tools/regression/geom_nop X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 19:43:20 -0000 Author: ngie Date: Fri Jan 8 19:43:18 2016 New Revision: 293437 URL: https://svnweb.freebsd.org/changeset/base/293437 Log: - Add a conf.sh file for executing common functions with gnop - Use attach_md for attaching md(4) devices - Don't hardcode /tmp for temporary files, which violates the kyua sandbox MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/geom_nop/conf.sh head/tools/regression/geom_nop/test-1.t head/tools/regression/geom_nop/test-2.t Modified: head/tools/regression/geom_nop/conf.sh ============================================================================== --- head/tools/regression/geom_nop/conf.sh Fri Jan 8 19:38:59 2016 (r293436) +++ head/tools/regression/geom_nop/conf.sh Fri Jan 8 19:43:18 2016 (r293437) @@ -4,4 +4,11 @@ class="nop" base=`basename $0` +gnop_test_cleanup() +{ + [ -c /dev/${us}.nop ] && gnop destroy ${us}.nop + geom_test_cleanup +} +trap gnop_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh Modified: head/tools/regression/geom_nop/test-1.t ============================================================================== --- head/tools/regression/geom_nop/test-1.t Fri Jan 8 19:38:59 2016 (r293436) +++ head/tools/regression/geom_nop/test-1.t Fri Jan 8 19:43:18 2016 (r293437) @@ -5,21 +5,16 @@ echo "1..1" -us=45 +us=$(attach_md -t malloc -s 1M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 - -gnop create /dev/md${us} || exit 1 +gnop create /dev/${us} || exit 1 # Size of created device should be 1MB. -size=`diskinfo /dev/md${us}.nop | awk '{print $3}'` +size=`diskinfo /dev/${us}.nop | awk '{print $3}'` if [ $size -eq 1048576 ]; then echo "ok 1" else echo "not ok 1" fi - -gnop destroy md${us}.nop -mdconfig -d -u $us Modified: head/tools/regression/geom_nop/test-2.t ============================================================================== --- head/tools/regression/geom_nop/test-2.t Fri Jan 8 19:38:59 2016 (r293436) +++ head/tools/regression/geom_nop/test-2.t Fri Jan 8 19:43:18 2016 (r293437) @@ -3,20 +3,19 @@ . `dirname $0`/conf.sh -us=45 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 echo "1..1" dd if=/dev/random of=${src} bs=1m count=1 >/dev/null 2>&1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 +us=$(attach_md -t malloc -s 1M) || exit 1 -gnop create /dev/md${us} || exit 1 +gnop create /dev/${us} || exit 1 -dd if=${src} of=/dev/md${us}.nop bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/md${us}.nop of=${dst} bs=1m count=1 >/dev/null 2>&1 +dd if=${src} of=/dev/${us}.nop bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/${us}.nop of=${dst} bs=1m count=1 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 1" @@ -24,6 +23,4 @@ else echo "ok 1" fi -gnop destroy md${us}.nop -mdconfig -d -u $us rm -f ${src} ${dst} From owner-svn-src-head@freebsd.org Fri Jan 8 19:47:52 2016 Return-Path: Delivered-To: svn-src-head@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 55972A6629E; Fri, 8 Jan 2016 19:47:52 +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 1E2251C61; Fri, 8 Jan 2016 19:47:52 +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 u08JlpKp060762; Fri, 8 Jan 2016 19:47:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08JloJq060748; Fri, 8 Jan 2016 19:47:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601081947.u08JloJq060748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 8 Jan 2016 19:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293438 - head/tools/regression/geom_raid3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 19:47:52 -0000 Author: ngie Date: Fri Jan 8 19:47:49 2016 New Revision: 293438 URL: https://svnweb.freebsd.org/changeset/base/293438 Log: - Add a geom_raid3 specific cleanup function and trap on that function at exit so things are cleaned up properly - Use attach_md for attaching md(4) devices - Don't hardcode /tmp for temporary files, which violates the kyua sandbox MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/geom_raid3/conf.sh head/tools/regression/geom_raid3/test-1.t head/tools/regression/geom_raid3/test-10.t head/tools/regression/geom_raid3/test-11.t head/tools/regression/geom_raid3/test-12.t head/tools/regression/geom_raid3/test-2.t head/tools/regression/geom_raid3/test-3.t head/tools/regression/geom_raid3/test-4.t head/tools/regression/geom_raid3/test-5.t head/tools/regression/geom_raid3/test-6.t head/tools/regression/geom_raid3/test-7.t head/tools/regression/geom_raid3/test-8.t head/tools/regression/geom_raid3/test-9.t Modified: head/tools/regression/geom_raid3/conf.sh ============================================================================== --- head/tools/regression/geom_raid3/conf.sh Fri Jan 8 19:43:18 2016 (r293437) +++ head/tools/regression/geom_raid3/conf.sh Fri Jan 8 19:47:49 2016 (r293438) @@ -5,4 +5,11 @@ name="$(mktemp -u graid3.XXXXXX)" class="raid3" base=`basename $0` +graid3_test_cleanup() +{ + [ -c /dev/$class/$name ] && graid3 stop $name + geom_test_cleanup +} +trap graid3_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh Modified: head/tools/regression/geom_raid3/test-1.t ============================================================================== --- head/tools/regression/geom_raid3/test-1.t Fri Jan 8 19:43:18 2016 (r293437) +++ head/tools/regression/geom_raid3/test-1.t Fri Jan 8 19:47:49 2016 (r293438) @@ -5,15 +5,11 @@ echo "1..2" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us0 || exit 1 -mdconfig -a -t malloc -s 2M -u $us1 || exit 1 -mdconfig -a -t malloc -s 3M -u $us2 || exit 1 - -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} 2>/dev/null || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} 2>/dev/null || exit 1 devwait # Size of created device should be 2MB - 1024B. @@ -30,8 +26,3 @@ if [ $sectorsize -eq 1024 ]; then else echo "not ok 2" fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 Modified: head/tools/regression/geom_raid3/test-10.t ============================================================================== --- head/tools/regression/geom_raid3/test-10.t Fri Jan 8 19:43:18 2016 (r293437) +++ head/tools/regression/geom_raid3/test-10.t Fri Jan 8 19:47:49 2016 (r293438) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label -r $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label -r $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -32,8 +29,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_raid3/test-11.t ============================================================================== --- head/tools/regression/geom_raid3/test-11.t Fri Jan 8 19:43:18 2016 (r293437) +++ head/tools/regression/geom_raid3/test-11.t Fri Jan 8 19:47:49 2016 (r293438) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label -w $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label -w $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -32,8 +29,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_raid3/test-12.t ============================================================================== --- head/tools/regression/geom_raid3/test-12.t Fri Jan 8 19:43:18 2016 (r293437) +++ head/tools/regression/geom_raid3/test-12.t Fri Jan 8 19:47:49 2016 (r293438) @@ -5,31 +5,28 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` nblocks1=9 nblocks2=`expr $nblocks1 - 1` nblocks3=`expr $nblocks2 / 2` -mdconfig -a -t malloc -s $nblocks1 -u $us0 || exit 1 -mdconfig -a -t malloc -s $nblocks1 -u $us1 || exit 1 -mdconfig -a -t malloc -s $nblocks1 -u $us2 || exit 1 - -dd if=/dev/random of=/dev/md${us0} count=$nblocks1 >/dev/null 2>&1 -dd if=/dev/random of=/dev/md${us1} count=$nblocks1 >/dev/null 2>&1 -dd if=/dev/random of=/dev/md${us2} count=$nblocks1 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $nblocks1) || exit 1 +us1=$(attach_md -t malloc -s $nblocks1) || exit 1 +us2=$(attach_md -t malloc -s $nblocks1) || exit 1 + +dd if=/dev/random of=/dev/${us0} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/${us1} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/random of=/dev/${us2} count=$nblocks1 >/dev/null 2>&1 -graid3 label -w $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label -w $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # Wait for synchronization. sleep 2 graid3 stop $name # Break one component. -dd if=/dev/random of=/dev/md${us1} count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/random of=/dev/${us1} count=$nblocks2 >/dev/null 2>&1 # Provoke retaste of the rest components. -true > /dev/md${us0} -true > /dev/md${us2} +true > /dev/${us0} +true > /dev/${us2} sleep 1 dd if=/dev/raid3/${name} of=/dev/null bs=1k count=$nblocks3 >/dev/null 2>&1 @@ -39,8 +36,3 @@ if [ $ec -eq 0 ]; then else echo "ok 1" fi - -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 Modified: head/tools/regression/geom_raid3/test-2.t ============================================================================== --- head/tools/regression/geom_raid3/test-2.t Fri Jan 8 19:43:18 2016 (r293437) +++ head/tools/regression/geom_raid3/test-2.t Fri Jan 8 19:47:49 2016 (r293438) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -32,8 +29,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_raid3/test-3.t ============================================================================== --- head/tools/regression/geom_raid3/test-3.t Fri Jan 8 19:43:18 2016 (r293437) +++ head/tools/regression/geom_raid3/test-3.t Fri Jan 8 19:47:49 2016 (r293438) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -36,8 +33,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_raid3/test-4.t ============================================================================== --- head/tools/regression/geom_raid3/test-4.t Fri Jan 8 19:43:18 2016 (r293437) +++ head/tools/regression/geom_raid3/test-4.t Fri Jan 8 19:47:49 2016 (r293438) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # @@ -36,8 +33,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_raid3/test-5.t ============================================================================== --- head/tools/regression/geom_raid3/test-5.t Fri Jan 8 19:43:18 2016 (r293437) +++ head/tools/regression/geom_raid3/test-5.t Fri Jan 8 19:47:49 2016 (r293438) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # @@ -36,8 +33,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_raid3/test-6.t ============================================================================== --- head/tools/regression/geom_raid3/test-6.t Fri Jan 8 19:43:18 2016 (r293437) +++ head/tools/regression/geom_raid3/test-6.t Fri Jan 8 19:47:49 2016 (r293438) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -29,7 +26,7 @@ dd if=${src} of=/dev/raid3/${name} bs=$d # Rebuild of DATA component. # graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 graid3 insert -n 1 $name md${us1} sleep 1 @@ -40,8 +37,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_raid3/test-7.t ============================================================================== --- head/tools/regression/geom_raid3/test-7.t Fri Jan 8 19:43:18 2016 (r293437) +++ head/tools/regression/geom_raid3/test-7.t Fri Jan 8 19:47:49 2016 (r293438) @@ -5,22 +5,19 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -29,12 +26,12 @@ dd if=${src} of=/dev/raid3/${name} bs=$d # Rebuild of PARITY component. # graid3 remove -n 2 $name -dd if=/dev/zero of=/dev/md${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 graid3 insert -n 2 $name md${us2} sleep 1 # Remove DATA component, so PARITY component can be used while reading. graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then @@ -43,8 +40,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_raid3/test-8.t ============================================================================== --- head/tools/regression/geom_raid3/test-8.t Fri Jan 8 19:43:18 2016 (r293437) +++ head/tools/regression/geom_raid3/test-8.t Fri Jan 8 19:47:49 2016 (r293438) @@ -5,29 +5,26 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # # Writing without DATA component and rebuild of DATA component. # graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 graid3 insert -n 1 $name md${us1} sleep 1 @@ -39,8 +36,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: head/tools/regression/geom_raid3/test-9.t ============================================================================== --- head/tools/regression/geom_raid3/test-9.t Fri Jan 8 19:43:18 2016 (r293437) +++ head/tools/regression/geom_raid3/test-9.t Fri Jan 8 19:47:49 2016 (r293438) @@ -5,35 +5,32 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 -dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +us0=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us1=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 +us2=$(attach_md -t malloc -s $(expr $nblocks1 + 1)) || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -graid3 label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +graid3 label $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait # # Writing without PARITY component and rebuild of PARITY component. # graid3 remove -n 2 $name -dd if=/dev/zero of=/dev/md${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us2} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=${src} of=/dev/raid3/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 graid3 insert -n 2 $name md${us2} sleep 1 # Remove DATA component, so PARITY component can be used while reading. graid3 remove -n 1 $name -dd if=/dev/zero of=/dev/md${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us1} bs=512 count=`expr $nblocks1 + 1` >/dev/null 2>&1 dd if=/dev/raid3/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then @@ -42,8 +39,4 @@ else echo "ok 1" fi -graid3 stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} From owner-svn-src-head@freebsd.org Fri Jan 8 20:34:58 2016 Return-Path: Delivered-To: svn-src-head@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 AA5DEA67687; Fri, 8 Jan 2016 20:34:58 +0000 (UTC) (envelope-from glebius@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 5A4F71834; Fri, 8 Jan 2016 20:34:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u08KYvdw075286; Fri, 8 Jan 2016 20:34:57 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08KYvLv075281; Fri, 8 Jan 2016 20:34:57 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601082034.u08KYvLv075281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 8 Jan 2016 20:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293439 - in head: lib/libc/sys sys/dev/ti sys/kern sys/sys usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 20:34:58 -0000 Author: glebius Date: Fri Jan 8 20:34:57 2016 New Revision: 293439 URL: https://svnweb.freebsd.org/changeset/base/293439 Log: New sendfile(2) syscall. A joint effort of NGINX and Netflix from 2013 and up to now. The new sendfile is the code that Netflix uses to send their multiple tens of gigabits of data per second. The new implementation features asynchronous I/O, when I/O operations are launched, but not awaited to be complete. An explanation of why such behavior is beneficial compared to old one is going to be too long for a commit message, so we will skip it here. Additional features of new syscall are extra flags, which provide an application more control over data sent. The SF_NOCACHE flag tells kernel that data shouldn't be cached after it was sent. The SF_READAHEAD() macro allows to specify readahead size in pages. The new syscalls is a drop in replacement. No modifications are required to applications. One can take nginx binary for stable/10 and run it successfully on head. Although SF_NODISKIO lost its original sense, as now sendfile doesn't block, and now means something completely different (tm), using the new sendfile the old way is absolutely safe. Celebrates: Netflix global launch! Sponsored by: Nginx, Inc. Sponsored by: Netflix Relnotes: yes Modified: head/lib/libc/sys/sendfile.2 head/sys/dev/ti/if_ti.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_syscalls.c head/sys/sys/mbuf.h head/sys/sys/sf_buf.h head/sys/sys/socket.h head/usr.bin/netstat/mbuf.c Modified: head/lib/libc/sys/sendfile.2 ============================================================================== --- head/lib/libc/sys/sendfile.2 Fri Jan 8 19:47:49 2016 (r293438) +++ head/lib/libc/sys/sendfile.2 Fri Jan 8 20:34:57 2016 (r293439) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2010 +.Dd January 7, 2016 .Dt SENDFILE 2 .Os .Sh NAME @@ -46,7 +46,7 @@ The .Fn sendfile system call -sends a regular file specified by descriptor +sends a regular file or shared memory object specified by descriptor .Fa fd out a stream socket specified by descriptor .Fa s . @@ -101,32 +101,55 @@ the system will write the total number o variable pointed to by .Fa sbytes . .Pp -The +The least significant 16 bits of .Fa flags argument is a bitmap of these values: -.Bl -item -offset indent -.It -.Dv SF_NODISKIO . -This flag causes any -.Fn sendfile -call which would block on disk I/O to instead -return -.Er EBUSY . -Busy servers may benefit by transferring requests that would -block to a separate I/O worker thread. -.It -.Dv SF_MNOWAIT . -Do not wait for some kernel resource to become available, -in particular, -.Vt mbuf -and -.Vt sf_buf . -The flag does not make the -.Fn sendfile -syscall truly non-blocking, since other resources are still allocated -in a blocking fashion. -.It -.Dv SF_SYNC . +.Bl -tag -offset indent +.It Dv SF_NODISKIO +This flag causes +.Nm +to return +.Er EBUSY +instead of blocking when a busy page is encountered. +This rare situation can happen if some other process is now working +with the same region of the file. +It is advised to retry the operation after a short period. +.Pp +Note that in older +.Fx +versions the +.Dv SF_NODISKIO +had slightly different notion. +The flag prevented +.Nm +to run I/O operations in case if an invalid (not cached) page is encountered, +thus avoiding blocking on I/O. +Starting with +.Fx 11 +.Nm +sending files off the +.Xr ffs 7 +filesystem doesn't block on I/O +(see +.Sx IMPLEMENTATION NOTES +), so the condition no longer applies. +However, it is safe if an application utilizes +.Dv SF_NODISKIO +and on +.Er EBUSY +performs the same action as it did in +older +.Fx +versions, e.g. +.Xr aio_read 2, +.Xr read 2 +or +.Nm +in a different context. +.It Dv SF_NOCACHE +The data sent to socket will not be cached by the virtual memory system, +and will be freed directly to the pool of free pages. +.It Dv SF_SYNC .Nm sleeps until the network stack no longer references the VM pages of the file, making subsequent modifications to it safe. @@ -134,6 +157,22 @@ Please note that this is not a guarantee been sent. .El .Pp +The most significant 16 bits of +.Fa flags +specify amount of pages that +.Nm +may read ahead when reading the file. +A macro +.Fn SF_FLAGS +is provided to combine readahead amount and flags. +Example shows specifing readahead of 16 pages and +.Dv SF_NOCACHE +flag: +.Pp +.Bd -literal -offset indent -compact + SF_FLAGS(16, SF_NOCACHE) +.Ed +.Pp When using a socket marked for non-blocking I/O, .Fn sendfile may send fewer bytes than requested. @@ -149,6 +188,18 @@ The .Fx implementation of .Fn sendfile +doesn't block on disk I/O when it sends a file off the +.Xr ffs 7 +filesystem. +The syscall returns success before the actual I/O completes, and data +is put into the socket later unattended. +However, the order of data in the socket is preserved, so it is safe +to do further writes to the socket. +.Pp +The +.Fx +implementation of +.Fn sendfile is "zero-copy", meaning that it has been optimized so that copying of the file data is avoided. .Sh TUNING On some architectures, this system call internally uses a special @@ -232,12 +283,10 @@ The argument is not a valid socket descriptor. .It Bq Er EBUSY -Completing the entire transfer would have required disk I/O, so -it was aborted. -Partial data may have been sent. -(This error can only occur when +A busy page was encountered and .Dv SF_NODISKIO -is specified.) +had been specified. +Partial data may have been sent. .It Bq Er EFAULT An invalid address was specified for an argument. .It Bq Er EINTR @@ -310,9 +359,19 @@ first appeared in .Fx 3.0 . This manual page first appeared in .Fx 3.1 . +In +.Fx 10 +support for sending shared memory descriptors had been introduced. +In +.Fx 11 +a non-blocking implementation had been introduced. .Sh AUTHORS -The +The initial implementation of .Fn sendfile system call and this manual page were written by .An David G. Lawrence Aq Mt dg@dglawrence.com . +The +.Fx 11 +implementation was written by +.An Gleb Smirnoff Aq Mt glebius@FreeBSD.org . Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Fri Jan 8 19:47:49 2016 (r293438) +++ head/sys/dev/ti/if_ti.c Fri Jan 8 20:34:57 2016 (r293439) @@ -1634,7 +1634,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int m[i]->m_data = (void *)sf_buf_kva(sf[i]); m[i]->m_len = PAGE_SIZE; MEXTADD(m[i], sf_buf_kva(sf[i]), PAGE_SIZE, - sf_buf_mext, (void*)sf_buf_kva(sf[i]), sf[i], + sf_mext_free, (void*)sf_buf_kva(sf[i]), sf[i], 0, EXT_DISPOSABLE); m[i]->m_next = m[i+1]; } @@ -1699,7 +1699,7 @@ nobufs: if (m[i]) m_freem(m[i]); if (sf[i]) - sf_buf_mext((void *)sf_buf_kva(sf[i]), sf[i]); + sf_mext_free((void *)sf_buf_kva(sf[i]), sf[i]); } return (ENOBUFS); } Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Fri Jan 8 19:47:49 2016 (r293438) +++ head/sys/kern/uipc_mbuf.c Fri Jan 8 20:34:57 2016 (r293439) @@ -338,6 +338,9 @@ mb_free_ext(struct mbuf *m) case EXT_SFBUF: sf_ext_free(m->m_ext.ext_arg1, m->m_ext.ext_arg2); break; + case EXT_SFBUF_NOCACHE: + sf_ext_free_nocache(m->m_ext.ext_arg1, m->m_ext.ext_arg2); + break; default: KASSERT(m->m_ext.ext_cnt != NULL, ("%s: no refcounting pointer on %p", __func__, m)); @@ -404,6 +407,7 @@ mb_dupcl(struct mbuf *n, const struct mb switch (m->m_ext.ext_type) { case EXT_SFBUF: + case EXT_SFBUF_NOCACHE: sf_ext_ref(m->m_ext.ext_arg1, m->m_ext.ext_arg2); break; default: Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Fri Jan 8 19:47:49 2016 (r293438) +++ head/sys/kern/uipc_syscalls.c Fri Jan 8 20:34:57 2016 (r293439) @@ -113,15 +113,6 @@ static int getpeername1(struct thread *t counter_u64_t sfstat[sizeof(struct sfstat) / sizeof(uint64_t)]; -/* - * sendfile(2)-related variables and associated sysctls - */ -static SYSCTL_NODE(_kern_ipc, OID_AUTO, sendfile, CTLFLAG_RW, 0, - "sendfile(2) tunables"); -static int sfreadahead = 1; -SYSCTL_INT(_kern_ipc_sendfile, OID_AUTO, readahead, CTLFLAG_RW, - &sfreadahead, 0, "Number of sendfile(2) read-ahead MAXBSIZE blocks"); - static void sfstat_init(const void *unused) { @@ -1858,13 +1849,12 @@ sf_ext_free(void *arg1, void *arg2) sf_buf_free(sf); vm_page_lock(pg); - vm_page_unwire(pg, PQ_INACTIVE); /* * Check for the object going away on us. This can * happen since we don't hold a reference to it. * If so, we're responsible for freeing the page. */ - if (pg->wire_count == 0 && pg->object == NULL) + if (vm_page_unwire(pg, PQ_INACTIVE) && pg->object == NULL) vm_page_free(pg); vm_page_unlock(pg); @@ -1878,6 +1868,43 @@ sf_ext_free(void *arg1, void *arg2) } /* + * Same as above, but forces the page to be detached from the object + * and go into free pool. + */ +void +sf_ext_free_nocache(void *arg1, void *arg2) +{ + struct sf_buf *sf = arg1; + struct sendfile_sync *sfs = arg2; + vm_page_t pg = sf_buf_page(sf); + + sf_buf_free(sf); + + vm_page_lock(pg); + if (vm_page_unwire(pg, PQ_NONE)) { + vm_object_t obj; + + /* Try to free the page, but only if it is cheap to. */ + if ((obj = pg->object) == NULL) + vm_page_free(pg); + else if (!vm_page_xbusied(pg) && VM_OBJECT_TRYWLOCK(obj)) { + vm_page_free(pg); + VM_OBJECT_WUNLOCK(obj); + } else + vm_page_deactivate(pg); + } + vm_page_unlock(pg); + + if (sfs != NULL) { + mtx_lock(&sfs->mtx); + KASSERT(sfs->count > 0, ("Sendfile sync botchup count == 0")); + if (--sfs->count == 0) + cv_signal(&sfs->cv); + mtx_unlock(&sfs->mtx); + } +} + +/* * sendfile(2) * * int sendfile(int fd, int s, off_t offset, size_t nbytes, @@ -1974,103 +2001,252 @@ freebsd4_sendfile(struct thread *td, str } #endif /* COMPAT_FREEBSD4 */ + /* + * How much data to put into page i of n. + * Only first and last pages are special. + */ +static inline off_t +xfsize(int i, int n, off_t off, off_t len) +{ + + if (i == 0) + return (omin(PAGE_SIZE - (off & PAGE_MASK), len)); + + if (i == n - 1 && ((off + len) & PAGE_MASK) > 0) + return ((off + len) & PAGE_MASK); + + return (PAGE_SIZE); +} + +/* + * Offset within object for i page. + */ +static inline vm_offset_t +vmoff(int i, off_t off) +{ + + if (i == 0) + return ((vm_offset_t)off); + + return (trunc_page(off + i * PAGE_SIZE)); +} + +/* + * Pretend as if we don't have enough space, subtract xfsize() of + * all pages that failed. + */ +static inline void +fixspace(int old, int new, off_t off, int *space) +{ + + KASSERT(old > new, ("%s: old %d new %d", __func__, old, new)); + + /* Subtract last one. */ + *space -= xfsize(old - 1, old, off, *space); + old--; + + if (new == old) + /* There was only one page. */ + return; + + /* Subtract first one. */ + if (new == 0) { + *space -= xfsize(0, old, off, *space); + new++; + } + + /* Rest of pages are full sized. */ + *space -= (old - new) * PAGE_SIZE; + + KASSERT(*space >= 0, ("%s: space went backwards", __func__)); +} + +/* + * Structure describing a single sendfile(2) I/O, which may consist of + * several underlying pager I/Os. + * + * The syscall context allocates the structure and initializes 'nios' + * to 1. As sendfile_swapin() runs through pages and starts asynchronous + * paging operations, it increments 'nios'. + * + * Every I/O completion calls sf_iodone(), which decrements the 'nios', and + * the syscall also calls sf_iodone() after allocating all mbufs, linking them + * and sending to socket. Whoever reaches zero 'nios' is responsible to + * call pru_ready on the socket, to notify it of readyness of the data. + */ +struct sf_io { + volatile u_int nios; + u_int error; + int npages; + struct file *sock_fp; + struct mbuf *m; + vm_page_t pa[]; +}; + +static void +sf_iodone(void *arg, vm_page_t *pg, int count, int error) +{ + struct sf_io *sfio = arg; + struct socket *so; + + for (int i = 0; i < count; i++) + vm_page_xunbusy(pg[i]); + + if (error) + sfio->error = error; + + if (!refcount_release(&sfio->nios)) + return; + + so = sfio->sock_fp->f_data; + + if (sfio->error) { + struct mbuf *m; + + /* + * I/O operation failed. The state of data in the socket + * is now inconsistent, and all what we can do is to tear + * it down. Protocol abort method would tear down protocol + * state, free all ready mbufs and detach not ready ones. + * We will free the mbufs corresponding to this I/O manually. + * + * The socket would be marked with EIO and made available + * for read, so that application receives EIO on next + * syscall and eventually closes the socket. + */ + so->so_proto->pr_usrreqs->pru_abort(so); + so->so_error = EIO; + + m = sfio->m; + for (int i = 0; i < sfio->npages; i++) + m = m_free(m); + } else { + CURVNET_SET(so->so_vnet); + (void )(so->so_proto->pr_usrreqs->pru_ready)(so, sfio->m, + sfio->npages); + CURVNET_RESTORE(); + } + + /* XXXGL: curthread */ + fdrop(sfio->sock_fp, curthread); + free(sfio, M_TEMP); +} + +/* + * Iterate through pages vector and request paging for non-valid pages. + */ static int -sendfile_readpage(vm_object_t obj, struct vnode *vp, int nd, - off_t off, int xfsize, int bsize, struct thread *td, vm_page_t *res) +sendfile_swapin(vm_object_t obj, struct sf_io *sfio, off_t off, off_t len, + int npages, int rhpages, int flags) { - vm_page_t m; - vm_pindex_t pindex; - ssize_t resid; - int error, readahead, rv; + vm_page_t *pa = sfio->pa; + int nios; - pindex = OFF_TO_IDX(off); - VM_OBJECT_WLOCK(obj); - m = vm_page_grab(obj, pindex, (vp != NULL ? VM_ALLOC_NOBUSY | - VM_ALLOC_IGN_SBUSY : 0) | VM_ALLOC_WIRED | VM_ALLOC_NORMAL); + nios = 0; + flags = (flags & SF_NODISKIO) ? VM_ALLOC_NOWAIT : 0; /* - * Check if page is valid for what we need, otherwise initiate I/O. - * - * The non-zero nd argument prevents disk I/O, instead we - * return the caller what he specified in nd. In particular, - * if we already turned some pages into mbufs, nd == EAGAIN - * and the main function send them the pages before we come - * here again and block. + * First grab all the pages and wire them. Note that we grab + * only required pages. Readahead pages are dealt with later. */ - if (m->valid != 0 && vm_page_is_valid(m, off & PAGE_MASK, xfsize)) { - if (vp == NULL) - vm_page_xunbusy(m); - VM_OBJECT_WUNLOCK(obj); - *res = m; - return (0); - } else if (nd != 0) { - if (vp == NULL) - vm_page_xunbusy(m); - error = nd; - goto free_page; + VM_OBJECT_WLOCK(obj); + for (int i = 0; i < npages; i++) { + pa[i] = vm_page_grab(obj, OFF_TO_IDX(vmoff(i, off)), + VM_ALLOC_WIRED | VM_ALLOC_NORMAL | flags); + if (pa[i] == NULL) { + npages = i; + rhpages = 0; + break; + } } - /* - * Get the page from backing store. - */ - error = 0; - if (vp != NULL) { - VM_OBJECT_WUNLOCK(obj); - readahead = sfreadahead * MAXBSIZE; + for (int i = 0; i < npages;) { + int j, a, count, rv; + + /* Skip valid pages. */ + if (vm_page_is_valid(pa[i], vmoff(i, off) & PAGE_MASK, + xfsize(i, npages, off, len))) { + vm_page_xunbusy(pa[i]); + SFSTAT_INC(sf_pages_valid); + i++; + continue; + } /* - * Use vn_rdwr() instead of the pager interface for - * the vnode, to allow the read-ahead. - * - * XXXMAC: Because we don't have fp->f_cred here, we - * pass in NOCRED. This is probably wrong, but is - * consistent with our original implementation. + * Now 'i' points to first invalid page, iterate further + * to make 'j' point at first valid after a bunch of + * invalid ones. */ - error = vn_rdwr(UIO_READ, vp, NULL, readahead, trunc_page(off), - UIO_NOCOPY, IO_NODELOCKED | IO_VMIO | ((readahead / - bsize) << IO_SEQSHIFT), td->td_ucred, NOCRED, &resid, td); - SFSTAT_INC(sf_iocnt); - VM_OBJECT_WLOCK(obj); - } else { - if (vm_pager_has_page(obj, pindex, NULL, NULL)) { - rv = vm_pager_get_pages(obj, &m, 1, NULL, NULL); - SFSTAT_INC(sf_iocnt); - if (rv != VM_PAGER_OK) { - vm_page_lock(m); - vm_page_free(m); - vm_page_unlock(m); - m = NULL; - error = EIO; + for (j = i + 1; j < npages; j++) + if (vm_page_is_valid(pa[j], vmoff(j, off) & PAGE_MASK, + xfsize(j, npages, off, len))) { + SFSTAT_INC(sf_pages_valid); + break; } - } else { - pmap_zero_page(m); - m->valid = VM_PAGE_BITS_ALL; - m->dirty = 0; + + /* + * Now we got region of invalid pages between 'i' and 'j'. + * Check that they belong to pager. They may not be there, + * which is a regular situation for shmem pager. For vnode + * pager this happens only in case of sparse file. + * + * Important feature of vm_pager_has_page() is the hint + * stored in 'a', about how many pages we can pagein after + * this page in a single I/O. + */ + while (!vm_pager_has_page(obj, OFF_TO_IDX(vmoff(i, off)), + NULL, &a) && i < j) { + pmap_zero_page(pa[i]); + pa[i]->valid = VM_PAGE_BITS_ALL; + pa[i]->dirty = 0; + vm_page_xunbusy(pa[i]); + i++; } - if (m != NULL) - vm_page_xunbusy(m); - } - if (error == 0) { - *res = m; - } else if (m != NULL) { -free_page: - vm_page_lock(m); - vm_page_unwire(m, PQ_INACTIVE); + if (i == j) + continue; /* - * See if anyone else might know about this page. If - * not and it is not valid, then free it. + * We want to pagein as many pages as possible, limited only + * by the 'a' hint and actual request. + * + * We should not pagein into already valid page, thus if + * 'j' didn't reach last page, trim by that page. + * + * When the pagein fulfils the request, also specify readahead. */ - if (m->wire_count == 0 && m->valid == 0 && !vm_page_busied(m)) - vm_page_free(m); - vm_page_unlock(m); - } - KASSERT(error != 0 || (m->wire_count > 0 && - vm_page_is_valid(m, off & PAGE_MASK, xfsize)), - ("wrong page state m %p off %#jx xfsize %d", m, (uintmax_t)off, - xfsize)); + if (j < npages) + a = min(a, j - i - 1); + count = min(a + 1, npages - i); + + refcount_acquire(&sfio->nios); + rv = vm_pager_get_pages_async(obj, pa + i, count, NULL, + i + count == npages ? &rhpages : NULL, + &sf_iodone, sfio); + KASSERT(rv == VM_PAGER_OK, ("%s: pager fail obj %p page %p", + __func__, obj, pa[i])); + + SFSTAT_INC(sf_iocnt); + SFSTAT_ADD(sf_pages_read, count); + if (i + count == npages) + SFSTAT_ADD(sf_rhpages_read, rhpages); + +#ifdef INVARIANTS + for (j = i; j < i + count && j < npages; j++) + KASSERT(pa[j] == vm_page_lookup(obj, + OFF_TO_IDX(vmoff(j, off))), + ("pa[j] %p lookup %p\n", pa[j], + vm_page_lookup(obj, OFF_TO_IDX(vmoff(j, off))))); +#endif + i += count; + nios++; + } + VM_OBJECT_WUNLOCK(obj); - return (error); + + if (nios == 0 && npages != 0) + SFSTAT_INC(sf_noiocnt); + + return (nios); } static int @@ -2178,42 +2354,37 @@ vn_sendfile(struct file *fp, int sockfd, struct vnode *vp; struct vm_object *obj; struct socket *so; - struct mbuf *m; + struct mbuf *m, *mh, *mhtail; struct sf_buf *sf; - struct vm_page *pg; struct shmfd *shmfd; struct sendfile_sync *sfs; struct vattr va; - off_t off, xfsize, fsbytes, sbytes, rem, obj_size; - int error, bsize, nd, hdrlen, mnw; + off_t off, sbytes, rem, obj_size; + int error, softerr, bsize, hdrlen; - pg = NULL; obj = NULL; so = NULL; - m = NULL; + m = mh = NULL; sfs = NULL; - fsbytes = sbytes = 0; - hdrlen = mnw = 0; - rem = nbytes; - obj_size = 0; + sbytes = 0; + softerr = 0; error = sendfile_getobj(td, fp, &obj, &vp, &shmfd, &obj_size, &bsize); if (error != 0) return (error); - if (rem == 0) - rem = obj_size; error = kern_sendfile_getsock(td, sockfd, &sock_fp, &so); if (error != 0) goto out; - /* - * Do not wait on memory allocations but return ENOMEM for - * caller to retry later. - * XXX: Experimental. - */ - if (flags & SF_MNOWAIT) - mnw = 1; +#ifdef MAC + error = mac_socket_check_send(td->td_ucred, so); + if (error != 0) + goto out; +#endif + + SFSTAT_INC(sf_syscalls); + SFSTAT_ADD(sf_rhpages_requested, SF_READAHEAD(flags)); if (flags & SF_SYNC) { sfs = malloc(sizeof *sfs, M_TEMP, M_WAITOK | M_ZERO); @@ -2221,37 +2392,27 @@ vn_sendfile(struct file *fp, int sockfd, cv_init(&sfs->cv, "sendfile"); } -#ifdef MAC - error = mac_socket_check_send(td->td_ucred, so); - if (error != 0) - goto out; -#endif - /* If headers are specified copy them into mbufs. */ - if (hdr_uio != NULL) { + if (hdr_uio != NULL && hdr_uio->uio_resid > 0) { hdr_uio->uio_td = td; hdr_uio->uio_rw = UIO_WRITE; - if (hdr_uio->uio_resid > 0) { - /* - * In FBSD < 5.0 the nbytes to send also included - * the header. If compat is specified subtract the - * header size from nbytes. - */ - if (kflags & SFK_COMPAT) { - if (nbytes > hdr_uio->uio_resid) - nbytes -= hdr_uio->uio_resid; - else - nbytes = 0; - } - m = m_uiotombuf(hdr_uio, (mnw ? M_NOWAIT : M_WAITOK), - 0, 0, 0); - if (m == NULL) { - error = mnw ? EAGAIN : ENOBUFS; - goto out; - } - hdrlen = m_length(m, NULL); + /* + * In FBSD < 5.0 the nbytes to send also included + * the header. If compat is specified subtract the + * header size from nbytes. + */ + if (kflags & SFK_COMPAT) { + if (nbytes > hdr_uio->uio_resid) + nbytes -= hdr_uio->uio_resid; + else + nbytes = 0; } - } + mh = m_uiotombuf(hdr_uio, M_WAITOK, 0, 0, 0); + hdrlen = m_length(mh, &mhtail); + } else + hdrlen = 0; + + rem = nbytes ? omin(nbytes, obj_size - offset) : obj_size - offset; /* * Protect against multiple writers to the socket. @@ -2272,21 +2433,13 @@ vn_sendfile(struct file *fp, int sockfd, * The outer loop checks the state and available space of the socket * and takes care of the overall progress. */ - for (off = offset; ; ) { + for (off = offset; rem > 0; ) { + struct sf_io *sfio; + vm_page_t *pa; struct mbuf *mtail; - int loopbytes; - int space; - int done; - - if ((nbytes != 0 && nbytes == fsbytes) || - (nbytes == 0 && obj_size == fsbytes)) - break; + int nios, space, npages, rhpages; mtail = NULL; - loopbytes = 0; - space = 0; - done = 0; - /* * Check the socket state for ongoing connection, * no errors and space in socket buffer. @@ -2362,49 +2515,58 @@ retry_space: VOP_UNLOCK(vp, 0); goto done; } - obj_size = va.va_size; + if (va.va_size != obj_size) { + if (nbytes == 0) + rem += va.va_size - obj_size; + else if (offset + nbytes > va.va_size) + rem -= (offset + nbytes - va.va_size); + obj_size = va.va_size; + } } + if (space > rem) + space = rem; + + npages = howmany(space + (off & PAGE_MASK), PAGE_SIZE); + + /* + * Calculate maximum allowed number of pages for readahead + * at this iteration. First, we allow readahead up to "rem". + * If application wants more, let it be, but there is no + * reason to go above MAXPHYS. Also check against "obj_size", + * since vm_pager_has_page() can hint beyond EOF. + */ + rhpages = howmany(rem + (off & PAGE_MASK), PAGE_SIZE) - npages; + rhpages += SF_READAHEAD(flags); + rhpages = min(howmany(MAXPHYS, PAGE_SIZE), rhpages); + rhpages = min(howmany(obj_size - trunc_page(off), PAGE_SIZE) - + npages, rhpages); + + sfio = malloc(sizeof(struct sf_io) + + npages * sizeof(vm_page_t), M_TEMP, M_WAITOK); + refcount_init(&sfio->nios, 1); + sfio->error = 0; + + nios = sendfile_swapin(obj, sfio, off, space, npages, rhpages, + flags); + /* * Loop and construct maximum sized mbuf chain to be bulk * dumped into socket buffer. */ - while (space > loopbytes) { - vm_offset_t pgoff; + pa = sfio->pa; + for (int i = 0; i < npages; i++) { struct mbuf *m0; /* - * Calculate the amount to transfer. - * Not to exceed a page, the EOF, - * or the passed in nbytes. + * If a page wasn't grabbed successfully, then + * trim the array. Can happen only with SF_NODISKIO. */ - pgoff = (vm_offset_t)(off & PAGE_MASK); - rem = obj_size - offset; - if (nbytes != 0) - rem = omin(rem, nbytes); - rem -= fsbytes + loopbytes; - xfsize = omin(PAGE_SIZE - pgoff, rem); - xfsize = omin(space - loopbytes, xfsize); - if (xfsize <= 0) { - done = 1; /* all data sent */ - break; - } - - /* - * Attempt to look up the page. Allocate - * if not found or wait and loop if busy. - */ - if (m != NULL) - nd = EAGAIN; /* send what we already got */ - else if ((flags & SF_NODISKIO) != 0) - nd = EBUSY; - else - nd = 0; - error = sendfile_readpage(obj, vp, nd, off, - xfsize, bsize, td, &pg); - if (error != 0) { - if (error == EAGAIN) - error = 0; /* not a real error */ + if (pa[i] == NULL) { + SFSTAT_INC(sf_busy); + fixspace(npages, i, off, &space); + npages = i; + softerr = EBUSY; break; } @@ -2417,56 +2579,59 @@ retry_space: * threads might exhaust the buffers and then * deadlock. */ - sf = sf_buf_alloc(pg, (mnw || m != NULL) ? SFB_NOWAIT : - SFB_CATCH); + sf = sf_buf_alloc(pa[i], + m != NULL ? SFB_NOWAIT : SFB_CATCH); if (sf == NULL) { SFSTAT_INC(sf_allocfail); - vm_page_lock(pg); - vm_page_unwire(pg, PQ_INACTIVE); - KASSERT(pg->object != NULL, - ("%s: object disappeared", __func__)); - vm_page_unlock(pg); + for (int j = i; j < npages; j++) { + vm_page_lock(pa[j]); + vm_page_unwire(pa[j], PQ_INACTIVE); + vm_page_unlock(pa[j]); + } if (m == NULL) - error = (mnw ? EAGAIN : EINTR); + softerr = ENOBUFS; + fixspace(npages, i, off, &space); + npages = i; break; } - /* - * Get an mbuf and set it up as having - * external storage. - */ - m0 = m_get((mnw ? M_NOWAIT : M_WAITOK), MT_DATA); - if (m0 == NULL) { - error = (mnw ? EAGAIN : ENOBUFS); - sf_ext_free(sf, NULL); - break; - } - /* - * Attach EXT_SFBUF external storage. - */ - m0->m_ext.ext_buf = (caddr_t )sf_buf_kva(sf); + m0 = m_get(M_WAITOK, MT_DATA); + m0->m_ext.ext_buf = (char *)sf_buf_kva(sf); m0->m_ext.ext_size = PAGE_SIZE; m0->m_ext.ext_arg1 = sf; m0->m_ext.ext_arg2 = sfs; - m0->m_ext.ext_type = EXT_SFBUF; + /* + * SF_NOCACHE sets the page as being freed upon send. + * However, we ignore it for the last page in 'space', + * if the page is truncated, and we got more data to + * send (rem > space), or if we have readahead + * configured (rhpages > 0). + */ + if ((flags & SF_NOCACHE) == 0 || + (i == npages - 1 && + ((off + space) & PAGE_MASK) && + (rem > space || rhpages > 0))) + m0->m_ext.ext_type = EXT_SFBUF; + else + m0->m_ext.ext_type = EXT_SFBUF_NOCACHE; m0->m_ext.ext_flags = 0; - m0->m_flags |= (M_EXT|M_RDONLY); - m0->m_data = (char *)sf_buf_kva(sf) + pgoff; - m0->m_len = xfsize; + m0->m_flags |= (M_EXT | M_RDONLY); + if (nios) + m0->m_flags |= M_NOTREADY; + m0->m_data = (char *)sf_buf_kva(sf) + + (vmoff(i, off) & PAGE_MASK); + m0->m_len = xfsize(i, npages, off, space); + + if (i == 0) + sfio->m = m0; /* Append to mbuf chain. */ if (mtail != NULL) mtail->m_next = m0; - else if (m != NULL) - m_last(m)->m_next = m0; else m = m0; mtail = m0; - /* Keep track of bits processed. */ - loopbytes += xfsize; - off += xfsize; - if (sfs != NULL) { mtx_lock(&sfs->mtx); sfs->count++; @@ -2477,49 +2642,60 @@ retry_space: if (vp != NULL) VOP_UNLOCK(vp, 0); + /* Keep track of bytes processed. */ + off += space; + rem -= space; + + /* Prepend header, if any. */ + if (hdrlen) { + mhtail->m_next = m; + m = mh; + mh = NULL; + } + + if (m == NULL) { + KASSERT(softerr, ("%s: m NULL, no error", __func__)); + error = softerr; + free(sfio, M_TEMP); + goto done; + } + /* Add the buffer chain to the socket buffer. */ - if (m != NULL) { - int mlen, err; + KASSERT(m_length(m, NULL) == space + hdrlen, + ("%s: mlen %u space %d hdrlen %d", + __func__, m_length(m, NULL), space, hdrlen)); - mlen = m_length(m, NULL); - SOCKBUF_LOCK(&so->so_snd); - if (so->so_snd.sb_state & SBS_CANTSENDMORE) { - error = EPIPE; - SOCKBUF_UNLOCK(&so->so_snd); - goto done; - } - SOCKBUF_UNLOCK(&so->so_snd); - CURVNET_SET(so->so_vnet); - /* Avoid error aliasing. */ - err = (*so->so_proto->pr_usrreqs->pru_send) - (so, 0, m, NULL, NULL, td); - CURVNET_RESTORE(); - if (err == 0) { - /* - * We need two counters to get the - * file offset and nbytes to send - * right: - * - sbytes contains the total amount - * of bytes sent, including headers. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Jan 8 20:37:13 2016 Return-Path: Delivered-To: svn-src-head@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 942D2A6776C; Fri, 8 Jan 2016 20:37:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 788C81B1D; Fri, 8 Jan 2016 20:37:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 71B7C1920; Fri, 8 Jan 2016 20:37:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 27C7018572; Fri, 8 Jan 2016 20:37:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id KhwinlUByIch; Fri, 8 Jan 2016 20:37:10 +0000 (UTC) Subject: Re: svn commit: r293439 - in head: lib/libc/sys sys/dev/ti sys/kern sys/sys usr.bin/netstat DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 70A9E1856C To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601082034.u08KYvLv075281@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56901DFA.7090409@FreeBSD.org> Date: Fri, 8 Jan 2016 12:37:14 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <201601082034.u08KYvLv075281@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="L7B8DSh9ui7GAwvAGd28ElKoSHx5DV9o5" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 20:37:13 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --L7B8DSh9ui7GAwvAGd28ElKoSHx5DV9o5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 1/8/2016 12:34 PM, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Jan 8 20:34:57 2016 > New Revision: 293439 > URL: https://svnweb.freebsd.org/changeset/base/293439 >=20 > Log: > New sendfile(2) syscall. A joint effort of NGINX and Netflix from 201= 3 and > up to now. > =20 > The new sendfile is the code that Netflix uses to send their multiple= tens > of gigabits of data per second. The new implementation features async= hronous > I/O, when I/O operations are launched, but not awaited to be complete= =2E An > explanation of why such behavior is beneficial compared to old one is= > going to be too long for a commit message, so we will skip it here. > =20 > Additional features of new syscall are extra flags, which provide an > application more control over data sent. The SF_NOCACHE flag tells > kernel that data shouldn't be cached after it was sent. The SF_READAH= EAD() > macro allows to specify readahead size in pages. > =20 > The new syscalls is a drop in replacement. No modifications are requi= red > to applications. One can take nginx binary for stable/10 and run it > successfully on head. Although SF_NODISKIO lost its original sense, a= s now > sendfile doesn't block, and now means something completely different = (tm), > using the new sendfile the old way is absolutely safe. > =20 > Celebrates: Netflix global launch! > Sponsored by: Nginx, Inc. > Sponsored by: Netflix > Relnotes: yes >=20 > Modified: > head/lib/libc/sys/sendfile.2 > head/sys/dev/ti/if_ti.c > head/sys/kern/uipc_mbuf.c > head/sys/kern/uipc_syscalls.c > head/sys/sys/mbuf.h > head/sys/sys/sf_buf.h > head/sys/sys/socket.h > head/usr.bin/netstat/mbuf.c Why not merge the branch with full history? --=20 Regards, Bryan Drewery --L7B8DSh9ui7GAwvAGd28ElKoSHx5DV9o5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWkB36AAoJEDXXcbtuRpfPZTYH/13iig98PbKvbGae42o6UGAg czAxIuKAVg1KHPufJgCZPQzfAVF8kYOkHAS9kSCXHmSfLAr1OvgnjfpkHesVhQNu 30z9yoSSbUfw8wF3PKXTT2CwoRQ2aQ0ypGFBtFef5jnPZ3mrSacJjjrgN/v2FImE ty7yLUJjxHcBX5D5jKia7Tkev80HMXkLMscv5pbp4JqAAlQOlpZOG7Nx2Ej6BSEi jEZOhvF3puNPX6DZt8j9GUfVriWZ47VCJoZZsiF/kus2qA4PpOVSdUdrH9Ym9Vh/ QAeEAwhcMfGRYDjCCRjBp2Y9OAEF6HbyAE3SoPFVvR9Xn3rAAA/pNJBXlrVdMm0= =2uLs -----END PGP SIGNATURE----- --L7B8DSh9ui7GAwvAGd28ElKoSHx5DV9o5-- From owner-svn-src-head@freebsd.org Fri Jan 8 20:44:36 2016 Return-Path: Delivered-To: svn-src-head@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 D465BA67B2D; Fri, 8 Jan 2016 20:44:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (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 B4B111106; Fri, 8 Jan 2016 20:44:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x234.google.com with SMTP id ho8so26921647pac.2; Fri, 08 Jan 2016 12:44:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rv1RRJGuzbWc1DcMAp5bHluZLjatJ8f6UeQNf/7vWro=; b=iUhwY317Z5PT4mhaToba0AvNsLNDG5AMUsioK4134Pf9Jh6Yk3dhghggy64hX+KEyU 7yiUvJyAXZSfBW+83oPemGJNoYOp/LBx/CQvYoZg5rhtKmYwatBbqeriXKGl7BZkNHeJ G0pdvuCs7zPe0vxZPJ9uAT6zlLQSCtfIfVDaqKvVCJ436KNaQ7yR3PkBhWaieqX61l2G EKHoCKo2G9HJrXbjtHxHNUUQzdyRTN5aDsZvRT7RWYtAlo2B3SkdWHo2sC9wHiKZHYGl qAckq9AIEYiywU95ge0uyMyi8yC1WME7jPije1NWc4s70KGTBQgqs+OnAXPV/bJzUEf4 p94g== X-Received: by 10.66.235.162 with SMTP id un2mr10239003pac.17.1452285876237; Fri, 08 Jan 2016 12:44:36 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:5503:16e8:a177:a045? ([2601:601:800:126d:5503:16e8:a177:a045]) by smtp.gmail.com with ESMTPSA id s80sm6700077pfi.36.2016.01.08.12.44.33 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Jan 2016 12:44:34 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293439 - in head: lib/libc/sys sys/dev/ti sys/kern sys/sys usr.bin/netstat From: NGie Cooper In-Reply-To: <201601082034.u08KYvLv075281@repo.freebsd.org> Date: Fri, 8 Jan 2016 12:44:32 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <96B980EE-FD2F-490E-BA5E-4F23A67CEB18@gmail.com> References: <201601082034.u08KYvLv075281@repo.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 20:44:36 -0000 > On Jan 8, 2016, at 12:34, Gleb Smirnoff wrote: >=20 > Author: glebius > Date: Fri Jan 8 20:34:57 2016 > New Revision: 293439 > URL: https://svnweb.freebsd.org/changeset/base/293439 >=20 > Log: > New sendfile(2) syscall. A joint effort of NGINX and Netflix from = 2013 and > up to now. >=20 > The new sendfile is the code that Netflix uses to send their multiple = tens > of gigabits of data per second. The new implementation features = asynchronous > I/O, when I/O operations are launched, but not awaited to be = complete. An > explanation of why such behavior is beneficial compared to old one is > going to be too long for a commit message, so we will skip it here. >=20 > Additional features of new syscall are extra flags, which provide an > application more control over data sent. The SF_NOCACHE flag tells > kernel that data shouldn't be cached after it was sent. The = SF_READAHEAD() > macro allows to specify readahead size in pages. >=20 > The new syscalls is a drop in replacement. No modifications are = required > to applications. One can take nginx binary for stable/10 and run it > successfully on head. Although SF_NODISKIO lost its original sense, = as now > sendfile doesn't block, and now means something completely different = (tm), > using the new sendfile the old way is absolutely safe. >=20 > Celebrates: Netflix global launch! > Sponsored by: Nginx, Inc. > Sponsored by: Netflix > Relnotes: yes Did anyone review these changes and the other changes made recently to = sys/kern and sys/net* ? Thanks, -NGie= From owner-svn-src-head@freebsd.org Fri Jan 8 21:07:35 2016 Return-Path: Delivered-To: svn-src-head@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 9C538A68339; Fri, 8 Jan 2016 21:07:35 +0000 (UTC) (envelope-from bdrewery@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 6976B1E2C; Fri, 8 Jan 2016 21:07:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u08L7Yps084069; Fri, 8 Jan 2016 21:07:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08L7YTJ084068; Fri, 8 Jan 2016 21:07:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601082107.u08L7YTJ084068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 8 Jan 2016 21:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293440 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 21:07:35 -0000 Author: bdrewery Date: Fri Jan 8 21:07:34 2016 New Revision: 293440 URL: https://svnweb.freebsd.org/changeset/base/293440 Log: Fix upgrading from OSVERSION 1000002-1000032 after r288829. r288829 states that lex requires the latest m4, but was not always building it. Move lex to the same logic as m4 since they are closely tied now. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Reported by: Slawa Olhovchenkov Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jan 8 20:34:57 2016 (r293439) +++ head/Makefile.inc1 Fri Jan 8 21:07:34 2016 (r293440) @@ -1425,11 +1425,13 @@ _vtfontcvt= usr.bin/vtfontcvt _sed= usr.bin/sed .endif -.if ${BOOTSTRAPPING} < 1000002 +.if ${BOOTSTRAPPING} < 1000033 _libopenbsd= lib/libopenbsd _m4= usr.bin/m4 +_lex= usr.bin/lex ${_bt}-usr.bin/m4: ${_bt}-lib/libopenbsd +${_bt}-usr.bin/lex: ${_bt}-usr.bin/m4 .endif .if ${BOOTSTRAPPING} < 1000026 @@ -1443,12 +1445,6 @@ ${_bt}-usr.sbin/nmtree: ${_bt}-lib/libne _cat= bin/cat .endif -.if ${BOOTSTRAPPING} < 1000033 -_lex= usr.bin/lex - -${_bt}-usr.bin/lex: ${_bt}-usr.bin/m4 -.endif - # r277259 crunchide: Correct 64-bit section header offset # r281674 crunchide: always include both 32- and 64-bit ELF support # r285986 crunchen: use STRIPBIN rather than STRIP From owner-svn-src-head@freebsd.org Fri Jan 8 21:10:43 2016 Return-Path: Delivered-To: svn-src-head@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 D82D7A68421; Fri, 8 Jan 2016 21:10:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A9B3C101C; Fri, 8 Jan 2016 21:10:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u08LAgeJ012076 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 8 Jan 2016 13:10:42 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u08LAf7Y012075; Fri, 8 Jan 2016 13:10:41 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 8 Jan 2016 13:10:41 -0800 From: Gleb Smirnoff To: NGie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293439 - in head: lib/libc/sys sys/dev/ti sys/kern sys/sys usr.bin/netstat Message-ID: <20160108211041.GG1906@FreeBSD.org> References: <201601082034.u08KYvLv075281@repo.freebsd.org> <96B980EE-FD2F-490E-BA5E-4F23A67CEB18@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <96B980EE-FD2F-490E-BA5E-4F23A67CEB18@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 21:10:43 -0000 On Fri, Jan 08, 2016 at 12:44:32PM -0800, NGie Cooper wrote: N> > Log: N> > New sendfile(2) syscall. A joint effort of NGINX and Netflix from 2013 and N> > up to now. N> > N> > The new sendfile is the code that Netflix uses to send their multiple tens N> > of gigabits of data per second. The new implementation features asynchronous N> > I/O, when I/O operations are launched, but not awaited to be complete. An N> > explanation of why such behavior is beneficial compared to old one is N> > going to be too long for a commit message, so we will skip it here. N> > N> > Additional features of new syscall are extra flags, which provide an N> > application more control over data sent. The SF_NOCACHE flag tells N> > kernel that data shouldn't be cached after it was sent. The SF_READAHEAD() N> > macro allows to specify readahead size in pages. N> > N> > The new syscalls is a drop in replacement. No modifications are required N> > to applications. One can take nginx binary for stable/10 and run it N> > successfully on head. Although SF_NODISKIO lost its original sense, as now N> > sendfile doesn't block, and now means something completely different (tm), N> > using the new sendfile the old way is absolutely safe. N> > N> > Celebrates: Netflix global launch! N> > Sponsored by: Nginx, Inc. N> > Sponsored by: Netflix N> > Relnotes: yes N> N> Did anyone review these changes and the other changes made recently to sys/kern and sys/net* ? 1) The review requests were sent continuosly to arch@ during last 1.5 years. https://lists.freebsd.org/pipermail/freebsd-arch/2014-May/015385.html 2) Team of engineers at Netflix has a lot of code build on top of that code, e.g. SSL_sendfile(). Of course, writing something on top assumes reviewing, so assume it reviewed thoroughly by rrs@. Actually, here is list of people who did some review of the code: emax@, rrs@, scottl@, gallatin@, imp@. 3) Do you have any particulars concerns with this change or those made recently to sys/kern and sys/net*? -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Jan 8 21:12:36 2016 Return-Path: Delivered-To: svn-src-head@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 4E9E7A68575; Fri, 8 Jan 2016 21:12:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A2F713AA; Fri, 8 Jan 2016 21:12:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u08LCZTP012103 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 8 Jan 2016 13:12:35 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u08LCZOt012102; Fri, 8 Jan 2016 13:12:35 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 8 Jan 2016 13:12:35 -0800 From: Gleb Smirnoff To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293439 - in head: lib/libc/sys sys/dev/ti sys/kern sys/sys usr.bin/netstat Message-ID: <20160108211235.GH1906@FreeBSD.org> References: <201601082034.u08KYvLv075281@repo.freebsd.org> <56901DFA.7090409@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56901DFA.7090409@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 21:12:36 -0000 On Fri, Jan 08, 2016 at 12:37:14PM -0800, Bryan Drewery wrote: B> > The new syscalls is a drop in replacement. No modifications are required B> > to applications. One can take nginx binary for stable/10 and run it B> > successfully on head. Although SF_NODISKIO lost its original sense, as now B> > sendfile doesn't block, and now means something completely different (tm), B> > using the new sendfile the old way is absolutely safe. B> > B> > Celebrates: Netflix global launch! B> > Sponsored by: Nginx, Inc. B> > Sponsored by: Netflix B> > Relnotes: yes B> > B> > Modified: B> > head/lib/libc/sys/sendfile.2 B> > head/sys/dev/ti/if_ti.c B> > head/sys/kern/uipc_mbuf.c B> > head/sys/kern/uipc_syscalls.c B> > head/sys/sys/mbuf.h B> > head/sys/sys/sf_buf.h B> > head/sys/sys/socket.h B> > head/usr.bin/netstat/mbuf.c B> B> Why not merge the branch with full history? This was already discussed in scope of other project branches, and decision was that this idea is bad. I don't remember the details. May be subversion experts will reply. Anyway, I'm not going to delete the branch soon. Indeed, it has a lot of interesting stories of success and failures in it :) -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Jan 8 21:12:56 2016 Return-Path: Delivered-To: svn-src-head@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 E4E35A685C3; Fri, 8 Jan 2016 21:12:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id D16121583; Fri, 8 Jan 2016 21:12:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id CB53315E2; Fri, 8 Jan 2016 21:12:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8C26318631; Fri, 8 Jan 2016 21:12:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id rTZz_NtiMHL3; Fri, 8 Jan 2016 21:12:54 +0000 (UTC) Subject: Re: svn commit: r293439 - in head: lib/libc/sys sys/dev/ti sys/kern sys/sys usr.bin/netstat DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com E52751862A To: Gleb Smirnoff , NGie Cooper References: <201601082034.u08KYvLv075281@repo.freebsd.org> <96B980EE-FD2F-490E-BA5E-4F23A67CEB18@gmail.com> <20160108211041.GG1906@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <5690265C.8040101@FreeBSD.org> Date: Fri, 8 Jan 2016 13:13:00 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160108211041.GG1906@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HSnexTQn5RMo9CVSBbJMFxS1FNAuq7jAT" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 21:12:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HSnexTQn5RMo9CVSBbJMFxS1FNAuq7jAT Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 1/8/2016 1:10 PM, Gleb Smirnoff wrote: > 1) The review requests were sent continuosly to arch@ during last 1.5 y= ears. >=20 > https://lists.freebsd.org/pipermail/freebsd-arch/2014-May/015385.htm= l >=20 > 2) Team of engineers at Netflix has a lot of code build on top of that = code, > e.g. SSL_sendfile(). Of course, writing something on top assumes rev= iewing, > so assume it reviewed thoroughly by rrs@. Actually, here is list of = people > who did some review of the code: emax@, rrs@, scottl@, gallatin@, im= p@. All of which should be in the commit msg! There's even https://reviews.freebsd.org/D102 --=20 Regards, Bryan Drewery --HSnexTQn5RMo9CVSBbJMFxS1FNAuq7jAT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWkCZcAAoJEDXXcbtuRpfPgZgIANWmrxpR/qUZ3AIyDlgOJJLi Q0OUNgK859Go/xYeNTkutHotRre0SagTJRjrragVLPQuUJY1X5wUEv53Bg+jhioD ZQBjl9165G66hIWReE4zCTKHApGCcw0/R+yi8dj5FRWeLPqeRUF8HQOUJi91ORbq 9y39eoDI/srln1VsH9Pa76wvTlk5EwEY5npn3UfV17sPmIWUQxC2nToh6OWyD++I YKQx5RSB7c9bNtDLvvsT7w8a/RFVEwJi7k1I7P++i5yaXDUeyH4Z9Gfezgg8n+fu 2cvlB6KKwLrNts303y6AGROKep8Cfd8iz7x61t6Z7QtGp9Nlg1/mNqdzwtptYys= =tfN8 -----END PGP SIGNATURE----- --HSnexTQn5RMo9CVSBbJMFxS1FNAuq7jAT-- From owner-svn-src-head@freebsd.org Fri Jan 8 21:22:49 2016 Return-Path: Delivered-To: svn-src-head@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 71019A689D1; Fri, 8 Jan 2016 21:22:49 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x234.google.com (mail-pf0-x234.google.com [IPv6:2607:f8b0:400e:c00::234]) (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 46C891BBE; Fri, 8 Jan 2016 21:22:49 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x234.google.com with SMTP id e65so14879825pfe.0; Fri, 08 Jan 2016 13:22:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=HaRunJcAMVCd+7d4kS56k3a4Qx1hEsgQ9SV1zfRDULE=; b=y5z8ODTL7ErhceTO0FnjsZ7FhA3Oe5J3jzWgZxSERx3nDud9Y8rqoc50RWKux/bOEI +akyNyZWTCsopVm0+C3qz7i3Va6xKaCnLKMeAN3P6U6pAmSHehMOtdZwp0cqJewQLX0T oU4wSMgG84qYU7Nu4GIH7EdbtCMAo1JkqSseyNP0u4WIughL1h7WNvpAXAR806IEVpPC QFUrPW7cy58pWLL7R0NbORB0OGZfIGjBJZTRb9nJCYQnmw47h/XrrziWvAIKENFOJ+5y jiXmBdK7539Jr8s2GWjap46njRvnt2U+8KEzS+PtvdYwKBhNXh8p3SlAZ6kPVWcFDIZo 3WbQ== X-Received: by 10.98.14.80 with SMTP id w77mr7475498pfi.152.1452288168828; Fri, 08 Jan 2016 13:22:48 -0800 (PST) Received: from [192.168.20.7] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id v7sm6787007pfa.77.2016.01.08.13.22.46 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Jan 2016 13:22:47 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293439 - in head: lib/libc/sys sys/dev/ti sys/kern sys/sys usr.bin/netstat From: NGie Cooper In-Reply-To: <20160108211041.GG1906@FreeBSD.org> Date: Fri, 8 Jan 2016 13:22:45 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <88B48C42-DFEF-4CAE-973E-BDF2A408B4A3@gmail.com> References: <201601082034.u08KYvLv075281@repo.freebsd.org> <96B980EE-FD2F-490E-BA5E-4F23A67CEB18@gmail.com> <20160108211041.GG1906@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 21:22:49 -0000 > On Jan 8, 2016, at 13:10, Gleb Smirnoff wrote: >=20 > On Fri, Jan 08, 2016 at 12:44:32PM -0800, NGie Cooper wrote: > N> > Log: > N> > New sendfile(2) syscall. A joint effort of NGINX and Netflix = from 2013 and > N> > up to now. > N> >=20 > N> > The new sendfile is the code that Netflix uses to send their = multiple tens > N> > of gigabits of data per second. The new implementation features = asynchronous > N> > I/O, when I/O operations are launched, but not awaited to be = complete. An > N> > explanation of why such behavior is beneficial compared to old = one is > N> > going to be too long for a commit message, so we will skip it = here. > N> >=20 > N> > Additional features of new syscall are extra flags, which = provide an > N> > application more control over data sent. The SF_NOCACHE flag = tells > N> > kernel that data shouldn't be cached after it was sent. The = SF_READAHEAD() > N> > macro allows to specify readahead size in pages. > N> >=20 > N> > The new syscalls is a drop in replacement. No modifications are = required > N> > to applications. One can take nginx binary for stable/10 and run = it > N> > successfully on head. Although SF_NODISKIO lost its original = sense, as now > N> > sendfile doesn't block, and now means something completely = different (tm), > N> > using the new sendfile the old way is absolutely safe. > N> >=20 > N> > Celebrates: Netflix global launch! > N> > Sponsored by: Nginx, Inc. > N> > Sponsored by: Netflix > N> > Relnotes: yes > N>=20 > N> Did anyone review these changes and the other changes made recently = to sys/kern and sys/net* ? >=20 > 1) The review requests were sent continuosly to arch@ during last 1.5 = years. >=20 > = https://lists.freebsd.org/pipermail/freebsd-arch/2014-May/015385.html >=20 > 2) Team of engineers at Netflix has a lot of code build on top of that = code, > e.g. SSL_sendfile(). Of course, writing something on top assumes = reviewing, > so assume it reviewed thoroughly by rrs@. Actually, here is list of = people > who did some review of the code: emax@, rrs@, scottl@, gallatin@, = imp@. >=20 > 3) Do you have any particulars concerns with this change or those made = recently > to sys/kern and sys/net*? I don=E2=80=99t as of right now, other than it=E2=80=99s really = difficult to audit changes and assess risk if someone doesn=E2=80=99t = have access to the CRs :(. Also=E2=80=A6 N> > An N> > explanation of why such behavior is beneficial compared to old one = is N> > going to be too long for a commit message, so we will skip it = here. This wasn=E2=80=99t really helpful. It would have been nice if there was = a wiki page or some other reference used in this commit which would have = described the where, why, and how behind this change a lot more. Thanks, -NGie= From owner-svn-src-head@freebsd.org Fri Jan 8 21:25:28 2016 Return-Path: Delivered-To: svn-src-head@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 78C03A68A74; Fri, 8 Jan 2016 21:25:28 +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 546CD1D58; Fri, 8 Jan 2016 21:25:28 +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 u08LPRNx089713; Fri, 8 Jan 2016 21:25:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08LPROW089710; Fri, 8 Jan 2016 21:25:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601082125.u08LPROW089710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 8 Jan 2016 21:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293441 - head/tools/regression/geom_shsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 21:25:28 -0000 Author: ngie Date: Fri Jan 8 21:25:27 2016 New Revision: 293441 URL: https://svnweb.freebsd.org/changeset/base/293441 Log: - Add a geom_shsec specific cleanup function and trap on that function at exit so things are cleaned up properly - Use attach_md for attaching md(4) devices - Don't hardcode /tmp for temporary files, which violates the kyua sandbox MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/geom_shsec/conf.sh head/tools/regression/geom_shsec/test-1.t head/tools/regression/geom_shsec/test-2.t Modified: head/tools/regression/geom_shsec/conf.sh ============================================================================== --- head/tools/regression/geom_shsec/conf.sh Fri Jan 8 21:07:34 2016 (r293440) +++ head/tools/regression/geom_shsec/conf.sh Fri Jan 8 21:25:27 2016 (r293441) @@ -5,4 +5,11 @@ name="$(mktemp -u shsec.XXXXXX)" class="shsec" base=`basename $0` +shsec_test_cleanup() +{ + [ -c /dev/$class/$name ] && gshsec stop $name + geom_test_cleanup +} +trap shsec_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh Modified: head/tools/regression/geom_shsec/test-1.t ============================================================================== --- head/tools/regression/geom_shsec/test-1.t Fri Jan 8 21:07:34 2016 (r293440) +++ head/tools/regression/geom_shsec/test-1.t Fri Jan 8 21:25:27 2016 (r293441) @@ -5,15 +5,11 @@ echo "1..2" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us0 || exit 1 -mdconfig -a -t malloc -s 2M -u $us1 || exit 1 -mdconfig -a -t malloc -s 3M -u $us2 || exit 1 - -gshsec label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} 2>/dev/null || exit 1 +gshsec label $name /dev/${us0} /dev/${us1} /dev/${us2} 2>/dev/null || exit 1 devwait # Size of created device should be 1MB - 512B. @@ -30,8 +26,3 @@ if [ $sectorsize -eq 512 ]; then else echo "not ok 2" fi - -gshsec stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 Modified: head/tools/regression/geom_shsec/test-2.t ============================================================================== --- head/tools/regression/geom_shsec/test-2.t Fri Jan 8 21:07:34 2016 (r293440) +++ head/tools/regression/geom_shsec/test-2.t Fri Jan 8 21:25:27 2016 (r293441) @@ -5,21 +5,18 @@ echo "1..4" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` nblocks1=1024 nblocks2=`expr $nblocks1 + 1` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} count=$nblocks1 >/dev/null 2>&1 -mdconfig -a -t malloc -s $nblocks2 -u $us0 || exit 1 -mdconfig -a -t malloc -s $nblocks2 -u $us1 || exit 1 -mdconfig -a -t malloc -s $nblocks2 -u $us2 || exit 1 +us0=$(attach_md -t malloc -s $nblocks2) || exit 1 +us1=$(attach_md -t malloc -s $nblocks2) || exit 1 +us2=$(attach_md -t malloc -s $nblocks2) || exit 1 -gshsec label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gshsec label $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait dd if=${src} of=/dev/shsec/${name} count=$nblocks1 >/dev/null 2>&1 @@ -31,29 +28,25 @@ else echo "ok 1" fi -dd if=/dev/md${us0} of=${dst} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/${us0} of=${dst} count=$nblocks1 >/dev/null 2>&1 if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then echo "not ok 2" else echo "ok 2" fi -dd if=/dev/md${us1} of=${dst} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/${us1} of=${dst} count=$nblocks1 >/dev/null 2>&1 if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then echo "not ok 3" else echo "ok 3" fi -dd if=/dev/md${us2} of=${dst} count=$nblocks1 >/dev/null 2>&1 +dd if=/dev/${us2} of=${dst} count=$nblocks1 >/dev/null 2>&1 if [ `md5 -q ${src}` = `md5 -q ${dst}` ]; then echo "not ok 4" else echo "ok 4" fi -gshsec stop $name -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} From owner-svn-src-head@freebsd.org Fri Jan 8 21:28:11 2016 Return-Path: Delivered-To: svn-src-head@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 64C22A68B1A; Fri, 8 Jan 2016 21:28:11 +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 3DD8F1EEA; Fri, 8 Jan 2016 21:28:11 +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 u08LSASZ089839; Fri, 8 Jan 2016 21:28:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08LSA8A089836; Fri, 8 Jan 2016 21:28:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601082128.u08LSA8A089836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 8 Jan 2016 21:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293442 - head/tools/regression/geom_stripe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 21:28:11 -0000 Author: ngie Date: Fri Jan 8 21:28:09 2016 New Revision: 293442 URL: https://svnweb.freebsd.org/changeset/base/293442 Log: - Add a geom_stripe specific cleanup function and trap on that function at exit so things are cleaned up properly - Use attach_md for attaching md(4) devices - Don't hardcode /tmp for temporary files, which violates the kyua sandbox MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/geom_stripe/conf.sh head/tools/regression/geom_stripe/test-1.t head/tools/regression/geom_stripe/test-2.t Modified: head/tools/regression/geom_stripe/conf.sh ============================================================================== --- head/tools/regression/geom_stripe/conf.sh Fri Jan 8 21:25:27 2016 (r293441) +++ head/tools/regression/geom_stripe/conf.sh Fri Jan 8 21:28:09 2016 (r293442) @@ -5,4 +5,11 @@ name="$(mktemp -u stripe.XXXXXX)" class="stripe" base=`basename $0` +gstripe_test_cleanup() +{ + [ -c /dev/$class/$name ] && gstripe destroy $name + geom_test_cleanup +} +trap gstripe_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh Modified: head/tools/regression/geom_stripe/test-1.t ============================================================================== --- head/tools/regression/geom_stripe/test-1.t Fri Jan 8 21:25:27 2016 (r293441) +++ head/tools/regression/geom_stripe/test-1.t Fri Jan 8 21:28:09 2016 (r293442) @@ -5,13 +5,11 @@ echo "1..1" -us=45 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 -mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 - -gstripe create -s 16384 $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +gstripe create -s 16384 $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait # Size of created device should be 1MB * 3. @@ -23,8 +21,3 @@ if [ $size -eq 3145728 ]; then else echo "not ok 1" fi - -gstripe destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` Modified: head/tools/regression/geom_stripe/test-2.t ============================================================================== --- head/tools/regression/geom_stripe/test-2.t Fri Jan 8 21:25:27 2016 (r293441) +++ head/tools/regression/geom_stripe/test-2.t Fri Jan 8 21:28:09 2016 (r293442) @@ -5,18 +5,17 @@ echo "1..1" -us=45 tsize=3 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=1m count=$tsize >/dev/null 2>&1 -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 2M -u `expr $us + 1` || exit 1 -mdconfig -a -t malloc -s 3M -u `expr $us + 2` || exit 1 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -gstripe create -s 8192 $name /dev/md${us} /dev/md`expr $us + 1` /dev/md`expr $us + 2` || exit 1 +gstripe create -s 8192 $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait dd if=${src} of=/dev/stripe/${name} bs=1m count=$tsize >/dev/null 2>&1 @@ -28,8 +27,4 @@ else echo "ok 1" fi -gstripe destroy $name -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -mdconfig -d -u `expr $us + 2` rm -f ${src} ${dst} From owner-svn-src-head@freebsd.org Fri Jan 8 21:32:03 2016 Return-Path: Delivered-To: svn-src-head@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 2981DA68C9F; Fri, 8 Jan 2016 21:32:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 13E0212B2; Fri, 8 Jan 2016 21:32:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u08LW2OZ012178 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 8 Jan 2016 13:32:02 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u08LW2Q4012177; Fri, 8 Jan 2016 13:32:02 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 8 Jan 2016 13:32:02 -0800 From: Gleb Smirnoff To: NGie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293439 - in head: lib/libc/sys sys/dev/ti sys/kern sys/sys usr.bin/netstat Message-ID: <20160108213202.GI1906@FreeBSD.org> References: <201601082034.u08KYvLv075281@repo.freebsd.org> <96B980EE-FD2F-490E-BA5E-4F23A67CEB18@gmail.com> <20160108211041.GG1906@FreeBSD.org> <88B48C42-DFEF-4CAE-973E-BDF2A408B4A3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <88B48C42-DFEF-4CAE-973E-BDF2A408B4A3@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 21:32:03 -0000 On Fri, Jan 08, 2016 at 01:22:45PM -0800, NGie Cooper wrote: N> > 1) The review requests were sent continuosly to arch@ during last 1.5 years. N> > N> > https://lists.freebsd.org/pipermail/freebsd-arch/2014-May/015385.html N> > N> > 2) Team of engineers at Netflix has a lot of code build on top of that code, N> > e.g. SSL_sendfile(). Of course, writing something on top assumes reviewing, N> > so assume it reviewed thoroughly by rrs@. Actually, here is list of people N> > who did some review of the code: emax@, rrs@, scottl@, gallatin@, imp@. N> > N> > 3) Do you have any particulars concerns with this change or those made recently N> > to sys/kern and sys/net*? N> N> I don’t as of right now, other than it’s really difficult to audit changes and assess risk if someone doesn’t have access to the CRs :(. N> N> Also… N> N> N> > An N> N> > explanation of why such behavior is beneficial compared to old one is N> N> > going to be too long for a commit message, so we will skip it here. N> N> This wasn’t really helpful. It would have been nice if there was a wiki page or some other reference used in this commit which would have described the where, why, and how behind this change a lot more. I'm writing status report on this right now. Also there is slideshare: http://www.slideshare.net/facepalmtarbz2/new-sendfile-in-english And there is even a paper, alas in Russian. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Jan 8 21:38:27 2016 Return-Path: Delivered-To: svn-src-head@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 A5952A68DE6; Fri, 8 Jan 2016 21:38:27 +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 7D9761531; Fri, 8 Jan 2016 21:38:27 +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 u08LcQeO092767; Fri, 8 Jan 2016 21:38:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08LcQAf092764; Fri, 8 Jan 2016 21:38:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601082138.u08LcQAf092764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 8 Jan 2016 21:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293443 - head/tools/regression/geom_uzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 21:38:27 -0000 Author: ngie Date: Fri Jan 8 21:38:26 2016 New Revision: 293443 URL: https://svnweb.freebsd.org/changeset/base/293443 Log: - Make test-1.sh into a TAP testable testcase - Delete test-2.sh as it was an incomplete testcase, and the contents were basically a subset of test-1.sh - Add a conf.sh file for executing common functions with geom_uzip - Use attach_md for attaching md(4) devices - Don't hardcode /tmp for temporary files, which violates the kyua sandbox MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Added: head/tools/regression/geom_uzip/conf.sh (contents, props changed) head/tools/regression/geom_uzip/test-1.t - copied, changed from r293442, head/tools/regression/geom_uzip/test-1.sh Deleted: head/tools/regression/geom_uzip/runtests.sh head/tools/regression/geom_uzip/test-1.sh head/tools/regression/geom_uzip/test-2.sh Modified: head/tools/regression/geom_uzip/Makefile Modified: head/tools/regression/geom_uzip/Makefile ============================================================================== --- head/tools/regression/geom_uzip/Makefile Fri Jan 8 21:28:09 2016 (r293442) +++ head/tools/regression/geom_uzip/Makefile Fri Jan 8 21:38:26 2016 (r293443) @@ -9,7 +9,7 @@ ZIMAGE= ${IMAGE}.uzip UZIMAGE= ${ZIMAGE}.uue test: - @sh runtests.sh + prove -rv ./test-1.t image: makefs -s 1048576 ${IMAGE} etalon Added: head/tools/regression/geom_uzip/conf.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/geom_uzip/conf.sh Fri Jan 8 21:38:26 2016 (r293443) @@ -0,0 +1,20 @@ +#!/bin/sh +# $FreeBSD$ + +class="uzip" +base=`basename $0` + +uzip_test_cleanup() +{ + if [ -n "$mntpoint" ]; then + umount $mntpoint + rmdir $mntpoint + fi + geom_test_cleanup +} +trap uzip_test_cleanup ABRT EXIT INT TERM + +. `dirname $0`/../geom_subr.sh + +# NOTE: make sure $TMPDIR has been set by geom_subr.sh if unset [by kyua, etc] +mntpoint=$(mktemp -d tmp.XXXXXX) || exit Copied and modified: head/tools/regression/geom_uzip/test-1.t (from r293442, head/tools/regression/geom_uzip/test-1.sh) ============================================================================== --- head/tools/regression/geom_uzip/test-1.sh Fri Jan 8 21:28:09 2016 (r293442, copy source) +++ head/tools/regression/geom_uzip/test-1.t Fri Jan 8 21:38:26 2016 (r293443) @@ -1,36 +1,22 @@ #!/bin/sh -# # $FreeBSD$ -# -mntpoint="/mnt/test-1" +testsdir=$(dirname $0) +. $testsdir/conf.sh -# -# prepare -kldload geom_uzip -uudecode test-1.img.uzip.uue -num=`mdconfig -an -f test-1.img.uzip` || exit 1 +echo "1..1" + +UUE=$testsdir/test-1.img.uzip.uue +uudecode $UUE +us0=$(attach_md -f $(basename $UUE .uue)) || exit 1 sleep 1 -# -# mount -mkdir -p "${mntpoint}" -mount -o ro /dev/md${num}.uzip "${mntpoint}" || exit 1 +mount -o ro /dev/${us0}.uzip "${mntpoint}" || exit 1 -# -# compare #cat "${mntpoint}/etalon.txt" -diff -u etalon/etalon.txt "${mntpoint}/etalon.txt" +diff -I '\$FreeBSD.*\$' -u $testsdir/etalon/etalon.txt "${mntpoint}/etalon.txt" if [ $? -eq 0 ]; then - echo "PASS" + echo "ok 1" else - echo "FAIL" + echo "not ok 1" fi - -# -# cleanup -umount "${mntpoint}" -rmdir "${mntpoint}" -mdconfig -d -u ${num} -sleep 1 -kldunload geom_uzip From owner-svn-src-head@freebsd.org Fri Jan 8 21:47:43 2016 Return-Path: Delivered-To: svn-src-head@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 2789DA6731C; Fri, 8 Jan 2016 21:47:43 +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 CF62B1ED0; Fri, 8 Jan 2016 21:47:42 +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 u08LlfAp095979; Fri, 8 Jan 2016 21:47:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08LlfI7095978; Fri, 8 Jan 2016 21:47:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601082147.u08LlfI7095978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 8 Jan 2016 21:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293444 - head/tools/regression X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 21:47:43 -0000 Author: ngie Date: Fri Jan 8 21:47:41 2016 New Revision: 293444 URL: https://svnweb.freebsd.org/changeset/base/293444 Log: - Move functions that might be used in class-specific cleanup functions (geom_test_cleanup, etc) down so the testcases don't emit noise when bailing - Conform to the TAP protocol better when dealing with classes that can't be loaded and with temporary files that can't be allocated for tracking md(4) devices. MFC after: 2 weeks X-MFC with: r293028, r293029, r293048 Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/geom_subr.sh Modified: head/tools/regression/geom_subr.sh ============================================================================== --- head/tools/regression/geom_subr.sh Fri Jan 8 21:38:26 2016 (r293443) +++ head/tools/regression/geom_subr.sh Fri Jan 8 21:47:41 2016 (r293444) @@ -1,13 +1,6 @@ #!/bin/sh # $FreeBSD$ -if [ $(id -u) -ne 0 ]; then - echo 'Tests must be run as root' - echo 'Bail out!' - exit 1 -fi -kldstat -q -m g_${class} || geom ${class} load || exit 1 - devwait() { while :; do @@ -18,13 +11,6 @@ devwait() done } -# Need to keep track of the test md devices to avoid the scenario where a test -# failing will cause the other tests to bomb out, or a test failing will leave -# a large number of md(4) devices lingering around -: ${TMPDIR=/tmp} -export TMPDIR -TEST_MDS_FILE=$(mktemp ${TMPDIR}/test_mds.XXXXXX) || exit 1 - attach_md() { local test_md @@ -38,12 +24,37 @@ geom_test_cleanup() { local test_md - if [ -f $TEST_MDS_FILE ]; then + if [ -f "$TEST_MDS_FILE" ]; then while read test_md; do # The "#" tells the TAP parser this is a comment echo "# Removing test memory disk: $test_md" mdconfig -d -u $test_md done < $TEST_MDS_FILE fi - rm -f $TEST_MDS_FILE + rm -f "$TEST_MDS_FILE" } + +if [ $(id -u) -ne 0 ]; then + echo 'Tests must be run as root' + echo 'Bail out!' + exit 1 +fi +# If the geom class isn't already loaded, try loading it. +if ! kldstat -q -m g_${class}; then + if ! geom ${class} load; then + echo "Could not load module for geom class=${class}" + echo 'Bail out!' + exit 1 + fi +fi + +# Need to keep track of the test md devices to avoid the scenario where a test +# failing will cause the other tests to bomb out, or a test failing will leave +# a large number of md(4) devices lingering around +: ${TMPDIR=/tmp} +export TMPDIR +if ! TEST_MDS_FILE=$(mktemp ${TMPDIR}/test_mds.XXXXXX); then + echo 'Failed to create temporary file for tracking the test md(4) devices' + echo 'Bail out!' + exit 1 +fi From owner-svn-src-head@freebsd.org Fri Jan 8 21:47:50 2016 Return-Path: Delivered-To: svn-src-head@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 972A7A6734D; Fri, 8 Jan 2016 21:47:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77EDA1028; Fri, 8 Jan 2016 21:47:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id EE04EB917; Fri, 8 Jan 2016 16:47:48 -0500 (EST) From: John Baldwin To: Jilles Tjoelker Cc: Chagin Dmitry , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r277610 - in head: bin/ln lib/libc/include lib/libc/sys share/man/man4 sys/compat/freebsd32 sys/kern sys/sys usr.bin/kdump Date: Fri, 08 Jan 2016 13:17:33 -0800 Message-ID: <2664148.V3yn9h2OfA@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160107201737.GA51187@stack.nl> References: <201501232107.t0NL79a8099736@svn.freebsd.org> <20160107130325.GA62399@chd.heemeyer.club> <20160107201737.GA51187@stack.nl> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 08 Jan 2016 16:47:49 -0500 (EST) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 21:47:50 -0000 On Thursday, January 07, 2016 09:17:37 PM Jilles Tjoelker wrote: > On Thu, Jan 07, 2016 at 04:03:25PM +0300, Chagin Dmitry wrote: > > On Fri, Jan 23, 2015 at 09:07:09PM +0000, Jilles Tjoelker wrote: > > > Author: jilles > > > Date: Fri Jan 23 21:07:08 2015 > > > New Revision: 277610 > > > URL: https://svnweb.freebsd.org/changeset/base/277610 > > > > Log: > > > Add futimens and utimensat system calls. > > > > The core kernel part is patch file utimes.2008.4.diff from > > > pluknet@FreeBSD.org. I updated the code for API changes, added the manual > > > page and added compatibility code for old kernels. There is also audit and > > > Capsicum support. > > > > A new UTIME_* constant might allow setting birthtimes in future. > > > > Differential Revision: https://reviews.freebsd.org/D1426 > > > Submitted by: pluknet (partially) > > > Reviewed by: delphij, pluknet, rwatson > > > Relnotes: yes > > > any chances that it will be merged to 10? if not, can I merge kernel > > part only? > > I don't plan an MFC because I don't think the trouble of not being able > to run a binary compiled on a newer stable/10 on an older stable/10 is > worth it. We've never provided that ABI guarantee. We only provide backwards compat, not forwards compat. Official packages are built against the oldest supported version on each stable branch for that reason, so if you MFC this change, 10.x packages will not start using it until 10.3 becomes the oldest supported release for 10.x. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Jan 8 22:59:50 2016 Return-Path: Delivered-To: svn-src-head@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 656FEA68B2F; Fri, 8 Jan 2016 22:59:50 +0000 (UTC) (envelope-from bdrewery@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 3994910E9; Fri, 8 Jan 2016 22:59:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u08MxnJS016877; Fri, 8 Jan 2016 22:59:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08MxnSn016876; Fri, 8 Jan 2016 22:59:49 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601082259.u08MxnSn016876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 8 Jan 2016 22:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293445 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 22:59:50 -0000 Author: bdrewery Date: Fri Jan 8 22:59:49 2016 New Revision: 293445 URL: https://svnweb.freebsd.org/changeset/base/293445 Log: Chase r292622: Update path to ioctl.c for incremental build hack. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jan 8 21:47:41 2016 (r293444) +++ head/Makefile.inc1 Fri Jan 8 22:59:49 2016 (r293445) @@ -570,9 +570,8 @@ _worldtmp: .PHONY .else rm -rf ${WORLDTMP}/legacy/usr/include # XXX - These three can depend on any header file. - rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c + rm -f ${OBJTREE}${.CURDIR}/lib/libsysdecode/ioctl.c rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c - rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c .endif .for _dir in \ lib usr legacy/bin legacy/usr From owner-svn-src-head@freebsd.org Fri Jan 8 23:38:35 2016 Return-Path: Delivered-To: svn-src-head@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 31948A67940 for ; Fri, 8 Jan 2016 23:38:35 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (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 B7525179D for ; Fri, 8 Jan 2016 23:38:34 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x230.google.com with SMTP id f206so152508098wmf.0 for ; Fri, 08 Jan 2016 15:38:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=8unOLfYpy/pSM5Qvw3n9IrpyPYjBrF/vvGf/w26csWs=; b=NqnEdt/fQvw3pWC3h7BcxLsckpCo4jNPhnX7CPiNO5KcZAZ3IROVSdslKWrfmGoKax CPHpt/LK+kP8TH8tjUYuyx+2GeSeV5urKauOrW4i+xk0hiVKue8XXNmeULrsK2aqnISz +BUxR2EyxV8DEIIQXskBm2sKRUpjmBHDDOGyg6HzDvoW8/tlxScDnhsHmyrFV3hgj1Ic 8CDJukeOyLjrgZbmy6Qrh9bY0JtfdL1StqGJ02hPkJDdS1H3zP0zepAXzCUTsm3jRJCR Zqzzyyr1RV6xpWKFum4QdJhStsrtYuJfx4vhxoQp8a1eqebBxWGUEN6O4c0vjcz5K7lk I5yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=8unOLfYpy/pSM5Qvw3n9IrpyPYjBrF/vvGf/w26csWs=; b=lYCtzBIPl/zWjwcybx05HHXLqqyZrMeCdQ+oQzEY1Q+aRokAEXeWlu5vxVruOYNhAy 3cvD1uPBk4D/4ut+ZM8Pw1CukEIjM6Cq/gqO0Wdv8t9yFuzZ6C+v1y0DFGyYEK5y+2eQ X072vCq3DRjPQtQ1gi3EqWNwtsAvf5IpnIfvDr2G9pRZ+TXz03s28sblpTvsjlLMUHVA wmdut2xj8gEBdFS8WSvawhRHmDSm9RckjTfdWWT+aO8GhsxrbEZjes7Yx1PlSlUEA/FA cfO5WPO8b+rPLdOn3a2hE9lpH5z/7VAG+wjv0EmEXuQ0DIs8VSUrsb+PQC1bf9avwH5t T7xg== X-Gm-Message-State: ALoCoQnU6UjLzBPjNZT/QmCNSJPOPnv9kkbKF73GoiLLqfxhdq1TJ13bcSPZDefvTirnqtBypWA7BHUIrBof4thUj/ODgA30qDBtnH79D00FicbiETBJUb8= MIME-Version: 1.0 X-Received: by 10.194.223.39 with SMTP id qr7mr119866941wjc.63.1452296312224; Fri, 08 Jan 2016 15:38:32 -0800 (PST) Received: by 10.194.85.167 with HTTP; Fri, 8 Jan 2016 15:38:32 -0800 (PST) In-Reply-To: <201601041503.u04F3Lps031314@repo.freebsd.org> References: <201601041503.u04F3Lps031314@repo.freebsd.org> Date: Sat, 9 Jan 2016 00:38:32 +0100 Message-ID: Subject: Re: svn commit: r293159 - in head/sys: net netinet netinet6 From: Oliver Pinter To: "Alexander V. Chernikov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 23:38:35 -0000 On 1/4/16, Alexander V. Chernikov wrote: > Author: melifaro > Date: Mon Jan 4 15:03:20 2016 > New Revision: 293159 > URL: https://svnweb.freebsd.org/changeset/base/293159 > > Log: > Add rib_lookup_info() to provide API for retrieving individual route > entries data in unified format. > > There are control plane functions that require information other than > just next-hop data (e.g. individual rtentry fields like flags or > prefix/mask). Given that the goal is to avoid rte > reference/refcounting, > re-use rt_addrinfo structure to store most rte fields. If caller wants > to retrieve key/mask or gateway (which are sockaddrs and are allocated > separately), it needs to provide sufficient-sized sockaddrs structures > w/ ther pointers saved in passed rt_addrinfo. > > Convert: > * lltable new records checks (in_lltable_rtcheck(), > nd6_is_new_addr_neighbor(). > * rtsock pre-add/change route check. > * IPv6 NS ND-proxy check (RADIX_MPATH code was eliminated because > 1) we don't support RTF_ANNOUNCE ND-proxy for networks and there > should > not be multiple host routes for such hosts 2) if we have multiple > routes we should inspect them (which is not done). 3) the entire > idea > of abusing KRT as storage for ND proxy seems odd. Userland > programs > should be used for that purpose). > > Modified: > head/sys/net/route.c > head/sys/net/route.h > head/sys/net/rtsock.c > head/sys/netinet/in.c > head/sys/netinet6/nd6.c > head/sys/netinet6/nd6_nbr.c > > Modified: head/sys/net/route.c > ============================================================================== > --- head/sys/net/route.c Mon Jan 4 09:58:16 2016 (r293158) > +++ head/sys/net/route.c Mon Jan 4 15:03:20 2016 (r293159) > @@ -147,6 +147,8 @@ static void rt_notifydelete(struct rtent > static struct radix_node *rt_mpath_unlink(struct radix_node_head *rnh, > struct rt_addrinfo *info, struct rtentry *rto, int *perror); > #endif > +static int rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *info, > + int flags); > > struct if_mtuinfo > { > @@ -832,6 +834,147 @@ rtrequest_fib(int req, > > > /* > + * Copy most of @rt data into @info. > + * > + * If @flags contains NHR_COPY, copies dst,netmask and gw to the > + * pointers specified by @info structure. Assume such pointers > + * are zeroed sockaddr-like structures with sa_len field initialized > + * to reflect size of the provided buffer. if no NHR_COPY is specified, > + * point dst,netmask and gw @info fields to appropriate @rt values. > + * > + * if @flags contains NHR_REF, do refcouting on rt_ifp. > + * > + * Returns 0 on success. > + */ > +int > +rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *info, int flags) > +{ > + struct rt_metrics *rmx; > + struct sockaddr *src, *dst; > + int sa_len; > + > + if (flags & NHR_COPY) { > + /* Copy destination if dst is non-zero */ > + src = rt_key(rt); > + dst = info->rti_info[RTAX_DST]; > + sa_len = src->sa_len; ** CID 1347797: Null pointer dereferences (REVERSE_INULL) /sys/net/route.c: 861 in rt_exportinfo() ________________________________________________________________________________________________________ *** CID 1347797: Null pointer dereferences (REVERSE_INULL) /sys/net/route.c: 861 in rt_exportinfo() 855 856 if (flags & NHR_COPY) { 857 /* Copy destination if dst is non-zero */ 858 src = rt_key(rt); 859 dst = info->rti_info[RTAX_DST]; 860 sa_len = src->sa_len; >>> CID 1347797: Null pointer dereferences (REVERSE_INULL) >>> Null-checking "src" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. 861 if (src != NULL && dst != NULL) { 862 if (src->sa_len > dst->sa_len) 863 return (ENOMEM); 864 memcpy(dst, src, src->sa_len); 865 info->rti_addrs |= RTA_DST; 866 } > + if (src != NULL && dst != NULL) { > + if (src->sa_len > dst->sa_len) > + return (ENOMEM); > + memcpy(dst, src, src->sa_len); > + info->rti_addrs |= RTA_DST; > + } > + > + /* Copy mask if set && dst is non-zero */ [...] > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Sat Jan 9 00:42:09 2016 Return-Path: Delivered-To: svn-src-head@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 017F5A683D2; Sat, 9 Jan 2016 00:42:09 +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 D1E121DA7; Sat, 9 Jan 2016 00:42:08 +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 u090g7SL048647; Sat, 9 Jan 2016 00:42:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u090g7dX048643; Sat, 9 Jan 2016 00:42:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601090042.u090g7dX048643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 9 Jan 2016 00:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293450 - in head: gnu/lib/libgcc share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 00:42:09 -0000 Author: emaste Date: Sat Jan 9 00:42:07 2016 New Revision: 293450 URL: https://svnweb.freebsd.org/changeset/base/293450 Log: Support use of LLVM's libunwind for exception unwinding It is built in libgcc_s.so and libgcc_eh.a to simplify transition. It is enabled by default on arm64 (where we previously had no other unwinder) and may be enabled for testing on other platforms by setting WITH_LLVM_LIBUNWIND in src.conf(5). Also add compiler-rt's __gcc_personality_v0 implementation for use with the LLVM unwinder. Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4787 Added: head/tools/build/options/WITHOUT_LLVM_LIBUNWIND (contents, props changed) head/tools/build/options/WITH_LLVM_LIBUNWIND (contents, props changed) Modified: head/gnu/lib/libgcc/Makefile head/share/mk/src.opts.mk Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Sat Jan 9 00:34:48 2016 (r293449) +++ head/gnu/lib/libgcc/Makefile Sat Jan 9 00:42:07 2016 (r293450) @@ -2,6 +2,9 @@ GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs +COMPILERRTDIR= ${.CURDIR}/../../../contrib/compiler-rt +UNWINDINCDIR= ${.CURDIR}/../../../contrib/llvm/projects/libunwind/include +UNWINDSRCDIR= ${.CURDIR}/../../../contrib/llvm/projects/libunwind/src SHLIB_NAME= libgcc_s.so.1 SHLIBDIR?= /lib @@ -67,8 +70,37 @@ LIB2ADD = $(LIB2FUNCS_EXTRA) LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA) # Additional sources to handle exceptions; overridden by targets as needed. +.if ${MK_LLVM_LIBUNWIND} != "no" + +.PATH: ${COMPILERRTDIR}/lib/builtins +.PATH: ${UNWINDSRCDIR} +LIB2ADDEH = gcc_personality_v0.c \ + int_util.c \ + Unwind-EHABI.cpp \ + Unwind-sjlj.c \ + UnwindLevel1-gcc-ext.c \ + UnwindLevel1.c \ + UnwindRegistersRestore.S \ + UnwindRegistersSave.S \ + libunwind.cpp + +CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++11 +.endif +CXXFLAGS+= -fno-rtti + +.else # MK_LLVM_LIBUNWIND + +.if ${TARGET_CPUARCH} == "arm" +LIB2ADDEH = unwind-arm.c libunwind.S pr-support.c unwind-c.c +.else LIB2ADDEH = unwind-dw2.c unwind-dw2-fde-glibc.c unwind-sjlj.c gthr-gnat.c \ unwind-c.c +.endif + +.endif # MK_LLVM_LIBUNWIND + LIB2ADDEHSTATIC = $(LIB2ADDEH) LIB2ADDEHSHARED = $(LIB2ADDEH) @@ -116,7 +148,6 @@ CFLAGS.clang+= -fheinous-gnu-extensions LIB1ASMSRC = lib1funcs.asm LIB1ASMFUNCS = _dvmd_tls _bb_init_func -LIB2ADDEH = unwind-arm.c libunwind.S pr-support.c unwind-c.c # Some compilers generate __aeabi_ functions libgcc_s is missing LIBADD+= compiler_rt .endif @@ -160,7 +191,10 @@ LIB2_DIVMOD_FUNCS:= ${LIB2_DIVMOD_FUNCS: .endfor .endif -COMMONHDRS= tm.h tconfig.h options.h unwind.h gthr-default.h +COMMONHDRS= tm.h tconfig.h options.h gthr-default.h +.if ${MK_LLVM_LIBUNWIND} == no +COMMONHDRS+= unwind.h +.endif #----------------------------------------------------------------------- # @@ -170,6 +204,9 @@ HIDE = -fvisibility=hidden -DHIDE_EXPOR CC_T = ${CC} -c ${CFLAGS} ${HIDE} -fPIC CC_P = ${CC} -c ${CFLAGS} ${HIDE} -p -fPIC CC_S = ${CC} -c ${CFLAGS} ${PICFLAG} -DSHARED +CXX_T = ${CXX} -c ${CXXFLAGS} ${HIDE} -fPIC +CXX_P = ${CXX} -c ${CXXFLAGS} ${HIDE} -p -fPIC +CXX_S = ${CXX} -c ${CXXFLAGS} ${PICFLAG} -DSHARED #----------------------------------------------------------------------- # @@ -284,16 +321,26 @@ EH_OBJS_S = ${LIB2ADDEHSHARED:R:S/$/.So/ EH_CFLAGS = -fexceptions -D__GLIBC__=3 -DElfW=__ElfN SOBJS += ${EH_OBJS_S} -.for _src in ${LIB2ADDEHSTATIC} +.for _src in ${LIB2ADDEHSTATIC:M*.c} ${_src:R:S/$/.o/}: ${_src} ${COMMONHDRS} ${CC_T} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC} ${_src:R:S/$/.po/}: ${_src} ${COMMONHDRS} ${CC_P} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC} .endfor -.for _src in ${LIB2ADDEHSHARED} +.for _src in ${LIB2ADDEHSTATIC:M*.cpp} +${_src:R:S/$/.o/}: ${_src} ${COMMONHDRS} + ${CXX_T} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC} +${_src:R:S/$/.po/}: ${_src} ${COMMONHDRS} + ${CXX_P} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC} +.endfor +.for _src in ${LIB2ADDEHSHARED:M*.c} ${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS} ${CC_S} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC} .endfor +.for _src in ${LIB2ADDEHSHARED:M*.cpp} +${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS} + ${CXX_S} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC} +.endfor #----------------------------------------------------------------------- Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sat Jan 9 00:34:48 2016 (r293449) +++ head/share/mk/src.opts.mk Sat Jan 9 00:42:07 2016 (r293450) @@ -231,9 +231,9 @@ __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTST # In-tree binutils/gcc are older versions without modern architecture support. .if ${__T} == "aarch64" || ${__T} == "riscv64" BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB -__DEFAULT_YES_OPTIONS+=ELFCOPY_AS_OBJCOPY +__DEFAULT_YES_OPTIONS+=ELFCOPY_AS_OBJCOPY LLVM_LIBUNWIND .else -__DEFAULT_NO_OPTIONS+=ELFCOPY_AS_OBJCOPY +__DEFAULT_NO_OPTIONS+=ELFCOPY_AS_OBJCOPY LLVM_LIBUNWIND .endif .if ${__T} == "riscv64" BROKEN_OPTIONS+=PROFILE # "sorry, unimplemented: profiler support for RISC-V" Added: head/tools/build/options/WITHOUT_LLVM_LIBUNWIND ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LLVM_LIBUNWIND Sat Jan 9 00:42:07 2016 (r293450) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to use GCC's stack unwinder (instead of LLVM's libunwind). Added: head/tools/build/options/WITH_LLVM_LIBUNWIND ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LLVM_LIBUNWIND Sat Jan 9 00:42:07 2016 (r293450) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). From owner-svn-src-head@freebsd.org Sat Jan 9 00:43:12 2016 Return-Path: Delivered-To: svn-src-head@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 96A54A6846D; Sat, 9 Jan 2016 00:43:12 +0000 (UTC) (envelope-from bdrewery@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 687271F58; Sat, 9 Jan 2016 00:43:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u090hB8e049339; Sat, 9 Jan 2016 00:43:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u090hBXa049338; Sat, 9 Jan 2016 00:43:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601090043.u090hBXa049338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 9 Jan 2016 00:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293451 - head/sys/boot/userboot/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 00:43:12 -0000 Author: bdrewery Date: Sat Jan 9 00:43:11 2016 New Revision: 293451 URL: https://svnweb.freebsd.org/changeset/base/293451 Log: Update dependencies. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/boot/userboot/libstand/Makefile.depend Modified: head/sys/boot/userboot/libstand/Makefile.depend ============================================================================== --- head/sys/boot/userboot/libstand/Makefile.depend Sat Jan 9 00:42:07 2016 (r293450) +++ head/sys/boot/userboot/libstand/Makefile.depend Sat Jan 9 00:43:11 2016 (r293451) @@ -6,7 +6,6 @@ DIRDEPS = \ include/arpa \ include/xlocale \ lib/libbz2 \ - lib/libstand \ .include From owner-svn-src-head@freebsd.org Sat Jan 9 00:45:39 2016 Return-Path: Delivered-To: svn-src-head@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 E3A8BA6869B; Sat, 9 Jan 2016 00:45:39 +0000 (UTC) (envelope-from gjb@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 B455E131D; Sat, 9 Jan 2016 00:45:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u090jcEF049487; Sat, 9 Jan 2016 00:45:38 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u090jcaa049486; Sat, 9 Jan 2016 00:45:38 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201601090045.u090jcaa049486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 9 Jan 2016 00:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293452 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 00:45:40 -0000 Author: gjb Date: Sat Jan 9 00:45:38 2016 New Revision: 293452 URL: https://svnweb.freebsd.org/changeset/base/293452 Log: Set FORCE_PKG_REGISTER=1 when installing packages to avoid failures when re-using build chroot(8) environments. This is based on the patch in the PR referenced below, but instead of using 'reinstall' in two locations (one of which already uses FORCE_PKG_REGISTER=1), changes the non-embedded behavior. PR: 205998 Submitted by: ngie MFC after: 5 days Sponsored by: The FreeBSD Foundation Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Sat Jan 9 00:43:11 2016 (r293451) +++ head/release/release.sh Sat Jan 9 00:45:38 2016 (r293452) @@ -275,6 +275,7 @@ extra_chroot_setup() { PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}" chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ ${PBUILD_FLAGS} OPTIONS_UNSET="FOP IGOR" \ + FORCE_PKG_REGISTER=1 \ install clean distclean fi fi From owner-svn-src-head@freebsd.org Sat Jan 9 00:47:02 2016 Return-Path: Delivered-To: svn-src-head@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 E378BA68759; Sat, 9 Jan 2016 00:47:02 +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 9AF0514D6; Sat, 9 Jan 2016 00:47:02 +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 u090l11N049588; Sat, 9 Jan 2016 00:47:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u090l1S5049587; Sat, 9 Jan 2016 00:47:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601090047.u090l1S5049587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 9 Jan 2016 00:47:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293453 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 00:47:03 -0000 Author: emaste Date: Sat Jan 9 00:47:01 2016 New Revision: 293453 URL: https://svnweb.freebsd.org/changeset/base/293453 Log: Regen after r293450 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat Jan 9 00:45:38 2016 (r293452) +++ head/share/man/man5/src.conf.5 Sat Jan 9 00:47:01 2016 (r293453) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd December 15, 2015 +.Dd January 9, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -948,9 +948,30 @@ Set to not build the .Nm libthr (1:1 threading) library. +.It Va WITHOUT_LLDB +.\" from FreeBSD: head/tools/build/options/WITHOUT_LLDB 289275 2015-10-14 00:23:31Z emaste +Set to not build the LLDB debugger. +.Pp +It is a default setting on +arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITH_LLDB .\" from FreeBSD: head/tools/build/options/WITH_LLDB 255722 2013-09-20 01:52:02Z emaste Set to build the LLDB debugger. +.Pp +It is a default setting on +amd64/amd64 and arm64/aarch64. +.It Va WITHOUT_LLVM_LIBUNWIND +.\" from FreeBSD: head/tools/build/options/WITHOUT_LLVM_LIBUNWIND 293450 2016-01-09 00:42:07Z emaste +Set to use GCC's stack unwinder (instead of LLVM's libunwind). +.Pp +It is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +.It Va WITH_LLVM_LIBUNWIND +.\" from FreeBSD: head/tools/build/options/WITH_LLVM_LIBUNWIND 293450 2016-01-09 00:42:07Z emaste +Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). +.Pp +It is a default setting on +arm64/aarch64. .It Va WITHOUT_LOCALES .\" from FreeBSD: head/tools/build/options/WITHOUT_LOCALES 156932 2006-03-21 07:50:50Z ru Set to not build localization files; see From owner-svn-src-head@freebsd.org Sat Jan 9 00:54:10 2016 Return-Path: Delivered-To: svn-src-head@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 13BE8A68A6C; Sat, 9 Jan 2016 00:54:10 +0000 (UTC) (envelope-from allanjude@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 C5FB01A58; Sat, 9 Jan 2016 00:54:09 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u090s8Ss052459; Sat, 9 Jan 2016 00:54:08 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u090s8IU052456; Sat, 9 Jan 2016 00:54:08 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201601090054.u090s8IU052456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 9 Jan 2016 00:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293454 - in head/sys/boot: i386/loader userboot/userboot zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 00:54:10 -0000 Author: allanjude Date: Sat Jan 9 00:54:08 2016 New Revision: 293454 URL: https://svnweb.freebsd.org/changeset/base/293454 Log: Only call init_zfs_bootenv() when the system was booted with ZFS Add a few other safeguards to ensure things do not break when the boot device cannot be determined Reported by: flo MFC after: 3 days Sponsored by: ScaleEngine Inc. Modified: head/sys/boot/i386/loader/main.c head/sys/boot/userboot/userboot/main.c head/sys/boot/zfs/zfs.c Modified: head/sys/boot/i386/loader/main.c ============================================================================== --- head/sys/boot/i386/loader/main.c Sat Jan 9 00:47:01 2016 (r293453) +++ head/sys/boot/i386/loader/main.c Sat Jan 9 00:54:08 2016 (r293454) @@ -262,6 +262,7 @@ extract_currdev(void) new_currdev.d_kind.zfs.root_guid = 0; } new_currdev.d_dev = &zfs_dev; + init_zfs_bootenv(zfs_fmtdev(&new_currdev)); #endif } else if ((initial_bootdev & B_MAGICMASK) != B_DEVMAGIC) { /* The passed-in boot device is bad */ @@ -295,10 +296,6 @@ extract_currdev(void) new_currdev.d_unit = 0; } -#ifdef LOADER_ZFS_SUPPORT - init_zfs_bootenv(zfs_fmtdev(&new_currdev)); -#endif - env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev), i386_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset, @@ -311,9 +308,14 @@ init_zfs_bootenv(char *currdev) { char *beroot; + if (strlen(currdev) == 0) + return; + if(strncmp(currdev, "zfs:", 4) != 0) + return; /* Remove the trailing : */ currdev[strlen(currdev) - 1] = '\0'; setenv("zfs_be_active", currdev, 1); + setenv("zfs_be_currpage", "1", 1); /* Do not overwrite if already set */ setenv("vfs.root.mountfrom", currdev, 0); /* Forward past zfs: */ @@ -323,9 +325,7 @@ init_zfs_bootenv(char *currdev) beroot = strrchr(currdev, '/'); if (beroot != NULL) beroot[0] = '\0'; - beroot = currdev; - setenv("zfs_be_root", beroot, 1); } #endif @@ -394,6 +394,7 @@ static int command_reloadbe(int argc, char *argv[]) { int err; + char *root; if (argc > 2) { command_errmsg = "wrong number of arguments"; @@ -403,6 +404,11 @@ command_reloadbe(int argc, char *argv[]) if (argc == 2) { err = zfs_bootenv(argv[1]); } else { + root = getenv("zfs_be_root"); + if (root == NULL) { + /* There does not appear to be a ZFS pool here, exit without error */ + return (CMD_OK); + } err = zfs_bootenv(getenv("zfs_be_root")); } Modified: head/sys/boot/userboot/userboot/main.c ============================================================================== --- head/sys/boot/userboot/userboot/main.c Sat Jan 9 00:47:01 2016 (r293453) +++ head/sys/boot/userboot/userboot/main.c Sat Jan 9 00:54:08 2016 (r293454) @@ -168,6 +168,7 @@ extract_currdev(void) zdev.d_type = zdev.d_dev->dv_type; dev = *(struct disk_devdesc *)&zdev; + init_zfs_bootenv(zfs_fmtdev(&dev)); } else #endif @@ -191,10 +192,6 @@ extract_currdev(void) dev.d_unit = 0; } -#if defined(USERBOOT_ZFS_SUPPORT) - init_zfs_bootenv(zfs_fmtdev(&dev)); -#endif - env_setenv("currdev", EV_VOLATILE, userboot_fmtdev(&dev), userboot_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, userboot_fmtdev(&dev), @@ -207,9 +204,14 @@ init_zfs_bootenv(char *currdev) { char *beroot; + if (strlen(currdev) == 0) + return; + if(strncmp(currdev, "zfs:", 4) != 0) + return; /* Remove the trailing : */ currdev[strlen(currdev) - 1] = '\0'; setenv("zfs_be_active", currdev, 1); + setenv("zfs_be_currpage", "1", 1); /* Do not overwrite if already set */ setenv("vfs.root.mountfrom", currdev, 0); /* Forward past zfs: */ @@ -219,9 +221,7 @@ init_zfs_bootenv(char *currdev) beroot = strrchr(currdev, '/'); if (beroot != NULL) beroot[0] = '\0'; - beroot = currdev; - setenv("zfs_be_root", beroot, 1); } @@ -273,6 +273,7 @@ static int command_reloadbe(int argc, char *argv[]) { int err; + char *root; if (argc > 2) { command_errmsg = "wrong number of arguments"; @@ -282,7 +283,11 @@ command_reloadbe(int argc, char *argv[]) if (argc == 2) { err = zfs_bootenv(argv[1]); } else { - err = zfs_bootenv(getenv("zfs_be_root")); + root = getenv("zfs_be_root"); + if (root == NULL) { + return (CMD_OK); + } + err = zfs_bootenv(root); } if (err != 0) { Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Sat Jan 9 00:47:01 2016 (r293453) +++ head/sys/boot/zfs/zfs.c Sat Jan 9 00:54:08 2016 (r293454) @@ -712,13 +712,18 @@ zfs_list(const char *name) int zfs_bootenv(const char *name) { - static char poolname[ZFS_MAXNAMELEN], *dsname; + static char poolname[ZFS_MAXNAMELEN], *dsname, *root; char becount[4]; uint64_t objid; spa_t *spa; int len, rv, pages, perpage, currpage; - if (strcmp(name, getenv("zfs_be_root")) != 0) { + if (name == NULL) + return (EINVAL); + if ((root = getenv("zfs_be_root")) == NULL) + return (EINVAL); + + if (strcmp(name, root) != 0) { if (setenv("zfs_be_root", name, 1) != 0) return (ENOMEM); } From owner-svn-src-head@freebsd.org Sat Jan 9 01:56:47 2016 Return-Path: Delivered-To: svn-src-head@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 AAA46A67D45; Sat, 9 Jan 2016 01:56:47 +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 6E5D0139A; Sat, 9 Jan 2016 01:56:47 +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 u091ukur069963; Sat, 9 Jan 2016 01:56:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u091ukMo069962; Sat, 9 Jan 2016 01:56:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201601090156.u091ukMo069962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 9 Jan 2016 01:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293458 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 01:56:47 -0000 Author: markj Date: Sat Jan 9 01:56:46 2016 New Revision: 293458 URL: https://svnweb.freebsd.org/changeset/base/293458 Log: Prevent cv_waiters wraparound. r282971 attempted to fix this problem by decrementing cv_waiters after waking up from sleeping on a condition variable, but this can result in a use-after-free if the CV is freed before all woken threads have had a chance to run. Instead, avoid incrementing cv_waiters past INT_MAX, and have cv_signal() explicitly check for sleeping threads once cv_waiters has reached this bound. Reviewed by: jhb MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D4822 Modified: head/sys/kern/kern_condvar.c Modified: head/sys/kern/kern_condvar.c ============================================================================== --- head/sys/kern/kern_condvar.c Sat Jan 9 01:43:53 2016 (r293457) +++ head/sys/kern/kern_condvar.c Sat Jan 9 01:56:46 2016 (r293458) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -47,6 +48,17 @@ __FBSDID("$FreeBSD$"); #endif /* + * A bound below which cv_waiters is valid. Once cv_waiters reaches this bound, + * cv_signal must manually check the wait queue for threads. + */ +#define CV_WAITERS_BOUND INT_MAX + +#define CV_WAITERS_INC(cvp) do { \ + if ((cvp)->cv_waiters < CV_WAITERS_BOUND) \ + (cvp)->cv_waiters++; \ +} while (0) + +/* * Common sanity checks for cv_wait* functions. */ #define CV_ASSERT(cvp, lock, td) do { \ @@ -122,7 +134,7 @@ _cv_wait(struct cv *cvp, struct lock_obj sleepq_lock(cvp); - cvp->cv_waiters++; + CV_WAITERS_INC(cvp); if (lock == &Giant.lock_object) mtx_assert(&Giant, MA_OWNED); DROP_GIANT(); @@ -184,7 +196,7 @@ _cv_wait_unlock(struct cv *cvp, struct l sleepq_lock(cvp); - cvp->cv_waiters++; + CV_WAITERS_INC(cvp); DROP_GIANT(); sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR, 0); @@ -240,7 +252,7 @@ _cv_wait_sig(struct cv *cvp, struct lock sleepq_lock(cvp); - cvp->cv_waiters++; + CV_WAITERS_INC(cvp); if (lock == &Giant.lock_object) mtx_assert(&Giant, MA_OWNED); DROP_GIANT(); @@ -307,7 +319,7 @@ _cv_timedwait_sbt(struct cv *cvp, struct sleepq_lock(cvp); - cvp->cv_waiters++; + CV_WAITERS_INC(cvp); if (lock == &Giant.lock_object) mtx_assert(&Giant, MA_OWNED); DROP_GIANT(); @@ -376,7 +388,7 @@ _cv_timedwait_sig_sbt(struct cv *cvp, st sleepq_lock(cvp); - cvp->cv_waiters++; + CV_WAITERS_INC(cvp); if (lock == &Giant.lock_object) mtx_assert(&Giant, MA_OWNED); DROP_GIANT(); @@ -422,8 +434,15 @@ cv_signal(struct cv *cvp) wakeup_swapper = 0; sleepq_lock(cvp); if (cvp->cv_waiters > 0) { - cvp->cv_waiters--; - wakeup_swapper = sleepq_signal(cvp, SLEEPQ_CONDVAR, 0, 0); + if (cvp->cv_waiters == CV_WAITERS_BOUND && + sleepq_lookup(cvp) == NULL) { + cvp->cv_waiters = 0; + } else { + if (cvp->cv_waiters < CV_WAITERS_BOUND) + cvp->cv_waiters--; + wakeup_swapper = sleepq_signal(cvp, SLEEPQ_CONDVAR, 0, + 0); + } } sleepq_release(cvp); if (wakeup_swapper) From owner-svn-src-head@freebsd.org Sat Jan 9 03:08:22 2016 Return-Path: Delivered-To: svn-src-head@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 71BE8A67384; Sat, 9 Jan 2016 03:08:22 +0000 (UTC) (envelope-from gnn@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 406AB12A3; Sat, 9 Jan 2016 03:08:22 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0938LPu090547; Sat, 9 Jan 2016 03:08:21 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0938LAm090546; Sat, 9 Jan 2016 03:08:21 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201601090308.u0938LAm090546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sat, 9 Jan 2016 03:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293459 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 03:08:22 -0000 Author: gnn Date: Sat Jan 9 03:08:21 2016 New Revision: 293459 URL: https://svnweb.freebsd.org/changeset/base/293459 Log: Add netmap support for bhyve Submitted by: btw MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4826 Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Sat Jan 9 01:56:46 2016 (r293458) +++ head/usr.sbin/bhyve/pci_virtio_net.c Sat Jan 9 03:08:21 2016 (r293459) @@ -36,6 +36,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifndef NETMAP_WITH_LIBS +#define NETMAP_WITH_LIBS +#endif +#include #include #include @@ -133,6 +137,8 @@ struct pci_vtnet_softc { struct mevent *vsc_mevp; int vsc_tapfd; + struct nm_desc *vsc_nmd; + int vsc_rx_ready; volatile int resetting; /* set and checked outside lock */ @@ -149,6 +155,10 @@ struct pci_vtnet_softc { pthread_mutex_t tx_mtx; pthread_cond_t tx_cond; int tx_in_progress; + + void (*pci_vtnet_rx)(struct pci_vtnet_softc *sc); + void (*pci_vtnet_tx)(struct pci_vtnet_softc *sc, struct iovec *iov, + int iovcnt, int len); }; static void pci_vtnet_reset(void *); @@ -371,14 +381,208 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc vq_endchains(vq, 1); } +static int +pci_vtnet_netmap_writev(struct nm_desc *nmd, struct iovec *iov, int iovcnt) +{ + int r, i; + int len = 0; + + for (r = nmd->cur_tx_ring; ; ) { + struct netmap_ring *ring = NETMAP_TXRING(nmd->nifp, r); + uint32_t cur, idx; + char *buf; + + if (nm_ring_empty(ring)) { + r++; + if (r > nmd->last_tx_ring) + r = nmd->first_tx_ring; + if (r == nmd->cur_rx_ring) + break; + continue; + } + cur = ring->cur; + idx = ring->slot[cur].buf_idx; + buf = NETMAP_BUF(ring, idx); + + for (i = 0; i < iovcnt; i++) { + memcpy(&buf[len], iov[i].iov_base, iov[i].iov_len); + len += iov[i].iov_len; + } + ring->slot[cur].len = len; + ring->head = ring->cur = nm_ring_next(ring, cur); + nmd->cur_tx_ring = r; + ioctl(nmd->fd, NIOCTXSYNC, NULL); + break; + } + + return (len); +} + +static inline int +pci_vtnet_netmap_readv(struct nm_desc *nmd, struct iovec *iov, int iovcnt) +{ + int len = 0; + int i = 0; + int r; + + for (r = nmd->cur_rx_ring; ; ) { + struct netmap_ring *ring = NETMAP_RXRING(nmd->nifp, r); + uint32_t cur, idx; + char *buf; + size_t left; + + if (nm_ring_empty(ring)) { + r++; + if (r > nmd->last_rx_ring) + r = nmd->first_rx_ring; + if (r == nmd->cur_rx_ring) + break; + continue; + } + cur = ring->cur; + idx = ring->slot[cur].buf_idx; + buf = NETMAP_BUF(ring, idx); + left = ring->slot[cur].len; + + for (i = 0; i < iovcnt && left > 0; i++) { + if (iov[i].iov_len > left) + iov[i].iov_len = left; + memcpy(iov[i].iov_base, &buf[len], iov[i].iov_len); + len += iov[i].iov_len; + left -= iov[i].iov_len; + } + ring->head = ring->cur = nm_ring_next(ring, cur); + nmd->cur_rx_ring = r; + ioctl(nmd->fd, NIOCRXSYNC, NULL); + break; + } + for (; i < iovcnt; i++) + iov[i].iov_len = 0; + + return (len); +} + +/* + * Called to send a buffer chain out to the vale port + */ +static void +pci_vtnet_netmap_tx(struct pci_vtnet_softc *sc, struct iovec *iov, int iovcnt, + int len) +{ + static char pad[60]; /* all zero bytes */ + + if (sc->vsc_nmd == NULL) + return; + + /* + * If the length is < 60, pad out to that and add the + * extra zero'd segment to the iov. It is guaranteed that + * there is always an extra iov available by the caller. + */ + if (len < 60) { + iov[iovcnt].iov_base = pad; + iov[iovcnt].iov_len = 60 - len; + iovcnt++; + } + (void) pci_vtnet_netmap_writev(sc->vsc_nmd, iov, iovcnt); +} + +static void +pci_vtnet_netmap_rx(struct pci_vtnet_softc *sc) +{ + struct iovec iov[VTNET_MAXSEGS], *riov; + struct vqueue_info *vq; + void *vrx; + int len, n; + uint16_t idx; + + /* + * Should never be called without a valid netmap descriptor + */ + assert(sc->vsc_nmd != NULL); + + /* + * But, will be called when the rx ring hasn't yet + * been set up or the guest is resetting the device. + */ + if (!sc->vsc_rx_ready || sc->resetting) { + /* + * Drop the packet and try later. + */ + (void) nm_nextpkt(sc->vsc_nmd, (void *)dummybuf); + return; + } + + /* + * Check for available rx buffers + */ + vq = &sc->vsc_queues[VTNET_RXQ]; + if (!vq_has_descs(vq)) { + /* + * Drop the packet and try later. Interrupt on + * empty, if that's negotiated. + */ + (void) nm_nextpkt(sc->vsc_nmd, (void *)dummybuf); + vq_endchains(vq, 1); + return; + } + + do { + /* + * Get descriptor chain. + */ + n = vq_getchain(vq, &idx, iov, VTNET_MAXSEGS, NULL); + assert(n >= 1 && n <= VTNET_MAXSEGS); + + /* + * Get a pointer to the rx header, and use the + * data immediately following it for the packet buffer. + */ + vrx = iov[0].iov_base; + riov = rx_iov_trim(iov, &n, sc->rx_vhdrlen); + + len = pci_vtnet_netmap_readv(sc->vsc_nmd, riov, n); + + if (len == 0) { + /* + * No more packets, but still some avail ring + * entries. Interrupt if needed/appropriate. + */ + vq_endchains(vq, 0); + return; + } + + /* + * The only valid field in the rx packet header is the + * number of buffers if merged rx bufs were negotiated. + */ + memset(vrx, 0, sc->rx_vhdrlen); + + if (sc->rx_merge) { + struct virtio_net_rxhdr *vrxh; + + vrxh = vrx; + vrxh->vrh_bufs = 1; + } + + /* + * Release this chain and handle more chains. + */ + vq_relchain(vq, idx, len + sc->rx_vhdrlen); + } while (vq_has_descs(vq)); + + /* Interrupt if needed, including for NOTIFY_ON_EMPTY. */ + vq_endchains(vq, 1); +} + static void -pci_vtnet_tap_callback(int fd, enum ev_type type, void *param) +pci_vtnet_rx_callback(int fd, enum ev_type type, void *param) { struct pci_vtnet_softc *sc = param; pthread_mutex_lock(&sc->rx_mtx); sc->rx_in_progress = 1; - pci_vtnet_tap_rx(sc); + sc->pci_vtnet_rx(sc); sc->rx_in_progress = 0; pthread_mutex_unlock(&sc->rx_mtx); @@ -421,7 +625,7 @@ pci_vtnet_proctx(struct pci_vtnet_softc } DPRINTF(("virtio: packet send, %d bytes, %d segs\n\r", plen, n)); - pci_vtnet_tap_tx(sc, &iov[1], n - 1, plen); + sc->pci_vtnet_tx(sc, &iov[1], n - 1, plen); /* chain is processed, release it and set tlen */ vq_relchain(vq, idx, tlen); @@ -532,6 +736,67 @@ pci_vtnet_parsemac(char *mac_str, uint8_ return (0); } +static void +pci_vtnet_tap_setup(struct pci_vtnet_softc *sc, char *devname) +{ + char tbuf[80]; + + strcpy(tbuf, "/dev/"); + strlcat(tbuf, devname, sizeof(tbuf)); + + sc->pci_vtnet_rx = pci_vtnet_tap_rx; + sc->pci_vtnet_tx = pci_vtnet_tap_tx; + + sc->vsc_tapfd = open(tbuf, O_RDWR); + if (sc->vsc_tapfd == -1) { + WPRINTF(("open of tap device %s failed\n", tbuf)); + return; + } + + /* + * Set non-blocking and register for read + * notifications with the event loop + */ + int opt = 1; + if (ioctl(sc->vsc_tapfd, FIONBIO, &opt) < 0) { + WPRINTF(("tap device O_NONBLOCK failed\n")); + close(sc->vsc_tapfd); + sc->vsc_tapfd = -1; + } + + sc->vsc_mevp = mevent_add(sc->vsc_tapfd, + EVF_READ, + pci_vtnet_rx_callback, + sc); + if (sc->vsc_mevp == NULL) { + WPRINTF(("Could not register event\n")); + close(sc->vsc_tapfd); + sc->vsc_tapfd = -1; + } +} + +static void +pci_vtnet_netmap_setup(struct pci_vtnet_softc *sc, char *ifname) +{ + sc->pci_vtnet_rx = pci_vtnet_netmap_rx; + sc->pci_vtnet_tx = pci_vtnet_netmap_tx; + + sc->vsc_nmd = nm_open(ifname, NULL, 0, 0); + if (sc->vsc_nmd == NULL) { + WPRINTF(("open of netmap device %s failed\n", ifname)); + return; + } + + sc->vsc_mevp = mevent_add(sc->vsc_nmd->fd, + EVF_READ, + pci_vtnet_rx_callback, + sc); + if (sc->vsc_mevp == NULL) { + WPRINTF(("Could not register event\n")); + nm_close(sc->vsc_nmd); + sc->vsc_nmd = NULL; + } +} static int pci_vtnet_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) @@ -567,8 +832,8 @@ pci_vtnet_init(struct vmctx *ctx, struct */ mac_provided = 0; sc->vsc_tapfd = -1; + sc->vsc_nmd = NULL; if (opts != NULL) { - char tbuf[80]; int err; devname = vtopts = strdup(opts); @@ -583,36 +848,12 @@ pci_vtnet_init(struct vmctx *ctx, struct mac_provided = 1; } - strcpy(tbuf, "/dev/"); - strlcat(tbuf, devname, sizeof(tbuf)); + if (strncmp(devname, "vale", 4) == 0) + pci_vtnet_netmap_setup(sc, devname); + if (strncmp(devname, "tap", 3) == 0) + pci_vtnet_tap_setup(sc, devname); free(devname); - - sc->vsc_tapfd = open(tbuf, O_RDWR); - if (sc->vsc_tapfd == -1) { - WPRINTF(("open of tap device %s failed\n", tbuf)); - } else { - /* - * Set non-blocking and register for read - * notifications with the event loop - */ - int opt = 1; - if (ioctl(sc->vsc_tapfd, FIONBIO, &opt) < 0) { - WPRINTF(("tap device O_NONBLOCK failed\n")); - close(sc->vsc_tapfd); - sc->vsc_tapfd = -1; - } - - sc->vsc_mevp = mevent_add(sc->vsc_tapfd, - EVF_READ, - pci_vtnet_tap_callback, - sc); - if (sc->vsc_mevp == NULL) { - WPRINTF(("Could not register event\n")); - close(sc->vsc_tapfd); - sc->vsc_tapfd = -1; - } - } } /* From owner-svn-src-head@freebsd.org Sat Jan 9 03:20:02 2016 Return-Path: Delivered-To: svn-src-head@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 C4A84A67766; Sat, 9 Jan 2016 03:20:02 +0000 (UTC) (envelope-from smh@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 7DCEB181C; Sat, 9 Jan 2016 03:20:02 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u093K1vT093417; Sat, 9 Jan 2016 03:20:01 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u093K1rY093415; Sat, 9 Jan 2016 03:20:01 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601090320.u093K1rY093415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Sat, 9 Jan 2016 03:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293460 - head/sys/boot/efi/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 03:20:02 -0000 Author: smh Date: Sat Jan 9 03:20:01 2016 New Revision: 293460 URL: https://svnweb.freebsd.org/changeset/base/293460 Log: Switch EFT boot1 to use libstand ARM and i386 already required libstand so switch to using it for all patforms, allowing the removal of custom print and memory methods. This is also a pre-cursor to enabling WARNS which highlighted a number of issues with the removed methods. MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/boot1/boot1.c Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Sat Jan 9 03:08:21 2016 (r293459) +++ head/sys/boot/efi/boot1/Makefile Sat Jan 9 03:20:01 2016 (r293460) @@ -41,14 +41,13 @@ CFLAGS+= -fPIC LDFLAGS+= -Wl,-znocombreloc .endif -.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "i386" # # Add libstand for the runtime functions used by the compiler - for example # __aeabi_* (arm) or __divdi3 (i386). +# as well as required string and memory functions for all platforms. # DPADD+= ${LIBSTAND} LDADD+= -lstand -.endif DPADD+= ${LDSCRIPT} Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Sat Jan 9 03:08:21 2016 (r293459) +++ head/sys/boot/efi/boot1/boot1.c Sat Jan 9 03:20:01 2016 (r293460) @@ -24,6 +24,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -33,28 +34,8 @@ __FBSDID("$FreeBSD$"); #define BSIZEMAX 16384 -typedef int putc_func_t(char c, void *arg); - -struct sp_data { - char *sp_buf; - u_int sp_len; - u_int sp_size; -}; - -static const char digits[] = "0123456789abcdef"; - -static void panic(const char *fmt, ...) __dead2; -static int printf(const char *fmt, ...); -static int putchar(char c, void *arg); -static int vprintf(const char *fmt, va_list ap); -static int vsnprintf(char *str, size_t sz, const char *fmt, va_list ap); - -static int __printf(const char *fmt, putc_func_t *putc, void *arg, va_list ap); -static int __putc(char c, void *arg); -static int __puts(const char *s, putc_func_t *putc, void *arg); -static int __sputc(char c, void *arg); -static char *__uitoa(char *buf, u_int val, int base); -static char *__ultoa(char *buf, u_long val, int base); +void panic(const char *fmt, ...) __dead2; +void putchar(int c); static int domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet); static void load(const char *fname); @@ -62,39 +43,6 @@ static void load(const char *fname); static EFI_SYSTEM_TABLE *systab; static EFI_HANDLE *image; -static void -bcopy(const void *src, void *dst, size_t len) -{ - const char *s = src; - char *d = dst; - - while (len-- != 0) - *d++ = *s++; -} - -static void -memcpy(void *dst, const void *src, size_t len) -{ - bcopy(src, dst, len); -} - -static void -bzero(void *b, size_t len) -{ - char *p = b; - - while (len-- != 0) - *p++ = 0; -} - -static int -strcmp(const char *s1, const char *s2) -{ - for (; *s1 == *s2 && *s1; s1++, s2++) - ; - return ((u_char)*s1 - (u_char)*s2); -} - static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; @@ -346,38 +294,22 @@ load(const char *fname) EFI_ERROR_CODE(status)); } -static void +void panic(const char *fmt, ...) { - char buf[128]; va_list ap; + printf("panic: "); va_start(ap, fmt); - vsnprintf(buf, sizeof buf, fmt, ap); - printf("panic: %s\n", buf); + vprintf(fmt, ap); va_end(ap); + printf("\n"); while (1) {} } -static int -printf(const char *fmt, ...) -{ - va_list ap; - int ret; - - /* Don't annoy the user as we probe for partitions */ - if (strcmp(fmt,"Not ufs\n") == 0) - return 0; - - va_start(ap, fmt); - ret = vprintf(fmt, ap); - va_end(ap); - return (ret); -} - -static int -putchar(char c, void *arg) +void +putchar(int c) { CHAR16 buf[2]; @@ -389,187 +321,4 @@ putchar(char c, void *arg) buf[0] = c; buf[1] = 0; systab->ConOut->OutputString(systab->ConOut, buf); - return (1); -} - -static int -vprintf(const char *fmt, va_list ap) -{ - int ret; - - ret = __printf(fmt, putchar, 0, ap); - return (ret); -} - -static int -vsnprintf(char *str, size_t sz, const char *fmt, va_list ap) -{ - struct sp_data sp; - int ret; - - sp.sp_buf = str; - sp.sp_len = 0; - sp.sp_size = sz; - ret = __printf(fmt, __sputc, &sp, ap); - return (ret); -} - -static int -__printf(const char *fmt, putc_func_t *putc, void *arg, va_list ap) -{ - char buf[(sizeof(long) * 8) + 1]; - char *nbuf; - u_long ul; - u_int ui; - int lflag; - int sflag; - char *s; - int pad; - int ret; - int c; - - nbuf = &buf[sizeof buf - 1]; - ret = 0; - while ((c = *fmt++) != 0) { - if (c != '%') { - ret += putc(c, arg); - continue; - } - lflag = 0; - sflag = 0; - pad = 0; -reswitch: c = *fmt++; - switch (c) { - case '#': - sflag = 1; - goto reswitch; - case '%': - ret += putc('%', arg); - break; - case 'c': - c = va_arg(ap, int); - ret += putc(c, arg); - break; - case 'd': - if (lflag == 0) { - ui = (u_int)va_arg(ap, int); - if (ui < (int)ui) { - ui = -ui; - ret += putc('-', arg); - } - s = __uitoa(nbuf, ui, 10); - } else { - ul = (u_long)va_arg(ap, long); - if (ul < (long)ul) { - ul = -ul; - ret += putc('-', arg); - } - s = __ultoa(nbuf, ul, 10); - } - ret += __puts(s, putc, arg); - break; - case 'l': - lflag = 1; - goto reswitch; - case 'o': - if (lflag == 0) { - ui = (u_int)va_arg(ap, u_int); - s = __uitoa(nbuf, ui, 8); - } else { - ul = (u_long)va_arg(ap, u_long); - s = __ultoa(nbuf, ul, 8); - } - ret += __puts(s, putc, arg); - break; - case 'p': - ul = (u_long)va_arg(ap, void *); - s = __ultoa(nbuf, ul, 16); - ret += __puts("0x", putc, arg); - ret += __puts(s, putc, arg); - break; - case 's': - s = va_arg(ap, char *); - ret += __puts(s, putc, arg); - break; - case 'u': - if (lflag == 0) { - ui = va_arg(ap, u_int); - s = __uitoa(nbuf, ui, 10); - } else { - ul = va_arg(ap, u_long); - s = __ultoa(nbuf, ul, 10); - } - ret += __puts(s, putc, arg); - break; - case 'x': - if (lflag == 0) { - ui = va_arg(ap, u_int); - s = __uitoa(nbuf, ui, 16); - } else { - ul = va_arg(ap, u_long); - s = __ultoa(nbuf, ul, 16); - } - if (sflag) - ret += __puts("0x", putc, arg); - ret += __puts(s, putc, arg); - break; - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - pad = pad * 10 + c - '0'; - goto reswitch; - default: - break; - } - } - return (ret); -} - -static int -__sputc(char c, void *arg) -{ - struct sp_data *sp; - - sp = arg; - if (sp->sp_len < sp->sp_size) - sp->sp_buf[sp->sp_len++] = c; - sp->sp_buf[sp->sp_len] = '\0'; - return (1); -} - -static int -__puts(const char *s, putc_func_t *putc, void *arg) -{ - const char *p; - int ret; - - ret = 0; - for (p = s; *p != '\0'; p++) - ret += putc(*p, arg); - return (ret); -} - -static char * -__uitoa(char *buf, u_int ui, int base) -{ - char *p; - - p = buf; - *p = '\0'; - do - *--p = digits[ui % base]; - while ((ui /= base) != 0); - return (p); -} - -static char * -__ultoa(char *buf, u_long ul, int base) -{ - char *p; - - p = buf; - *p = '\0'; - do - *--p = digits[ul % base]; - while ((ul /= base) != 0); - return (p); } From owner-svn-src-head@freebsd.org Sat Jan 9 03:30:34 2016 Return-Path: Delivered-To: svn-src-head@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 D42DEA67B0D; Sat, 9 Jan 2016 03:30:34 +0000 (UTC) (envelope-from smh@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 8D091113E; Sat, 9 Jan 2016 03:30:34 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u093UXEt096903; Sat, 9 Jan 2016 03:30:33 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u093UXYt096900; Sat, 9 Jan 2016 03:30:33 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601090330.u093UXYt096900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Sat, 9 Jan 2016 03:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293461 - in head/sys/boot: common efi/boot1 powerpc/boot1.chrp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 03:30:34 -0000 Author: smh Date: Sat Jan 9 03:30:33 2016 New Revision: 293461 URL: https://svnweb.freebsd.org/changeset/base/293461 Log: Remove hidden "Not ufs" printfs from boot code Remove the printf("Not ufs\n") from the boot code which was hidden by the local printf implementations, allowing these to have that code removed too. MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Modified: head/sys/boot/common/ufsread.c head/sys/boot/efi/boot1/boot1.c head/sys/boot/powerpc/boot1.chrp/boot1.c Modified: head/sys/boot/common/ufsread.c ============================================================================== --- head/sys/boot/common/ufsread.c Sat Jan 9 03:20:01 2016 (r293460) +++ head/sys/boot/common/ufsread.c Sat Jan 9 03:30:33 2016 (r293461) @@ -211,7 +211,6 @@ fsread(ufs_ino_t inode, void *buf, size_ break; } if (sblock_try[n] == -1) { - printf("Not ufs\n"); return -1; } dsk_meta++; Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Sat Jan 9 03:20:01 2016 (r293460) +++ head/sys/boot/efi/boot1/boot1.c Sat Jan 9 03:30:33 2016 (r293461) @@ -198,7 +198,6 @@ fsstat(ufs_ino_t inode) break; } if (sblock_try[n] == -1) { - printf("Not ufs\n"); return -1; } dsk_meta++; Modified: head/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/boot1.c Sat Jan 9 03:20:01 2016 (r293460) +++ head/sys/boot/powerpc/boot1.chrp/boot1.c Sat Jan 9 03:30:33 2016 (r293461) @@ -564,10 +564,6 @@ printf(const char *fmt, ...) va_list ap; int ret; - /* Don't annoy the user as we probe for partitions */ - if (strcmp(fmt,"Not ufs\n") == 0) - return 0; - va_start(ap, fmt); ret = vprintf(fmt, ap); va_end(ap); From owner-svn-src-head@freebsd.org Sat Jan 9 03:34:36 2016 Return-Path: Delivered-To: svn-src-head@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 99789A67D00; Sat, 9 Jan 2016 03:34:36 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com [IPv6:2607:f8b0:4001: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 6B232147A; Sat, 9 Jan 2016 03:34:36 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ig0-x22c.google.com with SMTP id z14so88157575igp.0; Fri, 08 Jan 2016 19:34:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=sJ+/0v64J6nAKSwx/d1gYWghj6bu2QBYR6bISYU8QM8=; b=mEK7NaIT7S+m6D2SEcz59aUvyqPaw4QNRJvnDu/ry75HM6F6LqrSkTHRJ4YgyQ9dUH brlKw7q3ajFQuPVbfQ5+yCiRfHsGjgd9gKHTyMWUUBM7UYxf2q6eFptAyhnJSc4cGgGU edbIvG60UQZPqTEQCZ7mTSJxSyq5kxfjxj/+A9KPkTepcFxN7pg9VoDtRXue0/EG1ZAD LSOZBNzOceBPIcKVGhGlcSYRB+R/yfxR4kJ2YQ/oUxYyOh4fVwRwg6LAeebkQnwiS8y8 vuqhkKsB4hrm7UU4RVZ02lIJlk0GvhdRZpHZ/NYdojxbsxij/Mizr6Gk8KwqCgHjHaDT zrww== X-Received: by 10.50.43.228 with SMTP id z4mr1994497igl.33.1452310475662; Fri, 08 Jan 2016 19:34:35 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.39.66 with HTTP; Fri, 8 Jan 2016 19:34:16 -0800 (PST) In-Reply-To: <201601090042.u090g7dX048643@repo.freebsd.org> References: <201601090042.u090g7dX048643@repo.freebsd.org> From: Ed Maste Date: Sat, 9 Jan 2016 03:34:16 +0000 X-Google-Sender-Auth: DfcnKUuI02IaQ0XnKmvkEArOu0k Message-ID: Subject: Re: svn commit: r293450 - in head: gnu/lib/libgcc share/mk tools/build/options To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 03:34:36 -0000 On 9 January 2016 at 00:42, Ed Maste wrote: > > Author: emaste > Date: Sat Jan 9 00:42:07 2016 > New Revision: 293450 > URL: https://svnweb.freebsd.org/changeset/base/293450 > > Log: > Support use of LLVM's libunwind for exception unwinding As reported by bz@, an incremental build on arm64 across this change can fail due to an old unwind.h being left behind. I hope to sort it out soon; in the interim deleting the generated unwind.h files from the objdir should be a usable workaround. From owner-svn-src-head@freebsd.org Sat Jan 9 04:09:35 2016 Return-Path: Delivered-To: svn-src-head@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 AB01EA68765; Sat, 9 Jan 2016 04:09:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 965FC1268; Sat, 9 Jan 2016 04:09:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u0949Ym6013723 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 8 Jan 2016 20:09:34 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u0949Yr6013722; Fri, 8 Jan 2016 20:09:34 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 8 Jan 2016 20:09:33 -0800 From: Gleb Smirnoff To: "George V. Neville-Neil" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293459 - head/usr.sbin/bhyve Message-ID: <20160109040933.GO1906@FreeBSD.org> References: <201601090308.u0938LAm090546@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601090308.u0938LAm090546@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 04:09:35 -0000 On Sat, Jan 09, 2016 at 03:08:21AM +0000, George V. Neville-Neil wrote: G> Author: gnn G> Date: Sat Jan 9 03:08:21 2016 G> New Revision: 293459 G> URL: https://svnweb.freebsd.org/changeset/base/293459 G> G> Log: G> Add netmap support for bhyve G> G> Submitted by: btw G> MFC after: 1 week G> Differential Revision: https://reviews.freebsd.org/D4826 I guess "btw" is Tiwei Bei and he doesn't have FreeBSD account. The common rule is to put only valid FreeBSD accounts into "Submitted by:" or full name and email (possibly mangled email). Once you or someone else will request a commit access for Tiwei, and core@ will look into his submission record, grep(1) on his name or email through commit logs will miss this important submission. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Sat Jan 9 05:07:51 2016 Return-Path: Delivered-To: svn-src-head@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 B05AAA69924; Sat, 9 Jan 2016 05:07:51 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 9164B15B4; Sat, 9 Jan 2016 05:07:51 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 3BD89D663; Sat, 9 Jan 2016 05:07:50 +0000 (UTC) Subject: Re: svn commit: r293459 - head/usr.sbin/bhyve To: Gleb Smirnoff , "George V. Neville-Neil" References: <201601090308.u0938LAm090546@repo.freebsd.org> <20160109040933.GO1906@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Allan Jude Message-ID: <569095B0.10707@freebsd.org> Date: Sat, 9 Jan 2016 00:08:00 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160109040933.GO1906@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eRE1lwClWePP7P15sTFHk4nMPkCwlCU4I" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 05:07:51 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --eRE1lwClWePP7P15sTFHk4nMPkCwlCU4I Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016-01-08 23:09, Gleb Smirnoff wrote: > On Sat, Jan 09, 2016 at 03:08:21AM +0000, George V. Neville-Neil wrote:= > G> Author: gnn > G> Date: Sat Jan 9 03:08:21 2016 > G> New Revision: 293459 > G> URL: https://svnweb.freebsd.org/changeset/base/293459 > G>=20 > G> Log: > G> Add netmap support for bhyve > G> =20 > G> Submitted by: btw > G> MFC after: 1 week > G> Differential Revision: https://reviews.freebsd.org/D4826 >=20 > I guess "btw" is Tiwei Bei and he doesn't have FreeBSD account. > The common rule is to put only valid FreeBSD accounts into "Submitted b= y:" > or full name and email (possibly mangled email). >=20 > Once you or someone else will request a commit access for Tiwei, > and core@ will look into his submission record, grep(1) on his name=20 > or email through commit logs will miss this important submission. >=20 How did they get a phabricator user of 'btw' without an account? I thought all non @freebsd.org accounts were forced to be a full email address. --=20 Allan Jude --eRE1lwClWePP7P15sTFHk4nMPkCwlCU4I Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJWkJW0AAoJEBmVNT4SmAt+bjwQANnh0QIHEWMXFGjuyrbTvwum TIX2WdXHkJaVX3qU5n3Z9eB30Aq5nFE3CnCiqKD/iEaSh/N9/A/a//rk1YX3oSCp 6WtmANTJ4NE4Us7nt6L+lRgYP2Bb5DY2FsFNRMXHM5hOOOVuhK8Ff+BMzajwUfts F3w/cjtgodWyXIVIJ/X9aMh70rOwloYFjvknbANJCj987UJeoUwlLyH7F8z7eq8N wJRdxSuRRiCGtJ2UdolDeeBB9TQwBh97mKPB+14WCima4TmpuryhwazVhVAepgrO 3D1ngZqFITiJmBrFU7ETRkVnFDvw3FokYQt1uwfUu6s4ZY+xXDbs5QsihHgSOFuR Pf2I5DoAk9G0Yg7Iqj/3PhKV7cIlX0BIzsNqqRkqFAE7gEiDceYT1Gz0J/1leM0+ 1aOMvPFyjhsMH7pqnj6iqUYrhezH71RYp8WrENyYwPDuO8ifL5gY78SS2M9uI6MI 03SjfryTnKYIxyr24aa7HEUACqbnvwgP+PnTm+vDoptBTqFjbocvb40lWxOlFNIY pZ2bXY1bnpyHLXMttssYYp8Xavgg0MZ8waCS4rr8ISsB9agMAtQ6pWXTa/SCE28Y DxNRlvYBWWVTPlXbNeGV/ja6Vu6mXmPGKmjRlmvJOCosC6HRPSIHE7+zyR6GVX7w f1H6o4/HQaQxDOkAw3yo =lqyc -----END PGP SIGNATURE----- --eRE1lwClWePP7P15sTFHk4nMPkCwlCU4I-- From owner-svn-src-head@freebsd.org Sat Jan 9 05:39:07 2016 Return-Path: Delivered-To: svn-src-head@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 6B368A6750C; Sat, 9 Jan 2016 05:39:07 +0000 (UTC) (envelope-from melifaro@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 3BC6F15AE; Sat, 9 Jan 2016 05:39:07 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u095d62F040909; Sat, 9 Jan 2016 05:39:06 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u095d6kK040908; Sat, 9 Jan 2016 05:39:06 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601090539.u095d6kK040908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 9 Jan 2016 05:39:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293465 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 05:39:07 -0000 Author: melifaro Date: Sat Jan 9 05:39:06 2016 New Revision: 293465 URL: https://svnweb.freebsd.org/changeset/base/293465 Log: Please Coverity by removing unneccessary check (rt_key() is always set). Coverity CID: 1347797 Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat Jan 9 05:07:02 2016 (r293464) +++ head/sys/net/route.c Sat Jan 9 05:39:06 2016 (r293465) @@ -858,7 +858,7 @@ rt_exportinfo(struct rtentry *rt, struct src = rt_key(rt); dst = info->rti_info[RTAX_DST]; sa_len = src->sa_len; - if (src != NULL && dst != NULL) { + if (dst != NULL) { if (src->sa_len > dst->sa_len) return (ENOMEM); memcpy(dst, src, src->sa_len); From owner-svn-src-head@freebsd.org Sat Jan 9 06:26:41 2016 Return-Path: Delivered-To: svn-src-head@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 8F6F2A68322; Sat, 9 Jan 2016 06:26:41 +0000 (UTC) (envelope-from melifaro@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 6C00415EB; Sat, 9 Jan 2016 06:26:41 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u096QeBR055135; Sat, 9 Jan 2016 06:26:40 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u096QeKd055132; Sat, 9 Jan 2016 06:26:40 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601090626.u096QeKd055132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 9 Jan 2016 06:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293466 - in head/sys: net netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 06:26:41 -0000 Author: melifaro Date: Sat Jan 9 06:26:40 2016 New Revision: 293466 URL: https://svnweb.freebsd.org/changeset/base/293466 Log: (Temporarily) remove route_redirect_event eventhandler. Such handler should pass different set of variables, instead of directly providing 2 locked route entries. Given that it hasn't been really used since at least 2012, remove current code. Will re-add it after finishing most major routing-related changes. Discussed with: np Modified: head/sys/net/route.c head/sys/net/route.h head/sys/netinet/toecore.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat Jan 9 05:39:06 2016 (r293465) +++ head/sys/net/route.c Sat Jan 9 06:26:40 2016 (r293466) @@ -568,7 +568,7 @@ rtredirect_fib(struct sockaddr *dst, struct sockaddr *src, u_int fibnum) { - struct rtentry *rt, *rt0 = NULL; + struct rtentry *rt; int error = 0; short *stat = NULL; struct rt_addrinfo info; @@ -627,7 +627,7 @@ rtredirect_fib(struct sockaddr *dst, * Create new route, rather than smashing route to net. */ create: - rt0 = rt; + RTFREE(rt); rt = NULL; flags |= RTF_DYNAMIC; @@ -637,21 +637,14 @@ rtredirect_fib(struct sockaddr *dst, info.rti_info[RTAX_NETMASK] = netmask; info.rti_ifa = ifa; info.rti_flags = flags; - if (rt0 != NULL) - RT_UNLOCK(rt0); /* drop lock to avoid LOR with RNH */ error = rtrequest1_fib(RTM_ADD, &info, &rt, fibnum); if (rt != NULL) { RT_LOCK(rt); - if (rt0 != NULL) - EVENTHANDLER_INVOKE(route_redirect_event, rt0, rt, dst); flags = rt->rt_flags; } - if (rt0 != NULL) - RTFREE(rt0); stat = &V_rtstat.rts_dynamic; } else { - struct rtentry *gwrt; /* * Smash the current notion of the gateway to @@ -669,11 +662,7 @@ rtredirect_fib(struct sockaddr *dst, RADIX_NODE_HEAD_LOCK(rnh); RT_LOCK(rt); rt_setgate(rt, rt_key(rt), gateway); - gwrt = rtalloc1(gateway, 1, RTF_RNH_LOCKED); RADIX_NODE_HEAD_UNLOCK(rnh); - EVENTHANDLER_INVOKE(route_redirect_event, rt, gwrt, dst); - if (gwrt) - RTFREE_LOCKED(gwrt); } } else error = EHOSTUNREACH; Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sat Jan 9 05:39:06 2016 (r293465) +++ head/sys/net/route.h Sat Jan 9 06:26:40 2016 (r293466) @@ -468,8 +468,6 @@ int rib_lookup_info(uint32_t, const stru void rib_free_info(struct rt_addrinfo *info); #include -typedef void (*rtevent_redirect_fn)(void *, struct rtentry *, struct rtentry *, struct sockaddr *); -EVENTHANDLER_DECLARE(route_redirect_event, rtevent_redirect_fn); #endif #endif Modified: head/sys/netinet/toecore.c ============================================================================== --- head/sys/netinet/toecore.c Sat Jan 9 05:39:06 2016 (r293465) +++ head/sys/netinet/toecore.c Sat Jan 9 06:26:40 2016 (r293466) @@ -70,7 +70,6 @@ static TAILQ_HEAD(, toedev) toedev_list; static eventhandler_tag listen_start_eh; static eventhandler_tag listen_stop_eh; static eventhandler_tag lle_event_eh; -static eventhandler_tag route_redirect_eh; static int toedev_connect(struct toedev *tod __unused, struct socket *so __unused, @@ -438,17 +437,6 @@ toe_lle_event(void *arg __unused, struct } /* - * XXX: implement. - */ -static void -toe_route_redirect_event(void *arg __unused, struct rtentry *rt0, - struct rtentry *rt1, struct sockaddr *sa) -{ - - return; -} - -/* * Returns 0 or EWOULDBLOCK on success (any other value is an error). 0 means * lladdr and vtag are valid on return, EWOULDBLOCK means the TOE driver's * tod_l2_update will be called later, when the entry is resolved or times out. @@ -534,8 +522,6 @@ toecore_load(void) toe_listen_stop_event, NULL, EVENTHANDLER_PRI_ANY); lle_event_eh = EVENTHANDLER_REGISTER(lle_event, toe_lle_event, NULL, EVENTHANDLER_PRI_ANY); - route_redirect_eh = EVENTHANDLER_REGISTER(route_redirect_event, - toe_route_redirect_event, NULL, EVENTHANDLER_PRI_ANY); return (0); } @@ -553,7 +539,6 @@ toecore_unload(void) EVENTHANDLER_DEREGISTER(tcp_offload_listen_start, listen_start_eh); EVENTHANDLER_DEREGISTER(tcp_offload_listen_stop, listen_stop_eh); EVENTHANDLER_DEREGISTER(lle_event, lle_event_eh); - EVENTHANDLER_DEREGISTER(route_redirect_event, route_redirect_eh); mtx_unlock(&toedev_lock); mtx_destroy(&toedev_lock); From owner-svn-src-head@freebsd.org Sat Jan 9 08:02:36 2016 Return-Path: Delivered-To: svn-src-head@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 E175BA677A5; Sat, 9 Jan 2016 08:02:36 +0000 (UTC) (envelope-from ae@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 B02711323; Sat, 9 Jan 2016 08:02:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0982ZXE084913; Sat, 9 Jan 2016 08:02:35 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0982Zjg084912; Sat, 9 Jan 2016 08:02:35 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201601090802.u0982Zjg084912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 9 Jan 2016 08:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293467 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 08:02:37 -0000 Author: ae Date: Sat Jan 9 08:02:35 2016 New Revision: 293467 URL: https://svnweb.freebsd.org/changeset/base/293467 Log: Fix a typo. PR: 205722 Modified: head/lib/libstand/uuid_to_string.c Modified: head/lib/libstand/uuid_to_string.c ============================================================================== --- head/lib/libstand/uuid_to_string.c Sat Jan 9 06:26:40 2016 (r293466) +++ head/lib/libstand/uuid_to_string.c Sat Jan 9 08:02:35 2016 (r293467) @@ -107,5 +107,5 @@ uuid_to_string(const uuid_t *u, char **s tohex(&w, 2, u->node[3]); tohex(&w, 2, u->node[4]); tohex(&w, 2, u->node[5]); - *w++ - '\0'; + *w++ = '\0'; } From owner-svn-src-head@freebsd.org Sat Jan 9 08:04:30 2016 Return-Path: Delivered-To: svn-src-head@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 508AFA678C3; Sat, 9 Jan 2016 08:04:30 +0000 (UTC) (envelope-from ae@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 22D61150A; Sat, 9 Jan 2016 08:04:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0984T26085028; Sat, 9 Jan 2016 08:04:29 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0984TFc085027; Sat, 9 Jan 2016 08:04:29 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201601090804.u0984TFc085027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 9 Jan 2016 08:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293468 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 08:04:30 -0000 Author: ae Date: Sat Jan 9 08:04:29 2016 New Revision: 293468 URL: https://svnweb.freebsd.org/changeset/base/293468 Log: Make tohex() work as expected. Modified: head/lib/libstand/uuid_to_string.c Modified: head/lib/libstand/uuid_to_string.c ============================================================================== --- head/lib/libstand/uuid_to_string.c Sat Jan 9 08:02:35 2016 (r293467) +++ head/lib/libstand/uuid_to_string.c Sat Jan 9 08:04:29 2016 (r293468) @@ -46,7 +46,7 @@ tohex(char **buf, int len, uint32_t val) char *walker = *buf; int i; - for (i = len - 1; i >= 0; i++) { + for (i = len - 1; i >= 0; i--) { walker[i] = hexstr[val & 0xf]; val >>= 4; } From owner-svn-src-head@freebsd.org Sat Jan 9 09:33:26 2016 Return-Path: Delivered-To: svn-src-head@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 1ECDBA698FD; Sat, 9 Jan 2016 09:33:26 +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 E66611F15; Sat, 9 Jan 2016 09:33:25 +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 u099XPVY012122; Sat, 9 Jan 2016 09:33:25 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u099XPHW012121; Sat, 9 Jan 2016 09:33:25 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601090933.u099XPHW012121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 9 Jan 2016 09:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293469 - head/usr.sbin/ntp/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 09:33:26 -0000 Author: delphij Date: Sat Jan 9 09:33:24 2016 New Revision: 293469 URL: https://svnweb.freebsd.org/changeset/base/293469 Log: Fix version number. Modified: head/usr.sbin/ntp/scripts/mkver Modified: head/usr.sbin/ntp/scripts/mkver ============================================================================== --- head/usr.sbin/ntp/scripts/mkver Sat Jan 9 08:04:29 2016 (r293468) +++ head/usr.sbin/ntp/scripts/mkver Sat Jan 9 09:33:24 2016 (r293469) @@ -6,7 +6,7 @@ PROG=${1-UNKNOWN} ConfStr="$PROG" -ConfStr="$ConfStr 4.2.8p4" +ConfStr="$ConfStr 4.2.8p5" case "$CSET" in '') ;; From owner-svn-src-head@freebsd.org Sat Jan 9 09:34:41 2016 Return-Path: Delivered-To: svn-src-head@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 D4BF0A6997E; Sat, 9 Jan 2016 09:34:41 +0000 (UTC) (envelope-from melifaro@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 AF31910C3; Sat, 9 Jan 2016 09:34:41 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u099YeHT012221; Sat, 9 Jan 2016 09:34:40 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u099YdJu012208; Sat, 9 Jan 2016 09:34:39 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601090934.u099YdJu012208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 9 Jan 2016 09:34:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293470 - in head/sys: net net80211 netgraph/netflow netinet netinet6 netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 09:34:42 -0000 Author: melifaro Date: Sat Jan 9 09:34:39 2016 New Revision: 293470 URL: https://svnweb.freebsd.org/changeset/base/293470 Log: Remove sys/eventhandler.h from net/route.h Reviewed by: ae Modified: head/sys/net/route.h head/sys/net80211/ieee80211_freebsd.c head/sys/netgraph/netflow/netflow.c head/sys/netgraph/netflow/netflow_v9.c head/sys/netgraph/netflow/ng_netflow.c head/sys/netinet/in_pcb.c head/sys/netinet/ip_encap.c head/sys/netinet/ip_mroute.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_subr.c head/sys/netinet6/frag6.c head/sys/netpfil/pf/pf_if.c Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sat Jan 9 09:33:24 2016 (r293469) +++ head/sys/net/route.h Sat Jan 9 09:34:39 2016 (r293470) @@ -467,7 +467,6 @@ int rib_lookup_info(uint32_t, const stru struct rt_addrinfo *); void rib_free_info(struct rt_addrinfo *info); -#include #endif #endif Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Sat Jan 9 09:33:24 2016 (r293469) +++ head/sys/net80211/ieee80211_freebsd.c Sat Jan 9 09:34:39 2016 (r293470) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netgraph/netflow/netflow.c ============================================================================== --- head/sys/netgraph/netflow/netflow.c Sat Jan 9 09:33:24 2016 (r293469) +++ head/sys/netgraph/netflow/netflow.c Sat Jan 9 09:34:39 2016 (r293470) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netgraph/netflow/netflow_v9.c ============================================================================== --- head/sys/netgraph/netflow/netflow_v9.c Sat Jan 9 09:33:24 2016 (r293469) +++ head/sys/netgraph/netflow/netflow_v9.c Sat Jan 9 09:34:39 2016 (r293470) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netgraph/netflow/ng_netflow.c ============================================================================== --- head/sys/netgraph/netflow/ng_netflow.c Sat Jan 9 09:33:24 2016 (r293469) +++ head/sys/netgraph/netflow/ng_netflow.c Sat Jan 9 09:34:39 2016 (r293470) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Sat Jan 9 09:33:24 2016 (r293469) +++ head/sys/netinet/in_pcb.c Sat Jan 9 09:34:39 2016 (r293470) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netinet/ip_encap.c ============================================================================== --- head/sys/netinet/ip_encap.c Sat Jan 9 09:33:24 2016 (r293469) +++ head/sys/netinet/ip_encap.c Sat Jan 9 09:34:39 2016 (r293470) @@ -65,6 +65,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Sat Jan 9 09:33:24 2016 (r293469) +++ head/sys/netinet/ip_mroute.c Sat Jan 9 09:34:39 2016 (r293470) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Sat Jan 9 09:33:24 2016 (r293469) +++ head/sys/netinet/raw_ip.c Sat Jan 9 09:34:39 2016 (r293470) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Sat Jan 9 09:33:24 2016 (r293469) +++ head/sys/netinet/tcp_reass.c Sat Jan 9 09:34:39 2016 (r293470) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sat Jan 9 09:33:24 2016 (r293469) +++ head/sys/netinet/tcp_subr.c Sat Jan 9 09:34:39 2016 (r293470) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Sat Jan 9 09:33:24 2016 (r293469) +++ head/sys/netinet6/frag6.c Sat Jan 9 09:34:39 2016 (r293470) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Sat Jan 9 09:33:24 2016 (r293469) +++ head/sys/netpfil/pf/pf_if.c Sat Jan 9 09:34:39 2016 (r293470) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Sat Jan 9 11:41:39 2016 Return-Path: Delivered-To: svn-src-head@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 56A2CA695F7; Sat, 9 Jan 2016 11:41:39 +0000 (UTC) (envelope-from melifaro@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 F2EE51E56; Sat, 9 Jan 2016 11:41:38 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09BfcdU049959; Sat, 9 Jan 2016 11:41:38 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Bfcvg049958; Sat, 9 Jan 2016 11:41:38 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601091141.u09Bfcvg049958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 9 Jan 2016 11:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293471 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 11:41:39 -0000 Author: melifaro Date: Sat Jan 9 11:41:37 2016 New Revision: 293471 URL: https://svnweb.freebsd.org/changeset/base/293471 Log: Remove prefix check from in6_addroute(). This check was added in initial? netinet6/ import back in 1999 (r53541). It effectively became unnecessary after 'address/prefix clean-ups' KAME commit 90ff8792e676132096a440dd787f99a5a5860ee8 (github) in 2001 (merged to FreeBSD in r78064) where prefix check was added to nd6_prefix_onlink(). Similar IPv4 check (in_addroute() was added in r137628). Additionally, the right plance for this (or similar) check is the prefix addition code (nd6_prefix_onlink(), nd6_prefix_onlink_rtrequest(), in_addprefix() or rtinit()), but not the generic radix insert routine. Modified: head/sys/netinet6/in6_rmx.c Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Sat Jan 9 09:34:39 2016 (r293470) +++ head/sys/netinet6/in6_rmx.c Sat Jan 9 11:41:37 2016 (r293471) @@ -107,7 +107,6 @@ in6_addroute(void *v_arg, void *n_arg, s { struct rtentry *rt = (struct rtentry *)treenodes; struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)rt_key(rt); - struct radix_node *ret; RADIX_NODE_HEAD_WLOCK_ASSERT(head); if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) @@ -148,34 +147,7 @@ in6_addroute(void *v_arg, void *n_arg, s rt->rt_mtu = IN6_LINKMTU(rt->rt_ifp); } - ret = rn_addroute(v_arg, n_arg, head, treenodes); - if (ret == NULL) { - struct rtentry *rt2; - /* - * We are trying to add a net route, but can't. - * The following case should be allowed, so we'll make a - * special check for this: - * Two IPv6 addresses with the same prefix is assigned - * to a single interrface. - * # ifconfig if0 inet6 3ffe:0501::1 prefix 64 alias (*1) - * # ifconfig if0 inet6 3ffe:0501::2 prefix 64 alias (*2) - * In this case, (*1) and (*2) want to add the same - * net route entry, 3ffe:0501:: -> if0. - * This case should not raise an error. - */ - rt2 = in6_rtalloc1((struct sockaddr *)sin6, 0, RTF_RNH_LOCKED, - rt->rt_fibnum); - if (rt2) { - if (((rt2->rt_flags & (RTF_HOST|RTF_GATEWAY)) == 0) - && rt2->rt_gateway - && rt2->rt_gateway->sa_family == AF_LINK - && rt2->rt_ifp == rt->rt_ifp) { - ret = rt2->rt_nodes; - } - RTFREE_LOCKED(rt2); - } - } - return (ret); + return (rn_addroute(v_arg, n_arg, head, treenodes)); } /* From owner-svn-src-head@freebsd.org Sat Jan 9 14:53:24 2016 Return-Path: Delivered-To: svn-src-head@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 AC13CA698BE; Sat, 9 Jan 2016 14:53:24 +0000 (UTC) (envelope-from kevlo@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 7B9AC19F9; Sat, 9 Jan 2016 14:53:24 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09ErNPS008688; Sat, 9 Jan 2016 14:53:23 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09ErNCj008687; Sat, 9 Jan 2016 14:53:23 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201601091453.u09ErNCj008687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Sat, 9 Jan 2016 14:53:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293491 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:53:24 -0000 Author: kevlo Date: Sat Jan 9 14:53:23 2016 New Revision: 293491 URL: https://svnweb.freebsd.org/changeset/base/293491 Log: - Add the definition of CHARCLASS_NAME_MAX, as per POSIX.1-2001. - Avoid namespace pollution and move definitions of _POSIX2_CHARCLASS_NAME_MAX and _POSIX2_COLL_WEIGHTS_MAX into the .2001 section. With input from bde. Submitted by bde Modified: head/include/limits.h Modified: head/include/limits.h ============================================================================== --- head/include/limits.h Sat Jan 9 14:53:08 2016 (r293490) +++ head/include/limits.h Sat Jan 9 14:53:23 2016 (r293491) @@ -59,10 +59,12 @@ #define _POSIX_TZNAME_MAX 3 #endif +#if __POSIX_VISIBLE >= 200112 #define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */ #define BC_DIM_MAX 2048 /* max array elements in bc(1) */ #define BC_SCALE_MAX 99 /* max scale value in bc(1) */ #define BC_STRING_MAX 1000 /* max const string length in bc(1) */ +#define CHARCLASS_NAME_MAX 14 /* max character class name size */ #define COLL_WEIGHTS_MAX 10 /* max weights for order keyword */ #define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */ #define LINE_MAX 2048 /* max bytes in an input line */ @@ -72,11 +74,14 @@ #define _POSIX2_BC_DIM_MAX 2048 #define _POSIX2_BC_SCALE_MAX 99 #define _POSIX2_BC_STRING_MAX 1000 +#define _POSIX2_CHARCLASS_NAME_MAX 14 +#define _POSIX2_COLL_WEIGHTS_MAX 2 #define _POSIX2_EQUIV_CLASS_MAX 2 #define _POSIX2_EXPR_NEST_MAX 32 #define _POSIX2_LINE_MAX 2048 #define _POSIX2_RE_DUP_MAX 255 #endif +#endif #if __POSIX_VISIBLE >= 199309 #define _POSIX_AIO_LISTIO_MAX 2 @@ -110,8 +115,6 @@ #define _POSIX_TRACE_SYS_MAX 8 #define _POSIX_TRACE_USER_EVENT_MAX 32 #define _POSIX_TTY_NAME_MAX 9 -#define _POSIX2_CHARCLASS_NAME_MAX 14 -#define _POSIX2_COLL_WEIGHTS_MAX 2 #define _POSIX_RE_DUP_MAX _POSIX2_RE_DUP_MAX #endif From owner-svn-src-head@freebsd.org Sat Jan 9 15:09:33 2016 Return-Path: Delivered-To: svn-src-head@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 4DB13A68187; Sat, 9 Jan 2016 15:09:33 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AB4F012E1; Sat, 9 Jan 2016 15:09:32 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.14.9/8.14.9) with ESMTP id u09F8jiA051871 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 9 Jan 2016 23:08:45 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.14.9/8.14.9/Submit) id u09F8iHB051870; Sat, 9 Jan 2016 23:08:44 +0800 (CST) (envelope-from kevlo) Date: Sat, 9 Jan 2016 23:08:43 +0800 From: Kevin Lo To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293491 - head/include Message-ID: <20160109150843.GA51824@ns.kevlo.org> References: <201601091453.u09ErNCj008687@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601091453.u09ErNCj008687@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:09:33 -0000 On Sat, Jan 09, 2016 at 02:53:23PM +0000, Kevin Lo wrote: > Author: kevlo > Date: Sat Jan 9 14:53:23 2016 > New Revision: 293491 > URL: https://svnweb.freebsd.org/changeset/base/293491 > > Log: > - Add the definition of CHARCLASS_NAME_MAX, as per POSIX.1-2001. > - Avoid namespace pollution and move definitions of _POSIX2_CHARCLASS_NAME_MAX > and _POSIX2_COLL_WEIGHTS_MAX into the .2001 section. > With input from bde. > > Submitted by bde Oops, should be reviewed by bde. > Modified: > head/include/limits.h > > Modified: head/include/limits.h > ============================================================================== > --- head/include/limits.h Sat Jan 9 14:53:08 2016 (r293490) > +++ head/include/limits.h Sat Jan 9 14:53:23 2016 (r293491) > @@ -59,10 +59,12 @@ > #define _POSIX_TZNAME_MAX 3 > #endif > > +#if __POSIX_VISIBLE >= 200112 > #define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */ > #define BC_DIM_MAX 2048 /* max array elements in bc(1) */ > #define BC_SCALE_MAX 99 /* max scale value in bc(1) */ > #define BC_STRING_MAX 1000 /* max const string length in bc(1) */ > +#define CHARCLASS_NAME_MAX 14 /* max character class name size */ > #define COLL_WEIGHTS_MAX 10 /* max weights for order keyword */ > #define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */ > #define LINE_MAX 2048 /* max bytes in an input line */ > @@ -72,11 +74,14 @@ > #define _POSIX2_BC_DIM_MAX 2048 > #define _POSIX2_BC_SCALE_MAX 99 > #define _POSIX2_BC_STRING_MAX 1000 > +#define _POSIX2_CHARCLASS_NAME_MAX 14 > +#define _POSIX2_COLL_WEIGHTS_MAX 2 > #define _POSIX2_EQUIV_CLASS_MAX 2 > #define _POSIX2_EXPR_NEST_MAX 32 > #define _POSIX2_LINE_MAX 2048 > #define _POSIX2_RE_DUP_MAX 255 > #endif > +#endif > > #if __POSIX_VISIBLE >= 199309 > #define _POSIX_AIO_LISTIO_MAX 2 > @@ -110,8 +115,6 @@ > #define _POSIX_TRACE_SYS_MAX 8 > #define _POSIX_TRACE_USER_EVENT_MAX 32 > #define _POSIX_TTY_NAME_MAX 9 > -#define _POSIX2_CHARCLASS_NAME_MAX 14 > -#define _POSIX2_COLL_WEIGHTS_MAX 2 > > #define _POSIX_RE_DUP_MAX _POSIX2_RE_DUP_MAX > #endif > From owner-svn-src-head@freebsd.org Sat Jan 9 16:34:39 2016 Return-Path: Delivered-To: svn-src-head@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 95F88A67568; Sat, 9 Jan 2016 16:34:39 +0000 (UTC) (envelope-from melifaro@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 6D94A1CB7; Sat, 9 Jan 2016 16:34:39 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GYcce041674; Sat, 9 Jan 2016 16:34:38 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GYbwn041665; Sat, 9 Jan 2016 16:34:37 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601091634.u09GYbwn041665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 9 Jan 2016 16:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293544 - in head/sys: net netinet ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:34:39 -0000 Author: melifaro Date: Sat Jan 9 16:34:37 2016 New Revision: 293544 URL: https://svnweb.freebsd.org/changeset/base/293544 Log: Finish r275196: do not dereference rtentry in if_output() routines. The only piece of information that is required is rt_flags subset. In particular, if_loop() requires RTF_REJECT and RTF_BLACKHOLE flags to check if this particular mbuf needs to be dropped (and what error should be returned). Note that if_loop() will always return EHOSTUNREACH for "reject" routes regardless of RTF_HOST flag existence. This is due to upcoming routing changes where RTF_HOST value won't be available as lookup result. All other functions require RTF_GATEWAY flag to check if they need to return EHOSTUNREACH instead of EHOSTDOWN error. There are 11 places where non-zero 'struct route' is passed to if_output(). For most of the callers (forwarding, bpf, arp) does not care about exact error value. In fact, the only place where this result is propagated is ip_output(). (ip6_output() passes NULL route to nd6_output_ifp()). Given that, add 3 new 'struct route' flags (RT_REJECT, RT_BLACKHOLE and RT_IS_GW) and inline function (rt_update_ro_flags()) to copy necessary rte flags to ro_flags. Call this function in ip_output() after looking up/ verifying rte. Reviewed by: ae Modified: head/sys/net/if_arcsubr.c head/sys/net/if_ethersubr.c head/sys/net/if_fddisubr.c head/sys/net/if_fwsubr.c head/sys/net/if_iso88025subr.c head/sys/net/if_loop.c head/sys/net/route.h head/sys/netinet/ip_output.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Modified: head/sys/net/if_arcsubr.c ============================================================================== --- head/sys/net/if_arcsubr.c Sat Jan 9 16:33:55 2016 (r293543) +++ head/sys/net/if_arcsubr.c Sat Jan 9 16:34:37 2016 (r293544) @@ -113,9 +113,8 @@ arc_output(struct ifnet *ifp, struct mbu error = 0; #if defined(INET) || defined(INET6) - if (ro != NULL && ro->ro_rt != NULL && - (ro->ro_rt->rt_flags & RTF_GATEWAY) != 0) - is_gw = 1; + if (ro != NULL) + is_gw = (ro->ro_flags & RT_HAS_GW) != 0; #endif switch (dst->sa_family) { Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Sat Jan 9 16:33:55 2016 (r293543) +++ head/sys/net/if_ethersubr.c Sat Jan 9 16:34:37 2016 (r293544) @@ -202,7 +202,6 @@ ether_resolve_addr(struct ifnet *ifp, st uint32_t *pflags) { struct ether_header *eh; - struct rtentry *rt; uint32_t lleflags = 0; int error = 0; #if defined(INET) || defined(INET6) @@ -253,8 +252,7 @@ ether_resolve_addr(struct ifnet *ifp, st } if (error == EHOSTDOWN) { - rt = (ro != NULL) ? ro->ro_rt : NULL; - if (rt != NULL && (rt->rt_flags & RTF_GATEWAY) != 0) + if (ro != NULL && (ro->ro_flags & RT_HAS_GW) != 0) error = EHOSTUNREACH; } Modified: head/sys/net/if_fddisubr.c ============================================================================== --- head/sys/net/if_fddisubr.c Sat Jan 9 16:33:55 2016 (r293543) +++ head/sys/net/if_fddisubr.c Sat Jan 9 16:34:37 2016 (r293544) @@ -119,9 +119,8 @@ fddi_output(struct ifnet *ifp, struct mb getmicrotime(&ifp->if_lastchange); #if defined(INET) || defined(INET6) - if (ro != NULL && ro->ro_rt != NULL && - (ro->ro_rt->rt_flags & RTF_GATEWAY) != 0) - is_gw = 1; + if (ro != NULL) + is_gw = (ro->ro_flags & RT_HAS_GW) != 0; #endif switch (dst->sa_family) { Modified: head/sys/net/if_fwsubr.c ============================================================================== --- head/sys/net/if_fwsubr.c Sat Jan 9 16:33:55 2016 (r293543) +++ head/sys/net/if_fwsubr.c Sat Jan 9 16:34:37 2016 (r293544) @@ -106,9 +106,8 @@ firewire_output(struct ifnet *ifp, struc } #if defined(INET) || defined(INET6) - if (ro != NULL && ro->ro_rt != NULL && - (ro->ro_rt->rt_flags & RTF_GATEWAY) != 0) - is_gw = 1; + if (ro != NULL) + is_gw = (ro->ro_flags & RT_HAS_GW) != 0; #endif /* * For unicast, we make a tag to store the lladdr of the @@ -145,10 +144,6 @@ firewire_output(struct ifnet *ifp, struc * doesn't fit into the arp model. */ if (unicast) { - is_gw = 0; - if (ro != NULL && ro->ro_rt != NULL && - (ro->ro_rt->rt_flags & RTF_GATEWAY) != 0) - is_gw = 1; error = arpresolve(ifp, is_gw, m, dst, (u_char *) destfw, NULL); if (error) return (error == EWOULDBLOCK ? 0 : error); Modified: head/sys/net/if_iso88025subr.c ============================================================================== --- head/sys/net/if_iso88025subr.c Sat Jan 9 16:33:55 2016 (r293543) +++ head/sys/net/if_iso88025subr.c Sat Jan 9 16:34:37 2016 (r293544) @@ -214,12 +214,8 @@ iso88025_output(struct ifnet *ifp, struc struct rtentry *rt0 = NULL; int is_gw = 0; - if (ro != NULL) { - rt0 = ro->ro_rt; - if (rt0 != NULL && (rt0->rt_flags & RTF_GATEWAY) != 0) - is_gw = 1; - } - + if (ro != NULL) + is_gw = (ro->ro_flags & RT_HAS_GW) != 0; #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error) Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Sat Jan 9 16:33:55 2016 (r293543) +++ head/sys/net/if_loop.c Sat Jan 9 16:34:37 2016 (r293544) @@ -202,15 +202,12 @@ looutput(struct ifnet *ifp, struct mbuf struct route *ro) { u_int32_t af; - struct rtentry *rt = NULL; #ifdef MAC int error; #endif M_ASSERTPKTHDR(m); /* check if we have the packet header */ - if (ro != NULL) - rt = ro->ro_rt; #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error) { @@ -219,10 +216,9 @@ looutput(struct ifnet *ifp, struct mbuf } #endif - if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) { + if (ro != NULL && ro->ro_flags & (RT_REJECT|RT_BLACKHOLE)) { m_freem(m); - return (rt->rt_flags & RTF_BLACKHOLE ? 0 : - rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH); + return (ro->ro_flags & RT_BLACKHOLE ? 0 : EHOSTUNREACH); } if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sat Jan 9 16:33:55 2016 (r293543) +++ head/sys/net/route.h Sat Jan 9 16:34:37 2016 (r293544) @@ -64,9 +64,13 @@ struct route { #define RT_CACHING_CONTEXT 0x1 /* XXX: not used anywhere */ #define RT_NORTREF 0x2 /* doesn't hold reference on ro_rt */ -#define RT_L2_ME (1 << RT_L2_ME_BIT) -#define RT_MAY_LOOP (1 << RT_MAY_LOOP_BIT) -#define RT_HAS_HEADER (1 << RT_HAS_HEADER_BIT) +#define RT_L2_ME (1 << RT_L2_ME_BIT) /* 0x0004 */ +#define RT_MAY_LOOP (1 << RT_MAY_LOOP_BIT) /* 0x0008 */ +#define RT_HAS_HEADER (1 << RT_HAS_HEADER_BIT) /* 0x0010 */ + +#define RT_REJECT 0x0020 /* Destination is reject */ +#define RT_BLACKHOLE 0x0040 /* Destination is blackhole */ +#define RT_HAS_GW 0x0080 /* Destination has GW */ struct rt_metrics { u_long rmx_locks; /* Kernel must leave these values alone */ @@ -215,6 +219,19 @@ fib_rte_to_nh_flags(int rt_flags) return (res); } +/* rte<>ro_flags translation */ +static inline void +rt_update_ro_flags(struct route *ro) +{ + int rt_flags = ro->ro_rt->rt_flags; + + ro->ro_flags &= ~ (RT_REJECT|RT_BLACKHOLE|RT_HAS_GW); + + ro->ro_flags = (rt_flags & RTF_REJECT) ? RT_REJECT : 0; + ro->ro_flags |= (rt_flags & RTF_BLACKHOLE) ? RT_BLACKHOLE : 0; + ro->ro_flags |= (rt_flags & RTF_GATEWAY) ? RT_HAS_GW : 0; +} + /* * Routing statistics. */ Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Sat Jan 9 16:33:55 2016 (r293543) +++ head/sys/netinet/ip_output.c Sat Jan 9 16:34:37 2016 (r293544) @@ -376,6 +376,7 @@ again: ia = ifatoia(rte->rt_ifa); ifp = rte->rt_ifp; counter_u64_add(rte->rt_pksent, 1); + rt_update_ro_flags(ro); if (rte->rt_flags & RTF_GATEWAY) gw = (struct sockaddr_in *)rte->rt_gateway; if (rte->rt_flags & RTF_HOST) Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Sat Jan 9 16:33:55 2016 (r293543) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Sat Jan 9 16:34:37 2016 (r293544) @@ -1260,16 +1260,12 @@ ipoib_output(struct ifnet *ifp, struct m #if defined(INET) || defined(INET6) struct llentry *lle = NULL; #endif - struct rtentry *rt0 = NULL; struct ipoib_header *eh; int error = 0, is_gw = 0; short type; - if (ro != NULL) { - rt0 = ro->ro_rt; - if (rt0 != NULL && (rt0->rt_flags & RTF_GATEWAY) != 0) - is_gw = 1; - } + if (ro != NULL) + is_gw = (ro->ro_flags & RT_HAS_GW) != 0; #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error) From owner-svn-src-head@freebsd.org Sat Jan 9 17:35:06 2016 Return-Path: Delivered-To: svn-src-head@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 6E3DEA6994A; Sat, 9 Jan 2016 17:35:06 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D2F010CA; Sat, 9 Jan 2016 17:35:06 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u09HZ3u8006070 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 9 Jan 2016 09:35:04 -0800 Subject: Re: svn commit: r293470 - in head/sys: net net80211 netgraph/netflow netinet netinet6 netpfil/pf To: "Alexander V. Chernikov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601090934.u099YdJu012208@repo.freebsd.org> From: Nathan Whitehorn Message-ID: <569144C7.6020101@freebsd.org> Date: Sat, 9 Jan 2016 09:35:03 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <201601090934.u099YdJu012208@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVYhgHFCLYZF+sHRfEr9Z1A3R57QNEI2AOLKhUghqg5PQcWKaxQapj6cTxRlFV5tCeH1QfWKwJSQEdory4vQoqtANFOdt59yl/M= X-Sonic-ID: C;luXoUPe25RGmTucs14k5kQ== M;2C85Ufe25RGmTucs14k5kQ== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:35:06 -0000 One or the other of these changes seems to have broken the build of libc: In file included from /usr/home/nwhitehorn/head/lib/libc/net/getifaddrs.c:42: /usr/obj/usr/home/nwhitehorn/head/tmp/usr/include/net/route.h:226: error: dereferencing pointer to incomplete type -Nathan On 01/09/16 01:34, Alexander V. Chernikov wrote: > Author: melifaro > Date: Sat Jan 9 09:34:39 2016 > New Revision: 293470 > URL: https://svnweb.freebsd.org/changeset/base/293470 > > Log: > Remove sys/eventhandler.h from net/route.h > > Reviewed by: ae > > Modified: > head/sys/net/route.h > head/sys/net80211/ieee80211_freebsd.c > head/sys/netgraph/netflow/netflow.c > head/sys/netgraph/netflow/netflow_v9.c > head/sys/netgraph/netflow/ng_netflow.c > head/sys/netinet/in_pcb.c > head/sys/netinet/ip_encap.c > head/sys/netinet/ip_mroute.c > head/sys/netinet/raw_ip.c > head/sys/netinet/tcp_reass.c > head/sys/netinet/tcp_subr.c > head/sys/netinet6/frag6.c > head/sys/netpfil/pf/pf_if.c > > Modified: head/sys/net/route.h > ============================================================================== > --- head/sys/net/route.h Sat Jan 9 09:33:24 2016 (r293469) > +++ head/sys/net/route.h Sat Jan 9 09:34:39 2016 (r293470) > @@ -467,7 +467,6 @@ int rib_lookup_info(uint32_t, const stru > struct rt_addrinfo *); > void rib_free_info(struct rt_addrinfo *info); > > -#include > #endif > > #endif > > Modified: head/sys/net80211/ieee80211_freebsd.c > ============================================================================== > --- head/sys/net80211/ieee80211_freebsd.c Sat Jan 9 09:33:24 2016 (r293469) > +++ head/sys/net80211/ieee80211_freebsd.c Sat Jan 9 09:34:39 2016 (r293470) > @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > > Modified: head/sys/netgraph/netflow/netflow.c > ============================================================================== > --- head/sys/netgraph/netflow/netflow.c Sat Jan 9 09:33:24 2016 (r293469) > +++ head/sys/netgraph/netflow/netflow.c Sat Jan 9 09:34:39 2016 (r293470) > @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > > Modified: head/sys/netgraph/netflow/netflow_v9.c > ============================================================================== > --- head/sys/netgraph/netflow/netflow_v9.c Sat Jan 9 09:33:24 2016 (r293469) > +++ head/sys/netgraph/netflow/netflow_v9.c Sat Jan 9 09:34:39 2016 (r293470) > @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > > Modified: head/sys/netgraph/netflow/ng_netflow.c > ============================================================================== > --- head/sys/netgraph/netflow/ng_netflow.c Sat Jan 9 09:33:24 2016 (r293469) > +++ head/sys/netgraph/netflow/ng_netflow.c Sat Jan 9 09:34:39 2016 (r293470) > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > > Modified: head/sys/netinet/in_pcb.c > ============================================================================== > --- head/sys/netinet/in_pcb.c Sat Jan 9 09:33:24 2016 (r293469) > +++ head/sys/netinet/in_pcb.c Sat Jan 9 09:34:39 2016 (r293470) > @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > > Modified: head/sys/netinet/ip_encap.c > ============================================================================== > --- head/sys/netinet/ip_encap.c Sat Jan 9 09:33:24 2016 (r293469) > +++ head/sys/netinet/ip_encap.c Sat Jan 9 09:34:39 2016 (r293470) > @@ -65,6 +65,8 @@ __FBSDID("$FreeBSD$"); > > #include > #include > +#include > +#include > #include > #include > #include > > Modified: head/sys/netinet/ip_mroute.c > ============================================================================== > --- head/sys/netinet/ip_mroute.c Sat Jan 9 09:33:24 2016 (r293469) > +++ head/sys/netinet/ip_mroute.c Sat Jan 9 09:34:39 2016 (r293470) > @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > > Modified: head/sys/netinet/raw_ip.c > ============================================================================== > --- head/sys/netinet/raw_ip.c Sat Jan 9 09:33:24 2016 (r293469) > +++ head/sys/netinet/raw_ip.c Sat Jan 9 09:34:39 2016 (r293470) > @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > > Modified: head/sys/netinet/tcp_reass.c > ============================================================================== > --- head/sys/netinet/tcp_reass.c Sat Jan 9 09:33:24 2016 (r293469) > +++ head/sys/netinet/tcp_reass.c Sat Jan 9 09:34:39 2016 (r293470) > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); > > #include > #include > +#include > #include > #include > #include > > Modified: head/sys/netinet/tcp_subr.c > ============================================================================== > --- head/sys/netinet/tcp_subr.c Sat Jan 9 09:33:24 2016 (r293469) > +++ head/sys/netinet/tcp_subr.c Sat Jan 9 09:34:39 2016 (r293470) > @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > > Modified: head/sys/netinet6/frag6.c > ============================================================================== > --- head/sys/netinet6/frag6.c Sat Jan 9 09:33:24 2016 (r293469) > +++ head/sys/netinet6/frag6.c Sat Jan 9 09:34:39 2016 (r293470) > @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > > Modified: head/sys/netpfil/pf/pf_if.c > ============================================================================== > --- head/sys/netpfil/pf/pf_if.c Sat Jan 9 09:33:24 2016 (r293469) > +++ head/sys/netpfil/pf/pf_if.c Sat Jan 9 09:34:39 2016 (r293470) > @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); > > #include > #include > +#include > #include > #include > #include > From owner-svn-src-head@freebsd.org Sat Jan 9 18:03:52 2016 Return-Path: Delivered-To: svn-src-head@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 86064A6975F; Sat, 9 Jan 2016 18:03:52 +0000 (UTC) (envelope-from jtl@freebsd.org) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0107.outbound.protection.outlook.com [65.55.169.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2C2615C5; Sat, 9 Jan 2016 18:03:51 +0000 (UTC) (envelope-from jtl@freebsd.org) Received: from CO2PR05CA024.namprd05.prod.outlook.com (10.141.241.152) by BN3PR0501MB1378.namprd05.prod.outlook.com (10.160.117.12) with Microsoft SMTP Server (TLS) id 15.1.361.13; Sat, 9 Jan 2016 17:49:10 +0000 Received: from BL2FFO11FD048.protection.gbl (2a01:111:f400:7c09::172) by CO2PR05CA024.outlook.office365.com (2a01:111:e400:1429::24) with Microsoft SMTP Server (TLS) id 15.1.365.19 via Frontend Transport; Sat, 9 Jan 2016 17:49:09 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=freebsd.org; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=freebsd.org; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning freebsd.org discourages use of 66.129.239.19 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.19) by BL2FFO11FD048.mail.protection.outlook.com (10.173.161.210) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Sat, 9 Jan 2016 17:49:08 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Sat, 9 Jan 2016 09:43:09 -0800 Received: from [172.29.33.83] ([172.29.33.83]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u09Hh4D18413; Sat, 9 Jan 2016 09:43:05 -0800 (PST) (envelope-from jtl@freebsd.org) User-Agent: Microsoft-MacOutlook/14.5.9.151119 Date: Sat, 9 Jan 2016 12:43:02 -0500 Subject: Re: svn commit: r293544 - in head/sys: net netinet ofed/drivers/infiniband/ulp/ipoib From: "Jonathan T. Looney" Sender: Jonathan Looney To: "Alexander V. Chernikov" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Thread-Topic: svn commit: r293544 - in head/sys: net netinet ofed/drivers/infiniband/ulp/ipoib References: <201601091634.u09GYbwn041665@repo.freebsd.org> In-Reply-To: <201601091634.u09GYbwn041665@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD048; 1:/YTshlCOKm4ULDXN1pToQWO0tDmktkuDa0ted8NrTUM4WXUNCl85N39hYgceMWxgiKdWIe8o4DJo22bGEIeBBab8HYyC5KCGhxPFowAc2VsOT/xICYU+TFMuQyKTcbOkI1pge1xbT0QfwF397KghhvJh9wlKSXVfvPI/aIRwVwf1CLoKAL5IPnnbkOoDBd2BZcjGDgS3s0Z3VCL0s5MRGDs4Sy5PRayZw7XZ0LdhsntUSQiXtMzkGEfYpg2s2LUkTcpugVCIwXvZlwNiRBPt+2UYCtcaUiZtUBObRbo3kThsGEoZtwDxAEf+6ygaHy8JbV/fckbuGc5Xtrp1024sGo722FnFUBDVcKlZwWzFGaQ= X-Forefront-Antispam-Report: CIP:66.129.239.19; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(377454003)(24454002)(189002)(479174004)(199003)(1096002)(36756003)(105596002)(230700001)(16796002)(83506001)(87936001)(50986999)(1220700001)(23726003)(19580395003)(2906002)(6806005)(47776003)(5001960100002)(450100001)(69596002)(50466002)(189998001)(106466001)(81156007)(5001770100001)(54356999)(97736004)(86362001)(19580405001)(2501003)(76176999)(4001350100001)(2201001)(77096005)(46406003)(92566002)(107886002)(586003)(2950100001)(21314002)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR0501MB1378; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0501MB1378; 2:P2uvaixzxQntDwJ6AjlUTiWuR/8YChFcIGtfEuF9GgjQAUCSoeicL3TBZnZ/bCtBd28dCXb8/dS0F7Z9d25AuMIJ71vTVg6YzvyD02wjXy0P05Qyx/WOER3QOqrrpyUwpkVb4wNsyGHpyxxeZq38hw==; 3:s8n6ljuMBAd+DuzNI/QY2CHpFWsm1mWYt3GWQulR+ll8l23rwVxCIDAvCC08yQ1fFH67akYsafo4JJm33XqWHGZDqsj07+ttaX3XOdeGeUdYGhcBqFKJEAj0P1BO79BXeiEqgYZz0vHU4Y2r8LHCz7cqHv+QqyD2QqDK1v4vxNdQFRt44OUOfdVhDpT0+qMm8mSCd3JkA6jdPwJKjGBwUSJnJb3KFHOqsQlx9gw8WXk=; 25:R6TULUDN72YF5yBRDOUjB2J35AsAFhyHYJXRNquQn7sP9VpplwHHUNf+MzL984OY5GAJR4+N3+owQUXxRzyT0i3jliSuCvTctUjEepGLKE8YUkwmf+npE2P9V+R8nnX+uqW0cbO78V1beYPV8FfS2mndFIa87efYRN+K8EK0GIfHgxiwbXOiWMIdHhjJ8+Ymb+nqfZ6FyDvP8xmAezu2UbsmVJ+2azORT2ogNt0n4MlAJ13qitbm8nuX0ZD52uvA X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0501MB1378; X-MS-Office365-Filtering-Correlation-Id: d02b14c1-6ff0-423d-4f5e-08d3191d2d03 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0501MB1378; 20:bCYQLKH1OmnkrqYUqnfoPFtPa/pueq3J0qGrzdatVkuXzguh3nFmGwr4gpnbqF8F3VokyM/KOufOlvZDquw9xVvlSkjWL6AvFAQwgixzB5KNzSlVtYFVqHRtFTtF3rcwcgmr5tFs/R+1TAeHp+PFKAAUfLUa68mDCE2c+T3PY6BlZRbs3MHItXVbqOOMeNe1TbQIdEBvfUmJmng9ZopmlyNQ0yManU5hrDPuR4c3zi7nQnpvVU3QXYO4x3A7RaSlvDvkEcihlRS/KDIPm8Vy/1GRLw1AUUCAT2XYoarYMGdakhpI5J1vD7jRh8J8gV67CSjtDQaG0x4ws/KfpVknMhYwy7eH5EEx9HZrvIRMxVq08LNKRlw5yhIffoPWNQqD7cwacicVJf3afcbhUciqx0rvzkpdIEJPM58nEYyuS2hmumubgG1EC1fUZCzk/tFRSTmSRgmljzSQKjeVe/iVYQE3Kv/m1ZB9TZu1Gz4Qtn05a/Dqi+av5DARlFtZ+uZz; 4:Q3iiLbElmhymNWW5/qD4O5U8e88Y2XYJLZS9KNr+WZZFgw0Ocra0ILs3XeQE4Ndv21AgFBOJOWSUSIsmVqNbajsF2EnhJm49EimrmSmDsRhTHOYm2iTbOuvCr2hiKftc2iCXmkIpbfXzU8K0r6Y+MpUSr4OjULwJ9R20WhN9q9ChhamOPKA58NsEr50ryzGw5kXjyFRuj/hiXZmtAvg9JIkFZN5OwHBhSC9RkmCnA35cJUfkjfTu8sGgxX1AthQptrYEL5RM15ldJ6rQYI9i3nw1z/FtzMzBzWoHSpUUIbjzI+V1LawMb1dr6wZwHBMtv/s7gi1PPefLzcFZBey9m+cLBPKJWSmHh663jwi72FUVjn1UHhLh8SkFf4wCkIjvH0q/rrrVYcjHRdPIDaHQTi6lreWC+5k0thbBK+4DyFh3+L+63EutARJxhpsyeuWT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(13015025)(13017025)(13018025)(8121501046)(3002001)(10201501046); SRVR:BN3PR0501MB1378; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0501MB1378; X-Forefront-PRVS: 0816F1D86E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0501MB1378; 23:oNqxxzBJHegANf3ujUxSd3PQX77+ou4zdhcLiEG?= =?us-ascii?Q?+8v1QR3VyVHdkb7SGE8cWhAVrYAy4aul3Tfk89r9Jx+7VuXo9yG6+p4LD2oL?= =?us-ascii?Q?yZo4W3QbvQ3rBrq0ryzm5PMtHVDP4VkNfIcc9A9L1YZRHxmEmdlkKVMam/6d?= =?us-ascii?Q?xzGbnWlL98QOemyhKxcS5XsopmQAuJRlmJHF/SGsjipnuS7GloZkivUoSCQK?= =?us-ascii?Q?jwkwVw8oZvrmLls8tC+MPVwR5hUoqA81hkk1yr2IBI8O0KeTiFcWyNWqqRs3?= =?us-ascii?Q?ljgo3O2vjUTub7+6YKeHShylPGhsfyGSvl0lqFuWMbKvLFIdTqKLoeZq0Djj?= =?us-ascii?Q?0haxiDiG1G9pwtrdpl+/8I/ZZwPftOdM7rHELiSej13wV9lk694bSkQmqL11?= =?us-ascii?Q?J9cVqxVBQNDvi+QTCQ7b85jh0s13DyPFGopw+7Z+PjfSFBBuL3tgMDID7iDy?= =?us-ascii?Q?sgwkep/GgfVc8FVOJ41UsHVgzKq7fO+QBmadbHZcYL7XpwYJ/7n5i0HnzZSx?= =?us-ascii?Q?iL3Gthc3fX0LNbCENvnwwWpg3v3oYtyZ8iVHEgamEq3gwjENuA3D3AgBIxB1?= =?us-ascii?Q?COJygg0mTHadeXsX6ICZqV87S+bhP4kDOw9+jZ9inopLvUlFADbBc19DhEhv?= =?us-ascii?Q?zUm94RnNOTXcZ6/WqCGhUp/CalvEnfV3aqjzDnh8zn0onAF6SW3P1lR2md1G?= =?us-ascii?Q?jnAXnHZq3W8lRFO5mzXdxrERMZxQVZ9EoCmOblO6d1vkXGX3mS2TVKlOwMyV?= =?us-ascii?Q?VogzQulMJAX7ioduiwO2DR+gfUBriylhPnwX5Vwmsb7TVe1qCYQ2+6w2FHni?= =?us-ascii?Q?Hf0I5lM+Xqe9Hb/rrWkDBalSpGcHhxp5k3e0yc7lD+UiQOlxa0z+rjpJiPoO?= =?us-ascii?Q?zbMKorgBzofL71rzc7vkSxqBFVu5cCS3lXKPu7s1n+yqRvdknDd1Jf3tZg6N?= =?us-ascii?Q?fcCnL2LHwUjDrYlVTcRvgXfLVAAR725xrMZW8A+eoZMPrzKHaoi+cTbIHjC/?= =?us-ascii?Q?wvN6HNtWBb0iw4UgFm3R1ql82cieon1biFe68LfHkpCE4n6fb5zRBMkoFGa1?= =?us-ascii?Q?48PIpw7Doy4So1bNR5K4wIDCj6aMq3Pj6haesTD/SzCC46V3ce0ODjpYPBjY?= =?us-ascii?Q?m8NhZlPjBYXkRN6txTdF+wOoPDoap76Sq+vTnCRW+b6+CQB348dH08A=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0501MB1378; 5:RVuqZ00vmTSFtFifsTM/KJ9JqHXcR4nXJcx1wgmjjFmSkp8xhybAPmWoxkm8vLA7pX6nQ7hUdQkoGQHsFuxLgD5+RgNldMXxcS0ZYZgK8kWgMYYxQLELIcCo4HRTpjHD8odWJ1UboUXnQ+C2xwTMwA==; 24:yUHt//riHUbcgH6GCgBBEPzsdOUbQxBznD+rNL0iDeXtKpZiNWj++8+5fJx1Or4PQanPcSAxEOUMNJ0Z0weL9qs8D49vUO0RN5w5a3oVqcE= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2016 17:49:08.5565 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.19]; Helo=[p-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0501MB1378 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:03:52 -0000 On 1/9/16, 11:34 AM, "owner-src-committers@freebsd.org on behalf of Alexander V. Chernikov" wrote: >Modified: head/sys/net/route.h >========================================================================== >==== >--- head/sys/net/route.h Sat Jan 9 16:33:55 2016 (r293543) >+++ head/sys/net/route.h Sat Jan 9 16:34:37 2016 (r293544) >@@ -64,9 +64,13 @@ struct route { > > #define RT_CACHING_CONTEXT 0x1 /* XXX: not used anywhere */ > #define RT_NORTREF 0x2 /* doesn't hold reference on ro_rt */ >-#define RT_L2_ME (1 << RT_L2_ME_BIT) >-#define RT_MAY_LOOP (1 << RT_MAY_LOOP_BIT) >-#define RT_HAS_HEADER (1 << RT_HAS_HEADER_BIT) >+#define RT_L2_ME (1 << RT_L2_ME_BIT) /* 0x0004 */ >+#define RT_MAY_LOOP (1 << RT_MAY_LOOP_BIT) /* 0x0008 */ >+#define RT_HAS_HEADER (1 << RT_HAS_HEADER_BIT) /* 0x0010 */ >+ >+#define RT_REJECT 0x0020 /* Destination is reject */ >+#define RT_BLACKHOLE 0x0040 /* Destination is blackhole */ >+#define RT_HAS_GW 0x0080 /* Destination has GW */ > > struct rt_metrics { > u_long rmx_locks; /* Kernel must leave these values alone */ >@@ -215,6 +219,19 @@ fib_rte_to_nh_flags(int rt_flags) > return (res); > } > >+/* rte<>ro_flags translation */ >+static inline void >+rt_update_ro_flags(struct route *ro) >+{ >+ int rt_flags = ro->ro_rt->rt_flags; >+ >+ ro->ro_flags &= ~ (RT_REJECT|RT_BLACKHOLE|RT_HAS_GW); >+ >+ ro->ro_flags = (rt_flags & RTF_REJECT) ? RT_REJECT : 0; >+ ro->ro_flags |= (rt_flags & RTF_BLACKHOLE) ? RT_BLACKHOLE : 0; >+ ro->ro_flags |= (rt_flags & RTF_GATEWAY) ? RT_HAS_GW : 0; >+} >+ > /* > * Routing statistics. > */ rt_update_ro_flags() probably needs to be wrapped in the same #if check that encloses the struct rtentry definition: #if defined(_KERNEL) || defined(_WANT_RTENTRY) Jonathan From owner-svn-src-head@freebsd.org Sat Jan 9 18:42:13 2016 Return-Path: Delivered-To: svn-src-head@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 BF9DFA68BA3; Sat, 9 Jan 2016 18:42:13 +0000 (UTC) (envelope-from melifaro@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 8CBD21021; Sat, 9 Jan 2016 18:42:13 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09IgC38084419; Sat, 9 Jan 2016 18:42:12 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09IgCNF084418; Sat, 9 Jan 2016 18:42:12 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201601091842.u09IgCNF084418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 9 Jan 2016 18:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293611 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:42:13 -0000 Author: melifaro Date: Sat Jan 9 18:42:12 2016 New Revision: 293611 URL: https://svnweb.freebsd.org/changeset/base/293611 Log: Fix userland build broken by r293470. Pointy hat to: melifaro Modified: head/sys/net/route.h Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sat Jan 9 18:40:20 2016 (r293610) +++ head/sys/net/route.h Sat Jan 9 18:42:12 2016 (r293611) @@ -219,6 +219,7 @@ fib_rte_to_nh_flags(int rt_flags) return (res); } +#ifdef _KERNEL /* rte<>ro_flags translation */ static inline void rt_update_ro_flags(struct route *ro) @@ -231,6 +232,7 @@ rt_update_ro_flags(struct route *ro) ro->ro_flags |= (rt_flags & RTF_BLACKHOLE) ? RT_BLACKHOLE : 0; ro->ro_flags |= (rt_flags & RTF_GATEWAY) ? RT_HAS_GW : 0; } +#endif /* * Routing statistics. From owner-svn-src-head@freebsd.org Sat Jan 9 18:43:49 2016 Return-Path: Delivered-To: svn-src-head@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 7B421A68D58; Sat, 9 Jan 2016 18:43:49 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward8j.cmail.yandex.net (forward8j.cmail.yandex.net [IPv6:2a02:6b8:0:1630::183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15522128B; Sat, 9 Jan 2016 18:43:48 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from web29j.yandex.ru (web29j.yandex.ru [IPv6:2a02:6b8:0:1619::329]) by forward8j.cmail.yandex.net (Yandex) with ESMTP id F20B321707; Sat, 9 Jan 2016 21:43:35 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web29j.yandex.ru (Yandex) with ESMTP id D445768024E1; Sat, 9 Jan 2016 21:43:34 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1452365015; bh=f21SfQKD9qvWLxqROjhz2g4+uRUW4SPL2Zpr6JnZW/Q=; h=From:To:In-Reply-To:References:Subject:Date; b=P7jw6E6Q5RlTxc3eRz/wKsTG03yiZ1OaTMDivZsnj2zschMd4Z/7XBHMgZ59U/eLP wDS2THkSfb5fOqB5oFKuCqZkH6InV4LRLdxpBpYiUOK/qDaIlqhFhPRudZAYp4RxDS mqDinfoDYbW3SHm1lf4IfnwuCwM68M1R0W5Yh38I= Received: by web29j.yandex.ru with HTTP; Sat, 09 Jan 2016 21:43:34 +0300 From: Alexander V. Chernikov To: Nathan Whitehorn , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <569144C7.6020101@freebsd.org> References: <201601090934.u099YdJu012208@repo.freebsd.org> <569144C7.6020101@freebsd.org> Subject: Re: svn commit: r293470 - in head/sys: net net80211 netgraph/netflow netinet netinet6 netpfil/pf MIME-Version: 1.0 Message-Id: <2757051452365014@web29j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 09 Jan 2016 21:43:34 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:43:49 -0000 Should be fixed in r293611. 09.01.2016, 20:35, "Nathan Whitehorn" : > One or the other of these changes seems to have broken the build of libc: > > In file included from > /usr/home/nwhitehorn/head/lib/libc/net/getifaddrs.c:42: > /usr/obj/usr/home/nwhitehorn/head/tmp/usr/include/net/route.h:226: > error: dereferencing pointer to incomplete type > -Nathan > > On 01/09/16 01:34, Alexander V. Chernikov wrote: >> šAuthor: melifaro >> šDate: Sat Jan 9 09:34:39 2016 >> šNew Revision: 293470 >> šURL: https://svnweb.freebsd.org/changeset/base/293470 >> >> šLog: >> ššššRemove sys/eventhandler.h from net/route.h >> >> ššššReviewed by: ae >> >> šModified: >> ššššhead/sys/net/route.h >> ššššhead/sys/net80211/ieee80211_freebsd.c >> ššššhead/sys/netgraph/netflow/netflow.c >> ššššhead/sys/netgraph/netflow/netflow_v9.c >> ššššhead/sys/netgraph/netflow/ng_netflow.c >> ššššhead/sys/netinet/in_pcb.c >> ššššhead/sys/netinet/ip_encap.c >> ššššhead/sys/netinet/ip_mroute.c >> ššššhead/sys/netinet/raw_ip.c >> ššššhead/sys/netinet/tcp_reass.c >> ššššhead/sys/netinet/tcp_subr.c >> ššššhead/sys/netinet6/frag6.c >> ššššhead/sys/netpfil/pf/pf_if.c >> >> šModified: head/sys/net/route.h >> š============================================================================== >> š--- head/sys/net/route.h Sat Jan 9 09:33:24 2016 (r293469) >> š+++ head/sys/net/route.h Sat Jan 9 09:34:39 2016 (r293470) >> š@@ -467,7 +467,6 @@ int rib_lookup_info(uint32_t, const stru >> šššššššššššššššstruct rt_addrinfo *); >> šššvoid rib_free_info(struct rt_addrinfo *info); >> >> š-#include >> ššš#endif >> >> ššš#endif >> >> šModified: head/sys/net80211/ieee80211_freebsd.c >> š============================================================================== >> š--- head/sys/net80211/ieee80211_freebsd.c Sat Jan 9 09:33:24 2016 (r293469) >> š+++ head/sys/net80211/ieee80211_freebsd.c Sat Jan 9 09:34:39 2016 (r293470) >> š@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); >> ššš#include >> ššš#include >> ššš#include >> š+#include >> ššš#include >> ššš#include >> ššš#include >> >> šModified: head/sys/netgraph/netflow/netflow.c >> š============================================================================== >> š--- head/sys/netgraph/netflow/netflow.c Sat Jan 9 09:33:24 2016 (r293469) >> š+++ head/sys/netgraph/netflow/netflow.c Sat Jan 9 09:34:39 2016 (r293470) >> š@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); >> ššš#include >> ššš#include >> ššš#include >> š+#include >> ššš#include >> ššš#include >> ššš#include >> >> šModified: head/sys/netgraph/netflow/netflow_v9.c >> š============================================================================== >> š--- head/sys/netgraph/netflow/netflow_v9.c Sat Jan 9 09:33:24 2016 (r293469) >> š+++ head/sys/netgraph/netflow/netflow_v9.c Sat Jan 9 09:34:39 2016 (r293470) >> š@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); >> ššš#include >> ššš#include >> ššš#include >> š+#include >> ššš#include >> ššš#include >> ššš#include >> >> šModified: head/sys/netgraph/netflow/ng_netflow.c >> š============================================================================== >> š--- head/sys/netgraph/netflow/ng_netflow.c Sat Jan 9 09:33:24 2016 (r293469) >> š+++ head/sys/netgraph/netflow/ng_netflow.c Sat Jan 9 09:34:39 2016 (r293470) >> š@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); >> ššš#include >> ššš#include >> ššš#include >> š+#include >> ššš#include >> ššš#include >> ššš#include >> >> šModified: head/sys/netinet/in_pcb.c >> š============================================================================== >> š--- head/sys/netinet/in_pcb.c Sat Jan 9 09:33:24 2016 (r293469) >> š+++ head/sys/netinet/in_pcb.c Sat Jan 9 09:34:39 2016 (r293470) >> š@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); >> ššš#include >> ššš#include >> ššš#include >> š+#include >> ššš#include >> ššš#include >> ššš#include >> >> šModified: head/sys/netinet/ip_encap.c >> š============================================================================== >> š--- head/sys/netinet/ip_encap.c Sat Jan 9 09:33:24 2016 (r293469) >> š+++ head/sys/netinet/ip_encap.c Sat Jan 9 09:34:39 2016 (r293470) >> š@@ -65,6 +65,8 @@ __FBSDID("$FreeBSD$"); >> >> ššš#include >> ššš#include >> š+#include >> š+#include >> ššš#include >> ššš#include >> ššš#include >> >> šModified: head/sys/netinet/ip_mroute.c >> š============================================================================== >> š--- head/sys/netinet/ip_mroute.c Sat Jan 9 09:33:24 2016 (r293469) >> š+++ head/sys/netinet/ip_mroute.c Sat Jan 9 09:34:39 2016 (r293470) >> š@@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); >> ššš#include >> ššš#include >> ššš#include >> š+#include >> ššš#include >> ššš#include >> ššš#include >> >> šModified: head/sys/netinet/raw_ip.c >> š============================================================================== >> š--- head/sys/netinet/raw_ip.c Sat Jan 9 09:33:24 2016 (r293469) >> š+++ head/sys/netinet/raw_ip.c Sat Jan 9 09:34:39 2016 (r293470) >> š@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); >> ššš#include >> ššš#include >> ššš#include >> š+#include >> ššš#include >> ššš#include >> ššš#include >> >> šModified: head/sys/netinet/tcp_reass.c >> š============================================================================== >> š--- head/sys/netinet/tcp_reass.c Sat Jan 9 09:33:24 2016 (r293469) >> š+++ head/sys/netinet/tcp_reass.c Sat Jan 9 09:34:39 2016 (r293470) >> š@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); >> >> ššš#include >> ššš#include >> š+#include >> ššš#include >> ššš#include >> ššš#include >> >> šModified: head/sys/netinet/tcp_subr.c >> š============================================================================== >> š--- head/sys/netinet/tcp_subr.c Sat Jan 9 09:33:24 2016 (r293469) >> š+++ head/sys/netinet/tcp_subr.c Sat Jan 9 09:34:39 2016 (r293470) >> š@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); >> ššš#include >> ššš#include >> ššš#include >> š+#include >> ššš#include >> ššš#include >> ššš#include >> >> šModified: head/sys/netinet6/frag6.c >> š============================================================================== >> š--- head/sys/netinet6/frag6.c Sat Jan 9 09:33:24 2016 (r293469) >> š+++ head/sys/netinet6/frag6.c Sat Jan 9 09:34:39 2016 (r293470) >> š@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); >> ššš#include >> ššš#include >> ššš#include >> š+#include >> ššš#include >> ššš#include >> ššš#include >> >> šModified: head/sys/netpfil/pf/pf_if.c >> š============================================================================== >> š--- head/sys/netpfil/pf/pf_if.c Sat Jan 9 09:33:24 2016 (r293469) >> š+++ head/sys/netpfil/pf/pf_if.c Sat Jan 9 09:34:39 2016 (r293470) >> š@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); >> >> ššš#include >> ššš#include >> š+#include >> ššš#include >> ššš#include >> ššš#include From owner-svn-src-head@freebsd.org Sat Jan 9 18:44:03 2016 Return-Path: Delivered-To: svn-src-head@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 B75F7A68D8A; Sat, 9 Jan 2016 18:44:03 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward19j.cmail.yandex.net (forward19j.cmail.yandex.net [IPv6:2a02:6b8:0:1630::f6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74AF713CE; Sat, 9 Jan 2016 18:44:03 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from web29j.yandex.ru (web29j.yandex.ru [5.45.198.70]) by forward19j.cmail.yandex.net (Yandex) with ESMTP id 4FDAD2145E; Sat, 9 Jan 2016 21:43:50 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web29j.yandex.ru (Yandex) with ESMTP id 804AA68024E1; Sat, 9 Jan 2016 21:43:49 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1452365029; bh=2rxVUW1j0AGwuBi+C4LPyke5UQUbeefhnkmrogYCtAw=; h=From:To:In-Reply-To:References:Subject:Date; b=R228YAdXN4aANMxRbrAsTSHKCptfeU+SnsBcp2Gmg+rfd726nLiGXONxzMI/FvtoH aHKZ3lKr/MhsamdHzHrdkDHIma4bTktP1K+jKEM19LCqEfBH95GUah6hziGBv5+fF6 ix3PxDTIM3BYBpE42HFvaOJhvUBEnNx8okeCV+3s= Received: by web29j.yandex.ru with HTTP; Sat, 09 Jan 2016 21:43:49 +0300 From: Alexander V. Chernikov To: Jonathan T. Looney , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: References: <201601091634.u09GYbwn041665@repo.freebsd.org> Subject: Re: svn commit: r293544 - in head/sys: net netinet ofed/drivers/infiniband/ulp/ipoib MIME-Version: 1.0 Message-Id: <2757471452365029@web29j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 09 Jan 2016 21:43:49 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:44:03 -0000 Thanks, should be fixed in r293611. 09.01.2016, 21:04, "Jonathan T. Looney" : > On 1/9/16, 11:34 AM, "owner-src-committers@freebsd.org on behalf of > Alexander V. Chernikov" melifaro@FreeBSD.org> wrote: > >> Modified: head/sys/net/route.h >> ========================================================================== >> ==== >> --- head/sys/net/route.h Sat Jan 9 16:33:55 2016 (r293543) >> +++ head/sys/net/route.h Sat Jan 9 16:34:37 2016 (r293544) >> @@ -64,9 +64,13 @@ struct route { >> >> š#define RT_CACHING_CONTEXT 0x1 /* XXX: not used anywhere */ >> š#define RT_NORTREF 0x2 /* doesn't hold reference on ro_rt */ >> -#define RT_L2_ME (1 << RT_L2_ME_BIT) >> -#define RT_MAY_LOOP (1 << RT_MAY_LOOP_BIT) >> -#define RT_HAS_HEADER (1 << RT_HAS_HEADER_BIT) >> +#define RT_L2_ME (1 << RT_L2_ME_BIT) /* 0x0004 */ >> +#define RT_MAY_LOOP (1 << RT_MAY_LOOP_BIT) /* 0x0008 */ >> +#define RT_HAS_HEADER (1 << RT_HAS_HEADER_BIT) /* 0x0010 */ >> + >> +#define RT_REJECT 0x0020 /* Destination is reject */ >> +#define RT_BLACKHOLE 0x0040 /* Destination is blackhole */ >> +#define RT_HAS_GW 0x0080 /* Destination has GW */ >> >> šstruct rt_metrics { >> šššššššššu_long rmx_locks; /* Kernel must leave these values alone */ >> @@ -215,6 +219,19 @@ fib_rte_to_nh_flags(int rt_flags) >> šššššššššreturn (res); >> š} >> >> +/* rte<>ro_flags translation */ >> +static inline void >> +rt_update_ro_flags(struct route *ro) >> +{ >> + int rt_flags = ro->ro_rt->rt_flags; >> + >> + ro->ro_flags &= ~ (RT_REJECT|RT_BLACKHOLE|RT_HAS_GW); >> + >> + ro->ro_flags = (rt_flags & RTF_REJECT) ? RT_REJECT : 0; >> + ro->ro_flags |= (rt_flags & RTF_BLACKHOLE) ? RT_BLACKHOLE : 0; >> + ro->ro_flags |= (rt_flags & RTF_GATEWAY) ? RT_HAS_GW : 0; >> +} >> + >> š/* >> šš* Routing statistics. >> šš*/ > > rt_update_ro_flags() probably needs to be wrapped in the same #if check > that encloses the struct rtentry definition: > > ššš#if defined(_KERNEL) || defined(_WANT_RTENTRY) > > Jonathan From owner-svn-src-head@freebsd.org Sat Jan 9 19:13:27 2016 Return-Path: Delivered-To: svn-src-head@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 183CDA69973; Sat, 9 Jan 2016 19:13:27 +0000 (UTC) (envelope-from allanjude@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 DD2271825; Sat, 9 Jan 2016 19:13:26 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09JDQjA093290; Sat, 9 Jan 2016 19:13:26 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09JDQsJ093289; Sat, 9 Jan 2016 19:13:26 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201601091913.u09JDQsJ093289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 9 Jan 2016 19:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293612 - head/sys/boot/i386/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 19:13:27 -0000 Author: allanjude Date: Sat Jan 9 19:13:25 2016 New Revision: 293612 URL: https://svnweb.freebsd.org/changeset/base/293612 Log: Return call to init_zfs_bootenv to its previous location When called to early, new_currdev->d_type was not yet set zfs_fmtdev() would then return null While here, guard call to init_zfs_bootenv with if d_type == DEVT_ZFS Reported by: tsoome at me.com MFC after: 3 days Sponsored by: ScaleEngine Inc. Modified: head/sys/boot/i386/loader/main.c Modified: head/sys/boot/i386/loader/main.c ============================================================================== --- head/sys/boot/i386/loader/main.c Sat Jan 9 18:42:12 2016 (r293611) +++ head/sys/boot/i386/loader/main.c Sat Jan 9 19:13:25 2016 (r293612) @@ -262,7 +262,6 @@ extract_currdev(void) new_currdev.d_kind.zfs.root_guid = 0; } new_currdev.d_dev = &zfs_dev; - init_zfs_bootenv(zfs_fmtdev(&new_currdev)); #endif } else if ((initial_bootdev & B_MAGICMASK) != B_DEVMAGIC) { /* The passed-in boot device is bad */ @@ -296,6 +295,11 @@ extract_currdev(void) new_currdev.d_unit = 0; } +#ifdef LOADER_ZFS_SUPPORT + if (new_currdev.d_type == DEVT_ZFS) + init_zfs_bootenv(zfs_fmtdev(&new_currdev)); +#endif + env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev), i386_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset, From owner-svn-src-head@freebsd.org Sat Jan 9 19:41:58 2016 Return-Path: Delivered-To: svn-src-head@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 6AB56A6A368; Sat, 9 Jan 2016 19:41:58 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (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 3C72215BA; Sat, 9 Jan 2016 19:41:58 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-io0-x234.google.com with SMTP id q21so316090752iod.0; Sat, 09 Jan 2016 11:41:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ym4Vi4K2ND1Kk1ywrTYIPcmifHrYp75dQC1ZHqgd0m4=; b=HY8CFCeyhfxJp4h1tfGjm+C8H7bCdNaXOTmxlzVqWM80SuNfN9O3xZ2bdPZ8m0Jpeg IyUNiMUl0pWkKbQOV8gVAC3RG6QtMJgiJo4ns1F8LDzf3rVbrT0CQRR6BW0oA1DBUr6y YG2AWGR1huHDdM/MLGsrgHGYPTssCjfOLikVgP/qJf0icvF9ZBpNVGiQktS9o+UcwWLb XDhYUhCv/0TMQhSLCycNzLECnE0jPKincUG+mtOjxOxYBl7/HzvpSmTN58nCdiLq/yyC es1qwJfixRG1mSewnAcmiutU22SfkG0IYnOFrSTBd4WeotI1GD67DWgKB8Pduk/etxPH EqwQ== MIME-Version: 1.0 X-Received: by 10.107.132.159 with SMTP id o31mr70258974ioi.32.1452368517663; Sat, 09 Jan 2016 11:41:57 -0800 (PST) Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.159.195 with HTTP; Sat, 9 Jan 2016 11:41:57 -0800 (PST) In-Reply-To: <201601082034.u08KYvLv075281@repo.freebsd.org> References: <201601082034.u08KYvLv075281@repo.freebsd.org> Date: Sat, 9 Jan 2016 19:41:57 +0000 X-Google-Sender-Auth: 0T5FhBGZbFk_bISR3CL3E7wyQAQ Message-ID: Subject: Re: svn commit: r293439 - in head: lib/libc/sys sys/dev/ti sys/kern sys/sys usr.bin/netstat From: Antoine Brodin To: Gleb Smirnoff , Dirk Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 19:41:58 -0000 On Fri, Jan 8, 2016 at 8:34 PM, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Jan 8 20:34:57 2016 > New Revision: 293439 > URL: https://svnweb.freebsd.org/changeset/base/293439 > > Log: > New sendfile(2) syscall. A joint effort of NGINX and Netflix from 2013 and > up to now. Hi, "SF_FLAGS" addition seems to break graphics/graphviz on head. See error log at: http://beefy3.nyi.freebsd.org/data/head-i386-default/p405601_s293454/logs/errors/graphviz-2.38.0_10.log 739 ports are skipped due to this failure. Cheers, Antoine From owner-svn-src-head@freebsd.org Sat Jan 9 20:18:57 2016 Return-Path: Delivered-To: svn-src-head@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 2782CA6AE6E; Sat, 9 Jan 2016 20:18:57 +0000 (UTC) (envelope-from dchagin@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 0142F198B; Sat, 9 Jan 2016 20:18:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09KIugA011168; Sat, 9 Jan 2016 20:18:56 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09KIsDd011149; Sat, 9 Jan 2016 20:18:54 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601092018.u09KIsDd011149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 20:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293613 - in head/sys: amd64/amd64 amd64/linux amd64/linux32 arm/arm arm64/arm64 compat/ia32 compat/svr4 i386/i386 i386/ibcs2 i386/linux kern mips/mips powerpc/powerpc sparc64/sparc64 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 20:18:57 -0000 Author: dchagin Date: Sat Jan 9 20:18:53 2016 New Revision: 293613 URL: https://svnweb.freebsd.org/changeset/base/293613 Log: Implement vsyscall hack. Prior to 2.13 glibc uses vsyscall instead of vdso. An upcoming linux_base-c6 needs it. Differential Revision: https://reviews.freebsd.org/D1090 Reviewed by: kib, trasz MFC after: 1 week Modified: head/sys/amd64/amd64/elf_machdep.c head/sys/amd64/amd64/trap.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm/arm/elf_machdep.c head/sys/arm64/arm64/elf_machdep.c head/sys/compat/ia32/ia32_sysvec.c head/sys/compat/svr4/svr4_sysvec.c head/sys/i386/i386/elf_machdep.c head/sys/i386/ibcs2/ibcs2_sysvec.c head/sys/i386/linux/linux_sysvec.c head/sys/kern/imgact_aout.c head/sys/kern/init_main.c head/sys/mips/mips/elf_machdep.c head/sys/mips/mips/freebsd32_machdep.c head/sys/powerpc/powerpc/elf32_machdep.c head/sys/powerpc/powerpc/elf64_machdep.c head/sys/sparc64/sparc64/elf_machdep.c head/sys/sys/sysent.h Modified: head/sys/amd64/amd64/elf_machdep.c ============================================================================== --- head/sys/amd64/amd64/elf_machdep.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/amd64/amd64/elf_machdep.c Sat Jan 9 20:18:53 2016 (r293613) @@ -80,6 +80,7 @@ struct sysentvec elf64_freebsd_sysvec = .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, .sv_thread_detach = NULL, + .sv_trap = NULL, }; INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/amd64/amd64/trap.c Sat Jan 9 20:18:53 2016 (r293613) @@ -322,6 +322,13 @@ trap(struct trapframe *frame) break; case T_PAGEFLT: /* page fault */ + /* + * Emulator can take care about this trap? + */ + if (*p->p_sysent->sv_trap != NULL && + (*p->p_sysent->sv_trap)(td) == 0) + goto userout; + addr = frame->tf_addr; i = trap_pfault(frame, TRUE); if (i == -1) Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/amd64/linux/linux_sysvec.c Sat Jan 9 20:18:53 2016 (r293613) @@ -129,6 +129,7 @@ static void linux_set_syscall_retval(str static int linux_fetch_syscall_args(struct thread *td, struct syscall_args *sa); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack); +static int linux_vsyscall(struct thread *td); /* * Linux syscalls return negative errno's, we do positive and map them @@ -746,6 +747,53 @@ exec_linux_imgact_try(struct image_param return(error); } +#define LINUX_VSYSCALL_START (-10UL << 20) +#define LINUX_VSYSCALL_SZ 1024 + +const unsigned long linux_vsyscall_vector[] = { + LINUX_SYS_gettimeofday, + LINUX_SYS_linux_time, + /* getcpu not implemented */ +}; + +static int +linux_vsyscall(struct thread *td) +{ + struct trapframe *frame; + uint64_t retqaddr; + int code, traced; + int error; + + frame = td->td_frame; + + /* Check %rip for vsyscall area */ + if (__predict_true(frame->tf_rip < LINUX_VSYSCALL_START)) + return (EINVAL); + if ((frame->tf_rip & (LINUX_VSYSCALL_SZ - 1)) != 0) + return (EINVAL); + code = (frame->tf_rip - LINUX_VSYSCALL_START) / LINUX_VSYSCALL_SZ; + if (code >= nitems(linux_vsyscall_vector)) + return (EINVAL); + + /* + * vsyscall called as callq *(%rax), so we must + * use return address from %rsp and also fixup %rsp + */ + error = copyin((void *)frame->tf_rsp, &retqaddr, sizeof(retqaddr)); + if (error) + return (error); + + frame->tf_rip = retqaddr; + frame->tf_rax = linux_vsyscall_vector[code]; + frame->tf_rsp += 8; + + traced = (frame->tf_flags & PSL_T); + + amd64_syscall(td, traced); + + return (0); +} + struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, @@ -778,7 +826,8 @@ struct sysentvec elf_linux_sysvec = { .sv_shared_page_base = SHAREDPAGE, .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = linux_schedtail, - .sv_thread_detach = linux_thread_detach + .sv_thread_detach = linux_thread_detach, + .sv_trap = linux_vsyscall, }; static void Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 20:18:53 2016 (r293613) @@ -1040,6 +1040,7 @@ struct sysentvec elf_linux_sysvec = { .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, + .sv_trap = NULL, }; static void Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/arm/arm/elf_machdep.c Sat Jan 9 20:18:53 2016 (r293613) @@ -86,6 +86,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, .sv_thread_detach = NULL, + .sv_trap = NULL, }; INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); Modified: head/sys/arm64/arm64/elf_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf_machdep.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/arm64/arm64/elf_machdep.c Sat Jan 9 20:18:53 2016 (r293613) @@ -87,6 +87,8 @@ static struct sysentvec elf64_freebsd_sy .sv_shared_page_base = SHAREDPAGE, .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, + .sv_thread_detach = NULL, + .sv_trap = NULL, }; INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); Modified: head/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- head/sys/compat/ia32/ia32_sysvec.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/compat/ia32/ia32_sysvec.c Sat Jan 9 20:18:53 2016 (r293613) @@ -134,6 +134,7 @@ struct sysentvec ia32_freebsd_sysvec = { .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, .sv_thread_detach = NULL, + .sv_trap = NULL, }; INIT_SYSENTVEC(elf_ia32_sysvec, &ia32_freebsd_sysvec); Modified: head/sys/compat/svr4/svr4_sysvec.c ============================================================================== --- head/sys/compat/svr4/svr4_sysvec.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/compat/svr4/svr4_sysvec.c Sat Jan 9 20:18:53 2016 (r293613) @@ -194,6 +194,7 @@ struct sysentvec svr4_sysvec = { .sv_syscallnames = NULL, .sv_schedtail = NULL, .sv_thread_detach = NULL, + .sv_trap = NULL, }; const char svr4_emul_path[] = "/compat/svr4"; Modified: head/sys/i386/i386/elf_machdep.c ============================================================================== --- head/sys/i386/i386/elf_machdep.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/i386/i386/elf_machdep.c Sat Jan 9 20:18:53 2016 (r293613) @@ -87,6 +87,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, .sv_thread_detach = NULL, + .sv_trap = NULL, }; INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); Modified: head/sys/i386/ibcs2/ibcs2_sysvec.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_sysvec.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/i386/ibcs2/ibcs2_sysvec.c Sat Jan 9 20:18:53 2016 (r293613) @@ -90,6 +90,7 @@ struct sysentvec ibcs2_svr3_sysvec = { .sv_syscallnames = NULL, .sv_schedtail = NULL, .sv_thread_detach = NULL, + .sv_trap = NULL, }; static int Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/i386/linux/linux_sysvec.c Sat Jan 9 20:18:53 2016 (r293613) @@ -985,6 +985,7 @@ struct sysentvec linux_sysvec = { .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, + .sv_trap = NULL, }; INIT_SYSENTVEC(aout_sysvec, &linux_sysvec); @@ -1021,6 +1022,7 @@ struct sysentvec elf_linux_sysvec = { .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, + .sv_trap = NULL, }; static void Modified: head/sys/kern/imgact_aout.c ============================================================================== --- head/sys/kern/imgact_aout.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/kern/imgact_aout.c Sat Jan 9 20:18:53 2016 (r293613) @@ -97,6 +97,7 @@ struct sysentvec aout_sysvec = { .sv_syscallnames = syscallnames, .sv_schedtail = NULL, .sv_thread_detach = NULL, + .sv_trap = NULL, }; #elif defined(__amd64__) Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/kern/init_main.c Sat Jan 9 20:18:53 2016 (r293613) @@ -414,6 +414,7 @@ struct sysentvec null_sysvec = { .sv_syscallnames = NULL, .sv_schedtail = NULL, .sv_thread_detach = NULL, + .sv_trap = NULL, }; /* Modified: head/sys/mips/mips/elf_machdep.c ============================================================================== --- head/sys/mips/mips/elf_machdep.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/mips/mips/elf_machdep.c Sat Jan 9 20:18:53 2016 (r293613) @@ -81,6 +81,7 @@ struct sysentvec elf64_freebsd_sysvec = .sv_syscallnames = syscallnames, .sv_schedtail = NULL, .sv_thread_detach = NULL, + .sv_trap = NULL, }; static Elf64_Brandinfo freebsd_brand_info = { @@ -135,6 +136,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_syscallnames = syscallnames, .sv_schedtail = NULL, .sv_thread_detach = NULL, + .sv_trap = NULL, }; static Elf32_Brandinfo freebsd_brand_info = { Modified: head/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- head/sys/mips/mips/freebsd32_machdep.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/mips/mips/freebsd32_machdep.c Sat Jan 9 20:18:53 2016 (r293613) @@ -104,6 +104,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_syscallnames = freebsd32_syscallnames, .sv_schedtail = NULL, .sv_thread_detach = NULL, + .sv_trap = NULL, }; INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); Modified: head/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf32_machdep.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/powerpc/powerpc/elf32_machdep.c Sat Jan 9 20:18:53 2016 (r293613) @@ -106,6 +106,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, .sv_thread_detach = NULL, + .sv_trap = NULL, }; INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/powerpc/powerpc/elf64_machdep.c Sat Jan 9 20:18:53 2016 (r293613) @@ -85,6 +85,7 @@ struct sysentvec elf64_freebsd_sysvec_v1 .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, .sv_thread_detach = NULL, + .sv_trap = NULL, }; INIT_SYSENTVEC(elf64_sysvec_v1, &elf64_freebsd_sysvec_v1); Modified: head/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/elf_machdep.c Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/sparc64/sparc64/elf_machdep.c Sat Jan 9 20:18:53 2016 (r293613) @@ -85,6 +85,7 @@ static struct sysentvec elf64_freebsd_sy .sv_syscallnames = syscallnames, .sv_schedtail = NULL, .sv_thread_detach = NULL, + .sv_trap = NULL, }; static Elf64_Brandinfo freebsd_brand_info = { Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Sat Jan 9 19:13:25 2016 (r293612) +++ head/sys/sys/sysent.h Sat Jan 9 20:18:53 2016 (r293613) @@ -129,6 +129,7 @@ struct sysentvec { void *sv_shared_page_obj; void (*sv_schedtail)(struct thread *); void (*sv_thread_detach)(struct thread *); + int (*sv_trap)(struct thread *); }; #define SV_ILP32 0x000100 /* 32-bit executable. */ From owner-svn-src-head@freebsd.org Sat Jan 9 20:19:22 2016 Return-Path: Delivered-To: svn-src-head@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 35E4FA6AEB7; Sat, 9 Jan 2016 20:19:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (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 0D9C51B1B; Sat, 9 Jan 2016 20:19:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id q63so25981117pfb.1; Sat, 09 Jan 2016 12:19:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yFvzH21eo8SFz33kUdQ9dSkH0Y7IQYmmwE41lnMyP1E=; b=Mmlm7I3HNYCgv5IsDAUg8Yoj/CzouDo0ZGC5hhFOH1+uxiOT1B4yDAkOySQRjPQlIL /JSN6etir+NRwH/752CXbX7UYKTShEvxJARI+2Sws5hlRr09SSNPuTlEAauq+D/eoR0P xi7W40H8/UziNoyiNAWxinFqfpD09I+7mwRpfh1kt+iB1nITDN6+3F9Vj5irkzfrsyET AroYwa8pdOoiswqk0yY7snmpeqzZbMvZlCIeOAEqqIlwmb+fOtB3ipM9IdnkIYu/XJCz TiK7OCL4KOaVUbo62ztrvESnrA+gC05mFnyuNbDVvyl5caznVYDlEJ4rYI+P4NNmF8hb 5IEQ== X-Received: by 10.98.12.213 with SMTP id 82mr14199000pfm.116.1452370761621; Sat, 09 Jan 2016 12:19:21 -0800 (PST) Received: from [192.168.20.7] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id s19sm2072771pfs.62.2016.01.09.12.19.19 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 09 Jan 2016 12:19:20 -0800 (PST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r293459 - head/usr.sbin/bhyve From: NGie Cooper In-Reply-To: <569095B0.10707@freebsd.org> Date: Sat, 9 Jan 2016 12:19:18 -0800 Cc: Gleb Smirnoff , "George V. Neville-Neil" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <168E1B93-9853-4393-B9E9-9837EBB56254@gmail.com> References: <201601090308.u0938LAm090546@repo.freebsd.org> <20160109040933.GO1906@FreeBSD.org> <569095B0.10707@freebsd.org> To: Allan Jude X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 20:19:22 -0000 > On Jan 8, 2016, at 21:08, Allan Jude wrote: >=20 > On 2016-01-08 23:09, Gleb Smirnoff wrote: >> On Sat, Jan 09, 2016 at 03:08:21AM +0000, George V. Neville-Neil = wrote: >> G> Author: gnn >> G> Date: Sat Jan 9 03:08:21 2016 >> G> New Revision: 293459 >> G> URL: https://svnweb.freebsd.org/changeset/base/293459 >> G>=20 >> G> Log: >> G> Add netmap support for bhyve >> G> =20 >> G> Submitted by: btw >> G> MFC after: 1 week >> G> Differential Revision: https://reviews.freebsd.org/D4826 >>=20 >> I guess "btw" is Tiwei Bei and he doesn't have FreeBSD account. >> The common rule is to put only valid FreeBSD accounts into "Submitted = by:" >> or full name and email (possibly mangled email). >>=20 >> Once you or someone else will request a commit access for Tiwei, >> and core@ will look into his submission record, grep(1) on his name=20= >> or email through commit logs will miss this important submission. >>=20 >=20 > How did they get a phabricator user of 'btw' without an account? I > thought all non @freebsd.org accounts were forced to be a full email > address. This was likely before the requirement was put in place. In = either way, this is a question probably best suited for phabric-admin, = not svn*. Thanks! -NGie [ngie@freefall ~]$ finger btw finger: btw: no such user [ngie@freefall ~]$ getent passwd | grep -i tiwei || echo not found not found [ngie@freefall ~]$= From owner-svn-src-head@freebsd.org Sat Jan 9 20:33:14 2016 Return-Path: Delivered-To: svn-src-head@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 478CBA6968C for ; Sat, 9 Jan 2016 20:33:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm34-vm5.bullet.mail.bf1.yahoo.com (nm34-vm5.bullet.mail.bf1.yahoo.com [72.30.239.77]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE5FE149E for ; Sat, 9 Jan 2016 20:33:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1452371191; bh=1r2inf5kfSgit9qsQSXfW24dO6inHt59ClBW7WV46fs=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=lN5Jo+p1TcL/FzZpGFfpGjWJd9GSczqhlfOXvYsy31n2q5zfoa3i+gUcCWCfqO02fRT5So37a4P1gOSeb+CUbXDULBRNqIvNF9b1b86ntwxYVU4dzTPLBoydKI+OkM+1ZKmxt8mU/tfPwtO30/1MpOi2fCmC10Uejt95BRIsvMRmOKe35beMZr3U1HN+t4kXM8Jg88HFEj3VcXw5rvpt/0fYfotAeDDcg9IzsMDu5SolpVuFkyre9I/IHbUp0O55/QERfyA/C+KLu45Mm+a+rTUVNeAoDoAJz42rrAu+fdiq+zQ/WrpdHlaFNj7EBeyh9iZRYrXXHgMhzdNZcihZWg== Received: from [98.139.170.179] by nm34.bullet.mail.bf1.yahoo.com with NNFMP; 09 Jan 2016 20:26:31 -0000 Received: from [68.142.230.75] by tm22.bullet.mail.bf1.yahoo.com with NNFMP; 09 Jan 2016 20:26:31 -0000 Received: from [127.0.0.1] by smtp232.mail.bf1.yahoo.com with NNFMP; 09 Jan 2016 20:26:31 -0000 X-Yahoo-Newman-Id: 910923.80645.bm@smtp232.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: fvflemIVM1mYser6UD7ruh92pNviJ334rjfWbR2v1ZahltK i_TbC7mi67h5LxDwF3BFo4KzmdfW397s30mn8PNug1oL8vAZYWaHpbtIZxxl agkrfsHUwLhFGAFqNamGQYBfgtb.WQ6LzjsbG4L8Ulo5p_IIzv.ecUqPD5fP POVf3ovVqvF91BJGrzwSbqhuoBNRYvH0wVGTFyI3EPZvrWNdFDEmPEB1wdpq NKwlPml.iZVXOcck817Ah9helGP50IAzzuIVuk4mGlyUkS8ivfsNrAIhZZGY _yrDIQqjLrmHgN_0ypCtvAhLJPLyDoRV90RYOSqr84Ybp0USDwiJ_EC84eEl lTGvwmwluVdcROn7rAjM3XRNR.bxyQ2UUWcAuTffPaNr_GhKjepcqQaL7zoT UKHRRDcY_YzuBquakvWqY9rzaI8nUB9u0D4aLHoGOEvX44yxeKZmMgkvizZC lGOfEWx4FAQ2pB5rQgVuTmnlfuigmSErTAE4ZShJzgr.dehOnS3zlucssgnM n9vkcRSYoWM.CPNXYtFxiPT23ykatt9K9wQljhxRTwg-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r293459 - head/usr.sbin/bhyve To: Allan Jude , Gleb Smirnoff , "George V. Neville-Neil" References: <201601090308.u0938LAm090546@repo.freebsd.org> <20160109040933.GO1906@FreeBSD.org> <569095B0.10707@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <56916CF9.1000609@FreeBSD.org> Date: Sat, 9 Jan 2016 15:26:33 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <569095B0.10707@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 20:33:14 -0000 On 01/09/16 00:08, Allan Jude wrote: > On 2016-01-08 23:09, Gleb Smirnoff wrote: >> On Sat, Jan 09, 2016 at 03:08:21AM +0000, George V. Neville-Neil wrote: >> G> Author: gnn >> G> Date: Sat Jan 9 03:08:21 2016 >> G> New Revision: 293459 >> G> URL: https://svnweb.freebsd.org/changeset/base/293459 >> G> >> G> Log: >> G> Add netmap support for bhyve >> G> >> G> Submitted by: btw >> G> MFC after: 1 week >> G> Differential Revision: https://reviews.freebsd.org/D4826 >> >> I guess "btw" is Tiwei Bei and he doesn't have FreeBSD account. >> The common rule is to put only valid FreeBSD accounts into "Submitted by:" >> or full name and email (possibly mangled email). >> >> Once you or someone else will request a commit access for Tiwei, >> and core@ will look into his submission record, grep(1) on his name >> or email through commit logs will miss this important submission. >> > > How did they get a phabricator user of 'btw' without an account? I > thought all non @freebsd.org accounts were forced to be a full email > address. > If I am not wrong, btw has a mail alias as he was a GSoC student. Perhaps the alias is sufficient for phabricator. Pedro. From owner-svn-src-head@freebsd.org Sat Jan 9 21:15:09 2016 Return-Path: Delivered-To: svn-src-head@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 D2DFCA6A63F; Sat, 9 Jan 2016 21:15:09 +0000 (UTC) (envelope-from kczekirda@gmail.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (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 83CE01BDD; Sat, 9 Jan 2016 21:15:09 +0000 (UTC) (envelope-from kczekirda@gmail.com) Received: by mail-wm0-x231.google.com with SMTP id f206so217495296wmf.0; Sat, 09 Jan 2016 13:15:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=7qQSxm3fKQXYrwgBEok0XRQFTvonG+j059d0xoalI2s=; b=pHUSojWuVYPaRqNThc8Y+04jO8BZiArgEepz3lwgU29PYjdxevrqUx1IDBIAvQZhoN /cl68FqVFSDw+0DheJfPuTVGQ3ps2M5Wtr8AxJzDruG0ojdvzgCH9q1B9GuwRw/FRWbA eAkqq4zAo8I+3wz5Oux6nqiXQObCCy60QA9h5QbwWNOVQWIp2dVxgPEScRrF/k4tJSRE /x+Onj27d9Z7oVLETIbrnN/EibI0n9F28QRKl6pWCNkaD6UP5JMPCyZgweft1aepM6af YmK+yKw3M/8HwpU/Krse6wWzPk47zL68k7mo23iG2kYqrKIhVFBE1GENDHKcZjDLMd8/ Tv8g== X-Received: by 10.28.16.78 with SMTP id 75mr5724619wmq.82.1452374107967; Sat, 09 Jan 2016 13:15:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.31.9 with HTTP; Sat, 9 Jan 2016 13:14:38 -0800 (PST) In-Reply-To: <56916CF9.1000609@FreeBSD.org> References: <201601090308.u0938LAm090546@repo.freebsd.org> <20160109040933.GO1906@FreeBSD.org> <569095B0.10707@freebsd.org> <56916CF9.1000609@FreeBSD.org> From: Kamil Czekirda Date: Sat, 9 Jan 2016 22:14:38 +0100 Message-ID: Subject: Re: svn commit: r293459 - head/usr.sbin/bhyve To: Pedro Giffuni Cc: Allan Jude , Gleb Smirnoff , "George V. Neville-Neil" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 21:15:10 -0000 Have the same: https://lists.freebsd.org/pipermail/svn-src-head/2015-June/073179.html It's GSoC students feature. Kamil 2016-01-09 21:26 GMT+01:00 Pedro Giffuni : > > > On 01/09/16 00:08, Allan Jude wrote: > >> On 2016-01-08 23:09, Gleb Smirnoff wrote: >> >>> On Sat, Jan 09, 2016 at 03:08:21AM +0000, George V. Neville-Neil wrote: >>> G> Author: gnn >>> G> Date: Sat Jan 9 03:08:21 2016 >>> G> New Revision: 293459 >>> G> URL: https://svnweb.freebsd.org/changeset/base/293459 >>> G> >>> G> Log: >>> G> Add netmap support for bhyve >>> G> >>> G> Submitted by: btw >>> G> MFC after: 1 week >>> G> Differential Revision: https://reviews.freebsd.org/D4826 >>> >>> I guess "btw" is Tiwei Bei and he doesn't have FreeBSD account. >>> The common rule is to put only valid FreeBSD accounts into "Submitted >>> by:" >>> or full name and email (possibly mangled email). >>> >>> Once you or someone else will request a commit access for Tiwei, >>> and core@ will look into his submission record, grep(1) on his name >>> or email through commit logs will miss this important submission. >>> >>> >> How did they get a phabricator user of 'btw' without an account? I >> thought all non @freebsd.org accounts were forced to be a full email >> address. >> >> > If I am not wrong, btw has a mail alias as he was a GSoC student. > Perhaps the alias is sufficient for phabricator. > > Pedro. > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Sat Jan 9 21:21:14 2016 Return-Path: Delivered-To: svn-src-head@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 B91C2A6A90A for ; Sat, 9 Jan 2016 21:21:14 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (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 555571046 for ; Sat, 9 Jan 2016 21:21:14 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22d.google.com with SMTP id u188so173792569wmu.1 for ; Sat, 09 Jan 2016 13:21:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=y8yy+FcAdQmHbi6DkCXtAv22IYTP76uj0BORp7VRJcQ=; b=aPCa1QMRX5i5YkLdnqHoSz9ibERGnXdD86kwWSFTPXiKR+BK5vX3bc57g+teS6Ou5r /c34MH6uKh44j/nfT+PLyPzjpkFjJYARcZSDHE1gPPfKJ2vM7RcXvNC9bDqhdaR/BzT/ IBjPcj8zFwa8gW4KWWDpnFb9I0AlnMBqPTBUJ1KpR6I7ULvUbY3ZNeLa8tpHA2HXKlLs f0dvErz8amCzt62t/YSI/WYjoTF3a3DDzmThRs0EcuUVHr6V5GzlcoyAUgF29+bPBIFe vD32dkMWfsTbiLVMW6Wea7cGYBnTOg/YB+yjt5FtBo42InUjHvwWOjlmBgrhqasTa1/f yWLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=y8yy+FcAdQmHbi6DkCXtAv22IYTP76uj0BORp7VRJcQ=; b=QN6lZ0X0rLbGq3GEFqrxV0iDy0R2NWWYh/U/Nrcy4wWr20ShZMZmJoGxiVgGye8KxI +0Mr+VIT8w4s46LuorBZlnmp9jl/6Q8gZTVt6WdJQB8SM30VC1pJlxHTwN0rs6ZFuqts jc7VZbwL1i4oZhqtbypcVfT5cHsNGkYCeIN544LnuUE4JddZ+qPeo0XIzlMrPll7ldmR v7rdvlxwYGtvSag8mNy96fpXp1P1ntMe3focaIPtZEh1jYinPVzqL6Jz88gt7SE2ODR+ Okn9t2q2C9l8CceCjyZQLeV0+WiaD4XvaVtD2mYkC+pJogNvjGkWPbdGehn6yb0+flwZ hlTA== X-Gm-Message-State: ALoCoQneSNinjI8lEne08Ijvi2qxJNKtKWjzkFUF6aBD/lUFgpCBk8zEOYouEL2BP6/dfuBrTUo5ou18fpD78A1fdVzwu9FzuJ9vxi14jc16pCu9pY2L0kI= MIME-Version: 1.0 X-Received: by 10.28.176.133 with SMTP id z127mr5826264wme.22.1452374472839; Sat, 09 Jan 2016 13:21:12 -0800 (PST) Received: by 10.194.85.167 with HTTP; Sat, 9 Jan 2016 13:21:12 -0800 (PST) In-Reply-To: <201601051448.u05Eme83057405@repo.freebsd.org> References: <201601051448.u05Eme83057405@repo.freebsd.org> Date: Sat, 9 Jan 2016 22:21:12 +0100 Message-ID: Subject: Re: svn commit: r293197 - head/sys/kern From: Oliver Pinter To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 21:21:14 -0000 On 1/5/16, Konstantin Belousov wrote: > Author: kib > Date: Tue Jan 5 14:48:40 2016 > New Revision: 293197 > URL: https://svnweb.freebsd.org/changeset/base/293197 > > Log: > Two fixes for excessive iterations after r292326. > > Advance the logical block number to the lblkno of the found block plus > one, instead of incrementing the block number which was used for > lookup. This change skips sparcely populated buffer ranges, similar > to r292325, instead of doing useless lookups. > > Do not restart the bnoreuselist() from the start of the range if > buffer lock cannot be obtained without sleep. Only retry lookup and > lock for the same queue and same logical block number. > > Reported by: benno > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 3 days Hi Konstantin! How do you plan to MFC this commit? Only by itself or together with r293059? > > Modified: > head/sys/kern/vfs_default.c > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_default.c > ============================================================================== > --- head/sys/kern/vfs_default.c Tue Jan 5 14:21:02 2016 (r293196) > +++ head/sys/kern/vfs_default.c Tue Jan 5 14:48:40 2016 (r293197) > @@ -1080,15 +1080,9 @@ vop_stdadvise(struct vop_advise_args *ap > bsize = vp->v_bufobj.bo_bsize; > startn = ap->a_start / bsize; > endn = ap->a_end / bsize; > - for (;;) { > - error = bnoreuselist(&bo->bo_clean, bo, startn, endn); > - if (error == EAGAIN) > - continue; > + error = bnoreuselist(&bo->bo_clean, bo, startn, endn); > + if (error == 0) > error = bnoreuselist(&bo->bo_dirty, bo, startn, endn); > - if (error == EAGAIN) > - continue; > - break; > - } > BO_RUNLOCK(bo); > VOP_UNLOCK(vp, 0); > break; > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Tue Jan 5 14:21:02 2016 (r293196) > +++ head/sys/kern/vfs_subr.c Tue Jan 5 14:48:40 2016 (r293197) > @@ -1669,7 +1669,8 @@ bnoreuselist(struct bufv *bufv, struct b > > ASSERT_BO_LOCKED(bo); > > - for (lblkno = startn;; lblkno++) { > + for (lblkno = startn;;) { > +again: > bp = BUF_PCTRIE_LOOKUP_GE(&bufv->bv_root, lblkno); > if (bp == NULL || bp->b_lblkno >= endn) > break; > @@ -1677,11 +1678,14 @@ bnoreuselist(struct bufv *bufv, struct b > LK_INTERLOCK, BO_LOCKPTR(bo), "brlsfl", 0, 0); > if (error != 0) { > BO_RLOCK(bo); > - return (error != ENOLCK ? error : EAGAIN); > + if (error == ENOLCK) > + goto again; > + return (error); > } > KASSERT(bp->b_bufobj == bo, > ("bp %p wrong b_bufobj %p should be %p", > bp, bp->b_bufobj, bo)); > + lblkno = bp->b_lblkno + 1; > if ((bp->b_flags & B_MANAGED) == 0) > bremfree(bp); > bp->b_flags |= B_RELBUF; > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Sat Jan 9 21:28:57 2016 Return-Path: Delivered-To: svn-src-head@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 C1D44A6AB5D; Sat, 9 Jan 2016 21:28:57 +0000 (UTC) (envelope-from nwhitehorn@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 7A8E3152D; Sat, 9 Jan 2016 21:28:57 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09LSupW031176; Sat, 9 Jan 2016 21:28:56 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09LSuSF031175; Sat, 9 Jan 2016 21:28:56 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201601092128.u09LSuSF031175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 9 Jan 2016 21:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293614 - head/sys/dev/vt/hw/ofwfb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 21:28:57 -0000 Author: nwhitehorn Date: Sat Jan 9 21:28:56 2016 New Revision: 293614 URL: https://svnweb.freebsd.org/changeset/base/293614 Log: Make graphical consoles work under PowerKVM. Without using hypercalls, it is not possible to write the framebuffer before pmap is up. Solve this by deferring initialization until that happens, like on PS3. MFC after: 1 week Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Sat Jan 9 20:18:53 2016 (r293613) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Sat Jan 9 21:28:56 2016 (r293614) @@ -57,6 +57,7 @@ struct ofwfb_softc { int iso_palette; }; +static void ofwfb_initialize(struct vt_device *vd); static vd_probe_t ofwfb_probe; static vd_init_t ofwfb_init; static vd_bitblt_text_t ofwfb_bitblt_text; @@ -124,6 +125,18 @@ ofwfb_bitblt_bitmap(struct vt_device *vd uint8_t c[4]; } ch1, ch2; +#ifdef __powerpc__ + /* Deal with unmapped framebuffers */ + if (sc->fb_flags & FB_FLAG_NOWRITE) { + if (pmap_bootstrapped) { + sc->fb_flags &= ~FB_FLAG_NOWRITE; + ofwfb_initialize(vd); + } else { + return; + } + } +#endif + fgc = sc->fb_cmap[fg]; bgc = sc->fb_cmap[bg]; b = m = 0; @@ -271,6 +284,11 @@ ofwfb_initialize(struct vt_device *vd) cell_t retval; uint32_t oldpix; + sc->fb.fb_cmsize = 16; + + if (sc->fb.fb_flags & FB_FLAG_NOWRITE) + return; + /* * Set up the color map */ @@ -318,8 +336,6 @@ ofwfb_initialize(struct vt_device *vd) panic("Unknown color space depth %d", sc->fb.fb_bpp); break; } - - sc->fb.fb_cmsize = 16; } static int @@ -466,6 +482,11 @@ ofwfb_init(struct vt_device *vd) #if defined(__powerpc__) OF_decode_addr(node, fb_phys, &sc->sc_memt, &sc->fb.fb_vbase); sc->fb.fb_pbase = sc->fb.fb_vbase; /* 1:1 mapped */ + #ifdef __powerpc64__ + /* Real mode under a hypervisor probably doesn't cover FB */ + if (!(mfmsr() & (PSL_HV | PSL_DR))) + sc->fb.fb_flags |= FB_FLAG_NOWRITE; + #endif #else /* No ability to interpret assigned-addresses otherwise */ return (CN_DEAD); From owner-svn-src-head@freebsd.org Sat Jan 9 21:31:33 2016 Return-Path: Delivered-To: svn-src-head@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 AEA42A6AC6D; Sat, 9 Jan 2016 21:31:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 984771A7E; Sat, 9 Jan 2016 21:31:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u09LVWRF024149 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 9 Jan 2016 13:31:32 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u09LVWo8024148; Sat, 9 Jan 2016 13:31:32 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 9 Jan 2016 13:31:32 -0800 From: Gleb Smirnoff To: Antoine Brodin Cc: Dirk Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293439 - in head: lib/libc/sys sys/dev/ti sys/kern sys/sys usr.bin/netstat Message-ID: <20160109213132.GT1906@FreeBSD.org> References: <201601082034.u08KYvLv075281@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 21:31:33 -0000 Antoine, On Sat, Jan 09, 2016 at 07:41:57PM +0000, Antoine Brodin wrote: A> On Fri, Jan 8, 2016 at 8:34 PM, Gleb Smirnoff wrote: A> > Author: glebius A> > Date: Fri Jan 8 20:34:57 2016 A> > New Revision: 293439 A> > URL: https://svnweb.freebsd.org/changeset/base/293439 A> > A> > Log: A> > New sendfile(2) syscall. A joint effort of NGINX and Netflix from 2013 and A> > up to now. A> A> Hi, A> A> "SF_FLAGS" addition seems to break graphics/graphviz on head. A> See error log at: A> http://beefy3.nyi.freebsd.org/data/head-i386-default/p405601_s293454/logs/errors/graphviz-2.38.0_10.log A> 739 ports are skipped due to this failure. I'm reluctant to fix that on our side. The problem comes from lib/sfio/sfhdr.h in graphviz. This file first includes "sfio_t.h", a local definitions file, and then includes system includes. This is clearly an mistake, and the breakage is exactly the consequence of such kind of mistakes. I can't imagine a situation when you do want system wide definitions to overtake yours. So I suggest to put a patch in the port and submit it upstream. Any objections? I can do it myself, but would be grateful if maintainer provides help. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Sat Jan 9 21:45:23 2016 Return-Path: Delivered-To: svn-src-head@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 0AAF5A69333; Sat, 9 Jan 2016 21:45:23 +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 CF1091343; Sat, 9 Jan 2016 21:45:22 +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 u09LjLY9037400; Sat, 9 Jan 2016 21:45:21 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09LjLj3037399; Sat, 9 Jan 2016 21:45:21 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601092145.u09LjLj3037399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 9 Jan 2016 21:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293616 - head/sys/dev/rtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 21:45:23 -0000 Author: avos Date: Sat Jan 9 21:45:21 2016 New Revision: 293616 URL: https://svnweb.freebsd.org/changeset/base/293616 Log: rtwn: fix sequence number assignment (part of r290630) Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4819 Modified: head/sys/dev/rtwn/if_rtwn.c Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Sat Jan 9 21:33:31 2016 (r293615) +++ head/sys/dev/rtwn/if_rtwn.c Sat Jan 9 21:45:21 2016 (r293616) @@ -1683,7 +1683,7 @@ rtwn_tx(struct rtwn_softc *sc, struct mb txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 0)); } /* Set sequence number (already little endian). */ - txd->txdseq = *(uint16_t *)wh->i_seq; + txd->txdseq = htole16(M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE); if (!qos) { /* Use HW sequence numbering for non-QoS frames. */ From owner-svn-src-head@freebsd.org Sat Jan 9 23:13:44 2016 Return-Path: Delivered-To: svn-src-head@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 72CF4A6919F; Sat, 9 Jan 2016 23:13:44 +0000 (UTC) (envelope-from dteske@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 403751106; Sat, 9 Jan 2016 23:13:44 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09NDhq9064080; Sat, 9 Jan 2016 23:13:43 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09NDh2B064079; Sat, 9 Jan 2016 23:13:43 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601092313.u09NDh2B064079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sat, 9 Jan 2016 23:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293617 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 23:13:44 -0000 Author: dteske Date: Sat Jan 9 23:13:43 2016 New Revision: 293617 URL: https://svnweb.freebsd.org/changeset/base/293617 Log: Fix improper duration for f_dialog_pause() API MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Sat Jan 9 21:45:21 2016 (r293616) +++ head/usr.sbin/bsdconfig/share/dialog.subr Sat Jan 9 23:13:43 2016 (r293617) @@ -1605,7 +1605,6 @@ f_dialog_pause() $height $width else [ $duration -gt 0 ] && duration=$(( $duration - 1 )) - [ $duration -gt 1 ] && duration=$(( $duration - 1 )) height=$(( $height + 3 )) # Add height for progress bar $DIALOG \ --title "$DIALOG_TITLE" \ From owner-svn-src-head@freebsd.org Sat Jan 9 23:45:27 2016 Return-Path: Delivered-To: svn-src-head@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 5CA7AA69BC7; Sat, 9 Jan 2016 23:45:27 +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 35E131232; Sat, 9 Jan 2016 23:45:27 +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 u09NjQHp073233; Sat, 9 Jan 2016 23:45:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09NjQtD073230; Sat, 9 Jan 2016 23:45:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601092345.u09NjQtD073230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 9 Jan 2016 23:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293621 - head/tools/regression/geom_gate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 23:45:27 -0000 Author: ngie Date: Sat Jan 9 23:45:25 2016 New Revision: 293621 URL: https://svnweb.freebsd.org/changeset/base/293621 Log: - Delete non-TAP testcases - Add a conf.sh file for executing common functions with geom_gate - Use attach_md for attaching md(4) devices - Don't hardcode /tmp for temporary files, which violates the kyua sandbox - Add/increase sleeps to try and improve synchronization - Add debug output for when checksums fail test-1.t: - Use pkill for killing ggated MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Deleted: head/tools/regression/geom_gate/runtests.sh head/tools/regression/geom_gate/test-1.sh head/tools/regression/geom_gate/test-2.sh head/tools/regression/geom_gate/test-3.sh Modified: head/tools/regression/geom_gate/test-1.t head/tools/regression/geom_gate/test-2.t head/tools/regression/geom_gate/test-3.t Modified: head/tools/regression/geom_gate/test-1.t ============================================================================== --- head/tools/regression/geom_gate/test-1.t Sat Jan 9 23:44:41 2016 (r293620) +++ head/tools/regression/geom_gate/test-1.t Sat Jan 9 23:45:25 2016 (r293621) @@ -1,40 +1,62 @@ #!/bin/sh # $FreeBSD$ -base=`basename $0` -us=45 -work="/dev/md${us}" -src="/dev/md`expr $us + 1`" -conf=`mktemp /tmp/$base.XXXXXX` || exit 1 - -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1 -dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 -sum=`cat $src | md5 -q` - -echo "127.0.0.1 RW $work" > $conf -ggated $conf -ggatec create -u $us 127.0.0.1 $work - -dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 +. `dirname $0`/conf.sh echo '1..2' -if [ `cat $work | md5 -q` != $sum ]; then - echo 'not ok 1 - md5 checksum' +base=`basename $0` +us=0 +while [ -c /dev/ggate${us} ]; do + : $(( us += 1 )) +done +conf=`mktemp $base.XXXXXX` || exit 1 +pidfile=/var/run/ggated.pid +port=33080 + +work=$(attach_md -t malloc -s 1M) +src=$(attach_md -t malloc -s 1M) + +test_cleanup() +{ + ggatec destroy -f -u $us + pkill -F $pidfile + geom_test_cleanup +} +trap test_cleanup ABRT EXIT INT TERM + +dd if=/dev/random of=/dev/$work bs=1m count=1 conv=sync +dd if=/dev/random of=/dev/$src bs=1m count=1 conv=sync +src_checksum=$(md5 -q /dev/$src) + +echo "127.0.0.1 RW /dev/$work" > $conf + +if ! ggated -p $port $conf; then + echo 'ggated failed to start' + echo 'Bail out!' + exit 1 +fi +sleep 1 +if ! ggatec create -p $port -u $us 127.0.0.1 /dev/$work; then + echo 'ggatec create failed' + echo 'Bail out!' + exit 1 +fi + +dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 +sleep 1 + +work_checksum=$(md5 -q /dev/$work) +if [ "$work_checksum" != "$src_checksum" ]; then + echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum)" + echo "not ok 2 # SKIP" else echo 'ok 1 - md5 checksum' - if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then - echo 'not ok 2 - md5 checksum' + ggate_checksum=$(md5 -q /dev/ggate${us}) + if [ "$ggate_checksum" != "$src_checksum" ]; then + echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)" else echo 'ok 2 - md5 checksum' fi fi - -ggatec destroy -u $us -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` -pkill ggated $conf -rm -f $conf Modified: head/tools/regression/geom_gate/test-2.t ============================================================================== --- head/tools/regression/geom_gate/test-2.t Sat Jan 9 23:44:41 2016 (r293620) +++ head/tools/regression/geom_gate/test-2.t Sat Jan 9 23:45:25 2016 (r293621) @@ -1,31 +1,48 @@ #!/bin/sh # $FreeBSD$ -base=`basename $0` -us=45 -work=`mktemp /tmp/$base.XXXXXX` || exit 1 -src=`mktemp /tmp/$base.XXXXXX` || exit 1 - -dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 -sum=`md5 -q $src` +. `dirname $0`/conf.sh -ggatel create -u $us $work +base=`basename $0` +us=46 +work=`mktemp -u $base.XXXXXX` || exit 1 +src=`mktemp -u $base.XXXXXX` || exit 1 + +test_cleanup() +{ + ggatel destroy -f -u $us + rm -f $work $src + + geom_test_cleanup +} +trap test_cleanup ABRT EXIT INT TERM + +dd if=/dev/random of=$work bs=1m count=1 conv=sync +dd if=/dev/random of=$src bs=1m count=1 conv=sync + +if ! ggatel create -u $us $work; then + echo 'ggatel create failed' + echo 'Bail out!' + exit 1 +fi -dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 +dd if=${src} of=/dev/ggate${us} bs=1m count=1 +sleep 1 echo '1..2' -if [ `md5 -q $work` != $sum ]; then - echo 'not ok 1 - md5 checksum' +src_checksum=$(md5 -q $src) +work_checksum=$(md5 -q $work) +if [ "$work_checksum" != "$src_checksum" ]; then + echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum) # TODO: bug 204616" + echo 'not ok 2 # SKIP' else echo 'ok 1 - md5 checksum' - if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then - echo 'not ok 2 - md5 checksum' + + ggate_checksum=$(md5 -q /dev/ggate${us}) + if [ "$ggate_checksum" != "$src_checksum" ]; then + echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)" else echo 'ok 2 - md5 checksum' fi fi - -ggatel destroy -u $us -rm -f $work $src Modified: head/tools/regression/geom_gate/test-3.t ============================================================================== --- head/tools/regression/geom_gate/test-3.t Sat Jan 9 23:44:41 2016 (r293620) +++ head/tools/regression/geom_gate/test-3.t Sat Jan 9 23:45:25 2016 (r293621) @@ -1,34 +1,48 @@ #!/bin/sh # $FreeBSD$ +. `dirname $0`/conf.sh + base=`basename $0` -us=45 -work="/dev/md${us}" -src="/dev/md`expr $us + 1`" - -mdconfig -a -t malloc -s 1M -u $us || exit 1 -mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1 -dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1 -dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1 -sum=`cat $src | md5 -q` +us=47 -ggatel create -u $us $work +test_cleanup() +{ + ggatel destroy -f -u $us + + geom_test_cleanup +} +trap test_cleanup ABRT EXIT INT TERM + +work=$(attach_md -t malloc -s 1M) +src=$(attach_md -t malloc -s 1M) + +dd if=/dev/random of=/dev/$work bs=1m count=1 conv=sync +dd if=/dev/random of=/dev/$src bs=1m count=1 conv=sync +src_checksum=$(md5 -q /dev/$src) + +if ! ggatel create -u $us /dev/$work; then + echo 'ggatel create failed' + echo 'Bail out!' + exit 1 +fi -dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1 +dd if=/dev/${src} of=/dev/ggate${us} bs=1m count=1 conv=sync +sleep 1 echo '1..2' -if [ `cat $work | md5 -q` != $sum ]; then - echo 'not ok 1 - md5 checksum' +work_checksum=$(md5 -q /dev/$work) +if [ "$work_checksum" != "$src_checksum" ]; then + echo "not ok 1 - md5 checksums didn't match ($work_checksum != $src_checksum)" + echo 'not ok 2 # SKIP' else echo 'ok 1 - md5 checksum' - if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then - echo 'not ok 2 - md5 checksum' + + ggate_checksum=$(md5 -q /dev/ggate${us}) + if [ "$ggate_checksum" != "$src_checksum" ]; then + echo "not ok 2 - md5 checksums didn't match ($ggate_checksum != $src_checksum)" else echo 'ok 2 - md5 checksum' fi fi - -ggatel destroy -u $us -mdconfig -d -u $us -mdconfig -d -u `expr $us + 1` From owner-svn-src-head@freebsd.org Sat Jan 9 23:46:54 2016 Return-Path: Delivered-To: svn-src-head@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 0FAA1A69C8D; Sat, 9 Jan 2016 23:46:54 +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 BA7FC13C2; Sat, 9 Jan 2016 23:46:53 +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 u09NkqqP073318; Sat, 9 Jan 2016 23:46:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09NkqCc073317; Sat, 9 Jan 2016 23:46:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601092346.u09NkqCc073317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 9 Jan 2016 23:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293622 - head/tools/regression/geom_gate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 23:46:54 -0000 Author: ngie Date: Sat Jan 9 23:46:52 2016 New Revision: 293622 URL: https://svnweb.freebsd.org/changeset/base/293622 Log: Remove Makefile now that the testcases are all TAP based and prove -rv can be used on them MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Deleted: head/tools/regression/geom_gate/Makefile