From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 01:12:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C9DFFAF; Sun, 15 Feb 2015 01:12:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0D4C8E9A; Sun, 15 Feb 2015 01:12:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1F1CFLu097771; Sun, 15 Feb 2015 01:12:15 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1F1CFHj097770; Sun, 15 Feb 2015 01:12:15 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502150112.t1F1CFHj097770@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 Feb 2015 01:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278790 - 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 01:12:16 -0000 Author: pfg Date: Sun Feb 15 01:12:15 2015 New Revision: 278790 URL: https://svnweb.freebsd.org/changeset/base/278790 Log: Initialize the allocation of variables related to the ext2 allocator. The e2fs_gd struct was not being initialized and garbage was being used for hinting the ext2 allocator variant. Use malloc to clear the values and also initialize e2fs_contigdirs during allocation to keep consistency. While here clean up small style issues. Reported by: Clang static analyser MFC after: 1 week Modified: head/sys/fs/ext2fs/ext2_vfsops.c Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Sat Feb 14 23:28:09 2015 (r278789) +++ head/sys/fs/ext2fs/ext2_vfsops.c Sun Feb 15 01:12:15 2015 (r278790) @@ -355,7 +355,7 @@ compute_sb_data(struct vnode *devvp, str } fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); - fs->e2fs_itpg = fs->e2fs_ipg /fs->e2fs_ipb; + fs->e2fs_itpg = fs->e2fs_ipg / fs->e2fs_ipb; /* s_resuid / s_resgid ? */ fs->e2fs_gcount = (es->e2fs_bcount - es->e2fs_first_dblock + EXT2_BLOCKS_PER_GROUP(fs) - 1) / EXT2_BLOCKS_PER_GROUP(fs); @@ -363,9 +363,9 @@ compute_sb_data(struct vnode *devvp, str db_count = (fs->e2fs_gcount + e2fs_descpb - 1) / e2fs_descpb; fs->e2fs_gdbcount = db_count; fs->e2fs_gd = malloc(db_count * fs->e2fs_bsize, - M_EXT2MNT, M_WAITOK); + M_EXT2MNT, M_WAITOK | M_ZERO); fs->e2fs_contigdirs = malloc(fs->e2fs_gcount * - sizeof(*fs->e2fs_contigdirs), M_EXT2MNT, M_WAITOK); + sizeof(*fs->e2fs_contigdirs), M_EXT2MNT, M_WAITOK | M_ZERO); /* * Adjust logic_sb_block. @@ -390,11 +390,11 @@ compute_sb_data(struct vnode *devvp, str brelse(bp); bp = NULL; } + /* Initialization for the ext2 Orlov allocator variant. */ fs->e2fs_total_dir = 0; - for (i=0; i < fs->e2fs_gcount; i++){ + for (i = 0; i < fs->e2fs_gcount; i++) fs->e2fs_total_dir += fs->e2fs_gd[i].ext2bgd_ndirs; - fs->e2fs_contigdirs[i] = 0; - } + if (es->e2fs_rev == E2FS_REV0 || !EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_LARGEFILE)) fs->e2fs_maxfilesize = 0x7fffffff; From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 01:34:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68FE51DB; Sun, 15 Feb 2015 01:34:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 540BAB; Sun, 15 Feb 2015 01:34:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1F1Y17j007306; Sun, 15 Feb 2015 01:34:01 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1F1Y1OY007305; Sun, 15 Feb 2015 01:34:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502150134.t1F1Y1OY007305@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 Feb 2015 01:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278791 - 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 01:34:01 -0000 Author: pfg Date: Sun Feb 15 01:34:00 2015 New Revision: 278791 URL: https://svnweb.freebsd.org/changeset/base/278791 Log: Reuse value of cursize instead of recalculating. Reported by: Clang static checker MFC after: 1 week Modified: head/sys/fs/ext2fs/ext2_htree.c Modified: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Sun Feb 15 01:12:15 2015 (r278790) +++ head/sys/fs/ext2fs/ext2_htree.c Sun Feb 15 01:34:00 2015 (r278791) @@ -861,7 +861,7 @@ ext2_htree_add_entry(struct vnode *dvp, ext2_htree_split_dirblock((char *)bp->b_data, newdirblock, blksize, fs->e3fs_hash_seed, hash_version, &split_hash, entry); cursize = roundup(ip->i_size, blksize); - dirsize = roundup(ip->i_size, blksize) + blksize; + dirsize = cursize + blksize; blknum = dirsize / blksize - 1; /* Add index entry for the new directory block */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 03:35:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04D65991; Sun, 15 Feb 2015 03:35:57 +0000 (UTC) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) (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 7F897F1F; Sun, 15 Feb 2015 03:35:56 +0000 (UTC) Received: by labgq15 with SMTP id gq15so23039445lab.3; Sat, 14 Feb 2015 19:35:54 -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=enZG3N1I5VekPe9bsAe5sNeG+twd0CtUM1a/ANRUA7k=; b=bhLcvc5Fhbvo1gnzp0aXuVJj9DfpwcsXRRUnp8TU58rAf/K6FNHutUP8ufvxQEX40j B9lDTToK6bf5VPzwEgpYq7X1c3wSJCSEv6nHXEpbXh354csxIIrMmURF0PBrFe1gBrim 3PN5PJ9ZZTfpfToFH6U2/8jRFpGbTlSqqRz+04a90Ekdh6jqhdwD7XeBoS8O//es8at9 PloalaTTMUVNBiH9gSamfRUFio9jCQlZKsyhcjq2S5mfVkGqnq6gzCDF8j6w8gNOvVlt iQhRyJHK9KIGgKAxsUm3wM8nIzumDhGHYQVUoI1yNaSXJycqc4/rIapqnTUnmge7kK35 1kiA== MIME-Version: 1.0 X-Received: by 10.112.137.38 with SMTP id qf6mr15695103lbb.59.1423971354103; Sat, 14 Feb 2015 19:35:54 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.28.40 with HTTP; Sat, 14 Feb 2015 19:35:53 -0800 (PST) In-Reply-To: <20150122222314.GO15484@FreeBSD.org> References: <201501060903.t06934qp081875@svn.freebsd.org> <20150122012709.GM15484@FreeBSD.org> <54C16715.6060701@gmx.com> <20150122222314.GO15484@FreeBSD.org> Date: Sat, 14 Feb 2015 19:35:53 -0800 X-Google-Sender-Auth: t0rvNHYDXy7BTh4VOMzJ4KFHvR4 Message-ID: Subject: Re: svn commit: r276747 - head/sys/netpfil/pf From: Craig Rodrigues To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Nikos Vassiliadis , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 15 Feb 2015 03:35:57 -0000 On Thu, Jan 22, 2015 at 2:23 PM, Gleb Smirnoff wrote: > On Thu, Jan 22, 2015 at 10:09:41PM +0100, Nikos Vassiliadis wrote: > N> > Sorry guys, I backed this out due to broken kldunload of pf module, > which > N> > is critical when you are working with pf bugs. > N> > N> For sure. 100% understood. > N> > N> > I had to backout r276746 as well, since it has numerous build > breakages, > N> > that are addressed by later revisions. > N> > > N> > That's my fault that I don't review in time, and I will try to improve > N> > the situation. > N> > > N> > Can you please replay r276746 again, addressing all the build problems > N> > and send the patch to me? You can user reviews.freebsd.org if you > want. > N> > > N> > I'd like to get this in, but in a better quality. > N> > N> I'd like to get involved again and help you fixing pf. Craig could you > N> replay 276746? > I wish you could have fixed the pf unload problem without backing out all these changes. I took all these changes from your projects/pf branch, which was starting to bitrot because it was not being sync'd with head. I got confirmation from several people that the fixes as they were (after the build break fixes), actually fixed their issues with PF and VIMAGE, which have been pending for several years now with no visible progress made. Most regular users of PF don't really kldunload it once it is used. For development use, I've been testing inside bhyve VM's, which doesn't solve the kldunload problem but allows testing and forward progress. Why do you want me to replay 276746 and give you a patch? Why don't you just do it yourself? -- Craig From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 06:53:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63F27B3E; Sun, 15 Feb 2015 06:53:17 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 103C712B; Sun, 15 Feb 2015 06:53:16 +0000 (UTC) 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 mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 8E412D60E1D; Sun, 15 Feb 2015 17:53:12 +1100 (AEDT) Date: Sun, 15 Feb 2015 17:53:11 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pedro Giffuni Subject: Re: svn commit: r278737 - head/usr.sbin/flowctl In-Reply-To: <54DFA7CC.20305@FreeBSD.org> Message-ID: <20150215162553.L977@besplex.bde.org> References: <201502132357.t1DNvKda075915@svn.freebsd.org> <20150214193210.N945@besplex.bde.org> <20150214181508.GL15484@FreeBSD.org> <1423938828.80968.148.camel@freebsd.org> <54DFA7CC.20305@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=baJSDo/B c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=cDe82WdCgFQVrr0NrMUA:9 a=CjuIK1q_8ugA:10 Cc: src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Gleb Smirnoff , Bruce Evans , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 15 Feb 2015 06:53:17 -0000 On Sat, 14 Feb 2015, Pedro Giffuni wrote: > On 02/14/15 13:33, Ian Lepore wrote: >> On Sat, 2015-02-14 at 21:15 +0300, Gleb Smirnoff wrote: >>> On Sat, Feb 14, 2015 at 08:46:58PM +1100, Bruce Evans wrote: >>> B> Using VLAs and also the C99 feature of declarations anwhere, and >>> extensions >>> B> like __aligned(), we can almost implement a full alloca() using the >>> fixed >>> B> version of this change: >>> B> >>> B> /* >>> B> * XXX need extended statement-expression so that __buf doesn't go out >>> B> * of scope after the right brace. >>> B> */ >>> B> #define my_alloca(n) __extension__ ({ >>> B> /* XXX need unique name. */ \ >>> B> char __buf[__roundup2((n), MUMBLE)] __aligned(MUMBLE); \ >>> B> \ >>> B> (void *)__buf; \ >>> B> }) >>> >>> I like this idea. But would this exact code work? The life of >>> __buf is limited by the code block, and we exit the block >>> immediately. Wouldn't the allocation be overwritten if we >>> enter any function or block later? I don't know how to do it. The comment describes the problem. C99 doesn't require the block, but the statement-expression does. There is another scope problem with alloca(). I think the storage allocated by it is live until the end of the function, so it doesn't go out of scope if alloca() is called in an inner block. (This is not properly documented in the FreeBSD manpage. It is stated that the space is freed on return, but it is not stated that the space is not freed earlier. This is not properly documented in a Linux manpage found on the web. This manpage has an almost identical DESCRIPTION section. Then it is better, except it doesn't spell RETURN VALUES' name with an S. FreeBSD's RETURN VALUES section is seriously broken. It says that NULL is returned on failure. But that is only for the extern libc version which is almost unreachable. Normally the builtin is used. The Linux man page states only the behaviour on error of the builtin. It is that the behaviour is undefined on stack overflow. The Linux manpage then has much larger STANDARDS and HISTORY sections (spelled CONFORMING TO and NOTES). These also deprecate it, and give some reasons.) VLAs and macros cannot duplicate alloca()'s scope behaviour if the macro or declaration is placed in an inner block. This is not a problem for FreeBSD, since style(9) forbids placing declarations in inner blocks and no one would break that rule :-). 'ptr = alloca(n);' isn't a declaration, but placing it in the outermost block is even more useful for making ptr and its related space visible. >> Why put any effort into avoiding alloca() in the first place? Is it >> inefficient on some platforms? On arm it's like 5 instructions, it just >> adjusts the size to keep the stack dword-aligned and subtracts the >> result from sp, done. It should be more like 0 instructions relative to a local array. It does take 0 more on x86 with clang, but not with gcc. Even gcc48 on amd64 still does pessimal stack alignment and more for alloca(). Tested with 'void test(void *);' and: test(alloca(2048)); vs int arr[1024]; test(arr); gcc produces an extra instruction or 2 to align the stack. Hmm, the clang code is actually broken, at least on i386. It needs to do the stack alignment even more than clang, due to to its non-pessimal alignment for the usual case. Apparently, the stack is always 16-byte aligned on amd64 although this is excessive. On i386, the stack is 16-byte aligned by default for gcc although this is pessimal. This can be changed by -mpreferred-stack boundary=N. For clang, the stack is only 4-byte aligned, and -mpreferred-stack-boundary is broken (not supported). clang is supposed to do alignment as necessary. That is, almost never. It does the stack adjustment for doubles, but not for alloca() or even for long doubles: double d; test(&d); /* adjusted */ test(alloca(8)); /* broken */ long double d; test(&d); /* broken */ On i386, gcc depends on the default for doubles and long doubles (and more importantly, for alignment directives and SSE variables), so it never needs to adjust for alloca(), the same as on amd64, but always does it. The stack allocation for multiple alloca()s or declarations (even ones in inner blocks), should be coalesced and done at the start of a function. gcc but not clang pessimizes this too. For alloca(8); alloca(8); on both amd64 and i386, gcc generates 2 separate allocations of 32 (?) bytes each with null (?) adjustments for each. Of course, variable stack allocations cannot be coalesced before the variables are known. Handling the stack for this case requires more care. For example, the original stack pointer must be saved, since subtraction to restore it cannot be used. Similarly if the stack is adjusted using andl. Allocations may be intentionally delayed to avoid wasting stack space, but this doesn't work for alloca() since the allocations are required to live (as if) until the end of the function. It also tends not to work for fixed-size variable allocations, due to optimizations. It might work for VLAs in inner blocks, depending on whether the compiler optimizes for time over space by delaying the deallocation. Compilers now track variable lifetimes and could deallocate even ones in outer scope to optimize for space, but rarely do. > Because it's non-standard and the alloca(3) man page discourages it: > _____ > ... > BUGS > The alloca() function is machine and compiler dependent; its use is dis- > couraged. This became out of date with VLAs in C99. Except for scopes, compilers must have slightly more complications to support VLAs than alloca(). They might still not support alloca(). But FreeBSD never used ones that don't. That it would never use them was not so clear when this man page was written. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 07:38:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7FC6E29; Sun, 15 Feb 2015 07:38:55 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 668D3664; Sun, 15 Feb 2015 07:38:54 +0000 (UTC) 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 E8DCC10455B8; Sun, 15 Feb 2015 18:38:46 +1100 (AEDT) Date: Sun, 15 Feb 2015 18:38:46 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans Subject: Re: svn commit: r278737 - head/usr.sbin/flowctl In-Reply-To: <20150215162553.L977@besplex.bde.org> Message-ID: <20150215182110.C1367@besplex.bde.org> References: <201502132357.t1DNvKda075915@svn.freebsd.org> <20150214193210.N945@besplex.bde.org> <20150214181508.GL15484@FreeBSD.org> <1423938828.80968.148.camel@freebsd.org> <54DFA7CC.20305@FreeBSD.org> <20150215162553.L977@besplex.bde.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=baJSDo/B c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=ePpomapnhtmqcGUZwNAA:9 a=CjuIK1q_8ugA:10 Cc: src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Pedro Giffuni , Gleb Smirnoff , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 15 Feb 2015 07:38:55 -0000 On Sun, 15 Feb 2015, Bruce Evans wrote: > On Sat, 14 Feb 2015, Pedro Giffuni wrote: >> _____ >> ... >> BUGS >> The alloca() function is machine and compiler dependent; its use is dis- >> couraged. > > This became out of date with VLAs in C99. Except for scopes, compilers > must have slightly more complications to support VLAs than alloca(). > They might still not support alloca(). But FreeBSD never used ones that > don't. That it would never use them was not so clear when this man page > was written. I found this interesting related problem on the web: inline functions with alloca() in them may blow out the stack. But this is only with broken compilers. For inline functions to work, they must have the same semantics as when they aren't inlined, especially when they are automatically inlined. This means that any alloca()'ed space in an inline function must be freed at the end of that function, not at the end of its caller. clang handles this correctly by doing requested inlining, and freeing in the right place. gcc documents the problem and normally refuse to do requested inlining in functions that call alloca(). However, gcc can be broken by forcing the inlining using __always_inline. gcc-4.2 silently produces the stack-blowing code. gcc-4.8 warns that the forced inlining might be wrong. alloca() in any macro would have this problem, unlike a [VL]A in a compound statement in a macro. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 07:44:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FFF119A; Sun, 15 Feb 2015 07:44:22 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DA9E4764; Sun, 15 Feb 2015 07:44:21 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t1F7iKtc003439 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Feb 2015 23:44:20 -0800 (PST) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t1F7iKPi003438; Sat, 14 Feb 2015 23:44:20 -0800 (PST) (envelope-from jmg) Date: Sat, 14 Feb 2015 23:44:20 -0800 From: John-Mark Gurney To: Bruce Evans Subject: Re: svn commit: r278737 - head/usr.sbin/flowctl Message-ID: <20150215074419.GB1953@funkthat.com> References: <201502132357.t1DNvKda075915@svn.freebsd.org> <20150214193210.N945@besplex.bde.org> <20150214181508.GL15484@FreeBSD.org> <1423938828.80968.148.camel@freebsd.org> <54DFA7CC.20305@FreeBSD.org> <20150215162553.L977@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150215162553.L977@besplex.bde.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Sat, 14 Feb 2015 23:44:20 -0800 (PST) Cc: src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Pedro Giffuni , Gleb Smirnoff , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 15 Feb 2015 07:44:22 -0000 Bruce Evans wrote this message on Sun, Feb 15, 2015 at 17:53 +1100: > On Sat, 14 Feb 2015, Pedro Giffuni wrote: > > > On 02/14/15 13:33, Ian Lepore wrote: > >> On Sat, 2015-02-14 at 21:15 +0300, Gleb Smirnoff wrote: > >>> On Sat, Feb 14, 2015 at 08:46:58PM +1100, Bruce Evans wrote: > >>> B> Using VLAs and also the C99 feature of declarations anwhere, and > >>> extensions > >>> B> like __aligned(), we can almost implement a full alloca() using the > >>> fixed > >>> B> version of this change: > >>> B> > >>> B> /* > >>> B> * XXX need extended statement-expression so that __buf doesn't go out > >>> B> * of scope after the right brace. > >>> B> */ > >>> B> #define my_alloca(n) __extension__ ({ > >>> B> /* XXX need unique name. */ \ > >>> B> char __buf[__roundup2((n), MUMBLE)] __aligned(MUMBLE); \ > >>> B> \ > >>> B> (void *)__buf; \ > >>> B> }) > >>> > >>> I like this idea. But would this exact code work? The life of > >>> __buf is limited by the code block, and we exit the block > >>> immediately. Wouldn't the allocation be overwritten if we > >>> enter any function or block later? Could this just be changed to something like: struct ng_mesg ng_mesg[(SORCVBUF_SIZE + sizeof(struct ng_mesg) - 1) / sizeof(struct ng_mesg)]; It might allocate a few extra bytes, but no more than 55, and gets alignment correct w/o lots of other hacks... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 08:40:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CC40852; Sun, 15 Feb 2015 08:40:06 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 2ABCABA3; Sun, 15 Feb 2015 08:40:05 +0000 (UTC) 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 480C91A1D02; Sun, 15 Feb 2015 19:40:02 +1100 (AEDT) Date: Sun, 15 Feb 2015 19:40:01 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John-Mark Gurney Subject: Re: svn commit: r278737 - head/usr.sbin/flowctl In-Reply-To: <20150215074419.GB1953@funkthat.com> Message-ID: <20150215185431.M1467@besplex.bde.org> References: <201502132357.t1DNvKda075915@svn.freebsd.org> <20150214193210.N945@besplex.bde.org> <20150214181508.GL15484@FreeBSD.org> <1423938828.80968.148.camel@freebsd.org> <54DFA7CC.20305@FreeBSD.org> <20150215162553.L977@besplex.bde.org> <20150215074419.GB1953@funkthat.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=baJSDo/B c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=qqYFbTANiK4VTEzh2kIA:9 a=CjuIK1q_8ugA:10 Cc: src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Pedro Giffuni , Gleb Smirnoff , Bruce Evans , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 15 Feb 2015 08:40:06 -0000 On Sat, 14 Feb 2015, John-Mark Gurney wrote: > Bruce Evans wrote this message on Sun, Feb 15, 2015 at 17:53 +1100: >> On Sat, 14 Feb 2015, Pedro Giffuni wrote: >> >>> On 02/14/15 13:33, Ian Lepore wrote: >>>> On Sat, 2015-02-14 at 21:15 +0300, Gleb Smirnoff wrote: >>>>> On Sat, Feb 14, 2015 at 08:46:58PM +1100, Bruce Evans wrote: >>>>> B> Using VLAs and also the C99 feature of declarations anwhere, and >>>>> extensions >>>>> B> like __aligned(), we can almost implement a full alloca() using the >>>>> fixed >>>>> B> version of this change: >>>>> B> >>>>> B> /* >>>>> B> * XXX need extended statement-expression so that __buf doesn't go out >>>>> B> * of scope after the right brace. >>>>> B> */ >>>>> B> #define my_alloca(n) __extension__ ({ >>>>> B> /* XXX need unique name. */ \ >>>>> B> char __buf[__roundup2((n), MUMBLE)] __aligned(MUMBLE); \ >>>>> B> \ >>>>> B> (void *)__buf; \ >>>>> B> }) >>>>> >>>>> I like this idea. But would this exact code work? The life of >>>>> __buf is limited by the code block, and we exit the block >>>>> immediately. Wouldn't the allocation be overwritten if we >>>>> enter any function or block later? > > Could this just be changed to something like: > struct ng_mesg ng_mesg[(SORCVBUF_SIZE + sizeof(struct ng_mesg) - 1) / > sizeof(struct ng_mesg)]; > > It might allocate a few extra bytes, but no more than 55, and gets > alignment correct w/o lots of other hacks... I already gave this version, with (SORCVBUF_SIZE + sizeof(struct ng_mesg) - 1) / sizeof(struct ng_mesg) spelled as howmany(SORCVBUF_SIZE, sizeof(*ng_mesg)). Even with the better spelling, it is less clear than using alloca(). Using malloc() would be equally clear to using alloca(), except it would take even more code unless all of error checking, error handling and deallocation were omitted. Presumably the unnecessary complications for that are the reason why malloc() wasn't used originally. However, it may be considered a style bug to use alloca() when almost everything else laboriously uses malloc(). "alloca(" occurs in 453 lines in /usr/src/. 110 not counting cddl, contrib, crypto or sys. 35 of the 110 are in jail; 10 in libjail; 12 in ctm; 7 in ppp; 8 in pppoed. That leaves 38. The only applications in these 38 are swapon, rpcbind, jls, flowctl and vidcontrol. Some of these could probably use VLAs. E.g., vidcontrol uses alloca() just twice, for char buffers. It has laborious error checking and handling after each. But the error checking is essentially useless since the libc alloca() that can return NULL is never used. More critical/security-related applications like jail of course don't have the error checking or handling. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 08:43:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 178CEA6E; Sun, 15 Feb 2015 08:43:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 03A9CC4E; Sun, 15 Feb 2015 08:43:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1F8hJvU006347; Sun, 15 Feb 2015 08:43:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1F8hJ6w006346; Sun, 15 Feb 2015 08:43:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502150843.t1F8hJ6w006346@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 15 Feb 2015 08:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278794 - 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 08:43:20 -0000 Author: kib Date: Sun Feb 15 08:43:19 2015 New Revision: 278794 URL: https://svnweb.freebsd.org/changeset/base/278794 Log: Return with the process locked, caller expects p still locked after the call. Reported and tested by: bapt Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/kern_procctl.c Modified: head/sys/kern/kern_procctl.c ============================================================================== --- head/sys/kern/kern_procctl.c Sun Feb 15 08:38:43 2015 (r278793) +++ head/sys/kern/kern_procctl.c Sun Feb 15 08:43:19 2015 (r278794) @@ -239,13 +239,13 @@ reap_kill(struct thread *td, struct proc int error, error1; sx_assert(&proctree_lock, SX_LOCKED); - PROC_UNLOCK(p); if (IN_CAPABILITY_MODE(td)) return (ECAPMODE); if (rk->rk_sig <= 0 || rk->rk_sig > _SIG_MAXSIG) return (EINVAL); if ((rk->rk_flags & ~REAPER_KILL_CHILDREN) != 0) return (EINVAL); + PROC_UNLOCK(p); reap = (p->p_treeflag & P_TREE_REAPER) == 0 ? p->p_reaper : p; ksiginfo_init(&ksi); ksi.ksi_signo = rk->rk_sig; From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 08:44:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F9FDBB0; Sun, 15 Feb 2015 08:44:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0B4DAC56; Sun, 15 Feb 2015 08:44:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1F8iUrM006561; Sun, 15 Feb 2015 08:44:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1F8iUVR006560; Sun, 15 Feb 2015 08:44:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502150844.t1F8iUVR006560@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 15 Feb 2015 08:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278795 - 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 08:44:31 -0000 Author: kib Date: Sun Feb 15 08:44:30 2015 New Revision: 278795 URL: https://svnweb.freebsd.org/changeset/base/278795 Log: Reparenting done by debugger attach can leave reaper without direct children. Handle the situation instead asserting that it is impossible. Reported and tested by: emaste Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/kern_procctl.c Modified: head/sys/kern/kern_procctl.c ============================================================================== --- head/sys/kern/kern_procctl.c Sun Feb 15 08:43:19 2015 (r278794) +++ head/sys/kern/kern_procctl.c Sun Feb 15 08:44:30 2015 (r278795) @@ -160,7 +160,7 @@ static int reap_status(struct thread *td, struct proc *p, struct procctl_reaper_status *rs) { - struct proc *reap, *p2; + struct proc *reap, *p2, *first_p; sx_assert(&proctree_lock, SX_LOCKED); bzero(rs, sizeof(*rs)); @@ -176,8 +176,10 @@ reap_status(struct thread *td, struct pr rs->rs_descendants = 0; rs->rs_children = 0; if (!LIST_EMPTY(&reap->p_reaplist)) { - KASSERT(!LIST_EMPTY(&reap->p_children), ("no children")); - rs->rs_pid = LIST_FIRST(&reap->p_children)->p_pid; + first_p = LIST_FIRST(&reap->p_children); + if (first_p == NULL) + first_p = LIST_FIRST(&reap->p_reaplist); + rs->rs_pid = first_p->p_pid; LIST_FOREACH(p2, &reap->p_reaplist, p_reapsibling) { if (proc_realparent(p2) == reap) rs->rs_children++; From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 10:51:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FC67BFB for ; Sun, 15 Feb 2015 10:51:58 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1.freebsd.org (Postfix) with SMTP id E1F2699A for ; Sun, 15 Feb 2015 10:51:57 +0000 (UTC) Received: (qmail 93312 invoked by uid 99); 15 Feb 2015 06:10:53 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Feb 2015 06:10:53 +0000 Received: from [192.168.0.103] (unknown [190.157.136.22]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 50C3D1A0031; Sun, 15 Feb 2015 06:10:52 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278790 - head/sys/fs/ext2fs From: Pedro Giffuni In-Reply-To: <201502150112.t1F1CFHj097770@svn.freebsd.org> Date: Sun, 15 Feb 2015 01:10:50 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <8D00DA70-E1B2-4B5F-996E-676087B27761@freebsd.org> References: <201502150112.t1F1CFHj097770@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.2070.6) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 15 Feb 2015 10:51:58 -0000 > Il giorno 14/feb/2015, alle ore 20:12, Pedro F. Giffuni = ha scritto: >=20 > Author: pfg > Date: Sun Feb 15 01:12:15 2015 > New Revision: 278790 > URL: https://svnweb.freebsd.org/changeset/base/278790 >=20 > Log: > Initialize the allocation of variables related to the ext2 allocator. >=20 > The e2fs_gd struct was not being initialized and garbage was > being used for hinting the ext2 allocator variant. > Use malloc to clear the values and also initialize e2fs_contigdirs > during allocation to keep consistency. >=20 > While here clean up small style issues. >=20 > Reported by: Clang static analyser > MFC after: 1 week >=20 > Modified: > head/sys/fs/ext2fs/ext2_vfsops.c >=20 Actually .. it=E2=80=99s a false positive but there is a memory leak = there so taking a fresh look at the code was good. Pedro. From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 11:23:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06B24F3F; Sun, 15 Feb 2015 11:23:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 CCD75C11; Sun, 15 Feb 2015 11:23:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FBNS5T080601; Sun, 15 Feb 2015 11:23:28 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FBNSiM080600; Sun, 15 Feb 2015 11:23:28 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201502151123.t1FBNSiM080600@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 15 Feb 2015 11:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278797 - head/sys/arm/broadcom/bcm2835 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 11:23:29 -0000 Author: andrew Date: Sun Feb 15 11:23:27 2015 New Revision: 278797 URL: https://svnweb.freebsd.org/changeset/base/278797 Log: Add the structures needed to get/set the power state. These can be used when, for example, we boot without U-Boot and wish to enable USB, or to suspend an unneeded device. MFC after: 1 week Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Sun Feb 15 08:52:09 2015 (r278796) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Sun Feb 15 11:23:27 2015 (r278797) @@ -52,6 +52,53 @@ struct bcm2835_mbox_tag_hdr { uint32_t val_len; }; +#define BCM2835_MBOX_POWER_ID_EMMC 0x00000000 +#define BCM2835_MBOX_POWER_ID_UART0 0x00000001 +#define BCM2835_MBOX_POWER_ID_UART1 0x00000002 +#define BCM2835_MBOX_POWER_ID_USB_HCD 0x00000003 +#define BCM2835_MBOX_POWER_ID_I2C0 0x00000004 +#define BCM2835_MBOX_POWER_ID_I2C1 0x00000005 +#define BCM2835_MBOX_POWER_ID_I2C2 0x00000006 +#define BCM2835_MBOX_POWER_ID_SPI 0x00000007 +#define BCM2835_MBOX_POWER_ID_CCP2TX 0x00000008 + +#define BCM2835_MBOX_POWER_ON (1 << 0) +#define BCM2835_MBOX_POWER_WAIT (1 << 1) + +#define BCM2835_MBOX_TAG_GET_POWER_STATE 0x00020001 +#define BCM2835_MBOX_TAG_SET_POWER_STATE 0x00028001 + +struct msg_get_power_state { + struct bcm2835_mbox_hdr hdr; + struct bcm2835_mbox_tag_hdr tag_hdr; + union { + struct { + uint32_t device_id; + } req; + struct { + uint32_t device_id; + uint32_t state; + } resp; + } body; + uint32_t end_tag; +}; + +struct msg_set_power_state { + struct bcm2835_mbox_hdr hdr; + struct bcm2835_mbox_tag_hdr tag_hdr; + union { + struct { + uint32_t device_id; + uint32_t state; + } req; + struct { + uint32_t device_id; + uint32_t state; + } resp; + } body; + uint32_t end_tag; +}; + #define BCM2835_MBOX_CLOCK_ID_EMMC 0x00000001 #define BCM2835_MBOX_CLOCK_ID_UART 0x00000002 #define BCM2835_MBOX_CLOCK_ID_ARM 0x00000003 From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 11:37:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67F0D253; Sun, 15 Feb 2015 11:37:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4F978CF9; Sun, 15 Feb 2015 11:37:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FBbhGG085893; Sun, 15 Feb 2015 11:37:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FBbf9O085884; Sun, 15 Feb 2015 11:37:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502151137.t1FBbf9O085884@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 15 Feb 2015 11:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278798 - in head/sys: conf dev/videomode modules/videomode 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 11:37:43 -0000 Author: hselasky Date: Sun Feb 15 11:37:40 2015 New Revision: 278798 URL: https://svnweb.freebsd.org/changeset/base/278798 Log: Import videomode code from NetBSD which is needed by USB display link drivers. Added: head/sys/dev/videomode/ head/sys/dev/videomode/Makefile.ediddevs (contents, props changed) head/sys/dev/videomode/Makefile.videomode (contents, props changed) head/sys/dev/videomode/devlist2h.awk (contents, props changed) head/sys/dev/videomode/edid.c (contents, props changed) head/sys/dev/videomode/ediddevs (contents, props changed) head/sys/dev/videomode/ediddevs.h (contents, props changed) head/sys/dev/videomode/ediddevs_data.h (contents, props changed) head/sys/dev/videomode/edidreg.h (contents, props changed) head/sys/dev/videomode/edidvar.h (contents, props changed) head/sys/dev/videomode/modelines (contents, props changed) head/sys/dev/videomode/modelines2c.awk (contents, props changed) head/sys/dev/videomode/pickmode.c (contents, props changed) head/sys/dev/videomode/test.c (contents, props changed) head/sys/dev/videomode/vesagtf.c (contents, props changed) head/sys/dev/videomode/vesagtf.h (contents, props changed) head/sys/dev/videomode/videomode.c (contents, props changed) head/sys/dev/videomode/videomode.h (contents, props changed) head/sys/modules/videomode/ head/sys/modules/videomode/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/conf/options Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Feb 15 11:23:27 2015 (r278797) +++ head/sys/conf/files Sun Feb 15 11:37:40 2015 (r278798) @@ -2565,6 +2565,10 @@ dev/usb/template/usb_template_serialnet. # # USB END # +dev/videomode/videomode.c optional videomode +dev/videomode/edid.c optional videomode +dev/videomode/pickmode.c optional videomode +dev/videomode/vesagtf.c optional videomode dev/utopia/idtphy.c optional utopia dev/utopia/suni.c optional utopia dev/utopia/utopia.c optional utopia Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Feb 15 11:23:27 2015 (r278797) +++ head/sys/conf/options Sun Feb 15 11:37:40 2015 (r278798) @@ -889,6 +889,9 @@ TDMA_TXRATE_QUARTER_DEFAULT opt_tdma.h TDMA_TXRATE_11NA_DEFAULT opt_tdma.h TDMA_TXRATE_11NG_DEFAULT opt_tdma.h +# VideoMode +PICKMODE_DEBUG opt_videomode.h + # Network stack virtualization options VIMAGE opt_global.h VNET_DEBUG opt_global.h Added: head/sys/dev/videomode/Makefile.ediddevs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/videomode/Makefile.ediddevs Sun Feb 15 11:37:40 2015 (r278798) @@ -0,0 +1,16 @@ +# $NetBSD: Makefile.ediddevs,v 1.1 2006/05/11 01:49:53 gdamore Exp $ +# $FreeBSD$ +# +# As per tron@NetBSD.org, the proper procedure is +# +# 1.) Change "src/sys/dev/videomode/ediddevs". +# 2.) Commit "src/sys/dev/videomode/ediddevs". +# 3.) Execute "make -f Makefile.ediddevs" in "src/sys/dev/videomode". +# 4.) Commit "src/sys/dev/videomode/ediddevs.h" and +# "src/sys/dev/videomode/ediddevs_data.h". + +.include + +ediddevs.h ediddevs_data.h: ediddevs devlist2h.awk + /bin/rm -f ediddevs.h ediddevs_data.h + ${TOOL_AWK} -f devlist2h.awk ediddevs Added: head/sys/dev/videomode/Makefile.videomode ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/videomode/Makefile.videomode Sun Feb 15 11:37:40 2015 (r278798) @@ -0,0 +1,18 @@ +# $NetBSD: Makefile.videomode,v 1.1 2006/03/04 02:34:27 gdamore Exp $ +# $FreeBSD$ +# +# As per tron@NetBSD.org, the proper procedure is +# +# 1.) Change "src/sys/dev/videomode/modelines". +# 2.) Commit "src/sys/dev/videomode/modelines". +# 3.) Execute "make -f Makefile.videomode" in "src/sys/dev/videomode". +# 4.) Commit "src/sys/dev/videomode/videomode.c" + +.include + +videomode.c: modelines modelines2c.awk + /bin/rm -f videomode.c + ${TOOL_AWK} -f modelines2c.awk modelines > videomode.c + +test: videomode.c videomode.h test.c + ${CC} -I ../../ -o test test.c videomode.c Added: head/sys/dev/videomode/devlist2h.awk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/videomode/devlist2h.awk Sun Feb 15 11:37:40 2015 (r278798) @@ -0,0 +1,193 @@ +#! /usr/bin/awk -f +# $NetBSD: devlist2h.awk,v 1.9 2005/12/11 12:21:20 christos Exp $ +# $FreeBSD$ +# +# Copyright (c) 1995, 1996 Christopher G. Demetriou +# 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. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by Christopher G. Demetriou. +# 4. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission +# +# 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. +# +BEGIN { + nproducts = nvendors = blanklines = 0 + dfile="ediddevs_data.h" + hfile="ediddevs.h" +} +NR == 1 { + VERSION = $0 + gsub("\\$", "", VERSION) + gsub(/ $/, "", VERSION) + + printf("/*\t$FreeBSD" "$\t*/\n\n") > dfile + printf("/*\n") > dfile + printf(" * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \ + > dfile + printf(" *\n") > dfile + printf(" * generated from:\n") > dfile + printf(" *\t%s\n", VERSION) > dfile + printf(" */\n") > dfile + + printf("/*\t$NetBSD" "$\t*/\n\n") > hfile + printf("/*\n") > hfile + printf(" * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \ + > hfile + printf(" *\n") > hfile + printf(" * generated from:\n") > hfile + printf(" *\t%s\n", VERSION) > hfile + printf(" */\n") > hfile + + next +} + +NF > 0 && $1 == "vendor" { + nvendors++ + + vendorindex[$2] = nvendors; # record index for this name, for later. + vendors[nvendors, 1] = $2; # name/ID + i = 2; f = 3; + + printf("#define\tEDID_VENDOR_%s\t\"", vendors[nvendors, 1]) > hfile + + # comments + oparen = 0 + while (f <= NF) { + if ($f == "#") { + printf("(") > hfile + oparen = 1 + f++ + continue + } + if (oparen) { + printf("%s", $f) > hfile + f++ + continue + } + vendors[nvendors, i] = $f + printf("%s", vendors[nvendors, i]) > hfile + if (f < NF) + printf(" ") > hfile + i++; f++; + } + if (oparen) + printf(")") > hfile + printf("\"") > hfile + printf("\n") > hfile + + next +} + +NF > 0 && $1 == "product" { + nproducts++ + + products[nproducts, 1] = $2; # vendor name + products[nproducts, 2] = $3; # product id + products[nproducts, 3] = $4; # id + printf("#define\tEDID_PRODUCT_%s_%s\t%s", products[nproducts, 1], + products[nproducts, 2], products[nproducts, 3]) > hfile + + i = 4; f = 5; + + ocomment = oparen = 0 + if (f <= NF) { + printf("\t\t/* ") > hfile + ocomment = 1; + } + while (f <= NF) { + if ($f == "#") { + printf("(") > hfile + oparen = 1 + f++ + continue + } + if (oparen) { + printf("%s", $f) > hfile + if (f < NF) + printf(" ") > hfile + f++ + continue + } + products[nproducts, i] = $f + printf("%s", products[nproducts, i]) > hfile + if (f < NF) + printf(" ") > hfile + i++; f++; + } + if (oparen) + printf(")") > hfile + if (ocomment) + printf(" */") > hfile + printf("\n") > hfile + + next +} +{ + if ($0 == "") + blanklines++ + if (blanklines != 2 && blanklines != 3) + print $0 > hfile + if (blanklines < 2) + print $0 > dfile +} +END { + # print out the match tables + + printf("\n") > dfile + printf("const struct edid_vendor edid_vendors[] = {\n") > dfile + + for (i = 1; i <= nvendors; i++) { + printf("\t{") > dfile + printf(" \"%s\", EDID_VENDOR_%s", vendors[i, 1], \ + vendors[i, 1]) > dfile + printf(" },\n") > dfile + } + printf("};\n") > dfile + printf("const int edid_nvendors = %d;\n", nvendors) > dfile + + printf("\n") > dfile + + printf("const struct edid_product edid_products[] = {\n") > dfile + for (i = 1; i <= nproducts; i++) { + printf("\t{\n") > dfile + printf("\t \"%s\", EDID_PRODUCT_%s_%s,\n", \ + products[i, 1], products[i, 1], products[i, 2]) > dfile + printf("\t \"") > dfile + j = 4 + needspace = 0 + while ((i, j) in products) { + if (needspace) + printf(" ") > dfile + printf("%s", products[i, j]) > dfile + needspace = 1 + j++ + } + printf("\",\n") > dfile + printf("\t},\n") > dfile + } + printf("};\n") > dfile + printf("const int edid_nproducts = %d;\n", nproducts) >dfile + + close(dfile) + close(hfile) +} Added: head/sys/dev/videomode/edid.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/videomode/edid.c Sun Feb 15 11:37:40 2015 (r278798) @@ -0,0 +1,647 @@ +/* $NetBSD: edid.c,v 1.12 2013/02/08 16:35:10 skrll Exp $ */ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2006 Itronix Inc. + * All rights reserved. + * + * Written by Garrett D'Amore for Itronix Inc. + * + * 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. + * 3. The name of Itronix Inc. may not be used to endorse + * or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``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 ITRONIX INC. 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define EDIDVERBOSE 1 +#define DIVIDE(x,y) (((x) + ((y) / 2)) / (y)) + +/* These are reversed established timing order */ +static const char *_edid_modes[] = { + "1280x1024x75", + "1024x768x75", + "1024x768x70", + "1024x768x60", + "1024x768x87i", + "832x624x74", /* rounding error, 74.55 Hz aka "832x624x75" */ + "800x600x75", + "800x600x72", + "800x600x60", + "800x600x56", + "640x480x75", + "640x480x72", + "640x480x67", + "640x480x60", + "720x400x87", /* rounding error, 87.85 Hz aka "720x400x88" */ + "720x400x70", +}; + +#ifdef EDIDVERBOSE +struct edid_vendor { + const char *vendor; + const char *name; +}; + +struct edid_product { + const char *vendor; + uint16_t product; + const char *name; +}; + +#include +#endif /* EDIDVERBOSE */ + +static const char * +edid_findvendor(const char *vendor) +{ +#ifdef EDIDVERBOSE + int n; + + for (n = 0; n < edid_nvendors; n++) + if (memcmp(edid_vendors[n].vendor, vendor, 3) == 0) + return edid_vendors[n].name; +#endif + return NULL; +} + +static const char * +edid_findproduct(const char *vendor, uint16_t product) +{ +#ifdef EDIDVERBOSE + int n; + + for (n = 0; n < edid_nproducts; n++) + if (edid_products[n].product == product && + memcmp(edid_products[n].vendor, vendor, 3) == 0) + return edid_products[n].name; +#endif /* EDIDVERBOSE */ + return NULL; + +} + +static void +edid_strchomp(char *ptr) +{ + for (;;) { + switch (*ptr) { + case '\0': + return; + case '\r': + case '\n': + *ptr = '\0'; + return; + } + ptr++; + } +} + +int +edid_is_valid(uint8_t *d) +{ + int sum = 0, i; + uint8_t sig[8] = EDID_SIGNATURE; + + if (memcmp(d, sig, 8) != 0) + return EINVAL; + + for (i = 0; i < 128; i++) + sum += d[i]; + if ((sum & 0xff) != 0) + return EINVAL; + + return 0; +} + +void +edid_print(struct edid_info *edid) +{ + int i; + + if (edid == NULL) + return; + printf("Vendor: [%s] %s\n", edid->edid_vendor, edid->edid_vendorname); + printf("Product: [%04X] %s\n", edid->edid_product, + edid->edid_productname); + printf("Serial number: %s\n", edid->edid_serial); + printf("Manufactured %d Week %d\n", + edid->edid_year, edid->edid_week); + printf("EDID Version %d.%d\n", edid->edid_version, + edid->edid_revision); + printf("EDID Comment: %s\n", edid->edid_comment); + + printf("Video Input: %x\n", edid->edid_video_input); + if (edid->edid_video_input & EDID_VIDEO_INPUT_DIGITAL) { + printf("\tDigital"); + if (edid->edid_video_input & EDID_VIDEO_INPUT_DFP1_COMPAT) + printf(" (DFP 1.x compatible)"); + printf("\n"); + } else { + printf("\tAnalog\n"); + switch (EDID_VIDEO_INPUT_LEVEL(edid->edid_video_input)) { + case 0: + printf("\t-0.7, 0.3V\n"); + break; + case 1: + printf("\t-0.714, 0.286V\n"); + break; + case 2: + printf("\t-1.0, 0.4V\n"); + break; + case 3: + printf("\t-0.7, 0.0V\n"); + break; + } + if (edid->edid_video_input & EDID_VIDEO_INPUT_BLANK_TO_BLACK) + printf("\tBlank-to-black setup\n"); + if (edid->edid_video_input & EDID_VIDEO_INPUT_SEPARATE_SYNCS) + printf("\tSeperate syncs\n"); + if (edid->edid_video_input & EDID_VIDEO_INPUT_COMPOSITE_SYNC) + printf("\tComposite sync\n"); + if (edid->edid_video_input & EDID_VIDEO_INPUT_SYNC_ON_GRN) + printf("\tSync on green\n"); + if (edid->edid_video_input & EDID_VIDEO_INPUT_SERRATION) + printf("\tSerration vsync\n"); + } + + printf("Gamma: %d.%02d\n", + edid->edid_gamma / 100, edid->edid_gamma % 100); + + printf("Max Size: %d cm x %d cm\n", + edid->edid_max_hsize, edid->edid_max_vsize); + + printf("Features: %x\n", edid->edid_features); + if (edid->edid_features & EDID_FEATURES_STANDBY) + printf("\tDPMS standby\n"); + if (edid->edid_features & EDID_FEATURES_SUSPEND) + printf("\tDPMS suspend\n"); + if (edid->edid_features & EDID_FEATURES_ACTIVE_OFF) + printf("\tDPMS active-off\n"); + switch (EDID_FEATURES_DISP_TYPE(edid->edid_features)) { + case EDID_FEATURES_DISP_TYPE_MONO: + printf("\tMonochrome\n"); + break; + case EDID_FEATURES_DISP_TYPE_RGB: + printf("\tRGB\n"); + break; + case EDID_FEATURES_DISP_TYPE_NON_RGB: + printf("\tMulticolor\n"); + break; + case EDID_FEATURES_DISP_TYPE_UNDEFINED: + printf("\tUndefined monitor type\n"); + break; + } + if (edid->edid_features & EDID_FEATURES_STD_COLOR) + printf("\tStandard color space\n"); + if (edid->edid_features & EDID_FEATURES_PREFERRED_TIMING) + printf("\tPreferred timing\n"); + if (edid->edid_features & EDID_FEATURES_DEFAULT_GTF) + printf("\tDefault GTF supported\n"); + + printf("Chroma Info:\n"); + printf("\tRed X: 0.%03d\n", edid->edid_chroma.ec_redx); + printf("\tRed Y: 0.%03d\n", edid->edid_chroma.ec_redy); + printf("\tGrn X: 0.%03d\n", edid->edid_chroma.ec_greenx); + printf("\tGrn Y: 0.%03d\n", edid->edid_chroma.ec_greeny); + printf("\tBlu X: 0.%03d\n", edid->edid_chroma.ec_bluex); + printf("\tBlu Y: 0.%03d\n", edid->edid_chroma.ec_bluey); + printf("\tWht X: 0.%03d\n", edid->edid_chroma.ec_whitex); + printf("\tWht Y: 0.%03d\n", edid->edid_chroma.ec_whitey); + + if (edid->edid_have_range) { + printf("Range:\n"); + printf("\tHorizontal: %d - %d kHz\n", + edid->edid_range.er_min_hfreq, + edid->edid_range.er_max_hfreq); + printf("\tVertical: %d - %d Hz\n", + edid->edid_range.er_min_vfreq, + edid->edid_range.er_max_vfreq); + printf("\tMax Dot Clock: %d MHz\n", + edid->edid_range.er_max_clock); + if (edid->edid_range.er_have_gtf2) { + printf("\tGTF2 hfreq: %d\n", + edid->edid_range.er_gtf2_hfreq); + printf("\tGTF2 C: %d\n", edid->edid_range.er_gtf2_c); + printf("\tGTF2 M: %d\n", edid->edid_range.er_gtf2_m); + printf("\tGTF2 J: %d\n", edid->edid_range.er_gtf2_j); + printf("\tGTF2 K: %d\n", edid->edid_range.er_gtf2_k); + } + } + printf("Video modes:\n"); + for (i = 0; i < edid->edid_nmodes; i++) { + printf("\t%dx%d @ %dHz", + edid->edid_modes[i].hdisplay, + edid->edid_modes[i].vdisplay, + DIVIDE(DIVIDE(edid->edid_modes[i].dot_clock * 1000, + edid->edid_modes[i].htotal), edid->edid_modes[i].vtotal)); + printf(" (%d %d %d %d %d %d %d", + edid->edid_modes[i].dot_clock, + edid->edid_modes[i].hsync_start, + edid->edid_modes[i].hsync_end, + edid->edid_modes[i].htotal, + edid->edid_modes[i].vsync_start, + edid->edid_modes[i].vsync_end, + edid->edid_modes[i].vtotal); + printf(" %s%sH %s%sV)\n", + edid->edid_modes[i].flags & VID_PHSYNC ? "+" : "", + edid->edid_modes[i].flags & VID_NHSYNC ? "-" : "", + edid->edid_modes[i].flags & VID_PVSYNC ? "+" : "", + edid->edid_modes[i].flags & VID_NVSYNC ? "-" : ""); + } + if (edid->edid_preferred_mode) + printf("Preferred mode: %dx%d @ %dHz\n", + edid->edid_preferred_mode->hdisplay, + edid->edid_preferred_mode->vdisplay, + DIVIDE(DIVIDE(edid->edid_preferred_mode->dot_clock * 1000, + edid->edid_preferred_mode->htotal), + edid->edid_preferred_mode->vtotal)); + + printf("Number of extension blocks: %d\n", edid->edid_ext_block_count); +} + +static const struct videomode * +edid_mode_lookup_list(const char *name) +{ + int i; + + for (i = 0; i < videomode_count; i++) + if (strcmp(name, videomode_list[i].name) == 0) + return &videomode_list[i]; + return NULL; +} + +static struct videomode * +edid_search_mode(struct edid_info *edid, const struct videomode *mode) +{ + int refresh, i; + + refresh = DIVIDE(DIVIDE(mode->dot_clock * 1000, + mode->htotal), mode->vtotal); + for (i = 0; i < edid->edid_nmodes; i++) { + if (mode->hdisplay == edid->edid_modes[i].hdisplay && + mode->vdisplay == edid->edid_modes[i].vdisplay && + refresh == DIVIDE(DIVIDE( + edid->edid_modes[i].dot_clock * 1000, + edid->edid_modes[i].htotal), edid->edid_modes[i].vtotal)) { + return &edid->edid_modes[i]; + } + } + return NULL; +} + +static int +edid_std_timing(uint8_t *data, struct videomode *vmp) +{ + unsigned x, y, f; + const struct videomode *lookup; + char name[80]; + + if ((data[0] == 1 && data[1] == 1) || + (data[0] == 0 && data[1] == 0) || + (data[0] == 0x20 && data[1] == 0x20)) + return 0; + + x = EDID_STD_TIMING_HRES(data); + switch (EDID_STD_TIMING_RATIO(data)) { + case EDID_STD_TIMING_RATIO_16_10: + y = x * 10 / 16; + break; + case EDID_STD_TIMING_RATIO_4_3: + y = x * 3 / 4; + break; + case EDID_STD_TIMING_RATIO_5_4: + y = x * 4 / 5; + break; + case EDID_STD_TIMING_RATIO_16_9: + default: + y = x * 9 / 16; + break; + } + f = EDID_STD_TIMING_VFREQ(data); + + /* first try to lookup the mode as a DMT timing */ + snprintf(name, sizeof(name), "%dx%dx%d", x, y, f); + if ((lookup = edid_mode_lookup_list(name)) != NULL) { + *vmp = *lookup; + } else { + /* failing that, calculate it using gtf */ + /* + * Hmm. I'm not using alternate GTF timings, which + * could, in theory, be present. + */ + vesagtf_mode(x, y, f, vmp); + } + return 1; +} + +static int +edid_det_timing(uint8_t *data, struct videomode *vmp) +{ + unsigned hactive, hblank, hsyncwid, hsyncoff; + unsigned vactive, vblank, vsyncwid, vsyncoff; + uint8_t flags; + + flags = EDID_DET_TIMING_FLAGS(data); + + /* we don't support stereo modes (for now) */ + if (flags & (EDID_DET_TIMING_FLAG_STEREO | + EDID_DET_TIMING_FLAG_STEREO_MODE)) + return 0; + + vmp->dot_clock = EDID_DET_TIMING_DOT_CLOCK(data) / 1000; + + hactive = EDID_DET_TIMING_HACTIVE(data); + hblank = EDID_DET_TIMING_HBLANK(data); + hsyncwid = EDID_DET_TIMING_HSYNC_WIDTH(data); + hsyncoff = EDID_DET_TIMING_HSYNC_OFFSET(data); + + vactive = EDID_DET_TIMING_VACTIVE(data); + vblank = EDID_DET_TIMING_VBLANK(data); + vsyncwid = EDID_DET_TIMING_VSYNC_WIDTH(data); + vsyncoff = EDID_DET_TIMING_VSYNC_OFFSET(data); + + /* Borders are contained within the blank areas. */ + + vmp->hdisplay = hactive; + vmp->htotal = hactive + hblank; + vmp->hsync_start = hactive + hsyncoff; + vmp->hsync_end = vmp->hsync_start + hsyncwid; + + vmp->vdisplay = vactive; + vmp->vtotal = vactive + vblank; + vmp->vsync_start = vactive + vsyncoff; + vmp->vsync_end = vmp->vsync_start + vsyncwid; + + vmp->flags = 0; + + if (flags & EDID_DET_TIMING_FLAG_INTERLACE) + vmp->flags |= VID_INTERLACE; + if (flags & EDID_DET_TIMING_FLAG_HSYNC_POSITIVE) + vmp->flags |= VID_PHSYNC; + else + vmp->flags |= VID_NHSYNC; + + if (flags & EDID_DET_TIMING_FLAG_VSYNC_POSITIVE) + vmp->flags |= VID_PVSYNC; + else + vmp->flags |= VID_NVSYNC; + + return 1; +} + +static void +edid_block(struct edid_info *edid, uint8_t *data) +{ + int i; + struct videomode mode, *exist_mode; + + if (EDID_BLOCK_IS_DET_TIMING(data)) { + if (!edid_det_timing(data, &mode)) + return; + /* Does this mode already exist? */ + exist_mode = edid_search_mode(edid, &mode); + if (exist_mode != NULL) { + *exist_mode = mode; + if (edid->edid_preferred_mode == NULL) + edid->edid_preferred_mode = exist_mode; + } else { + edid->edid_modes[edid->edid_nmodes] = mode; + if (edid->edid_preferred_mode == NULL) + edid->edid_preferred_mode = + &edid->edid_modes[edid->edid_nmodes]; + edid->edid_nmodes++; + } + return; + } + + switch (EDID_BLOCK_TYPE(data)) { + case EDID_DESC_BLOCK_TYPE_SERIAL: + memcpy(edid->edid_serial, data + EDID_DESC_ASCII_DATA_OFFSET, + EDID_DESC_ASCII_DATA_LEN); + edid->edid_serial[sizeof(edid->edid_serial) - 1] = 0; + break; + + case EDID_DESC_BLOCK_TYPE_ASCII: + memcpy(edid->edid_comment, data + EDID_DESC_ASCII_DATA_OFFSET, + EDID_DESC_ASCII_DATA_LEN); + edid->edid_comment[sizeof(edid->edid_comment) - 1] = 0; + break; + + case EDID_DESC_BLOCK_TYPE_RANGE: + edid->edid_have_range = 1; + edid->edid_range.er_min_vfreq = EDID_DESC_RANGE_MIN_VFREQ(data); + edid->edid_range.er_max_vfreq = EDID_DESC_RANGE_MAX_VFREQ(data); + edid->edid_range.er_min_hfreq = EDID_DESC_RANGE_MIN_HFREQ(data); + edid->edid_range.er_max_hfreq = EDID_DESC_RANGE_MAX_HFREQ(data); + edid->edid_range.er_max_clock = EDID_DESC_RANGE_MAX_CLOCK(data); + if (!EDID_DESC_RANGE_HAVE_GTF2(data)) + break; + edid->edid_range.er_have_gtf2 = 1; + edid->edid_range.er_gtf2_hfreq = + EDID_DESC_RANGE_GTF2_HFREQ(data); + edid->edid_range.er_gtf2_c = EDID_DESC_RANGE_GTF2_C(data); + edid->edid_range.er_gtf2_m = EDID_DESC_RANGE_GTF2_M(data); + edid->edid_range.er_gtf2_j = EDID_DESC_RANGE_GTF2_J(data); + edid->edid_range.er_gtf2_k = EDID_DESC_RANGE_GTF2_K(data); + break; + + case EDID_DESC_BLOCK_TYPE_NAME: + /* copy the product name into place */ + memcpy(edid->edid_productname, + data + EDID_DESC_ASCII_DATA_OFFSET, + EDID_DESC_ASCII_DATA_LEN); + break; + + case EDID_DESC_BLOCK_TYPE_STD_TIMING: + data += EDID_DESC_STD_TIMING_START; + for (i = 0; i < EDID_DESC_STD_TIMING_COUNT; i++) { + if (edid_std_timing(data, &mode)) { + /* Does this mode already exist? */ + exist_mode = edid_search_mode(edid, &mode); + if (exist_mode == NULL) { + edid->edid_modes[edid->edid_nmodes] = + mode; + edid->edid_nmodes++; + } + } + data += 2; + } + break; + + case EDID_DESC_BLOCK_TYPE_COLOR_POINT: + /* XXX: not implemented yet */ + break; + } +} + +/* + * Gets EDID version in BCD, e.g. EDID v1.3 returned as 0x0103 + */ +int +edid_parse(uint8_t *data, struct edid_info *edid) +{ + uint16_t manfid, estmodes; + const struct videomode *vmp; + int i; + const char *name; + int max_dotclock = 0; + int mhz; + + if (edid_is_valid(data) != 0) + return -1; + + /* get product identification */ + manfid = EDID_VENDOR_ID(data); + edid->edid_vendor[0] = EDID_MANFID_0(manfid); + edid->edid_vendor[1] = EDID_MANFID_1(manfid); + edid->edid_vendor[2] = EDID_MANFID_2(manfid); + edid->edid_vendor[3] = 0; /* null terminate for convenience */ + + edid->edid_product = data[EDID_OFFSET_PRODUCT_ID] + + (data[EDID_OFFSET_PRODUCT_ID + 1] << 8); + + name = edid_findvendor(edid->edid_vendor); + if (name != NULL) + strlcpy(edid->edid_vendorname, name, + sizeof(edid->edid_vendorname)); + else + edid->edid_vendorname[0] = '\0'; + + name = edid_findproduct(edid->edid_vendor, edid->edid_product); + if (name != NULL) + strlcpy(edid->edid_productname, name, + sizeof(edid->edid_productname)); + else + edid->edid_productname[0] = '\0'; + + snprintf(edid->edid_serial, sizeof(edid->edid_serial), "%08x", + EDID_SERIAL_NUMBER(data)); + + edid->edid_week = EDID_WEEK(data); + edid->edid_year = EDID_YEAR(data); + + /* get edid revision */ + edid->edid_version = EDID_VERSION(data); + edid->edid_revision = EDID_REVISION(data); + + edid->edid_video_input = EDID_VIDEO_INPUT(data); + edid->edid_max_hsize = EDID_MAX_HSIZE(data); + edid->edid_max_vsize = EDID_MAX_VSIZE(data); + + edid->edid_gamma = EDID_GAMMA(data); + edid->edid_features = EDID_FEATURES(data); + + edid->edid_chroma.ec_redx = EDID_CHROMA_REDX(data); + edid->edid_chroma.ec_redy = EDID_CHROMA_REDX(data); + edid->edid_chroma.ec_greenx = EDID_CHROMA_GREENX(data); + edid->edid_chroma.ec_greeny = EDID_CHROMA_GREENY(data); + edid->edid_chroma.ec_bluex = EDID_CHROMA_BLUEX(data); + edid->edid_chroma.ec_bluey = EDID_CHROMA_BLUEY(data); + edid->edid_chroma.ec_whitex = EDID_CHROMA_WHITEX(data); + edid->edid_chroma.ec_whitey = EDID_CHROMA_WHITEY(data); + + edid->edid_ext_block_count = EDID_EXT_BLOCK_COUNT(data); + + /* lookup established modes */ + edid->edid_nmodes = 0; + edid->edid_preferred_mode = NULL; + estmodes = EDID_EST_TIMING(data); + /* Iterate in esztablished timing order */ + for (i = 15; i >= 0; i--) { + if (estmodes & (1 << i)) { + vmp = edid_mode_lookup_list(_edid_modes[i]); + if (vmp != NULL) { + edid->edid_modes[edid->edid_nmodes] = *vmp; + edid->edid_nmodes++; + } +#ifdef DIAGNOSTIC + else + printf("no data for est. mode %s\n", + _edid_modes[i]); +#endif + } + } + + /* do standard timing section */ + for (i = 0; i < EDID_STD_TIMING_COUNT; i++) { + struct videomode mode, *exist_mode; + if (edid_std_timing(data + EDID_OFFSET_STD_TIMING + i * 2, + &mode)) { + /* Does this mode already exist? */ + exist_mode = edid_search_mode(edid, &mode); + if (exist_mode == NULL) { + edid->edid_modes[edid->edid_nmodes] = mode; + edid->edid_nmodes++; + } + } + } + + /* do detailed timings and descriptors */ + for (i = 0; i < EDID_BLOCK_COUNT; i++) { + edid_block(edid, data + EDID_OFFSET_DESC_BLOCK + + i * EDID_BLOCK_SIZE); + } + + edid_strchomp(edid->edid_vendorname); + edid_strchomp(edid->edid_productname); + edid_strchomp(edid->edid_serial); + edid_strchomp(edid->edid_comment); + + /* + * XXX + * some monitors lie about their maximum supported dot clock + * by claiming to support modes which need a higher dot clock + * than the stated maximum. + * For sanity's sake we bump it to the highest dot clock we find + * in the list of supported modes + */ + for (i = 0; i < edid->edid_nmodes; i++) + if (edid->edid_modes[i].dot_clock > max_dotclock) + max_dotclock = edid->edid_modes[i].dot_clock; + if (bootverbose) { + printf("edid: max_dotclock according to supported modes: %d\n", + max_dotclock); + } + mhz = (max_dotclock + 999) / 1000; + + if (edid->edid_have_range) { + if (mhz > edid->edid_range.er_max_clock) + edid->edid_range.er_max_clock = mhz; + } else + edid->edid_range.er_max_clock = mhz; + + return 0; +} + Added: head/sys/dev/videomode/ediddevs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/videomode/ediddevs Sun Feb 15 11:37:40 2015 (r278798) @@ -0,0 +1,106 @@ +$NetBSD: ediddevs,v 1.2 2007/03/07 18:47:13 macallan Exp $ +$FreeBSD$ + +/*- + * Copyright (c) 2006 Itronix Inc. + * All rights reserved. + * + * Written by Garrett D'Amore for Itronix Inc. + * + * 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. + * 3. The name of Itronix Inc. may not be used to endorse + * or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``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 ITRONIX INC. 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. + */ + +/* + * Use "make -f Makefile.ediddevs" to regenerate ediddevs.h and ediddevs_data.h + */ + +/* + * List of known EDID monitor vendors + * + * These are standard PNP ids, managed (apparently) by Microsoft. + * It is likely that this list is grossly incomplete. + */ +vendor AAC AcerView +vendor AOC AOC +vendor APP Apple Computer +vendor AST AST Research +vendor CPL Compal +vendor CPQ Compaq +vendor CTX CTX +vendor DEC DEC +vendor DEL Dell +vendor DPC Delta +vendor DWE Daewoo +vendor EIZ EIZO +vendor ELS ELSA +vendor EPI Envision +vendor FCM Funai +vendor FUJ Fujitsu +vendor GSM LG Electronics +vendor GWY Gateway 2000 +vendor HEI Hyundai +vendor HIT Hitachi +vendor HSL Hansol +vendor HTC Hitachi/Nissei +vendor HWP HP +vendor IBM IBM +vendor ICL Fujitsu ICL +vendor IVM Iiyama +vendor KDS Korea Data Systems +vendor MEI Panasonic +vendor MEL Mitsubishi Electronics +vendor NAN Nanao +vendor NEC NEC +vendor NOK Nokia Data +vendor PHL Philips +vendor REL Relisys +vendor SAM Samsung +vendor SGI SGI +vendor SNY Sony +vendor SRC Shamrock +vendor SUN Sun Microsystems +vendor TAT Tatung +vendor TOS Toshiba +vendor TSB Toshiba *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 12:02:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 703B56B7; Sun, 15 Feb 2015 12:02:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 58068F65; Sun, 15 Feb 2015 12:02:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FC2JTN099309; Sun, 15 Feb 2015 12:02:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FC2IcA099300; Sun, 15 Feb 2015 12:02:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502151202.t1FC2IcA099300@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 15 Feb 2015 12:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278799 - in head: share/man/man4 sys/conf sys/dev/usb sys/dev/usb/video sys/modules/usb/udl 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 12:02:19 -0000 Author: hselasky Date: Sun Feb 15 12:02:17 2015 New Revision: 278799 URL: https://svnweb.freebsd.org/changeset/base/278799 Log: Import USB display link driver from OpenBSD. Support for compression has been removed and the driver has been greatly simplified and optimised for FreeBSD. The driver is currently not built by default. Requested by: Bruce Simpson Added: head/share/man/man4/udl.4 (contents, props changed) head/sys/dev/usb/video/ head/sys/dev/usb/video/udl.c (contents, props changed) head/sys/dev/usb/video/udl.h (contents, props changed) head/sys/modules/usb/udl/ head/sys/modules/usb/udl/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files head/sys/dev/usb/usbdevs Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Feb 15 11:37:40 2015 (r278798) +++ head/share/man/man4/Makefile Sun Feb 15 12:02:17 2015 (r278799) @@ -843,6 +843,7 @@ MAN+= \ udbp.4 \ udp.4 \ udplite.4 \ + udl.4 \ uep.4 \ ufm.4 \ ufoma.4 \ Added: head/share/man/man4/udl.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/udl.4 Sun Feb 15 12:02:17 2015 (r278799) @@ -0,0 +1,67 @@ +.\" $OpenBSD: udl.4,v 1.20 2012/09/18 17:11:41 jasper Exp $ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2009 Marcus Glocker +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd February 15, 2015 +.Dt UDL 4 +.Os +.Sh NAME +.Nm udl +.Nd DisplayLink DL-120 / DL-160 USB display devices +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device udl" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +udl_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver supports USB display devices based on the DisplayLink DL-120 / DL-160 +graphic chip. +.Sh HARDWARE +The following devices should work: +.Pp +.Bl -tag -width Ds -offset indent -compact +.It Century Corp. Japan Plus One LCD-8000U +.It Century Corp. Japan Plus One LCD-4300U +.It DisplayLink USB to DVI +.It ForwardVideo EasyCAP008 USB to DVI +.It HP USB 2.0 Docking Station (FQ834) +.It HP USB Graphics Adapter (NL571) +.It IOGEAR USB 2.0 External DVI (GUC2020) +.It Koenig CMP-USBVGA10 and CMP-USBVGA11 +.It Lenovo 45K5296 USB to DVI +.It Lenovo ThinkVision LT1421 +.It Lilliput UM-70 +.It Nanovision MiMo UM-710 and UM-740 +.It Rextron VCUD60 USB to DVI +.It Samsung LD220 +.It StarTech CONV-USB2DVI +.It Sunweit USB to DVI +.It Unitek Y-2240 USB to DVI +.It VideoHome NBdock1920 +.El +.Sh SEE ALSO +.Xr usb 4 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Feb 15 11:37:40 2015 (r278798) +++ head/sys/conf/files Sun Feb 15 12:02:17 2015 (r278799) @@ -2563,6 +2563,10 @@ dev/usb/template/usb_template_mtp.c opti dev/usb/template/usb_template_phone.c optional usb_template dev/usb/template/usb_template_serialnet.c optional usb_template # +# USB video drivers +# +dev/usb/video/udl.c optional udl +# # USB END # dev/videomode/videomode.c optional videomode Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Feb 15 11:37:40 2015 (r278798) +++ head/sys/dev/usb/usbdevs Sun Feb 15 12:02:17 2015 (r278799) @@ -686,6 +686,7 @@ vendor ASUS2 0x1761 ASUS vendor SWEEX2 0x177f Sweex vendor METAGEEK 0x1781 MetaGeek vendor KAMSTRUP 0x17a8 Kamstrup A/S +vendor DISPLAYLINK 0x17e9 DisplayLink vendor LENOVO 0x17ef Lenovo vendor WAVESENSE 0x17f4 WaveSense vendor VAISALA 0x1843 Vaisala @@ -1655,6 +1656,27 @@ product DLINK2 RT3070_4 0x3c15 RT3070 product DLINK2 RT3070_5 0x3c16 RT3070 product DLINK3 DWM652 0x3e04 DWM-652 +/* DisplayLink products */ +product DISPLAYLINK LCD4300U 0x01ba LCD-4300U +product DISPLAYLINK LCD8000U 0x01bb LCD-8000U +product DISPLAYLINK LD220 0x0100 Samsung LD220 +product DISPLAYLINK GUC2020 0x0059 IOGEAR DVI GUC2020 +product DISPLAYLINK VCUD60 0x0136 Rextron DVI +product DISPLAYLINK CONV 0x0138 StarTech CONV-USB2DVI +product DISPLAYLINK DLDVI 0x0141 DisplayLink DVI +product DISPLAYLINK VGA10 0x015a CMP-USBVGA10 +product DISPLAYLINK WSDVI 0x0198 WS Tech DVI +product DISPLAYLINK EC008 0x019b EasyCAP008 DVI +product DISPLAYLINK HPDOCK 0x01d4 HP USB Docking +product DISPLAYLINK NL571 0x01d7 HP USB DVI +product DISPLAYLINK M01061 0x01e2 Lenovo DVI +product DISPLAYLINK SWDVI 0x024c SUNWEIT DVI +product DISPLAYLINK NBDOCK 0x0215 VideoHome NBdock1920 +product DISPLAYLINK LUM70 0x02a9 Lilliput UM-70 +product DISPLAYLINK UM7X0 0x401a nanovision MiMo +product DISPLAYLINK LT1421 0x03e0 Lenovo ThinkVision LT1421 +product DISPLAYLINK POLARIS2 0x0117 Polaris2 USB dock + /* DMI products */ product DMI CFSM_RW 0xa109 CF/SM Reader/Writer product DMI DISK 0x2bcf Generic Disk Added: head/sys/dev/usb/video/udl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/video/udl.c Sun Feb 15 12:02:17 2015 (r278799) @@ -0,0 +1,1068 @@ +/* $OpenBSD: udl.c,v 1.81 2014/12/09 07:05:06 doug Exp $ */ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2015 Hans Petter Selasky + * Copyright (c) 2009 Marcus Glocker + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * Driver for the "DisplayLink DL-120 / DL-160" graphic chips based on + * the reversed engineered specifications of Florian Echtler + * : + * + * http://floe.butterbrot.org/displaylink/doku.php + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include "usbdevs.h" + +#include + +#include "fb_if.h" + +#undef DPRINTF +#undef DPRINTFN +#define USB_DEBUG_VAR udl_debug +#include + +#ifdef USB_DEBUG +static int udl_debug = 0; + +static SYSCTL_NODE(_hw_usb, OID_AUTO, udl, CTLFLAG_RW, 0, "USB UDL"); + +SYSCTL_INT(_hw_usb_udl, OID_AUTO, debug, CTLFLAG_RWTUN, + &udl_debug, 0, "Debug level"); +#endif + +/* + * Prototypes. + */ +static usb_callback_t udl_bulk_write_callback; + +static device_probe_t udl_probe; +static device_attach_t udl_attach; +static device_detach_t udl_detach; +static fb_getinfo_t udl_fb_getinfo; +#if 0 +static fb_blank_display_t udl_fb_blank_display; +#endif + +static void udl_select_chip(struct udl_softc *, struct usb_attach_arg *); +static int udl_init_chip(struct udl_softc *); +static void udl_select_mode(struct udl_softc *); +static int udl_init_resolution(struct udl_softc *); +static void udl_fbmem_alloc(struct udl_softc *); +static int udl_cmd_write_buf_le16(struct udl_softc *, const uint8_t *, uint32_t, uint8_t, int); +static int udl_cmd_buf_copy_le16(struct udl_softc *, uint32_t, uint32_t, uint8_t, int); +static void udl_cmd_insert_int_1(struct udl_cmd_buf *, uint8_t); +static void udl_cmd_insert_int_3(struct udl_cmd_buf *, uint32_t); +static void udl_cmd_insert_buf_le16(struct udl_cmd_buf *, const uint8_t *, uint32_t); +static void udl_cmd_write_reg_1(struct udl_cmd_buf *, uint8_t, uint8_t); +static void udl_cmd_write_reg_3(struct udl_cmd_buf *, uint8_t, uint32_t); +#if 0 +static int udl_power_save(struct udl_softc *, int, int); +#endif + +static const struct usb_config udl_config[UDL_N_TRANSFER] = { + [UDL_BULK_WRITE_0] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .flags = {.pipe_bof = 1,.force_short_xfer = 1,.ext_buffer = 1,}, + .bufsize = UDL_CMD_MAX_DATA_SIZE * UDL_CMD_MAX_FRAMES, + .callback = &udl_bulk_write_callback, + .frames = UDL_CMD_MAX_FRAMES, + .timeout = 5000, /* 5 seconds */ + }, + [UDL_BULK_WRITE_1] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .flags = {.pipe_bof = 1,.force_short_xfer = 1,.ext_buffer = 1,}, + .bufsize = UDL_CMD_MAX_DATA_SIZE * UDL_CMD_MAX_FRAMES, + .callback = &udl_bulk_write_callback, + .frames = UDL_CMD_MAX_FRAMES, + .timeout = 5000, /* 5 seconds */ + }, +}; + +/* + * Driver glue. + */ +static devclass_t udl_devclass; + +static device_method_t udl_methods[] = { + DEVMETHOD(device_probe, udl_probe), + DEVMETHOD(device_attach, udl_attach), + DEVMETHOD(device_detach, udl_detach), + DEVMETHOD(fb_getinfo, udl_fb_getinfo), +#if 0 + DEVMETHOD(fb_blank_display, udl_fb_blank_display), +#endif + DEVMETHOD_END +}; + +static driver_t udl_driver = { + .name = "udl", + .methods = udl_methods, + .size = sizeof(struct udl_softc), +}; + +DRIVER_MODULE(udl, uhub, udl_driver, udl_devclass, NULL, NULL); +MODULE_DEPEND(udl, usb, 1, 1, 1); +MODULE_DEPEND(udl, fbd, 1, 1, 1); +MODULE_DEPEND(udl, videomode, 1, 1, 1); +MODULE_VERSION(udl, 1); + +/* + * Matching devices. + */ +static const STRUCT_USB_HOST_ID udl_devs[] = { + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LCD4300U, DL120)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LCD8000U, DL120)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_GUC2020, DL160)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LD220, DL165)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_VCUD60, DL160)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_DLDVI, DL160)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_VGA10, DL120)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_WSDVI, DLUNK)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_EC008, DL160)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_HPDOCK, DL160)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_NL571, DL160)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_M01061, DL195)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_NBDOCK, DL165)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_SWDVI, DLUNK)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_UM7X0, DL120)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_CONV, DL160)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LUM70, DL125)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_POLARIS2, DLUNK)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LT1421, DLUNK)} +}; + +static uint32_t +udl_get_fb_size(struct udl_softc *sc) +{ + unsigned i = sc->sc_cur_mode; + + return ((uint32_t)udl_modes[i].hdisplay * + (uint32_t)udl_modes[i].vdisplay * 2); +} + +static uint32_t +udl_get_fb_width(struct udl_softc *sc) +{ + unsigned i = sc->sc_cur_mode; + + return (udl_modes[i].vdisplay); +} + +static uint32_t +udl_get_fb_height(struct udl_softc *sc) +{ + unsigned i = sc->sc_cur_mode; + + return (udl_modes[i].hdisplay); +} + +static uint32_t +udl_get_fb_hz(struct udl_softc *sc) +{ + unsigned i = sc->sc_cur_mode; + + return (udl_modes[i].hz); +} + +static void +udl_callout(void *arg) +{ + struct udl_softc *sc = arg; + const uint32_t max = udl_get_fb_size(sc); + + if (sc->sc_power_save == 0) { + if (sc->sc_sync_off >= max) + sc->sc_sync_off = 0; + usbd_transfer_start(sc->sc_xfer[UDL_BULK_WRITE_0]); + usbd_transfer_start(sc->sc_xfer[UDL_BULK_WRITE_1]); + } + callout_reset(&sc->sc_callout, hz / 5, &udl_callout, sc); +} + +static int +udl_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + if (uaa->info.bConfigIndex != 0) + return (ENXIO); + if (uaa->info.bIfaceIndex != 0) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(udl_devs, sizeof(udl_devs), uaa)); +} + +static int +udl_attach(device_t dev) +{ + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); + struct sysctl_oid *tree = device_get_sysctl_tree(dev); + struct udl_softc *sc = device_get_softc(dev); + struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; + int i; + + device_set_usb_desc(dev); + + mtx_init(&sc->sc_mtx, "UDL lock", NULL, MTX_DEF); + cv_init(&sc->sc_cv, "UDLCV"); + callout_init_mtx(&sc->sc_callout, &sc->sc_mtx, 0); + sc->sc_udev = uaa->device; + + error = usbd_transfer_setup(uaa->device, &uaa->info.bIfaceIndex, + sc->sc_xfer, udl_config, UDL_N_TRANSFER, sc, &sc->sc_mtx); + + if (error) { + DPRINTF("usbd_transfer_setup error=%s\n", usbd_errstr(error)); + goto detach; + } + usbd_xfer_set_priv(sc->sc_xfer[UDL_BULK_WRITE_0], &sc->sc_xfer_head[0]); + usbd_xfer_set_priv(sc->sc_xfer[UDL_BULK_WRITE_1], &sc->sc_xfer_head[1]); + + TAILQ_INIT(&sc->sc_xfer_head[0]); + TAILQ_INIT(&sc->sc_xfer_head[1]); + TAILQ_INIT(&sc->sc_cmd_buf_free); + TAILQ_INIT(&sc->sc_cmd_buf_pending); + + sc->sc_def_chip = -1; + sc->sc_chip = USB_GET_DRIVER_INFO(uaa); + sc->sc_def_mode = -1; + sc->sc_cur_mode = UDL_MAX_MODES; + + /* Allow chip ID to be overwritten */ + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "chipid_force", + CTLFLAG_RWTUN, &sc->sc_def_chip, 0, "chip ID"); + + /* Export current chip ID */ + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "chipid", + CTLFLAG_RD, &sc->sc_chip, 0, "chip ID"); + + if (sc->sc_def_chip > -1 && sc->sc_def_chip <= DLMAX) { + device_printf(dev, "Forcing chip ID to 0x%04x\n", sc->sc_def_chip); + sc->sc_chip = sc->sc_def_chip; + } + /* + * The product might have more than one chip + */ + if (sc->sc_chip == DLUNK) + udl_select_chip(sc, uaa); + + for (i = 0; i != UDL_CMD_MAX_BUFFERS; i++) { + struct udl_cmd_buf *cb = &sc->sc_cmd_buf_temp[i]; + + TAILQ_INSERT_TAIL(&sc->sc_cmd_buf_free, cb, entry); + } + + /* + * Initialize chip. + */ + error = udl_init_chip(sc); + if (error != USB_ERR_NORMAL_COMPLETION) + goto detach; + + /* + * Select edid mode. + */ + udl_select_mode(sc); + + /* Allow default mode to be overwritten */ + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "mode_force", + CTLFLAG_RWTUN, &sc->sc_def_mode, 0, "mode"); + + /* Export current mode */ + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "mode", + CTLFLAG_RD, &sc->sc_cur_mode, 0, "mode"); + + i = sc->sc_def_mode; + if (i > -1 && i < UDL_MAX_MODES) { + if (udl_modes[i].chip <= sc->sc_chip) { + device_printf(dev, "Forcing mode to %d\n", i); + sc->sc_cur_mode = i; + } + } + /* Printout current mode */ + device_printf(dev, "Mode selected %dx%d @ %dHz\n", + (int)udl_get_fb_width(sc), + (int)udl_get_fb_height(sc), + (int)udl_get_fb_hz(sc)); + + udl_init_resolution(sc); + + /* Allocate frame buffer */ + udl_fbmem_alloc(sc); + + UDL_LOCK(sc); + udl_callout(sc); + UDL_UNLOCK(sc); + + sc->sc_fb_info.fb_name = device_get_nameunit(dev); + sc->sc_fb_info.fb_size = sc->sc_fb_size; + sc->sc_fb_info.fb_bpp = 16; + sc->sc_fb_info.fb_depth = 16; + sc->sc_fb_info.fb_width = udl_get_fb_width(sc); + sc->sc_fb_info.fb_height = udl_get_fb_height(sc); + sc->sc_fb_info.fb_stride = sc->sc_fb_info.fb_width * 2; + sc->sc_fb_info.fb_pbase = (uintptr_t)sc->sc_fb_addr; + sc->sc_fb_info.fb_vbase = (uintptr_t)sc->sc_fb_addr; + + sc->sc_fbdev = device_add_child(dev, "fbd", -1); + if (sc->sc_fbdev == NULL) + goto detach; + if (device_probe_and_attach(sc->sc_fbdev) != 0) + goto detach; + + return (0); + +detach: + udl_detach(dev); + + return (ENXIO); +} + +static int +udl_detach(device_t dev) +{ + struct udl_softc *sc = device_get_softc(dev); + + if (sc->sc_fbdev != NULL) { + device_t bdev; + + bdev = sc->sc_fbdev; + sc->sc_fbdev = NULL; + device_detach(bdev); + device_delete_child(dev, bdev); + } + UDL_LOCK(sc); + sc->sc_gone = 1; + callout_stop(&sc->sc_callout); + UDL_UNLOCK(sc); + + usbd_transfer_unsetup(sc->sc_xfer, UDL_N_TRANSFER); + + callout_drain(&sc->sc_callout); + + mtx_destroy(&sc->sc_mtx); + cv_destroy(&sc->sc_cv); + + /* + * Free framebuffer memory, if any. + */ + free(sc->sc_fb_addr, M_DEVBUF); + free(sc->sc_fb_copy, M_DEVBUF); + + return (0); +} + +static struct fb_info * +udl_fb_getinfo(device_t dev) +{ + struct udl_softc *sc = device_get_softc(dev); + + return (&sc->sc_fb_info); +} + +#if 0 +static int +udl_fb_blank_display(device_t dev, int mode) +{ + struct udl_softc *sc = device_get_softc(dev); + + switch (mode) { + case V_DISPLAY_ON: + udl_power_save(sc, 1, M_WAITOK); + break; + case V_DISPLAY_BLANK: + udl_power_save(sc, 1, M_WAITOK); + if (sc->sc_fb_addr != 0) { + const uint32_t max = udl_get_fb_size(sc); + + memset((void *)sc->sc_fb_addr, 0, max); + } + break; + case V_DISPLAY_STAND_BY: + case V_DISPLAY_SUSPEND: + udl_power_save(sc, 0, M_WAITOK); + break; + } + return (0); +} +#endif + +static struct udl_cmd_buf * +udl_cmd_buf_alloc(struct udl_softc *sc, int flags) +{ + struct udl_cmd_buf *cb; + + UDL_LOCK(sc); + while ((cb = TAILQ_FIRST(&sc->sc_cmd_buf_free)) == NULL) { + if (flags != M_WAITOK) + break; + cv_wait(&sc->sc_cv, &sc->sc_mtx); + } + if (cb != NULL) { + TAILQ_REMOVE(&sc->sc_cmd_buf_free, cb, entry); + cb->off = 0; + } + UDL_UNLOCK(sc); + return (cb); +} + +static void +udl_cmd_buf_send(struct udl_softc *sc, struct udl_cmd_buf *cb) +{ + UDL_LOCK(sc); + if (sc->sc_gone) { + TAILQ_INSERT_TAIL(&sc->sc_cmd_buf_free, cb, entry); + } else { + /* mark end of command stack */ + udl_cmd_insert_int_1(cb, UDL_BULK_SOC); + udl_cmd_insert_int_1(cb, UDL_BULK_CMD_EOC); + + TAILQ_INSERT_TAIL(&sc->sc_cmd_buf_pending, cb, entry); + usbd_transfer_start(sc->sc_xfer[UDL_BULK_WRITE_0]); + usbd_transfer_start(sc->sc_xfer[UDL_BULK_WRITE_1]); + } + UDL_UNLOCK(sc); +} + +static struct udl_cmd_buf * +udl_fb_synchronize(struct udl_softc *sc) +{ + const uint32_t max = udl_get_fb_size(sc); + + while (sc->sc_sync_off < max) { + uint32_t delta = max - sc->sc_sync_off; + + if (delta > UDL_CMD_MAX_PIXEL_COUNT * 2) + delta = UDL_CMD_MAX_PIXEL_COUNT * 2; + if (bcmp(sc->sc_fb_addr + sc->sc_sync_off, sc->sc_fb_copy + sc->sc_sync_off, delta) != 0) { + struct udl_cmd_buf *cb; + + cb = udl_cmd_buf_alloc(sc, M_NOWAIT); + if (cb == NULL) + goto done; + memcpy(sc->sc_fb_copy + sc->sc_sync_off, + sc->sc_fb_addr + sc->sc_sync_off, delta); + udl_cmd_insert_int_1(cb, UDL_BULK_SOC); + udl_cmd_insert_int_1(cb, UDL_BULK_CMD_FB_WRITE | UDL_BULK_CMD_FB_WORD); + udl_cmd_insert_int_3(cb, sc->sc_sync_off); + udl_cmd_insert_int_1(cb, delta / 2); + udl_cmd_insert_buf_le16(cb, sc->sc_fb_copy + sc->sc_sync_off, delta); + sc->sc_sync_off += delta; + return (cb); + } else { + sc->sc_sync_off += delta; + } + } +done: + return (NULL); +} + +static void +udl_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct udl_softc *sc = usbd_xfer_softc(xfer); + struct udl_cmd_head *phead = usbd_xfer_get_priv(xfer); + struct udl_cmd_buf *cb; + unsigned i; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + TAILQ_CONCAT(&sc->sc_cmd_buf_free, phead, entry); + case USB_ST_SETUP: +tr_setup: + for (i = 0; i != UDL_CMD_MAX_FRAMES; i++) { + cb = TAILQ_FIRST(&sc->sc_cmd_buf_pending); + if (cb == NULL) { + cb = udl_fb_synchronize(sc); + if (cb == NULL) + break; + } + TAILQ_REMOVE(&sc->sc_cmd_buf_pending, cb, entry); + TAILQ_INSERT_TAIL(phead, cb, entry); + usbd_xfer_set_frame_data(xfer, i, cb->buf, cb->off); + } + if (i != 0) { + usbd_xfer_set_frames(xfer, i); + usbd_transfer_submit(xfer); + } + break; + default: + TAILQ_CONCAT(&sc->sc_cmd_buf_free, phead, entry); + if (error != USB_ERR_CANCELLED) { + /* try clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } + /* wakeup any waiters */ + cv_signal(&sc->sc_cv); +} + +#if 0 +static int +udl_power_save(struct udl_softc *sc, int on, int flags) +{ + struct udl_cmd_buf *cb; + + /* get new buffer */ + cb = udl_cmd_buf_alloc(sc, flags); + if (cb == NULL) + return (EAGAIN); + + DPRINTF("screen %s\n", on ? "ON" : "OFF"); + + sc->sc_power_save = on ? 0 : 1; + + if (on) + udl_cmd_write_reg_1(cb, UDL_REG_SCREEN, UDL_REG_SCREEN_ON); + else + udl_cmd_write_reg_1(cb, UDL_REG_SCREEN, UDL_REG_SCREEN_OFF); + + udl_cmd_write_reg_1(cb, UDL_REG_SYNC, 0xff); + udl_cmd_buf_send(sc, cb); + return (0); +} +#endif + +static int +udl_ctrl_msg(struct udl_softc *sc, uint8_t rt, uint8_t r, + uint16_t index, uint16_t value, uint8_t *buf, size_t len) +{ + usb_device_request_t req; + int error; + + req.bmRequestType = rt; + req.bRequest = r; + USETW(req.wIndex, index); + USETW(req.wValue, value); + USETW(req.wLength, len); + + error = usbd_do_request_flags(sc->sc_udev, NULL, + &req, buf, 0, NULL, USB_DEFAULT_TIMEOUT); + + DPRINTF("%s\n", usbd_errstr(error)); + + return (error); +} + +static int +udl_poll(struct udl_softc *sc, uint32_t *buf) +{ + uint32_t lbuf; + int error; + + error = udl_ctrl_msg(sc, UT_READ_VENDOR_DEVICE, + UDL_CTRL_CMD_POLL, 0x0000, 0x0000, (uint8_t *)&lbuf, sizeof(lbuf)); + if (error == USB_ERR_NORMAL_COMPLETION) + *buf = le32toh(lbuf); + return (error); +} + +static int +udl_read_1(struct udl_softc *sc, uint16_t addr, uint8_t *buf) +{ + uint8_t lbuf[1]; + int error; + + error = udl_ctrl_msg(sc, UT_READ_VENDOR_DEVICE, + UDL_CTRL_CMD_READ_1, addr, 0x0000, lbuf, 1); + if (error == USB_ERR_NORMAL_COMPLETION) + *buf = *(uint8_t *)lbuf; + return (error); +} + +static int +udl_write_1(struct udl_softc *sc, uint16_t addr, uint8_t buf) +{ + int error; + + error = udl_ctrl_msg(sc, UT_WRITE_VENDOR_DEVICE, + UDL_CTRL_CMD_WRITE_1, addr, 0x0000, &buf, 1); + return (error); +} + +static int +udl_read_edid(struct udl_softc *sc, uint8_t *buf) +{ + uint8_t lbuf[64]; + uint16_t offset; + int error; + + offset = 0; + + error = udl_ctrl_msg(sc, UT_READ_VENDOR_DEVICE, + UDL_CTRL_CMD_READ_EDID, 0x00a1, (offset << 8), lbuf, 64); + if (error != USB_ERR_NORMAL_COMPLETION) + goto fail; + bcopy(lbuf + 1, buf + offset, 63); + offset += 63; + + error = udl_ctrl_msg(sc, UT_READ_VENDOR_DEVICE, + UDL_CTRL_CMD_READ_EDID, 0x00a1, (offset << 8), lbuf, 64); + if (error != USB_ERR_NORMAL_COMPLETION) + goto fail; + bcopy(lbuf + 1, buf + offset, 63); + offset += 63; + + error = udl_ctrl_msg(sc, UT_READ_VENDOR_DEVICE, + UDL_CTRL_CMD_READ_EDID, 0x00a1, (offset << 8), lbuf, 3); + if (error != USB_ERR_NORMAL_COMPLETION) + goto fail; + bcopy(lbuf + 1, buf + offset, 2); +fail: + return (error); +} + +static uint8_t +udl_lookup_mode(uint16_t hdisplay, uint16_t vdisplay, uint8_t hz, + uint16_t chip, uint32_t clock) +{ + uint8_t idx; + + /* + * Check first if we have a matching mode with pixelclock + */ + for (idx = 0; idx != UDL_MAX_MODES; idx++) { + if ((udl_modes[idx].hdisplay == hdisplay) && + (udl_modes[idx].vdisplay == vdisplay) && + (udl_modes[idx].clock == clock) && + (udl_modes[idx].chip <= chip)) { + return (idx); + } + } + + /* + * If not, check for matching mode with update frequency + */ + for (idx = 0; idx != UDL_MAX_MODES; idx++) { + if ((udl_modes[idx].hdisplay == hdisplay) && + (udl_modes[idx].vdisplay == vdisplay) && + (udl_modes[idx].hz == hz) && + (udl_modes[idx].chip <= chip)) { + return (idx); + } + } + return (idx); +} + +static void +udl_select_chip(struct udl_softc *sc, struct usb_attach_arg *uaa) +{ + const char *pserial; + + pserial = usb_get_serial(uaa->device); + + sc->sc_chip = DL120; + + if ((uaa->info.idVendor == USB_VENDOR_DISPLAYLINK) && + (uaa->info.idProduct == USB_PRODUCT_DISPLAYLINK_WSDVI)) { + + /* + * WS Tech DVI is DL120 or DL160. All deviced uses the + * same revision (0.04) so iSerialNumber must be used + * to determin which chip it is. + */ + + if (strlen(pserial) > 7) { + if (strncmp(pserial, "0198-13", 7) == 0) + sc->sc_chip = DL160; + } + DPRINTF("iSerialNumber (%s) used to select chip (%d)\n", + pserial, sc->sc_chip); + } + if ((uaa->info.idVendor == USB_VENDOR_DISPLAYLINK) && + (uaa->info.idProduct == USB_PRODUCT_DISPLAYLINK_SWDVI)) { + + /* + * SUNWEIT DVI is DL160, DL125, DL165 or DL195. Major revision + * can be used to differ between DL1x0 and DL1x5. Minor to + * differ between DL1x5. iSerialNumber seems not to be uniqe. + */ + + sc->sc_chip = DL160; + + if (uaa->info.bcdDevice >= 0x100) { + sc->sc_chip = DL165; + if (uaa->info.bcdDevice == 0x104) + sc->sc_chip = DL195; + if (uaa->info.bcdDevice == 0x108) + sc->sc_chip = DL125; + } + DPRINTF("bcdDevice (%02x) used to select chip (%d)\n", + uaa->info.bcdDevice, sc->sc_chip); + } +} + +static int +udl_set_enc_key(struct udl_softc *sc, uint8_t *buf, uint8_t len) +{ + int error; + + error = udl_ctrl_msg(sc, UT_WRITE_VENDOR_DEVICE, + UDL_CTRL_CMD_SET_KEY, 0x0000, 0x0000, buf, len); + return (error); +} + +static void +udl_fbmem_alloc(struct udl_softc *sc) +{ + uint32_t size; + + size = udl_get_fb_size(sc); + size = round_page(size); + + sc->sc_fb_addr = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO); + sc->sc_fb_copy = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO); + sc->sc_fb_size = size; +} + +static void +udl_cmd_insert_int_1(struct udl_cmd_buf *cb, uint8_t value) +{ + + cb->buf[cb->off] = value; + cb->off += 1; +} + +#if 0 +static void +udl_cmd_insert_int_2(struct udl_cmd_buf *cb, uint16_t value) +{ + uint16_t lvalue; + + lvalue = htobe16(value); + bcopy(&lvalue, cb->buf + cb->off, 2); + + cb->off += 2; +} + +#endif + +static void +udl_cmd_insert_int_3(struct udl_cmd_buf *cb, uint32_t value) +{ + uint32_t lvalue; + +#if BYTE_ORDER == BIG_ENDIAN + lvalue = htobe32(value) << 8; +#else + lvalue = htobe32(value) >> 8; +#endif + bcopy(&lvalue, cb->buf + cb->off, 3); + + cb->off += 3; +} + +#if 0 +static void +udl_cmd_insert_int_4(struct udl_cmd_buf *cb, uint32_t value) +{ + uint32_t lvalue; + + lvalue = htobe32(value); + bcopy(&lvalue, cb->buf + cb->off, 4); + + cb->off += 4; +} + +#endif + +static void +udl_cmd_insert_buf_le16(struct udl_cmd_buf *cb, const uint8_t *buf, uint32_t len) +{ + uint32_t x; + + for (x = 0; x != len; x += 2) { + /* byte swap from little endian to big endian */ + cb->buf[cb->off + x + 0] = buf[x + 1]; + cb->buf[cb->off + x + 1] = buf[x + 0]; + } + cb->off += len; +} + +static void +udl_cmd_write_reg_1(struct udl_cmd_buf *cb, uint8_t reg, uint8_t val) +{ + + udl_cmd_insert_int_1(cb, UDL_BULK_SOC); + udl_cmd_insert_int_1(cb, UDL_BULK_CMD_REG_WRITE_1); + udl_cmd_insert_int_1(cb, reg); + udl_cmd_insert_int_1(cb, val); +} + +static void +udl_cmd_write_reg_3(struct udl_cmd_buf *cb, uint8_t reg, uint32_t val) +{ + + udl_cmd_write_reg_1(cb, reg + 0, (val >> 16) & 0xff); + udl_cmd_write_reg_1(cb, reg + 1, (val >> 8) & 0xff); + udl_cmd_write_reg_1(cb, reg + 2, (val >> 0) & 0xff); +} + +static int +udl_init_chip(struct udl_softc *sc) +{ + uint32_t ui32; + uint8_t ui8; + int error; + + error = udl_poll(sc, &ui32); + if (error != USB_ERR_NORMAL_COMPLETION) + return (error); + DPRINTF("poll=0x%08x\n", ui32); + + /* Some products may use later chip too */ + switch (ui32 & 0xff) { + case 0xf1: /* DL1x5 */ + switch (sc->sc_chip) { + case DL120: + sc->sc_chip = DL125; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 14:25:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F537862; Sun, 15 Feb 2015 14:25:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 EEC47D79; Sun, 15 Feb 2015 14:25:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FEP0rr066134; Sun, 15 Feb 2015 14:25:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FEP0QV066133; Sun, 15 Feb 2015 14:25:00 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502151425.t1FEP0QV066133@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 Feb 2015 14:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278802 - 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 14:25:01 -0000 Author: pfg Date: Sun Feb 15 14:25:00 2015 New Revision: 278802 URL: https://svnweb.freebsd.org/changeset/base/278802 Log: ext2fs: Plug small memory leak free() e2fs_contigdirs upon error. Undo zeroing of e2fs_gd as this was actually a false positive. X-MFC with: 278790 Modified: head/sys/fs/ext2fs/ext2_vfsops.c Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Sun Feb 15 13:57:44 2015 (r278801) +++ head/sys/fs/ext2fs/ext2_vfsops.c Sun Feb 15 14:25:00 2015 (r278802) @@ -363,7 +363,7 @@ compute_sb_data(struct vnode *devvp, str db_count = (fs->e2fs_gcount + e2fs_descpb - 1) / e2fs_descpb; fs->e2fs_gdbcount = db_count; fs->e2fs_gd = malloc(db_count * fs->e2fs_bsize, - M_EXT2MNT, M_WAITOK | M_ZERO); + M_EXT2MNT, M_WAITOK); fs->e2fs_contigdirs = malloc(fs->e2fs_gcount * sizeof(*fs->e2fs_contigdirs), M_EXT2MNT, M_WAITOK | M_ZERO); @@ -379,6 +379,7 @@ compute_sb_data(struct vnode *devvp, str fsbtodb(fs, logic_sb_block + i + 1 ), fs->e2fs_bsize, NOCRED, &bp); if (error) { + free(fs->e2fs_contigdirs, M_EXT2MNT); free(fs->e2fs_gd, M_EXT2MNT); brelse(bp); return (error); From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 14:31:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AE8CA8E; Sun, 15 Feb 2015 14:31:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 760AFE2D; Sun, 15 Feb 2015 14:31:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FEVpbP070433; Sun, 15 Feb 2015 14:31:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FEVpaD070432; Sun, 15 Feb 2015 14:31:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502151431.t1FEVpaD070432@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 Feb 2015 14:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278803 - head/lib/libc/gen 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 14:31:51 -0000 Author: pfg Date: Sun Feb 15 14:31:50 2015 New Revision: 278803 URL: https://svnweb.freebsd.org/changeset/base/278803 Log: ulimit(3): Fix broken check. The existing implementation had a broken comparison that could overflow and return confusing values. Replace this with a check that avoids the overflow before it happens. Consistently return a maximum value also on the case of negative arguments since negative is considered an overflow and means infinity for our current setrlimit(). New revamped version is credited to Bruce Evans. CID: 1199295 MFC after: 1 week Modified: head/lib/libc/gen/ulimit.c Modified: head/lib/libc/gen/ulimit.c ============================================================================== --- head/lib/libc/gen/ulimit.c Sun Feb 15 14:25:00 2015 (r278802) +++ head/lib/libc/gen/ulimit.c Sun Feb 15 14:31:50 2015 (r278803) @@ -33,6 +33,7 @@ #include #include #include +#include #include long @@ -40,6 +41,7 @@ ulimit(int cmd, ...) { struct rlimit limit; va_list ap; + volatile intmax_t targ; long arg; if (cmd == UL_GETFSIZE) { @@ -51,16 +53,18 @@ ulimit(int cmd, ...) return ((long)limit.rlim_cur); } else if (cmd == UL_SETFSIZE) { va_start(ap, cmd); - arg = va_arg(ap, long); + targ = arg = va_arg(ap, long); va_end(ap); - limit.rlim_max = limit.rlim_cur = (rlim_t)arg * 512; + if (targ < 0) + targ = LONG_MAX; + if (targ > RLIM_INFINITY / 512) + targ = RLIM_INFINITY / 512; + limit.rlim_max = limit.rlim_cur = targ * 512; /* The setrlimit() function sets errno to EPERM if needed. */ if (setrlimit(RLIMIT_FSIZE, &limit) == -1) return (-1); - if (arg * 512 > LONG_MAX) - return (LONG_MAX); - return (arg); + return ((long)targ); } else { errno = EINVAL; return (-1); From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 16:50:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5021FE33; Sun, 15 Feb 2015 16:50:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3C780CBD; Sun, 15 Feb 2015 16:50:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FGoMwx032122; Sun, 15 Feb 2015 16:50:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FGoLTi032120; Sun, 15 Feb 2015 16:50:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502151650.t1FGoLTi032120@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 Feb 2015 16:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278804 - head/lib/libc/gen 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 16:50:22 -0000 Author: pfg Date: Sun Feb 15 16:50:21 2015 New Revision: 278804 URL: https://svnweb.freebsd.org/changeset/base/278804 Log: More tidy-ups on uninitialized scalar variable As a followup to r278363, there is one more case where stayopen can be accessed uninitialized, but even after swapping arguments, access is possible in some other cases so prevent it completely by initializing stayopen. CID: 1018729 CID: 1018732 Modified: head/lib/libc/gen/getgrent.c head/lib/libc/gen/getpwent.c Modified: head/lib/libc/gen/getgrent.c ============================================================================== --- head/lib/libc/gen/getgrent.c Sun Feb 15 14:31:50 2015 (r278803) +++ head/lib/libc/gen/getgrent.c Sun Feb 15 16:50:21 2015 (r278804) @@ -1303,7 +1303,7 @@ compat_group(void *retval, void *mdata, void *discard; size_t bufsize, linesize; off_t pos; - int rv, stayopen, *errnop; + int rv, stayopen = 0, *errnop; #define set_lookup_type(x, y) do { \ int i; \ @@ -1450,7 +1450,7 @@ docompat: pos = ftello(st->fp); } fin: - if (!stayopen && st->fp != NULL) { + if (st->fp != NULL || !stayopen) { fclose(st->fp); st->fp = NULL; } Modified: head/lib/libc/gen/getpwent.c ============================================================================== --- head/lib/libc/gen/getpwent.c Sun Feb 15 14:31:50 2015 (r278803) +++ head/lib/libc/gen/getpwent.c Sun Feb 15 16:50:21 2015 (r278804) @@ -815,7 +815,7 @@ files_passwd(void *retval, void *mdata, size_t bufsize, namesize; uid_t uid; uint32_t store; - int rv, stayopen, *errnop; + int rv, stayopen = 0, *errnop; name = NULL; uid = (uid_t)-1; From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 18:02:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F6D9682; Sun, 15 Feb 2015 18:02:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5B421320; Sun, 15 Feb 2015 18:02:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FI2615068960; Sun, 15 Feb 2015 18:02:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FI26Sm068959; Sun, 15 Feb 2015 18:02:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502151802.t1FI26Sm068959@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 Feb 2015 18:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278805 - head/lib/libc/gen 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 18:02:06 -0000 Author: pfg Date: Sun Feb 15 18:02:05 2015 New Revision: 278805 URL: https://svnweb.freebsd.org/changeset/base/278805 Log: Mismatch in r278804. Modified: head/lib/libc/gen/getgrent.c Modified: head/lib/libc/gen/getgrent.c ============================================================================== --- head/lib/libc/gen/getgrent.c Sun Feb 15 16:50:21 2015 (r278804) +++ head/lib/libc/gen/getgrent.c Sun Feb 15 18:02:05 2015 (r278805) @@ -1450,7 +1450,7 @@ docompat: pos = ftello(st->fp); } fin: - if (st->fp != NULL || !stayopen) { + if (st->fp != NULL && !stayopen) { fclose(st->fp); st->fp = NULL; } From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 19:01:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2C391FB; Sun, 15 Feb 2015 19:01:03 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E2E1A02; Sun, 15 Feb 2015 19:01:02 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1FJ10TV044897 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 15 Feb 2015 22:01:00 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1FJ10f2044896; Sun, 15 Feb 2015 22:01:00 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 15 Feb 2015 22:01:00 +0300 From: Gleb Smirnoff To: Craig Rodrigues Subject: Re: svn commit: r276747 - head/sys/netpfil/pf Message-ID: <20150215190100.GQ15484@FreeBSD.org> References: <201501060903.t06934qp081875@svn.freebsd.org> <20150122012709.GM15484@FreeBSD.org> <54C16715.6060701@gmx.com> <20150122222314.GO15484@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Nikos Vassiliadis , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 15 Feb 2015 19:01:03 -0000 Craig, On Sat, Feb 14, 2015 at 07:35:53PM -0800, Craig Rodrigues wrote: C> > On Thu, Jan 22, 2015 at 10:09:41PM +0100, Nikos Vassiliadis wrote: C> > N> > Sorry guys, I backed this out due to broken kldunload of pf module, C> > which C> > N> > is critical when you are working with pf bugs. C> > N> C> > N> For sure. 100% understood. C> > N> C> > N> > I had to backout r276746 as well, since it has numerous build C> > breakages, C> > N> > that are addressed by later revisions. C> > N> > C> > N> > That's my fault that I don't review in time, and I will try to improve C> > N> > the situation. C> > N> > C> > N> > Can you please replay r276746 again, addressing all the build problems C> > N> > and send the patch to me? You can user reviews.freebsd.org if you C> > want. C> > N> > C> > N> > I'd like to get this in, but in a better quality. C> > N> C> > N> I'd like to get involved again and help you fixing pf. Craig could you C> > N> replay 276746? C> C> I wish you could have fixed the pf unload problem without backing out C> all these changes. I took all these changes from your projects/pf branch, C> which was starting to bitrot because it was not being sync'd with head. C> C> I got confirmation from several people that the fixes as they were (after C> the build break fixes), C> actually fixed their issues with PF and VIMAGE, which have been pending for C> several C> years now with no visible progress made. C> C> Most regular users of PF don't really kldunload it once it is used. C> For development use, I've been testing inside bhyve VM's, which doesn't C> solve the kldunload problem but allows testing and forward progress. C> C> Why do you want me to replay 276746 and give you a patch? C> C> Why don't you just do it yourself? Because it is responsibility of the committer, who broke something, to fix it, not mine. Nevertheless, I tried to do that, and it took more than couple of hours, but I failed to untangle all the problems that r276746 brought and proceeded with checkout. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 19:03:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FB62371; Sun, 15 Feb 2015 19:03:12 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2491FA9A; Sun, 15 Feb 2015 19:03:11 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1FJ39CB044912 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 15 Feb 2015 22:03:09 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1FJ38lg044911; Sun, 15 Feb 2015 22:03:08 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 15 Feb 2015 22:03:08 +0300 From: Gleb Smirnoff To: Bruce Evans Subject: Re: svn commit: r278737 - head/usr.sbin/flowctl Message-ID: <20150215190308.GR15484@FreeBSD.org> References: <201502132357.t1DNvKda075915@svn.freebsd.org> <20150214193210.N945@besplex.bde.org> <20150214181508.GL15484@FreeBSD.org> <1423938828.80968.148.camel@freebsd.org> <54DFA7CC.20305@FreeBSD.org> <20150215162553.L977@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150215162553.L977@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , src-committers@freebsd.org, Ian Lepore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 15 Feb 2015 19:03:12 -0000 On Sun, Feb 15, 2015 at 05:53:11PM +1100, Bruce Evans wrote: B> This is not a problem B> for FreeBSD, since style(9) forbids placing declarations in inner B> blocks and no one would break that rule :-) Which is one of the worst rules from style(9), imho. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 19:48:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A6F0BFE; Sun, 15 Feb 2015 19:48:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 24FE4E56; Sun, 15 Feb 2015 19:48:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FJmVIH017076; Sun, 15 Feb 2015 19:48:31 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FJmUX6017072; Sun, 15 Feb 2015 19:48:30 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201502151948.t1FJmUX6017072@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 15 Feb 2015 19:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278806 - head/bin/sh/tests/expansion 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 19:48:31 -0000 Author: jilles Date: Sun Feb 15 19:48:29 2015 New Revision: 278806 URL: https://svnweb.freebsd.org/changeset/base/278806 Log: sh: Add simple tests for globbing/splitting command substitution. Added: head/bin/sh/tests/expansion/ifs5.0 (contents, props changed) head/bin/sh/tests/expansion/pathname5.0 (contents, props changed) Modified: head/bin/sh/tests/expansion/Makefile Modified: head/bin/sh/tests/expansion/Makefile ============================================================================== --- head/bin/sh/tests/expansion/Makefile Sun Feb 15 18:02:05 2015 (r278805) +++ head/bin/sh/tests/expansion/Makefile Sun Feb 15 19:48:29 2015 (r278806) @@ -48,6 +48,7 @@ FILES+= ifs1.0 FILES+= ifs2.0 FILES+= ifs3.0 FILES+= ifs4.0 +FILES+= ifs5.0 FILES+= length1.0 FILES+= length2.0 FILES+= length3.0 @@ -62,6 +63,7 @@ FILES+= pathname1.0 FILES+= pathname2.0 FILES+= pathname3.0 FILES+= pathname4.0 +FILES+= pathname5.0 FILES+= plus-minus1.0 FILES+= plus-minus2.0 FILES+= plus-minus3.0 Added: head/bin/sh/tests/expansion/ifs5.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/expansion/ifs5.0 Sun Feb 15 19:48:29 2015 (r278806) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +set -- $(echo a b c d) +[ "$#" = 4 ] Added: head/bin/sh/tests/expansion/pathname5.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/expansion/pathname5.0 Sun Feb 15 19:48:29 2015 (r278806) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +[ `echo '/[e]tc'` = /etc ] From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 19:56:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56AA5D8D; Sun, 15 Feb 2015 19:56:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3F672F0A; Sun, 15 Feb 2015 19:56:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FJuW70021537; Sun, 15 Feb 2015 19:56:32 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FJuVDR021535; Sun, 15 Feb 2015 19:56:31 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201502151956.t1FJuVDR021535@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 15 Feb 2015 19:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278807 - head/sys/contrib/dev/ath/ath_hal/ar9300 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 19:56:32 -0000 Author: adrian Date: Sun Feb 15 19:56:31 2015 New Revision: 278807 URL: https://svnweb.freebsd.org/changeset/base/278807 Log: Add ath_hal_setbeacontimers() to the AR9300 HAL. This is a custom FreeBSD HAL method that is used by the TDMA code to program the beacon timers directly without any guesswork/assumptions by the HAL. This brings up basic TDMA master/slave support on the AR9380 HAL, however there are other issues preventing it from being stable. (I'm seeing beacon interval instability, which may be due to busy 2GHz air, but also may be due to some HAL configuration issues with regards to ANI, or hardware timer programming, etc.) Tested: * AR9331 (Carambola2), STA, AP, adhoc and TDMA master mode. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_beacon.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_beacon.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_beacon.c Sun Feb 15 19:48:29 2015 (r278806) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_beacon.c Sun Feb 15 19:56:31 2015 (r278807) @@ -57,6 +57,9 @@ ar9300_beacon_init(struct ath_hal *ah, /* Add the fraction adjustment lost due to unit conversions. */ beacon_period_usec += beacon_period_fraction; + HALDEBUG(ah, HAL_DEBUG_BEACON, + "%s: next_beacon=0x%08x, beacon_period=%d, opmode=%d, beacon_period_usec=%d\n", + __func__, next_beacon, beacon_period, opmode, beacon_period_usec); OS_REG_WRITE(ah, AR_BEACON_PERIOD, beacon_period_usec); OS_REG_WRITE(ah, AR_DMA_BEACON_PERIOD, beacon_period_usec); Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Sun Feb 15 19:48:29 2015 (r278806) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Sun Feb 15 19:56:31 2015 (r278807) @@ -36,6 +36,9 @@ static HAL_BOOL ar9300ClrMulticastFilterIndex(struct ath_hal *ah, uint32_t ix); static HAL_BOOL ar9300SetMulticastFilterIndex(struct ath_hal *ah, uint32_t ix); +static void ar9300_beacon_set_beacon_timers(struct ath_hal *ah, + const HAL_BEACON_TIMERS *bt); + static void ar9300SetChainMasks(struct ath_hal *ah, uint32_t tx_chainmask, uint32_t rx_chainmask) @@ -193,10 +196,9 @@ ar9300_attach_freebsd_ops(struct ath_hal /* Beacon functions */ /* ah_setBeaconTimers */ ah->ah_beaconInit = ar9300_freebsd_beacon_init; - /* ah_setBeaconTimers */ + ah->ah_setBeaconTimers = ar9300_beacon_set_beacon_timers; ah->ah_setStationBeaconTimers = ar9300_set_sta_beacon_timers; /* ah_resetStationBeaconTimers */ - /* ah_getNextTBTT */ ah->ah_getNextTBTT = ar9300_get_next_tbtt; /* Interrupt functions */ @@ -669,6 +671,55 @@ ar9300SetMulticastFilterIndex(struct ath return (AH_TRUE); } +#define TU_TO_USEC(_tu) ((_tu) << 10) +#define ONE_EIGHTH_TU_TO_USEC(_tu8) ((_tu8) << 7) + +/* + * Initializes all of the hardware registers used to + * send beacons. Note that for station operation the + * driver calls ar9300_set_sta_beacon_timers instead. + */ +static void +ar9300_beacon_set_beacon_timers(struct ath_hal *ah, + const HAL_BEACON_TIMERS *bt) +{ + uint32_t bperiod; + +#if 0 + HALASSERT(opmode == HAL_M_IBSS || opmode == HAL_M_HOSTAP); + if (opmode == HAL_M_IBSS) { + OS_REG_SET_BIT(ah, AR_TXCFG, AR_TXCFG_ADHOC_BEACON_ATIM_TX_POLICY); + } +#endif + + /* XXX TODO: should migrate the HAL code to always use ONE_EIGHTH_TU */ + OS_REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(bt->bt_nexttbtt)); + OS_REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, ONE_EIGHTH_TU_TO_USEC(bt->bt_nextdba)); + OS_REG_WRITE(ah, AR_NEXT_SWBA, ONE_EIGHTH_TU_TO_USEC(bt->bt_nextswba)); + OS_REG_WRITE(ah, AR_NEXT_NDP_TIMER, TU_TO_USEC(bt->bt_nextatim)); + + bperiod = TU_TO_USEC(bt->bt_intval & HAL_BEACON_PERIOD); + /* XXX TODO! */ +// ahp->ah_beaconInterval = bt->bt_intval & HAL_BEACON_PERIOD; + OS_REG_WRITE(ah, AR_BEACON_PERIOD, bperiod); + OS_REG_WRITE(ah, AR_DMA_BEACON_PERIOD, bperiod); + OS_REG_WRITE(ah, AR_SWBA_PERIOD, bperiod); + OS_REG_WRITE(ah, AR_NDP_PERIOD, bperiod); + + /* + * Reset TSF if required. + */ + if (bt->bt_intval & HAL_BEACON_RESET_TSF) + ar9300_reset_tsf(ah); + + /* enable timers */ + /* NB: flags == 0 handled specially for backwards compatibility */ + OS_REG_SET_BIT(ah, AR_TIMER_MODE, + bt->bt_flags != 0 ? bt->bt_flags : + AR_TBTT_TIMER_EN | AR_DBA_TIMER_EN | AR_SWBA_TIMER_EN); +} + + /* * RF attach stubs */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 20:10:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCAB16D9; Sun, 15 Feb 2015 20:10:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8DBF991; Sun, 15 Feb 2015 20:10:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FKAshl028441; Sun, 15 Feb 2015 20:10:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FKAspg028440; Sun, 15 Feb 2015 20:10:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201502152010.t1FKAspg028440@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 15 Feb 2015 20:10:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278810 - head/usr.bin/timeout 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 20:10:54 -0000 Author: emaste Date: Sun Feb 15 20:10:53 2015 New Revision: 278810 URL: https://svnweb.freebsd.org/changeset/base/278810 Log: timeout: handle zombie grandchildren timeout previously collected only one child status with wait(2). If this was one of the grandchildren timeout would return to sigsuspend and wait until the timeout expired. Instead, loop for all children. PR: kern/197608 Reviewed by: bapt, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/timeout/timeout.c Modified: head/usr.bin/timeout/timeout.c ============================================================================== --- head/usr.bin/timeout/timeout.c Sun Feb 15 20:03:42 2015 (r278809) +++ head/usr.bin/timeout/timeout.c Sun Feb 15 20:10:53 2015 (r278810) @@ -172,6 +172,7 @@ main(int argc, char **argv) double second_kill; bool timedout = false; bool do_second_kill = false; + bool child_done = false; struct sigaction signals; struct procctl_reaper_status info; struct procctl_reaper_kill killemall; @@ -187,7 +188,6 @@ main(int argc, char **argv) foreground = preserve = 0; second_kill = 0; - cpid = -1; const struct option longopts[] = { { "preserve-status", no_argument, &preserve, 1 }, @@ -281,20 +281,26 @@ main(int argc, char **argv) if (sig_chld) { sig_chld = 0; - while (((cpid = wait(&status)) < 0) && errno == EINTR) - continue; - if (cpid == pid) { - pstat = status; - if (!foreground) - break; + while ((cpid = waitpid(-1, &status, WNOHANG)) != 0) { + if (cpid < 0) { + if (errno == EINTR) + continue; + else + break; + } else if (cpid == pid) { + pstat = status; + child_done = true; + } } - if (!foreground) { - procctl(P_PID, getpid(), PROC_REAP_STATUS, - &info); - if (info.rs_children == 0) { - cpid = pid; + if (child_done) { + if (foreground) { break; + } else { + procctl(P_PID, getpid(), + PROC_REAP_STATUS, &info); + if (info.rs_children == 0) + break; } } } else if (sig_alrm) { @@ -336,7 +342,7 @@ main(int argc, char **argv) } } - while (cpid != pid && wait(&pstat) == -1) { + while (!child_done && wait(&pstat) == -1) { if (errno != EINTR) err(EX_OSERR, "waitpid()"); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 21:03:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA37542E; Sun, 15 Feb 2015 21:03:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A4FF4882; Sun, 15 Feb 2015 21:03:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FL3oZb055151; Sun, 15 Feb 2015 21:03:50 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FL3o5v055150; Sun, 15 Feb 2015 21:03:50 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502152103.t1FL3o5v055150@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 Feb 2015 21:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278814 - head/lib/libc/gen 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 21:03:50 -0000 Author: pfg Date: Sun Feb 15 21:03:49 2015 New Revision: 278814 URL: https://svnweb.freebsd.org/changeset/base/278814 Log: Reverse one of the initializations from r278804. It does no harm but this is not needed after the correction in r278805 and I prefer to keep this code very similar to it's original state. Modified: head/lib/libc/gen/getgrent.c Modified: head/lib/libc/gen/getgrent.c ============================================================================== --- head/lib/libc/gen/getgrent.c Sun Feb 15 20:55:26 2015 (r278813) +++ head/lib/libc/gen/getgrent.c Sun Feb 15 21:03:49 2015 (r278814) @@ -1303,7 +1303,7 @@ compat_group(void *retval, void *mdata, void *discard; size_t bufsize, linesize; off_t pos; - int rv, stayopen = 0, *errnop; + int rv, stayopen, *errnop; #define set_lookup_type(x, y) do { \ int i; \ From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 21:11:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50E9469A; Sun, 15 Feb 2015 21:11:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3B724938; Sun, 15 Feb 2015 21:11:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FLB8gG059070; Sun, 15 Feb 2015 21:11:08 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FLB8MQ059069; Sun, 15 Feb 2015 21:11:08 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502152111.t1FLB8MQ059069@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 Feb 2015 21:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278815 - head/lib/libc/gen 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 21:11:08 -0000 Author: pfg Date: Sun Feb 15 21:11:07 2015 New Revision: 278815 URL: https://svnweb.freebsd.org/changeset/base/278815 Log: Replace strcpy() with strlcpy() The risk of an overrun here is very low but check the length, JIC. CID: 1019039 Modified: head/lib/libc/gen/fstab.c Modified: head/lib/libc/gen/fstab.c ============================================================================== --- head/lib/libc/gen/fstab.c Sun Feb 15 21:03:49 2015 (r278814) +++ head/lib/libc/gen/fstab.c Sun Feb 15 21:11:07 2015 (r278815) @@ -181,7 +181,7 @@ fstabscan(void) if (cp != NULL) _fs_fstab.fs_passno = atoi(cp); } - strcpy(subline, _fs_fstab.fs_mntops); + (void)strlcpy(subline, _fs_fstab.fs_mntops, sizeof(subline)); p = subline; for (typexx = 0, cp = strsep(&p, ","); cp; cp = strsep(&p, ",")) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 21:15:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C92D835; Sun, 15 Feb 2015 21:15:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6699395D; Sun, 15 Feb 2015 21:15:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FLFADC060309; Sun, 15 Feb 2015 21:15:10 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FLFABV060308; Sun, 15 Feb 2015 21:15:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201502152115.t1FLFABV060308@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 15 Feb 2015 21:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278816 - head/sys/contrib/dev/ath/ath_hal/ar9300 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 21:15:10 -0000 Author: adrian Date: Sun Feb 15 21:15:09 2015 New Revision: 278816 URL: https://svnweb.freebsd.org/changeset/base/278816 Log: Add initial support to the AR9300 HAL to support FreeBSD's intmit API. I don't like having it in this function; I may migrate it to ar9300_freebsd.c at some point to keep the HAL code pollution down. This allows ANI to be disabled via a sysctl. Tested: * AR9331, STA/TDMA modes Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Sun Feb 15 21:11:07 2015 (r278815) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Sun Feb 15 21:15:09 2015 (r278816) @@ -683,6 +683,7 @@ ar9300_get_capability(struct ath_hal *ah { struct ath_hal_9300 *ahp = AH9300(ah); const HAL_CAPABILITIES *p_cap = &AH_PRIVATE(ah)->ah_caps; + struct ar9300_ani_state *ani; switch (type) { case HAL_CAP_CIPHER: /* cipher handled in hardware */ @@ -911,6 +912,34 @@ ar9300_get_capability(struct ath_hal *ah return HAL_ENOTSUPP; } #endif + + /* FreeBSD ANI */ + case HAL_CAP_INTMIT: /* interference mitigation */ + switch (capability) { + case HAL_CAP_INTMIT_PRESENT: /* hardware capability */ + return HAL_OK; + case HAL_CAP_INTMIT_ENABLE: + return (ahp->ah_proc_phy_err & HAL_PROCESS_ANI) ? + HAL_OK : HAL_ENXIO; + case HAL_CAP_INTMIT_NOISE_IMMUNITY_LEVEL: + case HAL_CAP_INTMIT_OFDM_WEAK_SIGNAL_LEVEL: +// case HAL_CAP_INTMIT_CCK_WEAK_SIGNAL_THR: + case HAL_CAP_INTMIT_FIRSTEP_LEVEL: + case HAL_CAP_INTMIT_SPUR_IMMUNITY_LEVEL: + ani = ar9300_ani_get_current_state(ah); + if (ani == AH_NULL) + return HAL_ENXIO; + switch (capability) { + /* XXX AR9300 HAL has OFDM/CCK noise immunity level params? */ + case 2: *result = ani->ofdm_noise_immunity_level; break; + case 3: *result = !ani->ofdm_weak_sig_detect_off; break; + // case 4: *result = ani->cck_weak_sig_threshold; break; + case 5: *result = ani->firstep_level; break; + case 6: *result = ani->spur_immunity_level; break; + } + return HAL_OK; + } + return HAL_EINVAL; default: return ath_hal_getcapability(ah, type, capability, result); } @@ -986,6 +1015,27 @@ ar9300_set_capability(struct ath_hal *ah return AH_TRUE; } return AH_FALSE; + + /* FreeBSD interrupt mitigation / ANI */ + case HAL_CAP_INTMIT: { /* interference mitigation */ + /* This maps the public ANI commands to the internal ANI commands */ + /* Private: HAL_ANI_CMD; Public: HAL_CAP_INTMIT_CMD */ + static const HAL_ANI_CMD cmds[] = { + HAL_ANI_PRESENT, + HAL_ANI_MODE, + HAL_ANI_NOISE_IMMUNITY_LEVEL, + HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION, + HAL_ANI_CCK_WEAK_SIGNAL_THR, + HAL_ANI_FIRSTEP_LEVEL, + HAL_ANI_SPUR_IMMUNITY_LEVEL, + }; +#define N(a) (sizeof(a) / sizeof(a[0])) + return capability < N(cmds) ? + ar9300_ani_control(ah, cmds[capability], setting) : + AH_FALSE; +#undef N + } + case HAL_CAP_RXBUFSIZE: /* set MAC receive buffer size */ ahp->rx_buf_size = setting & AR_DATABUF_MASK; OS_REG_WRITE(ah, AR_DATABUF, ahp->rx_buf_size); From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 21:26:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EC29B37; Sun, 15 Feb 2015 21:26:22 +0000 (UTC) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com [209.85.215.49]) (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 E6F03A47; Sun, 15 Feb 2015 21:26:21 +0000 (UTC) Received: by labhs14 with SMTP id hs14so24607697lab.1; Sun, 15 Feb 2015 13:26:18 -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=uCl5NyVg8WZagQ24aOMk6DGkssbnzY509McMnz7WKRk=; b=RUa8aBkxUe/Rvk99IsQxkMkkIvebLhsLDE/6J8laNh398OyJVYKMoHbpiu30PlTlXO huBelTbpTOHRFNOl4oKymHWd4d1QzkMbXNpLUXnFESggxadxFIq0bA0xnKB+zzE6Fyfw F1/+huBWz+ds9lvJmuKoh5QOCOZD9Uub14tS79Lm6TziOOdUUVRXFgPC9eQwlvgIl5Fs U6au2S2OLyPQBuaF16UDnLxUmTY/7OWhUB/ZlMYW86NKuBg1ICBfPfAmZnWThQL/qU36 H972+D3tWXMomIq34phm7gLtglPIxPb2Tlj2dAusyWi+bhMrozzi1Wmx+RsDX/xXdfI0 y+dA== MIME-Version: 1.0 X-Received: by 10.112.137.38 with SMTP id qf6mr19043822lbb.59.1424035578631; Sun, 15 Feb 2015 13:26:18 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.28.40 with HTTP; Sun, 15 Feb 2015 13:26:18 -0800 (PST) In-Reply-To: <20150215190100.GQ15484@FreeBSD.org> References: <201501060903.t06934qp081875@svn.freebsd.org> <20150122012709.GM15484@FreeBSD.org> <54C16715.6060701@gmx.com> <20150122222314.GO15484@FreeBSD.org> <20150215190100.GQ15484@FreeBSD.org> Date: Sun, 15 Feb 2015 13:26:18 -0800 X-Google-Sender-Auth: FHLKL0r2UYtdQX5jIwpt0gCsP9s Message-ID: Subject: Re: svn commit: r276747 - head/sys/netpfil/pf From: Craig Rodrigues To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Nikos Vassiliadis , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 15 Feb 2015 21:26:22 -0000 On Sun, Feb 15, 2015 at 11:01 AM, Gleb Smirnoff wrote: > Craig, > > On Sat, Feb 14, 2015 at 07:35:53PM -0800, Craig Rodrigues wrote: > C> > On Thu, Jan 22, 2015 at 10:09:41PM +0100, Nikos Vassiliadis wrote: > C> > N> > Sorry guys, I backed this out due to broken kldunload of pf > module, > C> > which > C> > N> > is critical when you are working with pf bugs. > C> > N> > C> > N> For sure. 100% understood. > C> > N> > C> > N> > I had to backout r276746 as well, since it has numerous build > C> > breakages, > C> > N> > that are addressed by later revisions. > C> > N> > > C> > N> > That's my fault that I don't review in time, and I will try to > improve > C> > N> > the situation. > C> > N> > > C> > N> > Can you please replay r276746 again, addressing all the build > problems > C> > N> > and send the patch to me? You can user reviews.freebsd.org if > you > C> > want. > C> > N> > > C> > N> > I'd like to get this in, but in a better quality. > C> > N> > C> > N> I'd like to get involved again and help you fixing pf. Craig could > you > C> > N> replay 276746? > C> > C> I wish you could have fixed the pf unload problem without backing out > C> all these changes. I took all these changes from your projects/pf > branch, > C> which was starting to bitrot because it was not being sync'd with head. > C> > C> I got confirmation from several people that the fixes as they were > (after > C> the build break fixes), > C> actually fixed their issues with PF and VIMAGE, which have been pending > for > C> several > C> years now with no visible progress made. > C> > C> Most regular users of PF don't really kldunload it once it is used. > C> For development use, I've been testing inside bhyve VM's, which doesn't > C> solve the kldunload problem but allows testing and forward progress. > C> > C> Why do you want me to replay 276746 and give you a patch? > C> > C> Why don't you just do it yourself? > > Because it is responsibility of the committer, who broke something, to > fix it, not mine. > > Nevertheless, I tried to do that, and it took more than couple of hours, > but > I failed to untangle all the problems that r276746 brought and proceeded > with > checkout. > What are the problems in 276746 that you were unhappy with besides being unable to kldunload PF? With 276746, without the follow-on fixes, if you kldunload PF while VIMAGE is unabled, the kernel panics. That seems worse than being unable to kldunload PF. If I submit another patch, I am just going to commit it, but I don't know if you will be unhappy and revert it. -- Craig From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 21:28:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC51FD25; Sun, 15 Feb 2015 21:28:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9C732A59; Sun, 15 Feb 2015 21:28:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FLS175065507; Sun, 15 Feb 2015 21:28:01 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FLS1VY065506; Sun, 15 Feb 2015 21:28:01 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201502152128.t1FLS1VY065506@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 15 Feb 2015 21:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278817 - head/usr.bin/touch 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 21:28:01 -0000 Author: jilles Date: Sun Feb 15 21:28:00 2015 New Revision: 278817 URL: https://svnweb.freebsd.org/changeset/base/278817 Log: touch: Fix some subtle bugs related to NULL times fallback: * Do not subvert vfs.timestamp_precision by reading the time and passing that to utimensat(). Instead, pass UTIME_NOW. A fallback to a NULL times pointer is no longer used. * Do not ignore -a/-m if the user has write access but does not own the file. Leave timestamps unchanged using UTIME_OMIT and do not fall back to a NULL times pointer (which would set both timestamps) if that fails. Reviewed by: bde Modified: head/usr.bin/touch/touch.c Modified: head/usr.bin/touch/touch.c ============================================================================== --- head/usr.bin/touch/touch.c Sun Feb 15 21:15:09 2015 (r278816) +++ head/usr.bin/touch/touch.c Sun Feb 15 21:28:00 2015 (r278817) @@ -76,8 +76,8 @@ main(int argc, char *argv[]) myname = basename(argv[0]); Aflag = aflag = cflag = mflag = timeset = 0; atflag = 0; - if (clock_gettime(CLOCK_REALTIME, &ts[0]) == -1) - err(1, "clock_gettime(CLOCK_REALTIME)"); + ts[0].tv_sec = ts[1].tv_sec = 0; + ts[0].tv_nsec = ts[1].tv_nsec = UTIME_NOW; while ((ch = getopt(argc, argv, "A:acd:fhmr:t:")) != -1) switch(ch) { @@ -152,6 +152,11 @@ main(int argc, char *argv[]) ts[1] = ts[0]; } + if (!aflag) + ts[0].tv_nsec = UTIME_OMIT; + if (!mflag) + ts[1].tv_nsec = UTIME_OMIT; + if (*argv == NULL) usage(myname); @@ -183,11 +188,6 @@ main(int argc, char *argv[]) continue; } - if (!aflag) - ts[0] = sb.st_atim; - if (!mflag) - ts[1] = sb.st_mtim; - /* * We're adjusting the times based on the file times, not a * specified time (that gets handled above). @@ -203,26 +203,9 @@ main(int argc, char *argv[]) } } - /* Try utimensat(2). */ if (!utimensat(AT_FDCWD, *argv, ts, atflag)) continue; - /* If the user specified a time, nothing else we can do. */ - if (timeset || Aflag) { - rval = 1; - warn("%s", *argv); - continue; - } - - /* - * System V and POSIX 1003.1 require that a NULL argument - * set the access/modification times to the current time. - * The permission checks are different, too, in that the - * ability to write the file is sufficient. Take a shot. - */ - if (!utimensat(AT_FDCWD, *argv, NULL, atflag)) - continue; - rval = 1; warn("%s", *argv); } @@ -238,8 +221,8 @@ stime_arg1(const char *arg, struct times struct tm *t; int yearset; char *p; - /* Start with the current time. */ - now = tvp[0].tv_sec; + + now = time(NULL); if ((t = localtime(&now)) == NULL) err(1, "localtime"); /* [[CC]YY]MMDDhhmm[.SS] */ @@ -300,8 +283,8 @@ stime_arg2(const char *arg, int year, st { time_t now; struct tm *t; - /* Start with the current time. */ - now = tvp[0].tv_sec; + + now = time(NULL); if ((t = localtime(&now)) == NULL) err(1, "localtime"); From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 21:33:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D0B8F16; Sun, 15 Feb 2015 21:33:22 +0000 (UTC) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) (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 C6967B14; Sun, 15 Feb 2015 21:33:21 +0000 (UTC) Received: by labhs14 with SMTP id hs14so24622420lab.1; Sun, 15 Feb 2015 13:33:19 -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=UBTJc9tcGLoYgsDnsqClSaGM8N9R/fORUsk/lE+RvMA=; b=gebF1CYNy3/ANmA7KdtsxedgTunYYvKnoiPxCysBDa9MFHw+/jikXQwCEiW19M3gX4 pKTftH4xUHkgymB0LhW/isoirspa8s1f5ryBjQZISnxSXxvyLW7uQmae3xZ7s9DD7PP8 H8XuHqt+rTtcgtWMsr7s/b0tapWxS2xf1B39crNj1cZ4d7QwMvRpws2k/PwjiEcqGGNL vJUWRDV8mKNMpDdXWgDLSM0U5UzQbpOG442JdrHmyAG7iNfPHNR7AmMLZnwB+ZmMkJ69 DBWrOJ9FgIu6wBqXp4zo6Tgko1KgmMiNvF6IBN/sXTFrYYtZUla7dyHaIO8dC6d8Z3rZ l9aw== MIME-Version: 1.0 X-Received: by 10.152.184.39 with SMTP id er7mr17527292lac.116.1424035999536; Sun, 15 Feb 2015 13:33:19 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.28.40 with HTTP; Sun, 15 Feb 2015 13:33:19 -0800 (PST) In-Reply-To: References: <201501060903.t06934qp081875@svn.freebsd.org> <20150122012709.GM15484@FreeBSD.org> <54C16715.6060701@gmx.com> <20150122222314.GO15484@FreeBSD.org> <20150215190100.GQ15484@FreeBSD.org> Date: Sun, 15 Feb 2015 13:33:19 -0800 X-Google-Sender-Auth: FQhoexyZhL99l7qOcFs_-S0KYWE Message-ID: Subject: Re: svn commit: r276747 - head/sys/netpfil/pf From: Craig Rodrigues To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Nikos Vassiliadis , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 15 Feb 2015 21:33:22 -0000 On Sun, Feb 15, 2015 at 1:26 PM, Craig Rodrigues wrote: > On Sun, Feb 15, 2015 at 11:01 AM, Gleb Smirnoff > wrote: > >> Craig, >> >> On Sat, Feb 14, 2015 at 07:35:53PM -0800, Craig Rodrigues wrote: >> C> > On Thu, Jan 22, 2015 at 10:09:41PM +0100, Nikos Vassiliadis wrote: >> C> > N> > Sorry guys, I backed this out due to broken kldunload of pf >> module, >> C> > which >> C> > N> > is critical when you are working with pf bugs. >> C> > N> >> C> > N> For sure. 100% understood. >> C> > N> >> C> > N> > I had to backout r276746 as well, since it has numerous build >> C> > breakages, >> C> > N> > that are addressed by later revisions. >> C> > N> > >> C> > N> > That's my fault that I don't review in time, and I will try to >> improve >> C> > N> > the situation. >> C> > N> > >> C> > N> > Can you please replay r276746 again, addressing all the build >> problems >> C> > N> > and send the patch to me? You can user reviews.freebsd.org if >> you >> C> > want. >> C> > N> > >> C> > N> > I'd like to get this in, but in a better quality. >> C> > N> >> C> > N> I'd like to get involved again and help you fixing pf. Craig >> could you >> C> > N> replay 276746? >> C> >> C> I wish you could have fixed the pf unload problem without backing out >> C> all these changes. I took all these changes from your projects/pf >> branch, >> C> which was starting to bitrot because it was not being sync'd with head. >> C> >> C> I got confirmation from several people that the fixes as they were >> (after >> C> the build break fixes), >> C> actually fixed their issues with PF and VIMAGE, which have been >> pending for >> C> several >> C> years now with no visible progress made. >> C> >> C> Most regular users of PF don't really kldunload it once it is used. >> C> For development use, I've been testing inside bhyve VM's, which doesn't >> C> solve the kldunload problem but allows testing and forward progress. >> C> >> C> Why do you want me to replay 276746 and give you a patch? >> C> >> C> Why don't you just do it yourself? >> >> Because it is responsibility of the committer, who broke something, to >> fix it, not mine. >> >> Nevertheless, I tried to do that, and it took more than couple of hours, >> but >> I failed to untangle all the problems that r276746 brought and proceeded >> with >> checkout. >> > > > What are the problems in 276746 that you were unhappy with > besides being unable to kldunload PF? > > With 276746, without the follow-on fixes, if you kldunload PF > while VIMAGE is unabled, the kernel panics. That seems worse > than being unable to kldunload PF. > > If I submit another patch, I am just going to commit it, > but I don't know if you will be unhappy and revert it. > By the way, it would be helpful if you could provide feedback in Phabricator. When I created those Phabricator reviews, I added you as a reviewer to all of them, so you can't say that you didn't see the patches. You did not provide feedback on any of them: https://reviews.freebsd.org/D1309 https://reviews.freebsd.org/D1312 https://reviews.freebsd.org/D1313 https://reviews.freebsd.org/D1315 Please take some time to go and provide feedback in those reviews, so that a better patch can be made that makes you happy. -- Craig From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 21:41:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B4ED296; Sun, 15 Feb 2015 21:41:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 7AE39C1E; Sun, 15 Feb 2015 21:41:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FLfV1i073162; Sun, 15 Feb 2015 21:41:31 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FLfU3X073158; Sun, 15 Feb 2015 21:41:30 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201502152141.t1FLfU3X073158@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 15 Feb 2015 21:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278818 - 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 21:41:31 -0000 Author: jilles Date: Sun Feb 15 21:41:29 2015 New Revision: 278818 URL: https://svnweb.freebsd.org/changeset/base/278818 Log: sh: Add stsavestr(), like savestr() but allocates using stalloc(). Modified: head/bin/sh/cd.c head/bin/sh/expand.c head/bin/sh/memalloc.c head/bin/sh/memalloc.h Modified: head/bin/sh/cd.c ============================================================================== --- head/bin/sh/cd.c Sun Feb 15 21:28:00 2015 (r278817) +++ head/bin/sh/cd.c Sun Feb 15 21:41:29 2015 (r278818) @@ -182,7 +182,6 @@ cdlogical(char *dest) struct stat statb; int first; int badstat; - size_t len; /* * Check each component of the path. If we find a symlink or @@ -190,9 +189,7 @@ cdlogical(char *dest) * next time we get the value of the current directory. */ badstat = 0; - len = strlen(dest); - cdcomppath = stalloc(len + 1); - memcpy(cdcomppath, dest, len + 1); + cdcomppath = stsavestr(dest); STARTSTACKSTR(p); if (*dest == '/') { STPUTC('/', p); @@ -277,7 +274,6 @@ findcwd(char *dir) { char *new; char *p; - size_t len; /* * If our argument is NULL, we don't know the current directory @@ -286,9 +282,7 @@ findcwd(char *dir) */ if (dir == NULL || curdir == NULL) return getpwd2(); - len = strlen(dir); - cdcomppath = stalloc(len + 1); - memcpy(cdcomppath, dir, len + 1); + cdcomppath = stsavestr(dir); STARTSTACKSTR(new); if (*dir != '/') { STPUTS(curdir, new); Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun Feb 15 21:28:00 2015 (r278817) +++ head/bin/sh/expand.c Sun Feb 15 21:41:29 2015 (r278818) @@ -1284,11 +1284,8 @@ addfname(char *name) { char *p; struct strlist *sp; - size_t len; - len = strlen(name); - p = stalloc(len + 1); - memcpy(p, name, len + 1); + p = stsavestr(name); sp = (struct strlist *)stalloc(sizeof *sp); sp->text = p; *exparg.lastp = sp; Modified: head/bin/sh/memalloc.c ============================================================================== --- head/bin/sh/memalloc.c Sun Feb 15 21:28:00 2015 (r278817) +++ head/bin/sh/memalloc.c Sun Feb 15 21:41:29 2015 (r278818) @@ -180,6 +180,18 @@ stunalloc(pointer p) } +char * +stsavestr(const char *s) +{ + char *p; + size_t len; + + len = strlen(s); + p = stalloc(len + 1); + memcpy(p, s, len + 1); + return p; +} + void setstackmark(struct stackmark *mark) Modified: head/bin/sh/memalloc.h ============================================================================== --- head/bin/sh/memalloc.h Sun Feb 15 21:28:00 2015 (r278817) +++ head/bin/sh/memalloc.h Sun Feb 15 21:41:29 2015 (r278818) @@ -52,6 +52,7 @@ void ckfree(pointer); char *savestr(const char *); pointer stalloc(int); void stunalloc(pointer); +char *stsavestr(const char *); void setstackmark(struct stackmark *); void popstackmark(struct stackmark *); char *growstackstr(void); From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 21:42:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89C7D3CF; Sun, 15 Feb 2015 21:42:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 741EEC28; Sun, 15 Feb 2015 21:42:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FLgB5f074366; Sun, 15 Feb 2015 21:42:11 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FLgBmG074365; Sun, 15 Feb 2015 21:42:11 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201502152142.t1FLgBmG074365@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sun, 15 Feb 2015 21:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278819 - head/usr.sbin/pw/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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 21:42:11 -0000 Author: brd (doc committer) Date: Sun Feb 15 21:42:10 2015 New Revision: 278819 URL: https://svnweb.freebsd.org/changeset/base/278819 Log: Really fix the pw_usernext tests. PR: 197612 Approved by: will Modified: head/usr.sbin/pw/tests/pw_usernext.sh Modified: head/usr.sbin/pw/tests/pw_usernext.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_usernext.sh Sun Feb 15 21:41:29 2015 (r278818) +++ head/usr.sbin/pw/tests/pw_usernext.sh Sun Feb 15 21:42:10 2015 (r278819) @@ -8,14 +8,15 @@ atf_test_case usernext usernext_body() { populate_etc_skel - var0=1 - LIMIT=`jot -r 1 2 10` - while [ "$var0" -lt "$LIMIT" ] + CURRENT=`${PW} usernext | sed -e 's/:.*//'` + RANDOM=`jot -r 1 1 150` + MAX=`expr ${CURRENT} + ${RANDOM}` + while [ "${CURRENT}" -lt "${MAX}" ] do - atf_check -s exit:0 ${PW} useradd test$var0 - var0=`expr $var0 + 1` + atf_check -s exit:0 ${PW} useradd test${CURRENT} + CURRENT=`expr ${CURRENT} + 1` done - atf_check -s exit:0 -o match:"100${LIMIT}:100${LIMIT}" \ + atf_check -s exit:0 -o match:"${CURRENT}:${CURRENT}" \ ${PW} usernext } @@ -25,14 +26,16 @@ atf_test_case usernext_assigned_group usernext_assigned_group_body() { populate_etc_skel - var0=1 - LIMIT=`jot -r 1 2 10` - while [ "$var0" -lt "$LIMIT" ] + CURRENT=`${PW} usernext | sed -e 's/:.*//'` + CURRENTGID=`${PW} groupnext` + RANDOM=`jot -r 1 1 150` + MAX=`expr ${CURRENT} + ${RANDOM}` + while [ "${CURRENT}" -lt "${MAX}" ] do - atf_check -s exit:0 ${PW} useradd -n test$var0 -g 0 - var0=`expr $var0 + 1` + atf_check -s exit:0 ${PW} useradd -n test${CURRENT} -g 0 + CURRENT=`expr ${CURRENT} + 1` done - atf_check -s exit:0 -o match:"100${LIMIT}:1001" \ + atf_check -s exit:0 -o match:"${CURRENT}:${CURRENTGID}" \ ${PW} usernext } From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 21:47:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DCF8762; Sun, 15 Feb 2015 21:47:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 87A9BC5A; Sun, 15 Feb 2015 21:47:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FLlk2s075566; Sun, 15 Feb 2015 21:47:46 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FLliho075547; Sun, 15 Feb 2015 21:47:44 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201502152147.t1FLliho075547@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 15 Feb 2015 21:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278820 - 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 21:47:46 -0000 Author: jilles Date: Sun Feb 15 21:47:43 2015 New Revision: 278820 URL: https://svnweb.freebsd.org/changeset/base/278820 Log: sh: Prefer "" to nullstr where possible. Modified: head/bin/sh/cd.c head/bin/sh/eval.c head/bin/sh/expand.c head/bin/sh/mail.c head/bin/sh/miscbltin.c head/bin/sh/nodetypes head/bin/sh/parser.c head/bin/sh/var.c Modified: head/bin/sh/cd.c ============================================================================== --- head/bin/sh/cd.c Sun Feb 15 21:42:10 2015 (r278819) +++ head/bin/sh/cd.c Sun Feb 15 21:47:43 2015 (r278820) @@ -122,7 +122,7 @@ cdcmd(int argc __unused, char **argv __u (dest[0] == '.' && (dest[1] == '/' || dest[1] == '\0')) || (dest[0] == '.' && dest[1] == '.' && (dest[2] == '/' || dest[2] == '\0')) || (path = bltinlookup("CDPATH", 1)) == NULL) - path = nullstr; + path = ""; while ((p = padvance(&path, dest)) != NULL) { if (stat(p, &statb) < 0) { if (errno != ENOENT) Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Feb 15 21:42:10 2015 (r278819) +++ head/bin/sh/eval.c Sun Feb 15 21:47:43 2015 (r278820) @@ -498,7 +498,7 @@ exphere(union node *redir, struct arglis struct localvar *savelocalvars; int need_longjmp = 0; - redir->nhere.expdoc = nullstr; + redir->nhere.expdoc = ""; savelocalvars = localvars; localvars = NULL; forcelocal++; Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun Feb 15 21:42:10 2015 (r278819) +++ head/bin/sh/expand.c Sun Feb 15 21:47:43 2015 (r278820) @@ -530,8 +530,7 @@ subevalvar(char *p, char *str, int strlo error((char *)NULL); } error("%.*s: parameter %snot set", (int)(p - str - 1), - str, (varflags & VSNUL) ? "null or " - : nullstr); + str, (varflags & VSNUL) ? "null or " : ""); return 0; case VSTRIMLEFT: Modified: head/bin/sh/mail.c ============================================================================== --- head/bin/sh/mail.c Sun Feb 15 21:42:10 2015 (r278819) +++ head/bin/sh/mail.c Sun Feb 15 21:47:43 2015 (r278820) @@ -85,7 +85,7 @@ chkmail(int silent) setstackmark(&smark); mpath = mpathset()? mpathval() : mailval(); for (i = 0 ; i < nmboxes ; i++) { - p = padvance(&mpath, nullstr); + p = padvance(&mpath, ""); if (p == NULL) break; if (*p == '\0') Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Sun Feb 15 21:42:10 2015 (r278819) +++ head/bin/sh/miscbltin.c Sun Feb 15 21:47:43 2015 (r278820) @@ -265,7 +265,7 @@ readcmd(int argc __unused, char **argv _ /* Set any remaining args to "" */ while (*++ap != NULL) - setvar(*ap, nullstr, 0); + setvar(*ap, "", 0); return status; } Modified: head/bin/sh/nodetypes ============================================================================== --- head/bin/sh/nodetypes Sun Feb 15 21:42:10 2015 (r278819) +++ head/bin/sh/nodetypes Sun Feb 15 21:47:43 2015 (r278820) @@ -138,7 +138,7 @@ NXHERE nhere # fd<flags & VREADONLY) return (1); if (vp->text[vp->name_len + 1] != '\0') - setvar(s, nullstr, 0); + setvar(s, "", 0); if ((vp->flags & VEXPORT) && localevar(vp->text)) { change_env(s, 0); setlocale(LC_ALL, ""); From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 22:05:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38004DC9; Sun, 15 Feb 2015 22:05:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 07BCFDE9; Sun, 15 Feb 2015 22:05:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FM5Uti085069; Sun, 15 Feb 2015 22:05:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FM5UUu085067; Sun, 15 Feb 2015 22:05:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502152205.t1FM5UUu085067@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 15 Feb 2015 22:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278824 - head/sys/dev/usb/video 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 22:05:31 -0000 Author: hselasky Date: Sun Feb 15 22:05:30 2015 New Revision: 278824 URL: https://svnweb.freebsd.org/changeset/base/278824 Log: Bugfixes. Check if a framebuffer is present before using it. Dequeue element from correct head structure. No need to multiply framebuffer offset by two. It is already given in bytes. Modified: head/sys/dev/usb/video/udl.c Modified: head/sys/dev/usb/video/udl.c ============================================================================== --- head/sys/dev/usb/video/udl.c Sun Feb 15 21:59:05 2015 (r278823) +++ head/sys/dev/usb/video/udl.c Sun Feb 15 22:05:30 2015 (r278824) @@ -347,7 +347,7 @@ udl_attach(device_t dev) sc->sc_fb_info.fb_width = udl_get_fb_width(sc); sc->sc_fb_info.fb_height = udl_get_fb_height(sc); sc->sc_fb_info.fb_stride = sc->sc_fb_info.fb_width * 2; - sc->sc_fb_info.fb_pbase = (uintptr_t)sc->sc_fb_addr; + sc->sc_fb_info.fb_pbase = 0; sc->sc_fb_info.fb_vbase = (uintptr_t)sc->sc_fb_addr; sc->sc_fbdev = device_add_child(dev, "fbd", -1); @@ -475,6 +475,11 @@ udl_fb_synchronize(struct udl_softc *sc) { const uint32_t max = udl_get_fb_size(sc); + /* check if framebuffer is not ready */ + if (sc->sc_fb_addr == NULL || + sc->sc_fb_copy == NULL) + return (NULL); + while (sc->sc_sync_off < max) { uint32_t delta = max - sc->sc_sync_off; @@ -522,8 +527,9 @@ tr_setup: cb = udl_fb_synchronize(sc); if (cb == NULL) break; + } else { + TAILQ_REMOVE(&sc->sc_cmd_buf_pending, cb, entry); } - TAILQ_REMOVE(&sc->sc_cmd_buf_pending, cb, entry); TAILQ_INSERT_TAIL(phead, cb, entry); usbd_xfer_set_frame_data(xfer, i, cb->buf, cb->off); } @@ -1059,9 +1065,9 @@ udl_cmd_buf_copy_le16(struct udl_softc * udl_cmd_insert_int_1(cb, UDL_BULK_SOC); udl_cmd_insert_int_1(cb, UDL_BULK_CMD_FB_COPY | UDL_BULK_CMD_FB_WORD); - udl_cmd_insert_int_3(cb, 2 * dst); + udl_cmd_insert_int_3(cb, dst); udl_cmd_insert_int_1(cb, pixels); - udl_cmd_insert_int_3(cb, 2 * src); + udl_cmd_insert_int_3(cb, src); udl_cmd_buf_send(sc, cb); return (0); From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 22:06:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48E8EF03; Sun, 15 Feb 2015 22:06:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 329A4DF3; Sun, 15 Feb 2015 22:06:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FM6TOX085247; Sun, 15 Feb 2015 22:06:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FM6SYc085245; Sun, 15 Feb 2015 22:06:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502152206.t1FM6SYc085245@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 15 Feb 2015 22:06:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278825 - in head/sys/dev/usb: . video 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 22:06:29 -0000 Author: hselasky Date: Sun Feb 15 22:06:28 2015 New Revision: 278825 URL: https://svnweb.freebsd.org/changeset/base/278825 Log: Add new device ID. Modified: head/sys/dev/usb/usbdevs head/sys/dev/usb/video/udl.c Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Feb 15 22:05:30 2015 (r278824) +++ head/sys/dev/usb/usbdevs Sun Feb 15 22:06:28 2015 (r278825) @@ -1676,6 +1676,7 @@ product DISPLAYLINK LUM70 0x02a9 Lillipu product DISPLAYLINK UM7X0 0x401a nanovision MiMo product DISPLAYLINK LT1421 0x03e0 Lenovo ThinkVision LT1421 product DISPLAYLINK POLARIS2 0x0117 Polaris2 USB dock +product DISPLAYLINK PLUGABLE 0x0377 Plugable docking station /* DMI products */ product DMI CFSM_RW 0xa109 CF/SM Reader/Writer Modified: head/sys/dev/usb/video/udl.c ============================================================================== --- head/sys/dev/usb/video/udl.c Sun Feb 15 22:05:30 2015 (r278824) +++ head/sys/dev/usb/video/udl.c Sun Feb 15 22:06:28 2015 (r278825) @@ -169,6 +169,7 @@ static const STRUCT_USB_HOST_ID udl_devs {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_SWDVI, DLUNK)}, {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_UM7X0, DL120)}, {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_CONV, DL160)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_PLUGABLE, DL160)}, {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LUM70, DL125)}, {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_POLARIS2, DLUNK)}, {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LT1421, DLUNK)} From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 22:38:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B05884BE; Sun, 15 Feb 2015 22:38:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 99F1CC8; Sun, 15 Feb 2015 22:38:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FMc19T099710; Sun, 15 Feb 2015 22:38:01 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FMc17e099709; Sun, 15 Feb 2015 22:38:01 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201502152238.t1FMc17e099709@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 15 Feb 2015 22:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278826 - 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 22:38:01 -0000 Author: jilles Date: Sun Feb 15 22:38:00 2015 New Revision: 278826 URL: https://svnweb.freebsd.org/changeset/base/278826 Log: sh: Various cleanups to expand.c: * Remove some gotos. * Remove unused parameter. * Remove duplicate code. Modified: head/bin/sh/expand.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun Feb 15 22:06:28 2015 (r278825) +++ head/bin/sh/expand.c Sun Feb 15 22:38:00 2015 (r278826) @@ -105,11 +105,12 @@ static void expbackq(union node *, int, static int subevalvar(char *, char *, int, int, int, int, int); static char *evalvar(char *, int); static int varisset(const char *, int); +static void strtodest(const char *, int, int, int); static void varvalue(const char *, int, int, int); static void recordregion(int, int, int); static void removerecordregions(int); static void ifsbreakup(char *, struct arglist *); -static void expandmeta(struct strlist *, int); +static void expandmeta(struct strlist *); static void expmeta(char *, char *); static void addfname(char *); static struct strlist *expsort(struct strlist *); @@ -175,7 +176,7 @@ expandarg(union node *arg, struct arglis ifsbreakup(p, &exparg); *exparg.lastp = NULL; exparg.lastp = &exparg.list; - expandmeta(exparg.list, flag); + expandmeta(exparg.list); } else { sp = (struct strlist *)stalloc(sizeof (struct strlist)); sp->text = p; @@ -298,9 +299,9 @@ exptilde(char *p, int flag) char c, *startp = p; struct passwd *pw; char *home; - int quotes = flag & (EXP_FULL | EXP_CASE); - while ((c = *p) != '\0') { + for (;;) { + c = *p; switch(c) { case CTLESC: /* This means CTL* are always considered quoted. */ case CTLVAR: @@ -311,31 +312,27 @@ exptilde(char *p, int flag) case CTLQUOTEMARK: return (startp); case ':': - if (flag & EXP_VARTILDE) - goto done; - break; + if ((flag & EXP_VARTILDE) == 0) + break; + /* FALLTHROUGH */ + case '\0': case '/': case CTLENDVAR: - goto done; + *p = '\0'; + if (*(startp+1) == '\0') { + home = lookupvar("HOME"); + } else { + pw = getpwnam(startp+1); + home = pw != NULL ? pw->pw_dir : NULL; + } + *p = c; + if (home == NULL || *home == '\0') + return (startp); + strtodest(home, flag, VSNORMAL, 1); + return (p); } p++; } -done: - *p = '\0'; - if (*(startp+1) == '\0') { - home = lookupvar("HOME"); - } else { - pw = getpwnam(startp+1); - home = pw != NULL ? pw->pw_dir : NULL; - } - *p = c; - if (home == NULL || *home == '\0') - return (startp); - if (quotes) - STPUTS_QUOTES(home, DQSYNTAX, expdest); - else - STPUTS(home, expdest); - return (p); } @@ -496,6 +493,17 @@ expbackq(union node *cmd, int quoted, in +static void +recordleft(const char *str, const char *loc, char *startp) +{ + int amount; + + amount = ((str - 1) - (loc - startp)) - expdest; + STADJUST(amount, expdest); + while (loc != str - 1) + *startp++ = *loc++; +} + static int subevalvar(char *p, char *str, int strloc, int subtype, int startloc, int varflags, int quotes) @@ -539,7 +547,8 @@ subevalvar(char *p, char *str, int strlo *loc = '\0'; if (patmatch(str, startp, quotes)) { *loc = c; - goto recordleft; + recordleft(str, loc, startp); + return 1; } *loc = c; if (quotes && *loc == CTLESC) @@ -553,7 +562,8 @@ subevalvar(char *p, char *str, int strlo *loc = '\0'; if (patmatch(str, startp, quotes)) { *loc = c; - goto recordleft; + recordleft(str, loc, startp); + return 1; } *loc = c; loc--; @@ -601,13 +611,6 @@ subevalvar(char *p, char *str, int strlo default: abort(); } - -recordleft: - amount = ((str - 1) - (loc - startp)) - expdest; - STADJUST(amount, expdest); - while (loc != str - 1) - *startp++ = *loc++; - return 1; } @@ -632,6 +635,7 @@ evalvar(char *p, int flag) int varlenb; int easy; int quotes = flag & (EXP_FULL | EXP_CASE); + int record; varflags = (unsigned char)*p++; subtype = varflags & VSTYPE; @@ -689,22 +693,15 @@ again: /* jump here after setting a vari STADJUST(-varlenb, expdest); } } else { - char const *syntax = (varflags & VSQUOTE) ? DQSYNTAX - : BASESYNTAX; - if (subtype == VSLENGTH) { for (;*val; val++) if (!localeisutf8 || (*val & 0xC0) != 0x80) varlen++; } - else { - if (quotes) - STPUTS_QUOTES(val, syntax, expdest); - else - STPUTS(val, expdest); - - } + else + strtodest(val, flag, subtype, + varflags & VSQUOTE); } } @@ -718,15 +715,11 @@ again: /* jump here after setting a vari switch (subtype) { case VSLENGTH: expdest = cvtnum(varlen, expdest); - goto record; + record = 1; + break; case VSNORMAL: - if (!easy) - break; -record: - recordregion(startloc, expdest - stackblock(), - varflags & VSQUOTE || (ifsset() && ifsval()[0] == '\0' && - (*var == '@' || *var == '*'))); + record = easy; break; case VSPLUS: @@ -736,8 +729,7 @@ record: (varflags & VSQUOTE ? EXP_LIT_QUOTED : 0)); break; } - if (easy) - goto record; + record = easy; break; case VSTRIMLEFT: @@ -759,7 +751,8 @@ record: } /* Remove any recorded regions beyond start of variable */ removerecordregions(startloc); - goto record; + record = 1; + break; case VSASSIGN: case VSQUESTION: @@ -776,8 +769,7 @@ record: } break; } - if (easy) - goto record; + record = easy; break; case VSERROR: @@ -789,6 +781,11 @@ record: abort(); } + if (record) + recordregion(startloc, expdest - stackblock(), + varflags & VSQUOTE || (ifsset() && ifsval()[0] == '\0' && + (*var == '@' || *var == '*'))); + if (subtype != VSNORMAL) { /* skip to end of alternative */ int nesting = 1; for (;;) { @@ -1092,7 +1089,7 @@ static char expdir[PATH_MAX]; * The results are stored in the list exparg. */ static void -expandmeta(struct strlist *str, int flag __unused) +expandmeta(struct strlist *str) { char *p; struct strlist **savelastp; @@ -1474,16 +1471,14 @@ patmatch(const char *pattern, const char endp = p; if (*endp == '!' || *endp == '^') endp++; - for (;;) { + do { while (*endp == CTLQUOTEMARK) endp++; if (*endp == 0) goto dft; /* no matching ] */ if (*endp == CTLESC) endp++; - if (*++endp == ']') - break; - } + } while (*++endp != ']'); invert = 0; if (*p == '!' || *p == '^') { invert++; From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 23:58:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32024AF7; Sun, 15 Feb 2015 23:58:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1C96699D; Sun, 15 Feb 2015 23:58:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FNwvin036939; Sun, 15 Feb 2015 23:58:57 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FNwvXa036938; Sun, 15 Feb 2015 23:58:57 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201502152358.t1FNwvXa036938@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sun, 15 Feb 2015 23:58:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278827 - head/usr.sbin/binmiscctl 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.18-1 Precedence: list List-Id: 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, 15 Feb 2015 23:58:58 -0000 Author: sbruno Date: Sun Feb 15 23:58:57 2015 New Revision: 278827 URL: https://svnweb.freebsd.org/changeset/base/278827 Log: If no arguments are passed to a subcommand that requires arguments, error out before we deref a null pointer in the check for max length. Thanks to otis in IRC for the bug report. MFC after: 3 days Modified: head/usr.sbin/binmiscctl/binmiscctl.c Modified: head/usr.sbin/binmiscctl/binmiscctl.c ============================================================================== --- head/usr.sbin/binmiscctl/binmiscctl.c Sun Feb 15 22:38:00 2015 (r278826) +++ head/usr.sbin/binmiscctl/binmiscctl.c Sun Feb 15 23:58:57 2015 (r278827) @@ -371,8 +371,10 @@ add_cmd(__unused int argc, char *argv[], } int -name_cmd(__unused int argc, char *argv[], ximgact_binmisc_entry_t *xbe) +name_cmd(int argc, char *argv[], ximgact_binmisc_entry_t *xbe) { + if (argc == 0) + usage("Required argument missing\n"); if (strlen(argv[0]) > IBE_NAME_MAX) usage("'%s' string length longer than IBE_NAME_MAX (%d)", IBE_NAME_MAX); From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 01:12:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B330373E; Mon, 16 Feb 2015 01:12:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9DE5BA4; Mon, 16 Feb 2015 01:12:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G1CLFb074574; Mon, 16 Feb 2015 01:12:21 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G1CKd0074570; Mon, 16 Feb 2015 01:12:20 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502160112.t1G1CKd0074570@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 16 Feb 2015 01:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278828 - 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 01:12:21 -0000 Author: glebius Date: Mon Feb 16 01:12:20 2015 New Revision: 278828 URL: https://svnweb.freebsd.org/changeset/base/278828 Log: Factor out ip6_deletefraghdr() function, to be shared between IPv6 stack and pf(4). Submitted by: Kristof Provost Reviewed by: ae Differential Revision: D1764 Modified: head/sys/netinet6/frag6.c head/sys/netinet6/ip6_output.c head/sys/netinet6/ip6_var.h Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Sun Feb 15 23:58:57 2015 (r278827) +++ head/sys/netinet6/frag6.c Mon Feb 16 01:12:20 2015 (r278828) @@ -541,27 +541,16 @@ insert: *q6->ip6q_nxtp = (u_char)(nxt & 0xff); #endif - /* Delete frag6 header */ - if (m->m_len >= offset + sizeof(struct ip6_frag)) { - /* This is the only possible case with !PULLDOWN_TEST */ - ovbcopy((caddr_t)ip6, (caddr_t)ip6 + sizeof(struct ip6_frag), - offset); - m->m_data += sizeof(struct ip6_frag); - m->m_len -= sizeof(struct ip6_frag); - } else { - /* this comes with no copy if the boundary is on cluster */ - if ((t = m_split(m, offset, M_NOWAIT)) == NULL) { - frag6_remque(q6); - V_frag6_nfrags -= q6->ip6q_nfrag; + if (ip6_deletefraghdr(m, offset, M_NOWAIT) != 0) { + frag6_remque(q6); + V_frag6_nfrags -= q6->ip6q_nfrag; #ifdef MAC - mac_ip6q_destroy(q6); + mac_ip6q_destroy(q6); #endif - free(q6, M_FTABLE); - V_frag6_nfragpackets--; - goto dropfrag; - } - m_adj(t, sizeof(struct ip6_frag)); - m_cat(m, t); + free(q6, M_FTABLE); + V_frag6_nfragpackets--; + + goto dropfrag; } /* Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sun Feb 15 23:58:57 2015 (r278827) +++ head/sys/netinet6/ip6_output.c Mon Feb 16 01:12:20 2015 (r278828) @@ -1206,6 +1206,30 @@ ip6_insertfraghdr(struct mbuf *m0, struc return (0); } +int +ip6_deletefraghdr(struct mbuf *m, int offset, int wait) +{ + struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); + struct mbuf *t; + + /* Delete frag6 header. */ + if (m->m_len >= offset + sizeof(struct ip6_frag)) { + /* This is the only possible case with !PULLDOWN_TEST. */ + bcopy(ip6, (char *)ip6 + sizeof(struct ip6_frag), + offset); + m->m_data += sizeof(struct ip6_frag); + m->m_len -= sizeof(struct ip6_frag); + } else { + /* This comes with no copy if the boundary is on cluster. */ + if ((t = m_split(m, offset, wait)) == NULL) + return (ENOMEM); + m_adj(t, sizeof(struct ip6_frag)); + m_cat(m, t); + } + + return (0); +} + static int ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro, struct ifnet *ifp, struct in6_addr *dst, u_long *mtup, Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Sun Feb 15 23:58:57 2015 (r278827) +++ head/sys/netinet6/ip6_var.h Mon Feb 16 01:12:20 2015 (r278828) @@ -388,6 +388,7 @@ int ip6_setpktopts(struct mbuf *, struct void ip6_clearpktopts(struct ip6_pktopts *, int); struct ip6_pktopts *ip6_copypktopts(struct ip6_pktopts *, int); int ip6_optlen(struct inpcb *); +int ip6_deletefraghdr(struct mbuf *, int, int); int route6_input(struct mbuf **, int *, int); From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 01:24:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E8A48D2; Mon, 16 Feb 2015 01:24:15 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8187F16A; Mon, 16 Feb 2015 01:24:13 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1G1O9Y2047159 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 16 Feb 2015 04:24:09 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1G1O9BC047158; Mon, 16 Feb 2015 04:24:09 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 16 Feb 2015 04:24:09 +0300 From: Gleb Smirnoff To: Craig Rodrigues Subject: Re: svn commit: r276747 - head/sys/netpfil/pf Message-ID: <20150216012409.GZ15484@FreeBSD.org> References: <201501060903.t06934qp081875@svn.freebsd.org> <20150122012709.GM15484@FreeBSD.org> <54C16715.6060701@gmx.com> <20150122222314.GO15484@FreeBSD.org> <20150215190100.GQ15484@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Nikos Vassiliadis , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 01:24:15 -0000 On Sun, Feb 15, 2015 at 01:26:18PM -0800, Craig Rodrigues wrote: C> What are the problems in 276746 that you were unhappy with C> besides being unable to kldunload PF? They were listed in Message-ID: <20150121214445.GL15484@FreeBSD.org>. Also, the fact that commit required a serie of followup commits, means that initial commit was not tested properly. And did I ever said "being unable to kldunload PF"? This is what I said: > You blindly remove kproc_exit(). What do you think would happen on > 'kldunload -f pf'? If you can't grok that, you probably don't even understand the code you committed. Since what is going to happen is kernel panic. C> With 276746, without the follow-on fixes, if you kldunload PF C> while VIMAGE is unabled, the kernel panics. That seems worse C> than being unable to kldunload PF. So, without 276746 pf would panic with VIMAGE. And after 276747 pf would panic without VIMAGE. And yes, this is worse. Since backing out only 276747 leads to unbuildable kernel, I ended with backing out all chain of commits. C> If I submit another patch, I am just going to commit it, C> but I don't know if you will be unhappy and revert it. No, you will wait for review. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 01:25:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17B8CA13; Mon, 16 Feb 2015 01:25:31 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D444172; Mon, 16 Feb 2015 01:25:29 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1G1PSY7047175 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 16 Feb 2015 04:25:28 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1G1PS6a047174; Mon, 16 Feb 2015 04:25:28 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 16 Feb 2015 04:25:28 +0300 From: Gleb Smirnoff To: Craig Rodrigues Subject: Re: svn commit: r276747 - head/sys/netpfil/pf Message-ID: <20150216012528.GA15484@FreeBSD.org> References: <201501060903.t06934qp081875@svn.freebsd.org> <20150122012709.GM15484@FreeBSD.org> <54C16715.6060701@gmx.com> <20150122222314.GO15484@FreeBSD.org> <20150215190100.GQ15484@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Nikos Vassiliadis , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 01:25:31 -0000 On Sun, Feb 15, 2015 at 01:33:19PM -0800, Craig Rodrigues wrote: C> By the way, it would be helpful if you could provide feedback in C> Phabricator. When I created those Phabricator reviews, I added C> you as a reviewer to all of them, so you can't say that you didn't see C> the patches. C> You did not provide feedback on any of them: C> C> https://reviews.freebsd.org/D1309 C> https://reviews.freebsd.org/D1312 C> https://reviews.freebsd.org/D1313 C> https://reviews.freebsd.org/D1315 C> C> Please take some time to go and provide feedback in those C> reviews, so that a better patch can be made that makes you happy. Did you address all problems that arised after code was committed? Please do, otherwise my review would require me to cut-n-paste from my own emails. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 01:25:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25889B4E; Mon, 16 Feb 2015 01:25:50 +0000 (UTC) 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 BCE55176; Mon, 16 Feb 2015 01:25:49 +0000 (UTC) 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 6FD0125D3A8F; Mon, 16 Feb 2015 01:25:40 +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 A02A8C77045; Mon, 16 Feb 2015 01:25:39 +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 Qlkp5B-Jo7fJ; Mon, 16 Feb 2015 01:25:37 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:75b7:e357:a2dd:8cdb] (unknown [IPv6:fde9:577b:c1a9:4410:75b7:e357:a2dd:8cdb]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 3025CC77043; Mon, 16 Feb 2015 01:25:37 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278828 - head/sys/netinet6 From: "Bjoern A. Zeeb" In-Reply-To: <201502160112.t1G1CKd0074570@svn.freebsd.org> Date: Mon, 16 Feb 2015 01:25:05 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201502160112.t1G1CKd0074570@svn.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 01:25:50 -0000 > On 16 Feb 2015, at 01:12 , Gleb Smirnoff wrote: >=20 > Author: glebius > Date: Mon Feb 16 01:12:20 2015 > New Revision: 278828 > URL: https://svnweb.freebsd.org/changeset/base/278828 >=20 > Log: > Factor out ip6_deletefraghdr() function, to be shared between IPv6 > stack and pf(4). >=20 > Submitted by: Kristof Provost > Reviewed by: ae > Differential Revision: D1764 >=20 > Modified: > head/sys/netinet6/frag6.c > head/sys/netinet6/ip6_output.c Why did it have to move file? > head/sys/netinet6/ip6_var.h >=20 > Modified: head/sys/netinet6/frag6.c > = =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/sys/netinet6/frag6.c Sun Feb 15 23:58:57 2015 = (r278827) > +++ head/sys/netinet6/frag6.c Mon Feb 16 01:12:20 2015 = (r278828) > @@ -541,27 +541,16 @@ insert: > *q6->ip6q_nxtp =3D (u_char)(nxt & 0xff); > #endif >=20 > - /* Delete frag6 header */ > - if (m->m_len >=3D offset + sizeof(struct ip6_frag)) { > - /* This is the only possible case with !PULLDOWN_TEST */ > - ovbcopy((caddr_t)ip6, (caddr_t)ip6 + sizeof(struct = ip6_frag), > - offset); > - m->m_data +=3D sizeof(struct ip6_frag); > - m->m_len -=3D sizeof(struct ip6_frag); > - } else { > - /* this comes with no copy if the boundary is on cluster = */ > - if ((t =3D m_split(m, offset, M_NOWAIT)) =3D=3D NULL) { > - frag6_remque(q6); > - V_frag6_nfrags -=3D q6->ip6q_nfrag; > + if (ip6_deletefraghdr(m, offset, M_NOWAIT) !=3D 0) { > + frag6_remque(q6); > + V_frag6_nfrags -=3D q6->ip6q_nfrag; > #ifdef MAC > - mac_ip6q_destroy(q6); > + mac_ip6q_destroy(q6); > #endif > - free(q6, M_FTABLE); > - V_frag6_nfragpackets--; > - goto dropfrag; > - } > - m_adj(t, sizeof(struct ip6_frag)); > - m_cat(m, t); > + free(q6, M_FTABLE); > + V_frag6_nfragpackets--; > + > + goto dropfrag; > } >=20 > /* >=20 > Modified: head/sys/netinet6/ip6_output.c > = =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/sys/netinet6/ip6_output.c Sun Feb 15 23:58:57 2015 = (r278827) > +++ head/sys/netinet6/ip6_output.c Mon Feb 16 01:12:20 2015 = (r278828) > @@ -1206,6 +1206,30 @@ ip6_insertfraghdr(struct mbuf *m0, struc > return (0); > } >=20 > +int > +ip6_deletefraghdr(struct mbuf *m, int offset, int wait) > +{ > + struct ip6_hdr *ip6 =3D mtod(m, struct ip6_hdr *); > + struct mbuf *t; > + > + /* Delete frag6 header. */ > + if (m->m_len >=3D offset + sizeof(struct ip6_frag)) { > + /* This is the only possible case with !PULLDOWN_TEST. = */ > + bcopy(ip6, (char *)ip6 + sizeof(struct ip6_frag), > + offset); > + m->m_data +=3D sizeof(struct ip6_frag); > + m->m_len -=3D sizeof(struct ip6_frag); > + } else { > + /* This comes with no copy if the boundary is on = cluster. */ > + if ((t =3D m_split(m, offset, wait)) =3D=3D NULL) > + return (ENOMEM); > + m_adj(t, sizeof(struct ip6_frag)); > + m_cat(m, t); > + } > + > + return (0); > +} > + > static int > ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro, > struct ifnet *ifp, struct in6_addr *dst, u_long *mtup, >=20 > Modified: head/sys/netinet6/ip6_var.h > = =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/sys/netinet6/ip6_var.h Sun Feb 15 23:58:57 2015 = (r278827) > +++ head/sys/netinet6/ip6_var.h Mon Feb 16 01:12:20 2015 = (r278828) > @@ -388,6 +388,7 @@ int ip6_setpktopts(struct mbuf *, struct > void ip6_clearpktopts(struct ip6_pktopts *, int); > struct ip6_pktopts *ip6_copypktopts(struct ip6_pktopts *, int); > int ip6_optlen(struct inpcb *); > +int ip6_deletefraghdr(struct mbuf *, int, int); >=20 > int route6_input(struct mbuf **, int *, int); >=20 >=20 =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 01:30:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C23BE76; Mon, 16 Feb 2015 01:30:03 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 24A781AB; Mon, 16 Feb 2015 01:30:02 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1G1U0It047212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 16 Feb 2015 04:30:00 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1G1U0EJ047211; Mon, 16 Feb 2015 04:30:00 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 16 Feb 2015 04:30:00 +0300 From: Gleb Smirnoff To: "Bjoern A. Zeeb" Subject: Re: svn commit: r278828 - head/sys/netinet6 Message-ID: <20150216013000.GB15484@FreeBSD.org> References: <201502160112.t1G1CKd0074570@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 01:30:03 -0000 On Mon, Feb 16, 2015 at 01:25:05AM +0000, Bjoern A. Zeeb wrote: B> B> > On 16 Feb 2015, at 01:12 , Gleb Smirnoff wrote: B> > B> > Author: glebius B> > Date: Mon Feb 16 01:12:20 2015 B> > New Revision: 278828 B> > URL: https://svnweb.freebsd.org/changeset/base/278828 B> > B> > Log: B> > Factor out ip6_deletefraghdr() function, to be shared between IPv6 B> > stack and pf(4). B> > B> > Submitted by: Kristof Provost B> > Reviewed by: ae B> > Differential Revision: D1764 B> > B> > Modified: B> > head/sys/netinet6/frag6.c B> > head/sys/netinet6/ip6_output.c B> B> Why did it have to move file? Since it is related to fragment handling. Why not? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 01:34:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 253EF1AC; Mon, 16 Feb 2015 01:34:48 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (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 CC452271; Mon, 16 Feb 2015 01:34:47 +0000 (UTC) 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 5FC4F25D37C7; Mon, 16 Feb 2015 01:34:45 +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 41FC1C77043; Mon, 16 Feb 2015 01:34:44 +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 9dsx4Ss82Vth; Mon, 16 Feb 2015 01:34:43 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:75b7:e357:a2dd:8cdb] (unknown [IPv6:fde9:577b:c1a9:4410:75b7:e357:a2dd:8cdb]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 22F55C77042; Mon, 16 Feb 2015 01:34:41 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278828 - head/sys/netinet6 From: "Bjoern A. Zeeb" In-Reply-To: <20150216013000.GB15484@FreeBSD.org> Date: Mon, 16 Feb 2015 01:34:09 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <8750BD23-1384-4065-8368-C332F6683814@FreeBSD.org> References: <201502160112.t1G1CKd0074570@svn.freebsd.org> <20150216013000.GB15484@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 01:34:48 -0000 > On 16 Feb 2015, at 01:30 , Gleb Smirnoff wrote: >=20 > On Mon, Feb 16, 2015 at 01:25:05AM +0000, Bjoern A. Zeeb wrote: > B>=20 > B> > On 16 Feb 2015, at 01:12 , Gleb Smirnoff = wrote: > B> >=20 > B> > Author: glebius > B> > Date: Mon Feb 16 01:12:20 2015 > B> > New Revision: 278828 > B> > URL: https://svnweb.freebsd.org/changeset/base/278828 > B> >=20 > B> > Log: > B> > Factor out ip6_deletefraghdr() function, to be shared between = IPv6 > B> > stack and pf(4). > B> >=20 > B> > Submitted by: Kristof Provost > B> > Reviewed by: ae > B> > Differential Revision: D1764 > B> >=20 > B> > Modified: > B> > head/sys/netinet6/frag6.c > B> > head/sys/netinet6/ip6_output.c > B>=20 > B> Why did it have to move file? But the new function is in ip6_output and the consumer stays in frag6 = and will be in pf? So the new function moved to a different file = without consumer rather than just on top of the old function? Keep = code logically together seems to make more sense to me. What am I = missing?= From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 02:05:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 967978AD; Mon, 16 Feb 2015 02:05:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8202977E; Mon, 16 Feb 2015 02:05:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G25ZMp098296; Mon, 16 Feb 2015 02:05:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G25ZgP098295; Mon, 16 Feb 2015 02:05:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201502160205.t1G25ZgP098295@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 16 Feb 2015 02:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278829 - head/sys/mips/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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 02:05:35 -0000 Author: adrian Date: Mon Feb 16 02:05:34 2015 New Revision: 278829 URL: https://svnweb.freebsd.org/changeset/base/278829 Log: Remove this - I made it all work again a looong time ago. Modified: head/sys/mips/conf/AR71XX_BASE Modified: head/sys/mips/conf/AR71XX_BASE ============================================================================== --- head/sys/mips/conf/AR71XX_BASE Mon Feb 16 01:12:20 2015 (r278828) +++ head/sys/mips/conf/AR71XX_BASE Mon Feb 16 02:05:34 2015 (r278829) @@ -60,7 +60,6 @@ device ar71xx_pci options IEEE80211_DEBUG options IEEE80211_ALQ options IEEE80211_SUPPORT_MESH -# This option is currently broken for if_ath_tx. options IEEE80211_SUPPORT_TDMA options IEEE80211_AMPDU_AGE device wlan # 802.11 support From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 02:20:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0962CF6; Mon, 16 Feb 2015 02:20:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 AC32988C; Mon, 16 Feb 2015 02:20:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G2KC8N003779; Mon, 16 Feb 2015 02:20:12 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G2KCwN003778; Mon, 16 Feb 2015 02:20:12 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201502160220.t1G2KCwN003778@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Mon, 16 Feb 2015 02:20:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278830 - head/usr.sbin/devctl 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 02:20:12 -0000 Author: jmg Date: Mon Feb 16 02:20:11 2015 New Revision: 278830 URL: https://svnweb.freebsd.org/changeset/base/278830 Log: install the man page... Sponsored by: FreeBSD Foundation Modified: head/usr.sbin/devctl/Makefile Modified: head/usr.sbin/devctl/Makefile ============================================================================== --- head/usr.sbin/devctl/Makefile Mon Feb 16 02:05:34 2015 (r278829) +++ head/usr.sbin/devctl/Makefile Mon Feb 16 02:20:11 2015 (r278830) @@ -2,7 +2,6 @@ PROG= devctl MAN= devctl.8 -MAN= LIBADD= devctl From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 03:37:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A01B7BEC; Mon, 16 Feb 2015 03:37:00 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 24D609E; Mon, 16 Feb 2015 03:36:59 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1G3auQp047705 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 16 Feb 2015 06:36:56 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1G3autc047704; Mon, 16 Feb 2015 06:36:56 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 16 Feb 2015 06:36:56 +0300 From: Gleb Smirnoff To: "Bjoern A. Zeeb" Subject: Re: svn commit: r278828 - head/sys/netinet6 Message-ID: <20150216033656.GD15484@FreeBSD.org> References: <201502160112.t1G1CKd0074570@svn.freebsd.org> <20150216013000.GB15484@FreeBSD.org> <8750BD23-1384-4065-8368-C332F6683814@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8750BD23-1384-4065-8368-C332F6683814@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 03:37:00 -0000 On Mon, Feb 16, 2015 at 01:34:09AM +0000, Bjoern A. Zeeb wrote: B> B> > On 16 Feb 2015, at 01:30 , Gleb Smirnoff wrote: B> > B> > On Mon, Feb 16, 2015 at 01:25:05AM +0000, Bjoern A. Zeeb wrote: B> > B> B> > B> > On 16 Feb 2015, at 01:12 , Gleb Smirnoff wrote: B> > B> > B> > B> > Author: glebius B> > B> > Date: Mon Feb 16 01:12:20 2015 B> > B> > New Revision: 278828 B> > B> > URL: https://svnweb.freebsd.org/changeset/base/278828 B> > B> > B> > B> > Log: B> > B> > Factor out ip6_deletefraghdr() function, to be shared between IPv6 B> > B> > stack and pf(4). B> > B> > B> > B> > Submitted by: Kristof Provost B> > B> > Reviewed by: ae B> > B> > Differential Revision: D1764 B> > B> > B> > B> > Modified: B> > B> > head/sys/netinet6/frag6.c B> > B> > head/sys/netinet6/ip6_output.c B> > B> B> > B> Why did it have to move file? B> B> But the new function is in ip6_output and the consumer stays in frag6 and will be in pf? So the new function moved to a different file without consumer rather than just on top of the old function? Keep code logically together seems to make more sense to me. What am I missing? You are right. I somehow misread it as function being in frag6.c and consumer in ip6_output.c. Will fix. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 03:38:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8352ED52; Mon, 16 Feb 2015 03:38:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6D522A9; Mon, 16 Feb 2015 03:38:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G3cSPr042390; Mon, 16 Feb 2015 03:38:28 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G3cRlX042385; Mon, 16 Feb 2015 03:38:27 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502160338.t1G3cRlX042385@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 16 Feb 2015 03:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278831 - 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 03:38:28 -0000 Author: glebius Date: Mon Feb 16 03:38:27 2015 New Revision: 278831 URL: https://svnweb.freebsd.org/changeset/base/278831 Log: Update the pf fragment handling code to closer match recent OpenBSD. That partially fixes IPv6 fragment handling. Thanks to Kristof for working on that. Submitted by: Kristof Provost Tested by: peter Differential Revision: D1765 Modified: head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Mon Feb 16 02:20:11 2015 (r278830) +++ head/sys/netpfil/pf/pf.c Mon Feb 16 03:38:27 2015 (r278831) @@ -362,6 +362,45 @@ VNET_DEFINE(void *, pf_swi_cookie); VNET_DEFINE(uint32_t, pf_hashseed); #define V_pf_hashseed VNET(pf_hashseed) +int +pf_addr_cmp(struct pf_addr *a, struct pf_addr *b, sa_family_t af) +{ + + switch (af) { +#ifdef INET + case AF_INET: + if (a->addr32[0] > b->addr32[0]) + return (1); + if (a->addr32[0] < b->addr32[0]) + return (-1); + break; +#endif /* INET */ +#ifdef INET6 + case AF_INET6: + if (a->addr32[3] > b->addr32[3]) + return (1); + if (a->addr32[3] < b->addr32[3]) + return (-1); + if (a->addr32[2] > b->addr32[2]) + return (1); + if (a->addr32[2] < b->addr32[2]) + return (-1); + if (a->addr32[1] > b->addr32[1]) + return (1); + if (a->addr32[1] < b->addr32[1]) + return (-1); + if (a->addr32[0] > b->addr32[0]) + return (1); + if (a->addr32[0] < b->addr32[0]) + return (-1); + break; +#endif /* INET6 */ + default: + panic("%s: unknown address family %u", __func__, af); + } + return (0); +} + static __inline uint32_t pf_hashkey(struct pf_state_key *sk) { Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Mon Feb 16 02:20:11 2015 (r278830) +++ head/sys/netpfil/pf/pf_norm.c Mon Feb 16 03:38:27 2015 (r278831) @@ -1,5 +1,6 @@ /*- * Copyright 2001 Niels Provos + * Copyright 2011 Alexander Bluhm * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -57,38 +59,51 @@ __FBSDID("$FreeBSD$"); #endif /* INET6 */ struct pf_frent { - LIST_ENTRY(pf_frent) fr_next; - union { - struct { - struct ip *_fr_ip; - struct mbuf *_fr_m; - } _frag; - struct { - uint16_t _fr_off; - uint16_t _fr_end; - } _cache; - } _u; + TAILQ_ENTRY(pf_frent) fr_next; + struct mbuf *fe_m; + uint16_t fe_hdrlen; /* ipv4 header lenght with ip options + ipv6, extension, fragment header */ + uint16_t fe_extoff; /* last extension header offset or 0 */ + uint16_t fe_len; /* fragment length */ + uint16_t fe_off; /* fragment offset */ + uint16_t fe_mff; /* more fragment flag */ +}; + +struct pf_fragment_cmp { + struct pf_addr frc_src; + struct pf_addr frc_dst; + uint32_t frc_id; + sa_family_t frc_af; + uint8_t frc_proto; + uint8_t frc_direction; }; -#define fr_ip _u._frag._fr_ip -#define fr_m _u._frag._fr_m -#define fr_off _u._cache._fr_off -#define fr_end _u._cache._fr_end struct pf_fragment { + struct pf_fragment_cmp fr_key; +#define fr_src fr_key.frc_src +#define fr_dst fr_key.frc_dst +#define fr_id fr_key.frc_id +#define fr_af fr_key.frc_af +#define fr_proto fr_key.frc_proto +#define fr_direction fr_key.frc_direction + RB_ENTRY(pf_fragment) fr_entry; TAILQ_ENTRY(pf_fragment) frag_next; - struct in_addr fr_src; - struct in_addr fr_dst; - u_int8_t fr_p; /* protocol of this fragment */ - u_int8_t fr_flags; /* status flags */ -#define PFFRAG_SEENLAST 0x0001 /* Seen the last fragment for this */ -#define PFFRAG_NOBUFFER 0x0002 /* Non-buffering fragment cache */ -#define PFFRAG_DROP 0x0004 /* Drop all fragments */ + uint8_t fr_flags; /* status flags */ +#define PFFRAG_SEENLAST 0x0001 /* Seen the last fragment for this */ +#define PFFRAG_NOBUFFER 0x0002 /* Non-buffering fragment cache */ +#define PFFRAG_DROP 0x0004 /* Drop all fragments */ #define BUFFER_FRAGMENTS(fr) (!((fr)->fr_flags & PFFRAG_NOBUFFER)) - u_int16_t fr_id; /* fragment id for reassemble */ - u_int16_t fr_max; /* fragment data max */ - u_int32_t fr_timeout; - LIST_HEAD(, pf_frent) fr_queue; + uint16_t fr_max; /* fragment data max */ + uint32_t fr_timeout; + uint16_t fr_maxlen; /* maximum length of single fragment */ + TAILQ_HEAD(pf_fragq, pf_frent) fr_queue; +}; + +struct pf_fragment_tag { + uint16_t ft_hdrlen; /* header length of reassembled pkt */ + uint16_t ft_extoff; /* last extension header offset or 0 */ + uint16_t ft_maxlen; /* maximum fragment payload length */ }; static struct mtx pf_frag_mtx; @@ -125,15 +140,25 @@ static void pf_remove_fragment(struct static int pf_normalize_tcpopt(struct pf_rule *, struct mbuf *, struct tcphdr *, int, sa_family_t); #ifdef INET -static void pf_ip2key(struct pf_fragment *, struct ip *); static void pf_scrub_ip(struct mbuf **, u_int32_t, u_int8_t, u_int8_t); static void pf_flush_fragments(void); -static struct pf_fragment *pf_find_fragment(struct ip *, struct pf_frag_tree *); -static struct mbuf *pf_reassemble(struct mbuf **, struct pf_fragment **, - struct pf_frent *, int); +static struct pf_fragment *pf_find_fragment(struct pf_fragment_cmp *key, + struct pf_frag_tree *tree); +struct pf_frent *pf_create_fragment(u_short *); +static int pf_reassemble(struct mbuf **, struct ip *, int, + u_short *); +int pf_reassemble6(struct mbuf **, struct ip6_hdr *, + struct ip6_frag *, uint16_t, uint16_t, int, + u_short *); static struct mbuf *pf_fragcache(struct mbuf **, struct ip*, struct pf_fragment **, int, int, int *); +static struct pf_fragment *pf_fillup_fragment(struct pf_fragment_cmp *, + struct pf_frent *, u_short *); +int pf_isfull_fragment(struct pf_fragment *); +struct mbuf *pf_join_fragment(struct pf_fragment *); + + #endif /* INET */ #ifdef INET6 static void pf_scrub_ip6(struct mbuf **, u_int8_t); @@ -145,6 +170,18 @@ static void pf_scrub_ip6(struct mbuf * } \ } while(0) +static void +pf_ip2key(struct ip *ip, int dir, struct pf_fragment_cmp *key) +{ + + key->frc_src.v4 = ip->ip_src; + key->frc_dst.v4 = ip->ip_dst; + key->frc_af = AF_INET; + key->frc_proto = ip->ip_p; + key->frc_id = ip->ip_id; + key->frc_direction = dir; +} + void pf_normalize_init(void) { @@ -184,18 +221,16 @@ pf_frag_compare(struct pf_fragment *a, s { int diff; - if ((diff = a->fr_id - b->fr_id)) + if ((diff = a->fr_id - b->fr_id) != 0) return (diff); - else if ((diff = a->fr_p - b->fr_p)) + if ((diff = a->fr_proto - b->fr_proto) != 0) + return (diff); + if ((diff = a->fr_af - b->fr_af) != 0) + return (diff); + if ((diff = pf_addr_cmp(&a->fr_src, &b->fr_src, a->fr_af)) != 0) + return (diff); + if ((diff = pf_addr_cmp(&a->fr_dst, &b->fr_dst, a->fr_af)) != 0) return (diff); - else if (a->fr_src.s_addr < b->fr_src.s_addr) - return (-1); - else if (a->fr_src.s_addr > b->fr_src.s_addr) - return (1); - else if (a->fr_dst.s_addr < b->fr_dst.s_addr) - return (-1); - else if (a->fr_dst.s_addr > b->fr_dst.s_addr) - return (1); return (0); } @@ -270,23 +305,23 @@ pf_free_fragment(struct pf_fragment *fra /* Free all fragments */ if (BUFFER_FRAGMENTS(frag)) { - for (frent = LIST_FIRST(&frag->fr_queue); frent; - frent = LIST_FIRST(&frag->fr_queue)) { - LIST_REMOVE(frent, fr_next); + for (frent = TAILQ_FIRST(&frag->fr_queue); frent; + frent = TAILQ_FIRST(&frag->fr_queue)) { + TAILQ_REMOVE(&frag->fr_queue, frent, fr_next); - m_freem(frent->fr_m); + m_freem(frent->fe_m); uma_zfree(V_pf_frent_z, frent); } } else { - for (frent = LIST_FIRST(&frag->fr_queue); frent; - frent = LIST_FIRST(&frag->fr_queue)) { - LIST_REMOVE(frent, fr_next); - - KASSERT((LIST_EMPTY(&frag->fr_queue) || - LIST_FIRST(&frag->fr_queue)->fr_off > - frent->fr_end), - ("! (LIST_EMPTY() || LIST_FIRST()->fr_off >" - " frent->fr_end): %s", __func__)); + for (frent = TAILQ_FIRST(&frag->fr_queue); frent; + frent = TAILQ_FIRST(&frag->fr_queue)) { + TAILQ_REMOVE(&frag->fr_queue, frent, fr_next); + + KASSERT((TAILQ_EMPTY(&frag->fr_queue) || + TAILQ_FIRST(&frag->fr_queue)->fe_off > + frent->fe_len), + ("! (TAILQ_EMPTY() || TAILQ_FIRST()->fe_off >" + " frent->fe_len): %s", __func__)); uma_zfree(V_pf_frent_z, frent); } @@ -296,26 +331,14 @@ pf_free_fragment(struct pf_fragment *fra } #ifdef INET -static void -pf_ip2key(struct pf_fragment *key, struct ip *ip) -{ - key->fr_p = ip->ip_p; - key->fr_id = ip->ip_id; - key->fr_src.s_addr = ip->ip_src.s_addr; - key->fr_dst.s_addr = ip->ip_dst.s_addr; -} - static struct pf_fragment * -pf_find_fragment(struct ip *ip, struct pf_frag_tree *tree) +pf_find_fragment(struct pf_fragment_cmp *key, struct pf_frag_tree *tree) { - struct pf_fragment key; struct pf_fragment *frag; PF_FRAG_ASSERT(); - pf_ip2key(&key, ip); - - frag = RB_FIND(pf_frag_tree, tree, &key); + frag = RB_FIND(pf_frag_tree, tree, (struct pf_fragment *)key); if (frag != NULL) { /* XXX Are we sure we want to update the timeout? */ frag->fr_timeout = time_uptime; @@ -352,210 +375,412 @@ pf_remove_fragment(struct pf_fragment *f } #ifdef INET -#define FR_IP_OFF(fr) ((ntohs((fr)->fr_ip->ip_off) & IP_OFFMASK) << 3) -static struct mbuf * -pf_reassemble(struct mbuf **m0, struct pf_fragment **frag, - struct pf_frent *frent, int mff) +struct pf_frent * +pf_create_fragment(u_short *reason) { - struct mbuf *m = *m0, *m2; - struct pf_frent *frea, *next; - struct pf_frent *frep = NULL; - struct ip *ip = frent->fr_ip; - int hlen = ip->ip_hl << 2; - u_int16_t off = (ntohs(ip->ip_off) & IP_OFFMASK) << 3; - u_int16_t ip_len = ntohs(ip->ip_len) - ip->ip_hl * 4; - u_int16_t max = ip_len + off; + struct pf_frent *frent; PF_FRAG_ASSERT(); - KASSERT((*frag == NULL || BUFFER_FRAGMENTS(*frag)), - ("! (*frag == NULL || BUFFER_FRAGMENTS(*frag)): %s", __FUNCTION__)); - /* Strip off ip header */ - m->m_data += hlen; - m->m_len -= hlen; + frent = uma_zalloc(V_pf_frent_z, M_NOWAIT); + if (frent == NULL) { + pf_flush_fragments(); + frent = uma_zalloc(V_pf_frent_z, M_NOWAIT); + if (frent == NULL) { + REASON_SET(reason, PFRES_MEMORY); + return (NULL); + } + } + + return (frent); +} - /* Create a new reassembly queue for this packet */ - if (*frag == NULL) { - *frag = uma_zalloc(V_pf_frag_z, M_NOWAIT); - if (*frag == NULL) { +struct pf_fragment * +pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, + u_short *reason) +{ + struct pf_frent *after, *next, *prev; + struct pf_fragment *frag; + uint16_t total; + + PF_FRAG_ASSERT(); + + /* No empty fragments. */ + if (frent->fe_len == 0) { + DPFPRINTF(("bad fragment: len 0")); + goto bad_fragment; + } + + /* All fragments are 8 byte aligned. */ + if (frent->fe_mff && (frent->fe_len & 0x7)) { + DPFPRINTF(("bad fragment: mff and len %d", frent->fe_len)); + goto bad_fragment; + } + + /* Respect maximum length, IP_MAXPACKET == IPV6_MAXPACKET. */ + if (frent->fe_off + frent->fe_len > IP_MAXPACKET) { + DPFPRINTF(("bad fragment: max packet %d", + frent->fe_off + frent->fe_len)); + goto bad_fragment; + } + + DPFPRINTF((key->frc_af == AF_INET ? + "reass frag %d @ %d-%d" : "reass frag %#08x @ %d-%d", + key->frc_id, frent->fe_off, frent->fe_off + frent->fe_len)); + + /* Fully buffer all of the fragments in this fragment queue. */ + frag = pf_find_fragment(key, &V_pf_frag_tree); + + /* Create a new reassembly queue for this packet. */ + if (frag == NULL) { + frag = uma_zalloc(V_pf_frag_z, M_NOWAIT); + if (frag == NULL) { pf_flush_fragments(); - *frag = uma_zalloc(V_pf_frag_z, M_NOWAIT); - if (*frag == NULL) + frag = uma_zalloc(V_pf_frag_z, M_NOWAIT); + if (frag == NULL) { + REASON_SET(reason, PFRES_MEMORY); goto drop_fragment; + } } - (*frag)->fr_flags = 0; - (*frag)->fr_max = 0; - (*frag)->fr_src = frent->fr_ip->ip_src; - (*frag)->fr_dst = frent->fr_ip->ip_dst; - (*frag)->fr_p = frent->fr_ip->ip_p; - (*frag)->fr_id = frent->fr_ip->ip_id; - (*frag)->fr_timeout = time_uptime; - LIST_INIT(&(*frag)->fr_queue); + *(struct pf_fragment_cmp *)frag = *key; + frag->fr_timeout = time_second; + frag->fr_maxlen = frent->fe_len; + TAILQ_INIT(&frag->fr_queue); + + RB_INSERT(pf_frag_tree, &V_pf_frag_tree, frag); + TAILQ_INSERT_HEAD(&V_pf_fragqueue, frag, frag_next); - RB_INSERT(pf_frag_tree, &V_pf_frag_tree, *frag); - TAILQ_INSERT_HEAD(&V_pf_fragqueue, *frag, frag_next); + /* We do not have a previous fragment. */ + TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); - /* We do not have a previous fragment */ - frep = NULL; - goto insert; + return (frag); } - /* - * Find a fragment after the current one: - * - off contains the real shifted offset. - */ - LIST_FOREACH(frea, &(*frag)->fr_queue, fr_next) { - if (FR_IP_OFF(frea) > off) + KASSERT(!TAILQ_EMPTY(&frag->fr_queue), ("!TAILQ_EMPTY()->fr_queue")); + + /* Remember maximum fragment len for refragmentation. */ + if (frent->fe_len > frag->fr_maxlen) + frag->fr_maxlen = frent->fe_len; + + /* Maximum data we have seen already. */ + total = TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_off + + TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_len; + + /* Non terminal fragments must have more fragments flag. */ + if (frent->fe_off + frent->fe_len < total && !frent->fe_mff) + goto bad_fragment; + + /* Check if we saw the last fragment already. */ + if (!TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_mff) { + if (frent->fe_off + frent->fe_len > total || + (frent->fe_off + frent->fe_len == total && frent->fe_mff)) + goto bad_fragment; + } else { + if (frent->fe_off + frent->fe_len == total && !frent->fe_mff) + goto bad_fragment; + } + + /* Find a fragment after the current one. */ + prev = NULL; + TAILQ_FOREACH(after, &frag->fr_queue, fr_next) { + if (after->fe_off > frent->fe_off) break; - frep = frea; + prev = after; } - KASSERT((frep != NULL || frea != NULL), - ("!(frep != NULL || frea != NULL): %s", __FUNCTION__));; + KASSERT(prev != NULL || after != NULL, + ("prev != NULL || after != NULL")); - if (frep != NULL && - FR_IP_OFF(frep) + ntohs(frep->fr_ip->ip_len) - frep->fr_ip->ip_hl * - 4 > off) - { - u_int16_t precut; + if (prev != NULL && prev->fe_off + prev->fe_len > frent->fe_off) { + uint16_t precut; - precut = FR_IP_OFF(frep) + ntohs(frep->fr_ip->ip_len) - - frep->fr_ip->ip_hl * 4 - off; - if (precut >= ip_len) - goto drop_fragment; - m_adj(frent->fr_m, precut); - DPFPRINTF(("overlap -%d\n", precut)); - /* Enforce 8 byte boundaries */ - ip->ip_off = htons(ntohs(ip->ip_off) + (precut >> 3)); - off = (ntohs(ip->ip_off) & IP_OFFMASK) << 3; - ip_len -= precut; - ip->ip_len = htons(ip_len); - } - - for (; frea != NULL && ip_len + off > FR_IP_OFF(frea); - frea = next) - { - u_int16_t aftercut; - - aftercut = ip_len + off - FR_IP_OFF(frea); - DPFPRINTF(("adjust overlap %d\n", aftercut)); - if (aftercut < ntohs(frea->fr_ip->ip_len) - frea->fr_ip->ip_hl - * 4) - { - frea->fr_ip->ip_len = - htons(ntohs(frea->fr_ip->ip_len) - aftercut); - frea->fr_ip->ip_off = htons(ntohs(frea->fr_ip->ip_off) + - (aftercut >> 3)); - m_adj(frea->fr_m, aftercut); + precut = prev->fe_off + prev->fe_len - frent->fe_off; + if (precut >= frent->fe_len) + goto bad_fragment; + DPFPRINTF(("overlap -%d", precut)); + m_adj(frent->fe_m, precut); + frent->fe_off += precut; + frent->fe_len -= precut; + } + + for (; after != NULL && frent->fe_off + frent->fe_len > after->fe_off; + after = next) { + uint16_t aftercut; + + aftercut = frent->fe_off + frent->fe_len - after->fe_off; + DPFPRINTF(("adjust overlap %d", aftercut)); + if (aftercut < after->fe_len) { + m_adj(after->fe_m, aftercut); + after->fe_off += aftercut; + after->fe_len -= aftercut; break; } - /* This fragment is completely overlapped, lose it */ - next = LIST_NEXT(frea, fr_next); - m_freem(frea->fr_m); - LIST_REMOVE(frea, fr_next); - uma_zfree(V_pf_frent_z, frea); + /* This fragment is completely overlapped, lose it. */ + next = TAILQ_NEXT(after, fr_next); + m_freem(after->fe_m); + TAILQ_REMOVE(&frag->fr_queue, after, fr_next); + uma_zfree(V_pf_frent_z, after); } - insert: - /* Update maximum data size */ - if ((*frag)->fr_max < max) - (*frag)->fr_max = max; - /* This is the last segment */ - if (!mff) - (*frag)->fr_flags |= PFFRAG_SEENLAST; - - if (frep == NULL) - LIST_INSERT_HEAD(&(*frag)->fr_queue, frent, fr_next); + if (prev == NULL) + TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); else - LIST_INSERT_AFTER(frep, frent, fr_next); + TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next); + + return (frag); + +bad_fragment: + REASON_SET(reason, PFRES_FRAG); +drop_fragment: + uma_zfree(V_pf_frent_z, frent); + return (NULL); +} + +int +pf_isfull_fragment(struct pf_fragment *frag) +{ + struct pf_frent *frent, *next; + uint16_t off, total; /* Check if we are completely reassembled */ - if (!((*frag)->fr_flags & PFFRAG_SEENLAST)) - return (NULL); + if (TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_mff) + return (0); + + /* Maximum data we have seen already */ + total = TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_off + + TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_len; /* Check if we have all the data */ off = 0; - for (frep = LIST_FIRST(&(*frag)->fr_queue); frep; frep = next) { - next = LIST_NEXT(frep, fr_next); + for (frent = TAILQ_FIRST(&frag->fr_queue); frent; frent = next) { + next = TAILQ_NEXT(frent, fr_next); - off += ntohs(frep->fr_ip->ip_len) - frep->fr_ip->ip_hl * 4; - if (off < (*frag)->fr_max && - (next == NULL || FR_IP_OFF(next) != off)) - { - DPFPRINTF(("missing fragment at %d, next %d, max %d\n", - off, next == NULL ? -1 : FR_IP_OFF(next), - (*frag)->fr_max)); - return (NULL); + off += frent->fe_len; + if (off < total && (next == NULL || next->fe_off != off)) { + DPFPRINTF(("missing fragment at %d, next %d, total %d", + off, next == NULL ? -1 : next->fe_off, total)); + return (0); } } - DPFPRINTF(("%d < %d?\n", off, (*frag)->fr_max)); - if (off < (*frag)->fr_max) - return (NULL); + DPFPRINTF(("%d < %d?", off, total)); + if (off < total) + return (0); + KASSERT(off == total, ("off == total")); - /* We have all the data */ - frent = LIST_FIRST(&(*frag)->fr_queue); - KASSERT((frent != NULL), ("frent == NULL: %s", __FUNCTION__)); - if ((frent->fr_ip->ip_hl << 2) + off > IP_MAXPACKET) { - DPFPRINTF(("drop: too big: %d\n", off)); - pf_free_fragment(*frag); - *frag = NULL; - return (NULL); - } - next = LIST_NEXT(frent, fr_next); + return (1); +} - /* Magic from ip_input */ - ip = frent->fr_ip; - m = frent->fr_m; +struct mbuf * +pf_join_fragment(struct pf_fragment *frag) +{ + struct mbuf *m, *m2; + struct pf_frent *frent, *next; + + frent = TAILQ_FIRST(&frag->fr_queue); + next = TAILQ_NEXT(frent, fr_next); + + /* Magic from ip_input. */ + m = frent->fe_m; m2 = m->m_next; m->m_next = NULL; m_cat(m, m2); uma_zfree(V_pf_frent_z, frent); for (frent = next; frent != NULL; frent = next) { - next = LIST_NEXT(frent, fr_next); + next = TAILQ_NEXT(frent, fr_next); - m2 = frent->fr_m; + m2 = frent->fe_m; + /* Strip off ip header. */ + m_adj(m2, frent->fe_hdrlen); uma_zfree(V_pf_frent_z, frent); - m->m_pkthdr.csum_flags &= m2->m_pkthdr.csum_flags; - m->m_pkthdr.csum_data += m2->m_pkthdr.csum_data; m_cat(m, m2); } - while (m->m_pkthdr.csum_data & 0xffff0000) - m->m_pkthdr.csum_data = (m->m_pkthdr.csum_data & 0xffff) + - (m->m_pkthdr.csum_data >> 16); - ip->ip_src = (*frag)->fr_src; - ip->ip_dst = (*frag)->fr_dst; - - /* Remove from fragment queue */ - pf_remove_fragment(*frag); - *frag = NULL; - - hlen = ip->ip_hl << 2; - ip->ip_len = htons(off + hlen); - m->m_len += hlen; - m->m_data -= hlen; + /* Remove from fragment queue. */ + pf_remove_fragment(frag); + + return (m); +} + +#define FR_IP_OFF(fr) ((ntohs((fr)->fr_ip->ip_off) & IP_OFFMASK) << 3) +static int +pf_reassemble(struct mbuf **m0, struct ip *ip, int dir, u_short *reason) +{ + struct mbuf *m = *m0; + struct pf_frent *frent; + struct pf_fragment *frag; + struct pf_fragment_cmp key; + uint16_t total, hdrlen; + + /* Get an entry for the fragment queue */ + if ((frent = pf_create_fragment(reason)) == NULL) + return (PF_DROP); + + frent->fe_m = m; + frent->fe_hdrlen = ip->ip_hl << 2; + frent->fe_extoff = 0; + frent->fe_len = ntohs(ip->ip_len) - (ip->ip_hl << 2); + frent->fe_off = (ntohs(ip->ip_off) & IP_OFFMASK) << 3; + frent->fe_mff = ntohs(ip->ip_off) & IP_MF; + + pf_ip2key(ip, dir, &key); + + if ((frag = pf_fillup_fragment(&key, frent, reason)) == NULL) + return (PF_DROP); + + /* The mbuf is part of the fragment entry, no direct free or access */ + m = *m0 = NULL; + + if (!pf_isfull_fragment(frag)) + return (PF_PASS); /* drop because *m0 is NULL, no error */ + + /* We have all the data */ + frent = TAILQ_FIRST(&frag->fr_queue); + KASSERT(frent != NULL, ("frent != NULL")); + total = TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_off + + TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_len; + hdrlen = frent->fe_hdrlen; + + m = *m0 = pf_join_fragment(frag); + frag = NULL; - /* some debugging cruft by sklower, below, will go away soon */ - /* XXX this should be done elsewhere */ if (m->m_flags & M_PKTHDR) { int plen = 0; - for (m2 = m; m2; m2 = m2->m_next) - plen += m2->m_len; + for (m = *m0; m; m = m->m_next) + plen += m->m_len; + m = *m0; m->m_pkthdr.len = plen; } + ip = mtod(m, struct ip *); + ip->ip_len = htons(hdrlen + total); + ip->ip_off &= ~(IP_MF|IP_OFFMASK); + + if (hdrlen + total > IP_MAXPACKET) { + DPFPRINTF(("drop: too big: %d", total)); + ip->ip_len = 0; + REASON_SET(reason, PFRES_SHORT); + /* PF_DROP requires a valid mbuf *m0 in pf_test() */ + return (PF_DROP); + } + DPFPRINTF(("complete: %p(%d)\n", m, ntohs(ip->ip_len))); - return (m); + return (PF_PASS); +} - drop_fragment: - /* Oops - fail safe - drop packet */ - uma_zfree(V_pf_frent_z, frent); - m_freem(m); - return (NULL); +#ifdef INET6 +int +pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, struct ip6_frag *fraghdr, + uint16_t hdrlen, uint16_t extoff, int dir, u_short *reason) +{ + struct mbuf *m = *m0; + struct pf_frent *frent; + struct pf_fragment *frag; + struct pf_fragment_cmp key; + int off; + uint16_t total, maxlen; + uint8_t proto; + + PF_FRAG_LOCK(); + + /* Get an entry for the fragment queue. */ + if ((frent = pf_create_fragment(reason)) == NULL) { + PF_FRAG_UNLOCK(); + return (PF_DROP); + } + + frent->fe_m = m; + frent->fe_hdrlen = hdrlen; + frent->fe_extoff = extoff; + frent->fe_len = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen) - hdrlen; + frent->fe_off = ntohs(fraghdr->ip6f_offlg & IP6F_OFF_MASK); + frent->fe_mff = fraghdr->ip6f_offlg & IP6F_MORE_FRAG; + + key.frc_src.v6 = ip6->ip6_src; + key.frc_dst.v6 = ip6->ip6_dst; + key.frc_af = AF_INET6; + /* Only the first fragment's protocol is relevant. */ + key.frc_proto = 0; + key.frc_id = fraghdr->ip6f_ident; + key.frc_direction = dir; + + if ((frag = pf_fillup_fragment(&key, frent, reason)) == NULL) { + PF_FRAG_UNLOCK(); + return (PF_DROP); + } + + /* The mbuf is part of the fragment entry, no direct free or access. */ + m = *m0 = NULL; + + if (!pf_isfull_fragment(frag)) { + PF_FRAG_UNLOCK(); + return (PF_PASS); /* Drop because *m0 is NULL, no error. */ + } + + /* We have all the data. */ + extoff = frent->fe_extoff; + maxlen = frag->fr_maxlen; + frent = TAILQ_FIRST(&frag->fr_queue); + KASSERT(frent != NULL, ("frent != NULL")); + total = TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_off + + TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_len; + hdrlen = frent->fe_hdrlen - sizeof(struct ip6_frag); + + m = *m0 = pf_join_fragment(frag); + frag = NULL; + + PF_FRAG_UNLOCK(); + + /* Take protocol from first fragment header. */ + m = m_getptr(m, hdrlen + offsetof(struct ip6_frag, ip6f_nxt), &off); + KASSERT(m, ("%s: short mbuf chain", __func__)); + proto = *(mtod(m, caddr_t) + off); + m = *m0; + + /* Delete frag6 header */ + if (ip6_deletefraghdr(m, hdrlen, M_NOWAIT) != 0) + goto fail; + + if (m->m_flags & M_PKTHDR) { + int plen = 0; + for (m = *m0; m; m = m->m_next) + plen += m->m_len; + m = *m0; + m->m_pkthdr.len = plen; + } + + ip6 = mtod(m, struct ip6_hdr *); + ip6->ip6_plen = htons(hdrlen - sizeof(struct ip6_hdr) + total); + if (extoff) { + /* Write protocol into next field of last extension header. */ + m = m_getptr(m, extoff + offsetof(struct ip6_ext, ip6e_nxt), + &off); + KASSERT(m, ("%s: short mbuf chain", __func__)); + *(mtod(m, char *) + off) = proto; + m = *m0; + } else + ip6->ip6_nxt = proto; + + if (hdrlen - sizeof(struct ip6_hdr) + total > IPV6_MAXPACKET) { + DPFPRINTF(("drop: too big: %d", total)); + ip6->ip6_plen = 0; + REASON_SET(reason, PFRES_SHORT); + /* PF_DROP requires a valid mbuf *m0 in pf_test6(). */ + return (PF_DROP); + } + + DPFPRINTF(("complete: %p(%d)", m, ntohs(ip6->ip6_plen))); + return (PF_PASS); + +fail: + REASON_SET(reason, PFRES_MEMORY); + /* PF_DROP requires a valid mbuf *m0 in pf_test6(), will free later. */ + return (PF_DROP); } +#endif + static struct mbuf * pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff, int drop, int *nomem) @@ -591,16 +816,15 @@ pf_fragcache(struct mbuf **m0, struct ip (*frag)->fr_flags = PFFRAG_NOBUFFER; (*frag)->fr_max = 0; - (*frag)->fr_src = h->ip_src; - (*frag)->fr_dst = h->ip_dst; - (*frag)->fr_p = h->ip_p; + (*frag)->fr_src.v4 = h->ip_src; + (*frag)->fr_dst.v4 = h->ip_dst; (*frag)->fr_id = h->ip_id; (*frag)->fr_timeout = time_uptime; - cur->fr_off = off; - cur->fr_end = max; - LIST_INIT(&(*frag)->fr_queue); - LIST_INSERT_HEAD(&(*frag)->fr_queue, cur, fr_next); + cur->fe_off = off; + cur->fe_len = max; /* TODO: fe_len = max - off ? */ + TAILQ_INIT(&(*frag)->fr_queue); + TAILQ_INSERT_HEAD(&(*frag)->fr_queue, cur, fr_next); RB_INSERT(pf_frag_tree, &V_pf_cache_tree, *frag); TAILQ_INSERT_HEAD(&V_pf_cachequeue, *frag, frag_next); @@ -615,8 +839,8 @@ pf_fragcache(struct mbuf **m0, struct ip * - off contains the real shifted offset. */ frp = NULL; - LIST_FOREACH(fra, &(*frag)->fr_queue, fr_next) { - if (fra->fr_off > off) + TAILQ_FOREACH(fra, &(*frag)->fr_queue, fr_next) { + if (fra->fe_off > off) break; frp = fra; } @@ -627,18 +851,18 @@ pf_fragcache(struct mbuf **m0, struct ip if (frp != NULL) { int precut; - precut = frp->fr_end - off; + precut = frp->fe_len - off; if (precut >= ip_len) { /* Fragment is entirely a duplicate */ DPFPRINTF(("fragcache[%d]: dead (%d-%d) %d-%d\n", - h->ip_id, frp->fr_off, frp->fr_end, off, max)); + h->ip_id, frp->fe_off, frp->fe_len, off, max)); goto drop_fragment; } if (precut == 0) { /* They are adjacent. Fixup cache entry */ DPFPRINTF(("fragcache[%d]: adjacent (%d-%d) %d-%d\n", - h->ip_id, frp->fr_off, frp->fr_end, off, max)); - frp->fr_end = max; + h->ip_id, frp->fe_off, frp->fe_len, off, max)); + frp->fe_len = max; } else if (precut > 0) { /* The first part of this payload overlaps with a * fragment that has already been passed. @@ -648,13 +872,13 @@ pf_fragcache(struct mbuf **m0, struct ip */ DPFPRINTF(("fragcache[%d]: chop %d (%d-%d) %d-%d\n", - h->ip_id, precut, frp->fr_off, frp->fr_end, off, + h->ip_id, precut, frp->fe_off, frp->fe_len, off, max)); off += precut; max -= precut; /* Update the previous frag to encompass this one */ - frp->fr_end = max; + frp->fe_len = max; if (!drop) { /* XXX Optimization opportunity @@ -702,16 +926,16 @@ pf_fragcache(struct mbuf **m0, struct ip /* There is a gap between fragments */ DPFPRINTF(("fragcache[%d]: gap %d (%d-%d) %d-%d\n", - h->ip_id, -precut, frp->fr_off, frp->fr_end, off, + h->ip_id, -precut, frp->fe_off, frp->fe_len, off, max)); cur = uma_zalloc(V_pf_frent_z, M_NOWAIT); if (cur == NULL) goto no_mem; - cur->fr_off = off; - cur->fr_end = max; - LIST_INSERT_AFTER(frp, cur, fr_next); + cur->fe_off = off; + cur->fe_len = max; + TAILQ_INSERT_AFTER(&(*frag)->fr_queue, frp, cur, fr_next); } } @@ -719,19 +943,19 @@ pf_fragcache(struct mbuf **m0, struct ip int aftercut; int merge = 0; - aftercut = max - fra->fr_off; + aftercut = max - fra->fe_off; if (aftercut == 0) { /* Adjacent fragments */ DPFPRINTF(("fragcache[%d]: adjacent %d-%d (%d-%d)\n", - h->ip_id, off, max, fra->fr_off, fra->fr_end)); - fra->fr_off = off; + h->ip_id, off, max, fra->fe_off, fra->fe_len)); + fra->fe_off = off; merge = 1; } else if (aftercut > 0) { /* Need to chop off the tail of this fragment */ DPFPRINTF(("fragcache[%d]: chop %d %d-%d (%d-%d)\n", - h->ip_id, aftercut, off, max, fra->fr_off, - fra->fr_end)); - fra->fr_off = off; + h->ip_id, aftercut, off, max, fra->fe_off, + fra->fe_len)); + fra->fe_off = off; max -= aftercut; merge = 1; @@ -756,42 +980,42 @@ pf_fragcache(struct mbuf **m0, struct ip } else if (frp == NULL) { /* There is a gap between fragments */ DPFPRINTF(("fragcache[%d]: gap %d %d-%d (%d-%d)\n", - h->ip_id, -aftercut, off, max, fra->fr_off, - fra->fr_end)); + h->ip_id, -aftercut, off, max, fra->fe_off, + fra->fe_len)); cur = uma_zalloc(V_pf_frent_z, M_NOWAIT); if (cur == NULL) goto no_mem; - cur->fr_off = off; - cur->fr_end = max; - LIST_INSERT_BEFORE(fra, cur, fr_next); + cur->fe_off = off; + cur->fe_len = max; + TAILQ_INSERT_HEAD(&(*frag)->fr_queue, cur, fr_next); } /* Need to glue together two separate fragment descriptors */ if (merge) { - if (cur && fra->fr_off <= cur->fr_end) { + if (cur && fra->fe_off <= cur->fe_len) { /* Need to merge in a previous 'cur' */ DPFPRINTF(("fragcache[%d]: adjacent(merge " "%d-%d) %d-%d (%d-%d)\n", - h->ip_id, cur->fr_off, cur->fr_end, off, - max, fra->fr_off, fra->fr_end)); - fra->fr_off = cur->fr_off; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 05:58:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C846253E; Mon, 16 Feb 2015 05:58:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9997FF49; Mon, 16 Feb 2015 05:58:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G5wXSp012138; Mon, 16 Feb 2015 05:58:33 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G5wXpM012136; Mon, 16 Feb 2015 05:58:33 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502160558.t1G5wXpM012136@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 16 Feb 2015 05:58:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278832 - 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 05:58:33 -0000 Author: glebius Date: Mon Feb 16 05:58:32 2015 New Revision: 278832 URL: https://svnweb.freebsd.org/changeset/base/278832 Log: Move ip6_deletefraghdr() to frag6.c. Suggested by: bz Modified: head/sys/netinet6/frag6.c head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Mon Feb 16 03:38:27 2015 (r278831) +++ head/sys/netinet6/frag6.c Mon Feb 16 05:58:32 2015 (r278832) @@ -764,3 +764,27 @@ frag6_drain(void) IP6Q_UNLOCK(); VNET_LIST_RUNLOCK_NOSLEEP(); } + +int +ip6_deletefraghdr(struct mbuf *m, int offset, int wait) +{ + struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); + struct mbuf *t; + + /* Delete frag6 header. */ + if (m->m_len >= offset + sizeof(struct ip6_frag)) { + /* This is the only possible case with !PULLDOWN_TEST. */ + bcopy(ip6, (char *)ip6 + sizeof(struct ip6_frag), + offset); + m->m_data += sizeof(struct ip6_frag); + m->m_len -= sizeof(struct ip6_frag); + } else { + /* This comes with no copy if the boundary is on cluster. */ + if ((t = m_split(m, offset, wait)) == NULL) + return (ENOMEM); + m_adj(t, sizeof(struct ip6_frag)); + m_cat(m, t); + } + + return (0); +} Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Mon Feb 16 03:38:27 2015 (r278831) +++ head/sys/netinet6/ip6_output.c Mon Feb 16 05:58:32 2015 (r278832) @@ -1206,30 +1206,6 @@ ip6_insertfraghdr(struct mbuf *m0, struc return (0); } -int -ip6_deletefraghdr(struct mbuf *m, int offset, int wait) -{ - struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); - struct mbuf *t; - - /* Delete frag6 header. */ - if (m->m_len >= offset + sizeof(struct ip6_frag)) { - /* This is the only possible case with !PULLDOWN_TEST. */ - bcopy(ip6, (char *)ip6 + sizeof(struct ip6_frag), - offset); - m->m_data += sizeof(struct ip6_frag); - m->m_len -= sizeof(struct ip6_frag); - } else { - /* This comes with no copy if the boundary is on cluster. */ - if ((t = m_split(m, offset, wait)) == NULL) - return (ENOMEM); - m_adj(t, sizeof(struct ip6_frag)); - m_cat(m, t); - } - - return (0); -} - static int ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro, struct ifnet *ifp, struct in6_addr *dst, u_long *mtup, From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 06:00:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C67056B6; Mon, 16 Feb 2015 06:00:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B16E1FE3; Mon, 16 Feb 2015 06:00:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G60iiP012615; Mon, 16 Feb 2015 06:00:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G60iX9012614; Mon, 16 Feb 2015 06:00:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502160600.t1G60iX9012614@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 Feb 2015 06:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278833 - head/sys/dev/sfxge 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 06:00:44 -0000 Author: arybchik Date: Mon Feb 16 06:00:43 2015 New Revision: 278833 URL: https://svnweb.freebsd.org/changeset/base/278833 Log: sfxge: remove unused variable Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor), glebius Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Mon Feb 16 05:58:32 2015 (r278832) +++ head/sys/dev/sfxge/sfxge_tx.c Mon Feb 16 06:00:43 2015 (r278833) @@ -1280,7 +1280,6 @@ fail: void sfxge_tx_stop(struct sfxge_softc *sc) { - const efx_nic_cfg_t *encp; int index; index = SFXGE_TX_SCALE(sc); @@ -1289,7 +1288,6 @@ sfxge_tx_stop(struct sfxge_softc *sc) sfxge_tx_qstop(sc, SFXGE_TXQ_IP_CKSUM); - encp = efx_nic_cfg_get(sc->enp); sfxge_tx_qstop(sc, SFXGE_TXQ_NON_CKSUM); /* Tear down the transmit module */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 06:02:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F8B6871; Mon, 16 Feb 2015 06:02:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2B10229; Mon, 16 Feb 2015 06:02:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G62lMv016303; Mon, 16 Feb 2015 06:02:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G62l0x016302; Mon, 16 Feb 2015 06:02:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502160602.t1G62l0x016302@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 16 Feb 2015 06:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278834 - 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 06:02:47 -0000 Author: glebius Date: Mon Feb 16 06:02:46 2015 New Revision: 278834 URL: https://svnweb.freebsd.org/changeset/base/278834 Log: Missed from r278831. Modified: head/sys/net/pfvar.h Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Mon Feb 16 06:00:43 2015 (r278833) +++ head/sys/net/pfvar.h Mon Feb 16 06:02:46 2015 (r278834) @@ -1669,6 +1669,8 @@ int pfi_clear_flags(const char *, int) int pf_match_tag(struct mbuf *, struct pf_rule *, int *, int); int pf_tag_packet(struct mbuf *, struct pf_pdesc *, int); +int pf_addr_cmp(struct pf_addr *, struct pf_addr *, + sa_family_t); void pf_qid2qname(u_int32_t, char *); VNET_DECLARE(struct pf_kstatus, pf_status); From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 06:04:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA54E9EC; Mon, 16 Feb 2015 06:04:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9F0AF6B; Mon, 16 Feb 2015 06:04:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G64RAA016543; Mon, 16 Feb 2015 06:04:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G64R9f016542; Mon, 16 Feb 2015 06:04:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502160604.t1G64R9f016542@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 Feb 2015 06:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278835 - head/sys/dev/sfxge 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 06:04:27 -0000 Author: arybchik Date: Mon Feb 16 06:04:26 2015 New Revision: 278835 URL: https://svnweb.freebsd.org/changeset/base/278835 Log: sfxge: remove full_packet_size from sfxge_tso_state It makes sfxge_tso_state smaller and even makes tso_start_new_packet() few bytes smaller. Data used to calculate packet size are used nearby, so it should be no problems with cache etc. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor), glebius Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Mon Feb 16 06:02:46 2015 (r278834) +++ head/sys/dev/sfxge/sfxge_tx.c Mon Feb 16 06:04:26 2015 (r278835) @@ -792,8 +792,6 @@ struct sfxge_tso_state { ssize_t nh_off; /* Offset of network header */ ssize_t tcph_off; /* Offset of TCP header */ unsigned header_len; /* Number of bytes of header */ - int full_packet_size; /* Number of bytes to put in each outgoing - * segment */ }; static inline const struct ip *tso_iph(const struct sfxge_tso_state *tso) @@ -895,7 +893,6 @@ static void tso_start(struct sfxge_tso_s } tso->header_len = tso->tcph_off + 4 * tso_tcph(tso)->th_off; - tso->full_packet_size = tso->header_len + mbuf->m_pkthdr.tso_segsz; tso->seqnum = ntohl(tso_tcph(tso)->th_seq); @@ -1015,7 +1012,8 @@ static int tso_start_new_packet(struct s tso->seqnum += tso->mbuf->m_pkthdr.tso_segsz; if (tso->out_len > tso->mbuf->m_pkthdr.tso_segsz) { /* This packet will not finish the TSO burst. */ - ip_length = tso->full_packet_size - tso->nh_off; + ip_length = tso->header_len - tso->nh_off + + tso->mbuf->m_pkthdr.tso_segsz; tsoh_th->th_flags &= ~(TH_FIN | TH_PUSH); } else { /* This packet will be the last in the TSO burst. */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 06:07:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 440F9BD2; Mon, 16 Feb 2015 06:07:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2F6A8A0; Mon, 16 Feb 2015 06:07:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G672Q1016932; Mon, 16 Feb 2015 06:07:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G672LH016931; Mon, 16 Feb 2015 06:07:02 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502160607.t1G672LH016931@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 Feb 2015 06:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278836 - head/sys/dev/sfxge 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 06:07:02 -0000 Author: arybchik Date: Mon Feb 16 06:07:01 2015 New Revision: 278836 URL: https://svnweb.freebsd.org/changeset/base/278836 Log: sfxge: remove used sfxge_tso_state member dma_seg_i Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Mon Feb 16 06:04:26 2015 (r278835) +++ head/sys/dev/sfxge/sfxge_tx.c Mon Feb 16 06:07:01 2015 (r278836) @@ -783,7 +783,6 @@ struct sfxge_tso_state { unsigned packet_space; /* Remaining space in current packet */ /* Input position */ - unsigned dma_seg_i; /* Current DMA segment number */ uint64_t dma_addr; /* DMA address of current position */ unsigned in_len; /* Remaining length in current mbuf */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 06:08:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E778D84; Mon, 16 Feb 2015 06:08:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8986ABD; Mon, 16 Feb 2015 06:08:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G68ElV017125; Mon, 16 Feb 2015 06:08:14 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G68EwP017123; Mon, 16 Feb 2015 06:08:14 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502160608.t1G68EwP017123@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 Feb 2015 06:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278837 - head/sys/dev/sfxge 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 06:08:14 -0000 Author: arybchik Date: Mon Feb 16 06:08:13 2015 New Revision: 278837 URL: https://svnweb.freebsd.org/changeset/base/278837 Log: sfxge: remove inline specifiers Now compiler does not need any help. The patch does not change generated code. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor), glebius Modified: head/sys/dev/sfxge/sfxge_rx.c head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Mon Feb 16 06:07:01 2015 (r278836) +++ head/sys/dev/sfxge/sfxge_rx.c Mon Feb 16 06:08:13 2015 (r278837) @@ -92,8 +92,8 @@ static int lro_loss_packets = 20; #define SFXGE_LRO_CONN_IS_TCPIPV4(c) (!((c)->l2_id & SFXGE_LRO_L2_ID_IPV6)) /* Compare IPv6 addresses, avoiding conditional branches */ -static __inline unsigned long ipv6_addr_cmp(const struct in6_addr *left, - const struct in6_addr *right) +static unsigned long ipv6_addr_cmp(const struct in6_addr *left, + const struct in6_addr *right) { #if LONG_BIT == 64 const uint64_t *left64 = (const uint64_t *)left; @@ -167,7 +167,7 @@ sfxge_rx_schedule_refill(struct sfxge_rx sfxge_rx_post_refill, rxq); } -static inline struct mbuf *sfxge_rx_alloc_mbuf(struct sfxge_softc *sc) +static struct mbuf *sfxge_rx_alloc_mbuf(struct sfxge_softc *sc) { struct mb_args args; struct mbuf *m; Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Mon Feb 16 06:07:01 2015 (r278836) +++ head/sys/dev/sfxge/sfxge_tx.c Mon Feb 16 06:08:13 2015 (r278837) @@ -107,7 +107,7 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_p /* Forward declarations. */ -static inline void sfxge_tx_qdpl_service(struct sfxge_txq *txq); +static void sfxge_tx_qdpl_service(struct sfxge_txq *txq); static void sfxge_tx_qlist_post(struct sfxge_txq *txq); static void sfxge_tx_qunblock(struct sfxge_txq *txq); static int sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf, @@ -156,7 +156,7 @@ sfxge_tx_qcomplete(struct sfxge_txq *txq #ifdef SFXGE_HAVE_MQ -static inline unsigned int +static unsigned int sfxge_is_mbuf_non_tcp(struct mbuf *mbuf) { /* Absense of TCP checksum flags does not mean that it is non-TCP @@ -481,7 +481,7 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx * * NOTE: drops the txq mutex! */ -static inline void +static void sfxge_tx_qdpl_service(struct sfxge_txq *txq) { SFXGE_TXQ_LOCK_ASSERT_OWNED(txq); @@ -509,7 +509,7 @@ sfxge_tx_qdpl_service(struct sfxge_txq * * overload the csum_data field in the mbuf to keep track of this length * because there is no cheap alternative to avoid races. */ -static inline int +static int sfxge_tx_qdpl_put(struct sfxge_txq *txq, struct mbuf *mbuf, int locked) { struct sfxge_tx_dpl *stdp; @@ -758,7 +758,7 @@ void sfxge_if_start(struct ifnet *ifp) SFXGE_TXQ_UNLOCK(sc->txq[0]); } -static inline void +static void sfxge_tx_qdpl_service(struct sfxge_txq *txq) { struct ifnet *ifp = txq->sc->ifnet; @@ -793,19 +793,19 @@ struct sfxge_tso_state { unsigned header_len; /* Number of bytes of header */ }; -static inline const struct ip *tso_iph(const struct sfxge_tso_state *tso) +static const struct ip *tso_iph(const struct sfxge_tso_state *tso) { KASSERT(tso->protocol == htons(ETHERTYPE_IP), ("tso_iph() in non-IPv4 state")); return (const struct ip *)(tso->mbuf->m_data + tso->nh_off); } -static inline const struct ip6_hdr *tso_ip6h(const struct sfxge_tso_state *tso) +static __unused const struct ip6_hdr *tso_ip6h(const struct sfxge_tso_state *tso) { KASSERT(tso->protocol == htons(ETHERTYPE_IPV6), ("tso_ip6h() in non-IPv6 state")); return (const struct ip6_hdr *)(tso->mbuf->m_data + tso->nh_off); } -static inline const struct tcphdr *tso_tcph(const struct sfxge_tso_state *tso) +static const struct tcphdr *tso_tcph(const struct sfxge_tso_state *tso) { return (const struct tcphdr *)(tso->mbuf->m_data + tso->tcph_off); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 06:10:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84AB59A; Mon, 16 Feb 2015 06:10:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 704F8F0; Mon, 16 Feb 2015 06:10:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G6AIZH017481; Mon, 16 Feb 2015 06:10:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G6AIS4017480; Mon, 16 Feb 2015 06:10:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502160610.t1G6AIS4017480@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 Feb 2015 06:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278838 - head/sys/dev/sfxge 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 06:10:18 -0000 Author: arybchik Date: Mon Feb 16 06:10:17 2015 New Revision: 278838 URL: https://svnweb.freebsd.org/changeset/base/278838 Log: sfxge: SYSCTL_IN/OUT should not be called with non-sleepable lock held The problem is found using WITNESS option enabled. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/sfxge_port.c Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Mon Feb 16 06:08:13 2015 (r278837) +++ head/sys/dev/sfxge/sfxge_port.c Mon Feb 16 06:10:17 2015 (r278838) @@ -91,16 +91,15 @@ sfxge_mac_stat_handler(SYSCTL_HANDLER_AR struct sfxge_softc *sc = arg1; unsigned int id = arg2; int rc; + uint64_t val; SFXGE_PORT_LOCK(&sc->port); - if ((rc = sfxge_mac_stat_update(sc)) != 0) - goto out; - - rc = SYSCTL_OUT(req, - (uint64_t *)sc->port.mac_stats.decode_buf + id, - sizeof(uint64_t)); -out: + if ((rc = sfxge_mac_stat_update(sc)) == 0) + val = ((uint64_t *)sc->port.mac_stats.decode_buf)[id]; SFXGE_PORT_UNLOCK(&sc->port); + + if (rc == 0) + rc = SYSCTL_OUT(req, &val, sizeof(val)); return (rc); } @@ -173,28 +172,29 @@ sfxge_port_wanted_fc_handler(SYSCTL_HAND sc = arg1; port = &sc->port; - SFXGE_PORT_LOCK(port); - if (req->newptr != NULL) { if ((error = SYSCTL_IN(req, &fcntl, sizeof(fcntl))) != 0) - goto out; - - if (port->wanted_fc == fcntl) - goto out; + return (error); - port->wanted_fc = fcntl; + SFXGE_PORT_LOCK(port); - if (port->init_state != SFXGE_PORT_STARTED) - goto out; + if (port->wanted_fc != fcntl) { + if (port->init_state == SFXGE_PORT_STARTED) + error = efx_mac_fcntl_set(sc->enp, + port->wanted_fc, + B_TRUE); + if (error == 0) + port->wanted_fc = fcntl; + } - error = efx_mac_fcntl_set(sc->enp, port->wanted_fc, B_TRUE); + SFXGE_PORT_UNLOCK(port); } else { - error = SYSCTL_OUT(req, &port->wanted_fc, - sizeof(port->wanted_fc)); - } + SFXGE_PORT_LOCK(port); + fcntl = port->wanted_fc; + SFXGE_PORT_UNLOCK(port); -out: - SFXGE_PORT_UNLOCK(port); + error = SYSCTL_OUT(req, &fcntl, sizeof(fcntl)); + } return (error); } @@ -205,7 +205,6 @@ sfxge_port_link_fc_handler(SYSCTL_HANDLE struct sfxge_softc *sc; struct sfxge_port *port; unsigned int wanted_fc, link_fc; - int error; sc = arg1; port = &sc->port; @@ -215,10 +214,9 @@ sfxge_port_link_fc_handler(SYSCTL_HANDLE efx_mac_fcntl_get(sc->enp, &wanted_fc, &link_fc); else link_fc = 0; - error = SYSCTL_OUT(req, &link_fc, sizeof(link_fc)); SFXGE_PORT_UNLOCK(port); - return (error); + return (SYSCTL_OUT(req, &link_fc, sizeof(link_fc))); } #endif /* SFXGE_HAVE_PAUSE_MEDIAOPTS */ @@ -499,16 +497,15 @@ sfxge_phy_stat_handler(SYSCTL_HANDLER_AR struct sfxge_softc *sc = arg1; unsigned int id = arg2; int rc; + uint32_t val; SFXGE_PORT_LOCK(&sc->port); - if ((rc = sfxge_phy_stat_update(sc)) != 0) - goto out; - - rc = SYSCTL_OUT(req, - (uint32_t *)sc->port.phy_stats.decode_buf + id, - sizeof(uint32_t)); -out: + if ((rc = sfxge_phy_stat_update(sc)) == 0) + val = ((uint32_t *)sc->port.phy_stats.decode_buf)[id]; SFXGE_PORT_UNLOCK(&sc->port); + + if (rc == 0) + rc = SYSCTL_OUT(req, &val, sizeof(val)); return (rc); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 06:12:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA07028B; Mon, 16 Feb 2015 06:12:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9BB2E1A5; Mon, 16 Feb 2015 06:12:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G6C7f9021200; Mon, 16 Feb 2015 06:12:07 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G6C5Bv021182; Mon, 16 Feb 2015 06:12:05 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502160612.t1G6C5Bv021182@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 Feb 2015 06:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278839 - head/sys/dev/sfxge/common 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 06:12:07 -0000 Author: arybchik Date: Mon Feb 16 06:12:04 2015 New Revision: 278839 URL: https://svnweb.freebsd.org/changeset/base/278839 Log: sfxge: style fixes Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_mac.c head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/common/siena_mon.c head/sys/dev/sfxge/common/siena_nic.c head/sys/dev/sfxge/common/siena_vpd.c Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Mon Feb 16 06:10:17 2015 (r278838) +++ head/sys/dev/sfxge/common/efx_ev.c Mon Feb 16 06:12:04 2015 (r278839) @@ -89,7 +89,8 @@ efx_ev_rx_not_ok( if (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_TOBE_DISC) != 0) { EFX_EV_QSTAT_INCR(eep, EV_RX_TOBE_DISC); EFSYS_PROBE(tobe_disc); - /* Assume this is a unicast address mismatch, unless below + /* + * Assume this is a unicast address mismatch, unless below * we find either FSF_AZ_RX_EV_ETH_CRC_ERR or * EV_RX_PAUSE_FRM_ERR is set. */ @@ -102,7 +103,8 @@ efx_ev_rx_not_ok( (*flagsp) |= EFX_DISCARD; #if (EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER) - /* Lookout for payload queue ran dry errors and ignore them. + /* + * Lookout for payload queue ran dry errors and ignore them. * * Sadly for the header/data split cases, the descriptor * pointer in this event refers to the header queue and Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Mon Feb 16 06:10:17 2015 (r278838) +++ head/sys/dev/sfxge/common/efx_mac.c Mon Feb 16 06:12:04 2015 (r278839) @@ -669,11 +669,11 @@ chosen: EFSYS_ASSERT(emop != NULL); epp->ep_mac_type = type; - + if (emop->emo_reset != NULL) { if ((rc = emop->emo_reset(enp)) != 0) goto fail1; - + EFSYS_ASSERT(enp->en_reset_flags & EFX_RESET_MAC); enp->en_reset_flags &= ~EFX_RESET_MAC; } Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Mon Feb 16 06:10:17 2015 (r278838) +++ head/sys/dev/sfxge/common/efx_mcdi.c Mon Feb 16 06:12:04 2015 (r278839) @@ -44,7 +44,8 @@ __FBSDID("$FreeBSD$"); #define MCDI_P1_REBOOT_OFST 0x1fe #define MCDI_P2_REBOOT_OFST 0x1ff -/* A reboot/assertion causes the MCDI status word to be set after the +/* + * A reboot/assertion causes the MCDI status word to be set after the * command word is set or a REBOOT event is sent. If we notice a reboot * via these mechanisms then wait 10ms for the status word to be set. */ @@ -459,7 +460,8 @@ efx_mcdi_ev_death( ++emip->emi_aborted; } - /* Since we're running in parallel with a request, consume the + /* + * Since we're running in parallel with a request, consume the * status word before dropping the lock. */ if (rc == EIO || rc == EINTR) { Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Mon Feb 16 06:10:17 2015 (r278838) +++ head/sys/dev/sfxge/common/efx_nic.c Mon Feb 16 06:12:04 2015 (r278839) @@ -253,7 +253,8 @@ efx_nic_create( EFX_FEATURE_LFSR_HASH_INSERT | EFX_FEATURE_LINK_EVENTS | EFX_FEATURE_PERIODIC_MAC_STATS | EFX_FEATURE_WOL | EFX_FEATURE_MCDI | - EFX_FEATURE_LOOKAHEAD_SPLIT | EFX_FEATURE_MAC_HEADER_FILTERS; + EFX_FEATURE_LOOKAHEAD_SPLIT | + EFX_FEATURE_MAC_HEADER_FILTERS; break; #endif /* EFSYS_OPT_SIENA */ Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Mon Feb 16 06:10:17 2015 (r278838) +++ head/sys/dev/sfxge/common/efx_rx.c Mon Feb 16 06:12:04 2015 (r278839) @@ -527,7 +527,7 @@ efx_rx_filter_insert( EFSYS_ASSERT3P(spec, !=, NULL); spec->efs_dmaq_id = (uint16_t)erp->er_index; - return efx_filter_insert_filter(erp->er_enp, spec, B_FALSE); + return (efx_filter_insert_filter(erp->er_enp, spec, B_FALSE)); } #endif @@ -541,7 +541,7 @@ efx_rx_filter_remove( EFSYS_ASSERT3P(spec, !=, NULL); spec->efs_dmaq_id = (uint16_t)erp->er_index; - return efx_filter_remove_filter(erp->er_enp, spec); + return (efx_filter_remove_filter(erp->er_enp, spec)); } #endif @@ -673,7 +673,8 @@ efx_rx_qcreate( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); - EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << FRF_AZ_RX_DESCQ_LABEL_WIDTH)); + EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == + (1 << FRF_AZ_RX_DESCQ_LABEL_WIDTH)); EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS); EFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit); Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Mon Feb 16 06:10:17 2015 (r278838) +++ head/sys/dev/sfxge/common/efx_tx.c Mon Feb 16 06:12:04 2015 (r278839) @@ -114,7 +114,7 @@ efx_tx_filter_insert( EFSYS_ASSERT3P(spec, !=, NULL); spec->efs_dmaq_id = (uint16_t)etp->et_index; - return efx_filter_insert_filter(etp->et_enp, spec, B_FALSE); + return (efx_filter_insert_filter(etp->et_enp, spec, B_FALSE)); } #endif @@ -128,7 +128,7 @@ efx_tx_filter_remove( EFSYS_ASSERT3P(spec, !=, NULL); spec->efs_dmaq_id = (uint16_t)etp->et_index; - return efx_filter_remove_filter(etp->et_enp, spec); + return (efx_filter_remove_filter(etp->et_enp, spec)); } #endif Modified: head/sys/dev/sfxge/common/siena_mon.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mon.c Mon Feb 16 06:10:17 2015 (r278838) +++ head/sys/dev/sfxge/common/siena_mon.c Mon Feb 16 06:12:04 2015 (r278839) @@ -138,13 +138,13 @@ siena_mon_decode_stats( efx_dword_t dword; EFSYS_MEM_READD(esmp, 4 * mc_sensor, &dword); emsvp->emsv_value = - (uint16_t)EFX_DWORD_FIELD( - dword, - MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE); + (uint16_t)EFX_DWORD_FIELD( + dword, + MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE); emsvp->emsv_state = - (uint16_t)EFX_DWORD_FIELD( - dword, - MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE); + (uint16_t)EFX_DWORD_FIELD( + dword, + MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE); } } Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Mon Feb 16 06:10:17 2015 (r278838) +++ head/sys/dev/sfxge/common/siena_nic.c Mon Feb 16 06:12:04 2015 (r278839) @@ -324,7 +324,8 @@ siena_board_cfg( efx_mcdi_execute(enp, &req); if (req.emr_rc == 0) { - if (req.emr_out_length_used < MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN) { + if (req.emr_out_length_used < + MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN) { rc = EMSGSIZE; goto fail3; } Modified: head/sys/dev/sfxge/common/siena_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/siena_vpd.c Mon Feb 16 06:10:17 2015 (r278838) +++ head/sys/dev/sfxge/common/siena_vpd.c Mon Feb 16 06:12:04 2015 (r278839) @@ -541,11 +541,9 @@ siena_vpd_write( /* Copy in new vpd and update header */ vpd_offset = dcfg_size - vpd_length; - EFX_POPULATE_DWORD_1(dcfg->dynamic_vpd_offset, - EFX_DWORD_0, vpd_offset); + EFX_POPULATE_DWORD_1(dcfg->dynamic_vpd_offset, EFX_DWORD_0, vpd_offset); memcpy((caddr_t)dcfg + vpd_offset, data, vpd_length); - EFX_POPULATE_DWORD_1(dcfg->dynamic_vpd_length, - EFX_DWORD_0, vpd_length); + EFX_POPULATE_DWORD_1(dcfg->dynamic_vpd_length, EFX_DWORD_0, vpd_length); /* Update the checksum */ cksum = 0; From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 06:12:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DB4D3E2; Mon, 16 Feb 2015 06:12:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 88F1B1BA; Mon, 16 Feb 2015 06:12:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G6Cugq021327; Mon, 16 Feb 2015 06:12:56 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G6CuDa021326; Mon, 16 Feb 2015 06:12:56 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201502160612.t1G6CuDa021326@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Mon, 16 Feb 2015 06:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278840 - head/share/man/man4 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 06:12:56 -0000 Author: kevlo Date: Mon Feb 16 06:12:55 2015 New Revision: 278840 URL: https://svnweb.freebsd.org/changeset/base/278840 Log: Xref the following in wlan(4): - rsu(4) - urtwn(4) Modified: head/share/man/man4/wlan.4 Modified: head/share/man/man4/wlan.4 ============================================================================== --- head/share/man/man4/wlan.4 Mon Feb 16 06:12:04 2015 (r278839) +++ head/share/man/man4/wlan.4 Mon Feb 16 06:12:55 2015 (r278840) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 22, 2012 +.Dd February 16, 2015 .Dt WLAN 4 .Os .Sh NAME @@ -182,12 +182,14 @@ may not interoperate. .Xr mwl 4 , .Xr netintro 4 , .Xr ral 4 , +.Xr rsu 4 , .Xr rum 4 , .Xr run 4 , .Xr uath 4 , .Xr upgt 4 , .Xr ural 4 , .Xr urtw 4 , +.Xr urtwn 4 , .Xr wi 4 , .Xr wlan_acl 4 , .Xr wlan_ccmp 4 , From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 06:16:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8FFA66A; Mon, 16 Feb 2015 06:16:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B48621FA; Mon, 16 Feb 2015 06:16:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G6GdwT022036; Mon, 16 Feb 2015 06:16:39 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G6Gd02022035; Mon, 16 Feb 2015 06:16:39 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502160616.t1G6Gd02022035@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 Feb 2015 06:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278841 - head/sys/dev/sfxge 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 06:16:39 -0000 Author: arybchik Date: Mon Feb 16 06:16:38 2015 New Revision: 278841 URL: https://svnweb.freebsd.org/changeset/base/278841 Log: sfxge: flush all Tx queues from if_qflush Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor), glebius Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Mon Feb 16 06:12:55 2015 (r278840) +++ head/sys/dev/sfxge/sfxge_tx.c Mon Feb 16 06:16:38 2015 (r278841) @@ -649,7 +649,7 @@ sfxge_if_qflush(struct ifnet *ifp) sc = ifp->if_softc; - for (i = 0; i < SFXGE_TX_SCALE(sc); i++) + for (i = 0; i < SFXGE_TXQ_IP_TCP_UDP_CKSUM + SFXGE_TX_SCALE(sc); i++) sfxge_tx_qdpl_flush(sc->txq[i]); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 06:30:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F02F6B99; Mon, 16 Feb 2015 06:30:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D2D53346; Mon, 16 Feb 2015 06:30:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G6USQu028063; Mon, 16 Feb 2015 06:30:28 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G6USF5028061; Mon, 16 Feb 2015 06:30:28 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502160630.t1G6USF5028061@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 16 Feb 2015 06:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278842 - 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 06:30:29 -0000 Author: glebius Date: Mon Feb 16 06:30:27 2015 New Revision: 278842 URL: https://svnweb.freebsd.org/changeset/base/278842 Log: Factor out ip6_fragment() function, to be used in IPv6 stack and pf(4). Submitted by: Kristof Provost Differential Revision: D1766 Modified: head/sys/netinet6/ip6_output.c head/sys/netinet6/ip6_var.h Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Mon Feb 16 06:16:38 2015 (r278841) +++ head/sys/netinet6/ip6_output.c Mon Feb 16 06:30:27 2015 (r278842) @@ -212,6 +212,65 @@ in6_delayed_cksum(struct mbuf *m, uint32 *(u_short *)(m->m_data + offset) = csum; } +int +ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int hlen, u_char nextproto, + int mtu) +{ + struct mbuf *m, **mnext, *m_frgpart; + struct ip6_hdr *ip6, *mhip6; + struct ip6_frag *ip6f; + int off; + int error; + int tlen = m0->m_pkthdr.len; + uint32_t id = htonl(ip6_randomid()); + + m = m0; + ip6 = mtod(m, struct ip6_hdr *); + mnext = &m->m_nextpkt; + + for (off = hlen; off < tlen; off += mtu) { + m = m_gethdr(M_NOWAIT, MT_DATA); + if (!m) { + IP6STAT_INC(ip6s_odropped); + return (ENOBUFS); + } + m->m_flags = m0->m_flags & M_COPYFLAGS; + *mnext = m; + mnext = &m->m_nextpkt; + m->m_data += max_linkhdr; + mhip6 = mtod(m, struct ip6_hdr *); + *mhip6 = *ip6; + m->m_len = sizeof(*mhip6); + error = ip6_insertfraghdr(m0, m, hlen, &ip6f); + if (error) { + IP6STAT_INC(ip6s_odropped); + return (error); + } + ip6f->ip6f_offlg = htons((u_short)((off - hlen) & ~7)); + if (off + mtu >= tlen) + mtu = tlen - off; + else + ip6f->ip6f_offlg |= IP6F_MORE_FRAG; + mhip6->ip6_plen = htons((u_short)(mtu + hlen + + sizeof(*ip6f) - sizeof(struct ip6_hdr))); + if ((m_frgpart = m_copy(m0, off, mtu)) == 0) { + IP6STAT_INC(ip6s_odropped); + return (ENOBUFS); + } + m_cat(m, m_frgpart); + m->m_pkthdr.len = mtu + hlen + sizeof(*ip6f); + m->m_pkthdr.fibnum = m0->m_pkthdr.fibnum; + m->m_pkthdr.rcvif = NULL; + ip6f->ip6f_reserved = 0; + ip6f->ip6f_ident = id; + ip6f->ip6f_nxt = nextproto; + IP6STAT_INC(ip6s_ofragments); + in6_ifstat_inc(ifp, ifs6_out_fragcreat); + } + + return (0); +} + /* * IP6 output. The packet in mbuf chain m contains a skeletal IP6 * header (with pri, len, nxt, hlim, src, dst). @@ -236,11 +295,11 @@ ip6_output(struct mbuf *m0, struct ip6_p struct route_in6 *ro, int flags, struct ip6_moptions *im6o, struct ifnet **ifpp, struct inpcb *inp) { - struct ip6_hdr *ip6, *mhip6; + struct ip6_hdr *ip6; struct ifnet *ifp, *origifp; struct mbuf *m = m0; struct mbuf *mprev = NULL; - int hlen, tlen, len, off; + int hlen, tlen, len; struct route_in6 ip6route; struct rtentry *rt = NULL; struct sockaddr_in6 *dst, src_sa, dst_sa; @@ -901,9 +960,6 @@ passout: in6_ifstat_inc(ifp, ifs6_out_fragfail); goto bad; } else { - struct mbuf **mnext, *m_frgpart; - struct ip6_frag *ip6f; - u_int32_t id = htonl(ip6_randomid()); u_char nextproto; /* @@ -937,8 +993,6 @@ passout: m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; } #endif - mnext = &m->m_nextpkt; - /* * Change the next header field of the last header in the * unfragmentable part. @@ -963,47 +1017,8 @@ passout: * chain. */ m0 = m; - for (off = hlen; off < tlen; off += len) { - m = m_gethdr(M_NOWAIT, MT_DATA); - if (!m) { - error = ENOBUFS; - IP6STAT_INC(ip6s_odropped); - goto sendorfree; - } - m->m_flags = m0->m_flags & M_COPYFLAGS; - *mnext = m; - mnext = &m->m_nextpkt; - m->m_data += max_linkhdr; - mhip6 = mtod(m, struct ip6_hdr *); - *mhip6 = *ip6; - m->m_len = sizeof(*mhip6); - error = ip6_insertfraghdr(m0, m, hlen, &ip6f); - if (error) { - IP6STAT_INC(ip6s_odropped); - goto sendorfree; - } - ip6f->ip6f_offlg = htons((u_short)((off - hlen) & ~7)); - if (off + len >= tlen) - len = tlen - off; - else - ip6f->ip6f_offlg |= IP6F_MORE_FRAG; - mhip6->ip6_plen = htons((u_short)(len + hlen + - sizeof(*ip6f) - sizeof(struct ip6_hdr))); - if ((m_frgpart = m_copy(m0, off, len)) == 0) { - error = ENOBUFS; - IP6STAT_INC(ip6s_odropped); - goto sendorfree; - } - m_cat(m, m_frgpart); - m->m_pkthdr.len = len + hlen + sizeof(*ip6f); - m->m_pkthdr.fibnum = m0->m_pkthdr.fibnum; - m->m_pkthdr.rcvif = NULL; - ip6f->ip6f_reserved = 0; - ip6f->ip6f_ident = id; - ip6f->ip6f_nxt = nextproto; - IP6STAT_INC(ip6s_ofragments); - in6_ifstat_inc(ifp, ifs6_out_fragcreat); - } + if ((error = ip6_fragment(ifp, m, hlen, nextproto, len))) + goto sendorfree; in6_ifstat_inc(ifp, ifs6_out_fragok); } Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Mon Feb 16 06:16:38 2015 (r278841) +++ head/sys/netinet6/ip6_var.h Mon Feb 16 06:30:27 2015 (r278842) @@ -389,6 +389,7 @@ void ip6_clearpktopts(struct ip6_pktopts struct ip6_pktopts *ip6_copypktopts(struct ip6_pktopts *, int); int ip6_optlen(struct inpcb *); int ip6_deletefraghdr(struct mbuf *, int, int); +int ip6_fragment(struct ifnet *, struct mbuf *, int, u_char, int); int route6_input(struct mbuf **, int *, int); From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 07:01:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AEC58188; Mon, 16 Feb 2015 07:01:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8FB0B86F; Mon, 16 Feb 2015 07:01:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G714qi042199; Mon, 16 Feb 2015 07:01:04 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G713pW042194; Mon, 16 Feb 2015 07:01:03 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502160701.t1G713pW042194@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 16 Feb 2015 07:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278843 - 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 07:01:04 -0000 Author: glebius Date: Mon Feb 16 07:01:02 2015 New Revision: 278843 URL: https://svnweb.freebsd.org/changeset/base/278843 Log: In the forwarding case refragment the reassembled packets with the same size as they arrived in. This allows the sender to determine the optimal fragment size by Path MTU Discovery. Roughly based on the OpenBSD work by Alexander Bluhm. Submitted by: Kristof Provost Differential Revision: D1767 Modified: head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf.h head/sys/netpfil/pf/pf_mtag.h head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Mon Feb 16 06:30:27 2015 (r278842) +++ head/sys/netpfil/pf/pf.c Mon Feb 16 07:01:02 2015 (r278843) @@ -5499,7 +5499,7 @@ pf_route6(struct mbuf **m, struct pf_rul goto bad; if (oifp != ifp) { - if (pf_test6(PF_OUT, ifp, &m0, NULL) != PF_PASS) + if (pf_test6(PF_FWD, ifp, &m0, NULL) != PF_PASS) goto bad; else if (m0 == NULL) goto done; @@ -6057,15 +6057,20 @@ pf_test6(int dir, struct ifnet *ifp, str struct pfi_kif *kif; u_short action, reason = 0, log = 0; struct mbuf *m = *m0, *n = NULL; + struct m_tag *mtag; struct ip6_hdr *h = NULL; struct pf_rule *a = NULL, *r = &V_pf_default_rule, *tr, *nr; struct pf_state *s = NULL; struct pf_ruleset *ruleset = NULL; struct pf_pdesc pd; int off, terminal = 0, dirndx, rh_cnt = 0; + int fwdir = dir; M_ASSERTPKTHDR(m); + if (ifp != m->m_pkthdr.rcvif) + fwdir = PF_FWD; + if (!V_pf_status.running) return (PF_PASS); @@ -6427,6 +6432,11 @@ done: if (s) PF_STATE_UNLOCK(s); + /* If reassembled packet passed, create new fragments. */ + if (action == PF_PASS && *m0 && fwdir == PF_FWD && + (mtag = m_tag_find(m, PF_REASSEMBLED, NULL)) != NULL) + action = pf_refragment6(ifp, m0, mtag); + return (action); } #endif /* INET6 */ Modified: head/sys/netpfil/pf/pf.h ============================================================================== --- head/sys/netpfil/pf/pf.h Mon Feb 16 06:30:27 2015 (r278842) +++ head/sys/netpfil/pf/pf.h Mon Feb 16 07:01:02 2015 (r278843) @@ -43,7 +43,7 @@ #endif #endif -enum { PF_INOUT, PF_IN, PF_OUT }; +enum { PF_INOUT, PF_IN, PF_OUT, PF_FWD }; enum { PF_PASS, PF_DROP, PF_SCRUB, PF_NOSCRUB, PF_NAT, PF_NONAT, PF_BINAT, PF_NOBINAT, PF_RDR, PF_NORDR, PF_SYNPROXY_DROP, PF_DEFER }; enum { PF_RULESET_SCRUB, PF_RULESET_FILTER, PF_RULESET_NAT, Modified: head/sys/netpfil/pf/pf_mtag.h ============================================================================== --- head/sys/netpfil/pf/pf_mtag.h Mon Feb 16 06:30:27 2015 (r278842) +++ head/sys/netpfil/pf/pf_mtag.h Mon Feb 16 07:01:02 2015 (r278843) @@ -39,6 +39,7 @@ #define PF_TAG_TRANSLATE_LOCALHOST 0x04 #define PF_PACKET_LOOPED 0x08 #define PF_FASTFWD_OURS_PRESENT 0x10 +#define PF_REASSEMBLED 0x20 struct pf_mtag { void *hdr; /* saved hdr pos in mbuf, for ECN */ Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Mon Feb 16 06:30:27 2015 (r278842) +++ head/sys/netpfil/pf/pf_norm.c Mon Feb 16 07:01:02 2015 (r278843) @@ -678,6 +678,8 @@ pf_reassemble6(struct mbuf **m0, struct struct pf_frent *frent; struct pf_fragment *frag; struct pf_fragment_cmp key; + struct m_tag *mtag; + struct pf_fragment_tag *ftag; int off; uint16_t total, maxlen; uint8_t proto; @@ -750,6 +752,15 @@ pf_reassemble6(struct mbuf **m0, struct m->m_pkthdr.len = plen; } + if ((mtag = m_tag_get(PF_REASSEMBLED, sizeof(struct pf_fragment_tag), + M_NOWAIT)) == NULL) + goto fail; + ftag = (struct pf_fragment_tag *)(mtag + 1); + ftag->ft_hdrlen = hdrlen; + ftag->ft_extoff = extoff; + ftag->ft_maxlen = maxlen; + m_tag_prepend(m, mtag); + ip6 = mtod(m, struct ip6_hdr *); ip6->ip6_plen = htons(hdrlen - sizeof(struct ip6_hdr) + total); if (extoff) { @@ -1084,6 +1095,75 @@ pf_fragcache(struct mbuf **m0, struct ip } int +pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag) +{ + struct mbuf *m = *m0, *t; + struct pf_fragment_tag *ftag = (struct pf_fragment_tag *)(mtag + 1); + struct pf_pdesc pd; + uint16_t hdrlen, extoff, maxlen; + uint8_t proto; + int error, action; + + hdrlen = ftag->ft_hdrlen; + extoff = ftag->ft_extoff; + maxlen = ftag->ft_maxlen; + m_tag_delete(m, mtag); + mtag = NULL; + ftag = NULL; + + if (extoff) { + int off; + + /* Use protocol from next field of last extension header */ + m = m_getptr(m, extoff + offsetof(struct ip6_ext, ip6e_nxt), + &off); + KASSERT((m != NULL), ("pf_refragment6: short mbuf chain")); + proto = *(mtod(m, caddr_t) + off); + *(mtod(m, char *) + off) = IPPROTO_FRAGMENT; + m = *m0; + } else { + struct ip6_hdr *hdr; + + hdr = mtod(m, struct ip6_hdr *); + proto = hdr->ip6_nxt; + hdr->ip6_nxt = IPPROTO_FRAGMENT; + } + + /* + * Maxlen may be less than 8 if there was only a single + * fragment. As it was fragmented before, add a fragment + * header also for a single fragment. If total or maxlen + * is less than 8, ip6_fragment() will return EMSGSIZE and + * we drop the packet. + */ + error = ip6_fragment(ifp, m, hdrlen, proto, maxlen); + m = (*m0)->m_nextpkt; + (*m0)->m_nextpkt = NULL; + if (error == 0) { + /* The first mbuf contains the unfragmented packet. */ + m_freem(*m0); + *m0 = NULL; + action = PF_PASS; + } else { + /* Drop expects an mbuf to free. */ + DPFPRINTF(("refragment error %d", error)); + action = PF_DROP; + } + for (t = m; m; m = t) { + t = m->m_nextpkt; + m->m_nextpkt = NULL; + memset(&pd, 0, sizeof(pd)); + pd.pf_mtag = pf_find_mtag(m); + if (error == 0) + ip6_forward(m, 0); + else + m_freem(m); + } + + return (action); +} + +int pf_normalize_ip(struct mbuf **m0, int dir, struct pfi_kif *kif, u_short *reason, struct pf_pdesc *pd) { From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 07:36:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E6B770C; Mon, 16 Feb 2015 07:36:25 +0000 (UTC) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) (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 E4931BFD; Mon, 16 Feb 2015 07:36:24 +0000 (UTC) Received: by labpn19 with SMTP id pn19so26710119lab.4; Sun, 15 Feb 2015 23:36:17 -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=k/Tl6EtE/6uZ5udRDbsj0FPUP7ZGpKkqvAyDc7Gtvtg=; b=ax22/xdyMwFlV5FpaR0NW5RZ7fcunUcWmowbXKi497gb355oWJNux4rBMJA/NpVbz6 tCC4jrNQbivy+vlQRPA8WUumSk5GDUEiSmtg4znkwflAp+B4U9ayFBL2tjtq/hO7NWHX l8waNuutTfJsPkZ6Q+MLCDqhYf6qybkkzIlmpVGrqDJUklNHKnAwzW5g6Ej539LYNvT6 Nsjimm+ZsjqO1RrSYeCwyGuR7Athb0oKHQD9caRJhJaF6IZu8h0T/4+NkzUNbBg6jUIN tpcEITctbtsM5odtpO2VZzxoSjR8hLxjCEcQT6beSSYgvNgmTCe2JQ3+Zh360XLjmhHP YwKQ== MIME-Version: 1.0 X-Received: by 10.112.181.165 with SMTP id dx5mr20295175lbc.89.1424072177094; Sun, 15 Feb 2015 23:36:17 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.28.40 with HTTP; Sun, 15 Feb 2015 23:36:17 -0800 (PST) In-Reply-To: <20150216012528.GA15484@FreeBSD.org> References: <201501060903.t06934qp081875@svn.freebsd.org> <20150122012709.GM15484@FreeBSD.org> <54C16715.6060701@gmx.com> <20150122222314.GO15484@FreeBSD.org> <20150215190100.GQ15484@FreeBSD.org> <20150216012528.GA15484@FreeBSD.org> Date: Sun, 15 Feb 2015 23:36:17 -0800 X-Google-Sender-Auth: HIPwRdoWkvE-ZVqomfYY4jd9McU Message-ID: Subject: Re: svn commit: r276747 - head/sys/netpfil/pf From: Craig Rodrigues To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Nikos Vassiliadis , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 07:36:25 -0000 On Sun, Feb 15, 2015 at 5:25 PM, Gleb Smirnoff wrote: > On Sun, Feb 15, 2015 at 01:33:19PM -0800, Craig Rodrigues wrote: > C> By the way, it would be helpful if you could provide feedback in > C> Phabricator. When I created those Phabricator reviews, I added > C> you as a reviewer to all of them, so you can't say that you didn't see > C> the patches. > C> You did not provide feedback on any of them: > C> > C> https://reviews.freebsd.org/D1309 > C> https://reviews.freebsd.org/D1312 > C> https://reviews.freebsd.org/D1313 > C> https://reviews.freebsd.org/D1315 > C> > C> Please take some time to go and provide feedback in those > C> reviews, so that a better patch can be made that makes you happy. > > Did you address all problems that arised after code was committed? > > Please do, otherwise my review would require me to cut-n-paste from > my own emails. > Yes, please cut and paste from your e-mails, and put in the reviews. It's easier to follow in the individual reviews because there are different changes in each review, rather than one big revert, which is what you did. Thanks. -- Craig From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 07:47:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E6B2B17; Mon, 16 Feb 2015 07:47:01 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 78F70CF1; Mon, 16 Feb 2015 07:46:59 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1G7ku98049122 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 16 Feb 2015 10:46:56 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1G7kuJk049121; Mon, 16 Feb 2015 10:46:56 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 16 Feb 2015 10:46:56 +0300 From: Gleb Smirnoff To: Craig Rodrigues Subject: Re: svn commit: r276747 - head/sys/netpfil/pf Message-ID: <20150216074656.GE15484@FreeBSD.org> References: <201501060903.t06934qp081875@svn.freebsd.org> <20150122012709.GM15484@FreeBSD.org> <54C16715.6060701@gmx.com> <20150122222314.GO15484@FreeBSD.org> <20150215190100.GQ15484@FreeBSD.org> <20150216012528.GA15484@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Nikos Vassiliadis , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 07:47:01 -0000 On Sun, Feb 15, 2015 at 11:36:17PM -0800, Craig Rodrigues wrote: C> On Sun, Feb 15, 2015 at 5:25 PM, Gleb Smirnoff wrote: C> C> > On Sun, Feb 15, 2015 at 01:33:19PM -0800, Craig Rodrigues wrote: C> > C> By the way, it would be helpful if you could provide feedback in C> > C> Phabricator. When I created those Phabricator reviews, I added C> > C> you as a reviewer to all of them, so you can't say that you didn't see C> > C> the patches. C> > C> You did not provide feedback on any of them: C> > C> C> > C> https://reviews.freebsd.org/D1309 C> > C> https://reviews.freebsd.org/D1312 C> > C> https://reviews.freebsd.org/D1313 C> > C> https://reviews.freebsd.org/D1315 C> > C> C> > C> Please take some time to go and provide feedback in those C> > C> reviews, so that a better patch can be made that makes you happy. C> > C> > Did you address all problems that arised after code was committed? C> > C> > Please do, otherwise my review would require me to cut-n-paste from C> > my own emails. C> > C> C> Yes, please cut and paste from your e-mails, and put in the reviews. No, I will not do this. You know right now that you have problems in the aforementioned phab URLs, and you are asking me to look at patches at to point them out to you. This is your task, not mine. Please address all already known problems and update the phab revisions. C> It's easier to follow in the individual reviews because there are different C> changes C> in each review, rather than one big revert, which is what you did. I'm already starting to repeat myself. I did a big revert, because the first change wasn't compilable, later changes fixed compilation failures, but introduced unacceptable bugs. That's why I was forced to back out all chain. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 08:02:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2CE137A; Mon, 16 Feb 2015 08:02:22 +0000 (UTC) Received: from mail-lb0-x22e.google.com (mail-lb0-x22e.google.com [IPv6:2a00:1450:4010:c04::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 39CC7ECC; Mon, 16 Feb 2015 08:02:22 +0000 (UTC) Received: by mail-lb0-f174.google.com with SMTP id z11so25634930lbi.5; Mon, 16 Feb 2015 00:02:20 -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=Qbs/MyYxfHTCZXEIG0QAgR+KLxx1SNflhGhp4WP7p4M=; b=RG/+hzUKpRWBn+Fo0AcKqhnJCRYQw7pImkwFXf1O1ILyN9xrrvIwV3kNoIij6Yc4xQ I2ojU2oLUxUuFccB5zj/5mqe8vZGoux1v4SJUGBznxpXmrOjyjDDwR4pdLQFOH9gp1NH adLF+avILTbrhSTNCyprffYxEYP1w3jyR8VgMLr9CH3kBgrZIJzOvyjcf5fUqOkns57n MgIfJwzNG4Q8DDVNxSf2zpC5BcYR+kWSbwpnEjh+YxS1zdjAAzuALUG8l/sLYC+CMEa8 RH9AcctcLA4xcoxjZipHYfnOSQ1kdLBKdiVrPOUG7+S1YTGOqymbxPWul0W/vIzxCKl6 hfSQ== MIME-Version: 1.0 X-Received: by 10.112.202.227 with SMTP id kl3mr20563774lbc.81.1424073740365; Mon, 16 Feb 2015 00:02:20 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.28.40 with HTTP; Mon, 16 Feb 2015 00:02:20 -0800 (PST) In-Reply-To: <20150216074656.GE15484@FreeBSD.org> References: <201501060903.t06934qp081875@svn.freebsd.org> <20150122012709.GM15484@FreeBSD.org> <54C16715.6060701@gmx.com> <20150122222314.GO15484@FreeBSD.org> <20150215190100.GQ15484@FreeBSD.org> <20150216012528.GA15484@FreeBSD.org> <20150216074656.GE15484@FreeBSD.org> Date: Mon, 16 Feb 2015 00:02:20 -0800 X-Google-Sender-Auth: JxWgDEApYz8F4D09tMZCMNku9Qs Message-ID: Subject: Re: svn commit: r276747 - head/sys/netpfil/pf From: Craig Rodrigues To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Nikos Vassiliadis , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 08:02:22 -0000 On Sun, Feb 15, 2015 at 11:46 PM, Gleb Smirnoff wrote: > On Sun, Feb 15, 2015 at 11:36:17PM -0800, Craig Rodrigues wrote: > C> On Sun, Feb 15, 2015 at 5:25 PM, Gleb Smirnoff > wrote: > C> > C> > On Sun, Feb 15, 2015 at 01:33:19PM -0800, Craig Rodrigues wrote: > C> > C> By the way, it would be helpful if you could provide feedback in > C> > C> Phabricator. When I created those Phabricator reviews, I added > C> > C> you as a reviewer to all of them, so you can't say that you didn't > see > C> > C> the patches. > C> > C> You did not provide feedback on any of them: > C> > C> > C> > C> https://reviews.freebsd.org/D1309 > C> > C> https://reviews.freebsd.org/D1312 > C> > C> https://reviews.freebsd.org/D1313 > C> > C> https://reviews.freebsd.org/D1315 > C> > C> > C> > C> Please take some time to go and provide feedback in those > C> > C> reviews, so that a better patch can be made that makes you happy. > C> > > C> > Did you address all problems that arised after code was committed? > C> > > C> > Please do, otherwise my review would require me to cut-n-paste from > C> > my own emails. > C> > > C> > C> Yes, please cut and paste from your e-mails, and put in the reviews. > > No, I will not do this. You know right now that you have problems > in the aforementioned phab URLs, and you are asking me to look at > patches at to point them out to you. This is your task, not mine. > > Please address all already known problems and update the phab revisions. > > C> It's easier to follow in the individual reviews because there are > different > C> changes > C> in each review, rather than one big revert, which is what you did. > > I'm already starting to repeat myself. I did a big revert, because > the first change wasn't compilable, later changes fixed compilation > failures, but introduced unacceptable bugs. That's why I was forced > to back out all chain. > It's not clear to me what parts you find unacceptable, and what parts you find acceptable. I added you to the reviews in Phabricator from the beginning, so it would have been nice if you could have provided the review feedback there. Since you are slow to provide feedback when I asked you to be a reviewer in Phabricator, but you are quick to revert changes, and provide unclear feedback during your reversion, this makes it very hard to make forward progress in this area. In the past, multiple like Nikos and Martin Matuska have been providing patches in your projects/pf branch, but you don't seem to have the time/interest to push these patches back into head. I've seen that Martin Matuska stopped waiting for you to merge the pf branch to head, and started cherry -- Craig From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 08:38:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EC5998B; Mon, 16 Feb 2015 08:38:44 +0000 (UTC) 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 1EDF3259; Mon, 16 Feb 2015 08:38:43 +0000 (UTC) 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 BC85E25D3891; Mon, 16 Feb 2015 08:38:39 +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 5F3BAC77043; Mon, 16 Feb 2015 08:38:38 +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 23cPWvbyV_rh; Mon, 16 Feb 2015 08:38:37 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:75b7:e357:a2dd:8cdb] (unknown [IPv6:fde9:577b:c1a9:4410:75b7:e357:a2dd:8cdb]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 78326C77042; Mon, 16 Feb 2015 08:38:36 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278828 - head/sys/netinet6 From: "Bjoern A. Zeeb" In-Reply-To: <20150216033656.GD15484@FreeBSD.org> Date: Mon, 16 Feb 2015 08:38:04 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <114163CC-5599-4A12-92B6-5B106EF86263@FreeBSD.org> References: <201502160112.t1G1CKd0074570@svn.freebsd.org> <20150216013000.GB15484@FreeBSD.org> <8750BD23-1384-4065-8368-C332F6683814@FreeBSD.org> <20150216033656.GD15484@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 08:38:44 -0000 > On 16 Feb 2015, at 03:36 , Gleb Smirnoff wrote: >=20 > On Mon, Feb 16, 2015 at 01:34:09AM +0000, Bjoern A. Zeeb wrote: > B>=20 > B> > On 16 Feb 2015, at 01:30 , Gleb Smirnoff = wrote: > B> >=20 > B> > On Mon, Feb 16, 2015 at 01:25:05AM +0000, Bjoern A. Zeeb wrote: > B> > B>=20 > B> > B> > On 16 Feb 2015, at 01:12 , Gleb Smirnoff = wrote: > B> > B> >=20 > B> > B> > Author: glebius > B> > B> > Date: Mon Feb 16 01:12:20 2015 > B> > B> > New Revision: 278828 > B> > B> > URL: https://svnweb.freebsd.org/changeset/base/278828 > B> > B> >=20 > B> > B> > Log: > B> > B> > Factor out ip6_deletefraghdr() function, to be shared = between IPv6 > B> > B> > stack and pf(4). > B> > B> >=20 > B> > B> > Submitted by: Kristof Provost > B> > B> > Reviewed by: ae > B> > B> > Differential Revision: D1764 > B> > B> >=20 > B> > B> > Modified: > B> > B> > head/sys/netinet6/frag6.c > B> > B> > head/sys/netinet6/ip6_output.c > B> > B>=20 > B> > B> Why did it have to move file? > B>=20 > B> But the new function is in ip6_output and the consumer stays in = frag6 and will be in pf? So the new function moved to a different file = without consumer rather than just on top of the old function? Keep = code logically together seems to make more sense to me. What am I = missing? >=20 > You are right. I somehow misread it as function being in frag6.c and = consumer > in ip6_output.c. Will fix. Thanks! From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 09:04:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0BFAE2AD; Mon, 16 Feb 2015 09:04:29 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A148B7BC; Mon, 16 Feb 2015 09:04:28 +0000 (UTC) Received: from moby.local ([92.75.152.244]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0LaXEN-1XihZy2fs7-00mJ6m; Mon, 16 Feb 2015 09:59:09 +0100 Message-ID: <54E1B14E.10707@gmx.com> Date: Mon, 16 Feb 2015 09:58:54 +0100 From: Nikos Vassiliadis User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Craig Rodrigues , Gleb Smirnoff Subject: Re: svn commit: r276747 - head/sys/netpfil/pf References: <201501060903.t06934qp081875@svn.freebsd.org> <20150122012709.GM15484@FreeBSD.org> <54C16715.6060701@gmx.com> <20150122222314.GO15484@FreeBSD.org> <20150215190100.GQ15484@FreeBSD.org> <20150216012528.GA15484@FreeBSD.org> <20150216074656.GE15484@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:IulhHcdbDZLKisuDEwhlb5r617tFzQuMRJNU1qRrtzMsBhunNc8 Rmo5ITalTChzfX/Sjze+vYi0c/WcJBIfG1ny/CQ19PgnXS17p+HQgPILDwDqDvWy8H9IKBY KQMz/8JXdcyKW/685YYlKDOcGwTUK9jkxik8XLpGr6VrKHu8Y/gJyNGCGCblIPRvL5vgu6Z /TmRBjok1+80Bj+AUX9bA== X-UI-Out-Filterresults: notjunk:1; Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 09:04:29 -0000 Hi Gleb & Craig, I am already working on the issues that need to be fixed, namely: 1) all the changes from projects/pf 2) unloading the module 3) one purge thread per pf instance will remain until we have more experience It's almost ready, I am trying to fix unloading the module. As I am not at home this week I will send you a patch for review on Monday. Best regards, Nikos On 02/16/15 09:02, Craig Rodrigues wrote: > On Sun, Feb 15, 2015 at 11:46 PM, Gleb Smirnoff wrote: > >> On Sun, Feb 15, 2015 at 11:36:17PM -0800, Craig Rodrigues wrote: >> C> On Sun, Feb 15, 2015 at 5:25 PM, Gleb Smirnoff >> wrote: >> C> >> C> > On Sun, Feb 15, 2015 at 01:33:19PM -0800, Craig Rodrigues wrote: >> C> > C> By the way, it would be helpful if you could provide feedback in >> C> > C> Phabricator. When I created those Phabricator reviews, I added >> C> > C> you as a reviewer to all of them, so you can't say that you didn't >> see >> C> > C> the patches. >> C> > C> You did not provide feedback on any of them: >> C> > C> >> C> > C> https://reviews.freebsd.org/D1309 >> C> > C> https://reviews.freebsd.org/D1312 >> C> > C> https://reviews.freebsd.org/D1313 >> C> > C> https://reviews.freebsd.org/D1315 >> C> > C> >> C> > C> Please take some time to go and provide feedback in those >> C> > C> reviews, so that a better patch can be made that makes you happy. >> C> > >> C> > Did you address all problems that arised after code was committed? >> C> > >> C> > Please do, otherwise my review would require me to cut-n-paste from >> C> > my own emails. >> C> > >> C> >> C> Yes, please cut and paste from your e-mails, and put in the reviews. >> >> No, I will not do this. You know right now that you have problems >> in the aforementioned phab URLs, and you are asking me to look at >> patches at to point them out to you. This is your task, not mine. >> >> Please address all already known problems and update the phab revisions. >> >> C> It's easier to follow in the individual reviews because there are >> different >> C> changes >> C> in each review, rather than one big revert, which is what you did. >> >> I'm already starting to repeat myself. I did a big revert, because >> the first change wasn't compilable, later changes fixed compilation >> failures, but introduced unacceptable bugs. That's why I was forced >> to back out all chain. >> > > > > It's not clear to me what parts you find unacceptable, > and what parts you find acceptable. I added you to the reviews > in Phabricator from the beginning, so it would have been nice if you could > have > provided the review feedback there. Since you are slow to provide > feedback when I asked you to be a reviewer in Phabricator, but you > are quick to revert changes, and provide unclear feedback during your > reversion, > this makes it very hard to make forward progress in this area. > > In the past, multiple like Nikos and Martin Matuska have been providing > patches in your > projects/pf branch, but you don't seem to have the time/interest to push > these patches back into head. > I've seen that Martin Matuska stopped waiting for you to merge the pf > branch to head, and started cherry > > -- > Craig > From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 09:53:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B03A97F4; Mon, 16 Feb 2015 09:53:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9B143D3E; Mon, 16 Feb 2015 09:53:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G9riiH028300; Mon, 16 Feb 2015 09:53:44 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G9rijI028299; Mon, 16 Feb 2015 09:53:44 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201502160953.t1G9rijI028299@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Mon, 16 Feb 2015 09:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278844 - head/sys/dev/xen/xenstore 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 09:53:44 -0000 Author: royger Date: Mon Feb 16 09:53:43 2015 New Revision: 278844 URL: https://svnweb.freebsd.org/changeset/base/278844 Log: xen: fix xenstore dev Xenstore user-space device has two problems currently: - It does not correctly handle concurrent clients, because it's storing each client data in dev->si_drv1. - It does not correctly free this data when the client closes the device. In order to solve both of this issues store the per-client data using cdevpriv, which also comes with a hook in order to perform the necessary cleanup on device close. While there also make the device eternal. Sponsored by: Citrix Systems R&D Reported and Tested by: thompsa MFC after: 2 weeks Modified: head/sys/dev/xen/xenstore/xenstore_dev.c Modified: head/sys/dev/xen/xenstore/xenstore_dev.c ============================================================================== --- head/sys/dev/xen/xenstore/xenstore_dev.c Mon Feb 16 07:01:02 2015 (r278843) +++ head/sys/dev/xen/xenstore/xenstore_dev.c Mon Feb 16 09:53:43 2015 (r278844) @@ -77,7 +77,11 @@ static int xs_dev_read(struct cdev *dev, struct uio *uio, int ioflag) { int error; - struct xs_dev_data *u = dev->si_drv1; + struct xs_dev_data *u; + + error = devfs_get_cdevpriv((void **)&u); + if (error != 0) + return (error); while (u->read_prod == u->read_cons) { error = tsleep(u, PCATCH, "xsdread", hz/10); @@ -115,11 +119,15 @@ static int xs_dev_write(struct cdev *dev, struct uio *uio, int ioflag) { int error; - struct xs_dev_data *u = dev->si_drv1; + struct xs_dev_data *u; struct xs_dev_transaction *trans; void *reply; int len = uio->uio_resid; + error = devfs_get_cdevpriv((void **)&u); + if (error != 0) + return (error); + if ((len + u->len) > sizeof(u->u.buffer)) return (EINVAL); @@ -177,25 +185,10 @@ xs_dev_write(struct cdev *dev, struct ui return (error); } -static int -xs_dev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) -{ - struct xs_dev_data *u; - -#if 0 /* XXX figure out if equiv needed */ - nonseekable_open(inode, filp); -#endif - u = malloc(sizeof(*u), M_XENSTORE, M_WAITOK|M_ZERO); - LIST_INIT(&u->transactions); - dev->si_drv1 = u; - - return (0); -} - -static int -xs_dev_close(struct cdev *dev, int fflag, int devtype, struct thread *td) +static void +xs_dev_dtor(void *arg) { - struct xs_dev_data *u = dev->si_drv1; + struct xs_dev_data *u = arg; struct xs_dev_transaction *trans, *tmp; LIST_FOREACH_SAFE(trans, &u->transactions, list, tmp) { @@ -205,7 +198,21 @@ xs_dev_close(struct cdev *dev, int fflag } free(u, M_XENSTORE); - return (0); +} + +static int +xs_dev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +{ + struct xs_dev_data *u; + int error; + + u = malloc(sizeof(*u), M_XENSTORE, M_WAITOK|M_ZERO); + LIST_INIT(&u->transactions); + error = devfs_set_cdevpriv(u, xs_dev_dtor); + if (error != 0) + free(u, M_XENSTORE); + + return (error); } static struct cdevsw xs_dev_cdevsw = { @@ -213,7 +220,6 @@ static struct cdevsw xs_dev_cdevsw = { .d_read = xs_dev_read, .d_write = xs_dev_write, .d_open = xs_dev_open, - .d_close = xs_dev_close, .d_name = "xs_dev", }; @@ -262,8 +268,8 @@ xs_dev_attach(device_t dev) { struct cdev *xs_cdev; - xs_cdev = make_dev(&xs_dev_cdevsw, 0, UID_ROOT, GID_WHEEL, 0400, - "xen/xenstore"); + xs_cdev = make_dev_credf(MAKEDEV_ETERNAL, &xs_dev_cdevsw, 0, NULL, + UID_ROOT, GID_WHEEL, 0400, "xen/xenstore"); if (xs_cdev == NULL) return (EINVAL); From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 11:10:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03590A9A; Mon, 16 Feb 2015 11:10:59 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C8E5F794; Mon, 16 Feb 2015 11:10:58 +0000 (UTC) Received: from Julian-MBP3.local ([12.199.201.60]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t1GBAoJP099813 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 16 Feb 2015 03:10:50 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <54E1D03A.2070904@freebsd.org> Date: Mon, 16 Feb 2015 03:10:50 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Gleb Smirnoff , mav@FreeBSD.org Subject: Re: svn commit: r278640 - head/sys/netgraph References: <201502122220.t1CMKY8t040498@svn.freebsd.org> <20150214000540.GI15484@FreeBSD.org> In-Reply-To: <20150214000540.GI15484@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 11:10:59 -0000 On 2/13/15 4:05 PM, Gleb Smirnoff wrote: > Hi! > > On Thu, Feb 12, 2015 at 10:20:34PM +0000, Gleb Smirnoff wrote: > T> Author: glebius > T> Date: Thu Feb 12 22:20:34 2015 > T> New Revision: 278640 > T> URL: https://svnweb.freebsd.org/changeset/base/278640 > T> > T> Log: > T> Revise default limit for maximum of netgraph data items. > T> With modern internet speeds the limit can be reached even > T> on a single L2TP link. > > Actually any ng_item of data type requires an mbuf to be connected > to it, and thus I suggest to use mbuf limits to drive ng_item limits. > > If we got an item leak with mbufs being properly freed, then we've > got a bug to fix, and any limit won't work in long run time. I never > evidenced such a bug, but there complaints on hitting limit at > traffic bursts. As said, with previous 512 item limit I experienced > that even on a laptop. > > Any objections on removing the limit, guys? maybe derived from it, but not the same number. maybe change the systctl to define the relationship? > > T> Modified: > T> head/sys/netgraph/ng_base.c > T> > T> Modified: head/sys/netgraph/ng_base.c > T> ============================================================================== > T> --- head/sys/netgraph/ng_base.c Thu Feb 12 21:20:28 2015 (r278639) > T> +++ head/sys/netgraph/ng_base.c Thu Feb 12 22:20:34 2015 (r278640) > T> @@ -2952,7 +2952,7 @@ uma_zone_t ng_qzone; > T> uma_zone_t ng_qdzone; > T> static int numthreads = 0; /* number of queue threads */ > T> static int maxalloc = 4096;/* limit the damage of a leak */ > T> -static int maxdata = 512; /* limit the damage of a DoS */ > T> +static int maxdata = 4096; /* limit the damage of a DoS */ > T> > T> SYSCTL_INT(_net_graph, OID_AUTO, threads, CTLFLAG_RDTUN, &numthreads, > T> 0, "Number of queue processing threads"); > T> > From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 11:49:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07DEEF3B; Mon, 16 Feb 2015 11:49:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 CD0E8B02; Mon, 16 Feb 2015 11:49:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GBnnTR080555; Mon, 16 Feb 2015 11:49:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GBnnUe080550; Mon, 16 Feb 2015 11:49:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502161149.t1GBnnUe080550@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 16 Feb 2015 11:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278846 - in head/sys: dev/fb 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 11:49:50 -0000 Author: hselasky Date: Mon Feb 16 11:49:48 2015 New Revision: 278846 URL: https://svnweb.freebsd.org/changeset/base/278846 Log: Forward the FBIO_BLANK IOCTL to framebuffer clients. Bump the FreeBSD version to force re-compilation of external video driver kernel modules. Discussed with: ray @ Modified: head/sys/dev/fb/fbd.c head/sys/sys/fbio.h head/sys/sys/param.h Modified: head/sys/dev/fb/fbd.c ============================================================================== --- head/sys/dev/fb/fbd.c Mon Feb 16 11:03:36 2015 (r278845) +++ head/sys/dev/fb/fbd.c Mon Feb 16 11:49:48 2015 (r278846) @@ -134,7 +134,8 @@ fb_ioctl(struct cdev *dev, u_long cmd, c break; case FBIO_BLANK: /* blank display */ - error = 0; /* TODO */ + if (info->setblankmode != NULL) + error = info->setblankmode(info->fb_priv, *(int *)data); break; default: Modified: head/sys/sys/fbio.h ============================================================================== --- head/sys/sys/fbio.h Mon Feb 16 11:03:36 2015 (r278845) +++ head/sys/sys/fbio.h Mon Feb 16 11:49:48 2015 (r278846) @@ -115,6 +115,7 @@ struct fb_info; typedef int fb_enter_t(void *priv); typedef int fb_leave_t(void *priv); +typedef int fb_setblankmode_t(void *priv, int mode); struct fb_info { /* Raw copy of fbtype. Do not change. */ @@ -129,6 +130,7 @@ struct fb_info { fb_enter_t *enter; fb_leave_t *leave; + fb_setblankmode_t *setblankmode; intptr_t fb_pbase; /* For FB mmap. */ intptr_t fb_vbase; /* if NULL, use fb_write/fb_read. */ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Feb 16 11:03:36 2015 (r278845) +++ head/sys/sys/param.h Mon Feb 16 11:49:48 2015 (r278846) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100059 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100060 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 11:54:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD91715F; Mon, 16 Feb 2015 11:54:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9EE88C0A; Mon, 16 Feb 2015 11:54:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GBskTG084595; Mon, 16 Feb 2015 11:54:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GBskOm084594; Mon, 16 Feb 2015 11:54:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502161154.t1GBskOm084594@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 16 Feb 2015 11:54:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278847 - head/sys/dev/usb/video 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 11:54:46 -0000 Author: hselasky Date: Mon Feb 16 11:54:45 2015 New Revision: 278847 URL: https://svnweb.freebsd.org/changeset/base/278847 Log: Allow the display port to be powered off. Modified: head/sys/dev/usb/video/udl.c Modified: head/sys/dev/usb/video/udl.c ============================================================================== --- head/sys/dev/usb/video/udl.c Mon Feb 16 11:49:48 2015 (r278846) +++ head/sys/dev/usb/video/udl.c Mon Feb 16 11:54:45 2015 (r278847) @@ -78,9 +78,7 @@ static device_probe_t udl_probe; static device_attach_t udl_attach; static device_detach_t udl_detach; static fb_getinfo_t udl_fb_getinfo; -#if 0 -static fb_blank_display_t udl_fb_blank_display; -#endif +static fb_setblankmode_t udl_fb_setblankmode; static void udl_select_chip(struct udl_softc *, struct usb_attach_arg *); static int udl_init_chip(struct udl_softc *); @@ -94,9 +92,7 @@ static void udl_cmd_insert_int_3(struct static void udl_cmd_insert_buf_le16(struct udl_cmd_buf *, const uint8_t *, uint32_t); static void udl_cmd_write_reg_1(struct udl_cmd_buf *, uint8_t, uint8_t); static void udl_cmd_write_reg_3(struct udl_cmd_buf *, uint8_t, uint32_t); -#if 0 static int udl_power_save(struct udl_softc *, int, int); -#endif static const struct usb_config udl_config[UDL_N_TRANSFER] = { [UDL_BULK_WRITE_0] = { @@ -131,9 +127,6 @@ static device_method_t udl_methods[] = { DEVMETHOD(device_attach, udl_attach), DEVMETHOD(device_detach, udl_detach), DEVMETHOD(fb_getinfo, udl_fb_getinfo), -#if 0 - DEVMETHOD(fb_blank_display, udl_fb_blank_display), -#endif DEVMETHOD_END }; @@ -350,6 +343,8 @@ udl_attach(device_t dev) sc->sc_fb_info.fb_stride = sc->sc_fb_info.fb_width * 2; sc->sc_fb_info.fb_pbase = 0; sc->sc_fb_info.fb_vbase = (uintptr_t)sc->sc_fb_addr; + sc->sc_fb_info.fb_priv = sc; + sc->sc_fb_info.setblankmode = &udl_fb_setblankmode; sc->sc_fbdev = device_add_child(dev, "fbd", -1); if (sc->sc_fbdev == NULL) @@ -407,11 +402,10 @@ udl_fb_getinfo(device_t dev) return (&sc->sc_fb_info); } -#if 0 static int -udl_fb_blank_display(device_t dev, int mode) +udl_fb_setblankmode(void *arg, int mode) { - struct udl_softc *sc = device_get_softc(dev); + struct udl_softc *sc = arg; switch (mode) { case V_DISPLAY_ON: @@ -432,7 +426,6 @@ udl_fb_blank_display(device_t dev, int m } return (0); } -#endif static struct udl_cmd_buf * udl_cmd_buf_alloc(struct udl_softc *sc, int flags) @@ -552,7 +545,6 @@ tr_setup: cv_signal(&sc->sc_cv); } -#if 0 static int udl_power_save(struct udl_softc *sc, int on, int flags) { @@ -576,7 +568,6 @@ udl_power_save(struct udl_softc *sc, int udl_cmd_buf_send(sc, cb); return (0); } -#endif static int udl_ctrl_msg(struct udl_softc *sc, uint8_t rt, uint8_t r, From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 12:56:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B3BCE40; Mon, 16 Feb 2015 12:56:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 06E8D303; Mon, 16 Feb 2015 12:56:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GCutDB013200; Mon, 16 Feb 2015 12:56:55 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GCutY8013198; Mon, 16 Feb 2015 12:56:55 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201502161256.t1GCutY8013198@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Mon, 16 Feb 2015 12:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278848 - head/bin/ln 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 12:56:56 -0000 Author: jilles Date: Mon Feb 16 12:56:55 2015 New Revision: 278848 URL: https://svnweb.freebsd.org/changeset/base/278848 Log: symlink(7): Mention chflagsat() (can take AT_SYMLINK_NOFOLLOW). MFC after: 1 week Modified: head/bin/ln/symlink.7 Modified: head/bin/ln/symlink.7 ============================================================================== --- head/bin/ln/symlink.7 Mon Feb 16 11:54:45 2015 (r278847) +++ head/bin/ln/symlink.7 Mon Feb 16 12:56:55 2015 (r278848) @@ -29,7 +29,7 @@ .\" @(#)symlink.7 8.3 (Berkeley) 3/31/94 .\" $FreeBSD$ .\" -.Dd January 23, 2015 +.Dd February 16, 2015 .Dt SYMLINK 7 .Os .Sh NAME @@ -146,6 +146,7 @@ The following system calls follow symbol unless given the .Dv AT_SYMLINK_NOFOLLOW flag: +.Xr chflagsat 2 , .Xr fchmodat 2 , .Xr fchownat 2 , .Xr fstatat 2 From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 13:02:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C1C3FEE; Mon, 16 Feb 2015 13:02:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0767E3E1; Mon, 16 Feb 2015 13:02:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GD20hE017373; Mon, 16 Feb 2015 13:02:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GD20Rp017372; Mon, 16 Feb 2015 13:02:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201502161302.t1GD20Rp017372@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 Feb 2015 13:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278849 - head/sys/dev/vt 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 13:02:01 -0000 Author: avg Date: Mon Feb 16 13:02:00 2015 New Revision: 278849 URL: https://svnweb.freebsd.org/changeset/base/278849 Log: vt: move suspend/resume event handlers registration outside of mutex scope This is to avoid a witness warning about a waiting memory allocation in the evnt hanlder registration code. Reported by: markj MFC after: 3 days X-MFC with: r277795 Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Mon Feb 16 12:56:55 2015 (r278848) +++ head/sys/dev/vt/vt_core.c Mon Feb 16 13:02:00 2015 (r278849) @@ -2518,6 +2518,7 @@ vt_upgrade(struct vt_device *vd) { struct vt_window *vw; unsigned int i; + int register_handlers; if (!vty_enabled(VTY_VT)) return; @@ -2546,6 +2547,7 @@ vt_upgrade(struct vt_device *vd) if (vd->vd_curwindow == NULL) vd->vd_curwindow = vd->vd_windows[VT_CONSWINDOW]; + register_handlers = 0; if (!(vd->vd_flags & VDF_ASYNC)) { /* Attach keyboard. */ vt_allocate_keyboard(vd); @@ -2557,18 +2559,21 @@ vt_upgrade(struct vt_device *vd) vd->vd_flags |= VDF_ASYNC; callout_reset(&vd->vd_timer, hz / VT_TIMERFREQ, vt_timer, vd); vd->vd_timer_armed = 1; + register_handlers = 1; + } + + VT_UNLOCK(vd); + + /* Refill settings with new sizes. */ + vt_resize(vd); + if (register_handlers) { /* Register suspend/resume handlers. */ EVENTHANDLER_REGISTER(power_suspend_early, vt_suspend_handler, vd, EVENTHANDLER_PRI_ANY); EVENTHANDLER_REGISTER(power_resume, vt_resume_handler, vd, EVENTHANDLER_PRI_ANY); } - - VT_UNLOCK(vd); - - /* Refill settings with new sizes. */ - vt_resize(vd); } static void From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 14:21:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7913BD65; Mon, 16 Feb 2015 14:21:23 +0000 (UTC) Received: from fep25.mx.upcmail.net (fep25.mx.upcmail.net [62.179.121.45]) by mx1.freebsd.org (Postfix) with ESMTP id 248C9D89; Mon, 16 Feb 2015 14:21:21 +0000 (UTC) Received: from edge03.upcmail.net ([192.168.13.238]) by viefep25-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20150216142113.BOOZ16167.viefep25-int.chello.at@edge03.upcmail.net>; Mon, 16 Feb 2015 15:21:13 +0100 Received: from [192.168.0.23] ([178.84.134.112]) by edge03.upcmail.net with edge id t2MC1p0172Rg3Ey012MCqh; Mon, 16 Feb 2015 15:21:13 +0100 X-SourceIP: 178.84.134.112 Message-ID: <54E1FCD0.6000500@rainbow-runner.nl> Date: Mon, 16 Feb 2015 15:21:04 +0100 From: Koop Mast User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278473 - in head/sys: amd64/amd64 amd64/include amd64/vmm contrib/dev/acpica/include i386/i386 i386/include x86/acpica x86/include x86/x86 x86/xen References: <201502092100.t19L0vsv010944@svn.freebsd.org> In-Reply-To: <201502092100.t19L0vsv010944@svn.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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 14:21:23 -0000 On 9-2-2015 22:00, Konstantin Belousov wrote: > Author: kib > Date: Mon Feb 9 21:00:56 2015 > New Revision: 278473 > URL: https://svnweb.freebsd.org/changeset/base/278473 > > Log: > Add x2APIC support. Enable it by default if CPU is capable. The > hw.x2apic_enable tunable allows disabling it from the loader prompt. Hi Konstantin, This commit broke my Sandybridge laptop. If x2APIC is enabled the kernel freezes after the "ACPI APIC Table: <_ASUS_ NoteBook>" line is printed. I can't get much information out of it since I couldn't get into the kernel debugger nor has the machine a serial cable. I did notice that "x2APIC" is listed in the CPU Features2 list, but for the cpu's it reports "x2APIC: 0". I don't know if this has to do with disabled x2APIC or some hardware/bios issue? -Koop Verbose dmesg with x2APIC disabled: https://people.freebsd.org/~kwm/dmesg-x2apic.txt From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 14:45:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB25A30C; Mon, 16 Feb 2015 14:45:05 +0000 (UTC) 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 83674B8; Mon, 16 Feb 2015 14:45:05 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5E674B93A; Mon, 16 Feb 2015 09:45:04 -0500 (EST) From: John Baldwin To: Mateusz Guzik Subject: Re: svn commit: r278760 - head/sys/kern Date: Mon, 16 Feb 2015 09:42:54 -0500 Message-ID: <4509701.vaGfDQNhqC@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <20150214182109.GC18597@dft-labs.eu> References: <201502141702.t1EH2pVa059259@svn.freebsd.org> <20150214182109.GC18597@dft-labs.eu> 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, 16 Feb 2015 09:45:04 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 14:45:05 -0000 On Saturday, February 14, 2015 07:21:10 PM Mateusz Guzik wrote: > On Sat, Feb 14, 2015 at 05:02:51PM +0000, John Baldwin wrote: > > +SYSCTL_ULONG(_vfs, OID_AUTO, vnodes_created, CTLFLAG_RD, &vnodes_created, > > + 0, "Number of vnodes created by getnewvnode"); > > + > > [..] > > > +static u_long recycles_count; > > +SYSCTL_ULONG(_vfs, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, 0, > > + "Number of vnodes recycled to avoid exceding kern.maxvnodes"); > > + > > CTLFLAG_MPSAFE? #define SYSCTL_ULONG(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_ULONG | CTLFLAG_MPSAFE | (access), \ ptr, val, sysctl_handle_long, "LU", descr); \ CTASSERT((((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_ULONG) && \ sizeof(unsigned long) == sizeof(*(ptr))) All the trivial sysctls already include CTLFLAG_MPSAFE so that I didn't have to go spray that flag all over the tree. Only SYSCTL_PROC nodes need to be explicitly tagged. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 14:45:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89C8430A; Mon, 16 Feb 2015 14:45:05 +0000 (UTC) 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 61086B7; Mon, 16 Feb 2015 14:45:05 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C2E4CB926; Mon, 16 Feb 2015 09:45:03 -0500 (EST) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r278760 - head/sys/kern Date: Mon, 16 Feb 2015 09:44:49 -0500 Message-ID: <3743615.TmWIRblad9@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <20150214181803.GM15484@FreeBSD.org> References: <201502141702.t1EH2pVa059259@svn.freebsd.org> <20150214181803.GM15484@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, 16 Feb 2015 09:45:03 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 14:45:05 -0000 On Saturday, February 14, 2015 09:18:03 PM Gleb Smirnoff wrote: > On Sat, Feb 14, 2015 at 05:02:51PM +0000, John Baldwin wrote: > J> Author: jhb > J> Date: Sat Feb 14 17:02:51 2015 > J> New Revision: 278760 > J> URL: https://svnweb.freebsd.org/changeset/base/278760 > J> > J> Log: > J> Add two new counters for vnode life cycle events: > J> - vfs.recycles counts the number of vnodes forcefully recycled to avoid > J> exceeding kern.maxvnodes. > J> - vfs.vnodes_created counts the number of vnodes created by successful > J> calls to getnewvnode(). > J> > J> Differential Revision: https://reviews.freebsd.org/D1671 > J> Reviewed by: kib > J> MFC after: 1 week > > Why don't use counter(9) for that? Would avoid atomics. Just didn't think of it (that and the other counters in vfs_subr all use atomics). A more general patch to convert the various counters in this file would probably be useful. In the case of these specific counters: if you are recycling and creating vnodes so quickly that cache contention on these lines is problematic, you probably have much bigger problems such that the counters would be in the noise given all the other crap involved in vnode life-cycle management. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 15:34:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77846D04; Mon, 16 Feb 2015 15:34:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 62F817E1; Mon, 16 Feb 2015 15:34:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GFYB9k087992; Mon, 16 Feb 2015 15:34:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GFYBnD087991; Mon, 16 Feb 2015 15:34:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502161534.t1GFYBnD087991@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 16 Feb 2015 15:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278850 - 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 15:34:11 -0000 Author: hselasky Date: Mon Feb 16 15:34:10 2015 New Revision: 278850 URL: https://svnweb.freebsd.org/changeset/base/278850 Log: Handle VBUS error interrupts. Submitted by: SAITOU Toshihide PR: 190471 MFC after: 1 week Modified: head/sys/dev/usb/controller/musb_otg.c Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Mon Feb 16 13:02:00 2015 (r278849) +++ head/sys/dev/usb/controller/musb_otg.c Mon Feb 16 15:34:10 2015 (r278850) @@ -2258,7 +2258,8 @@ repeat: if (usb_status & (MUSB2_MASK_IRESET | MUSB2_MASK_IRESUME | MUSB2_MASK_ISUSP | - MUSB2_MASK_ICONN | MUSB2_MASK_IDISC)) { + MUSB2_MASK_ICONN | MUSB2_MASK_IDISC | + MUSB2_MASK_IVBUSERR)) { DPRINTFN(4, "real bus interrupt 0x%08x\n", usb_status); @@ -2330,6 +2331,12 @@ repeat: * always in reset state once device is connected. */ if (sc->sc_mode == MUSB2_HOST_MODE) { + /* check for VBUS error in USB host mode */ + if (usb_status & MUSB2_MASK_IVBUSERR) { + temp = MUSB2_READ_1(sc, MUSB2_REG_DEVCTL); + temp |= MUSB2_MASK_SESS; + MUSB2_WRITE_1(sc, MUSB2_REG_DEVCTL, temp); + } if (usb_status & MUSB2_MASK_ICONN) sc->sc_flags.status_bus_reset = 1; if (usb_status & MUSB2_MASK_IDISC) From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 15:39:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1D6AFD5; Mon, 16 Feb 2015 15:39:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 AD626834; Mon, 16 Feb 2015 15:39:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GFdqA3088698; Mon, 16 Feb 2015 15:39:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GFdq7D088697; Mon, 16 Feb 2015 15:39:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502161539.t1GFdq7D088697@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 16 Feb 2015 15:39:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278851 - head/sys/dev/usb/video 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 15:39:52 -0000 Author: hselasky Date: Mon Feb 16 15:39:51 2015 New Revision: 278851 URL: https://svnweb.freebsd.org/changeset/base/278851 Log: Swap screen dimensions back to normal. Modified: head/sys/dev/usb/video/udl.c Modified: head/sys/dev/usb/video/udl.c ============================================================================== --- head/sys/dev/usb/video/udl.c Mon Feb 16 15:34:10 2015 (r278850) +++ head/sys/dev/usb/video/udl.c Mon Feb 16 15:39:51 2015 (r278851) @@ -182,7 +182,7 @@ udl_get_fb_width(struct udl_softc *sc) { unsigned i = sc->sc_cur_mode; - return (udl_modes[i].vdisplay); + return (udl_modes[i].hdisplay); } static uint32_t @@ -190,7 +190,7 @@ udl_get_fb_height(struct udl_softc *sc) { unsigned i = sc->sc_cur_mode; - return (udl_modes[i].hdisplay); + return (udl_modes[i].vdisplay); } static uint32_t From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 15:46:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B1DC205; Mon, 16 Feb 2015 15:46:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1CBD78FF; Mon, 16 Feb 2015 15:46:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GFkGtY092984; Mon, 16 Feb 2015 15:46:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GFkGgJ092983; Mon, 16 Feb 2015 15:46:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502161546.t1GFkGgJ092983@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 16 Feb 2015 15:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278852 - head/sys/dev/usb/video 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 15:46:17 -0000 Author: hselasky Date: Mon Feb 16 15:46:16 2015 New Revision: 278852 URL: https://svnweb.freebsd.org/changeset/base/278852 Log: Avoid recursive locking. Modified: head/sys/dev/usb/video/udl.c Modified: head/sys/dev/usb/video/udl.c ============================================================================== --- head/sys/dev/usb/video/udl.c Mon Feb 16 15:39:51 2015 (r278851) +++ head/sys/dev/usb/video/udl.c Mon Feb 16 15:46:16 2015 (r278852) @@ -428,11 +428,10 @@ udl_fb_setblankmode(void *arg, int mode) } static struct udl_cmd_buf * -udl_cmd_buf_alloc(struct udl_softc *sc, int flags) +udl_cmd_buf_alloc_locked(struct udl_softc *sc, int flags) { struct udl_cmd_buf *cb; - UDL_LOCK(sc); while ((cb = TAILQ_FIRST(&sc->sc_cmd_buf_free)) == NULL) { if (flags != M_WAITOK) break; @@ -442,6 +441,16 @@ udl_cmd_buf_alloc(struct udl_softc *sc, TAILQ_REMOVE(&sc->sc_cmd_buf_free, cb, entry); cb->off = 0; } + return (cb); +} + +static struct udl_cmd_buf * +udl_cmd_buf_alloc(struct udl_softc *sc, int flags) +{ + struct udl_cmd_buf *cb; + + UDL_LOCK(sc); + cb = udl_cmd_buf_alloc_locked(sc, flags); UDL_UNLOCK(sc); return (cb); } @@ -465,7 +474,7 @@ udl_cmd_buf_send(struct udl_softc *sc, s } static struct udl_cmd_buf * -udl_fb_synchronize(struct udl_softc *sc) +udl_fb_synchronize_locked(struct udl_softc *sc) { const uint32_t max = udl_get_fb_size(sc); @@ -482,7 +491,7 @@ udl_fb_synchronize(struct udl_softc *sc) if (bcmp(sc->sc_fb_addr + sc->sc_sync_off, sc->sc_fb_copy + sc->sc_sync_off, delta) != 0) { struct udl_cmd_buf *cb; - cb = udl_cmd_buf_alloc(sc, M_NOWAIT); + cb = udl_cmd_buf_alloc_locked(sc, M_NOWAIT); if (cb == NULL) goto done; memcpy(sc->sc_fb_copy + sc->sc_sync_off, @@ -518,7 +527,7 @@ tr_setup: for (i = 0; i != UDL_CMD_MAX_FRAMES; i++) { cb = TAILQ_FIRST(&sc->sc_cmd_buf_pending); if (cb == NULL) { - cb = udl_fb_synchronize(sc); + cb = udl_fb_synchronize_locked(sc); if (cb == NULL) break; } else { From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 15:47:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98D1F370; Mon, 16 Feb 2015 15:47:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 845CE91B; Mon, 16 Feb 2015 15:47:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GFluR9093220; Mon, 16 Feb 2015 15:47:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GFlu2k093219; Mon, 16 Feb 2015 15:47:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502161547.t1GFlu2k093219@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 16 Feb 2015 15:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278853 - head/sys/dev/usb/video 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 15:47:56 -0000 Author: hselasky Date: Mon Feb 16 15:47:55 2015 New Revision: 278853 URL: https://svnweb.freebsd.org/changeset/base/278853 Log: Reduce number of memory buffers a bit. Modified: head/sys/dev/usb/video/udl.h Modified: head/sys/dev/usb/video/udl.h ============================================================================== --- head/sys/dev/usb/video/udl.h Mon Feb 16 15:46:16 2015 (r278852) +++ head/sys/dev/usb/video/udl.h Mon Feb 16 15:47:55 2015 (r278853) @@ -30,7 +30,7 @@ #define UDL_CMD_MAX_DATA_SIZE 512 /* bytes */ #define UDL_CMD_MAX_HEAD_SIZE 16 /* bytes */ #define UDL_CMD_MAX_PIXEL_COUNT ((UDL_CMD_MAX_DATA_SIZE - UDL_CMD_MAX_HEAD_SIZE) / 2) -#define UDL_CMD_MAX_BUFFERS 2048 /* units */ +#define UDL_CMD_MAX_BUFFERS (3 * UDL_CMD_MAX_FRAMES) #define UDL_FONT_HEIGHT 16 /* pixels */ #define UDL_MAX_MODES 25 /* units */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 16:25:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0642EC02; Mon, 16 Feb 2015 16:25:02 +0000 (UTC) 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 D0B34DCC; Mon, 16 Feb 2015 16:25:01 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 28DE4B926; Mon, 16 Feb 2015 11:25:00 -0500 (EST) From: John Baldwin To: Pedro Giffuni Subject: Re: svn commit: r278737 - head/usr.sbin/flowctl Date: Mon, 16 Feb 2015 11:20:46 -0500 Message-ID: <2515976.62jDXqymxG@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <54DFA7CC.20305@FreeBSD.org> References: <201502132357.t1DNvKda075915@svn.freebsd.org> <1423938828.80968.148.camel@freebsd.org> <54DFA7CC.20305@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, 16 Feb 2015 11:25:00 -0500 (EST) Cc: src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Gleb Smirnoff , Bruce Evans , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 16:25:02 -0000 On Saturday, February 14, 2015 02:53:48 PM Pedro Giffuni wrote: > On 02/14/15 13:33, Ian Lepore wrote: > > On Sat, 2015-02-14 at 21:15 +0300, Gleb Smirnoff wrote: > >> Bruce, > >> > >> On Sat, Feb 14, 2015 at 08:46:58PM +1100, Bruce Evans wrote: > >> B> Using VLAs and also the C99 feature of declarations anwhere, and > >> extensions B> like __aligned(), we can almost implement a full alloca() > >> using the fixed B> version of this change: > >> B> > >> B> /* > >> B> * XXX need extended statement-expression so that __buf doesn't go > >> out > >> B> * of scope after the right brace. > >> B> */ > >> B> #define my_alloca(n) __extension__ ({ > >> B> /* XXX need unique name. */ \ > >> B> char __buf[__roundup2((n), MUMBLE)] __aligned(MUMBLE); \ > >> B> \ > >> B> (void *)__buf; \ > >> B> }) > >> > >> I like this idea. But would this exact code work? The life of > >> __buf is limited by the code block, and we exit the block > >> immediately. Wouldn't the allocation be overwritten if we > >> enter any function or block later? > > > > Why put any effort into avoiding alloca() in the first place? Is it > > inefficient on some platforms? On arm it's like 5 instructions, it just > > adjusts the size to keep the stack dword-aligned and subtracts the > > result from sp, done. > > Because it's non-standard and the alloca(3) man page discourages it: > _____ > ... > BUGS > The alloca() function is machine and compiler dependent; its use is dis- > couraged. > > ____ > > It is not disappearing anytime soon though, some even say the man > page is wrong. Given all the alternative implementations and concerns, it seems like alloca() is a lot simpler to use. I suspect it isn't going away anytime soon, either. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 16:25:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3C65C09; Mon, 16 Feb 2015 16:25:02 +0000 (UTC) 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 BDCF2DCF; Mon, 16 Feb 2015 16:25:02 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BC937B949; Mon, 16 Feb 2015 11:25:01 -0500 (EST) From: John Baldwin To: John-Mark Gurney Subject: Re: svn commit: r278830 - head/usr.sbin/devctl Date: Mon, 16 Feb 2015 11:04:29 -0500 Message-ID: <4375684.e5saVYVVqV@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201502160220.t1G2KCwN003778@svn.freebsd.org> References: <201502160220.t1G2KCwN003778@svn.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, 16 Feb 2015 11:25:01 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 16:25:03 -0000 On Monday, February 16, 2015 02:20:12 AM John-Mark Gurney wrote: > Author: jmg > Date: Mon Feb 16 02:20:11 2015 > New Revision: 278830 > URL: https://svnweb.freebsd.org/changeset/base/278830 > > Log: > install the man page... > > Sponsored by: FreeBSD Foundation Doh, thanks! -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 16:30:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C1CDD5; Mon, 16 Feb 2015 16:30:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1D7C9E31; Mon, 16 Feb 2015 16:30:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GGUgGq013576; Mon, 16 Feb 2015 16:30:42 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GGUg43013575; Mon, 16 Feb 2015 16:30:42 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201502161630.t1GGUg43013575@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Mon, 16 Feb 2015 16:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278854 - head/sys/x86/xen 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 16:30:43 -0000 Author: royger Date: Mon Feb 16 16:30:42 2015 New Revision: 278854 URL: https://svnweb.freebsd.org/changeset/base/278854 Log: xen/intr: improve PIRQ handling Improve and cleanup the Xen PIRQ event channel code: - Remove the xi_shared field as it is unused. - Clean the "pending" bit in the EOI handler, this is more similar to how native interrupts are handled. - Don't mask edge triggered PIRQs, edge trigger interrupts cannot be masked. - Panic if PHYSDEVOP_eoi fails. - Remove the usage of the PHYSDEVOP_alloc_irq_vector hypercall because it's just a no-op in the Xen versions that are supported by FreeBSD Dom0. Sponsored by: Citrix Systems R&D Modified: head/sys/x86/xen/xen_intr.c Modified: head/sys/x86/xen/xen_intr.c ============================================================================== --- head/sys/x86/xen/xen_intr.c Mon Feb 16 15:47:55 2015 (r278853) +++ head/sys/x86/xen/xen_intr.c Mon Feb 16 16:30:42 2015 (r278854) @@ -126,7 +126,6 @@ struct xenisrc { int xi_virq; void *xi_cookie; u_int xi_close:1; /* close on unbind? */ - u_int xi_shared:1; /* Shared with other domains. */ u_int xi_activehi:1; u_int xi_edgetrigger:1; }; @@ -579,11 +578,12 @@ xen_intr_handle_upcall(struct trapframe /* process port */ port = (l1i * LONG_BIT) + l2i; - synch_clear_bit(port, &s->evtchn_pending[0]); isrc = xen_intr_port_to_isrc[port]; - if (__predict_false(isrc == NULL)) + if (__predict_false(isrc == NULL)) { + synch_clear_bit(port, &s->evtchn_pending[0]); continue; + } /* Make sure we are firing on the right vCPU */ KASSERT((isrc->xi_cpu == PCPU_GET(cpuid)), @@ -932,6 +932,9 @@ out: static void xen_intr_disable_source(struct intsrc *isrc, int eoi) { + + if (eoi == PIC_EOI) + xen_intr_eoi_source(isrc); } /* @@ -950,8 +953,13 @@ xen_intr_enable_source(struct intsrc *is * \param isrc The interrupt source to EOI. */ static void -xen_intr_eoi_source(struct intsrc *isrc) +xen_intr_eoi_source(struct intsrc *base_isrc) { + struct xenisrc *isrc; + + isrc = (struct xenisrc *)base_isrc; + synch_clear_bit(isrc->xi_port, + &HYPERVISOR_shared_info->evtchn_pending[0]); } /* @@ -981,8 +989,9 @@ xen_intr_pirq_disable_source(struct ints struct xenisrc *isrc; isrc = (struct xenisrc *)base_isrc; - evtchn_mask_port(isrc->xi_port); + if (isrc->xi_edgetrigger == 0) + evtchn_mask_port(isrc->xi_port); if (eoi == PIC_EOI) xen_intr_pirq_eoi_source(base_isrc); } @@ -998,7 +1007,9 @@ xen_intr_pirq_enable_source(struct intsr struct xenisrc *isrc; isrc = (struct xenisrc *)base_isrc; - evtchn_unmask_port(isrc->xi_port); + + if (isrc->xi_edgetrigger == 0) + evtchn_unmask_port(isrc->xi_port); } /* @@ -1010,13 +1021,19 @@ static void xen_intr_pirq_eoi_source(struct intsrc *base_isrc) { struct xenisrc *isrc; + int error; - /* XXX Use shared page of flags for this. */ isrc = (struct xenisrc *)base_isrc; + + synch_clear_bit(isrc->xi_port, + &HYPERVISOR_shared_info->evtchn_pending[0]); if (test_bit(isrc->xi_pirq, xen_intr_pirq_eoi_map)) { struct physdev_eoi eoi = { .irq = isrc->xi_pirq }; - (void)HYPERVISOR_physdev_op(PHYSDEVOP_eoi, &eoi); + error = HYPERVISOR_physdev_op(PHYSDEVOP_eoi, &eoi); + if (error != 0) + panic("Unable to EOI PIRQ#%d: %d\n", + isrc->xi_pirq, error); } } @@ -1361,7 +1378,6 @@ int xen_register_pirq(int vector, enum intr_trigger trig, enum intr_polarity pol) { struct physdev_map_pirq map_pirq; - struct physdev_irq alloc_pirq; struct xenisrc *isrc; int error; @@ -1382,14 +1398,6 @@ xen_register_pirq(int vector, enum intr_ return (error); } - alloc_pirq.irq = vector; - alloc_pirq.vector = 0; - error = HYPERVISOR_physdev_op(PHYSDEVOP_alloc_irq_vector, &alloc_pirq); - if (error) { - printf("xen: unable to alloc PIRQ for IRQ#%d\n", vector); - return (error); - } - mtx_lock(&xen_intr_isrc_lock); isrc = xen_intr_alloc_isrc(EVTCHN_TYPE_PIRQ, vector); mtx_unlock(&xen_intr_isrc_lock); @@ -1432,6 +1440,8 @@ xen_register_msi(device_t dev, int vecto KASSERT(isrc != NULL, ("xen: unable to allocate isrc for interrupt")); isrc->xi_pirq = msi_irq.pirq + i; + /* MSI interrupts are always edge triggered */ + isrc->xi_edgetrigger = 1; } mtx_unlock(&xen_intr_isrc_lock); @@ -1573,10 +1583,9 @@ xen_intr_dump_port(struct xenisrc *isrc) isrc->xi_port, xen_intr_print_type(isrc->xi_type)); if (isrc->xi_type == EVTCHN_TYPE_PIRQ) { db_printf("\tPirq: %d ActiveHi: %d EdgeTrigger: %d " - "NeedsEOI: %d Shared: %d\n", + "NeedsEOI: %d\n", isrc->xi_pirq, isrc->xi_activehi, isrc->xi_edgetrigger, - !!test_bit(isrc->xi_pirq, xen_intr_pirq_eoi_map), - isrc->xi_shared); + !!test_bit(isrc->xi_pirq, xen_intr_pirq_eoi_map)); } if (isrc->xi_type == EVTCHN_TYPE_VIRQ) db_printf("\tVirq: %d\n", isrc->xi_virq); From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 16:38:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E10CA2F8; Mon, 16 Feb 2015 16:38:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B337DF1B; Mon, 16 Feb 2015 16:38:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GGc0oA016969; Mon, 16 Feb 2015 16:38:00 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GGc0P2016968; Mon, 16 Feb 2015 16:38:00 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201502161638.t1GGc0P2016968@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Mon, 16 Feb 2015 16:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278855 - head/sys/x86/xen 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 16:38:01 -0000 Author: royger Date: Mon Feb 16 16:37:59 2015 New Revision: 278855 URL: https://svnweb.freebsd.org/changeset/base/278855 Log: xen/intr: improve handling of legacy IRQs Devices that use ISA IRQs expect them to be already configured, and don't call bus_config_intr, which prevents those IRQs from working on Xen. In order to solve it pre-register all the legacy IRQs with the default values (edge triggered, low polarity) if no override is found. While there add a panic if the registration of an interrupt override fails. Sponsored by: Citrix Systems R&D Modified: head/sys/x86/xen/pvcpu_enum.c Modified: head/sys/x86/xen/pvcpu_enum.c ============================================================================== --- head/sys/x86/xen/pvcpu_enum.c Mon Feb 16 16:30:42 2015 (r278854) +++ head/sys/x86/xen/pvcpu_enum.c Mon Feb 16 16:37:59 2015 (r278855) @@ -81,6 +81,7 @@ madt_parse_interrupt_override(ACPI_MADT_ { enum intr_trigger trig; enum intr_polarity pol; + int ret; if (acpi_quirks & ACPI_Q_MADT_IRQ0 && intr->SourceIrq == 0 && intr->GlobalIrq == 2) { @@ -101,7 +102,9 @@ madt_parse_interrupt_override(ACPI_MADT_ acpi_OverrideInterruptLevel(intr->GlobalIrq); /* Register the IRQ with the polarity and trigger mode found. */ - xen_register_pirq(intr->GlobalIrq, trig, pol); + ret = xen_register_pirq(intr->GlobalIrq, trig, pol); + if (ret != 0) + panic("Unable to register interrupt override"); } /* @@ -175,7 +178,7 @@ xenpv_setup_io(void) { if (xen_initial_domain()) { - int i; + int i, ret; /* Map MADT */ madt_physaddr = acpi_find_table(ACPI_SIG_MADT); @@ -201,8 +204,21 @@ xenpv_setup_io(void) if (!madt_found_sci_override) { printf( "MADT: Forcing active-low polarity and level trigger for SCI\n"); - xen_register_pirq(AcpiGbl_FADT.SciInterrupt, + ret = xen_register_pirq(AcpiGbl_FADT.SciInterrupt, INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW); + if (ret != 0) + panic("Unable to register SCI IRQ"); + } + + /* Register legacy ISA IRQs */ + for (i = 1; i < 16; i++) { + if (intr_lookup_source(i) != NULL) + continue; + ret = xen_register_pirq(i, INTR_TRIGGER_EDGE, + INTR_POLARITY_LOW); + if (ret != 0 && bootverbose) + printf("Unable to register legacy IRQ#%d: %d\n", + i, ret); } acpi_SetDefaultIntrModel(ACPI_INTR_APIC); From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 17:06:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B612A2B; Mon, 16 Feb 2015 17:06:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 76AD0271; Mon, 16 Feb 2015 17:06:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GH60DK030711; Mon, 16 Feb 2015 17:06:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GH60ps030710; Mon, 16 Feb 2015 17:06:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502161706.t1GH60ps030710@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 16 Feb 2015 17:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278856 - head/sys/ofed/drivers/net/mlx4 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 17:06:00 -0000 Author: hselasky Date: Mon Feb 16 17:05:59 2015 New Revision: 278856 URL: https://svnweb.freebsd.org/changeset/base/278856 Log: The "frag_info" pointer is already pointing to an array index. Don't index twice. Sponsored by: Mellanox Technologies MFC after: 3 days Modified: head/sys/ofed/drivers/net/mlx4/en_rx.c Modified: head/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_rx.c Mon Feb 16 16:37:59 2015 (r278855) +++ head/sys/ofed/drivers/net/mlx4/en_rx.c Mon Feb 16 17:05:59 2015 (r278856) @@ -492,7 +492,7 @@ static int mlx4_en_complete_rx_desc(stru if (nr) mb->m_next = mb_list[nr]; mb = mb_list[nr]; - mb->m_len = frag_info[nr].frag_size; + mb->m_len = frag_info->frag_size; dma = be64_to_cpu(rx_desc->data[nr].addr); /* Allocate a replacement page */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 17:19:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFA5AE91; Mon, 16 Feb 2015 17:19:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9B04C3C4; Mon, 16 Feb 2015 17:19:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GHJTS4035808; Mon, 16 Feb 2015 17:19:29 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GHJTer035807; Mon, 16 Feb 2015 17:19:29 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201502161719.t1GHJTer035807@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Mon, 16 Feb 2015 17:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278857 - head/usr.bin/kdump 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 17:19:29 -0000 Author: pluknet Date: Mon Feb 16 17:19:28 2015 New Revision: 278857 URL: https://svnweb.freebsd.org/changeset/base/278857 Log: kdump: sendfile(2) "flags" argument needs casting on 64-bit platforms. MFC after: 1 week Sponsored by: Nginx, Inc. Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Mon Feb 16 17:05:59 2015 (r278856) +++ head/usr.bin/kdump/kdump.c Mon Feb 16 17:19:28 2015 (r278857) @@ -1155,7 +1155,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in print_number(ip, narg, c); print_number(ip, narg, c); putchar(','); - sendfileflagsname(*ip); + sendfileflagsname(*(int *)ip); ip++; narg--; break; From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 17:47:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 078754EA; Mon, 16 Feb 2015 17:47:05 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 9D8A5887; Mon, 16 Feb 2015 17:47:04 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t1GHkw71084598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 16 Feb 2015 19:46:58 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t1GHkw71084598 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t1GHkwCY084597; Mon, 16 Feb 2015 19:46:58 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 16 Feb 2015 19:46:58 +0200 From: Konstantin Belousov To: Koop Mast Subject: Re: svn commit: r278473 - in head/sys: amd64/amd64 amd64/include amd64/vmm contrib/dev/acpica/include i386/i386 i386/include x86/acpica x86/include x86/x86 x86/xen Message-ID: <20150216174658.GI34251@kib.kiev.ua> References: <201502092100.t19L0vsv010944@svn.freebsd.org> <54E1FCD0.6000500@rainbow-runner.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54E1FCD0.6000500@rainbow-runner.nl> User-Agent: Mutt/1.5.23 (2014-03-12) 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.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 17:47:05 -0000 On Mon, Feb 16, 2015 at 03:21:04PM +0100, Koop Mast wrote: > On 9-2-2015 22:00, Konstantin Belousov wrote: > > Author: kib > > Date: Mon Feb 9 21:00:56 2015 > > New Revision: 278473 > > URL: https://svnweb.freebsd.org/changeset/base/278473 > > > > Log: > > Add x2APIC support. Enable it by default if CPU is capable. The > > hw.x2apic_enable tunable allows disabling it from the loader prompt. > > Hi Konstantin, > > This commit broke my Sandybridge laptop. If x2APIC is enabled the kernel > freezes after the > "ACPI APIC Table: <_ASUS_ NoteBook>" line is printed. I can't get much > information out of it since I couldn't get into the kernel debugger nor > has the machine a serial cable. Can you provide e.g. a photo of the machine screen with the hang boot, of the same kernel you used for the dmesg log below ? Also, please provide the output of acpidump -t. > > I did notice that "x2APIC" is listed in the CPU Features2 list, but for > the cpu's it reports "x2APIC: 0". I don't know if this has to do with > disabled x2APIC or some hardware/bios issue? x2APIC tag for the LAPIC reports appear when cpu declares support for x2APIC mode, like in your case. The 0/1 indicates the final value used by kernel, i.e. 0 means disabled, by user override (your case), by BIOS request, or due to detection of incompatible hypervisor. > > -Koop > > Verbose dmesg with x2APIC disabled: > https://people.freebsd.org/~kwm/dmesg-x2apic.txt Also, please try the following patch. Only the local_apic.c chunk could matter for you. diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 13c3d43..b767691 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -1507,6 +1507,7 @@ cpususpend_handler(void) vmm_resume_p(); /* Resume MCA and local APIC */ + lapic_xapic_mode(); mca_resume(); lapic_setup(0); diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index 32b9540..a80de54 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -1555,6 +1555,7 @@ cpususpend_handler(void) cpu_ops.cpu_resume(); /* Resume MCA and local APIC */ + lapic_xapic_mode(); mca_resume(); lapic_setup(0); diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/x86/acpica/acpi_wakeup.c index 74522be..e652419 100644 --- a/sys/x86/acpica/acpi_wakeup.c +++ b/sys/x86/acpica/acpi_wakeup.c @@ -270,6 +270,7 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, initializecpu(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); + lapic_xapic_mode(); #ifdef SMP if (!CPU_EMPTY(&suspcpus)) acpi_wakeup_cpus(sc); diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index 1809fa6..1b66674 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -527,7 +527,6 @@ native_lapic_xapic_mode(void) saveintr = intr_disable(); if (x2apic_mode) native_lapic_enable_x2apic(); - native_lapic_disable(); intr_restore(saveintr); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 18:06:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43E4E928; Mon, 16 Feb 2015 18:06:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2F815A4B; Mon, 16 Feb 2015 18:06:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GI6PXY058916; Mon, 16 Feb 2015 18:06:25 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GI6PZh058915; Mon, 16 Feb 2015 18:06:25 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201502161806.t1GI6PZh058915@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Mon, 16 Feb 2015 18:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278858 - 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 18:06:25 -0000 Author: brd (doc committer) Date: Mon Feb 16 18:06:24 2015 New Revision: 278858 URL: https://svnweb.freebsd.org/changeset/base/278858 Log: Fix build. Approved by: gibbs Modified: head/sys/net/pfvar.h Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Mon Feb 16 17:19:28 2015 (r278857) +++ head/sys/net/pfvar.h Mon Feb 16 18:06:24 2015 (r278858) @@ -1574,6 +1574,7 @@ int pf_test6(int, struct ifnet *, struct void pf_poolmask(struct pf_addr *, struct pf_addr*, struct pf_addr *, struct pf_addr *, u_int8_t); void pf_addr_inc(struct pf_addr *, sa_family_t); +int pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag); #endif /* INET6 */ u_int32_t pf_new_isn(struct pf_state *); From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 18:33:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4CFDEA1; Mon, 16 Feb 2015 18:33:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8F918D8C; Mon, 16 Feb 2015 18:33:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GIXYfe072703; Mon, 16 Feb 2015 18:33:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GIXYiW072702; Mon, 16 Feb 2015 18:33:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502161833.t1GIXYiW072702@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 16 Feb 2015 18:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278859 - 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 18:33:34 -0000 Author: glebius Date: Mon Feb 16 18:33:33 2015 New Revision: 278859 URL: https://svnweb.freebsd.org/changeset/base/278859 Log: Commit a miss from r278843. Pointy hat to: glebius Modified: head/sys/net/pfvar.h Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Mon Feb 16 18:06:24 2015 (r278858) +++ head/sys/net/pfvar.h Mon Feb 16 18:33:33 2015 (r278859) @@ -1589,6 +1589,7 @@ int pf_match_addr_range(struct pf_addr * int pf_match_port(u_int8_t, u_int16_t, u_int16_t, u_int16_t); void pf_normalize_init(void); +int pf_refragment6(struct ifnet *, struct mbuf **, struct m_tag *mtag); void pf_normalize_cleanup(void); int pf_normalize_ip(struct mbuf **, int, struct pfi_kif *, u_short *, struct pf_pdesc *); From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 18:42:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91347198; Mon, 16 Feb 2015 18:42:13 +0000 (UTC) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 305971D2C; Mon, 16 Feb 2015 18:42:13 +0000 (UTC) Message-ID: <54E23A04.4050403@FreeBSD.org> Date: Mon, 16 Feb 2015 13:42:12 -0500 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278859 - head/sys/net References: <201502161833.t1GIXYiW072702@svn.freebsd.org> In-Reply-To: <201502161833.t1GIXYiW072702@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 18:42:13 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 02/16/2015 13:33, Gleb Smirnoff wrote: > Author: glebius Date: Mon Feb 16 18:33:33 2015 New Revision: > 278859 URL: https://svnweb.freebsd.org/changeset/base/278859 > > Log: Commit a miss from r278843. > > Pointy hat to: glebius ??? Please see r278858. https://svnweb.freebsd.org/changeset/base/278858 Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJU4jn/AAoJEHyflib82/FGgggH/0JUWxX89xj2zVFG5hgeo84Z aD8TpsnOK0/8HJJr582jaey7r6SBUQXKZIC/YwDZf34tDOofGNm7EnGkwIsqglc6 7YAQA/7zxZXP5s+ybos8ufnwqzyvjam4aj+aI8OgjNGlU73lhNs8pjd+0posiRFE eWJloZtYJGtuiEVRC6OsusOXJd2eeCnG6psm9CReOn1RlXV4x6yPRyffwWpJBS8o 831HRR2I007+S/8XQLlux7CB4mODl2GucGDavkOCR7V6DA/na86Wur6uRMHAMhA7 HCf9a41aARmAmkituQvocy8r8n0A2rJ/lyuq7pNW7vWzyq5p/3SUddtWjxZVoI4= =BZfA -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 18:43:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A0F02E4; Mon, 16 Feb 2015 18:43:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 84FA9E7E; Mon, 16 Feb 2015 18:43:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GIhr2e077429; Mon, 16 Feb 2015 18:43:53 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GIhrQ1077428; Mon, 16 Feb 2015 18:43:53 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201502161843.t1GIhrQ1077428@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Mon, 16 Feb 2015 18:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278860 - head/sys/dev/pci 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 18:43:53 -0000 Author: jmg Date: Mon Feb 16 18:43:52 2015 New Revision: 278860 URL: https://svnweb.freebsd.org/changeset/base/278860 Log: remove NULL check as M_WAITOK will not return NULL Reviewed by: jhb Sponsored by: FreeBSD Foundation Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Feb 16 18:33:33 2015 (r278859) +++ head/sys/dev/pci/pci.c Mon Feb 16 18:43:52 2015 (r278860) @@ -605,8 +605,6 @@ pci_read_device(device_t pcib, int d, in if (REG(PCIR_DEVVENDOR, 4) != 0xfffffffful) { devlist_entry = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO); - if (devlist_entry == NULL) - return (NULL); cfg = &devlist_entry->cfg; From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 19:06:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 714CFA57; Mon, 16 Feb 2015 19:06:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5BA19CB; Mon, 16 Feb 2015 19:06:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GJ6WaN087362; Mon, 16 Feb 2015 19:06:32 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GJ6VE9087360; Mon, 16 Feb 2015 19:06:31 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201502161906.t1GJ6VE9087360@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 16 Feb 2015 19:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278861 - head/sys/arm/broadcom/bcm2835 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 19:06:32 -0000 Author: loos Date: Mon Feb 16 19:06:31 2015 New Revision: 278861 URL: https://svnweb.freebsd.org/changeset/base/278861 Log: Add a mask to match only the relative base address of BSC controllers. This should fix the attach of BSC on RPI2 (based on andrew@ dmesg). Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Mon Feb 16 18:43:52 2015 (r278860) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Mon Feb 16 19:06:31 2015 (r278861) @@ -247,7 +247,7 @@ bcm_bsc_attach(device_t dev) /* Check the unit we are attaching by its base address. */ start = rman_get_start(sc->sc_mem_res); for (i = 0; i < nitems(bcm_bsc_pins); i++) { - if (bcm_bsc_pins[i].start == start) + if (bcm_bsc_pins[i].start == (start & BCM_BSC_BASE_MASK)) break; } if (i == nitems(bcm_bsc_pins)) { Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h Mon Feb 16 18:43:52 2015 (r278860) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h Mon Feb 16 19:06:31 2015 (r278861) @@ -35,9 +35,10 @@ struct { uint32_t scl; unsigned long start; } bcm_bsc_pins[] = { - { 0, 1, 0x20205000 }, /* BSC0 GPIO pins and base address. */ - { 2, 3, 0x20804000 } /* BSC1 GPIO pins and base address. */ + { 0, 1, 0x205000 }, /* BSC0 GPIO pins and base address. */ + { 2, 3, 0x804000 } /* BSC1 GPIO pins and base address. */ }; +#define BCM_BSC_BASE_MASK 0x00ffffff struct bcm_bsc_softc { device_t sc_dev; From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 19:26:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F1AAFE3; Mon, 16 Feb 2015 19:26:58 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D6B482F0; Mon, 16 Feb 2015 19:26:57 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1GJQsGH055635 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 16 Feb 2015 22:26:54 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1GJQstu055634; Mon, 16 Feb 2015 22:26:54 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 16 Feb 2015 22:26:54 +0300 From: Gleb Smirnoff To: Julian Elischer Subject: Re: svn commit: r278640 - head/sys/netgraph Message-ID: <20150216192653.GI15484@FreeBSD.org> References: <201502122220.t1CMKY8t040498@svn.freebsd.org> <20150214000540.GI15484@FreeBSD.org> <54E1D03A.2070904@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54E1D03A.2070904@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, mav@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 19:26:58 -0000 On Mon, Feb 16, 2015 at 03:10:50AM -0800, Julian Elischer wrote: J> On 2/13/15 4:05 PM, Gleb Smirnoff wrote: J> > Hi! J> > J> > On Thu, Feb 12, 2015 at 10:20:34PM +0000, Gleb Smirnoff wrote: J> > T> Author: glebius J> > T> Date: Thu Feb 12 22:20:34 2015 J> > T> New Revision: 278640 J> > T> URL: https://svnweb.freebsd.org/changeset/base/278640 J> > T> J> > T> Log: J> > T> Revise default limit for maximum of netgraph data items. J> > T> With modern internet speeds the limit can be reached even J> > T> on a single L2TP link. J> > J> > Actually any ng_item of data type requires an mbuf to be connected J> > to it, and thus I suggest to use mbuf limits to drive ng_item limits. J> > J> > If we got an item leak with mbufs being properly freed, then we've J> > got a bug to fix, and any limit won't work in long run time. I never J> > evidenced such a bug, but there complaints on hitting limit at J> > traffic bursts. As said, with previous 512 item limit I experienced J> > that even on a laptop. J> > J> > Any objections on removing the limit, guys? J> maybe derived from it, but not the same number. J> maybe change the systctl to define the relationship? I guess you want to have ng_items limit smaller than mbuf limit? How smaller? What problem are we actually guarding against putting this limit? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 19:31:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8843E473; Mon, 16 Feb 2015 19:31:57 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 111DC3FD; Mon, 16 Feb 2015 19:31:56 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1GJVswZ055674 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 16 Feb 2015 22:31:54 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1GJVsoi055673; Mon, 16 Feb 2015 22:31:54 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 16 Feb 2015 22:31:54 +0300 From: Gleb Smirnoff To: Brad Davis Subject: Re: svn commit: r278858 - head/sys/net Message-ID: <20150216193154.GJ15484@FreeBSD.org> References: <201502161806.t1GI6PZh058915@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502161806.t1GI6PZh058915@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 19:31:57 -0000 On Mon, Feb 16, 2015 at 06:06:25PM +0000, Brad Davis wrote: B> Author: brd (doc committer) B> Date: Mon Feb 16 18:06:24 2015 B> New Revision: 278858 B> URL: https://svnweb.freebsd.org/changeset/base/278858 B> B> Log: B> Fix build. B> B> Approved by: gibbs Thanks, Brad and Justin. My failure. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 19:37:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91840779; Mon, 16 Feb 2015 19:37:45 +0000 (UTC) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) (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 181B7617; Mon, 16 Feb 2015 19:37:44 +0000 (UTC) Received: by lbdu14 with SMTP id u14so511309lbd.1; Mon, 16 Feb 2015 11:37:37 -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=23IK7RmD+PCY4afsJXXjMzxyn5iNL1Ox/ghbCT9bGOM=; b=XaL6a5aMGniRhH7dVX4fq/sv66VsQ+xl1IZOgRnvCZ84WCpEogIr5c+1mHSeTjhYJo kFetcN7AD6LM4XJ0oTQ8I3aYS/zc3ZLeDO36hTktxSTI/3uAuXizxHp+NCdx0oxmPmWh 2oE8v87V85zGl5yHWGscfFaAJrkXCvoAwA2LO0CIDaoq7Du1G2NLQrU6c4lKkNs6b9qB PrGpJah/cXG+ue1s3TeeuwU/cR+nWVtim3fFS6p0hBs6KEtSDNxKc2A7IBYHPrTzn41J Blaz0fq53TjmPFx0owQzJVPXjzJYc6y/i64QmtcJIAqrEe3iL34ZpCqTJXhihwM+K0wk UkGQ== MIME-Version: 1.0 X-Received: by 10.152.87.84 with SMTP id v20mr25117666laz.81.1424115457092; Mon, 16 Feb 2015 11:37:37 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.28.40 with HTTP; Mon, 16 Feb 2015 11:37:37 -0800 (PST) In-Reply-To: <20150216193154.GJ15484@FreeBSD.org> References: <201502161806.t1GI6PZh058915@svn.freebsd.org> <20150216193154.GJ15484@FreeBSD.org> Date: Mon, 16 Feb 2015 11:37:37 -0800 X-Google-Sender-Auth: ZtJ3x-lxDlGrk0a5yTaw1p6U4-A Message-ID: Subject: Re: svn commit: r278858 - head/sys/net From: Craig Rodrigues To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Brad Davis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 19:37:45 -0000 On Mon, Feb 16, 2015 at 11:31 AM, Gleb Smirnoff wrote: > On Mon, Feb 16, 2015 at 06:06:25PM +0000, Brad Davis wrote: > B> Author: brd (doc committer) > B> Date: Mon Feb 16 18:06:24 2015 > B> New Revision: 278858 > B> URL: https://svnweb.freebsd.org/changeset/base/278858 > B> > B> Log: > B> Fix build. > B> > B> Approved by: gibbs > > Thanks, Brad and Justin. My failure. > I think it is hilarious that you criticized me for breaking the build in PF, and at *almost the same time*, you broke the build in PF. LOL! Hopefully, we can move on from this and get everyone's fixes in to help improve the PF code. -- Craig From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 19:43:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DA639FA for ; Mon, 16 Feb 2015 19:43:16 +0000 (UTC) Received: from mail-we0-f180.google.com (mail-we0-f180.google.com [74.125.82.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 895FD6DE for ; Mon, 16 Feb 2015 19:43:15 +0000 (UTC) Received: by mail-we0-f180.google.com with SMTP id k11so31050858wes.11 for ; Mon, 16 Feb 2015 11:43:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=Gjq4wbPAhGDW+/o+JjbvmKCbS+50zUb6Zh3JEQgF//w=; b=eq9pnn37TnTg9PQ2EzEVbzs5phdzpf/1ZlliydgWyzk2ofdRcvZZno6DS0byVKWj+o jElyxgh069vZACeq2pbN9dgiq6QG5dgBePcczGd4mzcDMkwenAmKVWhIe0OyuQ4/TUWo FKAAIGJhten6IE/2uHsLqsUYNaY3EK5GQVGVpNOdt8cAUkeI9560jyY4z4WF3YUjixGr wR1XkNW8Z5EF1BUPxBnlywJeoZ7BH00Aly+RfOnIs+pXoX4YRpaWosjKq537FklO98xn P8HUiBqmDKdjGW6GE9pG2Lh0kNnMOgQ9uUzW2IYJ5mRwbHbIM0rMxpuqCn1carO1UVne AyYw== X-Gm-Message-State: ALoCoQkFrXhjb3D5pka43tzADqFQSXrBXgcx7zRaD8LzZVG6Mvr3rikYsPXtKIW44nZHpZH363av X-Received: by 10.194.176.33 with SMTP id cf1mr51351224wjc.19.1424115788385; Mon, 16 Feb 2015 11:43:08 -0800 (PST) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by mx.google.com with ESMTPSA id a5sm17011799wib.20.2015.02.16.11.43.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Feb 2015 11:43:07 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Message-ID: <54E24845.8050809@freebsd.org> Date: Mon, 16 Feb 2015 19:43:01 +0000 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Craig Rodrigues , Gleb Smirnoff Subject: Re: svn commit: r278858 - head/sys/net References: <201502161806.t1GI6PZh058915@svn.freebsd.org> <20150216193154.GJ15484@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Brad Davis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 19:43:16 -0000 On 16/02/2015 19:37, Craig Rodrigues wrote: > > > On Mon, Feb 16, 2015 at 11:31 AM, Gleb Smirnoff > wrote: > > On Mon, Feb 16, 2015 at 06:06:25PM +0000, Brad Davis wrote: > B> Author: brd (doc committer) > B> Date: Mon Feb 16 18:06:24 2015 > B> New Revision: 278858 > B> URL: https://svnweb.freebsd.org/changeset/base/278858 > B> > B> Log: > B> Fix build. > B> > B> Approved by: gibbs > > Thanks, Brad and Justin. My failure. > > > > I think it is hilarious that you criticized me for breaking the build > in PF, > and at *almost the same time*, you broke the build in PF. LOL! > > Hopefully, we can move on from this and get everyone's fixes in to > help improve the PF code. > Everyone's human unless we did invent AI and no one told me ;-) From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 19:46:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 609E8BCC; Mon, 16 Feb 2015 19:46:34 +0000 (UTC) Received: from fep31.mx.upcmail.net (fep31.mx.upcmail.net [62.179.121.49]) by mx1.freebsd.org (Postfix) with ESMTP id 6602875B; Mon, 16 Feb 2015 19:46:32 +0000 (UTC) Received: from edge03.upcmail.net ([192.168.13.238]) by viefep31-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20150216194625.ILJI3302.viefep31-int.chello.at@edge03.upcmail.net>; Mon, 16 Feb 2015 20:46:25 +0100 Received: from [192.168.0.23] ([178.84.134.112]) by edge03.upcmail.net with edge id t7mP1p00U2Rg3Ey017mP3T; Mon, 16 Feb 2015 20:46:24 +0100 X-SourceIP: 178.84.134.112 Message-ID: <54E24907.9030400@rainbow-runner.nl> Date: Mon, 16 Feb 2015 20:46:15 +0100 From: Koop Mast User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r278473 - in head/sys: amd64/amd64 amd64/include amd64/vmm contrib/dev/acpica/include i386/i386 i386/include x86/acpica x86/include x86/x86 x86/xen References: <201502092100.t19L0vsv010944@svn.freebsd.org> <54E1FCD0.6000500@rainbow-runner.nl> <20150216174658.GI34251@kib.kiev.ua> In-Reply-To: <20150216174658.GI34251@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 19:46:34 -0000 On 16-2-2015 18:46, Konstantin Belousov wrote: > On Mon, Feb 16, 2015 at 03:21:04PM +0100, Koop Mast wrote: >> On 9-2-2015 22:00, Konstantin Belousov wrote: >>> Author: kib >>> Date: Mon Feb 9 21:00:56 2015 >>> New Revision: 278473 >>> URL: https://svnweb.freebsd.org/changeset/base/278473 >>> >>> Log: >>> Add x2APIC support. Enable it by default if CPU is capable. The >>> hw.x2apic_enable tunable allows disabling it from the loader prompt. >> Hi Konstantin, >> >> This commit broke my Sandybridge laptop. If x2APIC is enabled the kernel >> freezes after the >> "ACPI APIC Table: <_ASUS_ NoteBook>" line is printed. I can't get much >> information out of it since I couldn't get into the kernel debugger nor >> has the machine a serial cable. > Can you provide e.g. a photo of the machine screen with the hang boot, > of the same kernel you used for the dmesg log below ? > > Also, please provide the output of acpidump -t. https://people.freebsd.org/~kwm/x2apic/acpidump.txt https://people.freebsd.org/~kwm/x2apic/x2apic-boot.jpg The patch below didn't seem to have any noticable effect. -Koop > >> I did notice that "x2APIC" is listed in the CPU Features2 list, but for >> the cpu's it reports "x2APIC: 0". I don't know if this has to do with >> disabled x2APIC or some hardware/bios issue? > x2APIC tag for the LAPIC reports appear when cpu declares support for > x2APIC mode, like in your case. The 0/1 indicates the final value used > by kernel, i.e. 0 means disabled, by user override (your case), by BIOS > request, or due to detection of incompatible hypervisor. > >> -Koop >> >> Verbose dmesg with x2APIC disabled: >> https://people.freebsd.org/~kwm/dmesg-x2apic.txt > Also, please try the following patch. Only the local_apic.c chunk could > matter for you. > > diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c > index 13c3d43..b767691 100644 > --- a/sys/amd64/amd64/mp_machdep.c > +++ b/sys/amd64/amd64/mp_machdep.c > @@ -1507,6 +1507,7 @@ cpususpend_handler(void) > vmm_resume_p(); > > /* Resume MCA and local APIC */ > + lapic_xapic_mode(); > mca_resume(); > lapic_setup(0); > > diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c > index 32b9540..a80de54 100644 > --- a/sys/i386/i386/mp_machdep.c > +++ b/sys/i386/i386/mp_machdep.c > @@ -1555,6 +1555,7 @@ cpususpend_handler(void) > cpu_ops.cpu_resume(); > > /* Resume MCA and local APIC */ > + lapic_xapic_mode(); > mca_resume(); > lapic_setup(0); > > diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/x86/acpica/acpi_wakeup.c > index 74522be..e652419 100644 > --- a/sys/x86/acpica/acpi_wakeup.c > +++ b/sys/x86/acpica/acpi_wakeup.c > @@ -270,6 +270,7 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, > initializecpu(); > PCPU_SET(switchtime, 0); > PCPU_SET(switchticks, ticks); > + lapic_xapic_mode(); > #ifdef SMP > if (!CPU_EMPTY(&suspcpus)) > acpi_wakeup_cpus(sc); > diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c > index 1809fa6..1b66674 100644 > --- a/sys/x86/x86/local_apic.c > +++ b/sys/x86/x86/local_apic.c > @@ -527,7 +527,6 @@ native_lapic_xapic_mode(void) > saveintr = intr_disable(); > if (x2apic_mode) > native_lapic_enable_x2apic(); > - native_lapic_disable(); > intr_restore(saveintr); > } > From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 19:47:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C923D45; Mon, 16 Feb 2015 19:47:40 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5250F76E; Mon, 16 Feb 2015 19:47:40 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t1GJldCw017187 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 16 Feb 2015 11:47:39 -0800 (PST) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t1GJldE6017186; Mon, 16 Feb 2015 11:47:39 -0800 (PST) (envelope-from jmg) Date: Mon, 16 Feb 2015 11:47:38 -0800 From: John-Mark Gurney To: Craig Rodrigues Subject: Re: svn commit: r278858 - head/sys/net Message-ID: <20150216194738.GN1953@funkthat.com> References: <201502161806.t1GI6PZh058915@svn.freebsd.org> <20150216193154.GJ15484@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Mon, 16 Feb 2015 11:47:39 -0800 (PST) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Gleb Smirnoff , "src-committers@freebsd.org" , Brad Davis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 19:47:40 -0000 Craig Rodrigues wrote this message on Mon, Feb 16, 2015 at 11:37 -0800: > On Mon, Feb 16, 2015 at 11:31 AM, Gleb Smirnoff wrote: > > > On Mon, Feb 16, 2015 at 06:06:25PM +0000, Brad Davis wrote: > > B> Author: brd (doc committer) > > B> Date: Mon Feb 16 18:06:24 2015 > > B> New Revision: 278858 > > B> URL: https://svnweb.freebsd.org/changeset/base/278858 > > B> > > B> Log: > > B> Fix build. > > B> > > B> Approved by: gibbs > > > > Thanks, Brad and Justin. My failure. > > > > > I think it is hilarious that you criticized me for breaking the build in PF, > and at *almost the same time*, you broke the build in PF. LOL! > > Hopefully, we can move on from this and get everyone's fixes in to help > improve the PF code. There's this box in the cluster called ref10-amd64 that is available w/ many cores, and it's motd tells you how to do a buildworld or tinderbox on it. Please use it! -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 19:53:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F535F4; Mon, 16 Feb 2015 19:53:31 +0000 (UTC) Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) (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 20EEC859; Mon, 16 Feb 2015 19:53:30 +0000 (UTC) Received: by iecrd18 with SMTP id rd18so36202830iec.5; Mon, 16 Feb 2015 11:53:24 -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 :message-id:references:to; bh=smfLMJsm1VXWN+jc4/410y4PbaX69dS6UfuxazWBEzI=; b=gn66MbpPyxASaZxJSG8nEl531fgHWXXpquzfWJen8G4SMptYQlrVRcQAGOAhN65Xv0 oxS8ZuVbqHG4UQo5DhzH9ce3hgB4cmZQAQAa6un6/fXtysIBDfgWrZ4GBwdroIABaTt9 9XkPt8493RyN5j414Cl89ZWQy4JgRWpJwaifTmJ+W2qYU3s+bUSL+TNYrIlSg79i7qmW 0CaR5rB+C2H446R1gadfpp/Cap1fDy8cUu8cocNtDm7ETYX/nK8MaePpfZjQ3XjniNSi jB8+CSuLxA2FH4ueM5IUuJiuwbBEdozy/NRKJjzgnosyasRoN83UMpWllK637eNAEXIe Bkvg== X-Received: by 10.42.109.20 with SMTP id j20mr30397791icp.27.1424116404619; Mon, 16 Feb 2015 11:53:24 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:747e:3a53:5473:32c? ([2601:8:ab80:7d6:747e:3a53:5473:32c]) by mx.google.com with ESMTPSA id f11sm10004819iof.16.2015.02.16.11.53.23 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Feb 2015 11:53:24 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_132766F2-5894-4566-AA76-4945D2983BDE"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r278858 - head/sys/net From: Garrett Cooper In-Reply-To: <20150216194738.GN1953@funkthat.com> Date: Mon, 16 Feb 2015 11:53:22 -0800 Message-Id: References: <201502161806.t1GI6PZh058915@svn.freebsd.org> <20150216193154.GJ15484@FreeBSD.org> <20150216194738.GN1953@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.1878.6) Cc: Craig Rodrigues , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Brad Davis , Gleb Smirnoff , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 19:53:31 -0000 --Apple-Mail=_132766F2-5894-4566-AA76-4945D2983BDE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Feb 16, 2015, at 11:47, John-Mark Gurney wrote: > Craig Rodrigues wrote this message on Mon, Feb 16, 2015 at 11:37 = -0800: >> On Mon, Feb 16, 2015 at 11:31 AM, Gleb Smirnoff = wrote: >>=20 >>> On Mon, Feb 16, 2015 at 06:06:25PM +0000, Brad Davis wrote: >>> B> Author: brd (doc committer) >>> B> Date: Mon Feb 16 18:06:24 2015 >>> B> New Revision: 278858 >>> B> URL: https://svnweb.freebsd.org/changeset/base/278858 >>> B> >>> B> Log: >>> B> Fix build. >>> B> >>> B> Approved by: gibbs >>>=20 >>> Thanks, Brad and Justin. My failure. >>>=20 >>=20 >>=20 >> I think it is hilarious that you criticized me for breaking the build = in PF, >> and at *almost the same time*, you broke the build in PF. LOL! >>=20 >> Hopefully, we can move on from this and get everyone's fixes in to = help >> improve the PF code. >=20 > There's this box in the cluster called ref10-amd64 that is available > w/ many cores, and it's motd tells you how to do a buildworld or > tinderbox on it. >=20 > Please use it! Yeah, I need to as well. In the meantime, can one or both of the commits be removed so some = =93smart compiler warnings=94 don=92t come along and warn of a duplicate = declaration in the future :)? --Apple-Mail=_132766F2-5894-4566-AA76-4945D2983BDE Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJU4kqyAAoJEMZr5QU6S73ehhMIAIOW3zQI8JuTGtvqx9krXzHx AlpAf9f2Ter7dgVZEml1j+6gYWDtmKoo3l5Ayk6nUPJe3+4E04o+ftRfUARWN/Kx XvIrVtKKRW6HD4It59SrNHFtYuR5XFGBhunnklN2/KVAbj1krfV7pBHnyg0dnbvw UXwq1hqpIxlNRTmYmjPRQlmtq1mNBAuqTLW9M2GjZbZcuy2c26CMilyIN2pKG9UY 6gHdduGptFj2uU3uOAuyJ+iREaBjHf74HzvJobzoYRqGQ9hAmZgsYrCjL7Vjuqim zx/Ep20IW7b71J4edchPqJhSHp7Ey4qon3NwaXRjr6lFtu/SqQmYho8GHYFgOfY= =ySCg -----END PGP SIGNATURE----- --Apple-Mail=_132766F2-5894-4566-AA76-4945D2983BDE-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 20:55:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5C71AEA; Mon, 16 Feb 2015 20:55:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D0477EE8; Mon, 16 Feb 2015 20:55:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GKtc75039702; Mon, 16 Feb 2015 20:55:38 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GKtcOe039701; Mon, 16 Feb 2015 20:55:38 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201502162055.t1GKtcOe039701@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 16 Feb 2015 20:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278862 - head/usr.sbin/binmiscctl 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 20:55:39 -0000 Author: sbruno Date: Mon Feb 16 20:55:37 2015 New Revision: 278862 URL: https://svnweb.freebsd.org/changeset/base/278862 Log: Add example for upcoming aarch64/arm64 targets. Modified: head/usr.sbin/binmiscctl/binmiscctl.8 Modified: head/usr.sbin/binmiscctl/binmiscctl.8 ============================================================================== --- head/usr.sbin/binmiscctl/binmiscctl.8 Mon Feb 16 19:06:31 2015 (r278861) +++ head/usr.sbin/binmiscctl/binmiscctl.8 Mon Feb 16 20:55:37 2015 (r278862) @@ -180,6 +180,17 @@ Look up and list the record for the image activator: .Dl # binmiscctl lookup llvmbc .Pp +Add QEMU bsd-user program as an image activator for ARM AARCH64 binaries: +.Bd -literal -offset indent +# binmiscctl add arm64 \e + --interpreter "/usr/local/bin/qemu-aarch64-static" \e + --magic "\ex7f\ex45\ex4c\ex46\ex02\ex01\ex01\ex00\ex00\ex00\e + \ex00\ex00\ex00\ex00\ex00\ex00\ex02\ex00\exb7\ex00" \e + --mask "\exff\exff\exff\exff\exff\exff\exff\ex00\exff\exff\e + \exff\exff\exff\exff\exff\exff\exfe\exff\exff\exff" \e + --size 20 --set-enabled +.Ed +.Pp Add QEMU bsd-user program as an image activator for ARM little-endian binaries: .Bd -literal -offset indent # binmiscctl add armelf \e From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 21:22:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E6B3BBA; Mon, 16 Feb 2015 21:22:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 57EC1259; Mon, 16 Feb 2015 21:22:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GLMvFC055007; Mon, 16 Feb 2015 21:22:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GLMuQ8055005; Mon, 16 Feb 2015 21:22:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502162122.t1GLMuQ8055005@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 16 Feb 2015 21:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278865 - head/sys/ofed/include/linux 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 21:22:57 -0000 Author: hselasky Date: Mon Feb 16 21:22:56 2015 New Revision: 278865 URL: https://svnweb.freebsd.org/changeset/base/278865 Log: The kasprintf() function cannot be inlined due to using a variable number of arguments. Move it to a C-file in the linuxapi module to make the function usable. Sponsored by: Mellanox Technologies MFC after: 3 days Modified: head/sys/ofed/include/linux/device.h head/sys/ofed/include/linux/linux_compat.c Modified: head/sys/ofed/include/linux/device.h ============================================================================== --- head/sys/ofed/include/linux/device.h Mon Feb 16 21:01:31 2015 (r278864) +++ head/sys/ofed/include/linux/device.h Mon Feb 16 21:22:56 2015 (r278865) @@ -431,17 +431,6 @@ static inline char *kvasprintf(gfp_t gfp return p; } -static inline char *kasprintf(gfp_t gfp, const char *fmt, ...) -{ - va_list ap; - char *p; - - va_start(ap, fmt); - p = kvasprintf(gfp, fmt, ap); - va_end(ap); - - return p; -} - +char *kasprintf(gfp_t, const char *, ...); #endif /* _LINUX_DEVICE_H_ */ Modified: head/sys/ofed/include/linux/linux_compat.c ============================================================================== --- head/sys/ofed/include/linux/linux_compat.c Mon Feb 16 21:01:31 2015 (r278864) +++ head/sys/ofed/include/linux/linux_compat.c Mon Feb 16 21:22:56 2015 (r278865) @@ -712,6 +712,20 @@ vunmap(void *addr) kfree(vmmap); } + +char * +kasprintf(gfp_t gfp, const char *fmt, ...) +{ + va_list ap; + char *p; + + va_start(ap, fmt); + p = kvasprintf(gfp, fmt, ap); + va_end(ap); + + return p; +} + static void linux_compat_init(void) { From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 21:26:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9574DF24; Mon, 16 Feb 2015 21:26:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 65EB8299; Mon, 16 Feb 2015 21:26:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GLQHPW055775; Mon, 16 Feb 2015 21:26:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GLQHYG055774; Mon, 16 Feb 2015 21:26:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502162126.t1GLQHYG055774@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 16 Feb 2015 21:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278866 - head/sys/ofed/include/linux 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 21:26:17 -0000 Author: hselasky Date: Mon Feb 16 21:26:16 2015 New Revision: 278866 URL: https://svnweb.freebsd.org/changeset/base/278866 Log: Define standard formatting strings to print GIDs in a separate header file. Sponsored by: Mellanox Technologies MFC after: 3 days Added: head/sys/ofed/include/linux/printk.h (contents, props changed) Added: head/sys/ofed/include/linux/printk.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/ofed/include/linux/printk.h Mon Feb 16 21:26:16 2015 (r278866) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013, 2014 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. + */ + +#ifndef _FBSD_PRINTK_H_ +#define _FBSD_PRINTK_H_ + +/* GID printing macros */ +#define GID_PRINT_FMT "%.4x:%.4x:%.4x:%.4x:%.4x:%.4x:%.4x:%.4x" +#define GID_PRINT_ARGS(gid_raw) htons(((u16 *)gid_raw)[0]), htons(((u16 *)gid_raw)[1]),\ + htons(((u16 *)gid_raw)[2]), htons(((u16 *)gid_raw)[3]),\ + htons(((u16 *)gid_raw)[4]), htons(((u16 *)gid_raw)[5]),\ + htons(((u16 *)gid_raw)[6]), htons(((u16 *)gid_raw)[7]) + +#endif /* _FBSD_PRINTK_H */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 21:35:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3F3460E; Mon, 16 Feb 2015 21:35:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9EA093C9; Mon, 16 Feb 2015 21:35:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GLZUwn060887; Mon, 16 Feb 2015 21:35:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GLZUpL060886; Mon, 16 Feb 2015 21:35:30 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502162135.t1GLZUpL060886@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 16 Feb 2015 21:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278867 - head/lib/libcompat/4.3 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 21:35:30 -0000 Author: pfg Date: Mon Feb 16 21:35:29 2015 New Revision: 278867 URL: https://svnweb.freebsd.org/changeset/base/278867 Log: rexec(3): prevent uninitialized access to "port" variable. CID: 1018716 (and clang static checker) Modified: head/lib/libcompat/4.3/rexec.c Modified: head/lib/libcompat/4.3/rexec.c ============================================================================== --- head/lib/libcompat/4.3/rexec.c Mon Feb 16 21:26:16 2015 (r278866) +++ head/lib/libcompat/4.3/rexec.c Mon Feb 16 21:35:29 2015 (r278867) @@ -332,10 +332,10 @@ retry: perror(hp->h_name); return (-1); } - if (fd2p == 0) { - (void) write(s, "", 1); - port = 0; - } else { + port = 0; + if (fd2p == 0) + (void) write(s, "", 1); + else { char num[8]; int s2, sin2len; From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 21:46:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF84B9B0; Mon, 16 Feb 2015 21:46:46 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 43AA26E5; Mon, 16 Feb 2015 21:46:45 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1GLkfwR056518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 17 Feb 2015 00:46:41 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1GLkfYB056517; Tue, 17 Feb 2015 00:46:41 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 17 Feb 2015 00:46:41 +0300 From: Gleb Smirnoff To: Craig Rodrigues Subject: Re: svn commit: r278858 - head/sys/net Message-ID: <20150216214641.GM15484@FreeBSD.org> References: <201502161806.t1GI6PZh058915@svn.freebsd.org> <20150216193154.GJ15484@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Brad Davis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 21:46:46 -0000 On Mon, Feb 16, 2015 at 11:37:37AM -0800, Craig Rodrigues wrote: C> On Mon, Feb 16, 2015 at 11:31 AM, Gleb Smirnoff wrote: C> C> > On Mon, Feb 16, 2015 at 06:06:25PM +0000, Brad Davis wrote: C> > B> Author: brd (doc committer) C> > B> Date: Mon Feb 16 18:06:24 2015 C> > B> New Revision: 278858 C> > B> URL: https://svnweb.freebsd.org/changeset/base/278858 C> > B> C> > B> Log: C> > B> Fix build. C> > B> C> > B> Approved by: gibbs C> > C> > Thanks, Brad and Justin. My failure. C> C> I think it is hilarious that you criticized me for breaking the build in PF, C> and at *almost the same time*, you broke the build in PF. LOL! C> C> Hopefully, we can move on from this and get everyone's fixes in to help C> improve the PF code. The difference between our breakages is that I missed a file when listing files in 'svn commit', and you don't understand that blindly deleting kproc_exit() is a problem. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 21:52:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 490B9DC6; Mon, 16 Feb 2015 21:52:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1907D83C; Mon, 16 Feb 2015 21:52:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GLqTkm070245; Mon, 16 Feb 2015 21:52:29 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GLqThk070242; Mon, 16 Feb 2015 21:52:29 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502162152.t1GLqThk070242@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 16 Feb 2015 21:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278868 - in head/sys: net 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 21:52:30 -0000 Author: glebius Date: Mon Feb 16 21:52:28 2015 New Revision: 278868 URL: https://svnweb.freebsd.org/changeset/base/278868 Log: Toss declarations to fix regular build and NO_INET6 build. Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf_norm.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Mon Feb 16 21:35:29 2015 (r278867) +++ head/sys/net/pfvar.h Mon Feb 16 21:52:28 2015 (r278868) @@ -1574,7 +1574,7 @@ int pf_test6(int, struct ifnet *, struct void pf_poolmask(struct pf_addr *, struct pf_addr*, struct pf_addr *, struct pf_addr *, u_int8_t); void pf_addr_inc(struct pf_addr *, sa_family_t); -int pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag); +int pf_refragment6(struct ifnet *, struct mbuf **, struct m_tag *); #endif /* INET6 */ u_int32_t pf_new_isn(struct pf_state *); @@ -1589,7 +1589,6 @@ int pf_match_addr_range(struct pf_addr * int pf_match_port(u_int8_t, u_int16_t, u_int16_t, u_int16_t); void pf_normalize_init(void); -int pf_refragment6(struct ifnet *, struct mbuf **, struct m_tag *mtag); void pf_normalize_cleanup(void); int pf_normalize_ip(struct mbuf **, int, struct pfi_kif *, u_short *, struct pf_pdesc *); Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Mon Feb 16 21:35:29 2015 (r278867) +++ head/sys/netpfil/pf/pf_norm.c Mon Feb 16 21:52:28 2015 (r278868) @@ -148,9 +148,6 @@ static struct pf_fragment *pf_find_fragm struct pf_frent *pf_create_fragment(u_short *); static int pf_reassemble(struct mbuf **, struct ip *, int, u_short *); -int pf_reassemble6(struct mbuf **, struct ip6_hdr *, - struct ip6_frag *, uint16_t, uint16_t, int, - u_short *); static struct mbuf *pf_fragcache(struct mbuf **, struct ip*, struct pf_fragment **, int, int, int *); static struct pf_fragment *pf_fillup_fragment(struct pf_fragment_cmp *, @@ -161,6 +158,9 @@ struct mbuf *pf_join_fragment(struct pf #endif /* INET */ #ifdef INET6 +int pf_reassemble6(struct mbuf **, struct ip6_hdr *, + struct ip6_frag *, uint16_t, uint16_t, int, + u_short *); static void pf_scrub_ip6(struct mbuf **, u_int8_t); #endif #define DPFPRINTF(x) do { \ @@ -1094,6 +1094,7 @@ pf_fragcache(struct mbuf **m0, struct ip return (NULL); } +#ifdef INET6 int pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag) { @@ -1162,6 +1163,7 @@ pf_refragment6(struct ifnet *ifp, struct return (action); } +#endif /* INET6 */ int pf_normalize_ip(struct mbuf **m0, int dir, struct pfi_kif *kif, u_short *reason, From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 21:56:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44A87D2; Mon, 16 Feb 2015 21:56:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 14C82878; Mon, 16 Feb 2015 21:56:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GLuKNd070799; Mon, 16 Feb 2015 21:56:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GLuKL3070794; Mon, 16 Feb 2015 21:56:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502162156.t1GLuKL3070794@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Feb 2015 21:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278869 - in head/sys: amd64/amd64 i386/i386 x86/acpica x86/x86 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 21:56:21 -0000 Author: kib Date: Mon Feb 16 21:56:19 2015 New Revision: 278869 URL: https://svnweb.freebsd.org/changeset/base/278869 Log: Initialize x2APIC mode on the resume path before accessing LAPIC. Remove unneeded disable of LAPIC in the native_lapic_xapic_mode(). We attempt to send wakeup IPI on the resume path right after BSP wakeup, so disabling is wrong. Reported and tested by: glebius, "Ranjan1018 ." <214748mv@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 2 months Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/i386/i386/mp_machdep.c head/sys/x86/acpica/acpi_wakeup.c head/sys/x86/x86/local_apic.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Mon Feb 16 21:52:28 2015 (r278868) +++ head/sys/amd64/amd64/mp_machdep.c Mon Feb 16 21:56:19 2015 (r278869) @@ -1507,6 +1507,7 @@ cpususpend_handler(void) vmm_resume_p(); /* Resume MCA and local APIC */ + lapic_xapic_mode(); mca_resume(); lapic_setup(0); Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Mon Feb 16 21:52:28 2015 (r278868) +++ head/sys/i386/i386/mp_machdep.c Mon Feb 16 21:56:19 2015 (r278869) @@ -1555,6 +1555,7 @@ cpususpend_handler(void) cpu_ops.cpu_resume(); /* Resume MCA and local APIC */ + lapic_xapic_mode(); mca_resume(); lapic_setup(0); Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Mon Feb 16 21:52:28 2015 (r278868) +++ head/sys/x86/acpica/acpi_wakeup.c Mon Feb 16 21:56:19 2015 (r278869) @@ -270,6 +270,7 @@ acpi_wakeup_machdep(struct acpi_softc *s initializecpu(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); + lapic_xapic_mode(); #ifdef SMP if (!CPU_EMPTY(&suspcpus)) acpi_wakeup_cpus(sc); Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon Feb 16 21:52:28 2015 (r278868) +++ head/sys/x86/x86/local_apic.c Mon Feb 16 21:56:19 2015 (r278869) @@ -527,7 +527,6 @@ native_lapic_xapic_mode(void) saveintr = intr_disable(); if (x2apic_mode) native_lapic_enable_x2apic(); - native_lapic_disable(); intr_restore(saveintr); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 22:13:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0989C6A8; Mon, 16 Feb 2015 22:13:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E784DA60; Mon, 16 Feb 2015 22:13:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GMD4CA080221; Mon, 16 Feb 2015 22:13:04 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GMD3QI080217; Mon, 16 Feb 2015 22:13:03 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201502162213.t1GMD3QI080217@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 16 Feb 2015 22:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278870 - in head: lib/libc/sparc64/sys lib/libc/sys sys/sparc64/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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 22:13:05 -0000 Author: marius Date: Mon Feb 16 22:13:03 2015 New Revision: 278870 URL: https://svnweb.freebsd.org/changeset/base/278870 Log: Unbreak sparc64 after r276630 by calling __sparc_sigtramp_setup signal trampoline as part of the MD __sys_sigaction again. Submitted by: kib (initial versions) MFC after: 3 days Added: head/lib/libc/sparc64/sys/sigaction1.S - copied, changed from r278826, head/lib/libc/sparc64/sys/sigaction.S Deleted: head/lib/libc/sparc64/sys/sigaction.S Modified: head/lib/libc/sparc64/sys/Makefile.inc head/lib/libc/sys/Makefile.inc head/sys/sparc64/include/asm.h Modified: head/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/sys/Makefile.inc Mon Feb 16 21:56:19 2015 (r278869) +++ head/lib/libc/sparc64/sys/Makefile.inc Mon Feb 16 22:13:03 2015 (r278870) @@ -12,7 +12,7 @@ SRCS+= __sparc_sigtramp_setup.c \ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu -MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S sigaction.S +MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S sigaction1.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o Copied and modified: head/lib/libc/sparc64/sys/sigaction1.S (from r278826, head/lib/libc/sparc64/sys/sigaction.S) ============================================================================== --- head/lib/libc/sparc64/sys/sigaction.S Sun Feb 15 22:38:00 2015 (r278826, copy source) +++ head/lib/libc/sparc64/sys/sigaction1.S Mon Feb 16 22:13:03 2015 (r278870) @@ -29,7 +29,8 @@ __FBSDID("$FreeBSD$"); #include "SYS.h" -_SYSENTRY(sigaction) + WEAK_REFERENCE(__sys_sigaction, _sigaction) +ENTRY(__sys_sigaction) PIC_PROLOGUE(%o3, %o4) SET(sigcode_installed, %o4, %o3) lduw [%o3], %o4 @@ -44,6 +45,6 @@ _SYSENTRY(sigaction) 1: _SYSCALL(sigaction) retl nop -_SYSEND(sigaction) +END(__sys_sigaction) .comm sigcode_installed, 4, 4 Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Mon Feb 16 21:56:19 2015 (r278869) +++ head/lib/libc/sys/Makefile.inc Mon Feb 16 22:13:03 2015 (r278870) @@ -65,7 +65,6 @@ INTERPOSED = \ sendmsg \ sendto \ setcontext \ - sigaction \ sigprocmask \ sigsuspend \ sigtimedwait \ @@ -76,6 +75,13 @@ INTERPOSED = \ write \ writev +.if ${MACHINE_CPUARCH} == "sparc64" +SRCS+= sigaction.c +NOASM+= sigaction.o +.else +INTERPOSED+= sigaction +.endif + SRCS+= ${INTERPOSED:S/$/.c/} NOASM+= ${INTERPOSED:S/$/.o/} PSEUDO+= ${INTERPOSED:C/^.*$/_&.o/} Modified: head/sys/sparc64/include/asm.h ============================================================================== --- head/sys/sparc64/include/asm.h Mon Feb 16 21:56:19 2015 (r278869) +++ head/sys/sparc64/include/asm.h Mon Feb 16 22:13:03 2015 (r278870) @@ -103,6 +103,16 @@ CNAME(x): #define END(x) .size x, . - x /* + * WEAK_REFERENCE(): create a weak reference alias from sym. + * The macro is not a general asm macro that takes arbitrary names, + * but one that takes only C names. It does the non-null name + * translation inside the macro. + */ +#define WEAK_REFERENCE(sym, alias) \ + .weak CNAME(alias); \ + .equ CNAME(alias),CNAME(sym) + +/* * Kernel RCS ID tag and copyright macros */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 22:18:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3A82920; Mon, 16 Feb 2015 22:18:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8E0DFA93; Mon, 16 Feb 2015 22:18:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GMIise081236; Mon, 16 Feb 2015 22:18:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GMIiim081235; Mon, 16 Feb 2015 22:18:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502162218.t1GMIiim081235@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Feb 2015 22:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278871 - head/sys/dev/acpica 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 22:18:44 -0000 Author: kib Date: Mon Feb 16 22:18:43 2015 New Revision: 278871 URL: https://svnweb.freebsd.org/changeset/base/278871 Log: Array cannot be NULL, remove always true comparision. ACPI spec identifies the tested condition for _PRT as "BYTE value of 0", so the remaining part of the conditionals is sufficient. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/acpica/acpi_pcib.c Modified: head/sys/dev/acpica/acpi_pcib.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib.c Mon Feb 16 22:13:03 2015 (r278870) +++ head/sys/dev/acpica/acpi_pcib.c Mon Feb 16 22:18:43 2015 (r278871) @@ -95,7 +95,7 @@ prt_attach_devices(ACPI_PCI_ROUTING_TABL int error; /* We only care about entries that reference a link device. */ - if (entry->Source == NULL || entry->Source[0] == '\0') + if (entry->Source[0] == '\0') return; /* @@ -222,7 +222,7 @@ acpi_pcib_route_interrupt(device_t pcib, if (bootverbose) { device_printf(pcib, "matched entry for %d.%d.INT%c", pci_get_bus(dev), pci_get_slot(dev), 'A' + pin); - if (prt->Source != NULL && prt->Source[0] != '\0') + if (prt->Source[0] != '\0') printf(" (src %s:%u)", prt->Source, prt->SourceIndex); printf("\n"); } @@ -234,8 +234,7 @@ acpi_pcib_route_interrupt(device_t pcib, * XXX: If the source index is non-zero, ignore the source device and * assume that this is a hard-wired entry. */ - if (prt->Source == NULL || prt->Source[0] == '\0' || - prt->SourceIndex != 0) { + if (prt->Source[0] == '\0' || prt->SourceIndex != 0) { if (bootverbose) device_printf(pcib, "slot %d INT%c hardwired to IRQ %d\n", pci_get_slot(dev), 'A' + pin, prt->SourceIndex); From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 22:24:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3E40AAD; Mon, 16 Feb 2015 22:24:47 +0000 (UTC) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) (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 70757B5A; Mon, 16 Feb 2015 22:24:47 +0000 (UTC) Received: by lbiw7 with SMTP id w7so1176042lbi.9; Mon, 16 Feb 2015 14:24:44 -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=96WE9SGbjWCd7tt5qAOyiNbSRqQLx6VIhnWte+ovXKw=; b=gMnoUlkQHtcla/NJU+grdehE9RC2O4F3z9ZcgzuaMFeMD1uWPL8z8IW6p3Dn3BShzZ mDyeKeXbx26ExTftUKvASCkpGGG0x9g2+2bphM5EA/4GVytI/5P/JU350iEukQ2KQmjQ 6hAtWJYD0rclgN7q/Vlbd6jdWGmK/3NomZciL9ubBspALWG3Inji3Efi2vABX+7/T9YF RV/1peM11Ky4vgeG6JX2bifa3YVbwtlkZZObED87zYUzkdmsTJNucNLcDdPpfZlfn4f1 XhDI84KS/llTFf95g6X+qS6N+Mu9JG3Qksw+TfSSOELc/jtv3Mu36UYxc0PbofawK851 AXEA== MIME-Version: 1.0 X-Received: by 10.112.181.165 with SMTP id dx5mr25555054lbc.89.1424125484478; Mon, 16 Feb 2015 14:24:44 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.28.40 with HTTP; Mon, 16 Feb 2015 14:24:44 -0800 (PST) In-Reply-To: <54E1B14E.10707@gmx.com> References: <201501060903.t06934qp081875@svn.freebsd.org> <20150122012709.GM15484@FreeBSD.org> <54C16715.6060701@gmx.com> <20150122222314.GO15484@FreeBSD.org> <20150215190100.GQ15484@FreeBSD.org> <20150216012528.GA15484@FreeBSD.org> <20150216074656.GE15484@FreeBSD.org> <54E1B14E.10707@gmx.com> Date: Mon, 16 Feb 2015 14:24:44 -0800 X-Google-Sender-Auth: r6wujh5HMuiLR3Ptig9qZbWHVno Message-ID: Subject: Re: svn commit: r276747 - head/sys/netpfil/pf From: Craig Rodrigues To: Nikos Vassiliadis Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Gleb Smirnoff , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 22:24:48 -0000 Cool. Having the PF + VIMAGE issues resolved and committed to HEAD is what I am most interested in. When you have a patch that you are happy with, would you be OK with getting it into Phabricator? It would be good to have it in there, so that multiple people can review it, including Gleb. Unfortunately, currently only committers can open reviews in Phabricator, so we would need to get your patch to a committer to enter in Phabricator. I can help with that, or you can hand off to another committer if you are more comfortable with that. Thanks! -- Craig On Mon, Feb 16, 2015 at 12:58 AM, Nikos Vassiliadis wrote: > Hi Gleb & Craig, > > I am already working on the issues that need to be fixed, namely: > 1) all the changes from projects/pf > 2) unloading the module > 3) one purge thread per pf instance will remain until we have > more experience > > It's almost ready, I am trying to fix unloading the module. > > As I am not at home this week I will send you a patch for review on > Monday. > > Best regards, > Nikos > > > On 02/16/15 09:02, Craig Rodrigues wrote: > >> On Sun, Feb 15, 2015 at 11:46 PM, Gleb Smirnoff >> wrote: >> >> On Sun, Feb 15, 2015 at 11:36:17PM -0800, Craig Rodrigues wrote: >>> C> On Sun, Feb 15, 2015 at 5:25 PM, Gleb Smirnoff >>> wrote: >>> C> >>> C> > On Sun, Feb 15, 2015 at 01:33:19PM -0800, Craig Rodrigues wrote: >>> C> > C> By the way, it would be helpful if you could provide feedback in >>> C> > C> Phabricator. When I created those Phabricator reviews, I added >>> C> > C> you as a reviewer to all of them, so you can't say that you >>> didn't >>> see >>> C> > C> the patches. >>> C> > C> You did not provide feedback on any of them: >>> C> > C> >>> C> > C> https://reviews.freebsd.org/D1309 >>> C> > C> https://reviews.freebsd.org/D1312 >>> C> > C> https://reviews.freebsd.org/D1313 >>> C> > C> https://reviews.freebsd.org/D1315 >>> C> > C> >>> C> > C> Please take some time to go and provide feedback in those >>> C> > C> reviews, so that a better patch can be made that makes you happy. >>> C> > >>> C> > Did you address all problems that arised after code was committed? >>> C> > >>> C> > Please do, otherwise my review would require me to cut-n-paste from >>> C> > my own emails. >>> C> > >>> C> >>> C> Yes, please cut and paste from your e-mails, and put in the reviews. >>> >>> No, I will not do this. You know right now that you have problems >>> in the aforementioned phab URLs, and you are asking me to look at >>> patches at to point them out to you. This is your task, not mine. >>> >>> Please address all already known problems and update the phab revisions. >>> >>> C> It's easier to follow in the individual reviews because there are >>> different >>> C> changes >>> C> in each review, rather than one big revert, which is what you did. >>> >>> I'm already starting to repeat myself. I did a big revert, because >>> the first change wasn't compilable, later changes fixed compilation >>> failures, but introduced unacceptable bugs. That's why I was forced >>> to back out all chain. >>> >>> >> >> >> It's not clear to me what parts you find unacceptable, >> and what parts you find acceptable. I added you to the reviews >> in Phabricator from the beginning, so it would have been nice if you could >> have >> provided the review feedback there. Since you are slow to provide >> feedback when I asked you to be a reviewer in Phabricator, but you >> are quick to revert changes, and provide unclear feedback during your >> reversion, >> this makes it very hard to make forward progress in this area. >> >> In the past, multiple like Nikos and Martin Matuska have been providing >> patches in your >> projects/pf branch, but you don't seem to have the time/interest to push >> these patches back into head. >> I've seen that Martin Matuska stopped waiting for you to merge the pf >> branch to head, and started cherry >> >> -- >> Craig >> >> From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 22:25:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73EEEBEA; Mon, 16 Feb 2015 22:25:14 +0000 (UTC) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::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 06C81B9E; Mon, 16 Feb 2015 22:25:14 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id k14so22065337wgh.3; Mon, 16 Feb 2015 14:25:12 -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=kQqQK++gMi4LDCt5+wGUzY1n25auk6PQEfKUJ5FeM3A=; b=BnMUrFow9NLoYrerL9tOEprURtTCtLRiNnxt4CFwMtZGKs7nAj2cexs+s6VrP4Iovv +4WrV6XMCb0Bqty8wZDIAFWtgcZVyPVY44vvuD8gRCqAR4i0ioh8bwWvLLSMz07RI5HH +VH44ZPi7RTeFrvhHJtLA3ZI56073d7Pnx0CBgn+p3b3VqGLPSyqPFKQsZKHawwA7yXi fz7CD7bz5JtGKdSnBIJCSbmf0EeMkPtdGl/OceN396Mf7omPEJ3nVrOP+WkIh55ugfYh peU150D4QHdr/fVtbY2epEOS9GaM9eOPVesetv7EC3jpBLpATXbM3L2DqeqLryOSqw24 IO0w== MIME-Version: 1.0 X-Received: by 10.194.205.228 with SMTP id lj4mr54183277wjc.77.1424125512522; Mon, 16 Feb 2015 14:25:12 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.27.84.206 with HTTP; Mon, 16 Feb 2015 14:25:12 -0800 (PST) In-Reply-To: <201502160338.t1G3cRlX042385@svn.freebsd.org> References: <201502160338.t1G3cRlX042385@svn.freebsd.org> Date: Tue, 17 Feb 2015 02:25:12 +0400 X-Google-Sender-Auth: Y3ENrEtdQxiG_-jkrmqKxfiWPq0 Message-ID: Subject: Re: svn commit: r278831 - head/sys/netpfil/pf From: Sergey Kandaurov To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 16 Feb 2015 22:25:14 -0000 On 16 February 2015 at 06:38, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Feb 16 03:38:27 2015 > New Revision: 278831 > URL: https://svnweb.freebsd.org/changeset/base/278831 > > Log: > Update the pf fragment handling code to closer match recent OpenBSD. > That partially fixes IPv6 fragment handling. Thanks to Kristof for > working on that. > [...] > @@ -125,15 +140,25 @@ static void pf_remove_fragment(struct > static int pf_normalize_tcpopt(struct pf_rule *, struct mbuf *, > struct tcphdr *, int, sa_family_t); > #ifdef INET > -static void pf_ip2key(struct pf_fragment *, struct ip *); It's still called under #ifdef INET only. [...] > @@ -145,6 +170,18 @@ static void pf_scrub_ip6(struct mbuf * > } \ > } while(0) > > +static void > +pf_ip2key(struct ip *ip, int dir, struct pf_fragment_cmp *key) > +{ > + > + key->frc_src.v4 = ip->ip_src; > + key->frc_dst.v4 = ip->ip_dst; > + key->frc_af = AF_INET; > + key->frc_proto = ip->ip_p; > + key->frc_id = ip->ip_id; > + key->frc_direction = dir; > +} > + > void > pf_normalize_init(void) > { [...] > @@ -296,26 +331,14 @@ pf_free_fragment(struct pf_fragment *fra > } > > #ifdef INET > -static void > -pf_ip2key(struct pf_fragment *key, struct ip *ip) > -{ > - key->fr_p = ip->ip_p; > - key->fr_id = ip->ip_id; > - key->fr_src.s_addr = ip->ip_src.s_addr; > - key->fr_dst.s_addr = ip->ip_dst.s_addr; > -} > - You seem to move pf_ip2key out of INET scope intentionally (why?). But this breaks gcc w/INET6 only kernel. netpfil/pf/pf_norm.c:176: warning: 'pf_ip2key' defined but not used -- wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 23:29:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03CDD79B; Mon, 16 Feb 2015 23:29:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E31D91A6; Mon, 16 Feb 2015 23:29:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GNTuVF014404; Mon, 16 Feb 2015 23:29:56 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GNTupa014403; Mon, 16 Feb 2015 23:29:56 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201502162329.t1GNTupa014403@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Mon, 16 Feb 2015 23:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278873 - 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 23:29:57 -0000 Author: rpaulo Date: Mon Feb 16 23:29:56 2015 New Revision: 278873 URL: https://svnweb.freebsd.org/changeset/base/278873 Log: Fix a typo when invoking tar(1) to create the debug distributions. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Feb 16 22:33:44 2015 (r278872) +++ head/Makefile.inc1 Mon Feb 16 23:29:56 2015 (r278873) @@ -929,7 +929,7 @@ packageworld: @${DESTDIR}/${DISTDIR}/${dist}.debug.meta . else ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ - tar cvJfL ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz \ + tar cvJLf ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz \ usr/lib/debug . endif .endfor From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 23:50:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2F5FEBA; Mon, 16 Feb 2015 23:50:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B3AF53DD; Mon, 16 Feb 2015 23:50:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GNosL5026327; Mon, 16 Feb 2015 23:50:54 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GNosXm026325; Mon, 16 Feb 2015 23:50:54 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502162350.t1GNosXm026325@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 16 Feb 2015 23:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278874 - in head/sys: net 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.18-1 Precedence: list List-Id: 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, 16 Feb 2015 23:50:55 -0000 Author: glebius Date: Mon Feb 16 23:50:53 2015 New Revision: 278874 URL: https://svnweb.freebsd.org/changeset/base/278874 Log: - Improve INET/INET6 scope. - style(9) declarations. - Make couple of local functions static. Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf_norm.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Mon Feb 16 23:29:56 2015 (r278873) +++ head/sys/net/pfvar.h Mon Feb 16 23:50:53 2015 (r278874) @@ -1567,10 +1567,14 @@ void pf_free_rule(struct pf_rule *); #ifdef INET int pf_test(int, struct ifnet *, struct mbuf **, struct inpcb *); +int pf_normalize_ip(struct mbuf **, int, struct pfi_kif *, u_short *, + struct pf_pdesc *); #endif /* INET */ #ifdef INET6 int pf_test6(int, struct ifnet *, struct mbuf **, struct inpcb *); +int pf_normalize_ip6(struct mbuf **, int, struct pfi_kif *, u_short *, + struct pf_pdesc *); void pf_poolmask(struct pf_addr *, struct pf_addr*, struct pf_addr *, struct pf_addr *, u_int8_t); void pf_addr_inc(struct pf_addr *, sa_family_t); @@ -1590,10 +1594,6 @@ int pf_match_port(u_int8_t, u_int16_t, u void pf_normalize_init(void); void pf_normalize_cleanup(void); -int pf_normalize_ip(struct mbuf **, int, struct pfi_kif *, u_short *, - struct pf_pdesc *); -int pf_normalize_ip6(struct mbuf **, int, struct pfi_kif *, u_short *, - struct pf_pdesc *); int pf_normalize_tcp(int, struct pfi_kif *, struct mbuf *, int, int, void *, struct pf_pdesc *); void pf_normalize_tcp_cleanup(struct pf_state *); Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Mon Feb 16 23:29:56 2015 (r278873) +++ head/sys/netpfil/pf/pf_norm.c Mon Feb 16 23:50:53 2015 (r278874) @@ -134,35 +134,32 @@ static int pf_frag_compare(struct pf_f static RB_PROTOTYPE(pf_frag_tree, pf_fragment, fr_entry, pf_frag_compare); static RB_GENERATE(pf_frag_tree, pf_fragment, fr_entry, pf_frag_compare); -/* Private prototypes */ -static void pf_free_fragment(struct pf_fragment *); -static void pf_remove_fragment(struct pf_fragment *); -static int pf_normalize_tcpopt(struct pf_rule *, struct mbuf *, - struct tcphdr *, int, sa_family_t); +static void pf_free_fragment(struct pf_fragment *); +static void pf_remove_fragment(struct pf_fragment *); +static int pf_normalize_tcpopt(struct pf_rule *, struct mbuf *, + struct tcphdr *, int, sa_family_t); +struct pf_frent *pf_create_fragment(u_short *); +static struct pf_fragment * + pf_find_fragment(struct pf_fragment_cmp *key, + struct pf_frag_tree *tree); +static struct pf_fragment * + pf_fillup_fragment(struct pf_fragment_cmp *, struct pf_frent *, u_short *); +static int pf_isfull_fragment(struct pf_fragment *); +struct mbuf *pf_join_fragment(struct pf_fragment *); #ifdef INET -static void pf_scrub_ip(struct mbuf **, u_int32_t, u_int8_t, - u_int8_t); -static void pf_flush_fragments(void); -static struct pf_fragment *pf_find_fragment(struct pf_fragment_cmp *key, - struct pf_frag_tree *tree); -struct pf_frent *pf_create_fragment(u_short *); -static int pf_reassemble(struct mbuf **, struct ip *, int, - u_short *); -static struct mbuf *pf_fragcache(struct mbuf **, struct ip*, - struct pf_fragment **, int, int, int *); -static struct pf_fragment *pf_fillup_fragment(struct pf_fragment_cmp *, - struct pf_frent *, u_short *); -int pf_isfull_fragment(struct pf_fragment *); -struct mbuf *pf_join_fragment(struct pf_fragment *); - - -#endif /* INET */ +static void pf_scrub_ip(struct mbuf **, uint32_t, uint8_t, uint8_t); +static void pf_flush_fragments(void); +static int pf_reassemble(struct mbuf **, struct ip *, int, u_short *); +static struct mbuf * + pf_fragcache(struct mbuf **, struct ip*, struct pf_fragment **, + int, int, int *); +#endif /* INET */ #ifdef INET6 -int pf_reassemble6(struct mbuf **, struct ip6_hdr *, - struct ip6_frag *, uint16_t, uint16_t, int, - u_short *); -static void pf_scrub_ip6(struct mbuf **, u_int8_t); -#endif +static int pf_reassemble6(struct mbuf **, struct ip6_hdr *, + struct ip6_frag *, uint16_t, uint16_t, int, u_short *); +static void pf_scrub_ip6(struct mbuf **, uint8_t); +#endif /* INET6 */ + #define DPFPRINTF(x) do { \ if (V_pf_status.debug >= PF_DEBUG_MISC) { \ printf("%s: ", __func__); \ @@ -170,6 +167,7 @@ static void pf_scrub_ip6(struct mbuf * } \ } while(0) +#ifdef INET static void pf_ip2key(struct ip *ip, int dir, struct pf_fragment_cmp *key) { @@ -181,6 +179,7 @@ pf_ip2key(struct ip *ip, int dir, struct key->frc_id = ip->ip_id; key->frc_direction = dir; } +#endif /* INET */ void pf_normalize_init(void) @@ -374,7 +373,6 @@ pf_remove_fragment(struct pf_fragment *f } } -#ifdef INET struct pf_frent * pf_create_fragment(u_short *reason) { @@ -538,7 +536,7 @@ drop_fragment: return (NULL); } -int +static int pf_isfull_fragment(struct pf_fragment *frag) { struct pf_frent *frent, *next; @@ -603,7 +601,7 @@ pf_join_fragment(struct pf_fragment *fra return (m); } -#define FR_IP_OFF(fr) ((ntohs((fr)->fr_ip->ip_off) & IP_OFFMASK) << 3) +#ifdef INET static int pf_reassemble(struct mbuf **m0, struct ip *ip, int dir, u_short *reason) { @@ -670,9 +668,9 @@ pf_reassemble(struct mbuf **m0, struct i } #ifdef INET6 -int +static int pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, struct ip6_frag *fraghdr, - uint16_t hdrlen, uint16_t extoff, int dir, u_short *reason) + uint16_t hdrlen, uint16_t extoff, int dir, u_short *reason) { struct mbuf *m = *m0; struct pf_frent *frent; @@ -789,8 +787,7 @@ fail: /* PF_DROP requires a valid mbuf *m0 in pf_test6(), will free later. */ return (PF_DROP); } - -#endif +#endif /* INET6 */ static struct mbuf * pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff, From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 01:23:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58BF051A; Tue, 17 Feb 2015 01:23:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 43737F1F; Tue, 17 Feb 2015 01:23:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1H1NdvQ071919; Tue, 17 Feb 2015 01:23:39 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1H1NdO6071918; Tue, 17 Feb 2015 01:23:39 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201502170123.t1H1NdO6071918@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 17 Feb 2015 01:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278876 - head/sys/powerpc/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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 01:23:39 -0000 Author: nwhitehorn Date: Tue Feb 17 01:23:38 2015 New Revision: 278876 URL: https://svnweb.freebsd.org/changeset/base/278876 Log: Having the TOC pointer in kernel dbeugger printouts is useful. Modified: head/sys/powerpc/powerpc/db_trace.c Modified: head/sys/powerpc/powerpc/db_trace.c ============================================================================== --- head/sys/powerpc/powerpc/db_trace.c Tue Feb 17 01:03:06 2015 (r278875) +++ head/sys/powerpc/powerpc/db_trace.c Tue Feb 17 01:23:38 2015 (r278876) @@ -267,6 +267,9 @@ db_backtrace(struct thread *td, db_addr_ db_printf("%-10s r1=%#zx cr=%#x xer=%#x ctr=%#zx", "", tf->fixreg[1], (uint32_t)tf->cr, (uint32_t)tf->xer, tf->ctr); +#ifdef __powerpc64__ + db_printf(" r2=%#zx", tf->fixreg[2]); +#endif if (tf->exc == EXC_DSI) db_printf(" sr=%#x", (uint32_t)tf->cpu.aim.dsisr); From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 02:35:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FF8666A; Tue, 17 Feb 2015 02:35:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5AD5D8C0; Tue, 17 Feb 2015 02:35:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1H2Z7cP005700; Tue, 17 Feb 2015 02:35:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1H2Z6eC005697; Tue, 17 Feb 2015 02:35:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201502170235.t1H2Z6eC005697@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 17 Feb 2015 02:35:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278879 - in head/sys: kern 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 02:35:07 -0000 Author: adrian Date: Tue Feb 17 02:35:06 2015 New Revision: 278879 URL: https://svnweb.freebsd.org/changeset/base/278879 Log: Implement taskqueue_start_threads_cpuset(). This is a more generic version of taskqueue_start_threads_pinned() which only supports a single cpuid. This originally came from John Baldwin who implemented it as part of a push towards NUMA awareness in drivers. I started implementing something similar for RSS and NUMA, then found he already did it. I'd like to axe taskqueue_start_threads_pinned() so it doesn't become part of a longer-term API. (Read: hps@ wants to MFC things, and if I don't do this soon, he'll MFC what's here. :-) I have a follow-up commit which converts the intel drivers over to using the cpuset version of this function, so we can eventually nuke the the pinned version. Tested: * igb, ixgbe Obtained from: jhbbsd Modified: head/sys/kern/subr_taskqueue.c head/sys/sys/taskqueue.h Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Tue Feb 17 01:45:38 2015 (r278878) +++ head/sys/kern/subr_taskqueue.c Tue Feb 17 02:35:06 2015 (r278879) @@ -571,8 +571,9 @@ taskqueue_swi_giant_run(void *dummy) static int _taskqueue_start_threads(struct taskqueue **tqp, int count, int pri, - cpuset_t *mask, const char *ktname) + cpuset_t *mask, const char *name, va_list ap) { + char ktname[MAXCOMLEN + 1]; struct thread *td; struct taskqueue *tq; int i, error; @@ -580,6 +581,7 @@ _taskqueue_start_threads(struct taskqueu if (count <= 0) return (EINVAL); + vsnprintf(ktname, sizeof(ktname), name, ap); tq = *tqp; tq->tq_threads = malloc(sizeof(struct thread *) * count, M_TASKQUEUE, @@ -635,27 +637,35 @@ int taskqueue_start_threads(struct taskqueue **tqp, int count, int pri, const char *name, ...) { - char ktname[MAXCOMLEN + 1]; va_list ap; + int error; va_start(ap, name); - vsnprintf(ktname, sizeof(ktname), name, ap); + error = _taskqueue_start_threads(tqp, count, pri, NULL, name, ap); va_end(ap); - - return (_taskqueue_start_threads(tqp, count, pri, NULL, ktname)); + return (error); } int -taskqueue_start_threads_pinned(struct taskqueue **tqp, int count, int pri, - int cpu_id, const char *name, ...) +taskqueue_start_threads_cpuset(struct taskqueue **tqp, int count, int pri, + cpuset_t *mask, const char *name, ...) { - char ktname[MAXCOMLEN + 1]; va_list ap; - cpuset_t mask; + int error; va_start(ap, name); - vsnprintf(ktname, sizeof(ktname), name, ap); + error = _taskqueue_start_threads(tqp, count, pri, mask, name, ap); va_end(ap); + return (error); +} + +int +taskqueue_start_threads_pinned(struct taskqueue **tqp, int count, int pri, + int cpu_id, const char *name, ...) +{ + cpuset_t mask; + va_list ap; + int error; /* * In case someone passes in NOCPU, just fall back to the @@ -666,8 +676,11 @@ taskqueue_start_threads_pinned(struct ta CPU_SET(cpu_id, &mask); } - return (_taskqueue_start_threads(tqp, count, pri, - cpu_id == NOCPU ? NULL : &mask, ktname)); + va_start(ap, name); + error = _taskqueue_start_threads(tqp, count, pri, + cpu_id == NOCPU ? NULL : &mask, name, ap); + va_end(ap); + return (error); } static inline void Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Tue Feb 17 01:45:38 2015 (r278878) +++ head/sys/sys/taskqueue.h Tue Feb 17 02:35:06 2015 (r278879) @@ -36,6 +36,7 @@ #include #include #include +#include struct taskqueue; struct thread; @@ -71,6 +72,8 @@ struct taskqueue *taskqueue_create(const void *context); int taskqueue_start_threads(struct taskqueue **tqp, int count, int pri, const char *name, ...) __printflike(4, 5); +int taskqueue_start_threads_cpuset(struct taskqueue **tqp, int count, + int pri, cpuset_t *mask, const char *name, ...) __printflike(5, 6); int taskqueue_start_threads_pinned(struct taskqueue **tqp, int count, int pri, int cpu_id, const char *name, ...) __printflike(5, 6); From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 05:07:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0882D66; Tue, 17 Feb 2015 05:07:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C321F957; Tue, 17 Feb 2015 05:07:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1H57cT8076922; Tue, 17 Feb 2015 05:07:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1H57chX076921; Tue, 17 Feb 2015 05:07:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502170507.t1H57chX076921@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Feb 2015 05:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278880 - head/sys/dev/ic 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 05:07:39 -0000 Author: imp Date: Tue Feb 17 05:07:38 2015 New Revision: 278880 URL: https://svnweb.freebsd.org/changeset/base/278880 Log: This should have been GC'd 6 years ago when ar(4) was removed. Deleted: head/sys/dev/ic/hd64570.h From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 05:10:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE0BCEBD; Tue, 17 Feb 2015 05:10:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C993996A; Tue, 17 Feb 2015 05:10:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1H5Ag2Z078304; Tue, 17 Feb 2015 05:10:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1H5AgUu078303; Tue, 17 Feb 2015 05:10:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502170510.t1H5AgUu078303@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Feb 2015 05:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278881 - head/sys/dev/lmc 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 05:10:43 -0000 Author: imp Date: Tue Feb 17 05:10:41 2015 New Revision: 278881 URL: https://svnweb.freebsd.org/changeset/base/278881 Log: Remove compat code for pre-FreeBSD 7 systems. Modified: head/sys/dev/lmc/if_lmc.h Modified: head/sys/dev/lmc/if_lmc.h ============================================================================== --- head/sys/dev/lmc/if_lmc.h Tue Feb 17 05:07:38 2015 (r278880) +++ head/sys/dev/lmc/if_lmc.h Tue Feb 17 05:10:41 2015 (r278881) @@ -1052,7 +1052,7 @@ struct card */ #define IOREF_CSR 1 /* access Tulip CSRs with IO cycles if 1 */ -#if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) +#if defined(DEVICE_POLLING) # define DEV_POLL 1 #else # define DEV_POLL 0 @@ -1076,15 +1076,10 @@ struct softc struct ifnet *ifp; struct ifmedia ifm; /* hooks for ifconfig(8) */ # if NSPPP -# if (__FreeBSD_version < 600000) - struct sppp spppcom; /* must be first in sc for fbsd < 6 */ -# endif struct sppp *sppp; # elif P2P struct p2pcom p2pcom; struct p2pcom *p2p; -# elif (__FreeBSD_version < 600000) - struct ifnet ifnet; /* must be first in sc for fbsd < 6 */ # endif #endif @@ -1092,13 +1087,8 @@ struct softc #if NETGRAPH node_p ng_node; /* pointer to our node struct */ hook_p ng_hook; /* non-zero means NETGRAPH owns device */ -# if (__FreeBSD_version >= 503000) struct ifaltq ng_sndq; struct ifaltq ng_fastq; -# else - struct ifqueue ng_sndq; - struct ifqueue ng_fastq; -# endif #endif struct callout callout; /* watchdog needs this */ @@ -1115,13 +1105,8 @@ struct softc # ifdef DEVICE_POLLING int quota; /* used for incoming packet flow control */ # endif -# if (__FreeBSD_version >= 500000) struct mtx top_mtx; /* lock card->watchdog vs core_ioctl */ struct mtx bottom_mtx; /* lock for buf queues & descriptor rings */ -# else /* FreeBSD-4 */ - int top_spl; /* lock card->watchdog vs core_ioctl */ - int bottom_spl; /* lock for buf queues & descriptor rings */ -# endif /* Top-half state used by all card types; lock with top_lock, */ @@ -1154,23 +1139,11 @@ struct softc # define WRITE_CSR(csr, val) bus_space_write_4(sc->csr_tag, sc->csr_handle, csr, val) # define NAME_UNIT device_get_nameunit(sc->dev) # define DRIVER_DEBUG ((sc->config.debug) || (sc->ifp->if_flags & IFF_DEBUG)) -# if (__FreeBSD_version >= 500000) -# define TOP_TRYLOCK mtx_trylock(&sc->top_mtx) -# define TOP_UNLOCK mtx_unlock (&sc->top_mtx) -# define BOTTOM_TRYLOCK mtx_trylock(&sc->bottom_mtx) -# define BOTTOM_UNLOCK mtx_unlock (&sc->bottom_mtx) -# if (__FreeBSD_version >= 700000) -# define CHECK_CAP priv_check(curthread, PRIV_DRIVER) -# else -# define CHECK_CAP suser(curthread) -# endif -# else /* FreeBSD-4 */ -# define TOP_TRYLOCK (sc->top_spl = splimp()) -# define TOP_UNLOCK splx(sc->top_spl) -# define BOTTOM_TRYLOCK 1 /* giant_lock protects */ -# define BOTTOM_UNLOCK /* nothing */ -# define CHECK_CAP suser(curproc) -# endif +# define TOP_TRYLOCK mtx_trylock(&sc->top_mtx) +# define TOP_UNLOCK mtx_unlock (&sc->top_mtx) +# define BOTTOM_TRYLOCK mtx_trylock(&sc->bottom_mtx) +# define BOTTOM_UNLOCK mtx_unlock (&sc->bottom_mtx) +# define CHECK_CAP priv_check(curthread, PRIV_DRIVER) # define DISABLE_INTR /* nothing */ # define ENABLE_INTR /* nothing */ # define IRQ_NONE /* nothing */ @@ -1181,28 +1154,13 @@ struct softc # define DMA_SYNC(map, size, flags) bus_dmamap_sync(ring->tag, map, flags) # define DMA_LOAD(map, addr, size) bus_dmamap_load(ring->tag, map, addr, size, fbsd_dmamap_load, ring, 0) # if (NBPFILTER != 0) -# if (__FreeBSD_version >= 500000) -# define LMC_BPF_MTAP(mbuf) BPF_MTAP(sc->ifp, mbuf) -# else /* FreeBSD-4 */ -# define LMC_BPF_MTAP(mbuf) if (sc->ifp->if_bpf) bpf_mtap(sc->ifp, mbuf) -# endif +# define LMC_BPF_MTAP(mbuf) BPF_MTAP(sc->ifp, mbuf) # define LMC_BPF_ATTACH(dlt, len) bpfattach(sc->ifp, dlt, len) # define LMC_BPF_DETACH bpfdetach(sc->ifp) # endif -# if (__FreeBSD_version >= 500000) -# define IF_DROP(ifq) _IF_DROP(ifq) -# define IF_QFULL(ifq) _IF_QFULL(ifq) -# endif -# if (__FreeBSD_version < 500000) -# define INTR_MPSAFE 0 -# define BUS_DMA_COHERENT 0 -# endif -# if (__FreeBSD_version >= 600000) -# define IFF_RUNNING IFF_DRV_RUNNING -# endif - - - +# define IF_DROP(ifq) _IF_DROP(ifq) +# define IF_QFULL(ifq) _IF_QFULL(ifq) +# define IFF_RUNNING IFF_DRV_RUNNING #if (NBPFILTER == 0) @@ -1211,40 +1169,6 @@ struct softc # define LMC_BPF_DETACH /* nothing */ #endif -#if (defined(__bsdi__) || /* unconditionally */ \ - (defined(__FreeBSD__) && (__FreeBSD_version < 503000)) || \ - (defined(__NetBSD__) && (__NetBSD_Version__ < 106000000)) || \ - (defined(__OpenBSD__) && ( OpenBSD < 200111))) -# define IFQ_ENQUEUE(ifq, m, pa, err) \ -do { \ - if (pa==0); /* suppress warning */ \ - if (IF_QFULL(ifq)) \ - { \ - IF_DROP(ifq); \ - m_freem(m); \ - err = ENOBUFS; \ - } \ - else \ - { \ - IF_ENQUEUE(ifq, m); \ - err = 0; \ - } \ - } while (0) -# define IFQ_DEQUEUE(ifq, m) do { IF_DEQUEUE((ifq), m) } while (0) -# define IFQ_IS_EMPTY(ifq) ((ifq)->ifq_head == NULL) -# define IFQ_SET_MAXLEN(ifq, len) (ifq)->ifq_maxlen = len -# define IFQ_SET_READY(ifq) /* nothing */ -# define IFQ_PURGE(ifq) \ -do { \ - while ((ifq)->ifq_head != NULL) \ - { \ - struct mbuf *m; \ - IF_DEQUEUE(ifq, m); \ - m_freem(m); \ - } \ - } while (0) -#endif - #define HSSI_DESC "SBE/LMC HSSI Card" #define T3_DESC "SBE/LMC T3 Card" #define SSI_DESC "SBE/LMC SSI Card" @@ -1315,10 +1239,6 @@ static void t1_send_bop(softc_t *, int); static int t1_ioctl(softc_t *, struct ioctl *); #if IFNET -# if ((defined(__FreeBSD__) && (__FreeBSD_version < 500000)) ||\ - defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)) -static void netisr_dispatch(int, struct mbuf *); -# endif static void lmc_raw_input(struct ifnet *, struct mbuf *); #endif /* IFNET */ @@ -1372,25 +1292,12 @@ static void lmc_ifnet_detach(softc_t *); #endif /* IFNET */ #if NETGRAPH -# if (__FreeBSD_version >= 500000) static int ng_constructor(node_p); -# else /* FreeBSD-4 */ -static int ng_constructor(node_p *); -# endif -# if (__FreeBSD_version >= 500000) static int ng_rcvmsg(node_p, item_p, hook_p); -# else /* FreeBSD-4 */ -static int ng_rcvmsg(node_p, struct ng_mesg *, - const char *, struct ng_mesg **); -# endif static int ng_shutdown(node_p); static int ng_newhook(node_p, hook_p, const char *); static int ng_connect(hook_p); -# if (__FreeBSD_version >= 500000) static int ng_rcvdata(hook_p, item_p); -# else /* FreeBSD-4 */ -static int ng_rcvdata(hook_p, struct mbuf *, meta_p); -# endif static int ng_disconnect(hook_p); # if (IFNET == 0) static void ng_watchdog(void *); From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 07:07:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CCD6C9E; Tue, 17 Feb 2015 07:07:37 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C40F5F7; Tue, 17 Feb 2015 07:07:37 +0000 (UTC) Received: from julian-mbp3.pixel8networks.com (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t1H77YRl003724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 16 Feb 2015 23:07:35 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <54E2E8B1.3020608@freebsd.org> Date: Mon, 16 Feb 2015 23:07:29 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r278640 - head/sys/netgraph References: <201502122220.t1CMKY8t040498@svn.freebsd.org> <20150214000540.GI15484@FreeBSD.org> <54E1D03A.2070904@freebsd.org> <20150216192653.GI15484@FreeBSD.org> In-Reply-To: <20150216192653.GI15484@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, mav@FreeBSD.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 17 Feb 2015 07:07:37 -0000 On 2/16/15 11:26 AM, Gleb Smirnoff wrote: > On Mon, Feb 16, 2015 at 03:10:50AM -0800, Julian Elischer wrote: > J> On 2/13/15 4:05 PM, Gleb Smirnoff wrote: > J> > Hi! > J> > > J> > On Thu, Feb 12, 2015 at 10:20:34PM +0000, Gleb Smirnoff wrote: > J> > T> Author: glebius > J> > T> Date: Thu Feb 12 22:20:34 2015 > J> > T> New Revision: 278640 > J> > T> URL: https://svnweb.freebsd.org/changeset/base/278640 > J> > T> > J> > T> Log: > J> > T> Revise default limit for maximum of netgraph data items. > J> > T> With modern internet speeds the limit can be reached even > J> > T> on a single L2TP link. > J> > > J> > Actually any ng_item of data type requires an mbuf to be connected > J> > to it, and thus I suggest to use mbuf limits to drive ng_item limits. > J> > > J> > If we got an item leak with mbufs being properly freed, then we've > J> > got a bug to fix, and any limit won't work in long run time. I never > J> > evidenced such a bug, but there complaints on hitting limit at > J> > traffic bursts. As said, with previous 512 item limit I experienced > J> > that even on a laptop. > J> > > J> > Any objections on removing the limit, guys? > J> maybe derived from it, but not the same number. > J> maybe change the systctl to define the relationship? > > I guess you want to have ng_items limit smaller than mbuf limit? > How smaller? > > What problem are we actually guarding against putting this limit? general paranoia, and remember 3rd parties write netgraph nodes. I just would limit to say 50% by default and have a sysctl for 1-100 % so netgraph will not lose all mbufs From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 07:52:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40E91460; Tue, 17 Feb 2015 07:52:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2BE8AA8D; Tue, 17 Feb 2015 07:52:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1H7qpK3056516; Tue, 17 Feb 2015 07:52:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1H7qp18056515; Tue, 17 Feb 2015 07:52:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502170752.t1H7qp18056515@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 17 Feb 2015 07:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278883 - 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 07:52:51 -0000 Author: hselasky Date: Tue Feb 17 07:52:50 2015 New Revision: 278883 URL: https://svnweb.freebsd.org/changeset/base/278883 Log: Try to resolve infinite interrupts by clearing an undocumented interrupt status bit. According to the UHCI controller specification the host controller halted interrupt is non-maskable. PR: 156596 Tested by: adrian @ MFC after: 1 week Modified: head/sys/dev/usb/controller/uhci.c Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Tue Feb 17 05:36:16 2015 (r278882) +++ head/sys/dev/usb/controller/uhci.c Tue Feb 17 07:52:50 2015 (r278883) @@ -1476,7 +1476,8 @@ uhci_interrupt(uhci_softc_t *sc) UHCI_STS_USBEI | UHCI_STS_RD | UHCI_STS_HSE | - UHCI_STS_HCPE); + UHCI_STS_HCPE | + UHCI_STS_HCH); if (status == 0) { /* nothing to acknowledge */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 08:40:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAEDDAB9; Tue, 17 Feb 2015 08:40:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A2047ECE; Tue, 17 Feb 2015 08:40:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1H8eVe7076398; Tue, 17 Feb 2015 08:40:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1H8eSwP076384; Tue, 17 Feb 2015 08:40:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502170840.t1H8eSwP076384@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 17 Feb 2015 08:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278886 - in head/sys: conf contrib/rdma/krping dev/cxgb/ulp/iw_cxgb dev/cxgbe/iw_cxgbe modules/ibcore modules/mlx4ib ofed/drivers/infiniband/core ofed/drivers/infiniband/debug ofed/dri... 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 08:40:31 -0000 Author: hselasky Date: Tue Feb 17 08:40:27 2015 New Revision: 278886 URL: https://svnweb.freebsd.org/changeset/base/278886 Log: Update the infiniband stack to Mellanox's OFED version 2.1. Highlights: - Multiple verbs API updates - Support for RoCE, RDMA over ethernet All hardware drivers depending on the common infiniband stack has been updated aswell. Discussed with: np @ Sponsored by: Mellanox Technologies MFC after: 1 month Added: head/sys/ofed/drivers/infiniband/core/peer_mem.c (contents, props changed) head/sys/ofed/drivers/infiniband/hw/mlx4/mlx4_exp.c (contents, props changed) head/sys/ofed/drivers/infiniband/hw/mlx4/mlx4_exp.h (contents, props changed) head/sys/ofed/include/rdma/ib_peer_mem.h (contents, props changed) head/sys/ofed/include/rdma/ib_user_verbs_exp.h (contents, props changed) head/sys/ofed/include/rdma/ib_verbs_exp.h (contents, props changed) head/sys/ofed/include/rdma/peer_mem.h (contents, props changed) Deleted: head/sys/ofed/drivers/infiniband/core/Makefile head/sys/ofed/drivers/infiniband/core/local_sa.c head/sys/ofed/drivers/infiniband/core/notice.c head/sys/ofed/drivers/infiniband/hw/mlx4/Makefile head/sys/ofed/drivers/infiniband/ulp/ipoib/Makefile Modified: head/sys/conf/files head/sys/contrib/rdma/krping/krping.c head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c head/sys/dev/cxgbe/iw_cxgbe/cq.c head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h head/sys/dev/cxgbe/iw_cxgbe/mem.c head/sys/modules/ibcore/Makefile head/sys/modules/mlx4ib/Makefile head/sys/ofed/drivers/infiniband/core/addr.c head/sys/ofed/drivers/infiniband/core/cache.c head/sys/ofed/drivers/infiniband/core/cm.c head/sys/ofed/drivers/infiniband/core/cm_msgs.h head/sys/ofed/drivers/infiniband/core/cma.c head/sys/ofed/drivers/infiniband/core/core_priv.h head/sys/ofed/drivers/infiniband/core/device.c head/sys/ofed/drivers/infiniband/core/fmr_pool.c head/sys/ofed/drivers/infiniband/core/iwcm.c head/sys/ofed/drivers/infiniband/core/mad.c head/sys/ofed/drivers/infiniband/core/mad_priv.h head/sys/ofed/drivers/infiniband/core/mad_rmpp.c head/sys/ofed/drivers/infiniband/core/multicast.c head/sys/ofed/drivers/infiniband/core/packer.c head/sys/ofed/drivers/infiniband/core/sa.h head/sys/ofed/drivers/infiniband/core/sa_query.c head/sys/ofed/drivers/infiniband/core/smi.c head/sys/ofed/drivers/infiniband/core/sysfs.c head/sys/ofed/drivers/infiniband/core/ucm.c head/sys/ofed/drivers/infiniband/core/ucma.c head/sys/ofed/drivers/infiniband/core/ud_header.c head/sys/ofed/drivers/infiniband/core/umem.c head/sys/ofed/drivers/infiniband/core/user_mad.c head/sys/ofed/drivers/infiniband/core/uverbs.h head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c head/sys/ofed/drivers/infiniband/core/uverbs_main.c head/sys/ofed/drivers/infiniband/core/uverbs_marshall.c head/sys/ofed/drivers/infiniband/core/verbs.c head/sys/ofed/drivers/infiniband/debug/memtrack.c head/sys/ofed/drivers/infiniband/debug/memtrack.h head/sys/ofed/drivers/infiniband/debug/mtrack.h head/sys/ofed/drivers/infiniband/hw/mlx4/ah.c head/sys/ofed/drivers/infiniband/hw/mlx4/alias_GUID.c head/sys/ofed/drivers/infiniband/hw/mlx4/cm.c head/sys/ofed/drivers/infiniband/hw/mlx4/cq.c head/sys/ofed/drivers/infiniband/hw/mlx4/doorbell.c head/sys/ofed/drivers/infiniband/hw/mlx4/mad.c head/sys/ofed/drivers/infiniband/hw/mlx4/main.c head/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c head/sys/ofed/drivers/infiniband/hw/mlx4/mlx4_ib.h head/sys/ofed/drivers/infiniband/hw/mlx4/mr.c head/sys/ofed/drivers/infiniband/hw/mlx4/qp.c head/sys/ofed/drivers/infiniband/hw/mlx4/sysfs.c head/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c head/sys/ofed/drivers/infiniband/hw/mthca/mthca_qp.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c head/sys/ofed/include/rdma/ib_addr.h head/sys/ofed/include/rdma/ib_cache.h head/sys/ofed/include/rdma/ib_cm.h head/sys/ofed/include/rdma/ib_mad.h head/sys/ofed/include/rdma/ib_pack.h head/sys/ofed/include/rdma/ib_sa.h head/sys/ofed/include/rdma/ib_umem.h head/sys/ofed/include/rdma/ib_user_verbs.h head/sys/ofed/include/rdma/ib_verbs.h head/sys/ofed/include/rdma/iw_cm.h head/sys/ofed/include/rdma/rdma_cm.h head/sys/ofed/include/rdma/rdma_user_cm.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 17 08:38:02 2015 (r278885) +++ head/sys/conf/files Tue Feb 17 08:40:27 2015 (r278886) @@ -3624,19 +3624,16 @@ ofed/drivers/infiniband/core/fmr_pool.c ofed/drivers/infiniband/core/iwcm.c optional ofed \ no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/local_sa.c optional ofed \ - no-depend \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/mad_rmpp.c optional ofed \ no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/multicast.c optional ofed \ no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/notice.c optional ofed \ +ofed/drivers/infiniband/core/packer.c optional ofed \ no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/packer.c optional ofed \ +ofed/drivers/infiniband/core/peer_mem.c optional ofed \ no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" ofed/drivers/infiniband/core/sa_query.c optional ofed \ @@ -3741,6 +3738,9 @@ ofed/drivers/infiniband/hw/mlx4/mad.c o ofed/drivers/infiniband/hw/mlx4/main.c optional mlx4ib \ no-depend obj-prefix "mlx4ib_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" +ofed/drivers/infiniband/hw/mlx4/mlx4_exp.c optional mlx4ib \ + no-depend \ + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" ofed/drivers/infiniband/hw/mlx4/mr.c optional mlx4ib \ no-depend obj-prefix "mlx4ib_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Tue Feb 17 08:38:02 2015 (r278885) +++ head/sys/contrib/rdma/krping/krping.c Tue Feb 17 08:40:27 2015 (r278886) @@ -525,7 +525,7 @@ static void krping_setup_wr(struct krpin case MW: cb->bind_attr.wr_id = 0xabbaabba; cb->bind_attr.send_flags = 0; /* unsignaled */ - cb->bind_attr.length = cb->size; + cb->bind_attr.bind_info.length = cb->size; break; default: break; @@ -627,7 +627,7 @@ static int krping_setup_buffers(struct k cb->page_list, cb->page_list_len); break; case MW: - cb->mw = ib_alloc_mw(cb->pd); + cb->mw = ib_alloc_mw(cb->pd,IB_MW_TYPE_1); if (IS_ERR(cb->mw)) { DEBUG_LOG(cb, "recv_buf alloc_mw failed\n"); ret = PTR_ERR(cb->mw); @@ -898,15 +898,15 @@ static u32 krping_rdma_rkey(struct krpin * Update the MW with new buf info. */ if (buf == (u64)cb->start_dma_addr) { - cb->bind_attr.mw_access_flags = IB_ACCESS_REMOTE_READ; - cb->bind_attr.mr = cb->start_mr; + cb->bind_attr.bind_info.mw_access_flags = IB_ACCESS_REMOTE_READ; + cb->bind_attr.bind_info.mr = cb->start_mr; } else { - cb->bind_attr.mw_access_flags = IB_ACCESS_REMOTE_WRITE; - cb->bind_attr.mr = cb->rdma_mr; + cb->bind_attr.bind_info.mw_access_flags = IB_ACCESS_REMOTE_WRITE; + cb->bind_attr.bind_info.mr = cb->rdma_mr; } - cb->bind_attr.addr = buf; + cb->bind_attr.bind_info.addr = buf; DEBUG_LOG(cb, "binding mw rkey 0x%x to buf %llx mr rkey 0x%x\n", - cb->mw->rkey, buf, cb->bind_attr.mr->rkey); + cb->mw->rkey, buf, cb->bind_attr.bind_info.mr->rkey); ret = ib_bind_mw(cb->qp, cb->mw, &cb->bind_attr); if (ret) { PRINTF(cb, "bind mw error %d\n", ret); @@ -2304,7 +2304,7 @@ int krping_doit(char *cmd, void *cookie) goto out; } - cb->cm_id = rdma_create_id(krping_cma_event_handler, cb, RDMA_PS_TCP); + cb->cm_id = rdma_create_id(krping_cma_event_handler, cb, RDMA_PS_TCP, IB_QPT_RC); if (IS_ERR(cb->cm_id)) { ret = PTR_ERR(cb->cm_id); PRINTF(cb, "rdma_create_id error %d\n", ret); Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c Tue Feb 17 08:38:02 2015 (r278885) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c Tue Feb 17 08:40:27 2015 (r278886) @@ -176,7 +176,7 @@ iwch_destroy_cq(struct ib_cq *ib_cq) } static struct ib_cq * -iwch_create_cq(struct ib_device *ibdev, int entries, int vector, +iwch_create_cq(struct ib_device *ibdev, struct ib_cq_init_attr *attr, struct ib_ucontext *ib_context, struct ib_udata *udata) { @@ -187,6 +187,7 @@ iwch_create_cq(struct ib_device *ibdev, struct iwch_ucontext *ucontext = NULL; static int warned; size_t resplen; + int entries = attr->cqe; CTR3(KTR_IW_CXGB, "%s ib_dev %p entries %d", __FUNCTION__, ibdev, entries); rhp = to_iwch_dev(ibdev); @@ -545,16 +546,14 @@ static struct ib_mr *iwch_reg_user_mr(st int mr_id) { __be64 *pages; - int shift, i, n; + int shift, n, len; + int i, k, entry; int err = 0; - struct ib_umem_chunk *chunk; struct iwch_dev *rhp; struct iwch_pd *php; struct iwch_mr *mhp; struct iwch_reg_user_mr_resp uresp; -#ifdef notyet - int j, k, len; -#endif + struct scatterlist *sg; CTR2(KTR_IW_CXGB, "%s ib_pd %p", __FUNCTION__, pd); @@ -575,9 +574,7 @@ static struct ib_mr *iwch_reg_user_mr(st shift = ffs(mhp->umem->page_size) - 1; - n = 0; - list_for_each_entry(chunk, &mhp->umem->chunk_list, list) - n += chunk->nents; + n = mhp->umem->nmap; err = iwch_alloc_pbl(mhp, n); if (err) @@ -591,7 +588,21 @@ static struct ib_mr *iwch_reg_user_mr(st i = n = 0; -#ifdef notyet + for_each_sg(mhp->umem->sg_head.sgl, sg, mhp->umem->nmap, entry) { + len = sg_dma_len(sg) >> shift; + for (k = 0; k < len; ++k) { + pages[i++] = cpu_to_be64(sg_dma_address(sg) + + mhp->umem->page_size * k); + if (i == PAGE_SIZE / sizeof *pages) { + err = iwch_write_pbl(mhp, pages, i, n); + if (err) + goto pbl_done; + n += i; + i = 0; + } + } + } +#if 0 TAILQ_FOREACH(chunk, &mhp->umem->chunk_list, entry) for (j = 0; j < chunk->nmap; ++j) { len = sg_dma_len(&chunk->page_list[j]) >> shift; @@ -612,9 +623,7 @@ static struct ib_mr *iwch_reg_user_mr(st if (i) err = iwch_write_pbl(mhp, pages, i, n); -#ifdef notyet pbl_done: -#endif cxfree(pages); if (err) goto err_pbl; @@ -672,7 +681,7 @@ static struct ib_mr *iwch_get_dma_mr(str return ibmr; } -static struct ib_mw *iwch_alloc_mw(struct ib_pd *pd) +static struct ib_mw *iwch_alloc_mw(struct ib_pd *pd, enum ib_mw_type type) { struct iwch_dev *rhp; struct iwch_pd *php; Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c Tue Feb 17 08:38:02 2015 (r278885) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c Tue Feb 17 08:40:27 2015 (r278886) @@ -551,18 +551,18 @@ int iwch_bind_mw(struct ib_qp *qp, if (mw_bind->send_flags & IB_SEND_SIGNALED) t3_wr_flags = T3_COMPLETION_FLAG; - sgl.addr = mw_bind->addr; - sgl.lkey = mw_bind->mr->lkey; - sgl.length = mw_bind->length; + sgl.addr = mw_bind->bind_info.addr; + sgl.lkey = mw_bind->bind_info.mr->lkey; + sgl.length = mw_bind->bind_info.length; wqe->bind.reserved = 0; wqe->bind.type = T3_VA_BASED_TO; /* TBD: check perms */ - wqe->bind.perms = iwch_ib_to_mwbind_access(mw_bind->mw_access_flags); - wqe->bind.mr_stag = htobe32(mw_bind->mr->lkey); + wqe->bind.perms = iwch_ib_to_mwbind_access(mw_bind->bind_info.mw_access_flags); + wqe->bind.mr_stag = htobe32(mw_bind->bind_info.mr->lkey); wqe->bind.mw_stag = htobe32(mw->rkey); - wqe->bind.mw_len = htobe32(mw_bind->length); - wqe->bind.mw_va = htobe64(mw_bind->addr); + wqe->bind.mw_len = htobe32(mw_bind->bind_info.length); + wqe->bind.mw_va = htobe64(mw_bind->bind_info.addr); err = iwch_sgl2pbl_map(rhp, &sgl, 1, &pbl_addr, &page_size); if (err) { mtx_unlock(&qhp->lock); Modified: head/sys/dev/cxgbe/iw_cxgbe/cq.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cq.c Tue Feb 17 08:38:02 2015 (r278885) +++ head/sys/dev/cxgbe/iw_cxgbe/cq.c Tue Feb 17 08:40:27 2015 (r278886) @@ -775,7 +775,7 @@ int c4iw_destroy_cq(struct ib_cq *ib_cq) } struct ib_cq * -c4iw_create_cq(struct ib_device *ibdev, int entries, int vector, +c4iw_create_cq(struct ib_device *ibdev, struct ib_cq_init_attr *attr, struct ib_ucontext *ib_context, struct ib_udata *udata) { struct c4iw_dev *rhp; @@ -785,6 +785,7 @@ c4iw_create_cq(struct ib_device *ibdev, int ret; size_t memsize, hwentries; struct c4iw_mm_entry *mm, *mm2; + int entries = attr->cqe; CTR3(KTR_IW_CXGBE, "%s ib_dev %p entries %d", __func__, ibdev, entries); Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Tue Feb 17 08:38:02 2015 (r278885) +++ head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Tue Feb 17 08:40:27 2015 (r278886) @@ -864,7 +864,7 @@ struct ib_fast_reg_page_list *c4iw_alloc int page_list_len); struct ib_mr *c4iw_alloc_fast_reg_mr(struct ib_pd *pd, int pbl_depth); int c4iw_dealloc_mw(struct ib_mw *mw); -struct ib_mw *c4iw_alloc_mw(struct ib_pd *pd); +struct ib_mw *c4iw_alloc_mw(struct ib_pd *pd, enum ib_mw_type type); struct ib_mr *c4iw_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, u64 virt, int acc, struct ib_udata *udata, int mr_id); struct ib_mr *c4iw_get_dma_mr(struct ib_pd *pd, int acc); @@ -881,8 +881,7 @@ int c4iw_reregister_phys_mem(struct ib_m int acc, u64 *iova_start); int c4iw_dereg_mr(struct ib_mr *ib_mr); int c4iw_destroy_cq(struct ib_cq *ib_cq); -struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries, - int vector, +struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, struct ib_cq_init_attr *attr, struct ib_ucontext *ib_context, struct ib_udata *udata); int c4iw_resize_cq(struct ib_cq *cq, int cqe, struct ib_udata *udata); Modified: head/sys/dev/cxgbe/iw_cxgbe/mem.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/mem.c Tue Feb 17 08:38:02 2015 (r278885) +++ head/sys/dev/cxgbe/iw_cxgbe/mem.c Tue Feb 17 08:40:27 2015 (r278886) @@ -563,9 +563,9 @@ struct ib_mr *c4iw_reg_user_mr(struct ib { __be64 *pages; int shift, n, len; - int i, j, k; + int i, k, entry; int err = 0; - struct ib_umem_chunk *chunk; + struct scatterlist *sg; struct c4iw_dev *rhp; struct c4iw_pd *php; struct c4iw_mr *mhp; @@ -594,11 +594,8 @@ struct ib_mr *c4iw_reg_user_mr(struct ib } shift = ffs(mhp->umem->page_size) - 1; - - n = 0; - list_for_each_entry(chunk, &mhp->umem->chunk_list, list) - n += chunk->nents; - + + n = mhp->umem->nmap; err = alloc_pbl(mhp, n); if (err) goto err; @@ -610,25 +607,23 @@ struct ib_mr *c4iw_reg_user_mr(struct ib } i = n = 0; - - list_for_each_entry(chunk, &mhp->umem->chunk_list, list) - for (j = 0; j < chunk->nmap; ++j) { - len = sg_dma_len(&chunk->page_list[j]) >> shift; - for (k = 0; k < len; ++k) { - pages[i++] = cpu_to_be64(sg_dma_address( - &chunk->page_list[j]) + + for_each_sg(mhp->umem->sg_head.sgl, sg, mhp->umem->nmap, entry) { + len = sg_dma_len(sg) >> shift; + for (k = 0; k < len; ++k) { + pages[i++] = cpu_to_be64(sg_dma_address(sg) + mhp->umem->page_size * k); - if (i == PAGE_SIZE / sizeof *pages) { - err = write_pbl(&mhp->rhp->rdev, - pages, - mhp->attr.pbl_addr + (n << 3), i); - if (err) - goto pbl_done; - n += i; - i = 0; - } + if (i == PAGE_SIZE / sizeof *pages) { + err = write_pbl(&mhp->rhp->rdev, + pages, + mhp->attr.pbl_addr + (n << 3), i); + if (err) + goto pbl_done; + n += i; + i = 0; + } } + } if (i) err = write_pbl(&mhp->rhp->rdev, pages, @@ -662,7 +657,7 @@ err: return ERR_PTR(err); } -struct ib_mw *c4iw_alloc_mw(struct ib_pd *pd) +struct ib_mw *c4iw_alloc_mw(struct ib_pd *pd, enum ib_mw_type type) { struct c4iw_dev *rhp; struct c4iw_pd *php; Modified: head/sys/modules/ibcore/Makefile ============================================================================== --- head/sys/modules/ibcore/Makefile Tue Feb 17 08:38:02 2015 (r278885) +++ head/sys/modules/ibcore/Makefile Tue Feb 17 08:40:27 2015 (r278886) @@ -4,8 +4,8 @@ KMOD= ibcore SRCS= addr.c iwcm.c sa_query.c ucma.c uverbs_cmd.c \ - agent.c local_sa.c multicast.c smi.c ud_header.c uverbs_main.c \ - mad.c notice.c umem.c uverbs_marshall.c \ + agent.c multicast.c smi.c ud_header.c uverbs_main.c \ + mad.c peer_mem.c umem.c uverbs_marshall.c \ cache.c device.c packer.c sysfs.c user_mad.c verbs.c \ cm.c fmr_pool.c mad_rmpp.c ucm.c cma.c \ vnode_if.h device_if.h bus_if.h pci_if.h \ Modified: head/sys/modules/mlx4ib/Makefile ============================================================================== --- head/sys/modules/mlx4ib/Makefile Tue Feb 17 08:38:02 2015 (r278885) +++ head/sys/modules/mlx4ib/Makefile Tue Feb 17 08:40:27 2015 (r278886) @@ -6,6 +6,7 @@ KMOD= mlx4ib SRCS= device_if.h bus_if.h vnode_if.h pci_if.h \ opt_inet.h opt_inet6.h \ alias_GUID.c mcg.c sysfs.c ah.c cq.c \ + mlx4_exp.c \ doorbell.c mad.c main.c mr.c qp.c srq.c wc.c cm.c CFLAGS+= -I${.CURDIR}/../../ofed/drivers/infiniband/hw/mlx4 Modified: head/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/addr.c Tue Feb 17 08:38:02 2015 (r278885) +++ head/sys/ofed/drivers/infiniband/core/addr.c Tue Feb 17 08:40:27 2015 (r278886) @@ -69,6 +69,7 @@ static LIST_HEAD(req_list); static struct delayed_work work; static struct workqueue_struct *addr_wq; +static struct rdma_addr_client self; void rdma_addr_register_client(struct rdma_addr_client *client) { atomic_set(&client->refcount, 1); @@ -89,19 +90,6 @@ void rdma_addr_unregister_client(struct } EXPORT_SYMBOL(rdma_addr_unregister_client); -#ifdef __linux__ -int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev, - const unsigned char *dst_dev_addr) -{ - dev_addr->dev_type = dev->type; - memcpy(dev_addr->src_dev_addr, dev->dev_addr, MAX_ADDR_LEN); - memcpy(dev_addr->broadcast, dev->broadcast, MAX_ADDR_LEN); - if (dst_dev_addr) - memcpy(dev_addr->dst_dev_addr, dst_dev_addr, MAX_ADDR_LEN); - dev_addr->bound_dev_if = dev->ifindex; - return 0; -} -#else int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct ifnet *dev, const unsigned char *dst_dev_addr) { @@ -119,10 +107,10 @@ int rdma_copy_addr(struct rdma_dev_addr dev_addr->bound_dev_if = dev->if_index; return 0; } -#endif EXPORT_SYMBOL(rdma_copy_addr); -int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr) +int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr, + u16 *vlan_id) { struct net_device *dev; int ret = -EADDRNOTAVAIL; @@ -137,33 +125,21 @@ int rdma_translate_ip(struct sockaddr *a } switch (addr->sa_family) { -#ifdef INET case AF_INET: - dev = ip_dev_find(NULL, + dev = ip_dev_find(&init_net, ((struct sockaddr_in *) addr)->sin_addr.s_addr); if (!dev) return ret; ret = rdma_copy_addr(dev_addr, dev, NULL); + if (vlan_id) + *vlan_id = rdma_vlan_dev_vlan_id(dev); dev_put(dev); break; -#endif #if defined(INET6) case AF_INET6: -#ifdef __linux__ - read_lock(&dev_base_lock); - for_each_netdev(&init_net, dev) { - if (ipv6_chk_addr(&init_net, - &((struct sockaddr_in6 *) addr)->sin6_addr, - dev, 1)) { - ret = rdma_copy_addr(dev_addr, dev, NULL); - break; - } - } - read_unlock(&dev_base_lock); -#else { struct sockaddr_in6 *sin6; struct ifaddr *ifa; @@ -179,12 +155,12 @@ int rdma_translate_ip(struct sockaddr *a break; } ret = rdma_copy_addr(dev_addr, ifa->ifa_ifp, NULL); + if (vlan_id) + *vlan_id = rdma_vlan_dev_vlan_id(ifa->ifa_ifp); ifa_free(ifa); break; } #endif - break; -#endif } return ret; } @@ -218,127 +194,6 @@ static void queue_req(struct addr_req *r mutex_unlock(&lock); } -#ifdef __linux__ -static int addr4_resolve(struct sockaddr_in *src_in, - struct sockaddr_in *dst_in, - struct rdma_dev_addr *addr) -{ - __be32 src_ip = src_in->sin_addr.s_addr; - __be32 dst_ip = dst_in->sin_addr.s_addr; - struct flowi fl; - struct rtable *rt; - struct neighbour *neigh; - int ret; - - memset(&fl, 0, sizeof fl); - fl.nl_u.ip4_u.daddr = dst_ip; - fl.nl_u.ip4_u.saddr = src_ip; - fl.oif = addr->bound_dev_if; - - ret = ip_route_output_key(&init_net, &rt, &fl); - if (ret) - goto out; - - src_in->sin_family = AF_INET; - src_in->sin_addr.s_addr = rt->rt_src; - - if (rt->idev->dev->flags & IFF_LOOPBACK) { - ret = rdma_translate_ip((struct sockaddr *) dst_in, addr); - if (!ret) - memcpy(addr->dst_dev_addr, addr->src_dev_addr, MAX_ADDR_LEN); - goto put; - } - - /* If the device does ARP internally, return 'done' */ - if (rt->idev->dev->flags & IFF_NOARP) { - rdma_copy_addr(addr, rt->idev->dev, NULL); - goto put; - } - - neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, rt->idev->dev); - if (!neigh || !(neigh->nud_state & NUD_VALID)) { - neigh_event_send(rt->u.dst.neighbour, NULL); - ret = -ENODATA; - if (neigh) - goto release; - goto put; - } - - ret = rdma_copy_addr(addr, neigh->dev, neigh->ha); -release: - neigh_release(neigh); -put: - ip_rt_put(rt); -out: - return ret; -} - -#if defined(INET6) -static int addr6_resolve(struct sockaddr_in6 *src_in, - struct sockaddr_in6 *dst_in, - struct rdma_dev_addr *addr) -{ - struct flowi fl; - struct neighbour *neigh; - struct dst_entry *dst; - int ret; - - memset(&fl, 0, sizeof fl); - ipv6_addr_copy(&fl.fl6_dst, &dst_in->sin6_addr); - ipv6_addr_copy(&fl.fl6_src, &src_in->sin6_addr); - fl.oif = addr->bound_dev_if; - - dst = ip6_route_output(&init_net, NULL, &fl); - if ((ret = dst->error)) - goto put; - - if (ipv6_addr_any(&fl.fl6_src)) { - ret = ipv6_dev_get_saddr(&init_net, ip6_dst_idev(dst)->dev, - &fl.fl6_dst, 0, &fl.fl6_src); - if (ret) - goto put; - - src_in->sin6_family = AF_INET6; - ipv6_addr_copy(&src_in->sin6_addr, &fl.fl6_src); - } - - if (dst->dev->flags & IFF_LOOPBACK) { - ret = rdma_translate_ip((struct sockaddr *) dst_in, addr); - if (!ret) - memcpy(addr->dst_dev_addr, addr->src_dev_addr, MAX_ADDR_LEN); - goto put; - } - - /* If the device does ARP internally, return 'done' */ - if (dst->dev->flags & IFF_NOARP) { - ret = rdma_copy_addr(addr, dst->dev, NULL); - goto put; - } - - neigh = dst->neighbour; - if (!neigh || !(neigh->nud_state & NUD_VALID)) { - neigh_event_send(dst->neighbour, NULL); - ret = -ENODATA; - goto put; - } - - ret = rdma_copy_addr(addr, dst->dev, neigh->ha); -put: - dst_release(dst); - return ret; -} -#else -static int addr6_resolve(struct sockaddr_in6 *src_in, - struct sockaddr_in6 *dst_in, - struct rdma_dev_addr *addr) -{ - return -EADDRNOTAVAIL; -} -#endif - -#else -#include - static int addr_resolve(struct sockaddr *src_in, struct sockaddr *dst_in, struct rdma_dev_addr *addr) @@ -354,7 +209,6 @@ static int addr_resolve(struct sockaddr int bcast; int is_gw = 0; int error = 0; - /* * Determine whether the address is unicast, multicast, or broadcast * and whether the source interface is valid. @@ -382,8 +236,7 @@ static int addr_resolve(struct sockaddr port = sin->sin_port; sin->sin_port = 0; memset(&sin->sin_zero, 0, sizeof(sin->sin_zero)); - } else - src_in = NULL; + } break; #endif #ifdef INET6 @@ -406,7 +259,7 @@ static int addr_resolve(struct sockaddr * If we have a source address to use look it up first and verify * that it is a local interface. */ - if (src_in) { + if (sin->sin_addr.s_addr != INADDR_ANY) { ifa = ifa_ifwithaddr(src_in); if (sin) sin->sin_port = port; @@ -436,15 +289,20 @@ static int addr_resolve(struct sockaddr * correct interface pointer and unlock the route. */ if (multi || bcast) { - if (ifp == NULL) + if (ifp == NULL) { ifp = rte->rt_ifp; + /* rt_ifa holds the route answer source address */ + ifa = rte->rt_ifa; + } RTFREE_LOCKED(rte); } else if (ifp && ifp != rte->rt_ifp) { RTFREE_LOCKED(rte); return -ENETUNREACH; } else { - if (ifp == NULL) + if (ifp == NULL) { ifp = rte->rt_ifp; + ifa = rte->rt_ifa; + } RT_UNLOCK(rte); } mcast: @@ -459,6 +317,8 @@ mcast: error = rdma_copy_addr(addr, ifp, LLADDR((struct sockaddr_dl *)llsa)); free(llsa, M_IFMADDR); + if (error == 0) + memcpy(src_in, ifa->ifa_addr, ip_addr_size(ifa->ifa_addr)); return error; } /* @@ -472,7 +332,7 @@ mcast: #endif #ifdef INET6 case AF_INET6: - error = nd6_storelladdr(ifp, NULL, dst_in, (u_char *)edst,NULL); + error = nd6_storelladdr(ifp, NULL, dst_in, (u_char *)edst, NULL); break; #endif default: @@ -480,15 +340,15 @@ mcast: error = -EINVAL; } RTFREE(rte); - if (error == 0) + if (error == 0) { + memcpy(src_in, ifa->ifa_addr, ip_addr_size(ifa->ifa_addr)); return rdma_copy_addr(addr, ifp, edst); + } if (error == EWOULDBLOCK) return -ENODATA; return -error; } -#endif - static void process_req(struct work_struct *work) { struct addr_req *req, *temp_req; @@ -602,20 +462,94 @@ void rdma_addr_cancel(struct rdma_dev_ad } EXPORT_SYMBOL(rdma_addr_cancel); +struct resolve_cb_context { + struct rdma_dev_addr *addr; + struct completion comp; +}; + +static void resolve_cb(int status, struct sockaddr *src_addr, + struct rdma_dev_addr *addr, void *context) +{ + memcpy(((struct resolve_cb_context *)context)->addr, addr, sizeof(struct + rdma_dev_addr)); + complete(&((struct resolve_cb_context *)context)->comp); +} + +int rdma_addr_find_dmac_by_grh(union ib_gid *sgid, union ib_gid *dgid, u8 *dmac, + u16 *vlan_id) +{ + int ret = 0; + struct rdma_dev_addr dev_addr; + struct resolve_cb_context ctx; + struct net_device *dev; + + union { + struct sockaddr _sockaddr; + struct sockaddr_in _sockaddr_in; + struct sockaddr_in6 _sockaddr_in6; + } sgid_addr, dgid_addr; + + + ret = rdma_gid2ip(&sgid_addr._sockaddr, sgid); + if (ret) + return ret; + + ret = rdma_gid2ip(&dgid_addr._sockaddr, dgid); + if (ret) + return ret; + + memset(&dev_addr, 0, sizeof(dev_addr)); + + ctx.addr = &dev_addr; + init_completion(&ctx.comp); + ret = rdma_resolve_ip(&self, &sgid_addr._sockaddr, &dgid_addr._sockaddr, + &dev_addr, 1000, resolve_cb, &ctx); + if (ret) + return ret; + + wait_for_completion(&ctx.comp); + + memcpy(dmac, dev_addr.dst_dev_addr, ETH_ALEN); + dev = dev_get_by_index(&init_net, dev_addr.bound_dev_if); + if (!dev) + return -ENODEV; + if (vlan_id) + *vlan_id = rdma_vlan_dev_vlan_id(dev); + dev_put(dev); + return ret; +} +EXPORT_SYMBOL(rdma_addr_find_dmac_by_grh); + +int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id) +{ + int ret = 0; + struct rdma_dev_addr dev_addr; + union { + struct sockaddr _sockaddr; + struct sockaddr_in _sockaddr_in; + struct sockaddr_in6 _sockaddr_in6; + } gid_addr; + + ret = rdma_gid2ip(&gid_addr._sockaddr, sgid); + + if (ret) + return ret; + memset(&dev_addr, 0, sizeof(dev_addr)); + ret = rdma_translate_ip(&gid_addr._sockaddr, &dev_addr, vlan_id); + if (ret) + return ret; + + memcpy(smac, dev_addr.src_dev_addr, ETH_ALEN); + return ret; +} +EXPORT_SYMBOL(rdma_addr_find_smac_by_sgid); + static int netevent_callback(struct notifier_block *self, unsigned long event, void *ctx) { if (event == NETEVENT_NEIGH_UPDATE) { -#ifdef __linux__ - struct neighbour *neigh = ctx; - - if (neigh->nud_state & NUD_VALID) { set_timeout(jiffies); } -#else - set_timeout(jiffies); -#endif - } return 0; } @@ -631,11 +565,13 @@ static int __init addr_init(void) return -ENOMEM; register_netevent_notifier(&nb); + rdma_addr_register_client(&self); return 0; } static void __exit addr_cleanup(void) { + rdma_addr_unregister_client(&self); unregister_netevent_notifier(&nb); destroy_workqueue(addr_wq); } Modified: head/sys/ofed/drivers/infiniband/core/cache.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/cache.c Tue Feb 17 08:38:02 2015 (r278885) +++ head/sys/ofed/drivers/infiniband/core/cache.c Tue Feb 17 08:40:27 2015 (r278886) @@ -76,19 +76,21 @@ int ib_get_cached_gid(struct ib_device * { struct ib_gid_cache *cache; unsigned long flags; - int ret = 0; + int ret = -EINVAL; if (port_num < start_port(device) || port_num > end_port(device)) return -EINVAL; read_lock_irqsave(&device->cache.lock, flags); - cache = device->cache.gid_cache[port_num - start_port(device)]; + if (device->cache.gid_cache) { + cache = device->cache.gid_cache[port_num - start_port(device)]; - if (index < 0 || index >= cache->table_len) - ret = -EINVAL; - else - *gid = cache->table[index]; + if (cache && index >= 0 && index < cache->table_len) { + *gid = cache->table[index]; + ret = 0; + } + } read_unlock_irqrestore(&device->cache.lock, flags); @@ -111,22 +113,24 @@ int ib_find_cached_gid(struct ib_device *index = -1; read_lock_irqsave(&device->cache.lock, flags); - + if (!device->cache.gid_cache) + goto out; for (p = 0; p <= end_port(device) - start_port(device); ++p) { cache = device->cache.gid_cache[p]; + if (!cache) + continue; for (i = 0; i < cache->table_len; ++i) { if (!memcmp(gid, &cache->table[i], sizeof *gid)) { *port_num = p + start_port(device); if (index) *index = i; ret = 0; - goto found; + goto out; } } } -found: +out: read_unlock_irqrestore(&device->cache.lock, flags); - return ret; } EXPORT_SYMBOL(ib_find_cached_gid); @@ -138,19 +142,21 @@ int ib_get_cached_pkey(struct ib_device { struct ib_pkey_cache *cache; unsigned long flags; - int ret = 0; + int ret = -EINVAL; if (port_num < start_port(device) || port_num > end_port(device)) return -EINVAL; read_lock_irqsave(&device->cache.lock, flags); - cache = device->cache.pkey_cache[port_num - start_port(device)]; + if (device->cache.pkey_cache) { + cache = device->cache.pkey_cache[port_num - start_port(device)]; - if (index < 0 || index >= cache->table_len) - ret = -EINVAL; - else - *pkey = cache->table[index]; + if (cache && index >= 0 && index < cache->table_len) { + *pkey = cache->table[index]; + ret = 0; + } + } read_unlock_irqrestore(&device->cache.lock, flags); @@ -167,41 +173,93 @@ int ib_find_cached_pkey(struct ib_device unsigned long flags; int i; int ret = -ENOENT; + int partial_ix = -1; if (port_num < start_port(device) || port_num > end_port(device)) return -EINVAL; + *index = -1; + read_lock_irqsave(&device->cache.lock, flags); + if (!device->cache.pkey_cache) + goto out; + cache = device->cache.pkey_cache[port_num - start_port(device)]; + if (!cache) + goto out; + + for (i = 0; i < cache->table_len; ++i) + if ((cache->table[i] & 0x7fff) == (pkey & 0x7fff)) { + if (cache->table[i] & 0x8000) { + *index = i; + ret = 0; + break; + } else + partial_ix = i; + } + + if (ret && partial_ix >= 0) { + *index = partial_ix; + ret = 0; + } +out: + read_unlock_irqrestore(&device->cache.lock, flags); + return ret; +} +EXPORT_SYMBOL(ib_find_cached_pkey); + +int ib_find_exact_cached_pkey(struct ib_device *device, + u8 port_num, + u16 pkey, + u16 *index) +{ + struct ib_pkey_cache *cache; + unsigned long flags; + int i; + int ret = -ENOENT; + + if (port_num < start_port(device) || port_num > end_port(device)) + return -EINVAL; *index = -1; + read_lock_irqsave(&device->cache.lock, flags); + + if (!device->cache.pkey_cache) + goto out; + + cache = device->cache.pkey_cache[port_num - start_port(device)]; + if (!cache) + goto out; + for (i = 0; i < cache->table_len; ++i) - if ((cache->table[i] & 0x7fff) == (pkey & 0x7fff)) { + if (cache->table[i] == pkey) { *index = i; ret = 0; break; } - +out: read_unlock_irqrestore(&device->cache.lock, flags); - return ret; } -EXPORT_SYMBOL(ib_find_cached_pkey); +EXPORT_SYMBOL(ib_find_exact_cached_pkey); int ib_get_cached_lmc(struct ib_device *device, u8 port_num, u8 *lmc) { unsigned long flags; - int ret = 0; + int ret = -EINVAL; if (port_num < start_port(device) || port_num > end_port(device)) return -EINVAL; read_lock_irqsave(&device->cache.lock, flags); - *lmc = device->cache.lmc_cache[port_num - start_port(device)]; + if (device->cache.lmc_cache) { + *lmc = device->cache.lmc_cache[port_num - start_port(device)]; + ret = 0; + } read_unlock_irqrestore(&device->cache.lock, flags); return ret; @@ -217,6 +275,10 @@ static void ib_cache_update(struct ib_de int i; int ret; + if (!(device->cache.pkey_cache && device->cache.gid_cache && + device->cache.lmc_cache)) + return; + tprops = kmalloc(sizeof *tprops, GFP_KERNEL); if (!tprops) return; @@ -309,7 +371,7 @@ static void ib_cache_event(struct ib_eve INIT_WORK(&work->work, ib_cache_task); work->device = event->device; work->port_num = event->element.port_num; - schedule_work(&work->work); + queue_work(ib_wq, &work->work); } } } @@ -362,14 +424,21 @@ err: kfree(device->cache.pkey_cache); kfree(device->cache.gid_cache); kfree(device->cache.lmc_cache); + device->cache.pkey_cache = NULL; + device->cache.gid_cache = NULL; + device->cache.lmc_cache = NULL; } static void ib_cache_cleanup_one(struct ib_device *device) { int p; + if (!(device->cache.pkey_cache && device->cache.gid_cache && + device->cache.lmc_cache)) + return; + ib_unregister_event_handler(&device->cache.event_handler); - flush_scheduled_work(); + flush_workqueue(ib_wq); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 08:42:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F5A0CE3; Tue, 17 Feb 2015 08:42:13 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id CA8077F2; Tue, 17 Feb 2015 08:42:11 +0000 (UTC) Message-ID: <54E2FEB3.5030006@FreeBSD.org> Date: Tue, 17 Feb 2015 11:41:23 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278880 - head/sys/dev/ic References: <201502170507.t1H57chX076921@svn.freebsd.org> In-Reply-To: <201502170507.t1H57chX076921@svn.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nC4bfJS3FkT6drWdvMnpVm4cEM3HNAEFC" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 17 Feb 2015 08:42:13 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nC4bfJS3FkT6drWdvMnpVm4cEM3HNAEFC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 17.02.2015 08:07, Warner Losh wrote: > Author: imp > Date: Tue Feb 17 05:07:38 2015 > New Revision: 278880 > URL: https://svnweb.freebsd.org/changeset/base/278880 >=20 > Log: > This should have been GC'd 6 years ago when ar(4) was removed. >=20 > Deleted: > head/sys/dev/ic/hd64570.h Hi, I think it should be added to ObsoleteFiles.inc. --=20 WBR, Andrey V. Elsukov --nC4bfJS3FkT6drWdvMnpVm4cEM3HNAEFC 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 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJU4v65AAoJEAHF6gQQyKF6/N4H/Rie0RLflbRQCZ3Gkt8PFC7P wKxm04zaiwIRVOk4jOa73bKub7DZfkbV8iUbhRCiycl1cd4ZM97Lfj7T5wyPgFrl JqMpE5M2+cukyxw8OUnN4w6xJOPUmyM62ATXd+ACFt7pJ/5AlqZj36VT3ADsU1PA jHKfHsrniM3Ovg4MNqloUJeEykNuYrMLgk8ck9tSaj3T5D/ftjwlEM8J6iO/d1Al Nf/1tUsNCERTGK9qKsjZj+cdaSrAX4Ujz7KUPy8A/nWgJXtbRF5fGUG2Q87HznPW g9rWMJ5Hr5G1Auu0rd6j8EMOk1beUM4lkOVaxwx+7K1BJuYsLudNn7CVFRd5kJs= =bmzb -----END PGP SIGNATURE----- --nC4bfJS3FkT6drWdvMnpVm4cEM3HNAEFC-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 08:50:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A627AD; Tue, 17 Feb 2015 08:50:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 55D88FBA; Tue, 17 Feb 2015 08:50:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1H8oRBe081772; Tue, 17 Feb 2015 08:50:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1H8oRrc081771; Tue, 17 Feb 2015 08:50:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201502170850.t1H8oRrc081771@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 17 Feb 2015 08:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278888 - head/sys/vm 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 08:50:27 -0000 Author: ngie Date: Tue Feb 17 08:50:26 2015 New Revision: 278888 URL: https://svnweb.freebsd.org/changeset/base/278888 Log: Some minor style(9) fixes (whitespace + comment) MFC after: 3 days Modified: head/sys/vm/memguard.c Modified: head/sys/vm/memguard.c ============================================================================== --- head/sys/vm/memguard.c Tue Feb 17 08:42:26 2015 (r278887) +++ head/sys/vm/memguard.c Tue Feb 17 08:50:26 2015 (r278888) @@ -89,9 +89,7 @@ memguard_sysctl_desc(SYSCTL_HANDLER_ARGS return (error); mtx_lock(&malloc_mtx); - /* - * If mtp is NULL, it will be initialized in memguard_cmp(). - */ + /* If mtp is NULL, it will be initialized in memguard_cmp() */ vm_memguard_mtype = malloc_desc2type(desc); strlcpy(vm_memguard_desc, desc, sizeof(vm_memguard_desc)); mtx_unlock(&malloc_mtx); @@ -502,7 +500,7 @@ int memguard_cmp_zone(uma_zone_t zone) { - if ((memguard_options & MG_GUARD_NOFREE) == 0 && + if ((memguard_options & MG_GUARD_NOFREE) == 0 && zone->uz_flags & UMA_ZONE_NOFREE) return (0); From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 08:54:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6974221; Tue, 17 Feb 2015 08:54:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 92401C5; Tue, 17 Feb 2015 08:54:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1H8s45G085175; Tue, 17 Feb 2015 08:54:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1H8s4TL085174; Tue, 17 Feb 2015 08:54:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502170854.t1H8s4TL085174@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 Feb 2015 08:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278889 - head/lib/libc/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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 08:54:04 -0000 Author: kib Date: Tue Feb 17 08:54:03 2015 New Revision: 278889 URL: https://svnweb.freebsd.org/changeset/base/278889 Log: Restore the extern qualifier on __cleanup. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/lib/libc/include/libc_private.h Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Tue Feb 17 08:50:26 2015 (r278888) +++ head/lib/libc/include/libc_private.h Tue Feb 17 08:54:03 2015 (r278889) @@ -271,7 +271,7 @@ void _malloc_first_thread(void); /* * Function to clean up streams, called from abort() and exit(). */ -void (*__cleanup)(void) __hidden; +extern void (*__cleanup)(void) __hidden; /* * Get kern.osreldate to detect ABI revisions. Explicitly From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 08:57:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8B92567; Tue, 17 Feb 2015 08:57:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D3CFAFB; Tue, 17 Feb 2015 08:57:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1H8vbZU085659; Tue, 17 Feb 2015 08:57:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1H8vbeY085658; Tue, 17 Feb 2015 08:57:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502170857.t1H8vbeY085658@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 17 Feb 2015 08:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278890 - head/sys/ofed/drivers/infiniband/core 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 08:57:38 -0000 Author: hselasky Date: Tue Feb 17 08:57:36 2015 New Revision: 278890 URL: https://svnweb.freebsd.org/changeset/base/278890 Log: Fix compilation when DEBUG is defined. Sponsored by: Mellanox Technologies MFC after: 1 month Modified: head/sys/ofed/drivers/infiniband/core/fmr_pool.c Modified: head/sys/ofed/drivers/infiniband/core/fmr_pool.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/fmr_pool.c Tue Feb 17 08:54:03 2015 (r278889) +++ head/sys/ofed/drivers/infiniband/core/fmr_pool.c Tue Feb 17 08:57:36 2015 (r278890) @@ -151,7 +151,7 @@ static void ib_fmr_batch_release(struct #ifdef DEBUG if (fmr->ref_count !=0) { - printk(KERN_WARNING PFX "Unmapping FMR 0x%08x with ref count %d\n", + printk(KERN_WARNING PFX "Unmapping FMR %p with ref count %d\n", fmr, fmr->ref_count); } #endif From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 09:31:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7226FF98; Tue, 17 Feb 2015 09:31:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5DB7E74F; Tue, 17 Feb 2015 09:31:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1H9VxOj003423; Tue, 17 Feb 2015 09:31:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1H9VxOV003422; Tue, 17 Feb 2015 09:31:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201502170931.t1H9VxOV003422@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 17 Feb 2015 09:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278891 - 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 09:31:59 -0000 Author: ngie Date: Tue Feb 17 09:31:58 2015 New Revision: 278891 URL: https://svnweb.freebsd.org/changeset/base/278891 Log: Add the mnt_lockref field to the ddb(4) 'show mount' command MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D1688 Submitted by: Conrad Meyer Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Feb 17 08:57:36 2015 (r278890) +++ head/sys/kern/vfs_subr.c Tue Feb 17 09:31:58 2015 (r278891) @@ -3203,6 +3203,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) db_printf(" mnt_maxsymlinklen = %d\n", mp->mnt_maxsymlinklen); db_printf(" mnt_iosize_max = %d\n", mp->mnt_iosize_max); db_printf(" mnt_hashseed = %u\n", mp->mnt_hashseed); + db_printf(" mnt_lockref = %d\n", mp->mnt_lockref); db_printf(" mnt_secondary_writes = %d\n", mp->mnt_secondary_writes); db_printf(" mnt_secondary_accwrites = %d\n", mp->mnt_secondary_accwrites); From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 10:00:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C62EE74D; Tue, 17 Feb 2015 10:00:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 AFFADA86; Tue, 17 Feb 2015 10:00:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HA0Hcs014396; Tue, 17 Feb 2015 10:00:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HA0GpS014384; Tue, 17 Feb 2015 10:00:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502171000.t1HA0GpS014384@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 17 Feb 2015 10:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278894 - in head/sys: conf ofed/drivers/infiniband/hw/mlx4 ofed/drivers/infiniband/ulp/sdp 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 10:00:17 -0000 Author: hselasky Date: Tue Feb 17 10:00:15 2015 New Revision: 278894 URL: https://svnweb.freebsd.org/changeset/base/278894 Log: Fix compilation of the SDP driver and a compile warning after r278886. Also fix the kernel build rule for mlx4_exp.c. This fixes the LINT kernel target for amd64. Sponsored by: Mellanox Technologies MFC after: 1 month Modified: head/sys/conf/files head/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 17 09:40:36 2015 (r278893) +++ head/sys/conf/files Tue Feb 17 10:00:15 2015 (r278894) @@ -3739,7 +3739,7 @@ ofed/drivers/infiniband/hw/mlx4/main.c no-depend obj-prefix "mlx4ib_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" ofed/drivers/infiniband/hw/mlx4/mlx4_exp.c optional mlx4ib \ - no-depend \ + no-depend obj-prefix "mlx4ib_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" ofed/drivers/infiniband/hw/mlx4/mr.c optional mlx4ib \ no-depend obj-prefix "mlx4ib_" \ Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c Tue Feb 17 09:40:36 2015 (r278893) +++ head/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c Tue Feb 17 10:00:15 2015 (r278894) @@ -668,7 +668,7 @@ static void mlx4_ib_mcg_work_handler(str if (!list_empty(&group->pending_list)) req = list_first_entry(&group->pending_list, struct mcast_req, group_list); - if ((method == IB_MGMT_METHOD_GET_RESP)) { + if (method == IB_MGMT_METHOD_GET_RESP) { if (req) { send_reply_to_slave(req->func, group, &req->sa_mad, status); --group->func[req->func].num_pend_reqs; Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Tue Feb 17 09:40:36 2015 (r278893) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Tue Feb 17 10:00:15 2015 (r278894) @@ -129,7 +129,7 @@ sdp_pcbbind(struct sdp_sock *ssk, struct /* rdma_bind_addr handles bind races. */ SDP_WUNLOCK(ssk); if (ssk->id == NULL) - ssk->id = rdma_create_id(sdp_cma_handler, ssk, RDMA_PS_SDP); + ssk->id = rdma_create_id(sdp_cma_handler, ssk, RDMA_PS_SDP, IB_QPT_RC); if (ssk->id == NULL) { SDP_WLOCK(ssk); return (ENOMEM); @@ -1702,11 +1702,15 @@ int sdp_mod_usec = 0; void sdp_set_default_moderation(struct sdp_sock *ssk) { + struct ib_cq_attr attr; if (sdp_mod_count <= 0 || sdp_mod_usec <= 0) return; - ib_modify_cq(ssk->rx_ring.cq, sdp_mod_count, sdp_mod_usec); -} + memset(&attr, 0, sizeof(attr)); + attr.moderation.cq_count = sdp_mod_count; + attr.moderation.cq_period = sdp_mod_usec; + ib_modify_cq(ssk->rx_ring.cq, &attr, IB_CQ_MODERATION); +} static void sdp_dev_add(struct ib_device *device) Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Tue Feb 17 09:40:36 2015 (r278893) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Tue Feb 17 10:00:15 2015 (r278894) @@ -736,7 +736,7 @@ sdp_rx_ring_create(struct sdp_sock *ssk, } rx_cq = ib_create_cq(device, sdp_rx_irq, sdp_rx_cq_event_handler, - ssk->socket, SDP_RX_SIZE, IB_CQ_VECTOR_LEAST_ATTACHED); + ssk->socket, SDP_RX_SIZE, 0); if (IS_ERR(rx_cq)) { rc = PTR_ERR(rx_cq); Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c Tue Feb 17 09:40:36 2015 (r278893) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c Tue Feb 17 10:00:15 2015 (r278894) @@ -438,7 +438,7 @@ sdp_tx_ring_create(struct sdp_sock *ssk, } tx_cq = ib_create_cq(device, sdp_tx_irq, sdp_tx_cq_event_handler, - ssk, SDP_TX_SIZE, IB_CQ_VECTOR_LEAST_ATTACHED); + ssk, SDP_TX_SIZE, 0); if (IS_ERR(tx_cq)) { rc = PTR_ERR(tx_cq); From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 13:09:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 232ABAC4; Tue, 17 Feb 2015 13:09:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0D023A4; Tue, 17 Feb 2015 13:09:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HD9MAW004902; Tue, 17 Feb 2015 13:09:22 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HD9L4b004892; Tue, 17 Feb 2015 13:09:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201502171309.t1HD9L4b004892@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 17 Feb 2015 13:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278895 - in head/sys: arm/arm arm/include 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 13:09:22 -0000 Author: andrew Date: Tue Feb 17 13:09:20 2015 New Revision: 278895 URL: https://svnweb.freebsd.org/changeset/base/278895 Log: Pull the ARM ddb unwind code out to a new file. This will allow it to be used by other places that expect to unwind the stack, e.g. dtrace and stack(9). As I have written most of this code I'm changing the license to the standard FreeBSD license. I have received approval from the other developers who have changed any of the affected code. Approved by: ian, imp, rpaulo, eadler (all license change) Added: head/sys/arm/arm/unwind.c - copied, changed from r278894, head/sys/arm/arm/db_trace.c Modified: head/sys/arm/arm/db_trace.c head/sys/arm/include/stack.h head/sys/conf/files.arm Modified: head/sys/arm/arm/db_trace.c ============================================================================== --- head/sys/arm/arm/db_trace.c Tue Feb 17 10:00:15 2015 (r278894) +++ head/sys/arm/arm/db_trace.c Tue Feb 17 13:09:20 2015 (r278895) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include #include #include @@ -45,322 +46,15 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include #include #include #include -/* - * Definitions for the instruction interpreter. - * - * The ARM EABI specifies how to perform the frame unwinding in the - * Exception Handling ABI for the ARM Architecture document. To perform - * the unwind we need to know the initial frame pointer, stack pointer, - * link register and program counter. We then find the entry within the - * index table that points to the function the program counter is within. - * This gives us either a list of three instructions to process, a 31-bit - * relative offset to a table of instructions, or a value telling us - * we can't unwind any further. - * - * When we have the instructions to process we need to decode them - * following table 4 in section 9.3. This describes a collection of bit - * patterns to encode that steps to take to update the stack pointer and - * link register to the correct values at the start of the function. - */ - -/* A special case when we are unable to unwind past this function */ -#define EXIDX_CANTUNWIND 1 - -/* The register names */ -#define FP 11 -#define SP 13 -#define LR 14 -#define PC 15 - -/* - * These are set in the linker script. Their addresses will be - * either the start or end of the exception table or index. - */ -extern int extab_start, extab_end, exidx_start, exidx_end; - -/* - * Entry types. - * These are the only entry types that have been seen in the kernel. - */ -#define ENTRY_MASK 0xff000000 -#define ENTRY_ARM_SU16 0x80000000 -#define ENTRY_ARM_LU16 0x81000000 - -/* Instruction masks. */ -#define INSN_VSP_MASK 0xc0 -#define INSN_VSP_SIZE_MASK 0x3f -#define INSN_STD_MASK 0xf0 -#define INSN_STD_DATA_MASK 0x0f -#define INSN_POP_TYPE_MASK 0x08 -#define INSN_POP_COUNT_MASK 0x07 -#define INSN_VSP_LARGE_INC_MASK 0xff - -/* Instruction definitions */ -#define INSN_VSP_INC 0x00 -#define INSN_VSP_DEC 0x40 -#define INSN_POP_MASKED 0x80 -#define INSN_VSP_REG 0x90 -#define INSN_POP_COUNT 0xa0 -#define INSN_FINISH 0xb0 -#define INSN_POP_REGS 0xb1 -#define INSN_VSP_LARGE_INC 0xb2 - -/* An item in the exception index table */ -struct unwind_idx { - uint32_t offset; - uint32_t insn; -}; - -/* The state of the unwind process */ -struct unwind_state { - uint32_t registers[16]; - uint32_t start_pc; - uint32_t *insn; - u_int entries; - u_int byte; - uint16_t update_mask; -}; - -/* Expand a 31-bit signed value to a 32-bit signed value */ -static __inline int32_t -db_expand_prel31(uint32_t prel31) -{ - - return ((int32_t)(prel31 & 0x7fffffffu) << 1) / 2; -} - -/* - * Perform a binary search of the index table to find the function - * with the largest address that doesn't exceed addr. - */ -static struct unwind_idx * -db_find_index(uint32_t addr) -{ - unsigned int min, mid, max; - struct unwind_idx *start; - struct unwind_idx *item; - int32_t prel31_addr; - uint32_t func_addr; - - start = (struct unwind_idx *)&exidx_start; - - min = 0; - max = (&exidx_end - &exidx_start) / 2; - - while (min != max) { - mid = min + (max - min + 1) / 2; - - item = &start[mid]; - - prel31_addr = db_expand_prel31(item->offset); - func_addr = (uint32_t)&item->offset + prel31_addr; - - if (func_addr <= addr) { - min = mid; - } else { - max = mid - 1; - } - } - - return &start[min]; -} - -/* Reads the next byte from the instruction list */ -static uint8_t -db_unwind_exec_read_byte(struct unwind_state *state) -{ - uint8_t insn; - - /* Read the unwind instruction */ - insn = (*state->insn) >> (state->byte * 8); - - /* Update the location of the next instruction */ - if (state->byte == 0) { - state->byte = 3; - state->insn++; - state->entries--; - } else - state->byte--; - - return insn; -} - -/* Executes the next instruction on the list */ -static int -db_unwind_exec_insn(struct unwind_state *state) -{ - unsigned int insn; - uint32_t *vsp = (uint32_t *)state->registers[SP]; - int update_vsp = 0; - - /* This should never happen */ - if (state->entries == 0) - return 1; - - /* Read the next instruction */ - insn = db_unwind_exec_read_byte(state); - - if ((insn & INSN_VSP_MASK) == INSN_VSP_INC) { - state->registers[SP] += ((insn & INSN_VSP_SIZE_MASK) << 2) + 4; - - } else if ((insn & INSN_VSP_MASK) == INSN_VSP_DEC) { - state->registers[SP] -= ((insn & INSN_VSP_SIZE_MASK) << 2) + 4; - - } else if ((insn & INSN_STD_MASK) == INSN_POP_MASKED) { - unsigned int mask, reg; - - /* Load the mask */ - mask = db_unwind_exec_read_byte(state); - mask |= (insn & INSN_STD_DATA_MASK) << 8; - - /* We have a refuse to unwind instruction */ - if (mask == 0) - return 1; - - /* Update SP */ - update_vsp = 1; - - /* Load the registers */ - for (reg = 4; mask && reg < 16; mask >>= 1, reg++) { - if (mask & 1) { - state->registers[reg] = *vsp++; - state->update_mask |= 1 << reg; - - /* If we have updated SP kep its value */ - if (reg == SP) - update_vsp = 0; - } - } - - } else if ((insn & INSN_STD_MASK) == INSN_VSP_REG && - ((insn & INSN_STD_DATA_MASK) != 13) && - ((insn & INSN_STD_DATA_MASK) != 15)) { - /* sp = register */ - state->registers[SP] = - state->registers[insn & INSN_STD_DATA_MASK]; - - } else if ((insn & INSN_STD_MASK) == INSN_POP_COUNT) { - unsigned int count, reg; - - /* Read how many registers to load */ - count = insn & INSN_POP_COUNT_MASK; - - /* Update sp */ - update_vsp = 1; - - /* Pop the registers */ - for (reg = 4; reg <= 4 + count; reg++) { - state->registers[reg] = *vsp++; - state->update_mask |= 1 << reg; - } - - /* Check if we are in the pop r14 version */ - if ((insn & INSN_POP_TYPE_MASK) != 0) { - state->registers[14] = *vsp++; - } - - } else if (insn == INSN_FINISH) { - /* Stop processing */ - state->entries = 0; - - } else if (insn == INSN_POP_REGS) { - unsigned int mask, reg; - - mask = db_unwind_exec_read_byte(state); - if (mask == 0 || (mask & 0xf0) != 0) - return 1; - - /* Update SP */ - update_vsp = 1; - - /* Load the registers */ - for (reg = 0; mask && reg < 4; mask >>= 1, reg++) { - if (mask & 1) { - state->registers[reg] = *vsp++; - state->update_mask |= 1 << reg; - } - } - - } else if ((insn & INSN_VSP_LARGE_INC_MASK) == INSN_VSP_LARGE_INC) { - unsigned int uleb128; - - /* Read the increment value */ - uleb128 = db_unwind_exec_read_byte(state); - - state->registers[SP] += 0x204 + (uleb128 << 2); - - } else { - /* We hit a new instruction that needs to be implemented */ - db_printf("Unhandled instruction %.2x\n", insn); - return 1; - } - - if (update_vsp) { - state->registers[SP] = (uint32_t)vsp; - } - -#if 0 - db_printf("fp = %08x, sp = %08x, lr = %08x, pc = %08x\n", - state->registers[FP], state->registers[SP], state->registers[LR], - state->registers[PC]); -#endif - - return 0; -} - -/* Performs the unwind of a function */ -static int -db_unwind_tab(struct unwind_state *state) -{ - uint32_t entry; - - /* Set PC to a known value */ - state->registers[PC] = 0; - - /* Read the personality */ - entry = *state->insn & ENTRY_MASK; - - if (entry == ENTRY_ARM_SU16) { - state->byte = 2; - state->entries = 1; - } else if (entry == ENTRY_ARM_LU16) { - state->byte = 1; - state->entries = ((*state->insn >> 16) & 0xFF) + 1; - } else { - db_printf("Unknown entry: %x\n", entry); - return 1; - } - - while (state->entries > 0) { - if (db_unwind_exec_insn(state) != 0) - return 1; - } - - /* - * The program counter was not updated, load it from the link register. - */ - if (state->registers[PC] == 0) { - state->registers[PC] = state->registers[LR]; - - /* - * If the program counter changed, flag it in the update mask. - */ - if (state->start_pc != state->registers[PC]) - state->update_mask |= 1 << PC; - } - - return 0; -} - static void db_stack_trace_cmd(struct unwind_state *state) { - struct unwind_idx *index; const char *name; db_expr_t value; db_expr_t offset; @@ -372,28 +66,7 @@ db_stack_trace_cmd(struct unwind_state * finished = false; while (!finished) { - /* Reset the mask of updated registers */ - state->update_mask = 0; - - /* The pc value is correct and will be overwritten, save it */ - state->start_pc = state->registers[PC]; - - /* Find the item to run */ - index = db_find_index(state->start_pc); - - if (index->insn != EXIDX_CANTUNWIND) { - if (index->insn & (1U << 31)) { - /* The data is within the instruction */ - state->insn = &index->insn; - } else { - /* A prel31 offset to the unwind table */ - state->insn = (uint32_t *) - ((uintptr_t)&index->insn + - db_expand_prel31(index->insn)); - } - /* Run the unwind function */ - finished = db_unwind_tab(state); - } + finished = unwind_stack_one(state); /* Print the frame details */ sym = db_search_symbol(state->start_pc, DB_STGY_ANY, &offset); @@ -432,6 +105,9 @@ db_stack_trace_cmd(struct unwind_state * } db_printf("\n"); + if (finished) + break; + /* * Stop if directed to do so, or if we've unwound back to the * kernel entry point, or if the unwind function didn't change @@ -441,9 +117,7 @@ db_stack_trace_cmd(struct unwind_state * * the last frame printed before you see the unwind failure * message (maybe it needs a STOP_UNWINDING). */ - if (index->insn == EXIDX_CANTUNWIND) { - finished = true; - } else if (state->registers[PC] < VM_MIN_KERNEL_ADDRESS) { + if (state->registers[PC] < VM_MIN_KERNEL_ADDRESS) { db_printf("Unable to unwind into user mode\n"); finished = true; } else if (state->update_mask == 0) { Copied and modified: head/sys/arm/arm/unwind.c (from r278894, head/sys/arm/arm/db_trace.c) ============================================================================== --- head/sys/arm/arm/db_trace.c Tue Feb 17 10:00:15 2015 (r278894, copy source) +++ head/sys/arm/arm/unwind.c Tue Feb 17 13:09:20 2015 (r278895) @@ -1,54 +1,40 @@ -/* $NetBSD: db_trace.c,v 1.8 2003/01/17 22:28:48 thorpej Exp $ */ - -/*- - * Copyright (c) 2000, 2001 Ben Harris - * Copyright (c) 1996 Scott K. Stevens - * - * Mach Operating System - * Copyright (c) 1991,1990 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. +/* + * Copyright 2013-2014 Andrew Turner. + * Copyright 2013-2014 Ian Lepore. + * Copyright 2013-2014 Rui Paulo. + * Copyright 2013 Eitan Adler. + * All rights reserved. * - * Carnegie Mellon requests users of this software to return to + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 + * 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. * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. + * 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. */ #include __FBSDID("$FreeBSD$"); + #include #include - -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include /* * Definitions for the instruction interpreter. @@ -71,12 +57,6 @@ __FBSDID("$FreeBSD$"); /* A special case when we are unable to unwind past this function */ #define EXIDX_CANTUNWIND 1 -/* The register names */ -#define FP 11 -#define SP 13 -#define LR 14 -#define PC 15 - /* * These are set in the linker script. Their addresses will be * either the start or end of the exception table or index. @@ -116,19 +96,9 @@ struct unwind_idx { uint32_t insn; }; -/* The state of the unwind process */ -struct unwind_state { - uint32_t registers[16]; - uint32_t start_pc; - uint32_t *insn; - u_int entries; - u_int byte; - uint16_t update_mask; -}; - /* Expand a 31-bit signed value to a 32-bit signed value */ static __inline int32_t -db_expand_prel31(uint32_t prel31) +expand_prel31(uint32_t prel31) { return ((int32_t)(prel31 & 0x7fffffffu) << 1) / 2; @@ -139,7 +109,7 @@ db_expand_prel31(uint32_t prel31) * with the largest address that doesn't exceed addr. */ static struct unwind_idx * -db_find_index(uint32_t addr) +find_index(uint32_t addr) { unsigned int min, mid, max; struct unwind_idx *start; @@ -157,7 +127,7 @@ db_find_index(uint32_t addr) item = &start[mid]; - prel31_addr = db_expand_prel31(item->offset); + prel31_addr = expand_prel31(item->offset); func_addr = (uint32_t)&item->offset + prel31_addr; if (func_addr <= addr) { @@ -172,7 +142,7 @@ db_find_index(uint32_t addr) /* Reads the next byte from the instruction list */ static uint8_t -db_unwind_exec_read_byte(struct unwind_state *state) +unwind_exec_read_byte(struct unwind_state *state) { uint8_t insn; @@ -192,7 +162,7 @@ db_unwind_exec_read_byte(struct unwind_s /* Executes the next instruction on the list */ static int -db_unwind_exec_insn(struct unwind_state *state) +unwind_exec_insn(struct unwind_state *state) { unsigned int insn; uint32_t *vsp = (uint32_t *)state->registers[SP]; @@ -203,7 +173,7 @@ db_unwind_exec_insn(struct unwind_state return 1; /* Read the next instruction */ - insn = db_unwind_exec_read_byte(state); + insn = unwind_exec_read_byte(state); if ((insn & INSN_VSP_MASK) == INSN_VSP_INC) { state->registers[SP] += ((insn & INSN_VSP_SIZE_MASK) << 2) + 4; @@ -215,7 +185,7 @@ db_unwind_exec_insn(struct unwind_state unsigned int mask, reg; /* Load the mask */ - mask = db_unwind_exec_read_byte(state); + mask = unwind_exec_read_byte(state); mask |= (insn & INSN_STD_DATA_MASK) << 8; /* We have a refuse to unwind instruction */ @@ -271,7 +241,7 @@ db_unwind_exec_insn(struct unwind_state } else if (insn == INSN_POP_REGS) { unsigned int mask, reg; - mask = db_unwind_exec_read_byte(state); + mask = unwind_exec_read_byte(state); if (mask == 0 || (mask & 0xf0) != 0) return 1; @@ -290,13 +260,15 @@ db_unwind_exec_insn(struct unwind_state unsigned int uleb128; /* Read the increment value */ - uleb128 = db_unwind_exec_read_byte(state); + uleb128 = unwind_exec_read_byte(state); state->registers[SP] += 0x204 + (uleb128 << 2); } else { /* We hit a new instruction that needs to be implemented */ +#if 0 db_printf("Unhandled instruction %.2x\n", insn); +#endif return 1; } @@ -315,7 +287,7 @@ db_unwind_exec_insn(struct unwind_state /* Performs the unwind of a function */ static int -db_unwind_tab(struct unwind_state *state) +unwind_tab(struct unwind_state *state) { uint32_t entry; @@ -332,12 +304,14 @@ db_unwind_tab(struct unwind_state *state state->byte = 1; state->entries = ((*state->insn >> 16) & 0xFF) + 1; } else { +#if 0 db_printf("Unknown entry: %x\n", entry); +#endif return 1; } while (state->entries > 0) { - if (db_unwind_exec_insn(state) != 0) + if (unwind_exec_insn(state) != 0) return 1; } @@ -357,153 +331,39 @@ db_unwind_tab(struct unwind_state *state return 0; } -static void -db_stack_trace_cmd(struct unwind_state *state) +int +unwind_stack_one(struct unwind_state *state) { struct unwind_idx *index; - const char *name; - db_expr_t value; - db_expr_t offset; - c_db_sym_t sym; - u_int reg, i; - char *sep; - uint16_t upd_mask; - bool finished; - - finished = false; - while (!finished) { - /* Reset the mask of updated registers */ - state->update_mask = 0; - - /* The pc value is correct and will be overwritten, save it */ - state->start_pc = state->registers[PC]; - - /* Find the item to run */ - index = db_find_index(state->start_pc); - - if (index->insn != EXIDX_CANTUNWIND) { - if (index->insn & (1U << 31)) { - /* The data is within the instruction */ - state->insn = &index->insn; - } else { - /* A prel31 offset to the unwind table */ - state->insn = (uint32_t *) - ((uintptr_t)&index->insn + - db_expand_prel31(index->insn)); - } - /* Run the unwind function */ - finished = db_unwind_tab(state); - } + int finished; - /* Print the frame details */ - sym = db_search_symbol(state->start_pc, DB_STGY_ANY, &offset); - if (sym == C_DB_SYM_NULL) { - value = 0; - name = "(null)"; - } else - db_symbol_values(sym, &name, &value); - db_printf("%s() at ", name); - db_printsym(state->start_pc, DB_STGY_PROC); - db_printf("\n"); - db_printf("\t pc = 0x%08x lr = 0x%08x (", state->start_pc, - state->registers[LR]); - db_printsym(state->registers[LR], DB_STGY_PROC); - db_printf(")\n"); - db_printf("\t sp = 0x%08x fp = 0x%08x", - state->registers[SP], state->registers[FP]); - - /* Don't print the registers we have already printed */ - upd_mask = state->update_mask & - ~((1 << SP) | (1 << FP) | (1 << LR) | (1 << PC)); - sep = "\n\t"; - for (i = 0, reg = 0; upd_mask != 0; upd_mask >>= 1, reg++) { - if ((upd_mask & 1) != 0) { - db_printf("%s%sr%d = 0x%08x", sep, - (reg < 10) ? " " : "", reg, - state->registers[reg]); - i++; - if (i == 2) { - sep = "\n\t"; - i = 0; - } else - sep = " "; + /* Reset the mask of updated registers */ + state->update_mask = 0; - } - } - db_printf("\n"); + /* The pc value is correct and will be overwritten, save it */ + state->start_pc = state->registers[PC]; - /* - * Stop if directed to do so, or if we've unwound back to the - * kernel entry point, or if the unwind function didn't change - * anything (to avoid getting stuck in this loop forever). - * If the latter happens, it's an indication that the unwind - * information is incorrect somehow for the function named in - * the last frame printed before you see the unwind failure - * message (maybe it needs a STOP_UNWINDING). - */ - if (index->insn == EXIDX_CANTUNWIND) { - finished = true; - } else if (state->registers[PC] < VM_MIN_KERNEL_ADDRESS) { - db_printf("Unable to unwind into user mode\n"); - finished = true; - } else if (state->update_mask == 0) { - db_printf("Unwind failure (no registers changed)\n"); - finished = true; + /* Find the item to run */ + index = find_index(state->start_pc); + + finished = 0; + if (index->insn != EXIDX_CANTUNWIND) { + if (index->insn & (1U << 31)) { + /* The data is within the instruction */ + state->insn = &index->insn; + } else { + /* A prel31 offset to the unwind table */ + state->insn = (uint32_t *) + ((uintptr_t)&index->insn + + expand_prel31(index->insn)); } + /* Run the unwind function */ + finished = unwind_tab(state); } -} - -/* XXX stubs */ -void -db_md_list_watchpoints() -{ -} - -int -db_md_clr_watchpoint(db_expr_t addr, db_expr_t size) -{ - return (0); -} - -int -db_md_set_watchpoint(db_expr_t addr, db_expr_t size) -{ - return (0); -} - -int -db_trace_thread(struct thread *thr, int count) -{ - struct unwind_state state; - struct pcb *ctx; - - if (thr != curthread) { - ctx = kdb_thr_ctx(thr); - - state.registers[FP] = ctx->pcb_regs.sf_r11; - state.registers[SP] = ctx->pcb_regs.sf_sp; - state.registers[LR] = ctx->pcb_regs.sf_lr; - state.registers[PC] = ctx->pcb_regs.sf_pc; - - db_stack_trace_cmd(&state); - } else - db_trace_self(); - return (0); -} - -void -db_trace_self(void) -{ - struct unwind_state state; - uint32_t sp; - - /* Read the stack pointer */ - __asm __volatile("mov %0, sp" : "=&r" (sp)); - state.registers[FP] = (uint32_t)__builtin_frame_address(0); - state.registers[SP] = sp; - state.registers[LR] = (uint32_t)__builtin_return_address(0); - state.registers[PC] = (uint32_t)db_trace_self; + /* This is the top of the stack, finish */ + if (index->insn == EXIDX_CANTUNWIND) + finished = 1; - db_stack_trace_cmd(&state); + return (finished); } Modified: head/sys/arm/include/stack.h ============================================================================== --- head/sys/arm/include/stack.h Tue Feb 17 10:00:15 2015 (r278894) +++ head/sys/arm/include/stack.h Tue Feb 17 13:09:20 2015 (r278895) @@ -39,4 +39,22 @@ #define FR_RSP (-2) #define FR_RFP (-3) +/* The state of the unwind process */ +struct unwind_state { + uint32_t registers[16]; + uint32_t start_pc; + uint32_t *insn; + u_int entries; + u_int byte; + uint16_t update_mask; +}; + +/* The register names */ +#define FP 11 +#define SP 13 +#define LR 14 +#define PC 15 + +int unwind_stack_one(struct unwind_state *); + #endif /* !_MACHINE_STACK_H_ */ Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Tue Feb 17 10:00:15 2015 (r278894) +++ head/sys/conf/files.arm Tue Feb 17 13:09:20 2015 (r278895) @@ -57,6 +57,7 @@ arm/arm/trap.c optional !armv6 arm/arm/trap-v6.c optional armv6 arm/arm/uio_machdep.c standard arm/arm/undefined.c standard +arm/arm/unwind.c optional ddb arm/arm/vm_machdep.c standard arm/arm/vfp.c standard board_id.h standard \ From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 13:12:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5C83DC4; Tue, 17 Feb 2015 13:12:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A8A9919A; Tue, 17 Feb 2015 13:12:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HDCt5u009194; Tue, 17 Feb 2015 13:12:55 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HDCsmM009191; Tue, 17 Feb 2015 13:12:54 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201502171312.t1HDCsmM009191@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 17 Feb 2015 13:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278896 - in head: lib/liblzma usr.bin/compress usr.bin/gzip 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 13:12:55 -0000 Author: jilles Date: Tue Feb 17 13:12:54 2015 New Revision: 278896 URL: https://svnweb.freebsd.org/changeset/base/278896 Log: compress,gzip,xz: Preserve timestamps with nanosecond precision. Modified: head/lib/liblzma/config.h head/usr.bin/compress/compress.c head/usr.bin/gzip/gzip.c Modified: head/lib/liblzma/config.h ============================================================================== --- head/lib/liblzma/config.h Tue Feb 17 13:09:20 2015 (r278895) +++ head/lib/liblzma/config.h Tue Feb 17 13:12:54 2015 (r278896) @@ -26,6 +26,7 @@ #define HAVE_ENCODER_SPARC 1 #define HAVE_ENCODER_X86 1 #define HAVE_FCNTL_H 1 +#define HAVE_FUTIMENS 1 #define HAVE_FUTIMES 1 #define HAVE_GETOPT_H 1 #define HAVE_GETOPT_LONG 1 Modified: head/usr.bin/compress/compress.c ============================================================================== --- head/usr.bin/compress/compress.c Tue Feb 17 13:09:20 2015 (r278895) +++ head/usr.bin/compress/compress.c Tue Feb 17 13:12:54 2015 (r278896) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -360,14 +361,14 @@ err: if (ofp) { static void setfile(const char *name, struct stat *fs) { - static struct timeval tv[2]; + static struct timespec tspec[2]; fs->st_mode &= S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO; - TIMESPEC_TO_TIMEVAL(&tv[0], &fs->st_atim); - TIMESPEC_TO_TIMEVAL(&tv[1], &fs->st_mtim); - if (utimes(name, tv)) - cwarn("utimes: %s", name); + tspec[0] = fs->st_atim; + tspec[1] = fs->st_mtim; + if (utimensat(AT_FDCWD, name, tspec, 0)) + cwarn("utimensat: %s", name); /* * Changing the ownership probably won't succeed, unless we're root Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Tue Feb 17 13:09:20 2015 (r278895) +++ head/usr.bin/gzip/gzip.c Tue Feb 17 13:12:54 2015 (r278896) @@ -1070,7 +1070,7 @@ out2: static void copymodes(int fd, const struct stat *sbp, const char *file) { - struct timeval times[2]; + struct timespec times[2]; struct stat sb; /* @@ -1098,10 +1098,10 @@ copymodes(int fd, const struct stat *sbp if (fchmod(fd, sb.st_mode) < 0) maybe_warn("couldn't fchmod: %s", file); - TIMESPEC_TO_TIMEVAL(×[0], &sb.st_atim); - TIMESPEC_TO_TIMEVAL(×[1], &sb.st_mtim); - if (futimes(fd, times) < 0) - maybe_warn("couldn't utimes: %s", file); + times[0] = sb.st_atim; + times[1] = sb.st_mtim; + if (futimens(fd, times) < 0) + maybe_warn("couldn't futimens: %s", file); /* only try flags if they exist already */ if (sb.st_flags != 0 && fchflags(fd, sb.st_flags) < 0) From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 14:48:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0BB8D661; Tue, 17 Feb 2015 14:48:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E0551E8E; Tue, 17 Feb 2015 14:48:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HEmGns052914; Tue, 17 Feb 2015 14:48:16 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HEmGJP052913; Tue, 17 Feb 2015 14:48:16 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201502171448.t1HEmGJP052913@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Tue, 17 Feb 2015 14:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278902 - head/usr.sbin/pw/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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 14:48:17 -0000 Author: brd (doc committer) Date: Tue Feb 17 14:48:16 2015 New Revision: 278902 URL: https://svnweb.freebsd.org/changeset/base/278902 Log: Add tests for account and password expiration. Approved by: will Modified: head/usr.sbin/pw/tests/pw_useradd.sh Modified: head/usr.sbin/pw/tests/pw_useradd.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_useradd.sh Tue Feb 17 14:37:11 2015 (r278901) +++ head/usr.sbin/pw/tests/pw_useradd.sh Tue Feb 17 14:48:16 2015 (r278902) @@ -63,6 +63,108 @@ user_add_comments_invalid_noupdate_body( atf_check -s exit:1 -o empty grep "^test:.*" $HOME/master.passwd } +# Test add user with alternate homedir +atf_test_case user_add_homedir +user_add_homedir_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd test -d /foo/bar + atf_check -s exit:0 -o match:"^test:\*:.*::0:0:User &:/foo/bar:.*" \ + ${PW} usershow test +} + +# Test add user with account expiration as an epoch date +atf_test_case user_add_account_expiration_epoch +user_add_account_expiration_epoch_body() { + populate_etc_skel + + DATE=`date -j -v+1d "+%s"` + atf_check -s exit:0 ${PW} useradd test -e ${DATE} + atf_check -s exit:0 -o match:"^test:\*:.*::0:${DATE}:.*" \ + ${PW} usershow test +} + +# Test add user with account expiration as a DD-MM-YYYY date +atf_test_case user_add_account_expiration_date_numeric +user_add_account_expiration_date_numeric_body() { + populate_etc_skel + + DATE=`date -j -v+1d "+%d-%m-%Y"` + EPOCH=`date -j -f "%d-%m-%Y %H:%M:%S" "${DATE} 00:00:00" "+%s"` + atf_check -s exit:0 ${PW} useradd test -e ${DATE} + atf_check -s exit:0 -o match:"^test:\*:.*::0:${EPOCH}:User &:.*" \ + ${PW} usershow test +} + +# Test add user with account expiration as a DD-MM-YYYY date +atf_test_case user_add_account_expiration_date_month +user_add_account_expiration_date_month_body() { + populate_etc_skel + + DATE=`date -j -v+1d "+%d-%b-%Y"` + EPOCH=`date -j -f "%d-%b-%Y %H:%M:%S" "${DATE} 00:00:00" "+%s"` + atf_check -s exit:0 ${PW} useradd test -e ${DATE} + atf_check -s exit:0 -o match:"^test:\*:.*::0:${EPOCH}:User &:.*" \ + ${PW} usershow test +} + +# Test add user with account expiration as a relative date +atf_test_case user_add_account_expiration_date_relative +user_add_account_expiration_date_relative_body() { + populate_etc_skel + + EPOCH=`date -j -v+13m "+%s"` + atf_check -s exit:0 ${PW} useradd test -e +13o + atf_check -s exit:0 -o match:"^test:\*:.*::0:${EPOCH}:User &:.*" \ + ${PW} usershow test +} + +# Test add user with password expiration as an epoch date +atf_test_case user_add_password_expiration_epoch +user_add_password_expiration_epoch_body() { + populate_etc_skel + + DATE=`date -j -v+1d "+%s"` + atf_check -s exit:0 ${PW} useradd test -p ${DATE} + atf_check -s exit:0 -o match:"^test:\*:.*::${DATE}:0:.*" \ + ${PW} usershow test +} + +# Test add user with password expiration as a DD-MM-YYYY date +atf_test_case user_add_password_expiration_date_numeric +user_add_password_expiration_date_numeric_body() { + populate_etc_skel + + DATE=`date -j -v+1d "+%d-%m-%Y"` + EPOCH=`date -j -f "%d-%m-%Y %H:%M:%S" "${DATE} 00:00:00" "+%s"` + atf_check -s exit:0 ${PW} useradd test -p ${DATE} + atf_check -s exit:0 -o match:"^test:\*:.*::${EPOCH}:0:User &:.*" \ + ${PW} usershow test +} + +# Test add user with password expiration as a DD-MMM-YYYY date +atf_test_case user_add_password_expiration_date_month +user_add_password_expiration_date_month_body() { + populate_etc_skel + + DATE=`date -j -v+1d "+%d-%b-%Y"` + EPOCH=`date -j -f "%d-%b-%Y %H:%M:%S" "${DATE} 00:00:00" "+%s"` + atf_check -s exit:0 ${PW} useradd test -p ${DATE} + atf_check -s exit:0 -o match:"^test:\*:.*::${EPOCH}:0:User &:.*" \ + ${PW} usershow test +} + +# Test add user with password expiration as a relative date +atf_test_case user_add_password_expiration_date_relative +user_add_password_expiration_date_relative_body() { + populate_etc_skel + + EPOCH=`date -j -v+13m "+%s"` + atf_check -s exit:0 ${PW} useradd test -p +13o + atf_check -s exit:0 -o match:"^test:\*:.*::${EPOCH}:0:User &:.*" \ + ${PW} usershow test +} + atf_init_test_cases() { atf_add_test_case user_add atf_add_test_case user_add_noupdate @@ -70,4 +172,13 @@ atf_init_test_cases() { atf_add_test_case user_add_comments_noupdate atf_add_test_case user_add_comments_invalid atf_add_test_case user_add_comments_invalid_noupdate + atf_add_test_case user_add_homedir + atf_add_test_case user_add_account_expiration_epoch + atf_add_test_case user_add_account_expiration_date_numeric + atf_add_test_case user_add_account_expiration_date_month + atf_add_test_case user_add_account_expiration_date_relative + atf_add_test_case user_add_password_expiration_epoch + atf_add_test_case user_add_password_expiration_date_numeric + atf_add_test_case user_add_password_expiration_date_month + atf_add_test_case user_add_password_expiration_date_relative } From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 15:20:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32D4DDA6; Tue, 17 Feb 2015 15:20:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1A15220F; Tue, 17 Feb 2015 15:20:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HFK7UN067487; Tue, 17 Feb 2015 15:20:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HFJxiu067357; Tue, 17 Feb 2015 15:19:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201502171519.t1HFJxiu067357@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 17 Feb 2015 15:19:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278904 - in head: contrib/elftoolchain/addr2line contrib/elftoolchain/common contrib/elftoolchain/elfcopy contrib/elftoolchain/libdwarf contrib/elftoolchain/libelf contrib/elftoolchain... 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 15:20:07 -0000 Author: emaste Date: Tue Feb 17 15:19:58 2015 New Revision: 278904 URL: https://svnweb.freebsd.org/changeset/base/278904 Log: Update elftoolchain to upstream revision 3163 Most of our changes have now been committed upstream, so this change is largely bookkeeping. Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/addr2line/addr2line.c head/contrib/elftoolchain/common/_elftc.h head/contrib/elftoolchain/common/elfdefinitions.h head/contrib/elftoolchain/elfcopy/main.c head/contrib/elftoolchain/elfcopy/sections.c head/contrib/elftoolchain/libdwarf/_libdwarf.h head/contrib/elftoolchain/libdwarf/dwarf_attrval.c head/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3 head/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3 head/contrib/elftoolchain/libdwarf/dwarf_get_section_max_offsets.3 head/contrib/elftoolchain/libdwarf/dwarf_hasattr.3 head/contrib/elftoolchain/libdwarf/dwarf_reloc.c head/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3 head/contrib/elftoolchain/libdwarf/dwarf_whatattr.3 head/contrib/elftoolchain/libdwarf/libdwarf.c head/contrib/elftoolchain/libdwarf/libdwarf.h head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c head/contrib/elftoolchain/libelf/_libelf_config.h head/contrib/elftoolchain/libelf/elf.3 head/contrib/elftoolchain/libelf/elf_scn.c head/contrib/elftoolchain/libelf/libelf_ar_util.c head/contrib/elftoolchain/libelf/libelf_convert.m4 head/contrib/elftoolchain/nm/nm.1 head/contrib/elftoolchain/nm/nm.c head/contrib/elftoolchain/readelf/readelf.c head/lib/libelftc/elftc_version.c Directory Properties: head/contrib/elftoolchain/ (props changed) Modified: head/contrib/elftoolchain/addr2line/addr2line.c ============================================================================== --- head/contrib/elftoolchain/addr2line/addr2line.c Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/addr2line/addr2line.c Tue Feb 17 15:19:58 2015 (r278904) @@ -40,7 +40,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: addr2line.c 2185 2011-11-19 16:07:16Z jkoshy $"); +ELFTC_VCSID("$Id: addr2line.c 3148 2015-02-15 18:47:39Z emaste $"); static struct option longopts[] = { {"target" , required_argument, NULL, 'b'}, Modified: head/contrib/elftoolchain/common/_elftc.h ============================================================================== --- head/contrib/elftoolchain/common/_elftc.h Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/common/_elftc.h Tue Feb 17 15:19:58 2015 (r278904) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: _elftc.h 2922 2013-03-17 22:53:15Z kaiwang27 $ + * $Id: _elftc.h 3139 2015-01-05 03:17:06Z kaiwang27 $ */ /** @@ -76,10 +76,17 @@ * SUCH DAMAGE. */ +#ifndef LIST_FOREACH_SAFE +#define LIST_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = LIST_FIRST((head)); \ + (var) && ((tvar) = LIST_NEXT((var), field), 1); \ + (var) = (tvar)) +#endif + #ifndef SLIST_FOREACH_SAFE -#define SLIST_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = SLIST_FIRST((head)); \ - (var) && ((tvar) = SLIST_NEXT((var), field), 1); \ +#define SLIST_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = SLIST_FIRST((head)); \ + (var) && ((tvar) = SLIST_NEXT((var), field), 1); \ (var) = (tvar)) #endif Modified: head/contrib/elftoolchain/common/elfdefinitions.h ============================================================================== --- head/contrib/elftoolchain/common/elfdefinitions.h Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/common/elfdefinitions.h Tue Feb 17 15:19:58 2015 (r278904) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfdefinitions.h 3110 2014-12-20 08:32:46Z kaiwang27 $ + * $Id: elfdefinitions.h 3149 2015-02-15 19:00:06Z emaste $ */ /* @@ -1396,6 +1396,12 @@ _ELF_DEFINE_RELOC(R_386_8, 22) \ _ELF_DEFINE_RELOC(R_386_PC8, 23) /* + */ +#define _ELF_DEFINE_AARCH64_RELOCATIONS() \ +_ELF_DEFINE_RELOC(R_AARCH64_ABS64, 257) \ +_ELF_DEFINE_RELOC(R_AARCH64_ABS32, 258) \ + +/* * These are the symbols used in the Sun ``Linkers and Loaders * Guide'', Document No: 817-1984-17. See the X86_64 relocations list * below for the spellings used in the ELF specification. @@ -1962,6 +1968,7 @@ _ELF_DEFINE_RELOC(R_X86_64_IRELATIVE, 37 #define _ELF_DEFINE_RELOCATIONS() \ _ELF_DEFINE_386_RELOCATIONS() \ +_ELF_DEFINE_AARCH64_RELOCATIONS() \ _ELF_DEFINE_AMD64_RELOCATIONS() \ _ELF_DEFINE_ARM_RELOCATIONS() \ _ELF_DEFINE_IA64_RELOCATIONS() \ Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/elfcopy/main.c Tue Feb 17 15:19:58 2015 (r278904) @@ -40,7 +40,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: main.c 3111 2014-12-20 08:33:01Z kaiwang27 $"); +ELFTC_VCSID("$Id: main.c 3156 2015-02-15 21:40:01Z emaste $"); enum options { Modified: head/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/sections.c Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/elfcopy/sections.c Tue Feb 17 15:19:58 2015 (r278904) @@ -35,7 +35,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: sections.c 3134 2014-12-23 10:43:59Z kaiwang27 $"); +ELFTC_VCSID("$Id: sections.c 3150 2015-02-15 19:07:46Z emaste $"); static void add_gnu_debuglink(struct elfcopy *ecp); static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc); Modified: head/contrib/elftoolchain/libdwarf/_libdwarf.h ============================================================================== --- head/contrib/elftoolchain/libdwarf/_libdwarf.h Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libdwarf/_libdwarf.h Tue Feb 17 15:19:58 2015 (r278904) @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: _libdwarf.h 3106 2014-12-19 16:00:58Z kaiwang27 $ + * $Id: _libdwarf.h 3161 2015-02-15 21:43:36Z emaste $ */ #ifndef __LIBDWARF_H_ Modified: head/contrib/elftoolchain/libdwarf/dwarf_attrval.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_attrval.c Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libdwarf/dwarf_attrval.c Tue Feb 17 15:19:58 2015 (r278904) @@ -26,7 +26,7 @@ #include "_libdwarf.h" -ELFTC_VCSID("$Id: dwarf_attrval.c 2977 2014-01-21 20:13:31Z kaiwang27 $"); +ELFTC_VCSID("$Id: dwarf_attrval.c 3159 2015-02-15 21:43:27Z emaste $"); int dwarf_attrval_flag(Dwarf_Die die, Dwarf_Half attr, Dwarf_Bool *valp, Dwarf_Error *err) Modified: head/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3 ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3 Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3 Tue Feb 17 15:19:58 2015 (r278904) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_AT_name.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_AT_name.3 3142 2015-01-29 23:11:14Z jkoshy $ .\" .Dd April 22, 2011 .Os Modified: head/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3 ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3 Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3 Tue Feb 17 15:19:58 2015 (r278904) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_arange_info.3 2134 2011-11-10 08:40:14Z jkoshy $ +.\" $Id: dwarf_get_arange_info.3 3142 2015-01-29 23:11:14Z jkoshy $ .\" .Dd April 16, 2011 .Os Modified: head/contrib/elftoolchain/libdwarf/dwarf_get_section_max_offsets.3 ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_get_section_max_offsets.3 Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libdwarf/dwarf_get_section_max_offsets.3 Tue Feb 17 15:19:58 2015 (r278904) @@ -22,9 +22,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_section_max_offsets.3 3098 2014-09-02 22:18:29Z kaiwang27 $ +.\" $Id: dwarf_get_section_max_offsets.3 3141 2015-01-29 23:11:10Z jkoshy $ .\" -.Dd July 27, 2014 +.Dd December 21, 2014 .Os .Dt DWARF_GET_SECTION_MAX_OFFSETS .Sh NAME @@ -101,7 +101,7 @@ is identical to function .Fn dwarf_get_section_max_offsets_b except that it does not provide argument .Ar debug_types , -thus it can not retrieve the size of the +and thus cannot return the size of the .Dq \&.debug_types section. .Sh RETURN VALUES Modified: head/contrib/elftoolchain/libdwarf/dwarf_hasattr.3 ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_hasattr.3 Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libdwarf/dwarf_hasattr.3 Tue Feb 17 15:19:58 2015 (r278904) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_hasattr.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_hasattr.3 3142 2015-01-29 23:11:14Z jkoshy $ .\" .Dd April 17, 2010 .Os Modified: head/contrib/elftoolchain/libdwarf/dwarf_reloc.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_reloc.c Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libdwarf/dwarf_reloc.c Tue Feb 17 15:19:58 2015 (r278904) @@ -26,7 +26,7 @@ #include "_libdwarf.h" -ELFTC_VCSID("$Id: dwarf_reloc.c 2075 2011-10-27 03:47:28Z jkoshy $"); +ELFTC_VCSID("$Id: dwarf_reloc.c 3161 2015-02-15 21:43:36Z emaste $"); int dwarf_set_reloc_application(int apply) Modified: head/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3 ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3 Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3 Tue Feb 17 15:19:58 2015 (r278904) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_set_reloc_application.3 2075 2011-10-27 03:47:28Z jkoshy $ +.\" $Id: dwarf_set_reloc_application.3 3161 2015-02-15 21:43:36Z emaste $ .\" .Dd February 11, 2015 .Os Modified: head/contrib/elftoolchain/libdwarf/dwarf_whatattr.3 ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_whatattr.3 Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libdwarf/dwarf_whatattr.3 Tue Feb 17 15:19:58 2015 (r278904) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_whatattr.3 2075 2011-10-27 03:47:28Z jkoshy $ +.\" $Id: dwarf_whatattr.3 3142 2015-01-29 23:11:14Z jkoshy $ .\" .Dd May 22, 2010 .Os Modified: head/contrib/elftoolchain/libdwarf/libdwarf.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf.c Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libdwarf/libdwarf.c Tue Feb 17 15:19:58 2015 (r278904) @@ -26,7 +26,7 @@ #include "_libdwarf.h" -ELFTC_VCSID("$Id: libdwarf.c 2070 2011-10-27 03:05:32Z jkoshy $"); +ELFTC_VCSID("$Id: libdwarf.c 3161 2015-02-15 21:43:36Z emaste $"); struct _libdwarf_globals _libdwarf = { .errhand = NULL, Modified: head/contrib/elftoolchain/libdwarf/libdwarf.h ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf.h Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libdwarf/libdwarf.h Tue Feb 17 15:19:58 2015 (r278904) @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: libdwarf.h 3064 2014-06-06 19:35:55Z kaiwang27 $ + * $Id: libdwarf.h 3149 2015-02-15 19:00:06Z emaste $ */ #ifndef _LIBDWARF_H_ Modified: head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c Tue Feb 17 15:19:58 2015 (r278904) @@ -26,7 +26,7 @@ #include "_libdwarf.h" -ELFTC_VCSID("$Id: libdwarf_elf_init.c 2972 2013-12-23 06:46:04Z kaiwang27 $"); +ELFTC_VCSID("$Id: libdwarf_elf_init.c 3161 2015-02-15 21:43:36Z emaste $"); static const char *debug_name[] = { ".debug_abbrev", Modified: head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Tue Feb 17 15:19:58 2015 (r278904) @@ -26,7 +26,7 @@ #include "_libdwarf.h" -ELFTC_VCSID("$Id: libdwarf_reloc.c 2948 2013-05-30 21:25:52Z kaiwang27 $"); +ELFTC_VCSID("$Id: libdwarf_reloc.c 3149 2015-02-15 19:00:06Z emaste $"); Dwarf_Unsigned _dwarf_get_reloc_type(Dwarf_P_Debug dbg, int is64) Modified: head/contrib/elftoolchain/libelf/_libelf_config.h ============================================================================== --- head/contrib/elftoolchain/libelf/_libelf_config.h Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libelf/_libelf_config.h Tue Feb 17 15:19:58 2015 (r278904) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: _libelf_config.h 2287 2011-12-04 06:45:47Z jkoshy $ + * $Id: _libelf_config.h 3143 2015-02-15 17:57:38Z emaste $ */ #ifdef __DragonFly__ Modified: head/contrib/elftoolchain/libelf/elf.3 ============================================================================== --- head/contrib/elftoolchain/libelf/elf.3 Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libelf/elf.3 Tue Feb 17 15:19:58 2015 (r278904) @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf.3 3082 2014-07-28 09:13:33Z jkoshy $ +.\" $Id: elf.3 3142 2015-01-29 23:11:14Z jkoshy $ .\" .Dd July 28, 2014 .Os Modified: head/contrib/elftoolchain/libelf/elf_scn.c ============================================================================== --- head/contrib/elftoolchain/libelf/elf_scn.c Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libelf/elf_scn.c Tue Feb 17 15:19:58 2015 (r278904) @@ -37,7 +37,7 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: elf_scn.c 3013 2014-03-23 06:16:59Z jkoshy $"); +ELFTC_VCSID("$Id: elf_scn.c 3147 2015-02-15 18:45:23Z emaste $"); /* * Load an ELF section table and create a list of Elf_Scn structures. Modified: head/contrib/elftoolchain/libelf/libelf_ar_util.c ============================================================================== --- head/contrib/elftoolchain/libelf/libelf_ar_util.c Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libelf/libelf_ar_util.c Tue Feb 17 15:19:58 2015 (r278904) @@ -34,7 +34,7 @@ #include "_libelf.h" #include "_libelf_ar.h" -ELFTC_VCSID("$Id: libelf_ar_util.c 3013 2014-03-23 06:16:59Z jkoshy $"); +ELFTC_VCSID("$Id: libelf_ar_util.c 3157 2015-02-15 21:42:02Z emaste $"); /* * Convert a string bounded by `start' and `start+sz' (exclusive) to a @@ -278,7 +278,6 @@ _libelf_ar_open(Elf *e, int reporterror) * Handle special archive members for the SVR4 format. */ if (arh.ar_name[0] == '/') { - if (sz == 0) goto error; Modified: head/contrib/elftoolchain/libelf/libelf_convert.m4 ============================================================================== --- head/contrib/elftoolchain/libelf/libelf_convert.m4 Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/libelf/libelf_convert.m4 Tue Feb 17 15:19:58 2015 (r278904) @@ -32,7 +32,7 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: libelf_convert.m4 3009 2014-03-23 01:49:59Z jkoshy $"); +ELFTC_VCSID("$Id: libelf_convert.m4 3158 2015-02-15 21:42:07Z emaste $"); /* WARNING: GENERATED FROM __file__. */ Modified: head/contrib/elftoolchain/nm/nm.1 ============================================================================== --- head/contrib/elftoolchain/nm/nm.1 Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/nm/nm.1 Tue Feb 17 15:19:58 2015 (r278904) @@ -22,9 +22,9 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: nm.1 2377 2012-01-03 07:10:59Z jkoshy $ +.\" $Id: nm.1 3145 2015-02-15 18:04:37Z emaste $ .\" -.Dd January 8, 2015 +.Dd February 15, 2015 .Os .Dt NM 1 .Sh NAME Modified: head/contrib/elftoolchain/nm/nm.c ============================================================================== --- head/contrib/elftoolchain/nm/nm.c Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/nm/nm.c Tue Feb 17 15:19:58 2015 (r278904) @@ -48,7 +48,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: nm.c 3124 2014-12-21 05:46:28Z kaiwang27 $"); +ELFTC_VCSID("$Id: nm.c 3145 2015-02-15 18:04:37Z emaste $"); /* symbol information list */ STAILQ_HEAD(sym_head, sym_entry); Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Tue Feb 17 15:04:53 2015 (r278903) +++ head/contrib/elftoolchain/readelf/readelf.c Tue Feb 17 15:19:58 2015 (r278904) @@ -47,7 +47,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: readelf.c 3110 2014-12-20 08:32:46Z kaiwang27 $"); +ELFTC_VCSID("$Id: readelf.c 3155 2015-02-15 19:15:57Z emaste $"); /* * readelf(1) options. @@ -1503,7 +1503,8 @@ r_type(unsigned int mach, unsigned int t static const char * note_type(const char *name, unsigned int et, unsigned int nt) { - if (strcmp(name, "CORE") == 0 && et == ET_CORE) + if ((strcmp(name, "CORE") == 0 || strcmp(name, "LINUX") == 0) && + et == ET_CORE) return note_type_linux_core(nt); else if (strcmp(name, "FreeBSD") == 0) if (et == ET_CORE) @@ -1559,13 +1560,27 @@ note_type_linux_core(unsigned int nt) case 1: return "NT_PRSTATUS (Process status)"; case 2: return "NT_FPREGSET (Floating point information)"; case 3: return "NT_PRPSINFO (Process information)"; + case 4: return "NT_TASKSTRUCT (Task structure)"; case 6: return "NT_AUXV (Auxiliary vector)"; - case 0x46E62B7FUL: return "NT_PRXFPREG (Linux user_xfpregs structure)"; case 10: return "NT_PSTATUS (Linux process status)"; case 12: return "NT_FPREGS (Linux floating point regset)"; case 13: return "NT_PSINFO (Linux process information)"; case 16: return "NT_LWPSTATUS (Linux lwpstatus_t type)"; case 17: return "NT_LWPSINFO (Linux lwpinfo_t type)"; + case 18: return "NT_WIN32PSTATUS (win32_pstatus structure)"; + case 0x100: return "NT_PPC_VMX (ppc Altivec registers)"; + case 0x102: return "NT_PPC_VSX (ppc VSX registers)"; + case 0x202: return "NT_X86_XSTATE (x86 XSAVE extended state)"; + case 0x300: return "NT_S390_HIGH_GPRS (s390 upper register halves)"; + case 0x301: return "NT_S390_TIMER (s390 timer register)"; + case 0x302: return "NT_S390_TODCMP (s390 TOD comparator register)"; + case 0x303: return "NT_S390_TODPREG (s390 TOD programmable register)"; + case 0x304: return "NT_S390_CTRS (s390 control registers)"; + case 0x305: return "NT_S390_PREFIX (s390 prefix register)"; + case 0x400: return "NT_ARM_VFP (arm VFP registers)"; + case 0x46494c45UL: return "NT_FILE (mapped files)"; + case 0x46E62B7FUL: return "NT_PRXFPREG (Linux user_xfpregs structure)"; + case 0x53494749UL: return "NT_SIGINFO (siginfo_t data)"; default: return (note_type_unknown(nt)); } } @@ -1605,7 +1620,8 @@ note_type_unknown(unsigned int nt) { static char s_nt[32]; - snprintf(s_nt, sizeof(s_nt), "", nt); + snprintf(s_nt, sizeof(s_nt), + nt >= 0x100 ? "" : "", nt); return (s_nt); } @@ -3154,6 +3170,10 @@ dump_rel(struct readelf *re, struct sect warnx("gelf_getrel failed: %s", elf_errmsg(-1)); continue; } + if (s->link >= re->shnum) { + warnx("invalid section link index %u", s->link); + continue; + } symname = get_symbol_name(re, s->link, GELF_R_SYM(r.r_info)); symval = get_symbol_value(re, s->link, GELF_R_SYM(r.r_info)); if (re->ec == ELFCLASS32) { @@ -3206,6 +3226,10 @@ dump_rela(struct readelf *re, struct sec warnx("gelf_getrel failed: %s", elf_errmsg(-1)); continue; } + if (s->link >= re->shnum) { + warnx("invalid section link index %u", s->link); + continue; + } symname = get_symbol_name(re, s->link, GELF_R_SYM(r.r_info)); symval = get_symbol_value(re, s->link, GELF_R_SYM(r.r_info)); if (re->ec == ELFCLASS32) { @@ -4219,14 +4243,22 @@ dump_attributes(struct readelf *re) len = d->d_size - 1; p++; while (len > 0) { + if (len < 4) { + warnx("truncated attribute section length"); + break; + } seclen = re->dw_decode(&p, 4); if (seclen > len) { warnx("invalid attribute section length"); break; } len -= seclen; - printf("Attribute Section: %s\n", (char *) p); nlen = strlen((char *) p) + 1; + if (nlen + 4 > seclen) { + warnx("invalid attribute section name"); + break; + } + printf("Attribute Section: %s\n", (char *) p); p += nlen; seclen -= nlen + 4; while (seclen > 0) { @@ -6696,10 +6728,8 @@ load_sections(struct readelf *re) return; } - if ((scn = elf_getscn(re->elf, 0)) == NULL) { - warnx("elf_getscn failed: %s", elf_errmsg(-1)); + if ((scn = elf_getscn(re->elf, 0)) == NULL) return; - } (void) elf_errno(); do { Modified: head/lib/libelftc/elftc_version.c ============================================================================== --- head/lib/libelftc/elftc_version.c Tue Feb 17 15:04:53 2015 (r278903) +++ head/lib/libelftc/elftc_version.c Tue Feb 17 15:19:58 2015 (r278904) @@ -6,5 +6,5 @@ const char * elftc_version(void) { - return "elftoolchain r3136M"; + return "elftoolchain r3163M"; } From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 15:40:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FB5D2B5; Tue, 17 Feb 2015 15:40:35 +0000 (UTC) Received: from mail.strugglingcoder.info (strugglingcoder.info [65.19.130.35]) (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 4828962F; Tue, 17 Feb 2015 15:40:35 +0000 (UTC) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPSA id E6597D0C7A; Tue, 17 Feb 2015 07:40:33 -0800 (PST) Date: Tue, 17 Feb 2015 07:40:33 -0800 From: hiren panchasara To: Adrian Chadd Subject: Re: svn commit: r278879 - in head/sys: kern sys Message-ID: <20150217154033.GJ19044@strugglingcoder.info> References: <201502170235.t1H2Z6eC005697@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OOq1TgGhe8eTwFBO" Content-Disposition: inline In-Reply-To: <201502170235.t1H2Z6eC005697@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 17 Feb 2015 15:40:35 -0000 --OOq1TgGhe8eTwFBO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 02/17/15 at 02:35P, Adrian Chadd wrote: > Author: adrian > Date: Tue Feb 17 02:35:06 2015 > New Revision: 278879 > URL: https://svnweb.freebsd.org/changeset/base/278879 >=20 > Log: > Implement taskqueue_start_threads_cpuset(). > =20 > This is a more generic version of taskqueue_start_threads_pinned() > which only supports a single cpuid. > =20 > This originally came from John Baldwin who implemented it > as part of a push towards NUMA awareness in drivers. I started impleme= nting > something similar for RSS and NUMA, then found he already did it. > =20 > I'd like to axe taskqueue_start_threads_pinned() so it doesn't become > part of a longer-term API. (Read: hps@ wants to MFC things, and > if I don't do this soon, he'll MFC what's here. :-) > =20 > I have a follow-up commit which converts the intel drivers over > to using the cpuset version of this function, so we can eventually > nuke the the pinned version. > =20 > Tested: > =20 > * igb, ixgbe > =20 > Obtained from: jhbbsd >=20 > Modified: > head/sys/kern/subr_taskqueue.c > head/sys/sys/taskqueue.h Can you please also update taskqueue(9) manpage? Cheers, Hiren --OOq1TgGhe8eTwFBO Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQF8BAEBCgBmBQJU42DxXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lz7AH/2oQVeDIxVc2znl3nOsyo25D w1y2ufgc/iMgCzoPLB3K4qMkVxrhYwe+C3NB/XEehvFJkfheh79pEKwZqPRrN14d 2irXE7l3+ZcH5rqHpPw7/YGZJo8oOwKtYXUcTA+3dueGtWsHKI2q2jM6/5LjTIWO nJCl4erVNxFLudW7VcvHBNXNq4/TtD3a14SXA30fPFwWeM1m7xlRruGCDXHPlN+A AMWtSykbdeePyMW7Noo+PMk8hgPn0U6G/MEGn4Zp4SA6FRc2xI+nSYEqR1YdLOIx 6O0v7PcbrBFXY3kDtRW+eyk4GEY+JzQeHHc/hmCol8KEdvNyc0ybGtPCfySNhNY= =b10n -----END PGP SIGNATURE----- --OOq1TgGhe8eTwFBO-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 16:01:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE8888C5; Tue, 17 Feb 2015 16:01:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D9D4B94E; Tue, 17 Feb 2015 16:01:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HG11Ss089338; Tue, 17 Feb 2015 16:01:01 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HG11pU089337; Tue, 17 Feb 2015 16:01:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502171601.t1HG11pU089337@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 17 Feb 2015 16:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278905 - head/lib/libc/gen 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 16:01:02 -0000 Author: pfg Date: Tue Feb 17 16:01:00 2015 New Revision: 278905 URL: https://svnweb.freebsd.org/changeset/base/278905 Log: ulimit(3): simplify. rlim_t is at least as large as long, so we don't need the extra variable to keep the intermediate step. We don't need the volatile either. The code was tested on i386 and amd64. Suggested by: bde X-MFC with: r278803 Modified: head/lib/libc/gen/ulimit.c Modified: head/lib/libc/gen/ulimit.c ============================================================================== --- head/lib/libc/gen/ulimit.c Tue Feb 17 15:19:58 2015 (r278904) +++ head/lib/libc/gen/ulimit.c Tue Feb 17 16:01:00 2015 (r278905) @@ -33,7 +33,6 @@ #include #include #include -#include #include long @@ -41,8 +40,7 @@ ulimit(int cmd, ...) { struct rlimit limit; va_list ap; - volatile intmax_t targ; - long arg; + rlim_t arg; if (cmd == UL_GETFSIZE) { if (getrlimit(RLIMIT_FSIZE, &limit) == -1) @@ -53,18 +51,18 @@ ulimit(int cmd, ...) return ((long)limit.rlim_cur); } else if (cmd == UL_SETFSIZE) { va_start(ap, cmd); - targ = arg = va_arg(ap, long); + arg = va_arg(ap, long); va_end(ap); - if (targ < 0) - targ = LONG_MAX; - if (targ > RLIM_INFINITY / 512) - targ = RLIM_INFINITY / 512; - limit.rlim_max = limit.rlim_cur = targ * 512; + if (arg < 0) + arg = LONG_MAX; + if (arg > RLIM_INFINITY / 512) + arg = RLIM_INFINITY / 512; + limit.rlim_max = limit.rlim_cur = arg * 512; /* The setrlimit() function sets errno to EPERM if needed. */ if (setrlimit(RLIMIT_FSIZE, &limit) == -1) return (-1); - return ((long)targ); + return ((long)arg); } else { errno = EINVAL; return (-1); From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 17:31:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A46F83B; Tue, 17 Feb 2015 17:31:35 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 13017604; Tue, 17 Feb 2015 17:31:34 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t1HHVYxU025991 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 Feb 2015 09:31:34 -0800 (PST) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t1HHVYBR025990; Tue, 17 Feb 2015 09:31:34 -0800 (PST) (envelope-from jmg) Date: Tue, 17 Feb 2015 09:31:34 -0800 From: John-Mark Gurney To: Gleb Smirnoff Subject: Re: svn commit: r278831 - head/sys/netpfil/pf Message-ID: <20150217173134.GZ1953@funkthat.com> References: <201502160338.t1G3cRlX042385@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502160338.t1G3cRlX042385@svn.freebsd.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Tue, 17 Feb 2015 09:31:34 -0800 (PST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 17 Feb 2015 17:31:35 -0000 Gleb Smirnoff wrote this message on Mon, Feb 16, 2015 at 03:38 +0000: > Author: glebius > Date: Mon Feb 16 03:38:27 2015 > New Revision: 278831 > URL: https://svnweb.freebsd.org/changeset/base/278831 > > Log: > Update the pf fragment handling code to closer match recent OpenBSD. > That partially fixes IPv6 fragment handling. Thanks to Kristof for > working on that. > > Submitted by: Kristof Provost > Tested by: peter > Differential Revision: D1765 Looks like pf_flush_fragments still called in !INET case, though only defined for INET case: /scratch/tmp/jmg/src.head/sys/modules/pf/../../netpfil/pf/pf_norm.c:385:3: error: implicit declaration of function 'pf_flush_fragments' is invalid in C99 [-Werror,-Wimplicit-function-declaration] pf_flush_fragments(); when compiling LINT-NOINET kernel.. at least as of r278883... We need to get Jenkins to be compiling the LINT-NOINET kernel too.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 17:34:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE23EBAC; Tue, 17 Feb 2015 17:34:38 +0000 (UTC) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) (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 BD78D643; Tue, 17 Feb 2015 17:34:38 +0000 (UTC) Received: by pdjy10 with SMTP id y10so45078581pdj.13; Tue, 17 Feb 2015 09:34:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=dY1F3Q71YCQ5qhX76tE0peHT6iRfaH3+Q2YdG+bdgfk=; b=qfVeyO+1eDdB8Zaegd+ySSXQ/NMUjGpVSMxS96p9STihg198VU/KC3aLhsFy11gt9T J8f1ZyY0va0xQuO0otT+6oA0l7TcCdcyt5XDr7zTqaRKtXoic++aVuPAKzPluCc3eo2q PTPmfb2qKQJR+ZmQwm7M2o6B/wA73JrdpPev95cNJ4hliQsqL2eGfIz6YKKCoo3+oWEW 6K6k0Ig1KUGkmPZ8ymU72xuG+yZaXIDWf8kNBeOklOwve7wzDQjuK0T3MDe5Y33evudC fSmbWWU4Ls9aqQ4y3y5drw5NW9ZbvoJtRCDPZnv8XMPQfxAWYi+WXZ0X1vvMF05BN9eg bV1g== X-Received: by 10.66.63.106 with SMTP id f10mr50969197pas.0.1424194472805; Tue, 17 Feb 2015 09:34:32 -0800 (PST) Received: from ox (c-24-6-44-228.hsd1.ca.comcast.net. [24.6.44.228]) by mx.google.com with ESMTPSA id ny1sm18096458pbb.77.2015.02.17.09.34.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Feb 2015 09:34:31 -0800 (PST) Date: Tue, 17 Feb 2015 09:34:23 -0800 From: Navdeep Parhar To: Hans Petter Selasky Subject: Re: svn commit: r278886 - in head/sys: conf contrib/rdma/krping dev/cxgb/ulp/iw_cxgb dev/cxgbe/iw_cxgbe modules/ibcore modules/mlx4ib ofed/drivers/infiniband/core ofed/drivers/infiniband/debug ofed/dri... Message-ID: <20150217173423.GA8762@ox> Mail-Followup-To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201502170840.t1H8eSwP076384@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502170840.t1H8eSwP076384@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 17 Feb 2015 17:34:39 -0000 On Tue, Feb 17, 2015 at 08:40:28AM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Feb 17 08:40:27 2015 > New Revision: 278886 > URL: https://svnweb.freebsd.org/changeset/base/278886 > > Log: > Update the infiniband stack to Mellanox's OFED version 2.1. What version of the Linux kernel does this match? > > Highlights: > - Multiple verbs API updates > - Support for RoCE, RDMA over ethernet > > All hardware drivers depending on the common infiniband stack has been > updated aswell. > > Discussed with: np @ > Sponsored by: Mellanox Technologies > MFC after: 1 month My reading of the project's MFC policy is that changes to the verbs cannot be MFC'd as that's a KPI/API change. I still plan to test these changes with some iWARP gear later this week. I thought you were going to wait till then, but, oh well. Regards, Navdeep > > Added: > head/sys/ofed/drivers/infiniband/core/peer_mem.c (contents, props changed) > head/sys/ofed/drivers/infiniband/hw/mlx4/mlx4_exp.c (contents, props changed) > head/sys/ofed/drivers/infiniband/hw/mlx4/mlx4_exp.h (contents, props changed) > head/sys/ofed/include/rdma/ib_peer_mem.h (contents, props changed) > head/sys/ofed/include/rdma/ib_user_verbs_exp.h (contents, props changed) > head/sys/ofed/include/rdma/ib_verbs_exp.h (contents, props changed) > head/sys/ofed/include/rdma/peer_mem.h (contents, props changed) > Deleted: > head/sys/ofed/drivers/infiniband/core/Makefile > head/sys/ofed/drivers/infiniband/core/local_sa.c > head/sys/ofed/drivers/infiniband/core/notice.c > head/sys/ofed/drivers/infiniband/hw/mlx4/Makefile > head/sys/ofed/drivers/infiniband/ulp/ipoib/Makefile > Modified: > head/sys/conf/files > head/sys/contrib/rdma/krping/krping.c > head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c > head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c > head/sys/dev/cxgbe/iw_cxgbe/cq.c > head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h > head/sys/dev/cxgbe/iw_cxgbe/mem.c > head/sys/modules/ibcore/Makefile > head/sys/modules/mlx4ib/Makefile > head/sys/ofed/drivers/infiniband/core/addr.c > head/sys/ofed/drivers/infiniband/core/cache.c > head/sys/ofed/drivers/infiniband/core/cm.c > head/sys/ofed/drivers/infiniband/core/cm_msgs.h > head/sys/ofed/drivers/infiniband/core/cma.c > head/sys/ofed/drivers/infiniband/core/core_priv.h > head/sys/ofed/drivers/infiniband/core/device.c > head/sys/ofed/drivers/infiniband/core/fmr_pool.c > head/sys/ofed/drivers/infiniband/core/iwcm.c > head/sys/ofed/drivers/infiniband/core/mad.c > head/sys/ofed/drivers/infiniband/core/mad_priv.h > head/sys/ofed/drivers/infiniband/core/mad_rmpp.c > head/sys/ofed/drivers/infiniband/core/multicast.c > head/sys/ofed/drivers/infiniband/core/packer.c > head/sys/ofed/drivers/infiniband/core/sa.h > head/sys/ofed/drivers/infiniband/core/sa_query.c > head/sys/ofed/drivers/infiniband/core/smi.c > head/sys/ofed/drivers/infiniband/core/sysfs.c > head/sys/ofed/drivers/infiniband/core/ucm.c > head/sys/ofed/drivers/infiniband/core/ucma.c > head/sys/ofed/drivers/infiniband/core/ud_header.c > head/sys/ofed/drivers/infiniband/core/umem.c > head/sys/ofed/drivers/infiniband/core/user_mad.c > head/sys/ofed/drivers/infiniband/core/uverbs.h > head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c > head/sys/ofed/drivers/infiniband/core/uverbs_main.c > head/sys/ofed/drivers/infiniband/core/uverbs_marshall.c > head/sys/ofed/drivers/infiniband/core/verbs.c > head/sys/ofed/drivers/infiniband/debug/memtrack.c > head/sys/ofed/drivers/infiniband/debug/memtrack.h > head/sys/ofed/drivers/infiniband/debug/mtrack.h > head/sys/ofed/drivers/infiniband/hw/mlx4/ah.c > head/sys/ofed/drivers/infiniband/hw/mlx4/alias_GUID.c > head/sys/ofed/drivers/infiniband/hw/mlx4/cm.c > head/sys/ofed/drivers/infiniband/hw/mlx4/cq.c > head/sys/ofed/drivers/infiniband/hw/mlx4/doorbell.c > head/sys/ofed/drivers/infiniband/hw/mlx4/mad.c > head/sys/ofed/drivers/infiniband/hw/mlx4/main.c > head/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c > head/sys/ofed/drivers/infiniband/hw/mlx4/mlx4_ib.h > head/sys/ofed/drivers/infiniband/hw/mlx4/mr.c > head/sys/ofed/drivers/infiniband/hw/mlx4/qp.c > head/sys/ofed/drivers/infiniband/hw/mlx4/sysfs.c > head/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c > head/sys/ofed/drivers/infiniband/hw/mthca/mthca_qp.c > head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h > head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c > head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c > head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c > head/sys/ofed/include/rdma/ib_addr.h > head/sys/ofed/include/rdma/ib_cache.h > head/sys/ofed/include/rdma/ib_cm.h > head/sys/ofed/include/rdma/ib_mad.h > head/sys/ofed/include/rdma/ib_pack.h > head/sys/ofed/include/rdma/ib_sa.h > head/sys/ofed/include/rdma/ib_umem.h > head/sys/ofed/include/rdma/ib_user_verbs.h > head/sys/ofed/include/rdma/ib_verbs.h > head/sys/ofed/include/rdma/iw_cm.h > head/sys/ofed/include/rdma/rdma_cm.h > head/sys/ofed/include/rdma/rdma_user_cm.h > From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 17:37:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B634BEF7; Tue, 17 Feb 2015 17:37:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A174367C; Tue, 17 Feb 2015 17:37:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HHb28r035950; Tue, 17 Feb 2015 17:37:02 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HHb1Gq035943; Tue, 17 Feb 2015 17:37:01 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201502171737.t1HHb1Gq035943@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Tue, 17 Feb 2015 17:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278907 - head/sys/dev/random 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 17:37:02 -0000 Author: jmg Date: Tue Feb 17 17:37:00 2015 New Revision: 278907 URL: https://svnweb.freebsd.org/changeset/base/278907 Log: When the new random adaptor code was brought it in r273872, a call to randomdev_init_reader to change read_random over to the newly installed adaptor was missed. This means both read_random and arc4random (seeded from read_random) were not returning very random data. This also effects userland arc4random as it is seeded from kernel arc4random. The random devices are uneffected and have returned good randomness since the change. All keys generated with a kernel of r273872 must be regenerated with a kernel with this patch. Keys generated may be predictable. Remove the warning as log is too early to print anything, and it would always get printed due to early use of arc4random... Reviewed by: delphij, markm Approved by: so (delphij) Modified: head/sys/dev/random/dummy_rng.c head/sys/dev/random/random_adaptors.c head/sys/dev/random/randomdev.c head/sys/dev/random/randomdev.h Modified: head/sys/dev/random/dummy_rng.c ============================================================================== --- head/sys/dev/random/dummy_rng.c Tue Feb 17 17:34:45 2015 (r278906) +++ head/sys/dev/random/dummy_rng.c Tue Feb 17 17:37:00 2015 (r278907) @@ -82,19 +82,13 @@ dummy_random_init(void) * * Caveat Emptor. */ -u_int +void dummy_random_read_phony(uint8_t *buf, u_int count) { /* If no entropy device is loaded, don't spam the console with warnings */ - static int warned = 0; u_long randval; size_t size, i; - if (!warned) { - log(LOG_WARNING, "random device not loaded/active; using insecure pseudo-random number generator\n"); - warned = 1; - } - /* srandom() is called in kern/init_main.c:proc0_post() */ /* Fill buf[] with random(9) output */ @@ -103,8 +97,6 @@ dummy_random_read_phony(uint8_t *buf, u_ size = MIN(count - i, sizeof(randval)); memcpy(buf + i, &randval, (size_t)size); } - - return (count); } struct random_adaptor randomdev_dummy = { Modified: head/sys/dev/random/random_adaptors.c ============================================================================== --- head/sys/dev/random/random_adaptors.c Tue Feb 17 17:34:45 2015 (r278906) +++ head/sys/dev/random/random_adaptors.c Tue Feb 17 17:37:00 2015 (r278907) @@ -149,10 +149,14 @@ random_adaptor_choose(void) (random_adaptor_previous == NULL ? "NULL" : random_adaptor_previous->ra_ident), random_adaptor->ra_ident); #endif - if (random_adaptor_previous != NULL) + if (random_adaptor_previous != NULL) { + randomdev_deinit_reader(); (random_adaptor_previous->ra_deinit)(); + } (random_adaptor->ra_init)(); } + + randomdev_init_reader(random_adaptor->ra_read); } Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Tue Feb 17 17:34:45 2015 (r278906) +++ head/sys/dev/random/randomdev.c Tue Feb 17 17:37:00 2015 (r278907) @@ -214,11 +214,11 @@ random_harvest(const void *entropy, u_in */ /* Hold the address of the routine which is actually called */ -static u_int (*read_func)(uint8_t *, u_int) = dummy_random_read_phony; +static void (*read_func)(uint8_t *, u_int) = dummy_random_read_phony; /* Initialise the reader when/if it is loaded */ void -randomdev_init_reader(u_int (*reader)(uint8_t *, u_int)) +randomdev_init_reader(void (*reader)(uint8_t *, u_int)) { read_func = reader; @@ -240,5 +240,10 @@ int read_random(void *buf, int count) { - return ((int)(*read_func)(buf, (u_int)count)); + if (count < 0) + return 0; + + read_func(buf, count); + + return count; } Modified: head/sys/dev/random/randomdev.h ============================================================================== --- head/sys/dev/random/randomdev.h Tue Feb 17 17:34:45 2015 (r278906) +++ head/sys/dev/random/randomdev.h Tue Feb 17 17:37:00 2015 (r278907) @@ -37,12 +37,12 @@ typedef void random_init_func_t(void); typedef void random_deinit_func_t(void); void randomdev_init_harvester(void (*)(const void *, u_int, u_int, enum random_entropy_source)); -void randomdev_init_reader(u_int (*)(uint8_t *, u_int)); +void randomdev_init_reader(void (*)(uint8_t *, u_int)); void randomdev_deinit_harvester(void); void randomdev_deinit_reader(void); /* Stub/fake routines for when no entropy processor is loaded */ -extern u_int dummy_random_read_phony(uint8_t *, u_int); +extern void dummy_random_read_phony(uint8_t *, u_int); /* kern.random sysctls */ #ifdef SYSCTL_DECL /* from sysctl.h */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 17:46:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79F4F3EA; Tue, 17 Feb 2015 17:46:30 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (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 3CEB5868; Tue, 17 Feb 2015 17:46:30 +0000 (UTC) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1YNmE6-000Oxt-Ts; Tue, 17 Feb 2015 17:46:28 +0000 Subject: Re: svn commit: r278907 - head/sys/dev/random Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_6681CDEF-E521-4843-BA17-4477C37AA309"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b5 From: Mark R V Murray In-Reply-To: <201502171737.t1HHb1Gq035943@svn.freebsd.org> Date: Tue, 17 Feb 2015 17:46:13 +0000 Message-Id: <30B45F07-482F-44D2-B871-468709C5B3F3@grondar.org> References: <201502171737.t1HHb1Gq035943@svn.freebsd.org> To: John-Mark Gurney X-Mailer: Apple Mail (2.2070.6) X-SA-Score: -3.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 17 Feb 2015 17:46:30 -0000 --Apple-Mail=_6681CDEF-E521-4843-BA17-4477C37AA309 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Thanks John-Mark! M > On 17 Feb 2015, at 17:37, John-Mark Gurney wrote: >=20 > Author: jmg > Date: Tue Feb 17 17:37:00 2015 > New Revision: 278907 > URL: https://svnweb.freebsd.org/changeset/base/278907 >=20 > Log: > When the new random adaptor code was brought it in r273872, a call to > randomdev_init_reader to change read_random over to the newly = installed > adaptor was missed. This means both read_random and arc4random = (seeded > from read_random) were not returning very random data. This also > effects userland arc4random as it is seeded from kernel arc4random. >=20 > The random devices are uneffected and have returned good randomness > since the change. >=20 > All keys generated with a kernel of r273872 must be regenerated with > a kernel with this patch. Keys generated may be predictable. >=20 > Remove the warning as log is too early to print anything, and it = would > always get printed due to early use of arc4random... >=20 > Reviewed by: delphij, markm > Approved by: so (delphij) >=20 > Modified: > head/sys/dev/random/dummy_rng.c > head/sys/dev/random/random_adaptors.c > head/sys/dev/random/randomdev.c > head/sys/dev/random/randomdev.h >=20 > Modified: head/sys/dev/random/dummy_rng.c > = =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/sys/dev/random/dummy_rng.c Tue Feb 17 17:34:45 2015 = (r278906) > +++ head/sys/dev/random/dummy_rng.c Tue Feb 17 17:37:00 2015 = (r278907) > @@ -82,19 +82,13 @@ dummy_random_init(void) > * > * Caveat Emptor. > */ > -u_int > +void > dummy_random_read_phony(uint8_t *buf, u_int count) > { > /* If no entropy device is loaded, don't spam the console with = warnings */ > - static int warned =3D 0; > u_long randval; > size_t size, i; >=20 > - if (!warned) { > - log(LOG_WARNING, "random device not loaded/active; using = insecure pseudo-random number generator\n"); > - warned =3D 1; > - } > - > /* srandom() is called in kern/init_main.c:proc0_post() */ >=20 > /* Fill buf[] with random(9) output */ > @@ -103,8 +97,6 @@ dummy_random_read_phony(uint8_t *buf, u_ > size =3D MIN(count - i, sizeof(randval)); > memcpy(buf + i, &randval, (size_t)size); > } > - > - return (count); > } >=20 > struct random_adaptor randomdev_dummy =3D { >=20 > Modified: head/sys/dev/random/random_adaptors.c > = =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/sys/dev/random/random_adaptors.c Tue Feb 17 17:34:45 2015 = (r278906) > +++ head/sys/dev/random/random_adaptors.c Tue Feb 17 17:37:00 2015 = (r278907) > @@ -149,10 +149,14 @@ random_adaptor_choose(void) > (random_adaptor_previous =3D=3D NULL ? "NULL" : = random_adaptor_previous->ra_ident), > random_adaptor->ra_ident); > #endif > - if (random_adaptor_previous !=3D NULL) > + if (random_adaptor_previous !=3D NULL) { > + randomdev_deinit_reader(); > (random_adaptor_previous->ra_deinit)(); > + } > (random_adaptor->ra_init)(); > } > + > + randomdev_init_reader(random_adaptor->ra_read); > } >=20 >=20 >=20 > Modified: head/sys/dev/random/randomdev.c > = =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/sys/dev/random/randomdev.c Tue Feb 17 17:34:45 2015 = (r278906) > +++ head/sys/dev/random/randomdev.c Tue Feb 17 17:37:00 2015 = (r278907) > @@ -214,11 +214,11 @@ random_harvest(const void *entropy, u_in > */ >=20 > /* Hold the address of the routine which is actually called */ > -static u_int (*read_func)(uint8_t *, u_int) =3D = dummy_random_read_phony; > +static void (*read_func)(uint8_t *, u_int) =3D = dummy_random_read_phony; >=20 > /* Initialise the reader when/if it is loaded */ > void > -randomdev_init_reader(u_int (*reader)(uint8_t *, u_int)) > +randomdev_init_reader(void (*reader)(uint8_t *, u_int)) > { >=20 > read_func =3D reader; > @@ -240,5 +240,10 @@ int > read_random(void *buf, int count) > { >=20 > - return ((int)(*read_func)(buf, (u_int)count)); > + if (count < 0) > + return 0; > + > + read_func(buf, count); > + > + return count; > } >=20 > Modified: head/sys/dev/random/randomdev.h > = =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/sys/dev/random/randomdev.h Tue Feb 17 17:34:45 2015 = (r278906) > +++ head/sys/dev/random/randomdev.h Tue Feb 17 17:37:00 2015 = (r278907) > @@ -37,12 +37,12 @@ typedef void random_init_func_t(void); > typedef void random_deinit_func_t(void); >=20 > void randomdev_init_harvester(void (*)(const void *, u_int, u_int, = enum random_entropy_source)); > -void randomdev_init_reader(u_int (*)(uint8_t *, u_int)); > +void randomdev_init_reader(void (*)(uint8_t *, u_int)); > void randomdev_deinit_harvester(void); > void randomdev_deinit_reader(void); >=20 > /* Stub/fake routines for when no entropy processor is loaded */ > -extern u_int dummy_random_read_phony(uint8_t *, u_int); > +extern void dummy_random_read_phony(uint8_t *, u_int); >=20 > /* kern.random sysctls */ > #ifdef SYSCTL_DECL /* from sysctl.h */ >=20 -- Mark R V Murray --Apple-Mail=_6681CDEF-E521-4843-BA17-4477C37AA309 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.26 Comment: GPGTools - http://gpgtools.org iQCVAwUBVON+a958vKOKE6LNAQqzIQP9GsJmnqiQD88DWxyM35e0Pcyi+Jm3tXde MVFXvvNRpJ9h1WJLEkb7MzNfeWMCgMC4riFs1CrgCrC1iiOYl4ZmdwTRqE1vd1yI Wx/uf1AEZIPzWOJiX27c0+4WUSNQq+/rLJGjqmIOf8saVpqfzraV4IvramvT5hVS NBlhf0ALF9Q= =4eLd -----END PGP SIGNATURE----- --Apple-Mail=_6681CDEF-E521-4843-BA17-4477C37AA309-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 18:10:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 880CA42D; Tue, 17 Feb 2015 18:10:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 73F35C0C; Tue, 17 Feb 2015 18:10:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HIAlH4053961; Tue, 17 Feb 2015 18:10:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HIAlsu053960; Tue, 17 Feb 2015 18:10:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502171810.t1HIAlsu053960@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Feb 2015 18:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278908 - 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 18:10:47 -0000 Author: imp Date: Tue Feb 17 18:10:46 2015 New Revision: 278908 URL: https://svnweb.freebsd.org/changeset/base/278908 Log: hd64570.h was installed, so add it here now that it is gone. Submitted by: ae@ Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Feb 17 17:37:00 2015 (r278907) +++ head/ObsoleteFiles.inc Tue Feb 17 18:10:46 2015 (r278908) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20150217: Removed remnants of ar(4) driver +OLD_FILES+=usr/include/sys/dev/ic/hd64570.h # 20150212: /usr/games moving into /usr/bin OLD_FILES+=usr/games/bcd OLD_FILES+=usr/games/caesar From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 18:33:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A279A8B; Tue, 17 Feb 2015 18:33:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 65024E39; Tue, 17 Feb 2015 18:33:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HIXIgD064215; Tue, 17 Feb 2015 18:33:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HIXI6q064214; Tue, 17 Feb 2015 18:33:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201502171833.t1HIXI6q064214@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 17 Feb 2015 18:33:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278909 - head/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 18:33:18 -0000 Author: emaste Date: Tue Feb 17 18:33:17 2015 New Revision: 278909 URL: https://svnweb.freebsd.org/changeset/base/278909 Log: lldb: workaround to permit cross-arch core file debugging FreeBSD core files have no section table and thus LLDB's OS and vendor detection logic does not work. If we encounter such an ELF file, update an unknown OS to match the host. This is not really the correct way to handle this, but more extensive rework of ObjectFileELF will be needed and this change restores cross- arch core debugging until that can be completed. Modified: head/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Modified: head/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Tue Feb 17 18:10:46 2015 (r278908) +++ head/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Tue Feb 17 18:33:17 2015 (r278909) @@ -1331,8 +1331,11 @@ ObjectFileELF::GetSectionHeaderInfo(Sect } // If there are no section headers we are done. - if (header.e_shnum == 0) + if (header.e_shnum == 0) { + if (arch_spec.GetTriple().getOS() == llvm::Triple::OSType::UnknownOS) + arch_spec.GetTriple().setOSName(HostInfo::GetOSString().data()); return 0; + } Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_MODULES)); From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 19:27:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDE80DBB; Tue, 17 Feb 2015 19:27:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9EEFE757; Tue, 17 Feb 2015 19:27:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HJRIZG088189; Tue, 17 Feb 2015 19:27:18 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HJRFVV088172; Tue, 17 Feb 2015 19:27:15 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502171927.t1HJRFVV088172@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 Feb 2015 19:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278913 - in head/sys: conf modules/cxgbe/if_cxgbe modules/drm2/radeonkms modules/ibcore modules/ipoib modules/mlx4 modules/mlx4ib modules/mlxen modules/mthca ofed/drivers/net/mlx4 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 19:27:18 -0000 Author: glebius Date: Tue Feb 17 19:27:14 2015 New Revision: 278913 URL: https://svnweb.freebsd.org/changeset/base/278913 Log: Globally enable -fms-extensions when building kernel with gcc, and remove this option from all modules that enable it theirselves. In C mode -fms-extensions option enables anonymous structs and unions, allowing us to use this C11 feature in kernel. Of course, clang supports it without any extra options. Reviewed by: dim Modified: head/sys/conf/files head/sys/conf/kern.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk head/sys/modules/cxgbe/if_cxgbe/Makefile head/sys/modules/drm2/radeonkms/Makefile head/sys/modules/ibcore/Makefile head/sys/modules/ipoib/Makefile head/sys/modules/mlx4/Makefile head/sys/modules/mlx4ib/Makefile head/sys/modules/mlxen/Makefile head/sys/modules/mthca/Makefile head/sys/ofed/drivers/net/mlx4/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 17 19:15:07 2015 (r278912) +++ head/sys/conf/files Tue Feb 17 19:27:14 2015 (r278913) @@ -1141,7 +1141,7 @@ dev/cxgb/sys/uipc_mvec.c optional cxgb p dev/cxgb/cxgb_t3fw.c optional cxgb cxgb_t3fw \ compile-with "${NORMAL_C} -I$S/dev/cxgb" dev/cxgbe/t4_mp_ring.c optional cxgbe pci \ - compile-with "${NORMAL_C} -I$S/dev/cxgbe ${GCC_MS_EXTENSIONS}" + compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_main.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_netmap.c optional cxgbe pci \ Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Tue Feb 17 19:15:07 2015 (r278912) +++ head/sys/conf/kern.mk Tue Feb 17 19:27:14 2015 (r278913) @@ -39,7 +39,6 @@ CLANG_NO_IAS34= -no-integrated-as .endif .if ${COMPILER_TYPE} == "gcc" -GCC_MS_EXTENSIONS= -fms-extensions .if ${COMPILER_VERSION} >= 40300 # Catch-all for all the things that are in our tree, but for which we're # not yet ready for this compiler. Note: we likely only really "support" Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Feb 17 19:15:07 2015 (r278912) +++ head/sys/conf/kern.pre.mk Tue Feb 17 19:27:14 2015 (r278913) @@ -97,7 +97,7 @@ CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000 .if ${MACHINE_CPUARCH} == "mips" CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 .endif -CFLAGS.gcc+= -fno-common -finline-limit=${INLINE_LIMIT} +CFLAGS.gcc+= -fno-common -fms-extensions -finline-limit=${INLINE_LIMIT} CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH} CFLAGS.gcc+= --param large-function-growth=${CFLAGS_PARAM_LARGE_FUNCTION_GROWTH} .if defined(CFLAGS_ARCH_PARAMS) @@ -162,7 +162,7 @@ NORMAL_LINT= ${LINT} ${LINTFLAGS} ${CFLA # Infiniband C flags. Correct include paths and omit errors that linux # does not honor. OFEDINCLUDES= -I$S/ofed/include/ -OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith OFEDCFLAGS= ${CFLAGS:N-I*} ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR} OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF} OFED_C= ${OFED_C_NOIMP} ${.IMPSRC} Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue Feb 17 19:15:07 2015 (r278912) +++ head/sys/conf/kmod.mk Tue Feb 17 19:27:14 2015 (r278913) @@ -105,6 +105,7 @@ CFLAGS+= -I. -I${SYSDIR} CFLAGS+= -I${SYSDIR}/contrib/altq CFLAGS.gcc+= -finline-limit=${INLINE_LIMIT} +CFLAGS.gcc+= -fms-extensions CFLAGS.gcc+= --param inline-unit-growth=100 CFLAGS.gcc+= --param large-function-growth=1000 Modified: head/sys/modules/cxgbe/if_cxgbe/Makefile ============================================================================== --- head/sys/modules/cxgbe/if_cxgbe/Makefile Tue Feb 17 19:15:07 2015 (r278912) +++ head/sys/modules/cxgbe/if_cxgbe/Makefile Tue Feb 17 19:27:14 2015 (r278913) @@ -26,4 +26,3 @@ SRCS+= t4_tracer.c CFLAGS+= -I${CXGBE} .include -CFLAGS+= ${GCC_MS_EXTENSIONS} Modified: head/sys/modules/drm2/radeonkms/Makefile ============================================================================== --- head/sys/modules/drm2/radeonkms/Makefile Tue Feb 17 19:15:07 2015 (r278912) +++ head/sys/modules/drm2/radeonkms/Makefile Tue Feb 17 19:27:14 2015 (r278913) @@ -106,6 +106,6 @@ SRCS += \ iicbus_if.h \ pci_if.h -CFLAGS += -I${.CURDIR}/../../../dev/drm2/radeon ${GCC_MS_EXTENSIONS} +CFLAGS += -I${.CURDIR}/../../../dev/drm2/radeon .include Modified: head/sys/modules/ibcore/Makefile ============================================================================== --- head/sys/modules/ibcore/Makefile Tue Feb 17 19:15:07 2015 (r278912) +++ head/sys/modules/ibcore/Makefile Tue Feb 17 19:27:14 2015 (r278913) @@ -18,6 +18,6 @@ CFLAGS+= -DINET6 -DINET .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith CWARNFLAGS.cm.c= -Wno-unused-function Modified: head/sys/modules/ipoib/Makefile ============================================================================== --- head/sys/modules/ipoib/Makefile Tue Feb 17 19:15:07 2015 (r278912) +++ head/sys/modules/ipoib/Makefile Tue Feb 17 19:27:14 2015 (r278913) @@ -15,4 +15,4 @@ CFLAGS+= -DINET6 -DINET .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith Modified: head/sys/modules/mlx4/Makefile ============================================================================== --- head/sys/modules/mlx4/Makefile Tue Feb 17 19:15:07 2015 (r278912) +++ head/sys/modules/mlx4/Makefile Tue Feb 17 19:27:14 2015 (r278913) @@ -15,7 +15,6 @@ CFLAGS+= -I${.CURDIR}/../../ofed/include .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} -CFLAGS+= -fms-extensions +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith CWARNFLAGS.mcg.c= -Wno-unused Modified: head/sys/modules/mlx4ib/Makefile ============================================================================== --- head/sys/modules/mlx4ib/Makefile Tue Feb 17 19:15:07 2015 (r278912) +++ head/sys/modules/mlx4ib/Makefile Tue Feb 17 19:27:14 2015 (r278913) @@ -13,8 +13,7 @@ CFLAGS+= -I${.CURDIR}/../../ofed/drivers CFLAGS+= -I${.CURDIR}/../../ofed/include/ CFLAGS+= -DCONFIG_INFINIBAND_USER_MEM CFLAGS+= -DINET6 -DINET -CFLAGS+= -fms-extensions .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith Modified: head/sys/modules/mlxen/Makefile ============================================================================== --- head/sys/modules/mlxen/Makefile Tue Feb 17 19:15:07 2015 (r278912) +++ head/sys/modules/mlxen/Makefile Tue Feb 17 19:27:14 2015 (r278913) @@ -8,8 +8,7 @@ SRCS += en_rx.c en_tx.c utils.c SRCS += opt_inet.h opt_inet6.h CFLAGS+= -I${.CURDIR}/../../ofed/drivers/net/mlx4 CFLAGS+= -I${.CURDIR}/../../ofed/include/ -CFLAGS+= -fms-extensions .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith Modified: head/sys/modules/mthca/Makefile ============================================================================== --- head/sys/modules/mthca/Makefile Tue Feb 17 19:15:07 2015 (r278912) +++ head/sys/modules/mthca/Makefile Tue Feb 17 19:27:14 2015 (r278913) @@ -14,4 +14,4 @@ CFLAGS+= -I${.CURDIR}/../../ofed/include .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith Modified: head/sys/ofed/drivers/net/mlx4/Makefile ============================================================================== --- head/sys/ofed/drivers/net/mlx4/Makefile Tue Feb 17 19:15:07 2015 (r278912) +++ head/sys/ofed/drivers/net/mlx4/Makefile Tue Feb 17 19:27:14 2015 (r278913) @@ -30,4 +30,4 @@ opt_inet6.h: .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 19:32:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4E431E4; Tue, 17 Feb 2015 19:32:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8606883A; Tue, 17 Feb 2015 19:32:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HJWCLP092412; Tue, 17 Feb 2015 19:32:12 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HJWCWk092408; Tue, 17 Feb 2015 19:32:12 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502171932.t1HJWCWk092408@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 Feb 2015 19:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278914 - in head/sys: kern 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 19:32:12 -0000 Author: glebius Date: Tue Feb 17 19:32:11 2015 New Revision: 278914 URL: https://svnweb.freebsd.org/changeset/base/278914 Log: Use anonymous unions to add possibility to put mbufs into queue(3) STAILQs and SLISTs using the same structure field as good old m_next and m_nextpkt linkage occupy. New code is encouraged to use queue(3) macros, instead of implementing the wheel. However, better not to have a mixture of old style and queue(3) in one file or subsystem. Reviewed by: rwatson, rrs, rpaulo Differential Revision: D1499 Modified: head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Tue Feb 17 19:27:14 2015 (r278913) +++ head/sys/kern/uipc_mbuf.c Tue Feb 17 19:32:11 2015 (r278914) @@ -120,6 +120,18 @@ CTASSERT(sizeof(struct struct_m_ext) == #endif /* + * Assert that the queue(3) macros produce code of the same size as an old + * plain pointer does. + */ +#ifdef INVARIANTS +static struct mbuf m_assertbuf; +CTASSERT(sizeof(m_assertbuf.m_slist) == sizeof(m_assertbuf.m_next)); +CTASSERT(sizeof(m_assertbuf.m_stailq) == sizeof(m_assertbuf.m_next)); +CTASSERT(sizeof(m_assertbuf.m_slistpkt) == sizeof(m_assertbuf.m_nextpkt)); +CTASSERT(sizeof(m_assertbuf.m_stailqpkt) == sizeof(m_assertbuf.m_nextpkt)); +#endif + +/* * m_get2() allocates minimum mbuf that would fit "size" argument. */ struct mbuf * Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Feb 17 19:27:14 2015 (r278913) +++ head/sys/sys/mbuf.h Tue Feb 17 19:32:11 2015 (r278914) @@ -184,8 +184,16 @@ struct mbuf { * Compile-time assertions in uipc_mbuf.c test these values to ensure * that they are correct. */ - struct mbuf *m_next; /* next buffer in chain */ - struct mbuf *m_nextpkt; /* next chain in queue/record */ + union { /* next buffer in chain */ + struct mbuf *m_next; + SLIST_ENTRY(mbuf) m_slist; + STAILQ_ENTRY(mbuf) m_stailq; + }; + union { /* next chain in queue/record */ + struct mbuf *m_nextpkt; + SLIST_ENTRY(mbuf) m_slistpkt; + STAILQ_ENTRY(mbuf) m_stailqpkt; + }; caddr_t m_data; /* location of data */ int32_t m_len; /* amount of data in this mbuf */ uint32_t m_type:8, /* type of data in this mbuf */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 19:38:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FEAF580; Tue, 17 Feb 2015 19:38:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4B8D0896; Tue, 17 Feb 2015 19:38:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HJcHFp093340; Tue, 17 Feb 2015 19:38:17 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HJcHQf093339; Tue, 17 Feb 2015 19:38:17 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201502171938.t1HJcHQf093339@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 17 Feb 2015 19:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278915 - head/sys/boot/fdt/dts/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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 19:38:17 -0000 Author: loos Date: Tue Feb 17 19:38:16 2015 New Revision: 278915 URL: https://svnweb.freebsd.org/changeset/base/278915 Log: Set the #address-cells and #size-cells properties on I2C controllers of Raspberry-pi. This fixes the issues of dtc(1) while compiling I2C addresses set in "reg" property. MFC after: 2 weeks Modified: head/sys/boot/fdt/dts/arm/bcm2835.dtsi Modified: head/sys/boot/fdt/dts/arm/bcm2835.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/bcm2835.dtsi Tue Feb 17 19:32:11 2015 (r278914) +++ head/sys/boot/fdt/dts/arm/bcm2835.dtsi Tue Feb 17 19:38:16 2015 (r278915) @@ -397,6 +397,8 @@ }; bsc0 { + #address-cells = <1>; + #size-cells = <0>; compatible = "broadcom,bcm2835-bsc", "broadcom,bcm2708-bsc"; reg = <0x205000 0x20>; @@ -405,6 +407,8 @@ }; bsc1 { + #address-cells = <1>; + #size-cells = <0>; compatible = "broadcom,bcm2835-bsc", "broadcom,bcm2708-bsc"; reg = <0x804000 0x20>; From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 20:08:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81E1722B; Tue, 17 Feb 2015 20:08:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 537C9C6E; Tue, 17 Feb 2015 20:08:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HK8fDQ007978; Tue, 17 Feb 2015 20:08:41 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HK8fP4007977; Tue, 17 Feb 2015 20:08:41 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201502172008.t1HK8fP4007977@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 17 Feb 2015 20:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278917 - head/sys/dev/iicbus 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 20:08:41 -0000 Author: loos Date: Tue Feb 17 20:08:40 2015 New Revision: 278917 URL: https://svnweb.freebsd.org/changeset/base/278917 Log: Fix the display of negative temperatures. Fix the setting of TOS (overtemperature shutdown) and THYST (hysteresis temperature). Modified: head/sys/dev/iicbus/lm75.c Modified: head/sys/dev/iicbus/lm75.c ============================================================================== --- head/sys/dev/iicbus/lm75.c Tue Feb 17 19:53:41 2015 (r278916) +++ head/sys/dev/iicbus/lm75.c Tue Feb 17 20:08:40 2015 (r278917) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); /* LM75 registers. */ #define LM75_TEMP 0x0 +#define LM75_TEMP_MASK 0xff80 +#define LM75A_TEMP_MASK 0xffe0 #define LM75_CONF 0x1 #define LM75_CONF_FSHIFT 3 #define LM75_CONF_FAULT 0x18 @@ -331,20 +333,24 @@ lm75_temp_read(struct lm75_softc *sc, ui { uint8_t buf8[2]; uint16_t buf; - int t; + int neg, t; if (lm75_read(sc->sc_dev, sc->sc_addr, reg, buf8, 2) < 0) return (-1); - - buf = (buf8[0] << 8) | (buf8[1] & 0xff); - + buf = (uint16_t)((buf8[0] << 8) | (buf8[1] & 0xff)); /* * LM75 has a 9 bit ADC with resolution of 0.5 C per bit. * LM75A has an 11 bit ADC with resolution of 0.125 C per bit. * Temperature is stored with two's complement. */ - if (buf & LM75_NEG_BIT) - buf = ~buf + 1; + neg = 0; + if (buf & LM75_NEG_BIT) { + if (sc->sc_hwtype == HWTYPE_LM75A) + buf = ~(buf & LM75A_TEMP_MASK) + 1; + else + buf = ~(buf & LM75_TEMP_MASK) + 1; + neg = 1; + } *temp = ((int16_t)buf >> 8) * 10; t = 0; if (sc->sc_hwtype == HWTYPE_LM75A) { @@ -357,7 +363,7 @@ lm75_temp_read(struct lm75_softc *sc, ui t += 500; t /= 100; *temp += t; - if (buf & LM75_NEG_BIT) + if (neg) *temp = -(*temp); *temp += TZ_ZEROC; @@ -370,6 +376,7 @@ lm75_temp_write(struct lm75_softc *sc, u uint8_t buf8[3]; uint16_t buf; + temp = (temp - TZ_ZEROC) / 10; if (temp > LM75_MAX_TEMP) temp = LM75_MAX_TEMP; if (temp < LM75_MIN_TEMP) From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 20:14:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAB9F3E2; Tue, 17 Feb 2015 20:14:15 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (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 79030D40; Tue, 17 Feb 2015 20:14:15 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 006101FE022; Tue, 17 Feb 2015 21:14:11 +0100 (CET) Message-ID: <54E3A145.7020502@selasky.org> Date: Tue, 17 Feb 2015 21:15:01 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278886 - in head/sys: conf contrib/rdma/krping dev/cxgb/ulp/iw_cxgb dev/cxgbe/iw_cxgbe modules/ibcore modules/mlx4ib ofed/drivers/infiniband/core ofed/drivers/infiniband/debug ofed/dri... References: <201502170840.t1H8eSwP076384@svn.freebsd.org> <20150217173423.GA8762@ox> In-Reply-To: <20150217173423.GA8762@ox> 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 20:14:15 -0000 Hi, On 02/17/15 18:34, Navdeep Parhar wrote: > On Tue, Feb 17, 2015 at 08:40:28AM +0000, Hans Petter Selasky wrote: >> Author: hselasky >> Date: Tue Feb 17 08:40:27 2015 >> New Revision: 278886 >> URL: https://svnweb.freebsd.org/changeset/base/278886 >> >> Log: >> Update the infiniband stack to Mellanox's OFED version 2.1. > > What version of the Linux kernel does this match? It is very close to the latest 3.xxx Linux kernel. > >> >> Highlights: >> - Multiple verbs API updates >> - Support for RoCE, RDMA over ethernet >> >> All hardware drivers depending on the common infiniband stack has been >> updated aswell. >> >> Discussed with: np @ >> Sponsored by: Mellanox Technologies >> MFC after: 1 month > > My reading of the project's MFC policy is that changes to the verbs > cannot be MFC'd as that's a KPI/API change. I agree, and if this will break binary compatibility and that is a requirement, I will not MFC. > > I still plan to test these changes with some iWARP gear later this week. > I thought you were going to wait till then, but, oh well. Thank you! --HPS From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 20:22:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C910261F; Tue, 17 Feb 2015 20:22:04 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 53AE6E19; Tue, 17 Feb 2015 20:22:03 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1HKLsNj064675 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 17 Feb 2015 23:21:54 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1HKLsZ5064674; Tue, 17 Feb 2015 23:21:54 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 17 Feb 2015 23:21:54 +0300 From: Gleb Smirnoff To: John-Mark Gurney Subject: Re: svn commit: r278831 - head/sys/netpfil/pf Message-ID: <20150217202154.GS15484@FreeBSD.org> References: <201502160338.t1G3cRlX042385@svn.freebsd.org> <20150217173134.GZ1953@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150217173134.GZ1953@funkthat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 17 Feb 2015 20:22:04 -0000 On Tue, Feb 17, 2015 at 09:31:34AM -0800, John-Mark Gurney wrote: J> Gleb Smirnoff wrote this message on Mon, Feb 16, 2015 at 03:38 +0000: J> > Author: glebius J> > Date: Mon Feb 16 03:38:27 2015 J> > New Revision: 278831 J> > URL: https://svnweb.freebsd.org/changeset/base/278831 J> > J> > Log: J> > Update the pf fragment handling code to closer match recent OpenBSD. J> > That partially fixes IPv6 fragment handling. Thanks to Kristof for J> > working on that. J> > J> > Submitted by: Kristof Provost J> > Tested by: peter J> > Differential Revision: D1765 J> J> Looks like pf_flush_fragments still called in !INET case, though only J> defined for INET case: J> /scratch/tmp/jmg/src.head/sys/modules/pf/../../netpfil/pf/pf_norm.c:385:3: error: implicit declaration of function 'pf_flush_fragments' is invalid in C99 [-Werror,-Wimplicit-function-declaration] J> pf_flush_fragments(); J> J> when compiling LINT-NOINET kernel.. J> J> at least as of r278883... J> J> We need to get Jenkins to be compiling the LINT-NOINET kernel too.. Strange, since r278874 was tested with KERNCONF="LINT LINT-NOINET LINT-NOINET6". I will take a look. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 20:29:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FD959F1; Tue, 17 Feb 2015 20:29:28 +0000 (UTC) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) (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 5060DE7B; Tue, 17 Feb 2015 20:29:27 +0000 (UTC) Received: by pdev10 with SMTP id v10so46082808pde.10; Tue, 17 Feb 2015 12:29:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=tgTMQQkwIqsMBDYGT4TX5+NM7BS4fqfgIK2HUXP23FM=; b=OduQIaeTn+LUJadQyttrYO0CVgiqniMYGrAPvQMdHg9wEMZFg23790ZAXiiHZ3oeUj iZ0Q2f0Fcf9WGjwRQBUSJt/jOv/hKjgYcYC0AaNY9k8NYbxBHXvLrdPbRZDLmurBjfjC yz3ds0wYgk5t+xPMyuOlv+W/V2f2DoQ7Zm+i5cPaQ9LRNxv7eHqiFHwlBt2XfLQPnUhX +jB8qDbecaJqXypw+i0ZMQRFpEGfvB7OIclhhL3n/GYFdqM/0aR/p3GfldHOKjsF3NLy LiG4A6LQIk/9shBKWJe6sq9rOcXwfF6fvudX7rnlqq4wy+O+dyPti5mgmzu6J4KEt5PI NjiQ== X-Received: by 10.70.92.68 with SMTP id ck4mr51897068pdb.3.1424204961100; Tue, 17 Feb 2015 12:29:21 -0800 (PST) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id hn4sm18502263pdb.58.2015.02.17.12.29.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Feb 2015 12:29:20 -0800 (PST) Sender: Navdeep Parhar Message-ID: <54E3A49D.5060208@FreeBSD.org> Date: Tue, 17 Feb 2015 12:29:17 -0800 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278886 - in head/sys: conf contrib/rdma/krping dev/cxgb/ulp/iw_cxgb dev/cxgbe/iw_cxgbe modules/ibcore modules/mlx4ib ofed/drivers/infiniband/core ofed/drivers/infiniband/debug ofed/dri... References: <201502170840.t1H8eSwP076384@svn.freebsd.org> <20150217173423.GA8762@ox> <54E3A145.7020502@selasky.org> In-Reply-To: <54E3A145.7020502@selasky.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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 20:29:28 -0000 On 02/17/15 12:15, Hans Petter Selasky wrote: > Hi, > > On 02/17/15 18:34, Navdeep Parhar wrote: >> On Tue, Feb 17, 2015 at 08:40:28AM +0000, Hans Petter Selasky wrote: >>> Author: hselasky >>> Date: Tue Feb 17 08:40:27 2015 >>> New Revision: 278886 >>> URL: https://svnweb.freebsd.org/changeset/base/278886 >>> >>> Log: >>> Update the infiniband stack to Mellanox's OFED version 2.1. >> >> What version of the Linux kernel does this match? > > It is very close to the latest 3.xxx Linux kernel. Let's please try and get an exact version the next time there's a big overhaul like this. It is important to be able to pinpoint the exact version of upstream that our stuff is supposed to be API/KPI compatible with. Regards, Navdeep >> >>> >>> Highlights: >>> - Multiple verbs API updates >>> - Support for RoCE, RDMA over ethernet >>> >>> All hardware drivers depending on the common infiniband stack has >>> been >>> updated aswell. >>> >>> Discussed with: np @ >>> Sponsored by: Mellanox Technologies >>> MFC after: 1 month >> >> My reading of the project's MFC policy is that changes to the verbs >> cannot be MFC'd as that's a KPI/API change. > > I agree, and if this will break binary compatibility and that is a > requirement, I will not MFC. > >> >> I still plan to test these changes with some iWARP gear later this week. >> I thought you were going to wait till then, but, oh well. > > Thank you! > > --HPS > > From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 20:29:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACD82B2B; Tue, 17 Feb 2015 20:29:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 982A1E81; Tue, 17 Feb 2015 20:29:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HKTh5l017437; Tue, 17 Feb 2015 20:29:43 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HKThAd017436; Tue, 17 Feb 2015 20:29:43 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201502172029.t1HKThAd017436@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 17 Feb 2015 20:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278918 - head/sys/dev/iicbus 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 20:29:43 -0000 Author: loos Date: Tue Feb 17 20:29:42 2015 New Revision: 278918 URL: https://svnweb.freebsd.org/changeset/base/278918 Log: Replace hardcoded sizes by sizeof() and nitems(). Set all the sysctls as CTLFLAG_MPSAFE. Modified: head/sys/dev/iicbus/lm75.c Modified: head/sys/dev/iicbus/lm75.c ============================================================================== --- head/sys/dev/iicbus/lm75.c Tue Feb 17 20:08:40 2015 (r278917) +++ head/sys/dev/iicbus/lm75.c Tue Feb 17 20:29:42 2015 (r278918) @@ -134,7 +134,7 @@ lm75_read(device_t dev, uint32_t addr, u { addr, IIC_M_RD, len, data }, }; - if (iicbus_transfer(dev, msg, 2) != 0) + if (iicbus_transfer(dev, msg, nitems(msg)) != 0) return (-1); return (0); @@ -147,7 +147,7 @@ lm75_write(device_t dev, uint32_t addr, { addr, IIC_M_WR, len, data }, }; - if (iicbus_transfer(dev, msg, 1) != 0) + if (iicbus_transfer(dev, msg, nitems(msg)) != 0) return (-1); return (0); @@ -228,7 +228,8 @@ lm75_type_detect(struct lm75_softc *sc) */ lm75a = 0; for (i = 4; i <= 6; i++) { - if (lm75_read(sc->sc_dev, sc->sc_addr, i, &buf8, 1) < 0) + if (lm75_read(sc->sc_dev, sc->sc_addr, i, + &buf8, sizeof(buf8)) < 0) return (-1); if (buf8 != LM75_TEST_PATTERN && buf8 != 0xff) return (-1); @@ -288,16 +289,16 @@ lm75_start(void *xdev) /* Configuration parameters. */ SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "faults", - CTLFLAG_RW | CTLTYPE_UINT, dev, 0, + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_MPSAFE, dev, 0, lm75_faults_sysctl, "IU", "LM75 fault queue"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "mode", - CTLFLAG_RW | CTLTYPE_STRING, dev, 0, + CTLFLAG_RW | CTLTYPE_STRING | CTLFLAG_MPSAFE, dev, 0, lm75_mode_sysctl, "A", "LM75 mode"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "polarity", - CTLFLAG_RW | CTLTYPE_STRING, dev, 0, + CTLFLAG_RW | CTLTYPE_STRING | CTLFLAG_MPSAFE, dev, 0, lm75_pol_sysctl, "A", "LM75 OS polarity"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "shutdown", - CTLFLAG_RW | CTLTYPE_UINT, dev, 0, + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_MPSAFE, dev, 0, lm75_shutdown_sysctl, "IU", "LM75 shutdown"); } @@ -306,9 +307,9 @@ lm75_conf_read(struct lm75_softc *sc) { uint8_t buf8; - if (lm75_read(sc->sc_dev, sc->sc_addr, LM75_CONF, &buf8, 1) < 0) + if (lm75_read(sc->sc_dev, sc->sc_addr, LM75_CONF, + &buf8, sizeof(buf8)) < 0) return (-1); - sc->sc_conf = (uint32_t)buf8; return (0); @@ -321,8 +322,7 @@ lm75_conf_write(struct lm75_softc *sc) buf8[0] = LM75_CONF; buf8[1] = (uint8_t)sc->sc_conf & LM75_CONF_MASK; - - if (lm75_write(sc->sc_dev, sc->sc_addr, buf8, 2) < 0) + if (lm75_write(sc->sc_dev, sc->sc_addr, buf8, sizeof(buf8)) < 0) return (-1); return (0); @@ -335,7 +335,7 @@ lm75_temp_read(struct lm75_softc *sc, ui uint16_t buf; int neg, t; - if (lm75_read(sc->sc_dev, sc->sc_addr, reg, buf8, 2) < 0) + if (lm75_read(sc->sc_dev, sc->sc_addr, reg, buf8, sizeof(buf8)) < 0) return (-1); buf = (uint16_t)((buf8[0] << 8) | (buf8[1] & 0xff)); /* @@ -388,8 +388,7 @@ lm75_temp_write(struct lm75_softc *sc, u buf8[0] = reg; buf8[1] = buf >> 8; buf8[2] = buf & 0xff; - - if (lm75_write(sc->sc_dev, sc->sc_addr, buf8, 3) < 0) + if (lm75_write(sc->sc_dev, sc->sc_addr, buf8, sizeof(buf8)) < 0) return (-1); return (0); From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 20:32:59 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E911DDE8; Tue, 17 Feb 2015 20:32:59 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A708CF47; Tue, 17 Feb 2015 20:32:59 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t1HKWvhc027727 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 Feb 2015 12:32:57 -0800 (PST) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t1HKWvCM027726; Tue, 17 Feb 2015 12:32:57 -0800 (PST) (envelope-from jmg) Date: Tue, 17 Feb 2015 12:32:57 -0800 From: John-Mark Gurney To: Gleb Smirnoff Subject: Re: svn commit: r278831 - head/sys/netpfil/pf Message-ID: <20150217203257.GH1953@funkthat.com> References: <201502160338.t1G3cRlX042385@svn.freebsd.org> <20150217173134.GZ1953@funkthat.com> <20150217202154.GS15484@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150217202154.GS15484@FreeBSD.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Tue, 17 Feb 2015 12:32:57 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 17 Feb 2015 20:33:00 -0000 Gleb Smirnoff wrote this message on Tue, Feb 17, 2015 at 23:21 +0300: > On Tue, Feb 17, 2015 at 09:31:34AM -0800, John-Mark Gurney wrote: > J> Gleb Smirnoff wrote this message on Mon, Feb 16, 2015 at 03:38 +0000: > J> > Author: glebius > J> > Date: Mon Feb 16 03:38:27 2015 > J> > New Revision: 278831 > J> > URL: https://svnweb.freebsd.org/changeset/base/278831 > J> > > J> > Log: > J> > Update the pf fragment handling code to closer match recent OpenBSD. > J> > That partially fixes IPv6 fragment handling. Thanks to Kristof for > J> > working on that. > J> > > J> > Submitted by: Kristof Provost > J> > Tested by: peter > J> > Differential Revision: D1765 > J> > J> Looks like pf_flush_fragments still called in !INET case, though only > J> defined for INET case: > J> /scratch/tmp/jmg/src.head/sys/modules/pf/../../netpfil/pf/pf_norm.c:385:3: error: implicit declaration of function 'pf_flush_fragments' is invalid in C99 [-Werror,-Wimplicit-function-declaration] > J> pf_flush_fragments(); > J> > J> when compiling LINT-NOINET kernel.. > J> > J> at least as of r278883... > J> > J> We need to get Jenkins to be compiling the LINT-NOINET kernel too.. > > Strange, since r278874 was tested with KERNCONF="LINT LINT-NOINET LINT-NOINET6". > > I will take a look. This is a result of a tinderbox build on ref10-amd64.freebsd.org... Look at /scratch/tmp/jmg/src.head/*NOINET -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 20:37:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1733CFDC; Tue, 17 Feb 2015 20:37:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 02699F70; Tue, 17 Feb 2015 20:37:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HKbLqP021932; Tue, 17 Feb 2015 20:37:21 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HKbLTE021931; Tue, 17 Feb 2015 20:37:21 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201502172037.t1HKbLTE021931@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 17 Feb 2015 20:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278919 - head/sys/arm/broadcom/bcm2835 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 20:37:22 -0000 Author: loos Date: Tue Feb 17 20:37:21 2015 New Revision: 278919 URL: https://svnweb.freebsd.org/changeset/base/278919 Log: Make use of the newly introduced macros. Update the copyright. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Tue Feb 17 20:29:42 2015 (r278918) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Tue Feb 17 20:37:21 2015 (r278919) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2012 Oleksandr Tymoshenko - * Copyright (c) 2012 Luiz Otavio O Souza. + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012-2015 Luiz Otavio O Souza * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -251,16 +251,14 @@ bcm_gpio_set_function(struct bcm_gpio_so static void bcm_gpio_set_pud(struct bcm_gpio_softc *sc, uint32_t pin, uint32_t state) { - uint32_t bank, offset; + uint32_t bank; /* Must be called with lock held. */ BCM_GPIO_LOCK_ASSERT(sc); - bank = pin / 32; - offset = pin - 32 * bank; - + bank = BCM_GPIO_BANK(pin); BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUD(0), state); - BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUDCLK(bank), (1 << offset)); + BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUDCLK(bank), BCM_GPIO_MASK(pin)); BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUD(0), 0); BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUDCLK(bank), 0); } @@ -438,29 +436,25 @@ static int bcm_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) { struct bcm_gpio_softc *sc = device_get_softc(dev); - uint32_t bank, offset; + uint32_t bank, reg; int i; for (i = 0; i < sc->sc_gpio_npins; i++) { if (sc->sc_gpio_pins[i].gp_pin == pin) break; } - if (i >= sc->sc_gpio_npins) return (EINVAL); - /* We never write to read-only/reserved pins. */ if (bcm_gpio_pin_is_ro(sc, pin)) return (EINVAL); - - bank = pin / 32; - offset = pin - 32 * bank; - BCM_GPIO_LOCK(sc); + bank = BCM_GPIO_BANK(pin); if (value) - BCM_GPIO_WRITE(sc, BCM_GPIO_GPSET(bank), (1 << offset)); + reg = BCM_GPIO_GPSET(bank); else - BCM_GPIO_WRITE(sc, BCM_GPIO_GPCLR(bank), (1 << offset)); + reg = BCM_GPIO_GPCLR(bank); + BCM_GPIO_WRITE(sc, reg, BCM_GPIO_MASK(pin)); BCM_GPIO_UNLOCK(sc); return (0); @@ -470,24 +464,20 @@ static int bcm_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) { struct bcm_gpio_softc *sc = device_get_softc(dev); - uint32_t bank, offset, reg_data; + uint32_t bank, reg_data; int i; for (i = 0; i < sc->sc_gpio_npins; i++) { if (sc->sc_gpio_pins[i].gp_pin == pin) break; } - if (i >= sc->sc_gpio_npins) return (EINVAL); - - bank = pin / 32; - offset = pin - 32 * bank; - + bank = BCM_GPIO_BANK(pin); BCM_GPIO_LOCK(sc); reg_data = BCM_GPIO_READ(sc, BCM_GPIO_GPLEV(bank)); BCM_GPIO_UNLOCK(sc); - *val = (reg_data & (1 << offset)) ? 1 : 0; + *val = (reg_data & BCM_GPIO_MASK(pin)) ? 1 : 0; return (0); } @@ -496,30 +486,26 @@ static int bcm_gpio_pin_toggle(device_t dev, uint32_t pin) { struct bcm_gpio_softc *sc = device_get_softc(dev); - uint32_t bank, data, offset; + uint32_t bank, data, reg; int i; for (i = 0; i < sc->sc_gpio_npins; i++) { if (sc->sc_gpio_pins[i].gp_pin == pin) break; } - if (i >= sc->sc_gpio_npins) return (EINVAL); - /* We never write to read-only/reserved pins. */ if (bcm_gpio_pin_is_ro(sc, pin)) return (EINVAL); - - bank = pin / 32; - offset = pin - 32 * bank; - BCM_GPIO_LOCK(sc); + bank = BCM_GPIO_BANK(pin); data = BCM_GPIO_READ(sc, BCM_GPIO_GPLEV(bank)); - if (data & (1 << offset)) - BCM_GPIO_WRITE(sc, BCM_GPIO_GPCLR(bank), (1 << offset)); + if (data & BCM_GPIO_MASK(pin)) + reg = BCM_GPIO_GPCLR(bank); else - BCM_GPIO_WRITE(sc, BCM_GPIO_GPSET(bank), (1 << offset)); + reg = BCM_GPIO_GPSET(bank); + BCM_GPIO_WRITE(sc, reg, BCM_GPIO_MASK(pin)); BCM_GPIO_UNLOCK(sc); return (0); From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 20:52:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C203D45F; Tue, 17 Feb 2015 20:52:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 938AE189; Tue, 17 Feb 2015 20:52:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HKqqdH030925; Tue, 17 Feb 2015 20:52:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HKqqsq030923; Tue, 17 Feb 2015 20:52:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502172052.t1HKqqsq030923@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 Feb 2015 20:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278920 - in head/sys: kern 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 20:52:52 -0000 Author: glebius Date: Tue Feb 17 20:52:51 2015 New Revision: 278920 URL: https://svnweb.freebsd.org/changeset/base/278920 Log: Use anonymous unions and structs to organize shared space in mbuf(9), instead of preprocessor macros. This will make debugger output of 'print *m' exactly match the names we use in code, making life of a kernel hacker way more pleasant. And this also allows to rename struct_m_ext back to m_ext. Modified: head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Tue Feb 17 20:37:21 2015 (r278919) +++ head/sys/kern/uipc_mbuf.c Tue Feb 17 20:52:51 2015 (r278920) @@ -112,11 +112,11 @@ CTASSERT(offsetof(struct mbuf, m_pktdat) #if defined(__LP64__) CTASSERT(offsetof(struct mbuf, m_dat) == 32); CTASSERT(sizeof(struct pkthdr) == 56); -CTASSERT(sizeof(struct struct_m_ext) == 48); +CTASSERT(sizeof(struct m_ext) == 48); #else CTASSERT(offsetof(struct mbuf, m_dat) == 24); CTASSERT(sizeof(struct pkthdr) == 48); -CTASSERT(sizeof(struct struct_m_ext) == 28); +CTASSERT(sizeof(struct m_ext) == 28); #endif /* Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Feb 17 20:37:21 2015 (r278919) +++ head/sys/sys/mbuf.h Tue Feb 17 20:52:51 2015 (r278920) @@ -65,8 +65,8 @@ * they are sensible. */ struct mbuf; -#define MHSIZE offsetof(struct mbuf, M_dat.M_databuf) -#define MPKTHSIZE offsetof(struct mbuf, M_dat.MH.MH_dat.MH_databuf) +#define MHSIZE offsetof(struct mbuf, m_dat) +#define MPKTHSIZE offsetof(struct mbuf, m_pktdat) #define MLEN ((int)(MSIZE - MHSIZE)) #define MHLEN ((int)(MSIZE - MPKTHSIZE)) #define MINCLSIZE (MHLEN + 1) @@ -160,7 +160,7 @@ struct pkthdr { * Compile-time assertions in uipc_mbuf.c test these values to ensure that * they are correct. */ -struct struct_m_ext { +struct m_ext { volatile u_int *ext_cnt; /* pointer to ref count info */ caddr_t ext_buf; /* start of buffer */ uint32_t ext_size; /* size of buffer, for ext_free */ @@ -211,19 +211,15 @@ struct mbuf { */ union { struct { - struct pkthdr MH_pkthdr; /* M_PKTHDR set */ + struct pkthdr m_pkthdr; /* M_PKTHDR set */ union { - struct struct_m_ext MH_ext; /* M_EXT set */ - char MH_databuf[0]; - } MH_dat; - } MH; - char M_databuf[0]; /* !M_PKTHDR, !M_EXT */ - } M_dat; + struct m_ext m_ext; /* M_EXT set */ + char m_pktdat[0]; + }; + }; + char m_dat[0]; /* !M_PKTHDR, !M_EXT */ + }; }; -#define m_pkthdr M_dat.MH.MH_pkthdr -#define m_ext M_dat.MH.MH_dat.MH_ext -#define m_pktdat M_dat.MH.MH_dat.MH_databuf -#define m_dat M_dat.M_databuf /* * mbuf flags of global significance and layer crossing. From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 21:12:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DDEFC3E; Tue, 17 Feb 2015 21:12:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 89C4F3E4; Tue, 17 Feb 2015 21:12:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HLCkum041026; Tue, 17 Feb 2015 21:12:46 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HLCk4p041025; Tue, 17 Feb 2015 21:12:46 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502172112.t1HLCk4p041025@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 17 Feb 2015 21:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278921 - head/usr.bin/du 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 21:12:46 -0000 Author: pfg Date: Tue Feb 17 21:12:45 2015 New Revision: 278921 URL: https://svnweb.freebsd.org/changeset/base/278921 Log: du(1): replace malloc + memset with calloc. Modified: head/usr.bin/du/du.c Modified: head/usr.bin/du/du.c ============================================================================== --- head/usr.bin/du/du.c Tue Feb 17 20:52:51 2015 (r278920) +++ head/usr.bin/du/du.c Tue Feb 17 21:12:45 2015 (r278921) @@ -376,7 +376,7 @@ linkchk(FTSENT *p) /* If the hash table is getting too full, enlarge it. */ if (number_entries > number_buckets * 10 && !stop_allocating) { new_size = number_buckets * 2; - new_buckets = malloc(new_size * sizeof(struct links_entry *)); + new_buckets = calloc(new_size, sizeof(struct links_entry *)); /* Try releasing the free list to see if that helps. */ if (new_buckets == NULL && free_list != NULL) { @@ -385,16 +385,13 @@ linkchk(FTSENT *p) free_list = le->next; free(le); } - new_buckets = malloc(new_size * - sizeof(new_buckets[0])); + new_buckets = calloc(new_size, sizeof(new_buckets[0])); } if (new_buckets == NULL) { stop_allocating = 1; warnx("No more memory for tracking hard links"); } else { - memset(new_buckets, 0, - new_size * sizeof(struct links_entry *)); for (i = 0; i < number_buckets; i++) { while (buckets[i] != NULL) { /* Remove entry from old bucket. */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 21:18:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 780B5F8B; Tue, 17 Feb 2015 21:18:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 640F55F7; Tue, 17 Feb 2015 21:18:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HLIIWD041817; Tue, 17 Feb 2015 21:18:18 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HLIIRj041816; Tue, 17 Feb 2015 21:18:18 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201502172118.t1HLIIRj041816@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Tue, 17 Feb 2015 21:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278922 - 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 21:18:18 -0000 Author: jmg Date: Tue Feb 17 21:18:17 2015 New Revision: 278922 URL: https://svnweb.freebsd.org/changeset/base/278922 Log: note that you should update your kernel due to RNG issue, and what versions you should upgrade... Suggested by: Ryan Stone Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Feb 17 21:12:45 2015 (r278921) +++ head/UPDATING Tue Feb 17 21:18:17 2015 (r278922) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20150217: + If you are running a -CURRENT kernel since r273872 (Oct 30th, 2014), + but before r278907, the RNG was not seeded properly. Immediately + upgrade the kernel to r278907 or later and regenerate any keys (e.g. + ssh keys or openssl keys) that were generated w/ a kernel from that + range. This does not effect programs that directly used /dev/random + or /dev/urandom. All userland uses of arc4random(3) are effected. + 20150210: The autofs(4) ABI was changed in order to restore binary compatibility with 10.1-RELEASE. The automountd(8) daemon needs to be rebuilt to work From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 21:40:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05996697; Tue, 17 Feb 2015 21:40:44 +0000 (UTC) Received: from mail-we0-f176.google.com (mail-we0-f176.google.com [74.125.82.176]) (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 9399292D; Tue, 17 Feb 2015 21:40:43 +0000 (UTC) Received: by wesw62 with SMTP id w62so1032824wes.9; Tue, 17 Feb 2015 13:40: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:date:message-id:subject :from:to:cc:content-type; bh=ZTmsB5Ks8FAimeDYIPnp74Z1Eus77DT7oivXcsJm/Ek=; b=kcW/Epgu1PmdbUcV+Xv/fscYUcW4qebqN/z6HDkN1Jl2qo1rX6Ruks8VDC+p29ptii 7H0eSkyHu3Dw6fAFr1Iw88m9Ad4LzoCTh9zzAqFF5kHyRwrK94BLsOxTNnJeCHaQNyLs ECGmir6Z5kZoEySl3AI5sXg8O9xZxpGwh3AjpDdn6FXVJoEWLZ8kKxrnPY90DyPOyfxS Mp1eIk50vZF+GZLOajizyE3tgLLeWNOodWMSrzkxuEb09ccojaT3WXgrVpMQ/pY2UXw9 vxJsPKLECutUb0bCDVrbNlJUbrHlBKOa3GGPGlkD+ekxRGyBf9TRcOaWFN3uhQWeyQkI IvTA== MIME-Version: 1.0 X-Received: by 10.180.76.45 with SMTP id h13mr50037921wiw.51.1424209236437; Tue, 17 Feb 2015 13:40:36 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.27.84.206 with HTTP; Tue, 17 Feb 2015 13:40:36 -0800 (PST) In-Reply-To: <20150217173134.GZ1953@funkthat.com> References: <201502160338.t1G3cRlX042385@svn.freebsd.org> <20150217173134.GZ1953@funkthat.com> Date: Wed, 18 Feb 2015 01:40:36 +0400 X-Google-Sender-Auth: Lxx7oFzDdsK_0Tb35ydqTKdNTNo Message-ID: Subject: Re: svn commit: r278831 - head/sys/netpfil/pf From: Sergey Kandaurov To: John-Mark Gurney Content-Type: multipart/mixed; boundary=f46d043be09ea031b5050f4f8d81 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 17 Feb 2015 21:40:44 -0000 --f46d043be09ea031b5050f4f8d81 Content-Type: text/plain; charset=ISO-8859-1 On 17 February 2015 at 20:31, John-Mark Gurney wrote: > Gleb Smirnoff wrote this message on Mon, Feb 16, 2015 at 03:38 +0000: >> Author: glebius >> Date: Mon Feb 16 03:38:27 2015 >> New Revision: 278831 >> URL: https://svnweb.freebsd.org/changeset/base/278831 >> >> Log: >> Update the pf fragment handling code to closer match recent OpenBSD. >> That partially fixes IPv6 fragment handling. Thanks to Kristof for >> working on that. >> >> Submitted by: Kristof Provost >> Tested by: peter >> Differential Revision: D1765 > > Looks like pf_flush_fragments still called in !INET case, though only > defined for INET case: > /scratch/tmp/jmg/src.head/sys/modules/pf/../../netpfil/pf/pf_norm.c:385:3: error: implicit declaration of function 'pf_flush_fragments' is invalid in C99 [-Werror,-Wimplicit-function-declaration] > pf_flush_fragments(); > > when compiling LINT-NOINET kernel.. With the changes attached I got all three kernels with both cc compiled (tested on MINI w/ MODULES_OVERRIDE=pf). Basically, - pf_flush_fragments is improperly INET-only - pf_find_fragment is properly declared, but its body is under INET - pf_refragment6 / pf_reassemble6 are properly under INET6, which is also under INET (the latter is wrong). - bonus: some functions may be / were static'ized. -- wbr, pluknet --f46d043be09ea031b5050f4f8d81 Content-Type: text/plain; charset=US-ASCII; name="pf.diff" Content-Disposition: attachment; filename="pf.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i69tcyhf0 SW5kZXg6IHN5cy9uZXRwZmlsL3BmL3BmX25vcm0uYwo9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzeXMvbmV0cGZp bC9wZi9wZl9ub3JtLmMJKHJldmlzaW9uIDI3ODkxNykKKysrIHN5cy9uZXRwZmlsL3BmL3BmX25v cm0uYwkod29ya2luZyBjb3B5KQpAQCAtMTM4LDE3ICsxMzgsMTcgQEAgc3RhdGljIHZvaWQJcGZf ZnJlZV9mcmFnbWVudChzdHJ1Y3QgcGZfZnJhZ21lbnQgKikKIHN0YXRpYyB2b2lkCXBmX3JlbW92 ZV9mcmFnbWVudChzdHJ1Y3QgcGZfZnJhZ21lbnQgKik7CiBzdGF0aWMgaW50CXBmX25vcm1hbGl6 ZV90Y3BvcHQoc3RydWN0IHBmX3J1bGUgKiwgc3RydWN0IG1idWYgKiwKIAkJICAgIHN0cnVjdCB0 Y3BoZHIgKiwgaW50LCBzYV9mYW1pbHlfdCk7Ci1zdHJ1Y3QgcGZfZnJlbnQJKnBmX2NyZWF0ZV9m cmFnbWVudCh1X3Nob3J0ICopOworc3RhdGljIHN0cnVjdCBwZl9mcmVudAkqcGZfY3JlYXRlX2Zy YWdtZW50KHVfc2hvcnQgKik7CiBzdGF0aWMgc3RydWN0IHBmX2ZyYWdtZW50ICoKIAkJcGZfZmlu ZF9mcmFnbWVudChzdHJ1Y3QgcGZfZnJhZ21lbnRfY21wICprZXksCiAJCSAgICBzdHJ1Y3QgcGZf ZnJhZ190cmVlICp0cmVlKTsKIHN0YXRpYyBzdHJ1Y3QgcGZfZnJhZ21lbnQgKgogCQlwZl9maWxs dXBfZnJhZ21lbnQoc3RydWN0IHBmX2ZyYWdtZW50X2NtcCAqLCBzdHJ1Y3QgcGZfZnJlbnQgKiwJ CQkgICAgdV9zaG9ydCAqKTsKIHN0YXRpYyBpbnQJcGZfaXNmdWxsX2ZyYWdtZW50KHN0cnVjdCBw Zl9mcmFnbWVudCAqKTsKLXN0cnVjdCBtYnVmCSpwZl9qb2luX2ZyYWdtZW50KHN0cnVjdCBwZl9m cmFnbWVudCAqKTsKK3N0YXRpYyBzdHJ1Y3QgbWJ1ZgkqcGZfam9pbl9mcmFnbWVudChzdHJ1Y3Qg cGZfZnJhZ21lbnQgKik7CitzdGF0aWMgdm9pZAlwZl9mbHVzaF9mcmFnbWVudHModm9pZCk7CiAj aWZkZWYgSU5FVAogc3RhdGljIHZvaWQJcGZfc2NydWJfaXAoc3RydWN0IG1idWYgKiosIHVpbnQz Ml90LCB1aW50OF90LCB1aW50OF90KTsKLXN0YXRpYyB2b2lkCXBmX2ZsdXNoX2ZyYWdtZW50cyh2 b2lkKTsKIHN0YXRpYyBpbnQJcGZfcmVhc3NlbWJsZShzdHJ1Y3QgbWJ1ZiAqKiwgc3RydWN0IGlw ICosIGludCwgdV9zaG9ydCAqKTsKIHN0YXRpYyBzdHJ1Y3QgbWJ1ZiAqCiAJCXBmX2ZyYWdjYWNo ZShzdHJ1Y3QgbWJ1ZiAqKiwgc3RydWN0IGlwKiwgc3RydWN0IHBmX2ZyYWdtZW50ICoqLApAQCAt MjY3LDcgKzI2Nyw2IEBAIHBmX3B1cmdlX2V4cGlyZWRfZnJhZ21lbnRzKHZvaWQpCiAJUEZfRlJB R19VTkxPQ0soKTsKIH0KIAotI2lmZGVmIElORVQKIC8qCiAgKiBUcnkgdG8gZmx1c2ggb2xkIGZy YWdtZW50cyB0byBtYWtlIHNwYWNlIGZvciBuZXcgb25lcwogICovCkBAIC0yOTIsNyArMjkxLDYg QEAgcGZfZmx1c2hfZnJhZ21lbnRzKHZvaWQpCiAJCQlicmVhazsKIAl9CiB9Ci0jZW5kaWYgLyog SU5FVCAqLwogCiAvKiBGcmVlcyB0aGUgZnJhZ21lbnRzIGFuZCBhbGwgYXNzb2NpYXRlZCBlbnRy aWVzICovCiBzdGF0aWMgdm9pZApAQCAtMzI5LDcgKzMyNyw2IEBAIHBmX2ZyZWVfZnJhZ21lbnQo c3RydWN0IHBmX2ZyYWdtZW50ICpmcmFnKQogCXBmX3JlbW92ZV9mcmFnbWVudChmcmFnKTsKIH0K IAotI2lmZGVmIElORVQKIHN0YXRpYyBzdHJ1Y3QgcGZfZnJhZ21lbnQgKgogcGZfZmluZF9mcmFn bWVudChzdHJ1Y3QgcGZfZnJhZ21lbnRfY21wICprZXksIHN0cnVjdCBwZl9mcmFnX3RyZWUgKnRy ZWUpCiB7CkBAIC0zNTIsMTAgKzM0OSw4IEBAIHBmX2ZpbmRfZnJhZ21lbnQoc3RydWN0IHBmX2Zy YWdtZW50X2NtcCAqa2V5LCBzdHJ1CiAKIAlyZXR1cm4gKGZyYWcpOwogfQotI2VuZGlmIC8qIElO RVQgKi8KIAogLyogUmVtb3ZlcyBhIGZyYWdtZW50IGZyb20gdGhlIGZyYWdtZW50IHF1ZXVlIGFu ZCBmcmVlcyB0aGUgZnJhZ21lbnQgKi8KLQogc3RhdGljIHZvaWQKIHBmX3JlbW92ZV9mcmFnbWVu dChzdHJ1Y3QgcGZfZnJhZ21lbnQgKmZyYWcpCiB7CkBAIC0zNzMsNyArMzY4LDcgQEAgcGZfcmVt b3ZlX2ZyYWdtZW50KHN0cnVjdCBwZl9mcmFnbWVudCAqZnJhZykKIAl9CiB9CiAKLXN0cnVjdCBw Zl9mcmVudCAqCitzdGF0aWMgc3RydWN0IHBmX2ZyZW50ICoKIHBmX2NyZWF0ZV9mcmFnbWVudCh1 X3Nob3J0ICpyZWFzb24pCiB7CiAJc3RydWN0IHBmX2ZyZW50ICpmcmVudDsKQEAgLTM5Myw3ICsz ODgsNyBAQCBwZl9jcmVhdGVfZnJhZ21lbnQodV9zaG9ydCAqcmVhc29uKQogCXJldHVybiAoZnJl bnQpOwogfQogCi1zdHJ1Y3QgcGZfZnJhZ21lbnQgKgorc3RhdGljIHN0cnVjdCBwZl9mcmFnbWVu dCAqCiBwZl9maWxsdXBfZnJhZ21lbnQoc3RydWN0IHBmX2ZyYWdtZW50X2NtcCAqa2V5LCBzdHJ1 Y3QgcGZfZnJlbnQgKmZyZW50LAogCQl1X3Nob3J0ICpyZWFzb24pCiB7CkBAIC01NzAsNyArNTY1 LDcgQEAgcGZfaXNmdWxsX2ZyYWdtZW50KHN0cnVjdCBwZl9mcmFnbWVudCAqZnJhZykKIAlyZXR1 cm4gKDEpOwogfQogCi1zdHJ1Y3QgbWJ1ZiAqCitzdGF0aWMgc3RydWN0IG1idWYgKgogcGZfam9p bl9mcmFnbWVudChzdHJ1Y3QgcGZfZnJhZ21lbnQgKmZyYWcpCiB7CiAJc3RydWN0IG1idWYgKm0s ICptMjsKQEAgLTY2Niw2ICs2NjEsNyBAQCBwZl9yZWFzc2VtYmxlKHN0cnVjdCBtYnVmICoqbTAs IHN0cnVjdCBpcCAqaXAsIGludAogCURQRlBSSU5URigoImNvbXBsZXRlOiAlcCglZClcbiIsIG0s IG50b2hzKGlwLT5pcF9sZW4pKSk7CiAJcmV0dXJuIChQRl9QQVNTKTsKIH0KKyNlbmRpZgkvKiBJ TkVUICovCiAKICNpZmRlZiBJTkVUNgogc3RhdGljIGludApAQCAtNzg5LDYgKzc4NSw3IEBAIGZh aWw6CiB9CiAjZW5kaWYJLyogSU5FVDYgKi8KIAorI2lmZGVmIElORVQKIHN0YXRpYyBzdHJ1Y3Qg bWJ1ZiAqCiBwZl9mcmFnY2FjaGUoc3RydWN0IG1idWYgKiptMCwgc3RydWN0IGlwICpoLCBzdHJ1 Y3QgcGZfZnJhZ21lbnQgKipmcmFnLCBpbnQgbWZmLAogICAgIGludCBkcm9wLCBpbnQgKm5vbWVt KQpAQCAtMTA5MCw2ICsxMDg3LDcgQEAgcGZfZnJhZ2NhY2hlKHN0cnVjdCBtYnVmICoqbTAsIHN0 cnVjdCBpcCAqaCwgc3RydWMKIAltX2ZyZWVtKG0pOwogCXJldHVybiAoTlVMTCk7CiB9CisjZW5k aWYJLyogSU5FVCAqLwogCiAjaWZkZWYgSU5FVDYKIGludApAQCAtMTE2Miw2ICsxMTYwLDcgQEAg cGZfcmVmcmFnbWVudDYoc3RydWN0IGlmbmV0ICppZnAsIHN0cnVjdCBtYnVmICoqbTAKIH0KICNl bmRpZiAvKiBJTkVUNiAqLwogCisjaWZkZWYgSU5FVAogaW50CiBwZl9ub3JtYWxpemVfaXAoc3Ry dWN0IG1idWYgKiptMCwgaW50IGRpciwgc3RydWN0IHBmaV9raWYgKmtpZiwgdV9zaG9ydCAqcmVh c29uLAogICAgIHN0cnVjdCBwZl9wZGVzYyAqcGQpCg== --f46d043be09ea031b5050f4f8d81-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 21:50:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB385A2B; Tue, 17 Feb 2015 21:50:55 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 498909F9; Tue, 17 Feb 2015 21:50:54 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1HLoqY3065165 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 18 Feb 2015 00:50:52 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1HLoqNE065164; Wed, 18 Feb 2015 00:50:52 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 18 Feb 2015 00:50:52 +0300 From: Gleb Smirnoff To: Sergey Kandaurov Subject: Re: svn commit: r278831 - head/sys/netpfil/pf Message-ID: <20150217215052.GT15484@FreeBSD.org> References: <201502160338.t1G3cRlX042385@svn.freebsd.org> <20150217173134.GZ1953@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 17 Feb 2015 21:50:56 -0000 On Wed, Feb 18, 2015 at 01:40:36AM +0400, Sergey Kandaurov wrote: S> On 17 February 2015 at 20:31, John-Mark Gurney wrote: S> > Gleb Smirnoff wrote this message on Mon, Feb 16, 2015 at 03:38 +0000: S> >> Author: glebius S> >> Date: Mon Feb 16 03:38:27 2015 S> >> New Revision: 278831 S> >> URL: https://svnweb.freebsd.org/changeset/base/278831 S> >> S> >> Log: S> >> Update the pf fragment handling code to closer match recent OpenBSD. S> >> That partially fixes IPv6 fragment handling. Thanks to Kristof for S> >> working on that. S> >> S> >> Submitted by: Kristof Provost S> >> Tested by: peter S> >> Differential Revision: D1765 S> > S> > Looks like pf_flush_fragments still called in !INET case, though only S> > defined for INET case: S> > /scratch/tmp/jmg/src.head/sys/modules/pf/../../netpfil/pf/pf_norm.c:385:3: error: implicit declaration of function 'pf_flush_fragments' is invalid in C99 [-Werror,-Wimplicit-function-declaration] S> > pf_flush_fragments(); S> > S> > when compiling LINT-NOINET kernel.. S> S> With the changes attached I got all three kernels with both cc compiled S> (tested on MINI w/ MODULES_OVERRIDE=pf). Basically, S> - pf_flush_fragments is improperly INET-only S> - pf_find_fragment is properly declared, but its body is under INET S> - pf_refragment6 / pf_reassemble6 are properly under INET6, S> which is also under INET (the latter is wrong). S> - bonus: some functions may be / were static'ized. Thanks, looks very close to patch that I'm build testing now. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 21:59:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B838D9F; Tue, 17 Feb 2015 21:59:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 76928AF9; Tue, 17 Feb 2015 21:59:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HLxGnE060805; Tue, 17 Feb 2015 21:59:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HLxGId060804; Tue, 17 Feb 2015 21:59:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201502172159.t1HLxGId060804@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 17 Feb 2015 21:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278924 - head/sys/ofed/include/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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 21:59:16 -0000 Author: hselasky Date: Tue Feb 17 21:59:15 2015 New Revision: 278924 URL: https://svnweb.freebsd.org/changeset/base/278924 Log: Fix compilation of LINT-NOINET kernel target after r278886. Sponsored by: Mellanox Technologies MFC after: 1 month Modified: head/sys/ofed/include/net/ip.h Modified: head/sys/ofed/include/net/ip.h ============================================================================== --- head/sys/ofed/include/net/ip.h Tue Feb 17 21:39:22 2015 (r278923) +++ head/sys/ofed/include/net/ip.h Tue Feb 17 21:59:15 2015 (r278924) @@ -42,13 +42,17 @@ #include #include -#ifdef INET static inline void inet_get_local_port_range(int *low, int *high) { +#ifdef INET CURVNET_SET_QUIET(TD_TO_VNET(curthread)); *low = V_ipport_firstauto; *high = V_ipport_lastauto; CURVNET_RESTORE(); +#else + *low = IPPORT_EPHEMERALFIRST; /* 10000 */ + *high = IPPORT_EPHEMERALLAST; /* 65535 */ +#endif } static inline void @@ -79,6 +83,5 @@ ip_ib_mc_map(uint32_t addr, const unsign buf[18] = (addr >> 8) & 0xff; buf[19] = addr & 0xff; } -#endif #endif /* _LINUX_NET_IP_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 22:26:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6B38651; Tue, 17 Feb 2015 22:26:02 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 67105E1E; Tue, 17 Feb 2015 22:26:01 +0000 (UTC) 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 02039781CC7; Wed, 18 Feb 2015 09:25:39 +1100 (AEDT) Date: Wed, 18 Feb 2015 09:25:38 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff Subject: Re: svn commit: r278913 - in head/sys: conf modules/cxgbe/if_cxgbe modules/drm2/radeonkms modules/ibcore modules/ipoib modules/mlx4 modules/mlx4ib modules/mlxen modules/mthca ofed/drivers/net/mlx4 In-Reply-To: <201502171927.t1HJRFVV088172@svn.freebsd.org> Message-ID: <20150218081602.C3182@besplex.bde.org> References: <201502171927.t1HJRFVV088172@svn.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=Za4kaKlA c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=09v5NAvb8IAPeZwDaCMA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 17 Feb 2015 22:26:02 -0000 On Tue, 17 Feb 2015, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Feb 17 19:27:14 2015 > New Revision: 278913 > URL: https://svnweb.freebsd.org/changeset/base/278913 > > Log: > Globally enable -fms-extensions when building kernel with gcc, and remove > this option from all modules that enable it theirselves. > In C mode -fms-extensions option enables anonymous structs and unions, > allowing us to use this C11 feature in kernel. Of course, clang supports > it without any extra options. Anonymous unions have been a standard gcc extension for more than 20 years. It shouldn't take a ms extensions flag to get them, except possibly for C++. Indeed, the bugs are mostly in extra options that are already present. Of course, clang handles these options incorrectly: - the default CFLAGS for kernels include the foot-shooting flag -std=c99. The feature isn't in C99, so this should make the feature unavailable in kernels. This works for gcc-4.2, but not for clang or gcc-4.8. It takes -pedantic as well as -std=c99 to kill the feature for these compilers. - the default CFLAGS for userland include -std=gnu99. This of course doesn't kill 20+ year old gcc extensions, so userland doesn't have the problem. I recently noticed several other bugs involving -std: - -std sets __STDC_VERSION__, but sys/cdefs.h mostly ignores that. It sets __ISO_C_VISIBLE based mainly on _POSIX_C_SOURCE, so __ISO_C_VISIBLE defaults to 2011 and is thus inconsistent with __STDC_VERSION__ in all cases where -std=c11 is not used -- that is, in almost all cases since everything defaults to -std=c99 or -std-gnu99 which give __STDC_VERSION__ = 199901L. Compiling with an old makefile or script that doesn't use -std gives larger inconsistencies -- it gives C90 for gcc but C99 for clang. gcc-4.8 remains compatible with gcc-4.2 (and gcc-1?) here. - most FreeBSD header files use __ISO_C_VISIBLE and not __STDC_VERSION__, so they give C11 symbols by default. They are supposed to give maximal symbols by default, but this is wrong if the symbols are related to language features that are turned off by -std. - gcc-4.8 uses some private header files. It doesn't use FreeBSD's __ISO_C_VISBLE of course, so it gives inconsistent symbols. - lib/msun used to depend on __ISO_C_VISIBLE being wrong when it was compiled with defaults. Now it depends on -std=*99 being in the defaults. Both conditions are satisifed when the system headers are used. But when gcc's float.h is used and -std is either not used or is *89, then the compile breaks. - gcc's private header for float.h also has incompatibilities unrelated to -std. These break lib/msun more seriously on i386. - -std=c99 in gcc-4.8 gives large pessimizations in floating point code on i386. -std=gnu99 gives compatible FP code (not perfectly pessimized to Standards spec). clang is just missing support for Standards here. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 22:33:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC396901; Tue, 17 Feb 2015 22:33:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C7191EED; Tue, 17 Feb 2015 22:33:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HMXNU1081109; Tue, 17 Feb 2015 22:33:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HMXNru081108; Tue, 17 Feb 2015 22:33:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502172233.t1HMXNru081108@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 Feb 2015 22:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278925 - 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 22:33:24 -0000 Author: glebius Date: Tue Feb 17 22:33:22 2015 New Revision: 278925 URL: https://svnweb.freebsd.org/changeset/base/278925 Log: Even more fixes to !INET and !INET6 kernels. In collaboration with: pluknet Modified: head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Tue Feb 17 21:59:15 2015 (r278924) +++ head/sys/netpfil/pf/pf_norm.c Tue Feb 17 22:33:22 2015 (r278925) @@ -134,25 +134,23 @@ static int pf_frag_compare(struct pf_f static RB_PROTOTYPE(pf_frag_tree, pf_fragment, fr_entry, pf_frag_compare); static RB_GENERATE(pf_frag_tree, pf_fragment, fr_entry, pf_frag_compare); +static void pf_flush_fragments(void); static void pf_free_fragment(struct pf_fragment *); static void pf_remove_fragment(struct pf_fragment *); static int pf_normalize_tcpopt(struct pf_rule *, struct mbuf *, struct tcphdr *, int, sa_family_t); -struct pf_frent *pf_create_fragment(u_short *); -static struct pf_fragment * - pf_find_fragment(struct pf_fragment_cmp *key, +static struct pf_frent *pf_create_fragment(u_short *); +static struct pf_fragment *pf_find_fragment(struct pf_fragment_cmp *key, struct pf_frag_tree *tree); -static struct pf_fragment * - pf_fillup_fragment(struct pf_fragment_cmp *, struct pf_frent *, u_short *); +static struct pf_fragment *pf_fillup_fragment(struct pf_fragment_cmp *, + struct pf_frent *, u_short *); static int pf_isfull_fragment(struct pf_fragment *); -struct mbuf *pf_join_fragment(struct pf_fragment *); +static struct mbuf *pf_join_fragment(struct pf_fragment *); #ifdef INET static void pf_scrub_ip(struct mbuf **, uint32_t, uint8_t, uint8_t); -static void pf_flush_fragments(void); static int pf_reassemble(struct mbuf **, struct ip *, int, u_short *); -static struct mbuf * - pf_fragcache(struct mbuf **, struct ip*, struct pf_fragment **, - int, int, int *); +static struct mbuf *pf_fragcache(struct mbuf **, struct ip*, + struct pf_fragment **, int, int, int *); #endif /* INET */ #ifdef INET6 static int pf_reassemble6(struct mbuf **, struct ip6_hdr *, @@ -267,7 +265,6 @@ pf_purge_expired_fragments(void) PF_FRAG_UNLOCK(); } -#ifdef INET /* * Try to flush old fragments to make space for new ones */ @@ -292,7 +289,6 @@ pf_flush_fragments(void) break; } } -#endif /* INET */ /* Frees the fragments and all associated entries */ static void @@ -329,7 +325,6 @@ pf_free_fragment(struct pf_fragment *fra pf_remove_fragment(frag); } -#ifdef INET static struct pf_fragment * pf_find_fragment(struct pf_fragment_cmp *key, struct pf_frag_tree *tree) { @@ -352,10 +347,8 @@ pf_find_fragment(struct pf_fragment_cmp return (frag); } -#endif /* INET */ /* Removes a fragment from the fragment queue and frees the fragment */ - static void pf_remove_fragment(struct pf_fragment *frag) { @@ -373,7 +366,7 @@ pf_remove_fragment(struct pf_fragment *f } } -struct pf_frent * +static struct pf_frent * pf_create_fragment(u_short *reason) { struct pf_frent *frent; @@ -570,7 +563,7 @@ pf_isfull_fragment(struct pf_fragment *f return (1); } -struct mbuf * +static struct mbuf * pf_join_fragment(struct pf_fragment *frag) { struct mbuf *m, *m2; @@ -666,6 +659,7 @@ pf_reassemble(struct mbuf **m0, struct i DPFPRINTF(("complete: %p(%d)\n", m, ntohs(ip->ip_len))); return (PF_PASS); } +#endif /* INET */ #ifdef INET6 static int @@ -789,6 +783,7 @@ fail: } #endif /* INET6 */ +#ifdef INET static struct mbuf * pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff, int drop, int *nomem) @@ -1090,6 +1085,7 @@ pf_fragcache(struct mbuf **m0, struct ip m_freem(m); return (NULL); } +#endif /* INET */ #ifdef INET6 int @@ -1162,6 +1158,7 @@ pf_refragment6(struct ifnet *ifp, struct } #endif /* INET6 */ +#ifdef INET int pf_normalize_ip(struct mbuf **m0, int dir, struct pfi_kif *kif, u_short *reason, struct pf_pdesc *pd) From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 23:13:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0DDA205; Tue, 17 Feb 2015 23:13:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DB0613B2; Tue, 17 Feb 2015 23:13:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HNDklr000103; Tue, 17 Feb 2015 23:13:46 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HNDjRq099998; Tue, 17 Feb 2015 23:13:45 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201502172313.t1HNDjRq099998@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 17 Feb 2015 23:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278926 - in head: . release 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 23:13:47 -0000 Author: rpaulo Date: Tue Feb 17 23:13:45 2015 New Revision: 278926 URL: https://svnweb.freebsd.org/changeset/base/278926 Log: release: use xz via pipe when compressing the tarballs. libarchive(3) doesn't support the new liblzma API yet, but this change allows us to enable multi-threaded xz compression. ``make release'' should now finish in half the time on a machine with several cores and fast disks (our typical build server). This behaviour only applies when building a release and it doesn't affect buildworld/installworld. To disable threaded xz compression, set XZ_THREADS=1. Reviewed by: gjb Tested by: gjb Modified: head/Makefile.inc1 head/release/Makefile head/release/Makefile.vm head/share/mk/bsd.own.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Feb 17 22:33:22 2015 (r278925) +++ head/Makefile.inc1 Tue Feb 17 23:13:45 2015 (r278926) @@ -912,25 +912,25 @@ packageworld: .for dist in base ${EXTRA_DISTRIBUTIONS} .if defined(NO_ROOT) ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ - tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \ - --exclude usr/lib/debug \ - @${DESTDIR}/${DISTDIR}/${dist}.meta + tar cvf - --exclude usr/lib/debug \ + @${DESTDIR}/${DISTDIR}/${dist}.meta | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}.txz .else ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ - tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \ - --exclude usr/lib/debug . + tar cvf - --exclude usr/lib/debug . | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}.txz .endif .endfor .for dist in ${DEBUG_DISTRIBUTIONS} . if defined(NO_ROOT) ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ - tar cvJf ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz \ - @${DESTDIR}/${DISTDIR}/${dist}.debug.meta + tar cvf - @${DESTDIR}/${DISTDIR}/${dist}.debug.meta | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz . else ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ - tar cvJLf ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz \ - usr/lib/debug + tar cvLf - usr/lib/debug | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz . endif .endfor @@ -1138,19 +1138,21 @@ distributekernel distributekernel.debug: packagekernel: .if defined(NO_ROOT) cd ${DESTDIR}/${DISTDIR}/kernel; \ - tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz \ - @${DESTDIR}/${DISTDIR}/kernel.meta + tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz .for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ - tar cvJf ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz \ - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta + tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz .endfor .else cd ${DESTDIR}/${DISTDIR}/kernel; \ - tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz . + tar cvf - . | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz .for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ - tar cvJf ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz . + tar cvf - . | \ + ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz .endfor .endif Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Feb 17 22:33:22 2015 (r278925) +++ head/release/Makefile Tue Feb 17 23:13:45 2015 (r278926) @@ -33,18 +33,12 @@ # with xz(1) (extremely time consuming) # WITH_CLOUDWARE: if set, build cloud hosting disk images with the release # TARGET/TARGET_ARCH: architecture of built release -# XZ_FLAGS: Additional arguments to pass to xz(1) -# XZ_THREADS: Number of xz(1) threads to use -# NO_XZTHREADS: Disable multi-threaded xz(1) compression # WORLDDIR?= ${.CURDIR}/.. PORTSDIR?= /usr/ports DOCDIR?= /usr/doc RELNOTES_LANG?= en_US.ISO8859-1 -XZCMD?= /usr/bin/xz -XZ_FLAGS?= -XZ_THREADS?= .if !defined(TARGET) || empty(TARGET) TARGET= ${MACHINE} @@ -59,15 +53,6 @@ TARGET_ARCH= ${TARGET} IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} DISTDIR= dist -.if !defined(NO_XZTHREADS) && empty(XZ_THREADS) -XZ_THREADS= 0 -.else -XZ_THREADS= ${XZ_THREADS} -.endif -.if !empty(XZ_THREADS) -XZ_FLAGS+= -T ${XZ_THREADS} -.endif - # Define OSRELEASE by using newvars.sh .if !defined(OSRELEASE) || empty(OSRELEASE) .for _V in TYPE BRANCH REVISION @@ -158,16 +143,18 @@ kernel.txz: src.txz: mkdir -p ${DISTDIR}/usr ln -fs ${WORLDDIR} ${DISTDIR}/usr/src - cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn --exclude .zfs \ - --exclude .git --exclude @ --exclude usr/src/release/dist usr/src + cd ${DISTDIR} && tar cLvf - --exclude .svn --exclude .zfs \ + --exclude .git --exclude @ --exclude usr/src/release/dist usr/src | \ + ${XZ_CMD} > ${.OBJDIR}/src.txz ports.txz: mkdir -p ${DISTDIR}/usr ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports - cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz \ + cd ${DISTDIR} && tar cLvf - \ --exclude .git --exclude .svn \ --exclude usr/ports/distfiles --exclude usr/ports/packages \ - --exclude 'usr/ports/INDEX*' --exclude work usr/ports + --exclude 'usr/ports/INDEX*' --exclude work usr/ports | \ + ${XZ_CMD} > ${.OBJDIR}/ports.txz reldoc: cd ${.CURDIR}/doc && ${MAKE} all install clean 'FORMATS=html txt' \ @@ -309,7 +296,7 @@ release-install: .for I in ${IMAGES} cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I} . if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) - ${XZCMD} ${XZ_FLAGS} -k ${DESTDIR}/${OSRELEASE}-${I} + ${XZ_CMD} -k ${DESTDIR}/${OSRELEASE}-${I} . endif .endfor cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 Modified: head/release/Makefile.vm ============================================================================== --- head/release/Makefile.vm Tue Feb 17 22:33:22 2015 (r278925) +++ head/release/Makefile.vm Tue Feb 17 23:13:45 2015 (r278926) @@ -101,7 +101,7 @@ vm-install: # the DESTDIR. . for FORMAT in ${VMFORMATS} # Don't keep the originals. There is a copy in ${.OBJDIR} if needed. - ${XZCMD} ${XZ_FLAGS} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} + ${XZ_CMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} . endfor . endif cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \ Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue Feb 17 22:33:22 2015 (r278925) +++ head/share/mk/bsd.own.mk Tue Feb 17 23:13:45 2015 (r278926) @@ -234,6 +234,15 @@ STRIP?= -s COMPRESS_CMD?= gzip -cn COMPRESS_EXT?= .gz +# Set XZ_THREADS to 1 to disable multi-threading. +XZ_THREADS?= 0 + +.if !empty(XZ_THREADS) +XZ_CMD?= xz -T ${XZ_THREADS} +.else +XZ_CMD?= xz +.endif + # Pointer to the top directory into which tests are installed. Should not be # overriden by Makefiles, but the user may choose to set this in src.conf(5). TESTSBASE?= /usr/tests From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 23:14:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AD0B35D; Tue, 17 Feb 2015 23:14:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0675D3C5; Tue, 17 Feb 2015 23:14:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HNEQ1x000252; Tue, 17 Feb 2015 23:14:26 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HNEQVs000251; Tue, 17 Feb 2015 23:14:26 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201502172314.t1HNEQVs000251@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Tue, 17 Feb 2015 23:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278927 - head/sys/dev/random 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 23:14:27 -0000 Author: jmg Date: Tue Feb 17 23:14:26 2015 New Revision: 278927 URL: https://svnweb.freebsd.org/changeset/base/278927 Log: Fix a bug where this function overflowed it's buffer... This was causing ZFS panics on boot... This is purely reviewed and tested by peter. Reviewed by: peter Approved by: so (implicit), peter Modified: head/sys/dev/random/yarrow.c Modified: head/sys/dev/random/yarrow.c ============================================================================== --- head/sys/dev/random/yarrow.c Tue Feb 17 23:13:45 2015 (r278926) +++ head/sys/dev/random/yarrow.c Tue Feb 17 23:14:26 2015 (r278927) @@ -432,6 +432,7 @@ reseed(u_int fastslow) void random_yarrow_read(uint8_t *buf, u_int bytecount) { + uint8_t tbuf[BLOCKSIZE]; u_int blockcount, i; /* Check for initial/final read requests */ @@ -448,8 +449,15 @@ random_yarrow_read(uint8_t *buf, u_int b yarrow_state.outputblocks = 0; } uint128_increment(&yarrow_state.counter.whole); - randomdev_encrypt(&yarrow_state.key, yarrow_state.counter.byte, buf, BLOCKSIZE); - buf += BLOCKSIZE; + if ((i + 1) * BLOCKSIZE > bytecount) { + randomdev_encrypt(&yarrow_state.key, + yarrow_state.counter.byte, tbuf, BLOCKSIZE); + memcpy(buf, tbuf, bytecount - i * BLOCKSIZE); + } else { + randomdev_encrypt(&yarrow_state.key, + yarrow_state.counter.byte, buf, BLOCKSIZE); + buf += BLOCKSIZE; + } } mtx_unlock(&random_reseed_mtx); From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 23:20:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 309CE4FB; Tue, 17 Feb 2015 23:20:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1C61C3F0; Tue, 17 Feb 2015 23:20:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HNKJMF001090; Tue, 17 Feb 2015 23:20:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HNKJDs001089; Tue, 17 Feb 2015 23:20:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502172320.t1HNKJDs001089@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 17 Feb 2015 23:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278928 - head/usr.bin/ministat 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 23:20:20 -0000 Author: pfg Date: Tue Feb 17 23:20:19 2015 New Revision: 278928 URL: https://svnweb.freebsd.org/changeset/base/278928 Log: ministat(1): replace malloc + memset with calloc. Reviewed by: phk Modified: head/usr.bin/ministat/ministat.c Modified: head/usr.bin/ministat/ministat.c ============================================================================== --- head/usr.bin/ministat/ministat.c Tue Feb 17 23:14:26 2015 (r278927) +++ head/usr.bin/ministat/ministat.c Tue Feb 17 23:20:19 2015 (r278928) @@ -329,10 +329,8 @@ PlotSet(struct dataset *ds, int val) else bar = 0; - if (pl->bar == NULL) { - pl->bar = malloc(sizeof(char *) * pl->num_datasets); - memset(pl->bar, 0, sizeof(char*) * pl->num_datasets); - } + if (pl->bar == NULL) + pl->bar = calloc(sizeof(char *), pl->num_datasets); if (pl->bar[bar] == NULL) { pl->bar[bar] = malloc(pl->width); memset(pl->bar[bar], 0, pl->width); From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 23:41:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F78ED81; Tue, 17 Feb 2015 23:41:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8AEDE8DA; Tue, 17 Feb 2015 23:41:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HNf9Ad014316; Tue, 17 Feb 2015 23:41:09 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HNf9ZX014315; Tue, 17 Feb 2015 23:41:09 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201502172341.t1HNf9ZX014315@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Tue, 17 Feb 2015 23:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278929 - 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 23:41:09 -0000 Author: jmg Date: Tue Feb 17 23:41:08 2015 New Revision: 278929 URL: https://svnweb.freebsd.org/changeset/base/278929 Log: bump the rev... ZFS is the first fall out of this bug, but there might be others... Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Feb 17 23:20:19 2015 (r278928) +++ head/UPDATING Tue Feb 17 23:41:08 2015 (r278929) @@ -33,8 +33,8 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 20150217: If you are running a -CURRENT kernel since r273872 (Oct 30th, 2014), - but before r278907, the RNG was not seeded properly. Immediately - upgrade the kernel to r278907 or later and regenerate any keys (e.g. + but before r278927, the RNG was not seeded properly. Immediately + upgrade the kernel to r278927 or later and regenerate any keys (e.g. ssh keys or openssl keys) that were generated w/ a kernel from that range. This does not effect programs that directly used /dev/random or /dev/urandom. All userland uses of arc4random(3) are effected. From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 23:54:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 081D832F; Tue, 17 Feb 2015 23:54:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E68BC9F1; Tue, 17 Feb 2015 23:54:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HNs8DR019463; Tue, 17 Feb 2015 23:54:08 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HNs6NT019455; Tue, 17 Feb 2015 23:54:06 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201502172354.t1HNs6NT019455@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 17 Feb 2015 23:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278930 - in head/sys: kern ofed/include/linux 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.18-1 Precedence: list List-Id: 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, 17 Feb 2015 23:54:09 -0000 Author: mjg Date: Tue Feb 17 23:54:06 2015 New Revision: 278930 URL: https://svnweb.freebsd.org/changeset/base/278930 Log: filedesc: simplify fget_unlocked & friends Introduce fget_fcntl which performs appropriate checks when needed. This removes a branch from fget_unlocked. Introduce fget_mmap dealing with cap_rights_to_vmprot conversion. This removes a branch from _fget. Modify fget_unlocked to pass sequence counter to interested callers so that they can perform their own checks and make sure the result was otained from stable & current state. Reviewed by: silence on -hackers Modified: head/sys/kern/kern_descrip.c head/sys/kern/sys_generic.c head/sys/kern/tty.c head/sys/kern/uipc_syscalls.c head/sys/kern/vfs_syscalls.c head/sys/ofed/include/linux/file.h head/sys/sys/file.h head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Tue Feb 17 23:41:08 2015 (r278929) +++ head/sys/kern/kern_descrip.c Tue Feb 17 23:54:06 2015 (r278930) @@ -531,8 +531,8 @@ kern_fcntl(struct thread *td, int fd, in break; case F_GETFL: - error = fget_unlocked(fdp, fd, - cap_rights_init(&rights, CAP_FCNTL), F_GETFL, &fp, NULL); + error = fget_fcntl(td, fd, + cap_rights_init(&rights, CAP_FCNTL), F_GETFL, &fp); if (error != 0) break; td->td_retval[0] = OFLAGS(fp->f_flag); @@ -540,8 +540,8 @@ kern_fcntl(struct thread *td, int fd, in break; case F_SETFL: - error = fget_unlocked(fdp, fd, - cap_rights_init(&rights, CAP_FCNTL), F_SETFL, &fp, NULL); + error = fget_fcntl(td, fd, + cap_rights_init(&rights, CAP_FCNTL), F_SETFL, &fp); if (error != 0) break; do { @@ -568,8 +568,8 @@ kern_fcntl(struct thread *td, int fd, in break; case F_GETOWN: - error = fget_unlocked(fdp, fd, - cap_rights_init(&rights, CAP_FCNTL), F_GETOWN, &fp, NULL); + error = fget_fcntl(td, fd, + cap_rights_init(&rights, CAP_FCNTL), F_GETOWN, &fp); if (error != 0) break; error = fo_ioctl(fp, FIOGETOWN, &tmp, td->td_ucred, td); @@ -579,8 +579,8 @@ kern_fcntl(struct thread *td, int fd, in break; case F_SETOWN: - error = fget_unlocked(fdp, fd, - cap_rights_init(&rights, CAP_FCNTL), F_SETOWN, &fp, NULL); + error = fget_fcntl(td, fd, + cap_rights_init(&rights, CAP_FCNTL), F_SETOWN, &fp); if (error != 0) break; tmp = arg; @@ -602,7 +602,7 @@ kern_fcntl(struct thread *td, int fd, in case F_SETLK: do_setlk: cap_rights_init(&rights, CAP_FLOCK); - error = fget_unlocked(fdp, fd, &rights, 0, &fp, NULL); + error = fget_unlocked(fdp, fd, &rights, &fp, NULL); if (error != 0) break; if (fp->f_type != DTYPE_VNODE) { @@ -691,7 +691,7 @@ kern_fcntl(struct thread *td, int fd, in * that the closing thread was a bit slower and that the * advisory lock succeeded before the close. */ - error = fget_unlocked(fdp, fd, &rights, 0, &fp2, NULL); + error = fget_unlocked(fdp, fd, &rights, &fp2, NULL); if (error != 0) { fdrop(fp, td); break; @@ -710,7 +710,7 @@ kern_fcntl(struct thread *td, int fd, in case F_GETLK: error = fget_unlocked(fdp, fd, - cap_rights_init(&rights, CAP_FLOCK), 0, &fp, NULL); + cap_rights_init(&rights, CAP_FLOCK), &fp, NULL); if (error != 0) break; if (fp->f_type != DTYPE_VNODE) { @@ -748,7 +748,7 @@ kern_fcntl(struct thread *td, int fd, in arg = arg ? 128 * 1024: 0; /* FALLTHROUGH */ case F_READAHEAD: - error = fget_unlocked(fdp, fd, NULL, 0, &fp, NULL); + error = fget_unlocked(fdp, fd, NULL, &fp, NULL); if (error != 0) break; if (fp->f_type != DTYPE_VNODE) { @@ -2327,10 +2327,10 @@ finit(struct file *fp, u_int flag, short int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, - int needfcntl, struct file **fpp, cap_rights_t *haverightsp) + struct file **fpp, seq_t *seqp) { #ifdef CAPABILITIES - struct filedescent fde; + struct filedescent *fde; #endif struct fdescenttbl *fdt; struct file *fp; @@ -2355,28 +2355,23 @@ fget_unlocked(struct filedesc *fdp, int for (;;) { #ifdef CAPABILITIES seq = seq_read(fd_seq(fdt, fd)); - fde = fdt->fdt_ofiles[fd]; + fde = &fdt->fdt_ofiles[fd]; + haverights = cap_rights_fde(fde); + fp = fde->fde_file; if (!seq_consistent(fd_seq(fdt, fd), seq)) { cpu_spinwait(); continue; } - fp = fde.fde_file; #else fp = fdt->fdt_ofiles[fd].fde_file; #endif if (fp == NULL) return (EBADF); #ifdef CAPABILITIES - haverights = cap_rights_fde(&fde); if (needrightsp != NULL) { error = cap_check(haverights, needrightsp); if (error != 0) return (error); - if (cap_rights_is_set(needrightsp, CAP_FCNTL)) { - error = cap_fcntl_check_fde(&fde, needfcntl); - if (error != 0) - return (error); - } } #endif retry: @@ -2406,11 +2401,9 @@ fget_unlocked(struct filedesc *fdp, int fdrop(fp, curthread); } *fpp = fp; - if (haverightsp != NULL) { + if (seqp != NULL) { #ifdef CAPABILITIES - *haverightsp = *haverights; -#else - CAP_ALL(haverightsp); + *seqp = seq; #endif } return (0); @@ -2431,11 +2424,11 @@ fget_unlocked(struct filedesc *fdp, int */ static __inline int _fget(struct thread *td, int fd, struct file **fpp, int flags, - cap_rights_t *needrightsp, u_char *maxprotp) + cap_rights_t *needrightsp, seq_t *seqp) { struct filedesc *fdp; struct file *fp; - cap_rights_t haverights, needrights; + cap_rights_t needrights; int error; *fpp = NULL; @@ -2444,9 +2437,7 @@ _fget(struct thread *td, int fd, struct needrights = *needrightsp; else cap_rights_init(&needrights); - if (maxprotp != NULL) - cap_rights_set(&needrights, CAP_MMAP); - error = fget_unlocked(fdp, fd, &needrights, 0, &fp, &haverights); + error = fget_unlocked(fdp, fd, &needrights, &fp, seqp); if (error != 0) return (error); if (fp->f_ops == &badfileops) { @@ -2454,17 +2445,6 @@ _fget(struct thread *td, int fd, struct return (EBADF); } -#ifdef CAPABILITIES - /* - * If requested, convert capability rights to access flags. - */ - if (maxprotp != NULL) - *maxprotp = cap_rights_to_vmprot(&haverights); -#else /* !CAPABILITIES */ - if (maxprotp != NULL) - *maxprotp = VM_PROT_ALL; -#endif /* CAPABILITIES */ - /* * FREAD and FWRITE failure return EBADF as per POSIX. */ @@ -2506,8 +2486,31 @@ int fget_mmap(struct thread *td, int fd, cap_rights_t *rightsp, u_char *maxprotp, struct file **fpp) { + int error; +#ifndef CAPABILITIES + error = _fget(td, fd, fpp, 0, rightsp, NULL); + if (maxprotp != NULL) + *maxprotp = VM_PROT_ALL; +#else + struct filedesc *fdp = td->td_proc->p_fd; + seq_t seq; - return (_fget(td, fd, fpp, 0, rightsp, maxprotp)); + MPASS(cap_rights_is_set(rightsp, CAP_MMAP)); + for (;;) { + error = _fget(td, fd, fpp, 0, rightsp, &seq); + if (error != 0) + return (error); + /* + * If requested, convert capability rights to access flags. + */ + if (maxprotp != NULL) + *maxprotp = cap_rights_to_vmprot(cap_rights(fdp, fd)); + if (!fd_modified(td->td_proc->p_fd, fd, seq)) + break; + fdrop(*fpp, td); + } +#endif + return (error); } int @@ -2524,6 +2527,35 @@ fget_write(struct thread *td, int fd, ca return (_fget(td, fd, fpp, FWRITE, rightsp, NULL)); } +int +fget_fcntl(struct thread *td, int fd, cap_rights_t *rightsp, int needfcntl, + struct file **fpp) +{ + struct filedesc *fdp = td->td_proc->p_fd; +#ifndef CAPABILITIES + return (fget_unlocked(fdp, fd, rightsp, fpp, NULL)); +#else + int error; + seq_t seq; + + MPASS(cap_rights_is_set(rightsp, CAP_FCNTL)); + for (;;) { + error = fget_unlocked(fdp, fd, rightsp, fpp, &seq); + if (error != 0) + return (error); + error = cap_fcntl_check(fdp, fd, needfcntl); + if (!fd_modified(fdp, fd, seq)) + break; + fdrop(*fpp, td); + } + if (error != 0) { + fdrop(*fpp, td); + *fpp = NULL; + } + return (error); +#endif +} + /* * Like fget() but loads the underlying vnode, or returns an error if the * descriptor does not represent a vnode. Note that pipes use vnodes but Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Tue Feb 17 23:41:08 2015 (r278929) +++ head/sys/kern/sys_generic.c Tue Feb 17 23:54:06 2015 (r278930) @@ -1214,7 +1214,7 @@ getselfd_cap(struct filedesc *fdp, int f cap_rights_init(&rights, CAP_EVENT); - return (fget_unlocked(fdp, fd, &rights, 0, fpp, NULL)); + return (fget_unlocked(fdp, fd, &rights, fpp, NULL)); } /* Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Tue Feb 17 23:41:08 2015 (r278929) +++ head/sys/kern/tty.c Tue Feb 17 23:54:06 2015 (r278930) @@ -1897,7 +1897,7 @@ ttyhook_register(struct tty **rtp, struc /* Validate the file descriptor. */ fdp = p->p_fd; error = fget_unlocked(fdp, fd, cap_rights_init(&rights, CAP_TTYHOOK), - 0, &fp, NULL); + &fp, NULL); if (error != 0) return (error); if (fp->f_ops == &badfileops) { Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Tue Feb 17 23:41:08 2015 (r278929) +++ head/sys/kern/uipc_syscalls.c Tue Feb 17 23:54:06 2015 (r278930) @@ -156,7 +156,7 @@ getsock_cap(struct filedesc *fdp, int fd struct file *fp; int error; - error = fget_unlocked(fdp, fd, rightsp, 0, &fp, NULL); + error = fget_unlocked(fdp, fd, rightsp, &fp, NULL); if (error != 0) return (error); if (fp->f_type != DTYPE_SOCKET) { Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue Feb 17 23:41:08 2015 (r278929) +++ head/sys/kern/vfs_syscalls.c Tue Feb 17 23:54:06 2015 (r278930) @@ -4217,7 +4217,7 @@ getvnode(struct filedesc *fdp, int fd, c struct file *fp; int error; - error = fget_unlocked(fdp, fd, rightsp, 0, &fp, NULL); + error = fget_unlocked(fdp, fd, rightsp, &fp, NULL); if (error != 0) return (error); Modified: head/sys/ofed/include/linux/file.h ============================================================================== --- head/sys/ofed/include/linux/file.h Tue Feb 17 23:41:08 2015 (r278929) +++ head/sys/ofed/include/linux/file.h Tue Feb 17 23:54:06 2015 (r278930) @@ -48,7 +48,7 @@ linux_fget(unsigned int fd) { struct file *file; - if (fget_unlocked(curthread->td_proc->p_fd, fd, NULL, 0, &file, + if (fget_unlocked(curthread->td_proc->p_fd, fd, NULL, &file, NULL) != 0) { return (NULL); } @@ -73,7 +73,7 @@ put_unused_fd(unsigned int fd) { struct file *file; - if (fget_unlocked(curthread->td_proc->p_fd, fd, NULL, 0, &file, + if (fget_unlocked(curthread->td_proc->p_fd, fd, NULL, &file, NULL) != 0) { return; } @@ -93,7 +93,7 @@ fd_install(unsigned int fd, struct linux { struct file *file; - if (fget_unlocked(curthread->td_proc->p_fd, fd, NULL, 0, &file, + if (fget_unlocked(curthread->td_proc->p_fd, fd, NULL, &file, NULL) != 0) { file = NULL; } Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Tue Feb 17 23:41:08 2015 (r278929) +++ head/sys/sys/file.h Tue Feb 17 23:54:06 2015 (r278930) @@ -230,6 +230,8 @@ int fget_read(struct thread *td, int fd, struct file **fpp); int fget_write(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp); +int fget_fcntl(struct thread *td, int fd, cap_rights_t *rightsp, + int needfcntl, struct file **fpp); int _fdrop(struct file *fp, struct thread *td); fo_rdwr_t invfo_rdwr; Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Tue Feb 17 23:41:08 2015 (r278929) +++ head/sys/sys/filedesc.h Tue Feb 17 23:54:06 2015 (r278930) @@ -169,7 +169,7 @@ void mountcheckdirs(struct vnode *olddp, /* Return a referenced file from an unlocked descriptor. */ int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, - int needfcntl, struct file **fpp, cap_rights_t *haverightsp); + struct file **fpp, seq_t *seqp); /* Requires a FILEDESC_{S,X}LOCK held and returns without a ref. */ static __inline struct file * @@ -184,6 +184,13 @@ fget_locked(struct filedesc *fdp, int fd return (fdp->fd_ofiles[fd].fde_file); } +static __inline bool +fd_modified(struct filedesc *fdp, int fd, seq_t seq) +{ + + return (!seq_consistent(fd_seq(fdp->fd_files, fd), seq)); +} + #endif /* _KERNEL */ #endif /* !_SYS_FILEDESC_H_ */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 01:06:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0054C341; Wed, 18 Feb 2015 01:06:32 +0000 (UTC) Received: from mail-qc0-x22b.google.com (mail-qc0-x22b.google.com [IPv6:2607:f8b0:400d:c01::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 A5AF013D; Wed, 18 Feb 2015 01:06:32 +0000 (UTC) Received: by mail-qc0-f171.google.com with SMTP id l6so31781455qcy.2; Tue, 17 Feb 2015 17:06:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-type; bh=YDF2DI7JOoZep1jw/c+MBLKrtTHUUyoUTs78icGnZtw=; b=TDamaBOu5tVUOhesEnAX9O+Q/NS7s1k0PpHJ5VFoDHm553C1av/z6qppPJmTmOxXFe XQ0brenfjmB7ceeU72EyNr9DqRpiXrx2zai0pey0kMbTWrzBU6fOEjranY0cmzOwsGtx drwDlm/o8QNPQYf7luBXFZ8LZCFoGJCO07uw+LMVapWN2VnLfT8LAw6e7VkBbrjbpteG UPB3kCq59NFL7iqBV8zUyCQf9sUaJ4zMqx5WYfUIXVZtYGIiWDsuBn6Q6ikWS01C2WJY RX0STrwAYFaevwCDVGf2tpj/FBBx7xIBEUfd1HoP1qVoYM4rui0CUgGTjA1vlL/o2hSM E/iA== X-Received: by 10.229.192.5 with SMTP id do5mr1201629qcb.12.1424221591569; Tue, 17 Feb 2015 17:06:31 -0800 (PST) Received: from shawn-work-laptop.localnet ([2601:a:1380:1046:458c:51:377a:7e40]) by mx.google.com with ESMTPSA id g11sm6859615qhc.35.2015.02.17.17.06.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Feb 2015 17:06:30 -0800 (PST) From: Shawn Webb To: svn-src-all@freebsd.org Subject: Re: svn commit: r278927 - head/sys/dev/random Date: Tue, 17 Feb 2015 20:06:32 -0500 Message-ID: <1995224.5kdoagqnev@shawn-work-laptop> User-Agent: KMail/4.14.1 (Linux/3.16.0-30-generic; KDE/4.14.1; x86_64; ; ) In-Reply-To: <201502172314.t1HNEQVs000251@svn.freebsd.org> References: <201502172314.t1HNEQVs000251@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1556437.h0QfWfbLTV"; micalg="pgp-sha1"; protocol="application/pgp-signature" Cc: John-Mark Gurney , svn-src-head@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 18 Feb 2015 01:06:33 -0000 --nextPart1556437.h0QfWfbLTV Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Tuesday, February 17, 2015 11:14:26 PM John-Mark Gurney wrote: > Author: jmg > Date: Tue Feb 17 23:14:26 2015 > New Revision: 278927 > URL: https://svnweb.freebsd.org/changeset/base/278927 > > Log: > Fix a bug where this function overflowed it's buffer... This was > causing ZFS panics on boot... > > This is purely reviewed and tested by peter. > > Reviewed by: peter > Approved by: so (implicit), peter I'm still seeing the kernel panic even after this commit. Thanks, Shawn --nextPart1556437.h0QfWfbLTV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABAgAGBQJU4+WYAAoJEGqEZY9SRW7uJx4QAIuJqqYBRsUNgHgKTxBH2O9b V0zOH/ngi/d2BSPVdG1jZRJtFuP3JAe0LZHTYfRuFAtX32ZRl+UDhgaUrwX2SKFq IsXEHlg+/TAbRs87Uf3n28u8FvWrzsz7uHQzyHcMHIVdb4slmmDBEyeKBHX0dPqY k66tHSmsb4ddsqoDHhzRW3ihzxB7zJ3VyfnSxVkF7xi0XXZ1URCq1Ghiiwbiq+DP /Jpnd/qRlgLYZotF4RI7xo4H1VBkUsdGgLFXeKPNUErdOAkvIhwJV2lVw8ss6HCS Nk2+KmSUcZ5dGo3wPCTMVOyBy7X34+9AuPC+gRmdEYlEKsUANKg8B7/q2JSMKR5A /wrJudipXkBR4g3JL0eo6LF9z5lSXrdRExa4EyYCs0BJwXILwHdX+/7R7xnLNtK9 bNan7u/ngqn1/uuIE/EWSZpMk7AdLeCYtki+jH2T0pJ+fccK+kMBwfcIKOXSPrtA E/wy+qX6cJnvi7Ta3a3jxT8lMxqURQZe2hYLTguBDflSQY24wqfedER7d3EPQkx3 oXwuD0aZ5x0DTQB3SadxOsQW8PeM+Oiz3aEw4Wm+s0IvOaqiPokPOKr+u/FUgf9B ZCXc5uGEn1thV8g9iGPJ4T0M1oba1AFRYzqQhOxjggTWpbA8SlqnntHIxaeG/RZE UmSPpnLeLWJB8p/0qO8B =IXTy -----END PGP SIGNATURE----- --nextPart1556437.h0QfWfbLTV-- From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 01:10:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA8E94B5; Wed, 18 Feb 2015 01:10:54 +0000 (UTC) Received: from mail-qg0-x234.google.com (mail-qg0-x234.google.com [IPv6:2607:f8b0:400d:c04::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 6882F15C; Wed, 18 Feb 2015 01:10:54 +0000 (UTC) Received: by mail-qg0-f52.google.com with SMTP id h3so30756655qgf.11; Tue, 17 Feb 2015 17:10:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-type; bh=MMP9monIvItGrR+rIRiMhuM+xdg6S8MgEOGGak3HRqI=; b=JYYSQpAbQjlZYvkygvSG0f8ny5E+4XTkOWcBCTqH7EGmgu5CW1Z0jNR2aoYNrxpraS vHb3N3NMvbv2OPgQTuCtaf6dmQmoLHPau+qJKCpc7wvaaRO9Avzwu0TM173zxzeyj735 jCRgcZiH0RnKWAySyO7h7NGexxjmDIDRLkl2MzfC08CgkFClSxpoCm7Eqkog3XfnPcoW ssjMBEguPvStehHxzeoRCijjejWGcGG3+gRJw+ebknn1u4mW8mzCYPWo0/9wqTAzBqdf P55uFQeB1j88RKHSuq9BjUPK31jgAldJ3EjKZvZG2JPBVIj5hjRZS5nlOeL6kykbZdrE t7MQ== X-Received: by 10.140.38.197 with SMTP id t63mr60600qgt.61.1424221853191; Tue, 17 Feb 2015 17:10:53 -0800 (PST) Received: from shawn-work-laptop.localnet ([2601:a:1380:1046:458c:51:377a:7e40]) by mx.google.com with ESMTPSA id 141sm6874900qhg.47.2015.02.17.17.10.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Feb 2015 17:10:52 -0800 (PST) From: Shawn Webb To: svn-src-all@freebsd.org Subject: Re: svn commit: r278927 - head/sys/dev/random Date: Tue, 17 Feb 2015 20:10:55 -0500 Message-ID: <5545025.MNc1ZYVVrp@shawn-work-laptop> User-Agent: KMail/4.14.1 (Linux/3.16.0-30-generic; KDE/4.14.1; x86_64; ; ) In-Reply-To: <1995224.5kdoagqnev@shawn-work-laptop> References: <201502172314.t1HNEQVs000251@svn.freebsd.org> <1995224.5kdoagqnev@shawn-work-laptop> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2626182.2CRRpYnjp7"; micalg="pgp-sha1"; protocol="application/pgp-signature" Cc: John-Mark Gurney , svn-src-head@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 18 Feb 2015 01:10:54 -0000 --nextPart2626182.2CRRpYnjp7 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Tuesday, February 17, 2015 08:06:32 PM Shawn Webb wrote: > On Tuesday, February 17, 2015 11:14:26 PM John-Mark Gurney wrote: > > Author: jmg > > Date: Tue Feb 17 23:14:26 2015 > > New Revision: 278927 > > URL: https://svnweb.freebsd.org/changeset/base/278927 > > > > Log: > > Fix a bug where this function overflowed it's buffer... This was > > causing ZFS panics on boot... > > > > This is purely reviewed and tested by peter. > > > > Reviewed by: peter > > Approved by: so (implicit), peter > > I'm still seeing the kernel panic even after this commit. > > Thanks, > > Shawn Whoops. Applied the patch to the wrong box. Never mind. --nextPart2626182.2CRRpYnjp7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABAgAGBQJU4+afAAoJEGqEZY9SRW7u/doQAJF/a3N9HPLk75jC/5oFKdHE UqG4Iz57xcKzhKjcGu7qfGq8L4Kw8GX8chKTVD1bxMVWfYhVmVH8nUXBTWbBwPEi MFwUlIHgl5uuKarRF+6dzij4VMNen/RIrNd0v9bW1Y+gEEw6Max3+92qtoQCWGn3 jUXmrqupAk18RJP9uuJohe0q2ByPECYDUqYth5CEtHnEB3ECaXoFlU+YygF20xGj UDx+KdP9tqAuQAagnIBICSHONQzZF8NAag6KAI6Uuav4Ks4gZam+JMO5vsfgzspa j2mmpWBdQQnmUcfUq62W7xM5UfdFNeszh8PCsDJWokOge3gn73bHGyqMAwH/jnmt jTBEO1VGEkJ3wN/XqvPE6OR1bjswPrpHit1guQqJIPmyBH34IcEMDWrRa0xNdtkC MlthPixBcI4J4xUhuEb1F343FZtWcb6CTMUQlkumfi5wIsFFfqGKZrPaWXXjSgKJ ytXvCX7vdVeVXYQmnaFke0AKZAOSZHAzEfHM20sZoM069X2bGvDXTkTpj9UfzA22 XoZgF4EwgdfdfUXQ4GH6D0bq12D5K9eYsD/ZPzatPGC9sBrCwrBngm5xrmfb8Uts xeKkM4hVkVYY/TWd4y5Yfr8BMIj5blr3TV/PirOcsAFsVQZwabFV4MFOraynZo39 s/4p5lzaf/lFVVqiAY+x =s83H -----END PGP SIGNATURE----- --nextPart2626182.2CRRpYnjp7-- From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 03:33:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E45CB1A; Wed, 18 Feb 2015 03:33:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2F60B127; Wed, 18 Feb 2015 03:33:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1I3XJH6023936; Wed, 18 Feb 2015 03:33:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1I3XIp3023933; Wed, 18 Feb 2015 03:33:18 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502180333.t1I3XIp3023933@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 18 Feb 2015 03:33:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278932 - in head/lib/libc: rpc stdio 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 03:33:19 -0000 Author: pfg Date: Wed Feb 18 03:33:17 2015 New Revision: 278932 URL: https://svnweb.freebsd.org/changeset/base/278932 Log: libc: clean some set-but-not-used errors. These were found by gcc 5.0 on Dragonfly BSD, however I made no attempt to silence the false positives. Obtained from: DragonFly (cf515c3a6f3a8964ad592e524442bc628f8ed63b) Modified: head/lib/libc/rpc/clnt_dg.c head/lib/libc/rpc/rpc_soc.c head/lib/libc/stdio/xprintf_float.c Modified: head/lib/libc/rpc/clnt_dg.c ============================================================================== --- head/lib/libc/rpc/clnt_dg.c Wed Feb 18 03:02:03 2015 (r278931) +++ head/lib/libc/rpc/clnt_dg.c Wed Feb 18 03:33:17 2015 (r278932) @@ -327,7 +327,7 @@ clnt_dg_call(cl, proc, xargs, argsp, xre struct sockaddr *sa; sigset_t mask; sigset_t newmask; - socklen_t inlen, salen; + socklen_t salen; ssize_t recvlen = 0; int kin_len, n, rpc_lock_value; u_int32_t xid; @@ -520,7 +520,6 @@ get_reply: goto call_again_same_xid; } } - inlen = (socklen_t)recvlen; /* * now decode and validate the response Modified: head/lib/libc/rpc/rpc_soc.c ============================================================================== --- head/lib/libc/rpc/rpc_soc.c Wed Feb 18 03:02:03 2015 (r278931) +++ head/lib/libc/rpc/rpc_soc.c Wed Feb 18 03:33:17 2015 (r278932) @@ -462,12 +462,10 @@ clntunix_create(raddr, prog, vers, sockp u_int recvsz; { struct netbuf *svcaddr; - struct netconfig *nconf; CLIENT *cl; int len; cl = NULL; - nconf = NULL; svcaddr = NULL; if ((raddr->sun_len == 0) || ((svcaddr = malloc(sizeof(struct netbuf))) == NULL ) || Modified: head/lib/libc/stdio/xprintf_float.c ============================================================================== --- head/lib/libc/stdio/xprintf_float.c Wed Feb 18 03:02:03 2015 (r278931) +++ head/lib/libc/stdio/xprintf_float.c Wed Feb 18 03:33:17 2015 (r278932) @@ -168,7 +168,6 @@ __printf_render_float(struct __printf_io int realsz; /* field size expanded by dprec, sign, etc */ int dprec; /* a copy of prec if [diouxX], 0 otherwise */ char ox[2]; /* space for 0x; ox[1] is either x, X, or \0 */ - int prsize; /* max size of printed field */ int ret; /* return value accumulator */ char *decimal_point; /* locale specific decimal point */ int n2; /* XXX: for PRINTANDPAD */ @@ -344,8 +343,6 @@ here: if (ox[1]) realsz += 2; - prsize = pi->width > realsz ? pi->width : realsz; - /* right-adjusting blank padding */ if (pi->pad != '0' && pi->left == 0) ret += __printf_pad(io, pi->width - realsz, 0); From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 03:46:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2CE5F32; Wed, 18 Feb 2015 03:46:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BE442236; Wed, 18 Feb 2015 03:46:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1I3ki6G004953; Wed, 18 Feb 2015 03:46:44 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1I3kiS3004952; Wed, 18 Feb 2015 03:46:44 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201502180346.t1I3kiS3004952@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Wed, 18 Feb 2015 03:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278933 - 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 03:46:44 -0000 Author: rpaulo Date: Wed Feb 18 03:46:43 2015 New Revision: 278933 URL: https://svnweb.freebsd.org/changeset/base/278933 Log: Fix a typo in ipv6_down(). We weren't skipping extraneous entries in the ifconfig | grep inet6 case. Submitted by: Ashutosh Kumar AK0037447 at TechMahindra.com MFC after: 1 week Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Wed Feb 18 03:33:17 2015 (r278932) +++ head/etc/network.subr Wed Feb 18 03:46:43 2015 (r278933) @@ -754,7 +754,7 @@ ipv6_down() IFS="$_ifs" for _inet6 in $inetList ; do # get rid of extraneous line - case $_inet in + case $_inet6 in inet6\ *) ;; *) continue ;; esac From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 03:54:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13FD4320; Wed, 18 Feb 2015 03:54:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 F1A88356; Wed, 18 Feb 2015 03:54:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1I3suxr009332; Wed, 18 Feb 2015 03:54:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1I3stA4009326; Wed, 18 Feb 2015 03:54:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201502180354.t1I3stA4009326@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 18 Feb 2015 03:54:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278934 - in head: cddl/contrib/opensolaris/lib/libdtrace/common 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 03:54:57 -0000 Author: markj Date: Wed Feb 18 03:54:54 2015 New Revision: 278934 URL: https://svnweb.freebsd.org/changeset/base/278934 Log: Remove drti.o's dependency on libelf. This makes it possible to add DTrace probes to userland programs and libraries without also needing to link libelf. dtrace -G places the __SUNW_dof symbol at the beginning of the DOF (DTrace probe and provider metdata) section in the generated object file; drti.o now just uses this symbol to locate the section. A complication occurs when multiple dtrace-generated object files are linked together, since the __SUNW_dof symbol defined in each file is global. This is handled by using objcopy(1) to convert __SUNW_dof to a local symbol once drti.o has been linked with the generated object file. Upstream, this is done using a linker feature not present in GNU ld. Differential Revision: https://reviews.freebsd.org/D1757 Reviewed by: rpaulo MFC after: 1 month Relnotes: yes Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c head/share/mk/bsd.dep.mk Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Wed Feb 18 03:46:43 2015 (r278933) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Wed Feb 18 03:54:54 2015 (r278934) @@ -36,7 +36,6 @@ #include #include #include -#include /* * In Solaris 10 GA, the only mechanism for communicating helper information @@ -62,9 +61,7 @@ static const char *olddevname = "/device static const char *modname; /* Name of this load object */ static int gen; /* DOF helper generation */ -#ifdef illumos extern dof_hdr_t __SUNW_dof; /* DOF defined in the .SUNW_dof section */ -#endif static boolean_t dof_init_debug = B_FALSE; /* From DTRACE_DOF_INIT_DEBUG */ static void @@ -99,11 +96,7 @@ static void dtrace_dof_init(void) __attr static void dtrace_dof_init(void) { -#ifdef illumos dof_hdr_t *dof = &__SUNW_dof; -#else - dof_hdr_t *dof = NULL; -#endif #ifdef _LP64 Elf64_Ehdr *elf; #else @@ -118,17 +111,6 @@ dtrace_dof_init(void) #endif int fd; const char *p; -#ifndef illumos - Elf *e; - Elf_Scn *scn = NULL; - Elf_Data *dofdata = NULL; - dof_hdr_t *dof_next = NULL; - GElf_Shdr shdr; - int efd; - char *s; - size_t shstridx; - uint64_t aligned_filesz; -#endif if (getenv("DTRACE_DOF_INIT_DISABLE") != NULL) return; @@ -152,42 +134,6 @@ dtrace_dof_init(void) modname = lmp->l_name; else modname++; -#ifndef illumos - elf_version(EV_CURRENT); - if ((efd = open(lmp->l_name, O_RDONLY, 0)) < 0) { - dprintf(1, "couldn't open file for reading\n"); - return; - } - if ((e = elf_begin(efd, ELF_C_READ, NULL)) == NULL) { - dprintf(1, "elf_begin failed\n"); - close(efd); - return; - } - elf_getshdrstrndx(e, &shstridx); - dof = NULL; - while ((scn = elf_nextscn(e, scn)) != NULL) { - gelf_getshdr(scn, &shdr); - if (shdr.sh_type == SHT_SUNW_dof) { - s = elf_strptr(e, shstridx, shdr.sh_name); - if (s != NULL && strcmp(s, ".SUNW_dof") == 0) { - dofdata = elf_getdata(scn, NULL); - dof = dofdata->d_buf; - break; - } - } - } - if (dof == NULL) { - dprintf(1, "SUNW_dof section not found\n"); - elf_end(e); - close(efd); - return; - } - - while ((char *) dof < (char *) dofdata->d_buf + dofdata->d_size) { - aligned_filesz = (shdr.sh_addralign == 0 ? dof->dofh_filesz : - roundup2(dof->dofh_filesz, shdr.sh_addralign)); - dof_next = (void *) ((char *) dof + aligned_filesz); -#endif if (dof->dofh_ident[DOF_ID_MAG0] != DOF_MAG_MAG0 || dof->dofh_ident[DOF_ID_MAG1] != DOF_MAG_MAG1 || @@ -237,21 +183,12 @@ dtrace_dof_init(void) dprintf(1, "DTrace ioctl failed for DOF at %p", dof); else { dprintf(1, "DTrace ioctl succeeded for DOF at %p\n", dof); -#ifndef illumos +#ifdef __FreeBSD__ gen = dh.gen; #endif } (void) close(fd); - -#ifndef illumos - /* End of while loop */ - dof = dof_next; - } - - elf_end(e); - (void) close(efd); -#endif } #ifdef illumos Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Wed Feb 18 03:46:43 2015 (r278933) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Wed Feb 18 03:54:54 2015 (r278934) @@ -275,6 +275,9 @@ struct dtrace_hdl { int dt_cpp_argc; /* count of initialized cpp(1) arguments */ int dt_cpp_args; /* size of dt_cpp_argv[] array */ char *dt_ld_path; /* pathname of ld(1) to invoke if needed */ +#ifdef __FreeBSD__ + char *dt_objcopy_path; /* pathname of objcopy(1) to invoke if needed */ +#endif dt_list_t dt_lib_path; /* linked-list forming library search path */ uint_t dt_lazyload; /* boolean: set via -xlazyload */ uint_t dt_droptags; /* boolean: set via -xdroptags */ Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Wed Feb 18 03:46:43 2015 (r278933) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Wed Feb 18 03:54:54 2015 (r278934) @@ -281,7 +281,11 @@ printf("%s:%s(%d): DOODAD\n",__FUNCTION_ sym->st_value = 0; sym->st_size = dof->dofh_filesz; sym->st_info = ELF32_ST_INFO(STB_GLOBAL, STT_OBJECT); +#ifdef illumos sym->st_other = 0; +#else + sym->st_other = ELF32_ST_VISIBILITY(STV_HIDDEN); +#endif sym->st_shndx = ESHDR_DOF; sym++; @@ -471,7 +475,11 @@ prepare_elf64(dtrace_hdl_t *dtp, const d sym->st_value = 0; sym->st_size = dof->dofh_filesz; sym->st_info = GELF_ST_INFO(STB_GLOBAL, STT_OBJECT); +#ifdef illumos sym->st_other = 0; +#else + sym->st_other = ELF64_ST_VISIBILITY(STV_HIDDEN); +#endif sym->st_shndx = ESHDR_DOF; sym++; @@ -711,11 +719,7 @@ dump_elf64(dtrace_hdl_t *dtp, const dof_ shp = &elf_file.shdr[ESHDR_DOF]; shp->sh_name = 11; /* DTRACE_SHSTRTAB64[11] = ".SUNW_dof" */ -#ifdef illumos shp->sh_flags = SHF_ALLOC; -#else - shp->sh_flags = SHF_WRITE | SHF_ALLOC; -#endif shp->sh_type = SHT_SUNW_dof; shp->sh_offset = off; shp->sh_size = dof->dofh_filesz; @@ -1874,7 +1878,7 @@ dtrace_program_link(dtrace_hdl_t *dtp, d #endif (void) snprintf(drti, sizeof (drti), "/usr/lib%s/dtrace/drti.o", - use_32 ? "32":""); + use_32 ? "32" : ""); len = snprintf(&tmp, 1, fmt, dtp->dt_ld_path, file, tfile, drti) + 1; @@ -1885,26 +1889,61 @@ dtrace_program_link(dtrace_hdl_t *dtp, d drti); #endif if ((status = system(cmd)) == -1) { - ret = dt_link_error(dtp, NULL, -1, NULL, + ret = dt_link_error(dtp, NULL, fd, NULL, "failed to run %s: %s", dtp->dt_ld_path, strerror(errno)); goto done; } if (WIFSIGNALED(status)) { - ret = dt_link_error(dtp, NULL, -1, NULL, + ret = dt_link_error(dtp, NULL, fd, NULL, "failed to link %s: %s failed due to signal %d", file, dtp->dt_ld_path, WTERMSIG(status)); goto done; } if (WEXITSTATUS(status) != 0) { - ret = dt_link_error(dtp, NULL, -1, NULL, + ret = dt_link_error(dtp, NULL, fd, NULL, "failed to link %s: %s exited with status %d\n", file, dtp->dt_ld_path, WEXITSTATUS(status)); goto done; } (void) close(fd); /* release temporary file */ + +#ifdef __FreeBSD__ + /* + * Now that we've linked drti.o, reduce the global __SUNW_dof + * symbol to a local symbol. This is needed to so that multiple + * generated object files (for different providers, for + * instance) can be linked together. This is accomplished using + * the -Blocal flag with Sun's linker, but GNU ld doesn't appear + * to have an equivalent option. + */ + asprintf(&cmd, "%s --localize-hidden %s", dtp->dt_objcopy_path, + file); + if ((status = system(cmd)) == -1) { + ret = dt_link_error(dtp, NULL, -1, NULL, + "failed to run %s: %s", dtp->dt_objcopy_path, + strerror(errno)); + free(cmd); + goto done; + } + free(cmd); + + if (WIFSIGNALED(status)) { + ret = dt_link_error(dtp, NULL, -1, NULL, + "failed to link %s: %s failed due to signal %d", + file, dtp->dt_objcopy_path, WTERMSIG(status)); + goto done; + } + + if (WEXITSTATUS(status) != 0) { + ret = dt_link_error(dtp, NULL, -1, NULL, + "failed to link %s: %s exited with status %d\n", + file, dtp->dt_objcopy_path, WEXITSTATUS(status)); + goto done; + } +#endif } else { (void) close(fd); } Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Wed Feb 18 03:46:43 2015 (r278933) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Wed Feb 18 03:54:54 2015 (r278934) @@ -785,6 +785,7 @@ const char *_dtrace_defld = "/usr/ccs/bi #else const char *_dtrace_defcpp = "cpp"; /* default cpp(1) to invoke */ const char *_dtrace_defld = "ld"; /* default ld(1) to invoke */ +const char *_dtrace_defobjcopy = "objcopy"; /* default objcopy(1) to invoke */ #endif const char *_dtrace_libdir = "/usr/lib/dtrace"; /* default library directory */ @@ -1185,6 +1186,9 @@ alloc: dtp->dt_cpp_argc = 1; dtp->dt_cpp_args = 1; dtp->dt_ld_path = strdup(_dtrace_defld); +#ifdef __FreeBSD__ + dtp->dt_objcopy_path = strdup(_dtrace_defobjcopy); +#endif dtp->dt_provmod = provmod; dtp->dt_vector = vector; dtp->dt_varg = arg; @@ -1193,6 +1197,9 @@ alloc: if (dtp->dt_mods == NULL || dtp->dt_provs == NULL || dtp->dt_procs == NULL || dtp->dt_ld_path == NULL || +#ifdef __FreeBSD__ + dtp->dt_objcopy_path == NULL || +#endif dtp->dt_cpp_path == NULL || dtp->dt_cpp_argv == NULL) return (set_open_errno(dtp, errp, EDT_NOMEM)); @@ -1673,6 +1680,9 @@ dtrace_close(dtrace_hdl_t *dtp) free(dtp->dt_cpp_argv); free(dtp->dt_cpp_path); free(dtp->dt_ld_path); +#ifdef __FreeBSD__ + free(dtp->dt_objcopy_path); +#endif free(dtp->dt_mods); free(dtp->dt_provs); Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c Wed Feb 18 03:46:43 2015 (r278933) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c Wed Feb 18 03:54:54 2015 (r278934) @@ -280,6 +280,28 @@ dt_opt_ld_path(dtrace_hdl_t *dtp, const return (0); } +#ifdef __FreeBSD__ +static int +dt_opt_objcopy_path(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) +{ + char *objcopy; + + if (arg == NULL) + return (dt_set_errno(dtp, EDT_BADOPTVAL)); + + if (dtp->dt_pcb != NULL) + return (dt_set_errno(dtp, EDT_BADOPTCTX)); + + if ((objcopy = strdup(arg)) == NULL) + return (dt_set_errno(dtp, EDT_NOMEM)); + + free(dtp->dt_objcopy_path); + dtp->dt_objcopy_path = objcopy; + + return (0); +} +#endif + /*ARGSUSED*/ static int dt_opt_libdir(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) @@ -960,6 +982,9 @@ static const dt_option_t _dtrace_ctoptio { "linkmode", dt_opt_linkmode }, { "linktype", dt_opt_linktype }, { "nolibs", dt_opt_cflags, DTRACE_C_NOLIBS }, +#ifdef __FreeBSD__ + { "objcopypath", dt_opt_objcopy_path }, +#endif { "pgmax", dt_opt_pgmax }, { "pspec", dt_opt_cflags, DTRACE_C_PSPEC }, { "setenv", dt_opt_setenv, 1 }, Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Feb 18 03:46:43 2015 (r278933) +++ head/share/mk/bsd.dep.mk Wed Feb 18 03:54:54 2015 (r278934) @@ -121,10 +121,7 @@ ${_YC:R}.o: ${_YC} .endfor # DTrace probe definitions -# libelf is currently needed for drti.o .if ${SRCS:M*.d} -LDADD+= -lelf -DPADD+= ${LIBELF} CFLAGS+= -I${.OBJDIR} .endif .for _DSRC in ${SRCS:M*.d:N*/*} From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 04:01:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 177B872B; Wed, 18 Feb 2015 04:01:38 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtp002.mac.com [17.172.220.237]) (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 DE9003F2; Wed, 18 Feb 2015 04:01:37 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NJY00BU58H4Y810@st11p02mm-asmtp002.mac.com>; Wed, 18 Feb 2015 04:00:43 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-18_02:2015-02-17,2015-02-18,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502180043 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278914 - in head/sys: kern sys From: Rui Paulo In-reply-to: <201502171932.t1HJWCWk092408@svn.freebsd.org> Date: Tue, 17 Feb 2015 20:00:40 -0800 Content-transfer-encoding: quoted-printable Message-id: References: <201502171932.t1HJWCWk092408@svn.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 18 Feb 2015 04:01:38 -0000 On Feb 17, 2015, at 11:32, Gleb Smirnoff wrote: >=20 > Differential Revision: D1499 You need to use the *FULL* URL. Otherwise the revision won't be closed = automatically. =20 -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 05:53:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 040EE612; Wed, 18 Feb 2015 05:53:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D8B98A7; Wed, 18 Feb 2015 05:53:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1I5r5RE063358; Wed, 18 Feb 2015 05:53:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1I5r5CF063356; Wed, 18 Feb 2015 05:53:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502180553.t1I5r5CF063356@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 18 Feb 2015 05:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278936 - in head/sys/dev: cardbus pccbb 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 05:53:06 -0000 Author: imp Date: Wed Feb 18 05:53:04 2015 New Revision: 278936 URL: https://svnweb.freebsd.org/changeset/base/278936 Log: On my Lenovo T400, a Atheros 2413 has a problem powering up sometimes. It will power up wrong and identify itself badly: cardbus0: at device 0.0 (no driver attached) cardbus0: at device 0.1 (no driver attached) cardbus0: at device 0.2 (no driver attached) cardbus0: at device 0.3 (no driver attached) cardbus0: at device 0.4 (no driver attached) cardbus0: at device 0.5 (no driver attached) cardbus0: at device 0.6 (no driver attached) cardbus0: at device 0.7 (no driver attached) All the higher numbered functions (.2 and above) have a config space of all 0's. This smells a bit like a special debug mode, but the current atheros driver doesn't cope. It is unclear if this card is just a flake, or if we're doing something wrong in the power-up sequence. Put a work around into the code that tests for this rather unusual condition. If we power a CardBus device up, and the device says it is multi-function, and any of the functions have a 0 device ID, try the power-up sequence again. Modified: head/sys/dev/cardbus/cardbus.c head/sys/dev/pccbb/pccbb.c Modified: head/sys/dev/cardbus/cardbus.c ============================================================================== --- head/sys/dev/cardbus/cardbus.c Wed Feb 18 05:20:52 2015 (r278935) +++ head/sys/dev/cardbus/cardbus.c Wed Feb 18 05:53:04 2015 (r278936) @@ -122,6 +122,7 @@ cardbus_detach(device_t cbdev) cardbus_detach_card(cbdev); #ifdef PCI_RES_BUS sc = device_get_softc(cbdev); + device_printf(cbdev, "Freeing up the allocatd bus\n"); (void)bus_release_resource(cbdev, PCI_RES_BUS, 0, sc->sc_bus); #endif return (0); @@ -180,6 +181,7 @@ cardbus_attach_card(device_t cbdev) sc = device_get_softc(cbdev); cardbus_detach_card(cbdev); /* detach existing cards */ + POWER_DISABLE_SOCKET(brdev, cbdev); /* Turn the socket off first */ POWER_ENABLE_SOCKET(brdev, cbdev); domain = pcib_get_domain(cbdev); bus = pcib_get_bus(cbdev); Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Wed Feb 18 05:20:52 2015 (r278935) +++ head/sys/dev/pccbb/pccbb.c Wed Feb 18 05:53:04 2015 (r278936) @@ -155,7 +155,7 @@ SYSCTL_INT(_hw_cbb, OID_AUTO, debug, CTL static void cbb_insert(struct cbb_softc *sc); static void cbb_removal(struct cbb_softc *sc); static uint32_t cbb_detect_voltage(device_t brdev); -static void cbb_cardbus_reset_power(device_t brdev, device_t child, int on); +static int cbb_cardbus_reset_power(device_t brdev, device_t child, int on); static int cbb_cardbus_io_open(device_t brdev, int win, uint32_t start, uint32_t end); static int cbb_cardbus_mem_open(device_t brdev, int win, @@ -958,12 +958,12 @@ cbb_do_power(device_t brdev) /* CardBus power functions */ /************************************************************************/ -static void +static int cbb_cardbus_reset_power(device_t brdev, device_t child, int on) { struct cbb_softc *sc = device_get_softc(brdev); - uint32_t b; - int delay, count; + uint32_t b, h; + int delay, count, zero_seen, func; /* * Asserting reset for 20ms is necessary for most bridges. For some @@ -1002,30 +1002,61 @@ cbb_cardbus_reset_power(device_t brdev, 0xfffffffful && --count >= 0); if (count < 0) device_printf(brdev, "Warning: Bus reset timeout\n"); + + /* + * Some cards (so far just an atheros card I have) seem to + * come out of reset in a funky state. They report they are + * multi-function cards, but have nonsense for some of the + * higher functions. So if the card claims to be MFDEV, and + * any of the higher functions' ID is 0, then we've hit the + * bug and we'll try again. + */ + h = PCIB_READ_CONFIG(brdev, b, 0, 0, PCIR_HDRTYPE, 1); + if ((h & PCIM_MFDEV) == 0) + return 0; + zero_seen = 0; + for (func = 1; func < 8; func++) { + h = PCIB_READ_CONFIG(brdev, b, 0, func, + PCIR_DEVVENDOR, 4); + if (h == 0) + zero_seen++; + } + if (!zero_seen) + return 0; + return (EINVAL); } + return 0; +} + +static int +cbb_cardbus_power_disable_socket(device_t brdev, device_t child) +{ + cbb_power(brdev, CARD_OFF); + cbb_cardbus_reset_power(brdev, child, 0); + return (0); } static int cbb_cardbus_power_enable_socket(device_t brdev, device_t child) { struct cbb_softc *sc = device_get_softc(brdev); - int err; + int err, count; if (!CBB_CARD_PRESENT(cbb_get(sc, CBB_SOCKET_STATE))) return (ENODEV); - err = cbb_do_power(brdev); - if (err) - return (err); - cbb_cardbus_reset_power(brdev, child, 1); - return (0); -} - -static int -cbb_cardbus_power_disable_socket(device_t brdev, device_t child) -{ - cbb_power(brdev, CARD_OFF); - cbb_cardbus_reset_power(brdev, child, 0); + count = 10; + do { + err = cbb_do_power(brdev); + if (err) + return (err); + err = cbb_cardbus_reset_power(brdev, child, 1); + if (err) { + device_printf(brdev, "Reset failed, trying again.\n"); + cbb_cardbus_power_disable_socket(brdev, child); + pause("cbbErr1", hz / 10); /* wait 100ms */ + } + } while (err != 0 && count-- > 0); return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 06:18:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F86393C; Wed, 18 Feb 2015 06:18:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5026D251; Wed, 18 Feb 2015 06:18:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1I6IqpE073501; Wed, 18 Feb 2015 06:18:52 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1I6Iqjn073500; Wed, 18 Feb 2015 06:18:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502180618.t1I6Iqjn073500@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 18 Feb 2015 06:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278937 - head/sys/dev/sfxge 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 06:18:52 -0000 Author: arybchik Date: Wed Feb 18 06:18:51 2015 New Revision: 278937 URL: https://svnweb.freebsd.org/changeset/base/278937 Log: sfxge: add TCP segment size to sfxge_tso_state It avoids access to m_pkthdr when TSO packet is started and also makes tso_start_new_packet() function smaller. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Wed Feb 18 05:53:04 2015 (r278936) +++ head/sys/dev/sfxge/sfxge_tx.c Wed Feb 18 06:18:51 2015 (r278937) @@ -791,6 +791,7 @@ struct sfxge_tso_state { ssize_t nh_off; /* Offset of network header */ ssize_t tcph_off; /* Offset of TCP header */ unsigned header_len; /* Number of bytes of header */ + unsigned seg_size; /* TCP segment size */ }; static const struct ip *tso_iph(const struct sfxge_tso_state *tso) @@ -892,6 +893,7 @@ static void tso_start(struct sfxge_tso_s } tso->header_len = tso->tcph_off + 4 * tso_tcph(tso)->th_off; + tso->seg_size = mbuf->m_pkthdr.tso_segsz; tso->seqnum = ntohl(tso_tcph(tso)->th_seq); @@ -1008,11 +1010,10 @@ static int tso_start_new_packet(struct s m_copydata(tso->mbuf, 0, tso->header_len, header); tsoh_th->th_seq = htonl(tso->seqnum); - tso->seqnum += tso->mbuf->m_pkthdr.tso_segsz; - if (tso->out_len > tso->mbuf->m_pkthdr.tso_segsz) { + tso->seqnum += tso->seg_size; + if (tso->out_len > tso->seg_size) { /* This packet will not finish the TSO burst. */ - ip_length = tso->header_len - tso->nh_off + - tso->mbuf->m_pkthdr.tso_segsz; + ip_length = tso->header_len - tso->nh_off + tso->seg_size; tsoh_th->th_flags &= ~(TH_FIN | TH_PUSH); } else { /* This packet will be the last in the TSO burst. */ @@ -1034,7 +1035,7 @@ static int tso_start_new_packet(struct s /* Make the header visible to the hardware. */ bus_dmamap_sync(txq->packet_dma_tag, map, BUS_DMASYNC_PREWRITE); - tso->packet_space = tso->mbuf->m_pkthdr.tso_segsz; + tso->packet_space = tso->seg_size; txq->tso_packets++; /* Form a descriptor for this header. */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 06:19:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFDB3AA5; Wed, 18 Feb 2015 06:19:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 AFE4E25E; Wed, 18 Feb 2015 06:19:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1I6JaXp073648; Wed, 18 Feb 2015 06:19:36 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1I6JaIb073645; Wed, 18 Feb 2015 06:19:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502180619.t1I6JaIb073645@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 18 Feb 2015 06:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278938 - head/sys/dev/sfxge 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 06:19:36 -0000 Author: arybchik Date: Wed Feb 18 06:19:35 2015 New Revision: 278938 URL: https://svnweb.freebsd.org/changeset/base/278938 Log: sfxge: add driver context member with number of transmit queues Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_tx.c head/sys/dev/sfxge/sfxge_tx.h Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Wed Feb 18 06:18:51 2015 (r278937) +++ head/sys/dev/sfxge/sfxge.h Wed Feb 18 06:19:35 2015 (r278938) @@ -259,6 +259,8 @@ struct sfxge_softc { struct mtx tx_lock __aligned(CACHE_LINE_SIZE); char tx_lock_name[SFXGE_LOCK_NAME_MAX]; #endif + + unsigned int txq_count; }; #define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN) Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Wed Feb 18 06:18:51 2015 (r278937) +++ head/sys/dev/sfxge/sfxge_tx.c Wed Feb 18 06:19:35 2015 (r278938) @@ -649,7 +649,7 @@ sfxge_if_qflush(struct ifnet *ifp) sc = ifp->if_softc; - for (i = 0; i < SFXGE_TXQ_IP_TCP_UDP_CKSUM + SFXGE_TX_SCALE(sc); i++) + for (i = 0; i < sc->txq_count; i++) sfxge_tx_qdpl_flush(sc->txq[i]); } @@ -1280,13 +1280,9 @@ sfxge_tx_stop(struct sfxge_softc *sc) { int index; - index = SFXGE_TX_SCALE(sc); + index = sc->txq_count; while (--index >= 0) - sfxge_tx_qstop(sc, SFXGE_TXQ_IP_TCP_UDP_CKSUM + index); - - sfxge_tx_qstop(sc, SFXGE_TXQ_IP_CKSUM); - - sfxge_tx_qstop(sc, SFXGE_TXQ_NON_CKSUM); + sfxge_tx_qstop(sc, index); /* Tear down the transmit module */ efx_tx_fini(sc->enp); @@ -1302,30 +1298,17 @@ sfxge_tx_start(struct sfxge_softc *sc) if ((rc = efx_tx_init(sc->enp)) != 0) return (rc); - if ((rc = sfxge_tx_qstart(sc, SFXGE_TXQ_NON_CKSUM)) != 0) - goto fail; - - if ((rc = sfxge_tx_qstart(sc, SFXGE_TXQ_IP_CKSUM)) != 0) - goto fail2; - - for (index = 0; index < SFXGE_TX_SCALE(sc); index++) { - if ((rc = sfxge_tx_qstart(sc, SFXGE_TXQ_IP_TCP_UDP_CKSUM + - index)) != 0) - goto fail3; + for (index = 0; index < sc->txq_count; index++) { + if ((rc = sfxge_tx_qstart(sc, index)) != 0) + goto fail; } return (0); -fail3: +fail: while (--index >= 0) - sfxge_tx_qstop(sc, SFXGE_TXQ_IP_TCP_UDP_CKSUM + index); - - sfxge_tx_qstop(sc, SFXGE_TXQ_IP_CKSUM); - -fail2: - sfxge_tx_qstop(sc, SFXGE_TXQ_NON_CKSUM); + sfxge_tx_qstop(sc, index); -fail: efx_tx_fini(sc->enp); return (rc); @@ -1536,9 +1519,7 @@ sfxge_tx_stat_handler(SYSCTL_HANDLER_ARG /* Sum across all TX queues */ sum = 0; - for (index = 0; - index < SFXGE_TXQ_IP_TCP_UDP_CKSUM + SFXGE_TX_SCALE(sc); - index++) + for (index = 0; index < sc->txq_count; index++) sum += *(unsigned long *)((caddr_t)sc->txq[index] + sfxge_tx_stats[id].offset); @@ -1571,12 +1552,11 @@ sfxge_tx_fini(struct sfxge_softc *sc) { int index; - index = SFXGE_TX_SCALE(sc); + index = sc->txq_count; while (--index >= 0) - sfxge_tx_qfini(sc, SFXGE_TXQ_IP_TCP_UDP_CKSUM + index); + sfxge_tx_qfini(sc, index); - sfxge_tx_qfini(sc, SFXGE_TXQ_IP_CKSUM); - sfxge_tx_qfini(sc, SFXGE_TXQ_NON_CKSUM); + sc->txq_count = 0; } @@ -1592,6 +1572,12 @@ sfxge_tx_init(struct sfxge_softc *sc) KASSERT(intr->state == SFXGE_INTR_INITIALIZED, ("intr->state != SFXGE_INTR_INITIALIZED")); +#ifdef SFXGE_HAVE_MQ + sc->txq_count = SFXGE_TXQ_NTYPES - 1 + sc->intr.n_alloc; +#else + sc->txq_count = SFXGE_TXQ_NTYPES; +#endif + sc->txqs_node = SYSCTL_ADD_NODE( device_get_sysctl_ctx(sc->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), @@ -1610,8 +1596,10 @@ sfxge_tx_init(struct sfxge_softc *sc) SFXGE_TXQ_IP_CKSUM, 0)) != 0) goto fail2; - for (index = 0; index < SFXGE_TX_SCALE(sc); index++) { - if ((rc = sfxge_tx_qinit(sc, SFXGE_TXQ_IP_TCP_UDP_CKSUM + index, + for (index = 0; + index < sc->txq_count - SFXGE_TXQ_NTYPES + 1; + index++) { + if ((rc = sfxge_tx_qinit(sc, SFXGE_TXQ_NTYPES - 1 + index, SFXGE_TXQ_IP_TCP_UDP_CKSUM, index)) != 0) goto fail3; } @@ -1621,15 +1609,16 @@ sfxge_tx_init(struct sfxge_softc *sc) return (0); fail3: - sfxge_tx_qfini(sc, SFXGE_TXQ_IP_CKSUM); - while (--index >= 0) sfxge_tx_qfini(sc, SFXGE_TXQ_IP_TCP_UDP_CKSUM + index); + sfxge_tx_qfini(sc, SFXGE_TXQ_IP_CKSUM); + fail2: sfxge_tx_qfini(sc, SFXGE_TXQ_NON_CKSUM); fail: fail_txq_node: + sc->txq_count = 0; return (rc); } Modified: head/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.h Wed Feb 18 06:18:51 2015 (r278937) +++ head/sys/dev/sfxge/sfxge_tx.h Wed Feb 18 06:19:35 2015 (r278938) @@ -124,10 +124,8 @@ enum sfxge_txq_type { #ifdef SFXGE_HAVE_MQ #define SFXGE_TX_LOCK(txq) (&(txq)->lock) -#define SFXGE_TX_SCALE(sc) ((sc)->intr.n_alloc) #else #define SFXGE_TX_LOCK(txq) (&(txq)->sc->tx_lock) -#define SFXGE_TX_SCALE(sc) 1 #endif #define SFXGE_TXQ_LOCK_INIT(_txq, _ifname, _txq_index) \ From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 06:21:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53B62C0D; Wed, 18 Feb 2015 06:21:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3E9D0323; Wed, 18 Feb 2015 06:21:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1I6L0vm077323; Wed, 18 Feb 2015 06:21:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1I6KxDg077315; Wed, 18 Feb 2015 06:20:59 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502180620.t1I6KxDg077315@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 18 Feb 2015 06:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278939 - head/sys/dev/sfxge 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 06:21:00 -0000 Author: arybchik Date: Wed Feb 18 06:20:59 2015 New Revision: 278939 URL: https://svnweb.freebsd.org/changeset/base/278939 Log: sfxge: add driver context member with number of receive queues Mainly to unify with similar member for transmit queues. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Wed Feb 18 06:19:35 2015 (r278938) +++ head/sys/dev/sfxge/sfxge.h Wed Feb 18 06:20:59 2015 (r278939) @@ -260,6 +260,7 @@ struct sfxge_softc { char tx_lock_name[SFXGE_LOCK_NAME_MAX]; #endif + unsigned int rxq_count; unsigned int txq_count; }; Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Wed Feb 18 06:19:35 2015 (r278938) +++ head/sys/dev/sfxge/sfxge_rx.c Wed Feb 18 06:20:59 2015 (r278939) @@ -939,13 +939,10 @@ fail: void sfxge_rx_stop(struct sfxge_softc *sc) { - struct sfxge_intr *intr; int index; - intr = &sc->intr; - /* Stop the receive queue(s) */ - index = intr->n_alloc; + index = sc->rxq_count; while (--index >= 0) sfxge_rx_qstop(sc, index); @@ -987,7 +984,7 @@ sfxge_rx_start(struct sfxge_softc *sc) * Set up the scale table. Enable all hash types and hash insertion. */ for (index = 0; index < SFXGE_RX_SCALE_MAX; index++) - sc->rx_indir_table[index] = index % sc->intr.n_alloc; + sc->rx_indir_table[index] = index % sc->rxq_count; if ((rc = efx_rx_scale_tbl_set(sc->enp, sc->rx_indir_table, SFXGE_RX_SCALE_MAX)) != 0) goto fail; @@ -1000,7 +997,7 @@ sfxge_rx_start(struct sfxge_softc *sc) goto fail; /* Start the receive queue(s). */ - for (index = 0; index < intr->n_alloc; index++) { + for (index = 0; index < sc->rxq_count; index++) { if ((rc = sfxge_rx_qstart(sc, index)) != 0) goto fail2; } @@ -1099,7 +1096,7 @@ sfxge_rx_qinit(struct sfxge_softc *sc, u efsys_mem_t *esmp; int rc; - KASSERT(index < sc->intr.n_alloc, ("index >= %d", sc->intr.n_alloc)); + KASSERT(index < sc->rxq_count, ("index >= %d", sc->rxq_count)); rxq = malloc(sizeof(struct sfxge_rxq), M_SFXGE, M_ZERO | M_WAITOK); rxq->sc = sc; @@ -1159,7 +1156,7 @@ sfxge_rx_stat_handler(SYSCTL_HANDLER_ARG /* Sum across all RX queues */ sum = 0; - for (index = 0; index < sc->intr.n_alloc; index++) + for (index = 0; index < sc->rxq_count; index++) sum += *(unsigned int *)((caddr_t)sc->rxq[index] + sfxge_rx_stats[id].offset); @@ -1190,14 +1187,13 @@ sfxge_rx_stat_init(struct sfxge_softc *s void sfxge_rx_fini(struct sfxge_softc *sc) { - struct sfxge_intr *intr; int index; - intr = &sc->intr; - - index = intr->n_alloc; + index = sc->rxq_count; while (--index >= 0) sfxge_rx_qfini(sc, index); + + sc->rxq_count = 0; } int @@ -1212,11 +1208,13 @@ sfxge_rx_init(struct sfxge_softc *sc) intr = &sc->intr; + sc->rxq_count = intr->n_alloc; + KASSERT(intr->state == SFXGE_INTR_INITIALIZED, ("intr->state != SFXGE_INTR_INITIALIZED")); /* Initialize the receive queue(s) - one per interrupt. */ - for (index = 0; index < intr->n_alloc; index++) { + for (index = 0; index < sc->rxq_count; index++) { if ((rc = sfxge_rx_qinit(sc, index)) != 0) goto fail; } @@ -1230,5 +1228,6 @@ fail: while (--index >= 0) sfxge_rx_qfini(sc, index); + sc->rxq_count = 0; return (rc); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 06:22:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25CBED60; Wed, 18 Feb 2015 06:22:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 104B0332; Wed, 18 Feb 2015 06:22:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1I6M0st077515; Wed, 18 Feb 2015 06:22:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1I6M0wU077512; Wed, 18 Feb 2015 06:22:00 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502180622.t1I6M0wU077512@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 18 Feb 2015 06:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278940 - head/sys/dev/sfxge 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 06:22:01 -0000 Author: arybchik Date: Wed Feb 18 06:21:59 2015 New Revision: 278940 URL: https://svnweb.freebsd.org/changeset/base/278940 Log: sfxge: add driver context member with number of event queues Mainly to unify with similar member for transmit and receive queues. It will be used in the future for resources allocation processing. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_ev.c Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Wed Feb 18 06:20:59 2015 (r278939) +++ head/sys/dev/sfxge/sfxge.h Wed Feb 18 06:21:59 2015 (r278940) @@ -260,6 +260,7 @@ struct sfxge_softc { char tx_lock_name[SFXGE_LOCK_NAME_MAX]; #endif + unsigned int evq_count; unsigned int rxq_count; unsigned int txq_count; }; Modified: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Wed Feb 18 06:20:59 2015 (r278939) +++ head/sys/dev/sfxge/sfxge_ev.c Wed Feb 18 06:21:59 2015 (r278940) @@ -427,7 +427,7 @@ sfxge_ev_stat_update(struct sfxge_softc sc->ev_stats_update_time = now; /* Add event counts from each event queue in turn */ - for (index = 0; index < sc->intr.n_alloc; index++) { + for (index = 0; index < sc->evq_count; index++) { evq = sc->evq[index]; SFXGE_EVQ_LOCK(evq); efx_ev_qstats_update(evq->common, sc->ev_stats); @@ -493,7 +493,7 @@ sfxge_int_mod_handler(SYSCTL_HANDLER_ARG struct sfxge_intr *intr = &sc->intr; unsigned int moderation; int error; - int index; + unsigned int index; SFXGE_ADAPTER_LOCK(sc); @@ -513,7 +513,7 @@ sfxge_int_mod_handler(SYSCTL_HANDLER_ARG sc->ev_moderation = moderation; if (intr->state == SFXGE_INTR_STARTED) { - for (index = 0; index < intr->n_alloc; index++) + for (index = 0; index < sc->evq_count; index++) sfxge_ev_qmoderate(sc, index, moderation); } } else { @@ -727,7 +727,7 @@ sfxge_ev_stop(struct sfxge_softc *sc) ("Interrupts not started")); /* Stop the event queue(s) */ - index = intr->n_alloc; + index = sc->evq_count; while (--index >= 0) sfxge_ev_qstop(sc, index); @@ -752,7 +752,7 @@ sfxge_ev_start(struct sfxge_softc *sc) return (rc); /* Start the event queues */ - for (index = 0; index < intr->n_alloc; index++) { + for (index = 0; index < sc->evq_count; index++) { if ((rc = sfxge_ev_qstart(sc, index)) != 0) goto fail; } @@ -853,9 +853,11 @@ sfxge_ev_fini(struct sfxge_softc *sc) sc->ev_moderation = 0; /* Tear down the event queue(s). */ - index = intr->n_alloc; + index = sc->evq_count; while (--index >= 0) sfxge_ev_qfini(sc, index); + + sc->evq_count = 0; } int @@ -869,6 +871,8 @@ sfxge_ev_init(struct sfxge_softc *sc) intr = &sc->intr; + sc->evq_count = intr->n_alloc; + KASSERT(intr->state == SFXGE_INTR_INITIALIZED, ("intr->state != SFXGE_INTR_INITIALIZED")); @@ -884,7 +888,7 @@ sfxge_ev_init(struct sfxge_softc *sc) /* * Initialize the event queue(s) - one per interrupt. */ - for (index = 0; index < intr->n_alloc; index++) { + for (index = 0; index < sc->evq_count; index++) { if ((rc = sfxge_ev_qinit(sc, index)) != 0) goto fail; } @@ -899,5 +903,6 @@ fail: while (--index >= 0) sfxge_ev_qfini(sc, index); + sc->evq_count = 0; return (rc); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 06:23:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6148EC9; Wed, 18 Feb 2015 06:23:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9078E346; Wed, 18 Feb 2015 06:23:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1I6NHkx077720; Wed, 18 Feb 2015 06:23:17 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1I6NGnJ077715; Wed, 18 Feb 2015 06:23:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502180623.t1I6NGnJ077715@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 18 Feb 2015 06:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278941 - head/sys/dev/sfxge/common 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 06:23:17 -0000 Author: arybchik Date: Wed Feb 18 06:23:16 2015 New Revision: 278941 URL: https://svnweb.freebsd.org/changeset/base/278941 Log: sfxge: support variable-length response to MCDI GET_BOARD_CFG Allocate the minimum or maximum response length for GET_BOARD_CFG as appropriate. When looking up firmware subtypes by partition ID, check the ID against the actual response length. Merge of the patch made by Ben Hutchings in 2011. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h head/sys/dev/sfxge/common/siena_nic.c head/sys/dev/sfxge/common/siena_nvram.c Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_mcdi.h Wed Feb 18 06:21:59 2015 (r278940) +++ head/sys/dev/sfxge/common/efx_regs_mcdi.h Wed Feb 18 06:23:16 2015 (r278941) @@ -709,7 +709,9 @@ #define MC_CMD_GET_BOARD_CFG_IN_LEN 0 /* MC_CMD_GET_BOARD_CFG_OUT msgresponse */ -#define MC_CMD_GET_BOARD_CFG_OUT_LEN 96 +#define MC_CMD_GET_BOARD_CFG_OUT_LENMIN 96 +#define MC_CMD_GET_BOARD_CFG_OUT_LENMAX 136 +#define MC_CMD_GET_BOARD_CFG_OUT_LEN(num) (72+2*(num)) #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_TYPE_OFST 0 #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_NAME_OFST 4 #define MC_CMD_GET_BOARD_CFG_OUT_BOARD_NAME_LEN 32 @@ -729,7 +731,8 @@ #define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT1_OFST 68 #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_OFST 72 #define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_LEN 2 -#define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_NUM 12 +#define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_MINNUM 12 +#define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_MAXNUM 32 /***********************************/ Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Wed Feb 18 06:21:59 2015 (r278940) +++ head/sys/dev/sfxge/common/siena_nic.c Wed Feb 18 06:23:16 2015 (r278941) @@ -276,7 +276,7 @@ siena_board_cfg( { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip); - uint8_t outbuf[MAX(MC_CMD_GET_BOARD_CFG_OUT_LEN, + uint8_t outbuf[MAX(MC_CMD_GET_BOARD_CFG_OUT_LENMIN, MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN)]; efx_mcdi_req_t req; uint8_t *src; @@ -288,7 +288,7 @@ siena_board_cfg( req.emr_in_buf = NULL; req.emr_in_length = 0; req.emr_out_buf = outbuf; - req.emr_out_length = MC_CMD_GET_BOARD_CFG_OUT_LEN; + req.emr_out_length = MC_CMD_GET_BOARD_CFG_OUT_LENMIN; efx_mcdi_execute(enp, &req); @@ -297,7 +297,7 @@ siena_board_cfg( goto fail1; } - if (req.emr_out_length_used < MC_CMD_GET_BOARD_CFG_OUT_LEN) { + if (req.emr_out_length_used < MC_CMD_GET_BOARD_CFG_OUT_LENMIN) { rc = EMSGSIZE; goto fail2; } Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Wed Feb 18 06:21:59 2015 (r278940) +++ head/sys/dev/sfxge/common/siena_nvram.c Wed Feb 18 06:23:16 2015 (r278941) @@ -587,7 +587,7 @@ siena_nvram_get_subtype( __out uint32_t *subtypep) { efx_mcdi_req_t req; - uint8_t outbuf[MC_CMD_GET_BOARD_CFG_OUT_LEN]; + uint8_t outbuf[MC_CMD_GET_BOARD_CFG_OUT_LENMAX]; efx_word_t *fw_list; int rc; @@ -605,17 +605,26 @@ siena_nvram_get_subtype( goto fail1; } - if (req.emr_out_length_used < MC_CMD_GET_BOARD_CFG_OUT_LEN) { + if (req.emr_out_length_used < MC_CMD_GET_BOARD_CFG_OUT_LENMIN) { rc = EMSGSIZE; goto fail2; } + if (req.emr_out_length_used < + MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_OFST + + (partn + 1) * sizeof(efx_word_t)) { + rc = ENOENT; + goto fail3; + } + fw_list = MCDI_OUT2(req, efx_word_t, GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST); *subtypep = EFX_WORD_FIELD(fw_list[partn], EFX_WORD_0); return (0); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 06:26:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00CC8A7; Wed, 18 Feb 2015 06:26:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C597F358; Wed, 18 Feb 2015 06:26:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1I6Q8Sg078135; Wed, 18 Feb 2015 06:26:08 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1I6Q89l078132; Wed, 18 Feb 2015 06:26:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502180626.t1I6Q89l078132@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 18 Feb 2015 06:26:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278942 - head/sys/dev/sfxge/common 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 06:26:09 -0000 Author: arybchik Date: Wed Feb 18 06:26:07 2015 New Revision: 278942 URL: https://svnweb.freebsd.org/changeset/base/278942 Log: sfxge: fix broken MCDI_EV_FIELD() macro Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/siena_phy.c Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Wed Feb 18 06:23:16 2015 (r278941) +++ head/sys/dev/sfxge/common/efx_ev.c Wed Feb 18 06:26:07 2015 (r278942) @@ -577,9 +577,9 @@ efx_ev_mcdi( case MCDI_EVENT_CODE_CMDDONE: efx_mcdi_ev_cpl(enp, - MCDI_EV_FIELD(*eqp, CMDDONE_SEQ), - MCDI_EV_FIELD(*eqp, CMDDONE_DATALEN), - MCDI_EV_FIELD(*eqp, CMDDONE_ERRNO)); + MCDI_EV_FIELD(eqp, CMDDONE_SEQ), + MCDI_EV_FIELD(eqp, CMDDONE_DATALEN), + MCDI_EV_FIELD(eqp, CMDDONE_ERRNO)); break; case MCDI_EVENT_CODE_LINKCHANGE: { Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Wed Feb 18 06:23:16 2015 (r278941) +++ head/sys/dev/sfxge/common/efx_mcdi.h Wed Feb 18 06:26:07 2015 (r278942) @@ -231,7 +231,7 @@ efx_mcdi_version( MC_CMD_ ## _field) #define MCDI_EV_FIELD(_eqp, _field) \ - EFX_QWORD_FIELD(*eqp, MCDI_EVENT_ ## _field) + EFX_QWORD_FIELD(*_eqp, MCDI_EVENT_ ## _field) #ifdef __cplusplus } Modified: head/sys/dev/sfxge/common/siena_phy.c ============================================================================== --- head/sys/dev/sfxge/common/siena_phy.c Wed Feb 18 06:23:16 2015 (r278941) +++ head/sys/dev/sfxge/common/siena_phy.c Wed Feb 18 06:26:07 2015 (r278942) @@ -122,7 +122,7 @@ siena_phy_link_ev( * Convert the LINKCHANGE speed enumeration into mbit/s, in the * same way as GET_LINK encodes the speed */ - switch (MCDI_EV_FIELD(*eqp, LINKCHANGE_SPEED)) { + switch (MCDI_EV_FIELD(eqp, LINKCHANGE_SPEED)) { case MCDI_EVENT_LINKCHANGE_SPEED_100M: speed = 100; break; @@ -137,11 +137,11 @@ siena_phy_link_ev( break; } - link_flags = MCDI_EV_FIELD(*eqp, LINKCHANGE_LINK_FLAGS); + link_flags = MCDI_EV_FIELD(eqp, LINKCHANGE_LINK_FLAGS); siena_phy_decode_link_mode(enp, link_flags, speed, - MCDI_EV_FIELD(*eqp, LINKCHANGE_FCNTL), + MCDI_EV_FIELD(eqp, LINKCHANGE_FCNTL), &link_mode, &fcntl); - siena_phy_decode_cap(MCDI_EV_FIELD(*eqp, LINKCHANGE_LP_CAP), + siena_phy_decode_cap(MCDI_EV_FIELD(eqp, LINKCHANGE_LP_CAP), &lp_cap_mask); /* From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 06:26:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3A8F306; Wed, 18 Feb 2015 06:26:54 +0000 (UTC) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) (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 C0E8B385; Wed, 18 Feb 2015 06:26:54 +0000 (UTC) Received: by iecar1 with SMTP id ar1so46561328iec.11; Tue, 17 Feb 2015 22:26:48 -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=sQ4dSar0YKICHCYXBp1Rztk2dnsqbSQevJMk/gJ0eEQ=; b=qMypDQpaZC8U7fKhcqlN47trMkwLcz/AT/ZIsLjhaEv+9gnOzurtgdx8pa4CXxQolF rAy0uudfObrHNDpbv5KIpeo+i8juBuSavMFb29i9Ztr1/t4yNtGqW0uY4CAgtu8+iJqq TRO3of47z99/Od8rzjsEPa3NUdyb6g/Cgjk4UVBiH3uvyXWai9D6LJ5GiyPUtnHvu6KC wOb7bIvkhSbsvBInpOiyW0sTniHjJ9kqxNJGPA52jemFL/I34DVyspHcVK0Qcdcp3gcT mcV03EC9sY32lUyQdlpWqS7Ff819F/tqh1acLoP/7z0P6xMPcbDWiec+pzrTcsxmxW1/ RW+A== MIME-Version: 1.0 X-Received: by 10.42.188.133 with SMTP id da5mr38568446icb.37.1424240808560; Tue, 17 Feb 2015 22:26:48 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.17.66 with HTTP; Tue, 17 Feb 2015 22:26:48 -0800 (PST) In-Reply-To: <201502180553.t1I5r5CF063356@svn.freebsd.org> References: <201502180553.t1I5r5CF063356@svn.freebsd.org> Date: Tue, 17 Feb 2015 22:26:48 -0800 X-Google-Sender-Auth: c0akGuDqFhLNAE9W67JndZRO6DA Message-ID: Subject: Re: svn commit: r278936 - in head/sys/dev: cardbus pccbb From: Adrian Chadd To: Warner Losh Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 18 Feb 2015 06:26:55 -0000 Hm! Can you dump the config space when this happens, just locally? I'd like to see what the device id and sub ids are. (That'll tell me if the thing hit a power-on bug, which there has actually been a reset power-on "bug" in atheros hardware since.. well, forever.) -adrian On 17 February 2015 at 21:53, Warner Losh wrote: > Author: imp > Date: Wed Feb 18 05:53:04 2015 > New Revision: 278936 > URL: https://svnweb.freebsd.org/changeset/base/278936 > > Log: > On my Lenovo T400, a Atheros 2413 has a problem powering up > sometimes. It will power up wrong and identify itself badly: > > cardbus0: at device 0.0 (no driver attached) > cardbus0: at device 0.1 (no driver attached) > cardbus0: at device 0.2 (no driver attached) > cardbus0: at device 0.3 (no driver attached) > cardbus0: at device 0.4 (no driver attached) > cardbus0: at device 0.5 (no driver attached) > cardbus0: at device 0.6 (no driver attached) > cardbus0: at device 0.7 (no driver attached) > > All the higher numbered functions (.2 and above) have a config space > of all 0's. This smells a bit like a special debug mode, but the > current atheros driver doesn't cope. It is unclear if this card is > just a flake, or if we're doing something wrong in the power-up > sequence. > > Put a work around into the code that tests for this rather unusual > condition. If we power a CardBus device up, and the device says it is > multi-function, and any of the functions have a 0 device ID, try the > power-up sequence again. > > Modified: > head/sys/dev/cardbus/cardbus.c > head/sys/dev/pccbb/pccbb.c > > Modified: head/sys/dev/cardbus/cardbus.c > ============================================================================== > --- head/sys/dev/cardbus/cardbus.c Wed Feb 18 05:20:52 2015 (r278935) > +++ head/sys/dev/cardbus/cardbus.c Wed Feb 18 05:53:04 2015 (r278936) > @@ -122,6 +122,7 @@ cardbus_detach(device_t cbdev) > cardbus_detach_card(cbdev); > #ifdef PCI_RES_BUS > sc = device_get_softc(cbdev); > + device_printf(cbdev, "Freeing up the allocatd bus\n"); > (void)bus_release_resource(cbdev, PCI_RES_BUS, 0, sc->sc_bus); > #endif > return (0); > @@ -180,6 +181,7 @@ cardbus_attach_card(device_t cbdev) > > sc = device_get_softc(cbdev); > cardbus_detach_card(cbdev); /* detach existing cards */ > + POWER_DISABLE_SOCKET(brdev, cbdev); /* Turn the socket off first */ > POWER_ENABLE_SOCKET(brdev, cbdev); > domain = pcib_get_domain(cbdev); > bus = pcib_get_bus(cbdev); > > Modified: head/sys/dev/pccbb/pccbb.c > ============================================================================== > --- head/sys/dev/pccbb/pccbb.c Wed Feb 18 05:20:52 2015 (r278935) > +++ head/sys/dev/pccbb/pccbb.c Wed Feb 18 05:53:04 2015 (r278936) > @@ -155,7 +155,7 @@ SYSCTL_INT(_hw_cbb, OID_AUTO, debug, CTL > static void cbb_insert(struct cbb_softc *sc); > static void cbb_removal(struct cbb_softc *sc); > static uint32_t cbb_detect_voltage(device_t brdev); > -static void cbb_cardbus_reset_power(device_t brdev, device_t child, int on); > +static int cbb_cardbus_reset_power(device_t brdev, device_t child, int on); > static int cbb_cardbus_io_open(device_t brdev, int win, uint32_t start, > uint32_t end); > static int cbb_cardbus_mem_open(device_t brdev, int win, > @@ -958,12 +958,12 @@ cbb_do_power(device_t brdev) > /* CardBus power functions */ > /************************************************************************/ > > -static void > +static int > cbb_cardbus_reset_power(device_t brdev, device_t child, int on) > { > struct cbb_softc *sc = device_get_softc(brdev); > - uint32_t b; > - int delay, count; > + uint32_t b, h; > + int delay, count, zero_seen, func; > > /* > * Asserting reset for 20ms is necessary for most bridges. For some > @@ -1002,30 +1002,61 @@ cbb_cardbus_reset_power(device_t brdev, > 0xfffffffful && --count >= 0); > if (count < 0) > device_printf(brdev, "Warning: Bus reset timeout\n"); > + > + /* > + * Some cards (so far just an atheros card I have) seem to > + * come out of reset in a funky state. They report they are > + * multi-function cards, but have nonsense for some of the > + * higher functions. So if the card claims to be MFDEV, and > + * any of the higher functions' ID is 0, then we've hit the > + * bug and we'll try again. > + */ > + h = PCIB_READ_CONFIG(brdev, b, 0, 0, PCIR_HDRTYPE, 1); > + if ((h & PCIM_MFDEV) == 0) > + return 0; > + zero_seen = 0; > + for (func = 1; func < 8; func++) { > + h = PCIB_READ_CONFIG(brdev, b, 0, func, > + PCIR_DEVVENDOR, 4); > + if (h == 0) > + zero_seen++; > + } > + if (!zero_seen) > + return 0; > + return (EINVAL); > } > + return 0; > +} > + > +static int > +cbb_cardbus_power_disable_socket(device_t brdev, device_t child) > +{ > + cbb_power(brdev, CARD_OFF); > + cbb_cardbus_reset_power(brdev, child, 0); > + return (0); > } > > static int > cbb_cardbus_power_enable_socket(device_t brdev, device_t child) > { > struct cbb_softc *sc = device_get_softc(brdev); > - int err; > + int err, count; > > if (!CBB_CARD_PRESENT(cbb_get(sc, CBB_SOCKET_STATE))) > return (ENODEV); > > - err = cbb_do_power(brdev); > - if (err) > - return (err); > - cbb_cardbus_reset_power(brdev, child, 1); > - return (0); > -} > - > -static int > -cbb_cardbus_power_disable_socket(device_t brdev, device_t child) > -{ > - cbb_power(brdev, CARD_OFF); > - cbb_cardbus_reset_power(brdev, child, 0); > + count = 10; > + do { > + err = cbb_do_power(brdev); > + if (err) > + return (err); > + err = cbb_cardbus_reset_power(brdev, child, 1); > + if (err) { > + device_printf(brdev, "Reset failed, trying again.\n"); > + cbb_cardbus_power_disable_socket(brdev, child); > + pause("cbbErr1", hz / 10); /* wait 100ms */ > + } > + } while (err != 0 && count-- > 0); > return (0); > } > > From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 06:53:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29467733; Wed, 18 Feb 2015 06:53:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 13E93880; Wed, 18 Feb 2015 06:53:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1I6rexh091724; Wed, 18 Feb 2015 06:53:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1I6re0V091723; Wed, 18 Feb 2015 06:53:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201502180653.t1I6re0V091723@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 18 Feb 2015 06:53:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278943 - head/sys/powerpc/powermac 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 06:53:41 -0000 Author: jhibbits Date: Wed Feb 18 06:53:40 2015 New Revision: 278943 URL: https://svnweb.freebsd.org/changeset/base/278943 Log: Don't set the write bit if we're just reading. Also fix a couple typos. MFC after: 3 weeks Modified: head/sys/powerpc/powermac/atibl.c Modified: head/sys/powerpc/powermac/atibl.c ============================================================================== --- head/sys/powerpc/powermac/atibl.c Wed Feb 18 06:26:07 2015 (r278942) +++ head/sys/powerpc/powermac/atibl.c Wed Feb 18 06:53:40 2015 (r278943) @@ -162,14 +162,13 @@ atibl_pll_rreg(struct atibl_softc *sc, u { uint32_t data, save, tmp; - bus_write_1(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, - ((reg & 0x3f) | RADEON_PLL_WR_EN)); + bus_write_1(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, (reg & 0x3f)); (void)bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_DATA); (void)bus_read_4(sc->sc_memr, RADEON_CRTC_GEN_CNTL); data = bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_DATA); - /* Only necessary on R300, bt won't hurt others. */ + /* Only necessary on R300, but won't hurt others. */ save = bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX); tmp = save & (~0x3f | RADEON_PLL_WR_EN); bus_write_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, tmp); @@ -192,7 +191,7 @@ atibl_pll_wreg(struct atibl_softc *sc, u bus_write_4(sc->sc_memr, RADEON_CLOCK_CNTL_DATA, val); DELAY(5000); - /* Only necessary on R300, bt won't hurt others. */ + /* Only necessary on R300, but won't hurt others. */ save = bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX); tmp = save & (~0x3f | RADEON_PLL_WR_EN); bus_write_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, tmp); From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 07:34:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E32E2252; Wed, 18 Feb 2015 07:34:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B3E4ECA5; Wed, 18 Feb 2015 07:34:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1I7YXw4010712; Wed, 18 Feb 2015 07:34:33 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1I7YXrY010710; Wed, 18 Feb 2015 07:34:33 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201502180734.t1I7YXrY010710@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 18 Feb 2015 07:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278945 - head/sys/powerpc/powermac 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 07:34:34 -0000 Author: jhibbits Date: Wed Feb 18 07:34:32 2015 New Revision: 278945 URL: https://svnweb.freebsd.org/changeset/base/278945 Log: Match the right backlight driver. Some ATI-based PowerBooks use the string 'mnca' in the backlight controller device tree entry, so account for this and don't use nVidia when it's not an nVidia device. MFC after: 3 weeks Modified: head/sys/powerpc/powermac/atibl.c head/sys/powerpc/powermac/nvbl.c Modified: head/sys/powerpc/powermac/atibl.c ============================================================================== --- head/sys/powerpc/powermac/atibl.c Wed Feb 18 06:55:11 2015 (r278944) +++ head/sys/powerpc/powermac/atibl.c Wed Feb 18 07:34:32 2015 (r278945) @@ -38,6 +38,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#ifndef PCI_VENDOR_ID_ATI +#define PCI_VENDOR_ID_ATI 0x1002 +#endif /* From the xf86-video-ati driver's radeon_reg.h */ #define RADEON_LVDS_GEN_CNTL 0x02d0 @@ -121,7 +126,9 @@ atibl_probe(device_t dev) if (OF_getprop(handle, "backlight-control", &control, sizeof(control)) < 0) return (ENXIO); - if (strcmp(control, "ati") != 0) + if (strcmp(control, "ati") != 0 && + (strcmp(control, "mnca") != 0 || + pci_get_vendor(device_get_parent(dev)) != 0x1002)) return (ENXIO); device_set_desc(dev, "PowerBook backlight for ATI graphics"); Modified: head/sys/powerpc/powermac/nvbl.c ============================================================================== --- head/sys/powerpc/powermac/nvbl.c Wed Feb 18 06:55:11 2015 (r278944) +++ head/sys/powerpc/powermac/nvbl.c Wed Feb 18 07:34:32 2015 (r278945) @@ -38,6 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#define PCI_VENDOR_ID_NVIDIA 0x10de #define NVIDIA_BRIGHT_MIN (0x0ec) #define NVIDIA_BRIGHT_MAX (0x538) @@ -102,7 +105,8 @@ nvbl_probe(device_t dev) if (OF_getprop(handle, "backlight-control", &control, sizeof(control)) < 0) return (ENXIO); - if (strcmp(control, "mnca") != 0) + if ((strcmp(control, "mnca") != 0) || + pci_get_vendor(device_get_parent(dev)) != PCI_VENDOR_ID_NVIDIA) return (ENXIO); device_set_desc(dev, "PowerBook backlight for nVidia graphics"); From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 08:21:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85FA9D57; Wed, 18 Feb 2015 08:21:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 56ADD1AE; Wed, 18 Feb 2015 08:21:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1I8LqvK032002; Wed, 18 Feb 2015 08:21:52 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1I8Lqxj032000; Wed, 18 Feb 2015 08:21:52 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201502180821.t1I8Lqxj032000@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 18 Feb 2015 08:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278950 - head/sys/dev/random 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 08:21:53 -0000 Author: delphij Date: Wed Feb 18 08:21:51 2015 New Revision: 278950 URL: https://svnweb.freebsd.org/changeset/base/278950 Log: - fortuna.c: catch up with r278927 and fix a buffer overflow by using the temporary buffer when remaining space is not enough to hold a whole block. - yarrow.c: add a comment that we intend to change the code and remove memcpy's in the future. (*) Requested by: markm (*) Reviewed by: markm Approved by: so (self) Modified: head/sys/dev/random/fortuna.c head/sys/dev/random/yarrow.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Wed Feb 18 08:10:13 2015 (r278949) +++ head/sys/dev/random/fortuna.c Wed Feb 18 08:21:51 2015 (r278950) @@ -298,8 +298,13 @@ random_fortuna_genrandom(uint8_t *buf, u KASSERT((bytecount <= (1 << 20)), ("invalid single read request to fortuna of %d bytes", bytecount)); /* F&S - r = first-n-bytes(GenerateBlocks(ceil(n/16))) */ - blockcount = (bytecount + BLOCKSIZE - 1)/BLOCKSIZE; + blockcount = bytecount / BLOCKSIZE; random_fortuna_genblocks(buf, blockcount); + /* TODO: FIX! remove memcpy()! */ + if (bytecount % BLOCKSIZE > 0) { + random_fortuna_genblocks(temp, 1); + memcpy(buf + (blockcount * BLOCKSIZE), temp, bytecount % BLOCKSIZE); + } /* F&S - K = GenerateBlocks(2) */ random_fortuna_genblocks(temp, KEYSIZE/BLOCKSIZE); Modified: head/sys/dev/random/yarrow.c ============================================================================== --- head/sys/dev/random/yarrow.c Wed Feb 18 08:10:13 2015 (r278949) +++ head/sys/dev/random/yarrow.c Wed Feb 18 08:21:51 2015 (r278950) @@ -450,6 +450,7 @@ random_yarrow_read(uint8_t *buf, u_int b } uint128_increment(&yarrow_state.counter.whole); if ((i + 1) * BLOCKSIZE > bytecount) { + /* TODO: FIX! remove memcpy()! */ randomdev_encrypt(&yarrow_state.key, yarrow_state.counter.byte, tbuf, BLOCKSIZE); memcpy(buf, tbuf, bytecount - i * BLOCKSIZE); From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 08:22:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CC90E9F; Wed, 18 Feb 2015 08:22:19 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F6491BB; Wed, 18 Feb 2015 08:22:18 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t1I8MCkt032167 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Feb 2015 00:22:12 -0800 (PST) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t1I8MCOj032166; Wed, 18 Feb 2015 00:22:12 -0800 (PST) (envelope-from jmg) Date: Wed, 18 Feb 2015 00:22:12 -0800 From: John-Mark Gurney To: Shawn Webb Subject: Re: svn commit: r278927 - head/sys/dev/random Message-ID: <20150218082211.GT1953@funkthat.com> References: <201502172314.t1HNEQVs000251@svn.freebsd.org> <1995224.5kdoagqnev@shawn-work-laptop> <5545025.MNc1ZYVVrp@shawn-work-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5545025.MNc1ZYVVrp@shawn-work-laptop> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Wed, 18 Feb 2015 00:22:12 -0800 (PST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 18 Feb 2015 08:22:19 -0000 Shawn Webb wrote this message on Tue, Feb 17, 2015 at 20:10 -0500: > On Tuesday, February 17, 2015 08:06:32 PM Shawn Webb wrote: > > On Tuesday, February 17, 2015 11:14:26 PM John-Mark Gurney wrote: > > > Author: jmg > > > Date: Tue Feb 17 23:14:26 2015 > > > New Revision: 278927 > > > URL: https://svnweb.freebsd.org/changeset/base/278927 > > > > > > Log: > > > Fix a bug where this function overflowed it's buffer... This was > > > causing ZFS panics on boot... > > > > > > This is purely reviewed and tested by peter. > > > > > > Reviewed by: peter > > > Approved by: so (implicit), peter > > > > I'm still seeing the kernel panic even after this commit. > > > > Thanks, > > > > Shawn > > Whoops. Applied the patch to the wrong box. Never mind. No worries.. :) Glad it's working again for you... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 08:24:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59EF813A; Wed, 18 Feb 2015 08:24:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 44C331D5; Wed, 18 Feb 2015 08:24:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1I8O1jr034188; Wed, 18 Feb 2015 08:24:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1I8O1ES034186; Wed, 18 Feb 2015 08:24:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201502180824.t1I8O1ES034186@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 18 Feb 2015 08:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278951 - 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 08:24:01 -0000 Author: delphij Date: Wed Feb 18 08:24:00 2015 New Revision: 278951 URL: https://svnweb.freebsd.org/changeset/base/278951 Log: Bump revision again after my Fortuna change. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Feb 18 08:21:51 2015 (r278950) +++ head/UPDATING Wed Feb 18 08:24:00 2015 (r278951) @@ -33,8 +33,8 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 20150217: If you are running a -CURRENT kernel since r273872 (Oct 30th, 2014), - but before r278927, the RNG was not seeded properly. Immediately - upgrade the kernel to r278927 or later and regenerate any keys (e.g. + but before r278950, the RNG was not seeded properly. Immediately + upgrade the kernel to r278950 or later and regenerate any keys (e.g. ssh keys or openssl keys) that were generated w/ a kernel from that range. This does not effect programs that directly used /dev/random or /dev/urandom. All userland uses of arc4random(3) are effected. From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 10:51:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B992F2D; Wed, 18 Feb 2015 10:51:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 467D83D1; Wed, 18 Feb 2015 10:51:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1IApndq003396; Wed, 18 Feb 2015 10:51:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1IApn1d003395; Wed, 18 Feb 2015 10:51:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502181051.t1IApn1d003395@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 18 Feb 2015 10:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278954 - head/sys/x86/acpica 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 10:51:49 -0000 Author: kib Date: Wed Feb 18 10:51:48 2015 New Revision: 278954 URL: https://svnweb.freebsd.org/changeset/base/278954 Log: Fix UP build. Sponsored by: The FreeBSD Foundation MFC after: 2 months Modified: head/sys/x86/acpica/acpi_wakeup.c Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Wed Feb 18 09:02:58 2015 (r278953) +++ head/sys/x86/acpica/acpi_wakeup.c Wed Feb 18 10:51:48 2015 (r278954) @@ -55,8 +55,9 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef SMP #include +#include +#ifdef SMP #include #include #endif From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 13:37:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4811CBB3; Wed, 18 Feb 2015 13:37:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3308F9A7; Wed, 18 Feb 2015 13:37:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1IDbSxE079239; Wed, 18 Feb 2015 13:37:28 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1IDbSER079238; Wed, 18 Feb 2015 13:37:28 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201502181337.t1IDbSER079238@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 18 Feb 2015 13:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278956 - 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 13:37:29 -0000 Author: mjg Date: Wed Feb 18 13:37:28 2015 New Revision: 278956 URL: https://svnweb.freebsd.org/changeset/base/278956 Log: filedesc: obtain a stable copy of credentials in fget_unlocked This was broken in r278930. While here tidy up fget_mmap to use fdp from local var instead of obtaining the same pointer from td. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Feb 18 13:07:26 2015 (r278955) +++ head/sys/kern/kern_descrip.c Wed Feb 18 13:37:28 2015 (r278956) @@ -2337,7 +2337,7 @@ fget_unlocked(struct filedesc *fdp, int u_int count; #ifdef CAPABILITIES seq_t seq; - cap_rights_t *haverights; + cap_rights_t haverights; int error; #endif @@ -2356,7 +2356,7 @@ fget_unlocked(struct filedesc *fdp, int #ifdef CAPABILITIES seq = seq_read(fd_seq(fdt, fd)); fde = &fdt->fdt_ofiles[fd]; - haverights = cap_rights_fde(fde); + haverights = *cap_rights_fde(fde); fp = fde->fde_file; if (!seq_consistent(fd_seq(fdt, fd), seq)) { cpu_spinwait(); @@ -2369,7 +2369,7 @@ fget_unlocked(struct filedesc *fdp, int return (EBADF); #ifdef CAPABILITIES if (needrightsp != NULL) { - error = cap_check(haverights, needrightsp); + error = cap_check(&haverights, needrightsp); if (error != 0) return (error); } @@ -2505,7 +2505,7 @@ fget_mmap(struct thread *td, int fd, cap */ if (maxprotp != NULL) *maxprotp = cap_rights_to_vmprot(cap_rights(fdp, fd)); - if (!fd_modified(td->td_proc->p_fd, fd, seq)) + if (!fd_modified(fdp, fd, seq)) break; fdrop(*fpp, td); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 14:33:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D7EE431; Wed, 18 Feb 2015 14:33:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 7DB77F86; Wed, 18 Feb 2015 14:33:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1IEXZBx006545; Wed, 18 Feb 2015 14:33:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1IEXY0M006542; Wed, 18 Feb 2015 14:33:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502181433.t1IEXY0M006542@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 18 Feb 2015 14:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278957 - head/sys/dev/spibus 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 14:33:35 -0000 Author: imp Date: Wed Feb 18 14:33:33 2015 New Revision: 278957 URL: https://svnweb.freebsd.org/changeset/base/278957 Log: Add copyright statement I should have had on these files in 2006, based on the spibus_if.m file. Modified: head/sys/dev/spibus/spi.h head/sys/dev/spibus/spibus.c head/sys/dev/spibus/spibusvar.h Modified: head/sys/dev/spibus/spi.h ============================================================================== --- head/sys/dev/spibus/spi.h Wed Feb 18 13:37:28 2015 (r278956) +++ head/sys/dev/spibus/spi.h Wed Feb 18 14:33:33 2015 (r278957) @@ -1,4 +1,30 @@ -/* $FreeBSD$ */ +/*- + * Copyright (c) 2006 M. Warner Losh + * 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$ + */ struct spi_command { void *tx_cmd; Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Wed Feb 18 13:37:28 2015 (r278956) +++ head/sys/dev/spibus/spibus.c Wed Feb 18 14:33:33 2015 (r278957) @@ -1,3 +1,30 @@ +/*- + * Copyright (c) 2006 M. Warner Losh + * 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. + * + */ + #include __FBSDID("$FreeBSD$"); Modified: head/sys/dev/spibus/spibusvar.h ============================================================================== --- head/sys/dev/spibus/spibusvar.h Wed Feb 18 13:37:28 2015 (r278956) +++ head/sys/dev/spibus/spibusvar.h Wed Feb 18 14:33:33 2015 (r278957) @@ -1,4 +1,30 @@ -/* $FreeBSD$ */ +/*- + * Copyright (c) 2006 M. Warner Losh + * 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$ + */ #define SPIBUS_IVAR(d) (struct spibus_ivar *) device_get_ivars(d) #define SPIBUS_SOFTC(d) (struct spibus_softc *) device_get_softc(d) From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 15:25:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27A8F484; Wed, 18 Feb 2015 15:25:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 122157D4; Wed, 18 Feb 2015 15:25:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1IFPKtr030927; Wed, 18 Feb 2015 15:25:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1IFPK2H030924; Wed, 18 Feb 2015 15:25:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502181525.t1IFPK2H030924@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 18 Feb 2015 15:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278958 - in head/sys: conf 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 15:25:21 -0000 Author: imp Date: Wed Feb 18 15:25:19 2015 New Revision: 278958 URL: https://svnweb.freebsd.org/changeset/base/278958 Log: Populate new KERN_OPTS from all the opt_*.h files in KERNBUILDDIR. Come up with some sensible defaults (though listing them in kmod.mk may be unwise -- we have no easy way to know what are the best sensible defaults for everything so we just catch the big stuff). Append SRCS.${opt} for each option in KERN_OPTS to SRCS to allow easy conditional compilation. Append any notion of KERN_OPTS_EXTRA to the list of kernel opts. Differential Revision: https://reviews.freebsd.org/D1530 Added: head/sys/conf/config.mk (contents, props changed) Modified: head/sys/conf/kmod.mk head/sys/modules/Makefile Added: head/sys/conf/config.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/config.mk Wed Feb 18 15:25:19 2015 (r278958) @@ -0,0 +1,54 @@ +# $FreeBSD$ +# +# Common code to marry kernel config(8) goo and module building goo. +# + +# Generate options files that otherwise would be built +# in substantially similar ways through the tree. Move +# the code here when they all produce identical results +# (or should) +.if !defined(KERNBUILDDIR) +opt_bpf.h: + echo "#define DEV_BPF 1" > ${.TARGET} +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} + @echo "#define TCP_OFFLOAD 1" >> ${.TARGET} +.endif +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.if ${MK_EISA} != "no" +opt_eisa.h: + @echo "#define DEV_EISA 1" > ${.TARGET} +.endif +opt_mrouting.h: + echo "#define MROUTING 1" > ${.TARGET} +opt_natm.h: + echo "#define NATM 1" > ${.TARGET} +opt_scsi.h: + echo "#define SCSI_DELAY 15000" > ${.TARGET} +opt_wlan.h: + echo "#define IEEE80211_DEBUG 1" > ${.TARGET} + echo "#define IEEE80211_AMPDU_AGE 1" >> ${.TARGET} + echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET} +KERN_OPTS.i386=NEW_PCIB DEV_PCI +KERN_OPTS.pc98=NEW_PCIB DEV_PCI +KERN_OPTS.amd64=NEW_PCIB DEV_PCI +KERN_OPTS.powerpc=NEW_PCIB DEV_PCI +KERN_OPTS=MROUTING NATM IEEE80211_DEBUG \ + IEEE80211_AMPDU_AGE IEEE80211_SUPPORT_MESH DEV_BPF \ + ${KERN_OPTS.${MACHINE}} ${KERN_OPTS_EXTRA} +.if ${MK_INET_SUPPORT} != "no" +KERN_OPTS+= INET TCP_OFFLOAD +.endif +.if ${MK_INET6_SUPPORT} != "no" +KERN_OPTS+= INET6 +.endif +.if ${MK_EISA} != "no" +KERN_OPTS+= DEV_EISA +.endif +.else +KERN_OPTS!=cat ${KERNBUILDDIR}/opt*.h | awk '{print $$2;}' | sort -u +.endif Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Wed Feb 18 14:33:33 2015 (r278957) +++ head/sys/conf/kmod.mk Wed Feb 18 15:25:19 2015 (r278958) @@ -70,6 +70,7 @@ OBJCOPY?= objcopy # do this after bsd.own.mk. .include "kern.opts.mk" .include +.include "config.mk" .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S @@ -163,6 +164,11 @@ OBJS+= ${_firmw:C/\:.*$/.fwo/} .endfor .endif +# Conditionally include SRCS based on kernel config options. +.for _o in ${KERN_OPTS} +SRCS+=${SRCS.${_o}} +.endfor + OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .if !defined(PROG) @@ -316,34 +322,6 @@ unload: ${KMODUNLOAD} -v ${PROG} .endif -# Generate options files that otherwise would be built -# in substantially similar ways through the tree. Move -# the code here when they all produce identical results -# (or should) -.if !defined(KERNBUILDDIR) -opt_bpf.h: - echo "#define DEV_BPF 1" > ${.TARGET} -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} - @echo "#define TCP_OFFLOAD 1" >> ${.TARGET} -.endif -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif -opt_mrouting.h: - echo "#define MROUTING 1" > ${.TARGET} -opt_natm.h: - echo "#define NATM 1" > ${.TARGET} -opt_scsi.h: - echo "#define SCSI_DELAY 15000" > ${.TARGET} -opt_wlan.h: - echo "#define IEEE80211_DEBUG 1" > ${.TARGET} - echo "#define IEEE80211_AMPDU_AGE 1" >> ${.TARGET} - echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET} -.endif - .if defined(KERNBUILDDIR) .PATH: ${KERNBUILDDIR} CFLAGS+= -I${KERNBUILDDIR} Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Feb 18 14:33:33 2015 (r278957) +++ head/sys/modules/Makefile Wed Feb 18 15:25:19 2015 (r278958) @@ -751,4 +751,8 @@ afterinstall: fi .endif +.include "${SYSDIR}/conf/config.mk" + +SUBDIR:= ${SUBDIR:u:O} + .include From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 15:25:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 743E1573; Wed, 18 Feb 2015 15:25:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5F4107D5; Wed, 18 Feb 2015 15:25:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1IFPO0s030978; Wed, 18 Feb 2015 15:25:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1IFPNG4030970; Wed, 18 Feb 2015 15:25:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502181525.t1IFPNG4030970@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 18 Feb 2015 15:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278959 - in head/sys/modules: dpt ed ep si vx 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 15:25:24 -0000 Author: imp Date: Wed Feb 18 15:25:22 2015 New Revision: 278959 URL: https://svnweb.freebsd.org/changeset/base/278959 Log: Cleanup the way we include some files (in this case EISA) based on kernel config. Also tidy up the ed options. Modified: head/sys/modules/dpt/Makefile head/sys/modules/ed/Makefile head/sys/modules/ep/Makefile head/sys/modules/si/Makefile head/sys/modules/vx/Makefile Modified: head/sys/modules/dpt/Makefile ============================================================================== --- head/sys/modules/dpt/Makefile Wed Feb 18 15:25:19 2015 (r278958) +++ head/sys/modules/dpt/Makefile Wed Feb 18 15:25:22 2015 (r278959) @@ -11,24 +11,6 @@ SRCS= dpt_scsi.c dpt.h \ opt_cam.h opt_scsi.h \ device_if.h bus_if.h -.if ${MK_EISA} == "no" -# Create an empty opt_eisa.h in order to keep kmod.mk from linking in an -# existing one from KERNBUILDDIR which possibly has DEV_EISA defined so -# dpt.ko is always built without EISA support. -opt_eisa.h: - :> ${.TARGET} -.else -.if !defined(KERNBUILDDIR) -SRCS+= dpt_eisa.c eisa_if.h - -opt_eisa.h: - echo "#define DEV_EISA 1" > ${.TARGET} -.else -DEV_EISA!= sed -n '/DEV_EISA/p' ${KERNBUILDDIR}/opt_eisa.h -.if !empty(DEV_EISA) -SRCS+= dpt_eisa.c eisa_if.h -.endif -.endif -.endif +SRCS.DEV_EISA= dpt_eisa.c eisa_if.h .include Modified: head/sys/modules/ed/Makefile ============================================================================== --- head/sys/modules/ed/Makefile Wed Feb 18 15:25:19 2015 (r278958) +++ head/sys/modules/ed/Makefile Wed Feb 18 15:25:22 2015 (r278959) @@ -8,10 +8,13 @@ SRCS+= if_ed_novell.c if_ed_wd80x3.c if_ .if ${MACHINE} == "pc98" SRCS+= if_ed_cbus.c .else -SRCS+= if_ed_isa.c if_ed_3c503.c if_ed_hpp.c if_ed_sic.c +SRCS+= if_ed_isa.c +SRCS.ED_HPP=if_ed_hpp.c +SRCS.ED_SIC=if_ed_sic.c +SRCS.ED_3C503=if_ed_3c503.c .endif SRCS+= if_ed_pccard.c pccarddevs.h card_if.h -SRCS+= if_ed_pci.c pci_if.h +SRCS.DEV_PCI=if_ed_pci.c pci_if.h SRCS+= opt_ed.h bus_if.h device_if.h miibus_if.h Modified: head/sys/modules/ep/Makefile ============================================================================== --- head/sys/modules/ep/Makefile Wed Feb 18 15:25:19 2015 (r278958) +++ head/sys/modules/ep/Makefile Wed Feb 18 15:25:22 2015 (r278959) @@ -9,10 +9,7 @@ KMOD= if_ep SRCS= if_ep.c SRCS+= if_ep_pccard.c pccarddevs.h card_if.h SRCS+= if_ep_isa.c isa_if.h -.if ${MK_EISA} != "no" -SRCS+= if_ep_eisa.c eisa_if.h -.endif -#SRCS+= if_ep_mca.c +SRCS.DEV_EISA= if_ep_eisa.c eisa_if.h SRCS+= bus_if.h device_if.h .include Modified: head/sys/modules/si/Makefile ============================================================================== --- head/sys/modules/si/Makefile Wed Feb 18 15:25:19 2015 (r278958) +++ head/sys/modules/si/Makefile Wed Feb 18 15:25:22 2015 (r278959) @@ -3,8 +3,9 @@ .PATH: ${.CURDIR}/../../dev/si KMOD= si -SRCS= si.c si2_z280.c si3_t225.c si_eisa.c si_isa.c si_pci.c -SRCS+= bus_if.h device_if.h eisa_if.h isa_if.h pci_if.h +SRCS= si.c si2_z280.c si3_t225.c si_isa.c si_pci.c +SRCS+= bus_if.h device_if.h isa_if.h pci_if.h SRCS+= opt_compat.h opt_debug_si.h opt_eisa.h +SRCS.DEV_EISA=si_eisa.c eisa_if.h .include Modified: head/sys/modules/vx/Makefile ============================================================================== --- head/sys/modules/vx/Makefile Wed Feb 18 15:25:19 2015 (r278958) +++ head/sys/modules/vx/Makefile Wed Feb 18 15:25:22 2015 (r278959) @@ -7,9 +7,7 @@ SYSDIR?=${.CURDIR}/../.. KMOD= if_vx SRCS= if_vx.c if_vx_pci.c -.if ${MK_EISA} != "no" -SRCS+= if_vx_eisa.c -.endif -SRCS+= device_if.h bus_if.h pci_if.h eisa_if.h +SRCS.DEV_EISA= if_vx_eisa.c eisa_if.h +SRCS+= device_if.h bus_if.h pci_if.h .include From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 15:25:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD4D05BC; Wed, 18 Feb 2015 15:25:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B86697D7; Wed, 18 Feb 2015 15:25:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1IFPQu7031024; Wed, 18 Feb 2015 15:25:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1IFPQkL031022; Wed, 18 Feb 2015 15:25:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502181525.t1IFPQkL031022@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 18 Feb 2015 15:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278960 - in head/sys/modules: if_gif if_gre 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 15:25:26 -0000 Author: imp Date: Wed Feb 18 15:25:25 2015 New Revision: 278960 URL: https://svnweb.freebsd.org/changeset/base/278960 Log: Clean up a bit of the INET/INET6 mess wrt options. Modified: head/sys/modules/if_gif/Makefile head/sys/modules/if_gre/Makefile Modified: head/sys/modules/if_gif/Makefile ============================================================================== --- head/sys/modules/if_gif/Makefile Wed Feb 18 15:25:22 2015 (r278959) +++ head/sys/modules/if_gif/Makefile Wed Feb 18 15:25:25 2015 (r278960) @@ -7,13 +7,7 @@ SYSDIR?=${.CURDIR}/../.. KMOD= if_gif SRCS= if_gif.c opt_inet.h opt_inet6.h - -.if ${MK_INET_SUPPORT} != "no" -SRCS+= in_gif.c -.endif - -.if ${MK_INET6_SUPPORT} != "no" -SRCS+= in6_gif.c -.endif +SRCS.INET=in_gif.c +SRCS.INET6=in6_gif.c .include Modified: head/sys/modules/if_gre/Makefile ============================================================================== --- head/sys/modules/if_gre/Makefile Wed Feb 18 15:25:22 2015 (r278959) +++ head/sys/modules/if_gre/Makefile Wed Feb 18 15:25:25 2015 (r278960) @@ -6,13 +6,7 @@ SYSDIR?=${.CURDIR}/../.. KMOD= if_gre SRCS= if_gre.c opt_inet.h opt_inet6.h - -.if ${MK_INET_SUPPORT} != "no" -SRCS+= ip_gre.c -.endif - -.if ${MK_INET6_SUPPORT} != "no" -SRCS+= ip6_gre.c -.endif +SRCS.INET= ip_gre.c +SRCS.INET6= ip6_gre.c .include From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 17:28:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63524BF; Wed, 18 Feb 2015 17:28:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4DD079FF; Wed, 18 Feb 2015 17:28:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1IHSubW098573; Wed, 18 Feb 2015 17:28:56 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1IHStUt098572; Wed, 18 Feb 2015 17:28:55 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201502181728.t1IHStUt098572@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 18 Feb 2015 17:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278962 - 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 17:28:56 -0000 Author: marcel Date: Wed Feb 18 17:28:55 2015 New Revision: 278962 URL: https://svnweb.freebsd.org/changeset/base/278962 Log: Add LIBXO. Modified: head/share/mk/bsd.libnames.mk Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Wed Feb 18 16:28:55 2015 (r278961) +++ head/share/mk/bsd.libnames.mk Wed Feb 18 17:28:55 2015 (r278962) @@ -131,6 +131,7 @@ LIBVMMAPI?= ${DESTDIR}${LIBDIR}/libvmmap LIBWIND?= ${DESTDIR}${LIBDIR}/libwind.a LIBWRAP?= ${DESTDIR}${LIBDIR}/libwrap.a LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a +LIBXO?= ${DESTDIR}${LIBDIR}/libxo.a LIBY?= ${DESTDIR}${LIBDIR}/liby.a LIBYPCLNT?= ${DESTDIR}${LIBDIR}/libypclnt.a LIBZ?= ${DESTDIR}${LIBDIR}/libz.a From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 18:12:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 366F5773; Wed, 18 Feb 2015 18:12:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1A2D6F82; Wed, 18 Feb 2015 18:12:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1IIC78B021266; Wed, 18 Feb 2015 18:12:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1IIC7Do021265; Wed, 18 Feb 2015 18:12:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502181812.t1IIC7Do021265@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 18 Feb 2015 18:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278963 - 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 18:12:08 -0000 Author: kib Date: Wed Feb 18 18:12:06 2015 New Revision: 278963 URL: https://svnweb.freebsd.org/changeset/base/278963 Log: If malloc() sleeps, Giant is dropped. Recheck for another thread doing our work. Remove unneeded check for failed M_WAITOK allocation. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Wed Feb 18 17:28:55 2015 (r278962) +++ head/sys/kern/sysv_shm.c Wed Feb 18 18:12:06 2015 (r278963) @@ -358,9 +358,22 @@ kern_shmat(td, shmid, shmaddr, shmflg) if (shmmap_s == NULL) { shmmap_s = malloc(shminfo.shmseg * sizeof(struct shmmap_state), M_SHM, M_WAITOK); - for (i = 0; i < shminfo.shmseg; i++) - shmmap_s[i].shmid = -1; - p->p_vmspace->vm_shm = shmmap_s; + + /* + * If malloc() above sleeps, the Giant lock is + * temporarily dropped, which allows another thread to + * allocate shmmap_state and set vm_shm. Recheck + * vm_shm and free the new shmmap_state if another one + * is already allocated. + */ + if (p->p_vmspace->vm_shm != NULL) { + free(shmmap_s, M_SHM); + shmmap_s = p->p_vmspace->vm_shm; + } else { + for (i = 0; i < shminfo.shmseg; i++) + shmmap_s[i].shmid = -1; + p->p_vmspace->vm_shm = shmmap_s; + } } shmseg = shm_find_segment_by_shmid(shmid); if (shmseg == NULL) { @@ -826,8 +839,6 @@ shmrealloc(void) return; newsegs = malloc(shminfo.shmmni * sizeof(*newsegs), M_SHM, M_WAITOK); - if (newsegs == NULL) - return; for (i = 0; i < shmalloced; i++) bcopy(&shmsegs[i], &newsegs[i], sizeof(newsegs[0])); for (; i < shminfo.shmmni; i++) { From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 18:30:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB5CEDC7; Wed, 18 Feb 2015 18:30:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A4B30196; Wed, 18 Feb 2015 18:30:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1IIUMwI027104; Wed, 18 Feb 2015 18:30:22 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1IIUKIR027093; Wed, 18 Feb 2015 18:30:20 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201502181830.t1IIUKIR027093@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Wed, 18 Feb 2015 18:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278964 - in head: sbin/camcontrol sys/cam sys/cam/scsi sys/dev/mpr sys/dev/mps 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 18:30:22 -0000 Author: ken Date: Wed Feb 18 18:30:19 2015 New Revision: 278964 URL: https://svnweb.freebsd.org/changeset/base/278964 Log: Make sure that the flags for the XPT_DEV_ADVINFO CCB are initialized properly. If there is garbage in the flags field, it can sometimes include a set CDAI_FLAG_STORE flag, which may cause either an error or perhaps result in overwriting the field that was intended to be read. sys/cam/cam_ccb.h: Add a new flag to the XPT_DEV_ADVINFO CCB, CDAI_FLAG_NONE, that callers can use to set the flags field when no store is desired. sys/cam/scsi/scsi_enc_ses.c: In ses_setphyspath_callback(), explicitly set the XPT_DEV_ADVINFO flags to CDAI_FLAG_NONE when fetching the physical path information. Instead of ORing in the CDAI_FLAG_STORE flag when storing the physical path, set the flags field to CDAI_FLAG_STORE. sys/cam/scsi/scsi_sa.c: Set the XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE when fetching extended inquiry information. sys/cam/scsi/scsi_da.c: When storing extended READ CAPACITY information, set the XPT_DEV_ADVINFO flags field to CDAI_FLAG_STORE instead of ORing it into a field that isn't initialized. sys/dev/mpr/mpr_sas.c, sys/dev/mps/mps_sas.c: When fetching extended READ CAPACITY information, set the XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE instead of setting it to 0. sbin/camcontrol/camcontrol.c: When fetching a device ID, set the XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE instead of 0. sys/sys/param.h: Bump __FreeBSD_version to 1100061 for the new XPT_DEV_ADVINFO CCB flag, CDAI_FLAG_NONE. Sponsored by: Spectra Logic MFC after: 1 week Modified: head/sbin/camcontrol/camcontrol.c head/sys/cam/cam_ccb.h head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_enc_ses.c head/sys/dev/mpr/mpr_sas.c head/sys/dev/mps/mps_sas.c head/sys/sys/param.h Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Wed Feb 18 18:12:06 2015 (r278963) +++ head/sbin/camcontrol/camcontrol.c Wed Feb 18 18:30:19 2015 (r278964) @@ -7404,7 +7404,7 @@ getdevid(struct cam_devitem *item) retry: ccb->ccb_h.func_code = XPT_DEV_ADVINFO; ccb->ccb_h.flags = CAM_DIR_IN; - ccb->cdai.flags = 0; + ccb->cdai.flags = CDAI_FLAG_NONE; ccb->cdai.buftype = CDAI_TYPE_SCSI_DEVID; ccb->cdai.bufsiz = item->device_id_len; if (item->device_id_len != 0) Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Wed Feb 18 18:12:06 2015 (r278963) +++ head/sys/cam/cam_ccb.h Wed Feb 18 18:30:19 2015 (r278964) @@ -1140,6 +1140,7 @@ struct ccb_eng_exec { /* This structure struct ccb_dev_advinfo { struct ccb_hdr ccb_h; uint32_t flags; +#define CDAI_FLAG_NONE 0x0 /* No flags set */ #define CDAI_FLAG_STORE 0x1 /* If set, action becomes store */ uint32_t buftype; /* IN: Type of data being requested */ /* NB: buftype is interpreted on a per-transport basis */ Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Feb 18 18:12:06 2015 (r278963) +++ head/sys/cam/scsi/scsi_da.c Wed Feb 18 18:30:19 2015 (r278964) @@ -3787,7 +3787,7 @@ dasetgeom(struct cam_periph *periph, uin xpt_setup_ccb(&cdai.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.buftype = CDAI_TYPE_RCAPLONG; - cdai.flags |= CDAI_FLAG_STORE; + cdai.flags = CDAI_FLAG_STORE; cdai.bufsiz = rcap_len; cdai.buf = (uint8_t *)rcaplong; xpt_action((union ccb *)&cdai); Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Wed Feb 18 18:12:06 2015 (r278963) +++ head/sys/cam/scsi/scsi_enc_ses.c Wed Feb 18 18:30:19 2015 (r278964) @@ -1007,7 +1007,7 @@ ses_setphyspath_callback(enc_softc_t *en xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.buftype = CDAI_TYPE_PHYS_PATH; - cdai.flags = 0; + cdai.flags = CDAI_FLAG_NONE; cdai.bufsiz = MAXPATHLEN; cdai.buf = old_physpath; xpt_action((union ccb *)&cdai); @@ -1019,7 +1019,7 @@ ses_setphyspath_callback(enc_softc_t *en xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.buftype = CDAI_TYPE_PHYS_PATH; - cdai.flags |= CDAI_FLAG_STORE; + cdai.flags = CDAI_FLAG_STORE; cdai.bufsiz = sbuf_len(args->physpath); cdai.buf = sbuf_data(args->physpath); xpt_action((union ccb *)&cdai); Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Wed Feb 18 18:12:06 2015 (r278963) +++ head/sys/dev/mpr/mpr_sas.c Wed Feb 18 18:30:19 2015 (r278964) @@ -3082,7 +3082,11 @@ mprsas_async(void *callback_arg, uint32_ cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.ccb_h.flags = CAM_DIR_IN; cdai.buftype = CDAI_TYPE_RCAPLONG; +#if __FreeBSD_version >= 1100061 + cdai.flags = CDAI_FLAG_NONE; +#else cdai.flags = 0; +#endif cdai.bufsiz = sizeof(rcap_buf); cdai.buf = (uint8_t *)&rcap_buf; xpt_action((union ccb *)&cdai); Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Wed Feb 18 18:12:06 2015 (r278963) +++ head/sys/dev/mps/mps_sas.c Wed Feb 18 18:30:19 2015 (r278964) @@ -3235,7 +3235,11 @@ mpssas_async(void *callback_arg, uint32_ cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.ccb_h.flags = CAM_DIR_IN; cdai.buftype = CDAI_TYPE_RCAPLONG; +#if __FreeBSD_version >= 1100061 + cdai.flags = CDAI_FLAG_NONE; +#else cdai.flags = 0; +#endif cdai.bufsiz = sizeof(rcap_buf); cdai.buf = (uint8_t *)&rcap_buf; xpt_action((union ccb *)&cdai); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Feb 18 18:12:06 2015 (r278963) +++ head/sys/sys/param.h Wed Feb 18 18:30:19 2015 (r278964) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100060 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100061 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 18:36:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00E42F99; Wed, 18 Feb 2015 18:36:29 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (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 C027C275; Wed, 18 Feb 2015 18:36:29 +0000 (UTC) Received: from st11p02mm-spool001.mac.com ([17.172.220.246]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTP id <0NJZ00N0HD0Q1V60@st11p02mm-asmtp002.mac.com>; Wed, 18 Feb 2015 18:36:26 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-18_07:2015-02-18,2015-02-18,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502180193 MIME-version: 1.0 Received: from localhost ([17.172.220.163]) by st11p02mm-spool001.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTP id <0NJZ008U7D0Q0D20@st11p02mm-spool001.mac.com>; Wed, 18 Feb 2015 18:36:26 +0000 (GMT) To: Steven Hartland From: Rui Paulo Subject: =?utf-8?B?UmU6IHN2biBjb21taXQ6IHIyNzczMDAgLSBpbiBoZWFkOiBjZGRsL2NvbnRy?= =?utf-8?B?aWIvb3BlbnNvbGFyaXMvY21kL2R0cmFjZSBjZGRsL2NvbnRyaWIvb3BlbnNv?= =?utf-8?B?bGFyaXMvY21kL2xvY2tzdGF0IGNkZGwvY29udHJpYi9vcGVuc29sYXJpcy9j?= =?utf-8?B?bWQvbWRiL3Rvb2xzL2NvbW1vbiBjZGRsL2NvbnRyaWIvb3BlbnNvbGFyaXMv?= =?utf-8?B?Y21kL3Bsb2Nrc3RhdCBjZGRsL2NvLi4u?= Date: Wed, 18 Feb 2015 18:36:26 +0000 (GMT) X-Mailer: iCloud MailClient15A99 MailServer15A.18175 X-Originating-IP: [12.218.212.178] Message-id: <5f8079b1-ae7d-4977-99f6-a8fd0f3f8252@me.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 18 Feb 2015 18:36:30 -0000 On Jan 17, 2015, at 06:45 AM, Steven Hartland wrote:=0A=0A= Author: smh=0ADate: Sat Jan 17 14:44:59 2015=0ANew Revision: 277300=0AURL:= https://svnweb.freebsd.org/changeset/base/277300=0A=0ALog:=0AMechanically= convert cddl sun #ifdef's to illumos=0A=0ASince the upstream for cddl cod= e is now illumos not sun, mechanically=0Aconvert all sun #ifdef's to illum= os #ifdef's which have been used in all=0Anewer code for some time.=0A=0AA= lso do a manual pass to correct the use if #ifdef comments as per style(9)= =0Aas well as few uses of #if defined(__FreeBSD__) vs #ifndef illumos.=0A=C2= =A0=0AI had just convinced Mark=C2=A0Johnston to use "#ifdef __FreeBSD__" = instead of "#ifndef illumos". =C2=A0Is there a reason why we keep using #i= fndef ? =C2=A0To me, it's much easier to read #ifdef __FreeBSD__ than to n= ote whether theres an "n" in that pre-processor macro.=0A=0A= From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 19:27:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3F1E551; Wed, 18 Feb 2015 19:27:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9FEDCACC; Wed, 18 Feb 2015 19:27:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1IJRqkB056181; Wed, 18 Feb 2015 19:27:52 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1IJRqEf056180; Wed, 18 Feb 2015 19:27:52 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201502181927.t1IJRqEf056180@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Wed, 18 Feb 2015 19:27:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278965 - 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 19:27:52 -0000 Author: grehan Date: Wed Feb 18 19:27:51 2015 New Revision: 278965 URL: https://svnweb.freebsd.org/changeset/base/278965 Log: Restore the ability to use clang as an external compiler. This was inadvertently removed when support for external GCC was added. Deprecate XFLAGS in favour of the newer XCFLAGS/XCXXFLAGS. Tested with: make universe, make CROSS_COMPILER_PREFIX=/usr/bin/ buildworld Reviewed by: imp, bapt Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Feb 18 18:30:19 2015 (r278964) +++ head/Makefile.inc1 Wed Feb 18 19:27:51 2015 (r278965) @@ -343,16 +343,15 @@ WMAKEENV+= CC="${XCC} ${XCFLAGS}" CXX="$ SIZE="${XSIZE}" .if ${XCC:M/*} -XFLAGS= --sysroot=${WORLDTMP} .if defined(CROSS_BINUTILS_PREFIX) # In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a # directory, but the compiler will look in the right place for it's # tools so we don't need to tell it where to look. .if exists(${CROSS_BINUTILS_PREFIX}) -XFLAGS+= -B${CROSS_BINUTILS_PREFIX} +BFLAGS+= -B${CROSS_BINUTILS_PREFIX} .endif .else -XFLAGS+= -B${WORLDTMP}/usr/bin +BFLAGS+= -B${WORLDTMP}/usr/bin .endif .if ${TARGET} == "arm" .if ${TARGET_ARCH:M*hf*} != "" @@ -369,6 +368,8 @@ DEPFLAGS+= -I${WORLDTMP}/usr/include/c++ TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 XCFLAGS+= -target ${TARGET_TRIPLE} +XCFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS} +XCXXFLAGS+= --sysroot=${WORLDTMP} ${BFLAGS} .endif .endif From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 20:33:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF6F6DE1; Wed, 18 Feb 2015 20:33:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A53FF3E2; Wed, 18 Feb 2015 20:33:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1IKX9qx089538; Wed, 18 Feb 2015 20:33:09 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1IKX1af089468; Wed, 18 Feb 2015 20:33:01 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201502182033.t1IKX1af089468@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 18 Feb 2015 20:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278970 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon... 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 20:33:09 -0000 Author: jkim Date: Wed Feb 18 20:33:00 2015 New Revision: 278970 URL: https://svnweb.freebsd.org/changeset/base/278970 Log: Merge ACPICA 20141107 and 20150204. Added: head/sys/contrib/dev/acpica/compiler/aslprintf.c - copied, changed from r274357, vendor-sys/acpica/dist/source/compiler/aslprintf.c head/sys/contrib/dev/acpica/compiler/aslprune.c - copied, changed from r274357, vendor-sys/acpica/dist/source/compiler/aslprune.c head/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c - copied, changed from r274357, vendor-sys/acpica/dist/source/components/disassembler/dmcstyle.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/changes.txt (contents, props changed) head/sys/contrib/dev/acpica/common/acgetline.c head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/ahids.c head/sys/contrib/dev/acpica/common/ahpredef.c head/sys/contrib/dev/acpica/common/ahuuids.c head/sys/contrib/dev/acpica/common/cmfsize.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/common/getopt.c head/sys/contrib/dev/acpica/compiler/aslanalyze.c head/sys/contrib/dev/acpica/compiler/aslascii.c head/sys/contrib/dev/acpica/compiler/aslbtypes.c head/sys/contrib/dev/acpica/compiler/aslcodegen.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfileio.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslfold.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/aslhex.c head/sys/contrib/dev/acpica/compiler/asllength.c head/sys/contrib/dev/acpica/compiler/asllisting.c head/sys/contrib/dev/acpica/compiler/asllistsup.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/asllookup.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmap.c head/sys/contrib/dev/acpica/compiler/aslmapenter.c head/sys/contrib/dev/acpica/compiler/aslmapoutput.c head/sys/contrib/dev/acpica/compiler/aslmaputils.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslmethod.c head/sys/contrib/dev/acpica/compiler/aslnamesp.c head/sys/contrib/dev/acpica/compiler/asloffset.c head/sys/contrib/dev/acpica/compiler/aslopcodes.c head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/aslparser.y head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslprepkg.c head/sys/contrib/dev/acpica/compiler/aslresource.c head/sys/contrib/dev/acpica/compiler/aslrestype1.c head/sys/contrib/dev/acpica/compiler/aslrestype1i.c head/sys/contrib/dev/acpica/compiler/aslrestype2.c head/sys/contrib/dev/acpica/compiler/aslrestype2d.c head/sys/contrib/dev/acpica/compiler/aslrestype2e.c head/sys/contrib/dev/acpica/compiler/aslrestype2q.c head/sys/contrib/dev/acpica/compiler/aslrestype2s.c head/sys/contrib/dev/acpica/compiler/aslrestype2w.c head/sys/contrib/dev/acpica/compiler/aslrules.y head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslstubs.c head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/aslsupport.y head/sys/contrib/dev/acpica/compiler/asltokens.y head/sys/contrib/dev/acpica/compiler/asltransform.c head/sys/contrib/dev/acpica/compiler/asltree.c head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/asltypes.y head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/asluuid.c head/sys/contrib/dev/acpica/compiler/aslwalks.c head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtfield.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dtparser.l head/sys/contrib/dev/acpica/compiler/dtparser.y head/sys/contrib/dev/acpica/compiler/dtsubtable.c head/sys/contrib/dev/acpica/compiler/dttable.c head/sys/contrib/dev/acpica/compiler/dttemplate.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/compiler/dtutils.c head/sys/contrib/dev/acpica/compiler/preprocess.h head/sys/contrib/dev/acpica/compiler/prexpress.c head/sys/contrib/dev/acpica/compiler/prmacros.c head/sys/contrib/dev/acpica/compiler/prparser.l head/sys/contrib/dev/acpica/compiler/prparser.y head/sys/contrib/dev/acpica/compiler/prscan.c head/sys/contrib/dev/acpica/compiler/prutils.c head/sys/contrib/dev/acpica/components/debugger/dbcmds.c head/sys/contrib/dev/acpica/components/debugger/dbconvert.c head/sys/contrib/dev/acpica/components/debugger/dbdisply.c head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbfileio.c head/sys/contrib/dev/acpica/components/debugger/dbhistry.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbmethod.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/debugger/dbstats.c head/sys/contrib/dev/acpica/components/debugger/dbtest.c head/sys/contrib/dev/acpica/components/debugger/dbutils.c head/sys/contrib/dev/acpica/components/debugger/dbxface.c head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c head/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c head/sys/contrib/dev/acpica/components/disassembler/dmnames.c head/sys/contrib/dev/acpica/components/disassembler/dmobject.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c head/sys/contrib/dev/acpica/components/disassembler/dmutils.c head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c head/sys/contrib/dev/acpica/components/dispatcher/dsargs.c head/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c head/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c head/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c head/sys/contrib/dev/acpica/components/dispatcher/dsobject.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c head/sys/contrib/dev/acpica/components/dispatcher/dswexec.c head/sys/contrib/dev/acpica/components/dispatcher/dswload.c head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c head/sys/contrib/dev/acpica/components/dispatcher/dswscope.c head/sys/contrib/dev/acpica/components/dispatcher/dswstate.c head/sys/contrib/dev/acpica/components/events/evevent.c head/sys/contrib/dev/acpica/components/events/evglock.c head/sys/contrib/dev/acpica/components/events/evgpe.c head/sys/contrib/dev/acpica/components/events/evgpeblk.c head/sys/contrib/dev/acpica/components/events/evgpeinit.c head/sys/contrib/dev/acpica/components/events/evgpeutil.c head/sys/contrib/dev/acpica/components/events/evhandler.c head/sys/contrib/dev/acpica/components/events/evmisc.c head/sys/contrib/dev/acpica/components/events/evregion.c head/sys/contrib/dev/acpica/components/events/evrgnini.c head/sys/contrib/dev/acpica/components/events/evsci.c head/sys/contrib/dev/acpica/components/events/evxface.c head/sys/contrib/dev/acpica/components/events/evxfevnt.c head/sys/contrib/dev/acpica/components/events/evxfgpe.c head/sys/contrib/dev/acpica/components/events/evxfregn.c head/sys/contrib/dev/acpica/components/executer/exconfig.c head/sys/contrib/dev/acpica/components/executer/exconvrt.c head/sys/contrib/dev/acpica/components/executer/excreate.c head/sys/contrib/dev/acpica/components/executer/exdebug.c head/sys/contrib/dev/acpica/components/executer/exdump.c head/sys/contrib/dev/acpica/components/executer/exfield.c head/sys/contrib/dev/acpica/components/executer/exfldio.c head/sys/contrib/dev/acpica/components/executer/exmisc.c head/sys/contrib/dev/acpica/components/executer/exmutex.c head/sys/contrib/dev/acpica/components/executer/exnames.c head/sys/contrib/dev/acpica/components/executer/exoparg1.c head/sys/contrib/dev/acpica/components/executer/exoparg2.c head/sys/contrib/dev/acpica/components/executer/exoparg3.c head/sys/contrib/dev/acpica/components/executer/exoparg6.c head/sys/contrib/dev/acpica/components/executer/exprep.c head/sys/contrib/dev/acpica/components/executer/exregion.c head/sys/contrib/dev/acpica/components/executer/exresnte.c head/sys/contrib/dev/acpica/components/executer/exresolv.c head/sys/contrib/dev/acpica/components/executer/exresop.c head/sys/contrib/dev/acpica/components/executer/exstore.c head/sys/contrib/dev/acpica/components/executer/exstoren.c head/sys/contrib/dev/acpica/components/executer/exstorob.c head/sys/contrib/dev/acpica/components/executer/exsystem.c head/sys/contrib/dev/acpica/components/executer/exutils.c head/sys/contrib/dev/acpica/components/hardware/hwacpi.c head/sys/contrib/dev/acpica/components/hardware/hwesleep.c head/sys/contrib/dev/acpica/components/hardware/hwgpe.c head/sys/contrib/dev/acpica/components/hardware/hwpci.c head/sys/contrib/dev/acpica/components/hardware/hwregs.c head/sys/contrib/dev/acpica/components/hardware/hwsleep.c head/sys/contrib/dev/acpica/components/hardware/hwtimer.c head/sys/contrib/dev/acpica/components/hardware/hwvalid.c head/sys/contrib/dev/acpica/components/hardware/hwxface.c head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/namespace/nsalloc.c head/sys/contrib/dev/acpica/components/namespace/nsarguments.c head/sys/contrib/dev/acpica/components/namespace/nsconvert.c head/sys/contrib/dev/acpica/components/namespace/nsdump.c head/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c head/sys/contrib/dev/acpica/components/namespace/nseval.c head/sys/contrib/dev/acpica/components/namespace/nsinit.c head/sys/contrib/dev/acpica/components/namespace/nsload.c head/sys/contrib/dev/acpica/components/namespace/nsnames.c head/sys/contrib/dev/acpica/components/namespace/nsobject.c head/sys/contrib/dev/acpica/components/namespace/nsparse.c head/sys/contrib/dev/acpica/components/namespace/nspredef.c head/sys/contrib/dev/acpica/components/namespace/nsprepkg.c head/sys/contrib/dev/acpica/components/namespace/nsrepair.c head/sys/contrib/dev/acpica/components/namespace/nsrepair2.c head/sys/contrib/dev/acpica/components/namespace/nssearch.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/namespace/nswalk.c head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c head/sys/contrib/dev/acpica/components/namespace/nsxfname.c head/sys/contrib/dev/acpica/components/namespace/nsxfobj.c head/sys/contrib/dev/acpica/components/parser/psargs.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/parser/psopcode.c head/sys/contrib/dev/acpica/components/parser/psopinfo.c head/sys/contrib/dev/acpica/components/parser/psparse.c head/sys/contrib/dev/acpica/components/parser/psscope.c head/sys/contrib/dev/acpica/components/parser/pstree.c head/sys/contrib/dev/acpica/components/parser/psutils.c head/sys/contrib/dev/acpica/components/parser/pswalk.c head/sys/contrib/dev/acpica/components/parser/psxface.c head/sys/contrib/dev/acpica/components/resources/rsaddr.c head/sys/contrib/dev/acpica/components/resources/rscalc.c head/sys/contrib/dev/acpica/components/resources/rscreate.c head/sys/contrib/dev/acpica/components/resources/rsdump.c head/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c head/sys/contrib/dev/acpica/components/resources/rsinfo.c head/sys/contrib/dev/acpica/components/resources/rsio.c head/sys/contrib/dev/acpica/components/resources/rsirq.c head/sys/contrib/dev/acpica/components/resources/rslist.c head/sys/contrib/dev/acpica/components/resources/rsmemory.c head/sys/contrib/dev/acpica/components/resources/rsmisc.c head/sys/contrib/dev/acpica/components/resources/rsserial.c head/sys/contrib/dev/acpica/components/resources/rsutils.c head/sys/contrib/dev/acpica/components/resources/rsxface.c head/sys/contrib/dev/acpica/components/tables/tbdata.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/tables/tbfind.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbprint.c head/sys/contrib/dev/acpica/components/tables/tbutils.c head/sys/contrib/dev/acpica/components/tables/tbxface.c head/sys/contrib/dev/acpica/components/tables/tbxfload.c head/sys/contrib/dev/acpica/components/tables/tbxfroot.c head/sys/contrib/dev/acpica/components/utilities/utaddress.c head/sys/contrib/dev/acpica/components/utilities/utalloc.c head/sys/contrib/dev/acpica/components/utilities/utbuffer.c head/sys/contrib/dev/acpica/components/utilities/utcache.c head/sys/contrib/dev/acpica/components/utilities/utcopy.c head/sys/contrib/dev/acpica/components/utilities/utdebug.c head/sys/contrib/dev/acpica/components/utilities/utdecode.c head/sys/contrib/dev/acpica/components/utilities/utdelete.c head/sys/contrib/dev/acpica/components/utilities/uterror.c head/sys/contrib/dev/acpica/components/utilities/uteval.c head/sys/contrib/dev/acpica/components/utilities/utexcep.c head/sys/contrib/dev/acpica/components/utilities/utfileio.c head/sys/contrib/dev/acpica/components/utilities/utglobal.c head/sys/contrib/dev/acpica/components/utilities/uthex.c head/sys/contrib/dev/acpica/components/utilities/utids.c head/sys/contrib/dev/acpica/components/utilities/utinit.c head/sys/contrib/dev/acpica/components/utilities/utlock.c head/sys/contrib/dev/acpica/components/utilities/utmath.c head/sys/contrib/dev/acpica/components/utilities/utmisc.c head/sys/contrib/dev/acpica/components/utilities/utmutex.c head/sys/contrib/dev/acpica/components/utilities/utobject.c head/sys/contrib/dev/acpica/components/utilities/utosi.c head/sys/contrib/dev/acpica/components/utilities/utownerid.c head/sys/contrib/dev/acpica/components/utilities/utpredef.c head/sys/contrib/dev/acpica/components/utilities/utprint.c head/sys/contrib/dev/acpica/components/utilities/utresrc.c head/sys/contrib/dev/acpica/components/utilities/utstate.c head/sys/contrib/dev/acpica/components/utilities/utstring.c head/sys/contrib/dev/acpica/components/utilities/uttrack.c head/sys/contrib/dev/acpica/components/utilities/utuuid.c head/sys/contrib/dev/acpica/components/utilities/utxface.c head/sys/contrib/dev/acpica/components/utilities/utxferror.c head/sys/contrib/dev/acpica/components/utilities/utxfinit.c head/sys/contrib/dev/acpica/components/utilities/utxfmutex.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/acbuffer.h head/sys/contrib/dev/acpica/include/accommon.h head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acdispat.h head/sys/contrib/dev/acpica/include/acevents.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/achware.h head/sys/contrib/dev/acpica/include/acinterp.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acnames.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acopcode.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/acparser.h head/sys/contrib/dev/acpica/include/acpi.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acpredef.h head/sys/contrib/dev/acpica/include/acresrc.h head/sys/contrib/dev/acpica/include/acrestyp.h head/sys/contrib/dev/acpica/include/acstruct.h head/sys/contrib/dev/acpica/include/actables.h head/sys/contrib/dev/acpica/include/actbl.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actbl3.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/include/amlcode.h head/sys/contrib/dev/acpica/include/amlresrc.h head/sys/contrib/dev/acpica/include/platform/acenv.h head/sys/contrib/dev/acpica/include/platform/acenvex.h head/sys/contrib/dev/acpica/include/platform/acfreebsd.h head/sys/contrib/dev/acpica/include/platform/acgcc.h head/sys/contrib/dev/acpica/os_specific/service_layers/oslibcfs.c head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/acpidb/acpidb.c head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/common/ (props changed) head/sys/contrib/dev/acpica/compiler/ (props changed) head/sys/contrib/dev/acpica/components/debugger/ (props changed) head/sys/contrib/dev/acpica/components/disassembler/ (props changed) head/sys/contrib/dev/acpica/components/dispatcher/ (props changed) head/sys/contrib/dev/acpica/components/events/ (props changed) head/sys/contrib/dev/acpica/components/executer/ (props changed) head/sys/contrib/dev/acpica/components/hardware/ (props changed) head/sys/contrib/dev/acpica/components/namespace/ (props changed) head/sys/contrib/dev/acpica/components/parser/ (props changed) head/sys/contrib/dev/acpica/components/resources/ (props changed) head/sys/contrib/dev/acpica/components/tables/ (props changed) head/sys/contrib/dev/acpica/components/utilities/ (props changed) head/sys/contrib/dev/acpica/include/ (props changed) head/sys/contrib/dev/acpica/os_specific/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/conf/files Wed Feb 18 20:33:00 2015 (r278970) @@ -271,6 +271,7 @@ contrib/dev/acpica/components/debugger/d contrib/dev/acpica/components/debugger/dbutils.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbxface.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmbuffer.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmcstyle.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmdeferred.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmnames.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmopcode.c optional acpi acpi_debug Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/changes.txt Wed Feb 18 20:33:00 2015 (r278970) @@ -1,4 +1,223 @@ ---------------------------------------- +04 February 2015. Summary of changes for version 20150204: + +This release is available at https://acpica.org/downloads + +ACPICA kernel-resident subsystem: + +Updated all ACPICA copyrights and signons to 2014. Added the 2014 +copyright to all module headers and signons, including the standard Linux +header. This affects virtually every file in the ACPICA core subsystem, +iASL compiler, all ACPICA utilities, and the test suites. + +Events: Introduce ACPI_GPE_DISPATCH_RAW_HANDLER to fix GPE storm issues. +A raw gpe handling mechanism was created to allow better handling of GPE +storms that aren't easily managed by the normal handler. The raw handler +allows disabling/renabling of the the GPE so that interrupt storms can be +avoided in cases where events cannot be timely serviced. In this scenario, +handlers should use the AcpiSetGpe() API to disable/enable the GPE. This API +will leave the reference counts undisturbed, thereby preventing unintentional +clearing of the GPE when the intent in only to temporarily disable it. Raw +handlers allow enabling and disabling of a GPE by removing GPE register +locking. As such, raw handlers much provide their own locks while using +GPE API's to protect access to GPE data structures. +Lv Zheng + +Events: Always modify GPE registers under the GPE lock. +Applies GPE lock around AcpiFinishGpe() to protect access to GPE register +values. Reported as bug by joe.liu@apple.com. + +Unix makefiles: Separate option to disable optimizations and _FORTIFY_SOURCE. +This change removes the _FORTIFY_SOURCE flag from the NOOPT disable option and +creates a separate flag (NOFORTIFY) for this purpose. Some toolchains may +define _FORTIFY_SOURCE which leads redefined errors when building ACPICA. This +allows disabling the option without also having to disable optimazations. +David Box + + Current Release: + Non-Debug Version: 101.7K Code, 27.9K Data, 129.6K Total + Debug Version: 199.2K Code, 82.4K Data, 281.6K Total + +---------------------------------------- +07 November 2014. Summary of changes for version 20141107: + +This release is available at https://acpica.org/downloads + +This release introduces and implements language extensions to ASL that +provide support for symbolic ("C-style") operators and expressions. These +language extensions are known collectively as ASL+. + + +1) iASL Compiler/Disassembler and Tools: + +Disassembler: Fixed a problem with disassembly of the UartSerialBus +macro. Changed "StopBitsNone" to the correct "StopBitsZero". David E. +Box. + +Disassembler: Fixed the Unicode macro support to add escape sequences. +All non-printable ASCII values are emitted as escape sequences, as well +as the standard escapes for quote and backslash. Ensures that the +disassembled macro can be correctly recompiled. + +iASL: Added Printf/Fprintf macros for formatted output. These macros are +translated to existing AML Concatenate and Store operations. Printf +writes to the ASL Debug object. Fprintf allows the specification of an +ASL name as the target. Only a single format specifier is required, %o, +since the AML interpreter dynamically converts objects to the required +type. David E. Box. + + (old) Store (Concatenate (Concatenate (Concatenate (Concatenate + (Concatenate (Concatenate (Concatenate ("", Arg0), + ": Unexpected value for "), Arg1), ", "), Arg2), + " at line "), Arg3), Debug) + + (new) Printf ("%o: Unexpected value for %o, %o at line %o", + Arg0, Arg1, Arg2, Arg3) + + (old) Store (Concatenate (Concatenate (Concatenate (Concatenate + ("", Arg1), ": "), Arg0), " Successful"), STR1) + + (new) Fprintf (STR1, "%o: %o Successful", Arg1, Arg0) + +iASL: Added debug options (-bp, -bt) to dynamically prune levels of the +ASL parse tree before the AML code is generated. This allows blocks of +ASL code to be removed in order to help locate and identify problem +devices and/or code. David E. Box. + +AcpiExec: Added support (-fi) for an optional namespace object +initialization file. This file specifies initial values for namespace +objects as necessary for debugging and testing different ASL code paths +that may be taken as a result of BIOS options. + + +2) Overview of symbolic operator support for ASL (ASL+) +------------------------------------------------------- + +As an extension to the ASL language, iASL implements support for symbolic +(C-style) operators for math and logical expressions. This can greatly +simplify ASL code as well as improve both readability and +maintainability. These language extensions can exist concurrently with +all legacy ASL code and expressions. + +The symbolic extensions are 100% compatible with existing AML +interpreters, since no new AML opcodes are created. To implement the +extensions, the iASL compiler transforms the symbolic expressions into +the legacy ASL/AML equivalents at compile time. + +Full symbolic expressions are supported, along with the standard C +precedence and associativity rules. + +Full disassembler support for the symbolic expressions is provided, and +creates an automatic migration path for existing ASL code to ASL+ code +via the disassembly process. By default, the disassembler now emits ASL+ +code with symbolic expressions. An option (-dl) is provided to force the +disassembler to emit legacy ASL code if desired. + +Below is the complete list of the currently supported symbolic operators +with examples. See the iASL User Guide for additional information. + + +ASL+ Syntax Legacy ASL Equivalent +----------- --------------------- + + // Math operators + +Z = X + Y Add (X, Y, Z) +Z = X - Y Subtract (X, Y, Z) +Z = X * Y Multiply (X, Y, Z) +Z = X / Y Divide (X, Y, , Z) +Z = X % Y Mod (X, Y, Z) +Z = X << Y ShiftLeft (X, Y, Z) +Z = X >> Y ShiftRight (X, Y, Z) +Z = X & Y And (X, Y, Z) +Z = X | Y Or (X, Y, Z) +Z = X ^ Y Xor (X, Y, Z) +Z = ~X Not (X, Z) +X++ Increment (X) +X-- Decrement (X) + + // Logical operators + +(X == Y) LEqual (X, Y) +(X != Y) LNotEqual (X, Y) +(X < Y) LLess (X, Y) +(X > Y) LGreater (X, Y) +(X <= Y) LLessEqual (X, Y) +(X >= Y) LGreaterEqual (X, Y) +(X && Y) LAnd (X, Y) +(X || Y) LOr (X, Y) +(!X) LNot (X) + + // Assignment and compound assignment operations + +X = Y Store (Y, X) +X += Y Add (X, Y, X) +X -= Y Subtract (X, Y, X) +X *= Y Multiply (X, Y, X) +X /= Y Divide (X, Y, , X) +X %= Y Mod (X, Y, X) +X <<= Y ShiftLeft (X, Y, X) +X >>= Y ShiftRight (X, Y, X) +X &= Y And (X, Y, X) +X |= Y Or (X, Y, X) +X ^= Y Xor (X, Y, X) + + +3) ASL+ Examples: +----------------- + +Legacy ASL: + If (LOr (LOr (LEqual (And (R510, 0x03FB), 0x02E0), LEqual ( + And (R520, 0x03FB), 0x02E0)), LOr (LEqual (And (R530, +0x03FB), + 0x02E0), LEqual (And (R540, 0x03FB), 0x02E0)))) + { + And (MEMB, 0xFFFFFFF0, SRMB) + Store (MEMB, Local2) + Store (PDBM, Local1) + And (PDBM, 0xFFFFFFFFFFFFFFF9, PDBM) + Store (SRMB, MEMB) + Or (PDBM, 0x02, PDBM) + } + +ASL+ version: + If (((R510 & 0x03FB) == 0x02E0) || + ((R520 & 0x03FB) == 0x02E0) || + ((R530 & 0x03FB) == 0x02E0) || + ((R540 & 0x03FB) == 0x02E0)) + { + SRMB = (MEMB & 0xFFFFFFF0) + Local2 = MEMB + Local1 = PDBM + PDBM &= 0xFFFFFFFFFFFFFFF9 + MEMB = SRMB + PDBM |= 0x02 + } + +Legacy ASL: + Store (0x1234, Local1) + Multiply (Add (Add (Local1, TEST), 0x20), Local2, Local3) + Multiply (Local2, Add (Add (Local1, TEST), 0x20), Local3) + Add (Local1, Add (TEST, Multiply (0x20, Local2)), Local3) + Store (Index (PKG1, 0x03), Local6) + Store (Add (Local3, Local2), Debug) + Add (Local1, 0x0F, Local2) + Add (Local1, Multiply (Local2, Local3), Local2) + Multiply (Add (Add (Local1, TEST), 0x20), ToBCD (Local1), Local3) + +ASL+ version: + Local1 = 0x1234 + Local3 = (((Local1 + TEST) + 0x20) * Local2) + Local3 = (Local2 * ((Local1 + TEST) + 0x20)) + Local3 = (Local1 + (TEST + (0x20 * Local2))) + Local6 = Index (PKG1, 0x03) + Debug = (Local3 + Local2) + Local2 = (Local1 + 0x0F) + Local2 = (Local1 + (Local2 * Local3)) + Local3 = (((Local1 + TEST) + 0x20) * ToBCD (Local1)) + + +---------------------------------------- 26 September 2014. Summary of changes for version 20140926: 1) ACPICA kernel-resident subsystem: Modified: head/sys/contrib/dev/acpica/common/acgetline.c ============================================================================== --- head/sys/contrib/dev/acpica/common/acgetline.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/common/acgetline.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/common/adfile.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/common/adisasm.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -357,8 +357,12 @@ AdAmlDisassemble ( AcpiDmDumpDataTable (Table); fprintf (stderr, "Acpi Data Table [%4.4s] decoded\n", Table->Signature); - fprintf (stderr, "Formatted output: %s - %u bytes\n", - DisasmFilename, CmGetFileSize (File)); + + if (File) + { + fprintf (stderr, "Formatted output: %s - %u bytes\n", + DisasmFilename, CmGetFileSize (File)); + } } else { @@ -376,8 +380,11 @@ AdAmlDisassemble ( { AcpiOsPrintf ("/**** Before second load\n"); - NsSetupNamespaceListing (File); - NsDisplayNamespace (); + if (File) + { + NsSetupNamespaceListing (File); + NsDisplayNamespace (); + } AcpiOsPrintf ("*****/\n"); } @@ -457,8 +464,11 @@ AdAmlDisassemble ( if (AslCompilerdebug) { AcpiOsPrintf ("/**** After second load and resource conversion\n"); - NsSetupNamespaceListing (File); - NsDisplayNamespace (); + if (File) + { + NsSetupNamespaceListing (File); + NsDisplayNamespace (); + } AcpiOsPrintf ("*****/\n"); AcpiDmDumpTree (AcpiGbl_ParseOpRoot); @@ -487,8 +497,11 @@ AdAmlDisassemble ( AcpiDmDumpDataTable (Table); fprintf (stderr, "Disassembly completed\n"); - fprintf (stderr, "ASL Output: %s - %u bytes\n", - DisasmFilename, CmGetFileSize (File)); + if (File) + { + fprintf (stderr, "ASL Output: %s - %u bytes\n", + DisasmFilename, CmGetFileSize (File)); + } if (Gbl_MapfileFlag) { @@ -507,7 +520,7 @@ Cleanup: ACPI_FREE (Table); } - if (OutToFile && File) + if (File) { if (AslCompilerdebug) /* Display final namespace, with transforms */ { @@ -544,12 +557,26 @@ AdDisassemblerHeader ( { time_t Timer; + time (&Timer); /* Header and input table info */ AcpiOsPrintf ("/*\n"); - AcpiOsPrintf (ACPI_COMMON_HEADER ("AML Disassembler", " * ")); + AcpiOsPrintf (ACPI_COMMON_HEADER (AML_DISASSEMBLER_NAME, " * ")); + + if (AcpiGbl_CstyleDisassembly) + { + AcpiOsPrintf ( + " * Disassembling to symbolic ASL+ operators\n" + " *\n"); + } + else + { + AcpiOsPrintf ( + " * Disassembling to non-symbolic legacy ASL operators\n" + " *\n"); + } AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer)); AcpiOsPrintf (" *\n"); Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/common/adwalk.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/ahids.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahids.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/common/ahids.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/ahpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahpredef.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/common/ahpredef.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/ahuuids.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahuuids.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/common/ahuuids.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/cmfsize.c ============================================================================== --- head/sys/contrib/dev/acpica/common/cmfsize.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/common/cmfsize.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/common/dmextern.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmrestag.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/common/dmrestag.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/common/dmtable.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/common/dmtbdump.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmtbinfo.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/common/dmtbinfo.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/getopt.c ============================================================================== --- head/sys/contrib/dev/acpica/common/getopt.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/common/getopt.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslanalyze.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslanalyze.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/compiler/aslanalyze.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslascii.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslascii.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/compiler/aslascii.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslbtypes.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslbtypes.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/compiler/aslbtypes.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -374,6 +374,12 @@ AnGetBtype ( UINT32 ThisNodeBtype = 0; + if (!Op) + { + AcpiOsPrintf ("Null Op in AnGetBtype\n"); + return (ACPI_UINT32_MAX); + } + if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) || (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) || (Op->Asl.ParseOpcode == PARSEOP_METHODCALL)) Modified: head/sys/contrib/dev/acpica/compiler/aslcodegen.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcodegen.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/compiler/aslcodegen.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -107,6 +107,12 @@ CgGenerateAmlOutput ( TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, CgAmlWriteWalk, NULL, NULL); + + DbgPrint (ASL_TREE_OUTPUT, + "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" + " Parent Child Next Flags AcTyp Final Col L\n", + 76, " "); + CgCloseTable (); } @@ -138,7 +144,8 @@ CgAmlWriteWalk ( DbgPrint (ASL_TREE_OUTPUT, "Final parse tree used for AML output:\n"); DbgPrint (ASL_TREE_OUTPUT, - "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr Child Parent Flags AcTyp Final Col L\n", + "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" + " Parent Child Next Flags AcTyp Final Col L\n", 76, " "); } @@ -161,7 +168,8 @@ CgAmlWriteWalk ( } DbgPrint (ASL_TREE_OUTPUT, - "%08X %04X %04X %01X %04X %04X %04X %04X %08X %08X %08X %08X %08X %04X %02d %02d\n", + "%08X %04X %04X %01X %04X %04X %04X %04X " + "%08X %08X %08X %08X %08X %08X %04X %02d %02d\n", /* 1 */ (UINT32) Op->Asl.Value.Integer, /* 2 */ Op->Asl.ParseOpcode, /* 3 */ Op->Asl.AmlOpcode, @@ -171,13 +179,14 @@ CgAmlWriteWalk ( /* 7 */ Op->Asl.AmlSubtreeLength, /* 8 */ Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0, /* 9 */ Op, - /* 10 */ Op->Asl.Child, - /* 11 */ Op->Asl.Parent, - /* 12 */ Op->Asl.CompileFlags, - /* 13 */ Op->Asl.AcpiBtype, - /* 14 */ Op->Asl.FinalAmlLength, - /* 15 */ Op->Asl.Column, - /* 16 */ Op->Asl.LineNumber); + /* 10 */ Op->Asl.Parent, + /* 11 */ Op->Asl.Child, + /* 12 */ Op->Asl.Next, + /* 13 */ Op->Asl.CompileFlags, + /* 14 */ Op->Asl.AcpiBtype, + /* 15 */ Op->Asl.FinalAmlLength, + /* 16 */ Op->Asl.Column, + /* 17 */ Op->Asl.LineNumber); /* Generate the AML for this node */ Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -118,10 +118,9 @@ CmDoCompile ( AslCompilerparse(); UtEndEvent (Event); - /* Check for parse errors */ + /* Check for parser-detected syntax errors */ - Status = AslCheckForErrorExit (); - if (ACPI_FAILURE (Status)) + if (Gbl_SyntaxError) { fprintf (stderr, "Compiler aborting due to parser-detected syntax error(s)\n"); LsDumpParseTree (); @@ -147,6 +146,13 @@ CmDoCompile ( Event = UtBeginEvent ("Flush source input"); CmFlushSourceCode (); + /* Prune the parse tree if requested (debug purposes only) */ + + if (Gbl_PruneParseTree) + { + AslPruneParseTree (Gbl_PruneDepth, Gbl_PruneType); + } + /* Optional parse tree dump, compiler debug output only */ LsDumpParseTree (); Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -543,6 +543,27 @@ OptOptimizeNamePath ( /* + * aslprintf - Printf/Fprintf macros + */ +void +OpcDoPrintf ( + ACPI_PARSE_OBJECT *Op); + +void +OpcDoFprintf ( + ACPI_PARSE_OBJECT *Op); + + +/* + * aslprune - parse tree pruner + */ +void +AslPruneParseTree ( + UINT32 PruneDepth, + UINT32 Type); + + +/* * aslcodegen - code generation */ void @@ -684,6 +705,16 @@ TrCreateLeafNode ( UINT32 ParseOpcode); ACPI_PARSE_OBJECT * +TrCreateAssignmentNode ( + ACPI_PARSE_OBJECT *Target, + ACPI_PARSE_OBJECT *Source); + +ACPI_PARSE_OBJECT * +TrCreateTargetOperand ( + ACPI_PARSE_OBJECT *OriginalOp, + ACPI_PARSE_OBJECT *ParentOp); + +ACPI_PARSE_OBJECT * TrCreateValuedLeafNode ( UINT32 ParseOpcode, UINT64 Value); Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.l Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.l Wed Feb 18 20:33:00 2015 (r278970) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -117,7 +117,49 @@ NamePathTail [.]{NameSeg} else {yyterminate ();} } ";" { count (0); return(';'); } + /* ASL Extension: Standard C operators */ +"~" { count (3); return (PARSEOP_EXP_NOT); } +"!" { count (3); return (PARSEOP_EXP_LOGICAL_NOT); } +"*" { count (3); return (PARSEOP_EXP_MULTIPLY); } +"/" { count (3); return (PARSEOP_EXP_DIVIDE); } +"%" { count (3); return (PARSEOP_EXP_MODULO); } +"+" { count (3); return (PARSEOP_EXP_ADD); } +"-" { count (3); return (PARSEOP_EXP_SUBTRACT); } +">>" { count (3); return (PARSEOP_EXP_SHIFT_RIGHT); } +"<<" { count (3); return (PARSEOP_EXP_SHIFT_LEFT); } +"<" { count (3); return (PARSEOP_EXP_LESS); } +">" { count (3); return (PARSEOP_EXP_GREATER); } +"&" { count (3); return (PARSEOP_EXP_AND); } +"<=" { count (3); return (PARSEOP_EXP_LESS_EQUAL); } +">=" { count (3); return (PARSEOP_EXP_GREATER_EQUAL); } +"==" { count (3); return (PARSEOP_EXP_EQUAL); } +"!=" { count (3); return (PARSEOP_EXP_NOT_EQUAL); } +"|" { count (3); return (PARSEOP_EXP_OR); } +"&&" { count (3); return (PARSEOP_EXP_LOGICAL_AND); } +"||" { count (3); return (PARSEOP_EXP_LOGICAL_OR); } +"++" { count (3); return (PARSEOP_EXP_INCREMENT); } +"--" { count (3); return (PARSEOP_EXP_DECREMENT); } +"^ " { count (3); return (PARSEOP_EXP_XOR); } + + /* ASL Extension: Standard C assignment operators */ + +"=" { count (3); return (PARSEOP_EXP_EQUALS); } +"+=" { count (3); return (PARSEOP_EXP_ADD_EQ); } +"-=" { count (3); return (PARSEOP_EXP_SUB_EQ); } +"*=" { count (3); return (PARSEOP_EXP_MUL_EQ); } +"/=" { count (3); return (PARSEOP_EXP_DIV_EQ); } +"%=" { count (3); return (PARSEOP_EXP_MOD_EQ); } +"<<=" { count (3); return (PARSEOP_EXP_SHL_EQ); } +">>=" { count (3); return (PARSEOP_EXP_SHR_EQ); } +"&=" { count (3); return (PARSEOP_EXP_AND_EQ); } +"^=" { count (3); return (PARSEOP_EXP_XOR_EQ); } +"|=" { count (3); return (PARSEOP_EXP_OR_EQ); } + + + /* + * Begin standard ASL grammar + */ 0[xX]{HexDigitChar}+ | {DigitChar}+ { AslCompilerlval.i = UtDoConstant ((char *) AslCompilertext); count (1); return (PARSEOP_INTEGER); } @@ -592,6 +634,44 @@ NamePathTail [.]{NameSeg} "Transfer8_16" { count (0); return (PARSEOP_XFERTYPE_8_16); } "Transfer16" { count (0); return (PARSEOP_XFERTYPE_16); } + /* ToPld macro */ + +"ToPLD" { count (0); return (PARSEOP_TOPLD); } + +"PLD_Revision" { count (0); return (PARSEOP_PLD_REVISION); } +"PLD_IgnoreColor" { count (0); return (PARSEOP_PLD_IGNORECOLOR); } +"PLD_Red" { count (0); return (PARSEOP_PLD_RED); } +"PLD_Green" { count (0); return (PARSEOP_PLD_GREEN); } +"PLD_Blue" { count (0); return (PARSEOP_PLD_BLUE); } +"PLD_Width" { count (0); return (PARSEOP_PLD_WIDTH); } +"PLD_Height" { count (0); return (PARSEOP_PLD_HEIGHT); } +"PLD_UserVisible" { count (0); return (PARSEOP_PLD_USERVISIBLE); } +"PLD_Dock" { count (0); return (PARSEOP_PLD_DOCK); } +"PLD_Lid" { count (0); return (PARSEOP_PLD_LID); } +"PLD_Panel" { count (0); return (PARSEOP_PLD_PANEL); } +"PLD_VerticalPosition" { count (0); return (PARSEOP_PLD_VERTICALPOSITION); } +"PLD_HorizontalPosition" { count (0); return (PARSEOP_PLD_HORIZONTALPOSITION); } +"PLD_Shape" { count (0); return (PARSEOP_PLD_SHAPE); } +"PLD_GroupOrientation" { count (0); return (PARSEOP_PLD_GROUPORIENTATION); } +"PLD_GroupToken" { count (0); return (PARSEOP_PLD_GROUPTOKEN); } +"PLD_GroupPosition" { count (0); return (PARSEOP_PLD_GROUPPOSITION); } +"PLD_Bay" { count (0); return (PARSEOP_PLD_BAY); } +"PLD_Ejectable" { count (0); return (PARSEOP_PLD_EJECTABLE); } +"PLD_EjectRequired" { count (0); return (PARSEOP_PLD_EJECTREQUIRED); } +"PLD_CabinetNumber" { count (0); return (PARSEOP_PLD_CABINETNUMBER); } +"PLD_CardCageNumber" { count (0); return (PARSEOP_PLD_CARDCAGENUMBER); } +"PLD_Reference" { count (0); return (PARSEOP_PLD_REFERENCE); } +"PLD_Rotation" { count (0); return (PARSEOP_PLD_ROTATION); } +"PLD_Order" { count (0); return (PARSEOP_PLD_ORDER); } +"PLD_Reserved" { count (0); return (PARSEOP_PLD_RESERVED); } +"PLD_VerticalOffset" { count (0); return (PARSEOP_PLD_VERTICALOFFSET); } +"PLD_HorizontalOffset" { count (0); return (PARSEOP_PLD_HORIZONTALOFFSET); } + + + /* printf debug macros */ +"printf" { count (0); return (PARSEOP_PRINTF); } +"fprintf" { count (0); return (PARSEOP_FPRINTF); } + /* Predefined compiler names */ "__DATE__" { count (0); return (PARSEOP___DATE__); } @@ -628,10 +708,6 @@ NamePathTail [.]{NameSeg} DbgPrint (ASL_PARSE_OUTPUT, "NameString: %s\n", s); return (PARSEOP_NAMESTRING); } -"*" | -"/" { count (1); - AslCompilererror ("Parse error, expecting ASL keyword or name");} - . { count (1); sprintf (MsgBuffer, "Invalid character (0x%2.2X), expecting ASL keyword or name", Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asldefine.h Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/compiler/asldefine.h Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -49,8 +49,8 @@ * Compiler versions and names */ #define ASL_REVISION ACPI_CA_VERSION -#define ASL_COMPILER_NAME "ASL Optimizing Compiler" -#define AML_DISASSEMBLER_NAME "AML Disassembler" +#define ASL_COMPILER_NAME "ASL+ Optimizing Compiler" +#define AML_DISASSEMBLER_NAME "AML/ASL+ Disassembler" #define ASL_INVOCATION_NAME "iasl" #define ASL_CREATOR_ID "INTL" Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -918,6 +918,8 @@ AslCompilererror ( const char *CompilerMessage) { + Gbl_SyntaxError++; + AslCommonError (ASL_ERROR, ASL_MSG_SYNTAX, Gbl_CurrentLineNumber, Gbl_LogicalLineNumber, Gbl_CurrentLineOffset, Gbl_CurrentColumn, Gbl_Files[ASL_FILE_INPUT].Filename, Modified: head/sys/contrib/dev/acpica/compiler/aslfileio.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfileio.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/compiler/aslfileio.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -68,8 +68,8 @@ FlFileError ( UINT8 ErrorId) { - sprintf (MsgBuffer, "\"%s\" (%s)", Gbl_Files[FileId].Filename, - strerror (errno)); + sprintf (MsgBuffer, "\"%s\" (%s) - %s", Gbl_Files[FileId].Filename, + Gbl_Files[FileId].Description, strerror (errno)); AslCommonError (ASL_ERROR, ErrorId, 0, 0, 0, 0, NULL, MsgBuffer); } @@ -98,6 +98,9 @@ FlOpenFile ( FILE *File; + Gbl_Files[FileId].Filename = Filename; + Gbl_Files[FileId].Handle = NULL; + File = fopen (Filename, Mode); if (!File) { @@ -105,8 +108,7 @@ FlOpenFile ( AslAbort (); } - Gbl_Files[FileId].Filename = Filename; - Gbl_Files[FileId].Handle = File; + Gbl_Files[FileId].Handle = File; } Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -485,6 +485,8 @@ FlOpenAmlOutputFile ( 0, 0, 0, 0, NULL, NULL); return (AE_ERROR); } + + Gbl_Files[ASL_FILE_AML_OUTPUT].Filename = Filename; } /* Open the output AML file in binary mode */ @@ -563,9 +565,14 @@ FlOpenMiscOutputFiles ( if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle) { - AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME, - 0, 0, 0, 0, NULL, NULL); - return (AE_ERROR); + /* + * A problem with freopen is that on error, + * we no longer have stderr. + */ + Gbl_DebugFlag = FALSE; + memcpy (stderr, stdout, sizeof (FILE)); + FlFileError (ASL_FILE_DEBUG_OUTPUT, ASL_MSG_DEBUG_FILENAME); + AslAbort (); } AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT); @@ -758,6 +765,26 @@ FlOpenMiscOutputFiles ( AslCompilerFileHeader (ASL_FILE_NAMESPACE_OUTPUT); } + /* Create/Open a map file if requested */ + + if (Gbl_MapfileFlag) + { + Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_MAP); + if (!Filename) + { + AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME, + 0, 0, 0, 0, NULL, NULL); + return (AE_ERROR); + } + + /* Open the hex file, text mode (closed at compiler exit) */ + + FlOpenFile (ASL_FILE_MAP_OUTPUT, Filename, "w+t"); + + AslCompilerSignon (ASL_FILE_MAP_OUTPUT); + AslCompilerFileHeader (ASL_FILE_MAP_OUTPUT); + } + return (AE_OK); } Modified: head/sys/contrib/dev/acpica/compiler/aslfold.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfold.c Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/compiler/aslfold.c Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslglobal.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslglobal.h Wed Feb 18 19:53:56 2015 (r278969) +++ head/sys/contrib/dev/acpica/compiler/aslglobal.h Wed Feb 18 20:33:00 2015 (r278970) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2014, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -127,6 +127,7 @@ ASL_EXTERN UINT32 ASL_ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineNumber, 1); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LogicalLineNumber, 1); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineOffset, 0); +ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_SyntaxError, 0); /* Exception reporting */ @@ -173,6 +174,7 @@ ASL_EXTERN BOOLEAN ASL_ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileGeneric, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AllExceptionsDisabled, FALSE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PruneParseTree, FALSE); #define HEX_OUTPUT_NONE 0 @@ -251,6 +253,8 @@ ASL_EXTERN UINT32 ASL_ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ReservedMethods, 0); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableSignature, "NO_SIG"); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableId, "NO_ID"); +ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_PruneDepth, 0); +ASL_EXTERN UINT16 ASL_INIT_GLOBAL (Gbl_PruneType, 0); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 21:35:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 957343E9 for ; Wed, 18 Feb 2015 21:35:24 +0000 (UTC) Received: from nm32-vm7.bullet.mail.bf1.yahoo.com (nm32-vm7.bullet.mail.bf1.yahoo.com [72.30.239.143]) (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 48886ED0 for ; Wed, 18 Feb 2015 21:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1424294935; bh=IEHgDFDIMgcmgQDv6uRak/1gbF1K8OjBrBWafPbUZ74=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=IytLzQjTHXP+rsX79LQ/KbNpPr+jo45FKaFPw5Fm0TK4qf84PEHPzccG7YOKQLXGyD94L8ex6s/krKxfdIWAlWNic4TPKyEjCG1aXCjokTbtjnuS9Vccka8z6K++lcXiI9SGnzBXYfnv+vLsKyvSsjliJa3ih7kNEdf6aRtR29xN+OHZUwOcujPzGEy4IUFcXXeqp8KWzvUs7tz4Er3nmy7TLJSCkBIaggzjrDHuqmq+Zv1CDQ0dhSVYWtd8gceSxfZx5rLbL5fTrL4jpXWddgNRBX7/sluNxdGaf/jmDZff4+3wLyHFf7x38VAZMRvltAi5nG9U9eVlKrrM0459DQ== Received: from [66.196.81.171] by nm32.bullet.mail.bf1.yahoo.com with NNFMP; 18 Feb 2015 21:28:55 -0000 Received: from [98.139.213.8] by tm17.bullet.mail.bf1.yahoo.com with NNFMP; 18 Feb 2015 21:28:55 -0000 Received: from [127.0.0.1] by smtp108.mail.bf1.yahoo.com with NNFMP; 18 Feb 2015 21:28:55 -0000 X-Yahoo-Newman-Id: 141403.94464.bm@smtp108.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: W5YbimYVM1l5pSrAAJMYQsFgr4VTXDR_1gA22kQNX13BLwo EpY8EWRe2nYegtUtCx8piRtCFvVosYl489XJDyOSRxoo7vCUpy3DAYj71Qtn LFIDj98vXq4Q3HrwOsmciFFzPsERD62WEnaZ_AAA9s5FOV42SHlsrDlUtFyl nskFKaC4ff7sk_wgIwUeMlOtB9X6mbnX4Y1tlqejlaEfJoXuEYToIDkpON2B WsugZzl7E50uWGZNvbQl38qXlWdax.tXaztA8uCqDerXAovyx_qlyYiiMInG BrYVjviSCpNfEpm8whflVLPN_kzkWXp6jEc9Ycc07uIGJtpjwV0iRLKJnRxO _rCObSa.IFsNs_c7q52PC1oUeQewy5M1WDs.uT7lUBG5vd3aGI5.l4gF2eDG PdIbr3K48yoTlGkGIwY_MxL_gqA8lGHgVKNrbcNt09qWItQ6rwFuWml3HV_u QGRG3F2mwq2KuJDVls67LdMstC7.10BZnW_eB45.lPdLfa0Anr4DwmH0gh.o lnS0RVaqX7X3xylJETGwORcrIc_tIzgBZ X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <54E50419.3030106@FreeBSD.org> Date: Wed, 18 Feb 2015 16:28:57 -0500 From: Pedro Giffuni Organization: FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Rui Paulo , Steven Hartland Subject: Re: svn commit: r277300 - in head: cddl/contrib/opensolaris/cmd/dtrace cddl/contrib/opensolaris/cmd/lockstat cddl/contrib/opensolaris/cmd/mdb/tools/common cddl/contrib/opensolaris/cmd/plockstat cddl/co... References: <5f8079b1-ae7d-4977-99f6-a8fd0f3f8252@me.com> In-Reply-To: <5f8079b1-ae7d-4977-99f6-a8fd0f3f8252@me.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 18 Feb 2015 21:35:24 -0000 On 18/02/2015 01:36 p.m., Rui Paulo wrote: > On Jan 17, 2015, at 06:45 AM, Steven Hartland wrote: > >> Author: smh >> Date: Sat Jan 17 14:44:59 2015 >> New Revision: 277300 >> URL: https://svnweb.freebsd.org/changeset/base/277300 >> >> Log: >> Mechanically convert cddl sun #ifdef's to illumos >> >> Since the upstream for cddl code is now illumos not sun, mechanically >> convert all sun #ifdef's to illumos #ifdef's which have been used in all >> newer code for some time. >> FWIW, we should probably "svn move" contrib/cddl/opensolaris to contrib/cddl/illumos as well. "opensolaris" doesn't exist anymore but "illumos" is also shorter. >> Also do a manual pass to correct the use if #ifdef comments as per >> style(9) >> as well as few uses of #if defined(__FreeBSD__) vs #ifndef illumos. > I had just convinced Mark Johnston to use "#ifdef __FreeBSD__" instead > of "#ifndef illumos". Is there a reason why we keep using #ifndef ? > To me, it's much easier to read #ifdef __FreeBSD__ than to note > whether theres an "n" in that pre-processor macro. > Pedro. From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 23:10:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1805F46D; Wed, 18 Feb 2015 23:10:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 03233E09; Wed, 18 Feb 2015 23:10:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1INAF9u063396; Wed, 18 Feb 2015 23:10:15 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1INAF5j063395; Wed, 18 Feb 2015 23:10:15 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201502182310.t1INAF5j063395@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 18 Feb 2015 23:10:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278975 - 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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 23:10:16 -0000 Author: jkim Date: Wed Feb 18 23:10:15 2015 New Revision: 278975 URL: https://svnweb.freebsd.org/changeset/base/278975 Log: Fix bootstrap on systems with old yacc with small MAXTABLE. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Feb 18 23:08:13 2015 (r278974) +++ head/Makefile.inc1 Wed Feb 18 23:10:15 2015 (r278975) @@ -1247,11 +1247,6 @@ _m4= lib/libohash \ usr.bin/m4 .endif -.if ${BOOTSTRAPPING} < 1000013 -_yacc= lib/liby \ - usr.bin/yacc -.endif - .if ${BOOTSTRAPPING} < 1000014 _crunch= usr.sbin/crunch .endif @@ -1273,6 +1268,11 @@ _lex= usr.bin/lex _awk= usr.bin/awk .endif +.if ${BOOTSTRAPPING} < 1001506 +_yacc= lib/liby \ + usr.bin/yacc +.endif + .if ${MK_BSNMP} != "no" _gensnmptree= usr.sbin/bsnmpd/gensnmptree .endif From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 23:28:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13AFA9E8 for ; Wed, 18 Feb 2015 23:28:26 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (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 CDE28FEB for ; Wed, 18 Feb 2015 23:28:25 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t1INSPoM082344 for ; Wed, 18 Feb 2015 23:28:25 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t1INSPEs082342 for svn-src-head@freebsd.org; Wed, 18 Feb 2015 23:28:25 GMT (envelope-from bdrewery) Received: (qmail 22614 invoked from network); 18 Feb 2015 17:28:23 -0600 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 18 Feb 2015 17:28:23 -0600 Message-ID: <54E52019.8080009@FreeBSD.org> Date: Wed, 18 Feb 2015 17:28:25 -0600 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278889 - head/lib/libc/include References: <201502170854.t1H8s4TL085174@svn.freebsd.org> In-Reply-To: <201502170854.t1H8s4TL085174@svn.freebsd.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HdAbDJnagW23GuF9WJKme0eVEqMLgQJPf" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 18 Feb 2015 23:28:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HdAbDJnagW23GuF9WJKme0eVEqMLgQJPf Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2/17/2015 2:54 AM, Konstantin Belousov wrote: > Author: kib > Date: Tue Feb 17 08:54:03 2015 > New Revision: 278889 > URL: https://svnweb.freebsd.org/changeset/base/278889 >=20 > Log: > Restore the extern qualifier on __cleanup. > =20 > Sponsored by: The FreeBSD Foundation > MFC after: 3 days >=20 > Modified: > head/lib/libc/include/libc_private.h >=20 > Modified: head/lib/libc/include/libc_private.h > =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/lib/libc/include/libc_private.h Tue Feb 17 08:50:26 2015 (r278= 888) > +++ head/lib/libc/include/libc_private.h Tue Feb 17 08:54:03 2015 (r278= 889) > @@ -271,7 +271,7 @@ void _malloc_first_thread(void); > /* > * Function to clean up streams, called from abort() and exit(). > */ > -void (*__cleanup)(void) __hidden; > +extern void (*__cleanup)(void) __hidden; > =20 > /* > * Get kern.osreldate to detect ABI revisions. Explicitly >=20 Is this a NOP? --=20 Regards, Bryan Drewery --HdAbDJnagW23GuF9WJKme0eVEqMLgQJPf 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 iQEcBAEBAgAGBQJU5SAZAAoJEDXXcbtuRpfP2/AH/1cSzmxjqB8BM71wzwLKwoFZ o2S2Mk3s/wwcAF+fu2uf4TjcpxJOPSIzw1NC/VCSgV96X0c2UEAxNcCpQjMpbRJT B+4UnEh2n1/UVKH2MDwORS5slqrurHdE3kiy01o4WPT9JSr5Qmgl552jZpehGlFx KvX67WJqxk0kJzO+SqtH8ZTnbViMoBvaKEbC3ywN6g77fuH8y4VDjeNxtJAJpg4j XQy0a0RSHA99eP5JyQ2cpJ8/3y9TB4UtEVyxsdHQe+6TpPj6oBFJAletnut9NvR+ +F8t+QBcOuwAZHtvBhkdTeBPFErHSvvlgvXQxreSSUsr/CxycTqPWUssfowDqkc= =djc7 -----END PGP SIGNATURE----- --HdAbDJnagW23GuF9WJKme0eVEqMLgQJPf-- From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 23:28:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B96CB5D for ; Wed, 18 Feb 2015 23:28:31 +0000 (UTC) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) (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 9499CFF1 for ; Wed, 18 Feb 2015 23:28:30 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id l2so4102187wgh.9 for ; Wed, 18 Feb 2015 15:28:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=2ViFiMT57OvpjKyLgWoVoMYc1rcDLeDPfcKd5TNbwLM=; b=Y7ShbeJ+tu4j6I4T1E6PX6ykwsDRqemw27a9VxhYW+clXrECr5x2+Zjavi0w6viiHG OUekxHXDWjORBxzJ+kozZUsmLY39aYbeDKTV3nc+zeRANrwPybAOCZVj8Z/MQE7yqfTa 0ChK2cGWXzKqk3AlOdoGuHcmUSFDqzVA+aY0yiKYWN9w3PuJBmkV4nmNa8UfuJhkig9l KhpH/dF3ayGIbFLdWlSFPfVNTDz9BpJoGrgnh4uZIXxdSR+qsZgHCW7ndz7kF0BRP+ts y7kwCXgDVFvlSGqKhx/VBUS8pZHvtUwKEar5RcKjdnGwpO+RvgGhl+Z8BaBou3RPPWem zbEw== X-Gm-Message-State: ALoCoQnj/FDN6501sUdIsIVMNqGTgPLuVFRp6ooNIxgs4FkMjndgW+g+QxjniuR1ItT9p9KV0JYw X-Received: by 10.194.187.236 with SMTP id fv12mr3144156wjc.131.1424302102919; Wed, 18 Feb 2015 15:28:22 -0800 (PST) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by mx.google.com with ESMTPSA id gm2sm21528228wib.5.2015.02.18.15.28.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 15:28:21 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Message-ID: <54E52011.9040502@freebsd.org> Date: Wed, 18 Feb 2015 23:28:17 +0000 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Rui Paulo Subject: Re: svn commit: r277300 - in head: cddl/contrib/opensolaris/cmd/dtrace cddl/contrib/opensolaris/cmd/lockstat cddl/contrib/opensolaris/cmd/mdb/tools/common cddl/contrib/opensolaris/cmd/plockstat cddl/co... References: <5f8079b1-ae7d-4977-99f6-a8fd0f3f8252@me.com> In-Reply-To: <5f8079b1-ae7d-4977-99f6-a8fd0f3f8252@me.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 18 Feb 2015 23:28:31 -0000 On 18/02/2015 18:36, Rui Paulo wrote: > On Jan 17, 2015, at 06:45 AM, Steven Hartland wrote: > >> Author: smh >> Date: Sat Jan 17 14:44:59 2015 >> New Revision: 277300 >> URL: https://svnweb.freebsd.org/changeset/base/277300 >> >> Log: >> Mechanically convert cddl sun #ifdef's to illumos >> >> Since the upstream for cddl code is now illumos not sun, mechanically >> convert all sun #ifdef's to illumos #ifdef's which have been used in all >> newer code for some time. >> >> Also do a manual pass to correct the use if #ifdef comments as per >> style(9) >> as well as few uses of #if defined(__FreeBSD__) vs #ifndef illumos. > I had just convinced Mark Johnston to use "#ifdef __FreeBSD__" instead > of "#ifndef illumos". Is there a reason why we keep using #ifndef ? > To me, it's much easier to read #ifdef __FreeBSD__ than to note > whether theres an "n" in that pre-processor macro. > None that I'm aware of, happy to go with that in the future :) From owner-svn-src-head@FreeBSD.ORG Wed Feb 18 23:34:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83F8FE36; Wed, 18 Feb 2015 23:34:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6F4E515B; Wed, 18 Feb 2015 23:34:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1INY4vd076586; Wed, 18 Feb 2015 23:34:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1INY463076584; Wed, 18 Feb 2015 23:34:04 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201502182334.t1INY463076584@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 18 Feb 2015 23:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278976 - in head/sys: amd64/amd64 i386/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.18-1 Precedence: list List-Id: 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, 18 Feb 2015 23:34:04 -0000 Author: jhb Date: Wed Feb 18 23:34:03 2015 New Revision: 278976 URL: https://svnweb.freebsd.org/changeset/base/278976 Log: Ensure that the supplied data length is large enough to hold the base FPU state to avoid passing a negative length to fpusetregs() / npxsetregs(). Differential Revision: https://reviews.freebsd.org/D1861 Reviewed by: kib, emaste Modified: head/sys/amd64/amd64/ptrace_machdep.c head/sys/i386/i386/ptrace_machdep.c Modified: head/sys/amd64/amd64/ptrace_machdep.c ============================================================================== --- head/sys/amd64/amd64/ptrace_machdep.c Wed Feb 18 23:10:15 2015 (r278975) +++ head/sys/amd64/amd64/ptrace_machdep.c Wed Feb 18 23:34:03 2015 (r278976) @@ -88,7 +88,8 @@ cpu_ptrace_xstate(struct thread *td, int break; case PT_SETXSTATE: - if (data > cpu_max_ext_state_size) { + if (data < sizeof(struct savefpu) || + data > cpu_max_ext_state_size) { error = EINVAL; break; } Modified: head/sys/i386/i386/ptrace_machdep.c ============================================================================== --- head/sys/i386/i386/ptrace_machdep.c Wed Feb 18 23:10:15 2015 (r278975) +++ head/sys/i386/i386/ptrace_machdep.c Wed Feb 18 23:34:03 2015 (r278976) @@ -92,7 +92,8 @@ cpu_ptrace_xstate(struct thread *td, int break; case PT_SETXSTATE: - if (data > cpu_max_ext_state_size) { + if (data < sizeof(union savefpu) || + data > cpu_max_ext_state_size) { error = EINVAL; break; } From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 00:58:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EA9F9B6; Thu, 19 Feb 2015 00:58:57 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 4EAAEE1D; Thu, 19 Feb 2015 00:58:57 +0000 (UTC) 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 26CAB7827C1; Thu, 19 Feb 2015 11:58:49 +1100 (AEDT) Date: Thu, 19 Feb 2015 11:58:48 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bryan Drewery Subject: Re: svn commit: r278889 - head/lib/libc/include In-Reply-To: <54E52019.8080009@FreeBSD.org> Message-ID: <20150219113226.K2984@besplex.bde.org> References: <201502170854.t1H8s4TL085174@svn.freebsd.org> <54E52019.8080009@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=A5NVYcmG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=-bqlIzqZ-nb7rq5Px1YA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 19 Feb 2015 00:58:57 -0000 On Wed, 18 Feb 2015, Bryan Drewery wrote: > On 2/17/2015 2:54 AM, Konstantin Belousov wrote: >> ... >> Log: >> Restore the extern qualifier on __cleanup. >> ... >> Modified: head/lib/libc/include/libc_private.h >> ============================================================================== >> --- head/lib/libc/include/libc_private.h Tue Feb 17 08:50:26 2015 (r278888) >> +++ head/lib/libc/include/libc_private.h Tue Feb 17 08:54:03 2015 (r278889) >> @@ -271,7 +271,7 @@ void _malloc_first_thread(void); >> /* >> * Function to clean up streams, called from abort() and exit(). >> */ >> -void (*__cleanup)(void) __hidden; >> +extern void (*__cleanup)(void) __hidden; >> >> /* >> * Get kern.osreldate to detect ABI revisions. Explicitly >> > > Is this a NOP? No, since this is a data declaration. It would be a style bug on a prototype. BTW, the reason for existence of __cleanup() has been broken by malloc() and other bloatware. It is to avoid linking anything in stdio when only exit() is used. But crtso now links to malloc() and malloc() links to stdio and much more. When correctly (that is, statically) linked, this bloats the size of a minimal C program from to 440K + 80K symbols on amd64 and to 390K + 60K symbols on i386. In FreeBSD-4 and in my version of FreeBSD-5, __cleanup still works and the minimal C program has size 2K + 1.5K symbols. In FreeBSD-5, malloc() is relatively unbloated, so crtso's linking to it costs only 9K + 9K symbols instead of 400+K. The same program written in asm takes about 10 bytes in all versions of FreeBSD-x86. When dynamically linked, __cleanup() has little effect. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 01:19:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B986B146; Thu, 19 Feb 2015 01:19:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A2850B7; Thu, 19 Feb 2015 01:19:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1J1Ji7d025611; Thu, 19 Feb 2015 01:19:44 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1J1JhSI025601; Thu, 19 Feb 2015 01:19:43 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502190119.t1J1JhSI025601@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 19 Feb 2015 01:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278977 - in head/sys: dev/cxgb dev/cxgb/sys dev/cxgb/ulp/tom dev/xen/netfront 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 01:19:44 -0000 Author: glebius Date: Thu Feb 19 01:19:42 2015 New Revision: 278977 URL: https://svnweb.freebsd.org/changeset/base/278977 Log: Provide a set of inline functions to manage simple mbuf(9) queues, based on queue(3)'s STAILQ. Utilize them in cxgb(4) and Xen, deleting home grown implementations. Sponsored by: Netflix Sponsored by: Nginx, Inc. Deleted: head/sys/dev/cxgb/sys/mbufq.h head/sys/dev/xen/netfront/mbufq.h Modified: head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c head/sys/dev/cxgb/ulp/tom/cxgb_toepcb.h head/sys/dev/xen/netfront/netfront.c head/sys/sys/mbuf.h Modified: head/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- head/sys/dev/cxgb/cxgb_adapter.h Wed Feb 18 23:34:03 2015 (r278976) +++ head/sys/dev/cxgb/cxgb_adapter.h Thu Feb 19 01:19:42 2015 (r278977) @@ -59,7 +59,6 @@ $FreeBSD$ #include #include -#include struct adapter; struct sge_qset; @@ -251,7 +250,7 @@ struct sge_txq { bus_dma_tag_t desc_tag; bus_dmamap_t desc_map; bus_dma_tag_t entry_tag; - struct mbuf_head sendq; + struct mbufq sendq; struct buf_ring *txq_mr; struct ifaltq *txq_ifq; Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Wed Feb 18 23:34:03 2015 (r278976) +++ head/sys/dev/cxgb/cxgb_sge.c Thu Feb 19 01:19:42 2015 (r278977) @@ -1117,9 +1117,10 @@ init_qset_cntxt(struct sge_qset *qs, u_i qs->txq[TXQ_CTRL].cntxt_id = FW_CTRL_SGEEC_START + id; qs->txq[TXQ_CTRL].token = FW_CTRL_TID_START + id; - mbufq_init(&qs->txq[TXQ_ETH].sendq); - mbufq_init(&qs->txq[TXQ_OFLD].sendq); - mbufq_init(&qs->txq[TXQ_CTRL].sendq); + /* XXX: a sane limit is needed instead of INT_MAX */ + mbufq_init(&qs->txq[TXQ_ETH].sendq, INT_MAX); + mbufq_init(&qs->txq[TXQ_OFLD].sendq, INT_MAX); + mbufq_init(&qs->txq[TXQ_CTRL].sendq, INT_MAX); } @@ -1820,8 +1821,8 @@ check_desc_avail(adapter_t *adap, struct * the control queue is only used for binding qsets which happens * at init time so we are guaranteed enough descriptors */ - if (__predict_false(!mbufq_empty(&q->sendq))) { -addq_exit: mbufq_tail(&q->sendq, m); + if (__predict_false(mbufq_len(&q->sendq))) { +addq_exit: (void )mbufq_enqueue(&q->sendq, m); return 1; } if (__predict_false(q->size - q->in_use < ndesc)) { @@ -1936,7 +1937,7 @@ again: reclaim_completed_tx_imm(q); } q->in_use++; } - if (!mbufq_empty(&q->sendq)) { + if (mbufq_len(&q->sendq)) { setbit(&qs->txq_stopped, TXQ_CTRL); if (should_restart_tx(q) && @@ -2319,7 +2320,7 @@ restart_offloadq(void *data, int npendin TXQ_LOCK(qs); again: cleaned = reclaim_completed_tx(qs, 16, TXQ_OFLD); - while ((m = mbufq_peek(&q->sendq)) != NULL) { + while ((m = mbufq_first(&q->sendq)) != NULL) { unsigned int gen, pidx; struct ofld_hdr *oh = mtod(m, struct ofld_hdr *); unsigned int ndesc = G_HDR_NDESC(oh->flags); @@ -2485,7 +2486,7 @@ t3_sge_alloc_qset(adapter_t *sc, u_int i printf("error %d from alloc ring tx %i\n", ret, i); goto err; } - mbufq_init(&q->txq[i].sendq); + mbufq_init(&q->txq[i].sendq, INT_MAX); q->txq[i].gen = 1; q->txq[i].size = p->txq_size[i]; } @@ -3521,7 +3522,7 @@ t3_add_configured_sysctls(adapter_t *sc) CTLFLAG_RD, &qs->txq[TXQ_ETH].txq_mr->br_drops, "#tunneled packets dropped"); SYSCTL_ADD_UINT(ctx, txqpoidlist, OID_AUTO, "sendqlen", - CTLFLAG_RD, &qs->txq[TXQ_ETH].sendq.qlen, + CTLFLAG_RD, &qs->txq[TXQ_ETH].sendq.mq_len, 0, "#tunneled packets waiting to be sent"); #if 0 SYSCTL_ADD_UINT(ctx, txqpoidlist, OID_AUTO, "queue_pidx", Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Feb 18 23:34:03 2015 (r278976) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Thu Feb 19 01:19:42 2015 (r278977) @@ -1088,7 +1088,7 @@ send_reset(struct toepcb *toep) req->cmd = CPL_ABORT_SEND_RST; if (tp->t_state == TCPS_SYN_SENT) - mbufq_tail(&toep->out_of_order_queue, m); /* defer */ + (void )mbufq_enqueue(&toep->out_of_order_queue, m); /* defer */ else l2t_send(sc, m, toep->tp_l2t); } Modified: head/sys/dev/cxgb/ulp/tom/cxgb_toepcb.h ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_toepcb.h Wed Feb 18 23:34:03 2015 (r278976) +++ head/sys/dev/cxgb/ulp/tom/cxgb_toepcb.h Thu Feb 19 01:19:42 2015 (r278977) @@ -30,7 +30,7 @@ #define CXGB_TOEPCB_H_ #include #include -#include +#include #define TP_DATASENT (1 << 0) #define TP_TX_WAIT_IDLE (1 << 1) @@ -64,26 +64,26 @@ struct toepcb { struct inpcb *tp_inp; struct mbuf *tp_m_last; - struct mbuf_head wr_list; - struct mbuf_head out_of_order_queue; + struct mbufq wr_list; + struct mbufq out_of_order_queue; }; static inline void reset_wr_list(struct toepcb *toep) { - mbufq_init(&toep->wr_list); + mbufq_init(&toep->wr_list, INT_MAX); /* XXX: sane limit needed */ } static inline void enqueue_wr(struct toepcb *toep, struct mbuf *m) { - mbufq_tail(&toep->wr_list, m); + (void )mbufq_enqueue(&toep->wr_list, m); } static inline struct mbuf * peek_wr(const struct toepcb *toep) { - return (mbufq_peek(&toep->wr_list)); + return (mbufq_first(&toep->wr_list)); } static inline struct mbuf * Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Wed Feb 18 23:34:03 2015 (r278976) +++ head/sys/dev/xen/netfront/netfront.c Thu Feb 19 01:19:42 2015 (r278977) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -87,8 +88,6 @@ __FBSDID("$FreeBSD$"); #include -#include - #include "xenbus_if.h" /* Features supported by all backends. TSO and LRO can be negotiated */ @@ -277,7 +276,7 @@ struct netfront_info { int rx_ring_ref; uint8_t mac[ETHER_ADDR_LEN]; struct xn_chain_data xn_cdata; /* mbufs */ - struct mbuf_head xn_rx_batch; /* head of the batch queue */ + struct mbufq xn_rx_batch; /* batch queue */ int xn_if_flags; struct callout xn_stat_ch; @@ -837,7 +836,7 @@ no_mbuf: m_new->m_len = m_new->m_pkthdr.len = MJUMPAGESIZE; /* queue the mbufs allocated */ - mbufq_tail(&sc->xn_rx_batch, m_new); + (void )mbufq_enqueue(&sc->xn_rx_batch, m_new); } /* @@ -973,7 +972,7 @@ xn_rxeof(struct netfront_info *np) RING_IDX i, rp; multicall_entry_t *mcl; struct mbuf *m; - struct mbuf_head rxq, errq; + struct mbufq rxq, errq; int err, pages_flipped = 0, work_to_do; do { @@ -981,8 +980,9 @@ xn_rxeof(struct netfront_info *np) if (!netfront_carrier_ok(np)) return; - mbufq_init(&errq); - mbufq_init(&rxq); + /* XXX: there should be some sane limit. */ + mbufq_init(&errq, INT_MAX); + mbufq_init(&rxq, INT_MAX); ifp = np->xn_ifp; @@ -1000,7 +1000,7 @@ xn_rxeof(struct netfront_info *np) if (__predict_false(err)) { if (m) - mbufq_tail(&errq, m); + (void )mbufq_enqueue(&errq, m); np->stats.rx_errors++; continue; } @@ -1022,7 +1022,7 @@ xn_rxeof(struct netfront_info *np) np->stats.rx_packets++; np->stats.rx_bytes += m->m_pkthdr.len; - mbufq_tail(&rxq, m); + (void )mbufq_enqueue(&rxq, m); np->rx.rsp_cons = i; } @@ -1046,8 +1046,7 @@ xn_rxeof(struct netfront_info *np) } } - while ((m = mbufq_dequeue(&errq))) - m_freem(m); + mbufq_drain(&errq); /* * Process all the mbufs after the remapping is complete. Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Wed Feb 18 23:34:03 2015 (r278976) +++ head/sys/sys/mbuf.h Thu Feb 19 01:19:42 2015 (r278977) @@ -1199,5 +1199,101 @@ rt_m_getfib(struct mbuf *m) #define M_PROFILE(m) #endif +struct mbufq { + STAILQ_HEAD(, mbuf) mq_head; + int mq_len; + int mq_maxlen; +}; +static inline void +mbufq_init(struct mbufq *mq, int maxlen) +{ + + STAILQ_INIT(&mq->mq_head); + mq->mq_maxlen = maxlen; + mq->mq_len = 0; +} + +static inline struct mbuf * +mbufq_flush(struct mbufq *mq) +{ + struct mbuf *m; + + m = STAILQ_FIRST(&mq->mq_head); + STAILQ_INIT(&mq->mq_head); + mq->mq_len = 0; + return (m); +} + +static inline void +mbufq_drain(struct mbufq *mq) +{ + struct mbuf *m, *n; + + n = mbufq_flush(mq); + while ((m = n) != NULL) { + n = STAILQ_NEXT(m, m_stailqpkt); + m_freem(m); + } +} + +static inline struct mbuf * +mbufq_first(const struct mbufq *mq) +{ + + return (STAILQ_FIRST(&mq->mq_head)); +} + +static inline struct mbuf * +mbufq_last(const struct mbufq *mq) +{ + + return (STAILQ_LAST(&mq->mq_head, mbuf, m_stailqpkt)); +} + +static inline int +mbufq_full(const struct mbufq *mq) +{ + + return (mq->mq_len >= mq->mq_maxlen); +} + +static inline int +mbufq_len(const struct mbufq *mq) +{ + + return (mq->mq_len); +} + +static inline int +mbufq_enqueue(struct mbufq *mq, struct mbuf *m) +{ + + if (mbufq_full(mq)) + return (ENOBUFS); + STAILQ_INSERT_TAIL(&mq->mq_head, m, m_stailqpkt); + mq->mq_len++; + return (0); +} + +static inline struct mbuf * +mbufq_dequeue(struct mbufq *mq) +{ + struct mbuf *m; + + m = STAILQ_FIRST(&mq->mq_head); + if (m) { + STAILQ_REMOVE_HEAD(&mq->mq_head, m_stailqpkt); + mq->mq_len--; + } + return (m); +} + +static inline void +mbufq_prepend(struct mbufq *mq, struct mbuf *m) +{ + + STAILQ_INSERT_HEAD(&mq->mq_head, m, m_stailqpkt); + mq->mq_len++; +} #endif /* !_SYS_MBUF_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 01:21:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F08E29B; Thu, 19 Feb 2015 01:21:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 7FE92CE; Thu, 19 Feb 2015 01:21:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1J1L3KZ026981; Thu, 19 Feb 2015 01:21:03 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1J1L2rf026978; Thu, 19 Feb 2015 01:21:02 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502190121.t1J1L2rf026978@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 19 Feb 2015 01:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278978 - 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 01:21:03 -0000 Author: glebius Date: Thu Feb 19 01:21:02 2015 New Revision: 278978 URL: https://svnweb.freebsd.org/changeset/base/278978 Log: Use new struct mbufq instead of struct ifqueue to manage packet queues in IPv4 multicast code. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/netinet/igmp.c head/sys/netinet/in_mcast.c head/sys/netinet/in_var.h Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Thu Feb 19 01:19:42 2015 (r278977) +++ head/sys/netinet/igmp.c Thu Feb 19 01:21:02 2015 (r278978) @@ -87,7 +87,7 @@ __FBSDID("$FreeBSD$"); static struct igmp_ifinfo * igi_alloc_locked(struct ifnet *); static void igi_delete_locked(const struct ifnet *); -static void igmp_dispatch_queue(struct ifqueue *, int, const int); +static void igmp_dispatch_queue(struct mbufq *, int, const int); static void igmp_fasttimo_vnet(void); static void igmp_final_leave(struct in_multi *, struct igmp_ifinfo *); static int igmp_handle_state_change(struct in_multi *, @@ -122,15 +122,15 @@ static void igmp_v3_cancel_link_timers(s static void igmp_v3_dispatch_general_query(struct igmp_ifinfo *); static struct mbuf * igmp_v3_encap_report(struct ifnet *, struct mbuf *); -static int igmp_v3_enqueue_group_record(struct ifqueue *, +static int igmp_v3_enqueue_group_record(struct mbufq *, struct in_multi *, const int, const int, const int); -static int igmp_v3_enqueue_filter_change(struct ifqueue *, +static int igmp_v3_enqueue_filter_change(struct mbufq *, struct in_multi *); static void igmp_v3_process_group_timers(struct igmp_ifinfo *, - struct ifqueue *, struct ifqueue *, struct in_multi *, + struct mbufq *, struct mbufq *, struct in_multi *, const int); static int igmp_v3_merge_state_changes(struct in_multi *, - struct ifqueue *); + struct mbufq *); static void igmp_v3_suppress_group_record(struct in_multi *); static int sysctl_igmp_default_version(SYSCTL_HANDLER_ARGS); static int sysctl_igmp_gsr(SYSCTL_HANDLER_ARGS); @@ -475,15 +475,12 @@ out_locked: * VIMAGE: Assumes the vnet pointer has been set. */ static void -igmp_dispatch_queue(struct ifqueue *ifq, int limit, const int loop) +igmp_dispatch_queue(struct mbufq *mq, int limit, const int loop) { struct mbuf *m; - for (;;) { - _IF_DEQUEUE(ifq, m); - if (m == NULL) - break; - CTR3(KTR_IGMPV3, "%s: dispatch %p from %p", __func__, ifq, m); + while ((m = mbufq_dequeue(mq)) != NULL) { + CTR3(KTR_IGMPV3, "%s: dispatch %p from %p", __func__, mq, m); if (loop) m->m_flags |= M_IGMP_LOOP; netisr_dispatch(NETISR_IGMP, m); @@ -579,13 +576,8 @@ igi_alloc_locked(/*const*/ struct ifnet igi->igi_qi = IGMP_QI_INIT; igi->igi_qri = IGMP_QRI_INIT; igi->igi_uri = IGMP_URI_INIT; - SLIST_INIT(&igi->igi_relinmhead); - - /* - * Responses to general queries are subject to bounds. - */ - IFQ_SET_MAXLEN(&igi->igi_gq, IGMP_MAX_RESPONSE_PACKETS); + mbufq_init(&igi->igi_gq, IGMP_MAX_RESPONSE_PACKETS); LIST_INSERT_HEAD(&V_igi_head, igi, igi_link); @@ -683,7 +675,7 @@ igi_delete_locked(const struct ifnet *if /* * Free deferred General Query responses. */ - _IF_DRAIN(&igi->igi_gq); + mbufq_drain(&igi->igi_gq); LIST_REMOVE(igi, igi_link); @@ -1643,8 +1635,8 @@ igmp_fasttimo(void) static void igmp_fasttimo_vnet(void) { - struct ifqueue scq; /* State-change packets */ - struct ifqueue qrq; /* Query response packets */ + struct mbufq scq; /* State-change packets */ + struct mbufq qrq; /* Query response packets */ struct ifnet *ifp; struct igmp_ifinfo *igi; struct ifmultiaddr *ifma; @@ -1705,12 +1697,8 @@ igmp_fasttimo_vnet(void) loop = (igi->igi_flags & IGIF_LOOPBACK) ? 1 : 0; uri_fasthz = IGMP_RANDOM_DELAY(igi->igi_uri * PR_FASTHZ); - - memset(&qrq, 0, sizeof(struct ifqueue)); - IFQ_SET_MAXLEN(&qrq, IGMP_MAX_G_GS_PACKETS); - - memset(&scq, 0, sizeof(struct ifqueue)); - IFQ_SET_MAXLEN(&scq, IGMP_MAX_STATE_CHANGE_PACKETS); + mbufq_init(&qrq, IGMP_MAX_G_GS_PACKETS); + mbufq_init(&scq, IGMP_MAX_STATE_CHANGE_PACKETS); } IF_ADDR_RLOCK(ifp); @@ -1809,7 +1797,7 @@ igmp_v1v2_process_group_timer(struct in_ */ static void igmp_v3_process_group_timers(struct igmp_ifinfo *igi, - struct ifqueue *qrq, struct ifqueue *scq, + struct mbufq *qrq, struct mbufq *scq, struct in_multi *inm, const int uri_fasthz) { int query_response_timer_expired; @@ -2071,7 +2059,7 @@ igmp_v3_cancel_link_timers(struct igmp_i */ inm->inm_sctimer = 0; inm->inm_timer = 0; - _IF_DRAIN(&inm->inm_scq); + mbufq_drain(&inm->inm_scq); } IF_ADDR_RUNLOCK(ifp); SLIST_FOREACH_SAFE(inm, &igi->igi_relinmhead, inm_nrele, tinm) { @@ -2344,7 +2332,7 @@ static int igmp_initial_join(struct in_multi *inm, struct igmp_ifinfo *igi) { struct ifnet *ifp; - struct ifqueue *ifq; + struct mbufq *mq; int error, retval, syncstates; CTR4(KTR_IGMPV3, "%s: initial join %s on ifp %p(%s)", @@ -2418,9 +2406,9 @@ igmp_initial_join(struct in_multi *inm, * Don't kick the timers if there is nothing to do, * or if an error occurred. */ - ifq = &inm->inm_scq; - _IF_DRAIN(ifq); - retval = igmp_v3_enqueue_group_record(ifq, inm, 1, + mq = &inm->inm_scq; + mbufq_drain(mq); + retval = igmp_v3_enqueue_group_record(mq, inm, 1, 0, 0); CTR2(KTR_IGMPV3, "%s: enqueue record = %d", __func__, retval); @@ -2500,7 +2488,7 @@ igmp_handle_state_change(struct in_multi return (0); } - _IF_DRAIN(&inm->inm_scq); + mbufq_drain(&inm->inm_scq); retval = igmp_v3_enqueue_group_record(&inm->inm_scq, inm, 1, 0, 0); CTR2(KTR_IGMPV3, "%s: enqueue record = %d", __func__, retval); @@ -2569,7 +2557,7 @@ igmp_final_leave(struct in_multi *inm, s * TO_IN {} to be sent on the next fast timeout, * giving us an opportunity to merge reports. */ - _IF_DRAIN(&inm->inm_scq); + mbufq_drain(&inm->inm_scq); inm->inm_timer = 0; if (igi->igi_flags & IGIF_LOOPBACK) { inm->inm_scrv = 1; @@ -2647,7 +2635,7 @@ igmp_final_leave(struct in_multi *inm, s * no record(s) were appended. */ static int -igmp_v3_enqueue_group_record(struct ifqueue *ifq, struct in_multi *inm, +igmp_v3_enqueue_group_record(struct mbufq *mq, struct in_multi *inm, const int is_state_change, const int is_group_query, const int is_source_query) { @@ -2737,7 +2725,7 @@ igmp_v3_enqueue_group_record(struct ifqu * Generate the filter list changes using a separate function. */ if (is_filter_list_change) - return (igmp_v3_enqueue_filter_change(ifq, inm)); + return (igmp_v3_enqueue_filter_change(mq, inm)); if (type == IGMP_DO_NOTHING) { CTR3(KTR_IGMPV3, "%s: nothing to do for %s/%s", @@ -2767,7 +2755,7 @@ igmp_v3_enqueue_group_record(struct ifqu * Note: Group records for G/GSR query responses MUST be sent * in their own packet. */ - m0 = ifq->ifq_tail; + m0 = mbufq_last(mq); if (!is_group_query && m0 != NULL && (m0->m_pkthdr.PH_vt.vt_nrecs + 1 <= IGMP_V3_REPORT_MAXRECS) && @@ -2778,7 +2766,7 @@ igmp_v3_enqueue_group_record(struct ifqu m = m0; CTR1(KTR_IGMPV3, "%s: use existing packet", __func__); } else { - if (_IF_QFULL(ifq)) { + if (mbufq_full(mq)) { CTR1(KTR_IGMPV3, "%s: outbound queue full", __func__); return (-ENOMEM); } @@ -2891,7 +2879,7 @@ igmp_v3_enqueue_group_record(struct ifqu if (m != m0) { CTR1(KTR_IGMPV3, "%s: enqueueing first packet", __func__); m->m_pkthdr.PH_vt.vt_nrecs = 1; - _IF_ENQUEUE(ifq, m); + mbufq_enqueue(mq, m); } else m->m_pkthdr.PH_vt.vt_nrecs++; @@ -2907,7 +2895,7 @@ igmp_v3_enqueue_group_record(struct ifqu * Always try for a cluster first. */ while (nims != NULL) { - if (_IF_QFULL(ifq)) { + if (mbufq_full(mq)) { CTR1(KTR_IGMPV3, "%s: outbound queue full", __func__); return (-ENOMEM); } @@ -2970,7 +2958,7 @@ igmp_v3_enqueue_group_record(struct ifqu nbytes += (msrcs * sizeof(in_addr_t)); CTR1(KTR_IGMPV3, "%s: enqueueing next packet", __func__); - _IF_ENQUEUE(ifq, m); + mbufq_enqueue(mq, m); } return (nbytes); @@ -3010,7 +2998,7 @@ typedef enum { * no record(s) were appended. */ static int -igmp_v3_enqueue_filter_change(struct ifqueue *ifq, struct in_multi *inm) +igmp_v3_enqueue_filter_change(struct mbufq *mq, struct in_multi *inm) { static const int MINRECLEN = sizeof(struct igmp_grouprec) + sizeof(in_addr_t); @@ -3054,7 +3042,7 @@ igmp_v3_enqueue_filter_change(struct ifq */ while (drt != REC_FULL) { do { - m0 = ifq->ifq_tail; + m0 = mbufq_last(mq); if (m0 != NULL && (m0->m_pkthdr.PH_vt.vt_nrecs + 1 <= IGMP_V3_REPORT_MAXRECS) && @@ -3201,7 +3189,7 @@ igmp_v3_enqueue_filter_change(struct ifq */ m->m_pkthdr.PH_vt.vt_nrecs++; if (m != m0) - _IF_ENQUEUE(ifq, m); + mbufq_enqueue(mq, m); nbytes += npbytes; } while (nims != NULL); drt |= crt; @@ -3215,9 +3203,9 @@ igmp_v3_enqueue_filter_change(struct ifq } static int -igmp_v3_merge_state_changes(struct in_multi *inm, struct ifqueue *ifscq) +igmp_v3_merge_state_changes(struct in_multi *inm, struct mbufq *scq) { - struct ifqueue *gq; + struct mbufq *gq; struct mbuf *m; /* pending state-change */ struct mbuf *m0; /* copy of pending state-change */ struct mbuf *mt; /* last state-change in packet */ @@ -3240,13 +3228,13 @@ igmp_v3_merge_state_changes(struct in_mu gq = &inm->inm_scq; #ifdef KTR - if (gq->ifq_head == NULL) { + if (mbufq_first(gq) == NULL) { CTR2(KTR_IGMPV3, "%s: WARNING: queue for inm %p is empty", __func__, inm); } #endif - m = gq->ifq_head; + m = mbufq_first(gq); while (m != NULL) { /* * Only merge the report into the current packet if @@ -3257,7 +3245,7 @@ igmp_v3_merge_state_changes(struct in_mu * allocated clusters. */ domerge = 0; - mt = ifscq->ifq_tail; + mt = mbufq_last(scq); if (mt != NULL) { recslen = m_length(m, NULL); @@ -3269,7 +3257,7 @@ igmp_v3_merge_state_changes(struct in_mu domerge = 1; } - if (!domerge && _IF_QFULL(gq)) { + if (!domerge && mbufq_full(gq)) { CTR2(KTR_IGMPV3, "%s: outbound queue full, skipping whole packet %p", __func__, m); @@ -3282,7 +3270,7 @@ igmp_v3_merge_state_changes(struct in_mu if (!docopy) { CTR2(KTR_IGMPV3, "%s: dequeueing %p", __func__, m); - _IF_DEQUEUE(gq, m0); + m0 = mbufq_dequeue(gq); m = m0->m_nextpkt; } else { CTR2(KTR_IGMPV3, "%s: copying %p", __func__, m); @@ -3294,13 +3282,13 @@ igmp_v3_merge_state_changes(struct in_mu } if (!domerge) { - CTR3(KTR_IGMPV3, "%s: queueing %p to ifscq %p)", - __func__, m0, ifscq); - _IF_ENQUEUE(ifscq, m0); + CTR3(KTR_IGMPV3, "%s: queueing %p to scq %p)", + __func__, m0, scq); + mbufq_enqueue(scq, m0); } else { struct mbuf *mtl; /* last mbuf of packet mt */ - CTR3(KTR_IGMPV3, "%s: merging %p with ifscq tail %p)", + CTR3(KTR_IGMPV3, "%s: merging %p with scq tail %p)", __func__, m0, mt); mtl = m_last(mt); @@ -3374,7 +3362,7 @@ igmp_v3_dispatch_general_query(struct ig /* * Slew transmission of bursts over 500ms intervals. */ - if (igi->igi_gq.ifq_head != NULL) { + if (mbufq_first(&igi->igi_gq) != NULL) { igi->igi_v3_timer = 1 + IGMP_RANDOM_DELAY( IGMP_RESPONSE_BURST_INTERVAL); V_interface_timers_running = 1; Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Thu Feb 19 01:19:42 2015 (r278977) +++ head/sys/netinet/in_mcast.c Thu Feb 19 01:21:02 2015 (r278978) @@ -523,12 +523,7 @@ in_getmulti(struct ifnet *ifp, const str inm->inm_ifma = ifma; inm->inm_refcount = 1; inm->inm_state = IGMP_NOT_MEMBER; - - /* - * Pending state-changes per group are subject to a bounds check. - */ - IFQ_SET_MAXLEN(&inm->inm_scq, IGMP_MAX_STATE_CHANGES); - + mbufq_init(&inm->inm_scq, IGMP_MAX_STATE_CHANGES); inm->inm_st[0].iss_fmode = MCAST_UNDEFINED; inm->inm_st[1].iss_fmode = MCAST_UNDEFINED; RB_INIT(&inm->inm_srcs); Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Thu Feb 19 01:19:42 2015 (r278977) +++ head/sys/netinet/in_var.h Thu Feb 19 01:21:02 2015 (r278978) @@ -210,7 +210,7 @@ struct igmp_ifinfo { uint32_t igi_qri; /* IGMPv3 Query Response Interval (s) */ uint32_t igi_uri; /* IGMPv3 Unsolicited Report Interval (s) */ SLIST_HEAD(,in_multi) igi_relinmhead; /* released groups */ - struct ifqueue igi_gq; /* queue of general query responses */ + struct mbufq igi_gq; /* queue of general query responses */ }; #define IGIF_SILENT 0x00000001 /* Do not use IGMP on this ifp */ @@ -299,7 +299,7 @@ struct in_multi { struct ip_msource_tree inm_srcs; /* tree of sources */ u_long inm_nsrc; /* # of tree entries */ - struct ifqueue inm_scq; /* queue of pending + struct mbufq inm_scq; /* queue of pending * state-change packets */ struct timeval inm_lastgsrtv; /* Time of last G-S-R query */ uint16_t inm_sctimer; /* state-change timer */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 01:21:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CA773DD; Thu, 19 Feb 2015 01:21:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3D7DA169; Thu, 19 Feb 2015 01:21:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1J1LP0Y028944; Thu, 19 Feb 2015 01:21:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1J1LOwU028918; Thu, 19 Feb 2015 01:21:24 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502190121.t1J1LOwU028918@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 19 Feb 2015 01:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278979 - 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 01:21:25 -0000 Author: glebius Date: Thu Feb 19 01:21:23 2015 New Revision: 278979 URL: https://svnweb.freebsd.org/changeset/base/278979 Log: Use new struct mbufq instead of struct ifqueue to manage packet queues in IPv6 multicast code. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_var.h head/sys/netinet6/mld6.c head/sys/netinet6/mld6_var.h Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Thu Feb 19 01:21:02 2015 (r278978) +++ head/sys/netinet6/in6_mcast.c Thu Feb 19 01:21:23 2015 (r278979) @@ -479,7 +479,7 @@ in6_mc_get(struct ifnet *ifp, const stru inm->in6m_ifma = ifma; inm->in6m_refcount = 1; inm->in6m_state = MLD_NOT_MEMBER; - IFQ_SET_MAXLEN(&inm->in6m_scq, MLD_MAX_STATE_CHANGES); + mbufq_init(&inm->in6m_scq, MLD_MAX_STATE_CHANGES); inm->in6m_st[0].iss_fmode = MCAST_UNDEFINED; inm->in6m_st[1].iss_fmode = MCAST_UNDEFINED; @@ -1074,7 +1074,7 @@ in6m_purge(struct in6_multi *inm) inm->in6m_nsrc--; } /* Free state-change requests that might be queued. */ - _IF_DRAIN(&inm->in6m_scq); + mbufq_drain(&inm->in6m_scq); } /* @@ -2804,7 +2804,7 @@ in6m_print(const struct in6_multi *inm) inm->in6m_timer, in6m_state_str(inm->in6m_state), inm->in6m_refcount, - inm->in6m_scq.ifq_len); + mbufq_len(&inm->in6m_scq)); printf("mli %p nsrc %lu sctimer %u scrv %u\n", inm->in6m_mli, inm->in6m_nsrc, Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Thu Feb 19 01:21:02 2015 (r278978) +++ head/sys/netinet6/in6_var.h Thu Feb 19 01:21:23 2015 (r278979) @@ -652,7 +652,7 @@ struct in6_multi { struct ip6_msource_tree in6m_srcs; /* tree of sources */ u_long in6m_nsrc; /* # of tree entries */ - struct ifqueue in6m_scq; /* queue of pending + struct mbufq in6m_scq; /* queue of pending * state-change packets */ struct timeval in6m_lastgsrtv; /* last G-S-R query */ uint16_t in6m_sctimer; /* state-change timer */ Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Thu Feb 19 01:21:02 2015 (r278978) +++ head/sys/netinet6/mld6.c Thu Feb 19 01:21:23 2015 (r278979) @@ -106,7 +106,7 @@ static struct mld_ifinfo * mli_alloc_locked(struct ifnet *); static void mli_delete_locked(const struct ifnet *); static void mld_dispatch_packet(struct mbuf *); -static void mld_dispatch_queue(struct ifqueue *, int); +static void mld_dispatch_queue(struct mbufq *, int); static void mld_final_leave(struct in6_multi *, struct mld_ifinfo *); static void mld_fasttimo_vnet(void); static int mld_handle_state_change(struct in6_multi *, @@ -131,17 +131,17 @@ static void mld_v2_cancel_link_timers(st static void mld_v2_dispatch_general_query(struct mld_ifinfo *); static struct mbuf * mld_v2_encap_report(struct ifnet *, struct mbuf *); -static int mld_v2_enqueue_filter_change(struct ifqueue *, +static int mld_v2_enqueue_filter_change(struct mbufq *, struct in6_multi *); -static int mld_v2_enqueue_group_record(struct ifqueue *, +static int mld_v2_enqueue_group_record(struct mbufq *, struct in6_multi *, const int, const int, const int, const int); static int mld_v2_input_query(struct ifnet *, const struct ip6_hdr *, struct mbuf *, const int, const int); static int mld_v2_merge_state_changes(struct in6_multi *, - struct ifqueue *); + struct mbufq *); static void mld_v2_process_group_timers(struct mld_ifinfo *, - struct ifqueue *, struct ifqueue *, + struct mbufq *, struct mbufq *, struct in6_multi *, const int); static int mld_v2_process_group_query(struct in6_multi *, struct mld_ifinfo *mli, int, struct mbuf *, const int); @@ -406,15 +406,12 @@ out_locked: * VIMAGE: Assumes the vnet pointer has been set. */ static void -mld_dispatch_queue(struct ifqueue *ifq, int limit) +mld_dispatch_queue(struct mbufq *mq, int limit) { struct mbuf *m; - for (;;) { - _IF_DEQUEUE(ifq, m); - if (m == NULL) - break; - CTR3(KTR_MLD, "%s: dispatch %p from %p", __func__, ifq, m); + while ((m = mbufq_dequeue(mq)) != NULL) { + CTR3(KTR_MLD, "%s: dispatch %p from %p", __func__, mq, m); mld_dispatch_packet(m); if (--limit == 0) break; @@ -499,13 +496,8 @@ mli_alloc_locked(/*const*/ struct ifnet mli->mli_qi = MLD_QI_INIT; mli->mli_qri = MLD_QRI_INIT; mli->mli_uri = MLD_URI_INIT; - SLIST_INIT(&mli->mli_relinmhead); - - /* - * Responses to general queries are subject to bounds. - */ - IFQ_SET_MAXLEN(&mli->mli_gq, MLD_MAX_RESPONSE_PACKETS); + mbufq_init(&mli->mli_gq, MLD_MAX_RESPONSE_PACKETS); LIST_INSERT_HEAD(&V_mli_head, mli, mli_link); @@ -598,7 +590,7 @@ mli_delete_locked(const struct ifnet *if /* * Free deferred General Query responses. */ - _IF_DRAIN(&mli->mli_gq); + mbufq_drain(&mli->mli_gq); LIST_REMOVE(mli, mli_link); @@ -1326,8 +1318,8 @@ mld_fasttimo(void) static void mld_fasttimo_vnet(void) { - struct ifqueue scq; /* State-change packets */ - struct ifqueue qrq; /* Query response packets */ + struct mbufq scq; /* State-change packets */ + struct mbufq qrq; /* Query response packets */ struct ifnet *ifp; struct mld_ifinfo *mli; struct ifmultiaddr *ifma; @@ -1386,12 +1378,8 @@ mld_fasttimo_vnet(void) if (mli->mli_version == MLD_VERSION_2) { uri_fasthz = MLD_RANDOM_DELAY(mli->mli_uri * PR_FASTHZ); - - memset(&qrq, 0, sizeof(struct ifqueue)); - IFQ_SET_MAXLEN(&qrq, MLD_MAX_G_GS_PACKETS); - - memset(&scq, 0, sizeof(struct ifqueue)); - IFQ_SET_MAXLEN(&scq, MLD_MAX_STATE_CHANGE_PACKETS); + mbufq_init(&qrq, MLD_MAX_G_GS_PACKETS); + mbufq_init(&scq, MLD_MAX_STATE_CHANGE_PACKETS); } IF_ADDR_RLOCK(ifp); @@ -1503,7 +1491,7 @@ mld_v1_process_group_timer(struct mld_if */ static void mld_v2_process_group_timers(struct mld_ifinfo *mli, - struct ifqueue *qrq, struct ifqueue *scq, + struct mbufq *qrq, struct mbufq *scq, struct in6_multi *inm, const int uri_fasthz) { int query_response_timer_expired; @@ -1711,7 +1699,7 @@ mld_v2_cancel_link_timers(struct mld_ifi /* * Free any pending MLDv2 state-change records. */ - _IF_DRAIN(&inm->in6m_scq); + mbufq_drain(&inm->in6m_scq); break; } } @@ -1950,7 +1938,7 @@ mld_initial_join(struct in6_multi *inm, const int delay) { struct ifnet *ifp; - struct ifqueue *ifq; + struct mbufq *mq; int error, retval, syncstates; int odelay; #ifdef KTR @@ -2037,9 +2025,9 @@ mld_initial_join(struct in6_multi *inm, * Don't kick the timers if there is nothing to do, * or if an error occurred. */ - ifq = &inm->in6m_scq; - _IF_DRAIN(ifq); - retval = mld_v2_enqueue_group_record(ifq, inm, 1, + mq = &inm->in6m_scq; + mbufq_drain(mq); + retval = mld_v2_enqueue_group_record(mq, inm, 1, 0, 0, (mli->mli_flags & MLIF_USEALLOW)); CTR2(KTR_MLD, "%s: enqueue record = %d", __func__, retval); @@ -2131,7 +2119,7 @@ mld_handle_state_change(struct in6_multi return (0); } - _IF_DRAIN(&inm->in6m_scq); + mbufq_drain(&inm->in6m_scq); retval = mld_v2_enqueue_group_record(&inm->in6m_scq, inm, 1, 0, 0, (mli->mli_flags & MLIF_USEALLOW)); @@ -2204,7 +2192,7 @@ mld_final_leave(struct in6_multi *inm, s * TO_IN {} to be sent on the next fast timeout, * giving us an opportunity to merge reports. */ - _IF_DRAIN(&inm->in6m_scq); + mbufq_drain(&inm->in6m_scq); inm->in6m_timer = 0; inm->in6m_scrv = mli->mli_rv; CTR4(KTR_MLD, "%s: Leaving %s/%s with %d " @@ -2280,7 +2268,7 @@ mld_final_leave(struct in6_multi *inm, s * no record(s) were appended. */ static int -mld_v2_enqueue_group_record(struct ifqueue *ifq, struct in6_multi *inm, +mld_v2_enqueue_group_record(struct mbufq *mq, struct in6_multi *inm, const int is_state_change, const int is_group_query, const int is_source_query, const int use_block_allow) { @@ -2395,7 +2383,7 @@ mld_v2_enqueue_group_record(struct ifque * Generate the filter list changes using a separate function. */ if (is_filter_list_change) - return (mld_v2_enqueue_filter_change(ifq, inm)); + return (mld_v2_enqueue_filter_change(mq, inm)); if (type == MLD_DO_NOTHING) { CTR3(KTR_MLD, "%s: nothing to do for %s/%s", @@ -2426,7 +2414,7 @@ mld_v2_enqueue_group_record(struct ifque * Note: Group records for G/GSR query responses MUST be sent * in their own packet. */ - m0 = ifq->ifq_tail; + m0 = mbufq_last(mq); if (!is_group_query && m0 != NULL && (m0->m_pkthdr.PH_vt.vt_nrecs + 1 <= MLD_V2_REPORT_MAXRECS) && @@ -2438,7 +2426,7 @@ mld_v2_enqueue_group_record(struct ifque m = m0; CTR1(KTR_MLD, "%s: use existing packet", __func__); } else { - if (_IF_QFULL(ifq)) { + if (mbufq_full(mq)) { CTR1(KTR_MLD, "%s: outbound queue full", __func__); return (-ENOMEM); } @@ -2551,7 +2539,7 @@ mld_v2_enqueue_group_record(struct ifque if (m != m0) { CTR1(KTR_MLD, "%s: enqueueing first packet", __func__); m->m_pkthdr.PH_vt.vt_nrecs = 1; - _IF_ENQUEUE(ifq, m); + mbufq_enqueue(mq, m); } else m->m_pkthdr.PH_vt.vt_nrecs++; @@ -2567,7 +2555,7 @@ mld_v2_enqueue_group_record(struct ifque * Always try for a cluster first. */ while (nims != NULL) { - if (_IF_QFULL(ifq)) { + if (mbufq_full(mq)) { CTR1(KTR_MLD, "%s: outbound queue full", __func__); return (-ENOMEM); } @@ -2626,7 +2614,7 @@ mld_v2_enqueue_group_record(struct ifque nbytes += (msrcs * sizeof(struct in6_addr)); CTR1(KTR_MLD, "%s: enqueueing next packet", __func__); - _IF_ENQUEUE(ifq, m); + mbufq_enqueue(mq, m); } return (nbytes); @@ -2666,7 +2654,7 @@ typedef enum { * no record(s) were appended. */ static int -mld_v2_enqueue_filter_change(struct ifqueue *ifq, struct in6_multi *inm) +mld_v2_enqueue_filter_change(struct mbufq *mq, struct in6_multi *inm) { static const int MINRECLEN = sizeof(struct mldv2_record) + sizeof(struct in6_addr); @@ -2712,7 +2700,7 @@ mld_v2_enqueue_filter_change(struct ifqu */ while (drt != REC_FULL) { do { - m0 = ifq->ifq_tail; + m0 = mbufq_last(mq); if (m0 != NULL && (m0->m_pkthdr.PH_vt.vt_nrecs + 1 <= MLD_V2_REPORT_MAXRECS) && @@ -2856,7 +2844,7 @@ mld_v2_enqueue_filter_change(struct ifqu */ m->m_pkthdr.PH_vt.vt_nrecs++; if (m != m0) - _IF_ENQUEUE(ifq, m); + mbufq_enqueue(mq, m); nbytes += npbytes; } while (nims != NULL); drt |= crt; @@ -2870,9 +2858,9 @@ mld_v2_enqueue_filter_change(struct ifqu } static int -mld_v2_merge_state_changes(struct in6_multi *inm, struct ifqueue *ifscq) +mld_v2_merge_state_changes(struct in6_multi *inm, struct mbufq *scq) { - struct ifqueue *gq; + struct mbufq *gq; struct mbuf *m; /* pending state-change */ struct mbuf *m0; /* copy of pending state-change */ struct mbuf *mt; /* last state-change in packet */ @@ -2895,13 +2883,13 @@ mld_v2_merge_state_changes(struct in6_mu gq = &inm->in6m_scq; #ifdef KTR - if (gq->ifq_head == NULL) { + if (mbufq_first(gq) == NULL) { CTR2(KTR_MLD, "%s: WARNING: queue for inm %p is empty", __func__, inm); } #endif - m = gq->ifq_head; + m = mbufq_first(gq); while (m != NULL) { /* * Only merge the report into the current packet if @@ -2912,7 +2900,7 @@ mld_v2_merge_state_changes(struct in6_mu * allocated clusters. */ domerge = 0; - mt = ifscq->ifq_tail; + mt = mbufq_last(scq); if (mt != NULL) { recslen = m_length(m, NULL); @@ -2924,7 +2912,7 @@ mld_v2_merge_state_changes(struct in6_mu domerge = 1; } - if (!domerge && _IF_QFULL(gq)) { + if (!domerge && mbufq_full(gq)) { CTR2(KTR_MLD, "%s: outbound queue full, skipping whole packet %p", __func__, m); @@ -2937,7 +2925,7 @@ mld_v2_merge_state_changes(struct in6_mu if (!docopy) { CTR2(KTR_MLD, "%s: dequeueing %p", __func__, m); - _IF_DEQUEUE(gq, m0); + m0 = mbufq_dequeue(gq); m = m0->m_nextpkt; } else { CTR2(KTR_MLD, "%s: copying %p", __func__, m); @@ -2949,9 +2937,9 @@ mld_v2_merge_state_changes(struct in6_mu } if (!domerge) { - CTR3(KTR_MLD, "%s: queueing %p to ifscq %p)", - __func__, m0, ifscq); - _IF_ENQUEUE(ifscq, m0); + CTR3(KTR_MLD, "%s: queueing %p to scq %p)", + __func__, m0, scq); + mbufq_enqueue(scq, m0); } else { struct mbuf *mtl; /* last mbuf of packet mt */ @@ -3028,7 +3016,7 @@ mld_v2_dispatch_general_query(struct mld /* * Slew transmission of bursts over 500ms intervals. */ - if (mli->mli_gq.ifq_head != NULL) { + if (mbufq_first(&mli->mli_gq) != NULL) { mli->mli_v2_timer = 1 + MLD_RANDOM_DELAY( MLD_RESPONSE_BURST_INTERVAL); V_interface_timers_running6 = 1; Modified: head/sys/netinet6/mld6_var.h ============================================================================== --- head/sys/netinet6/mld6_var.h Thu Feb 19 01:21:02 2015 (r278978) +++ head/sys/netinet6/mld6_var.h Thu Feb 19 01:21:23 2015 (r278979) @@ -52,7 +52,7 @@ struct mld_ifinfo { uint32_t mli_qri; /* MLDv2 Query Response Interval (s) */ uint32_t mli_uri; /* MLDv2 Unsolicited Report Interval (s) */ SLIST_HEAD(,in6_multi) mli_relinmhead; /* released groups */ - struct ifqueue mli_gq; /* queue of general query responses */ + struct mbufq mli_gq; /* queue of general query responses */ }; #define MLIF_SILENT 0x00000001 /* Do not use MLD on this ifp */ #define MLIF_USEALLOW 0x00000002 /* Use ALLOW/BLOCK for joins/leaves */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 01:24:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF99D55B for ; Thu, 19 Feb 2015 01:24:07 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (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 7514718C for ; Thu, 19 Feb 2015 01:24:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t1J1O7lJ030442 for ; Thu, 19 Feb 2015 01:24:07 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t1J1O7CM030437 for svn-src-head@freebsd.org; Thu, 19 Feb 2015 01:24:07 GMT (envelope-from bdrewery) Received: (qmail 62349 invoked from network); 18 Feb 2015 19:24:02 -0600 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 18 Feb 2015 19:24:02 -0600 Message-ID: <54E53B34.5070605@FreeBSD.org> Date: Wed, 18 Feb 2015 19:24:04 -0600 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r278889 - head/lib/libc/include References: <201502170854.t1H8s4TL085174@svn.freebsd.org> <54E52019.8080009@FreeBSD.org> <20150219113226.K2984@besplex.bde.org> In-Reply-To: <20150219113226.K2984@besplex.bde.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="coaBkDreXFxRaNXll2iG82XBNptxFfnbj" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 19 Feb 2015 01:24:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --coaBkDreXFxRaNXll2iG82XBNptxFfnbj Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2/18/2015 6:58 PM, Bruce Evans wrote: > On Wed, 18 Feb 2015, Bryan Drewery wrote: >=20 >> On 2/17/2015 2:54 AM, Konstantin Belousov wrote: >>> ... >>> Log: >>> Restore the extern qualifier on __cleanup. >>> ... >>> Modified: head/lib/libc/include/libc_private.h >>> =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/lib/libc/include/libc_private.h Tue Feb 17 08:50:26 >>> 2015 (r278888) >>> +++ head/lib/libc/include/libc_private.h Tue Feb 17 08:54:03 >>> 2015 (r278889) >>> @@ -271,7 +271,7 @@ void _malloc_first_thread(void); >>> /* >>> * Function to clean up streams, called from abort() and exit(). >>> */ >>> -void (*__cleanup)(void) __hidden; >>> +extern void (*__cleanup)(void) __hidden; >>> >>> /* >>> * Get kern.osreldate to detect ABI revisions. Explicitly >>> >> >> Is this a NOP? >=20 > No, since this is a data declaration. It would be a style bug on a > prototype. Ah, of course. I missed the *, despite the (). --=20 Regards, Bryan Drewery --coaBkDreXFxRaNXll2iG82XBNptxFfnbj 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 iQEcBAEBAgAGBQJU5Ts0AAoJEDXXcbtuRpfP3w8H/0+okgPyrG4pqke1nZjr91nj bbWN9YrIAYMyrbRFsV4CtkOuf10bbymFo/BnH+obaWYyUrrozaH77LH1ojuMHUl2 bx5omR8S7wwp18YqxZBDHuMCQRsZb6G3qEFJtSWaNsmHMsEtowleqyQpyWZ3yeFG GkR+K1y24mFrvN6N/Y+QyE5WaAz35aIZ1wkdlad9MXfMHif087O5p90YOcBc7/lc DHGfEAJ1AgwmPx23JuL1wUtwVNP1wvP+ACmDLjEAWUNlzqfKAEFpUJi2G8jzUujn mLrrfx8zJJbufdfSbP+Ve8xjmLqnzRJAL2frzMfuj3Sf9fZeS3ekCtLLbbA5Vn8= =129k -----END PGP SIGNATURE----- --coaBkDreXFxRaNXll2iG82XBNptxFfnbj-- From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 01:51:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7522DEB3; Thu, 19 Feb 2015 01:51:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6055863D; Thu, 19 Feb 2015 01:51:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1J1pI2w040856; Thu, 19 Feb 2015 01:51:18 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1J1pIsD040854; Thu, 19 Feb 2015 01:51:18 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201502190151.t1J1pIsD040854@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Thu, 19 Feb 2015 01:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278981 - head/lib/libc/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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 01:51:18 -0000 Author: jmg Date: Thu Feb 19 01:51:17 2015 New Revision: 278981 URL: https://svnweb.freebsd.org/changeset/base/278981 Log: fix spelling, add comma and remove BUGS section.. it provided no useful information, and is not really bugs, but limitations for other reasons... Modified: head/lib/libc/sys/mmap.2 Modified: head/lib/libc/sys/mmap.2 ============================================================================== --- head/lib/libc/sys/mmap.2 Thu Feb 19 01:29:24 2015 (r278980) +++ head/lib/libc/sys/mmap.2 Thu Feb 19 01:51:17 2015 (r278981) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd September 17, 2014 +.Dd February 18, 2015 .Dt MMAP 2 .Os .Sh NAME @@ -160,7 +160,7 @@ is specified, must be a multiple of the pagesize. If .Dv MAP_EXCL -is not specified, a successfull +is not specified, a successful .Dv MAP_FIXED request replaces any previous mappings for the process' pages in the range from @@ -225,7 +225,7 @@ it. You can test file fragmentation by observing the KB/t (kilobytes per transfer) results from an .Dq Li iostat 1 -while reading a large file sequentially, e.g.\& using +while reading a large file sequentially, e.g.,\& using .Dq Li dd if=filename of=/dev/null bs=32k . .Pp The @@ -448,17 +448,3 @@ was specified and insufficient memory wa .Xr munmap 2 , .Xr getpagesize 3 , .Xr getpagesizes 3 -.Sh BUGS -The -.Fa len -argument -is limited to the maximum file size or available userland address -space. -Files may not be able to be made more than 1TB large on 32 bit systems -due to file systems restrictions and bugs, but address space is far more -restrictive. -Larger files may be possible on 64 bit systems. -.Pp -The previous documented limit of 2GB was a documentation bug. -That limit has not existed since -.Fx 2.2 . From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 02:49:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79EB2567 for ; Thu, 19 Feb 2015 02:49:29 +0000 (UTC) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 41CC0AB9 for ; Thu, 19 Feb 2015 02:49:28 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id A08B2208CF for ; Wed, 18 Feb 2015 21:49:27 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Wed, 18 Feb 2015 21:49:27 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= x-sasl-enc:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; s=mesmtp; bh=Ryz3jfq4HWD ZE29g6HbzMPyM22Y=; b=QSkEt7twBs3xKOOs9lYwAOtpSksqz0xU7OBZmigaTPz X4gnze9tF2e0oRtnCKwuUxZHH9wUtNxtz3w9sxqWci2tjA3STTcDaJ0gNODV6TdG j87TH2Af+gN/z1smUVLAbvUpIYm5brHEZPZCkRDodBxl2/BOWuXCY4wxrrmFcbnI = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:date:from:to:cc:subject :message-id:references:mime-version:content-type:in-reply-to; s= smtpout; bh=Ryz3jfq4HWDZE29g6HbzMPyM22Y=; b=RphUrjvSa9jRn1Kxb2ab 8ZBK0BFhUSd2eA0qE+rL1KYP/Bhcuc0+VBW4uhcdasbDJGN7m/IAY+95UxE0RLIB oReIh+R7i/uez4z3LSY/PKu8xyMbdUa9zTubrzuxyEHCWqxS8IlAS8gX4r1mJw/Z WqOwdz44dFtcjZlUbIhkyPk= X-Sasl-enc: Nv+hry2vZPddF4PlY5PoqHwQ0aFtlRkYOshzDdyfPkYO 1424314166 Received: from kropotkin.auxio (unknown [223.252.30.161]) by mail.messagingengine.com (Postfix) with ESMTPA id B3F86C00295; Wed, 18 Feb 2015 21:49:25 -0500 (EST) Date: Thu, 19 Feb 2015 10:49:22 +0800 From: Alastair Hogge To: Gleb Smirnoff Subject: Re: svn commit: r278979 - head/sys/netinet6 Message-ID: <20150219024922.GA2330@kropotkin.auxio> References: <201502190121.t1J1LOwU028918@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201502190121.t1J1LOwU028918@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 19 Feb 2015 02:49:29 -0000 On 2015-02-19 Thu 01:21:24 +0000, Gleb Smirnoff wrote: Hi Gleb, I think this commit the whole economy^W buildworld? > Author: glebius > Date: Thu Feb 19 01:21:23 2015 > New Revision: 278979 > URL: https://svnweb.freebsd.org/changeset/base/278979 > > Log: > Use new struct mbufq instead of struct ifqueue to manage packet queues in > IPv6 multicast code. > > Sponsored by: Netflix > Sponsored by: Nginx, Inc. > > Modified: > head/sys/netinet6/in6_mcast.c > head/sys/netinet6/in6_var.h cc -fpic -DPIC -O2 -pipe -march=corei7-avx -I/usr/src/lib/libc/include -I/usr/src/lib/libc/../../include -I/usr/src/lib/libc/amd64 -DNLS -D__DBINTERFACE_PRIVATE -I/usr/src/lib/libc/../../contrib/gdtoa -I/usr/src/lib/libc/../../contrib/libc-vis -DINET6 -I/tmp/corei7-avx/usr/src/lib/libc -I/usr/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/src/lib/libc/../libmd -I/usr/src/lib/libc/../../contrib/jemalloc/include -DMALLOC_PRODUCTION -I/usr/src/lib/libc/../../contrib/tzcode/stdtime -I/usr/src/lib/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DNS_CACHING -DSYMBOL_VERSIONING -DSYSCALL_COMPAT -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Qunused-arguments -c /usr/src/lib/libc/net/getaddrinfo.c -o getaddrinfo.So In file included from /usr/src/lib/libc/net/getaddrinfo.c:70: /tmp/corei7-avx/usr/src/tmp/usr/include/netinet6/in6_var.h:655:17: error: field has incomplete type 'struct mbufq' struct mbufq in6m_scq; /* queue of pending ^ /tmp/corei7-avx/usr/src/tmp/usr/include/netinet6/in6_var.h:655:9: note: forward declaration of 'struct mbufq' struct mbufq in6m_scq; /* queue of pending ^ 1 error generated. *** [getaddrinfo.So] Error code 1 make[4]: stopped in /usr/src/lib/libc 1 error make[4]: stopped in /usr/src/lib/libc A failure has been detected in another branch of the parallel make make[3]: stopped in /usr/src *** [libraries] Error code 2 make[2]: stopped in /usr/src 1 error make[2]: stopped in /usr/src *** [_libraries] Error code 2 make[1]: stopped in /usr/src 1 error make[1]: stopped in /usr/src *** [buildworld] Error code 2 make: stopped in /usr/src 1 error make: stopped in /usr/src 2|agh@kropotkin:/usr/src $ $ uname -a FreeBSD kropotkin.auxio 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r278930: Wed Feb 18 11:14:06 AWST 2015 agh@kropotkin:/tmp/corei7-avx/usr/src/sys/KROPOTKIN amd64 $ cat /etc/make ALWAYS_CHECK_MAKE=YES CPUTYPE?=corei7-avx DEFAULT_VERSIONS= perl5=5.20 KERNCONF= KROPOTKIN KROPOTKIN_DEBUG MALLOC_PRODUCTION= PERL5_DEFAULT= 5.20 WITH_BDB_VER= 5 #WITH_DEBUG= WITH_OPENSSL_PORT= WITH_PKG= devel $ cat /etc/src.make WITH_BSD_GREP= WITH_CLANG_EXTRAS= WITH_LLDB= WITH_PIE= #WITH_SORT_THREADS= WITHOUT_APM= WITHOUT_ATM= WITHOUT_BLUETOOTH= WITHOUT_CDDL= WITHOUT_CTM= WITHOUT_CUSE= WITHOUT_FLOPPY= WITHOUT_FMTREE= WITHOUT_GCOV= WITHOUT_GDB= WITHOUT_HYPERV= WITHOUT_INFO= WITHOUT_IPFILTER= #WITHOUT_LIB32= WITHOUT_LPR= WITHOUT_NDIS= WITHOUT_NTP= WITHOUT_PC_SYSINSTALL= WITHOUT_PORTSNAP= WITHOUT_PPP= WITHOUT_PROFILE= WITHOUT_RCMDS= WITHOUT_RCS= WITHOUT_SENDMAIL= WITHOUT_SVNLITE= WITHOUT_SYSCONS= WITHOUT_SYSINSTALL= WITHOUT_TEXINFO= WITHOUT_WIRELESS= WITHOUT_WPA_SUPPLICANT_EAPOL= From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 03:29:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0883E8F; Thu, 19 Feb 2015 03:29:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8C264FAC; Thu, 19 Feb 2015 03:29:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1J3Tlo0087570; Thu, 19 Feb 2015 03:29:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1J3TlnJ087569; Thu, 19 Feb 2015 03:29:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201502190329.t1J3TlnJ087569@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 19 Feb 2015 03:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278983 - 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 03:29:47 -0000 Author: markj Date: Thu Feb 19 03:29:46 2015 New Revision: 278983 URL: https://svnweb.freebsd.org/changeset/base/278983 Log: Free the zlib stream after expanding a compressed CTF section. Note that this memory would only be leaked once, since CTF info for a kld file is cached after the first access. MFC after: 3 days Modified: head/sys/kern/kern_ctf.c Modified: head/sys/kern/kern_ctf.c ============================================================================== --- head/sys/kern/kern_ctf.c Thu Feb 19 02:56:34 2015 (r278982) +++ head/sys/kern/kern_ctf.c Thu Feb 19 03:29:46 2015 (r278983) @@ -293,7 +293,9 @@ link_elf_ctf_get(linker_file_t lf, linke zs.next_in = ((uint8_t *) raw) + sizeof(ctf_hdr); zs.avail_out = sz - sizeof(ctf_hdr); zs.next_out = ((uint8_t *) ctftab) + sizeof(ctf_hdr); - if ((ret = inflate(&zs, Z_FINISH)) != Z_STREAM_END) { + ret = inflate(&zs, Z_FINISH); + inflateEnd(&zs); + if (ret != Z_STREAM_END) { printf("%s(%d): zlib inflate returned %d\n", __func__, __LINE__, ret); error = EIO; goto out; From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 03:32:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19E95FF1; Thu, 19 Feb 2015 03:32:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DFE10D3; Thu, 19 Feb 2015 03:32:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1J3WmED091458; Thu, 19 Feb 2015 03:32:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1J3WmYV091457; Thu, 19 Feb 2015 03:32:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201502190332.t1J3WmYV091457@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 19 Feb 2015 03:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278984 - 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 03:32:49 -0000 Author: markj Date: Thu Feb 19 03:32:48 2015 New Revision: 278984 URL: https://svnweb.freebsd.org/changeset/base/278984 Log: Remove unnecessary checks for a return value of NULL from M_WAITOK allocations. MFC after: 3 days Modified: head/sys/kern/kern_ctf.c Modified: head/sys/kern/kern_ctf.c ============================================================================== --- head/sys/kern/kern_ctf.c Thu Feb 19 03:29:46 2015 (r278983) +++ head/sys/kern/kern_ctf.c Thu Feb 19 03:32:48 2015 (r278984) @@ -121,10 +121,7 @@ link_elf_ctf_get(linker_file_t lf, linke NDFREE(&nd, NDF_ONLY_PNBUF); /* Allocate memory for the FLF header. */ - if ((hdr = malloc(sizeof(*hdr), M_LINKER, M_WAITOK)) == NULL) { - error = ENOMEM; - goto out; - } + hdr = malloc(sizeof(*hdr), M_LINKER, M_WAITOK); /* Read the ELF header. */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, hdr, sizeof(*hdr), @@ -146,10 +143,7 @@ link_elf_ctf_get(linker_file_t lf, linke } /* Allocate memory for all the section headers */ - if ((shdr = malloc(nbytes, M_LINKER, M_WAITOK)) == NULL) { - error = ENOMEM; - goto out; - } + shdr = malloc(nbytes, M_LINKER, M_WAITOK); /* Read all the section headers */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t)shdr, nbytes, @@ -171,11 +165,7 @@ link_elf_ctf_get(linker_file_t lf, linke } /* Allocate memory to buffer the section header strings. */ - if ((shstrtab = malloc(shdr[hdr->e_shstrndx].sh_size, M_LINKER, - M_WAITOK)) == NULL) { - error = ENOMEM; - goto out; - } + shstrtab = malloc(shdr[hdr->e_shstrndx].sh_size, M_LINKER, M_WAITOK); /* Read the section header strings. */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, shstrtab, @@ -238,10 +228,7 @@ link_elf_ctf_get(linker_file_t lf, linke * Allocate memory for the compressed CTF data, including * the header (which isn't compressed). */ - if ((raw = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK)) == NULL) { - error = ENOMEM; - goto out; - } + raw = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK); } else { /* * The CTF data is not compressed, so the ELF section @@ -254,10 +241,7 @@ link_elf_ctf_get(linker_file_t lf, linke * Allocate memory to buffer the CTF data in it's decompressed * form. */ - if ((ctftab = malloc(sz, M_LINKER, M_WAITOK)) == NULL) { - error = ENOMEM; - goto out; - } + ctftab = malloc(sz, M_LINKER, M_WAITOK); /* * Read the CTF data into the raw buffer if compressed, or From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 04:32:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80C6DA91; Thu, 19 Feb 2015 04:32:47 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0902786D; Thu, 19 Feb 2015 04:32:45 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1J4WcOe075645 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 19 Feb 2015 07:32:38 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1J4WbbW075644; Thu, 19 Feb 2015 07:32:37 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 19 Feb 2015 07:32:37 +0300 From: Gleb Smirnoff To: Alastair Hogge Subject: Re: svn commit: r278979 - head/sys/netinet6 Message-ID: <20150219043237.GH15484@FreeBSD.org> References: <201502190121.t1J1LOwU028918@svn.freebsd.org> <20150219024922.GA2330@kropotkin.auxio> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="B3NBd8mrXZtPJEYR" Content-Disposition: inline In-Reply-To: <20150219024922.GA2330@kropotkin.auxio> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 19 Feb 2015 04:32:47 -0000 --B3NBd8mrXZtPJEYR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Feb 19, 2015 at 10:49:22AM +0800, Alastair Hogge wrote: A> On 2015-02-19 Thu 01:21:24 +0000, Gleb Smirnoff wrote: A> A> Hi Gleb, A> A> I think this commit the whole economy^W buildworld? Here is preliminary patch, that I'm testing now. -- Totus tuus, Glebius. --B3NBd8mrXZtPJEYR Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="in6_var.h.diff" Index: sys/netinet6/in6_var.h =================================================================== --- sys/netinet6/in6_var.h (revision 278985) +++ sys/netinet6/in6_var.h (working copy) @@ -596,7 +596,6 @@ ip6_msource_cmp(const struct ip6_msource *a, const return (memcmp(&a->im6s_addr, &b->im6s_addr, sizeof(struct in6_addr))); } RB_PROTOTYPE(ip6_msource_tree, ip6_msource, im6s_link, ip6_msource_cmp); -#endif /* _KERNEL */ /* * IPv6 multicast PCB-layer group filter descriptor. @@ -696,8 +695,6 @@ im6s_get_mode(const struct in6_multi *inm, const s return (MCAST_UNDEFINED); } -#ifdef _KERNEL - /* * Lock macros for IPv6 layer multicast address lists. IPv6 lock goes * before link layer multicast locks in the lock order. In most cases, --B3NBd8mrXZtPJEYR-- From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 05:21:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EA3137F; Thu, 19 Feb 2015 05:21:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5AA16C81; Thu, 19 Feb 2015 05:21:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1J5L092039259; Thu, 19 Feb 2015 05:21:00 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1J5L0k7039253; Thu, 19 Feb 2015 05:21:00 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502190521.t1J5L0k7039253@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 19 Feb 2015 05:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278986 - 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 05:21:00 -0000 Author: gjb Date: Thu Feb 19 05:20:59 2015 New Revision: 278986 URL: https://svnweb.freebsd.org/changeset/base/278986 Log: Fix a grammar nit. Sponsored by: The FreeBSD Foundation Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Feb 19 03:57:47 2015 (r278985) +++ head/UPDATING Thu Feb 19 05:20:59 2015 (r278986) @@ -37,7 +37,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 upgrade the kernel to r278950 or later and regenerate any keys (e.g. ssh keys or openssl keys) that were generated w/ a kernel from that range. This does not effect programs that directly used /dev/random - or /dev/urandom. All userland uses of arc4random(3) are effected. + or /dev/urandom. All userland uses of arc4random(3) are affected. 20150210: The autofs(4) ABI was changed in order to restore binary compatibility From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 06:22:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90F5EA06 for ; Thu, 19 Feb 2015 06:22:51 +0000 (UTC) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 57EF7278 for ; Thu, 19 Feb 2015 06:22:50 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D5210205AB; Thu, 19 Feb 2015 01:22:43 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Thu, 19 Feb 2015 01:22:43 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= x-sasl-enc:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; s=mesmtp; bh=eJdgU+sh4L2 h8EftTx4Ji3m59RM=; b=h1J83FODowQ5Itif4UlaXlaMwQSW8q1zdmcdIGzBy9T Y0WuAYcKZD3z9/ivjA/gBFATcF0BKv3wmK3SeDngjJeZ76jV1jLG7PY3K8Cv5MPq 7xYroFSobJbUXY8qI8M+obiwpw6xTS3JR+Xy4xVUJuHMSTcb4LoXKT0jYWdSboPM = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:date:from:to:cc:subject :message-id:references:mime-version:content-type:in-reply-to; s= smtpout; bh=eJdgU+sh4L2h8EftTx4Ji3m59RM=; b=WCjd7WhumEjECIpQFhJv odwtQbqeyCMAev3yxR9FnDcnlJY9NSm8TrcrO0z2I3UK79AgANlx7Hy2NkpysbpX HpXcPZLritBahuU7+cIC9Sx7P3RESbJEnUfCv+xHtgJWJL6vVecLQFUu1gdt07/s xITAkGC+D7dPwmMVK663Do8= X-Sasl-enc: V4EgruLi5E2nALwharxxD/NAS2vMjYOU1X0lNm6x/g8a 1424326963 Received: from kropotkin.auxio (unknown [223.252.30.161]) by mail.messagingengine.com (Postfix) with ESMTPA id BFFBDC0028C; Thu, 19 Feb 2015 01:22:41 -0500 (EST) Date: Thu, 19 Feb 2015 14:22:33 +0800 From: Alastair Hogge To: Gleb Smirnoff Subject: Re: svn commit: r278979 - head/sys/netinet6 Message-ID: <20150219062233.GB2330@kropotkin.auxio> References: <201502190121.t1J1LOwU028918@svn.freebsd.org> <20150219024922.GA2330@kropotkin.auxio> <20150219043237.GH15484@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150219043237.GH15484@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 19 Feb 2015 06:22:51 -0000 On 2015-02-19 Thu 07:32:37 +0300, Gleb Smirnoff wrote: > On Thu, Feb 19, 2015 at 10:49:22AM +0800, Alastair Hogge wrote: > A> On 2015-02-19 Thu 01:21:24 +0000, Gleb Smirnoff wrote: > A> > A> Hi Gleb, > A> > A> I think this commit the whole economy^W buildworld? > > Here is preliminary patch, that I'm testing now. Ta, the build continues, tho, it breaks on sys/netinet/in_var.h now: cc -O2 -pipe -march=corei7-avx -DINET6 -DINET -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs -DRESCUE -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Qunused-arguments -c /usr/src/sbin/ifconfig/ifconfig.c In file included from /usr/src/sbin/ifconfig/ifconfig.c:61: /tmp/corei7-avx/usr/src/tmp/usr/include/netinet/in_var.h:213:16: error: field has incomplete type 'struct mbufq' struct mbufq igi_gq; /* queue of general query responses */ ^ /tmp/corei7-avx/usr/src/tmp/usr/include/netinet/in_var.h:213:9: note: forward declaration of 'struct mbufq' struct mbufq igi_gq; /* queue of general query responses */ ^ /tmp/corei7-avx/usr/src/tmp/usr/include/netinet/in_var.h:302:17: error: field has incomplete type 'struct mbufq' struct mbufq inm_scq; /* queue of pending ^ /tmp/corei7-avx/usr/src/tmp/usr/include/netinet/in_var.h:213:9: note: forward declaration of 'struct mbufq' struct mbufq igi_gq; /* queue of general query responses */ ^ 2 errors generated. *** [ifconfig.o] Error code 1 make[6]: stopped in /usr/src/sbin/ifconfig 1 error make[6]: stopped in /usr/src/sbin/ifconfig *** [ifconfig_make] Error code 2 make[5]: stopped in /tmp/corei7-avx/usr/src/rescue/rescue 1 error make[5]: stopped in /tmp/corei7-avx/usr/src/rescue/rescue *** [objs] Error code 2 make[4]: stopped in /usr/src/rescue/rescue 1 error make[4]: stopped in /usr/src/rescue/rescue *** [_sub.all] Error code 2 make[3]: stopped in /usr/src/rescue 1 error make[3]: stopped in /usr/src/rescue *** [rescue.all__D] Error code 2 make[2]: stopped in /usr/src 1 error make[2]: stopped in /usr/src *** [everything] Error code 2 make[1]: stopped in /usr/src 1 error make[1]: stopped in /usr/src *** [buildworld] Error code 2 make: stopped in /usr/src 1 error make: stopped in /usr/src Salud, al -- Washington, D.C: Fifty square miles almost completely surrounded by reality. From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 06:24:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1D45B4C; Thu, 19 Feb 2015 06:24:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B2957284; Thu, 19 Feb 2015 06:24:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1J6OSJ3070497; Thu, 19 Feb 2015 06:24:28 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1J6OS7w070489; Thu, 19 Feb 2015 06:24:28 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502190624.t1J6OS7w070489@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 19 Feb 2015 06:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278987 - in head/sys: netinet netinet6 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 06:24:29 -0000 Author: glebius Date: Thu Feb 19 06:24:27 2015 New Revision: 278987 URL: https://svnweb.freebsd.org/changeset/base/278987 Log: Widen _KERNEL ifdef to hide more kernel network stack structures from userland. Modified: head/sys/netinet/in_var.h head/sys/netinet6/in6_var.h head/sys/sys/mbuf.h Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Thu Feb 19 05:20:59 2015 (r278986) +++ head/sys/netinet/in_var.h Thu Feb 19 06:24:27 2015 (r278987) @@ -173,7 +173,6 @@ do { \ ifa_ref(&(ia)->ia_ifa); \ IN_IFADDR_RUNLOCK(); \ } while (0) -#endif /* * IP datagram reassembly. @@ -343,8 +342,6 @@ ims_get_mode(const struct in_multi *inm, return (MCAST_UNDEFINED); } -#ifdef _KERNEL - #ifdef SYSCTL_DECL SYSCTL_DECL(_net_inet); SYSCTL_DECL(_net_inet_ip); @@ -425,12 +422,6 @@ void in_rtredirect(struct sockaddr *, s struct sockaddr *, int, struct sockaddr *, u_int); int in_rtrequest(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); - -#if 0 -int in_rt_getifa(struct rt_addrinfo *, u_int fibnum); -int in_rtioctl(u_long, caddr_t, u_int); -int in_rtrequest1(int, struct rt_addrinfo *, struct rtentry **, u_int); -#endif #endif /* _KERNEL */ /* INET6 stuff */ Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Thu Feb 19 05:20:59 2015 (r278986) +++ head/sys/netinet6/in6_var.h Thu Feb 19 06:24:27 2015 (r278987) @@ -596,7 +596,6 @@ ip6_msource_cmp(const struct ip6_msource return (memcmp(&a->im6s_addr, &b->im6s_addr, sizeof(struct in6_addr))); } RB_PROTOTYPE(ip6_msource_tree, ip6_msource, im6s_link, ip6_msource_cmp); -#endif /* _KERNEL */ /* * IPv6 multicast PCB-layer group filter descriptor. @@ -696,8 +695,6 @@ im6s_get_mode(const struct in6_multi *in return (MCAST_UNDEFINED); } -#ifdef _KERNEL - /* * Lock macros for IPv6 layer multicast address lists. IPv6 lock goes * before link layer multicast locks in the lock order. In most cases, Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Feb 19 05:20:59 2015 (r278986) +++ head/sys/sys/mbuf.h Thu Feb 19 06:24:27 2015 (r278987) @@ -1190,8 +1190,6 @@ rt_m_getfib(struct mbuf *m) ((_m)->m_pkthdr.fibnum) = (_fib); \ } while (0) -#endif /* _KERNEL */ - #ifdef MBUF_PROFILING void m_profile(struct mbuf *m); #define M_PROFILE(m) m_profile(m) @@ -1296,4 +1294,5 @@ mbufq_prepend(struct mbufq *mq, struct m STAILQ_INSERT_HEAD(&mq->mq_head, m, m_stailqpkt); mq->mq_len++; } +#endif /* _KERNEL */ #endif /* !_SYS_MBUF_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 06:27:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26E55CAD; Thu, 19 Feb 2015 06:27:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 123BD2AA; Thu, 19 Feb 2015 06:27:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1J6REfm070893; Thu, 19 Feb 2015 06:27:14 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1J6RE3x070892; Thu, 19 Feb 2015 06:27:14 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502190627.t1J6RE3x070892@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 19 Feb 2015 06:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278988 - head/usr.sbin 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 06:27:15 -0000 Author: glebius Date: Thu Feb 19 06:27:14 2015 New Revision: 278988 URL: https://svnweb.freebsd.org/changeset/base/278988 Log: Temporarily disconnect ifmcstat(8) from build, to make world buildable ifmcstat(8) noses in kernel memory too much, and thus is very tentative to any changes in kernel. I will rewrite it to use some API instead of libkvm(3) and connect back to build. Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Feb 19 06:24:27 2015 (r278987) +++ head/usr.sbin/Makefile Thu Feb 19 06:27:14 2015 (r278988) @@ -33,7 +33,7 @@ SUBDIR= adduser \ getpmac \ gstat \ i2c \ - ifmcstat \ +# ifmcstat \ iostat \ kldxref \ mailwrapper \ From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 06:29:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F27ADEC; Thu, 19 Feb 2015 06:29:03 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8898F2B9; Thu, 19 Feb 2015 06:29:01 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1J6St56076164 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 19 Feb 2015 09:28:55 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1J6StOx076163; Thu, 19 Feb 2015 09:28:55 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 19 Feb 2015 09:28:55 +0300 From: Gleb Smirnoff To: Alastair Hogge Subject: Re: svn commit: r278979 - head/sys/netinet6 Message-ID: <20150219062855.GI15484@FreeBSD.org> References: <201502190121.t1J1LOwU028918@svn.freebsd.org> <20150219024922.GA2330@kropotkin.auxio> <20150219043237.GH15484@FreeBSD.org> <20150219062233.GB2330@kropotkin.auxio> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150219062233.GB2330@kropotkin.auxio> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 19 Feb 2015 06:29:03 -0000 On Thu, Feb 19, 2015 at 02:22:33PM +0800, Alastair Hogge wrote: A> On 2015-02-19 Thu 07:32:37 +0300, Gleb Smirnoff wrote: A> > On Thu, Feb 19, 2015 at 10:49:22AM +0800, Alastair Hogge wrote: A> > A> On 2015-02-19 Thu 01:21:24 +0000, Gleb Smirnoff wrote: A> > A> A> > A> Hi Gleb, A> > A> A> > A> I think this commit the whole economy^W buildworld? A> > A> > Here is preliminary patch, that I'm testing now. A> A> Ta, the build continues, tho, it breaks on sys/netinet/in_var.h now: Should be fixed now with r278987 and r278988. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 09:24:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC14765C; Thu, 19 Feb 2015 09:24:02 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 4ED5C854; Thu, 19 Feb 2015 09:24:02 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t1J9NuwG075986 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Feb 2015 11:23:56 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t1J9NuwG075986 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t1J9NtOb075985; Thu, 19 Feb 2015 11:23:55 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 19 Feb 2015 11:23:55 +0200 From: Konstantin Belousov To: Bruce Evans Subject: Re: svn commit: r278889 - head/lib/libc/include Message-ID: <20150219092355.GE34251@kib.kiev.ua> References: <201502170854.t1H8s4TL085174@svn.freebsd.org> <54E52019.8080009@FreeBSD.org> <20150219113226.K2984@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150219113226.K2984@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bryan Drewery X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 19 Feb 2015 09:24:02 -0000 On Thu, Feb 19, 2015 at 11:58:48AM +1100, Bruce Evans wrote: > On Wed, 18 Feb 2015, Bryan Drewery wrote: > > > On 2/17/2015 2:54 AM, Konstantin Belousov wrote: > >> ... > >> Log: > >> Restore the extern qualifier on __cleanup. > >> ... > >> Modified: head/lib/libc/include/libc_private.h > >> ============================================================================== > >> --- head/lib/libc/include/libc_private.h Tue Feb 17 08:50:26 2015 (r278888) > >> +++ head/lib/libc/include/libc_private.h Tue Feb 17 08:54:03 2015 (r278889) > >> @@ -271,7 +271,7 @@ void _malloc_first_thread(void); > >> /* > >> * Function to clean up streams, called from abort() and exit(). > >> */ > >> -void (*__cleanup)(void) __hidden; > >> +extern void (*__cleanup)(void) __hidden; > >> > >> /* > >> * Get kern.osreldate to detect ABI revisions. Explicitly > >> > > > > Is this a NOP? > > No, since this is a data declaration. It would be a style bug on a > prototype. > > BTW, the reason for existence of __cleanup() has been broken by malloc() > and other bloatware. It is to avoid linking anything in stdio when > only exit() is used. But crtso now links to malloc() and malloc() > links to stdio and much more. When correctly (that is, statically) > linked, this bloats the size of a minimal C program from to 440K + 80K > symbols on amd64 and to 390K + 60K symbols on i386. In FreeBSD-4 and > in my version of FreeBSD-5, __cleanup still works and the minimal C > program has size 2K + 1.5K symbols. In FreeBSD-5, malloc() is > relatively unbloated, so crtso's linking to it costs only 9K + 9K > symbols instead of 400+K. The same program written in asm takes about > 10 bytes in all versions of FreeBSD-x86. When dynamically linked, > __cleanup() has little effect. I briefly looked at the possibility of removing __cleanup (*). Besides ensuring that all stdio FILEs are flushed at exit(3), it also ensures that stdio finalization is performed as the last action, after the whole chain of atexit(3) handlers was called. To repeat this behaviour, the flush handler must be registered very early, which would just mirror special behaviour of __cleanup, but at the startup. * Bruce, I do understand that your response is that we should fix malloc to not depend on stdio instead. From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 11:10:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA091DEE; Thu, 19 Feb 2015 11:10:44 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 53726315; Thu, 19 Feb 2015 11:10:43 +0000 (UTC) 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 8EA9A1043D72; Thu, 19 Feb 2015 22:10:34 +1100 (AEDT) Date: Thu, 19 Feb 2015 22:10:33 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r278889 - head/lib/libc/include In-Reply-To: <20150219092355.GE34251@kib.kiev.ua> Message-ID: <20150219213224.G4526@besplex.bde.org> References: <201502170854.t1H8s4TL085174@svn.freebsd.org> <54E52019.8080009@FreeBSD.org> <20150219113226.K2984@besplex.bde.org> <20150219092355.GE34251@kib.kiev.ua> 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=Za4kaKlA c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=4h80pm8kGQkXuxGf7-gA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans , Bryan Drewery X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 19 Feb 2015 11:10:44 -0000 On Thu, 19 Feb 2015, Konstantin Belousov wrote: > On Thu, Feb 19, 2015 at 11:58:48AM +1100, Bruce Evans wrote: >> >> BTW, the reason for existence of __cleanup() has been broken by malloc() >> and other bloatware. It is to avoid linking anything in stdio when >> only exit() is used. But crtso now links to malloc() and malloc() >> links to stdio and much more. When correctly (that is, statically) >> linked, this bloats the size of a minimal C program from to 440K + 80K >> symbols on amd64 and to 390K + 60K symbols on i386. In FreeBSD-4 and >> in my version of FreeBSD-5, __cleanup still works and the minimal C >> program has size 2K + 1.5K symbols. In FreeBSD-5, malloc() is >> relatively unbloated, so crtso's linking to it costs only 9K + 9K >> symbols instead of 400+K. The same program written in asm takes about >> 10 bytes in all versions of FreeBSD-x86. When dynamically linked, >> __cleanup() has little effect. > > I briefly looked at the possibility of removing __cleanup (*). Besides > ensuring that all stdio FILEs are flushed at exit(3), it also ensures > that stdio finalization is performed as the last action, after the whole > chain of atexit(3) handlers was called. To repeat this behaviour, the > flush handler must be registered very early, which would just mirror > special behaviour of __cleanup, but at the startup. > > * Bruce, I do understand that your response is that we should fix malloc > to not depend on stdio instead. Also, malloc to not be so difficult to replace, and atexit() and possibly other things called by crtso to not be so large and/or not have such a large closure including calling malloc(). I use this hack for atexit(): X Index: atexit.c X =================================================================== X RCS file: /home/ncvs/src/lib/libc/stdlib/atexit.c,v X retrieving revision 1.7 X diff -u -2 -r1.7 atexit.c X --- atexit.c 19 Dec 2003 17:11:20 -0000 1.7 X +++ atexit.c 21 Dec 2003 15:20:28 -0000 X @@ -55,8 +55,15 @@ X #define ATEXIT_FN_CXA 2 X X +/* XXX how to remove this in non-threaded case? */ X static pthread_mutex_t atexit_mutex = PTHREAD_MUTEX_INITIALIZER; X X -#define _MUTEX_LOCK(x) if (__isthreaded) _pthread_mutex_lock(x) X -#define _MUTEX_UNLOCK(x) if (__isthreaded) _pthread_mutex_unlock(x) X +#define _MUTEX_LOCK(x) do { \ X + if (__isthreaded) \ X + _pthread_mutex_lock(x); \ X +} while (0) X +#define _MUTEX_UNLOCK(x) do { \ X + if (__isthreaded) \ X + _pthread_mutex_unlock(x); \ X +} while (0) X X struct atexit { X @@ -76,4 +83,10 @@ X static struct atexit *__atexit; /* points to head of LIFO stack */ X X +#pragma weak malloc X +#pragma weak free X +#pragma weak __isthreaded X +#pragma weak _pthread_mutex_lock X +#pragma weak _pthread_mutex_unlock X + X /* X * Register the function described by 'fptr' to be called at application X @@ -94,6 +107,13 @@ X old__atexit = __atexit; X _MUTEX_UNLOCK(&atexit_mutex); X - if ((p = (struct atexit *)malloc(sizeof(*p))) == NULL) X - return (-1); X + if (&malloc == NULL) { X + p = sbrk(sizeof(*p)); X + if (p == (struct atexit *)-1) X + return (-1); X + } else { X + p = malloc(sizeof(*p)); X + if (p == NULL) X + return (-1); X + } X _MUTEX_LOCK(&atexit_mutex); X if (old__atexit != __atexit) { BTW, atexit() has uses a space-saving feature that has been broken by it calling malloc(). This is the static allocation of ATEXIT_SIZE = 32 entries. Each entry takes 16 bytes on i386. Most programs should never call atexit(), so if malloc() is linked then the static table just wastes the size of 32 entries. But crtso calls atexit(), so all C programs except ones linked with -nostdlib call atexit(), and a couple of statically allocated entries are useful. However, these shouldn't be full entries. Note that __cleanup() is essentially a specialized version of atexit(). It plus code to call it costs just a little more than the space for 1 atexit entry, and costs less to set up. for 1 entry. Perhaps all the atexit() calls in crtso can be handled similarly, so that atexit() is only linked if the application proper calls it. Simply place them in exit() in the correct order relative to __cxa_finalize() and __cleanup(). Bruce From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 11:17:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39587E5; Thu, 19 Feb 2015 11:17:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 24E423FA; Thu, 19 Feb 2015 11:17:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JBHb5e006781; Thu, 19 Feb 2015 11:17:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JBHbJA006780; Thu, 19 Feb 2015 11:17:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201502191117.t1JBHbJA006780@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 19 Feb 2015 11:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278992 - head/usr.sbin 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 11:17:37 -0000 Author: ngie Date: Thu Feb 19 11:17:36 2015 New Revision: 278992 URL: https://svnweb.freebsd.org/changeset/base/278992 Log: Unbreak freshly installed worlds by properly "commenting" out ifmcstat Pointyhat to: glebius Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Feb 19 10:28:22 2015 (r278991) +++ head/usr.sbin/Makefile Thu Feb 19 11:17:36 2015 (r278992) @@ -33,7 +33,7 @@ SUBDIR= adduser \ getpmac \ gstat \ i2c \ -# ifmcstat \ + ifmcstat \ iostat \ kldxref \ mailwrapper \ @@ -94,6 +94,8 @@ SUBDIR= adduser \ watchdogd \ zic +SUBDIR:= ${SUBDIR:Nifmcstat} + # NB: keep these sorted by MK_* knobs .if ${MK_ACCT} != "no" From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 11:19:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCC6F32C; Thu, 19 Feb 2015 11:19:56 +0000 (UTC) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) (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 8C2B95EA; Thu, 19 Feb 2015 11:19:56 +0000 (UTC) Received: by pdbfp1 with SMTP id fp1so8204399pdb.5; Thu, 19 Feb 2015 03:19:55 -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 :message-id:references:to; bh=GWo7/XY3GBPJ48Cr9Nti42NWZuvWKXQ4Ucbk5XhA/Iw=; b=L+xbZjxg9cJu574cU3Df2swMbYZoK1uHCQm9E2Gdl4qtiTRbYZnJa9FGFVPUMkNiac JAStbh62QcHhlo68IC56JcCpukKJFHJfBw9qOoHixYJ43o+peNExKzZT3DaQvrorduP4 4zAHi1oqik2v83hTqhxASoHLlP5koU62LP2bhSJnbIEDt/TDe5UVjDmKEjo0dCZpSedG EIDVvRk02aiaXu4VRf6xTjW6Da/OWAcEKkH4fpQSaJ5JtWzTsFSV4mn3yCgbA7wWDYcm MewPKBaFor8e8IcDXk3UrbRZYf4al714kub3tn6c1HtBfICnqmpnan3vcHPES9WY2KhA ku5A== X-Received: by 10.66.174.165 with SMTP id bt5mr6722900pac.53.1424344795261; Thu, 19 Feb 2015 03:19:55 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:b073:b5c7:79cc:a718? ([2601:8:ab80:7d6:b073:b5c7:79cc:a718]) by mx.google.com with ESMTPSA id ah1sm23713196pad.16.2015.02.19.03.19.54 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Feb 2015 03:19:54 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_E41D5A97-06C0-4C2D-8A39-AA32AEC5EE5A"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r278988 - head/usr.sbin From: Garrett Cooper In-Reply-To: <201502190627.t1J6RE3x070892@svn.freebsd.org> Date: Thu, 19 Feb 2015 03:19:53 -0800 Message-Id: <2CE7E65D-CE0B-4A5D-83D0-176DA476BD77@gmail.com> References: <201502190627.t1J6RE3x070892@svn.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 19 Feb 2015 11:19:57 -0000 --Apple-Mail=_E41D5A97-06C0-4C2D-8A39-AA32AEC5EE5A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Feb 18, 2015, at 22:27, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Feb 19 06:27:14 2015 > New Revision: 278988 > URL: https://svnweb.freebsd.org/changeset/base/278988 >=20 > Log: > Temporarily disconnect ifmcstat(8) from build, to make world = buildable > ifmcstat(8) noses in kernel memory too much, and thus is very = tentative > to any changes in kernel. >=20 > I will rewrite it to use some API instead of libkvm(3) and connect = back > to build. >=20 > Modified: > head/usr.sbin/Makefile >=20 > Modified: head/usr.sbin/Makefile > = =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/usr.sbin/Makefile Thu Feb 19 06:24:27 2015 = (r278987) > +++ head/usr.sbin/Makefile Thu Feb 19 06:27:14 2015 = (r278988) > @@ -33,7 +33,7 @@ SUBDIR=3D adduser \ > getpmac \ > gstat \ > i2c \ > - ifmcstat \ > +# ifmcstat \ > iostat \ > kldxref \ > mailwrapper \ >=20 Hi Gleb, You just broke the build (technically the install) again with this = commit. I checked in a =93fix=94 in r278992 =97 please remove the = addition I made in r278992 when ifmcstat is =93fixed=94. Thank you, $ SRCCONF=3D/dev/null make -VSUBDIR | grep kldxref $ --Apple-Mail=_E41D5A97-06C0-4C2D-8A39-AA32AEC5EE5A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJU5cbZAAoJEMZr5QU6S73erDcIALbKmbAL1bYX9xkVJY+j9KA+ LAjsLMsGgeynGFoPvp7SnCJoEZi0c4/qArGbqo2eWKxNxV4dIMgz453pjJQM1lnf nygunGL4xZLCtK2d1u5hHyEe9MgmB+Bx645kIr5cxhhpHSpcBsO7cSJeAhQteVS3 h9IO+SXnbgM6B5swsihVRlxG3O0Qoy1JyxILX9uTwBLxAxV10nA4pPTC6oOFvHXo 6hht7XIoRPRArARfE1o5r59mIS5JngqAozd6tyOhbHR0GUWCdB+FxDd4ILuSur+F Ta+Kzmz9DJPlXcsXtqgCMBNH08fLKkCWVeYDglN0wV6PVSH8161i3fCJQ93PZ/M= =Vq/Q -----END PGP SIGNATURE----- --Apple-Mail=_E41D5A97-06C0-4C2D-8A39-AA32AEC5EE5A-- From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 11:46:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4917B95 for ; Thu, 19 Feb 2015 11:46:02 +0000 (UTC) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 A7F9F920 for ; Thu, 19 Feb 2015 11:46:02 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 8DABE20BE8; Thu, 19 Feb 2015 06:46:00 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Thu, 19 Feb 2015 06:46:00 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= x-sasl-enc:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; s=mesmtp; bh=cNIqSArx7L8 13R0Shuj87A/rCTY=; b=pbgqrjGnQ/zeHrKtbBE3yqS5bv8nPb5BeXL4557ToXh 1PF3IEAR3t/QA2J3FE3jVYI9PmkCXVAURPciyotSqw+uSbuzZG5BAdBx3ksZUg5n OaySWA4xQJiP9864WpSnfMioojr7g5T9RRa86wlr6Uv2yYSb3UrjqxMZsHMh4zYE = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:date:from:to:cc:subject :message-id:references:mime-version:content-type:in-reply-to; s= smtpout; bh=cNIqSArx7L813R0Shuj87A/rCTY=; b=t6ABEwNyJEW/tQWwD70N fDy8y9BvRgoCwUcZew6Lj0YQMVnYLvLjlBkqm/bhfwyq+1o9QNU9BxWNyGhb0xla 8Wlsj+Ipo2VS/wxb04g50nFlKURAeEuLIyqsNFqp79FTSJcbFYyTfL0axWEM9Gye ldK/YH669jpoNhTs1G3b+0k= X-Sasl-enc: dBwMoAZr8DsiSON9gLDH/iXOXFyR1Msj1KLAZizSn7me 1424346359 Received: from kropotkin.auxio (unknown [223.252.30.161]) by mail.messagingengine.com (Postfix) with ESMTPA id E061168012D; Thu, 19 Feb 2015 06:45:58 -0500 (EST) Date: Thu, 19 Feb 2015 19:45:57 +0800 From: Alastair Hogge To: Gleb Smirnoff Subject: Re: svn commit: r278979 - head/sys/netinet6 Message-ID: <20150219114557.GE2330@kropotkin.auxio> References: <201502190121.t1J1LOwU028918@svn.freebsd.org> <20150219024922.GA2330@kropotkin.auxio> <20150219043237.GH15484@FreeBSD.org> <20150219062233.GB2330@kropotkin.auxio> <20150219062855.GI15484@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150219062855.GI15484@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 19 Feb 2015 11:46:03 -0000 Thanks On 2015-02-19 Thu 09:28:55 +0300, Gleb Smirnoff wrote: > On Thu, Feb 19, 2015 at 02:22:33PM +0800, Alastair Hogge wrote: > A> On 2015-02-19 Thu 07:32:37 +0300, Gleb Smirnoff wrote: > A> > On Thu, Feb 19, 2015 at 10:49:22AM +0800, Alastair Hogge wrote: > A> > A> On 2015-02-19 Thu 01:21:24 +0000, Gleb Smirnoff wrote: > A> > A> > A> > A> Hi Gleb, > A> > A> > A> > A> I think this commit the whole economy^W buildworld? > A> > > A> > Here is preliminary patch, that I'm testing now. > A> > A> Ta, the build continues, tho, it breaks on sys/netinet/in_var.h now: > > Should be fixed now with r278987 and r278988. From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 11:48:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A8A7CE5; Thu, 19 Feb 2015 11:48:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 25D43930; Thu, 19 Feb 2015 11:48:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JBm1nh021338; Thu, 19 Feb 2015 11:48:01 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JBm1a8021337; Thu, 19 Feb 2015 11:48:01 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201502191148.t1JBm1a8021337@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 19 Feb 2015 11:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278995 - head/sys/ofed/drivers/infiniband/core 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 11:48:01 -0000 Author: bz Date: Thu Feb 19 11:48:00 2015 New Revision: 278995 URL: https://svnweb.freebsd.org/changeset/base/278995 Log: Try to unbreak NOIP and NOINET6 LINT builds after r278886 by placing appropriate #ifdefs around otherwise unused variables or sections with functions called which are not available without IPv6 support in the kernel. Modified: head/sys/ofed/drivers/infiniband/core/cma.c Modified: head/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/cma.c Thu Feb 19 11:44:50 2015 (r278994) +++ head/sys/ofed/drivers/infiniband/core/cma.c Thu Feb 19 11:48:00 2015 (r278995) @@ -2558,8 +2558,10 @@ int rdma_bind_addr(struct rdma_cm_id *id { struct rdma_id_private *id_priv; int ret; +#if defined(INET6) int ipv6only; size_t var_size = sizeof(int); +#endif if (addr->sa_family != AF_INET && addr->sa_family != AF_INET6) return -EAFNOSUPPORT; @@ -3222,10 +3224,13 @@ static void cma_set_mgid(struct rdma_id_ unsigned char mc_map[MAX_ADDR_LEN]; struct rdma_dev_addr *dev_addr = &id_priv->id.route.addr.dev_addr; struct sockaddr_in *sin = (struct sockaddr_in *) addr; +#if defined(INET6) struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) addr; +#endif if (cma_any_addr(addr)) { memset(mgid, 0, sizeof *mgid); +#if defined(INET6) } else if ((addr->sa_family == AF_INET6) && ((be32_to_cpu(sin6->sin6_addr.s6_addr32[0]) & 0xFFF0FFFF) == 0xFF10A01B)) { @@ -3236,6 +3241,7 @@ static void cma_set_mgid(struct rdma_id_ if (id_priv->id.ps == RDMA_PS_UDP) mc_map[7] = 0x01; /* Use RDMA CM signature */ *mgid = *(union ib_gid *) (mc_map + 4); +#endif } else { ip_ib_mc_map(sin->sin_addr.s_addr, dev_addr->broadcast, mc_map); if (id_priv->id.ps == RDMA_PS_UDP) From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 12:07:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F374936A; Thu, 19 Feb 2015 12:06:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D4C51B76; Thu, 19 Feb 2015 12:06:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JC6xHe030551; Thu, 19 Feb 2015 12:06:59 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JC6wIB030545; Thu, 19 Feb 2015 12:06:58 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201502191206.t1JC6wIB030545@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 19 Feb 2015 12:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278996 - in head/sys: arm/arm arm/include 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 12:07:00 -0000 Author: andrew Date: Thu Feb 19 12:06:57 2015 New Revision: 278996 URL: https://svnweb.freebsd.org/changeset/base/278996 Log: Allow the ARM unwinder to work through modules. This will be used to add support for unwinding from dtrace. Tested by: gnn (with dtrace) Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/db_trace.c head/sys/arm/arm/unwind.c head/sys/arm/include/stack.h head/sys/conf/kmod.mk Modified: head/sys/arm/arm/db_trace.c ============================================================================== --- head/sys/arm/arm/db_trace.c Thu Feb 19 11:48:00 2015 (r278995) +++ head/sys/arm/arm/db_trace.c Thu Feb 19 12:06:57 2015 (r278996) @@ -66,7 +66,7 @@ db_stack_trace_cmd(struct unwind_state * finished = false; while (!finished) { - finished = unwind_stack_one(state); + finished = unwind_stack_one(state, 0); /* Print the frame details */ sym = db_search_symbol(state->start_pc, DB_STGY_ANY, &offset); Modified: head/sys/arm/arm/unwind.c ============================================================================== --- head/sys/arm/arm/unwind.c Thu Feb 19 11:48:00 2015 (r278995) +++ head/sys/arm/arm/unwind.c Thu Feb 19 12:06:57 2015 (r278996) @@ -33,9 +33,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include "linker_if.h" + /* * Definitions for the instruction interpreter. * @@ -61,7 +64,7 @@ __FBSDID("$FreeBSD$"); * These are set in the linker script. Their addresses will be * either the start or end of the exception table or index. */ -extern int extab_start, extab_end, exidx_start, exidx_end; +extern int exidx_start, exidx_end; /* * Entry types. @@ -104,13 +107,47 @@ expand_prel31(uint32_t prel31) return ((int32_t)(prel31 & 0x7fffffffu) << 1) / 2; } +struct search_context { + uint32_t addr; + caddr_t exidx_start; + caddr_t exidx_end; +}; + +static int +module_search(linker_file_t lf, void *context) +{ + struct search_context *sc = context; + linker_symval_t symval; + c_linker_sym_t sym; + + if (lf->address <= (caddr_t)sc->addr && + (lf->address + lf->size) >= (caddr_t)sc->addr) { + if ((LINKER_LOOKUP_SYMBOL(lf, "__exidx_start", &sym) == 0 || + LINKER_LOOKUP_SYMBOL(lf, "exidx_start", &sym) == 0) && + LINKER_SYMBOL_VALUES(lf, sym, &symval) == 0) + sc->exidx_start = symval.value; + + if ((LINKER_LOOKUP_SYMBOL(lf, "__exidx_end", &sym) == 0 || + LINKER_LOOKUP_SYMBOL(lf, "exidx_end", &sym) == 0) && + LINKER_SYMBOL_VALUES(lf, sym, &symval) == 0) + sc->exidx_end = symval.value; + + if (sc->exidx_start != NULL && sc->exidx_end != NULL) + return (1); + panic("Invalid module %s, no unwind tables\n", lf->filename); + } + return (0); +} + /* * Perform a binary search of the index table to find the function * with the largest address that doesn't exceed addr. */ static struct unwind_idx * -find_index(uint32_t addr) +find_index(uint32_t addr, int search_modules) { + struct search_context sc; + caddr_t idx_start, idx_end; unsigned int min, mid, max; struct unwind_idx *start; struct unwind_idx *item; @@ -118,9 +155,23 @@ find_index(uint32_t addr) uint32_t func_addr; start = (struct unwind_idx *)&exidx_start; + idx_start = (caddr_t)&exidx_start; + idx_end = (caddr_t)&exidx_end; + + /* This may acquire a lock */ + if (search_modules) { + bzero(&sc, sizeof(sc)); + sc.addr = addr; + if (linker_file_foreach(module_search, &sc) != 0 && + sc.exidx_start != NULL && sc.exidx_end != NULL) { + start = (struct unwind_idx *)sc.exidx_start; + idx_start = sc.exidx_start; + idx_end = sc.exidx_end; + } + } min = 0; - max = (&exidx_end - &exidx_start) / 2; + max = (idx_end - idx_start) / sizeof(struct unwind_idx); while (min != max) { mid = min + (max - min + 1) / 2; @@ -332,7 +383,7 @@ unwind_tab(struct unwind_state *state) } int -unwind_stack_one(struct unwind_state *state) +unwind_stack_one(struct unwind_state *state, int can_lock) { struct unwind_idx *index; int finished; @@ -344,7 +395,7 @@ unwind_stack_one(struct unwind_state *st state->start_pc = state->registers[PC]; /* Find the item to run */ - index = find_index(state->start_pc); + index = find_index(state->start_pc, can_lock); finished = 0; if (index->insn != EXIDX_CANTUNWIND) { Modified: head/sys/arm/include/stack.h ============================================================================== --- head/sys/arm/include/stack.h Thu Feb 19 11:48:00 2015 (r278995) +++ head/sys/arm/include/stack.h Thu Feb 19 12:06:57 2015 (r278996) @@ -55,6 +55,6 @@ struct unwind_state { #define LR 14 #define PC 15 -int unwind_stack_one(struct unwind_state *); +int unwind_stack_one(struct unwind_state *, int); #endif /* !_MACHINE_STACK_H_ */ Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Thu Feb 19 11:48:00 2015 (r278995) +++ head/sys/conf/kmod.mk Thu Feb 19 12:06:57 2015 (r278996) @@ -125,6 +125,7 @@ CFLAGS+= -fno-omit-frame-pointer -mno-om .if ${MACHINE_CPUARCH} == arm CFLAGS.clang+= -mllvm -arm-use-movt=0 CFLAGS.clang+= -mfpu=none +CFLAGS+= -funwind-tables .endif .if ${MACHINE_CPUARCH} == powerpc From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 12:20:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E8168A0; Thu, 19 Feb 2015 12:20:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 7F3F0CB2; Thu, 19 Feb 2015 12:20:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JCKMa8035791; Thu, 19 Feb 2015 12:20:22 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JCKMRA035789; Thu, 19 Feb 2015 12:20:22 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201502191220.t1JCKMRA035789@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 19 Feb 2015 12:20:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278997 - in head/sys: cddl/dev/dtrace/arm 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 12:20:22 -0000 Author: andrew Date: Thu Feb 19 12:20:21 2015 New Revision: 278997 URL: https://svnweb.freebsd.org/changeset/base/278997 Log: Use the ARM unwinder with dtrace to extract the stack when asked. With this dtrace is able to display a stack trace similar to the one below. # dtrace -p 603 -n 'tcp:kernel::receive { stack(); }' 0 70 :receive kernel`ip_input+0x140 kernel`netisr_dispatch_src+0xb8 kernel`ether_demux+0x1c4 kernel`ether_nh_input+0x3a8 kernel`netisr_dispatch_src+0xb8 kernel`ether_input+0x60 kernel`cpsw_intr_rx+0xac kernel`intr_event_execute_handlers+0x128 kernel`ithread_loop+0xb4 kernel`fork_exit+0x84 kernel`swi_exit kernel`swi_exit Tested by: gnn Sponsored by: ABT Systems Ltd Modified: head/sys/cddl/dev/dtrace/arm/dtrace_isa.c head/sys/conf/files.arm Modified: head/sys/cddl/dev/dtrace/arm/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/arm/dtrace_isa.c Thu Feb 19 12:06:57 2015 (r278996) +++ head/sys/cddl/dev/dtrace/arm/dtrace_isa.c Thu Feb 19 12:20:21 2015 (r278997) @@ -69,9 +69,10 @@ void dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, uint32_t *intrpc) { - u_int32_t *frame, *lastframe; - int scp_offset; - int depth = 0; + struct unwind_state state; + register_t sp; + int scp_offset; + int depth = 0; pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; if (intrpc != 0) @@ -79,23 +80,17 @@ dtrace_getpcstack(pc_t *pcstack, int pcs aframes++; - frame = (u_int32_t *)__builtin_frame_address(0);; - lastframe = NULL; - scp_offset = -(get_pc_str_offset() >> 2); - - while ((frame != NULL) && (depth < pcstack_limit)) { - db_addr_t scp; -#if 0 - u_int32_t savecode; - int r; - u_int32_t *rp; -#endif - - /* - * In theory, the SCP isn't guaranteed to be in the function - * that generated the stack frame. We hope for the best. - */ - scp = frame[FR_SCP]; + __asm __volatile("mov %0, sp" : "=&r" (sp)); + + state.registers[FP] = (uint32_t)__builtin_frame_address(0); + state.registers[SP] = sp; + state.registers[LR] = (uint32_t)__builtin_return_address(0); + state.registers[PC] = (uint32_t)dtrace_getpcstack; + + while (depth < pcstack_limit) { + int done; + + done = unwind_stack_one(&state, 1); if (aframes > 0) { aframes--; @@ -104,39 +99,10 @@ dtrace_getpcstack(pc_t *pcstack, int pcs } } else { - pcstack[depth++] = scp; + pcstack[depth++] = state.registers[PC]; } -#if 0 - savecode = ((u_int32_t *)scp)[scp_offset]; - if ((savecode & 0x0e100000) == 0x08000000) { - /* Looks like an STM */ - rp = frame - 4; - for (r = 10; r >= 0; r--) { - if (savecode & (1 << r)) { - /* register r == *rp-- */ - } - } - } -#endif - - /* - * Switch to next frame up - */ - if (frame[FR_RFP] == 0) - break; /* Top of stack */ - - lastframe = frame; - frame = (u_int32_t *)(frame[FR_RFP]); - - if (INKERNEL((int)frame)) { - /* staying in kernel */ - if (frame <= lastframe) { - /* bad frame pointer */ - break; - } - } - else + if (done) break; } @@ -176,55 +142,28 @@ dtrace_getarg(int arg, int aframes) int dtrace_getstackdepth(int aframes) { - u_int32_t *frame, *lastframe; - int scp_offset; - int depth = 1; - - frame = (u_int32_t *)__builtin_frame_address(0);; - lastframe = NULL; - scp_offset = -(get_pc_str_offset() >> 2); - - while (frame != NULL) { - db_addr_t scp; -#if 0 - u_int32_t savecode; - int r; - u_int32_t *rp; -#endif - - /* - * In theory, the SCP isn't guaranteed to be in the function - * that generated the stack frame. We hope for the best. - */ - scp = frame[FR_SCP]; + struct unwind_state state; + register_t sp; + int scp_offset; + int done = 0; + int depth = 1; + + __asm __volatile("mov %0, sp" : "=&r" (sp)); + + state.registers[FP] = (uint32_t)__builtin_frame_address(0); + state.registers[SP] = sp; + state.registers[LR] = (uint32_t)__builtin_return_address(0); + state.registers[PC] = (uint32_t)dtrace_getstackdepth; + do { + done = unwind_stack_one(&state, 1); depth++; - - /* - * Switch to next frame up - */ - if (frame[FR_RFP] == 0) - break; /* Top of stack */ - - lastframe = frame; - frame = (u_int32_t *)(frame[FR_RFP]); - - if (INKERNEL((int)frame)) { - /* staying in kernel */ - if (frame <= lastframe) { - /* bad frame pointer */ - break; - } - } - else - break; - } + } while (!done); if (depth < aframes) return 0; else return depth - aframes; - } ulong_t Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Thu Feb 19 12:06:57 2015 (r278996) +++ head/sys/conf/files.arm Thu Feb 19 12:20:21 2015 (r278997) @@ -57,7 +57,7 @@ arm/arm/trap.c optional !armv6 arm/arm/trap-v6.c optional armv6 arm/arm/uio_machdep.c standard arm/arm/undefined.c standard -arm/arm/unwind.c optional ddb +arm/arm/unwind.c optional ddb | kdtrace_hooks arm/arm/vm_machdep.c standard arm/arm/vfp.c standard board_id.h standard \ From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 12:47:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECD41E81; Thu, 19 Feb 2015 12:47:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BDE89F66; Thu, 19 Feb 2015 12:47:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JClnOI051036; Thu, 19 Feb 2015 12:47:49 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JClnx7051034; Thu, 19 Feb 2015 12:47:49 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201502191247.t1JClnx7051034@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 19 Feb 2015 12:47:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278998 - in head/sys: dev/ofw 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 12:47:50 -0000 Author: andrew Date: Thu Feb 19 12:47:48 2015 New Revision: 278998 URL: https://svnweb.freebsd.org/changeset/base/278998 Log: Add support to get the cpu ID from its device driver in a generic way. This will be needed by arm64 to find the value to pass to the psci (Power State Coordination Interface) driver, among other things, used to enable cores. Differential Revision: https://reviews.freebsd.org/D1824 Reviewed by: imp Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/ofw/ofw_cpu.c head/sys/sys/cpu.h Modified: head/sys/dev/ofw/ofw_cpu.c ============================================================================== --- head/sys/dev/ofw/ofw_cpu.c Thu Feb 19 12:20:21 2015 (r278997) +++ head/sys/dev/ofw/ofw_cpu.c Thu Feb 19 12:47:48 2015 (r278998) @@ -244,6 +244,7 @@ ofw_cpu_attach(device_t dev) static int ofw_cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result) { + struct ofw_cpulist_softc *psc; struct ofw_cpu_softc *sc; sc = device_get_softc(dev); @@ -258,6 +259,16 @@ ofw_cpu_read_ivar(device_t dev, device_t return (0); } break; + case CPU_IVAR_CPUID_SIZE: + psc = device_get_softc(device_get_parent(dev)); + *result = psc->sc_addr_cells; + return (0); + case CPU_IVAR_CPUID: + if (sc->sc_reg_valid) { + *result = (uintptr_t)sc->sc_reg; + return (0); + } + break; } return (ENOENT); Modified: head/sys/sys/cpu.h ============================================================================== --- head/sys/sys/cpu.h Thu Feb 19 12:20:21 2015 (r278997) +++ head/sys/sys/cpu.h Thu Feb 19 12:47:48 2015 (r278998) @@ -37,6 +37,8 @@ #define CPU_IVAR_PCPU 1 #define CPU_IVAR_NOMINAL_MHZ 2 +#define CPU_IVAR_CPUID_SIZE 3 +#define CPU_IVAR_CPUID 4 static __inline struct pcpu *cpu_get_pcpu(device_t dev) { @@ -54,6 +56,20 @@ static __inline int32_t cpu_get_nominal_ return ((int32_t)v); } +static __inline const uint32_t *cpu_get_cpuid(device_t dev, size_t *count) +{ + uintptr_t v = 0; + if (BUS_READ_IVAR(device_get_parent(dev), dev, + CPU_IVAR_CPUID_SIZE, &v) != 0) + return (NULL); + *count = (size_t)v; + + if (BUS_READ_IVAR(device_get_parent(dev), dev, + CPU_IVAR_CPUID, &v) != 0) + return (NULL); + return ((const uint32_t *)v); +} + /* * CPU frequency control interface. */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 15:41:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 219C814C; Thu, 19 Feb 2015 15:41:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0CD3D765; Thu, 19 Feb 2015 15:41:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JFfNDo037228; Thu, 19 Feb 2015 15:41:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JFfN01037227; Thu, 19 Feb 2015 15:41:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502191541.t1JFfN01037227@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Feb 2015 15:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279007 - 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 15:41:24 -0000 Author: kib Date: Thu Feb 19 15:41:23 2015 New Revision: 279007 URL: https://svnweb.freebsd.org/changeset/base/279007 Log: Fix build with KTR after r278978. Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Thu Feb 19 14:52:01 2015 (r279006) +++ head/sys/netinet/in_mcast.c Thu Feb 19 15:41:23 2015 (r279007) @@ -2978,7 +2978,7 @@ inm_print(const struct in_multi *inm) inm->inm_timer, inm_state_str(inm->inm_state), inm->inm_refcount, - inm->inm_scq.ifq_len); + inm->inm_scq.mq_len); printf("igi %p nsrc %lu sctimer %u scrv %u\n", inm->inm_igi, inm->inm_nsrc, From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 16:34:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35DCB52E; Thu, 19 Feb 2015 16:34:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2057CD32; Thu, 19 Feb 2015 16:34:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JGYnC5061714; Thu, 19 Feb 2015 16:34:50 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JGYnnr061706; Thu, 19 Feb 2015 16:34:49 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201502191634.t1JGYnnr061706@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 19 Feb 2015 16:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279012 - head/sys/dev/ofw 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 16:34:50 -0000 Author: andrew Date: Thu Feb 19 16:34:48 2015 New Revision: 279012 URL: https://svnweb.freebsd.org/changeset/base/279012 Log: Adda function to iterate over the cpu nodes in the OFW or FDT data. This will be used with arm64 to find which cpus to enable, and could also be used with 32-bit arm and mips for the same purpose. Differential Revision: https://reviews.freebsd.org/D1825 Sponsored by: The FreeBSD Foundation Added: head/sys/dev/ofw/ofw_cpu.h (contents, props changed) Modified: head/sys/dev/ofw/ofw_cpu.c Modified: head/sys/dev/ofw/ofw_cpu.c ============================================================================== --- head/sys/dev/ofw/ofw_cpu.c Thu Feb 19 16:25:18 2015 (r279011) +++ head/sys/dev/ofw/ofw_cpu.c Thu Feb 19 16:34:48 2015 (r279012) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static int ofw_cpulist_probe(device_t); static int ofw_cpulist_attach(device_t); @@ -274,3 +275,50 @@ ofw_cpu_read_ivar(device_t dev, device_t return (ENOENT); } +int +ofw_cpu_early_foreach(ofw_cpu_foreach_cb callback, boolean_t only_runnable) +{ + phandle_t node, child; + pcell_t addr_cells, reg[2]; + char status[16]; + u_int id; + int count, rv; + + count = 0; + id = 0; + + node = OF_finddevice("/cpus"); + if (node == -1) + return (-1); + + /* Find the number of cells in the cpu register */ + if (OF_getencprop(node, "#address-cells", &addr_cells, + sizeof(addr_cells)) < 0) + return (-1); + + for (child = OF_child(node); child != 0; child = OF_peer(child), id++) { + /* + * If we are filtering by runnable then limit to only + * those that have been enabled. + */ + if (only_runnable) { + status[0] = '\0'; + OF_getprop(child, "status", status, sizeof(status)); + if (status[0] != '\0' && strcmp(status, "okay") != 0) + continue; + } + + /* + * Check we have a register to identify the cpu + */ + rv = OF_getencprop(child, "reg", reg, + addr_cells * sizeof(cell_t)); + if (rv != addr_cells * sizeof(cell_t)) + continue; + + if (callback == NULL || callback(id, child, addr_cells, reg)) + count++; + } + + return (only_runnable ? count : id); +} Added: head/sys/dev/ofw/ofw_cpu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ofw/ofw_cpu.h Thu Feb 19 16:34:48 2015 (r279012) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2015 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Andrew Turner under + * sponsorship from the FreeBSD Foundation. + * + * 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 _DEV_OFW_OFW_CPU_H_ +#define _DEV_OFW_OFW_CPU_H_ + +typedef boolean_t (*ofw_cpu_foreach_cb)(u_int, phandle_t, u_int, pcell_t *); +int ofw_cpu_early_foreach(ofw_cpu_foreach_cb, boolean_t); + +#endif /* _DEV_OFW_OFW_CPU_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 17:03:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE6F8C64; Thu, 19 Feb 2015 17:03:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 99C5ABE; Thu, 19 Feb 2015 17:03:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JH3EHR075760; Thu, 19 Feb 2015 17:03:14 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JH3ENt075759; Thu, 19 Feb 2015 17:03:14 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502191703.t1JH3ENt075759@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 19 Feb 2015 17:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279013 - 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 17:03:14 -0000 Author: glebius Date: Thu Feb 19 17:03:13 2015 New Revision: 279013 URL: https://svnweb.freebsd.org/changeset/base/279013 Log: Use KTR_COMPILE=(KTR_ALL) for LINTs, to get more code coverage. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Feb 19 16:34:48 2015 (r279012) +++ head/sys/conf/NOTES Thu Feb 19 17:03:13 2015 (r279013) @@ -495,7 +495,7 @@ options KTRACE_REQUEST_POOL=101 options KTR options KTR_BOOT_ENTRIES=1024 options KTR_ENTRIES=(128*1024) -options KTR_COMPILE=(KTR_INTR|KTR_PROC) +options KTR_COMPILE=(KTR_ALL) options KTR_MASK=KTR_INTR options KTR_CPUMASK=0x3 options KTR_VERBOSE From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 18:47:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA8A03E3; Thu, 19 Feb 2015 18:47:22 +0000 (UTC) Received: from mail-wg0-x236.google.com (mail-wg0-x236.google.com [IPv6:2a00:1450:400c:c00::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 46C3CF30; Thu, 19 Feb 2015 18:47:22 +0000 (UTC) Received: by mail-wg0-f54.google.com with SMTP id y19so8914184wgg.13; Thu, 19 Feb 2015 10:47:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=TwwLCAaXZjzbVgHakinZSmbaR0a+dNMpMzlGOvFGLDw=; b=pnoIYcNworpxZ0tCqnB3gugOG7dBvad51wmA6Em+uymlncknGdYJyToEcyud/UrC2m RFQznWnxbIOM6nLDfcLzETihKnc8lYOSroC/EDxnRO2BJ+5PZfoOF1el6zELQhw7uWZi mQHCeKWeGOincJt6uyS7ePV9hUwG88Nk8If5miptwbQxrVGu3ZHXy30BqFkyxUA4J8/D mUz07rQ3Eb4DcO1F9+vSkYkFpf0wMJrrUV8UZ7V1eN7ThYXFj8n33R9qp5PIjlZqtKRt xDgvTJGEi/S9C+xtoU4ac86RMGLfCGcssaOR/Qmz7kiM+G+ompHmBkUM/eo748aR+cWU nmGQ== X-Received: by 10.180.76.133 with SMTP id k5mr17639190wiw.30.1424371640837; Thu, 19 Feb 2015 10:47:20 -0800 (PST) Received: from [172.16.1.30] (150.Red-81-39-62.dynamicIP.rima-tde.net. [81.39.62.150]) by mx.google.com with ESMTPSA id pp10sm38578748wjc.31.2015.02.19.10.47.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Feb 2015 10:47:19 -0800 (PST) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Message-ID: <54E62FB6.6050800@FreeBSD.org> Date: Thu, 19 Feb 2015 19:47:18 +0100 From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278977 - in head/sys: dev/cxgb dev/cxgb/sys dev/cxgb/ulp/tom dev/xen/netfront sys References: <201502190119.t1J1JhSI025601@svn.freebsd.org> In-Reply-To: <201502190119.t1J1JhSI025601@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 19 Feb 2015 18:47:22 -0000 El 19/02/15 a les 2.19, Gleb Smirnoff ha escrit: > Author: glebius > Date: Thu Feb 19 01:19:42 2015 > New Revision: 278977 > URL: https://svnweb.freebsd.org/changeset/base/278977 > > Log: > Provide a set of inline functions to manage simple mbuf(9) queues, based > on queue(3)'s STAILQ. Utilize them in cxgb(4) and Xen, deleting home > grown implementations. > > Sponsored by: Netflix > Sponsored by: Nginx, Inc. Have you tested this commit on Xen? I'm getting the following: xn0: at device/vif/0 on xenbusb_front0 xn0: Ethernet address: 00:16:3e:51:85:e3 xenbusb_back0: on xenstore0 xbd0: Back-end specified ring-pages of 15 is not a power of 2. Limited to 8. xn0: backend features: feature-sg feature-gso-tcp4 panic: no mbufs processed cpuid = 0 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe007adc3920 vpanic() at vpanic+0x189/frame 0xfffffe007adc39a0 kassert_panic() at kassert_panic+0x132/frame 0xfffffe007adc3a10 network_alloc_rx_buffers() at network_alloc_rx_buffers+0x439/frame 0xfffffe007adc3ac0 network_connect() at network_connect+0xac1/frame 0xfffffe007adc3b50 netfront_backend_changed() at netfront_backend_changed+0xed/frame 0xfffffe007adc3b90 xenwatch_thread() at xenwatch_thread+0x1a2/frame 0xfffffe007adc3bb0 fork_exit() at fork_exit+0x84/frame 0xfffffe007adc3bf0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe007adc3bf0 --- trap 0, rip = 0, rsp = 0xfffffe007adc3cb0, rbp = 0 --- KDB: enter: panic [ thread pid 15 tid 100038 ] Stopped at kdb_enter+0x3e: movq $0,kdb_why Full boot dmesg attached below. /boot/kernel/kernel text=0x1026770 data=0x12cb20+0x3faf70 syms=[0x8+0x147270+0x8+0x162fd8] Booting... GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2015 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 11.0-CURRENT #0: Thu Feb 19 19:14:10 CET 2015 root@:/usr/obj/usr/src/sys/GENERIC amd64 FreeBSD clang version 3.5.1 (tags/RELEASE_351/final 225668) 20150115 WARNING: WITNESS option enabled, expect reduced performance. VT: running with driver "vga". XEN: Hypervisor version 4.6 detected. CPU: Intel(R) Xeon(R) CPU W3550 @ 3.07GHz (3066.84-MHz K8-class CPU) Origin="GenuineIntel" Id=0x106a5 Family=0x6 Model=0x1a Stepping=5 Features=0x1783fbff Features2=0x81b82201 AMD Features=0x20100800 AMD Features2=0x1 Hypervisor: Origin = "XenVMMXenVMM" real memory = 2139095040 (2040 MB) avail memory = 2031947776 (1937 MB) Event timer "LAPIC" quality 400 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs FreeBSD/SMP: 1 package(s) x 8 core(s) cpu0 (BSP): APIC ID: 0 cpu1 (AP): APIC ID: 2 cpu2 (AP): APIC ID: 4 cpu3 (AP): APIC ID: 6 cpu4 (AP): APIC ID: 8 cpu5 (AP): APIC ID: 10 cpu6 (AP): APIC ID: 12 cpu7 (AP): APIC ID: 14 ioapic0: Changing APIC ID to 1 MADT: Forcing active-low polarity and level trigger for SCI ioapic0 irqs 0-47 on motherboard random: entropy device infrastructure driver random: selecting highest priority adaptor kbd1 at kbdmux0 netmap: loaded module random: SOFT: yarrow init() random: selecting highest priority adaptor module_register_init: MOD_LOAD (vesa, 0xffffffff80dde720, 0) error 19 vtvga0: on motherboard xenpv0: on motherboard granttable0: on xenpv0 xen_et0: on xenpv0 Event timer "XENTIMER" frequency 1000000000 Hz quality 950 Timecounter "XENTIMER" frequency 1000000000 Hz quality 950 xenstore0: on xenpv0 evtchn0: on xenpv0 privcmd0: on xenpv0 isa0: on xenpv0 acpi0: on motherboard acpi0: Power Button (fixed) acpi0: Sleep Button (fixed) acpi0: reservation of 0, a0000 (3) failed cpu0: on acpi0 cpu1: on acpi0 cpu2: on acpi0 cpu3: on acpi0 cpu4: on acpi0 cpu5: on acpi0 cpu6: on acpi0 cpu7: on acpi0 hpet0: iomem 0xfed00000-0xfed003ff on acpi0 Timecounter "HPET" frequency 62500000 Hz quality 950 attimer0: port 0x40-0x43 irq 0 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 atrtc0: port 0x70-0x71 irq 8 on acpi0 Event timer "RTC" frequency 32768 Hz quality 0 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <32-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 isab0: at device 1.0 on pci0 device_attach: isab0 attach returned 6 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xc200-0xc20f at device 1.1 on pci0 ata0: at channel 0 on atapci0 ata1: at channel 1 on atapci0 pci0: at device 1.3 (no driver attached) xenpci0: port 0xc000-0xc0ff mem 0xf2000000-0xf2ffffff irq 24 at device 2.0 on pci0 vgapci0: mem 0xf0000000-0xf1ffffff,0xf3050000-0xf3050fff at device 3.0 on pci0 vgapci0: Boot video device atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] psm0: irq 12 on atkbdc0 psm0: [GIANT-LOCKED] psm0: model IntelliMouse Explorer, device ID 4 fdc0: port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0 fdc0: does not respond device_attach: fdc0 attach returned 6 uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 uart0: console (115200,n,8,1) qpi0: on motherboard orm0: at iomem 0xef000-0xeffff on isa0 vga0: at port 0x3b0-0x3bb iomem 0xb0000-0xb7fff on isa0 fdc0: No FDOUT register! ppc0: cannot reserve I/O port range Timecounters tick every 1.000 msec xenballoon0: on xenstore0 xctrl0: on xenstore0 xs_dev0: on xenstore0 xenbusb_front0: on xenstore0 xenbusb_add_device: Device device/suspend/event-channel ignored. State 6 xn0: at device/vif/0 on xenbusb_front0 xn0: Ethernet address: 00:16:3e:51:85:e3 xenbusb_back0: on xenstore0 xbd0: Back-end specified ring-pages of 15 is not a power of 2. Limited to 8. xn0: backend features: feature-sg feature-gso-tcp4 panic: no mbufs processed cpuid = 0 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe007adc3920 vpanic() at vpanic+0x189/frame 0xfffffe007adc39a0 kassert_panic() at kassert_panic+0x132/frame 0xfffffe007adc3a10 network_alloc_rx_buffers() at network_alloc_rx_buffers+0x439/frame 0xfffffe007adc3ac0 network_connect() at network_connect+0xac1/frame 0xfffffe007adc3b50 netfront_backend_changed() at netfront_backend_changed+0xed/frame 0xfffffe007adc3b90 xenwatch_thread() at xenwatch_thread+0x1a2/frame 0xfffffe007adc3bb0 fork_exit() at fork_exit+0x84/frame 0xfffffe007adc3bf0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe007adc3bf0 --- trap 0, rip = 0, rsp = 0xfffffe007adc3cb0, rbp = 0 --- KDB: enter: panic [ thread pid 15 tid 100038 ] Stopped at kdb_enter+0x3e: movq $0,kdb_why From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 18:56:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4C265F0; Thu, 19 Feb 2015 18:56:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B015D9E; Thu, 19 Feb 2015 18:56:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JIue3Q030717; Thu, 19 Feb 2015 18:56:40 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JIue20030716; Thu, 19 Feb 2015 18:56:40 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201502191856.t1JIue20030716@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 19 Feb 2015 18:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279016 - head/usr.sbin/syslogd 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 18:56:40 -0000 Author: ed Date: Thu Feb 19 18:56:39 2015 New Revision: 279016 URL: https://svnweb.freebsd.org/changeset/base/279016 Log: Make syslogd work in case shutdown() is POSIX-ly correct. On POSIX conformant systems, shutdown() should return ENOTCONN when not connected. We attempted to fix this once (kern/84761), but this change got backed out because it 'breaks code' (r150155). I just reapplied the patch and indeed, syslogd fails on startup. Make it easier to re-enable this change in the future by paching up syslogd to do the right thing. MFC after: 3 weeks Sponsored by: Nuxi Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Thu Feb 19 17:47:42 2015 (r279015) +++ head/usr.sbin/syslogd/syslogd.c Thu Feb 19 18:56:39 2015 (r279016) @@ -557,7 +557,8 @@ main(int argc, char *argv[]) if (finet) { if (SecureMode) { for (i = 0; i < *finet; i++) { - if (shutdown(finet[i+1], SHUT_RD) < 0) { + if (shutdown(finet[i+1], SHUT_RD) < 0 && + errno != ENOTCONN) { logerror("shutdown"); if (!Debug) die(0); From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 19:36:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0574634B; Thu, 19 Feb 2015 19:36:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 CA5DB76A; Thu, 19 Feb 2015 19:36:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JJasgS051782; Thu, 19 Feb 2015 19:36:54 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JJas0P051781; Thu, 19 Feb 2015 19:36:54 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502191936.t1JJas0P051781@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 19 Feb 2015 19:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279017 - head/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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 19:36:55 -0000 Author: glebius Date: Thu Feb 19 19:36:54 2015 New Revision: 279017 URL: https://svnweb.freebsd.org/changeset/base/279017 Log: Burn bridges to FreeBSD 7.x IGMP stats. Modified: head/usr.bin/netstat/inet.c Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Thu Feb 19 18:56:39 2015 (r279016) +++ head/usr.bin/netstat/inet.c Thu Feb 19 19:36:54 2015 (r279017) @@ -1093,47 +1093,6 @@ icmp_stats(u_long off, const char *name, } } -#ifndef BURN_BRIDGES -/* - * Dump IGMP statistics structure (pre 8.x kernel). - */ -static void -igmp_stats_live_old(const char *name) -{ - struct oigmpstat oigmpstat, zerostat; - size_t len = sizeof(oigmpstat); - - if (zflag) - memset(&zerostat, 0, len); - if (sysctlbyname("net.inet.igmp.stats", &oigmpstat, &len, - zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - warn("sysctl: net.inet.igmp.stats"); - return; - } - - printf("%s:\n", name); - -#define p(f, m) if (oigmpstat.f || sflag <= 1) \ - printf(m, oigmpstat.f, plural(oigmpstat.f)) -#define py(f, m) if (oigmpstat.f || sflag <= 1) \ - printf(m, oigmpstat.f, oigmpstat.f != 1 ? "ies" : "y") - p(igps_rcv_total, "\t%u message%s received\n"); - p(igps_rcv_tooshort, "\t%u message%s received with too few bytes\n"); - p(igps_rcv_badsum, "\t%u message%s received with bad checksum\n"); - py(igps_rcv_queries, "\t%u membership quer%s received\n"); - py(igps_rcv_badqueries, - "\t%u membership quer%s received with invalid field(s)\n"); - p(igps_rcv_reports, "\t%u membership report%s received\n"); - p(igps_rcv_badreports, - "\t%u membership report%s received with invalid field(s)\n"); - p(igps_rcv_ourreports, -"\t%u membership report%s received for groups to which we belong\n"); - p(igps_snd_reports, "\t%u membership report%s sent\n"); -#undef p -#undef py -} -#endif /* !BURN_BRIDGES */ - /* * Dump IGMP statistics structure. */ @@ -1143,27 +1102,6 @@ igmp_stats(u_long off, const char *name, struct igmpstat igmpstat, zerostat; size_t len; -#ifndef BURN_BRIDGES - if (live) { - /* - * Detect if we are being run against a pre-IGMPv3 kernel. - * We cannot do this for a core file as the legacy - * struct igmpstat has no size field, nor does it - * export it in any readily-available symbols. - */ - len = 0; - if (sysctlbyname("net.inet.igmp.stats", NULL, &len, NULL, - 0) < 0) { - warn("sysctl: net.inet.igmp.stats"); - return; - } - if (len < sizeof(igmpstat)) { - igmp_stats_live_old(name); - return; - } - } -#endif /* !BURN_BRIDGES */ - len = sizeof(igmpstat); if (live) { if (zflag) From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 19:53:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A4443EA; Thu, 19 Feb 2015 19:53:04 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A3042970; Thu, 19 Feb 2015 19:53:02 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1JJqxjs081413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 19 Feb 2015 22:52:59 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1JJqxCF081412; Thu, 19 Feb 2015 22:52:59 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 19 Feb 2015 22:52:59 +0300 From: Gleb Smirnoff To: Roger Pau =?iso-8859-1?Q?Monn=E9?= Subject: Re: svn commit: r278977 - in head/sys: dev/cxgb dev/cxgb/sys dev/cxgb/ulp/tom dev/xen/netfront sys Message-ID: <20150219195259.GJ15484@FreeBSD.org> References: <201502190119.t1J1JhSI025601@svn.freebsd.org> <54E62FB6.6050800@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <54E62FB6.6050800@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 19 Feb 2015 19:53:04 -0000 On Thu, Feb 19, 2015 at 07:47:18PM +0100, Roger Pau Monné wrote: R> El 19/02/15 a les 2.19, Gleb Smirnoff ha escrit: R> > Author: glebius R> > Date: Thu Feb 19 01:19:42 2015 R> > New Revision: 278977 R> > URL: https://svnweb.freebsd.org/changeset/base/278977 R> > R> > Log: R> > Provide a set of inline functions to manage simple mbuf(9) queues, based R> > on queue(3)'s STAILQ. Utilize them in cxgb(4) and Xen, deleting home R> > grown implementations. R> > R> > Sponsored by: Netflix R> > Sponsored by: Nginx, Inc. R> R> Have you tested this commit on Xen? I'm getting the following: R> R> xn0: at device/vif/0 on xenbusb_front0 R> xn0: Ethernet address: 00:16:3e:51:85:e3 R> xenbusb_back0: on xenstore0 R> xbd0: Back-end specified ring-pages of 15 is not a power of 2. Limited to 8. R> xn0: backend features: feature-sg feature-gso-tcp4 R> panic: no mbufs processed R> cpuid = 0 R> KDB: stack backtrace: R> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe007adc3920 R> vpanic() at vpanic+0x189/frame 0xfffffe007adc39a0 R> kassert_panic() at kassert_panic+0x132/frame 0xfffffe007adc3a10 R> network_alloc_rx_buffers() at network_alloc_rx_buffers+0x439/frame 0xfffffe007adc3ac0 R> network_connect() at network_connect+0xac1/frame 0xfffffe007adc3b50 R> netfront_backend_changed() at netfront_backend_changed+0xed/frame 0xfffffe007adc3b90 R> xenwatch_thread() at xenwatch_thread+0x1a2/frame 0xfffffe007adc3bb0 R> fork_exit() at fork_exit+0x84/frame 0xfffffe007adc3bf0 R> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe007adc3bf0 R> --- trap 0, rip = 0, rsp = 0xfffffe007adc3cb0, rbp = 0 --- R> KDB: enter: panic R> [ thread pid 15 tid 100038 ] R> Stopped at kdb_enter+0x3e: movq $0,kdb_why Have you got the core? If yes, please do in the network_alloc_rx_buffers() frame: p sc->xn_rx_batch -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 20:03:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 320A3BB7; Thu, 19 Feb 2015 20:03:00 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A8ED5AA3; Thu, 19 Feb 2015 20:02:59 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1JK2vOx081544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 19 Feb 2015 23:02:57 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1JK2vrT081543; Thu, 19 Feb 2015 23:02:57 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 19 Feb 2015 23:02:57 +0300 From: Gleb Smirnoff To: Roger Pau =?iso-8859-1?Q?Monn=E9?= Subject: Re: svn commit: r278977 - in head/sys: dev/cxgb dev/cxgb/sys dev/cxgb/ulp/tom dev/xen/netfront sys Message-ID: <20150219200257.GK15484@FreeBSD.org> References: <201502190119.t1J1JhSI025601@svn.freebsd.org> <54E62FB6.6050800@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="fjEAjMKpll6GDq3U" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <54E62FB6.6050800@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 19 Feb 2015 20:03:00 -0000 --fjEAjMKpll6GDq3U Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Thu, Feb 19, 2015 at 07:47:18PM +0100, Roger Pau Monné wrote: R> El 19/02/15 a les 2.19, Gleb Smirnoff ha escrit: R> > Author: glebius R> > Date: Thu Feb 19 01:19:42 2015 R> > New Revision: 278977 R> > URL: https://svnweb.freebsd.org/changeset/base/278977 R> > R> > Log: R> > Provide a set of inline functions to manage simple mbuf(9) queues, based R> > on queue(3)'s STAILQ. Utilize them in cxgb(4) and Xen, deleting home R> > grown implementations. R> > R> > Sponsored by: Netflix R> > Sponsored by: Nginx, Inc. R> R> Have you tested this commit on Xen? I'm getting the following: R> R> xn0: at device/vif/0 on xenbusb_front0 R> xn0: Ethernet address: 00:16:3e:51:85:e3 R> xenbusb_back0: on xenstore0 R> xbd0: Back-end specified ring-pages of 15 is not a power of 2. Limited to 8. R> xn0: backend features: feature-sg feature-gso-tcp4 R> panic: no mbufs processed R> cpuid = 0 R> KDB: stack backtrace: R> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe007adc3920 R> vpanic() at vpanic+0x189/frame 0xfffffe007adc39a0 R> kassert_panic() at kassert_panic+0x132/frame 0xfffffe007adc3a10 R> network_alloc_rx_buffers() at network_alloc_rx_buffers+0x439/frame 0xfffffe007adc3ac0 R> network_connect() at network_connect+0xac1/frame 0xfffffe007adc3b50 R> netfront_backend_changed() at netfront_backend_changed+0xed/frame 0xfffffe007adc3b90 R> xenwatch_thread() at xenwatch_thread+0x1a2/frame 0xfffffe007adc3bb0 R> fork_exit() at fork_exit+0x84/frame 0xfffffe007adc3bf0 R> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe007adc3bf0 R> --- trap 0, rip = 0, rsp = 0xfffffe007adc3cb0, rbp = 0 --- R> KDB: enter: panic R> [ thread pid 15 tid 100038 ] R> Stopped at kdb_enter+0x3e: movq $0,kdb_why I guess the problem is that the queue limit isn't initialized. Please try the attached patch. The problem with older mbufq was that it doesn't have any sane limit on it. So, converting to new, I simply put INT_MAX, which is ugly. I'd appreciate if you fix mbufq_init()s in netfront.c to some appropriate values. -- Totus tuus, Glebius. --fjEAjMKpll6GDq3U Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="netfront.c.diff" Index: netfront.c =================================================================== --- netfront.c (revision 279017) +++ netfront.c (working copy) @@ -2062,6 +2062,9 @@ create_netdev(device_t dev) np->rx_mbufs[i] = NULL; np->grant_rx_ref[i] = GRANT_REF_INVALID; } + + mbufq_init(&np->xn_rx_batch, INT_MAX); + /* A grant for every tx ring slot */ if (gnttab_alloc_grant_references(NET_TX_RING_SIZE, &np->gref_tx_head) != 0) { --fjEAjMKpll6GDq3U-- From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 20:15:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFD592A2; Thu, 19 Feb 2015 20:15:04 +0000 (UTC) Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com [IPv6:2607:f8b0:400e:c03::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 75EC7C23; Thu, 19 Feb 2015 20:15:04 +0000 (UTC) Received: by pabkx10 with SMTP id kx10so2261703pab.0; Thu, 19 Feb 2015 12:15:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=MgLHwC9Q9Z0yxCn5+dTFo87zCQMzzkGZoAbFbCKTTIg=; b=Qshi1aQy9qsFqt2S5U4OQKdd9J2DSbxTJUs/5zlIr5AsvlZ4wRbFAr4gG6cA29ySD0 v/QLwgwbB6p/RYnmXjX/ixbTQ4UxA54H1zZ26A1K9VlwJXTqpAgQJ5iSIbagYZCxNcvm 9wmh3yK11rWIqMbtPGOEanO9SFeA0Dl3BjmhHaDTMFWq1WpJrwug7fx8O4NbiqTkNI4c fd/zvlXs+JlgArj84k1J540r3s81ylfCg2PT32WdSi9KyGpYdFq8Hv8boestK+GXUvFM oKIfcWoe/hoRWBfyb0AcetUHWBv4yQbu0H/Nlqx+D/zzVKJCuf7GQ77r6TY8GdSnGJVq 10xQ== X-Received: by 10.66.233.74 with SMTP id tu10mr10462322pac.135.1424376903952; Thu, 19 Feb 2015 12:15:03 -0800 (PST) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id bw3sm24599062pbb.9.2015.02.19.12.15.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Feb 2015 12:15:02 -0800 (PST) Sender: Navdeep Parhar Message-ID: <54E64444.8030506@FreeBSD.org> Date: Thu, 19 Feb 2015 12:15:00 -0800 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Gleb Smirnoff , =?windows-1252?Q?Roger_Pau_M?= =?windows-1252?Q?onn=E9?= Subject: Re: svn commit: r278977 - in head/sys: dev/cxgb dev/cxgb/sys dev/cxgb/ulp/tom dev/xen/netfront sys References: <201502190119.t1J1JhSI025601@svn.freebsd.org> <54E62FB6.6050800@FreeBSD.org> <20150219200257.GK15484@FreeBSD.org> In-Reply-To: <20150219200257.GK15484@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 19 Feb 2015 20:15:04 -0000 On 02/19/15 12:02, Gleb Smirnoff wrote: > On Thu, Feb 19, 2015 at 07:47:18PM +0100, Roger Pau Monn=E9 wrote: > R> El 19/02/15 a les 2.19, Gleb Smirnoff ha escrit: > R> > Author: glebius > R> > Date: Thu Feb 19 01:19:42 2015 > R> > New Revision: 278977 > R> > URL: https://svnweb.freebsd.org/changeset/base/278977 > R> > > R> > Log: > R> > Provide a set of inline functions to manage simple mbuf(9) queue= s, based > R> > on queue(3)'s STAILQ. Utilize them in cxgb(4) and Xen, deleting= home > R> > grown implementations. > R> > > R> > Sponsored by: Netflix > R> > Sponsored by: Nginx, Inc. > R> > R> Have you tested this commit on Xen? I'm getting the following: > R> > R> xn0: at device/vif/0 on xenbusb_front0 > R> xn0: Ethernet address: 00:16:3e:51:85:e3 > R> xenbusb_back0: on xenstore0 > R> xbd0: Back-end specified ring-pages of 15 is not a power of 2. Limit= ed to 8. > R> xn0: backend features: feature-sg feature-gso-tcp4 > R> panic: no mbufs processed > R> cpuid =3D 0 > R> KDB: stack backtrace: > R> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe= 007adc3920 > R> vpanic() at vpanic+0x189/frame 0xfffffe007adc39a0 > R> kassert_panic() at kassert_panic+0x132/frame 0xfffffe007adc3a10 > R> network_alloc_rx_buffers() at network_alloc_rx_buffers+0x439/frame 0= xfffffe007adc3ac0 > R> network_connect() at network_connect+0xac1/frame 0xfffffe007adc3b50 > R> netfront_backend_changed() at netfront_backend_changed+0xed/frame 0x= fffffe007adc3b90 > R> xenwatch_thread() at xenwatch_thread+0x1a2/frame 0xfffffe007adc3bb0 > R> fork_exit() at fork_exit+0x84/frame 0xfffffe007adc3bf0 > R> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe007adc3bf0 > R> --- trap 0, rip =3D 0, rsp =3D 0xfffffe007adc3cb0, rbp =3D 0 --- > R> KDB: enter: panic > R> [ thread pid 15 tid 100038 ] > R> Stopped at kdb_enter+0x3e: movq $0,kdb_why > > I guess the problem is that the queue limit isn't initialized. Please > try the attached patch. > > The problem with older mbufq was that it doesn't have any sane limit > on it. So, converting to new, I simply put INT_MAX, which is ugly. Is mq_len supposed to count the number of mbufs in the mbufq? Then it=20 doesn't work for m_next linked chains. It pretends to enforce a cap on=20 the number of mbufs in the mbufq while doing no such thing. If it's not = trying to count the number of mbufs then I'd like to know exactly what=20 it does? Regards, Navdeep > > I'd appreciate if you fix mbufq_init()s in netfront.c to some appropria= te > values. > From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 20:22:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A643F5E2; Thu, 19 Feb 2015 20:22:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 919F4D0D; Thu, 19 Feb 2015 20:22:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JKMVdF077599; Thu, 19 Feb 2015 20:22:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JKMVu7077598; Thu, 19 Feb 2015 20:22:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502192022.t1JKMVu7077598@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 19 Feb 2015 20:22:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279018 - 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 20:22:31 -0000 Author: imp Date: Thu Feb 19 20:22:30 2015 New Revision: 279018 URL: https://svnweb.freebsd.org/changeset/base/279018 Log: Only disable gvn on clang 3.5 and newer. Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Thu Feb 19 19:36:54 2015 (r279017) +++ head/share/mk/bsd.sys.mk Thu Feb 19 20:22:30 2015 (r279018) @@ -118,7 +118,10 @@ CWARNFLAGS+= -Wno-unknown-pragmas CLANG_NO_IAS= -no-integrated-as .endif CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\ - -mllvm -simplifycfg-dup-ret -mllvm -enable-gvn=false + -mllvm -simplifycfg-dup-ret -mllvm +.if ${COMPILER_VERSION} > 30400 +CLANG_OPT_SMALL+= -enable-gvn=false +.endif CFLAGS.clang+= -Qunused-arguments .if ${MACHINE_CPUARCH} == "sparc64" # Don't emit .cfi directives, since we must use GNU as on sparc64, for now. From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 20:36:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28BA9B10; Thu, 19 Feb 2015 20:36:39 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B9553E70; Thu, 19 Feb 2015 20:36:38 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1JKaYR2081734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 19 Feb 2015 23:36:34 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1JKaYsV081733; Thu, 19 Feb 2015 23:36:34 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 19 Feb 2015 23:36:34 +0300 From: Gleb Smirnoff To: Navdeep Parhar Subject: Re: svn commit: r278977 - in head/sys: dev/cxgb dev/cxgb/sys dev/cxgb/ulp/tom dev/xen/netfront sys Message-ID: <20150219203634.GL15484@FreeBSD.org> References: <201502190119.t1J1JhSI025601@svn.freebsd.org> <54E62FB6.6050800@FreeBSD.org> <20150219200257.GK15484@FreeBSD.org> <54E64444.8030506@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <54E64444.8030506@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Roger Pau =?iso-8859-1?Q?Monn=E9?= , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 19 Feb 2015 20:36:39 -0000 On Thu, Feb 19, 2015 at 12:15:00PM -0800, Navdeep Parhar wrote: N> On 02/19/15 12:02, Gleb Smirnoff wrote: N> > On Thu, Feb 19, 2015 at 07:47:18PM +0100, Roger Pau Monné wrote: N> > R> El 19/02/15 a les 2.19, Gleb Smirnoff ha escrit: N> > R> > Author: glebius N> > R> > Date: Thu Feb 19 01:19:42 2015 N> > R> > New Revision: 278977 N> > R> > URL: https://svnweb.freebsd.org/changeset/base/278977 N> > R> > N> > R> > Log: N> > R> > Provide a set of inline functions to manage simple mbuf(9) queues, based N> > R> > on queue(3)'s STAILQ. Utilize them in cxgb(4) and Xen, deleting home N> > R> > grown implementations. N> > R> > N> > R> > Sponsored by: Netflix N> > R> > Sponsored by: Nginx, Inc. N> > R> N> > R> Have you tested this commit on Xen? I'm getting the following: N> > R> N> > R> xn0: at device/vif/0 on xenbusb_front0 N> > R> xn0: Ethernet address: 00:16:3e:51:85:e3 N> > R> xenbusb_back0: on xenstore0 N> > R> xbd0: Back-end specified ring-pages of 15 is not a power of 2. Limited to 8. N> > R> xn0: backend features: feature-sg feature-gso-tcp4 N> > R> panic: no mbufs processed N> > R> cpuid = 0 N> > R> KDB: stack backtrace: N> > R> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe007adc3920 N> > R> vpanic() at vpanic+0x189/frame 0xfffffe007adc39a0 N> > R> kassert_panic() at kassert_panic+0x132/frame 0xfffffe007adc3a10 N> > R> network_alloc_rx_buffers() at network_alloc_rx_buffers+0x439/frame 0xfffffe007adc3ac0 N> > R> network_connect() at network_connect+0xac1/frame 0xfffffe007adc3b50 N> > R> netfront_backend_changed() at netfront_backend_changed+0xed/frame 0xfffffe007adc3b90 N> > R> xenwatch_thread() at xenwatch_thread+0x1a2/frame 0xfffffe007adc3bb0 N> > R> fork_exit() at fork_exit+0x84/frame 0xfffffe007adc3bf0 N> > R> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe007adc3bf0 N> > R> --- trap 0, rip = 0, rsp = 0xfffffe007adc3cb0, rbp = 0 --- N> > R> KDB: enter: panic N> > R> [ thread pid 15 tid 100038 ] N> > R> Stopped at kdb_enter+0x3e: movq $0,kdb_why N> > N> > I guess the problem is that the queue limit isn't initialized. Please N> > try the attached patch. N> > N> > The problem with older mbufq was that it doesn't have any sane limit N> > on it. So, converting to new, I simply put INT_MAX, which is ugly. N> N> Is mq_len supposed to count the number of mbufs in the mbufq? Then it N> doesn't work for m_next linked chains. It pretends to enforce a cap on N> the number of mbufs in the mbufq while doing no such thing. If it's not N> trying to count the number of mbufs then I'd like to know exactly what N> it does? It counts number of packets. As it did the same in the previous version of mbufq. And as it did in struct ifqueue. So, new mbufq doesn't bring any new functionality, it converges what two copies of mbufq.h and one copy of ifq.h did. I am not against adding new features to it, if anyone wishes to. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 21:47:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50351A90; Thu, 19 Feb 2015 21:47:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3B3DA8B4; Thu, 19 Feb 2015 21:47:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JLlWo7017779; Thu, 19 Feb 2015 21:47:32 GMT (envelope-from bhd@FreeBSD.org) Received: (from bhd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JLlW0V017778; Thu, 19 Feb 2015 21:47:32 GMT (envelope-from bhd@FreeBSD.org) Message-Id: <201502192147.t1JLlW0V017778@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bhd set sender to bhd@FreeBSD.org using -f From: Bjoern Heidottin Date: Thu, 19 Feb 2015 21:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279024 - head/share/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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 21:47:32 -0000 Author: bhd (doc committer) Date: Thu Feb 19 21:47:31 2015 New Revision: 279024 URL: https://svnweb.freebsd.org/changeset/base/279024 Log: Add myself to committers-doc.dot Approved by: bcr (mentor) Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Thu Feb 19 21:10:01 2015 (r279023) +++ head/share/misc/committers-doc.dot Thu Feb 19 21:47:31 2015 (r279024) @@ -53,6 +53,7 @@ node [color=lightblue2, style=filled, bg ale [label="Alex Dupre\nale@FreeBSD.org\n2003/12/22"] allanjude [label="Allan Jude\nallanjude@FreeBSD.org\n2014/05/17"] bcr [label="Benedict Reuschling\nbcr@FreeBSD.org\n2009/12/24"] +bhd [label="Björn Heidotting\nbhd@FreeBSD.org\n2014/10/14"] blackend [label="Marc Fonvieille\nblackend@FreeBSD.org\n2002/06/16"] brd [label="Brad Davis\nbrd@FreeBSD.org\n2005/06/01"] brueffer [label="Christian Brueffer\nbrueffer@FreeBSD.org\n2003/01/13"] @@ -102,6 +103,7 @@ bcr -> dru bcr -> crees bcr -> jgh bcr -> allanjude +bcr -> bhd blackend -> ale From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 22:35:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 617479CF; Thu, 19 Feb 2015 22:35:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4B1A0E0F; Thu, 19 Feb 2015 22:35:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JMZOGq041376; Thu, 19 Feb 2015 22:35:24 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JMZOwl041373; Thu, 19 Feb 2015 22:35:24 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502192235.t1JMZOwl041373@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 19 Feb 2015 22:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279026 - 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 22:35:25 -0000 Author: glebius Date: Thu Feb 19 22:35:23 2015 New Revision: 279026 URL: https://svnweb.freebsd.org/changeset/base/279026 Log: - Rename 'struct igmp_ifinfo' into 'struct igmp_ifsoftc', since it really represents a context. - Preserve name 'struct igmp_ifinfo' for a new structure, that will be stable API between userland and kernel. - Make sysctl_igmp_ifinfo() return the new 'struct igmp_ifinfo', instead of old one, which had a bunch of internal kernel structures in it. - Move all above declarations from in_var.h to igmp_var.h, since they are private to IGMP code. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/netinet/igmp.c head/sys/netinet/igmp_var.h head/sys/netinet/in_var.h Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Thu Feb 19 22:20:19 2015 (r279025) +++ head/sys/netinet/igmp.c Thu Feb 19 22:35:23 2015 (r279026) @@ -84,15 +84,15 @@ __FBSDID("$FreeBSD$"); #define KTR_IGMPV3 KTR_INET #endif -static struct igmp_ifinfo * +static struct igmp_ifsoftc * igi_alloc_locked(struct ifnet *); static void igi_delete_locked(const struct ifnet *); static void igmp_dispatch_queue(struct mbufq *, int, const int); static void igmp_fasttimo_vnet(void); -static void igmp_final_leave(struct in_multi *, struct igmp_ifinfo *); +static void igmp_final_leave(struct in_multi *, struct igmp_ifsoftc *); static int igmp_handle_state_change(struct in_multi *, - struct igmp_ifinfo *); -static int igmp_initial_join(struct in_multi *, struct igmp_ifinfo *); + struct igmp_ifsoftc *); +static int igmp_initial_join(struct in_multi *, struct igmp_ifsoftc *); static int igmp_input_v1_query(struct ifnet *, const struct ip *, const struct igmp *); static int igmp_input_v2_query(struct ifnet *, const struct ip *, @@ -100,7 +100,7 @@ static int igmp_input_v2_query(struct if static int igmp_input_v3_query(struct ifnet *, const struct ip *, /*const*/ struct igmpv3 *); static int igmp_input_v3_group_query(struct in_multi *, - struct igmp_ifinfo *, int, /*const*/ struct igmpv3 *); + struct igmp_ifsoftc *, int, /*const*/ struct igmpv3 *); static int igmp_input_v1_report(struct ifnet *, /*const*/ struct ip *, /*const*/ struct igmp *); static int igmp_input_v2_report(struct ifnet *, /*const*/ struct ip *, @@ -112,21 +112,21 @@ static struct mbuf * #ifdef KTR static char * igmp_rec_type_to_str(const int); #endif -static void igmp_set_version(struct igmp_ifinfo *, const int); +static void igmp_set_version(struct igmp_ifsoftc *, const int); static void igmp_slowtimo_vnet(void); static int igmp_v1v2_queue_report(struct in_multi *, const int); static void igmp_v1v2_process_group_timer(struct in_multi *, const int); -static void igmp_v1v2_process_querier_timers(struct igmp_ifinfo *); +static void igmp_v1v2_process_querier_timers(struct igmp_ifsoftc *); static void igmp_v2_update_group(struct in_multi *, const int); -static void igmp_v3_cancel_link_timers(struct igmp_ifinfo *); -static void igmp_v3_dispatch_general_query(struct igmp_ifinfo *); +static void igmp_v3_cancel_link_timers(struct igmp_ifsoftc *); +static void igmp_v3_dispatch_general_query(struct igmp_ifsoftc *); static struct mbuf * igmp_v3_encap_report(struct ifnet *, struct mbuf *); static int igmp_v3_enqueue_group_record(struct mbufq *, struct in_multi *, const int, const int, const int); static int igmp_v3_enqueue_filter_change(struct mbufq *, struct in_multi *); -static void igmp_v3_process_group_timers(struct igmp_ifinfo *, +static void igmp_v3_process_group_timers(struct igmp_ifsoftc *, struct mbufq *, struct mbufq *, struct in_multi *, const int); static int igmp_v3_merge_state_changes(struct in_multi *, @@ -158,13 +158,13 @@ static const struct netisr_handler igmp_ * * All output is delegated to the netisr. * Now that Giant has been eliminated, the netisr may be inlined. * * IN_MULTI_LOCK covers in_multi. - * * IGMP_LOCK covers igmp_ifinfo and any global variables in this file, + * * IGMP_LOCK covers igmp_ifsoftc and any global variables in this file, * including the output queue. * * IF_ADDR_LOCK covers if_multiaddrs, which is used for a variety of * per-link state iterators. - * * igmp_ifinfo is valid as long as PF_INET is attached to the interface, + * * igmp_ifsoftc is valid as long as PF_INET is attached to the interface, * therefore it is not refcounted. - * We allow unlocked reads of igmp_ifinfo when accessed via in_multi. + * We allow unlocked reads of igmp_ifsoftc when accessed via in_multi. * * Reference counting * * IGMP acquires its own reference every time an in_multi is passed to @@ -219,7 +219,7 @@ static VNET_DEFINE(int, current_state_ti #define V_state_change_timers_running VNET(state_change_timers_running) #define V_current_state_timers_running VNET(current_state_timers_running) -static VNET_DEFINE(LIST_HEAD(, igmp_ifinfo), igi_head); +static VNET_DEFINE(LIST_HEAD(, igmp_ifsoftc), igi_head); static VNET_DEFINE(struct igmpstat, igmpstat) = { .igps_version = IGPS_VERSION_3, .igps_len = sizeof(struct igmpstat), @@ -412,7 +412,7 @@ out_locked: } /* - * Expose struct igmp_ifinfo to userland, keyed by ifindex. + * Expose struct igmp_ifsoftc to userland, keyed by ifindex. * For use by ifmcstat(8). * * SMPng: NOTE: Does an unlocked ifindex space read. @@ -426,7 +426,7 @@ sysctl_igmp_ifinfo(SYSCTL_HANDLER_ARGS) int error; u_int namelen; struct ifnet *ifp; - struct igmp_ifinfo *igi; + struct igmp_ifsoftc *igi; name = (int *)arg1; namelen = arg2; @@ -457,8 +457,18 @@ sysctl_igmp_ifinfo(SYSCTL_HANDLER_ARGS) LIST_FOREACH(igi, &V_igi_head, igi_link) { if (ifp == igi->igi_ifp) { - error = SYSCTL_OUT(req, igi, - sizeof(struct igmp_ifinfo)); + struct igmp_ifinfo info; + + info.igi_version = igi->igi_version; + info.igi_v1_timer = igi->igi_v1_timer; + info.igi_v2_timer = igi->igi_v2_timer; + info.igi_v3_timer = igi->igi_v3_timer; + info.igi_flags = igi->igi_flags; + info.igi_rv = igi->igi_rv; + info.igi_qi = igi->igi_qi; + info.igi_qri = igi->igi_qri; + info.igi_uri = igi->igi_uri; + error = SYSCTL_OUT(req, &info, sizeof(info)); break; } } @@ -536,10 +546,10 @@ igmp_ra_alloc(void) /* * Attach IGMP when PF_INET is attached to an interface. */ -struct igmp_ifinfo * +struct igmp_ifsoftc * igmp_domifattach(struct ifnet *ifp) { - struct igmp_ifinfo *igi; + struct igmp_ifsoftc *igi; CTR3(KTR_IGMPV3, "%s: called for ifp %p(%s)", __func__, ifp, ifp->if_xname); @@ -558,14 +568,14 @@ igmp_domifattach(struct ifnet *ifp) /* * VIMAGE: assume curvnet set by caller. */ -static struct igmp_ifinfo * +static struct igmp_ifsoftc * igi_alloc_locked(/*const*/ struct ifnet *ifp) { - struct igmp_ifinfo *igi; + struct igmp_ifsoftc *igi; IGMP_LOCK_ASSERT(); - igi = malloc(sizeof(struct igmp_ifinfo), M_IGMP, M_NOWAIT|M_ZERO); + igi = malloc(sizeof(struct igmp_ifsoftc), M_IGMP, M_NOWAIT|M_ZERO); if (igi == NULL) goto out; @@ -581,7 +591,7 @@ igi_alloc_locked(/*const*/ struct ifnet LIST_INSERT_HEAD(&V_igi_head, igi, igi_link); - CTR2(KTR_IGMPV3, "allocate igmp_ifinfo for ifp %p(%s)", + CTR2(KTR_IGMPV3, "allocate igmp_ifsoftc for ifp %p(%s)", ifp, ifp->if_xname); out: @@ -600,7 +610,7 @@ out: void igmp_ifdetach(struct ifnet *ifp) { - struct igmp_ifinfo *igi; + struct igmp_ifsoftc *igi; struct ifmultiaddr *ifma; struct in_multi *inm, *tinm; @@ -647,7 +657,7 @@ igmp_ifdetach(struct ifnet *ifp) void igmp_domifdetach(struct ifnet *ifp) { - struct igmp_ifinfo *igi; + struct igmp_ifsoftc *igi; CTR3(KTR_IGMPV3, "%s: called for ifp %p(%s)", __func__, ifp, ifp->if_xname); @@ -663,9 +673,9 @@ igmp_domifdetach(struct ifnet *ifp) static void igi_delete_locked(const struct ifnet *ifp) { - struct igmp_ifinfo *igi, *tigi; + struct igmp_ifsoftc *igi, *tigi; - CTR3(KTR_IGMPV3, "%s: freeing igmp_ifinfo for ifp %p(%s)", + CTR3(KTR_IGMPV3, "%s: freeing igmp_ifsoftc for ifp %p(%s)", __func__, ifp, ifp->if_xname); IGMP_LOCK_ASSERT(); @@ -689,7 +699,7 @@ igi_delete_locked(const struct ifnet *if } #ifdef INVARIANTS - panic("%s: igmp_ifinfo not found for ifp %p\n", __func__, ifp); + panic("%s: igmp_ifsoftc not found for ifp %p\n", __func__, ifp); #endif } @@ -704,7 +714,7 @@ igmp_input_v1_query(struct ifnet *ifp, c const struct igmp *igmp) { struct ifmultiaddr *ifma; - struct igmp_ifinfo *igi; + struct igmp_ifsoftc *igi; struct in_multi *inm; /* @@ -724,7 +734,7 @@ igmp_input_v1_query(struct ifnet *ifp, c IGMP_LOCK(); igi = ((struct in_ifinfo *)ifp->if_afdata[AF_INET])->ii_igmp; - KASSERT(igi != NULL, ("%s: no igmp_ifinfo for ifp %p", __func__, ifp)); + KASSERT(igi != NULL, ("%s: no igmp_ifsoftc for ifp %p", __func__, ifp)); if (igi->igi_flags & IGIF_LOOPBACK) { CTR2(KTR_IGMPV3, "ignore v1 query on IGIF_LOOPBACK ifp %p(%s)", @@ -789,7 +799,7 @@ igmp_input_v2_query(struct ifnet *ifp, c const struct igmp *igmp) { struct ifmultiaddr *ifma; - struct igmp_ifinfo *igi; + struct igmp_ifsoftc *igi; struct in_multi *inm; int is_general_query; uint16_t timer; @@ -818,7 +828,7 @@ igmp_input_v2_query(struct ifnet *ifp, c IGMP_LOCK(); igi = ((struct in_ifinfo *)ifp->if_afdata[AF_INET])->ii_igmp; - KASSERT(igi != NULL, ("%s: no igmp_ifinfo for ifp %p", __func__, ifp)); + KASSERT(igi != NULL, ("%s: no igmp_ifsoftc for ifp %p", __func__, ifp)); if (igi->igi_flags & IGIF_LOOPBACK) { CTR2(KTR_IGMPV3, "ignore v2 query on IGIF_LOOPBACK ifp %p(%s)", @@ -939,7 +949,7 @@ static int igmp_input_v3_query(struct ifnet *ifp, const struct ip *ip, /*const*/ struct igmpv3 *igmpv3) { - struct igmp_ifinfo *igi; + struct igmp_ifsoftc *igi; struct in_multi *inm; int is_general_query; uint32_t maxresp, nsrc, qqi; @@ -1012,7 +1022,7 @@ igmp_input_v3_query(struct ifnet *ifp, c IGMP_LOCK(); igi = ((struct in_ifinfo *)ifp->if_afdata[AF_INET])->ii_igmp; - KASSERT(igi != NULL, ("%s: no igmp_ifinfo for ifp %p", __func__, ifp)); + KASSERT(igi != NULL, ("%s: no igmp_ifsoftc for ifp %p", __func__, ifp)); if (igi->igi_flags & IGIF_LOOPBACK) { CTR2(KTR_IGMPV3, "ignore v3 query on IGIF_LOOPBACK ifp %p(%s)", @@ -1100,7 +1110,7 @@ out_locked: * Return <0 if any error occured. Currently this is ignored. */ static int -igmp_input_v3_group_query(struct in_multi *inm, struct igmp_ifinfo *igi, +igmp_input_v3_group_query(struct in_multi *inm, struct igmp_ifsoftc *igi, int timer, /*const*/ struct igmpv3 *igmpv3) { int retval; @@ -1245,7 +1255,7 @@ igmp_input_v1_report(struct ifnet *ifp, IN_MULTI_LOCK(); inm = inm_lookup(ifp, igmp->igmp_group); if (inm != NULL) { - struct igmp_ifinfo *igi; + struct igmp_ifsoftc *igi; igi = inm->inm_igi; if (igi == NULL) { @@ -1369,7 +1379,7 @@ igmp_input_v2_report(struct ifnet *ifp, IN_MULTI_LOCK(); inm = inm_lookup(ifp, igmp->igmp_group); if (inm != NULL) { - struct igmp_ifinfo *igi; + struct igmp_ifsoftc *igi; igi = inm->inm_igi; KASSERT(igi != NULL, ("%s: no igi for ifp %p", __func__, ifp)); @@ -1638,7 +1648,7 @@ igmp_fasttimo_vnet(void) struct mbufq scq; /* State-change packets */ struct mbufq qrq; /* Query response packets */ struct ifnet *ifp; - struct igmp_ifinfo *igi; + struct igmp_ifsoftc *igi; struct ifmultiaddr *ifma; struct in_multi *inm; int loop, uri_fasthz; @@ -1796,7 +1806,7 @@ igmp_v1v2_process_group_timer(struct in_ * Note: Unlocked read from igi. */ static void -igmp_v3_process_group_timers(struct igmp_ifinfo *igi, +igmp_v3_process_group_timers(struct igmp_ifsoftc *igi, struct mbufq *qrq, struct mbufq *scq, struct in_multi *inm, const int uri_fasthz) { @@ -1943,7 +1953,7 @@ igmp_v3_suppress_group_record(struct in_ * as per Section 7.2.1. */ static void -igmp_set_version(struct igmp_ifinfo *igi, const int version) +igmp_set_version(struct igmp_ifsoftc *igi, const int version) { int old_version_timer; @@ -1992,7 +2002,7 @@ igmp_set_version(struct igmp_ifinfo *igi * query processing. */ static void -igmp_v3_cancel_link_timers(struct igmp_ifinfo *igi) +igmp_v3_cancel_link_timers(struct igmp_ifsoftc *igi) { struct ifmultiaddr *ifma; struct ifnet *ifp; @@ -2073,7 +2083,7 @@ igmp_v3_cancel_link_timers(struct igmp_i * See Section 7.2.1 of RFC 3376. */ static void -igmp_v1v2_process_querier_timers(struct igmp_ifinfo *igi) +igmp_v1v2_process_querier_timers(struct igmp_ifsoftc *igi) { IGMP_LOCK_ASSERT(); @@ -2169,7 +2179,7 @@ igmp_slowtimo(void) static void igmp_slowtimo_vnet(void) { - struct igmp_ifinfo *igi; + struct igmp_ifsoftc *igi; IGMP_LOCK(); @@ -2265,7 +2275,7 @@ igmp_v1v2_queue_report(struct in_multi * int igmp_change_state(struct in_multi *inm) { - struct igmp_ifinfo *igi; + struct igmp_ifsoftc *igi; struct ifnet *ifp; int error; @@ -2288,7 +2298,7 @@ igmp_change_state(struct in_multi *inm) IGMP_LOCK(); igi = ((struct in_ifinfo *)ifp->if_afdata[AF_INET])->ii_igmp; - KASSERT(igi != NULL, ("%s: no igmp_ifinfo for ifp %p", __func__, ifp)); + KASSERT(igi != NULL, ("%s: no igmp_ifsoftc for ifp %p", __func__, ifp)); /* * If we detect a state transition to or from MCAST_UNDEFINED @@ -2329,7 +2339,7 @@ out_locked: * initial state of the membership. */ static int -igmp_initial_join(struct in_multi *inm, struct igmp_ifinfo *igi) +igmp_initial_join(struct in_multi *inm, struct igmp_ifsoftc *igi) { struct ifnet *ifp; struct mbufq *mq; @@ -2457,7 +2467,7 @@ igmp_initial_join(struct in_multi *inm, * Issue an intermediate state change during the IGMP life-cycle. */ static int -igmp_handle_state_change(struct in_multi *inm, struct igmp_ifinfo *igi) +igmp_handle_state_change(struct in_multi *inm, struct igmp_ifsoftc *igi) { struct ifnet *ifp; int retval; @@ -2516,7 +2526,7 @@ igmp_handle_state_change(struct in_multi * to INCLUDE {} for immediate transmission. */ static void -igmp_final_leave(struct in_multi *inm, struct igmp_ifinfo *igi) +igmp_final_leave(struct in_multi *inm, struct igmp_ifsoftc *igi) { int syncstates; @@ -3308,7 +3318,7 @@ igmp_v3_merge_state_changes(struct in_mu * Respond to a pending IGMPv3 General Query. */ static void -igmp_v3_dispatch_general_query(struct igmp_ifinfo *igi) +igmp_v3_dispatch_general_query(struct igmp_ifsoftc *igi) { struct ifmultiaddr *ifma; struct ifnet *ifp; Modified: head/sys/netinet/igmp_var.h ============================================================================== --- head/sys/netinet/igmp_var.h Thu Feb 19 22:20:19 2015 (r279025) +++ head/sys/netinet/igmp_var.h Thu Feb 19 22:35:23 2015 (r279026) @@ -46,24 +46,6 @@ * MULTICAST Revision: 3.5.1.3 */ -#ifndef BURN_BRIDGES -/* - * Pre-IGMPV3 igmpstat structure. - */ -struct oigmpstat { - u_int igps_rcv_total; /* total IGMP messages received */ - u_int igps_rcv_tooshort; /* received with too few bytes */ - u_int igps_rcv_badsum; /* received with bad checksum */ - u_int igps_rcv_queries; /* received membership queries */ - u_int igps_rcv_badqueries; /* received invalid queries */ - u_int igps_rcv_reports; /* received membership reports */ - u_int igps_rcv_badreports; /* received invalid reports */ - u_int igps_rcv_ourreports; /* received reports for our groups */ - u_int igps_snd_reports; /* sent membership reports */ - u_int igps_rcv_toolong; /* received with too many bytes */ -}; -#endif - /* * IGMPv3 protocol statistics. */ @@ -105,19 +87,16 @@ struct igmpstat { }; #define IGPS_VERSION_3 3 /* as of FreeBSD 8.x */ #define IGPS_VERSION3_LEN 168 - -#ifdef _KERNEL -#define IGMPSTAT_ADD(name, val) V_igmpstat.name += (val) -#define IGMPSTAT_INC(name) IGMPSTAT_ADD(name, 1) -#endif - #ifdef CTASSERT -CTASSERT(sizeof(struct igmpstat) == 168); +CTASSERT(sizeof(struct igmpstat) == IGPS_VERSION3_LEN); #endif -#ifdef _KERNEL -#define IGMP_RANDOM_DELAY(X) (random() % (X) + 1) +/* + * Identifiers for IGMP sysctl nodes + */ +#define IGMPCTL_STATS 1 /* statistics (read-only) */ +#define IGMP_RANDOM_DELAY(X) (random() % (X) + 1) #define IGMP_MAX_STATE_CHANGES 24 /* Max pending changes per group */ /* @@ -186,6 +165,27 @@ CTASSERT(sizeof(struct igmpstat) == 168) (sizeof(struct ip) + RAOPT_LEN + sizeof(struct igmp_report)) /* + * Structure returned by net.inet.igmp.ifinfo sysctl. + */ +struct igmp_ifinfo { + uint32_t igi_version; /* IGMPv3 Host Compatibility Mode */ + uint32_t igi_v1_timer; /* IGMPv1 Querier Present timer (s) */ + uint32_t igi_v2_timer; /* IGMPv2 Querier Present timer (s) */ + uint32_t igi_v3_timer; /* IGMPv3 General Query (interface) timer (s)*/ + uint32_t igi_flags; /* IGMP per-interface flags */ +#define IGIF_SILENT 0x00000001 /* Do not use IGMP on this ifp */ +#define IGIF_LOOPBACK 0x00000002 /* Send IGMP reports to loopback */ + uint32_t igi_rv; /* IGMPv3 Robustness Variable */ + uint32_t igi_qi; /* IGMPv3 Query Interval (s) */ + uint32_t igi_qri; /* IGMPv3 Query Response Interval (s) */ + uint32_t igi_uri; /* IGMPv3 Unsolicited Report Interval (s) */ +}; + +#ifdef _KERNEL +#define IGMPSTAT_ADD(name, val) V_igmpstat.name += (val) +#define IGMPSTAT_INC(name) IGMPSTAT_ADD(name, 1) + +/* * Subsystem lock macros. * The IGMP lock is only taken with IGMP. Currently it is system-wide. * VIMAGE: The lock could be pushed to per-VIMAGE granularity in future. @@ -197,11 +197,28 @@ CTASSERT(sizeof(struct igmpstat) == 168) #define IGMP_UNLOCK() mtx_unlock(&igmp_mtx) #define IGMP_UNLOCK_ASSERT() mtx_assert(&igmp_mtx, MA_NOTOWNED) -struct igmp_ifinfo; +/* + * Per-interface IGMP router version information. + */ +struct igmp_ifsoftc { + LIST_ENTRY(igmp_ifsoftc) igi_link; + struct ifnet *igi_ifp; /* pointer back to interface */ + uint32_t igi_version; /* IGMPv3 Host Compatibility Mode */ + uint32_t igi_v1_timer; /* IGMPv1 Querier Present timer (s) */ + uint32_t igi_v2_timer; /* IGMPv2 Querier Present timer (s) */ + uint32_t igi_v3_timer; /* IGMPv3 General Query (interface) timer (s)*/ + uint32_t igi_flags; /* IGMP per-interface flags */ + uint32_t igi_rv; /* IGMPv3 Robustness Variable */ + uint32_t igi_qi; /* IGMPv3 Query Interval (s) */ + uint32_t igi_qri; /* IGMPv3 Query Response Interval (s) */ + uint32_t igi_uri; /* IGMPv3 Unsolicited Report Interval (s) */ + SLIST_HEAD(,in_multi) igi_relinmhead; /* released groups */ + struct mbufq igi_gq; /* general query responses queue */ +}; int igmp_change_state(struct in_multi *); void igmp_fasttimo(void); -struct igmp_ifinfo * +struct igmp_ifsoftc * igmp_domifattach(struct ifnet *); void igmp_domifdetach(struct ifnet *); void igmp_ifdetach(struct ifnet *); @@ -211,10 +228,4 @@ void igmp_slowtimo(void); SYSCTL_DECL(_net_inet_igmp); #endif /* _KERNEL */ - -/* - * Identifiers for IGMP sysctl nodes - */ -#define IGMPCTL_STATS 1 /* statistics (read-only) */ - #endif Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Thu Feb 19 22:20:19 2015 (r279025) +++ head/sys/netinet/in_var.h Thu Feb 19 22:35:23 2015 (r279026) @@ -37,7 +37,7 @@ #include #include -struct igmp_ifinfo; +struct igmp_ifsoftc; struct in_multi; struct lltable; @@ -46,7 +46,7 @@ struct lltable; */ struct in_ifinfo { struct lltable *ii_llt; /* ARP state */ - struct igmp_ifinfo *ii_igmp; /* IGMP state */ + struct igmp_ifsoftc *ii_igmp; /* IGMP state */ struct in_multi *ii_allhosts; /* 224.0.0.1 membership */ }; @@ -194,28 +194,6 @@ struct router_info { }; /* - * Per-interface IGMP router version information. - */ -struct igmp_ifinfo { - LIST_ENTRY(igmp_ifinfo) igi_link; - struct ifnet *igi_ifp; /* interface this instance belongs to */ - uint32_t igi_version; /* IGMPv3 Host Compatibility Mode */ - uint32_t igi_v1_timer; /* IGMPv1 Querier Present timer (s) */ - uint32_t igi_v2_timer; /* IGMPv2 Querier Present timer (s) */ - uint32_t igi_v3_timer; /* IGMPv3 General Query (interface) timer (s)*/ - uint32_t igi_flags; /* IGMP per-interface flags */ - uint32_t igi_rv; /* IGMPv3 Robustness Variable */ - uint32_t igi_qi; /* IGMPv3 Query Interval (s) */ - uint32_t igi_qri; /* IGMPv3 Query Response Interval (s) */ - uint32_t igi_uri; /* IGMPv3 Unsolicited Report Interval (s) */ - SLIST_HEAD(,in_multi) igi_relinmhead; /* released groups */ - struct mbufq igi_gq; /* queue of general query responses */ -}; - -#define IGIF_SILENT 0x00000001 /* Do not use IGMP on this ifp */ -#define IGIF_LOOPBACK 0x00000002 /* Send IGMP reports to loopback */ - -/* * IPv4 multicast IGMP-layer source entry. */ struct ip_msource { @@ -293,7 +271,7 @@ struct in_multi { u_int inm_refcount; /* reference count */ /* New fields for IGMPv3 follow. */ - struct igmp_ifinfo *inm_igi; /* IGMP info */ + struct igmp_ifsoftc *inm_igi; /* IGMP info */ SLIST_ENTRY(in_multi) inm_nrele; /* to-be-released by IGMP */ struct ip_msource_tree inm_srcs; /* tree of sources */ u_long inm_nsrc; /* # of tree entries */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 22:37:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6972FB42; Thu, 19 Feb 2015 22:37:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 531B5E33; Thu, 19 Feb 2015 22:37:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JMb378041630; Thu, 19 Feb 2015 22:37:03 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JMb2G3041626; Thu, 19 Feb 2015 22:37:02 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502192237.t1JMb2G3041626@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 19 Feb 2015 22:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279027 - 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 22:37:03 -0000 Author: glebius Date: Thu Feb 19 22:37:01 2015 New Revision: 279027 URL: https://svnweb.freebsd.org/changeset/base/279027 Log: - Rename 'struct mld_ifinfo' into 'struct mld_ifsoftc', since it really represents a context. - Preserve name 'struct mld_ifinfo' for a new structure, that will be stable API between userland and kernel. - Make sysctl_mld_ifinfo() return the new 'struct mld_ifinfo', instead of old one, which had a bunch of internal kernel structures in it. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/netinet6/in6_var.h head/sys/netinet6/mld6.c head/sys/netinet6/mld6_var.h Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Thu Feb 19 22:35:23 2015 (r279026) +++ head/sys/netinet6/in6_var.h Thu Feb 19 22:37:01 2015 (r279027) @@ -97,7 +97,7 @@ struct in6_addrlifetime { struct nd_ifinfo; struct scope6_id; struct lltable; -struct mld_ifinfo; +struct mld_ifsoftc; struct in6_ifextra { counter_u64_t *in6_ifstat; @@ -105,7 +105,7 @@ struct in6_ifextra { struct nd_ifinfo *nd_ifinfo; struct scope6_id *scope6_id; struct lltable *lltable; - struct mld_ifinfo *mld_ifinfo; + struct mld_ifsoftc *mld_ifinfo; }; #define LLTABLE6(ifp) (((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->lltable) @@ -646,7 +646,7 @@ struct in6_multi { u_int in6m_timer; /* MLD6 listener report timer */ /* New fields for MLDv2 follow. */ - struct mld_ifinfo *in6m_mli; /* MLD info */ + struct mld_ifsoftc *in6m_mli; /* MLD info */ SLIST_ENTRY(in6_multi) in6m_nrele; /* to-be-released by MLD */ struct ip6_msource_tree in6m_srcs; /* tree of sources */ u_long in6m_nsrc; /* # of tree entries */ Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Thu Feb 19 22:35:23 2015 (r279026) +++ head/sys/netinet6/mld6.c Thu Feb 19 22:37:01 2015 (r279027) @@ -102,33 +102,33 @@ __FBSDID("$FreeBSD$"); #define KTR_MLD KTR_INET6 #endif -static struct mld_ifinfo * +static struct mld_ifsoftc * mli_alloc_locked(struct ifnet *); static void mli_delete_locked(const struct ifnet *); static void mld_dispatch_packet(struct mbuf *); static void mld_dispatch_queue(struct mbufq *, int); -static void mld_final_leave(struct in6_multi *, struct mld_ifinfo *); +static void mld_final_leave(struct in6_multi *, struct mld_ifsoftc *); static void mld_fasttimo_vnet(void); static int mld_handle_state_change(struct in6_multi *, - struct mld_ifinfo *); -static int mld_initial_join(struct in6_multi *, struct mld_ifinfo *, + struct mld_ifsoftc *); +static int mld_initial_join(struct in6_multi *, struct mld_ifsoftc *, const int); #ifdef KTR static char * mld_rec_type_to_str(const int); #endif -static void mld_set_version(struct mld_ifinfo *, const int); +static void mld_set_version(struct mld_ifsoftc *, const int); static void mld_slowtimo_vnet(void); static int mld_v1_input_query(struct ifnet *, const struct ip6_hdr *, /*const*/ struct mld_hdr *); static int mld_v1_input_report(struct ifnet *, const struct ip6_hdr *, /*const*/ struct mld_hdr *); -static void mld_v1_process_group_timer(struct mld_ifinfo *, +static void mld_v1_process_group_timer(struct mld_ifsoftc *, struct in6_multi *); -static void mld_v1_process_querier_timers(struct mld_ifinfo *); +static void mld_v1_process_querier_timers(struct mld_ifsoftc *); static int mld_v1_transmit_report(struct in6_multi *, const int); static void mld_v1_update_group(struct in6_multi *, const int); -static void mld_v2_cancel_link_timers(struct mld_ifinfo *); -static void mld_v2_dispatch_general_query(struct mld_ifinfo *); +static void mld_v2_cancel_link_timers(struct mld_ifsoftc *); +static void mld_v2_dispatch_general_query(struct mld_ifsoftc *); static struct mbuf * mld_v2_encap_report(struct ifnet *, struct mbuf *); static int mld_v2_enqueue_filter_change(struct mbufq *, @@ -140,11 +140,11 @@ static int mld_v2_input_query(struct ifn struct mbuf *, const int, const int); static int mld_v2_merge_state_changes(struct in6_multi *, struct mbufq *); -static void mld_v2_process_group_timers(struct mld_ifinfo *, +static void mld_v2_process_group_timers(struct mld_ifsoftc *, struct mbufq *, struct mbufq *, struct in6_multi *, const int); static int mld_v2_process_group_query(struct in6_multi *, - struct mld_ifinfo *mli, int, struct mbuf *, const int); + struct mld_ifsoftc *mli, int, struct mbuf *, const int); static int sysctl_mld_gsr(SYSCTL_HANDLER_ARGS); static int sysctl_mld_ifinfo(SYSCTL_HANDLER_ARGS); @@ -206,7 +206,7 @@ static MALLOC_DEFINE(M_MLD, "mld", "mld * VIMAGE-wide globals. */ static VNET_DEFINE(struct timeval, mld_gsrdelay) = {10, 0}; -static VNET_DEFINE(LIST_HEAD(, mld_ifinfo), mli_head); +static VNET_DEFINE(LIST_HEAD(, mld_ifsoftc), mli_head); static VNET_DEFINE(int, interface_timers_running6); static VNET_DEFINE(int, state_change_timers_running6); static VNET_DEFINE(int, current_state_timers_running6); @@ -344,7 +344,7 @@ out_locked: } /* - * Expose struct mld_ifinfo to userland, keyed by ifindex. + * Expose struct mld_ifsoftc to userland, keyed by ifindex. * For use by ifmcstat(8). * * SMPng: NOTE: Does an unlocked ifindex space read. @@ -358,7 +358,7 @@ sysctl_mld_ifinfo(SYSCTL_HANDLER_ARGS) int error; u_int namelen; struct ifnet *ifp; - struct mld_ifinfo *mli; + struct mld_ifsoftc *mli; name = (int *)arg1; namelen = arg2; @@ -389,8 +389,17 @@ sysctl_mld_ifinfo(SYSCTL_HANDLER_ARGS) LIST_FOREACH(mli, &V_mli_head, mli_link) { if (ifp == mli->mli_ifp) { - error = SYSCTL_OUT(req, mli, - sizeof(struct mld_ifinfo)); + struct mld_ifinfo info; + + info.mli_version = mli->mli_version; + info.mli_v1_timer = mli->mli_v1_timer; + info.mli_v2_timer = mli->mli_v2_timer; + info.mli_flags = mli->mli_flags; + info.mli_rv = mli->mli_rv; + info.mli_qi = mli->mli_qi; + info.mli_qri = mli->mli_qri; + info.mli_uri = mli->mli_uri; + error = SYSCTL_OUT(req, &info, sizeof(info)); break; } } @@ -454,10 +463,10 @@ mld_is_addr_reported(const struct in6_ad * * SMPng: Normally called with IF_AFDATA_LOCK held. */ -struct mld_ifinfo * +struct mld_ifsoftc * mld_domifattach(struct ifnet *ifp) { - struct mld_ifinfo *mli; + struct mld_ifsoftc *mli; CTR3(KTR_MLD, "%s: called for ifp %p(%s)", __func__, ifp, if_name(ifp)); @@ -478,14 +487,14 @@ mld_domifattach(struct ifnet *ifp) /* * VIMAGE: assume curvnet set by caller. */ -static struct mld_ifinfo * +static struct mld_ifsoftc * mli_alloc_locked(/*const*/ struct ifnet *ifp) { - struct mld_ifinfo *mli; + struct mld_ifsoftc *mli; MLD_LOCK_ASSERT(); - mli = malloc(sizeof(struct mld_ifinfo), M_MLD, M_NOWAIT|M_ZERO); + mli = malloc(sizeof(struct mld_ifsoftc), M_MLD, M_NOWAIT|M_ZERO); if (mli == NULL) goto out; @@ -501,7 +510,7 @@ mli_alloc_locked(/*const*/ struct ifnet LIST_INSERT_HEAD(&V_mli_head, mli, mli_link); - CTR2(KTR_MLD, "allocate mld_ifinfo for ifp %p(%s)", + CTR2(KTR_MLD, "allocate mld_ifsoftc for ifp %p(%s)", ifp, if_name(ifp)); out: @@ -522,7 +531,7 @@ out: void mld_ifdetach(struct ifnet *ifp) { - struct mld_ifinfo *mli; + struct mld_ifsoftc *mli; struct ifmultiaddr *ifma; struct in6_multi *inm, *tinm; @@ -578,9 +587,9 @@ mld_domifdetach(struct ifnet *ifp) static void mli_delete_locked(const struct ifnet *ifp) { - struct mld_ifinfo *mli, *tmli; + struct mld_ifsoftc *mli, *tmli; - CTR3(KTR_MLD, "%s: freeing mld_ifinfo for ifp %p(%s)", + CTR3(KTR_MLD, "%s: freeing mld_ifsoftc for ifp %p(%s)", __func__, ifp, if_name(ifp)); MLD_LOCK_ASSERT(); @@ -603,7 +612,7 @@ mli_delete_locked(const struct ifnet *if } } #ifdef INVARIANTS - panic("%s: mld_ifinfo not found for ifp %p\n", __func__, ifp); + panic("%s: mld_ifsoftc not found for ifp %p\n", __func__, ifp); #endif } @@ -619,7 +628,7 @@ mld_v1_input_query(struct ifnet *ifp, co /*const*/ struct mld_hdr *mld) { struct ifmultiaddr *ifma; - struct mld_ifinfo *mli; + struct mld_ifsoftc *mli; struct in6_multi *inm; int is_general_query; uint16_t timer; @@ -678,7 +687,7 @@ mld_v1_input_query(struct ifnet *ifp, co * Switch to MLDv1 host compatibility mode. */ mli = MLD_IFINFO(ifp); - KASSERT(mli != NULL, ("%s: no mld_ifinfo for ifp %p", __func__, ifp)); + KASSERT(mli != NULL, ("%s: no mld_ifsoftc for ifp %p", __func__, ifp)); mld_set_version(mli, MLD_VERSION_1); timer = (ntohs(mld->mld_maxdelay) * PR_FASTHZ) / MLD_TIMER_SCALE; @@ -795,7 +804,7 @@ static int mld_v2_input_query(struct ifnet *ifp, const struct ip6_hdr *ip6, struct mbuf *m, const int off, const int icmp6len) { - struct mld_ifinfo *mli; + struct mld_ifsoftc *mli; struct mldv2_query *mld; struct in6_multi *inm; uint32_t maxdelay, nsrc, qqi; @@ -877,7 +886,7 @@ mld_v2_input_query(struct ifnet *ifp, co MLD_LOCK(); mli = MLD_IFINFO(ifp); - KASSERT(mli != NULL, ("%s: no mld_ifinfo for ifp %p", __func__, ifp)); + KASSERT(mli != NULL, ("%s: no mld_ifsoftc for ifp %p", __func__, ifp)); /* * Discard the v2 query if we're in Compatibility Mode. @@ -967,7 +976,7 @@ out_locked: * Return <0 if any error occured. Currently this is ignored. */ static int -mld_v2_process_group_query(struct in6_multi *inm, struct mld_ifinfo *mli, +mld_v2_process_group_query(struct in6_multi *inm, struct mld_ifsoftc *mli, int timer, struct mbuf *m0, const int off) { struct mldv2_query *mld; @@ -1171,7 +1180,7 @@ mld_v1_input_report(struct ifnet *ifp, c */ inm = in6m_lookup_locked(ifp, &mld->mld_addr); if (inm != NULL) { - struct mld_ifinfo *mli; + struct mld_ifsoftc *mli; mli = inm->in6m_mli; KASSERT(mli != NULL, @@ -1321,7 +1330,7 @@ mld_fasttimo_vnet(void) struct mbufq scq; /* State-change packets */ struct mbufq qrq; /* Query response packets */ struct ifnet *ifp; - struct mld_ifinfo *mli; + struct mld_ifsoftc *mli; struct ifmultiaddr *ifma; struct in6_multi *inm, *tinm; int uri_fasthz; @@ -1446,7 +1455,7 @@ out_locked: * Will update the global pending timer flags. */ static void -mld_v1_process_group_timer(struct mld_ifinfo *mli, struct in6_multi *inm) +mld_v1_process_group_timer(struct mld_ifsoftc *mli, struct in6_multi *inm) { int report_timer_expired; @@ -1490,7 +1499,7 @@ mld_v1_process_group_timer(struct mld_if * Note: Unlocked read from mli. */ static void -mld_v2_process_group_timers(struct mld_ifinfo *mli, +mld_v2_process_group_timers(struct mld_ifsoftc *mli, struct mbufq *qrq, struct mbufq *scq, struct in6_multi *inm, const int uri_fasthz) { @@ -1611,7 +1620,7 @@ mld_v2_process_group_timers(struct mld_i * as per Section 9.12. */ static void -mld_set_version(struct mld_ifinfo *mli, const int version) +mld_set_version(struct mld_ifsoftc *mli, const int version) { int old_version_timer; @@ -1641,7 +1650,7 @@ mld_set_version(struct mld_ifinfo *mli, * joined on it; state-change, general-query, and group-query timers. */ static void -mld_v2_cancel_link_timers(struct mld_ifinfo *mli) +mld_v2_cancel_link_timers(struct mld_ifsoftc *mli) { struct ifmultiaddr *ifma; struct ifnet *ifp; @@ -1734,7 +1743,7 @@ mld_slowtimo(void) static void mld_slowtimo_vnet(void) { - struct mld_ifinfo *mli; + struct mld_ifsoftc *mli; MLD_LOCK(); @@ -1750,7 +1759,7 @@ mld_slowtimo_vnet(void) * See Section 9.12 of RFC 3810. */ static void -mld_v1_process_querier_timers(struct mld_ifinfo *mli) +mld_v1_process_querier_timers(struct mld_ifsoftc *mli) { MLD_LOCK_ASSERT(); @@ -1866,7 +1875,7 @@ mld_v1_transmit_report(struct in6_multi int mld_change_state(struct in6_multi *inm, const int delay) { - struct mld_ifinfo *mli; + struct mld_ifsoftc *mli; struct ifnet *ifp; int error; @@ -1891,7 +1900,7 @@ mld_change_state(struct in6_multi *inm, MLD_LOCK(); mli = MLD_IFINFO(ifp); - KASSERT(mli != NULL, ("%s: no mld_ifinfo for ifp %p", __func__, ifp)); + KASSERT(mli != NULL, ("%s: no mld_ifsoftc for ifp %p", __func__, ifp)); /* * If we detect a state transition to or from MCAST_UNDEFINED @@ -1934,7 +1943,7 @@ out_locked: * initial state change for delay ticks (in units of PR_FASTHZ). */ static int -mld_initial_join(struct in6_multi *inm, struct mld_ifinfo *mli, +mld_initial_join(struct in6_multi *inm, struct mld_ifsoftc *mli, const int delay) { struct ifnet *ifp; @@ -2083,7 +2092,7 @@ mld_initial_join(struct in6_multi *inm, * Issue an intermediate state change during the life-cycle. */ static int -mld_handle_state_change(struct in6_multi *inm, struct mld_ifinfo *mli) +mld_handle_state_change(struct in6_multi *inm, struct mld_ifsoftc *mli) { struct ifnet *ifp; int retval; @@ -2147,7 +2156,7 @@ mld_handle_state_change(struct in6_multi * to INCLUDE {} for immediate transmission. */ static void -mld_final_leave(struct in6_multi *inm, struct mld_ifinfo *mli) +mld_final_leave(struct in6_multi *inm, struct mld_ifsoftc *mli) { int syncstates; #ifdef KTR @@ -2963,7 +2972,7 @@ mld_v2_merge_state_changes(struct in6_mu * Respond to a pending MLDv2 General Query. */ static void -mld_v2_dispatch_general_query(struct mld_ifinfo *mli) +mld_v2_dispatch_general_query(struct mld_ifsoftc *mli) { struct ifmultiaddr *ifma; struct ifnet *ifp; Modified: head/sys/netinet6/mld6_var.h ============================================================================== --- head/sys/netinet6/mld6_var.h Thu Feb 19 22:35:23 2015 (r279026) +++ head/sys/netinet6/mld6_var.h Thu Feb 19 22:37:01 2015 (r279027) @@ -35,31 +35,6 @@ * implementation-specific definitions. */ -#ifdef _KERNEL - -/* - * Per-link MLD state. - */ -struct mld_ifinfo { - LIST_ENTRY(mld_ifinfo) mli_link; - struct ifnet *mli_ifp; /* interface this instance belongs to */ - uint32_t mli_version; /* MLDv1 Host Compatibility Mode */ - uint32_t mli_v1_timer; /* MLDv1 Querier Present timer (s) */ - uint32_t mli_v2_timer; /* MLDv2 General Query (interface) timer (s)*/ - uint32_t mli_flags; /* MLD per-interface flags */ - uint32_t mli_rv; /* MLDv2 Robustness Variable */ - uint32_t mli_qi; /* MLDv2 Query Interval (s) */ - uint32_t mli_qri; /* MLDv2 Query Response Interval (s) */ - uint32_t mli_uri; /* MLDv2 Unsolicited Report Interval (s) */ - SLIST_HEAD(,in6_multi) mli_relinmhead; /* released groups */ - struct mbufq mli_gq; /* queue of general query responses */ -}; -#define MLIF_SILENT 0x00000001 /* Do not use MLD on this ifp */ -#define MLIF_USEALLOW 0x00000002 /* Use ALLOW/BLOCK for joins/leaves */ - -#define MLD_RANDOM_DELAY(X) (arc4random() % (X) + 1) -#define MLD_MAX_STATE_CHANGES 24 /* Max pending changes per group */ - /* * MLD per-group states. */ @@ -129,6 +104,44 @@ struct mld_ifinfo { sizeof(struct icmp6_hdr)) /* + * Structure returned by net.inet6.mld.ifinfo. + */ +struct mld_ifinfo { + uint32_t mli_version; /* MLDv1 Host Compatibility Mode */ + uint32_t mli_v1_timer; /* MLDv1 Querier Present timer (s) */ + uint32_t mli_v2_timer; /* MLDv2 General Query (interface) timer (s)*/ + uint32_t mli_flags; /* MLD per-interface flags */ +#define MLIF_SILENT 0x00000001 /* Do not use MLD on this ifp */ +#define MLIF_USEALLOW 0x00000002 /* Use ALLOW/BLOCK for joins/leaves */ + uint32_t mli_rv; /* MLDv2 Robustness Variable */ + uint32_t mli_qi; /* MLDv2 Query Interval (s) */ + uint32_t mli_qri; /* MLDv2 Query Response Interval (s) */ + uint32_t mli_uri; /* MLDv2 Unsolicited Report Interval (s) */ +}; + +#ifdef _KERNEL +/* + * Per-link MLD state. + */ +struct mld_ifsoftc { + LIST_ENTRY(mld_ifsoftc) mli_link; + struct ifnet *mli_ifp; /* interface this instance belongs to */ + uint32_t mli_version; /* MLDv1 Host Compatibility Mode */ + uint32_t mli_v1_timer; /* MLDv1 Querier Present timer (s) */ + uint32_t mli_v2_timer; /* MLDv2 General Query (interface) timer (s)*/ + uint32_t mli_flags; /* MLD per-interface flags */ + uint32_t mli_rv; /* MLDv2 Robustness Variable */ + uint32_t mli_qi; /* MLDv2 Query Interval (s) */ + uint32_t mli_qri; /* MLDv2 Query Response Interval (s) */ + uint32_t mli_uri; /* MLDv2 Unsolicited Report Interval (s) */ + SLIST_HEAD(,in6_multi) mli_relinmhead; /* released groups */ + struct mbufq mli_gq; /* queue of general query responses */ +}; + +#define MLD_RANDOM_DELAY(X) (arc4random() % (X) + 1) +#define MLD_MAX_STATE_CHANGES 24 /* Max pending changes per group */ + +/* * Subsystem lock macros. * The MLD lock is only taken with MLD. Currently it is system-wide. * VIMAGE: The lock could be pushed to per-VIMAGE granularity in future. @@ -147,7 +160,7 @@ struct mld_ifinfo { (((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->mld_ifinfo) int mld_change_state(struct in6_multi *, const int); -struct mld_ifinfo * +struct mld_ifsoftc * mld_domifattach(struct ifnet *); void mld_domifdetach(struct ifnet *); void mld_fasttimo(void); From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 22:42:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC515F81; Thu, 19 Feb 2015 22:42:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C71D8EF4; Thu, 19 Feb 2015 22:42:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JMgZ4s045924; Thu, 19 Feb 2015 22:42:35 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JMgY3e045902; Thu, 19 Feb 2015 22:42:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502192242.t1JMgY3e045902@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 19 Feb 2015 22:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279028 - in head/usr.sbin: . ifmcstat 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 22:42:36 -0000 Author: glebius Date: Thu Feb 19 22:42:33 2015 New Revision: 279028 URL: https://svnweb.freebsd.org/changeset/base/279028 Log: Now that IGMP and MLD sysctls provide a clean API structures that do not leak kernel internal stuff, reconnect ifmcstat(1) back to build. However, disable kvm(3) support in it, since it requires uncovering tons of _KERNEL defined declarations, which can be achieved either uncovering them globally or providing dirty hacks such as _WANT_IFADDR. If anyone demands an ifmcstat-like kvm-based tool, please take the code out of usr.sbin/ifmstat and create a tool in src/tools/tools. Modified: head/usr.sbin/Makefile head/usr.sbin/ifmcstat/Makefile head/usr.sbin/ifmcstat/ifmcstat.c Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Feb 19 22:37:01 2015 (r279027) +++ head/usr.sbin/Makefile Thu Feb 19 22:42:33 2015 (r279028) @@ -94,8 +94,6 @@ SUBDIR= adduser \ watchdogd \ zic -SUBDIR:= ${SUBDIR:Nifmcstat} - # NB: keep these sorted by MK_* knobs .if ${MK_ACCT} != "no" Modified: head/usr.sbin/ifmcstat/Makefile ============================================================================== --- head/usr.sbin/ifmcstat/Makefile Thu Feb 19 22:37:01 2015 (r279027) +++ head/usr.sbin/ifmcstat/Makefile Thu Feb 19 22:42:33 2015 (r279028) @@ -15,9 +15,4 @@ WARNS?= 2 CFLAGS+=-DINET6 .endif -.if ${MK_KVM_SUPPORT} != "no" -CFLAGS+=-DWITH_KVM -LIBADD= kvm -.endif - .include Modified: head/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.c Thu Feb 19 22:37:01 2015 (r279027) +++ head/usr.sbin/ifmcstat/ifmcstat.c Thu Feb 19 22:42:33 2015 (r279028) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define _WANT_IFADDR #include #include #include @@ -52,20 +51,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define KERNEL -# include -#undef KERNEL -#define _KERNEL -#define SYSCTL_DECL(x) -# include -#undef SYSCTL_DECL -#undef _KERNEL +#include +#include #ifdef INET6 #include -#define _KERNEL -# include -#undef _KERNEL +#include #endif /* INET6 */ #include @@ -82,14 +73,23 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include -#include #include #include -/* XXX: This file currently assumes INET and KVM support in the base system. */ +#ifdef KVM +/* + * Currently the KVM build is broken. To be fixed it requires uncovering + * large amount of _KERNEL code in include files, and it is also very + * tentative to internal kernel ABI changes. If anyone wishes to restore + * it, please move it out of src/usr.sbin to src/tools/tools. + */ +#include +#include +#endif + +/* XXX: This file currently assumes INET support in the base system. */ #ifndef INET #define INET #endif From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 23:14:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA23E88A; Thu, 19 Feb 2015 23:14:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A50282AD; Thu, 19 Feb 2015 23:14:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JNEaHj060507; Thu, 19 Feb 2015 23:14:36 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JNEaxn060505; Thu, 19 Feb 2015 23:14:36 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502192314.t1JNEaxn060505@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 19 Feb 2015 23:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279029 - head/contrib/ipfilter 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 23:14:36 -0000 Author: glebius Date: Thu Feb 19 23:14:35 2015 New Revision: 279029 URL: https://svnweb.freebsd.org/changeset/base/279029 Log: The ipftest(1) is a program that emulates ipf(4) operation and tests packets against rules. It definitely doesn't need to know about kernel internals, such as 'struct ifaddr'. What it does with ifaddr, is that it only takes ifa_addr member of it, and treats it as sockaddr, while it is only a pointer to sockaddr. Fortunately, sizeof(struct ifaddr) > sizeof(struct sockaddr_in6), so no problems arise. Fix that declaring a private struct ifaddr in ipftest(1) and stop including if_var.h. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/contrib/ipfilter/ip_fil.c head/contrib/ipfilter/ipf.h Modified: head/contrib/ipfilter/ip_fil.c ============================================================================== --- head/contrib/ipfilter/ip_fil.c Thu Feb 19 22:42:33 2015 (r279028) +++ head/contrib/ipfilter/ip_fil.c Thu Feb 19 23:14:35 2015 (r279029) @@ -44,6 +44,9 @@ static int write_output __P((struct ifne # endif #endif +struct ifaddr { + struct sockaddr_storage ifa_addr; +}; int ipfattach(softc) Modified: head/contrib/ipfilter/ipf.h ============================================================================== --- head/contrib/ipfilter/ipf.h Thu Feb 19 22:42:33 2015 (r279028) +++ head/contrib/ipfilter/ipf.h Thu Feb 19 23:14:35 2015 (r279029) @@ -43,9 +43,6 @@ struct file; #include #include -#define _WANT_IFADDR -#include - #include #include #include From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 23:16:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C39C5A05; Thu, 19 Feb 2015 23:16:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 ADC9F2E0; Thu, 19 Feb 2015 23:16:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JNGBll060794; Thu, 19 Feb 2015 23:16:11 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JNGALg060789; Thu, 19 Feb 2015 23:16:10 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502192316.t1JNGALg060789@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 19 Feb 2015 23:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279030 - 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 23:16:12 -0000 Author: glebius Date: Thu Feb 19 23:16:10 2015 New Revision: 279030 URL: https://svnweb.freebsd.org/changeset/base/279030 Log: Now that all users of _WANT_IFADDR are fixed, remove this crutch and hide ifaddr, in_ifaddr and in6_ifaddr under _KERNEL. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/if_var.h head/sys/netinet/in_var.h head/sys/netinet6/in6_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Feb 19 23:14:35 2015 (r279029) +++ head/sys/net/if_var.h Thu Feb 19 23:16:10 2015 (r279030) @@ -365,8 +365,6 @@ EVENTHANDLER_DECLARE(group_change_event, #define TOEDEV(ifp) ((ifp)->if_llsoftc) -#endif /* _KERNEL */ - /* * The ifaddr structure contains information about one address * of an interface. They are maintained by the different address families, @@ -377,7 +375,6 @@ EVENTHANDLER_DECLARE(group_change_event, * chunk of malloc'ed memory, where we store the three addresses * (ifa_addr, ifa_dstaddr and ifa_netmask) referenced here. */ -#if defined(_KERNEL) || defined(_WANT_IFADDR) struct ifaddr { struct sockaddr *ifa_addr; /* address of interface */ struct sockaddr *ifa_dstaddr; /* other end of p-to-p link */ @@ -389,6 +386,8 @@ struct ifaddr { void (*ifa_rtrequest) /* check or clean routes (+ or -)'d */ (int, struct rtentry *, struct rt_addrinfo *); u_short ifa_flags; /* mostly rt_flags for cloning */ +#define IFA_ROUTE RTF_UP /* route installed */ +#define IFA_RTSELF RTF_HOST /* loopback route to self installed */ u_int ifa_refcnt; /* references to this structure */ counter_u64_t ifa_ipackets; @@ -396,11 +395,6 @@ struct ifaddr { counter_u64_t ifa_ibytes; counter_u64_t ifa_obytes; }; -#endif - -#ifdef _KERNEL -#define IFA_ROUTE RTF_UP /* route installed */ -#define IFA_RTSELF RTF_HOST /* loopback route to self installed */ /* For compatibility with other BSDs. SCTP uses it. */ #define ifa_list ifa_link Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Thu Feb 19 23:14:35 2015 (r279029) +++ head/sys/netinet/in_var.h Thu Feb 19 23:16:10 2015 (r279030) @@ -50,7 +50,7 @@ struct in_ifinfo { struct in_multi *ii_allhosts; /* 224.0.0.1 membership */ }; -#if defined(_KERNEL) || defined(_WANT_IFADDR) +#ifdef _KERNEL /* * Interface address, Internet version. One of these structures * is allocated for each Internet address on an interface. @@ -71,7 +71,7 @@ struct in_ifaddr { #define ia_broadaddr ia_dstaddr struct sockaddr_in ia_sockmask; /* reserve space for general netmask */ }; -#endif +#endif /* _KERNEL */ struct in_aliasreq { char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Thu Feb 19 23:14:35 2015 (r279029) +++ head/sys/netinet6/in6_var.h Thu Feb 19 23:16:10 2015 (r279030) @@ -110,7 +110,7 @@ struct in6_ifextra { #define LLTABLE6(ifp) (((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->lltable) -#if defined(_KERNEL) || defined(_WANT_IFADDR) +#ifdef _KERNEL struct in6_ifaddr { struct ifaddr ia_ifa; /* protocol-independent info */ #define ia_ifp ia_ifa.ifa_ifp @@ -141,7 +141,7 @@ struct in6_ifaddr { /* List of in6_ifaddr's. */ TAILQ_HEAD(in6_ifaddrhead, in6_ifaddr); LIST_HEAD(in6_ifaddrlisthead, in6_ifaddr); -#endif +#endif /* _KERNEL */ /* control structure to manage address selection policy */ struct in6_addrpolicy { From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 23:59:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23C2E3BE; Thu, 19 Feb 2015 23:59:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E87D796A; Thu, 19 Feb 2015 23:59:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JNxRmK080027; Thu, 19 Feb 2015 23:59:27 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JNxR1D080026; Thu, 19 Feb 2015 23:59:27 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502192359.t1JNxR1D080026@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 19 Feb 2015 23:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279031 - 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.18-1 Precedence: list List-Id: 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, 19 Feb 2015 23:59:28 -0000 Author: glebius Date: Thu Feb 19 23:59:27 2015 New Revision: 279031 URL: https://svnweb.freebsd.org/changeset/base/279031 Log: The last userland piece of in_var.h is now 'struct in_aliasreq'. Move it to the top of the file, and ifdef _KERNEL the rest. Modified: head/sys/netinet/in_var.h Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Thu Feb 19 23:16:10 2015 (r279030) +++ head/sys/netinet/in_var.h Thu Feb 19 23:59:27 2015 (r279031) @@ -33,6 +33,19 @@ #ifndef _NETINET_IN_VAR_H_ #define _NETINET_IN_VAR_H_ +/* + * Argument structure for SIOCAIFADDR. + */ +struct in_aliasreq { + char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ + struct sockaddr_in ifra_addr; + struct sockaddr_in ifra_broadaddr; +#define ifra_dstaddr ifra_broadaddr + struct sockaddr_in ifra_mask; + int ifra_vhid; +}; + +#ifdef _KERNEL #include #include #include @@ -50,7 +63,6 @@ struct in_ifinfo { struct in_multi *ii_allhosts; /* 224.0.0.1 membership */ }; -#ifdef _KERNEL /* * Interface address, Internet version. One of these structures * is allocated for each Internet address on an interface. @@ -71,16 +83,7 @@ struct in_ifaddr { #define ia_broadaddr ia_dstaddr struct sockaddr_in ia_sockmask; /* reserve space for general netmask */ }; -#endif /* _KERNEL */ -struct in_aliasreq { - char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ - struct sockaddr_in ifra_addr; - struct sockaddr_in ifra_broadaddr; -#define ifra_dstaddr ifra_broadaddr - struct sockaddr_in ifra_mask; - int ifra_vhid; -}; /* * Given a pointer to an in_ifaddr (ifaddr), * return a pointer to the addr as a sockaddr_in. @@ -92,8 +95,6 @@ struct in_aliasreq { #define IN_LNAOF(in, ifa) \ ((ntohl((in).s_addr) & ~((struct in_ifaddr *)(ifa)->ia_subnetmask)) - -#ifdef _KERNEL extern u_char inetctlerrmap[]; #define LLTABLE(ifp) \ From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 00:40:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2306DC6; Fri, 20 Feb 2015 00:40:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0CD10DD2; Fri, 20 Feb 2015 00:40:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1K0eSSS001562; Fri, 20 Feb 2015 00:40:28 GMT (envelope-from jfv@FreeBSD.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1K0eQOE001552; Fri, 20 Feb 2015 00:40:26 GMT (envelope-from jfv@FreeBSD.org) Message-Id: <201502200040.t1K0eQOE001552@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jfv set sender to jfv@FreeBSD.org using -f From: Jack F Vogel Date: Fri, 20 Feb 2015 00:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279033 - 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 00:40:29 -0000 Author: jfv Date: Fri Feb 20 00:40:26 2015 New Revision: 279033 URL: https://svnweb.freebsd.org/changeset/base/279033 Log: Bring the XL710 drivers up to the SW3 release level. MFC after: 1 week Modified: head/sys/dev/ixl/i40e_adminq.c head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_lan_hmc.c head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_pf.h head/sys/dev/ixl/ixl_txrx.c head/sys/dev/ixl/ixlvc.c Modified: head/sys/dev/ixl/i40e_adminq.c ============================================================================== --- head/sys/dev/ixl/i40e_adminq.c Fri Feb 20 00:12:59 2015 (r279032) +++ head/sys/dev/ixl/i40e_adminq.c Fri Feb 20 00:40:26 2015 (r279033) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -614,7 +614,8 @@ enum i40e_status_code i40e_init_adminq(s goto init_adminq_free_arq; /* get the NVM version info */ - i40e_read_nvm_word(hw, I40E_SR_NVM_IMAGE_VERSION, &hw->nvm.version); + i40e_read_nvm_word(hw, I40E_SR_NVM_DEV_STARTER_VERSION, + &hw->nvm.version); i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_LO, &eetrack_lo); i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_HI, &eetrack_hi); hw->nvm.eetrack = (eetrack_hi << 16) | eetrack_lo; Modified: head/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq_cmd.h Fri Feb 20 00:12:59 2015 (r279032) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Fri Feb 20 00:40:26 2015 (r279033) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -42,7 +42,7 @@ */ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR 0x0002 +#define I40E_FW_API_VERSION_MINOR 0x0004 struct i40e_aq_desc { __le16 flags; @@ -140,12 +140,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_list_func_capabilities = 0x000A, i40e_aqc_opc_list_dev_capabilities = 0x000B, - i40e_aqc_opc_set_cppm_configuration = 0x0103, - i40e_aqc_opc_set_arp_proxy_entry = 0x0104, - i40e_aqc_opc_set_ns_proxy_entry = 0x0105, - /* LAA */ - i40e_aqc_opc_mng_laa = 0x0106, /* AQ obsolete */ i40e_aqc_opc_mac_address_read = 0x0107, i40e_aqc_opc_mac_address_write = 0x0108, @@ -270,7 +265,6 @@ enum i40e_admin_queue_opc { /* Tunnel commands */ i40e_aqc_opc_add_udp_tunnel = 0x0B00, i40e_aqc_opc_del_udp_tunnel = 0x0B01, - i40e_aqc_opc_tunnel_key_structure = 0x0B10, /* Async Events */ i40e_aqc_opc_event_lan_overflow = 0x1001, @@ -282,8 +276,6 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_oem_ocbb_initialize = 0xFE03, /* debug commands */ - i40e_aqc_opc_debug_get_deviceid = 0xFF00, - i40e_aqc_opc_debug_set_mode = 0xFF01, i40e_aqc_opc_debug_read_reg = 0xFF03, i40e_aqc_opc_debug_write_reg = 0xFF04, i40e_aqc_opc_debug_modify_reg = 0xFF07, @@ -517,7 +509,8 @@ struct i40e_aqc_mac_address_read { #define I40E_AQC_SAN_ADDR_VALID 0x20 #define I40E_AQC_PORT_ADDR_VALID 0x40 #define I40E_AQC_WOL_ADDR_VALID 0x80 -#define I40E_AQC_ADDR_VALID_MASK 0xf0 +#define I40E_AQC_MC_MAG_EN_VALID 0x100 +#define I40E_AQC_ADDR_VALID_MASK 0x1F0 u8 reserved[6]; __le32 addr_high; __le32 addr_low; @@ -540,7 +533,9 @@ struct i40e_aqc_mac_address_write { #define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x0000 #define I40E_AQC_WRITE_TYPE_LAA_WOL 0x4000 #define I40E_AQC_WRITE_TYPE_PORT 0x8000 -#define I40E_AQC_WRITE_TYPE_MASK 0xc000 +#define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG 0xC000 +#define I40E_AQC_WRITE_TYPE_MASK 0xC000 + __le16 mac_sah; __le32 mac_sal; u8 reserved[8]; @@ -1076,6 +1071,7 @@ struct i40e_aqc_set_vsi_promiscuous_mode __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF __le16 vlan_tag; +#define I40E_AQC_SET_VSI_VLAN_MASK 0x0FFF #define I40E_AQC_SET_VSI_VLAN_VALID 0x8000 u8 reserved[8]; }; @@ -2070,6 +2066,12 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_star #define I40E_AQC_CEE_PFC_STATUS_MASK (0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT) #define I40E_AQC_CEE_APP_STATUS_SHIFT 0x8 #define I40E_AQC_CEE_APP_STATUS_MASK (0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT) +#define I40E_AQC_CEE_FCOE_STATUS_SHIFT 0x8 +#define I40E_AQC_CEE_FCOE_STATUS_MASK (0x7 << I40E_AQC_CEE_FCOE_STATUS_SHIFT) +#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT 0xA +#define I40E_AQC_CEE_ISCSI_STATUS_MASK (0x7 << I40E_AQC_CEE_ISCSI_STATUS_SHIFT) +#define I40E_AQC_CEE_FIP_STATUS_SHIFT 0x10 +#define I40E_AQC_CEE_FIP_STATUS_MASK (0x7 << I40E_AQC_CEE_FIP_STATUS_SHIFT) struct i40e_aqc_get_cee_dcb_cfg_v1_resp { u8 reserved1; u8 oper_num_tc; Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Fri Feb 20 00:12:59 2015 (r279032) +++ head/sys/dev/ixl/i40e_common.c Fri Feb 20 00:40:26 2015 (r279033) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -37,6 +37,7 @@ #include "i40e_prototype.h" #include "i40e_virtchnl.h" + /** * i40e_set_mac_type - Sets MAC type * @hw: pointer to the HW structure @@ -61,6 +62,7 @@ enum i40e_status_code i40e_set_mac_type( case I40E_DEV_ID_QSFP_B: case I40E_DEV_ID_QSFP_C: case I40E_DEV_ID_10G_BASE_T: + case I40E_DEV_ID_20G_KR2: hw->mac.type = I40E_MAC_XL710; break; case I40E_DEV_ID_VF: @@ -840,12 +842,15 @@ static enum i40e_media_type i40e_get_med case I40E_PHY_TYPE_10GBASE_CR1: case I40E_PHY_TYPE_40GBASE_CR4: case I40E_PHY_TYPE_10GBASE_SFPP_CU: + case I40E_PHY_TYPE_40GBASE_AOC: + case I40E_PHY_TYPE_10GBASE_AOC: media = I40E_MEDIA_TYPE_DA; break; case I40E_PHY_TYPE_1000BASE_KX: case I40E_PHY_TYPE_10GBASE_KX4: case I40E_PHY_TYPE_10GBASE_KR: case I40E_PHY_TYPE_40GBASE_KR4: + case I40E_PHY_TYPE_20GBASE_KR2: media = I40E_MEDIA_TYPE_BACKPLANE; break; case I40E_PHY_TYPE_SGMII: @@ -1508,6 +1513,10 @@ enum i40e_status_code i40e_aq_get_link_i else hw_link_info->lse_enable = FALSE; + if ((hw->aq.fw_maj_ver < 4 || (hw->aq.fw_maj_ver == 4 && + hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE) + hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU; + /* save link status information */ if (link) i40e_memcpy(link, hw_link_info, sizeof(*hw_link_info), @@ -2807,12 +2816,13 @@ i40e_aq_erase_nvm_exit: #define I40E_DEV_FUNC_CAP_MSIX_VF 0x44 #define I40E_DEV_FUNC_CAP_FLOW_DIRECTOR 0x45 #define I40E_DEV_FUNC_CAP_IEEE_1588 0x46 -#define I40E_DEV_FUNC_CAP_MFP_MODE_1 0xF1 +#define I40E_DEV_FUNC_CAP_FLEX10 0xF1 #define I40E_DEV_FUNC_CAP_CEM 0xF2 #define I40E_DEV_FUNC_CAP_IWARP 0x51 #define I40E_DEV_FUNC_CAP_LED 0x61 #define I40E_DEV_FUNC_CAP_SDP 0x62 #define I40E_DEV_FUNC_CAP_MDIO 0x63 +#define I40E_DEV_FUNC_CAP_WR_CSR_PROT 0x64 /** * i40e_parse_discover_capabilities @@ -2830,6 +2840,7 @@ static void i40e_parse_discover_capabili struct i40e_aqc_list_capabilities_element_resp *cap; u32 valid_functions, num_functions; u32 number, logical_id, phys_id; + u8 major_rev; struct i40e_hw_capabilities *p; u32 i = 0; u16 id; @@ -2848,6 +2859,7 @@ static void i40e_parse_discover_capabili number = LE32_TO_CPU(cap->number); logical_id = LE32_TO_CPU(cap->logical_id); phys_id = LE32_TO_CPU(cap->phys_id); + major_rev = cap->major_rev; switch (id) { case I40E_DEV_FUNC_CAP_SWITCH_MODE: @@ -2922,9 +2934,21 @@ static void i40e_parse_discover_capabili case I40E_DEV_FUNC_CAP_MSIX_VF: p->num_msix_vectors_vf = number; break; - case I40E_DEV_FUNC_CAP_MFP_MODE_1: - if (number == 1) - p->mfp_mode_1 = TRUE; + case I40E_DEV_FUNC_CAP_FLEX10: + if (major_rev == 1) { + if (number == 1) { + p->flex10_enable = TRUE; + p->flex10_capable = TRUE; + } + } else { + /* Capability revision >= 2 */ + if (number & 1) + p->flex10_enable = TRUE; + if (number & 2) + p->flex10_capable = TRUE; + } + p->flex10_mode = logical_id; + p->flex10_status = phys_id; break; case I40E_DEV_FUNC_CAP_CEM: if (number == 1) @@ -2957,11 +2981,18 @@ static void i40e_parse_discover_capabili p->fd_filters_guaranteed = number; p->fd_filters_best_effort = logical_id; break; + case I40E_DEV_FUNC_CAP_WR_CSR_PROT: + p->wr_csr_prot = (u64)number; + p->wr_csr_prot |= (u64)logical_id << 32; + break; default: break; } } + if (p->fcoe) + i40e_debug(hw, I40E_DEBUG_ALL, "device is FCoE capable\n"); + /* Always disable FCoE if compiled without the I40E_FCOE_ENA flag */ p->fcoe = FALSE; @@ -4917,6 +4948,63 @@ void i40e_set_pci_config_data(struct i40 } /** + * i40e_aq_debug_dump + * @hw: pointer to the hardware structure + * @cluster_id: specific cluster to dump + * @table_id: table id within cluster + * @start_index: index of line in the block to read + * @buff_size: dump buffer size + * @buff: dump buffer + * @ret_buff_size: actual buffer size returned + * @ret_next_table: next block to read + * @ret_next_index: next index to read + * + * Dump internal FW/HW data for debug purposes. + * + **/ +enum i40e_status_code i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id, + u8 table_id, u32 start_index, u16 buff_size, + void *buff, u16 *ret_buff_size, + u8 *ret_next_table, u32 *ret_next_index, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_debug_dump_internals *cmd = + (struct i40e_aqc_debug_dump_internals *)&desc.params.raw; + struct i40e_aqc_debug_dump_internals *resp = + (struct i40e_aqc_debug_dump_internals *)&desc.params.raw; + enum i40e_status_code status; + + if (buff_size == 0 || !buff) + return I40E_ERR_PARAM; + + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_debug_dump_internals); + /* Indirect Command */ + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); + if (buff_size > I40E_AQ_LARGE_BUF) + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB); + + cmd->cluster_id = cluster_id; + cmd->table_id = table_id; + cmd->idx = CPU_TO_LE32(start_index); + + desc.datalen = CPU_TO_LE16(buff_size); + + status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); + if (!status) { + if (ret_buff_size != NULL) + *ret_buff_size = LE16_TO_CPU(desc.datalen); + if (ret_next_table != NULL) + *ret_next_table = resp->table_id; + if (ret_next_index != NULL) + *ret_next_index = LE32_TO_CPU(resp->idx); + } + + return status; +} + +/** * i40e_read_bw_from_alt_ram * @hw: pointer to the hardware structure * @max_bw: pointer for max_bw read Modified: head/sys/dev/ixl/i40e_lan_hmc.c ============================================================================== --- head/sys/dev/ixl/i40e_lan_hmc.c Fri Feb 20 00:12:59 2015 (r279032) +++ head/sys/dev/ixl/i40e_lan_hmc.c Fri Feb 20 00:40:26 2015 (r279033) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -1218,7 +1218,7 @@ static enum i40e_status_code i40e_set_hm /** * i40e_hmc_get_object_va - retrieves an object's virtual address - * @hmc_info: pointer to i40e_hmc_info struct + * @hw: pointer to the hw structure * @object_base: pointer to u64 to get the va * @rsrc_type: the hmc resource type * @obj_idx: hmc object index @@ -1227,12 +1227,13 @@ static enum i40e_status_code i40e_set_hm * base pointer. This function is used for LAN Queue contexts. **/ static -enum i40e_status_code i40e_hmc_get_object_va(struct i40e_hmc_info *hmc_info, +enum i40e_status_code i40e_hmc_get_object_va(struct i40e_hw *hw, u8 **object_base, enum i40e_hmc_lan_rsrc_type rsrc_type, u32 obj_idx) { u32 obj_offset_in_sd, obj_offset_in_pd; + struct i40e_hmc_info *hmc_info = &hw->hmc; struct i40e_hmc_sd_entry *sd_entry; struct i40e_hmc_pd_entry *pd_entry; u32 pd_idx, pd_lmt, rel_pd_idx; @@ -1304,8 +1305,7 @@ enum i40e_status_code i40e_get_lan_tx_qu enum i40e_status_code err; u8 *context_bytes; - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, - I40E_HMC_LAN_TX, queue); + err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_TX, queue); if (err < 0) return err; @@ -1324,8 +1324,7 @@ enum i40e_status_code i40e_clear_lan_tx_ enum i40e_status_code err; u8 *context_bytes; - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, - I40E_HMC_LAN_TX, queue); + err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_TX, queue); if (err < 0) return err; @@ -1345,8 +1344,7 @@ enum i40e_status_code i40e_set_lan_tx_qu enum i40e_status_code err; u8 *context_bytes; - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, - I40E_HMC_LAN_TX, queue); + err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_TX, queue); if (err < 0) return err; @@ -1367,8 +1365,7 @@ enum i40e_status_code i40e_get_lan_rx_qu enum i40e_status_code err; u8 *context_bytes; - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, - I40E_HMC_LAN_RX, queue); + err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_RX, queue); if (err < 0) return err; @@ -1387,8 +1384,7 @@ enum i40e_status_code i40e_clear_lan_rx_ enum i40e_status_code err; u8 *context_bytes; - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, - I40E_HMC_LAN_RX, queue); + err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_RX, queue); if (err < 0) return err; @@ -1408,8 +1404,7 @@ enum i40e_status_code i40e_set_lan_rx_qu enum i40e_status_code err; u8 *context_bytes; - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, - I40E_HMC_LAN_RX, queue); + err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_RX, queue); if (err < 0) return err; Modified: head/sys/dev/ixl/i40e_prototype.h ============================================================================== --- head/sys/dev/ixl/i40e_prototype.h Fri Feb 20 00:12:59 2015 (r279032) +++ head/sys/dev/ixl/i40e_prototype.h Fri Feb 20 00:40:26 2015 (r279033) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -445,4 +445,9 @@ enum i40e_status_code i40e_aq_add_rem_co u16 vsi_seid, u16 queue, bool is_add, struct i40e_control_filter_stats *stats, struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id, + u8 table_id, u32 start_index, u16 buff_size, + void *buff, u16 *ret_buff_size, + u8 *ret_next_table, u32 *ret_next_index, + struct i40e_asq_cmd_details *cmd_details); #endif /* _I40E_PROTOTYPE_H_ */ Modified: head/sys/dev/ixl/i40e_type.h ============================================================================== --- head/sys/dev/ixl/i40e_type.h Fri Feb 20 00:12:59 2015 (r279032) +++ head/sys/dev/ixl/i40e_type.h Fri Feb 20 00:40:26 2015 (r279033) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -57,6 +57,7 @@ #define I40E_DEV_ID_QSFP_B 0x1584 #define I40E_DEV_ID_QSFP_C 0x1585 #define I40E_DEV_ID_10G_BASE_T 0x1586 +#define I40E_DEV_ID_20G_KR2 0x1587 #define I40E_DEV_ID_VF 0x154C #define I40E_DEV_ID_VF_HV 0x1571 @@ -286,7 +287,17 @@ struct i40e_hw_capabilities { bool dcb; bool fcoe; bool iscsi; /* Indicates iSCSI enabled */ - bool mfp_mode_1; + bool flex10_enable; + bool flex10_capable; + u32 flex10_mode; +#define I40E_FLEX10_MODE_UNKNOWN 0x0 +#define I40E_FLEX10_MODE_DCC 0x1 +#define I40E_FLEX10_MODE_DCI 0x2 + + u32 flex10_status; +#define I40E_FLEX10_STATUS_DCC_ERROR 0x1 +#define I40E_FLEX10_STATUS_VC_MODE 0x2 + bool mgmt_cem; bool ieee_1588; bool iwarp; @@ -315,6 +326,7 @@ struct i40e_hw_capabilities { u8 rx_buf_chain_len; u32 enabled_tcmap; u32 maxtc; + u64 wr_csr_prot; }; struct i40e_mac_info { @@ -560,7 +572,11 @@ struct i40e_hw { /* debug mask */ u32 debug_mask; }; -#define i40e_is_vf(_hw) ((_hw)->mac.type == I40E_MAC_VF) + +static INLINE bool i40e_is_vf(struct i40e_hw *hw) +{ + return hw->mac.type == I40E_MAC_VF; +} struct i40e_driver_version { u8 major_version; @@ -1258,6 +1274,9 @@ struct i40e_hw_port_stats { /* flow director stats */ u64 fd_atr_match; u64 fd_sb_match; + u64 fd_atr_tunnel_match; + u32 fd_atr_status; + u32 fd_sb_status; /* EEE LPI */ u32 tx_lpi_status; u32 rx_lpi_status; Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Fri Feb 20 00:12:59 2015 (r279032) +++ head/sys/dev/ixl/if_ixl.c Fri Feb 20 00:40:26 2015 (r279033) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -32,9 +32,12 @@ ******************************************************************************/ /*$FreeBSD$*/ +#ifndef IXL_STANDALONE_BUILD #include "opt_inet.h" #include "opt_inet6.h" #include "opt_rss.h" +#endif + #include "ixl.h" #include "ixl_pf.h" @@ -45,7 +48,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.3.1"; +char ixl_driver_version[] = "1.3.6"; /********************************************************************* * PCI Device ID Table @@ -99,7 +102,7 @@ static void ixl_update_link_status(s static int ixl_allocate_pci_resources(struct ixl_pf *); static u16 ixl_get_bus_info(struct i40e_hw *, device_t); static int ixl_setup_stations(struct ixl_pf *); -static int ixl_setup_vsi(struct ixl_vsi *); +static int ixl_switch_config(struct ixl_pf *); static int ixl_initialize_vsi(struct ixl_vsi *); static int ixl_assign_vsi_msix(struct ixl_pf *); static int ixl_assign_vsi_legacy(struct ixl_pf *); @@ -499,48 +502,6 @@ ixl_attach(device_t dev) goto err_out; } - /* For now always do an initial CORE reset on first device */ - { - static int ixl_dev_count; - static int ixl_dev_track[32]; - u32 my_dev; - int i, found = FALSE; - u16 bus = pci_get_bus(dev); - - mtx_lock(&ixl_reset_mtx); - my_dev = (bus << 8) | hw->bus.device; - - for (i = 0; i < ixl_dev_count; i++) { - if (ixl_dev_track[i] == my_dev) - found = TRUE; - } - - if (!found) { - u32 reg; - - ixl_dev_track[ixl_dev_count] = my_dev; - ixl_dev_count++; - - INIT_DEBUGOUT("Initial CORE RESET\n"); - wr32(hw, I40E_GLGEN_RTRIG, I40E_GLGEN_RTRIG_CORER_MASK); - ixl_flush(hw); - i = 50; - do { - i40e_msec_delay(50); - reg = rd32(hw, I40E_GLGEN_RSTAT); - if (!(reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK)) - break; - } while (i--); - - /* paranoia */ - wr32(hw, I40E_PF_ATQLEN, 0); - wr32(hw, I40E_PF_ATQBAL, 0); - wr32(hw, I40E_PF_ATQBAH, 0); - i40e_clear_pxe_mode(hw); - } - mtx_unlock(&ixl_reset_mtx); - } - /* Set admin queue parameters */ hw->aq.num_arq_entries = IXL_AQ_LEN; hw->aq.num_asq_entries = IXL_AQ_LEN; @@ -630,13 +591,15 @@ ixl_attach(device_t dev) if (error) goto err_late; - i40e_msec_delay(75); - error = i40e_aq_set_link_restart_an(hw, TRUE, NULL); - if (error) { - device_printf(dev, "link restart failed, aq_err=%d\n", - pf->hw.aq.asq_last_status); + if (((hw->aq.fw_maj_ver == 4) && (hw->aq.fw_min_ver < 33)) || + (hw->aq.fw_maj_ver < 4)) { + i40e_msec_delay(75); + error = i40e_aq_set_link_restart_an(hw, TRUE, NULL); + if (error) + device_printf(dev, "link restart failed, aq_err=%d\n", + pf->hw.aq.asq_last_status); } - + /* Determine link state */ vsi->link_up = ixl_config_link(hw); @@ -656,6 +619,18 @@ ixl_attach(device_t dev) goto err_late; } + error = ixl_switch_config(pf); + if (error) { + device_printf(dev, "Initial switch config failed: %d\n", error); + goto err_mac_hmc; + } + + /* Limit phy interrupts to link and modules failure */ + error = i40e_aq_set_phy_int_mask(hw, + I40E_AQ_EVENT_LINK_UPDOWN | I40E_AQ_EVENT_MODULE_QUAL_FAIL, NULL); + if (error) + device_printf(dev, "set phy mask failed: %d\n", error); + /* Get the bus configuration and set the shared code */ bus = ixl_get_bus_info(hw, dev); i40e_set_pci_config_data(hw, bus); @@ -665,13 +640,6 @@ ixl_attach(device_t dev) ixl_update_stats_counters(pf); ixl_add_hw_stats(pf); - /* Reset port's advertised speeds */ - if (!i40e_is_40G_device(hw->device_id)) { - pf->advertised_speed = - (hw->device_id == I40E_DEV_ID_10G_BASE_T) ? 0x7 : 0x6; - ixl_set_advertised_speeds(pf, pf->advertised_speed); - } - /* Register for VLAN events */ vsi->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, ixl_register_vlan, vsi, EVENTHANDLER_PRI_FIRST); @@ -723,9 +691,12 @@ ixl_detach(device_t dev) return (EBUSY); } - IXL_PF_LOCK(pf); - ixl_stop(pf); - IXL_PF_UNLOCK(pf); + ether_ifdetach(vsi->ifp); + if (vsi->ifp->if_drv_flags & IFF_DRV_RUNNING) { + IXL_PF_LOCK(pf); + ixl_stop(pf); + IXL_PF_UNLOCK(pf); + } for (int i = 0; i < vsi->num_queues; i++, que++) { if (que->tq) { @@ -753,7 +724,6 @@ ixl_detach(device_t dev) if (vsi->vlan_detach != NULL) EVENTHANDLER_DEREGISTER(vlan_unconfig, vsi->vlan_detach); - ether_ifdetach(vsi->ifp); callout_drain(&pf->timer); @@ -1122,11 +1092,8 @@ ixl_init_locked(struct ixl_pf *pf) /* Set up RSS */ ixl_config_rss(vsi); - /* Setup the VSI */ - ixl_setup_vsi(vsi); - /* - ** Prepare the rings, hmc contexts, etc... + ** Prepare the VSI: rings, hmc contexts, etc... */ if (ixl_initialize_vsi(vsi)) { device_printf(dev, "initialize vsi failed!!\n"); @@ -1409,16 +1376,14 @@ ixl_media_status(struct ifnet * ifp, str ifmr->ifm_active |= IFM_1000_LX; break; /* 10 G */ + case I40E_PHY_TYPE_10GBASE_CR1: case I40E_PHY_TYPE_10GBASE_CR1_CU: case I40E_PHY_TYPE_10GBASE_SFPP_CU: + /* Using this until a real KR media type */ + case I40E_PHY_TYPE_10GBASE_KR: + case I40E_PHY_TYPE_10GBASE_KX4: ifmr->ifm_active |= IFM_10G_TWINAX; break; - case I40E_PHY_TYPE_10GBASE_KR: - /* - ** this is not technically correct - ** but FreeBSD does not have the media - ** type defined yet, so its a compromise. - */ case I40E_PHY_TYPE_10GBASE_SR: ifmr->ifm_active |= IFM_10G_SR; break; @@ -1439,6 +1404,16 @@ ixl_media_status(struct ifnet * ifp, str case I40E_PHY_TYPE_40GBASE_LR4: ifmr->ifm_active |= IFM_40G_LR4; break; + /* + ** Set these to CR4 because OS does not + ** have types available yet. + */ + case I40E_PHY_TYPE_40GBASE_KR4: + case I40E_PHY_TYPE_XLAUI: + case I40E_PHY_TYPE_XLPPI: + case I40E_PHY_TYPE_40GBASE_AOC: + ifmr->ifm_active |= IFM_40G_CR4; + break; default: ifmr->ifm_active |= IFM_UNKNOWN; break; @@ -1765,18 +1740,17 @@ ixl_update_link_status(struct ixl_pf *pf struct i40e_hw *hw = &pf->hw; struct ifnet *ifp = vsi->ifp; device_t dev = pf->dev; - enum i40e_fc_mode fc; if (vsi->link_up){ if (vsi->link_active == FALSE) { i40e_aq_get_link_info(hw, TRUE, NULL, NULL); + pf->fc = hw->fc.current_mode; if (bootverbose) { - fc = hw->fc.current_mode; device_printf(dev,"Link is up %d Gbps %s," " Flow Control: %s\n", ((vsi->link_speed == I40E_LINK_SPEED_40GB)? 40:10), - "Full Duplex", ixl_fc_string[fc]); + "Full Duplex", ixl_fc_string[pf->fc]); } vsi->link_active = TRUE; /* @@ -2341,8 +2315,15 @@ ixl_add_ifmedia(struct ixl_vsi *vsi, u32 ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_T, 0, NULL); if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1_CU) || + phy_type & (1 << I40E_PHY_TYPE_10GBASE_KX4) || + phy_type & (1 << I40E_PHY_TYPE_10GBASE_KR) || + phy_type & (1 << I40E_PHY_TYPE_10GBASE_AOC) || + phy_type & (1 << I40E_PHY_TYPE_XAUI) || + phy_type & (1 << I40E_PHY_TYPE_XFI) || + phy_type & (1 << I40E_PHY_TYPE_SFI) || phy_type & (1 << I40E_PHY_TYPE_10GBASE_SFPP_CU)) ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_SR)) ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_SR, 0, NULL); if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_LR)) @@ -2350,9 +2331,15 @@ ixl_add_ifmedia(struct ixl_vsi *vsi, u32 if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_T)) ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_T, 0, NULL); - if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4_CU) || - phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4)) + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4) || + phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4_CU) || + phy_type & (1 << I40E_PHY_TYPE_40GBASE_AOC) || + phy_type & (1 << I40E_PHY_TYPE_XLAUI) || + phy_type & (1 << I40E_PHY_TYPE_XLPPI) || + /* KR4 uses CR4 until the OS has the real media type */ + phy_type & (1 << I40E_PHY_TYPE_40GBASE_KR4)) ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_CR4, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_SR4)) ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_SR4, 0, NULL); if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_LR4)) @@ -2370,7 +2357,7 @@ ixl_setup_interface(device_t dev, struct struct ifnet *ifp; struct i40e_hw *hw = vsi->hw; struct ixl_queue *que = vsi->queues; - struct i40e_aq_get_phy_abilities_resp abilities_resp; + struct i40e_aq_get_phy_abilities_resp abilities; enum i40e_status_code aq_error = 0; INIT_DEBUGOUT("ixl_setup_interface: begin"); @@ -2437,21 +2424,25 @@ ixl_setup_interface(device_t dev, struct ifmedia_init(&vsi->media, IFM_IMASK, ixl_media_change, ixl_media_status); - aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, TRUE, &abilities_resp, NULL); + aq_error = i40e_aq_get_phy_capabilities(hw, + FALSE, TRUE, &abilities, NULL); + /* May need delay to detect fiber correctly */ if (aq_error == I40E_ERR_UNKNOWN_PHY) { - /* Need delay to detect fiber correctly */ i40e_msec_delay(200); aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, - TRUE, &abilities_resp, NULL); + TRUE, &abilities, NULL); + } + if (aq_error) { if (aq_error == I40E_ERR_UNKNOWN_PHY) device_printf(dev, "Unknown PHY type detected!\n"); else - ixl_add_ifmedia(vsi, abilities_resp.phy_type); - } else if (aq_error) { - device_printf(dev, "Error getting supported media types, err %d," - " AQ error %d\n", aq_error, hw->aq.asq_last_status); - } else - ixl_add_ifmedia(vsi, abilities_resp.phy_type); + device_printf(dev, + "Error getting supported media types, err %d," + " AQ error %d\n", aq_error, hw->aq.asq_last_status); + return (0); + } + + ixl_add_ifmedia(vsi, abilities.phy_type); /* Use autoselect media by default */ ifmedia_add(&vsi->media, IFM_ETHER | IFM_AUTO, 0, NULL); @@ -2477,20 +2468,23 @@ ixl_config_link(struct i40e_hw *hw) /********************************************************************* * - * Initialize this VSI + * Get Firmware Switch configuration + * - this will need to be more robust when more complex + * switch configurations are enabled. * **********************************************************************/ static int -ixl_setup_vsi(struct ixl_vsi *vsi) +ixl_switch_config(struct ixl_pf *pf) { - struct i40e_hw *hw = vsi->hw; + struct i40e_hw *hw = &pf->hw; + struct ixl_vsi *vsi = &pf->vsi; device_t dev = vsi->dev; struct i40e_aqc_get_switch_config_resp *sw_config; - struct i40e_vsi_context ctxt; u8 aq_buf[I40E_AQ_LARGE_BUF]; int ret = I40E_SUCCESS; u16 next = 0; + memset(&aq_buf, 0, sizeof(aq_buf)); sw_config = (struct i40e_aqc_get_switch_config_resp *)aq_buf; ret = i40e_aq_get_switch_config(hw, sw_config, sizeof(aq_buf), &next, NULL); @@ -2507,16 +2501,34 @@ ixl_setup_vsi(struct ixl_vsi *vsi) sw_config->element[0].uplink_seid, sw_config->element[0].downlink_seid); #endif - /* Save off this important value */ + /* Simplified due to a single VSI at the moment */ vsi->seid = sw_config->element[0].seid; + return (ret); +} + +/********************************************************************* + * + * Initialize the VSI: this handles contexts, which means things + * like the number of descriptors, buffer size, + * plus we init the rings thru this function. + * + **********************************************************************/ +static int +ixl_initialize_vsi(struct ixl_vsi *vsi) +{ + struct ixl_queue *que = vsi->queues; + device_t dev = vsi->dev; + struct i40e_hw *hw = vsi->hw; + struct i40e_vsi_context ctxt; + int err = 0; memset(&ctxt, 0, sizeof(ctxt)); ctxt.seid = vsi->seid; ctxt.pf_num = hw->pf_id; - ret = i40e_aq_get_vsi_params(hw, &ctxt, NULL); - if (ret) { - device_printf(dev,"get vsi params failed %x!!\n", ret); - return (ret); + err = i40e_aq_get_vsi_params(hw, &ctxt, NULL); + if (err) { + device_printf(dev,"get vsi params failed %x!!\n", err); + return (err); } #ifdef IXL_DEBUG printf("get_vsi_params: seid: %d, uplinkseid: %d, vsi_number: %d, " @@ -2553,29 +2565,12 @@ ixl_setup_vsi(struct ixl_vsi *vsi) vsi->hw_filters_add = 0; vsi->hw_filters_del = 0; - ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); - if (ret) + err = i40e_aq_update_vsi_params(hw, &ctxt, NULL); + if (err) { device_printf(dev,"update vsi params failed %x!!\n", hw->aq.asq_last_status); - return (ret); -} - - -/********************************************************************* - * - * Initialize the VSI: this handles contexts, which means things - * like the number of descriptors, buffer size, - * plus we init the rings thru this function. - * - **********************************************************************/ -static int -ixl_initialize_vsi(struct ixl_vsi *vsi) -{ - struct ixl_queue *que = vsi->queues; - device_t dev = vsi->dev; - struct i40e_hw *hw = vsi->hw; - int err = 0; - + return (err); + } for (int i = 0; i < vsi->num_queues; i++, que++) { struct tx_ring *txr = &que->txr; @@ -3216,7 +3211,7 @@ static void ixl_config_rss(struct ixl_vs set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP); if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6) set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER); - if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6_EX) + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6_EX) set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6); if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV6) set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP); @@ -3521,8 +3516,8 @@ ixl_add_hw_filters(struct ixl_vsi *vsi, if (j > 0) { err = i40e_aq_add_macvlan(hw, vsi->seid, a, j, NULL); if (err) - device_printf(dev, "aq_add_macvlan err %d, aq_error %d\n", - err, hw->aq.asq_last_status); + device_printf(dev, "aq_add_macvlan err %d, " + "aq_error %d\n", err, hw->aq.asq_last_status); else vsi->hw_filters_add += j; } @@ -4307,24 +4302,15 @@ ixl_set_flowcntl(SYSCTL_HANDLER_ARGS) struct ixl_pf *pf = (struct ixl_pf *)arg1; struct i40e_hw *hw = &pf->hw; device_t dev = pf->dev; - int requested_fc = 0, error = 0; + int error = 0; enum i40e_status_code aq_error = 0; u8 fc_aq_err = 0; - aq_error = i40e_aq_get_link_info(hw, TRUE, NULL, NULL); - if (aq_error) { - device_printf(dev, - "%s: Error retrieving link info from aq, %d\n", - __func__, aq_error); - return (EAGAIN); - } - - /* Read in new mode */ - requested_fc = hw->fc.current_mode; - error = sysctl_handle_int(oidp, &requested_fc, 0, req); + /* Get request */ + error = sysctl_handle_int(oidp, &pf->fc, 0, req); if ((error) || (req->newptr == NULL)) return (error); - if (requested_fc < 0 || requested_fc > 3) { + if (pf->fc < 0 || pf->fc > 3) { device_printf(dev, "Invalid fc mode; valid modes are 0 through 3\n"); return (EINVAL); @@ -4342,7 +4328,7 @@ ixl_set_flowcntl(SYSCTL_HANDLER_ARGS) } /* Set fc ability for port */ - hw->fc.requested_mode = requested_fc; + hw->fc.requested_mode = pf->fc; aq_error = i40e_set_fc(hw, &fc_aq_err, TRUE); if (aq_error) { device_printf(dev, @@ -4351,14 +4337,6 @@ ixl_set_flowcntl(SYSCTL_HANDLER_ARGS) return (EAGAIN); } - if (hw->fc.current_mode != hw->fc.requested_mode) { - device_printf(dev, "%s: FC set failure:\n", __func__); - device_printf(dev, "%s: Current: %s / Requested: %s\n", - __func__, - ixl_fc_string[hw->fc.current_mode], - ixl_fc_string[hw->fc.requested_mode]); - } - return (0); } @@ -4417,9 +4395,11 @@ ixl_set_advertised_speeds(struct ixl_pf enum i40e_status_code aq_error = 0; /* Get current capability information */ - aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, FALSE, &abilities, NULL); + aq_error = i40e_aq_get_phy_capabilities(hw, + FALSE, FALSE, &abilities, NULL); if (aq_error) { - device_printf(dev, "%s: Error getting phy capabilities %d," + device_printf(dev, + "%s: Error getting phy capabilities %d," " aq error: %d\n", __func__, aq_error, hw->aq.asq_last_status); return (EAGAIN); @@ -4444,7 +4424,8 @@ ixl_set_advertised_speeds(struct ixl_pf /* Do aq command & restart link */ aq_error = i40e_aq_set_phy_config(hw, &config, NULL); if (aq_error) { - device_printf(dev, "%s: Error setting new phy config %d," + device_printf(dev, + "%s: Error setting new phy config %d," *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 01:02:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40FE59A4; Fri, 20 Feb 2015 01:02:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2C09CF7; Fri, 20 Feb 2015 01:02:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1K12X30014213; Fri, 20 Feb 2015 01:02:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1K12X3l014211; Fri, 20 Feb 2015 01:02:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502200102.t1K12X3l014211@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 20 Feb 2015 01:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279035 - head/lib/libc/gen 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 01:02:34 -0000 Author: pfg Date: Fri Feb 20 01:02:32 2015 New Revision: 279035 URL: https://svnweb.freebsd.org/changeset/base/279035 Log: Fix small memleaks in nis_passwd() and nis_group(). These only occur upon error. Code Review: https://reviews.freebsd.org/D1849 Reviewed by: delphij CID: 1016715 CID: 1016717 Modified: head/lib/libc/gen/getgrent.c head/lib/libc/gen/getpwent.c Modified: head/lib/libc/gen/getgrent.c ============================================================================== --- head/lib/libc/gen/getgrent.c Fri Feb 20 00:55:38 2015 (r279034) +++ head/lib/libc/gen/getgrent.c Fri Feb 20 01:02:32 2015 (r279035) @@ -1173,8 +1173,10 @@ nis_group(void *retval, void *mdata, va_ * terminator, alignment padding, and one (char *) * pointer for the member list terminator. */ - if (resultlen >= bufsize - _ALIGNBYTES - sizeof(char *)) + if (resultlen >= bufsize - _ALIGNBYTES - sizeof(char *)) { + free(result); goto erange; + } memcpy(buffer, result, resultlen); buffer[resultlen] = '\0'; free(result); Modified: head/lib/libc/gen/getpwent.c ============================================================================== --- head/lib/libc/gen/getpwent.c Fri Feb 20 00:55:38 2015 (r279034) +++ head/lib/libc/gen/getpwent.c Fri Feb 20 01:02:32 2015 (r279035) @@ -1392,8 +1392,10 @@ nis_passwd(void *retval, void *mdata, va continue; } } - if (resultlen >= bufsize) + if (resultlen >= bufsize) { + free(result); goto erange; + } memcpy(buffer, result, resultlen); buffer[resultlen] = '\0'; free(result); From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 01:31:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 339D87FE; Fri, 20 Feb 2015 01:31:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1F730650; Fri, 20 Feb 2015 01:31:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1K1VAGA025275; Fri, 20 Feb 2015 01:31:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1K1VARj025274; Fri, 20 Feb 2015 01:31:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502200131.t1K1VARj025274@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 20 Feb 2015 01:31:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279037 - head/lib/libc/db/man 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 01:31:11 -0000 Author: pfg Date: Fri Feb 20 01:31:10 2015 New Revision: 279037 URL: https://svnweb.freebsd.org/changeset/base/279037 Log: dbm_delete(3) correct man page to match current behaviour. "The dbm_store() and dbm_delete() functions shall return 0 when they succeed and a negative value when they fail." Reference: http://pubs.opengroup.org/onlinepubs/9699919799/functions/dbm_clearerr.html PR: 42422 Suggested by: delphij MFC after: 3 days Modified: head/lib/libc/db/man/dbm.3 Modified: head/lib/libc/db/man/dbm.3 ============================================================================== --- head/lib/libc/db/man/dbm.3 Fri Feb 20 01:03:44 2015 (r279036) +++ head/lib/libc/db/man/dbm.3 Fri Feb 20 01:31:10 2015 (r279037) @@ -15,7 +15,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 16, 2006 +.Dd February 19, 2015 .Dt DBM 3 .Os .Sh NAME @@ -174,9 +174,7 @@ deletes the entry for The .Fn dbm_delete function -normally returns zero but returns 1 if there was no entry with -.Fa key -in the database or returns -1 and sets +normally returns zero or returns -1 and sets .Va errno if there were any errors. .Pp From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 01:40:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85899B2C; Fri, 20 Feb 2015 01:40:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 56F996E5; Fri, 20 Feb 2015 01:40:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1K1evxS031972; Fri, 20 Feb 2015 01:40:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1K1eubZ031964; Fri, 20 Feb 2015 01:40:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502200140.t1K1eubZ031964@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 20 Feb 2015 01:40:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279038 - in head/sys/boot/efi/include: . amd64 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 01:40:57 -0000 Author: imp Date: Fri Feb 20 01:40:55 2015 New Revision: 279038 URL: https://svnweb.freebsd.org/changeset/base/279038 Log: Allow EFI and ACPI to be included together. When ACPI is included first, EFI will use its definitions for {,U}INT{8,16,32,64} and BOOLEAN. When EFI is included first, define ACPI_USE_SYSTEM_INTTYPES to tell ACPI that these are already defined. Differential Revision: https://reviews.freebsd.org/D1905 Modified: head/sys/boot/efi/include/amd64/efibind.h head/sys/boot/efi/include/efidef.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 Fri Feb 20 01:31:10 2015 (r279037) +++ head/sys/boot/efi/include/amd64/efibind.h Fri Feb 20 01:40:55 2015 (r279038) @@ -85,6 +85,9 @@ Revision History // Basic EFI types of various widths // +#ifndef ACPI_THREAD_ID /* ACPI's definitions are fine */ +#define ACPI_USE_SYSTEM_INTTYPES 1 /* Tell ACPI we've defined types */ + typedef uint64_t UINT64; typedef int64_t INT64; @@ -98,6 +101,7 @@ typedef int16_t INT16; typedef uint8_t UINT8; typedef int8_t INT8; +#endif #undef VOID #define VOID void Modified: head/sys/boot/efi/include/efidef.h ============================================================================== --- head/sys/boot/efi/include/efidef.h Fri Feb 20 01:31:10 2015 (r279037) +++ head/sys/boot/efi/include/efidef.h Fri Feb 20 01:40:55 2015 (r279038) @@ -30,7 +30,9 @@ Revision History typedef UINT16 CHAR16; typedef UINT8 CHAR8; +#ifndef ACPI_THREAD_ID /* ACPI's definitions are fine */ typedef UINT8 BOOLEAN; +#endif #ifndef TRUE #define TRUE ((BOOLEAN) 1) Modified: head/sys/boot/efi/include/i386/efibind.h ============================================================================== --- head/sys/boot/efi/include/i386/efibind.h Fri Feb 20 01:31:10 2015 (r279037) +++ head/sys/boot/efi/include/i386/efibind.h Fri Feb 20 01:40:55 2015 (r279038) @@ -85,6 +85,9 @@ Revision History // Basic EFI types of various widths // +#ifndef ACPI_THREAD_ID /* ACPI's definitions are fine, use those */ +#define ACPI_USE_SYSTEM_INTTYPES 1 /* Tell ACPI we've defined types */ + typedef uint64_t UINT64; typedef int64_t INT64; @@ -98,6 +101,7 @@ typedef int16_t INT16; typedef uint8_t UINT8; typedef int8_t INT8; +#endif #undef VOID #define VOID void From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 03:14:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E24C9A6A for ; Fri, 20 Feb 2015 03:14:22 +0000 (UTC) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 AAAE6271 for ; Fri, 20 Feb 2015 03:14:22 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 5659720BC7 for ; Thu, 19 Feb 2015 22:14:20 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Thu, 19 Feb 2015 22:14:20 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= x-sasl-enc:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=oq+dihRG/UBO8mtrJvFuF/vg3pQ=; b=fvr+RNIk1J3Itqag8M Vy/7gKhpJ6WrCCoyhCZ85XHjyC7pt2fdIGiwaRlcC+0FlYbJH60RQMqxJg/jS1xd kcEAtYacykRhxbhkfSacfrVpC+i/00D6pdYIMIYl/OiK/Pb0BIbh3FHvpsLQyddx 948ceLF8CGH+h8Y6sRebbphhI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:message-id:date:from :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=oq+dihRG/UBO8mtrJvFuF/ vg3pQ=; b=SLUUD8O8+Mq2uIkioOrW/sJoxTZyz1kcP9BqdH1zcuPxdhh6CHWSx+ ZxAHYLE41hPIT5M5t0+AyCU+ro8rHfycTTqlA2kgdB/YvFhKPldYkiXhtrP7CPTB gvvMXbUUlTbdXfVa0j1FAhxAUqtDRsCY80rReuThlI7Xm9LdbqMnQ= X-Sasl-enc: prFbRgO8AM/VBpyRNNtHlw8Vdsiv3j30XhcFLXCunmZH 1424402060 Received: from [192.168.1.88] (unknown [94.194.112.120]) by mail.messagingengine.com (Postfix) with ESMTPA id E2D3C6800D5; Thu, 19 Feb 2015 22:14:19 -0500 (EST) Message-ID: <54E6A68B.1090609@fastmail.net> Date: Fri, 20 Feb 2015 03:14:19 +0000 From: Bruce Simpson User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r279028 - in head/usr.sbin: . ifmcstat References: <201502192242.t1JMgY3e045902@svn.freebsd.org> In-Reply-To: <201502192242.t1JMgY3e045902@svn.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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 03:14:23 -0000 Gleb, Correct me if I'm wrong -- but doesn't this set of changes remove the ability for the user to see the stack-wide membership filters on each link? The implementation required KVM as it must inspect the SSM filters themselves to obtain this information. On 19/02/2015 22:42, Gleb Smirnoff wrote: > Now that IGMP and MLD sysctls provide a clean API structures that do not > leak kernel internal stuff, reconnect ifmcstat(1) back to build. The change is well motivated, but the job is only half done. The backend code you have added simply reflects the per-link information to userland as a flat data structure; it does not appear to report what the membership filters are. This would require taking a lock, walking the RB-tree for the in-mode filters, and serializing the data to userland as a variable length structure. regards Bruce From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 05:40:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07595378; Fri, 20 Feb 2015 05:40:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DCCC8228; Fri, 20 Feb 2015 05:40:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1K5eepr046753; Fri, 20 Feb 2015 05:40:40 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1K5eeas046751; Fri, 20 Feb 2015 05:40:40 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201502200540.t1K5eeas046751@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 20 Feb 2015 05:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279043 - head/share/man/man4/man4.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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 05:40:41 -0000 Author: nwhitehorn Date: Fri Feb 20 05:40:39 2015 New Revision: 279043 URL: https://svnweb.freebsd.org/changeset/base/279043 Log: Add rudimentary man page for llan(4) virtualized ethernet controllers. MFC after: 1 week Added: head/share/man/man4/man4.powerpc/llan.4 (contents, props changed) Modified: head/share/man/man4/man4.powerpc/Makefile Modified: head/share/man/man4/man4.powerpc/Makefile ============================================================================== --- head/share/man/man4/man4.powerpc/Makefile Fri Feb 20 05:29:22 2015 (r279042) +++ head/share/man/man4/man4.powerpc/Makefile Fri Feb 20 05:40:39 2015 (r279043) @@ -6,6 +6,7 @@ MAN= adb.4 \ ams.4 \ bm.4 \ cuda.4 \ + llan.4 \ pmu.4 \ powermac_nvram.4 \ smu.4 \ Added: head/share/man/man4/man4.powerpc/llan.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.powerpc/llan.4 Fri Feb 20 05:40:39 2015 (r279043) @@ -0,0 +1,61 @@ +.\"- +.\" Copyright (c) 2015 Nathan Whitehorn +.\" 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 ``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$ +.\" +.Dd February 19, 2015 +.Dt LLAN 4 +.Os +.Sh NAME +.Nm llan +.Nd POWER Logical Lan +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device llan" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the inter-partition logical LAN controller +provided by PAPR-compliant POWER hypervisors (such as PowerVM and PowerKVM). +On some firmwares, advanced offload features are supported by the hypervisor, +but these are not currently supported by the driver. +.Sh SEE ALSO +.Xr vtnet 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver appeared in +.Fx 10.0. +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Nathan Whitehorn Aq Mt nwhitehorn@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 06:19:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F11858C9; Fri, 20 Feb 2015 06:19:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D1F10777; Fri, 20 Feb 2015 06:19:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1K6JOOS062953; Fri, 20 Feb 2015 06:19:24 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1K6JOUv062952; Fri, 20 Feb 2015 06:19:24 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201502200619.t1K6JOUv062952@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 20 Feb 2015 06:19:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279045 - head/sys/powerpc/powermac 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 06:19:25 -0000 Author: jhibbits Date: Fri Feb 20 06:19:23 2015 New Revision: 279045 URL: https://svnweb.freebsd.org/changeset/base/279045 Log: Make the PowerMac fan control nonlinear Summary: Currently, fan control is linear between the target temperature and max temperature, which is far from ideal. This changes it to be proportional to the distance between the current temperature and the two endpoints (target and max temp). This also adds a hysteresis, so that fans keep going when the temperature drops, for about 10 seconds, before slowing down. Reviewers: nwhitehorn Reviewed By: nwhitehorn Differential Revision: https://reviews.freebsd.org/D1549 MFC after: 3 weeks Modified: head/sys/powerpc/powermac/powermac_thermal.c Modified: head/sys/powerpc/powermac/powermac_thermal.c ============================================================================== --- head/sys/powerpc/powermac/powermac_thermal.c Fri Feb 20 06:13:52 2015 (r279044) +++ head/sys/powerpc/powermac/powermac_thermal.c Fri Feb 20 06:19:23 2015 (r279045) @@ -42,6 +42,9 @@ __FBSDID("$FreeBSD$"); #include "powermac_thermal.h" +/* A 10 second timer for spinning down fans. */ +#define FAN_HYSTERESIS_TIMER 10 + static void fan_management_proc(void); static void pmac_therm_manage_fans(void); @@ -63,6 +66,7 @@ static MALLOC_DEFINE(M_PMACTHERM, "pmact struct pmac_fan_le { struct pmac_fan *fan; int last_val; + int timer; SLIST_ENTRY(pmac_fan_le) entries; }; struct pmac_sens_le { @@ -95,6 +99,7 @@ pmac_therm_manage_fans(void) struct pmac_sens_le *sensor; struct pmac_fan_le *fan; int average_excess, max_excess_zone, frac_excess; + int fan_speed; int nsens, nsens_zone; int temp; @@ -137,10 +142,11 @@ pmac_therm_manage_fans(void) nsens = nsens_zone = 0; average_excess = max_excess_zone = 0; SLIST_FOREACH(sensor, &sensors, entries) { - frac_excess = (sensor->last_val - + temp = imin(sensor->last_val, + sensor->sensor->max_temp); + frac_excess = (temp - sensor->sensor->target_temp)*100 / - (sensor->sensor->max_temp - - sensor->sensor->target_temp); + (sensor->sensor->max_temp - temp + 1); if (frac_excess < 0) frac_excess = 0; if (sensor->sensor->zone == fan->fan->zone) { @@ -166,9 +172,21 @@ pmac_therm_manage_fans(void) * Scale the fan linearly in the max temperature in its * thermal zone. */ - fan->fan->set(fan->fan, max_excess_zone * + max_excess_zone = imin(max_excess_zone, 100); + fan_speed = max_excess_zone * (fan->fan->max_rpm - fan->fan->min_rpm)/100 + - fan->fan->min_rpm); + fan->fan->min_rpm; + if (fan_speed >= fan->last_val) { + fan->timer = FAN_HYSTERESIS_TIMER; + fan->last_val = fan_speed; + } else { + fan->timer--; + if (fan->timer == 0) { + fan->last_val = fan_speed; + fan->timer = FAN_HYSTERESIS_TIMER; + } + } + fan->fan->set(fan->fan, fan->last_val); } } From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 07:53:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F90E854; Fri, 20 Feb 2015 07:53:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 30DCB15D; Fri, 20 Feb 2015 07:53:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1K7rlMD009203; Fri, 20 Feb 2015 07:53:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1K7rlRX009202; Fri, 20 Feb 2015 07:53:47 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502200753.t1K7rlRX009202@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 20 Feb 2015 07:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279046 - head/sys/dev/sfxge 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 07:53:47 -0000 Author: arybchik Date: Fri Feb 20 07:53:46 2015 New Revision: 279046 URL: https://svnweb.freebsd.org/changeset/base/279046 Log: sfxge: handle fragmented TCP header in mbuf TCP header is fragmented in the case of VLAN tagged IPv6 traffic without HW VLAN tagging. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Fri Feb 20 06:19:23 2015 (r279045) +++ head/sys/dev/sfxge/sfxge_tx.c Fri Feb 20 07:53:46 2015 (r279046) @@ -865,6 +865,8 @@ static void tso_fini(struct sfxge_txq *t static void tso_start(struct sfxge_tso_state *tso, struct mbuf *mbuf) { struct ether_header *eh = mtod(mbuf, struct ether_header *); + const struct tcphdr *th; + struct tcphdr th_copy; tso->mbuf = mbuf; @@ -892,13 +894,24 @@ static void tso_start(struct sfxge_tso_s tso->tcph_off = tso->nh_off + sizeof(struct ip6_hdr); } - tso->header_len = tso->tcph_off + 4 * tso_tcph(tso)->th_off; + KASSERT(mbuf->m_len >= tso->tcph_off, + ("network header is fragmented in mbuf")); + /* We need TCP header including flags (window is the next) */ + if (mbuf->m_len < tso->tcph_off + offsetof(struct tcphdr, th_win)) { + m_copydata(tso->mbuf, tso->tcph_off, sizeof(th_copy), + (caddr_t)&th_copy); + th = &th_copy; + } else { + th = tso_tcph(tso); + } + + tso->header_len = tso->tcph_off + 4 * th->th_off; tso->seg_size = mbuf->m_pkthdr.tso_segsz; - tso->seqnum = ntohl(tso_tcph(tso)->th_seq); + tso->seqnum = ntohl(th->th_seq); /* These flags must not be duplicated */ - KASSERT(!(tso_tcph(tso)->th_flags & (TH_URG | TH_SYN | TH_RST)), + KASSERT(!(th->th_flags & (TH_URG | TH_SYN | TH_RST)), ("incompatible TCP flag on TSO packet")); tso->out_len = mbuf->m_pkthdr.len - tso->header_len; From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 07:54:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C2C899B; Fri, 20 Feb 2015 07:54:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 EA9CF16A; Fri, 20 Feb 2015 07:54:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1K7sZov009364; Fri, 20 Feb 2015 07:54:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1K7sZxD009363; Fri, 20 Feb 2015 07:54:35 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502200754.t1K7sZxD009363@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 20 Feb 2015 07:54:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279047 - head/sys/dev/sfxge/common 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 07:54:36 -0000 Author: arybchik Date: Fri Feb 20 07:54:35 2015 New Revision: 279047 URL: https://svnweb.freebsd.org/changeset/base/279047 Log: sfxge: regenerate MCDI protocol headers Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h Modified: head/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_mcdi.h Fri Feb 20 07:53:46 2015 (r279046) +++ head/sys/dev/sfxge/common/efx_regs_mcdi.h Fri Feb 20 07:54:35 2015 (r279047) @@ -40,6 +40,18 @@ /* The Scheduler has started. */ #define MC_FW_STATE_SCHED (8) +/* Siena MC shared memmory offsets */ +/* The 'doorbell' addresses are hard-wired to alert the MC when written */ +#define MC_SMEM_P0_DOORBELL_OFST 0x000 +#define MC_SMEM_P1_DOORBELL_OFST 0x004 +/* The rest of these are firmware-defined */ +#define MC_SMEM_P0_PDU_OFST 0x008 +#define MC_SMEM_P1_PDU_OFST 0x108 +#define MC_SMEM_PDU_LEN 0x100 +#define MC_SMEM_P0_PTP_TIME_OFST 0x7f0 +#define MC_SMEM_P0_STATUS_OFST 0x7f8 +#define MC_SMEM_P1_STATUS_OFST 0x7fc + /* Values to be written to the per-port status dword in shared * memory on reboot and assert */ #define MC_STATUS_DWORD_REBOOT (0xb007b007) @@ -58,10 +70,7 @@ /* Unused commands: 0x23, 0x27, 0x30, 0x31 */ -/* Unused commands: 0x23, 0x27, 0x30, 0x31 */ - -/** - * MCDI version 1 +/* MCDI version 1 * * Each MCDI request starts with an MCDI_HEADER, which is a 32byte * structure, filled in by the client. @@ -113,10 +122,10 @@ #define MCDI_HEADER_XFLAGS_EVREQ 0x01 /* Maximum number of payload bytes */ -#if MCDI_PCOL_VERSION == 1 -#define MCDI_CTL_SDU_LEN_MAX 0xfc -#elif MCDI_PCOL_VERSION == 2 +#ifdef WITH_MCDI_V2 #define MCDI_CTL_SDU_LEN_MAX 0x400 +#else +#define MCDI_CTL_SDU_LEN_MAX 0xfc #endif /* The MC can generate events for two reasons: @@ -133,7 +142,7 @@ * * If Code==CMDDONE, then the fields are further interpreted as: * - * - LEVEL==INFO Command succeded + * - LEVEL==INFO Command succeeded * - LEVEL==ERR Command failed * * 0 8 16 24 32 @@ -293,6 +302,27 @@ #define MCDI_EVENT_TX_ERR_INFO_WIDTH 16 #define MCDI_EVENT_TX_FLUSH_TXQ_LBN 0 #define MCDI_EVENT_TX_FLUSH_TXQ_WIDTH 12 +#define MCDI_EVENT_PTP_ERR_TYPE_LBN 0 +#define MCDI_EVENT_PTP_ERR_TYPE_WIDTH 8 +#define MCDI_EVENT_PTP_ERR_PLL_LOST 0x1 /* enum */ +#define MCDI_EVENT_PTP_ERR_FILTER 0x2 /* enum */ +#define MCDI_EVENT_PTP_ERR_FIFO 0x3 /* enum */ +#define MCDI_EVENT_PTP_ERR_QUEUE 0x4 /* enum */ +#define MCDI_EVENT_AOE_ERR_TYPE_LBN 0 +#define MCDI_EVENT_AOE_ERR_TYPE_WIDTH 8 +#define MCDI_EVENT_AOE_NO_LOAD 0x1 /* enum */ +#define MCDI_EVENT_AOE_FC_ASSERT 0x2 /* enum */ +#define MCDI_EVENT_AOE_FC_WATCHDOG 0x3 /* enum */ +#define MCDI_EVENT_AOE_FC_NO_START 0x4 /* enum */ +#define MCDI_EVENT_AOE_FAULT 0x5 /* enum */ +#define MCDI_EVENT_AOE_CPLD_REPROGRAMMED 0x6 /* enum */ +#define MCDI_EVENT_AOE_LOAD 0x7 /* enum */ +#define MCDI_EVENT_AOE_DMA 0x8 /* enum */ +#define MCDI_EVENT_AOE_BYTEBLASTER 0x9 /* enum */ +#define MCDI_EVENT_AOE_DDR_ECC_STATUS 0xa /* enum */ +#define MCDI_EVENT_AOE_PTP_STATUS 0xb /* enum */ +#define MCDI_EVENT_AOE_ERR_DATA_LBN 8 +#define MCDI_EVENT_AOE_ERR_DATA_WIDTH 8 #define MCDI_EVENT_DATA_LBN 0 #define MCDI_EVENT_DATA_WIDTH 32 #define MCDI_EVENT_SRC_LBN 36 @@ -313,6 +343,12 @@ #define MCDI_EVENT_CODE_FLR 0xa /* enum */ #define MCDI_EVENT_CODE_TX_ERR 0xb /* enum */ #define MCDI_EVENT_CODE_TX_FLUSH 0xc /* enum */ +#define MCDI_EVENT_CODE_PTP_RX 0xd /* enum */ +#define MCDI_EVENT_CODE_PTP_FAULT 0xe /* enum */ +#define MCDI_EVENT_CODE_PTP_PPS 0xf /* enum */ +#define MCDI_EVENT_CODE_AOE 0x12 /* enum */ +#define MCDI_EVENT_CODE_VCAL_FAIL 0x13 /* enum */ +#define MCDI_EVENT_CODE_HW_PPS 0x14 /* enum */ #define MCDI_EVENT_CMDDONE_DATA_OFST 0 #define MCDI_EVENT_CMDDONE_DATA_LBN 0 #define MCDI_EVENT_CMDDONE_DATA_WIDTH 32 @@ -328,6 +364,94 @@ #define MCDI_EVENT_TX_ERR_DATA_OFST 0 #define MCDI_EVENT_TX_ERR_DATA_LBN 0 #define MCDI_EVENT_TX_ERR_DATA_WIDTH 32 +#define MCDI_EVENT_PTP_SECONDS_OFST 0 +#define MCDI_EVENT_PTP_SECONDS_LBN 0 +#define MCDI_EVENT_PTP_SECONDS_WIDTH 32 +#define MCDI_EVENT_PTP_NANOSECONDS_OFST 0 +#define MCDI_EVENT_PTP_NANOSECONDS_LBN 0 +#define MCDI_EVENT_PTP_NANOSECONDS_WIDTH 32 +#define MCDI_EVENT_PTP_UUID_OFST 0 +#define MCDI_EVENT_PTP_UUID_LBN 0 +#define MCDI_EVENT_PTP_UUID_WIDTH 32 + +/* FCDI_EVENT structuredef */ +#define FCDI_EVENT_LEN 8 +#define FCDI_EVENT_CONT_LBN 32 +#define FCDI_EVENT_CONT_WIDTH 1 +#define FCDI_EVENT_LEVEL_LBN 33 +#define FCDI_EVENT_LEVEL_WIDTH 3 +#define FCDI_EVENT_LEVEL_INFO 0x0 /* enum */ +#define FCDI_EVENT_LEVEL_WARN 0x1 /* enum */ +#define FCDI_EVENT_LEVEL_ERR 0x2 /* enum */ +#define FCDI_EVENT_LEVEL_FATAL 0x3 /* enum */ +#define FCDI_EVENT_DATA_OFST 0 +#define FCDI_EVENT_LINK_STATE_STATUS_LBN 0 +#define FCDI_EVENT_LINK_STATE_STATUS_WIDTH 1 +#define FCDI_EVENT_LINK_DOWN 0x0 /* enum */ +#define FCDI_EVENT_LINK_UP 0x1 /* enum */ +#define FCDI_EVENT_DATA_LBN 0 +#define FCDI_EVENT_DATA_WIDTH 32 +#define FCDI_EVENT_SRC_LBN 36 +#define FCDI_EVENT_SRC_WIDTH 8 +#define FCDI_EVENT_EV_CODE_LBN 60 +#define FCDI_EVENT_EV_CODE_WIDTH 4 +#define FCDI_EVENT_CODE_LBN 44 +#define FCDI_EVENT_CODE_WIDTH 8 +#define FCDI_EVENT_CODE_REBOOT 0x1 /* enum */ +#define FCDI_EVENT_CODE_ASSERT 0x2 /* enum */ +#define FCDI_EVENT_CODE_DDR_TEST_RESULT 0x3 /* enum */ +#define FCDI_EVENT_CODE_LINK_STATE 0x4 /* enum */ +#define FCDI_EVENT_CODE_TIMED_READ 0x5 /* enum */ +#define FCDI_EVENT_CODE_PPS_IN 0x6 /* enum */ +#define FCDI_EVENT_CODE_PTP_TICK 0x7 /* enum */ +#define FCDI_EVENT_CODE_DDR_ECC_STATUS 0x8 /* enum */ +#define FCDI_EVENT_CODE_PTP_STATUS 0x9 /* enum */ +#define FCDI_EVENT_ASSERT_INSTR_ADDRESS_OFST 0 +#define FCDI_EVENT_ASSERT_INSTR_ADDRESS_LBN 0 +#define FCDI_EVENT_ASSERT_INSTR_ADDRESS_WIDTH 32 +#define FCDI_EVENT_ASSERT_TYPE_LBN 36 +#define FCDI_EVENT_ASSERT_TYPE_WIDTH 8 +#define FCDI_EVENT_DDR_TEST_RESULT_STATUS_CODE_LBN 36 +#define FCDI_EVENT_DDR_TEST_RESULT_STATUS_CODE_WIDTH 8 +#define FCDI_EVENT_DDR_TEST_RESULT_RESULT_OFST 0 +#define FCDI_EVENT_DDR_TEST_RESULT_RESULT_LBN 0 +#define FCDI_EVENT_DDR_TEST_RESULT_RESULT_WIDTH 32 +#define FCDI_EVENT_LINK_STATE_DATA_OFST 0 +#define FCDI_EVENT_LINK_STATE_DATA_LBN 0 +#define FCDI_EVENT_LINK_STATE_DATA_WIDTH 32 +#define FCDI_EVENT_PTP_STATE_OFST 0 +#define FCDI_EVENT_PTP_UNDEFINED 0x0 /* enum */ +#define FCDI_EVENT_PTP_SETUP_FAILED 0x1 /* enum */ +#define FCDI_EVENT_PTP_OPERATIONAL 0x2 /* enum */ +#define FCDI_EVENT_PTP_STATE_LBN 0 +#define FCDI_EVENT_PTP_STATE_WIDTH 32 +#define FCDI_EVENT_DDR_ECC_STATUS_BANK_ID_LBN 36 +#define FCDI_EVENT_DDR_ECC_STATUS_BANK_ID_WIDTH 8 +#define FCDI_EVENT_DDR_ECC_STATUS_STATUS_OFST 0 +#define FCDI_EVENT_DDR_ECC_STATUS_STATUS_LBN 0 +#define FCDI_EVENT_DDR_ECC_STATUS_STATUS_WIDTH 32 + +/* FCDI_EXTENDED_EVENT_PPS structuredef */ +#define FCDI_EXTENDED_EVENT_PPS_LENMIN 16 +#define FCDI_EXTENDED_EVENT_PPS_LENMAX 248 +#define FCDI_EXTENDED_EVENT_PPS_LEN(num) (8+8*(num)) +#define FCDI_EXTENDED_EVENT_PPS_COUNT_OFST 0 +#define FCDI_EXTENDED_EVENT_PPS_COUNT_LBN 0 +#define FCDI_EXTENDED_EVENT_PPS_COUNT_WIDTH 32 +#define FCDI_EXTENDED_EVENT_PPS_SECONDS_OFST 8 +#define FCDI_EXTENDED_EVENT_PPS_SECONDS_LBN 64 +#define FCDI_EXTENDED_EVENT_PPS_SECONDS_WIDTH 32 +#define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_OFST 12 +#define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_LBN 96 +#define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_WIDTH 32 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_OFST 8 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LEN 8 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LO_OFST 8 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_HI_OFST 12 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_MINNUM 1 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_MAXNUM 30 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LBN 64 +#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_WIDTH 64 /***********************************/ @@ -478,6 +602,8 @@ #define MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0 #define MC_CMD_GET_VERSION_OUT_FIRMWARE_ANY 0xffffffff /* enum */ #define MC_CMD_GET_VERSION_OUT_FIRMWARE_BOOTROM 0xb0070000 /* enum */ +#define MC_CMD_GET_VERSION_OUT_FIRMWARE_SIENA_BOOTROM 0xb0070000 /* enum */ +#define MC_CMD_GET_VERSION_OUT_FIRMWARE_HUNT_BOOTROM 0xb0070001 /* enum */ /* MC_CMD_GET_VERSION_OUT msgresponse */ #define MC_CMD_GET_VERSION_OUT_LEN 32 @@ -494,6 +620,2059 @@ /***********************************/ +/* MC_CMD_FC + * Perform an FC operation + */ +#define MC_CMD_FC 0x9 + +/* MC_CMD_FC_IN msgrequest */ +#define MC_CMD_FC_IN_LEN 4 +#define MC_CMD_FC_IN_OP_HDR_OFST 0 +#define MC_CMD_FC_IN_OP_LBN 0 +#define MC_CMD_FC_IN_OP_WIDTH 8 +#define MC_CMD_FC_OP_NULL 0x1 /* enum */ +#define MC_CMD_FC_OP_UNUSED 0x2 /* enum */ +#define MC_CMD_FC_OP_MAC 0x3 /* enum */ +#define MC_CMD_FC_OP_READ32 0x4 /* enum */ +#define MC_CMD_FC_OP_WRITE32 0x5 /* enum */ +#define MC_CMD_FC_OP_TRC_READ 0x6 /* enum */ +#define MC_CMD_FC_OP_TRC_WRITE 0x7 /* enum */ +#define MC_CMD_FC_OP_GET_VERSION 0x8 /* enum */ +#define MC_CMD_FC_OP_TRC_RX_READ 0x9 /* enum */ +#define MC_CMD_FC_OP_TRC_RX_WRITE 0xa /* enum */ +#define MC_CMD_FC_OP_SFP 0xb /* enum */ +#define MC_CMD_FC_OP_DDR_TEST 0xc /* enum */ +#define MC_CMD_FC_OP_GET_ASSERT 0xd /* enum */ +#define MC_CMD_FC_OP_FPGA_BUILD 0xe /* enum */ +#define MC_CMD_FC_OP_READ_MAP 0xf /* enum */ +#define MC_CMD_FC_OP_CAPABILITIES 0x10 /* enum */ +#define MC_CMD_FC_OP_GLOBAL_FLAGS 0x11 /* enum */ +#define MC_CMD_FC_OP_IO_REL 0x12 /* enum */ +#define MC_CMD_FC_OP_UHLINK 0x13 /* enum */ +#define MC_CMD_FC_OP_SET_LINK 0x14 /* enum */ +#define MC_CMD_FC_OP_LICENSE 0x15 /* enum */ +#define MC_CMD_FC_OP_STARTUP 0x16 /* enum */ +#define MC_CMD_FC_OP_DMA 0x17 /* enum */ +#define MC_CMD_FC_OP_TIMED_READ 0x18 /* enum */ +#define MC_CMD_FC_OP_LOG 0x19 /* enum */ +#define MC_CMD_FC_OP_CLOCK 0x1a /* enum */ +#define MC_CMD_FC_OP_DDR 0x1b /* enum */ +#define MC_CMD_FC_OP_TIMESTAMP 0x1c /* enum */ +#define MC_CMD_FC_OP_SPI 0x1d /* enum */ +#define MC_CMD_FC_OP_DIAG 0x1e /* enum */ +#define MC_CMD_FC_IN_PORT_EXT_OFST 0x0 /* enum */ +#define MC_CMD_FC_IN_PORT_INT_OFST 0x40 /* enum */ + +/* MC_CMD_FC_IN_NULL msgrequest */ +#define MC_CMD_FC_IN_NULL_LEN 4 +#define MC_CMD_FC_IN_CMD_OFST 0 + +/* MC_CMD_FC_IN_MAC msgrequest */ +#define MC_CMD_FC_IN_MAC_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_MAC_HEADER_OFST 4 +#define MC_CMD_FC_IN_MAC_OP_LBN 0 +#define MC_CMD_FC_IN_MAC_OP_WIDTH 8 +#define MC_CMD_FC_OP_MAC_OP_RECONFIGURE 0x1 /* enum */ +#define MC_CMD_FC_OP_MAC_OP_SET_LINK 0x2 /* enum */ +#define MC_CMD_FC_OP_MAC_OP_GET_STATS 0x3 /* enum */ +#define MC_CMD_FC_OP_MAC_OP_GET_RX_STATS 0x6 /* enum */ +#define MC_CMD_FC_OP_MAC_OP_GET_TX_STATS 0x7 /* enum */ +#define MC_CMD_FC_OP_MAC_OP_READ_STATUS 0x8 /* enum */ +#define MC_CMD_FC_IN_MAC_PORT_TYPE_LBN 8 +#define MC_CMD_FC_IN_MAC_PORT_TYPE_WIDTH 8 +#define MC_CMD_FC_PORT_EXT 0x0 /* enum */ +#define MC_CMD_FC_PORT_INT 0x1 /* enum */ +#define MC_CMD_FC_IN_MAC_PORT_IDX_LBN 16 +#define MC_CMD_FC_IN_MAC_PORT_IDX_WIDTH 8 +#define MC_CMD_FC_IN_MAC_CMD_FORMAT_LBN 24 +#define MC_CMD_FC_IN_MAC_CMD_FORMAT_WIDTH 8 +#define MC_CMD_FC_OP_MAC_CMD_FORMAT_DEFAULT 0x0 /* enum */ +#define MC_CMD_FC_OP_MAC_CMD_FORMAT_PORT_OVERRIDE 0x1 /* enum */ + +/* MC_CMD_FC_IN_MAC_RECONFIGURE msgrequest */ +#define MC_CMD_FC_IN_MAC_RECONFIGURE_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ + +/* MC_CMD_FC_IN_MAC_SET_LINK msgrequest */ +#define MC_CMD_FC_IN_MAC_SET_LINK_LEN 32 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ +#define MC_CMD_FC_IN_MAC_SET_LINK_MTU_OFST 8 +#define MC_CMD_FC_IN_MAC_SET_LINK_DRAIN_OFST 12 +#define MC_CMD_FC_IN_MAC_SET_LINK_ADDR_OFST 16 +#define MC_CMD_FC_IN_MAC_SET_LINK_ADDR_LEN 8 +#define MC_CMD_FC_IN_MAC_SET_LINK_ADDR_LO_OFST 16 +#define MC_CMD_FC_IN_MAC_SET_LINK_ADDR_HI_OFST 20 +#define MC_CMD_FC_IN_MAC_SET_LINK_REJECT_OFST 24 +#define MC_CMD_FC_IN_MAC_SET_LINK_REJECT_UNICAST_LBN 0 +#define MC_CMD_FC_IN_MAC_SET_LINK_REJECT_UNICAST_WIDTH 1 +#define MC_CMD_FC_IN_MAC_SET_LINK_REJECT_BRDCAST_LBN 1 +#define MC_CMD_FC_IN_MAC_SET_LINK_REJECT_BRDCAST_WIDTH 1 +#define MC_CMD_FC_IN_MAC_SET_LINK_FCNTL_OFST 28 + +/* MC_CMD_FC_IN_MAC_READ_STATUS msgrequest */ +#define MC_CMD_FC_IN_MAC_READ_STATUS_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ + +/* MC_CMD_FC_IN_MAC_GET_RX_STATS msgrequest */ +#define MC_CMD_FC_IN_MAC_GET_RX_STATS_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ + +/* MC_CMD_FC_IN_MAC_GET_TX_STATS msgrequest */ +#define MC_CMD_FC_IN_MAC_GET_TX_STATS_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ + +/* MC_CMD_FC_IN_MAC_GET_STATS msgrequest */ +#define MC_CMD_FC_IN_MAC_GET_STATS_LEN 20 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */ +#define MC_CMD_FC_IN_MAC_GET_STATS_STATS_INDEX_OFST 8 +#define MC_CMD_FC_IN_MAC_GET_STATS_FLAGS_OFST 12 +#define MC_CMD_FC_IN_MAC_GET_STATS_CLEAR_ALL_LBN 0 +#define MC_CMD_FC_IN_MAC_GET_STATS_CLEAR_ALL_WIDTH 1 +#define MC_CMD_FC_IN_MAC_GET_STATS_CLEAR_LBN 1 +#define MC_CMD_FC_IN_MAC_GET_STATS_CLEAR_WIDTH 1 +#define MC_CMD_FC_IN_MAC_GET_STATS_UPDATE_LBN 2 +#define MC_CMD_FC_IN_MAC_GET_STATS_UPDATE_WIDTH 1 +#define MC_CMD_FC_IN_MAC_GET_STATS_NUM_OFST 16 +#define MC_CMD_FC_MAC_NSTATS_PER_BLOCK 0x1e /* enum */ +#define MC_CMD_FC_MAC_NBYTES_PER_STAT 0x8 /* enum */ + +/* MC_CMD_FC_IN_READ32 msgrequest */ +#define MC_CMD_FC_IN_READ32_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_READ32_ADDR_HI_OFST 4 +#define MC_CMD_FC_IN_READ32_ADDR_LO_OFST 8 +#define MC_CMD_FC_IN_READ32_NUMWORDS_OFST 12 + +/* MC_CMD_FC_IN_WRITE32 msgrequest */ +#define MC_CMD_FC_IN_WRITE32_LENMIN 16 +#define MC_CMD_FC_IN_WRITE32_LENMAX 252 +#define MC_CMD_FC_IN_WRITE32_LEN(num) (12+4*(num)) +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_WRITE32_ADDR_HI_OFST 4 +#define MC_CMD_FC_IN_WRITE32_ADDR_LO_OFST 8 +#define MC_CMD_FC_IN_WRITE32_BUFFER_OFST 12 +#define MC_CMD_FC_IN_WRITE32_BUFFER_LEN 4 +#define MC_CMD_FC_IN_WRITE32_BUFFER_MINNUM 1 +#define MC_CMD_FC_IN_WRITE32_BUFFER_MAXNUM 60 + +/* MC_CMD_FC_IN_TRC_READ msgrequest */ +#define MC_CMD_FC_IN_TRC_READ_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TRC_READ_TRC_OFST 4 +#define MC_CMD_FC_IN_TRC_READ_CHANNEL_OFST 8 + +/* MC_CMD_FC_IN_TRC_WRITE msgrequest */ +#define MC_CMD_FC_IN_TRC_WRITE_LEN 28 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TRC_WRITE_TRC_OFST 4 +#define MC_CMD_FC_IN_TRC_WRITE_CHANNEL_OFST 8 +#define MC_CMD_FC_IN_TRC_WRITE_DATA_OFST 12 +#define MC_CMD_FC_IN_TRC_WRITE_DATA_LEN 4 +#define MC_CMD_FC_IN_TRC_WRITE_DATA_NUM 4 + +/* MC_CMD_FC_IN_GET_VERSION msgrequest */ +#define MC_CMD_FC_IN_GET_VERSION_LEN 4 +/* MC_CMD_FC_IN_CMD_OFST 0 */ + +/* MC_CMD_FC_IN_TRC_RX_READ msgrequest */ +#define MC_CMD_FC_IN_TRC_RX_READ_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TRC_RX_READ_TRC_OFST 4 +#define MC_CMD_FC_IN_TRC_RX_READ_CHANNEL_OFST 8 + +/* MC_CMD_FC_IN_TRC_RX_WRITE msgrequest */ +#define MC_CMD_FC_IN_TRC_RX_WRITE_LEN 20 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TRC_RX_WRITE_TRC_OFST 4 +#define MC_CMD_FC_IN_TRC_RX_WRITE_CHANNEL_OFST 8 +#define MC_CMD_FC_IN_TRC_RX_WRITE_DATA_OFST 12 +#define MC_CMD_FC_IN_TRC_RX_WRITE_DATA_LEN 4 +#define MC_CMD_FC_IN_TRC_RX_WRITE_DATA_NUM 2 + +/* MC_CMD_FC_IN_SFP msgrequest */ +#define MC_CMD_FC_IN_SFP_LEN 24 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_SFP_SPEED_OFST 4 +#define MC_CMD_FC_IN_SFP_COPPER_LEN_OFST 8 +#define MC_CMD_FC_IN_SFP_DUAL_SPEED_OFST 12 +#define MC_CMD_FC_IN_SFP_PRESENT_OFST 16 +#define MC_CMD_FC_IN_SFP_TYPE_OFST 20 + +/* MC_CMD_FC_IN_DDR_TEST msgrequest */ +#define MC_CMD_FC_IN_DDR_TEST_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DDR_TEST_HEADER_OFST 4 +#define MC_CMD_FC_IN_DDR_TEST_OP_LBN 0 +#define MC_CMD_FC_IN_DDR_TEST_OP_WIDTH 8 +#define MC_CMD_FC_OP_DDR_TEST_START 0x1 /* enum */ +#define MC_CMD_FC_OP_DDR_TEST_POLL 0x2 /* enum */ + +/* MC_CMD_FC_IN_DDR_TEST_START msgrequest */ +#define MC_CMD_FC_IN_DDR_TEST_START_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_DDR_TEST_HEADER_OFST 4 */ +#define MC_CMD_FC_IN_DDR_TEST_START_MASK_OFST 8 +#define MC_CMD_FC_IN_DDR_TEST_START_T0_LBN 0 +#define MC_CMD_FC_IN_DDR_TEST_START_T0_WIDTH 1 +#define MC_CMD_FC_IN_DDR_TEST_START_T1_LBN 1 +#define MC_CMD_FC_IN_DDR_TEST_START_T1_WIDTH 1 +#define MC_CMD_FC_IN_DDR_TEST_START_B0_LBN 2 +#define MC_CMD_FC_IN_DDR_TEST_START_B0_WIDTH 1 +#define MC_CMD_FC_IN_DDR_TEST_START_B1_LBN 3 +#define MC_CMD_FC_IN_DDR_TEST_START_B1_WIDTH 1 + +/* MC_CMD_FC_IN_DDR_TEST_POLL msgrequest */ +#define MC_CMD_FC_IN_DDR_TEST_POLL_LEN 8 +#define MC_CMD_FC_IN_DDR_TEST_CMD_OFST 0 +/* MC_CMD_FC_IN_DDR_TEST_HEADER_OFST 4 */ + +/* MC_CMD_FC_IN_GET_ASSERT msgrequest */ +#define MC_CMD_FC_IN_GET_ASSERT_LEN 4 +/* MC_CMD_FC_IN_CMD_OFST 0 */ + +/* MC_CMD_FC_IN_FPGA_BUILD msgrequest */ +#define MC_CMD_FC_IN_FPGA_BUILD_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_FPGA_BUILD_OP_OFST 4 +#define MC_CMD_FC_IN_FPGA_BUILD_BUILD 0x1 /* enum */ +#define MC_CMD_FC_IN_FPGA_BUILD_SERVICES 0x2 /* enum */ +#define MC_CMD_FC_IN_FPGA_BUILD_BSP_VERSION 0x3 /* enum */ + +/* MC_CMD_FC_IN_READ_MAP msgrequest */ +#define MC_CMD_FC_IN_READ_MAP_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_READ_MAP_HEADER_OFST 4 +#define MC_CMD_FC_IN_READ_MAP_OP_LBN 0 +#define MC_CMD_FC_IN_READ_MAP_OP_WIDTH 8 +#define MC_CMD_FC_OP_READ_MAP_COUNT 0x1 /* enum */ +#define MC_CMD_FC_OP_READ_MAP_INDEX 0x2 /* enum */ + +/* MC_CMD_FC_IN_READ_MAP_COUNT msgrequest */ +#define MC_CMD_FC_IN_READ_MAP_COUNT_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_READ_MAP_HEADER_OFST 4 */ + +/* MC_CMD_FC_IN_READ_MAP_INDEX msgrequest */ +#define MC_CMD_FC_IN_READ_MAP_INDEX_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_READ_MAP_HEADER_OFST 4 */ +#define MC_CMD_FC_IN_MAP_INDEX_OFST 8 + +/* MC_CMD_FC_IN_CAPABILITIES msgrequest */ +#define MC_CMD_FC_IN_CAPABILITIES_LEN 4 +/* MC_CMD_FC_IN_CMD_OFST 0 */ + +/* MC_CMD_FC_IN_GLOBAL_FLAGS msgrequest */ +#define MC_CMD_FC_IN_GLOBAL_FLAGS_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_GLOBAL_FLAGS_FLAGS_OFST 4 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_RX_TUNING_CABLE_PLUGGED_IN_LBN 0 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_RX_TUNING_CABLE_PLUGGED_IN_WIDTH 1 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_RX_TUNING_LINK_MONITORING_LBN 1 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_RX_TUNING_LINK_MONITORING_WIDTH 1 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_DFE_ENABLE_LBN 2 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_DFE_ENABLE_WIDTH 1 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_1D_EYE_ENABLE_LBN 3 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_1D_EYE_ENABLE_WIDTH 1 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_1D_TUNING_ENABLE_LBN 4 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_1D_TUNING_ENABLE_WIDTH 1 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_OFFCAL_ENABLE_LBN 5 +#define MC_CMD_FC_IN_GLOBAL_FLAGS_OFFCAL_ENABLE_WIDTH 1 + +/* MC_CMD_FC_IN_IO_REL msgrequest */ +#define MC_CMD_FC_IN_IO_REL_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_IO_REL_HEADER_OFST 4 +#define MC_CMD_FC_IN_IO_REL_OP_LBN 0 +#define MC_CMD_FC_IN_IO_REL_OP_WIDTH 8 +#define MC_CMD_FC_IN_IO_REL_GET_ADDR 0x1 /* enum */ +#define MC_CMD_FC_IN_IO_REL_READ32 0x2 /* enum */ +#define MC_CMD_FC_IN_IO_REL_WRITE32 0x3 /* enum */ +#define MC_CMD_FC_IN_IO_REL_COMP_TYPE_LBN 8 +#define MC_CMD_FC_IN_IO_REL_COMP_TYPE_WIDTH 8 +#define MC_CMD_FC_COMP_TYPE_APP_ADDR_SPACE 0x1 /* enum */ +#define MC_CMD_FC_COMP_TYPE_FLASH 0x2 /* enum */ + +/* MC_CMD_FC_IN_IO_REL_GET_ADDR msgrequest */ +#define MC_CMD_FC_IN_IO_REL_GET_ADDR_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_IO_REL_HEADER_OFST 4 */ + +/* MC_CMD_FC_IN_IO_REL_READ32 msgrequest */ +#define MC_CMD_FC_IN_IO_REL_READ32_LEN 20 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_IO_REL_HEADER_OFST 4 */ +#define MC_CMD_FC_IN_IO_REL_READ32_ADDR_HI_OFST 8 +#define MC_CMD_FC_IN_IO_REL_READ32_ADDR_LO_OFST 12 +#define MC_CMD_FC_IN_IO_REL_READ32_NUMWORDS_OFST 16 + +/* MC_CMD_FC_IN_IO_REL_WRITE32 msgrequest */ +#define MC_CMD_FC_IN_IO_REL_WRITE32_LENMIN 20 +#define MC_CMD_FC_IN_IO_REL_WRITE32_LENMAX 252 +#define MC_CMD_FC_IN_IO_REL_WRITE32_LEN(num) (16+4*(num)) +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_IO_REL_HEADER_OFST 4 */ +#define MC_CMD_FC_IN_IO_REL_WRITE32_ADDR_HI_OFST 8 +#define MC_CMD_FC_IN_IO_REL_WRITE32_ADDR_LO_OFST 12 +#define MC_CMD_FC_IN_IO_REL_WRITE32_BUFFER_OFST 16 +#define MC_CMD_FC_IN_IO_REL_WRITE32_BUFFER_LEN 4 +#define MC_CMD_FC_IN_IO_REL_WRITE32_BUFFER_MINNUM 1 +#define MC_CMD_FC_IN_IO_REL_WRITE32_BUFFER_MAXNUM 59 + +/* MC_CMD_FC_IN_UHLINK msgrequest */ +#define MC_CMD_FC_IN_UHLINK_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 +#define MC_CMD_FC_IN_UHLINK_OP_LBN 0 +#define MC_CMD_FC_IN_UHLINK_OP_WIDTH 8 +#define MC_CMD_FC_OP_UHLINK_PHY 0x1 /* enum */ +#define MC_CMD_FC_OP_UHLINK_MAC 0x2 /* enum */ +#define MC_CMD_FC_OP_UHLINK_RX_EYE 0x3 /* enum */ +#define MC_CMD_FC_OP_UHLINK_DUMP_RX_EYE_PLOT 0x4 /* enum */ +#define MC_CMD_FC_OP_UHLINK_READ_RX_EYE_PLOT 0x5 /* enum */ +#define MC_CMD_FC_OP_UHLINK_RX_TUNE 0x6 /* enum */ +#define MC_CMD_FC_OP_UHLINK_LOOPBACK_SET 0x7 /* enum */ +#define MC_CMD_FC_OP_UHLINK_LOOPBACK_GET 0x8 /* enum */ +#define MC_CMD_FC_IN_UHLINK_PORT_TYPE_LBN 8 +#define MC_CMD_FC_IN_UHLINK_PORT_TYPE_WIDTH 8 +#define MC_CMD_FC_IN_UHLINK_PORT_IDX_LBN 16 +#define MC_CMD_FC_IN_UHLINK_PORT_IDX_WIDTH 8 +#define MC_CMD_FC_IN_UHLINK_CMD_FORMAT_LBN 24 +#define MC_CMD_FC_IN_UHLINK_CMD_FORMAT_WIDTH 8 +#define MC_CMD_FC_OP_UHLINK_CMD_FORMAT_DEFAULT 0x0 /* enum */ +#define MC_CMD_FC_OP_UHLINK_CMD_FORMAT_PORT_OVERRIDE 0x1 /* enum */ + +/* MC_CMD_FC_OP_UHLINK_PHY msgrequest */ +#define MC_CMD_FC_OP_UHLINK_PHY_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ + +/* MC_CMD_FC_OP_UHLINK_MAC msgrequest */ +#define MC_CMD_FC_OP_UHLINK_MAC_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ + +/* MC_CMD_FC_OP_UHLINK_RX_EYE msgrequest */ +#define MC_CMD_FC_OP_UHLINK_RX_EYE_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ +#define MC_CMD_FC_OP_UHLINK_RX_EYE_INDEX_OFST 8 +#define MC_CMD_FC_UHLINK_RX_EYE_PER_BLOCK 0x30 /* enum */ + +/* MC_CMD_FC_OP_UHLINK_DUMP_RX_EYE_PLOT msgrequest */ +#define MC_CMD_FC_OP_UHLINK_DUMP_RX_EYE_PLOT_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ + +/* MC_CMD_FC_OP_UHLINK_READ_RX_EYE_PLOT msgrequest */ +#define MC_CMD_FC_OP_UHLINK_READ_RX_EYE_PLOT_LEN 20 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ +#define MC_CMD_FC_OP_UHLINK_READ_RX_EYE_PLOT_DC_GAIN_OFST 8 +#define MC_CMD_FC_OP_UHLINK_READ_RX_EYE_PLOT_EQ_CONTROL_OFST 12 +#define MC_CMD_FC_OP_UHLINK_READ_RX_EYE_PLOT_INDEX_OFST 16 +#define MC_CMD_FC_UHLINK_RX_EYE_PLOT_ROWS_PER_BLOCK 0x1e /* enum */ + +/* MC_CMD_FC_OP_UHLINK_RX_TUNE msgrequest */ +#define MC_CMD_FC_OP_UHLINK_RX_TUNE_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ + +/* MC_CMD_FC_OP_UHLINK_LOOPBACK_SET msgrequest */ +#define MC_CMD_FC_OP_UHLINK_LOOPBACK_SET_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ +#define MC_CMD_FC_OP_UHLINK_LOOPBACK_SET_TYPE_OFST 8 +#define MC_CMD_FC_UHLINK_LOOPBACK_TYPE_PCS_SERIAL 0x0 /* enum */ +#define MC_CMD_FC_UHLINK_LOOPBACK_TYPE_PMA_PRE_CDR 0x1 /* enum */ +#define MC_CMD_FC_UHLINK_LOOPBACK_TYPE_PMA_POST_CDR 0x2 /* enum */ +#define MC_CMD_FC_OP_UHLINK_LOOPBACK_SET_STATE_OFST 12 +#define MC_CMD_FC_UHLINK_LOOPBACK_STATE_OFF 0x0 /* enum */ +#define MC_CMD_FC_UHLINK_LOOPBACK_STATE_ON 0x1 /* enum */ + +/* MC_CMD_FC_OP_UHLINK_LOOPBACK_GET msgrequest */ +#define MC_CMD_FC_OP_UHLINK_LOOPBACK_GET_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_UHLINK_HEADER_OFST 4 */ +#define MC_CMD_FC_OP_UHLINK_LOOPBACK_GET_TYPE_OFST 8 + +/* MC_CMD_FC_IN_SET_LINK msgrequest */ +#define MC_CMD_FC_IN_SET_LINK_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_SET_LINK_MODE_OFST 4 +#define MC_CMD_FC_IN_SET_LINK_SPEED_OFST 8 +#define MC_CMD_FC_IN_SET_LINK_FLAGS_OFST 12 +#define MC_CMD_FC_IN_SET_LINK_LOWPOWER_LBN 0 +#define MC_CMD_FC_IN_SET_LINK_LOWPOWER_WIDTH 1 +#define MC_CMD_FC_IN_SET_LINK_POWEROFF_LBN 1 +#define MC_CMD_FC_IN_SET_LINK_POWEROFF_WIDTH 1 +#define MC_CMD_FC_IN_SET_LINK_TXDIS_LBN 2 +#define MC_CMD_FC_IN_SET_LINK_TXDIS_WIDTH 1 + +/* MC_CMD_FC_IN_LICENSE msgrequest */ +#define MC_CMD_FC_IN_LICENSE_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_LICENSE_OP_OFST 4 +#define MC_CMD_FC_IN_LICENSE_UPDATE_LICENSE 0x0 /* enum */ +#define MC_CMD_FC_IN_LICENSE_GET_KEY_STATS 0x1 /* enum */ + +/* MC_CMD_FC_IN_STARTUP msgrequest */ +#define MC_CMD_FC_IN_STARTUP_LEN 40 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_STARTUP_BASE_OFST 4 +#define MC_CMD_FC_IN_STARTUP_LENGTH_OFST 8 +#define MC_CMD_FC_IN_STARTUP_IDLENGTH_OFST 12 +#define MC_CMD_FC_IN_STARTUP_ID_OFST 16 +#define MC_CMD_FC_IN_STARTUP_ID_LEN 1 +#define MC_CMD_FC_IN_STARTUP_ID_NUM 24 + +/* MC_CMD_FC_IN_DMA msgrequest */ +#define MC_CMD_FC_IN_DMA_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DMA_OP_OFST 4 +#define MC_CMD_FC_IN_DMA_STOP 0x0 /* enum */ +#define MC_CMD_FC_IN_DMA_READ 0x1 /* enum */ + +/* MC_CMD_FC_IN_DMA_STOP msgrequest */ +#define MC_CMD_FC_IN_DMA_STOP_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_DMA_OP_OFST 4 */ +#define MC_CMD_FC_IN_DMA_STOP_FC_HANDLE_OFST 8 + +/* MC_CMD_FC_IN_DMA_READ msgrequest */ +#define MC_CMD_FC_IN_DMA_READ_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_DMA_OP_OFST 4 */ +#define MC_CMD_FC_IN_DMA_READ_OFFSET_OFST 8 +#define MC_CMD_FC_IN_DMA_READ_LENGTH_OFST 12 + +/* MC_CMD_FC_IN_TIMED_READ msgrequest */ +#define MC_CMD_FC_IN_TIMED_READ_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TIMED_READ_OP_OFST 4 +#define MC_CMD_FC_IN_TIMED_READ_SET 0x0 /* enum */ +#define MC_CMD_FC_IN_TIMED_READ_GET 0x1 /* enum */ +#define MC_CMD_FC_IN_TIMED_READ_CLEAR 0x2 /* enum */ + +/* MC_CMD_FC_IN_TIMED_READ_SET msgrequest */ +#define MC_CMD_FC_IN_TIMED_READ_SET_LEN 52 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_TIMED_READ_OP_OFST 4 */ +#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_HANDLE_OFST 8 +#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_DMA_ADDRESS_OFST 12 +#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_DMA_ADDRESS_LEN 8 +#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_DMA_ADDRESS_LO_OFST 12 +#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_DMA_ADDRESS_HI_OFST 16 +#define MC_CMD_FC_IN_TIMED_READ_SET_AOE_ADDRESS_OFST 20 +#define MC_CMD_FC_IN_TIMED_READ_SET_AOE_ADDRESS_LEN 8 +#define MC_CMD_FC_IN_TIMED_READ_SET_AOE_ADDRESS_LO_OFST 20 +#define MC_CMD_FC_IN_TIMED_READ_SET_AOE_ADDRESS_HI_OFST 24 +#define MC_CMD_FC_IN_TIMED_READ_SET_AOE_LENGTH_OFST 28 +#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_LENGTH_OFST 32 +#define MC_CMD_FC_IN_TIMED_READ_SET_OFFSET_OFST 36 +#define MC_CMD_FC_IN_TIMED_READ_SET_DATA_OFST 40 +#define MC_CMD_FC_IN_TIMED_READ_SET_FLAGS_OFST 44 +#define MC_CMD_FC_IN_TIMED_READ_SET_INDIRECT_LBN 0 +#define MC_CMD_FC_IN_TIMED_READ_SET_INDIRECT_WIDTH 1 +#define MC_CMD_FC_IN_TIMED_READ_SET_DOUBLE_LBN 1 +#define MC_CMD_FC_IN_TIMED_READ_SET_DOUBLE_WIDTH 1 +#define MC_CMD_FC_IN_TIMED_READ_SET_EVENT_LBN 2 +#define MC_CMD_FC_IN_TIMED_READ_SET_EVENT_WIDTH 1 +#define MC_CMD_FC_IN_TIMED_READ_SET_PREREAD_LBN 3 +#define MC_CMD_FC_IN_TIMED_READ_SET_PREREAD_WIDTH 2 +#define MC_CMD_FC_IN_TIMED_READ_SET_NONE 0x0 /* enum */ +#define MC_CMD_FC_IN_TIMED_READ_SET_READ 0x1 /* enum */ +#define MC_CMD_FC_IN_TIMED_READ_SET_WRITE 0x2 /* enum */ +#define MC_CMD_FC_IN_TIMED_READ_SET_READWRITE 0x3 /* enum */ +#define MC_CMD_FC_IN_TIMED_READ_SET_PERIOD_OFST 48 + +/* MC_CMD_FC_IN_TIMED_READ_GET msgrequest */ +#define MC_CMD_FC_IN_TIMED_READ_GET_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_TIMED_READ_OP_OFST 4 */ +#define MC_CMD_FC_IN_TIMED_READ_GET_FC_HANDLE_OFST 8 + +/* MC_CMD_FC_IN_TIMED_READ_CLEAR msgrequest */ +#define MC_CMD_FC_IN_TIMED_READ_CLEAR_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_TIMED_READ_OP_OFST 4 */ +#define MC_CMD_FC_IN_TIMED_READ_CLEAR_FC_HANDLE_OFST 8 + +/* MC_CMD_FC_IN_LOG msgrequest */ +#define MC_CMD_FC_IN_LOG_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_LOG_OP_OFST 4 +#define MC_CMD_FC_IN_LOG_ADDR_RANGE 0x0 /* enum */ +#define MC_CMD_FC_IN_LOG_JTAG_UART 0x1 /* enum */ + +/* MC_CMD_FC_IN_LOG_ADDR_RANGE msgrequest */ +#define MC_CMD_FC_IN_LOG_ADDR_RANGE_LEN 20 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_LOG_OP_OFST 4 */ +#define MC_CMD_FC_IN_LOG_ADDR_RANGE_OFFSET_OFST 8 +#define MC_CMD_FC_IN_LOG_ADDR_RANGE_LENGTH_OFST 12 +#define MC_CMD_FC_IN_LOG_ADDR_RANGE_ERASE_SIZE_OFST 16 + +/* MC_CMD_FC_IN_LOG_JTAG_UART msgrequest */ +#define MC_CMD_FC_IN_LOG_JTAG_UART_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_LOG_OP_OFST 4 */ +#define MC_CMD_FC_IN_LOG_JTAG_UART_ENABLE_OFST 8 + +/* MC_CMD_FC_IN_CLOCK msgrequest */ +#define MC_CMD_FC_IN_CLOCK_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_CLOCK_OP_OFST 4 +#define MC_CMD_FC_IN_CLOCK_GET_TIME 0x0 /* enum */ +#define MC_CMD_FC_IN_CLOCK_SET_TIME 0x1 /* enum */ +#define MC_CMD_FC_IN_CLOCK_ID_OFST 8 +#define MC_CMD_FC_IN_CLOCK_STATS 0x0 /* enum */ +#define MC_CMD_FC_IN_CLOCK_MAC 0x1 /* enum */ + +/* MC_CMD_FC_IN_CLOCK_GET_TIME msgrequest */ +#define MC_CMD_FC_IN_CLOCK_GET_TIME_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_CLOCK_OP_OFST 4 */ +/* MC_CMD_FC_IN_CLOCK_ID_OFST 8 */ + +/* MC_CMD_FC_IN_CLOCK_SET_TIME msgrequest */ +#define MC_CMD_FC_IN_CLOCK_SET_TIME_LEN 24 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_CLOCK_OP_OFST 4 */ +/* MC_CMD_FC_IN_CLOCK_ID_OFST 8 */ +#define MC_CMD_FC_IN_CLOCK_SET_TIME_SECONDS_OFST 12 +#define MC_CMD_FC_IN_CLOCK_SET_TIME_SECONDS_LEN 8 +#define MC_CMD_FC_IN_CLOCK_SET_TIME_SECONDS_LO_OFST 12 +#define MC_CMD_FC_IN_CLOCK_SET_TIME_SECONDS_HI_OFST 16 +#define MC_CMD_FC_IN_CLOCK_SET_TIME_NANOSECONDS_OFST 20 + +/* MC_CMD_FC_IN_DDR msgrequest */ +#define MC_CMD_FC_IN_DDR_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DDR_OP_OFST 4 +#define MC_CMD_FC_IN_DDR_SET_SPD 0x0 /* enum */ +#define MC_CMD_FC_IN_DDR_GET_STATUS 0x1 /* enum */ +#define MC_CMD_FC_IN_DDR_BANK_OFST 8 +#define MC_CMD_FC_IN_DDR_BANK_B0 0x0 /* enum */ +#define MC_CMD_FC_IN_DDR_BANK_B1 0x1 /* enum */ +#define MC_CMD_FC_IN_DDR_BANK_T0 0x2 /* enum */ +#define MC_CMD_FC_IN_DDR_BANK_T1 0x3 /* enum */ +#define MC_CMD_FC_IN_DDR_NUM_BANKS 0x4 /* enum */ + +/* MC_CMD_FC_IN_DDR_SET_SPD msgrequest */ +#define MC_CMD_FC_IN_DDR_SET_SPD_LEN 148 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_DDR_OP_OFST 4 */ +/* MC_CMD_FC_IN_DDR_BANK_OFST 8 */ +#define MC_CMD_FC_IN_DDR_FLAGS_OFST 12 +#define MC_CMD_FC_IN_DDR_SET_SPD_ACTIVE 0x1 /* enum */ +#define MC_CMD_FC_IN_DDR_SPD_OFST 16 +#define MC_CMD_FC_IN_DDR_SPD_LEN 1 +#define MC_CMD_FC_IN_DDR_SPD_NUM 128 +#define MC_CMD_FC_IN_DDR_SPD_PAGE_ID_OFST 144 + +/* MC_CMD_FC_IN_DDR_GET_STATUS msgrequest */ +#define MC_CMD_FC_IN_DDR_GET_STATUS_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +/* MC_CMD_FC_IN_DDR_OP_OFST 4 */ +/* MC_CMD_FC_IN_DDR_BANK_OFST 8 */ + +/* MC_CMD_FC_IN_TIMESTAMP msgrequest */ +#define MC_CMD_FC_IN_TIMESTAMP_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TIMESTAMP_OP_OFST 4 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT 0x0 /* enum */ +#define MC_CMD_FC_IN_TIMESTAMP_READ_SNAPSHOT 0x1 /* enum */ +#define MC_CMD_FC_IN_TIMESTAMP_CLEAR_TRANSMIT 0x2 /* enum */ + +/* MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT msgrequest */ +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_LEN 28 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_OP_OFST 4 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_FILTER_OFST 8 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_LATEST 0x0 /* enum */ +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_MATCH 0x1 /* enum */ +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_CLOCK_ID_OFST 12 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_CLOCK_ID_LEN 8 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_CLOCK_ID_LO_OFST 12 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_CLOCK_ID_HI_OFST 16 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_PORT_NUM_OFST 20 +#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_SEQ_NUM_OFST 24 + +/* MC_CMD_FC_IN_TIMESTAMP_READ_SNAPSHOT msgrequest */ +#define MC_CMD_FC_IN_TIMESTAMP_READ_SNAPSHOT_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TIMESTAMP_READ_SNAPSHOT_OP_OFST 4 + +/* MC_CMD_FC_IN_TIMESTAMP_CLEAR_TRANSMIT msgrequest */ +#define MC_CMD_FC_IN_TIMESTAMP_CLEAR_TRANSMIT_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_TIMESTAMP_CLEAR_TRANSMIT_OP_OFST 4 + +/* MC_CMD_FC_IN_SPI msgrequest */ +#define MC_CMD_FC_IN_SPI_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_SPI_OP_OFST 4 +#define MC_CMD_FC_IN_SPI_READ 0x0 /* enum */ +#define MC_CMD_FC_IN_SPI_WRITE 0x1 /* enum */ +#define MC_CMD_FC_IN_SPI_ERASE 0x2 /* enum */ + +/* MC_CMD_FC_IN_SPI_READ msgrequest */ +#define MC_CMD_FC_IN_SPI_READ_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_SPI_READ_OP_OFST 4 +#define MC_CMD_FC_IN_SPI_READ_ADDR_OFST 8 +#define MC_CMD_FC_IN_SPI_READ_NUMBYTES_OFST 12 + +/* MC_CMD_FC_IN_SPI_WRITE msgrequest */ +#define MC_CMD_FC_IN_SPI_WRITE_LENMIN 16 +#define MC_CMD_FC_IN_SPI_WRITE_LENMAX 252 +#define MC_CMD_FC_IN_SPI_WRITE_LEN(num) (12+4*(num)) +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_SPI_WRITE_OP_OFST 4 +#define MC_CMD_FC_IN_SPI_WRITE_ADDR_OFST 8 +#define MC_CMD_FC_IN_SPI_WRITE_BUFFER_OFST 12 +#define MC_CMD_FC_IN_SPI_WRITE_BUFFER_LEN 4 +#define MC_CMD_FC_IN_SPI_WRITE_BUFFER_MINNUM 1 +#define MC_CMD_FC_IN_SPI_WRITE_BUFFER_MAXNUM 60 + +/* MC_CMD_FC_IN_SPI_ERASE msgrequest */ +#define MC_CMD_FC_IN_SPI_ERASE_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_SPI_ERASE_OP_OFST 4 +#define MC_CMD_FC_IN_SPI_ERASE_ADDR_OFST 8 +#define MC_CMD_FC_IN_SPI_ERASE_NUMBYTES_OFST 12 + +/* MC_CMD_FC_IN_DIAG msgrequest */ +#define MC_CMD_FC_IN_DIAG_LEN 8 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_POWER_NOISE 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK 0x1 /* enum */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL 0x2 /* enum */ + +/* MC_CMD_FC_IN_DIAG_POWER_NOISE msgrequest */ +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_READ_CONFIG 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG 0x1 /* enum */ + +/* MC_CMD_FC_IN_DIAG_POWER_NOISE_READ_CONFIG msgrequest */ +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_READ_CONFIG_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_READ_CONFIG_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_READ_CONFIG_SUB_OP_OFST 8 + +/* MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG msgrequest */ +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG_LEN 20 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG_TOGGLE_COUNT_OFST 12 +#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG_CLKEN_COUNT_OFST 16 + +/* MC_CMD_FC_IN_DIAG_DDR_SOAK msgrequest */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT 0x1 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP 0x2 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR 0x3 /* enum */ + +/* MC_CMD_FC_IN_DIAG_DDR_SOAK_START msgrequest */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_LEN 24 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_BANK_MASK_OFST 12 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_TEST_PATTERN_OFST 16 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_ZEROS 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_ONES 0x1 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_TEST_TYPE_OFST 20 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_ONGOING_TEST 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_SINGLE_TEST 0x1 /* enum */ + +/* MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT msgrequest */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT_BANK_ID_OFST 12 +#define MC_CMD_FC_DDR_BANK0 0x0 /* enum */ +#define MC_CMD_FC_DDR_BANK1 0x1 /* enum */ +#define MC_CMD_FC_DDR_BANK2 0x2 /* enum */ +#define MC_CMD_FC_DDR_BANK3 0x3 /* enum */ +#define MC_CMD_FC_DDR_AOEMEM_MAX_BANKS 0x4 /* enum */ + +/* MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP msgrequest */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP_BANK_MASK_OFST 12 + +/* MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR msgrequest */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_LEN 20 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_BANK_MASK_OFST 12 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_FLAG_ACTION_OFST 16 +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_CLEAR 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_SET 0x1 /* enum */ + +/* MC_CMD_FC_IN_DIAG_DATAPATH_CTRL msgrequest */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_LEN 12 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG 0x1 /* enum */ + +/* MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE msgrequest */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_LEN 16 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_MODE_OFST 12 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_PASSTHROUGH 0x0 /* enum */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_SNAKE 0x1 /* enum */ + +/* MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG msgrequest */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_LEN 24 +/* MC_CMD_FC_IN_CMD_OFST 0 */ +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_OP_OFST 4 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_SUB_OP_OFST 8 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_CONTROL1_OFST 12 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_CONTROL2_OFST 16 +#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_CONTROL3_OFST 20 + +/* MC_CMD_FC_OUT msgresponse */ +#define MC_CMD_FC_OUT_LEN 0 + +/* MC_CMD_FC_OUT_NULL msgresponse */ +#define MC_CMD_FC_OUT_NULL_LEN 0 + +/* MC_CMD_FC_OUT_READ32 msgresponse */ +#define MC_CMD_FC_OUT_READ32_LENMIN 4 +#define MC_CMD_FC_OUT_READ32_LENMAX 252 +#define MC_CMD_FC_OUT_READ32_LEN(num) (0+4*(num)) +#define MC_CMD_FC_OUT_READ32_BUFFER_OFST 0 +#define MC_CMD_FC_OUT_READ32_BUFFER_LEN 4 +#define MC_CMD_FC_OUT_READ32_BUFFER_MINNUM 1 +#define MC_CMD_FC_OUT_READ32_BUFFER_MAXNUM 63 + +/* MC_CMD_FC_OUT_WRITE32 msgresponse */ +#define MC_CMD_FC_OUT_WRITE32_LEN 0 + +/* MC_CMD_FC_OUT_TRC_READ msgresponse */ +#define MC_CMD_FC_OUT_TRC_READ_LEN 16 +#define MC_CMD_FC_OUT_TRC_READ_DATA_OFST 0 +#define MC_CMD_FC_OUT_TRC_READ_DATA_LEN 4 +#define MC_CMD_FC_OUT_TRC_READ_DATA_NUM 4 + +/* MC_CMD_FC_OUT_TRC_WRITE msgresponse */ +#define MC_CMD_FC_OUT_TRC_WRITE_LEN 0 + +/* MC_CMD_FC_OUT_GET_VERSION msgresponse */ +#define MC_CMD_FC_OUT_GET_VERSION_LEN 12 +#define MC_CMD_FC_OUT_GET_VERSION_FIRMWARE_OFST 0 +#define MC_CMD_FC_OUT_GET_VERSION_VERSION_OFST 4 +#define MC_CMD_FC_OUT_GET_VERSION_VERSION_LEN 8 +#define MC_CMD_FC_OUT_GET_VERSION_VERSION_LO_OFST 4 +#define MC_CMD_FC_OUT_GET_VERSION_VERSION_HI_OFST 8 + +/* MC_CMD_FC_OUT_TRC_RX_READ msgresponse */ +#define MC_CMD_FC_OUT_TRC_RX_READ_LEN 8 +#define MC_CMD_FC_OUT_TRC_RX_READ_DATA_OFST 0 +#define MC_CMD_FC_OUT_TRC_RX_READ_DATA_LEN 4 +#define MC_CMD_FC_OUT_TRC_RX_READ_DATA_NUM 2 + +/* MC_CMD_FC_OUT_TRC_RX_WRITE msgresponse */ +#define MC_CMD_FC_OUT_TRC_RX_WRITE_LEN 0 + +/* MC_CMD_FC_OUT_MAC_RECONFIGURE msgresponse */ +#define MC_CMD_FC_OUT_MAC_RECONFIGURE_LEN 0 + +/* MC_CMD_FC_OUT_MAC_SET_LINK msgresponse */ +#define MC_CMD_FC_OUT_MAC_SET_LINK_LEN 0 + +/* MC_CMD_FC_OUT_MAC_READ_STATUS msgresponse */ +#define MC_CMD_FC_OUT_MAC_READ_STATUS_LEN 4 +#define MC_CMD_FC_OUT_MAC_READ_STATUS_STATUS_OFST 0 + +/* MC_CMD_FC_OUT_MAC_GET_RX_STATS msgresponse */ +#define MC_CMD_FC_OUT_MAC_GET_RX_STATS_LEN ((((0-1+(64*MC_CMD_FC_MAC_RX_NSTATS))+1))>>3) +#define MC_CMD_FC_OUT_MAC_GET_RX_STATS_STATISTICS_OFST 0 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 07:58:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE0AEB74; Fri, 20 Feb 2015 07:58:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 CEF9B1A1; Fri, 20 Feb 2015 07:58:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1K7w0KJ009850; Fri, 20 Feb 2015 07:58:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1K7vxZw009835; Fri, 20 Feb 2015 07:57:59 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502200757.t1K7vxZw009835@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 20 Feb 2015 07:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279048 - head/sys/dev/sfxge/common 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 07:58:01 -0000 Author: arybchik Date: Fri Feb 20 07:57:59 2015 New Revision: 279048 URL: https://svnweb.freebsd.org/changeset/base/279048 Log: sfxge: add Florence R7 turbo mode support to common code Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Feb 20 07:54:35 2015 (r279047) +++ head/sys/dev/sfxge/common/efx.h Fri Feb 20 07:57:59 2015 (r279048) @@ -861,6 +861,7 @@ efx_phy_bist_stop( #define EFX_FEATURE_MCDI 0x00000020 #define EFX_FEATURE_LOOKAHEAD_SPLIT 0x00000040 #define EFX_FEATURE_MAC_HEADER_FILTERS 0x00000080 +#define EFX_FEATURE_TURBO 0x00000100 typedef struct efx_nic_cfg_s { uint32_t enc_board_type; @@ -881,6 +882,7 @@ typedef struct efx_nic_cfg_s { uint32_t enc_rxq_limit; uint32_t enc_buftbl_limit; uint32_t enc_evq_moderation_max; + uint32_t enc_clk_mult; #if EFSYS_OPT_LOOPBACK uint32_t enc_loopback_types[EFX_LINK_NMODES]; #endif /* EFSYS_OPT_LOOPBACK */ Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Fri Feb 20 07:54:35 2015 (r279047) +++ head/sys/dev/sfxge/common/efx_ev.c Fri Feb 20 07:57:59 2015 (r279048) @@ -844,13 +844,14 @@ efx_ev_qmoderate( __in unsigned int us) { efx_nic_t *enp = eep->ee_enp; + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); unsigned int locked; efx_dword_t dword; int rc; EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); - if (us > enp->en_nic_cfg.enc_evq_moderation_max) { + if (us > encp->enc_evq_moderation_max) { rc = EINVAL; goto fail1; } @@ -869,21 +870,20 @@ efx_ev_qmoderate( uint32_t timer_val; /* Calculate the timer value in quanta */ - us -= (us % EFX_EV_TIMER_QUANTUM); - if (us < EFX_EV_TIMER_QUANTUM) - us = EFX_EV_TIMER_QUANTUM; - - timer_val = us / EFX_EV_TIMER_QUANTUM; + timer_val = us * encp->enc_clk_mult / EFX_EV_TIMER_QUANTUM; /* Moderation value is base 0 so we need to deduct 1 */ + if (timer_val > 0) + timer_val--; + if (enp->en_family == EFX_FAMILY_FALCON) EFX_POPULATE_DWORD_2(dword, FRF_AB_TC_TIMER_MODE, FFE_AB_TIMER_MODE_INT_HLDOFF, - FRF_AB_TIMER_VAL, timer_val - 1); + FRF_AB_TIMER_VAL, timer_val); else EFX_POPULATE_DWORD_2(dword, FRF_CZ_TC_TIMER_MODE, FFE_CZ_TIMER_MODE_INT_HLDOFF, - FRF_CZ_TC_TIMER_VAL, timer_val - 1); + FRF_CZ_TC_TIMER_VAL, timer_val); } locked = (eep->ee_index == 0) ? 1 : 0; Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Fri Feb 20 07:54:35 2015 (r279047) +++ head/sys/dev/sfxge/common/efx_mcdi.h Fri Feb 20 07:57:59 2015 (r279048) @@ -233,6 +233,9 @@ efx_mcdi_version( #define MCDI_EV_FIELD(_eqp, _field) \ EFX_QWORD_FIELD(*_eqp, MCDI_EVENT_ ## _field) +#define MCDI_CMD_DWORD_FIELD(_edp, _field) \ + EFX_DWORD_FIELD(*_edp, MC_CMD_ ## _field) + #ifdef __cplusplus } #endif Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Fri Feb 20 07:54:35 2015 (r279047) +++ head/sys/dev/sfxge/common/siena_nic.c Fri Feb 20 07:57:59 2015 (r279048) @@ -279,7 +279,8 @@ siena_board_cfg( uint8_t outbuf[MAX(MC_CMD_GET_BOARD_CFG_OUT_LENMIN, MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN)]; efx_mcdi_req_t req; - uint8_t *src; + uint8_t *mac_addr; + efx_dword_t *capabilities; int rc; /* Board configuration */ @@ -302,17 +303,35 @@ siena_board_cfg( goto fail2; } - if (emip->emi_port == 1) - src = MCDI_OUT2(req, uint8_t, + if (emip->emi_port == 1) { + mac_addr = MCDI_OUT2(req, uint8_t, GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0); - else - src = MCDI_OUT2(req, uint8_t, + capabilities = MCDI_OUT2(req, efx_dword_t, + GET_BOARD_CFG_OUT_CAPABILITIES_PORT0); + } else { + mac_addr = MCDI_OUT2(req, uint8_t, GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT1); - EFX_MAC_ADDR_COPY(encp->enc_mac_addr, src); + capabilities = MCDI_OUT2(req, efx_dword_t, + GET_BOARD_CFG_OUT_CAPABILITIES_PORT1); + } + EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); encp->enc_board_type = MCDI_OUT_DWORD(req, GET_BOARD_CFG_OUT_BOARD_TYPE); + /* Additional capabilities */ + encp->enc_clk_mult = 1; + if (MCDI_CMD_DWORD_FIELD(capabilities, CAPABILITIES_TURBO)) { + enp->en_features |= EFX_FEATURE_TURBO; + + if (MCDI_CMD_DWORD_FIELD(capabilities, + CAPABILITIES_TURBO_ACTIVE)) + encp->enc_clk_mult = 2; + } + + encp->enc_evq_moderation_max = EFX_EV_TIMER_QUANTUM << + FRF_AB_TIMER_VAL_WIDTH / encp->enc_clk_mult; + /* Resource limits */ req.emr_cmd = MC_CMD_GET_RESOURCE_LIMITS; EFX_STATIC_ASSERT(MC_CMD_GET_RESOURCE_LIMITS_IN_LEN == 0); @@ -608,9 +627,6 @@ siena_nic_probe( if ((rc = siena_board_cfg(enp)) != 0) goto fail4; - encp->enc_evq_moderation_max = - EFX_EV_TIMER_QUANTUM << FRF_CZ_TIMER_VAL_WIDTH; - if ((rc = siena_phy_cfg(enp)) != 0) goto fail5; From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 08:34:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43E7343A; Fri, 20 Feb 2015 08:34:12 +0000 (UTC) Received: from mail-wg0-x232.google.com (mail-wg0-x232.google.com [IPv6:2a00:1450:400c:c00::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 C3D967B8; Fri, 20 Feb 2015 08:34:11 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id l2so11691624wgh.9; Fri, 20 Feb 2015 00:34:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=NJ65Z+1dNxZAxQIAGeBMnL8hPcnFoPizauRzM2Aiysw=; b=tzHWjydQiRIYJbFz4GnfztKGz79V7R6rvhMKjEQQalop/pd5oXVsWU0YfFIy35g8fz CKNrTp2StPYgnjgim4KCs8+omMO/6NpjeRyXBSdP1jtg4hl2VlJd2xmwbfxgioeUe2eU Nyx1uBD52c6A3fYPBmHP6wErCUDG/e6JSPiKmRAMM7OrZbqdL2+wYWs0yFvPjBaknv6a 5Oj+tjWzhuyQvL8o39t7oloQZ+o74QEVbRjvnG9SVituDKk0C+H6owGwYYR0dOp7VY87 oL/E89yn6vSSHDuTOMKX28h7Z6Ip0cfft2KXGBBpvkXoBgSd72YhJE+D4nbAtun2Uf2t eq7Q== X-Received: by 10.180.12.233 with SMTP id b9mr13540024wic.49.1424421250271; Fri, 20 Feb 2015 00:34:10 -0800 (PST) Received: from [172.16.1.30] (150.Red-81-39-62.dynamicIP.rima-tde.net. [81.39.62.150]) by mx.google.com with ESMTPSA id u18sm40975220wjq.42.2015.02.20.00.34.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Feb 2015 00:34:09 -0800 (PST) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Message-ID: <54E6F17A.4020702@FreeBSD.org> Date: Fri, 20 Feb 2015 09:34:02 +0100 From: =?windows-1252?Q?Roger_Pau_Monn=E9?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r278977 - in head/sys: dev/cxgb dev/cxgb/sys dev/cxgb/ulp/tom dev/xen/netfront sys References: <201502190119.t1J1JhSI025601@svn.freebsd.org> <54E62FB6.6050800@FreeBSD.org> <20150219200257.GK15484@FreeBSD.org> In-Reply-To: <20150219200257.GK15484@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 20 Feb 2015 08:34:12 -0000 El 19/02/15 a les 21.02, Gleb Smirnoff ha escrit: > On Thu, Feb 19, 2015 at 07:47:18PM +0100, Roger Pau Monné wrote: > R> El 19/02/15 a les 2.19, Gleb Smirnoff ha escrit: > R> > Author: glebius > R> > Date: Thu Feb 19 01:19:42 2015 > R> > New Revision: 278977 > R> > URL: https://svnweb.freebsd.org/changeset/base/278977 > R> > > R> > Log: > R> > Provide a set of inline functions to manage simple mbuf(9) queues, based > R> > on queue(3)'s STAILQ. Utilize them in cxgb(4) and Xen, deleting home > R> > grown implementations. > R> > > R> > Sponsored by: Netflix > R> > Sponsored by: Nginx, Inc. > R> > R> Have you tested this commit on Xen? I'm getting the following: > R> > R> xn0: at device/vif/0 on xenbusb_front0 > R> xn0: Ethernet address: 00:16:3e:51:85:e3 > R> xenbusb_back0: on xenstore0 > R> xbd0: Back-end specified ring-pages of 15 is not a power of 2. Limited to 8. > R> xn0: backend features: feature-sg feature-gso-tcp4 > R> panic: no mbufs processed > R> cpuid = 0 > R> KDB: stack backtrace: > R> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe007adc3920 > R> vpanic() at vpanic+0x189/frame 0xfffffe007adc39a0 > R> kassert_panic() at kassert_panic+0x132/frame 0xfffffe007adc3a10 > R> network_alloc_rx_buffers() at network_alloc_rx_buffers+0x439/frame 0xfffffe007adc3ac0 > R> network_connect() at network_connect+0xac1/frame 0xfffffe007adc3b50 > R> netfront_backend_changed() at netfront_backend_changed+0xed/frame 0xfffffe007adc3b90 > R> xenwatch_thread() at xenwatch_thread+0x1a2/frame 0xfffffe007adc3bb0 > R> fork_exit() at fork_exit+0x84/frame 0xfffffe007adc3bf0 > R> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe007adc3bf0 > R> --- trap 0, rip = 0, rsp = 0xfffffe007adc3cb0, rbp = 0 --- > R> KDB: enter: panic > R> [ thread pid 15 tid 100038 ] > R> Stopped at kdb_enter+0x3e: movq $0,kdb_why > > I guess the problem is that the queue limit isn't initialized. Please > try the attached patch. > > The problem with older mbufq was that it doesn't have any sane limit > on it. So, converting to new, I simply put INT_MAX, which is ugly. > > I'd appreciate if you fix mbufq_init()s in netfront.c to some appropriate > values. Hello, I've tried the attached patch and now I get a different panic: [...] xn0: at device/vif/0 on xenbusb_front0 xn0: Ethernet address: 00:16:3e:0a:80:c2 xenbusb_back0: on xenstore0 xbd0: Back-end specified ring-pages of 15 is not a power of 2. Limited to 8. xn0: backend features: feature-sg feature-gso-tcp4 xbd0: Fatal trap 9: general protection fault while in kernel mode cpuid = 0; apic id = 00 instruction pointer = 0x20:0xffffffff80b0c60b stack pointer = 0x28:0xfffffe0096c18960 frame pointer = 0x28:0xfffffe0096c18a30 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 12 (irq778: xn0) [ thread pid 12 tid 100052 ] Stopped at tcp_lro_rx+0x1b: movw 0xc(%rbx),%r15w db> bt Tracing pid 12 tid 100052 td 0xfffff80002da2940 tcp_lro_rx() at tcp_lro_rx+0x1b/frame 0xfffffe0096c18a30 xn_intr() at xn_intr+0xa12/frame 0xfffffe0096c18b30 intr_event_execute_handlers() at intr_event_execute_handlers+0xe1/frame 0xfffffe0096c18b70 ithread_loop() at ithread_loop+0xac/frame 0xfffffe0096c18bb0 fork_exit() at fork_exit+0x84/frame 0xfffffe0096c18bf0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0096c18bf0 --- trap 0, rip = 0, rsp = 0xfffffe0096c18cb0, rbp = 0 --- db> addr2line however seems to be unable to resolve the IP address to a line number: # addr2line -e /boot/kernel/kernel ffffffff80b0c60b ??:0 Roger. From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 09:30:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CDD3198; Fri, 20 Feb 2015 09:30:21 +0000 (UTC) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (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 0A831D05; Fri, 20 Feb 2015 09:30:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id t1K9PoRT095162; Fri, 20 Feb 2015 12:25:50 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Fri, 20 Feb 2015 12:25:50 +0300 (MSK) From: Dmitry Morozovsky To: Gleb Smirnoff Subject: Re: svn commit: r279030 - in head/sys: net netinet netinet6 In-Reply-To: <201502192316.t1JNGALg060789@svn.freebsd.org> Message-ID: References: <201502192316.t1JNGALg060789@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Fri, 20 Feb 2015 12:25:50 +0300 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 20 Feb 2015 09:30:21 -0000 On Thu, 19 Feb 2015, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Feb 19 23:16:10 2015 > New Revision: 279030 > URL: https://svnweb.freebsd.org/changeset/base/279030 > > Log: > Now that all users of _WANT_IFADDR are fixed, remove this crutch and > hide ifaddr, in_ifaddr and in6_ifaddr under _KERNEL. Wow, finally! ;) -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 10:25:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6F1CC57; Fri, 20 Feb 2015 10:25:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 87E88338; Fri, 20 Feb 2015 10:25:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KAPEGw080318; Fri, 20 Feb 2015 10:25:14 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KAPEjs080317; Fri, 20 Feb 2015 10:25:14 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201502201025.t1KAPEjs080317@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 20 Feb 2015 10:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279050 - head/share/man/man4/man4.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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 10:25:14 -0000 Author: brueffer Date: Fri Feb 20 10:25:13 2015 New Revision: 279050 URL: https://svnweb.freebsd.org/changeset/base/279050 Log: Apply mdoc style. MFC after: 1 week Modified: head/share/man/man4/man4.powerpc/tsec.4 Modified: head/share/man/man4/man4.powerpc/tsec.4 ============================================================================== --- head/share/man/man4/man4.powerpc/tsec.4 Fri Feb 20 09:25:13 2015 (r279049) +++ head/share/man/man4/man4.powerpc/tsec.4 Fri Feb 20 10:25:13 2015 (r279050) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 22, 2009 +.Dd February 20, 2015 .Dt TSEC 4 .Os .Sh NAME @@ -91,18 +91,23 @@ The driver supports interrupts coalescing (IC) so that raising a transmit/receive frame interrupt is delayed, if possible, until a threshold-defined period of time has elapsed, or a threshold-defined frame counter has been reached -(whichever occurs first). The following sysctls regulate this behaviour: +(whichever occurs first). +The following sysctls regulate this behaviour: .Bl -tag -width indent .It Va dev.tsec.X.int_coal.rx_time .It Va dev.tsec.X.int_coal.rx_count .It Va dev.tsec.X.int_coal.tx_time .It Va dev.tsec.X.int_coal.tx_count .Pp -Value of 0 for either time or count disables IC on the given path. Time value +Value of 0 for either time or count disables IC on the given path. +Time value 1-65535 corresponds to a real time period and is expressed in units equivalent -to 64 ticks of the TSEC clock. Count 1-255 represents the number of frames -(note that value of 1 is equivalent to IC disabled). User provided values -larger than supported will be trimmed to the maximum supported. More details +to 64 ticks of the TSEC clock. +Count 1-255 represents the number of frames +(note that value of 1 is equivalent to IC disabled). +User provided values +larger than supported will be trimmed to the maximum supported. +More details are available in the reference manual of the device. .El .Sh HARDWARE @@ -144,9 +149,9 @@ device driver first appeared in The base version of .Nm device driver was written by -.An Piotr Kruszynski. +.An Piotr Kruszynski . It has been extended with polling and interrupt coalescing support by -.An Rafal Jaworowski. +.An Rafal Jaworowski . It has been further enhanced with multicast, h/w checksum calculation and vlan support by .An Piotr Ziecik . From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 11:23:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D636F53C; Fri, 20 Feb 2015 11:23:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C18BBAC3; Fri, 20 Feb 2015 11:23:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KBNgwG008147; Fri, 20 Feb 2015 11:23:42 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KBNgjX008146; Fri, 20 Feb 2015 11:23:42 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201502201123.t1KBNgjX008146@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 20 Feb 2015 11:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279051 - head/share/man/man4/man4.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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 11:23:42 -0000 Author: brueffer Date: Fri Feb 20 11:23:41 2015 New Revision: 279051 URL: https://svnweb.freebsd.org/changeset/base/279051 Log: Properly mark up author name. Modified: head/share/man/man4/man4.arm/devcfg.4 Modified: head/share/man/man4/man4.arm/devcfg.4 ============================================================================== --- head/share/man/man4/man4.arm/devcfg.4 Fri Feb 20 10:25:13 2015 (r279050) +++ head/share/man/man4/man4.arm/devcfg.4 Fri Feb 20 11:23:41 2015 (r279051) @@ -92,4 +92,4 @@ driver. .Sh SEE ALSO Zynq-7000 SoC Technical Reference Manual (Xilinx doc UG585) .Sh AUTHORS -Thomas Skibo +.An Thomas Skibo From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 13:50:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73697FF2; Fri, 20 Feb 2015 13:50:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5EA12CB0; Fri, 20 Feb 2015 13:50:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KDoosS077596; Fri, 20 Feb 2015 13:50:50 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KDooSa077595; Fri, 20 Feb 2015 13:50:50 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201502201350.t1KDooSa077595@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 20 Feb 2015 13:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279054 - head/share/man/man4/man4.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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 13:50:51 -0000 Author: brueffer Date: Fri Feb 20 13:50:50 2015 New Revision: 279054 URL: https://svnweb.freebsd.org/changeset/base/279054 Log: Properly mark up author name. Modified: head/share/man/man4/man4.i386/apm.4 Modified: head/share/man/man4/man4.i386/apm.4 ============================================================================== --- head/share/man/man4/man4.i386/apm.4 Fri Feb 20 13:34:12 2015 (r279053) +++ head/share/man/man4/man4.i386/apm.4 Fri Feb 20 13:50:50 2015 (r279054) @@ -121,7 +121,7 @@ polls APM events and handles the followi .Xr apm 8 , .Xr zzz 8 .Sh AUTHORS -Tatsumi Hosokawa +.An Tatsumi Hosokawa Aq Mt hosokawa@jp.FreeBSD.org .Sh BUGS WARNING! Many, if not most, of the implementations of APM-bios in laptops From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 17:45:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A449CECC; Fri, 20 Feb 2015 17:45:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8C9C4E1E; Fri, 20 Feb 2015 17:45:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KHjvNa089763; Fri, 20 Feb 2015 17:45:57 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KHjv9U089762; Fri, 20 Feb 2015 17:45:57 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201745.t1KHjv9U089762@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 17:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279057 - head/release/doc/en_US.ISO8859-1/relnotes 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 17:45:57 -0000 Author: gjb Date: Fri Feb 20 17:45:56 2015 New Revision: 279057 URL: https://svnweb.freebsd.org/changeset/base/279057 Log: Document r277610, futimens(2) and utimensat(2) added. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:10:46 2015 (r279056) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:45:56 2015 (r279057) @@ -460,6 +460,10 @@ The &man.gpio.3; library has been added, providing a wrapper around the &man.gpio.4; kernel interface. + + The futimens() and + utimensat() system calls have been + added. See &man.utimensat.2; for more information. From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 17:46:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D685FBE; Fri, 20 Feb 2015 17:46:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 70A16E23; Fri, 20 Feb 2015 17:46:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KHk0Zc089816; Fri, 20 Feb 2015 17:46:00 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KHk0t2089810; Fri, 20 Feb 2015 17:46:00 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201746.t1KHk0t2089810@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 17:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279058 - head/release/doc/en_US.ISO8859-1/relnotes 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 17:46:00 -0000 Author: gjb Date: Fri Feb 20 17:45:59 2015 New Revision: 279058 URL: https://svnweb.freebsd.org/changeset/base/279058 Log: Document r277904, '-s' option added to config(8). Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:45:56 2015 (r279057) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:45:59 2015 (r279058) @@ -519,6 +519,11 @@ at the &man.loader.8; prompt during boot, or add kern.vty=vt to &man.loader.conf.5; and reboot the system. + + The &man.config.8; utility has been + updated to allow using a non-standard src/ tree, specified as an + argument to the -s flag. From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 17:46:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C5E8270; Fri, 20 Feb 2015 17:46:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 78138E2C; Fri, 20 Feb 2015 17:46:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KHk5SG089934; Fri, 20 Feb 2015 17:46:05 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KHk5TW089933; Fri, 20 Feb 2015 17:46:05 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201746.t1KHk5TW089933@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 17:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279060 - head/release/doc/en_US.ISO8859-1/relnotes 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 17:46:05 -0000 Author: gjb Date: Fri Feb 20 17:46:04 2015 New Revision: 279060 URL: https://svnweb.freebsd.org/changeset/base/279060 Log: Document r278934, elf(3) dependency removed from dtri.o Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:46:02 2015 (r279059) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:46:04 2015 (r279060) @@ -464,6 +464,12 @@ The futimens() and utimensat() system calls have been added. See &man.utimensat.2; for more information. + + The &man.elf.3; compile-time dependency + has been removed from dtri.o, which + allows adding DTrace to userland + applications and libraries without also linking against + &man.elf.3;. From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 17:46:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 521873C3; Fri, 20 Feb 2015 17:46:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3D986E31; Fri, 20 Feb 2015 17:46:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KHk8Ro089979; Fri, 20 Feb 2015 17:46:08 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KHk8oa089978; Fri, 20 Feb 2015 17:46:08 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201746.t1KHk8oa089978@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 17:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279061 - head/release/doc/en_US.ISO8859-1/relnotes 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 17:46:08 -0000 Author: gjb Date: Fri Feb 20 17:46:07 2015 New Revision: 279061 URL: https://svnweb.freebsd.org/changeset/base/279061 Log: Add a 'General Storage' section. Document r278037, CAM LUN mapping rewrite. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:46:04 2015 (r279060) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:46:07 2015 (r279061) @@ -788,6 +788,15 @@ This section covers changes and additions to file systems and other storage subsystems, both local and networked. + + General Storage + + The + &man.cam.4; LUN mapping has been rewritten, + replacing iSCSI-specific mapping mechanisms + with a new mechanism that works for any port. + + Networked Storage From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 17:46:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02D7917B; Fri, 20 Feb 2015 17:46:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E234BE27; Fri, 20 Feb 2015 17:46:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KHk2RY089879; Fri, 20 Feb 2015 17:46:02 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KHk2s5089878; Fri, 20 Feb 2015 17:46:02 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201746.t1KHk2s5089878@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 17:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279059 - head/release/doc/en_US.ISO8859-1/relnotes 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 17:46:03 -0000 Author: gjb Date: Fri Feb 20 17:46:02 2015 New Revision: 279059 URL: https://svnweb.freebsd.org/changeset/base/279059 Log: Document r277990, powerpc64 kernel now built as a position-independent executable Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:45:59 2015 (r279058) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:46:02 2015 (r279059) @@ -524,6 +524,18 @@ updated to allow using a non-standard src/ tree, specified as an argument to the -s flag. + + The + &os;/&arch.powerpc64; kernel now builds as + a position-independent executable, allowing the kernel to be + loaded into and run from any physical or virtual + address. + + + This change requires an update to &man.loader.8;. + The userland and kernel must be updated before rebooting the + system. + From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 17:46:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6924605; Fri, 20 Feb 2015 17:46:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 919F8E3B; Fri, 20 Feb 2015 17:46:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KHkDtt090099; Fri, 20 Feb 2015 17:46:13 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KHkD0U090098; Fri, 20 Feb 2015 17:46:13 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201746.t1KHkD0U090098@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 17:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279063 - head/release/doc/en_US.ISO8859-1/relnotes 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 17:46:13 -0000 Author: gjb Date: Fri Feb 20 17:46:12 2015 New Revision: 279063 URL: https://svnweb.freebsd.org/changeset/base/279063 Log: Document r278354, ctld(8) update to control non-iSCSI CTL ports Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:46:10 2015 (r279062) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:46:12 2015 (r279063) @@ -797,11 +797,14 @@ General Storage - The &man.cam.4; LUN mapping has been rewritten, replacing iSCSI-specific mapping mechanisms with a new mechanism that works for any port. + + The + &man.ctld.8; utility has been updated to allow controlling + non-iSCSI &man.ctl.4; ports. From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 17:46:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FE48785; Fri, 20 Feb 2015 17:46:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4ADE8E40; Fri, 20 Feb 2015 17:46:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KHkGm1090151; Fri, 20 Feb 2015 17:46:16 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KHkGWV090150; Fri, 20 Feb 2015 17:46:16 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201746.t1KHkGWV090150@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 17:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279064 - head/release/doc/en_US.ISO8859-1/relnotes 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 17:46:16 -0000 Author: gjb Date: Fri Feb 20 17:46:15 2015 New Revision: 279064 URL: https://svnweb.freebsd.org/changeset/base/279064 Log: Document r278433, xz(1) update to 5.2.0. Separately document multi-threaded support to keep the version update separate, so it remains correct if xz(1) is updated again. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:46:12 2015 (r279063) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:46:15 2015 (r279064) @@ -382,6 +382,12 @@ OpenSSL has been updated to version 1.0.1l. + + The &man.xz.1; utility has been udpated + to version 5.2.0. + + The &man.xz.1; utility has been updated + to support multi-threaded compression. From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 17:46:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FFCD4E7; Fri, 20 Feb 2015 17:46:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 EF3AEE36; Fri, 20 Feb 2015 17:46:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KHkAJc090030; Fri, 20 Feb 2015 17:46:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KHkAnX090029; Fri, 20 Feb 2015 17:46:10 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201746.t1KHkAnX090029@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 17:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279062 - head/release/doc/en_US.ISO8859-1/relnotes 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 17:46:11 -0000 Author: gjb Date: Fri Feb 20 17:46:10 2015 New Revision: 279062 URL: https://svnweb.freebsd.org/changeset/base/279062 Log: Document r278320, devctl(3) and devctl(8) added. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:46:07 2015 (r279061) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:46:10 2015 (r279062) @@ -302,6 +302,13 @@ The &man.ptrace.2; system call has been updated include support for Altivec registers on &os;/&arch.powerpc;. + + A new device control utility, + &man.devctl.8; has been added, which allows making + administrative changes to individual devices, such as + attaching and detaching drivers, and enabling and disabling + devices. The &man.devctl.8; utility uses the new + &man.devctl.3; library. From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 17:46:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16E9F897; Fri, 20 Feb 2015 17:46:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 02A57E46; Fri, 20 Feb 2015 17:46:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KHkI0P090195; Fri, 20 Feb 2015 17:46:18 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KHkI4F090194; Fri, 20 Feb 2015 17:46:18 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201746.t1KHkI4F090194@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 17:46:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279065 - head/release/doc/en_US.ISO8859-1/relnotes 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 17:46:19 -0000 Author: gjb Date: Fri Feb 20 17:46:18 2015 New Revision: 279065 URL: https://svnweb.freebsd.org/changeset/base/279065 Log: Document r278926, 'make release' now uses multi-threaded xz(1). Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:46:15 2015 (r279064) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:46:18 2015 (r279065) @@ -1014,6 +1014,11 @@ Release Engineering build tools have been updated to include support for producing virtual machine disk images for various cloud hosting providers. + + The Release Engineering build tools have + been updated to use multi-threaded &man.xz.1;. By default, + the number of &man.xz.1; threads is set to the number of cores + available. From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 17:46:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C116A9A4; Fri, 20 Feb 2015 17:46:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 AC6CBE4D; Fri, 20 Feb 2015 17:46:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KHkLLp090245; Fri, 20 Feb 2015 17:46:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KHkLCD090244; Fri, 20 Feb 2015 17:46:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201746.t1KHkLCD090244@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 17:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279066 - head/release/doc/en_US.ISO8859-1/relnotes 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 17:46:21 -0000 Author: gjb Date: Fri Feb 20 17:46:20 2015 New Revision: 279066 URL: https://svnweb.freebsd.org/changeset/base/279066 Log: Update the commented last revision. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:46:18 2015 (r279065) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:46:20 2015 (r279066) @@ -22,7 +22,7 @@ $FreeBSD$ - + 2015 From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 17:53:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28D76C87; Fri, 20 Feb 2015 17:53:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 13D31F36; Fri, 20 Feb 2015 17:53:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KHrAlP094626; Fri, 20 Feb 2015 17:53:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KHrAaT094625; Fri, 20 Feb 2015 17:53:10 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201753.t1KHrAaT094625@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 17:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279067 - head/share/man/man7 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 17:53:11 -0000 Author: gjb Date: Fri Feb 20 17:53:10 2015 New Revision: 279067 URL: https://svnweb.freebsd.org/changeset/base/279067 Log: Document XZ_THREADS in release(7). Sponsored by: The FreeBSD Foundation Modified: head/share/man/man7/release.7 Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Fri Feb 20 17:46:20 2015 (r279066) +++ head/share/man/man7/release.7 Fri Feb 20 17:53:10 2015 (r279067) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 28, 2015 +.Dd February 20, 2015 .Dt RELEASE 7 .Os .Sh NAME @@ -256,6 +256,14 @@ Set to a non-empty value to compress the The original .Pq uncompressed images are not removed. +.It Va XZ_THREADS Pq Vt int +Set to the number of threads +.Xr xz 1 +should use when compressing images. +By default, +.Va XZ_THREADS +is set to the number of cores reported by +.Va kern.ncpu . .It Va VCSCMD The command run to obtain the source trees. Defaults to From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 17:56:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9FF4DFF; Fri, 20 Feb 2015 17:56:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A528BF4E; Fri, 20 Feb 2015 17:56:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KHuS3x095111; Fri, 20 Feb 2015 17:56:28 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KHuS9M095110; Fri, 20 Feb 2015 17:56:28 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201756.t1KHuS9M095110@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 17:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279068 - head/release/doc/en_US.ISO8859-1/relnotes 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 17:56:28 -0000 Author: gjb Date: Fri Feb 20 17:56:27 2015 New Revision: 279068 URL: https://svnweb.freebsd.org/changeset/base/279068 Log: Fix a typo in r278037 entry: s/cam/ctl/ Submitted by: mav Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:53:10 2015 (r279067) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:56:27 2015 (r279068) @@ -804,7 +804,7 @@ General Storage The - &man.cam.4; LUN mapping has been rewritten, + &man.ctl.4; LUN mapping has been rewritten, replacing iSCSI-specific mapping mechanisms with a new mechanism that works for any port. From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 18:06:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77F1821E; Fri, 20 Feb 2015 18:06:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 62F5FE9; Fri, 20 Feb 2015 18:06:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KI6CUq000159; Fri, 20 Feb 2015 18:06:12 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KI6Cdd000158; Fri, 20 Feb 2015 18:06:12 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201806.t1KI6Cdd000158@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 18:06:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279069 - head/release/doc/en_US.ISO8859-1/relnotes 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 18:06:12 -0000 Author: gjb Date: Fri Feb 20 18:06:11 2015 New Revision: 279069 URL: https://svnweb.freebsd.org/changeset/base/279069 Log: Document r275140, pmc callchain depths increased. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 17:56:27 2015 (r279068) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 18:06:11 2015 (r279069) @@ -560,7 +560,10 @@ System Tuning and Controls -   + The + &man.hwpmc.4; default and maximum callchain depths have been + increased. The default has been increased from 16 to 32, and + the maximum increased from 32 to 128. From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 18:39:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97164E57; Fri, 20 Feb 2015 18:39:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8294F680; Fri, 20 Feb 2015 18:39:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KIdC2U015325; Fri, 20 Feb 2015 18:39:12 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KIdCcW015324; Fri, 20 Feb 2015 18:39:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201502201839.t1KIdCcW015324@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 20 Feb 2015 18:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279071 - 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 18:39:13 -0000 Author: delphij Date: Fri Feb 20 18:39:12 2015 New Revision: 279071 URL: https://svnweb.freebsd.org/changeset/base/279071 Log: Handle SIOCSIFCAP by propogating the request to the parent interface. This allows adding an vlan interface into a bridge. Thanks for William Katsak for testing and fixing an issue in my previous patch draft. MFC after: 2 weeks Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Fri Feb 20 18:06:33 2015 (r279070) +++ head/sys/net/if_vlan.c Fri Feb 20 18:39:12 2015 (r279071) @@ -1775,6 +1775,27 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd } break; + case SIOCSIFCAP: + VLAN_LOCK(); + if (TRUNK(ifv) != NULL) { + p = PARENT(ifv); + VLAN_UNLOCK(); + if ((p->if_type != IFT_ETHER) && + (ifr->ifr_reqcap & IFCAP_VLAN_HWTAGGING) == 0) { + error = EINVAL; + break; + } + error = (*p->if_ioctl)(p, cmd, data); + if (error) + break; + /* Propogate vlan interface capabilities */ + vlan_trunk_capabilities(p); + } else { + VLAN_UNLOCK(); + error = EINVAL; + } + break; + default: error = EINVAL; break; From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 18:42:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81188FD0; Fri, 20 Feb 2015 18:42:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6CAEC788; Fri, 20 Feb 2015 18:42:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KIg1mi019169; Fri, 20 Feb 2015 18:42:01 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KIg1Xi019168; Fri, 20 Feb 2015 18:42:01 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201842.t1KIg1Xi019168@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 18:42:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279072 - head/release/doc/en_US.ISO8859-1/relnotes 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 18:42:01 -0000 Author: gjb Date: Fri Feb 20 18:42:00 2015 New Revision: 279072 URL: https://svnweb.freebsd.org/changeset/base/279072 Log: Fix wording in entry for r278934. Submitted by: markj Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 18:39:12 2015 (r279071) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Feb 20 18:42:00 2015 (r279072) @@ -480,9 +480,9 @@ The &man.elf.3; compile-time dependency has been removed from dtri.o, which - allows adding DTrace to userland - applications and libraries without also linking against - &man.elf.3;. + allows adding DTrace probes to + userland applications and libraries without also linking + against &man.elf.3;. From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 18:49:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3ED152D8; Fri, 20 Feb 2015 18:49:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2AA477D2; Fri, 20 Feb 2015 18:49:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KInoSr020182; Fri, 20 Feb 2015 18:49:50 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KInoF0020181; Fri, 20 Feb 2015 18:49:50 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201849.t1KInoF0020181@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 18:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279073 - head/share/man/man7 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 18:49:51 -0000 Author: gjb Date: Fri Feb 20 18:49:49 2015 New Revision: 279073 URL: https://svnweb.freebsd.org/changeset/base/279073 Log: Fix XZ_THREADS description in release(7), which defaults to '0', not kern.ncpu. Sponsored by: The FreeBSD Foundation Modified: head/share/man/man7/release.7 Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Fri Feb 20 18:42:00 2015 (r279072) +++ head/share/man/man7/release.7 Fri Feb 20 18:49:49 2015 (r279073) @@ -262,8 +262,9 @@ Set to the number of threads should use when compressing images. By default, .Va XZ_THREADS -is set to the number of cores reported by -.Va kern.ncpu . +is set to +.Va 0 , +which uses all available cores on the system. .It Va VCSCMD The command run to obtain the source trees. Defaults to From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 18:51:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DA5B445; Fri, 20 Feb 2015 18:51:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5970587C; Fri, 20 Feb 2015 18:51:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KIprdc023921; Fri, 20 Feb 2015 18:51:53 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KIpqZY023918; Fri, 20 Feb 2015 18:51:52 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201502201851.t1KIpqZY023918@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 20 Feb 2015 18:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279074 - 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 18:51:53 -0000 Author: gjb Date: Fri Feb 20 18:51:52 2015 New Revision: 279074 URL: https://svnweb.freebsd.org/changeset/base/279074 Log: Default XZ_THREADS=0, and add to RELEASE_RMAKEFLAGS so it is passed to the 'release' make(1) target if it needs to be adjusted to a non-zero integer. Sponsored by: The FreeBSD Foundation Modified: head/release/release.conf.sample head/release/release.sh Modified: head/release/release.conf.sample ============================================================================== --- head/release/release.conf.sample Fri Feb 20 18:49:49 2015 (r279073) +++ head/release/release.conf.sample Fri Feb 20 18:51:52 2015 (r279074) @@ -53,6 +53,9 @@ PORTBRANCH="ports/head@rHEAD" #WITH_DVD= #WITH_COMPRESSED_IMAGES= +## Set to '1' to disable multi-threaded xz(1) compression. +#XZ_THREADS=0 + ## Set when building embedded images. #EMBEDDEDBUILD= Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Fri Feb 20 18:49:49 2015 (r279073) +++ head/release/release.sh Fri Feb 20 18:51:52 2015 (r279074) @@ -93,6 +93,7 @@ WITH_COMPRESSED_IMAGES= # the release. WITH_VMIMAGES= WITH_COMPRESSED_VMIMAGES= +XZ_THREADS=0 # Set to non-empty value to build virtual machine images for various # cloud providers as part of the release. @@ -179,7 +180,7 @@ RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORL RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \ ${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \ - WITH_CLOUDWARE=${WITH_CLOUDWARE}" + WITH_CLOUDWARE=${WITH_CLOUDWARE} XZ_THREADS=${XZ_THREADS}" # Force src checkout if configured FORCE_SRC_KEY= From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 19:37:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A61BAEB3; Fri, 20 Feb 2015 19:37:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 7989ECEE; Fri, 20 Feb 2015 19:37:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KJbBYY043945; Fri, 20 Feb 2015 19:37:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KJbBuI043935; Fri, 20 Feb 2015 19:37:11 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502201937.t1KJbBuI043935@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 20 Feb 2015 19:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279076 - head/sys/dev/sfxge/common 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 19:37:11 -0000 Author: arybchik Date: Fri Feb 20 19:37:10 2015 New Revision: 279076 URL: https://svnweb.freebsd.org/changeset/base/279076 Log: sfxge: regenerate sensor map Add Florence R7 and Modena sensors. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mon.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Feb 20 18:59:43 2015 (r279075) +++ head/sys/dev/sfxge/common/efx.h Fri Feb 20 19:37:10 2015 (r279076) @@ -459,7 +459,7 @@ efx_mon_init( #define EFX_MON_STATS_SIZE 0x100 -/* START MKCONFIG GENERATED MonitorHeaderStatsBlock 16a14e61aa4f8d80 */ +/* START MKCONFIG GENERATED MonitorHeaderStatsBlock 58706a378332aeee */ typedef enum efx_mon_stat_e { EFX_MON_STAT_2_5V, EFX_MON_STAT_VCCP1, @@ -477,6 +477,20 @@ typedef enum efx_mon_stat_e { EFX_MON_STAT_1_2V, EFX_MON_STAT_1_8V, EFX_MON_STAT_3_3V, + EFX_MON_STAT_1_2VA, + EFX_MON_STAT_VREF, + EFX_MON_STAT_VAOE, + EFX_MON_STAT_AOE_TEMP, + EFX_MON_STAT_PSU_AOE_TEMP, + EFX_MON_STAT_PSU_TEMP, + EFX_MON_STAT_FAN0, + EFX_MON_STAT_FAN1, + EFX_MON_STAT_FAN2, + EFX_MON_STAT_FAN3, + EFX_MON_STAT_FAN4, + EFX_MON_STAT_VAOE_IN, + EFX_MON_STAT_IAOE, + EFX_MON_STAT_IAOE_IN, EFX_MON_NSTATS } efx_mon_stat_t; Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Fri Feb 20 18:59:43 2015 (r279075) +++ head/sys/dev/sfxge/common/efx_mon.c Fri Feb 20 19:37:10 2015 (r279076) @@ -195,7 +195,7 @@ fail1: #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED MonitorStatNamesBlock 08518fd1fb4e2612 */ +/* START MKCONFIG GENERATED MonitorStatNamesBlock 89ff37f1d74ad8b3 */ static const char __cs * __cs __mon_stat_name[] = { "value_2_5v", "value_vccp1", @@ -213,6 +213,20 @@ static const char __cs * __cs __mon_sta "1_2v", "1_8v", "3_3v", + "1_2va", + "vref", + "vaoe", + "aoe_temperature", + "psu_aoe_temperature", + "psu_temperature", + "fan0", + "fan1", + "fan2", + "fan3", + "fan4", + "vaoe_in", + "iaoe", + "iaoe_in", }; /* END MKCONFIG GENERATED MonitorStatNamesBlock */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 19:39:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E3A672; Fri, 20 Feb 2015 19:39:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 49806D02; Fri, 20 Feb 2015 19:39:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KJdgqq044283; Fri, 20 Feb 2015 19:39:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KJdfYV044272; Fri, 20 Feb 2015 19:39:41 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502201939.t1KJdfYV044272@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 20 Feb 2015 19:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279077 - in head/sys/dev/sfxge: . common 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 19:39:42 -0000 Author: arybchik Date: Fri Feb 20 19:39:40 2015 New Revision: 279077 URL: https://svnweb.freebsd.org/changeset/base/279077 Log: sfxge: style fixes Use nitem() to get number of array elements. Remove unused define. Use TAB to indent. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/sfxge_rx.c head/sys/dev/sfxge/sfxge_tx.c head/sys/dev/sfxge/sfxge_tx.h Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Feb 20 19:37:10 2015 (r279076) +++ head/sys/dev/sfxge/common/efx.h Fri Feb 20 19:39:40 2015 (r279077) @@ -1614,14 +1614,14 @@ efx_rx_scale_toeplitz_ipv6_key_set( #endif /* EFSYS_OPT_RX_SCALE */ -#define EFX_RXQ_MAXNDESCS 4096 -#define EFX_RXQ_MINNDESCS 512 +#define EFX_RXQ_MAXNDESCS 4096 +#define EFX_RXQ_MINNDESCS 512 -#define EFX_RXQ_NDESCS_MASK EFX_MASK(EFX_RXQ_MAXNDESCS, EFX_RXQ_MINNDESCS) +#define EFX_RXQ_NDESCS_MASK EFX_MASK(EFX_RXQ_MAXNDESCS, EFX_RXQ_MINNDESCS) -#define EFX_RXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) -#define EFX_RXQ_NBUFS(_ndescs) (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_SIZE) -#define EFX_RXQ_LIMIT(_ndescs) ((_ndescs) - 16) +#define EFX_RXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) +#define EFX_RXQ_NBUFS(_ndescs) (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_SIZE) +#define EFX_RXQ_LIMIT(_ndescs) ((_ndescs) - 16) typedef enum efx_rxq_type_e { EFX_RXQ_TYPE_DEFAULT, @@ -1700,14 +1700,14 @@ extern void efx_tx_fini( __in efx_nic_t *enp); -#define EFX_TXQ_MAXNDESCS 4096 -#define EFX_TXQ_MINNDESCS 512 +#define EFX_TXQ_MAXNDESCS 4096 +#define EFX_TXQ_MINNDESCS 512 -#define EFX_TXQ_NDESCS_MASK EFX_MASK(EFX_TXQ_MAXNDESCS, EFX_TXQ_MINNDESCS) +#define EFX_TXQ_NDESCS_MASK EFX_MASK(EFX_TXQ_MAXNDESCS, EFX_TXQ_MINNDESCS) -#define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) -#define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_SIZE) -#define EFX_TXQ_LIMIT(_ndescs) ((_ndescs) - 16) +#define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) +#define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_SIZE) +#define EFX_TXQ_LIMIT(_ndescs) ((_ndescs) - 16) extern __checkReturn int efx_tx_qcreate( Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Fri Feb 20 19:37:10 2015 (r279076) +++ head/sys/dev/sfxge/sfxge_rx.c Fri Feb 20 19:39:40 2015 (r279077) @@ -1172,9 +1172,7 @@ sfxge_rx_stat_init(struct sfxge_softc *s stat_list = SYSCTL_CHILDREN(sc->stats_node); - for (id = 0; - id < sizeof(sfxge_rx_stats) / sizeof(sfxge_rx_stats[0]); - id++) { + for (id = 0; id < nitems(sfxge_rx_stats); id++) { SYSCTL_ADD_PROC( ctx, stat_list, OID_AUTO, sfxge_rx_stats[id].name, Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Fri Feb 20 19:37:10 2015 (r279076) +++ head/sys/dev/sfxge/sfxge_tx.c Fri Feb 20 19:39:40 2015 (r279077) @@ -1548,9 +1548,7 @@ sfxge_tx_stat_init(struct sfxge_softc *s stat_list = SYSCTL_CHILDREN(sc->stats_node); - for (id = 0; - id < sizeof(sfxge_tx_stats) / sizeof(sfxge_tx_stats[0]); - id++) { + for (id = 0; id < nitems(sfxge_tx_stats); id++) { SYSCTL_ADD_PROC( ctx, stat_list, OID_AUTO, sfxge_tx_stats[id].name, Modified: head/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.h Fri Feb 20 19:37:10 2015 (r279076) +++ head/sys/dev/sfxge/sfxge_tx.h Fri Feb 20 19:39:40 2015 (r279077) @@ -41,13 +41,7 @@ * clusters. (The chain could be longer than this initially, but can * be shortened with m_collapse().) */ -#define SFXGE_TX_MAPPING_MAX_SEG (64 / 2 + 1) - -/* Maximum number of DMA segments needed to map an output packet. It - * could overlap all mbufs in the chain and also require an extra - * segment for a TSO header. - */ -#define SFXGE_TX_PACKET_MAX_SEG (SFXGE_TX_MAPPING_MAX_SEG + 1) +#define SFXGE_TX_MAPPING_MAX_SEG (64 / 2 + 1) /* * Buffer mapping flags. From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 19:42:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CCB02209; Fri, 20 Feb 2015 19:42:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B870EDB0; Fri, 20 Feb 2015 19:42:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KJg6cd048074; Fri, 20 Feb 2015 19:42:06 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KJg6E9048073; Fri, 20 Feb 2015 19:42:06 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502201942.t1KJg6E9048073@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 20 Feb 2015 19:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279078 - head/sys/dev/sfxge/common 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 19:42:06 -0000 Author: arybchik Date: Fri Feb 20 19:42:05 2015 New Revision: 279078 URL: https://svnweb.freebsd.org/changeset/base/279078 Log: sfxge: add assertions that required event handlers are implemented efx_ev_mcdi() does not assert or check that all event handlers it calls are non-null. Add assertions at the top for all required event handlers, as some events (in the case of this bug, monitor events) are rare. Submitted by: Ben Hutchings Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/efx_ev.c Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Fri Feb 20 19:39:40 2015 (r279077) +++ head/sys/dev/sfxge/common/efx_ev.c Fri Feb 20 19:42:05 2015 (r279078) @@ -567,6 +567,12 @@ efx_ev_mcdi( if (enp->en_family != EFX_FAMILY_SIENA) goto out; + EFSYS_ASSERT(eecp->eec_link_change != NULL); + EFSYS_ASSERT(eecp->eec_exception != NULL); +#if EFSYS_OPT_MON_STATS + EFSYS_ASSERT(eecp->eec_monitor != NULL); +#endif + EFX_EV_QSTAT_INCR(eep, EV_MCDI_RESPONSE); code = EFX_QWORD_FIELD(*eqp, MCDI_EVENT_CODE); From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 19:42:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 570B3340; Fri, 20 Feb 2015 19:42:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 42BF2DB5; Fri, 20 Feb 2015 19:42:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KJgR28048159; Fri, 20 Feb 2015 19:42:27 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KJgR9R048158; Fri, 20 Feb 2015 19:42:27 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201502201942.t1KJgR9R048158@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Fri, 20 Feb 2015 19:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279079 - head/sys/x86/acpica 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 19:42:27 -0000 Author: tijl Date: Fri Feb 20 19:42:26 2015 New Revision: 279079 URL: https://svnweb.freebsd.org/changeset/base/279079 Log: Fix build on i386 without "device apic" Reviewed by: kib Modified: head/sys/x86/acpica/acpi_wakeup.c Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Fri Feb 20 19:42:05 2015 (r279078) +++ head/sys/x86/acpica/acpi_wakeup.c Fri Feb 20 19:42:26 2015 (r279079) @@ -30,6 +30,11 @@ #include __FBSDID("$FreeBSD$"); +#if defined(__amd64__) +#define DEV_APIC +#else +#include "opt_apic.h" +#endif #ifdef __i386__ #include "opt_npx.h" #endif @@ -55,8 +60,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DEV_APIC #include #include +#endif #ifdef SMP #include #include @@ -271,7 +278,9 @@ acpi_wakeup_machdep(struct acpi_softc *s initializecpu(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); +#ifdef DEV_APIC lapic_xapic_mode(); +#endif #ifdef SMP if (!CPU_EMPTY(&suspcpus)) acpi_wakeup_cpus(sc); From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 19:44:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EC2F4AB; Fri, 20 Feb 2015 19:44:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 7A284DC9; Fri, 20 Feb 2015 19:44:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KJi3L8048429; Fri, 20 Feb 2015 19:44:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KJi3SW048428; Fri, 20 Feb 2015 19:44:03 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502201944.t1KJi3SW048428@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 20 Feb 2015 19:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279080 - head/sys/dev/sfxge 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 19:44:03 -0000 Author: arybchik Date: Fri Feb 20 19:44:02 2015 New Revision: 279080 URL: https://svnweb.freebsd.org/changeset/base/279080 Log: sfxge: reap Tx descriptors on unblock Otherwise when processing finally comes to efx_tx_qdesc_post() it could be insufficient space between reaped and added to post pending descriptors. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Fri Feb 20 19:42:26 2015 (r279079) +++ head/sys/dev/sfxge/sfxge_tx.c Fri Feb 20 19:44:02 2015 (r279080) @@ -1143,8 +1143,11 @@ sfxge_tx_qunblock(struct sfxge_txq *txq) unsigned int level; level = txq->added - txq->completed; - if (level <= SFXGE_TXQ_UNBLOCK_LEVEL(txq->entries)) + if (level <= SFXGE_TXQ_UNBLOCK_LEVEL(txq->entries)) { + /* reaped must be in sync with blocked */ + sfxge_tx_qreap(txq); txq->blocked = 0; + } } sfxge_tx_qdpl_service(txq); From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 19:48:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B67A46AE; Fri, 20 Feb 2015 19:48:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A29D9E0F; Fri, 20 Feb 2015 19:48:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KJmP6T049034; Fri, 20 Feb 2015 19:48:25 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KJmPn6049032; Fri, 20 Feb 2015 19:48:25 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201502201948.t1KJmPn6049032@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Fri, 20 Feb 2015 19:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279081 - head/usr.sbin/jls 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 19:48:25 -0000 Author: jamie Date: Fri Feb 20 19:48:24 2015 New Revision: 279081 URL: https://svnweb.freebsd.org/changeset/base/279081 Log: Allow parameters listed on the command line to override the -v option, instead of crashing. PR: 197701 MFC after: 1 week Modified: head/usr.sbin/jls/jls.8 head/usr.sbin/jls/jls.c Modified: head/usr.sbin/jls/jls.8 ============================================================================== --- head/usr.sbin/jls/jls.8 Fri Feb 20 19:44:02 2015 (r279080) +++ head/usr.sbin/jls/jls.8 Fri Feb 20 19:48:24 2015 (r279081) @@ -92,7 +92,8 @@ skipping read-only and unused parameters Implies .Fl nq . .It Fl v -Print a multiple-line summary per jail, with the following parameters: +Extend the standard display with a multiple-line summary per jail, +containing the following parameters: jail identifier (jid), hostname (host.hostname), path (path), jail name (name), jail state (dying), cpuset ID (cpuset), IP address(es) (ip4.addr and ip6.addr). Modified: head/usr.sbin/jls/jls.c ============================================================================== --- head/usr.sbin/jls/jls.c Fri Feb 20 19:44:02 2015 (r279080) +++ head/usr.sbin/jls/jls.c Fri Feb 20 19:48:24 2015 (r279081) @@ -166,10 +166,12 @@ main(int argc, char **argv) JP_USER); add_param("path", NULL, (size_t)0, NULL, JP_USER); } - } else + } else { + pflags &= ~PRINT_VERBOSE; while (optind < argc) add_param(argv[optind++], NULL, (size_t)0, NULL, JP_USER); + } if (pflags & PRINT_SKIP) { /* Check for parameters with jailsys parents. */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 20:12:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A590DD7A; Fri, 20 Feb 2015 20:12:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9171C13D; Fri, 20 Feb 2015 20:12:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KKC6Ol062820; Fri, 20 Feb 2015 20:12:06 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KKC6qw062819; Fri, 20 Feb 2015 20:12:06 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201502202012.t1KKC6qw062819@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Fri, 20 Feb 2015 20:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279083 - head/usr.sbin/jls 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 20:12:06 -0000 Author: jamie Date: Fri Feb 20 20:12:05 2015 New Revision: 279083 URL: https://svnweb.freebsd.org/changeset/base/279083 Log: Fix the logic for skipping parameters (with -s) that have "jailsys" parents (such as host.hostname); these were being skipped all the time. That it went this long without anyone noticing is a sign that this feature isn't actually used by anyone, but it's there so it might as well work. MFC after: 1 week Modified: head/usr.sbin/jls/jls.c Modified: head/usr.sbin/jls/jls.c ============================================================================== --- head/usr.sbin/jls/jls.c Fri Feb 20 20:02:47 2015 (r279082) +++ head/usr.sbin/jls/jls.c Fri Feb 20 20:12:05 2015 (r279083) @@ -78,7 +78,7 @@ static void quoted_print(char *str); int main(int argc, char **argv) { - char *dot, *ep, *jname; + char *dot, *ep, *jname, *pname; int c, i, jflags, jid, lastjid, pflags, spc; jname = NULL; @@ -178,10 +178,11 @@ main(int argc, char **argv) for (i = 0; i < nparams; i++) { if ((params[i].jp_flags & JP_USER) && (dot = strchr(params[i].jp_name, '.'))) { - *dot = 0; - param_parent[i] = add_param(params[i].jp_name, + pname = alloca((dot - params[i].jp_name) + 1); + strlcpy(pname, params[i].jp_name, + (dot - params[i].jp_name) + 1); + param_parent[i] = add_param(pname, NULL, (size_t)0, NULL, JP_OPT); - *dot = '.'; } } } From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 20:27:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC1565E4; Fri, 20 Feb 2015 20:27:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B83BC2DF; Fri, 20 Feb 2015 20:27:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KKRsVD070652; Fri, 20 Feb 2015 20:27:54 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KKRsmc070650; Fri, 20 Feb 2015 20:27:54 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502202027.t1KKRsmc070650@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 20 Feb 2015 20:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279084 - head/lib/libc/gen 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 20:27:54 -0000 Author: pfg Date: Fri Feb 20 20:27:53 2015 New Revision: 279084 URL: https://svnweb.freebsd.org/changeset/base/279084 Log: tab vs spaces. Modified: head/lib/libc/gen/setmode.c Modified: head/lib/libc/gen/setmode.c ============================================================================== --- head/lib/libc/gen/setmode.c Fri Feb 20 20:12:05 2015 (r279083) +++ head/lib/libc/gen/setmode.c Fri Feb 20 20:27:53 2015 (r279084) @@ -186,10 +186,10 @@ setmode(const char *p) * as best we can. */ sigfillset(&sigset); - (void)_sigprocmask(SIG_BLOCK, &sigset, &sigoset); + (void)_sigprocmask(SIG_BLOCK, &sigset, &sigoset); (void)umask(mask = umask(0)); mask = ~mask; - (void)_sigprocmask(SIG_SETMASK, &sigoset, NULL); + (void)_sigprocmask(SIG_SETMASK, &sigoset, NULL); setlen = SET_LEN + 2; From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 20:37:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 887A5D41; Fri, 20 Feb 2015 20:37:38 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtp002.mac.com [17.172.220.237]) (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 55E06605; Fri, 20 Feb 2015 20:37:38 +0000 (UTC) Received: from st11p02mm-spool001.mac.com ([17.172.220.246]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTP id <0NK300DB67X9X010@st11p02mm-asmtp002.mac.com>; Fri, 20 Feb 2015 20:36:46 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-20_09:2015-02-20,2015-02-20,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502200193 MIME-version: 1.0 Received: from localhost ([17.172.220.163]) by st11p02mm-spool001.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTP id <0NK3004RP7X9ZP30@st11p02mm-spool001.mac.com>; Fri, 20 Feb 2015 20:36:45 +0000 (GMT) To: Glen Barber From: Rui Paulo Subject: Re: svn commit: r279073 - head/share/man/man7 Date: Fri, 20 Feb 2015 20:36:46 +0000 (GMT) X-Mailer: iCloud MailClient15A99 MailServer15A.18175 X-Originating-IP: [173.11.70.226] Message-id: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 20 Feb 2015 20:37:38 -0000 On Feb 20, 2015, at 10:49 AM, Glen Barber wrote:=0A=0AAu= thor: gjb=0ADate: Fri Feb 20 18:49:49 2015=0ANew Revision: 279073=0AURL: h= ttps://svnweb.freebsd.org/changeset/base/279073=0A=0ALog:=0AFix XZ_THREADS= description in release(7), which defaults to=0A'0', not kern.ncpu.=0A=0AS= ponsored by: =C2=A0 =C2=A0 =C2=A0 =C2=A0The FreeBSD Foundation=0A=0AModifi= ed:=0Ahead/share/man/man7/release.7=0A=0AModified: head/share/man/man7/rel= ease.7=0A=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=0A--- head/share/man/man7/release.7 =C2=A0 =C2=A0 =C2=A0= =C2=A0Fri Feb 20 18:42:00 2015 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r279072)=0A+++= head/share/man/man7/release.7 =C2=A0 =C2=A0Fri Feb 20 18:49:49 2015 =C2=A0= =C2=A0 =C2=A0 =C2=A0(r279073)=0A@@ -262,8 +262,9 @@ Set to the number of = threads=0Ashould use when compressing images.=0ABy default,=0A.Va XZ_THREA= DS=0A-is set to the number of cores reported by=0A-.Va kern.ncpu .=0A+is s= et to=0A+.Va 0 ,=0A+which uses all available cores on the system.=0A=C2=A0= =0A... provided there's enough memory.= From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 20:49:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6BF0167; Fri, 20 Feb 2015 20:49:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 899397EC; Fri, 20 Feb 2015 20:49:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KKn1XB080450; Fri, 20 Feb 2015 20:49:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KKn1Ni080449; Fri, 20 Feb 2015 20:49:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201502202049.t1KKn1Ni080449@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 20 Feb 2015 20:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279089 - 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 20:49:01 -0000 Author: markj Date: Fri Feb 20 20:49:00 2015 New Revision: 279089 URL: https://svnweb.freebsd.org/changeset/base/279089 Log: Don't specify a resid parameter if we're just going to ignore it. Instead, let vn_rdwr() check for short reads. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/kern_ctf.c Modified: head/sys/kern/kern_ctf.c ============================================================================== --- head/sys/kern/kern_ctf.c Fri Feb 20 20:33:43 2015 (r279088) +++ head/sys/kern/kern_ctf.c Fri Feb 20 20:49:00 2015 (r279089) @@ -68,7 +68,6 @@ link_elf_ctf_get(linker_file_t lf, linke int flags; int i; int nbytes; - ssize_t resid; size_t sz; struct nameidata nd; struct thread *td = curthread; @@ -125,7 +124,7 @@ link_elf_ctf_get(linker_file_t lf, linke /* Read the ELF header. */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, hdr, sizeof(*hdr), - 0, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, &resid, + 0, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, NULL, td)) != 0) goto out; @@ -148,7 +147,7 @@ link_elf_ctf_get(linker_file_t lf, linke /* Read all the section headers */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t)shdr, nbytes, hdr->e_shoff, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, - &resid, td)) != 0) + NULL, td)) != 0) goto out; /* @@ -170,8 +169,7 @@ link_elf_ctf_get(linker_file_t lf, linke /* Read the section header strings. */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, shstrtab, shdr[hdr->e_shstrndx].sh_size, shdr[hdr->e_shstrndx].sh_offset, - UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, &resid, - td)) != 0) + UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, NULL, td)) != 0) goto out; /* Search for the section containing the CTF data. */ @@ -190,7 +188,7 @@ link_elf_ctf_get(linker_file_t lf, linke /* Read the CTF header. */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, ctf_hdr, sizeof(ctf_hdr), shdr[i].sh_offset, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, - NOCRED, &resid, td)) != 0) + NOCRED, NULL, td)) != 0) goto out; /* Check the CTF magic number. (XXX check for big endian!) */ @@ -249,7 +247,7 @@ link_elf_ctf_get(linker_file_t lf, linke */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, raw == NULL ? ctftab : raw, shdr[i].sh_size, shdr[i].sh_offset, UIO_SYSSPACE, IO_NODELOCKED, - td->td_ucred, NOCRED, &resid, td)) != 0) + td->td_ucred, NOCRED, NULL, td)) != 0) goto out; /* Check if decompression is required. */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 21:21:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D368C1F; Fri, 20 Feb 2015 21:21:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 19899C13; Fri, 20 Feb 2015 21:21:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KLLd3O097578; Fri, 20 Feb 2015 21:21:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KLLd5e097574; Fri, 20 Feb 2015 21:21:39 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502202121.t1KLLd5e097574@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 20 Feb 2015 21:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279090 - head/lib/libc/regex 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 21:21:40 -0000 Author: pfg Date: Fri Feb 20 21:21:38 2015 New Revision: 279090 URL: https://svnweb.freebsd.org/changeset/base/279090 Log: regex(3): Fix uninitialized pointer values. CID: 405582 (also clang static checker) CID: 1018724 Modified: head/lib/libc/regex/engine.c head/lib/libc/regex/regcomp.c Modified: head/lib/libc/regex/engine.c ============================================================================== --- head/lib/libc/regex/engine.c Fri Feb 20 20:49:00 2015 (r279089) +++ head/lib/libc/regex/engine.c Fri Feb 20 21:21:38 2015 (r279090) @@ -157,7 +157,7 @@ matcher(struct re_guts *g, int i; struct match mv; struct match *m = &mv; - const char *dp; + const char *dp = NULL; const sopno gf = g->firststate+1; /* +1 for OEND */ const sopno gl = g->laststate; const char *start; Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Fri Feb 20 20:49:00 2015 (r279089) +++ head/lib/libc/regex/regcomp.c Fri Feb 20 21:21:38 2015 (r279090) @@ -1422,8 +1422,8 @@ static void findmust(struct parse *p, struct re_guts *g) { sop *scan; - sop *start; - sop *newstart; + sop *start = NULL; + sop *newstart = NULL; sopno newlen; sop s; char *cp; From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 22:52:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A813C181; Fri, 20 Feb 2015 22:52:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 93C79877; Fri, 20 Feb 2015 22:52:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KMqPlu040168; Fri, 20 Feb 2015 22:52:25 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KMqPZk040167; Fri, 20 Feb 2015 22:52:25 GMT (envelope-from np@FreeBSD.org) Message-Id: <201502202252.t1KMqPZk040167@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 20 Feb 2015 22:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279091 - head/share/man/man4 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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 22:52:25 -0000 Author: np Date: Fri Feb 20 22:52:24 2015 New Revision: 279091 URL: https://svnweb.freebsd.org/changeset/base/279091 Log: Add cxl(4) and if_cxl(4) as links to cxgbe(4). MFC after: 1 week. Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Feb 20 21:21:38 2015 (r279090) +++ head/share/man/man4/Makefile Fri Feb 20 22:52:24 2015 (r279091) @@ -573,7 +573,9 @@ MLINKS+=cdce.4 if_cdce.4 MLINKS+=crypto.4 cryptodev.4 MLINKS+=cue.4 if_cue.4 MLINKS+=cxgb.4 if_cxgb.4 -MLINKS+=cxgbe.4 if_cxgbe.4 +MLINKS+=cxgbe.4 if_cxgbe.4 \ + cxgbe.4 cxl.4 \ + cxgbe.4 if_cxl.4 MLINKS+=dc.4 if_dc.4 MLINKS+=de.4 if_de.4 MLINKS+=disc.4 if_disc.4 From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 22:57:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFC97306; Fri, 20 Feb 2015 22:57:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 CBC8A89C; Fri, 20 Feb 2015 22:57:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KMvtJ4040905; Fri, 20 Feb 2015 22:57:55 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KMvts5040904; Fri, 20 Feb 2015 22:57:55 GMT (envelope-from np@FreeBSD.org) Message-Id: <201502202257.t1KMvts5040904@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 20 Feb 2015 22:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279092 - head/sys/dev/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.18-1 Precedence: list List-Id: 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, 20 Feb 2015 22:57:56 -0000 Author: np Date: Fri Feb 20 22:57:54 2015 New Revision: 279092 URL: https://svnweb.freebsd.org/changeset/base/279092 Log: cxgbe(4): there is no need to force an "unimplemented" panic needlessly. The calls to free_nm_txq and free_nm_rxq are made just a few lines prior to the panic. Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Feb 20 22:52:24 2015 (r279091) +++ head/sys/dev/cxgbe/t4_sge.c Fri Feb 20 22:57:54 2015 (r279092) @@ -1249,9 +1249,6 @@ t4_teardown_port_queues(struct port_info free_ofld_rxq(pi, ofld_rxq); } #endif -#ifdef DEV_NETMAP - CXGBE_UNIMPLEMENTED(__func__); -#endif return (0); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 00:51:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8215807; Sat, 21 Feb 2015 00:51:04 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3319B5EB; Sat, 21 Feb 2015 00:51:02 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1L0opbP091218 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 21 Feb 2015 03:50:51 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1L0opxT091217; Sat, 21 Feb 2015 03:50:51 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 21 Feb 2015 03:50:51 +0300 From: Gleb Smirnoff To: Bruce Simpson Subject: Re: svn commit: r279028 - in head/usr.sbin: . ifmcstat Message-ID: <20150221005051.GT15484@FreeBSD.org> References: <201502192242.t1JMgY3e045902@svn.freebsd.org> <54E6A68B.1090609@fastmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54E6A68B.1090609@fastmail.net> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 21 Feb 2015 00:51:04 -0000 Bruce, On Fri, Feb 20, 2015 at 03:14:19AM +0000, Bruce Simpson wrote: B> Gleb, B> B> Correct me if I'm wrong -- but doesn't this set of changes remove the B> ability for the user to see the stack-wide membership filters on each B> link? The implementation required KVM as it must inspect the SSM filters B> themselves to obtain this information. Can you point me at the code please? I see that both kvm(3) or API based code call in6_ifinfo() or in_ifinfo(). May be you refer to code that was always under #if 0, disabled due to difficulty to go through RB-trees via kvm(3)? B> On 19/02/2015 22:42, Gleb Smirnoff wrote: B> > Now that IGMP and MLD sysctls provide a clean API structures that do not B> > leak kernel internal stuff, reconnect ifmcstat(1) back to build. B> B> The change is well motivated, but the job is only half done. B> B> The backend code you have added simply reflects the per-link information B> to userland as a flat data structure; it does not appear to report what B> the membership filters are. B> B> This would require taking a lock, walking the RB-tree for the in-mode B> filters, and serializing the data to userland as a variable length B> structure. I can do that, if you provide me with details. But I'd really appreciate, if you do that :) -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 01:06:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 681E1A0E; Sat, 21 Feb 2015 01:06:36 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E35087CA; Sat, 21 Feb 2015 01:06:35 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t1L16XA7091312 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 21 Feb 2015 04:06:33 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t1L16X9e091311; Sat, 21 Feb 2015 04:06:33 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 21 Feb 2015 04:06:33 +0300 From: Gleb Smirnoff To: Roger Pau =?iso-8859-1?Q?Monn=E9?= Subject: Re: svn commit: r278977 - in head/sys: dev/cxgb dev/cxgb/sys dev/cxgb/ulp/tom dev/xen/netfront sys Message-ID: <20150221010633.GU15484@FreeBSD.org> References: <201502190119.t1J1JhSI025601@svn.freebsd.org> <54E62FB6.6050800@FreeBSD.org> <20150219200257.GK15484@FreeBSD.org> <54E6F17A.4020702@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <54E6F17A.4020702@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 21 Feb 2015 01:06:36 -0000 On Fri, Feb 20, 2015 at 09:34:02AM +0100, Roger Pau Monné wrote: R> I've tried the attached patch and now I get a different panic: R> R> [...] R> xn0: at device/vif/0 on xenbusb_front0 R> xn0: Ethernet address: 00:16:3e:0a:80:c2 R> xenbusb_back0: on xenstore0 R> xbd0: Back-end specified ring-pages of 15 is not a power of 2. Limited to 8. R> xn0: backend features: feature-sg feature-gso-tcp4 R> xbd0: R> R> Fatal trap 9: general protection fault while in kernel mode R> cpuid = 0; apic id = 00 R> instruction pointer = 0x20:0xffffffff80b0c60b R> stack pointer = 0x28:0xfffffe0096c18960 R> frame pointer = 0x28:0xfffffe0096c18a30 R> code segment = base 0x0, limit 0xfffff, type 0x1b R> = DPL 0, pres 1, long 1, def32 0, gran 1 R> processor eflags = interrupt enabled, resume, IOPL = 0 R> current process = 12 (irq778: xn0) R> [ thread pid 12 tid 100052 ] R> Stopped at tcp_lro_rx+0x1b: movw 0xc(%rbx),%r15w R> db> bt R> Tracing pid 12 tid 100052 td 0xfffff80002da2940 R> tcp_lro_rx() at tcp_lro_rx+0x1b/frame 0xfffffe0096c18a30 R> xn_intr() at xn_intr+0xa12/frame 0xfffffe0096c18b30 R> intr_event_execute_handlers() at intr_event_execute_handlers+0xe1/frame 0xfffffe0096c18b70 R> ithread_loop() at ithread_loop+0xac/frame 0xfffffe0096c18bb0 R> fork_exit() at fork_exit+0x84/frame 0xfffffe0096c18bf0 R> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0096c18bf0 R> --- trap 0, rip = 0, rsp = 0xfffffe0096c18cb0, rbp = 0 --- R> db> R> R> addr2line however seems to be unable to resolve the IP address R> to a line number: R> R> # addr2line -e /boot/kernel/kernel ffffffff80b0c60b R> ??:0 Do you have coredump? If yes, can you please show within frame of xn_intr(): p rxq p *m -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 06:05:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F471F10; Sat, 21 Feb 2015 06:05:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 50794840; Sat, 21 Feb 2015 06:05:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1L65qZ8043004; Sat, 21 Feb 2015 06:05:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1L65p4P043002; Sat, 21 Feb 2015 06:05:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201502210605.t1L65p4P043002@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 21 Feb 2015 06:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279093 - in head: etc 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.18-1 Precedence: list List-Id: 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, 21 Feb 2015 06:05:52 -0000 Author: markj Date: Sat Feb 21 06:05:51 2015 New Revision: 279093 URL: https://svnweb.freebsd.org/changeset/base/279093 Log: Purge references to the mrouted rc script, which was removed in r275299. PR: 195785 Modified: head/etc/netstart head/share/man/man5/rc.conf.5 Modified: head/etc/netstart ============================================================================== --- head/etc/netstart Fri Feb 20 22:57:54 2015 (r279092) +++ head/etc/netstart Sat Feb 21 06:05:51 2015 (r279093) @@ -57,7 +57,6 @@ _start=quietstart /etc/rc.d/routing ${_start} /etc/rc.d/mroute6d ${_start} /etc/rc.d/route6d ${_start} -/etc/rc.d/mrouted ${_start} /etc/rc.d/routed ${_start} /etc/rc.d/rtsold ${_start} /etc/rc.d/nisdomain ${_start} Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Fri Feb 20 22:57:54 2015 (r279092) +++ head/share/man/man5/rc.conf.5 Sat Feb 21 06:05:51 2015 (r279093) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 11, 2014 +.Dd February 20, 2015 .Dt RC.CONF 5 .Os .Sh NAME @@ -2806,16 +2806,8 @@ these are the flags to pass to the routi .Pq Vt str The IPv6 equivalent of .Va routed_flags . -.It Va mrouted_enable -.Pq Vt bool -If set to -.Dq Li YES , -run the multicast routing daemon, -.Xr mrouted 8 . .It Va mroute6d_enable .Pq Vt bool -The IPv6 equivalent of -.Va mrouted_enable . If set to .Dq Li YES , run the IPv6 multicast routing daemon. @@ -2829,19 +2821,8 @@ and may be installed from the .Fx Ports Collection. -.It Va mrouted_flags -.Pq Vt str -If -.Va mrouted_enable -is set to -.Dq Li YES , -these are the flags to pass to the -.Xr mrouted 8 -daemon. .It Va mroute6d_flags .Pq Vt str -The IPv6 equivalent of -.Va mrouted_flags . If .Va mroute6d_enable is set to @@ -4530,7 +4511,6 @@ ruleset to load for .Xr mixer 8 , .Xr mountd 8 , .Xr moused 8 , -.Xr mrouted 8 , .Xr newfs 8 , .Xr newsyslog 8 , .Xr nfsd 8 , From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 06:06:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 221F1125; Sat, 21 Feb 2015 06:06:57 +0000 (UTC) Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com [IPv6:2607:f8b0:400e:c03::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 E4D53852; Sat, 21 Feb 2015 06:06:56 +0000 (UTC) Received: by pablf10 with SMTP id lf10so13315361pab.12; Fri, 20 Feb 2015 22:06:55 -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 :message-id:references:to; bh=x6lR4aEsvsCUoEgYBkxhb78M5dfFOJ0n2W+JIJ/MrNk=; b=JxX33sU78KWwhiVb4TDFqBsQMDr0ZxpQBzUghr1kgqiyBg4Bo3slMT8ulRUmzvpQ1y 6jQa6Lq6/OSqbFC2Jph5uN2G8T+7QTRXi1dZBvKPqOwIw6KejkhMQYz2V2BfYhXu2EOt XXlTjHTLrlTYwR92JZAKsuEqvAaa2GLysIR/jpX/1sOQ9kHKJPcuoylzDDP5inxybw2y JQUsqVfDsxq7FRjIpAb7q0EK8xjjUow2At6em6rO31/MqlCTXiK3g1xaYFFFjUqoUX3/ Pbivf7VLoBU6l+SJVygZJy41o9CNIK1eVN3Kqorysls7SimHMfrFvcOHyORIpuxKtxYw i+kw== X-Received: by 10.66.147.169 with SMTP id tl9mr1957788pab.63.1424498815815; Fri, 20 Feb 2015 22:06:55 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:517b:6471:4bb9:7b83? ([2601:8:ab80:7d6:517b:6471:4bb9:7b83]) by mx.google.com with ESMTPSA id r7sm21168318pdo.90.2015.02.20.22.06.54 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Feb 2015 22:06:55 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_6FA57D8A-C5F2-4572-A30D-524E27A29788"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r279093 - in head: etc share/man/man5 From: Garrett Cooper In-Reply-To: <201502210605.t1L65p4P043002@svn.freebsd.org> Date: Fri, 20 Feb 2015 22:06:52 -0800 Message-Id: References: <201502210605.t1L65p4P043002@svn.freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: 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, 21 Feb 2015 06:06:57 -0000 --Apple-Mail=_6FA57D8A-C5F2-4572-A30D-524E27A29788 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On Feb 20, 2015, at 22:05, Mark Johnston wrote: > Author: markj > Date: Sat Feb 21 06:05:51 2015 > New Revision: 279093 > URL: https://svnweb.freebsd.org/changeset/base/279093 > > Log: > Purge references to the mrouted rc script, which was removed in r275299. > > PR: 195785 Thanks >_>... --Apple-Mail=_6FA57D8A-C5F2-4572-A30D-524E27A29788 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJU6CB8AAoJEMZr5QU6S73emmkH/0JHHw97XdvNER3DEaprsbQp bxTc7E6cBsIsFRJiDchKbxIyCVjFz1O3HEFxq2B3JVkWQaWL1e30khiEcITamsUk joWfVe40FWVgtxulYIl228F/nWos9wlX5hCpNgDxzinocIFcar2I0H4dYkvfBa1f ahKe0TqxnFxKyW7iXeTa/5iJ9SNvjRSNmSMMct8wum2lBUoojyXot6icd7kjTPG9 kpAn/2hpKNZAPU3ewpc4TNEwnCodPsE+2Nf63pH6tc7J1d6LY0YVetsDoUzNuRVY CpP9crMNiBl93vPxyoNQNyvbqSnNn1AnCptuXOOwOph2u++i7u7up3uRi9mqnTo= =0hfZ -----END PGP SIGNATURE----- --Apple-Mail=_6FA57D8A-C5F2-4572-A30D-524E27A29788-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 06:24:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4EE13C1; Sat, 21 Feb 2015 06:24:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B5CA79CB; Sat, 21 Feb 2015 06:24:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1L6On6R052514; Sat, 21 Feb 2015 06:24:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1L6OneO052511; Sat, 21 Feb 2015 06:24:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502210624.t1L6OneO052511@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 21 Feb 2015 06:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279094 - head/sys/dev/sfxge 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.18-1 Precedence: list List-Id: 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, 21 Feb 2015 06:24:50 -0000 Author: arybchik Date: Sat Feb 21 06:24:48 2015 New Revision: 279094 URL: https://svnweb.freebsd.org/changeset/base/279094 Log: sfxge: more accurate calculation of maximum number of TSO segments Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/sfxge_tx.c head/sys/dev/sfxge/sfxge_tx.h Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Sat Feb 21 06:05:51 2015 (r279093) +++ head/sys/dev/sfxge/sfxge_tx.c Sat Feb 21 06:24:48 2015 (r279094) @@ -72,10 +72,10 @@ __FBSDID("$FreeBSD$"); * maximum mbuf length we might need more than a ring-ful of * descriptors, but this should not happen in practice except * due to deliberate attack. In that case we will truncate - * the output at a packet boundary. Allow for a reasonable - * minimum MSS of 512. + * the output at a packet boundary. */ -#define SFXGE_TSO_MAX_DESC ((65535 / 512) * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1) +#define SFXGE_TSO_MAX_DESC \ + (SFXGE_TSO_MAX_SEGS * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1) #define SFXGE_TXQ_BLOCK_LEVEL(_entries) ((_entries) - SFXGE_TSO_MAX_DESC) #ifdef SFXGE_HAVE_MQ Modified: head/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.h Sat Feb 21 06:05:51 2015 (r279093) +++ head/sys/dev/sfxge/sfxge_tx.h Sat Feb 21 06:24:48 2015 (r279094) @@ -36,12 +36,22 @@ #include #include +/* Maximum size of TSO packet */ +#define SFXGE_TSO_MAX_SIZE (65535) + +/* + * Maximum number of segments to be created for a TSO packet. + * Allow for a reasonable minimum MSS of 512. + */ +#define SFXGE_TSO_MAX_SEGS howmany(SFXGE_TSO_MAX_SIZE, 512) + /* Maximum number of DMA segments needed to map an mbuf chain. With * TSO, the mbuf length may be just over 64K, divided into 2K mbuf * clusters. (The chain could be longer than this initially, but can * be shortened with m_collapse().) */ -#define SFXGE_TX_MAPPING_MAX_SEG (64 / 2 + 1) +#define SFXGE_TX_MAPPING_MAX_SEG \ + (1 + howmany(SFXGE_TSO_MAX_SIZE, MCLBYTES)) /* * Buffer mapping flags. From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 06:26:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B795547; Sat, 21 Feb 2015 06:26:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8649E9DF; Sat, 21 Feb 2015 06:26:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1L6QBlC052837; Sat, 21 Feb 2015 06:26:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1L6QBqS052836; Sat, 21 Feb 2015 06:26:11 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502210626.t1L6QBqS052836@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 21 Feb 2015 06:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279095 - head/sys/dev/sfxge/common 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.18-1 Precedence: list List-Id: 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, 21 Feb 2015 06:26:11 -0000 Author: arybchik Date: Sat Feb 21 06:26:10 2015 New Revision: 279095 URL: https://svnweb.freebsd.org/changeset/base/279095 Log: sfxge: never set RX_DESCQ_EN during self-test We must not enable RX queues with random parameters when they are mapped into a VF with an untrusted driver. It's probably not a good idea to do this anyway, so take this bit out of the table test masks. Submitted by: Ben Hutchings Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Sat Feb 21 06:24:48 2015 (r279094) +++ head/sys/dev/sfxge/common/siena_nic.c Sat Feb 21 06:26:10 2015 (r279095) @@ -904,7 +904,7 @@ static efx_register_set_t __cs __siena_t static const uint32_t __cs __siena_table_masks[] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x000003FF, 0xFFFF0FFF, 0xFFFFFFFF, 0x00000E7F, 0x00000000, - 0xFFFFFFFF, 0x0FFFFFFF, 0x01800000, 0x00000000, + 0xFFFFFFFE, 0x0FFFFFFF, 0x01800000, 0x00000000, 0xFFFFFFFE, 0x0FFFFFFF, 0x0C000000, 0x00000000, 0x3FFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x000013FF, From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 06:27:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF1A568D; Sat, 21 Feb 2015 06:27:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A9A109E6; Sat, 21 Feb 2015 06:27:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1L6RHkm053060; Sat, 21 Feb 2015 06:27:17 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1L6RHjq053059; Sat, 21 Feb 2015 06:27:17 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502210627.t1L6RHjq053059@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 21 Feb 2015 06:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279096 - head/sys/dev/sfxge/common 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.18-1 Precedence: list List-Id: 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, 21 Feb 2015 06:27:17 -0000 Author: arybchik Date: Sat Feb 21 06:27:16 2015 New Revision: 279096 URL: https://svnweb.freebsd.org/changeset/base/279096 Log: sfxge: keep fw and driver view of autoneg parameters consistent Previously the driver's view was the expected outcome of any reconfiguration even if that reconfiguration failed. Submitted by: Ben Horgan Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Sat Feb 21 06:26:10 2015 (r279095) +++ head/sys/dev/sfxge/common/efx_phy.c Sat Feb 21 06:27:16 2015 (r279096) @@ -427,6 +427,7 @@ efx_phy_adv_cap_set( { efx_port_t *epp = &(enp->en_port); efx_phy_ops_t *epop = epp->ep_epop; + uint32_t old_mask; int rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -440,6 +441,7 @@ efx_phy_adv_cap_set( if (epp->ep_adv_cap_mask == mask) goto done; + old_mask = epp->ep_adv_cap_mask; epp->ep_adv_cap_mask = mask; if ((rc = epop->epo_reconfigure(enp)) != 0) @@ -450,6 +452,17 @@ done: fail2: EFSYS_PROBE(fail2); + + epp->ep_adv_cap_mask = old_mask; + /* Reconfigure for robustness */ + if (epop->epo_reconfigure(enp) != 0) { + /* + * We may have an inconsistent view of our advertised speed + * capabilities. + */ + EFSYS_ASSERT(0); + } + fail1: EFSYS_PROBE1(fail1, int, rc); From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 06:27:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 434F37D0; Sat, 21 Feb 2015 06:27:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2CD9F9EB; Sat, 21 Feb 2015 06:27:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1L6Rkox053191; Sat, 21 Feb 2015 06:27:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1L6RkAY053190; Sat, 21 Feb 2015 06:27:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502210627.t1L6RkAY053190@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 21 Feb 2015 06:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279097 - head/sys/dev/sfxge/common 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.18-1 Precedence: list List-Id: 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, 21 Feb 2015 06:27:46 -0000 Author: arybchik Date: Sat Feb 21 06:27:45 2015 New Revision: 279097 URL: https://svnweb.freebsd.org/changeset/base/279097 Log: sfxge: check allocations are non-NULL before freeing them Caught when efx_filter_init() failed and called efx_filter_fini() in the teardown path. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Sat Feb 21 06:27:16 2015 (r279096) +++ head/sys/dev/sfxge/common/efx_filter.c Sat Feb 21 06:27:45 2015 (r279097) @@ -721,7 +721,7 @@ efx_filter_init( eftp->eft_spec); if (!eftp->eft_spec) { rc = ENOMEM; - goto fail2; + goto fail3; } memset(eftp->eft_spec, 0, eftp->eft_size * sizeof(*eftp->eft_spec)); } @@ -729,6 +729,9 @@ efx_filter_init( return (0); +fail3: + EFSYS_PROBE(fail3); + fail2: EFSYS_PROBE(fail2); efx_filter_fini(enp); @@ -755,12 +758,17 @@ efx_filter_fini( EFX_STATIC_ASSERT(sizeof(eftp->eft_bitmap[0]) == sizeof(uint32_t)); bitmap_size = (eftp->eft_size + (sizeof(uint32_t) * 8) - 1) / 8; - EFSYS_KMEM_FREE(enp->en_esip, bitmap_size, eftp->eft_bitmap); - eftp->eft_bitmap = NULL; + if (eftp->eft_bitmap != NULL) { + EFSYS_KMEM_FREE(enp->en_esip, bitmap_size, + eftp->eft_bitmap); + eftp->eft_bitmap = NULL; + } - EFSYS_KMEM_FREE(enp->en_esip, eftp->eft_size * sizeof(*eftp->eft_spec), - eftp->eft_spec); - eftp->eft_spec = NULL; + if (eftp->eft_spec != NULL) { + EFSYS_KMEM_FREE(enp->en_esip, eftp->eft_size * + sizeof(*eftp->eft_spec), eftp->eft_spec); + eftp->eft_spec = NULL; + } } enp->en_mod_flags &= ~EFX_MOD_FILTER; From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 06:28:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 330B290C; Sat, 21 Feb 2015 06:28:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 13F139F1; Sat, 21 Feb 2015 06:28:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1L6SWIP053368; Sat, 21 Feb 2015 06:28:32 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1L6SW96053364; Sat, 21 Feb 2015 06:28:32 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502210628.t1L6SW96053364@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 21 Feb 2015 06:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279098 - head/sys/dev/sfxge/common 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.18-1 Precedence: list List-Id: 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, 21 Feb 2015 06:28:33 -0000 Author: arybchik Date: Sat Feb 21 06:28:31 2015 New Revision: 279098 URL: https://svnweb.freebsd.org/changeset/base/279098 Log: sfxge: allow TX and RX queue limits to be changed Before the common code had hard coded limits on the IDs RXQs and TXQs could be created with which were suited for the Windows driver with VMQ, and so would prevent queues with IDs greater than or equal to 259 (for TXQs) or 768 (for RXQs) from being created. This change allows the limits to be set in efsys.h, so that all 1024 queues can be created during new manftest tests. Also, the descriptor cache sizes were also hard coded to values suited to the smaller queue counts, and so it was necessary to make them configurable as well. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/siena_nic.c head/sys/dev/sfxge/common/siena_sram.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Feb 21 06:27:45 2015 (r279097) +++ head/sys/dev/sfxge/common/efx.h Sat Feb 21 06:28:31 2015 (r279098) @@ -1622,6 +1622,7 @@ efx_rx_scale_toeplitz_ipv6_key_set( #define EFX_RXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) #define EFX_RXQ_NBUFS(_ndescs) (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_SIZE) #define EFX_RXQ_LIMIT(_ndescs) ((_ndescs) - 16) +#define EFX_RXQ_DC_NDESCS(_dcsize) (8 << _dcsize) typedef enum efx_rxq_type_e { EFX_RXQ_TYPE_DEFAULT, @@ -1708,6 +1709,7 @@ efx_tx_fini( #define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) #define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_SIZE) #define EFX_TXQ_LIMIT(_ndescs) ((_ndescs) - 16) +#define EFX_TXQ_DC_NDESCS(_dcsize) (8 << _dcsize) extern __checkReturn int efx_tx_qcreate( Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat Feb 21 06:27:45 2015 (r279097) +++ head/sys/dev/sfxge/common/efx_impl.h Sat Feb 21 06:28:31 2015 (r279098) @@ -200,8 +200,18 @@ typedef struct efx_nic_ops_s { void (*eno_unprobe)(efx_nic_t *); } efx_nic_ops_t; -#define EFX_TXQ_LIMIT_TARGET 259 -#define EFX_RXQ_LIMIT_TARGET 768 +#ifndef EFX_TXQ_LIMIT_TARGET +# define EFX_TXQ_LIMIT_TARGET 259 +#endif +#ifndef EFX_RXQ_LIMIT_TARGET +# define EFX_RXQ_LIMIT_TARGET 768 +#endif +#ifndef EFX_TXQ_DC_SIZE +#define EFX_TXQ_DC_SIZE 1 /* 16 descriptors */ +#endif +#ifndef EFX_RXQ_DC_SIZE +#define EFX_RXQ_DC_SIZE 3 /* 64 descriptors */ +#endif #if EFSYS_OPT_FILTER Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Sat Feb 21 06:27:45 2015 (r279097) +++ head/sys/dev/sfxge/common/siena_nic.c Sat Feb 21 06:28:31 2015 (r279098) @@ -365,7 +365,8 @@ siena_board_cfg( } encp->enc_buftbl_limit = SIENA_SRAM_ROWS - - (encp->enc_txq_limit * 16) - (encp->enc_rxq_limit * 64); + (encp->enc_txq_limit * EFX_TXQ_DC_NDESCS(EFX_TXQ_DC_SIZE)) - + (encp->enc_rxq_limit * EFX_RXQ_DC_NDESCS(EFX_RXQ_DC_SIZE)); return (0); Modified: head/sys/dev/sfxge/common/siena_sram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_sram.c Sat Feb 21 06:27:45 2015 (r279097) +++ head/sys/dev/sfxge/common/siena_sram.c Sat Feb 21 06:28:31 2015 (r279098) @@ -44,20 +44,21 @@ siena_sram_init( EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); rx_base = encp->enc_buftbl_limit; - tx_base = rx_base + (encp->enc_rxq_limit * 64); + tx_base = rx_base + (encp->enc_rxq_limit * + EFX_RXQ_DC_NDESCS(EFX_RXQ_DC_SIZE)); /* Initialize the transmit descriptor cache */ EFX_POPULATE_OWORD_1(oword, FRF_AZ_SRM_TX_DC_BASE_ADR, tx_base); EFX_BAR_WRITEO(enp, FR_AZ_SRM_TX_DC_CFG_REG, &oword); - EFX_POPULATE_OWORD_1(oword, FRF_AZ_TX_DC_SIZE, 1); /* 16 descriptors */ + EFX_POPULATE_OWORD_1(oword, FRF_AZ_TX_DC_SIZE, EFX_TXQ_DC_SIZE); EFX_BAR_WRITEO(enp, FR_AZ_TX_DC_CFG_REG, &oword); /* Initialize the receive descriptor cache */ EFX_POPULATE_OWORD_1(oword, FRF_AZ_SRM_RX_DC_BASE_ADR, rx_base); EFX_BAR_WRITEO(enp, FR_AZ_SRM_RX_DC_CFG_REG, &oword); - EFX_POPULATE_OWORD_1(oword, FRF_AZ_RX_DC_SIZE, 3); /* 64 descriptors */ + EFX_POPULATE_OWORD_1(oword, FRF_AZ_RX_DC_SIZE, EFX_RXQ_DC_SIZE); EFX_BAR_WRITEO(enp, FR_AZ_RX_DC_CFG_REG, &oword); /* Set receive descriptor pre-fetch low water mark */ From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 13:00:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDC283AF; Sat, 21 Feb 2015 13:00:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B942E14F; Sat, 21 Feb 2015 13:00:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1LD0qMC039089; Sat, 21 Feb 2015 13:00:52 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1LD0qUM039088; Sat, 21 Feb 2015 13:00:52 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201502211300.t1LD0qUM039088@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Sat, 21 Feb 2015 13:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279103 - 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.18-1 Precedence: list List-Id: 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, 21 Feb 2015 13:00:52 -0000 Author: gavin Date: Sat Feb 21 13:00:52 2015 New Revision: 279103 URL: https://svnweb.freebsd.org/changeset/base/279103 Log: Typo: effect -> affect. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Feb 21 10:10:26 2015 (r279102) +++ head/UPDATING Sat Feb 21 13:00:52 2015 (r279103) @@ -36,7 +36,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 but before r278950, the RNG was not seeded properly. Immediately upgrade the kernel to r278950 or later and regenerate any keys (e.g. ssh keys or openssl keys) that were generated w/ a kernel from that - range. This does not effect programs that directly used /dev/random + range. This does not affect programs that directly used /dev/random or /dev/urandom. All userland uses of arc4random(3) are affected. 20150210: From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 15:02:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D14A7953; Sat, 21 Feb 2015 15:02:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BC35BEB5; Sat, 21 Feb 2015 15:02:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1LF2SZj098761; Sat, 21 Feb 2015 15:02:28 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1LF2SYo098760; Sat, 21 Feb 2015 15:02:28 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502211502.t1LF2SYo098760@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 21 Feb 2015 15:02:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279104 - head/lib/libc/regex 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.18-1 Precedence: list List-Id: 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, 21 Feb 2015 15:02:28 -0000 Author: pfg Date: Sat Feb 21 15:02:27 2015 New Revision: 279104 URL: https://svnweb.freebsd.org/changeset/base/279104 Log: Prevent NULL pointer de-reference. As a follow up to r279090, if dp hasn't been defined, we shouldn't attempt to do an optimization here. Modified: head/lib/libc/regex/engine.c Modified: head/lib/libc/regex/engine.c ============================================================================== --- head/lib/libc/regex/engine.c Sat Feb 21 13:00:52 2015 (r279103) +++ head/lib/libc/regex/engine.c Sat Feb 21 15:02:27 2015 (r279104) @@ -244,7 +244,7 @@ matcher(struct re_guts *g, ZAPSTATE(&m->mbs); /* Adjust start according to moffset, to speed things up */ - if (g->moffset > -1) + if (dp != NULL && g->moffset > -1) start = ((dp - g->moffset) < start) ? start : dp - g->moffset; SP("mloop", m->st, *start); From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 22:20:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3ACB94D4; Sat, 21 Feb 2015 22:20:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 26DE1EE6; Sat, 21 Feb 2015 22:20:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1LMK0vC006341; Sat, 21 Feb 2015 22:20:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1LMK0fj006315; Sat, 21 Feb 2015 22:20:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201502212220.t1LMK0fj006315@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 21 Feb 2015 22:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279114 - head/sys/arm/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.18-1 Precedence: list List-Id: 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, 21 Feb 2015 22:20:00 -0000 Author: ian Date: Sat Feb 21 22:19:59 2015 New Revision: 279114 URL: https://svnweb.freebsd.org/changeset/base/279114 Log: Correct a comment which was exactly backwards from reality. Modified: head/sys/arm/include/atomic.h Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Sat Feb 21 22:10:14 2015 (r279113) +++ head/sys/arm/include/atomic.h Sat Feb 21 22:19:59 2015 (r279114) @@ -582,8 +582,8 @@ atomic_load_64(volatile uint64_t *p) /* * The only way to atomically load 64 bits is with LDREXD which puts the - * exclusive monitor into the open state, so reset it with CLREX because - * we don't actually need to store anything. + * exclusive monitor into the exclusive state, so reset it to open state + * with CLREX because we don't actually need to store anything. */ __asm __volatile( "1: \n" From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 22:25:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D401A711; Sat, 21 Feb 2015 22:25:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BF26BF98; Sat, 21 Feb 2015 22:25:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1LMPPJE010645; Sat, 21 Feb 2015 22:25:25 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1LMPPCt010644; Sat, 21 Feb 2015 22:25:25 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201502212225.t1LMPPCt010644@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sat, 21 Feb 2015 22:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279115 - 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.18-1 Precedence: list List-Id: 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, 21 Feb 2015 22:25:25 -0000 Author: jmg Date: Sat Feb 21 22:25:24 2015 New Revision: 279115 URL: https://svnweb.freebsd.org/changeset/base/279115 Log: back Xref get_cyclecount to have it get more exposure... Modified: head/share/man/man9/microuptime.9 Modified: head/share/man/man9/microuptime.9 ============================================================================== --- head/share/man/man9/microuptime.9 Sat Feb 21 22:19:59 2015 (r279114) +++ head/share/man/man9/microuptime.9 Sat Feb 21 22:25:24 2015 (r279115) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 25, 2013 +.Dd February 21, 2015 .Dt MICROUPTIME 9 .Os .Sh NAME @@ -112,6 +112,7 @@ functions is to enforce the user's prefe execution time. .Sh SEE ALSO .Xr bintime 9 , +.Xr get_cyclecount 9 , .Xr getbintime 9 , .Xr getmicrotime 9 , .Xr getnanotime 9 , From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 22:38:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D52BAAD; Sat, 21 Feb 2015 22:38:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4E4C910A; Sat, 21 Feb 2015 22:38:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1LMcXCn015894; Sat, 21 Feb 2015 22:38:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1LMcWVB015893; Sat, 21 Feb 2015 22:38:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201502212238.t1LMcWVB015893@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 21 Feb 2015 22:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279117 - head/sys/x86/iommu 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.18-1 Precedence: list List-Id: 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, 21 Feb 2015 22:38:33 -0000 Author: kib Date: Sat Feb 21 22:38:32 2015 New Revision: 279117 URL: https://svnweb.freebsd.org/changeset/base/279117 Log: Revert r276949 and redo the fix for PCIe/PCI bridges, which do not follow specification and do not provide PCIe capability. Verify if the port above such bridge is downstream PCIe (or root port) and treat the bridge as PCIe/PCI then. This allows to avoid maintaining the table of device ids for bridges without capability, while still calculate correct request originator for devices behind the bridge. Submitted by: Jason Harmening MFC after: 1 week Modified: head/sys/x86/iommu/busdma_dmar.c Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Sat Feb 21 22:27:57 2015 (r279116) +++ head/sys/x86/iommu/busdma_dmar.c Sat Feb 21 22:38:32 2015 (r279117) @@ -98,6 +98,8 @@ dmar_get_requester(device_t dev, uint16_ devclass_t pci_class; device_t l, pci, pcib, pcip, pcibp, requester; int cap_offset; + uint16_t pcie_flags; + bool bridge_is_pcie; pci_class = devclass_find("pci"); l = requester = dev; @@ -144,13 +146,30 @@ dmar_get_requester(device_t dev, uint16_ } else { /* * Device is not PCIe, it cannot be seen as a - * requester by DMAR unit. + * requester by DMAR unit. Check whether the + * bridge is PCIe. */ - requester = pcibp; + bridge_is_pcie = pci_find_cap(pcib, PCIY_EXPRESS, + &cap_offset) == 0; + requester = pcib; - /* Check whether the bus above the bridge is PCIe. */ - if (pci_find_cap(pcibp, PCIY_EXPRESS, - &cap_offset) == 0) { + /* + * Check for a buggy PCIe/PCI bridge that + * doesn't report the express capability. If + * the bridge above it is express but isn't a + * PCI bridge, then we know pcib is actually a + * PCIe/PCI bridge. + */ + if (!bridge_is_pcie && pci_find_cap(pcibp, + PCIY_EXPRESS, &cap_offset) == 0) { + pcie_flags = pci_read_config(pcibp, + cap_offset + PCIER_FLAGS, 2); + if ((pcie_flags & PCIEM_FLAGS_TYPE) != + PCIEM_TYPE_PCI_BRIDGE) + bridge_is_pcie = true; + } + + if (bridge_is_pcie) { /* * The current device is not PCIe, but * the bridge above it is. This is a @@ -168,6 +187,7 @@ dmar_get_requester(device_t dev, uint16_ * non-taken transactions. */ *rid = PCI_RID(pci_get_bus(l), 0, 0); + l = pcibp; } else { /* * Neither the device nor the bridge @@ -177,8 +197,8 @@ dmar_get_requester(device_t dev, uint16_ * requester ID. */ *rid = pci_get_rid(pcib); + l = pcib; } - l = pcibp; } } return (requester); From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 23:20:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B376A89C; Sat, 21 Feb 2015 23:20:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9E0B86D9; Sat, 21 Feb 2015 23:20:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1LNK64h035655; Sat, 21 Feb 2015 23:20:06 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1LNK6Ca035654; Sat, 21 Feb 2015 23:20:06 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201502212320.t1LNK6Ca035654@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 21 Feb 2015 23:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279119 - 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.18-1 Precedence: list List-Id: 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, 21 Feb 2015 23:20:06 -0000 Author: nwhitehorn Date: Sat Feb 21 23:20:05 2015 New Revision: 279119 URL: https://svnweb.freebsd.org/changeset/base/279119 Log: Make kernel ELF image parsing not crash for kernels running at locations other than their link address. Modified: head/sys/kern/link_elf.c Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Sat Feb 21 23:04:18 2015 (r279118) +++ head/sys/kern/link_elf.c Sat Feb 21 23:20:05 2015 (r279119) @@ -381,6 +381,8 @@ link_elf_link_common_finish(linker_file_ return (0); } +extern vm_offset_t __startkernel; + static void link_elf_init(void* arg) { @@ -409,7 +411,11 @@ link_elf_init(void* arg) ef = (elf_file_t) linker_kernel_file; ef->preloaded = 1; +#ifdef __powerpc64__ + ef->address = (caddr_t) (__startkernel - KERNBASE); +#else ef->address = 0; +#endif #ifdef SPARSE_MAPPING ef->object = 0; #endif @@ -417,7 +423,7 @@ link_elf_init(void* arg) if (dp != NULL) parse_dynamic(ef); - linker_kernel_file->address = (caddr_t) KERNBASE; + linker_kernel_file->address += KERNBASE; linker_kernel_file->size = -(intptr_t)linker_kernel_file->address; if (modptr != NULL) { From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 23:39:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D199EF2; Sat, 21 Feb 2015 23:39:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 67D8B8EB; Sat, 21 Feb 2015 23:39:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1LNdi6e044982; Sat, 21 Feb 2015 23:39:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1LNdhpP044980; Sat, 21 Feb 2015 23:39:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201502212339.t1LNdhpP044980@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 21 Feb 2015 23:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279121 - head/bin/pkill/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.18-1 Precedence: list List-Id: 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, 21 Feb 2015 23:39:44 -0000 Author: ngie Date: Sat Feb 21 23:39:43 2015 New Revision: 279121 URL: https://svnweb.freebsd.org/changeset/base/279121 Log: Disguising stderr from jls generally considered harmful Undisguising it dumps out the following logspew: jls: unknown parameter: allow PR: 191019 Modified: head/bin/pkill/tests/pgrep-j_test.sh head/bin/pkill/tests/pkill-j_test.sh Modified: head/bin/pkill/tests/pgrep-j_test.sh ============================================================================== --- head/bin/pkill/tests/pgrep-j_test.sh Sat Feb 21 23:21:40 2015 (r279120) +++ head/bin/pkill/tests/pgrep-j_test.sh Sat Feb 21 23:39:43 2015 (r279121) @@ -4,7 +4,7 @@ jail_name_to_jid() { local check_name="$1" - jls -j "$check_name" -s 2>/dev/null | tr ' ' '\n' | grep jid= | sed -e 's/.*=//g' + jls -j "$check_name" -s | tr ' ' '\n' | grep jid= | sed -e 's/.*=//g' } base=pgrep_j_test @@ -38,6 +38,7 @@ for i in `seq 1 10`; do esac sleep 0.1 done +sleep 0.5 pid1="$(pgrep -f -x -j "$jid" "$sleep $sleep_amount" | sort)" pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_1_1.pid)" \ Modified: head/bin/pkill/tests/pkill-j_test.sh ============================================================================== --- head/bin/pkill/tests/pkill-j_test.sh Sat Feb 21 23:21:40 2015 (r279120) +++ head/bin/pkill/tests/pkill-j_test.sh Sat Feb 21 23:39:43 2015 (r279121) @@ -4,7 +4,7 @@ jail_name_to_jid() { local check_name="$1" - jls -j "$check_name" -s 2>/dev/null | tr ' ' '\n' | grep jid= | sed -e 's/.*=//g' + jls -j "$check_name" -s | tr ' ' '\n' | grep jid= | sed -e 's/.*=//g' } base=pkill_j_test @@ -40,6 +40,7 @@ for i in `seq 1 10`; do esac sleep 0.1 done +sleep 0.5 if pkill -f -j "$jid" $sleep && sleep 0.5 && ! -f ${PWD}/${base}_1_1.pid && From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 23:47:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F7BC355; Sat, 21 Feb 2015 23:47:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0862C9C3; Sat, 21 Feb 2015 23:47:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1LNlMTM049465; Sat, 21 Feb 2015 23:47:22 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1LNlK5o049455; Sat, 21 Feb 2015 23:47:20 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201502212347.t1LNlK5o049455@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sat, 21 Feb 2015 23:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279122 - head/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.18-1 Precedence: list List-Id: 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, 21 Feb 2015 23:47:22 -0000 Author: marcel Date: Sat Feb 21 23:47:20 2015 New Revision: 279122 URL: https://svnweb.freebsd.org/changeset/base/279122 Log: Convert netstat to use libxo. Obtained from: Phil Shafer Ported to -current by: alfred@ (mostly), Kim Shrier Formatting: marcel@ Sponsored by: Juniper Networks, Inc. Modified: head/usr.bin/netstat/Makefile head/usr.bin/netstat/bpf.c head/usr.bin/netstat/flowtable.c head/usr.bin/netstat/if.c head/usr.bin/netstat/inet.c head/usr.bin/netstat/inet6.c head/usr.bin/netstat/ipsec.c head/usr.bin/netstat/main.c head/usr.bin/netstat/mbuf.c head/usr.bin/netstat/mroute.c head/usr.bin/netstat/mroute6.c head/usr.bin/netstat/netgraph.c head/usr.bin/netstat/netisr.c head/usr.bin/netstat/netstat.h head/usr.bin/netstat/pfkey.c head/usr.bin/netstat/route.c head/usr.bin/netstat/sctp.c head/usr.bin/netstat/unix.c Modified: head/usr.bin/netstat/Makefile ============================================================================== --- head/usr.bin/netstat/Makefile Sat Feb 21 23:39:43 2015 (r279121) +++ head/usr.bin/netstat/Makefile Sat Feb 21 23:47:20 2015 (r279122) @@ -41,4 +41,6 @@ LIBADD+= netgraph CFLAGS+=-DNETGRAPH .endif +LIBADD+= xo + .include Modified: head/usr.bin/netstat/bpf.c ============================================================================== --- head/usr.bin/netstat/bpf.c Sat Feb 21 23:39:43 2015 (r279121) +++ head/usr.bin/netstat/bpf.c Sat Feb 21 23:47:20 2015 (r279122) @@ -46,8 +46,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include "netstat.h" @@ -67,7 +69,7 @@ bpf_pidname(pid_t pid) size = sizeof(newkp); error = sysctl(mib, 4, &newkp, &size, NULL, 0); if (error < 0) { - warn("kern.proc.pid failed"); + xo_warn("kern.proc.pid failed"); return (strdup("??????")); } return (strdup(newkp.ki_comm)); @@ -86,6 +88,21 @@ bpf_flags(struct xbpf_d *bd, char *flagb *flagbuf++ = bd->bd_async ? 'a' : '-'; *flagbuf++ = bd->bd_locked ? 'l' : '-'; *flagbuf++ = '\0'; + + if (bd->bd_promisc) + xo_emit("{e:promiscuous/}"); + if (bd->bd_immediate) + xo_emit("{e:immediate/}"); + if (bd->bd_hdrcmplt) + xo_emit("{e:header-complete/}"); + xo_emit("{e:direction}", (bd->bd_direction == BPF_D_IN) ? "input" : + (bd->bd_direction == BPF_D_OUT) ? "output" : "bidirectional"); + if (bd->bd_feedback) + xo_emit("{e:feedback/}"); + if (bd->bd_async) + xo_emit("{e:async/}"); + if (bd->bd_locked) + xo_emit("{e:locked/}"); } void @@ -99,44 +116,55 @@ bpf_stats(char *ifname) bzero(&zerostat, sizeof(zerostat)); if (sysctlbyname("net.bpf.stats", NULL, NULL, &zerostat, sizeof(zerostat)) < 0) - warn("failed to zero bpf counters"); + xo_warn("failed to zero bpf counters"); return; } if (sysctlbyname("net.bpf.stats", NULL, &size, NULL, 0) < 0) { - warn("net.bpf.stats"); + xo_warn("net.bpf.stats"); return; } if (size == 0) return; bd = malloc(size); if (bd == NULL) { - warn("malloc failed"); + xo_warn("malloc failed"); return; } if (sysctlbyname("net.bpf.stats", bd, &size, NULL, 0) < 0) { - warn("net.bpf.stats"); + xo_warn("net.bpf.stats"); free(bd); return; } - (void) printf("%5s %6s %7s %9s %9s %9s %5s %5s %s\n", - "Pid", "Netif", "Flags", "Recv", "Drop", "Match", "Sblen", - "Hblen", "Command"); + xo_emit("{T:/%5s} {T:/%6s} {T:/%7s} {T:/%9s} {T:/%9s} {T:/%9s} " + "{T:/%5s} {T:/%5s} {T:/%s}\n", + "Pid", "Netif", "Flags", "Recv", "Drop", "Match", + "Sblen", "Hblen", "Command"); + xo_open_container("bpf-statistics"); + xo_open_list("bpf-entry"); for (d = &bd[0]; d < &bd[size / sizeof(*d)]; d++) { if (d->bd_structsize != sizeof(*d)) { - warnx("bpf_stats_extended: version mismatch"); + xo_warnx("bpf_stats_extended: version mismatch"); return; } if (ifname && strcmp(ifname, d->bd_ifname) != 0) continue; - bpf_flags(d, flagbuf); + xo_open_instance("bpf-entry"); pname = bpf_pidname(d->bd_pid); - (void) printf("%5d %6s %7s %9ju %9ju %9ju %5d %5d %s\n", - d->bd_pid, d->bd_ifname, flagbuf, - d->bd_rcount, d->bd_dcount, d->bd_fcount, - d->bd_slen, d->bd_hlen, pname); + xo_emit("{k:pid/%5d} {k:interface-name/%6s} ", + d->bd_pid, d->bd_ifname); + bpf_flags(d, flagbuf); + xo_emit("{d:flags/%7s} {:received-packets/%9ju} " + "{:dropped-packets/%9ju} {:filter-packets/%9ju} " + "{:store-buffer-length/%5d} {:hold-buffer-length/%5d} " + "{:process/%s}\n", + flagbuf, (uintmax_t)d->bd_rcount, (uintmax_t)d->bd_dcount, + (uintmax_t)d->bd_fcount, d->bd_slen, d->bd_hlen, pname); free(pname); + xo_close_instance("bpf-entry"); } + xo_close_list("bpf-entry"); + xo_close_container("bpf-statistics"); free(bd); } Modified: head/usr.bin/netstat/flowtable.c ============================================================================== --- head/usr.bin/netstat/flowtable.c Sat Feb 21 23:39:43 2015 (r279121) +++ head/usr.bin/netstat/flowtable.c Sat Feb 21 23:47:20 2015 (r279122) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "netstat.h" /* Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Sat Feb 21 23:39:43 2015 (r279121) +++ head/usr.bin/netstat/if.c Sat Feb 21 23:47:20 2015 (r279122) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "netstat.h" @@ -98,14 +99,38 @@ static const char* pfsyncacts[] = { /* PFSYNC_ACT_EOF */ "end of frame mark", }; +static const char* pfsyncacts_name[] = { + /* PFSYNC_ACT_CLR */ "clear-all-request", + /* PFSYNC_ACT_INS */ "state-insert", + /* PFSYNC_ACT_INS_ACK */ "state-inserted-ack", + /* PFSYNC_ACT_UPD */ "state-update", + /* PFSYNC_ACT_UPD_C */ "compressed-state-update", + /* PFSYNC_ACT_UPD_REQ */ "uncompressed-state-request", + /* PFSYNC_ACT_DEL */ "state-delete", + /* PFSYNC_ACT_DEL_C */ "compressed-state-delete", + /* PFSYNC_ACT_INS_F */ "fragment-insert", + /* PFSYNC_ACT_DEL_F */ "fragment-delete", + /* PFSYNC_ACT_BUS */ "bulk-update-mark", + /* PFSYNC_ACT_TDB */ "TDB-replay-counter-update", + /* PFSYNC_ACT_EOF */ "end-of-frame-mark", +}; + static void -pfsync_acts_stats(const char *fmt, uint64_t *a) +pfsync_acts_stats(const char *list, const char *desc, uint64_t *a) { int i; - for (i = 0; i < PFSYNC_ACT_MAX; i++, a++) - if (*a || sflag <= 1) - printf(fmt, *a, pfsyncacts[i], plural(*a)); + xo_open_list(list); + for (i = 0; i < PFSYNC_ACT_MAX; i++, a++) { + if (*a || sflag <= 1) { + xo_open_instance(list); + xo_emit("\t\t{e:name}{:count/%ju} {N:/%s%s %s}\n", + pfsyncacts_name[i], (uintmax_t)(*a), + pfsyncacts[i], plural(*a), desc); + xo_close_instance(list); + } + } + xo_close_list(list); } /* @@ -129,32 +154,50 @@ pfsync_stats(u_long off, const char *nam } else kread(off, &pfsyncstat, len); - printf("%s:\n", name); + xo_emit("{T:/%s}:\n", name); + xo_open_container(name); #define p(f, m) if (pfsyncstat.f || sflag <= 1) \ - printf(m, (uintmax_t)pfsyncstat.f, plural(pfsyncstat.f)) + xo_emit(m, (uintmax_t)pfsyncstat.f, plural(pfsyncstat.f)) - p(pfsyncs_ipackets, "\t%ju packet%s received (IPv4)\n"); - p(pfsyncs_ipackets6, "\t%ju packet%s received (IPv6)\n"); - pfsync_acts_stats("\t %ju %s%s received\n", + p(pfsyncs_ipackets, "\t{:received-inet-packets/%ju} " + "{N:/packet%s received (IPv4)}\n"); + p(pfsyncs_ipackets6, "\t{:received-inet6-packets/%ju} " + "{N:/packet%s received (IPv6)}\n"); + pfsync_acts_stats("input-histogram", "received", &pfsyncstat.pfsyncs_iacts[0]); - p(pfsyncs_badif, "\t\t%ju packet%s discarded for bad interface\n"); - p(pfsyncs_badttl, "\t\t%ju packet%s discarded for bad ttl\n"); - p(pfsyncs_hdrops, "\t\t%ju packet%s shorter than header\n"); - p(pfsyncs_badver, "\t\t%ju packet%s discarded for bad version\n"); - p(pfsyncs_badauth, "\t\t%ju packet%s discarded for bad HMAC\n"); - p(pfsyncs_badact,"\t\t%ju packet%s discarded for bad action\n"); - p(pfsyncs_badlen, "\t\t%ju packet%s discarded for short packet\n"); - p(pfsyncs_badval, "\t\t%ju state%s discarded for bad values\n"); - p(pfsyncs_stale, "\t\t%ju stale state%s\n"); - p(pfsyncs_badstate, "\t\t%ju failed state lookup/insert%s\n"); - p(pfsyncs_opackets, "\t%ju packet%s sent (IPv4)\n"); - p(pfsyncs_opackets6, "\t%ju packet%s sent (IPv6)\n"); - pfsync_acts_stats("\t %ju %s%s sent\n", + p(pfsyncs_badif, "\t\t/{:dropped-bad-interface/%ju} " + "{N:/packet%s discarded for bad interface}\n"); + p(pfsyncs_badttl, "\t\t{:dropped-bad-ttl/%ju} " + "{N:/packet%s discarded for bad ttl}\n"); + p(pfsyncs_hdrops, "\t\t{:dropped-short-header/%ju} " + "{N:/packet%s shorter than header}\n"); + p(pfsyncs_badver, "\t\t{:dropped-bad-version/%ju} " + "{N:/packet%s discarded for bad version}\n"); + p(pfsyncs_badauth, "\t\t{:dropped-bad-auth/%ju} " + "{N:/packet%s discarded for bad HMAC}\n"); + p(pfsyncs_badact,"\t\t{:dropped-bad-action/%ju} " + "{N:/packet%s discarded for bad action}\n"); + p(pfsyncs_badlen, "\t\t{:dropped-short/%ju} " + "{N:/packet%s discarded for short packet}\n"); + p(pfsyncs_badval, "\t\t{:dropped-bad-values/%ju} " + "{N:/state%s discarded for bad values}\n"); + p(pfsyncs_stale, "\t\t{:dropped-stale-state/%ju} " + "{N:/stale state%s}\n"); + p(pfsyncs_badstate, "\t\t{:dropped-failed-lookup/%ju} " + "{N:/failed state lookup\\/insert%s}\n"); + p(pfsyncs_opackets, "\t{:sent-inet-packets/%ju} " + "{N:/packet%s sent (IPv4})\n"); + p(pfsyncs_opackets6, "\t{:send-inet6-packets/%ju} " + "{N:/packet%s sent (IPv6})\n"); + pfsync_acts_stats("output-histogram", "sent", &pfsyncstat.pfsyncs_oacts[0]); - p(pfsyncs_onomem, "\t\t%ju failure%s due to mbuf memory error\n"); - p(pfsyncs_oerrors, "\t\t%ju send error%s\n"); + p(pfsyncs_onomem, "\t\t{:discarded-no-memory/%ju} " + "{N:/failure%s due to mbuf memory error}\n"); + p(pfsyncs_oerrors, "\t\t{:send-errors/%ju} " + "{N:/send error%s}\n"); #undef p + xo_close_container(name); } #endif /* PF */ @@ -162,10 +205,11 @@ pfsync_stats(u_long off, const char *nam * Display a formatted value, or a '-' in the same space. */ static void -show_stat(const char *fmt, int width, u_long value, short showvalue) +show_stat(const char *fmt, int width, const char *name, + u_long value, short showvalue) { const char *lsep, *rsep; - char newfmt[32]; + char newfmt[64]; lsep = ""; if (strncmp(fmt, "LS", 2) == 0) { @@ -179,23 +223,42 @@ show_stat(const char *fmt, int width, u_ } if (showvalue == 0) { /* Print just dash. */ - sprintf(newfmt, "%s%%%ds%s", lsep, width, rsep); - printf(newfmt, "-"); + xo_emit("{P:/%s}{D:/%*s}{P:/%s}", lsep, width, "-", rsep); return; } + /* + * XXX: workaround {P:} modifier can't be empty and doesn't seem to + * take args... so we need to conditionally include it in the format. + */ +#define maybe_pad(pad) do { \ + if (strlen(pad)) { \ + snprintf(newfmt, sizeof(newfmt), "{P:%s}", pad); \ + xo_emit(newfmt); \ + } \ +} while (0) + if (hflag) { char buf[5]; /* Format in human readable form. */ humanize_number(buf, sizeof(buf), (int64_t)value, "", HN_AUTOSCALE, HN_NOSPACE | HN_DECIMAL); - sprintf(newfmt, "%s%%%ds%s", lsep, width, rsep); - printf(newfmt, buf); + snprintf(newfmt, sizeof(newfmt), "%s%%%ds%s", + lsep, width, rsep); + xo_emit(newfmt, buf); + xo_attr("value", "%lu", value); + maybe_pad(lsep); + snprintf(newfmt, sizeof(newfmt), "{:%s/%%%ds}", name, width); + xo_emit(newfmt, buf); + maybe_pad(rsep); } else { /* Construct the format string. */ - sprintf(newfmt, "%s%%%d%s%s", lsep, width, fmt, rsep); - printf(newfmt, value); + maybe_pad(lsep); + snprintf(newfmt, sizeof(newfmt), "{:%s/%%%d%s}", + name, width, fmt); + xo_emit(newfmt, value); + maybe_pad(rsep); } } @@ -235,34 +298,37 @@ intpr(int interval, void (*pfunc)(char * if (aflag && getifmaddrs(&ifmap) != 0) err(EX_OSERR, "getifmaddrs"); + xo_open_list("interface"); if (!pfunc) { if (Wflag) - printf("%-7.7s", "Name"); + xo_emit("{T:/%-7.7s}", "Name"); else - printf("%-5.5s", "Name"); - printf(" %5.5s %-13.13s %-17.17s %8.8s %5.5s %5.5s", + xo_emit("{T:/%-5.5s}", "Name"); + xo_emit(" {T:/%5.5s} {T:/%-13.13s} {T:/%-17.17s} {T:/%8.8s} " + "{T:/%5.5s} {T:/%5.5s}", "Mtu", "Network", "Address", "Ipkts", "Ierrs", "Idrop"); if (bflag) - printf(" %10.10s","Ibytes"); - printf(" %8.8s %5.5s", "Opkts", "Oerrs"); + xo_emit(" {T:/%10.10s}","Ibytes"); + xo_emit(" {T:/%8.8s} {T:/%5.5s}", "Opkts", "Oerrs"); if (bflag) - printf(" %10.10s","Obytes"); - printf(" %5s", "Coll"); + xo_emit(" {T:/%10.10s}","Obytes"); + xo_emit(" {T:/%5s}", "Coll"); if (dflag) - printf(" %s", "Drop"); - putchar('\n'); + xo_emit(" {T:/%s}", "Drop"); + xo_emit("\n"); } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { bool network = false, link = false; + char *name; if (interface != NULL && strcmp(ifa->ifa_name, interface) != 0) continue; + name = ifa->ifa_name; + if (pfunc) { - char *name; - name = ifa->ifa_name; (*pfunc)(name); /* @@ -278,19 +344,21 @@ intpr(int interval, void (*pfunc)(char * if (af != AF_UNSPEC && ifa->ifa_addr->sa_family != af) continue; + xo_open_instance("interface"); + if (Wflag) - printf("%-7.7s", ifa->ifa_name); + xo_emit("{tk:name/%-7.7s}", name); else - printf("%-5.5s", ifa->ifa_name); + xo_emit("{tk:name/%-5.5s}", name); #define IFA_MTU(ifa) (((struct if_data *)(ifa)->ifa_data)->ifi_mtu) - show_stat("lu", 6, IFA_MTU(ifa), IFA_MTU(ifa)); + show_stat("lu", 6, "mtu", IFA_MTU(ifa), IFA_MTU(ifa)); #undef IFA_MTU switch (ifa->ifa_addr->sa_family) { case AF_UNSPEC: - printf("%-13.13s ", "none"); - printf("%-15.15s ", "none"); + xo_emit("{:network/%-13.13s} ", "none"); + xo_emit("{:address/%-15.15s} ", "none"); break; case AF_INET: { @@ -298,9 +366,10 @@ intpr(int interval, void (*pfunc)(char * sin = (struct sockaddr_in *)ifa->ifa_addr; mask = (struct sockaddr_in *)ifa->ifa_netmask; - printf("%-13.13s ", netname(sin->sin_addr.s_addr, + xo_emit("{t:network/%-13.13s} ", + netname(sin->sin_addr.s_addr, mask->sin_addr.s_addr)); - printf("%-17.17s ", + xo_emit("{t:address/%-17.17s} ", routename(sin->sin_addr.s_addr)); network = true; @@ -314,67 +383,82 @@ intpr(int interval, void (*pfunc)(char * sin6 = (struct sockaddr_in6 *)ifa->ifa_addr; mask = (struct sockaddr_in6 *)ifa->ifa_netmask; - printf("%-13.13s ", netname6(sin6, &mask->sin6_addr)); + xo_emit("{t:network/%-13.13s} ", + netname6(sin6, &mask->sin6_addr)); getnameinfo(ifa->ifa_addr, ifa->ifa_addr->sa_len, addr_buf, sizeof(addr_buf), 0, 0, NI_NUMERICHOST); - printf("%-17.17s ", addr_buf); + xo_emit("{t:address/%-17.17s} ", addr_buf); network = 1; break; - } + } #endif /* INET6 */ case AF_LINK: { struct sockaddr_dl *sdl; char *cp, linknum[10]; - int n, m; + int len = 32; + char buf[len]; + int n, z; sdl = (struct sockaddr_dl *)ifa->ifa_addr; cp = (char *)LLADDR(sdl); n = sdl->sdl_alen; sprintf(linknum, "", sdl->sdl_index); - m = printf("%-13.13s ", linknum); - - while ((--n >= 0) && (m < 30)) - m += printf("%02x%c", *cp++ & 0xff, - n > 0 ? ':' : ' '); - m = 32 - m; - while (m-- > 0) - putchar(' '); - + xo_emit("{t:network/%-13.13s} ", linknum); + buf[0] = '\0'; + z = 0; + while ((--n >= 0) && (z < len)) { + snprintf(buf + z, len - z, "%02x%c", + *cp++ & 0xff, n > 0 ? ':' : ' '); + z += 3; + } + if (z > 0) + xo_emit("{:address/%*s}", 32 - z, buf); + else + xo_emit("{P: }"); link = 1; break; } } #define IFA_STAT(s) (((struct if_data *)ifa->ifa_data)->ifi_ ## s) - show_stat("lu", 8, IFA_STAT(ipackets), link|network); - show_stat("lu", 5, IFA_STAT(ierrors), link); - show_stat("lu", 5, IFA_STAT(iqdrops), link); + show_stat("lu", 8, "received-packets", IFA_STAT(ipackets), + link|network); + show_stat("lu", 5, "received-errors", IFA_STAT(ierrors), link); + show_stat("lu", 5, "dropped-packet", IFA_STAT(iqdrops), link); if (bflag) - show_stat("lu", 10, IFA_STAT(ibytes), link|network); - show_stat("lu", 8, IFA_STAT(opackets), link|network); - show_stat("lu", 5, IFA_STAT(oerrors), link); + show_stat("lu", 10, "received-bytes", IFA_STAT(ibytes), + link|network); + show_stat("lu", 8, "sent-packets", IFA_STAT(opackets), + link|network); + show_stat("lu", 5, "send-errors", IFA_STAT(oerrors), link); if (bflag) - show_stat("lu", 10, IFA_STAT(obytes), link|network); - show_stat("NRSlu", 5, IFA_STAT(collisions), link); + show_stat("lu", 10, "sent-bytes", IFA_STAT(obytes), + link|network); + show_stat("NRSlu", 5, "collisions", IFA_STAT(collisions), link); if (dflag) - show_stat("LSlu", 5, IFA_STAT(oqdrops), link); - putchar('\n'); + show_stat("LSlu", 5, "dropped-packets", + IFA_STAT(oqdrops), link); + xo_emit("\n"); - if (!aflag) + if (!aflag) { + xo_close_instance("interface"); continue; + } /* * Print family's multicast addresses. */ + xo_open_list("multicast-address"); for (ifma = next_ifma(ifmap, ifa->ifa_name, - ifa->ifa_addr->sa_family); - ifma != NULL; - ifma = next_ifma(ifma, ifa->ifa_name, - ifa->ifa_addr->sa_family)) { + ifa->ifa_addr->sa_family); + ifma != NULL; + ifma = next_ifma(ifma, ifa->ifa_name, + ifa->ifa_addr->sa_family)) { const char *fmt = NULL; + xo_open_instance("multicast-address"); switch (ifma->ifma_addr->sa_family) { case AF_INET: { @@ -391,7 +475,7 @@ intpr(int interval, void (*pfunc)(char * getnameinfo(ifma->ifma_addr, ifma->ifma_addr->sa_len, addr_buf, sizeof(addr_buf), 0, 0, NI_NUMERICHOST); - printf("%*s %s\n", + xo_emit("{P:/%*s }{t:address/%-19.19s}", Wflag ? 27 : 25, "", addr_buf); break; #endif /* INET6 */ @@ -412,21 +496,24 @@ intpr(int interval, void (*pfunc)(char * } if (fmt) { - printf("%*s %-17.17s", + xo_emit("{P:/%*s }{t:address/%-17.17s/}", Wflag ? 27 : 25, "", fmt); if (ifma->ifma_addr->sa_family == AF_LINK) { - printf(" %8ju", - (uintmax_t )IFA_STAT(imcasts)); - printf("%*s", bflag ? 17 : 6, ""); - printf(" %8ju", - (uintmax_t )IFA_STAT(omcasts)); - } - putchar('\n'); + xo_emit(" {:received-packets/%8lu}", + IFA_STAT(imcasts)); + xo_emit("{P:/%*s}", bflag? 17 : 6, ""); + xo_emit(" {:sent-packets/%8lu}", + IFA_STAT(omcasts)); + } + xo_emit("\n"); } - + xo_close_instance("multicast-address"); ifma = ifma->ifma_next; } + xo_close_list("multicast-address"); + xo_close_instance("interface"); } + xo_close_list("interface"); freeifaddrs(ifap); if (aflag) @@ -455,7 +542,7 @@ fill_iftot(struct iftot *st) bool found = false; if (getifaddrs(&ifap) != 0) - err(EX_OSERR, "getifaddrs"); + xo_err(EX_OSERR, "getifaddrs"); bzero(st, sizeof(*st)); @@ -481,7 +568,7 @@ fill_iftot(struct iftot *st) } if (interface && found == false) - err(EX_DATAERR, "interface %s not found", interface); + xo_err(EX_DATAERR, "interface %s not found", interface); freeifaddrs(ifap); } @@ -520,23 +607,26 @@ sidewaysintpr(int interval) interval_it.it_interval.tv_usec = 0; interval_it.it_value = interval_it.it_interval; setitimer(ITIMER_REAL, &interval_it, NULL); + xo_open_list("interface-statistics"); banner: - printf("%17s %14s %16s", "input", + xo_emit("{T:/%17s} {T:/%14s} {T:/%16s}\n", "input", interface != NULL ? interface : "(Total)", "output"); - putchar('\n'); - printf("%10s %5s %5s %10s %10s %5s %10s %5s", + xo_emit("{T:/%10s} {T:/%5s} {T:/%5s} {T:/%10s} {T:/%10s} {T:/%5s} " + "{T:/%10s} {T:/%5s}", "packets", "errs", "idrops", "bytes", "packets", "errs", "bytes", "colls"); if (dflag) - printf(" %5.5s", "drops"); - putchar('\n'); - fflush(stdout); + xo_emit(" {T:/%5.5s}", "drops"); + xo_emit("\n"); + xo_flush(); line = 0; loop: - if ((noutputs != 0) && (--noutputs == 0)) - exit(0); + if ((noutputs != 0) && (--noutputs == 0)) { + xo_close_list("interface-statistics"); + return; + } oldmask = sigblock(sigmask(SIGALRM)); while (!signalled) sigpause(0); @@ -546,18 +636,29 @@ loop: fill_iftot(new); - show_stat("lu", 10, new->ift_ip - old->ift_ip, 1); - show_stat("lu", 5, new->ift_ie - old->ift_ie, 1); - show_stat("lu", 5, new->ift_id - old->ift_id, 1); - show_stat("lu", 10, new->ift_ib - old->ift_ib, 1); - show_stat("lu", 10, new->ift_op - old->ift_op, 1); - show_stat("lu", 5, new->ift_oe - old->ift_oe, 1); - show_stat("lu", 10, new->ift_ob - old->ift_ob, 1); - show_stat("NRSlu", 5, new->ift_co - old->ift_co, 1); + xo_open_instance("stats"); + show_stat("lu", 10, "received-packets", + new->ift_ip - old->ift_ip, 1); + show_stat("lu", 5, "received-errors", + new->ift_ie - old->ift_ie, 1); + show_stat("lu", 5, "dropped-packets", + new->ift_id - old->ift_id, 1); + show_stat("lu", 10, "received-bytes", + new->ift_ib - old->ift_ib, 1); + show_stat("lu", 10, "sent-packets", + new->ift_op - old->ift_op, 1); + show_stat("lu", 5, "send-errors", + new->ift_oe - old->ift_oe, 1); + show_stat("lu", 10, "sent-bytes", + new->ift_ob - old->ift_ob, 1); + show_stat("NRSlu", 5, "collisions", + new->ift_co - old->ift_co, 1); if (dflag) - show_stat("LSlu", 5, new->ift_od - old->ift_od, 1); - putchar('\n'); - fflush(stdout); + show_stat("LSlu", 5, "dropped-packets", + new->ift_od - old->ift_od, 1); + xo_close_instance("stats"); + xo_emit("\n"); + xo_flush(); if (new == &ift[0]) { new = &ift[1]; Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Sat Feb 21 23:39:43 2015 (r279121) +++ head/usr.bin/netstat/inet.c Sat Feb 21 23:47:20 2015 (r279122) @@ -78,12 +78,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include "netstat.h" char *inetname(struct in_addr *); -void inetprint(struct in_addr *, int, const char *, int); +void inetprint(const char *, struct in_addr *, int, const char *, int); #ifdef INET6 static int udp_done, tcp_done, sdp_done; #endif /* INET6 */ @@ -114,15 +116,15 @@ pcblist_sysctl(int proto, const char *na len = 0; if (sysctlbyname(mibvar, 0, &len, 0, 0) < 0) { if (errno != ENOENT) - warn("sysctl: %s", mibvar); + xo_warn("sysctl: %s", mibvar); return (0); } if ((buf = malloc(len)) == 0) { - warnx("malloc %lu bytes", (u_long)len); + xo_warnx("malloc %lu bytes", (u_long)len); return (0); } if (sysctlbyname(mibvar, buf, &len, 0, 0) < 0) { - warn("sysctl: %s", mibvar); + xo_warn("sysctl: %s", mibvar); free(buf); return (0); } @@ -205,14 +207,14 @@ pcblist_kvm(u_long off, char **bufp, int (pcbinfo.ipi_count + pcbinfo.ipi_count / 8) * sizeof(struct xinpcb); if ((buf = malloc(len)) == 0) { - warnx("malloc %lu bytes", (u_long)len); + xo_warnx("malloc %lu bytes", (u_long)len); return (0); } p = buf; #define COPYOUT(obj, size) do { \ if (len < (size)) { \ - warnx("buffer size exceeded"); \ + xo_warnx("buffer size exceeded"); \ goto fail; \ } \ bcopy((obj), p, (size)); \ @@ -349,8 +351,8 @@ protopr(u_long off, const char *name, in oxig = xig = (struct xinpgen *)buf; for (xig = (struct xinpgen *)((char *)xig + xig->xig_len); - xig->xig_len > sizeof(struct xinpgen); - xig = (struct xinpgen *)((char *)xig + xig->xig_len)) { + xig->xig_len > sizeof(struct xinpgen); + xig = (struct xinpgen *)((char *)xig + xig->xig_len)) { if (istcp) { timer = &((struct xtcpcb *)xig)->xt_timer; tp = &((struct xtcpcb *)xig)->xt_tp; @@ -403,186 +405,218 @@ protopr(u_long off, const char *name, in if (first) { if (!Lflag) { - printf("Active Internet connections"); + xo_emit("Active Internet connections"); if (aflag) - printf(" (including servers)"); + xo_emit(" (including servers)"); } else - printf( + xo_emit( "Current listen queue sizes (qlen/incqlen/maxqlen)"); - putchar('\n'); + xo_emit("\n"); if (Aflag) - printf("%-*s ", 2 * (int)sizeof(void *), "Tcpcb"); + xo_emit("{T:/%-*s} ", 2 * (int)sizeof(void *), + "Tcpcb"); if (Lflag) - printf((Aflag && !Wflag) ? - "%-5.5s %-14.14s %-18.18s" : - "%-5.5s %-14.14s %-22.22s", + xo_emit((Aflag && !Wflag) ? + "{T:/%-5.5s} {T:/%-14.14s} {T:/%-18.18s}" : + "{T:/%-5.5s} {T:/%-14.14s} {T:/%-22.22s}", "Proto", "Listen", "Local Address"); else if (Tflag) - printf((Aflag && !Wflag) ? - "%-5.5s %-6.6s %-6.6s %-6.6s %-18.18s %s" : - "%-5.5s %-6.6s %-6.6s %-6.6s %-22.22s %s", + xo_emit((Aflag && !Wflag) ? + "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-18.18s} {T:/%s}" : + "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-22.22s} {T:/%s}", "Proto", "Rexmit", "OOORcv", "0-win", "Local Address", "Foreign Address"); else { - printf((Aflag && !Wflag) ? - "%-5.5s %-6.6s %-6.6s %-18.18s %-18.18s" : - "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s", - "Proto", "Recv-Q", "Send-Q", - "Local Address", "Foreign Address"); + xo_emit((Aflag && !Wflag) ? + "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-18.18s} {T:/%-18.18s}" : + "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-22.22s} {T:/%-22.22s}", + "Proto", "Recv-Q", "Send-Q", + "Local Address", "Foreign Address"); if (!xflag && !Rflag) - printf(" (state)"); + xo_emit(" (state)"); } if (xflag) { - printf(" %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s", - "R-MBUF", "S-MBUF", "R-CLUS", - "S-CLUS", "R-HIWA", "S-HIWA", - "R-LOWA", "S-LOWA", "R-BCNT", - "S-BCNT", "R-BMAX", "S-BMAX"); - printf(" %7.7s %7.7s %7.7s %7.7s %7.7s %7.7s", - "rexmt", "persist", "keep", - "2msl", "delack", "rcvtime"); + xo_emit(" {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} " + "{T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} " + "{T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} " + "{T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s}", + "R-MBUF", "S-MBUF", "R-CLUS", "S-CLUS", + "R-HIWA", "S-HIWA", "R-LOWA", "S-LOWA", + "R-BCNT", "S-BCNT", "R-BMAX", "S-BMAX"); + xo_emit(" {T:/%7.7s} {T:/%7.7s} {T:/%7.7s} " + "{T:/%7.7s} {T:/%7.7s} {T:/%7.7s}", + "rexmt", "persist", "keep", "2msl", + "delack", "rcvtime"); } else if (Rflag) { - printf (" %8.8s %5.5s", + xo_emit(" {T:/%8.8s} {T:/%5.5s}", "flowid", "ftype"); } - putchar('\n'); + xo_emit("\n"); first = 0; } if (Lflag && so->so_qlimit == 0) continue; + xo_open_instance("socket"); if (Aflag) { if (istcp) - printf("%*lx ", 2 * (int)sizeof(void *), (u_long)inp->inp_ppcb); + xo_emit("{q:address/%*lx} ", + 2 * (int)sizeof(void *), + (u_long)inp->inp_ppcb); else - printf("%*lx ", 2 * (int)sizeof(void *), (u_long)so->so_pcb); + xo_emit("{q:adddress/%*lx} ", + 2 * (int)sizeof(void *), + (u_long)so->so_pcb); } #ifdef INET6 if ((inp->inp_vflag & INP_IPV6) != 0) vchar = ((inp->inp_vflag & INP_IPV4) != 0) ? - "46" : "6 "; + "46" : "6"; else #endif vchar = ((inp->inp_vflag & INP_IPV4) != 0) ? - "4 " : " "; + "4" : ""; if (istcp && (tp->t_flags & TF_TOE) != 0) - printf("%-3.3s%-2.2s ", "toe", vchar); + xo_emit("{:protocol/%-3.3s%-2.2s/%s%s} ", "toe", vchar); else - printf("%-3.3s%-2.2s ", name, vchar); + xo_emit("{:protocol/%-3.3s%-2.2s/%s%s} ", name, vchar); if (Lflag) { char buf1[15]; snprintf(buf1, 15, "%d/%d/%d", so->so_qlen, so->so_incqlen, so->so_qlimit); - printf("%-14.14s ", buf1); + xo_emit("{:listen-queue-sizes/%-14.14s} ", buf1); } else if (Tflag) { if (istcp) - printf("%6u %6u %6u ", tp->t_sndrexmitpack, - tp->t_rcvoopack, tp->t_sndzerowin); + xo_emit("{:sent-retransmit-packets/%6u} " + "{:received-out-of-order-packets/%6u} " + "{:sent-zero-window/%6u} ", + tp->t_sndrexmitpack, tp->t_rcvoopack, + tp->t_sndzerowin); } else { - printf("%6u %6u ", + xo_emit("{:receive-bytes-waiting/%6u} " + "{:send-bytes-waiting/%6u} ", so->so_rcv.sb_cc, so->so_snd.sb_cc); } if (numeric_port) { if (inp->inp_vflag & INP_IPV4) { - inetprint(&inp->inp_laddr, (int)inp->inp_lport, - name, 1); + inetprint("local", &inp->inp_laddr, + (int)inp->inp_lport, name, 1); if (!Lflag) - inetprint(&inp->inp_faddr, + inetprint("remote", &inp->inp_faddr, (int)inp->inp_fport, name, 1); } #ifdef INET6 else if (inp->inp_vflag & INP_IPV6) { - inet6print(&inp->in6p_laddr, + inet6print("local", &inp->in6p_laddr, (int)inp->inp_lport, name, 1); if (!Lflag) - inet6print(&inp->in6p_faddr, + inet6print("remote", &inp->in6p_faddr, (int)inp->inp_fport, name, 1); } /* else nothing printed now */ #endif /* INET6 */ } else if (inp->inp_flags & INP_ANONPORT) { if (inp->inp_vflag & INP_IPV4) { - inetprint(&inp->inp_laddr, (int)inp->inp_lport, - name, 1); + inetprint("local", &inp->inp_laddr, + (int)inp->inp_lport, name, 1); if (!Lflag) - inetprint(&inp->inp_faddr, + inetprint("remote", &inp->inp_faddr, (int)inp->inp_fport, name, 0); } #ifdef INET6 else if (inp->inp_vflag & INP_IPV6) { - inet6print(&inp->in6p_laddr, + inet6print("local", &inp->in6p_laddr, (int)inp->inp_lport, name, 1); if (!Lflag) - inet6print(&inp->in6p_faddr, + inet6print("remote", &inp->in6p_faddr, (int)inp->inp_fport, name, 0); } /* else nothing printed now */ #endif /* INET6 */ } else { if (inp->inp_vflag & INP_IPV4) { - inetprint(&inp->inp_laddr, (int)inp->inp_lport, - name, 0); + inetprint("local", &inp->inp_laddr, + (int)inp->inp_lport, name, 0); if (!Lflag) - inetprint(&inp->inp_faddr, + inetprint("remote", &inp->inp_faddr, (int)inp->inp_fport, name, inp->inp_lport != inp->inp_fport); } #ifdef INET6 else if (inp->inp_vflag & INP_IPV6) { - inet6print(&inp->in6p_laddr, + inet6print("local", &inp->in6p_laddr, (int)inp->inp_lport, name, 0); if (!Lflag) - inet6print(&inp->in6p_faddr, + inet6print("remote", &inp->in6p_faddr, (int)inp->inp_fport, name, inp->inp_lport != inp->inp_fport); } /* else nothing printed now */ #endif /* INET6 */ } if (xflag) { - printf("%6u %6u %6u %6u %6u %6u %6u %6u %6u %6u %6u %6u", - so->so_rcv.sb_mcnt, so->so_snd.sb_mcnt, - so->so_rcv.sb_ccnt, so->so_snd.sb_ccnt, - so->so_rcv.sb_hiwat, so->so_snd.sb_hiwat, - so->so_rcv.sb_lowat, so->so_snd.sb_lowat, - so->so_rcv.sb_mbcnt, so->so_snd.sb_mbcnt, - so->so_rcv.sb_mbmax, so->so_snd.sb_mbmax); + xo_emit("{:receive-mbufs/%6u} {:send-mbufs/%6u} " + "{:receive-clusters/%6u} {:send-clusters/%6u} " + "{:receive-high-water/%6u} {:send-high-water/%6u} " + "{:receive-low-water/%6u} {:send-low-water/%6u} " + "{:receive-mbuf-bytes/%6u} {:send-mbuf-bytes/%6u} " + "{:receive-mbuf-bytes-max/%6u} " + "{:send-mbuf-bytes-max/%6u}", + so->so_rcv.sb_mcnt, so->so_snd.sb_mcnt, + so->so_rcv.sb_ccnt, so->so_snd.sb_ccnt, + so->so_rcv.sb_hiwat, so->so_snd.sb_hiwat, + so->so_rcv.sb_lowat, so->so_snd.sb_lowat, + so->so_rcv.sb_mbcnt, so->so_snd.sb_mbcnt, + so->so_rcv.sb_mbmax, so->so_snd.sb_mbmax); if (timer != NULL) - printf(" %4d.%02d %4d.%02d %4d.%02d %4d.%02d %4d.%02d %4d.%02d", - timer->tt_rexmt / 1000, (timer->tt_rexmt % 1000) / 10, - timer->tt_persist / 1000, (timer->tt_persist % 1000) / 10, - timer->tt_keep / 1000, (timer->tt_keep % 1000) / 10, - timer->tt_2msl / 1000, (timer->tt_2msl % 1000) / 10, - timer->tt_delack / 1000, (timer->tt_delack % 1000) / 10, - timer->t_rcvtime / 1000, (timer->t_rcvtime % 1000) / 10); + xo_emit(" {:retransmit-timer/%4d.%02d} " + "{:persist-timer/%4d.%02d} " + "{:keepalive-timer/%4d.%02d} " + "{:msl2-timer/%4d.%02d} " + "{:delay-ack-timer/%4d.%02d} " + "{:inactivity-timer/%4d.%02d}", + timer->tt_rexmt / 1000, + (timer->tt_rexmt % 1000) / 10, + timer->tt_persist / 1000, + (timer->tt_persist % 1000) / 10, + timer->tt_keep / 1000, + (timer->tt_keep % 1000) / 10, + timer->tt_2msl / 1000, + (timer->tt_2msl % 1000) / 10, + timer->tt_delack / 1000, + (timer->tt_delack % 1000) / 10, + timer->t_rcvtime / 1000, + (timer->t_rcvtime % 1000) / 10); } if (istcp && !Lflag && !xflag && !Tflag && !Rflag) { if (tp->t_state < 0 || tp->t_state >= TCP_NSTATES) - printf("%d", tp->t_state); + xo_emit("{:tcp-state/%d}", tp->t_state); else { - printf("%s", tcpstates[tp->t_state]); + xo_emit("{:tcp-state/%s}", + tcpstates[tp->t_state]); #if defined(TF_NEEDSYN) && defined(TF_NEEDFIN) /* Show T/TCP `hidden state' */ if (tp->t_flags & (TF_NEEDSYN|TF_NEEDFIN)) - putchar('*'); + xo_emit("{:need-syn-or-fin/*}"); #endif /* defined(TF_NEEDSYN) && defined(TF_NEEDFIN) */ } } if (Rflag) { - printf(" %08x %5d", + /* XXX: is this right Alfred */ + xo_emit(" {:flow-id/%08x} {:flow-type/%5d}", inp->inp_flowid, inp->inp_flowtype); } - putchar('\n'); + xo_emit("\n"); + xo_close_instance("socket"); } if (xig != oxig && xig->xig_gen != oxig->xig_gen) { if (oxig->xig_count > xig->xig_count) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***