From owner-svn-src-head@freebsd.org Sun Sep 17 09:27:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15CC0E05D97; Sun, 17 Sep 2017 09:27:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D67B57CA2E; Sun, 17 Sep 2017 09:27:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8H9RS6f064204; Sun, 17 Sep 2017 09:27:28 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8H9RSI7064203; Sun, 17 Sep 2017 09:27:28 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709170927.v8H9RSI7064203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 Sep 2017 09:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323670 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 323670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 09:27:29 -0000 Author: tuexen Date: Sun Sep 17 09:27:27 2017 New Revision: 323670 URL: https://svnweb.freebsd.org/changeset/base/323670 Log: Fix an accounting bug and use sctp_timer_start to start a timer. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Sep 17 06:35:33 2017 (r323669) +++ head/sys/netinet/sctp_indata.c Sun Sep 17 09:27:27 2017 (r323670) @@ -1594,9 +1594,17 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc next_fsn, control->fsn_included); TAILQ_REMOVE(&control->reasm, at, sctp_next); lenadded = sctp_add_chk_to_control(control, strm, stcb, asoc, at, SCTP_READ_LOCK_NOT_HELD); - asoc->size_on_all_streams += lenadded; if (control->on_read_q) { do_wakeup = 1; + } else { + /* + * We only add to the + * size-on-all-streams if its not on + * the read q. The read q flag will + * cause a sballoc so its accounted + * for there. + */ + asoc->size_on_all_streams += lenadded; } next_fsn++; if (control->end_added && control->pdapi_started) { @@ -4229,8 +4237,7 @@ again: } if (net->flight_size) { j++; - (void)SCTP_OS_TIMER_START(&net->rxt_timer.timer, to_ticks, - sctp_timeout_handler, &net->rxt_timer); + sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net); if (net->window_probe) { net->window_probe = 0; } @@ -4242,8 +4249,7 @@ again: */ net->window_probe = 0; if (!SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) { - SCTP_OS_TIMER_START(&net->rxt_timer.timer, to_ticks, - sctp_timeout_handler, &net->rxt_timer); + sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net); } } else if (SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) { sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, From owner-svn-src-head@freebsd.org Sun Sep 17 10:28:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57976E0873B; Sun, 17 Sep 2017 10:28:47 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 215397DF73; Sun, 17 Sep 2017 10:28:47 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8HASk4p088176; Sun, 17 Sep 2017 10:28:46 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8HASkGa088174; Sun, 17 Sep 2017 10:28:46 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201709171028.v8HASkGa088174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 17 Sep 2017 10:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323671 - in head: . sbin/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: . sbin/geom/class/eli X-SVN-Commit-Revision: 323671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 10:28:47 -0000 Author: oshogbo Date: Sun Sep 17 10:28:45 2017 New Revision: 323671 URL: https://svnweb.freebsd.org/changeset/base/323671 Log: Fix language used in the r322923. Pointed out by: wblock@ MFC after: 1 week X-MFC-with: r322923 Modified: head/UPDATING head/sbin/geom/class/eli/geli.8 Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Sep 17 09:27:27 2017 (r323670) +++ head/UPDATING Sun Sep 17 10:28:45 2017 (r323671) @@ -66,8 +66,8 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: soft-float everything else should be affected. 20170826: - During boot the geli passphrase will be hidden. To restore previous - behavior see geli(8) configuration options. + The geli password typed at boot is now hidden. To restore the previous + behavior, see geli(8) for configuration options. 20170825: Move PMTUD blackhole counters to TCPSTATS and remove them from bare Modified: head/sbin/geom/class/eli/geli.8 ============================================================================== --- head/sbin/geom/class/eli/geli.8 Sun Sep 17 09:27:27 2017 (r323670) +++ head/sbin/geom/class/eli/geli.8 Sun Sep 17 10:28:45 2017 (r323671) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 26, 2017 +.Dd September 17, 2017 .Dt GELI 8 .Os .Sh NAME @@ -280,8 +280,10 @@ To inhibit backups, you can use as the .Ar backupfile . .It Fl d -While booting from this encrypted root filesystem enable visibility of -passphrase length. +When entering the passphrase to boot from this encrypted root filesystem, echo +.Ql * +characters. +This makes the length of the passphrase visible. .It Fl e Ar ealgo Encryption algorithm to use. Currently supported algorithms are: @@ -494,11 +496,14 @@ subcommand. .It Fl B Remove the BOOT flag from the given providers. .It Fl d -While booting from this encrypted root filesystem enable visibility of -passphrase length. +When entering the passphrase to boot from this encrypted root filesystem, echo +.Ql * +characters. +This makes the length of the passphrase visible. .It Fl D -While booting from this encrypted root filesystem disable visibility of -passphrase length. +Disable echoing of any characters when a passphrase is entered to boot from this +encrypted root filesystem. +This hides the passphrase length. .It Fl g Enable booting from this encrypted root filesystem. The boot loader prompts for the passphrase and loads From owner-svn-src-head@freebsd.org Sun Sep 17 12:56:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81277E10181; Sun, 17 Sep 2017 12:56:48 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.imp.ch (smtp.imp.ch [157.161.13.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45D13829EB; Sun, 17 Sep 2017 12:56:47 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from [192.168.225.14] (dhclient-91-190-10-49.flashcable.ch [91.190.10.49]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by fgznet.ch (Postfix) with ESMTPSA id 9B37AC3D0A; Sun, 17 Sep 2017 14:56:44 +0200 (CEST) Subject: Re: svn commit: r323290 - head/sys/vm To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201709072143.v87Lhdsg060310@repo.freebsd.org> <20170914203232.GA72190@bish> <67bb96f2-da01-8bce-65ba-bf811f51e56d@FreeBSD.org> <20170916222846.GA88851@bish> From: Andreas Tobler Message-ID: Date: Sun, 17 Sep 2017 14:56:44 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170916222846.GA88851@bish> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-CH Content-Transfer-Encoding: 7bit X-Scanned-By: Idefix Submit on 127.0.1.1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 12:56:48 -0000 On 17.09.17 00:28, Mark Johnston wrote: > On Sat, Sep 16, 2017 at 09:01:56PM +0200, Andreas Tobler wrote: >> On 14.09.17 22:32, Mark Johnston wrote: >>> On Thu, Sep 14, 2017 at 09:51:17PM +0200, Andreas Tobler wrote: >>>> Hi Mark, >>>> >>>> On 07.09.17 23:43, Mark Johnston wrote: >>>>> Author: markj >>>>> Date: Thu Sep 7 21:43:39 2017 >>>>> New Revision: 323290 >>>>> URL: https://svnweb.freebsd.org/changeset/base/323290 >>>>> >>>>> Log: >>>>> Speed up vm_page_array initialization. >>>>> >>>>> We currently initialize the vm_page array in three passes: one to zero >>>>> the array, one to initialize the "order" field of each page (necessary >>>>> when inserting them into the vm_phys buddy allocator one-by-one), and >>>>> one to initialize the remaining non-zero fields and individually insert >>>>> each page into the allocator. >>>>> >>>>> Merge the three passes into one following a suggestion from alc: >>>>> initialize vm_page fields in a single pass, and use vm_phys_free_contig() >>>>> to efficiently insert physical memory segments into the buddy allocator. >>>>> This reduces the initialization time to a third or a quarter of what it >>>>> was before on most systems that I tested. >>>>> >>>>> Reviewed by: alc, kib >>>>> MFC after: 3 weeks >>>>> Differential Revision: https://reviews.freebsd.org/D12248 >>>>> >>>>> Modified: >>>>> head/sys/vm/vm_page.c >>>>> head/sys/vm/vm_phys.c >>>>> head/sys/vm/vm_phys.h >>>> >>>> I just found out that this commit breaks booting my powerpc64 Quad G5. >>>> It hangs, pressing ctrl-t shows: cmd: sh [*vm active pagequeue]. >>>> >>>> Sometimes it hangs earlier when the kbd is not there yet (usb), then I >>>> can't get the process/task where it hangs. >>>> >>>> Note, this kernel is compiled with the default gcc (4.2.1-FreeBSD) >>>> >>>> Any ideas how to find out what's wrong? >>> >>> Are you able to break into DDB when the hang occurs? If so, the output >>> of "show page" would be helpful. >> >> Unfortunately not from the beginning. The keyboard is usb and it gets >> installed late. Once it survives the loading of the kbd and co, I can >> enter into ddb. But it is a trial and error. So far I didn't succeed to >> come that far. >> >>> Are you running with INVARIANTS configured? If not, please try that. >> >> The above was w/o INVARIANTS. With invariants the kernel panics >> immediately after boot, see pic. > > Thanks. Could you please try applying the patch at the end of this email > and see if that fixes the issue? I have not yet tried to compile it, > sorry. Excellent! I can confirm the two platforms, 32- and 64-bit powerpc, are back to life. Both are running since a few hours and perfom ports rebuild now. Thank you very much for your prompt response and help. Andreas From owner-svn-src-head@freebsd.org Sun Sep 17 14:03:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C9B2E13CC5; Sun, 17 Sep 2017 14:03:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A9B684BD5; Sun, 17 Sep 2017 14:03:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8HE3tNg080424; Sun, 17 Sep 2017 14:03:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8HE3tFf080423; Sun, 17 Sep 2017 14:03:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201709171403.v8HE3tFf080423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 17 Sep 2017 14:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323675 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 323675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 14:03:56 -0000 Author: emaste Date: Sun Sep 17 14:03:54 2017 New Revision: 323675 URL: https://svnweb.freebsd.org/changeset/base/323675 Log: libsysdecode: report invalid cap_rights_t Previously we'd have an assertion failure in cap_rights_is_set if sysdecode_cap_rights is called with an invalid cap_rights_t, so test for validity first. PR: 222258 Reviewed by: cem MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12391 Modified: head/lib/libsysdecode/flags.c Modified: head/lib/libsysdecode/flags.c ============================================================================== --- head/lib/libsysdecode/flags.c Sun Sep 17 10:47:21 2017 (r323674) +++ head/lib/libsysdecode/flags.c Sun Sep 17 14:03:54 2017 (r323675) @@ -1028,8 +1028,15 @@ void sysdecode_cap_rights(FILE *fp, cap_rights_t *rightsp) { struct name_table *t; + int i; bool comma; + for (i = 0; i < CAPARSIZE(rightsp); i++) { + if (CAPIDXBIT(rightsp->cr_rights[i]) != 1 << i) { + fprintf(fp, "invalid cap_rights_t"); + return; + } + } comma = false; for (t = caprights; t->str != NULL; t++) { if (cap_rights_is_set(rightsp, t->val)) { From owner-svn-src-head@freebsd.org Sun Sep 17 15:40:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FE74E199A9; Sun, 17 Sep 2017 15:40:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A2F43634; Sun, 17 Sep 2017 15:40:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8HFeCAH017785; Sun, 17 Sep 2017 15:40:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8HFeCJd017783; Sun, 17 Sep 2017 15:40:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201709171540.v8HFeCJd017783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Sep 2017 15:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323676 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 323676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 15:40:13 -0000 Author: markj Date: Sun Sep 17 15:40:12 2017 New Revision: 323676 URL: https://svnweb.freebsd.org/changeset/base/323676 Log: Implement mmu_page_init for AIM platforms. As of r323290 we cannot rely on the vm_page array being zero-initialized. Reported and tested by: andreast MFC after: 1 week Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Sun Sep 17 14:03:54 2017 (r323675) +++ head/sys/powerpc/aim/mmu_oea.c Sun Sep 17 15:40:12 2017 (r323676) @@ -287,6 +287,7 @@ boolean_t moea_is_referenced(mmu_t, vm_page_t); int moea_ts_referenced(mmu_t, vm_page_t); vm_offset_t moea_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); boolean_t moea_page_exists_quick(mmu_t, pmap_t, vm_page_t); +void moea_page_init(mmu_t, vm_page_t); int moea_page_wired_mappings(mmu_t, vm_page_t); void moea_pinit(mmu_t, pmap_t); void moea_pinit0(mmu_t, pmap_t); @@ -334,6 +335,7 @@ static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_ts_referenced, moea_ts_referenced), MMUMETHOD(mmu_map, moea_map), MMUMETHOD(mmu_page_exists_quick,moea_page_exists_quick), + MMUMETHOD(mmu_page_init, moea_page_init), MMUMETHOD(mmu_page_wired_mappings,moea_page_wired_mappings), MMUMETHOD(mmu_pinit, moea_pinit), MMUMETHOD(mmu_pinit0, moea_pinit0), @@ -1592,6 +1594,15 @@ moea_page_exists_quick(mmu_t mmu, pmap_t pmap, vm_page } rw_wunlock(&pvh_global_lock); return (rv); +} + +void +moea_page_init(mmu_t mmu __unused, vm_page_t m) +{ + + m->md.mdpg_attrs = 0; + m->md.mdpg_cache_attrs = VM_MEMATTR_DEFAULT; + LIST_INIT(&m->md.mdpg_pvoh); } /* Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sun Sep 17 14:03:54 2017 (r323675) +++ head/sys/powerpc/aim/mmu_oea64.c Sun Sep 17 15:40:12 2017 (r323676) @@ -251,6 +251,7 @@ boolean_t moea64_is_referenced(mmu_t, vm_page_t); int moea64_ts_referenced(mmu_t, vm_page_t); vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); boolean_t moea64_page_exists_quick(mmu_t, pmap_t, vm_page_t); +void moea64_page_init(mmu_t, vm_page_t); int moea64_page_wired_mappings(mmu_t, vm_page_t); void moea64_pinit(mmu_t, pmap_t); void moea64_pinit0(mmu_t, pmap_t); @@ -298,6 +299,7 @@ static mmu_method_t moea64_methods[] = { MMUMETHOD(mmu_ts_referenced, moea64_ts_referenced), MMUMETHOD(mmu_map, moea64_map), MMUMETHOD(mmu_page_exists_quick,moea64_page_exists_quick), + MMUMETHOD(mmu_page_init, moea64_page_init), MMUMETHOD(mmu_page_wired_mappings,moea64_page_wired_mappings), MMUMETHOD(mmu_pinit, moea64_pinit), MMUMETHOD(mmu_pinit0, moea64_pinit0), @@ -1896,6 +1898,15 @@ moea64_page_exists_quick(mmu_t mmu, pmap_t pmap, vm_pa } PV_PAGE_UNLOCK(m); return (rv); +} + +void +moea64_page_init(mmu_t mmu __unused, vm_page_t m) +{ + + m->md.mdpg_attrs = 0; + m->md.mdpg_cache_attrs = VM_MEMATTR_DEFAULT; + LIST_INIT(&m->md.mdpg_pvoh); } /* From owner-svn-src-head@freebsd.org Sun Sep 17 15:41:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3552BE19C4A; Sun, 17 Sep 2017 15:41:14 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x22c.google.com (mail-qt0-x22c.google.com [IPv6:2607:f8b0:400d:c0d::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 DF562391F; Sun, 17 Sep 2017 15:41:13 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x22c.google.com with SMTP id s18so5641053qta.3; Sun, 17 Sep 2017 08:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=hzsv9fPFMBU6/dPbVbnhlA2S2isvyWogW+OP0PYonOY=; b=tosEs3EiSqe66tF2CMPOVXPwwNeb45YiYHSs36WOKtYzIxSfeGP4TRh4bsBcj9RJCT QXhdHRWqVp4GJGevDh6+4fxAPXD8LmUCVKyybCG7tU6PtvF17hdIxKJ0eDhK0k0yXM8Y T8czUtYeE5a88kQwJEUYaBrAG7ZwIe1jUPAWXYFQTnjCmRmzD4emq65qlbwKHIvV8Z6e G4Xqk6nGLgN/wu38Cj/pW4QhzuB4mMoX4sSrZ7MGuJPuX4p5Sk89OKvuXfVjflD6+FrV 5voJKRWIJv+/aVCLtOvlTfhHhXmLQYy90usVRz+kldRj3UxcMQsPFKzZ7/w1q5dm/ZYh mDmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=hzsv9fPFMBU6/dPbVbnhlA2S2isvyWogW+OP0PYonOY=; b=qpglBDkMkg06Kn0b/4Nw4hHD6SNZ26zexoLrjJ2QUd0Ug4CdiqMPldvjicn9XlV9GW dopnbH8hKldarY/Tl2q8ycT3V3UhlUbpGLoFgf8Cn62iqXc+3k1RG+FW0OZU3gVslqKS z+t0mVS5j4JviHKilF1em8ocpdMoZwAFs3WoG2KnXXV7tKvVRGdjoc+N8iHXf/n7XMy7 dPQR/gwSxGZr8kNfVROLgnNklL8kQMm9n+bFbu0Mf1+J/mUsrn8g80yqiNCY1nbl+ekF kmyl3YLuSRR6EvLGyHOAAyQ3PWVVBIB7jFBildyPoIY5oLaXCF2s30Px5ukVV0icPuga 933g== X-Gm-Message-State: AHPjjUh3/bRZeXyylnebM85tzpi/11bmusjEQCpLvdpqYQmidlT4t1al ZB8m+py3osnvGla7 X-Google-Smtp-Source: AOwi7QAE6nXFhoJcO5IFTFsqCNt+NLd1/Yg9+GHQnRG2oLhEu4OfjNRcrBCgWDxbJaDFvSQbqBxFQw== X-Received: by 10.200.26.211 with SMTP id h19mr46958462qtk.341.1505662872496; Sun, 17 Sep 2017 08:41:12 -0700 (PDT) Received: from bish (toroon0560w-lp140-01-69-159-37-127.dsl.bell.ca. [69.159.37.127]) by smtp.gmail.com with ESMTPSA id t65sm3663765qke.12.2017.09.17.08.41.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Sep 2017 08:41:11 -0700 (PDT) Sender: Mark Johnston Date: Sun, 17 Sep 2017 11:41:06 -0400 From: Mark Johnston To: Andreas Tobler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323290 - head/sys/vm Message-ID: <20170917154106.GA22322@bish> References: <201709072143.v87Lhdsg060310@repo.freebsd.org> <20170914203232.GA72190@bish> <67bb96f2-da01-8bce-65ba-bf811f51e56d@FreeBSD.org> <20170916222846.GA88851@bish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 15:41:14 -0000 On Sun, Sep 17, 2017 at 02:56:44PM +0200, Andreas Tobler wrote: > On 17.09.17 00:28, Mark Johnston wrote: > > Thanks. Could you please try applying the patch at the end of this email > > and see if that fixes the issue? I have not yet tried to compile it, > > sorry. > > Excellent! I can confirm the two platforms, 32- and 64-bit powerpc, are > back to life. Both are running since a few hours and perfom ports > rebuild now. > > Thank you very much for your prompt response and help. Thanks Andreas, committed as r323676. From owner-svn-src-head@freebsd.org Sun Sep 17 18:50:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 539DBE245F9 for ; Sun, 17 Sep 2017 18:50:54 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-66.reflexion.net [208.70.210.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FDD3696E7 for ; Sun, 17 Sep 2017 18:50:52 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 17026 invoked from network); 17 Sep 2017 18:50:50 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 17 Sep 2017 18:50:50 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Sun, 17 Sep 2017 14:50:50 -0400 (EDT) Received: (qmail 14709 invoked from network); 17 Sep 2017 18:50:50 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 17 Sep 2017 18:50:50 -0000 Received: from [192.168.1.109] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id BCE7AEC8804; Sun, 17 Sep 2017 11:50:49 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r323641 - head/sys/arm/allwinner (BananapiM3 [an A83T] and USB: BPI-M3 historically had usb nodes listed in ofwdump -a) Message-Id: Date: Sun, 17 Sep 2017 11:50:49 -0700 To: Emmanuel Vadot , svn-src-head@freebsd.org, freebsd-arm X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 18:50:54 -0000 > Author: manu > Date: Sat Sep 16 15:58:20 2017 > New Revision: 323641 > URL:=20 > https://svnweb.freebsd.org/changeset/base/323641 >=20 >=20 > Log: > Allwinner usb phy: Rework resource allocation > =20 > . . . > =20 > While here remove A83T code as upstream and FreeBSD dts don't have > nodes for USB. > =20 > . . . > =20 > EHCI is still buggy on Pine64 (hang the board) so do not enable it = for now. > =20 > Tested On: Bananapi (A20), BananapiM2 (A31S), OrangePi One (H3) = Pine64 (A64) I have a BPI-M3 (A83T based) that has not been updated since head -r317015M. It has the root file system on a USB SSD for how I normally boot it. The ubldr and ubldr.bin go back to 2016-Oct-24 or before (file system date). sysutils/u-boot-sinovoip-bpi-m3/files/ has not been updated since then. Nor has the distinfo or pkg-descr files. The Makefile has had only one change since then: Revision 430454 - (view) (download) (annotate) - [select for diffs]=20 Modified Tue Jan 3 11:01:05 2017 UTC (8 months, 1 week ago) by mat=20 File length: 1369 byte(s)=20 Diff to previous 419007 Cleanup BROKEN/IGNORE for 10.3- Sponsored by: Absolight The BPI-M3 has usb nodes show in ofwdump. . . # uname -apKU FreeBSD bpim3 12.0-CURRENT FreeBSD 12.0-CURRENT r317015M arm armv6 = 1200028 1200028 ofwdump -a shows usb nodes: Node 0x38:=20 . . . Node 0x19e0: soc . . . Node 0x1e80: pinctrl@01c20800 . . . Node 0x21f0: usb0_vbus_pin@0 Node 0x2270: usb1_vbus_pin@0 Node 0x22f4: usb2_vbus_pin@0 . . . Node 0x32ec: phy@01c19400 Node 0x3458: usb@01c1a000 Node 0x3550: usb@01c1b000 . . . Node 0x39fc: usb0-vbus Node 0x3ae8: usb1-vbus Node 0x3bdc: usb2-vbus More fully (followed by usb specific ofwdump -p listings): # ofwdump -a Node 0x38:=20 Node 0xcc: chosen Node 0x108: aliases Node 0x13c: memory Node 0x174: cpus Node 0x1a0: cpu@0 Node 0x248: cpu@1 Node 0x294: cpu@2 Node 0x2e0: cpu@3 Node 0x32c: cpu@100 Node 0x3d4: cpu@101 Node 0x420: cpu@102 Node 0x46c: cpu@103 Node 0x4bc: timer Node 0x524: clocks Node 0x55c: osc24M_clk Node 0x5dc: osc16M_clk Node 0x65c: osc16Md512_clk Node 0x70c: clk@01c20028 Node 0x7b8: pll6d2_clk Node 0x860: clk@01c20054 Node 0x918: apb1_clk@01c20054 Node 0x9c8: clk@01c20058 Node 0xa80: clk@01c2005c Node 0xb2c: clk@01c20060 Node 0xe18: clk@01c20088 Node 0xedc: clk@01c2008c Node 0xfa0: clk@01c20090 Node 0x1064: clk@01f01400 Node 0x111c: ahb0_clk Node 0x11c4: clk@01f0140c Node 0x1270: clk@01f01428 Node 0x1384: clk@01c20000 Node 0x1438: clk@01c20004 Node 0x14ec: c0clk@01c20050 Node 0x159c: c1clk@01c20050 Node 0x164c: clk@01c20044 Node 0x16fc: clk@01c200cc Node 0x180c: clk@1 Node 0x188c: clk@2 Node 0x190c: clk@01c00030 Node 0x19e0: soc Node 0x1a2c: mmc@01c0f000 Node 0x1bcc: mmc@01c10000 Node 0x1d00: mmc@01c11000 Node 0x1e80: pinctrl@01c20800 Node 0x1f74: mmc0@0 Node 0x1ffc: mmc0_cd_pin@0 Node 0x2078: uart0@0 Node 0x20f0: uart0@1 Node 0x216c: ahci_pwr_pin@0 Node 0x21f0: usb0_vbus_pin@0 Node 0x2270: usb1_vbus_pin@0 Node 0x22f4: usb2_vbus_pin@0 Node 0x2374: mmc2_8bit Node 0x241c: emac_rgmii@0 Node 0x24e0: i2c0@0 Node 0x2558: i2c1@0 Node 0x25d0: i2c2@0 Node 0x264c: reset@01c202c0 Node 0x26d4: reset@01c202d0 Node 0x275c: reset@01c202d8 Node 0x27e4: timer@01c20c00 Node 0x286c: watchdog@01c20ca0 Node 0x28e8: serial@01c28000 Node 0x29ec: interrupt-controller@01c81000 Node 0x2ac8: reset@01f014b0 Node 0x2b50: pinctrl@01f02c00 Node 0x2c40: r_rsb Node 0x2cbc: i2c@01f03400 Node 0x2dd0: pmic@3a3 Node 0x2e6c: regulators Node 0x2e7c: dcdc2 Node 0x2ec0: dcdc3 Node 0x2f10: interrupt-controller@01f00c0c Node 0x2fc8: i2c@01c2ac00 Node 0x30d4: i2c@01c2b000 Node 0x31e0: i2c@01c2b400 Node 0x32ec: phy@01c19400 Node 0x3458: usb@01c1a000 Node 0x3550: usb@01c1b000 Node 0x3648: ethernet@01c30000 Node 0x37b4: ethernet-phy@1 Node 0x3800: eeprom@01c14000 Node 0x3874: rtp@01f04000 Node 0x3910: ahci-5v Node 0x39fc: usb0-vbus Node 0x3ae8: usb1-vbus Node 0x3bdc: usb2-vbus Node 0x3cd4: vcc3v0 Node 0x3d54: vcc3v3 Node 0x3dd4: vcc5v0 Node 0x3e54: pmu Node 0x3ed0: leds Node 0x3ef4: green_led Node 0x3f34: blue_led Node 0x3f78: __symbols__ # ofwdump -p /soc/pinctrl@01c20800/usb0_vbus_pin@0 Node 0x21f0: usb0_vbus_pin@0 allwinner,pins: 50 42 39 00=20 'PB9' allwinner,function: 67 70 69 6f 5f 6f 75 74 00=20 'gpio_out' allwinner,drive: 00 00 00 00=20 allwinner,pull: 00 00 00 00=20 linux,phandle: 00 00 00 32=20 phandle: 00 00 00 32=20 # ofwdump -p /soc/pinctrl@01c20800/usb1_vbus_pin@0 Node 0x2270: usb1_vbus_pin@0 allwinner,pins: 50 44 32 34 00=20 'PD24' allwinner,function: 67 70 69 6f 5f 6f 75 74 00=20 'gpio_out' allwinner,drive: 00 00 00 00=20 allwinner,pull: 00 00 00 00=20 linux,phandle: 00 00 00 33=20 phandle: 00 00 00 33=20 # ofwdump -p /soc/pinctrl@01c20800/usb2_vbus_pin@0 Node 0x22f4: usb2_vbus_pin@0 allwinner,pins: 50 48 33 00=20 'PH3' allwinner,function: 67 70 69 6f 5f 6f 75 74 00=20 'gpio_out' allwinner,drive: 00 00 00 00=20 allwinner,pull: 00 00 00 00=20 linux,phandle: 00 00 00 34=20 phandle: 00 00 00 34=20 # ofwdump -p /soc/phy@01c19400 Node 0x32ec: phy@01c19400 compatible: 61 6c 6c 77 69 6e 6e 65 72 2c 73 75 6e 38 69 2d 61 38 33 74=20 2d 75 73 62 2d 70 68 79 00=20 'allwinner,sun8i-a83t-usb-phy' reg: 01 c1 94 00 00 00 00 2c 01 c1 a8 00 00 00 00 04 01 c1 b8 00=20 00 00 00 04=20 clocks: 00 00 00 2b 00 00 00 08 00 00 00 2b 00 00 00 09 00 00 00 2b=20 00 00 00 0a 00 00 00 2b 00 00 00 0b=20 clock-names: 75 73 62 30 5f 70 68 79 00 75 73 62 31 5f 70 68 79 00 68 73=20 69 63 5f 70 6c 6c 00 68 73 69 63 5f 31 32 6d 00=20 resets: 00 00 00 2b 00 00 00 00 00 00 00 2b 00 00 00 01 00 00 00 2b=20 00 00 00 02=20 reset-names: 75 73 62 30 5f 72 65 73 65 74 00 75 73 62 31 5f 72 65 73 65=20 74 00 75 73 62 32 5f 72 65 73 65 74 00=20 status: 6f 6b 61 79 00=20 'okay' #phy-cells: 00 00 00 01=20 usb1_vbus-supply: 00 00 00 2c=20 linux,phandle: 00 00 00 2d=20 phandle: 00 00 00 2d=20 # ofwdump -p /soc/usb@01c1a000 Node 0x3458: usb@01c1a000 compatible: 61 6c 6c 77 69 6e 6e 65 72 2c 73 75 6e 38 69 2d 61 38 33 74=20 2d 65 68 63 69 00 67 65 6e 65 72 69 63 2d 65 68 63 69 00=20 reg: 01 c1 a0 00 00 00 01 00=20 interrupts: 00 00 00 00 00 00 00 48 00 00 00 04=20 clocks: 00 00 00 17 00 00 00 1a=20 resets: 00 00 00 19 00 00 00 1a=20 phys: 00 00 00 2d 00 00 00 01=20 phy-names: 75 73 62 00=20 'usb' status: 6f 6b 61 79 00=20 'okay' linux,phandle: 00 00 00 41=20 phandle: 00 00 00 41=20 # ofwdump -p /soc/usb@01c1b000 Node 0x3550: usb@01c1b000 compatible: 61 6c 6c 77 69 6e 6e 65 72 2c 73 75 6e 38 69 2d 61 38 33 74=20 2d 65 68 63 69 00 67 65 6e 65 72 69 63 2d 65 68 63 69 00=20 reg: 01 c1 b0 00 00 00 01 00=20 interrupts: 00 00 00 00 00 00 00 4a 00 00 00 04=20 clocks: 00 00 00 17 00 00 00 1b=20 resets: 00 00 00 19 00 00 00 1b=20 phys: 00 00 00 2d 00 00 00 02=20 phy-names: 75 73 62 00=20 'usb' status: 6f 6b 61 79 00=20 'okay' linux,phandle: 00 00 00 42=20 phandle: 00 00 00 42=20 # ofwdump -p /usb0-vbus Node 0x39fc: usb0-vbus compatible: 72 65 67 75 6c 61 74 6f 72 2d 66 69 78 65 64 00=20 'regulator-fixed' pinctrl-names: 64 65 66 61 75 6c 74 00=20 'default' pinctrl-0: 00 00 00 32=20 regulator-name: 75 73 62 30 2d 76 62 75 73 00=20 'usb0-vbus' regulator-min-microvolt: 00 4c 4b 40=20 regulator-max-microvolt: 00 4c 4b 40=20 enable-active-high: gpio: 00 00 00 1d 00 00 00 01 00 00 00 09 00 00 00 00=20 status: 64 69 73 61 62 6c 65 64 00=20 'disabled' linux,phandle: 00 00 00 47=20 phandle: 00 00 00 47=20 # ofwdump -p /usb1-vbus Node 0x3ae8: usb1-vbus compatible: 72 65 67 75 6c 61 74 6f 72 2d 66 69 78 65 64 00=20 'regulator-fixed' pinctrl-names: 64 65 66 61 75 6c 74 00=20 'default' pinctrl-0: 00 00 00 33=20 regulator-name: 75 73 62 31 2d 76 62 75 73 00=20 'usb1-vbus' regulator-min-microvolt: 00 4c 4b 40=20 regulator-max-microvolt: 00 4c 4b 40=20 regulator-boot-on: enable-active-high: gpio: 00 00 00 1d 00 00 00 03 00 00 00 18 00 00 00 00=20 status: 6f 6b 61 79 00=20 'okay' linux,phandle: 00 00 00 2c=20 phandle: 00 00 00 2c=20 # ofwdump -p /usb2-vbus Node 0x3bdc: usb2-vbus compatible: 72 65 67 75 6c 61 74 6f 72 2d 66 69 78 65 64 00=20 'regulator-fixed' pinctrl-names: 64 65 66 61 75 6c 74 00=20 'default' pinctrl-0: 00 00 00 34=20 regulator-name: 75 73 62 32 2d 76 62 75 73 00=20 'usb2-vbus' regulator-min-microvolt: 00 4c 4b 40=20 regulator-max-microvolt: 00 4c 4b 40=20 regulator-boot-on: enable-active-high: gpio: 00 00 00 1d 00 00 00 07 00 00 00 03 00 00 00 00=20 status: 64 69 73 61 62 6c 65 64 00=20 'disabled' linux,phandle: 00 00 00 48=20 phandle: 00 00 00 48=20 =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Sun Sep 17 19:14:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97A29E2588F; Sun, 17 Sep 2017 19:14:40 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C98A6A1D4; Sun, 17 Sep 2017 19:14:40 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8HJEdaA009205; Sun, 17 Sep 2017 19:14:39 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8HJEcVg009193; Sun, 17 Sep 2017 19:14:38 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201709171914.v8HJEcVg009193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Sun, 17 Sep 2017 19:14:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323683 - in head: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src contrib/file/tests lib/libmagic X-SVN-Group: head X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in head: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src contrib/file/tests lib/libmagic X-SVN-Commit-Revision: 323683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 19:14:40 -0000 Author: gordon Date: Sun Sep 17 19:14:38 2017 New Revision: 323683 URL: https://svnweb.freebsd.org/changeset/base/323683 Log: MFV r323678: file 5.32 Approved by: emaste (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12400 Added: head/contrib/file/magic/Magdir/apache - copied unchanged from r323678, vendor/file/dist/magic/Magdir/apache head/contrib/file/magic/Magdir/bhl - copied unchanged from r323678, vendor/file/dist/magic/Magdir/bhl head/contrib/file/magic/Magdir/gconv - copied unchanged from r323678, vendor/file/dist/magic/Magdir/gconv head/contrib/file/magic/Magdir/gpu - copied unchanged from r323678, vendor/file/dist/magic/Magdir/gpu head/contrib/file/magic/Magdir/webassembly - copied unchanged from r323678, vendor/file/dist/magic/Magdir/webassembly head/contrib/file/magic/Magdir/yara - copied unchanged from r323678, vendor/file/dist/magic/Magdir/yara head/contrib/file/tests/hddrawcopytool.result - copied unchanged from r323678, vendor/file/dist/tests/hddrawcopytool.result head/contrib/file/tests/hddrawcopytool.testfile - copied unchanged from r323678, vendor/file/dist/tests/hddrawcopytool.testfile Modified: head/contrib/file/ChangeLog head/contrib/file/aclocal.m4 head/contrib/file/config.guess head/contrib/file/config.sub head/contrib/file/configure head/contrib/file/configure.ac head/contrib/file/doc/file.man head/contrib/file/doc/libmagic.man head/contrib/file/doc/magic.man head/contrib/file/magic/Localstuff head/contrib/file/magic/Magdir/adventure head/contrib/file/magic/Magdir/amanda head/contrib/file/magic/Magdir/amigaos head/contrib/file/magic/Magdir/android head/contrib/file/magic/Magdir/animation head/contrib/file/magic/Magdir/apple head/contrib/file/magic/Magdir/archive head/contrib/file/magic/Magdir/att3b head/contrib/file/magic/Magdir/audio head/contrib/file/magic/Magdir/blackberry head/contrib/file/magic/Magdir/blender head/contrib/file/magic/Magdir/c-lang head/contrib/file/magic/Magdir/cad head/contrib/file/magic/Magdir/cafebabe head/contrib/file/magic/Magdir/clipper head/contrib/file/magic/Magdir/coff head/contrib/file/magic/Magdir/commands head/contrib/file/magic/Magdir/compress head/contrib/file/magic/Magdir/console head/contrib/file/magic/Magdir/cups head/contrib/file/magic/Magdir/database head/contrib/file/magic/Magdir/der head/contrib/file/magic/Magdir/diff head/contrib/file/magic/Magdir/dolby head/contrib/file/magic/Magdir/dump head/contrib/file/magic/Magdir/dyadic head/contrib/file/magic/Magdir/editors head/contrib/file/magic/Magdir/filesystems head/contrib/file/magic/Magdir/flash head/contrib/file/magic/Magdir/fonts head/contrib/file/magic/Magdir/fsav head/contrib/file/magic/Magdir/games head/contrib/file/magic/Magdir/geo head/contrib/file/magic/Magdir/gnu head/contrib/file/magic/Magdir/gpt head/contrib/file/magic/Magdir/gringotts head/contrib/file/magic/Magdir/hitachi-sh head/contrib/file/magic/Magdir/ibm370 head/contrib/file/magic/Magdir/ibm6000 head/contrib/file/magic/Magdir/icc head/contrib/file/magic/Magdir/images head/contrib/file/magic/Magdir/intel head/contrib/file/magic/Magdir/isz head/contrib/file/magic/Magdir/jpeg head/contrib/file/magic/Magdir/kerberos head/contrib/file/magic/Magdir/kml head/contrib/file/magic/Magdir/linux head/contrib/file/magic/Magdir/lisp head/contrib/file/magic/Magdir/m4 head/contrib/file/magic/Magdir/macintosh head/contrib/file/magic/Magdir/make head/contrib/file/magic/Magdir/maple head/contrib/file/magic/Magdir/marc21 head/contrib/file/magic/Magdir/mathematica head/contrib/file/magic/Magdir/metastore head/contrib/file/magic/Magdir/meteorological head/contrib/file/magic/Magdir/microfocus head/contrib/file/magic/Magdir/mime head/contrib/file/magic/Magdir/misctools head/contrib/file/magic/Magdir/modem head/contrib/file/magic/Magdir/mozilla head/contrib/file/magic/Magdir/msdos head/contrib/file/magic/Magdir/msvc head/contrib/file/magic/Magdir/msx head/contrib/file/magic/Magdir/mup head/contrib/file/magic/Magdir/nasa head/contrib/file/magic/Magdir/netbsd head/contrib/file/magic/Magdir/netscape head/contrib/file/magic/Magdir/nitpicker head/contrib/file/magic/Magdir/os2 head/contrib/file/magic/Magdir/os9 head/contrib/file/magic/Magdir/pbf head/contrib/file/magic/Magdir/pc88 head/contrib/file/magic/Magdir/pc98 head/contrib/file/magic/Magdir/pdf head/contrib/file/magic/Magdir/pdp head/contrib/file/magic/Magdir/perl head/contrib/file/magic/Magdir/pgf head/contrib/file/magic/Magdir/pgp head/contrib/file/magic/Magdir/printer head/contrib/file/magic/Magdir/project head/contrib/file/magic/Magdir/psdbms head/contrib/file/magic/Magdir/python head/contrib/file/magic/Magdir/riff head/contrib/file/magic/Magdir/ruby head/contrib/file/magic/Magdir/sccs head/contrib/file/magic/Magdir/scientific head/contrib/file/magic/Magdir/sendmail head/contrib/file/magic/Magdir/sequent head/contrib/file/magic/Magdir/sgml head/contrib/file/magic/Magdir/sharc head/contrib/file/magic/Magdir/sketch head/contrib/file/magic/Magdir/sql head/contrib/file/magic/Magdir/ssl head/contrib/file/magic/Magdir/sysex head/contrib/file/magic/Magdir/terminfo head/contrib/file/magic/Magdir/vms head/contrib/file/magic/Magdir/vmware head/contrib/file/magic/Magdir/vorbis head/contrib/file/magic/Magdir/windows head/contrib/file/magic/Magdir/xenix head/contrib/file/magic/Magdir/xilinx head/contrib/file/magic/Magdir/xwindows head/contrib/file/magic/Makefile.am head/contrib/file/magic/Makefile.in head/contrib/file/python/magic.py head/contrib/file/src/apprentice.c head/contrib/file/src/cdf.c head/contrib/file/src/cdf.h head/contrib/file/src/cdf_time.c head/contrib/file/src/compress.c head/contrib/file/src/der.c head/contrib/file/src/file.h head/contrib/file/src/fsmagic.c head/contrib/file/src/funcs.c head/contrib/file/src/is_tar.c head/contrib/file/src/magic.c head/contrib/file/src/magic.h.in head/contrib/file/src/print.c head/contrib/file/src/readcdf.c head/contrib/file/src/readelf.c head/contrib/file/src/readelf.h head/contrib/file/src/softmagic.c head/contrib/file/src/vasprintf.c head/contrib/file/tests/Makefile.am head/contrib/file/tests/Makefile.in head/contrib/file/tests/test.c head/lib/libmagic/config.h Directory Properties: head/contrib/file/ (props changed) Modified: head/contrib/file/ChangeLog ============================================================================== --- head/contrib/file/ChangeLog Sun Sep 17 19:04:06 2017 (r323682) +++ head/contrib/file/ChangeLog Sun Sep 17 19:14:38 2017 (r323683) @@ -1,6 +1,60 @@ +2017-09-02 11:53 Christos Zoulas + + * release 5.32 + +2017-08-28 16:37 Christos Zoulas + + * Always reset state in {file,buffer}_apprentice (Krzysztof Wilczynski) + +2017-08-27 03:55 Christos Zoulas + + * Fix always true condition (Thomas Jarosch) + +2017-05-24 17:30 Christos Zoulas + + * pickier parsing of numeric values in magic files. + +2017-05-23 17:55 Christos Zoulas + + * PR/615 add magic_getflags() + +2017-05-23 13:55 Christos Zoulas + + * release 5.31 + +2017-03-17 20:32 Christos Zoulas + + * remove trailing spaces from magic files + * refactor is_tar + * better bounds checks for cdf + +2017-02-10 12:24 Christos Zoulas + + * release 5.30 + +2017-02-07 23:27 Christos Zoulas + + * If we exceeded the offset in a search return no match + (Christoph Biedl) + * Be more lenient on corrupt CDF files (Christoph Biedl) + +2017-02-04 16:46 Christos Zoulas + + * pacify ubsan sign extension (oss-fuzz/524) + +2017-02-01 12:42 Christos Zoulas + + * off by one in cdf parsing (PR/593) + * report debugging sections in elf (PR/591) + +2016-11-06 10:52 Christos Zoulas + + * Allow @@@ in extensions + * Add missing overflow check in der magic (Jonas Wagner) + 2016-10-25 10:40 Christos Zoulas - * release 5.28 + * release 5.29 2016-10-24 11:20 Christos Zoulas @@ -387,7 +441,7 @@ ` 2013-11-06 14:40 Christos Zoulas - * fix erroneous non-zero exit code from non-existant file and message + * fix erroneous non-zero exit code from non-existent file and message 2013-10-29 14:25 Christos Zoulas Modified: head/contrib/file/aclocal.m4 ============================================================================== --- head/contrib/file/aclocal.m4 Sun Sep 17 19:04:06 2017 (r323682) +++ head/contrib/file/aclocal.m4 Sun Sep 17 19:14:38 2017 (r323683) @@ -21,7 +21,7 @@ If you have problems, you may need to regenerate the b To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # visibility.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2005, 2008, 2010-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008, 2010-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. Modified: head/contrib/file/config.guess ============================================================================== --- head/contrib/file/config.guess Sun Sep 17 19:04:06 2017 (r323682) +++ head/contrib/file/config.guess Sun Sep 17 19:14:38 2017 (r323683) @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2015-03-04' +timestamp='2017-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ timestamp='2015-03-04' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -186,9 +186,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. + # to ELF recently (or will in the future) and ABI. case "${UNAME_MACHINE_ARCH}" in - arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -221,7 +224,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: @@ -237,6 +240,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; @@ -249,6 +256,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -265,42 +275,42 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 @@ -373,16 +383,16 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build - SUN_ARCH="i386" + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` @@ -407,7 +417,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} @@ -632,13 +642,13 @@ EOF sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi @@ -677,11 +687,11 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build @@ -694,12 +704,12 @@ EOF # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} @@ -804,14 +814,14 @@ EOF echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) @@ -893,7 +903,7 @@ EOF exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix @@ -916,7 +926,7 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) @@ -962,6 +972,9 @@ EOF ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -987,6 +1000,9 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + mips64el:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; @@ -1019,6 +1035,9 @@ EOF ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; @@ -1038,7 +1057,7 @@ EOF echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} @@ -1117,7 +1136,7 @@ EOF # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1266,6 +1285,9 @@ EOF SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; @@ -1279,9 +1301,9 @@ EOF UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in @@ -1303,7 +1325,7 @@ EOF exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi @@ -1334,7 +1356,7 @@ EOF # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" @@ -1376,7 +1398,7 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos @@ -1387,23 +1409,25 @@ EOF x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; esac cat >&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp Modified: head/contrib/file/config.sub ============================================================================== --- head/contrib/file/config.sub Sun Sep 17 19:04:06 2017 (r323682) +++ head/contrib/file/config.sub Sun Sep 17 19:14:38 2017 (r323683) @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2015-03-08' +timestamp='2017-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ timestamp='2015-03-08' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,8 +53,7 @@ timestamp='2015-03-08' me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. @@ -68,7 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -118,7 +117,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -255,6 +254,7 @@ case $basic_machine in | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ @@ -301,11 +301,12 @@ case $basic_machine in | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -376,6 +377,7 @@ case $basic_machine in | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ @@ -427,13 +429,15 @@ case $basic_machine in | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -518,7 +522,7 @@ case $basic_machine in basic_machine=i386-pc os=-aros ;; - asmjs) + asmjs) basic_machine=asmjs-unknown ;; aux) @@ -641,6 +645,14 @@ case $basic_machine in basic_machine=m68k-bull os=-sysv3 ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; ebmon29k) basic_machine=a29k-amd os=-ebmon @@ -1020,7 +1032,7 @@ case $basic_machine in ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle | ppc-le | powerpc-little) + ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) @@ -1030,7 +1042,7 @@ case $basic_machine in ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) + ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) @@ -1376,18 +1388,18 @@ case $os in | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* | -cloudabi* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ @@ -1396,7 +1408,8 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1528,6 +1541,8 @@ case $os in ;; -nacl*) ;; + -ios) + ;; -none) ;; *) @@ -1622,6 +1637,9 @@ case $basic_machine in ;; sparc-* | *-sun) os=-sunos4.1.1 + ;; + pru-*) + os=-elf ;; *-be) os=-beos Modified: head/contrib/file/configure ============================================================================== --- head/contrib/file/configure Sun Sep 17 19:04:06 2017 (r323682) +++ head/contrib/file/configure Sun Sep 17 19:14:38 2017 (r323683) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.29. +# Generated by GNU Autoconf 2.69 for file 5.32. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.29' -PACKAGE_STRING='file 5.29' +PACKAGE_VERSION='5.32' +PACKAGE_STRING='file 5.32' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1328,7 +1328,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.29 to adapt to many kinds of systems. +\`configure' configures file 5.32 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1398,7 +1398,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.29:";; + short | recursive ) echo "Configuration of file 5.32:";; esac cat <<\_ACEOF @@ -1509,7 +1509,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.29 +file configure 5.32 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2165,7 +2165,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.29, which was +It was created by file $as_me 5.32, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3031,7 +3031,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.29' + VERSION='5.32' cat >>confdefs.h <<_ACEOF @@ -15075,7 +15075,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.29, which was +This file was extended by file $as_me 5.32, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15141,7 +15141,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.29 +file config.status 5.32 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/file/configure.ac ============================================================================== --- head/contrib/file/configure.ac Sun Sep 17 19:04:06 2017 (r323682) +++ head/contrib/file/configure.ac Sun Sep 17 19:14:38 2017 (r323683) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.29],[christos@astron.com]) +AC_INIT([file],[5.32],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) Modified: head/contrib/file/doc/file.man ============================================================================== --- head/contrib/file/doc/file.man Sun Sep 17 19:04:06 2017 (r323682) +++ head/contrib/file/doc/file.man Sun Sep 17 19:14:38 2017 (r323683) @@ -1,4 +1,4 @@ -.\" $File: file.man,v 1.124 2016/10/19 20:52:45 christos Exp $ +.\" $File: file.man,v 1.125 2017/01/03 11:24:46 christos Exp $ .Dd October 19, 2016 .Dt FILE __CSECTION__ .Os @@ -238,8 +238,8 @@ or at least one filename argument must be present; to test the standard input, use .Sq - as a filename argument. -Please note that -.Ar namefile +Please note that +.Ar namefile is unwrapped and the enclosed filenames are processed when this option is encountered and before any further options processing is done. This allows one to process multiple lists of files with different command line @@ -411,10 +411,10 @@ and .Fl h options. .Sh SEE ALSO -.Xr magic __FSECTION__ , .Xr hexdump 1 , .Xr od 1 , .Xr strings 1 , +.Xr magic __FSECTION__ , .Xr fstyp 8 .Sh STANDARDS CONFORMANCE This program is believed to exceed the System V Interface Definition @@ -531,16 +531,15 @@ John Gilmore revised the code extensively, making it b the first version. Geoff Collyer found several inadequacies and provided some magic file entries. -Contributions by the +Contributions of the .Sq \*[Am] operator by Rob McMahon, .Aq cudcv@warwick.ac.uk , 1989. .Pp -Guy Harris, +Guy Harris, .Aq guy@netapp.com , made many changes from 1993 to the present. -1989. .Pp Primary development and maintenance from 1990 to the present by Christos Zoulas @@ -588,7 +587,6 @@ program, and are not covered by the above license. .Nm returns 0 on success, and non-zero on error. .Sh BUGS -.Pp Please report bugs and send patches to the bug tracker at .Pa http://bugs.gw.com/ or the mailing list at @@ -597,7 +595,6 @@ or the mailing list at .Pa http://mx.gw.com/mailman/listinfo/file first to subscribe). .Sh TODO -.Pp Fix output so that tests for MIME and APPLE flags are not needed all over the place, and actual output is only done in one place. This needs a design. @@ -646,16 +643,16 @@ Fix .Dq name and .Dq use -to check for consistency at compile time (duplicate +to check for consistency at compile time (duplicate .Dq name , .Dq use pointing to undefined .Dq name ). -Make +Make .Dq name / -.Dq use +.Dq use more efficient by keeping a sorted list of names. Special-case ^ to flip endianness in the parser so that it does not have to be escaped, and document it. Modified: head/contrib/file/doc/libmagic.man ============================================================================== --- head/contrib/file/doc/libmagic.man Sun Sep 17 19:04:06 2017 (r323682) +++ head/contrib/file/doc/libmagic.man Sun Sep 17 19:14:38 2017 (r323683) @@ -1,4 +1,4 @@ -.\" $File: libmagic.man,v 1.40 2016/03/31 17:51:12 christos Exp $ +.\" $File: libmagic.man,v 1.41 2017/05/23 21:54:07 christos Exp $ .\" .\" Copyright (c) Christos Zoulas 2003. .\" All Rights Reserved. @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 11, 2015 +.Dd May 23, 2017 .Dt LIBMAGIC 3 .Os .Sh NAME @@ -35,6 +35,7 @@ .Nm magic_errno , .Nm magic_descriptor , .Nm magic_buffer , +.Nm magic_getflags , .Nm magic_setflags , .Nm magic_check , .Nm magic_compile , @@ -64,6 +65,8 @@ .Ft const char * .Fn magic_buffer "magic_t cookie" "const void *buffer" "size_t length" .Ft int +.Fn magic_getflags "magic_t cookie" +.Ft int .Fn magic_setflags "magic_t cookie" "int flags" .Ft int .Fn magic_check "magic_t cookie" "const char *filename" @@ -204,6 +207,12 @@ function returns a textual description of the contents argument with .Ar length bytes size. +.Pp +The +.Fn magic_getflags +functions returns a value representing current +.Ar flags +set. .Pp The .Fn magic_setflags Modified: head/contrib/file/doc/magic.man ============================================================================== --- head/contrib/file/doc/magic.man Sun Sep 17 19:04:06 2017 (r323682) +++ head/contrib/file/doc/magic.man Sun Sep 17 19:14:38 2017 (r323683) @@ -1,5 +1,5 @@ -.\" $File: magic.man,v 1.88 2016/07/27 09:42:49 rrt Exp $ -.Dd July 20, 2016 +.\" $File: magic.man,v 1.91 2017/02/12 15:30:08 christos Exp $ +.Dd February 12, 2017 .Dt MAGIC __FSECTION__ .Os .\" install as magic.4 on USG, magic.5 on V7, Berkeley and Linux systems. @@ -7,7 +7,7 @@ .Nm magic .Nd file command's magic pattern file .Sh DESCRIPTION -This manual page documents the format of the magic file as +This manual page documents the format of magic files as used by the .Xr file __CSECTION__ command, version __VERSION__. @@ -17,13 +17,19 @@ command identifies the type of a file using, among other tests, a test for whether the file contains certain .Dq "magic patterns" . -The file -.Pa __MAGIC__ -specifies what patterns are to be tested for, what message or +The database of these +.Dq "magic patterns" +is usually located in a binary file in +.Pa __MAGIC__.mgc +or a directory of source text magic pattern fragment files in +.Pa __MAGIC__ . +The database specifies what patterns are to be tested for, what message or MIME type to print if a particular pattern is found, and additional information to extract from the file. .Pp -Each line of the file specifies a test to be performed. +The format of the source fragment files that are used to build this database +is as follows: +Each line of a fragment file specifies a test to be performed. A test compares the data starting at a particular offset in the file with a byte value, a string or a numeric value. If the test succeeds, a message is printed. @@ -98,13 +104,13 @@ The following modifiers are supported: .It B A byte length (default). .It H -A 2 byte big endian length. +A 4 byte big endian length. .It h -A 2 byte big little length. +A 2 byte big endian length. .It L -A 4 byte big endian length. +A 4 byte little endian length. .It l -A 4 byte big little length. +A 2 byte little endian length. .It J The length includes itself in its count. .El @@ -651,7 +657,7 @@ start of the main indirect offset. \*[Gt]\*[Gt]\*[Gt]\*[Gt](\*[Am]0xe.l+(-4)) string PK\e3\e4 \eb, ZIP self-extracting archive .Ed .Pp -If you have a list of known avalues at a particular continuation level, +If you have a list of known values at a particular continuation level, and you want to provide a switch-like default case: .Bd -literal -offset indent # clear that continuation level match Modified: head/contrib/file/magic/Localstuff ============================================================================== --- head/contrib/file/magic/Localstuff Sun Sep 17 19:04:06 2017 (r323682) +++ head/contrib/file/magic/Localstuff Sun Sep 17 19:14:38 2017 (r323683) @@ -2,6 +2,6 @@ #------------------------------------------------------------------------------ # Localstuff: file(1) magic for locally observed files # -# $File: Localstuff,v 1.4 2003/03/23 04:17:27 christos Exp $ +# $File: Localstuff,v 1.5 2007/01/12 17:38:27 christos Exp $ # Add any locally observed files here. Remember: # text if readable, executable if runnable binary, data if unreadable. Modified: head/contrib/file/magic/Magdir/adventure ============================================================================== --- head/contrib/file/magic/Magdir/adventure Sun Sep 17 19:04:06 2017 (r323682) +++ head/contrib/file/magic/Magdir/adventure Sun Sep 17 19:14:38 2017 (r323683) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: adventure,v 1.15 2015/09/07 10:03:21 christos Exp $ +# $File: adventure,v 1.17 2017/07/03 16:03:40 christos Exp $ # adventure: file(1) magic for Adventure game files # # from Allen Garvin @@ -36,11 +36,12 @@ >0 ubyte <9 >>16 belong&0xfe00f0f0 0x3030 >>>0 ubyte < 10 ->>>>2 ubeshort < 10 +>>>>2 ubeshort x >>>>>18 regex [0-9][0-9][0-9][0-9][0-9][0-9] ->>>>>>0 ubyte < 10 Infocom (Z-machine %d, ->>>>>>>2 ubeshort < 10 Release %d / ->>>>>>>>18 string >\0 Serial %.6s) +>>>>>>0 ubyte < 10 Infocom (Z-machine %d +>>>>>>>2 ubeshort x \b, Release %d +>>>>>>>>18 string >\0 \b, Serial %.6s +>>>>>>>>18 string x \b) !:strength + 40 !:mime application/x-zmachine @@ -78,7 +79,7 @@ !:mime application/x-tads # Some saved game files start with "TADS2 save/g\n\r\032\0", a little-endian # 2-byte length N, the N-char name of the game file *without* a NUL (darn!), -# "TADS2 save\n\r\032\0" and the interpreter version. +# "TADS2 save\n\r\032\0" and the interpreter version. 0 string TADS2\ save/g TADS >12 belong !0x0A0D1A00 saved game data, CORRUPTED >12 belong 0x0A0D1A00 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Sep 17 19:29:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1920E26534; Sun, 17 Sep 2017 19:29:07 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 189C26A8B3; Sun, 17 Sep 2017 19:29:06 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 4de6ae09; Sun, 17 Sep 2017 21:29:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=yflQhIe3mjzc9q+emDNJVW3cZH8=; b=VbkePRBTYKK6X1IMYf4fTHl/2VOl HNwAMyxOc1muZcPtBd2N+C4eiob+5eq1jXKaGBw2sBCJLPLS/Wle1MW7flJsZvfp JBEkurL7nZgmeTkJpnzWFJsRKP0X2kkRwp8RZRoA791WSmIIfMJ2GyH+qa2oU+3E om2IV5E6b46/mco= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=pk+NAiQZeqQEi/k2+B888JG+yg0Rs5KuvZNkjLYyc9bZZ2R6SHUBJwz1 vJVzHhDVchSJUp1aJ32D65RPKcWmse8C/kDVA7f4LxsGsJJocgPDkm+MkC6SS2Hz Z0qX+Sb5v6wKgkAbFFbMJ+XWlA2A+cNm3f+kzgPQugAkS2r+umI= Received: from knuckles.blih.net (ip-54.net-82-216-203.roubaix.rev.numericable.fr [82.216.203.54]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 6ddc91d9 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Sun, 17 Sep 2017 21:29:03 +0200 (CEST) Date: Sun, 17 Sep 2017 21:28:58 +0200 From: Emmanuel Vadot To: Mark Millard Cc: Emmanuel Vadot , svn-src-head@freebsd.org, freebsd-arm Subject: Re: svn commit: r323641 - head/sys/arm/allwinner (BananapiM3 [an A83T] and USB: BPI-M3 historically had usb nodes listed in ofwdump -a) Message-Id: <20170917212858.58fda5174908940ff1ffcc49@bidouilliste.com> In-Reply-To: References: X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 19:29:07 -0000 On Sun, 17 Sep 2017 11:50:49 -0700 Mark Millard wrote: > > Author: manu > > Date: Sat Sep 16 15:58:20 2017 > > New Revision: 323641 > > URL: > > https://svnweb.freebsd.org/changeset/base/323641 > > > > > > Log: > > Allwinner usb phy: Rework resource allocation > > > > . . . > > > > While here remove A83T code as upstream and FreeBSD dts don't have > > nodes for USB. > > > > . . . > > > > EHCI is still buggy on Pine64 (hang the board) so do not enable it for now. > > > > Tested On: Bananapi (A20), BananapiM2 (A31S), OrangePi One (H3) Pine64 (A64) > > I have a BPI-M3 (A83T based) that has not been updated > since head -r317015M. It has the root file system on a > USB SSD for how I normally boot it. The ubldr and > ubldr.bin go back to 2016-Oct-24 or before (file > system date). > > sysutils/u-boot-sinovoip-bpi-m3/files/ has not > been updated since then. Nor has the distinfo > or pkg-descr files. The Makefile has had only > one change since then: > > Revision 430454 - (view) (download) (annotate) - [select for diffs] > Modified Tue Jan 3 11:01:05 2017 UTC (8 months, 1 week ago) by mat > File length: 1369 byte(s) > Diff to previous 419007 > Cleanup BROKEN/IGNORE for 10.3- > > Sponsored by: Absolight I don't have the board so if you want to update u-boot for it please provide a patch. > > The BPI-M3 has usb nodes show in ofwdump. . . > Yeah I miss-read the DTS because 4 of them are used for one board ... I don't want to update the dts in sys/boot/fdt/dts/arm and I will remove them soon. Upstream DTS don't have usb in it but it will be easy to add it. You could send a patch to linux-arm if you want but note that upstream DTS now uses clkng binding (i.e. not all clocks are under /clocks node) so it will require a driver on our side. And please no need to send a 1km long email. -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Sun Sep 17 19:40:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7939FE26E40; Sun, 17 Sep 2017 19:40:18 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4795E6AEDB; Sun, 17 Sep 2017 19:40:18 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8HJeHSh018021; Sun, 17 Sep 2017 19:40:17 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8HJeHmQ018020; Sun, 17 Sep 2017 19:40:17 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201709171940.v8HJeHmQ018020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 17 Sep 2017 19:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323684 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 323684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 19:40:18 -0000 Author: jhibbits Date: Sun Sep 17 19:40:17 2017 New Revision: 323684 URL: https://svnweb.freebsd.org/changeset/base/323684 Log: Print the correct bitmask for the running Book-E CPU All the Book-E world is no longer e500v{1,2}. e500mc the 64-bit derivatives do not use the DOZE/NAP bits with MSR[WE], instead using the `wait' instruction to wait for interrupts, and SoC plane controls (via CCSR) for power management. MFC after: 1 week Modified: head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Sun Sep 17 19:14:38 2017 (r323683) +++ head/sys/powerpc/powerpc/cpu.c Sun Sep 17 19:40:17 2017 (r323684) @@ -530,16 +530,32 @@ cpu_booke_setup(int cpuid, uint16_t vers) { #ifdef BOOKE_E500 register_t hid0; + const char *bitmask; hid0 = mfspr(SPR_HID0); - /* Programe power-management mode. */ - hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP); - hid0 |= HID0_DOZE; + switch (vers) { + case FSL_E500mc: + bitmask = HID0_E500MC_BITMASK; + break; + case FSL_E5500: + case FSL_E6500: + bitmask = HID0_E5500_BITMASK; + break; + case FSL_E500v1: + case FSL_E500v2: + /* Only e500v1/v2 support HID0 power management setup. */ - mtspr(SPR_HID0, hid0); + /* Programe power-management mode. */ + hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP); + hid0 |= HID0_DOZE; - printf("cpu%d: HID0 %b\n", cpuid, (int)hid0, HID0_E500_BITMASK); + mtspr(SPR_HID0, hid0); + default: + bitmask = HID0_E500_BITMASK; + break; + } + printf("cpu%d: HID0 %b\n", cpuid, (int)hid0, bitmask); #endif if (cpu_idle_hook == NULL) From owner-svn-src-head@freebsd.org Sun Sep 17 19:44:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 393DEE00358 for ; Sun, 17 Sep 2017 19:44:16 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-66.reflexion.net [208.70.210.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0A916B3D4 for ; Sun, 17 Sep 2017 19:44:15 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 15102 invoked from network); 17 Sep 2017 19:44:14 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 17 Sep 2017 19:44:14 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Sun, 17 Sep 2017 15:44:14 -0400 (EDT) Received: (qmail 13981 invoked from network); 17 Sep 2017 19:44:14 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 17 Sep 2017 19:44:14 -0000 Received: from [192.168.1.109] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id ABDA7EC85D5; Sun, 17 Sep 2017 12:44:13 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r323641 - head/sys/arm/allwinner (BananapiM3 [an A83T] and USB: BPI-M3 historically had usb nodes listed in ofwdump -a) Date: Sun, 17 Sep 2017 12:44:13 -0700 References: To: Emmanuel Vadot , svn-src-head@freebsd.org, freebsd-arm In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 19:44:16 -0000 [I went looking in the tree for head -r323676 and found *.dts* files listing usb things for the BPI-M3 and a83t. So I add notes about that.] On 2017-Sep-17, at 11:50 AM, Mark Millard wrote: >> Author: manu >> Date: Sat Sep 16 15:58:20 2017 >> New Revision: 323641 >> URL:=20 >> https://svnweb.freebsd.org/changeset/base/323641 >>=20 >>=20 >> Log: >> Allwinner usb phy: Rework resource allocation >>=20 >> . . . >>=20 >> While here remove A83T code as upstream and FreeBSD dts don't have >> nodes for USB. >>=20 >> . . . >>=20 >> EHCI is still buggy on Pine64 (hang the board) so do not enable it = for now. >>=20 >> Tested On: Bananapi (A20), BananapiM2 (A31S), OrangePi One (H3) = Pine64 (A64) >=20 > I have a BPI-M3 (A83T based) that has not been updated > since head -r317015M. It has the root file system on a > USB SSD for how I normally boot it. The ubldr and > ubldr.bin go back to 2016-Oct-24 or before (file > system date). >=20 > sysutils/u-boot-sinovoip-bpi-m3/files/ has not > been updated since then. Nor has the distinfo > or pkg-descr files. The Makefile has had only > one change since then: >=20 > Revision 430454 - (view) (download) (annotate) - [select for diffs]=20 > Modified Tue Jan 3 11:01:05 2017 UTC (8 months, 1 week ago) by mat=20 > File length: 1369 byte(s)=20 > Diff to previous 419007 > Cleanup BROKEN/IGNORE for 10.3- >=20 > Sponsored by: Absolight >=20 >=20 >=20 > The BPI-M3 has usb nodes show in ofwdump. . . >=20 > # uname -apKU > FreeBSD bpim3 12.0-CURRENT FreeBSD 12.0-CURRENT r317015M arm armv6 = 1200028 1200028 >=20 > ofwdump -a shows usb nodes: >=20 > Node 0x38:=20 > . . . > Node 0x19e0: soc > . . . > Node 0x1e80: pinctrl@01c20800 > . . . > Node 0x21f0: usb0_vbus_pin@0 > Node 0x2270: usb1_vbus_pin@0 > Node 0x22f4: usb2_vbus_pin@0 > . . . > Node 0x32ec: phy@01c19400 > Node 0x3458: usb@01c1a000 > Node 0x3550: usb@01c1b000 > . . . > Node 0x39fc: usb0-vbus > Node 0x3ae8: usb1-vbus > Node 0x3bdc: usb2-vbus >=20 > More fully (followed by usb specific > ofwdump -p listings): >=20 > # ofwdump -a > Node 0x38:=20 > Node 0xcc: chosen > Node 0x108: aliases > Node 0x13c: memory > Node 0x174: cpus > Node 0x1a0: cpu@0 > Node 0x248: cpu@1 > Node 0x294: cpu@2 > Node 0x2e0: cpu@3 > Node 0x32c: cpu@100 > Node 0x3d4: cpu@101 > Node 0x420: cpu@102 > Node 0x46c: cpu@103 > Node 0x4bc: timer > Node 0x524: clocks > Node 0x55c: osc24M_clk > Node 0x5dc: osc16M_clk > Node 0x65c: osc16Md512_clk > Node 0x70c: clk@01c20028 > Node 0x7b8: pll6d2_clk > Node 0x860: clk@01c20054 > Node 0x918: apb1_clk@01c20054 > Node 0x9c8: clk@01c20058 > Node 0xa80: clk@01c2005c > Node 0xb2c: clk@01c20060 > Node 0xe18: clk@01c20088 > Node 0xedc: clk@01c2008c > Node 0xfa0: clk@01c20090 > Node 0x1064: clk@01f01400 > Node 0x111c: ahb0_clk > Node 0x11c4: clk@01f0140c > Node 0x1270: clk@01f01428 > Node 0x1384: clk@01c20000 > Node 0x1438: clk@01c20004 > Node 0x14ec: c0clk@01c20050 > Node 0x159c: c1clk@01c20050 > Node 0x164c: clk@01c20044 > Node 0x16fc: clk@01c200cc > Node 0x180c: clk@1 > Node 0x188c: clk@2 > Node 0x190c: clk@01c00030 > Node 0x19e0: soc > Node 0x1a2c: mmc@01c0f000 > Node 0x1bcc: mmc@01c10000 > Node 0x1d00: mmc@01c11000 > Node 0x1e80: pinctrl@01c20800 > Node 0x1f74: mmc0@0 > Node 0x1ffc: mmc0_cd_pin@0 > Node 0x2078: uart0@0 > Node 0x20f0: uart0@1 > Node 0x216c: ahci_pwr_pin@0 > Node 0x21f0: usb0_vbus_pin@0 > Node 0x2270: usb1_vbus_pin@0 > Node 0x22f4: usb2_vbus_pin@0 > Node 0x2374: mmc2_8bit > Node 0x241c: emac_rgmii@0 > Node 0x24e0: i2c0@0 > Node 0x2558: i2c1@0 > Node 0x25d0: i2c2@0 > Node 0x264c: reset@01c202c0 > Node 0x26d4: reset@01c202d0 > Node 0x275c: reset@01c202d8 > Node 0x27e4: timer@01c20c00 > Node 0x286c: watchdog@01c20ca0 > Node 0x28e8: serial@01c28000 > Node 0x29ec: interrupt-controller@01c81000 > Node 0x2ac8: reset@01f014b0 > Node 0x2b50: pinctrl@01f02c00 > Node 0x2c40: r_rsb > Node 0x2cbc: i2c@01f03400 > Node 0x2dd0: pmic@3a3 > Node 0x2e6c: regulators > Node 0x2e7c: dcdc2 > Node 0x2ec0: dcdc3 > Node 0x2f10: interrupt-controller@01f00c0c > Node 0x2fc8: i2c@01c2ac00 > Node 0x30d4: i2c@01c2b000 > Node 0x31e0: i2c@01c2b400 > Node 0x32ec: phy@01c19400 > Node 0x3458: usb@01c1a000 > Node 0x3550: usb@01c1b000 > Node 0x3648: ethernet@01c30000 > Node 0x37b4: ethernet-phy@1 > Node 0x3800: eeprom@01c14000 > Node 0x3874: rtp@01f04000 > Node 0x3910: ahci-5v > Node 0x39fc: usb0-vbus > Node 0x3ae8: usb1-vbus > Node 0x3bdc: usb2-vbus > Node 0x3cd4: vcc3v0 > Node 0x3d54: vcc3v3 > Node 0x3dd4: vcc5v0 > Node 0x3e54: pmu > Node 0x3ed0: leds > Node 0x3ef4: green_led > Node 0x3f34: blue_led > Node 0x3f78: __symbols__ >=20 > # ofwdump -p /soc/pinctrl@01c20800/usb0_vbus_pin@0 > Node 0x21f0: usb0_vbus_pin@0 > allwinner,pins: > 50 42 39 00=20 > 'PB9' > allwinner,function: > 67 70 69 6f 5f 6f 75 74 00=20 > 'gpio_out' > allwinner,drive: > 00 00 00 00=20 > allwinner,pull: > 00 00 00 00=20 > linux,phandle: > 00 00 00 32=20 > phandle: > 00 00 00 32=20 >=20 > # ofwdump -p /soc/pinctrl@01c20800/usb1_vbus_pin@0 > Node 0x2270: usb1_vbus_pin@0 > allwinner,pins: > 50 44 32 34 00=20 > 'PD24' > allwinner,function: > 67 70 69 6f 5f 6f 75 74 00=20 > 'gpio_out' > allwinner,drive: > 00 00 00 00=20 > allwinner,pull: > 00 00 00 00=20 > linux,phandle: > 00 00 00 33=20 > phandle: > 00 00 00 33=20 >=20 > # ofwdump -p /soc/pinctrl@01c20800/usb2_vbus_pin@0 > Node 0x22f4: usb2_vbus_pin@0 > allwinner,pins: > 50 48 33 00=20 > 'PH3' > allwinner,function: > 67 70 69 6f 5f 6f 75 74 00=20 > 'gpio_out' > allwinner,drive: > 00 00 00 00=20 > allwinner,pull: > 00 00 00 00=20 > linux,phandle: > 00 00 00 34=20 > phandle: > 00 00 00 34=20 >=20 > # ofwdump -p /soc/phy@01c19400 > Node 0x32ec: phy@01c19400 > compatible: > 61 6c 6c 77 69 6e 6e 65 72 2c 73 75 6e 38 69 2d 61 38 33 74=20 > 2d 75 73 62 2d 70 68 79 00=20 > 'allwinner,sun8i-a83t-usb-phy' > reg: > 01 c1 94 00 00 00 00 2c 01 c1 a8 00 00 00 00 04 01 c1 b8 00=20 > 00 00 00 04=20 > clocks: > 00 00 00 2b 00 00 00 08 00 00 00 2b 00 00 00 09 00 00 00 2b=20 > 00 00 00 0a 00 00 00 2b 00 00 00 0b=20 > clock-names: > 75 73 62 30 5f 70 68 79 00 75 73 62 31 5f 70 68 79 00 68 73=20 > 69 63 5f 70 6c 6c 00 68 73 69 63 5f 31 32 6d 00=20 > resets: > 00 00 00 2b 00 00 00 00 00 00 00 2b 00 00 00 01 00 00 00 2b=20 > 00 00 00 02=20 > reset-names: > 75 73 62 30 5f 72 65 73 65 74 00 75 73 62 31 5f 72 65 73 65=20 > 74 00 75 73 62 32 5f 72 65 73 65 74 00=20 > status: > 6f 6b 61 79 00=20 > 'okay' > #phy-cells: > 00 00 00 01=20 > usb1_vbus-supply: > 00 00 00 2c=20 > linux,phandle: > 00 00 00 2d=20 > phandle: > 00 00 00 2d=20 >=20 > # ofwdump -p /soc/usb@01c1a000 > Node 0x3458: usb@01c1a000 > compatible: > 61 6c 6c 77 69 6e 6e 65 72 2c 73 75 6e 38 69 2d 61 38 33 74=20 > 2d 65 68 63 69 00 67 65 6e 65 72 69 63 2d 65 68 63 69 00=20 > reg: > 01 c1 a0 00 00 00 01 00=20 > interrupts: > 00 00 00 00 00 00 00 48 00 00 00 04=20 > clocks: > 00 00 00 17 00 00 00 1a=20 > resets: > 00 00 00 19 00 00 00 1a=20 > phys: > 00 00 00 2d 00 00 00 01=20 > phy-names: > 75 73 62 00=20 > 'usb' > status: > 6f 6b 61 79 00=20 > 'okay' > linux,phandle: > 00 00 00 41=20 > phandle: > 00 00 00 41=20 >=20 > # ofwdump -p /soc/usb@01c1b000 > Node 0x3550: usb@01c1b000 > compatible: > 61 6c 6c 77 69 6e 6e 65 72 2c 73 75 6e 38 69 2d 61 38 33 74=20 > 2d 65 68 63 69 00 67 65 6e 65 72 69 63 2d 65 68 63 69 00=20 > reg: > 01 c1 b0 00 00 00 01 00=20 > interrupts: > 00 00 00 00 00 00 00 4a 00 00 00 04=20 > clocks: > 00 00 00 17 00 00 00 1b=20 > resets: > 00 00 00 19 00 00 00 1b=20 > phys: > 00 00 00 2d 00 00 00 02=20 > phy-names: > 75 73 62 00=20 > 'usb' > status: > 6f 6b 61 79 00=20 > 'okay' > linux,phandle: > 00 00 00 42=20 > phandle: > 00 00 00 42=20 >=20 > # ofwdump -p /usb0-vbus > Node 0x39fc: usb0-vbus > compatible: > 72 65 67 75 6c 61 74 6f 72 2d 66 69 78 65 64 00=20 > 'regulator-fixed' > pinctrl-names: > 64 65 66 61 75 6c 74 00=20 > 'default' > pinctrl-0: > 00 00 00 32=20 > regulator-name: > 75 73 62 30 2d 76 62 75 73 00=20 > 'usb0-vbus' > regulator-min-microvolt: > 00 4c 4b 40=20 > regulator-max-microvolt: > 00 4c 4b 40=20 > enable-active-high: > gpio: > 00 00 00 1d 00 00 00 01 00 00 00 09 00 00 00 00=20 > status: > 64 69 73 61 62 6c 65 64 00=20 > 'disabled' > linux,phandle: > 00 00 00 47=20 > phandle: > 00 00 00 47=20 >=20 > # ofwdump -p /usb1-vbus > Node 0x3ae8: usb1-vbus > compatible: > 72 65 67 75 6c 61 74 6f 72 2d 66 69 78 65 64 00=20 > 'regulator-fixed' > pinctrl-names: > 64 65 66 61 75 6c 74 00=20 > 'default' > pinctrl-0: > 00 00 00 33=20 > regulator-name: > 75 73 62 31 2d 76 62 75 73 00=20 > 'usb1-vbus' > regulator-min-microvolt: > 00 4c 4b 40=20 > regulator-max-microvolt: > 00 4c 4b 40=20 > regulator-boot-on: > enable-active-high: > gpio: > 00 00 00 1d 00 00 00 03 00 00 00 18 00 00 00 00=20 > status: > 6f 6b 61 79 00=20 > 'okay' > linux,phandle: > 00 00 00 2c=20 > phandle: > 00 00 00 2c=20 >=20 > # ofwdump -p /usb2-vbus > Node 0x3bdc: usb2-vbus > compatible: > 72 65 67 75 6c 61 74 6f 72 2d 66 69 78 65 64 00=20 > 'regulator-fixed' > pinctrl-names: > 64 65 66 61 75 6c 74 00=20 > 'default' > pinctrl-0: > 00 00 00 34=20 > regulator-name: > 75 73 62 32 2d 76 62 75 73 00=20 > 'usb2-vbus' > regulator-min-microvolt: > 00 4c 4b 40=20 > regulator-max-microvolt: > 00 4c 4b 40=20 > regulator-boot-on: > enable-active-high: > gpio: > 00 00 00 1d 00 00 00 07 00 00 00 03 00 00 00 00=20 > status: > 64 69 73 61 62 6c 65 64 00=20 > 'disabled' > linux,phandle: > 00 00 00 48=20 > phandle: > 00 00 00 48=20 I might not have found all the usb references but the below is a start. /usr/src/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts has: &ehci0 { status =3D "okay"; }; &ehci1 { status =3D "okay"; }; . . . ®_usb1_vbus { gpio =3D <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */ status =3D "okay"; }; &usb1_vbus_pin_a { allwinner,pins =3D "PD24"; }; &usbphy { usb1_vbus-supply =3D <®_usb1_vbus>; status =3D "okay"; }; Via #include there is: /usr/src/sys/boot/fdt/dts/arm/sun8i-a83t.dtsi has: bus_gates: clk@01c20060 { . . . clock-output-names =3D . . . "bus_spi1", "bus_usb_otg", "bus_ehci0", "bus_ehci1", "bus_ohci0", "bus_ve", . . . }; /usr/src/sys/gnu/dts/arm/sunxi-common-regulators.dtsi has: &pio { . . . usb0_vbus_pin_a: usb0_vbus_pin@0 { pins =3D "PB9"; function =3D "gpio_out"; }; usb1_vbus_pin_a: usb1_vbus_pin@0 { pins =3D "PH6"; function =3D "gpio_out"; }; usb2_vbus_pin_a: usb2_vbus_pin@0 { pins =3D "PH3"; function =3D "gpio_out"; }; }; / { . . . reg_usb0_vbus: usb0-vbus { compatible =3D "regulator-fixed"; pinctrl-names =3D "default"; pinctrl-0 =3D <&usb0_vbus_pin_a>; regulator-name =3D "usb0-vbus"; regulator-min-microvolt =3D <5000000>; regulator-max-microvolt =3D <5000000>; enable-active-high; gpio =3D <&pio 1 9 GPIO_ACTIVE_HIGH>; status =3D "disabled"; }; reg_usb1_vbus: usb1-vbus { compatible =3D "regulator-fixed"; pinctrl-names =3D "default"; pinctrl-0 =3D <&usb1_vbus_pin_a>; regulator-name =3D "usb1-vbus"; regulator-min-microvolt =3D <5000000>; regulator-max-microvolt =3D <5000000>; regulator-boot-on; enable-active-high; gpio =3D <&pio 7 6 GPIO_ACTIVE_HIGH>; status =3D "disabled"; }; reg_usb2_vbus: usb2-vbus { compatible =3D "regulator-fixed"; pinctrl-names =3D "default"; pinctrl-0 =3D <&usb2_vbus_pin_a>; regulator-name =3D "usb2-vbus"; regulator-min-microvolt =3D <5000000>; regulator-max-microvolt =3D <5000000>; regulator-boot-on; enable-active-high; gpio =3D <&pio 7 3 GPIO_ACTIVE_HIGH>; status =3D "disabled"; }; . . . /usr/src/sys/boot/fdt/dts/arm/a83t.dtsi has: clocks { . . . usb_clk: clk@01c200cc { #clock-cells =3D <1>; #reset-cells =3D <1>; compatible =3D "allwinner,sun8i-a83t-usb-clk"; reg =3D <0x01c200cc 0x4>; clocks =3D <&osc24M>, <&pll_hsic>; clock-indices =3D <8>, <9>, <10>, <11>, <16>; clock-output-names =3D "usb_phy0", "usb_phy1", "usb_hsic_pll", = "usb_hsic_12m", "usb_ohci0"; }; . . . soc { . . . usbphy: phy@01c19400 { compatible =3D "allwinner,sun8i-a83t-usb-phy"; reg =3D <0x01c19400 0x2c>, <0x01c1a800 0x4>, <0x01c1b800 0x4>; clocks =3D <&usb_clk 8>, <&usb_clk 9>, <&usb_clk 10>, <&usb_clk 11>; clock-names =3D "usb0_phy", "usb1_phy", "hsic_pll", "hsic_12m"; resets =3D <&usb_clk 0>, <&usb_clk 1>, <&usb_clk 2>; reset-names =3D "usb0_reset", "usb1_reset", "usb2_reset"; status =3D "disabled"; #phy-cells =3D <1>; }; =20 ehci0: usb@01c1a000 { compatible =3D "allwinner,sun8i-a83t-ehci", = "generic-ehci"; reg =3D <0x01c1a000 0x100>; interrupts =3D ; clocks =3D <&bus_gates 26>; resets =3D <&ahb_reset 26>; phys =3D <&usbphy 1>; phy-names =3D "usb"; status =3D "disabled"; }; =20 ehci1: usb@01c1b000 { compatible =3D "allwinner,sun8i-a83t-ehci", = "generic-ehci"; reg =3D <0x01c1b000 0x100>; interrupts =3D ; clocks =3D <&bus_gates 27>; resets =3D <&ahb_reset 27>; phys =3D <&usbphy 2>; phy-names =3D "usb"; status =3D "disabled"; }; =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Sun Sep 17 20:07:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA294E01A55; Sun, 17 Sep 2017 20:07:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7B046C0D4; Sun, 17 Sep 2017 20:07:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8HK7KLB030299; Sun, 17 Sep 2017 20:07:20 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8HK7K4m030298; Sun, 17 Sep 2017 20:07:20 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201709172007.v8HK7K4m030298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 17 Sep 2017 20:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323687 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 323687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 20:07:22 -0000 Author: jhibbits Date: Sun Sep 17 20:07:20 2017 New Revision: 323687 URL: https://svnweb.freebsd.org/changeset/base/323687 Log: Don't use a non-zero argument for __builtin_frame_address __builtin_frame_address with a non-zero argument is unsafe and rejected by newer gcc. Since it doesn't seem to impact the stacktrace, don't bother with gymnastics to unwind to a different frame for starting. PR: kern/220118 MFC after: 2 weeks Modified: head/sys/powerpc/powerpc/stack_machdep.c Modified: head/sys/powerpc/powerpc/stack_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/stack_machdep.c Sun Sep 17 19:54:27 2017 (r323686) +++ head/sys/powerpc/powerpc/stack_machdep.c Sun Sep 17 20:07:20 2017 (r323687) @@ -110,6 +110,6 @@ stack_save(struct stack *st) { register_t frame; - frame = (register_t)__builtin_frame_address(1); + frame = (register_t)__builtin_frame_address(0); stack_capture(st, frame); } From owner-svn-src-head@freebsd.org Sun Sep 17 20:30:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80090E0307A for ; Sun, 17 Sep 2017 20:30:23 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-66.reflexion.net [208.70.210.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2ECB56CC5B for ; Sun, 17 Sep 2017 20:30:23 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 2790 invoked from network); 17 Sep 2017 20:30:22 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 17 Sep 2017 20:30:22 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Sun, 17 Sep 2017 16:30:22 -0400 (EDT) Received: (qmail 15150 invoked from network); 17 Sep 2017 20:30:21 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 17 Sep 2017 20:30:21 -0000 Received: from [192.168.1.109] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 1E343EC85D5; Sun, 17 Sep 2017 13:30:21 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r323641 - head/sys/arm/allwinner (BananapiM3 [an A83T] and USB: BPI-M3 historically had usb nodes listed in ofwdump -a) From: Mark Millard In-Reply-To: <20170917212858.58fda5174908940ff1ffcc49@bidouilliste.com> Date: Sun, 17 Sep 2017 13:30:20 -0700 Cc: Warner Losh Content-Transfer-Encoding: quoted-printable Message-Id: <8D50DB46-D6BD-4F93-9F4A-FA1E405901AA@dsl-only.net> References: <20170917212858.58fda5174908940ff1ffcc49@bidouilliste.com> To: Emmanuel Vadot , svn-src-head@freebsd.org, freebsd-arm X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 20:30:23 -0000 On 2017-Sep-17, at 12:28 PM, Emmanuel Vadot = wrote: > On Sun, 17 Sep 2017 11:50:49 -0700 > Mark Millard wrote: >=20 >>> Author: manu >>> Date: Sat Sep 16 15:58:20 2017 >>> New Revision: 323641 >>> URL:=20 >>> https://svnweb.freebsd.org/changeset/base/323641 >>>=20 >>>=20 >>> Log: >>> Allwinner usb phy: Rework resource allocation >>>=20 >>> . . . >>>=20 >>> While here remove A83T code as upstream and FreeBSD dts don't have >>> nodes for USB. >>>=20 >>> . . . >>>=20 >>> EHCI is still buggy on Pine64 (hang the board) so do not enable it = for now. >>>=20 >>> Tested On: Bananapi (A20), BananapiM2 (A31S), OrangePi One (H3) = Pine64 (A64) >>=20 >> I have a BPI-M3 (A83T based) that has not been updated >> since head -r317015M. It has the root file system on a >> USB SSD for how I normally boot it. The ubldr and >> ubldr.bin go back to 2016-Oct-24 or before (file >> system date). >>=20 >> sysutils/u-boot-sinovoip-bpi-m3/files/ has not >> been updated since then. Nor has the distinfo >> or pkg-descr files. The Makefile has had only >> one change since then: >>=20 >> Revision 430454 - (view) (download) (annotate) - [select for diffs]=20= >> Modified Tue Jan 3 11:01:05 2017 UTC (8 months, 1 week ago) by mat=20 >> File length: 1369 byte(s)=20 >> Diff to previous 419007 >> Cleanup BROKEN/IGNORE for 10.3- >>=20 >> Sponsored by: Absolight >=20 > I don't have the board so if you want to update u-boot for it please > provide a patch. Unfortunately while I can readily look around and identify things that mention "usb", "ehci", "ohci", and "phy" in ofwdump output and in *.dt* files I've no clue about u-boot, *.dt* 's, and the like --and very little clue about the kernel. It would be more of a from-scratch research project, much like finding that "dts ish" before "sev" would, for example, again allow the Pine64+ 2GB to boot from a modern non-debug kernel. That was a lot of exploration to find a single instruction to add. When I started I had no clue it would end up as something like that. [Sometimes when I explore like that someone with the proper background picks out what the core issue is and how to fix before I get as far as a likely suboptimal solution that points in a very specific direction. Other times I get there first.] So if an BPI-M3 u-boot update waits for me it is likely to be a significant wait. Someone with more background likely would work better. Hopefully I'd be able to test trial updates since I have a board. For now it looks like I'll need to set up a non-USB configuration to progress to modern head. >>=20 >> The BPI-M3 has usb nodes show in ofwdump. . . >>=20 >=20 > Yeah I miss-read the DTS because 4 of them are used for one board ... > I don't want to update the dts in sys/boot/fdt/dts/arm and I will > remove them soon. Upstream DTS don't have usb in it but it will be = easy > to add it. You could send a patch to linux-arm if you want but note > that upstream DTS now uses clkng binding (i.e. not all clocks are > under /clocks node) so it will require a driver on our side. >=20 > And please no need to send a 1km long email. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Sun Sep 17 22:18:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51589E09398; Sun, 17 Sep 2017 22:18:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2038370571; Sun, 17 Sep 2017 22:18:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8HMI1IM084650; Sun, 17 Sep 2017 22:18:01 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8HMI1qh084649; Sun, 17 Sep 2017 22:18:01 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201709172218.v8HMI1qh084649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 17 Sep 2017 22:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323689 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 323689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 22:18:02 -0000 Author: rmacklem Date: Sun Sep 17 22:18:01 2017 New Revision: 323689 URL: https://svnweb.freebsd.org/changeset/base/323689 Log: Fix bogus FREAD with NFSV4OPEN_ACCESSREAD. No functional change. The code in nfscl_doflayoutio() bogusly used FREAD instead of NFSV4OPEN_ACCESSREAD. Since both happen to be defined as "1", this worked and the patch doesn't result in a functional change. Found by inspection during development of Flex File Layout support. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Sun Sep 17 21:41:51 2017 (r323688) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Sun Sep 17 22:18:01 2017 (r323689) @@ -5674,7 +5674,7 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i np->n_flag &= ~NDSCOMMIT; mtx_unlock(&np->n_mtx); } - } else if (rwflag == FREAD) + } else if (rwflag == NFSV4OPEN_ACCESSREAD) error = nfsrpc_readds(vp, uiop, stateidp, eofp, *dspp, io_off, xfer, fhp, cred, p); else { From owner-svn-src-head@freebsd.org Sun Sep 17 22:58:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F21DE0B9DA; Sun, 17 Sep 2017 22:58:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69058718C3; Sun, 17 Sep 2017 22:58:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8HMwDLR000804; Sun, 17 Sep 2017 22:58:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8HMwD99000799; Sun, 17 Sep 2017 22:58:13 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709172258.v8HMwD99000799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 17 Sep 2017 22:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323690 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 323690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 22:58:14 -0000 Author: cem Date: Sun Sep 17 22:58:13 2017 New Revision: 323690 URL: https://svnweb.freebsd.org/changeset/base/323690 Log: MCA: Expand AMD Thresholding support to cover all banks When it was added in r314636, AMD Thresholding was hardcoded to only bank 4 (Northbridge) for some reason. However, even on family 10h the MCAx_MISC register Valid/Present bits determine whether thresholding is supported on that bank. Expand thresholding support to monitor all monitorable banks. This simplifies some of the logic and makes it more consistent with our Intel CMCI support. Reviewed by: markj (earlier version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12321 Modified: head/sys/x86/x86/local_apic.c head/sys/x86/x86/mca.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Sun Sep 17 22:18:01 2017 (r323689) +++ head/sys/x86/x86/local_apic.c Sun Sep 17 22:58:13 2017 (r323690) @@ -1426,8 +1426,9 @@ native_lapic_enable_mca_elvt(void) value = lapic_read32(LAPIC_EXT_LVT0 + APIC_ELVT_MCA); if ((value & APIC_LVT_M) == 0) { - printf("AMD MCE Thresholding Extended LVT is already active\n"); - return (-1); + if (bootverbose) + printf("AMD MCE Thresholding Extended LVT is already active\n"); + return (APIC_ELVT_MCA); } lapics[apic_id].la_elvts[APIC_ELVT_MCA].lvt_masked = 0; lapics[apic_id].la_elvts[APIC_ELVT_MCA].lvt_active = 1; Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Sun Sep 17 22:18:01 2017 (r323689) +++ head/sys/x86/x86/mca.c Sun Sep 17 22:58:13 2017 (r323690) @@ -124,7 +124,7 @@ static struct mtx mca_lock; #ifdef DEV_APIC static struct cmc_state **cmc_state; /* Indexed by cpuid, bank. */ -static struct amd_et_state *amd_et_state; /* Indexed by cpuid. */ +static struct amd_et_state **amd_et_state; /* Indexed by cpuid, bank. */ static int cmc_throttle = 60; /* Time in seconds to throttle CMCI. */ static int amd_elvt = -1; @@ -645,9 +645,7 @@ amd_thresholding_update(enum scan_mode mode, int bank, int new_threshold; int count; - KASSERT(bank == MC_AMDNB_BANK, - ("%s: unexpected bank %d", __func__, bank)); - cc = &amd_et_state[PCPU_GET(cpuid)]; + cc = &amd_et_state[PCPU_GET(cpuid)][bank]; misc = rdmsr(MSR_MC_MISC(bank)); count = (misc & MC_MISC_AMD_CNT_MASK) >> MC_MISC_AMD_CNT_SHIFT; count = count - (MC_MISC_AMD_CNT_MAX - cc->cur_threshold); @@ -841,9 +839,13 @@ cmci_setup(void) static void amd_thresholding_setup(void) { + int i; - amd_et_state = malloc((mp_maxid + 1) * sizeof(struct amd_et_state), - M_MCA, M_WAITOK | M_ZERO); + amd_et_state = malloc((mp_maxid + 1) * sizeof(struct amd_et_state *), + M_MCA, M_WAITOK); + for (i = 0; i <= mp_maxid; i++) + amd_et_state[i] = malloc(sizeof(struct amd_et_state) * + mca_banks, M_MCA, M_WAITOK | M_ZERO); SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, "cmc_throttle", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &cmc_throttle, 0, sysctl_positive_int, "I", @@ -964,44 +966,59 @@ cmci_resume(int i) wrmsr(MSR_MC_CTL2(i), ctl); } +/* + * Apply an AMD ET configuration to the corresponding MSR. + */ static void -amd_thresholding_start(struct amd_et_state *cc) +amd_thresholding_start(struct amd_et_state *cc, int bank) { uint64_t misc; KASSERT(amd_elvt >= 0, ("ELVT offset is not set")); - misc = rdmsr(MSR_MC_MISC(MC_AMDNB_BANK)); + + misc = rdmsr(MSR_MC_MISC(bank)); + misc &= ~MC_MISC_AMD_INT_MASK; misc |= MC_MISC_AMD_INT_LVT; + misc &= ~MC_MISC_AMD_LVT_MASK; misc |= (uint64_t)amd_elvt << MC_MISC_AMD_LVT_SHIFT; + misc &= ~MC_MISC_AMD_CNT_MASK; misc |= (uint64_t)(MC_MISC_AMD_CNT_MAX - cc->cur_threshold) << MC_MISC_AMD_CNT_SHIFT; + misc &= ~MC_MISC_AMD_OVERFLOW; misc |= MC_MISC_AMD_CNTEN; - wrmsr(MSR_MC_MISC(MC_AMDNB_BANK), misc); + wrmsr(MSR_MC_MISC(bank), misc); } static void -amd_thresholding_init(void) +amd_thresholding_monitor(int i) { struct amd_et_state *cc; uint64_t misc; + /* + * Kludge: On 10h, banks after 4 are not thresholding but also may have + * bogus Valid bits. Skip them. This is definitely fixed in 15h, but + * I have not investigated whether it is fixed in earlier models. + */ + if (CPUID_TO_FAMILY(cpu_id) < 0x15 && i >= 5) + return; + /* The counter must be valid and present. */ - misc = rdmsr(MSR_MC_MISC(MC_AMDNB_BANK)); + misc = rdmsr(MSR_MC_MISC(i)); if ((misc & (MC_MISC_AMD_VAL | MC_MISC_AMD_CNTP)) != - (MC_MISC_AMD_VAL | MC_MISC_AMD_CNTP)) { - printf("%s: 0x%jx: !valid | !present\n", __func__, - (uintmax_t)misc); + (MC_MISC_AMD_VAL | MC_MISC_AMD_CNTP)) return; - } /* The register should not be locked. */ if ((misc & MC_MISC_AMD_LOCK) != 0) { - printf("%s: 0x%jx: locked\n", __func__, (uintmax_t)misc); + if (bootverbose) + printf("%s: 0x%jx: Bank %d: locked\n", __func__, + (uintmax_t)misc, i); return; } @@ -1010,8 +1027,9 @@ amd_thresholding_init(void) * has already claimed it. */ if ((misc & MC_MISC_AMD_CNTEN) != 0) { - printf("%s: 0x%jx: count already enabled\n", __func__, - (uintmax_t)misc); + if (bootverbose) + printf("%s: 0x%jx: Bank %d: already enabled\n", + __func__, (uintmax_t)misc, i); return; } @@ -1022,35 +1040,39 @@ amd_thresholding_init(void) */ amd_elvt = lapic_enable_mca_elvt(); if (amd_elvt < 0) { - printf("%s: lapic enable mca elvt failed: %d\n", __func__, amd_elvt); + printf("%s: Bank %d: lapic enable mca elvt failed: %d\n", + __func__, i, amd_elvt); return; } /* Re-use Intel CMC support infrastructure. */ if (bootverbose) - printf("%s: Starting AMD thresholding\n", __func__); + printf("%s: Starting AMD thresholding on bank %d\n", __func__, + i); - cc = &amd_et_state[PCPU_GET(cpuid)]; + cc = &amd_et_state[PCPU_GET(cpuid)][i]; cc->cur_threshold = 1; - amd_thresholding_start(cc); + amd_thresholding_start(cc, i); - /* Mark the NB bank as monitored. */ - PCPU_SET(cmci_mask, PCPU_GET(cmci_mask) | 1 << MC_AMDNB_BANK); + /* Mark this bank as monitored. */ + PCPU_SET(cmci_mask, PCPU_GET(cmci_mask) | 1 << i); } static void -amd_thresholding_resume(void) +amd_thresholding_resume(int i) { struct amd_et_state *cc; - /* Nothing to do if this CPU doesn't monitor the NB bank. */ - if ((PCPU_GET(cmci_mask) & 1 << MC_AMDNB_BANK) == 0) + KASSERT(i < mca_banks, ("CPU %d has more MC banks", PCPU_GET(cpuid))); + + /* Ignore banks not monitored by this CPU. */ + if (!(PCPU_GET(cmci_mask) & 1 << i)) return; - cc = &amd_et_state[PCPU_GET(cpuid)]; + cc = &amd_et_state[PCPU_GET(cpuid)][i]; cc->last_intr = 0; cc->cur_threshold = 1; - amd_thresholding_start(cc); + amd_thresholding_start(cc, i); } #endif @@ -1063,8 +1085,10 @@ _mca_init(int boot) { uint64_t mcg_cap; uint64_t ctl, mask; - int i, skip; + int i, skip, family; + family = CPUID_TO_FAMILY(cpu_id); + /* MCE is required. */ if (!mca_enabled || !(cpu_feature & CPUID_MCE)) return; @@ -1087,8 +1111,8 @@ _mca_init(int boot) * is no performance penalty to this workaround. However, * L1TP errors will go unreported. */ - if (cpu_vendor_id == CPU_VENDOR_AMD && - CPUID_TO_FAMILY(cpu_id) == 0x10 && !amd10h_L1TP) { + if (cpu_vendor_id == CPU_VENDOR_AMD && family == 0x10 && + !amd10h_L1TP) { mask = rdmsr(MSR_MC0_CTL_MASK); if ((mask & (1UL << 5)) == 0) wrmsr(MSR_MC0_CTL_MASK, mask | (1UL << 5)); @@ -1103,12 +1127,12 @@ _mca_init(int boot) * For P6 models before Nehalem MC0_CTL is * always enabled and reserved. */ - if (i == 0 && CPUID_TO_FAMILY(cpu_id) == 0x6 + if (i == 0 && family == 0x6 && CPUID_TO_MODEL(cpu_id) < 0x1a) skip = 1; } else if (cpu_vendor_id == CPU_VENDOR_AMD) { /* BKDG for Family 10h: unset GartTblWkEn. */ - if (i == 4 && CPUID_TO_FAMILY(cpu_id) >= 0xf) + if (i == MC_AMDNB_BANK && family >= 0xf) ctl &= ~(1UL << 10); } @@ -1121,6 +1145,11 @@ _mca_init(int boot) cmci_monitor(i); else cmci_resume(i); + } else if (amd_thresholding_supported()) { + if (boot) + amd_thresholding_monitor(i); + else + amd_thresholding_resume(i); } #endif @@ -1129,26 +1158,9 @@ _mca_init(int boot) } #ifdef DEV_APIC - /* - * AMD Processors from families 10h - 16h provide support - * for Machine Check Error Thresholding. - * The processors support counters of MC errors and they - * can be configured to generate an interrupt when a counter - * overflows. - * The counters are all associated with Bank 4 and each - * of them covers a group of errors reported via that bank. - * At the moment only the DRAM Error Threshold Group is - * supported. - */ - if (amd_thresholding_supported() && - (mcg_cap & MCG_CAP_COUNT) >= 4) { - if (boot) - amd_thresholding_init(); - else - amd_thresholding_resume(); - } else if (PCPU_GET(cmci_mask) != 0 && boot) { + if (!amd_thresholding_supported() && + PCPU_GET(cmci_mask) != 0 && boot) lapic_enable_cmc(); - } #endif } From owner-svn-src-head@freebsd.org Sun Sep 17 22:58:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1C23E0B9DF; Sun, 17 Sep 2017 22:58:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EDC2718C4; Sun, 17 Sep 2017 22:58:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8HMwDBh000816; Sun, 17 Sep 2017 22:58:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8HMwDgn000805; Sun, 17 Sep 2017 22:58:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201709172258.v8HMwDgn000805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 17 Sep 2017 22:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323691 - in head/sys: dev/iicbus modules/i2c modules/i2c/icee X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: dev/iicbus modules/i2c modules/i2c/icee X-SVN-Commit-Revision: 323691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 22:58:14 -0000 Author: ian Date: Sun Sep 17 22:58:13 2017 New Revision: 323691 URL: https://svnweb.freebsd.org/changeset/base/323691 Log: Give icee(4) a detach() method so it can be used as a module. Add a module makefile for it. Added: head/sys/modules/i2c/icee/ head/sys/modules/i2c/icee/Makefile (contents, props changed) Modified: head/sys/dev/iicbus/icee.c head/sys/modules/i2c/Makefile Modified: head/sys/dev/iicbus/icee.c ============================================================================== --- head/sys/dev/iicbus/icee.c Sun Sep 17 22:58:13 2017 (r323690) +++ head/sys/dev/iicbus/icee.c Sun Sep 17 22:58:13 2017 (r323691) @@ -206,17 +206,34 @@ icee_attach(device_t dev) return (0); } +static int +icee_detach(device_t dev) +{ + struct icee_softc *sc = device_get_softc(dev); + + destroy_dev(sc->cdev); + return (0); +} + static int icee_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { + struct icee_softc *sc; + sc = CDEV2SOFTC(dev); + if (device_get_state(sc->dev) < DS_BUSY) + device_busy(sc->dev); + return (0); } static int icee_close(struct cdev *dev, int fflag, int devtype, struct thread *td) { + struct icee_softc *sc; + sc = CDEV2SOFTC(dev); + device_unbusy(sc->dev); return (0); } @@ -345,6 +362,7 @@ icee_write(struct cdev *dev, struct uio *uio, int iofl static device_method_t icee_methods[] = { DEVMETHOD(device_probe, icee_probe), DEVMETHOD(device_attach, icee_attach), + DEVMETHOD(device_detach, icee_detach), DEVMETHOD_END }; Modified: head/sys/modules/i2c/Makefile ============================================================================== --- head/sys/modules/i2c/Makefile Sun Sep 17 22:58:13 2017 (r323690) +++ head/sys/modules/i2c/Makefile Sun Sep 17 22:58:13 2017 (r323691) @@ -6,6 +6,7 @@ SUBDIR = \ ds1307 \ ds13rtc \ ds3231 \ + icee \ if_ic \ iic \ iicbb \ Added: head/sys/modules/i2c/icee/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/i2c/icee/Makefile Sun Sep 17 22:58:13 2017 (r323691) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/iicbus +KMOD= icee +SRCS= icee.c + +SRCS+= \ + bus_if.h \ + device_if.h \ + iicbus_if.h \ + ofw_bus_if.h \ + opt_platform.h \ + +.include From owner-svn-src-head@freebsd.org Sun Sep 17 23:40:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B0B1E0DEB8; Sun, 17 Sep 2017 23:40:17 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66ADE72C15; Sun, 17 Sep 2017 23:40:17 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8HNeGwp017000; Sun, 17 Sep 2017 23:40:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8HNeGuP016998; Sun, 17 Sep 2017 23:40:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709172340.v8HNeGuP016998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 17 Sep 2017 23:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323692 - in head/sys/compat: linsysfs linux X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/compat: linsysfs linux X-SVN-Commit-Revision: 323692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Sep 2017 23:40:17 -0000 Author: cem Date: Sun Sep 17 23:40:16 2017 New Revision: 323692 URL: https://svnweb.freebsd.org/changeset/base/323692 Log: linsysfs(5): Add support for recent libdrm Expose more information about PCI devices (and GPUs in particular) via linsysfs to libdrm. This allows unmodified modern 64-bit Linux libdrm to work, which allows modern Linux Mesa to work. The submitter reports that he tested the change with an Ubuntu 16.04 chroot + amdgpu from graphics/drm-next-kmod. PR: 222375 Submitted by: Greg V Modified: head/sys/compat/linsysfs/linsysfs.c head/sys/compat/linux/linux_util.c Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Sun Sep 17 22:58:13 2017 (r323691) +++ head/sys/compat/linsysfs/linsysfs.c Sun Sep 17 23:40:16 2017 (r323692) @@ -133,20 +133,135 @@ linsysfs_link_scsi_host(PFS_FILL_ARGS) return (0); } +static int +linsysfs_fill_data(PFS_FILL_ARGS) +{ + sbuf_printf(sb, "%s", pn->pn_data); + return (0); +} + +static int +linsysfs_fill_vendor(PFS_FILL_ARGS) +{ + sbuf_printf(sb, "0x%04x\n", pci_get_vendor((device_t)pn->pn_data)); + return (0); +} + +static int +linsysfs_fill_device(PFS_FILL_ARGS) +{ + sbuf_printf(sb, "0x%04x\n", pci_get_device((device_t)pn->pn_data)); + return (0); +} + +static int +linsysfs_fill_subvendor(PFS_FILL_ARGS) +{ + sbuf_printf(sb, "0x%04x\n", pci_get_subvendor((device_t)pn->pn_data)); + return (0); +} + +static int +linsysfs_fill_subdevice(PFS_FILL_ARGS) +{ + sbuf_printf(sb, "0x%04x\n", pci_get_subdevice((device_t)pn->pn_data)); + return (0); +} + +static int +linsysfs_fill_revid(PFS_FILL_ARGS) +{ + sbuf_printf(sb, "0x%x\n", pci_get_revid((device_t)pn->pn_data)); + return (0); +} + +/* + * Filler function for PCI uevent file + */ +static int +linsysfs_fill_uevent_pci(PFS_FILL_ARGS) +{ + device_t dev; + + dev = (device_t)pn->pn_data; + sbuf_printf(sb, "DRIVER=%s\nPCI_CLASS=%X\nPCI_ID=%04X:%04X\n" + "PCI_SUBSYS_ID=%04X:%04X\nPCI_SLOT_NAME=%04d:%02x:%02x.%x\n", + linux_driver_get_name_dev(dev), pci_get_class(dev), + pci_get_vendor(dev), pci_get_device(dev), pci_get_subvendor(dev), + pci_get_subdevice(dev), pci_get_domain(dev), pci_get_bus(dev), + pci_get_slot(dev), pci_get_function(dev)); + return (0); +} + +/* + * Filler function for drm uevent file + */ +static int +linsysfs_fill_uevent_drm(PFS_FILL_ARGS) +{ + device_t dev; + int unit; + + dev = (device_t)pn->pn_data; + unit = device_get_unit(dev); + sbuf_printf(sb, + "MAJOR=226\nMINOR=%d\nDEVNAME=drm/%d\nDEVTYPE=dri_minor\n", unit, + unit); + return (0); +} + +static char * +get_full_pfs_path(struct pfs_node *cur) +{ + char *temp, *path; + + temp = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); + path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); + path[0] = '\0'; + + do { + snprintf(temp, MAXPATHLEN, "%s/%s", cur->pn_name, path); + strlcpy(path, temp, MAXPATHLEN); + cur = cur->pn_parent; + } while (cur->pn_parent != NULL); + + path[strlen(path) - 1] = '\0'; /* remove extra slash */ + free(temp, M_TEMP); + return (path); +} + +/* + * Filler function for symlink from drm char device to PCI device + */ +static int +linsysfs_fill_vgapci(PFS_FILL_ARGS) +{ + char *path; + + path = get_full_pfs_path((struct pfs_node*)pn->pn_data); + sbuf_printf(sb, "../../../%s", path); + free(path, M_TEMP); + return (0); +} + #define PCI_DEV "pci" +#define DRMN_DEV "drmn" static int -linsysfs_run_bus(device_t dev, struct pfs_node *dir, struct pfs_node *scsi, char *path, - char *prefix) +linsysfs_run_bus(device_t dev, struct pfs_node *dir, struct pfs_node *scsi, struct pfs_node *chardev, + char *path, char *prefix) { struct scsi_host_queue *scsi_host; - struct pfs_node *sub_dir; + struct pfs_node *sub_dir, *cur_file, *cur_chardev; int i, nchildren; device_t *children, parent; devclass_t devclass; const char *name = NULL; struct pci_devinfo *dinfo; - char *device, *host, *new_path = path; + char *device, *host, *new_path, *chardevname; + new_path = path; + chardevname = malloc(16, M_TEMP, M_WAITOK); + parent = device_get_parent(dev); if (parent) { devclass = device_get_devclass(parent); @@ -171,6 +286,36 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s strcat(new_path, device); dir = pfs_create_dir(dir, device, NULL, NULL, NULL, 0); + cur_file = pfs_create_file(dir, "vendor", + &linsysfs_fill_vendor, NULL, NULL, NULL, + PFS_RD); + cur_file->pn_data = (void*)dev; + cur_file = pfs_create_file(dir, "device", + &linsysfs_fill_device, NULL, NULL, NULL, + PFS_RD); + cur_file->pn_data = (void*)dev; + cur_file = pfs_create_file(dir, + "subsystem_vendor", + &linsysfs_fill_subvendor, NULL, NULL, NULL, + PFS_RD); + cur_file->pn_data = (void*)dev; + cur_file = pfs_create_file(dir, + "subsystem_device", + &linsysfs_fill_subdevice, NULL, NULL, NULL, + PFS_RD); + cur_file->pn_data = (void*)dev; + cur_file = pfs_create_file(dir, "revision", + &linsysfs_fill_revid, NULL, NULL, NULL, + PFS_RD); + cur_file->pn_data = (void*)dev; + cur_file = pfs_create_file(dir, "uevent", + &linsysfs_fill_uevent_pci, NULL, NULL, + NULL, PFS_RD); + cur_file->pn_data = (void*)dev; + cur_file = pfs_create_link(dir, "subsystem", + &linsysfs_fill_data, NULL, NULL, NULL, 0); + /* libdrm just checks that the link ends in "/pci" */ + cur_file->pn_data = "/sys/bus/pci"; if (dinfo->cfg.baseclass == PCIC_STORAGE) { /* DJA only make this if needed */ @@ -207,15 +352,38 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s free(host, M_TEMP); } } + + dinfo = device_get_ivars(parent); + if (dinfo != NULL && dinfo->cfg.baseclass == PCIC_DISPLAY) { + devclass = device_get_devclass(dev); + if (devclass != NULL) + name = devclass_get_name(devclass); + if (name != NULL && strcmp(name, DRMN_DEV) == 0 && + device_get_unit(dev) >= 0) { + sprintf(chardevname, "226:%d", + device_get_unit(dev)); + cur_chardev = pfs_create_dir(chardev, + chardevname, NULL, NULL, NULL, 0); + cur_file = pfs_create_link(cur_chardev, + "device", &linsysfs_fill_vgapci, NULL, + NULL, NULL, PFS_RD); + cur_file->pn_data = (void*)dir; + cur_file = pfs_create_file(cur_chardev, + "uevent", &linsysfs_fill_uevent_drm, NULL, + NULL, NULL, PFS_RD); + cur_file->pn_data = (void*)dev; + } + } } device_get_children(dev, &children, &nchildren); for (i = 0; i < nchildren; i++) { if (children[i]) - linsysfs_run_bus(children[i], dir, scsi, new_path, prefix); + linsysfs_run_bus(children[i], dir, scsi, chardev, new_path, prefix); } if (new_path != path) free(new_path, M_TEMP); + free(chardevname, M_TEMP); return (1); } @@ -279,6 +447,7 @@ linsysfs_init(PFS_INIT_ARGS) struct pfs_node *dir, *sys, *cpu; struct pfs_node *pci; struct pfs_node *scsi; + struct pfs_node *devdir, *chardev; devclass_t devclass; device_t dev; @@ -296,13 +465,17 @@ linsysfs_init(PFS_INIT_ARGS) /* /sys/devices/pci0000:00 */ pci = pfs_create_dir(dir, "pci0000:00", NULL, NULL, NULL, 0); + /* /sys/dev/char */ + devdir = pfs_create_dir(root, "dev", NULL, NULL, NULL, 0); + chardev = pfs_create_dir(devdir, "char", NULL, NULL, NULL, 0); + devclass = devclass_find("root"); if (devclass == NULL) { return (0); } dev = devclass_get_device(devclass, 0); - linsysfs_run_bus(dev, pci, scsi, "/pci0000:00", "0000"); + linsysfs_run_bus(dev, pci, scsi, chardev, "/pci0000:00", "0000"); /* /sys/devices/system */ sys = pfs_create_dir(dir, "system", NULL, NULL, NULL, 0); Modified: head/sys/compat/linux/linux_util.c ============================================================================== --- head/sys/compat/linux/linux_util.c Sun Sep 17 22:58:13 2017 (r323691) +++ head/sys/compat/linux/linux_util.c Sun Sep 17 23:40:16 2017 (r323692) @@ -127,14 +127,13 @@ int linux_driver_get_major_minor(const char *node, int *major, int *minor) { struct device_element *de; + unsigned long devno; if (node == NULL || major == NULL || minor == NULL) return 1; if (strlen(node) > strlen("pts/") && strncmp(node, "pts/", strlen("pts/")) == 0) { - unsigned long devno; - /* * Linux checks major and minors of the slave device * to make sure it's a pty device, so let's make him @@ -146,6 +145,15 @@ linux_driver_get_major_minor(const char *node, int *ma return (0); } + + if ((strlen(node) > strlen("drm/") && + strncmp(node, "drm/", strlen("drm/")) == 0) ) { + devno = strtoul(node + strlen("drm/"), NULL, 10); + *major = 226 + (devno / 256); + *minor = devno % 256; + return (0); + } + TAILQ_FOREACH(de, &devices, list) { if (strcmp(node, de->entry.bsd_device_name) == 0) { From owner-svn-src-head@freebsd.org Mon Sep 18 10:40:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60708E07026; Mon, 18 Sep 2017 10:40:48 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::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 2CB833E9E; Mon, 18 Sep 2017 10:40:48 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (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 DBA8026034B; Mon, 18 Sep 2017 12:40:44 +0200 (CEST) Subject: Re: svn commit: r323692 - in head/sys/compat: linsysfs linux To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201709172340.v8HNeGuP016998@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Mon, 18 Sep 2017 12:38:16 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201709172340.v8HNeGuP016998@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 10:40:48 -0000 On 09/18/17 01:40, Conrad Meyer wrote: > + sprintf(chardevname, "226:%d", > + device_get_unit(dev)); Hi, Try to use snprintf(). Define the chardevname size as a macro, or just allocate it on the stack if it is < 32 bytes. --HPS From owner-svn-src-head@freebsd.org Mon Sep 18 13:17:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A86FE0F82F; Mon, 18 Sep 2017 13:17:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5D8167E9B; Mon, 18 Sep 2017 13:17:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8IDHNNk052411; Mon, 18 Sep 2017 13:17:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8IDHNiT052409; Mon, 18 Sep 2017 13:17:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201709181317.v8IDHNiT052409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 Sep 2017 13:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323703 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 323703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 13:17:25 -0000 Author: hselasky Date: Mon Sep 18 13:17:23 2017 New Revision: 323703 URL: https://svnweb.freebsd.org/changeset/base/323703 Log: Add support for shared memory functions to the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h head/sys/compat/linuxkpi/common/src/linux_page.c Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/fs.h Mon Sep 18 08:46:07 2017 (r323702) +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Mon Sep 18 13:17:23 2017 (r323703) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -287,5 +287,26 @@ noop_llseek(struct linux_file *file, loff_t offset, in return (file->_file->f_offset); } + +/* Shared memory support */ +unsigned long linux_invalidate_mapping_pages(vm_object_t, pgoff_t, pgoff_t); +struct page *linux_shmem_read_mapping_page_gfp(vm_object_t, int, gfp_t); +struct linux_file *linux_shmem_file_setup(const char *, loff_t, unsigned long); +void linux_shmem_truncate_range(vm_object_t, loff_t, loff_t); + +#define invalidate_mapping_pages(...) \ + linux_invalidate_mapping_pages(__VA_ARGS__) + +#define shmem_read_mapping_page(...) \ + linux_shmem_read_mapping_page_gfp(__VA_ARGS__, 0) + +#define shmem_read_mapping_page_gfp(...) \ + linux_shmem_read_mapping_page_gfp(__VA_ARGS__) + +#define shmem_file_setup(...) \ + linux_shmem_file_setup(__VA_ARGS__) + +#define shmem_truncate_range(...) \ + linux_shmem_truncate_range(__VA_ARGS__) #endif /* _LINUX_FS_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Mon Sep 18 08:46:07 2017 (r323702) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Mon Sep 18 13:17:23 2017 (r323703) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #if defined(__amd64__) || defined(__aarch64__) || defined(__riscv) #define LINUXKPI_HAVE_DMAP @@ -288,4 +289,108 @@ int is_vmalloc_addr(const void *addr) { return (vtoslab((vm_offset_t)addr & ~UMA_SLAB_MASK) != NULL); +} + +struct page * +linux_shmem_read_mapping_page_gfp(vm_object_t obj, int pindex, gfp_t gfp) +{ + vm_page_t page; + int rv; + + if ((gfp & GFP_NOWAIT) != 0) + panic("GFP_NOWAIT is unimplemented"); + + VM_OBJECT_WLOCK(obj); + page = vm_page_grab(obj, pindex, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | + VM_ALLOC_WIRED); + if (page->valid != VM_PAGE_BITS_ALL) { + vm_page_xbusy(page); + if (vm_pager_has_page(obj, pindex, NULL, NULL)) { + rv = vm_pager_get_pages(obj, &page, 1, NULL, NULL); + if (rv != VM_PAGER_OK) { + vm_page_lock(page); + vm_page_unwire(page, PQ_NONE); + vm_page_free(page); + vm_page_unlock(page); + VM_OBJECT_WUNLOCK(obj); + return (ERR_PTR(-EINVAL)); + } + MPASS(page->valid == VM_PAGE_BITS_ALL); + } else { + pmap_zero_page(page); + page->valid = VM_PAGE_BITS_ALL; + page->dirty = 0; + } + vm_page_xunbusy(page); + } + vm_page_lock(page); + vm_page_hold(page); + vm_page_unlock(page); + VM_OBJECT_WUNLOCK(obj); + return (page); +} + +struct linux_file * +linux_shmem_file_setup(const char *name, loff_t size, unsigned long flags) +{ + struct fileobj { + struct linux_file file __aligned(sizeof(void *)); + struct vnode vnode __aligned(sizeof(void *)); + }; + struct fileobj *fileobj; + struct linux_file *filp; + struct vnode *vp; + int error; + + fileobj = kzalloc(sizeof(*fileobj), GFP_KERNEL); + if (fileobj == NULL) { + error = -ENOMEM; + goto err_0; + } + filp = &fileobj->file; + vp = &fileobj->vnode; + + filp->f_count = 1; + filp->f_vnode = vp; + filp->f_shmem = vm_pager_allocate(OBJT_DEFAULT, NULL, size, + VM_PROT_READ | VM_PROT_WRITE, 0, curthread->td_ucred); + if (filp->f_shmem == NULL) { + error = -ENOMEM; + goto err_1; + } + return (filp); +err_1: + kfree(filp); +err_0: + return (ERR_PTR(error)); +} + +static vm_ooffset_t +linux_invalidate_mapping_pages_sub(vm_object_t obj, vm_pindex_t start, + vm_pindex_t end, int flags) +{ + int start_count, end_count; + + VM_OBJECT_WLOCK(obj); + start_count = obj->resident_page_count; + vm_object_page_remove(obj, start, end, flags); + end_count = obj->resident_page_count; + VM_OBJECT_WUNLOCK(obj); + return (start_count - end_count); +} + +unsigned long +linux_invalidate_mapping_pages(vm_object_t obj, pgoff_t start, pgoff_t end) +{ + + return (linux_invalidate_mapping_pages_sub(obj, start, end, OBJPR_CLEANONLY)); +} + +void +linux_shmem_truncate_range(vm_object_t obj, loff_t lstart, loff_t lend) +{ + vm_pindex_t start = OFF_TO_IDX(lstart + PAGE_SIZE - 1); + vm_pindex_t end = OFF_TO_IDX(lend + 1); + + (void) linux_invalidate_mapping_pages_sub(obj, start, end, 0); } From owner-svn-src-head@freebsd.org Mon Sep 18 13:24:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E95FE10095; Mon, 18 Sep 2017 13:24:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEE9A68610; Mon, 18 Sep 2017 13:24:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8IDO0cU056221; Mon, 18 Sep 2017 13:24:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8IDNxB6056215; Mon, 18 Sep 2017 13:23:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201709181323.v8IDNxB6056215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 Sep 2017 13:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323704 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 323704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 13:24:01 -0000 Author: hselasky Date: Mon Sep 18 13:23:59 2017 New Revision: 323704 URL: https://svnweb.freebsd.org/changeset/base/323704 Log: Only wire pages in the LinuxKPI instead of holding and wiring them. This prevents the page daemon from regularly scanning the held pages. Suggested by: kib @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h head/sys/compat/linuxkpi/common/src/linux_page.c Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm.h Mon Sep 18 13:17:23 2017 (r323703) +++ head/sys/compat/linuxkpi/common/include/linux/mm.h Mon Sep 18 13:23:59 2017 (r323704) @@ -220,7 +220,6 @@ static inline void get_page(struct vm_page *page) { vm_page_lock(page); - vm_page_hold(page); vm_page_wire(page); vm_page_unlock(page); } @@ -245,7 +244,6 @@ put_page(struct vm_page *page) { vm_page_lock(page); vm_page_unwire(page, PQ_ACTIVE); - vm_page_unhold(page); vm_page_unlock(page); } Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Mon Sep 18 13:17:23 2017 (r323703) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Mon Sep 18 13:23:59 2017 (r323704) @@ -209,6 +209,7 @@ linux_get_user_pages_internal(vm_map_t map, unsigned l vm_page_lock(pg); vm_page_wire(pg); + vm_page_unhold(pg); vm_page_unlock(pg); } return (nr_pages); @@ -243,6 +244,7 @@ __get_user_pages_fast(unsigned long start, int nr_page vm_page_lock(*mp); vm_page_wire(*mp); + vm_page_unhold(*mp); vm_page_unlock(*mp); if ((prot & VM_PROT_WRITE) != 0 && @@ -323,9 +325,6 @@ linux_shmem_read_mapping_page_gfp(vm_object_t obj, int } vm_page_xunbusy(page); } - vm_page_lock(page); - vm_page_hold(page); - vm_page_unlock(page); VM_OBJECT_WUNLOCK(obj); return (page); } From owner-svn-src-head@freebsd.org Mon Sep 18 13:37:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29FE3E10C8B; Mon, 18 Sep 2017 13:37:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05E1369177; Mon, 18 Sep 2017 13:37:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8IDbFEv060250; Mon, 18 Sep 2017 13:37:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8IDbEPD060245; Mon, 18 Sep 2017 13:37:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201709181337.v8IDbEPD060245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 Sep 2017 13:37:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323705 - in head/sys/compat/linuxkpi/common: include/asm include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/asm include/linux src X-SVN-Commit-Revision: 323705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 13:37:16 -0000 Author: hselasky Date: Mon Sep 18 13:37:14 2017 New Revision: 323705 URL: https://svnweb.freebsd.org/changeset/base/323705 Log: The LinuxKPI atomics do not have acquire nor release semantics unless specified. Fix code to use READ_ONCE() and WRITE_ONCE() where appropriate. Suggested by: kib @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h head/sys/compat/linuxkpi/common/include/asm/atomic.h head/sys/compat/linuxkpi/common/include/asm/atomic64.h head/sys/compat/linuxkpi/common/include/linux/bitops.h head/sys/compat/linuxkpi/common/src/linux_tasklet.c Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon Sep 18 13:23:59 2017 (r323704) +++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon Sep 18 13:37:14 2017 (r323705) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,7 +31,7 @@ #ifndef _ATOMIC_LONG_H_ #define _ATOMIC_LONG_H_ -#include +#include #include #include @@ -54,13 +54,13 @@ atomic_long_add_return(long i, atomic_long_t *v) static inline void atomic_long_set(atomic_long_t *v, long i) { - atomic_store_rel_long(&v->counter, i); + WRITE_ONCE(v->counter, i); } static inline long atomic_long_read(atomic_long_t *v) { - return atomic_load_acq_long(&v->counter); + return READ_ONCE(v->counter); } static inline long Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Mon Sep 18 13:23:59 2017 (r323704) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Mon Sep 18 13:37:14 2017 (r323705) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,9 +32,8 @@ #ifndef _ASM_ATOMIC_H_ #define _ASM_ATOMIC_H_ -#include +#include #include - #include #define ATOMIC_INIT(x) { .counter = (x) } @@ -73,7 +72,7 @@ atomic_sub_return(int i, atomic_t *v) static inline void atomic_set(atomic_t *v, int i) { - atomic_store_rel_int(&v->counter, i); + WRITE_ONCE(v->counter, i); } static inline void @@ -91,7 +90,7 @@ atomic_set_mask(unsigned int mask, atomic_t *v) static inline int atomic_read(const atomic_t *v) { - return atomic_load_acq_int(&__DECONST(atomic_t *, v)->counter); + return READ_ONCE(v->counter); } static inline int @@ -137,7 +136,7 @@ atomic_xchg(atomic_t *v, int i) #else int ret; for (;;) { - ret = atomic_load_acq_int(&v->counter); + ret = READ_ONCE(v->counter); if (atomic_cmpset_int(&v->counter, ret, i)) break; } @@ -153,7 +152,7 @@ atomic_cmpxchg(atomic_t *v, int old, int new) for (;;) { if (atomic_cmpset_int(&v->counter, old, new)) break; - ret = atomic_load_acq_int(&v->counter); + ret = READ_ONCE(v->counter); if (ret != old) break; } Modified: head/sys/compat/linuxkpi/common/include/asm/atomic64.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic64.h Mon Sep 18 13:23:59 2017 (r323704) +++ head/sys/compat/linuxkpi/common/include/asm/atomic64.h Mon Sep 18 13:37:14 2017 (r323705) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Mellanox Technologies, Ltd. + * Copyright (c) 2016-2017 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ #ifndef _ASM_ATOMIC64_H_ #define _ASM_ATOMIC64_H_ -#include +#include #include #include @@ -74,7 +74,7 @@ atomic64_set(atomic64_t *v, int64_t i) static inline int64_t atomic64_read(atomic64_t *v) { - return atomic_load_acq_64(&v->counter); + return READ_ONCE(v->counter); } static inline int64_t @@ -114,7 +114,7 @@ atomic64_xchg(atomic64_t *v, int64_t i) #else int64_t ret; for (;;) { - ret = atomic_load_acq_64(&v->counter); + ret = READ_ONCE(v->counter); if (atomic_cmpset_64(&v->counter, ret, i)) break; } @@ -130,7 +130,7 @@ atomic64_cmpxchg(atomic64_t *v, int64_t old, int64_t n for (;;) { if (atomic_cmpset_64(&v->counter, old, new)) break; - ret = atomic_load_acq_64(&v->counter); + ret = READ_ONCE(v->counter); if (ret != old) break; } Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Mon Sep 18 13:23:59 2017 (r323704) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Mon Sep 18 13:37:14 2017 (r323705) @@ -269,8 +269,7 @@ find_next_zero_bit(const unsigned long *addr, unsigned atomic_clear_long(&((volatile unsigned long *)(a))[BIT_WORD(i)], BIT_MASK(i)) #define test_bit(i, a) \ - !!(atomic_load_acq_long(&((volatile unsigned long *)(a))[BIT_WORD(i)]) & \ - BIT_MASK(i)) + !!(READ_ONCE(((volatile unsigned long *)(a))[BIT_WORD(i)]) & BIT_MASK(i)) static inline int test_and_clear_bit(long bit, volatile unsigned long *var) Modified: head/sys/compat/linuxkpi/common/src/linux_tasklet.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_tasklet.c Mon Sep 18 13:23:59 2017 (r323704) +++ head/sys/compat/linuxkpi/common/src/linux_tasklet.c Mon Sep 18 13:37:14 2017 (r323705) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -45,10 +46,10 @@ __FBSDID("$FreeBSD$"); atomic_cmpset_ptr((volatile uintptr_t *)&(ts)->entry.tqe_prev, old, new) #define TASKLET_ST_SET(ts, new) \ - atomic_store_rel_ptr((volatile uintptr_t *)&(ts)->entry.tqe_prev, new) + WRITE_ONCE(*(volatile uintptr_t *)&(ts)->entry.tqe_prev, new) #define TASKLET_ST_GET(ts) \ - atomic_load_acq_ptr((volatile uintptr_t *)&(ts)->entry.tqe_prev) + READ_ONCE(*(volatile uintptr_t *)&(ts)->entry.tqe_prev) struct tasklet_worker { struct mtx mtx; From owner-svn-src-head@freebsd.org Mon Sep 18 13:39:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A32CEE10F09; Mon, 18 Sep 2017 13:39:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DB1669345; Mon, 18 Sep 2017 13:39:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8IDdp3Z060368; Mon, 18 Sep 2017 13:39:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8IDdpIl060367; Mon, 18 Sep 2017 13:39:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201709181339.v8IDdpIl060367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 Sep 2017 13:39:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323706 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 323706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 13:39:52 -0000 Author: hselasky Date: Mon Sep 18 13:39:51 2017 New Revision: 323706 URL: https://svnweb.freebsd.org/changeset/base/323706 Log: Bump the __FreeBSD_version after recent LinuxKPI changes. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Sep 18 13:37:14 2017 (r323705) +++ head/sys/sys/param.h Mon Sep 18 13:39:51 2017 (r323706) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200044 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200045 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Mon Sep 18 15:08:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EDB1E16764; Mon, 18 Sep 2017 15:08:11 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46BE76C9FF; Mon, 18 Sep 2017 15:08:10 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (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 CD3C9260105; Mon, 18 Sep 2017 17:08:08 +0200 (CEST) Subject: Re: svn commit: r323692 - in head/sys/compat: linsysfs linux To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201709172340.v8HNeGuP016998@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <7527afaa-c983-a2dd-6a1c-a20bb1d03d7a@selasky.org> Date: Mon, 18 Sep 2017 17:05:40 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201709172340.v8HNeGuP016998@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 15:08:11 -0000 On 09/18/17 01:40, Conrad Meyer wrote: > device_get_children(dev, &children, &nchildren); > for (i = 0; i < nchildren; i++) { > if (children[i]) > - linsysfs_run_bus(children[i], dir, scsi, new_path, prefix); > + linsysfs_run_bus(children[i], dir, scsi, chardev, new_path, prefix); > } > if (new_path != path) > free(new_path, M_TEMP); > + free(chardevname, M_TEMP); > > return (1); 1) Return code from device_get_children() should be checked. 2) children pointer should be freed else there is a memory leak. --HPS From owner-svn-src-head@freebsd.org Mon Sep 18 15:09:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71124E16906; Mon, 18 Sep 2017 15:09:55 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yw0-f194.google.com (mail-yw0-f194.google.com [209.85.161.194]) (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 374FC6CB8A; Mon, 18 Sep 2017 15:09:54 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yw0-f194.google.com with SMTP id s62so54436ywg.4; Mon, 18 Sep 2017 08:09:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=LqAImCQgFqvmauKccppPK6ZKobhhri91vkLRFySTnFQ=; b=CpJ8fmtLoC6NwxTK5p3QRXGazdIl+pH9FPXas43YwDumjL84hcpG9PrVjCdmiFCxas 4HGTxrCbO3k4rUGUYjC5K6ThkVazUcCYkR/gSDfhg3Zk/XzYha9cvgWGDwOANftBWI6D 55dIpY5Y9w81swPm7wZqoYgXGr7CpYm7btKr/5svoEFE03YXGmXz37pvYULIqA4wQgdy tM/OeMZRVCksr5CKJ8+YPAXaPEVt/aFzyqUlmJjHJRx9npIXaO+5xgCSjVB7yvTg3nYV Q0GJHItB9XEwgoy7RYopAVEOOioDKTILpoDgHg01sEW1DLqLqVyl9PtU4LG9qaM9GyMK UZXQ== X-Gm-Message-State: AHPjjUi522bTv5vn1d4sTdj/17IA3EMMhwsdxAD6EwTdu93IBtsjrUqT dcFdPaUbO5yUTojlj2Y= X-Received: by 10.37.129.69 with SMTP id j5mr771619ybm.31.1505747388340; Mon, 18 Sep 2017 08:09:48 -0700 (PDT) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com. [209.85.214.45]) by smtp.gmail.com with ESMTPSA id w137sm3075003ywd.9.2017.09.18.08.09.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Sep 2017 08:09:48 -0700 (PDT) Received: by mail-it0-f45.google.com with SMTP id r131so6494410itc.1; Mon, 18 Sep 2017 08:09:48 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDyi7a/HvdGRhGO26mVfHJoqI1ta6o7KAs7Hz3gKBd9dum/RMjc3jB1iOHk6XSojlW3yg9jokS1tcn09lKL2zU= X-Received: by 10.36.84.81 with SMTP id t78mr16261158ita.117.1505747387310; Mon, 18 Sep 2017 08:09:47 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.81.131 with HTTP; Mon, 18 Sep 2017 08:09:46 -0700 (PDT) In-Reply-To: References: <201709172340.v8HNeGuP016998@repo.freebsd.org> From: Conrad Meyer Date: Mon, 18 Sep 2017 08:09:46 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r323692 - in head/sys/compat: linsysfs linux To: Hans Petter Selasky Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 15:09:55 -0000 Seems unhelpful here, as the maximum length of "226:%d" is shorter than the buffer. On Mon, Sep 18, 2017 at 3:38 AM, Hans Petter Selasky wrote: > On 09/18/17 01:40, Conrad Meyer wrote: >> >> + sprintf(chardevname, "226:%d", >> + device_get_unit(dev)); > > > Hi, > > Try to use snprintf(). Define the chardevname size as a macro, or just > allocate it on the stack if it is < 32 bytes. > > --HPS From owner-svn-src-head@freebsd.org Mon Sep 18 15:14:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 014BAE1727D; Mon, 18 Sep 2017 15:14:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::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 C03936D23F; Mon, 18 Sep 2017 15:14:30 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (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 D63B0260105; Mon, 18 Sep 2017 17:14:28 +0200 (CEST) Subject: Re: svn commit: r323692 - in head/sys/compat: linsysfs linux To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201709172340.v8HNeGuP016998@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <74fa25ac-685e-c3f8-90d6-cdfac10a0f88@selasky.org> Date: Mon, 18 Sep 2017 17:12:01 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201709172340.v8HNeGuP016998@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 15:14:31 -0000 On 09/18/17 01:40, Conrad Meyer wrote: > + > + dinfo = device_get_ivars(parent); > + if (dinfo != NULL && dinfo->cfg.baseclass == PCIC_DISPLAY) { > + devclass = device_get_devclass(dev); > + if (devclass != NULL) > + name = devclass_get_name(devclass); > + if (name != NULL && strcmp(name, DRMN_DEV) == 0 && > + device_get_unit(dev) >= 0) { > + sprintf(chardevname, "226:%d", Order of comparison should be switched. First check devclass and name. Then try to access ivars. Else the ivars might have an undefined type! --HPS From owner-svn-src-head@freebsd.org Mon Sep 18 15:15:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D468BE17456; Mon, 18 Sep 2017 15:15:43 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::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 9DDEF6D3D5; Mon, 18 Sep 2017 15:15:43 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (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 DF69D260105; Mon, 18 Sep 2017 17:15:41 +0200 (CEST) Subject: Re: svn commit: r323692 - in head/sys/compat: linsysfs linux To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201709172340.v8HNeGuP016998@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <3cf448fc-d984-2394-2143-c758ae3fb8f2@selasky.org> Date: Mon, 18 Sep 2017 17:13:14 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 15:15:44 -0000 On 09/18/17 17:09, Conrad Meyer wrote: > Seems unhelpful here, as the maximum length of "226:%d" is shorter > than the buffer. > It makes code-review easier. --HPS From owner-svn-src-head@freebsd.org Mon Sep 18 15:17:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC929E175E7; Mon, 18 Sep 2017 15:17:02 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6F9C6D629; Mon, 18 Sep 2017 15:17:02 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8IFH1gG001750; Mon, 18 Sep 2017 15:17:01 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8IFH1iC001749; Mon, 18 Sep 2017 15:17:01 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201709181517.v8IFH1iC001749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 18 Sep 2017 15:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323707 - head/sys/boot/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/i386/libi386 X-SVN-Commit-Revision: 323707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 15:17:03 -0000 Author: tsoome Date: Mon Sep 18 15:17:01 2017 New Revision: 323707 URL: https://svnweb.freebsd.org/changeset/base/323707 Log: loader: biosmem allocate heap just below 4GB The current biosmem code is walking bios smap entries and looking for smap entry just below 4GB line, if there is such entry, its base and size is set for heap base and size. Instead of entry base, we should use last HEAP_MIN (currently 64MB) bytes just below 4GB, to make maximum space for kernel and modules. The problem was revealed on ASUS B350M-A system board, an AMD Ryzen 3 1200 CPU memory map: SMAP type=01 base=0000000000000000 len=000000000009d400 attr=01 SMAP type=02 base=000000000009d400 len=0000000000002c00 attr=01 SMAP type=02 base=00000000000e0000 len=0000000000020000 attr=01 SMAP type=01 base=0000000000100000 len=0000000009c00000 attr=01 SMAP type=02 base=0000000009d00000 len=0000000000300000 attr=01 SMAP type=01 base=000000000a000000 len=00000000be69b000 attr=01 SMAP type=03 base=00000000c869b000 len=0000000000016000 attr=01 SMAP type=01 base=00000000c86b1000 len=00000000124e7000 attr=01 SMAP type=02 base=00000000dab98000 len=0000000000138000 attr=01 SMAP type=03 base=00000000dacd0000 len=0000000000008000 attr=01 SMAP type=01 base=00000000dacd8000 len=0000000000100000 attr=01 SMAP type=04 base=00000000dadd8000 len=00000000003b3000 attr=01 SMAP type=02 base=00000000db18b000 len=0000000000d42000 attr=01 SMAP type=01 base=00000000dbecd000 len=0000000002133000 attr=01 SMAP type=01 base=0000000100000000 len=000000011f380000 attr=01 SMAP type=02 base=00000000de000000 len=0000000002000000 attr=01 SMAP type=02 base=00000000f8000000 len=0000000004000000 attr=01 SMAP type=02 base=00000000fdf00000 len=0000000000100000 attr=01 SMAP type=02 base=00000000fea00000 len=0000000000010000 attr=01 SMAP type=02 base=00000000feb80000 len=0000000000082000 attr=01 SMAP type=02 base=00000000fec10000 len=0000000000001000 attr=01 SMAP type=02 base=00000000fec30000 len=0000000000001000 attr=01 SMAP type=02 base=00000000fed00000 len=0000000000001000 attr=01 SMAP type=02 base=00000000fed40000 len=0000000000005000 attr=01 SMAP type=02 base=00000000fed80000 len=0000000000010000 attr=01 SMAP type=02 base=00000000fedc2000 len=000000000000e000 attr=01 SMAP type=02 base=00000000fedd4000 len=0000000000002000 attr=01 SMAP type=02 base=00000000fee00000 len=0000000000100000 attr=01 SMAP type=02 base=00000000ff000000 len=0000000001000000 attr=01 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D12368 Modified: head/sys/boot/i386/libi386/biosmem.c Modified: head/sys/boot/i386/libi386/biosmem.c ============================================================================== --- head/sys/boot/i386/libi386/biosmem.c Mon Sep 18 13:39:51 2017 (r323706) +++ head/sys/boot/i386/libi386/biosmem.c Mon Sep 18 15:17:01 2017 (r323707) @@ -125,7 +125,7 @@ bios_getmem(void) } /* - * Look for the largest segment in 'extended' memory beyond + * Look for the highest segment in 'extended' memory beyond * 1MB but below 4GB. */ if ((smap.type == SMAP_TYPE_MEMORY) && @@ -140,9 +140,13 @@ bios_getmem(void) if (smap.base + size > 0x100000000ull) size = 0x100000000ull - smap.base; - if (size > high_heap_size) { - high_heap_size = size; - high_heap_base = smap.base; + /* + * To make maximum space for the kernel and the modules, + * set heap to use highest HEAP_MIN bytes below 4GB. + */ + if (high_heap_base < smap.base && size >= HEAP_MIN) { + high_heap_base = smap.base + size - HEAP_MIN; + high_heap_size = HEAP_MIN; } } } while (v86.ebx != 0); @@ -203,7 +207,11 @@ bios_getmem(void) } /* Set memtop to actual top of memory */ - memtop = memtop_copyin = 0x100000 + bios_extmem; + if (high_heap_size != 0) { + memtop = memtop_copyin = high_heap_base; + } else { + memtop = memtop_copyin = 0x100000 + bios_extmem; + } /* * If we have extended memory and did not find a suitable heap @@ -213,6 +221,7 @@ bios_getmem(void) if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { high_heap_size = HEAP_MIN; high_heap_base = memtop - HEAP_MIN; + memtop = memtop_copyin = high_heap_base; } } From owner-svn-src-head@freebsd.org Mon Sep 18 16:29:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21214E1CB8A; Mon, 18 Sep 2017 16:29:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yw0-f172.google.com (mail-yw0-f172.google.com [209.85.161.172]) (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 DA92270726; Mon, 18 Sep 2017 16:29:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yw0-f172.google.com with SMTP id u11so727254ywh.7; Mon, 18 Sep 2017 09:29:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=onXPYrabmc2/opTMNq09CTP23xkm3OjokE2eHwEcuv0=; b=R1V6SS4MsPVrbavGdu1kg0nnBorFSpWmeW7DWnBkzgyQdtEIezHCQmlxRC+mQaIt21 ykgJVTPvEaVBDJZUB6Ok4DxfgRebnokmPEV45IF9u/zL6Tm2rUAEDCpYSjRq7z2SndUF +4bM+nsghOYVpBW+Br9C6/dq8AdiwKEHOBOE/yN1eAAz30RN3Ah/+kj0pA557ivnedbM wybzsbms1N+ZfBOXd9SqgylBCYwBhL3AdWv31XX64djUu+naMNjj9k52+mcgi0izX+xF 4MqjcFzACqTFgQ4ZDNAH563NALP5g8aQexnwxcSXUQfANLJ1E/kLBwbinXoiRGvBsGUh oyJQ== X-Gm-Message-State: AHPjjUgcweRlc28CVHr4dfDrAnVEvkOocOHCDFXp9Dvz+8Ofew5asR34 OXFmW/YiCeJaAMt0DRc= X-Received: by 10.37.111.135 with SMTP id k129mr13982203ybc.74.1505750853318; Mon, 18 Sep 2017 09:07:33 -0700 (PDT) Received: from mail-io0-f170.google.com (mail-io0-f170.google.com. [209.85.223.170]) by smtp.gmail.com with ESMTPSA id z77sm3138693ywd.31.2017.09.18.09.07.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Sep 2017 09:07:33 -0700 (PDT) Received: by mail-io0-f170.google.com with SMTP id z187so3277508ioz.12; Mon, 18 Sep 2017 09:07:33 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCtRHFpv8So2jOm1WJkZbUgiLITXeiWsi6nMFq1+6Jvu3p5FCq6gfAytPOV7j0cZGSd8c4JboE/d2P0h7VdJ+I= X-Received: by 10.107.97.5 with SMTP id v5mr19967780iob.174.1505750852753; Mon, 18 Sep 2017 09:07:32 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.81.131 with HTTP; Mon, 18 Sep 2017 09:07:32 -0700 (PDT) In-Reply-To: <7527afaa-c983-a2dd-6a1c-a20bb1d03d7a@selasky.org> References: <201709172340.v8HNeGuP016998@repo.freebsd.org> <7527afaa-c983-a2dd-6a1c-a20bb1d03d7a@selasky.org> From: Conrad Meyer Date: Mon, 18 Sep 2017 09:07:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r323692 - in head/sys/compat: linsysfs linux To: Hans Petter Selasky Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 16:29:36 -0000 This was not introduced in this change. On Mon, Sep 18, 2017 at 8:05 AM, Hans Petter Selasky wrote: > On 09/18/17 01:40, Conrad Meyer wrote: >> >> device_get_children(dev, &children, &nchildren); >> for (i = 0; i < nchildren; i++) { >> if (children[i]) >> - linsysfs_run_bus(children[i], dir, scsi, new_path, >> prefix); >> + linsysfs_run_bus(children[i], dir, scsi, chardev, >> new_path, prefix); >> } >> if (new_path != path) >> free(new_path, M_TEMP); >> + free(chardevname, M_TEMP); >> return (1); > > > 1) Return code from device_get_children() should be checked. > > 2) children pointer should be freed else there is a memory leak. > > --HPS From owner-svn-src-head@freebsd.org Mon Sep 18 16:42:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10A1FE1DA1F; Mon, 18 Sep 2017 16:42:15 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3CCC70F18; Mon, 18 Sep 2017 16:42:14 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8IGgEM9039219; Mon, 18 Sep 2017 16:42:14 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8IGgEpF039218; Mon, 18 Sep 2017 16:42:14 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201709181642.v8IGgEpF039218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Mon, 18 Sep 2017 16:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323709 - head/usr.sbin/tcpdump/tcpdump X-SVN-Group: head X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: head/usr.sbin/tcpdump/tcpdump X-SVN-Commit-Revision: 323709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 16:42:15 -0000 Author: gordon Date: Mon Sep 18 16:42:13 2017 New Revision: 323709 URL: https://svnweb.freebsd.org/changeset/base/323709 Log: Revert tcpdump to using the source manpage instead of having a copy here. This helps future maintainability of tcpdump so we don't forget to update the manpage (like we have previously). Stolen from: usr.bin/file/Makefile Reviewed by: jilles Approved by: delphij (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D12403 Deleted: head/usr.sbin/tcpdump/tcpdump/tcpdump.1 Modified: head/usr.sbin/tcpdump/tcpdump/Makefile Modified: head/usr.sbin/tcpdump/tcpdump/Makefile ============================================================================== --- head/usr.sbin/tcpdump/tcpdump/Makefile Mon Sep 18 15:17:07 2017 (r323708) +++ head/usr.sbin/tcpdump/tcpdump/Makefile Mon Sep 18 16:42:13 2017 (r323709) @@ -173,7 +173,7 @@ SRCS= addrtoname.c \ tcpdump.c \ util-print.c \ version.c -CLEANFILES+= version.c +CLEANFILES+= version.c ${MAN} CFLAGS+= -I${.CURDIR} -I${TCPDUMP_DISTDIR} CFLAGS+= -DHAVE_CONFIG_H @@ -210,3 +210,9 @@ version.c: ${TCPDUMP_DISTDIR}/VERSION > version.c .include + +.for mp in ${MAN} +${mp}: ${mp}.in + sed -e 's/@MAN_MISC_INFO@/7/g' -e 's/@MAN_FILE_FORMATS@/5/g' \ + ${.ALLSRC} > ${.TARGET} +.endfor From owner-svn-src-head@freebsd.org Mon Sep 18 16:54:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78269E1E586; Mon, 18 Sep 2017 16:54:15 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F4BF71741; Mon, 18 Sep 2017 16:54:14 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id tzJ7dYGvCDJTWtzJ8dAth7; Mon, 18 Sep 2017 10:54:07 -0600 X-Authority-Analysis: v=2.2 cv=B4DJ6KlM c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=2JCJgTwv5E4A:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=pSCgvsbptnqMfPoRQk0A:9 a=QEXdDO2ut3YA:10 a=hSUpV7hDpKOlQw-o2Q8A:9 a=vtgsAvVPlfX4ugVk:21 a=_W_S_7VecoQA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from [10.168.3.99] (S0106d4ca6d8943b0.gv.shawcable.net [24.68.134.59]) by spqr.komquats.com (Postfix) with ESMTPSA id 2A7413D5; Mon, 18 Sep 2017 09:54:05 -0700 (PDT) MIME-Version: 1.0 From: Cy Schubert Subject: RE: svn commit: r323709 - head/usr.sbin/tcpdump/tcpdump Date: Mon, 18 Sep 2017 09:54:07 -0700 To: Gordon Tetlow , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <20170918165405.2A7413D5@spqr.komquats.com> X-CMAE-Envelope: MS4wfFr7iRxSeY5Tu8/6qsdYDtK+DcbVwb+ms1DvDIpIS4YL89f7E5mBlh041X0l3BP//7n6bsAVZVHIyH8Kmv0JKzPi8nGXTA5nQ6W40QuuJB1/p1qbcbi7 Un0Qoo6KifYWZextYtO5iDrXG1CuYpzeVYrNzUS1u4ejdHa+L2DalaMfOmrLD/LxYwK7wGW7Q1rm7jXt+YmbPS8k74MgsoUzSVnLlsqzDaiqF+eRnobusl8q bKhnsXK7sxFiHSiOMcwGsKF/JEL0nRh2viYEURHITN+A8Nmbcdx0EfJuX7zbjXjF Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 16:54:15 -0000 Thank you. Sent using a tiny phone keyboard. Apologies for any typos. Cy Schubert or -----Original Message----- From: Gordon Tetlow Sent: 18/09/2017 09:42 To: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb= sd.org Subject: svn commit: r323709 - head/usr.sbin/tcpdump/tcpdump Author: gordon Date: Mon Sep 18 16:42:13 2017 New Revision: 323709 URL: https://svnweb.freebsd.org/changeset/base/323709 Log: Revert tcpdump to using the source manpage instead of having a copy here. =20 This helps future maintainability of tcpdump so we don't forget to update the manpage (like we have previously). =20 Stolen from: usr.bin/file/Makefile Reviewed by: jilles Approved by: delphij (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D12403 Deleted: head/usr.sbin/tcpdump/tcpdump/tcpdump.1 Modified: head/usr.sbin/tcpdump/tcpdump/Makefile Modified: head/usr.sbin/tcpdump/tcpdump/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/tcpdump/tcpdump/Makefile Mon Sep 18 15:17:07 2017 (r32370= 8) +++ head/usr.sbin/tcpdump/tcpdump/Makefile Mon Sep 18 16:42:13 2017 (r32370= 9) @@ -173,7 +173,7 @@ SRCS=3D addrtoname.c \ tcpdump.c \ util-print.c \ version.c -CLEANFILES+=3D version.c +CLEANFILES+=3D version.c ${MAN} =20 CFLAGS+=3D -I${.CURDIR} -I${TCPDUMP_DISTDIR} CFLAGS+=3D -DHAVE_CONFIG_H @@ -210,3 +210,9 @@ version.c: ${TCPDUMP_DISTDIR}/VERSION > version.c =20 .include + +.for mp in ${MAN} +${mp}: ${mp}.in + sed -e 's/@MAN_MISC_INFO@/7/g' -e 's/@MAN_FILE_FORMATS@/5/g' \ + ${.ALLSRC} > ${.TARGET} +.endfor From owner-svn-src-head@freebsd.org Mon Sep 18 17:14:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62DFEE1FA2E; Mon, 18 Sep 2017 17:14:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30858721D8; Mon, 18 Sep 2017 17:14:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8IHEDZ2051499; Mon, 18 Sep 2017 17:14:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8IHEDeE051497; Mon, 18 Sep 2017 17:14:13 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709181714.v8IHEDeE051497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 18 Sep 2017 17:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323710 - head/sys/compat/linsysfs X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/compat/linsysfs X-SVN-Commit-Revision: 323710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 17:14:14 -0000 Author: cem Date: Mon Sep 18 17:14:13 2017 New Revision: 323710 URL: https://svnweb.freebsd.org/changeset/base/323710 Log: linsysfs(5): Fix two unrelated issues 1. Swap the order of device_get_ivars with device_get_devclass and devclass name validation. This bug was introduced in r323692. 2. Error check device_get_children and free the returned list. This bug was introduced in the original linsysfs commit. Reported by: Oleg V. Nauman , hselasky (1); hselasky (2) Reviewed by: hselasky Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12407 Modified: head/sys/compat/linsysfs/linsysfs.c Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Mon Sep 18 16:42:13 2017 (r323709) +++ head/sys/compat/linsysfs/linsysfs.c Mon Sep 18 17:14:13 2017 (r323710) @@ -252,7 +252,7 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s { struct scsi_host_queue *scsi_host; struct pfs_node *sub_dir, *cur_file, *cur_chardev; - int i, nchildren; + int i, nchildren, error; device_t *children, parent; devclass_t devclass; const char *name = NULL; @@ -353,13 +353,15 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s } } - dinfo = device_get_ivars(parent); - if (dinfo != NULL && dinfo->cfg.baseclass == PCIC_DISPLAY) { - devclass = device_get_devclass(dev); - if (devclass != NULL) - name = devclass_get_name(devclass); - if (name != NULL && strcmp(name, DRMN_DEV) == 0 && - device_get_unit(dev) >= 0) { + devclass = device_get_devclass(dev); + if (devclass != NULL) + name = devclass_get_name(devclass); + else + name = NULL; + if (name != NULL && strcmp(name, DRMN_DEV) == 0 && + device_get_unit(dev) >= 0) { + dinfo = device_get_ivars(parent); + if (dinfo != NULL && dinfo->cfg.baseclass == PCIC_DISPLAY) { sprintf(chardevname, "226:%d", device_get_unit(dev)); cur_chardev = pfs_create_dir(chardev, @@ -376,10 +378,13 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s } } - device_get_children(dev, &children, &nchildren); - for (i = 0; i < nchildren; i++) { - if (children[i]) - linsysfs_run_bus(children[i], dir, scsi, chardev, new_path, prefix); + error = device_get_children(dev, &children, &nchildren); + if (error == 0) { + for (i = 0; i < nchildren; i++) + if (children[i]) + linsysfs_run_bus(children[i], dir, scsi, + chardev, new_path, prefix); + free(children, M_TEMP); } if (new_path != path) free(new_path, M_TEMP); From owner-svn-src-head@freebsd.org Mon Sep 18 17:43:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE559E21776; Mon, 18 Sep 2017 17:43:09 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-pf0-f176.google.com (mail-pf0-f176.google.com [209.85.192.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 9657A733E8; Mon, 18 Sep 2017 17:43:09 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-pf0-f176.google.com with SMTP id u12so597618pfl.4; Mon, 18 Sep 2017 10:43:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NcAV6Z5RBmy9oX5kaMrU785w0nSFZYikIGRi4OjbwCU=; b=QzwyHoTK7ua43cmtsBvJ0oDlsfetuAB1tPeYoApghpNx8P1WNoVFEyGmHCiA+x3lpf 4qXghyqrvkDfT2SS2UfOH0RDKATeGnkkLOJ8jLcHgTft9gXHxeykCIe+cvaqpROX0KiT 4kZ5bsEQY1jQn8rBbhDFajXWhC/SlmAOZI42yRVG1LlLYKYe+2LjNKeqgbSn77T+OP3P A2AiBNAjC+4FcvPvrFKllbhIoSsXUhAufKyb1RCWMFNlg3oa1dLUzF3LOYDooSqB91Wb KsqSzmkxY8HRgWh+pnX4cfaekWFtcF1Z2ykWYtuJSEfSFUKt64hgqsZ2bzlhywns7DSi zHGg== X-Gm-Message-State: AHPjjUhtKHhj80rrlapJzE9NUptlB8A3H1fYQuiW4iEjChOweR/vOD9f vtLK0GEqfDyiV4OX/5o= X-Received: by 10.84.232.14 with SMTP id h14mr36694553plk.274.1505756583248; Mon, 18 Sep 2017 10:43:03 -0700 (PDT) Received: from mail-pg0-f44.google.com (mail-pg0-f44.google.com. [74.125.83.44]) by smtp.gmail.com with ESMTPSA id f69sm1666pff.4.2017.09.18.10.43.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Sep 2017 10:43:02 -0700 (PDT) Received: by mail-pg0-f44.google.com with SMTP id 188so527649pgb.2; Mon, 18 Sep 2017 10:43:02 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7Rniq3AQcjYlNCLIklDbWhKGxqAA9KsMA59ZRYHg2gkiaAHSfKXYD9OBTERNdYV0133825iHNWF1HSEO0PXSo= X-Received: by 10.84.133.11 with SMTP id 11mr36865739plf.13.1505756582198; Mon, 18 Sep 2017 10:43:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.207.193 with HTTP; Mon, 18 Sep 2017 10:43:01 -0700 (PDT) In-Reply-To: <201709172340.v8HNeGuP016998@repo.freebsd.org> References: <201709172340.v8HNeGuP016998@repo.freebsd.org> From: Ryan Libby Date: Mon, 18 Sep 2017 10:43:01 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r323692 - in head/sys/compat: linsysfs linux To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 17:43:09 -0000 On Sun, Sep 17, 2017 at 4:40 PM, Conrad Meyer wrote: > Author: cem > Date: Sun Sep 17 23:40:16 2017 > New Revision: 323692 > URL: https://svnweb.freebsd.org/changeset/base/323692 > > Log: > linsysfs(5): Add support for recent libdrm > > Expose more information about PCI devices (and GPUs in particular) via > linsysfs to libdrm. > > This allows unmodified modern 64-bit Linux libdrm to work, which allows > modern Linux Mesa to work. The submitter reports that he tested the change > with an Ubuntu 16.04 chroot + amdgpu from graphics/drm-next-kmod. > > PR: 222375 > Submitted by: Greg V > > Modified: > head/sys/compat/linsysfs/linsysfs.c > head/sys/compat/linux/linux_util.c > > Modified: head/sys/compat/linsysfs/linsysfs.c > ============================================================================== > --- head/sys/compat/linsysfs/linsysfs.c Sun Sep 17 22:58:13 2017 (r323691) > +++ head/sys/compat/linsysfs/linsysfs.c Sun Sep 17 23:40:16 2017 (r323692) > @@ -133,20 +133,135 @@ linsysfs_link_scsi_host(PFS_FILL_ARGS) > return (0); > } > > +static int > +linsysfs_fill_data(PFS_FILL_ARGS) > +{ > + sbuf_printf(sb, "%s", pn->pn_data); > + return (0); > +} This broke the gcc build with -Wformat [1]: /workspace/src/sys/compat/linsysfs/linsysfs.c: In function 'linsysfs_fill_data': /workspace/src/sys/compat/linsysfs/linsysfs.c:139:20: error: format '%s' expects argument of type 'char *', but argument 3 has type 'void *' [-Werror=format=] sbuf_printf(sb, "%s", pn->pn_data); It builds if a char * cast is added. Is that the right fix? [1] https://ci.freebsd.org/job/FreeBSD-head-amd64-gcc/2532/ From owner-svn-src-head@freebsd.org Mon Sep 18 18:42:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 943F9E25356; Mon, 18 Sep 2017 18:42:29 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57DEF75FD0; Mon, 18 Sep 2017 18:42:29 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8IIgSaq095807; Mon, 18 Sep 2017 18:42:28 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8IIgSIE095806; Mon, 18 Sep 2017 18:42:28 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201709181842.v8IIgSIE095806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 18 Sep 2017 18:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323712 - head/sys/dev/ppc X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/dev/ppc X-SVN-Commit-Revision: 323712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 18:42:29 -0000 Author: scottl Date: Mon Sep 18 18:42:28 2017 New Revision: 323712 URL: https://svnweb.freebsd.org/changeset/base/323712 Log: Hide a normal probe warning message under bootverbose, similar to atkbdc Sponsored by: Netflix Modified: head/sys/dev/ppc/ppc.c Modified: head/sys/dev/ppc/ppc.c ============================================================================== --- head/sys/dev/ppc/ppc.c Mon Sep 18 17:26:47 2017 (r323711) +++ head/sys/dev/ppc/ppc.c Mon Sep 18 18:42:28 2017 (r323712) @@ -1720,7 +1720,8 @@ ppc_probe(device_t dev, int rid) if (bootverbose) device_printf(dev, "using normal I/O port range\n"); } else { - device_printf(dev, "cannot reserve I/O port range\n"); + if (bootverbose) + device_printf(dev, "cannot reserve I/O port range\n"); goto error; } } From owner-svn-src-head@freebsd.org Mon Sep 18 19:09:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FF79E26C50; Mon, 18 Sep 2017 19:09:41 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F25ED772CF; Mon, 18 Sep 2017 19:09:40 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8IJ9eRj004835; Mon, 18 Sep 2017 19:09:40 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8IJ9eYK004834; Mon, 18 Sep 2017 19:09:40 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201709181909.v8IJ9eYK004834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Mon, 18 Sep 2017 19:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323714 - head/sys/compat/linsysfs X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/compat/linsysfs X-SVN-Commit-Revision: 323714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 19:09:41 -0000 Author: rlibby Date: Mon Sep 18 19:09:40 2017 New Revision: 323714 URL: https://svnweb.freebsd.org/changeset/base/323714 Log: linsysfs: quiet gcc -Wformat after r323692 Reviewed by: cem Sponsored by: Dell EMC Isilon Modified: head/sys/compat/linsysfs/linsysfs.c Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Mon Sep 18 18:44:45 2017 (r323713) +++ head/sys/compat/linsysfs/linsysfs.c Mon Sep 18 19:09:40 2017 (r323714) @@ -136,7 +136,7 @@ linsysfs_link_scsi_host(PFS_FILL_ARGS) static int linsysfs_fill_data(PFS_FILL_ARGS) { - sbuf_printf(sb, "%s", pn->pn_data); + sbuf_printf(sb, "%s", (char *)pn->pn_data); return (0); } From owner-svn-src-head@freebsd.org Mon Sep 18 19:16:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6D69E003AE; Mon, 18 Sep 2017 19:16:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4AEF778ED; Mon, 18 Sep 2017 19:16:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8IJGfLe008864; Mon, 18 Sep 2017 19:16:41 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8IJGfcP008863; Mon, 18 Sep 2017 19:16:41 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201709181916.v8IJGfcP008863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 18 Sep 2017 19:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323715 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 323715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 19:16:43 -0000 Author: cy Date: Mon Sep 18 19:16:41 2017 New Revision: 323715 URL: https://svnweb.freebsd.org/changeset/base/323715 Log: Don't use an apostrophe in a possesive pronoun. MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/ip_state.c Modified: head/sys/contrib/ipfilter/netinet/ip_state.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_state.c Mon Sep 18 19:09:40 2017 (r323714) +++ head/sys/contrib/ipfilter/netinet/ip_state.c Mon Sep 18 19:16:41 2017 (r323715) @@ -1449,7 +1449,7 @@ ipf_state_add(softc, fin, stsave, flags) is->is_die = 1 + softc->ipf_ticks; /* * We want to check everything that is a property of this packet, - * but we don't (automatically) care about it's fragment status as + * but we don't (automatically) care about its fragment status as * this may change. */ is->is_pass = pass; From owner-svn-src-head@freebsd.org Mon Sep 18 19:52:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7751DE02729 for ; Mon, 18 Sep 2017 19:52:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 597EE7D1A2 for ; Mon, 18 Sep 2017 19:52:44 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: eac81974-9caa-11e7-a937-4f970e858fdb X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id eac81974-9caa-11e7-a937-4f970e858fdb; Mon, 18 Sep 2017 19:52:36 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v8IJqZuu008641; Mon, 18 Sep 2017 13:52:35 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1505764355.60200.63.camel@freebsd.org> Subject: Re: svn commit: r323715 - head/sys/contrib/ipfilter/netinet From: Ian Lepore To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 18 Sep 2017 13:52:35 -0600 In-Reply-To: <201709181916.v8IJGfcP008863@repo.freebsd.org> References: <201709181916.v8IJGfcP008863@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 19:52:44 -0000 On Mon, 2017-09-18 at 19:16 +0000, Cy Schubert wrote: > Author: cy > Date: Mon Sep 18 19:16:41 2017 > New Revision: 323715 > URL: https://svnweb.freebsd.org/changeset/base/323715 > > Log: >   Don't use an apostrophe in a possesive pronoun. >    And that really is the way to remember it for those who struggle: yours, theirs, his, hers, its... none of the possesive pronouns that end in s use an apostrophe. -- Ian (only mildly obsessed with apostrophe abuse) From owner-svn-src-head@freebsd.org Mon Sep 18 20:01:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 024A3E03429; Mon, 18 Sep 2017 20:01:04 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABD547D8A3; Mon, 18 Sep 2017 20:01:03 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8IK12Ni027405; Mon, 18 Sep 2017 20:01:02 GMT (envelope-from kibab@FreeBSD.org) Received: (from kibab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8IK11ua027395; Mon, 18 Sep 2017 20:01:01 GMT (envelope-from kibab@FreeBSD.org) Message-Id: <201709182001.v8IK11ua027395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kibab set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin Date: Mon, 18 Sep 2017 20:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323717 - head/usr.bin/sdiotool X-SVN-Group: head X-SVN-Commit-Author: kibab X-SVN-Commit-Paths: head/usr.bin/sdiotool X-SVN-Commit-Revision: 323717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 20:01:04 -0000 Author: kibab Date: Mon Sep 18 20:01:01 2017 New Revision: 323717 URL: https://svnweb.freebsd.org/changeset/base/323717 Log: Make basic Broadcom I/O space reading functions work It's now possible to use Broadcom functions to read the I/O registers of SDIO card. The functions were copied from the BSD-licensed Broadcom Linux driver as-is. To make it possible, a small Linux compatibility layer was introduced. Currently the card responds with the correct version number ("magic") when reading the corresponding address. Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D12111 Added: head/usr.bin/sdiotool/brcmfmac_bus.h (contents, props changed) head/usr.bin/sdiotool/brcmfmac_sdio.h (contents, props changed) head/usr.bin/sdiotool/cam_sdio.c (contents, props changed) head/usr.bin/sdiotool/cam_sdio.h (contents, props changed) head/usr.bin/sdiotool/linux_compat.h (contents, props changed) head/usr.bin/sdiotool/linux_sdio_compat.c (contents, props changed) head/usr.bin/sdiotool/linux_sdio_compat.h (contents, props changed) Modified: head/usr.bin/sdiotool/Makefile head/usr.bin/sdiotool/sdiotool.c Modified: head/usr.bin/sdiotool/Makefile ============================================================================== --- head/usr.bin/sdiotool/Makefile Mon Sep 18 19:56:05 2017 (r323716) +++ head/usr.bin/sdiotool/Makefile Mon Sep 18 20:01:01 2017 (r323717) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= sdiotool -SRCS= sdiotool.c +SRCS= sdiotool.c cam_sdio.c linux_sdio_compat.c LIBADD= cam util MAN= Added: head/usr.bin/sdiotool/brcmfmac_bus.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiotool/brcmfmac_bus.h Mon Sep 18 20:01:01 2017 (r323717) @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2010 Broadcom Corporation + * + * Permission to use, copy, modify, and/or 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. + * + * $FreeBSD$ + */ +/* The level of bus communication with the dongle */ +enum brcmf_bus_state { + BRCMF_BUS_DOWN, /* Not ready for frame transfers */ + BRCMF_BUS_UP /* Ready for frame transfers */ +}; + +struct brcmf_bus { + enum brcmf_bus_state state; +}; Added: head/usr.bin/sdiotool/brcmfmac_sdio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiotool/brcmfmac_sdio.h Mon Sep 18 20:01:01 2017 (r323717) @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2010 Broadcom Corporation + * + * Permission to use, copy, modify, and/or 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. + * + * $FreeBSD$ + */ +#define SDIO_FUNC_0 0 +#define SDIO_FUNC_1 1 +#define SDIO_FUNC_2 2 + +#define SDIOD_FBR_SIZE 0x100 + +/* io_en */ +#define SDIO_FUNC_ENABLE_1 0x02 +#define SDIO_FUNC_ENABLE_2 0x04 + +/* io_rdys */ +#define SDIO_FUNC_READY_1 0x02 +#define SDIO_FUNC_READY_2 0x04 + +/* intr_status */ +#define INTR_STATUS_FUNC1 0x2 +#define INTR_STATUS_FUNC2 0x4 + +/* Maximum number of I/O funcs */ +#define SDIOD_MAX_IOFUNCS 7 + +/* mask of register map */ +#define REG_F0_REG_MASK 0x7FF +#define REG_F1_MISC_MASK 0x1FFFF + +/* as of sdiod rev 0, supports 3 functions */ +#define SBSDIO_NUM_FUNCTION 3 + +/* function 0 vendor specific CCCR registers */ +#define SDIO_CCCR_BRCM_CARDCAP 0xf0 +#define SDIO_CCCR_BRCM_CARDCAP_CMD14_SUPPORT 0x02 +#define SDIO_CCCR_BRCM_CARDCAP_CMD14_EXT 0x04 +#define SDIO_CCCR_BRCM_CARDCAP_CMD_NODEC 0x08 +#define SDIO_CCCR_BRCM_CARDCTRL 0xf1 +#define SDIO_CCCR_BRCM_CARDCTRL_WLANRESET 0x02 +#define SDIO_CCCR_BRCM_SEPINT 0xf2 + +#define SDIO_SEPINT_MASK 0x01 +#define SDIO_SEPINT_OE 0x02 +#define SDIO_SEPINT_ACT_HI 0x04 + +/* function 1 miscellaneous registers */ + +/* sprom command and status */ +#define SBSDIO_SPROM_CS 0x10000 +/* sprom info register */ +#define SBSDIO_SPROM_INFO 0x10001 +/* sprom indirect access data byte 0 */ +#define SBSDIO_SPROM_DATA_LOW 0x10002 +/* sprom indirect access data byte 1 */ +#define SBSDIO_SPROM_DATA_HIGH 0x10003 +/* sprom indirect access addr byte 0 */ +#define SBSDIO_SPROM_ADDR_LOW 0x10004 +/* gpio select */ +#define SBSDIO_GPIO_SELECT 0x10005 +/* gpio output */ +#define SBSDIO_GPIO_OUT 0x10006 +/* gpio enable */ +#define SBSDIO_GPIO_EN 0x10007 +/* rev < 7, watermark for sdio device */ +#define SBSDIO_WATERMARK 0x10008 +/* control busy signal generation */ +#define SBSDIO_DEVICE_CTL 0x10009 + +/* SB Address Window Low (b15) */ +#define SBSDIO_FUNC1_SBADDRLOW 0x1000A +/* SB Address Window Mid (b23:b16) */ +#define SBSDIO_FUNC1_SBADDRMID 0x1000B +/* SB Address Window High (b31:b24) */ +#define SBSDIO_FUNC1_SBADDRHIGH 0x1000C +/* Frame Control (frame term/abort) */ +#define SBSDIO_FUNC1_FRAMECTRL 0x1000D +/* ChipClockCSR (ALP/HT ctl/status) */ +#define SBSDIO_FUNC1_CHIPCLKCSR 0x1000E +/* SdioPullUp (on cmd, d0-d2) */ +#define SBSDIO_FUNC1_SDIOPULLUP 0x1000F +/* Write Frame Byte Count Low */ +#define SBSDIO_FUNC1_WFRAMEBCLO 0x10019 +/* Write Frame Byte Count High */ +#define SBSDIO_FUNC1_WFRAMEBCHI 0x1001A +/* Read Frame Byte Count Low */ +#define SBSDIO_FUNC1_RFRAMEBCLO 0x1001B +/* Read Frame Byte Count High */ +#define SBSDIO_FUNC1_RFRAMEBCHI 0x1001C +/* MesBusyCtl (rev 11) */ +#define SBSDIO_FUNC1_MESBUSYCTRL 0x1001D +/* Sdio Core Rev 12 */ +#define SBSDIO_FUNC1_WAKEUPCTRL 0x1001E +#define SBSDIO_FUNC1_WCTRL_ALPWAIT_MASK 0x1 +#define SBSDIO_FUNC1_WCTRL_ALPWAIT_SHIFT 0 +#define SBSDIO_FUNC1_WCTRL_HTWAIT_MASK 0x2 +#define SBSDIO_FUNC1_WCTRL_HTWAIT_SHIFT 1 +#define SBSDIO_FUNC1_SLEEPCSR 0x1001F +#define SBSDIO_FUNC1_SLEEPCSR_KSO_MASK 0x1 +#define SBSDIO_FUNC1_SLEEPCSR_KSO_SHIFT 0 +#define SBSDIO_FUNC1_SLEEPCSR_KSO_EN 1 +#define SBSDIO_FUNC1_SLEEPCSR_DEVON_MASK 0x2 +#define SBSDIO_FUNC1_SLEEPCSR_DEVON_SHIFT 1 + +#define SBSDIO_FUNC1_MISC_REG_START 0x10000 /* f1 misc register start */ +#define SBSDIO_FUNC1_MISC_REG_LIMIT 0x1001F /* f1 misc register end */ + +/* function 1 OCP space */ + +/* sb offset addr is <= 15 bits, 32k */ +#define SBSDIO_SB_OFT_ADDR_MASK 0x07FFF +#define SBSDIO_SB_OFT_ADDR_LIMIT 0x08000 +/* with b15, maps to 32-bit SB access */ +#define SBSDIO_SB_ACCESS_2_4B_FLAG 0x08000 + +/* valid bits in SBSDIO_FUNC1_SBADDRxxx regs */ + +#define SBSDIO_SBADDRLOW_MASK 0x80 /* Valid bits in SBADDRLOW */ +#define SBSDIO_SBADDRMID_MASK 0xff /* Valid bits in SBADDRMID */ +#define SBSDIO_SBADDRHIGH_MASK 0xffU /* Valid bits in SBADDRHIGH */ +/* Address bits from SBADDR regs */ +#define SBSDIO_SBWINDOW_MASK 0xffff8000 + +#define SDIOH_READ 0 /* Read request */ +#define SDIOH_WRITE 1 /* Write request */ + +#define SDIOH_DATA_FIX 0 /* Fixed addressing */ +#define SDIOH_DATA_INC 1 /* Incremental addressing */ + +/* internal return code */ +#define SUCCESS 0 +#define ERROR 1 + +/* Packet alignment for most efficient SDIO (can change based on platform) */ +#define BRCMF_SDALIGN (1 << 6) + +/** + * enum brcmf_sdiod_state - the state of the bus. + * + * @BRCMF_SDIOD_DOWN: Device can be accessed, no DPC. + * @BRCMF_SDIOD_DATA: Ready for data transfers, DPC enabled. + * @BRCMF_SDIOD_NOMEDIUM: No medium access to dongle possible. + */ +enum brcmf_sdiod_state { + BRCMF_SDIOD_DOWN, + BRCMF_SDIOD_DATA, + BRCMF_SDIOD_NOMEDIUM +}; Added: head/usr.bin/sdiotool/cam_sdio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiotool/cam_sdio.c Mon Sep 18 20:01:01 2017 (r323717) @@ -0,0 +1,440 @@ +/*- + * Copyright (c) 2017 Ilya Bakulin + * 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$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "cam_sdio.h" + +/* Use CMD52 to read or write a single byte */ +int +sdio_rw_direct(struct cam_device *dev, + uint8_t func_number, + uint32_t addr, + uint8_t is_write, + uint8_t *data, uint8_t *resp) { + union ccb *ccb; + uint32_t flags; + uint32_t arg; + int retval = 0; + + ccb = cam_getccb(dev); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + return (-1); + } + bzero(&(&ccb->ccb_h)[1], + sizeof(union ccb) - sizeof(struct ccb_hdr)); + + flags = MMC_RSP_R5 | MMC_CMD_AC; + arg = SD_IO_RW_FUNC(func_number) | SD_IO_RW_ADR(addr); + if (is_write) + arg |= SD_IO_RW_WR | SD_IO_RW_RAW | SD_IO_RW_DAT(*data); + + cam_fill_mmcio(&ccb->mmcio, + /*retries*/ 0, + /*cbfcnp*/ NULL, + /*flags*/ CAM_DIR_NONE, + /*mmc_opcode*/ SD_IO_RW_DIRECT, + /*mmc_arg*/ arg, + /*mmc_flags*/ flags, + /*mmc_data*/ 0, + /*timeout*/ 5000); + + if (((retval = cam_send_ccb(dev, ccb)) < 0) + || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + const char warnstr[] = "error sending command"; + + if (retval < 0) + warn(warnstr); + else + warnx(warnstr); + return (-1); + } + + *resp = ccb->mmcio.cmd.resp[0] & 0xFF; + cam_freeccb(ccb); + return (retval); +} + +/* + * CMD53 -- IO_RW_EXTENDED + * Use to read or write memory blocks + * + * is_increment=1: FIFO mode + * blk_count > 0: block mode + */ +int +sdio_rw_extended(struct cam_device *dev, + uint8_t func_number, + uint32_t addr, + uint8_t is_write, + caddr_t data, size_t datalen, + uint8_t is_increment, + uint16_t blk_count) { + union ccb *ccb; + uint32_t flags; + uint32_t arg; + uint32_t cam_flags; + uint8_t resp; + struct mmc_data mmcd; + int retval = 0; + + if (blk_count != 0) { + warnx("%s: block mode is not supported yet", __func__); + return (-1); + } + + ccb = cam_getccb(dev); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + return (-1); + } + bzero(&(&ccb->ccb_h)[1], + sizeof(union ccb) - sizeof(struct ccb_hdr)); + + flags = MMC_RSP_R5 | MMC_CMD_ADTC; + arg = SD_IO_RW_FUNC(func_number) | SD_IO_RW_ADR(addr) | + SD_IOE_RW_LEN(datalen); + + if (is_increment) + arg |= SD_IO_RW_INCR; + + mmcd.data = data; + mmcd.len = datalen; + mmcd.xfer_len = 0; /* not used by MMCCAM */ + mmcd.mrq = NULL; /* not used by MMCCAM */ + + if (is_write) { + arg |= SD_IO_RW_WR; + cam_flags = CAM_DIR_OUT; + mmcd.flags = MMC_DATA_WRITE; + } else { + cam_flags = CAM_DIR_IN; + mmcd.flags = MMC_DATA_READ; + } + cam_fill_mmcio(&ccb->mmcio, + /*retries*/ 0, + /*cbfcnp*/ NULL, + /*flags*/ cam_flags, + /*mmc_opcode*/ SD_IO_RW_EXTENDED, + /*mmc_arg*/ arg, + /*mmc_flags*/ flags, + /*mmc_data*/ &mmcd, + /*timeout*/ 5000); + + if (((retval = cam_send_ccb(dev, ccb)) < 0) + || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + const char warnstr[] = "error sending command"; + + if (retval < 0) + warn(warnstr); + else + warnx(warnstr); + return (-1); + } + + resp = ccb->mmcio.cmd.resp[0] & 0xFF; + if (resp != 0) + warn("Response from CMD53 is not 0?!"); + cam_freeccb(ccb); + return (retval); +} + + +int +sdio_read_bool_for_func(struct cam_device *dev, uint32_t addr, uint8_t func_number, uint8_t *is_enab) { + uint8_t resp; + int ret; + + ret = sdio_rw_direct(dev, 0, addr, 0, NULL, &resp); + if (ret < 0) + return ret; + + *is_enab = (resp & (1 << func_number)) > 0 ? 1 : 0; + + return (0); +} + +int +sdio_set_bool_for_func(struct cam_device *dev, uint32_t addr, uint8_t func_number, int enable) { + uint8_t resp; + int ret; + uint8_t is_enabled; + + ret = sdio_rw_direct(dev, 0, addr, 0, NULL, &resp); + if (ret != 0) + return ret; + + is_enabled = resp & (1 << func_number); + if ((is_enabled !=0 && enable == 1) || (is_enabled == 0 && enable == 0)) + return 0; + + if (enable) + resp |= 1 << func_number; + else + resp &= ~ (1 << func_number); + + ret = sdio_rw_direct(dev, 0, addr, 1, &resp, &resp); + + return ret; +} + +/* Conventional I/O functions */ +uint8_t +sdio_read_1(struct cam_device *dev, uint8_t func_number, uint32_t addr, int *ret) { + uint8_t val; + *ret = sdio_rw_direct(dev, func_number, addr, 0, NULL, &val); + return val; +} + +int +sdio_write_1(struct cam_device *dev, uint8_t func_number, uint32_t addr, uint8_t val) { + uint8_t _val; + return sdio_rw_direct(dev, func_number, addr, 0, &val, &_val); +} + +uint16_t +sdio_read_2(struct cam_device *dev, uint8_t func_number, uint32_t addr, int *ret) { + uint16_t val; + *ret = sdio_rw_extended(dev, func_number, addr, + /* is_write */ 0, + /* data */ (caddr_t) &val, + /* datalen */ sizeof(val), + /* is_increment */ 1, + /* blk_count */ 0 + ); + return val; +} + + +int +sdio_write_2(struct cam_device *dev, uint8_t func_number, uint32_t addr, uint16_t val) { + return sdio_rw_extended(dev, func_number, addr, + /* is_write */ 1, + /* data */ (caddr_t) &val, + /* datalen */ sizeof(val), + /* is_increment */ 1, + /* blk_count */ 0 + ); +} + +uint32_t +sdio_read_4(struct cam_device *dev, uint8_t func_number, uint32_t addr, int *ret) { + uint32_t val; + *ret = sdio_rw_extended(dev, func_number, addr, + /* is_write */ 0, + /* data */ (caddr_t) &val, + /* datalen */ sizeof(val), + /* is_increment */ 1, + /* blk_count */ 0 + ); + return val; +} + + +int +sdio_write_4(struct cam_device *dev, uint8_t func_number, uint32_t addr, uint32_t val) { + return sdio_rw_extended(dev, func_number, addr, + /* is_write */ 1, + /* data */ (caddr_t) &val, + /* datalen */ sizeof(val), + /* is_increment */ 1, + /* blk_count */ 0 + ); +} + +/* Higher-level wrappers for certain management operations */ +int +sdio_is_func_ready(struct cam_device *dev, uint8_t func_number, uint8_t *is_enab) { + return sdio_read_bool_for_func(dev, SD_IO_CCCR_FN_READY, func_number, is_enab); +} + +int +sdio_is_func_enabled(struct cam_device *dev, uint8_t func_number, uint8_t *is_enab) { + return sdio_read_bool_for_func(dev, SD_IO_CCCR_FN_ENABLE, func_number, is_enab); +} + +int +sdio_func_enable(struct cam_device *dev, uint8_t func_number, int enable) { + return sdio_set_bool_for_func(dev, SD_IO_CCCR_FN_ENABLE, func_number, enable); +} + +int +sdio_is_func_intr_enabled(struct cam_device *dev, uint8_t func_number, uint8_t *is_enab) { + return sdio_read_bool_for_func(dev, SD_IO_CCCR_INT_ENABLE, func_number, is_enab); +} + +int +sdio_func_intr_enable(struct cam_device *dev, uint8_t func_number, int enable) { + return sdio_set_bool_for_func(dev, SD_IO_CCCR_INT_ENABLE, func_number, enable); +} + +int +sdio_card_set_bus_width(struct cam_device *dev, enum mmc_bus_width bw) { + int ret; + uint8_t ctl_val; + ret = sdio_rw_direct(dev, 0, SD_IO_CCCR_BUS_WIDTH, 0, NULL, &ctl_val); + if (ret < 0) { + warn("Error getting CCCR_BUS_WIDTH value"); + return ret; + } + ctl_val &= ~0x3; + switch (bw) { + case bus_width_1: + /* Already set to 1-bit */ + break; + case bus_width_4: + ctl_val |= CCCR_BUS_WIDTH_4; + break; + case bus_width_8: + warn("Cannot do 8-bit on SDIO yet"); + return -1; + break; + } + ret = sdio_rw_direct(dev, 0, SD_IO_CCCR_BUS_WIDTH, 1, &ctl_val, &ctl_val); + if (ret < 0) { + warn("Error setting CCCR_BUS_WIDTH value"); + return ret; + } + return ret; +} + +int +sdio_func_read_cis(struct cam_device *dev, uint8_t func_number, + uint32_t cis_addr, struct cis_info *info) { + uint8_t tuple_id, tuple_len, tuple_count; + uint32_t addr; + + char *cis1_info[4]; + int start, i, ch, count, ret; + char cis1_info_buf[256]; + + tuple_count = 0; /* Use to prevent infinite loop in case of parse errors */ + memset(cis1_info_buf, 0, 256); + do { + addr = cis_addr; + tuple_id = sdio_read_1(dev, 0, addr++, &ret); + if (tuple_id == SD_IO_CISTPL_END) + break; + if (tuple_id == 0) { + cis_addr++; + continue; + } + tuple_len = sdio_read_1(dev, 0, addr++, &ret); + if (tuple_len == 0 && tuple_id != 0x00) { + warn("Parse error: 0-length tuple %02X\n", tuple_id); + return -1; + } + + switch (tuple_id) { + case SD_IO_CISTPL_VERS_1: + addr += 2; + for (count = 0, start = 0, i = 0; + (count < 4) && ((i + 4) < 256); i++) { + ch = sdio_read_1(dev, 0, addr + i, &ret); + printf("count=%d, start=%d, i=%d, Got %c (0x%02x)\n", count, start, i, ch, ch); + if (ch == 0xff) + break; + cis1_info_buf[i] = ch; + if (ch == 0) { + cis1_info[count] = + cis1_info_buf + start; + start = i + 1; + count++; + } + } + printf("Card info:"); + for (i=0; i<4; i++) + if (cis1_info[i]) + printf(" %s", cis1_info[i]); + printf("\n"); + break; + case SD_IO_CISTPL_MANFID: + info->man_id = sdio_read_1(dev, 0, addr++, &ret); + info->man_id |= sdio_read_1(dev, 0, addr++, &ret) << 8; + + info->prod_id = sdio_read_1(dev, 0, addr++, &ret); + info->prod_id |= sdio_read_1(dev, 0, addr++, &ret) << 8; + break; + case SD_IO_CISTPL_FUNCID: + /* not sure if we need to parse it? */ + break; + case SD_IO_CISTPL_FUNCE: + if (tuple_len < 4) { + printf("FUNCE is too short: %d\n", tuple_len); + break; + } + if (func_number == 0) { + /* skip extended_data */ + addr++; + info->max_block_size = sdio_read_1(dev, 0, addr++, &ret); + info->max_block_size |= sdio_read_1(dev, 0, addr++, &ret) << 8; + } else { + info->max_block_size = sdio_read_1(dev, 0, addr + 0xC, &ret); + info->max_block_size |= sdio_read_1(dev, 0, addr + 0xD, &ret) << 8; + } + break; + default: + warnx("Skipping tuple ID %02X len %02X\n", tuple_id, tuple_len); + } + cis_addr += tuple_len + 2; + tuple_count++; + } while (tuple_count < 20); + + return 0; +} + +uint32_t +sdio_get_common_cis_addr(struct cam_device *dev) { + uint32_t addr; + int ret; + + addr = sdio_read_1(dev, 0, SD_IO_CCCR_CISPTR, &ret); + addr |= sdio_read_1(dev, 0, SD_IO_CCCR_CISPTR + 1, &ret) << 8; + addr |= sdio_read_1(dev, 0, SD_IO_CCCR_CISPTR + 2, &ret) << 16; + + if (addr < SD_IO_CIS_START || addr > SD_IO_CIS_START + SD_IO_CIS_SIZE) { + warn("Bad CIS address: %04X\n", addr); + addr = 0; + } + + return addr; +} + +void sdio_card_reset(struct cam_device *dev) { + int ret; + uint8_t ctl_val; + ret = sdio_rw_direct(dev, 0, SD_IO_CCCR_CTL, 0, NULL, &ctl_val); + if (ret < 0) + errx(1, "Error getting CCCR_CTL value"); + ctl_val |= CCCR_CTL_RES; + ret = sdio_rw_direct(dev, 0, SD_IO_CCCR_CTL, 1, &ctl_val, &ctl_val); + if (ret < 0) + errx(1, "Error setting CCCR_CTL value"); +} Added: head/usr.bin/sdiotool/cam_sdio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiotool/cam_sdio.h Mon Sep 18 20:01:01 2017 (r323717) @@ -0,0 +1,95 @@ +/*- + * Copyright (c) 2017 Ilya Bakulin + * 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$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +struct cis_info { + uint16_t man_id; + uint16_t prod_id; + uint16_t max_block_size; +}; + +int sdio_rw_direct(struct cam_device *dev, + uint8_t func_number, + uint32_t addr, + uint8_t is_write, + uint8_t *data, + uint8_t *resp); +int +sdio_rw_extended(struct cam_device *dev, + uint8_t func_number, + uint32_t addr, + uint8_t is_write, + caddr_t data, size_t datalen, + uint8_t is_increment, + uint16_t blk_count); +uint8_t sdio_read_1(struct cam_device *dev, uint8_t func_number, uint32_t addr, int *ret); +int sdio_write_1(struct cam_device *dev, uint8_t func_number, uint32_t addr, uint8_t val); +uint16_t sdio_read_2(struct cam_device *dev, uint8_t func_number, uint32_t addr, int *ret); +int sdio_write_2(struct cam_device *dev, uint8_t func_number, uint32_t addr, uint16_t val); +uint32_t sdio_read_4(struct cam_device *dev, uint8_t func_number, uint32_t addr, int *ret); +int sdio_write_4(struct cam_device *dev, uint8_t func_number, uint32_t addr, uint32_t val); +int sdio_read_bool_for_func(struct cam_device *dev, uint32_t addr, uint8_t func_number, uint8_t *is_enab); +int sdio_set_bool_for_func(struct cam_device *dev, uint32_t addr, uint8_t func_number, int enable); +int sdio_is_func_ready(struct cam_device *dev, uint8_t func_number, uint8_t *is_enab); +int sdio_is_func_enabled(struct cam_device *dev, uint8_t func_number, uint8_t *is_enab); +int sdio_func_enable(struct cam_device *dev, uint8_t func_number, int enable); +int sdio_is_func_intr_enabled(struct cam_device *dev, uint8_t func_number, uint8_t *is_enab); +int sdio_func_intr_enable(struct cam_device *dev, uint8_t func_number, int enable); +void sdio_card_reset(struct cam_device *dev); +uint32_t sdio_get_common_cis_addr(struct cam_device *dev); +int sdio_func_read_cis(struct cam_device *dev, uint8_t func_number, + uint32_t cis_addr, struct cis_info *info); +int sdio_card_set_bus_width(struct cam_device *dev, enum mmc_bus_width bw); Added: head/usr.bin/sdiotool/linux_compat.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiotool/linux_compat.h Mon Sep 18 20:01:01 2017 (r323717) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2016-2017 Ilya Bakulin + * 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$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#ifndef _LINUX_COMPAT_H_ +#define _LINUX_COMPAT_H_ + +/* Linux compatibility shims */ +#define uint unsigned int +#define u32 uint32_t +#define u8 uint8_t +#define u16 uint16_t +#define s32 int32_t +#define bool int8_t +#define true 1 +#define false 0 + +#define usleep_range(a, b) usleep(a) +#define ENOMEDIUM -1 +#define EINVAL -2 + +#define WARN_ON(cond) ({ \ + bool __ret = (cond); \ + if (__ret) { \ + printf("WARNING %s failed at %s:%d\n", \ + #cond, __FILE__, __LINE__); \ + } \ + (__ret); \ +}) + +#endif Added: head/usr.bin/sdiotool/linux_sdio_compat.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiotool/linux_sdio_compat.c Mon Sep 18 20:01:01 2017 (r323717) @@ -0,0 +1,104 @@ +/*- + * Copyright (c) 2016-2017 Ilya Bakulin + * 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$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "linux_compat.h" +#include "linux_sdio_compat.h" +#include "cam_sdio.h" + +u8 sdio_readb(struct sdio_func *func, unsigned int addr, int *err_ret) { + return sdio_read_1(func->dev, func->num, addr, err_ret); +} + +unsigned char sdio_f0_readb(struct sdio_func *func, unsigned int addr, int *err_ret) { + return sdio_readb(func, addr, err_ret); +} + +u16 sdio_readw(struct sdio_func *func, unsigned int addr, int *err_ret) { + return sdio_read_2(func->dev, func->num, addr, err_ret); +} + +u32 sdio_readl(struct sdio_func *func, unsigned int addr, int *err_ret) { + return sdio_read_4(func->dev, func->num, addr, err_ret); +} + +void sdio_writeb(struct sdio_func *func, u8 b, + unsigned int addr, int *err_ret) { + *err_ret = sdio_write_1(func->dev, func->num, addr, b); +} + +/* Only writes to the vendor specific CCCR registers + * (0xF0 - 0xFF) are permiited. */ +void sdio_f0_writeb(struct sdio_func *func, unsigned char b, + unsigned int addr, int *err_ret) +{ + if (addr < 0xF0 || addr > 0xFF) { + if (err_ret) + *err_ret = -EINVAL; + return; + } + sdio_writeb(func, b, addr, err_ret); +} + +void sdio_writew(struct sdio_func *func, u16 b, + unsigned int addr, int *err_ret) { + *err_ret = sdio_write_2(func->dev, func->num, addr, b); +} + +void sdio_writel(struct sdio_func *func, u32 b, + unsigned int addr, int *err_ret) { + *err_ret = sdio_write_4(func->dev, func->num, addr, b); +} Added: head/usr.bin/sdiotool/linux_sdio_compat.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiotool/linux_sdio_compat.h Mon Sep 18 20:01:01 2017 (r323717) @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2017 Ilya Bakulin + * 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$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#ifndef _LINUX_SDIO_COMPAT_H_ +#define _LINUX_SDIO_COMPAT_H_ + +#include +#include "linux_compat.h" + +/* Linux SDIO stack functions and definitions */ +#define SDIO_CCCR_ABORT SD_IO_CCCR_CTL +#define SDIO_CCCR_IENx SD_IO_CCCR_INT_ENABLE + +struct sdio_func { + struct cam_device *dev; + uint8_t num; +}; + +u8 sdio_readb(struct sdio_func *func, unsigned int addr, int *err_ret); +unsigned char sdio_f0_readb(struct sdio_func *func, + unsigned int addr, int *err_ret); +u16 sdio_readw(struct sdio_func *func, unsigned int addr, int *err_ret); +u32 sdio_readl(struct sdio_func *func, unsigned int addr, int *err_ret); + +void sdio_writeb(struct sdio_func *func, u8 b, + unsigned int addr, int *err_ret); +void sdio_f0_writeb(struct sdio_func *func, unsigned char b, + unsigned int addr, int *err_ret); +void sdio_writew(struct sdio_func *func, u16 b, + unsigned int addr, int *err_ret); +void sdio_writel(struct sdio_func *func, u32 b, + unsigned int addr, int *err_ret); + + +#endif Modified: head/usr.bin/sdiotool/sdiotool.c ============================================================================== --- head/usr.bin/sdiotool/sdiotool.c Mon Sep 18 19:56:05 2017 (r323716) +++ head/usr.bin/sdiotool/sdiotool.c Mon Sep 18 20:01:01 2017 (r323717) @@ -23,6 +23,20 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * Copyright (c) 2010 Broadcom Corporation + * + * Permission to use, copy, modify, and/or 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. + * * $FreeBSD$ */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Sep 18 20:17:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EB2DE04450; Mon, 18 Sep 2017 20:17:09 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CB4D7E582; Mon, 18 Sep 2017 20:17:09 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8IKH8C4034061; Mon, 18 Sep 2017 20:17:08 GMT (envelope-from kibab@FreeBSD.org) Received: (from kibab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8IKH8aB034060; Mon, 18 Sep 2017 20:17:08 GMT (envelope-from kibab@FreeBSD.org) Message-Id: <201709182017.v8IKH8aB034060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kibab set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin Date: Mon, 18 Sep 2017 20:17:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323721 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: kibab X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 323721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 20:17:09 -0000 Author: kibab Date: Mon Sep 18 20:17:08 2017 New Revision: 323721 URL: https://svnweb.freebsd.org/changeset/base/323721 Log: Add kern.features flag for MMCCAM kern.features.mmcam will be present and equal to 1 if the kernel has been compiled with option MMCCAM. This will help sdio-related userland tools to fail-fast if running on the kernel without MMCCAM enabled. Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D12386 Modified: head/sys/cam/mmc/mmc_xpt.c Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Mon Sep 18 20:09:17 2017 (r323720) +++ head/sys/cam/mmc/mmc_xpt.c Mon Sep 18 20:17:08 2017 (r323721) @@ -63,6 +63,8 @@ __FBSDID("$FreeBSD$"); #include /* for PRIu64 */ #include "opt_cam.h" +FEATURE(mmccam, "CAM-based MMC/SD/SDIO stack"); + static struct cam_ed * mmc_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id); static void mmc_dev_async(u_int32_t async_code, struct cam_eb *bus, From owner-svn-src-head@freebsd.org Mon Sep 18 20:22:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 903C2E04A8E; Mon, 18 Sep 2017 20:22:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 593F27EA1D; Mon, 18 Sep 2017 20:22:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8IKMhsN038057; Mon, 18 Sep 2017 20:22:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8IKMgIR038048; Mon, 18 Sep 2017 20:22:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709182022.v8IKMgIR038048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 18 Sep 2017 20:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323722 - in head/sys: i386/i386 i386/include i386/isa kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: i386/i386 i386/include i386/isa kern X-SVN-Commit-Revision: 323722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 20:22:44 -0000 Author: kib Date: Mon Sep 18 20:22:42 2017 New Revision: 323722 URL: https://svnweb.freebsd.org/changeset/base/323722 Log: Fix handling of the segment registers on i386. Suppose that userspace is executing with the non-standard segment descriptors. Then, until exception or interrupt handler executed SET_KERNEL_SEGS, kernel is still executing with user %ds, %es and %fs. If an interrupt occurs in this window, the interrupt handler is executed unsafely, relying on usability of the usermode registers. If the interrupt results in the context switch on return, the contamination of the kernel state spreads to the thread we switched to. As result, kernel data accesses might fault or, if only the base is changed, completely messed up. More, if the user segment was allocated in LDT, another thread might mark the descriptor as invalid before doreti code tried to reload them. In this case kernel panics. The issue exists for all exception entry points which use trap gate, and thus do not automatically disable interrupts on entry, and for lcall_handler. Fix is two-fold: first, we need to disable interrupts for all kernel entries, changing the IDT descriptor types from trap gate to interrupt gate. Interrupts are re-enabled not earlier than the kernel segments are loaded into the segment registers. Second, we only load the segment registers from the trap frame when returning to usermode. For the later, all interrupt return paths must happen through the doreti common code. There is no way to disable interrupts on call gate, which is the supposed mode of servicing for lcall $7,$0 syscalls. Change the LDT descriptor 0 into a code segment type and point it to the userspace trampoline which redirects the syscall to int $0x80. All the measures make the segment register handling similar to that of amd64. We do not apply amd64 optimizations of not reloading segment registers on return from the syscall. Reported by: Maxime Villard Tested by: pho (the non-lcall part) Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D12402 Modified: head/sys/i386/i386/apic_vector.s head/sys/i386/i386/db_trace.c head/sys/i386/i386/exception.s head/sys/i386/i386/locore.s head/sys/i386/i386/machdep.c head/sys/i386/i386/trap.c head/sys/i386/include/md_var.h head/sys/i386/isa/npx.c head/sys/kern/imgact_aout.c Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Mon Sep 18 20:17:08 2017 (r323721) +++ head/sys/i386/i386/apic_vector.s Mon Sep 18 20:22:42 2017 (r323722) @@ -189,8 +189,7 @@ IDTVEC(xen_intr_upcall) SUPERALIGN_TEXT invltlb_ret: call as_lapic_eoi - POP_FRAME - iret + jmp doreti SUPERALIGN_TEXT IDTVEC(invltlb) @@ -274,10 +273,8 @@ IDTVEC(cpustop) call as_lapic_eoi call cpustop_handler + jmp doreti - POP_FRAME - iret - /* * Executed by a CPU when it receives an IPI_SUSPEND from another CPU. */ @@ -290,10 +287,8 @@ IDTVEC(cpususpend) call as_lapic_eoi call cpususpend_handler + jmp doreti - POP_FRAME - jmp doreti_iret - /* * Executed by a CPU when it receives a RENDEZVOUS IPI from another CPU. * @@ -314,7 +309,6 @@ IDTVEC(rendezvous) call smp_rendezvous_action call as_lapic_eoi - POP_FRAME - iret + jmp doreti #endif /* SMP */ Modified: head/sys/i386/i386/db_trace.c ============================================================================== --- head/sys/i386/i386/db_trace.c Mon Sep 18 20:17:08 2017 (r323721) +++ head/sys/i386/i386/db_trace.c Mon Sep 18 20:22:42 2017 (r323722) @@ -326,8 +326,7 @@ db_nextframe(struct i386_frame **fp, db_addr_t *ip, st else if (strncmp(name, "Xatpic_intr", 11) == 0 || strncmp(name, "Xapic_isr", 9) == 0) frame_type = INTERRUPT; - else if (strcmp(name, "Xlcall_syscall") == 0 || - strcmp(name, "Xint0x80_syscall") == 0) + else if (strcmp(name, "Xint0x80_syscall") == 0) frame_type = SYSCALL; else if (strcmp(name, "dblfault_handler") == 0) frame_type = DOUBLE_FAULT; Modified: head/sys/i386/i386/exception.s ============================================================================== --- head/sys/i386/i386/exception.s Mon Sep 18 20:17:08 2017 (r323721) +++ head/sys/i386/i386/exception.s Mon Sep 18 20:22:42 2017 (r323722) @@ -98,15 +98,16 @@ MCOUNT_LABEL(user) MCOUNT_LABEL(btrap) #define TRAP(a) pushl $(a) ; jmp alltraps +#define TRAP_NOEN(a) pushl $(a) ; jmp alltraps_noen IDTVEC(div) pushl $0; TRAP(T_DIVIDE) IDTVEC(dbg) - pushl $0; TRAP(T_TRCTRAP) + pushl $0; TRAP_NOEN(T_TRCTRAP) IDTVEC(nmi) - pushl $0; TRAP(T_NMI) + pushl $0; TRAP_NOEN(T_NMI) IDTVEC(bpt) - pushl $0; TRAP(T_BPTFLT) + pushl $0; TRAP_NOEN(T_BPTFLT) IDTVEC(dtrace_ret) pushl $0; TRAP(T_DTRACE_RET) IDTVEC(ofl) @@ -130,7 +131,7 @@ IDTVEC(stk) IDTVEC(prot) TRAP(T_PROTFLT) IDTVEC(page) - TRAP(T_PAGEFLT) + TRAP_NOEN(T_PAGEFLT) IDTVEC(mchk) pushl $0; TRAP(T_MCHK) IDTVEC(rsvd) @@ -142,6 +143,21 @@ IDTVEC(align) IDTVEC(xmm) pushl $0; TRAP(T_XMMFLT) + SUPERALIGN_TEXT + .globl alltraps_noen +alltraps_noen: + pushal + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) + SET_KERNEL_SREGS + cld + FAKE_MCOUNT(TF_EIP(%esp)) + jmp calltrap + /* * All traps except ones for syscalls jump to alltraps. If * interrupts were enabled when the trap occurred, then interrupts @@ -164,6 +180,7 @@ alltraps: movw %fs,(%esp) alltraps_with_regs_pushed: SET_KERNEL_SREGS + sti cld FAKE_MCOUNT(TF_EIP(%esp)) calltrap: @@ -225,40 +242,6 @@ norm_ill: #endif /* - * Call gate entry for syscalls (lcall 7,0). - * This is used by FreeBSD 1.x a.out executables and "old" NetBSD executables. - * - * The intersegment call has been set up to specify one dummy parameter. - * This leaves a place to put eflags so that the call frame can be - * converted to a trap frame. Note that the eflags is (semi-)bogusly - * pushed into (what will be) tf_err and then copied later into the - * final spot. It has to be done this way because esp can't be just - * temporarily altered for the pushfl - an interrupt might come in - * and clobber the saved cs/eip. - */ - SUPERALIGN_TEXT -IDTVEC(lcall_syscall) - pushfl /* save eflags */ - popl 8(%esp) /* shuffle into tf_eflags */ - pushl $7 /* sizeof "lcall 7,0" */ - pushl $0 /* tf_trapno */ - pushal - pushl $0 - movw %ds,(%esp) - pushl $0 - movw %es,(%esp) - pushl $0 - movw %fs,(%esp) - SET_KERNEL_SREGS - cld - FAKE_MCOUNT(TF_EIP(%esp)) - pushl %esp - call syscall - add $4, %esp - MEXITCOUNT - jmp doreti - -/* * Trap gate entry for syscalls (int 0x80). * This is used by FreeBSD ELF executables, "new" NetBSD executables, and all * Linux executables. @@ -279,6 +262,7 @@ IDTVEC(int0x80_syscall) pushl $0 movw %fs,(%esp) SET_KERNEL_SREGS + sti cld FAKE_MCOUNT(TF_EIP(%esp)) pushl %esp @@ -362,7 +346,7 @@ doreti_next: #ifdef HWPMC_HOOKS je doreti_nmi #else - je doreti_exit + je doreti_notvm86 #endif /* * PSL_VM must be checked first since segment registers only @@ -378,7 +362,7 @@ doreti_next: doreti_notvm86: testb $SEL_RPL_MASK,TF_CS(%esp) /* are we returning to user mode? */ - jz doreti_exit /* can't handle ASTs now if not */ + jz doreti_nosegs /* can't handle ASTs now if not */ doreti_ast: /* @@ -415,6 +399,12 @@ doreti_popl_es: .globl doreti_popl_ds doreti_popl_ds: popl %ds + jmp doreti_iret_popal + +doreti_nosegs: + MEXITCOUNT + addl $12,%esp +doreti_iret_popal: popal addl $8,%esp .globl doreti_iret @@ -457,7 +447,7 @@ doreti_nmi: * needs a user call chain capture. */ testb $SEL_RPL_MASK,TF_CS(%esp) - jz doreti_exit + jz doreti_nosegs movl PCPU(CURTHREAD),%eax /* curthread present? */ orl %eax,%eax jz doreti_exit Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Mon Sep 18 20:17:08 2017 (r323721) +++ head/sys/i386/i386/locore.s Mon Sep 18 20:22:42 2017 (r323722) @@ -335,6 +335,44 @@ osigcode: pushl %eax /* junk to fake return addr. */ int $0x80 /* enter kernel with args */ 0: jmp 0b + +/* + * The lcall $7,$0 handler cannot use the call gate that does an + * inter-privilege transition. The reason is that the call gate + * does not disable interrupts, and, before the kernel segment registers + * are loaded, we would have a window where the ring 0 code is + * executed with the wrong segments. + * + * Instead, set LDT descriptor 0 as code segment, which reflects + * the lcall $7,$0 back to ring 3 trampoline. The trampoline sets up + * the frame for int $0x80. + */ + ALIGN_TEXT +lcall_tramp: + cmpl $SYS_vfork,%eax + je 1f + pushl %ebp + movl %esp,%ebp + pushl 0x24(%ebp) /* arg 6 */ + pushl 0x20(%ebp) + pushl 0x1c(%ebp) + pushl 0x18(%ebp) + pushl 0x14(%ebp) + pushl 0x10(%ebp) /* arg 1 */ + subl $4,%esp /* gap */ + int $0x80 + leavel + lretl +1: + /* + * vfork handling is special and relies on the libc stub saving + * the return ip in %ecx. Also, we assume that the call was done + * with ucode32 selector in %cs. + */ + int $0x80 + movl $0x33,4(%esp) /* GUCODE32_SEL | SEL_UPL */ + movl %ecx,(%esp) + lretl #endif /* COMPAT_43 */ ALIGN_TEXT @@ -353,6 +391,9 @@ szfreebsd4_sigcode: .globl szosigcode szosigcode: .long esigcode-osigcode + .globl szlcallcode +szlcallcode: + .long esigcode-lcall_tramp #endif .text Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Sep 18 20:17:08 2017 (r323721) +++ head/sys/i386/i386/machdep.c Mon Sep 18 20:22:42 2017 (r323722) @@ -1513,7 +1513,7 @@ extern inthand_t #ifdef XENHVM IDTVEC(xen_intr_upcall), #endif - IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); + IDTVEC(int0x80_syscall); #ifdef DDB /* @@ -2157,7 +2157,9 @@ i386_kdb_init(void) register_t init386(int first) { - struct gate_descriptor *gdp; +#ifdef COMPAT_43 + struct segment_descriptor *gdp; +#endif int gsel_tss, metadata_missing, x, pa; struct pcpu *pc; struct xstate_hdr *xhdr; @@ -2246,9 +2248,9 @@ init386(int first) /* exceptions */ for (x = 0; x < NIDT; x++) - setidt(x, &IDTVEC(rsvd), SDT_SYS386TGT, SEL_KPL, + setidt(x, &IDTVEC(rsvd), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_DE, &IDTVEC(div), SDT_SYS386TGT, SEL_KPL, + setidt(IDT_DE, &IDTVEC(div), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_DB, &IDTVEC(dbg), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); @@ -2256,39 +2258,39 @@ init386(int first) GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_BP, &IDTVEC(bpt), SDT_SYS386IGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_OF, &IDTVEC(ofl), SDT_SYS386TGT, SEL_UPL, + setidt(IDT_OF, &IDTVEC(ofl), SDT_SYS386IGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_BR, &IDTVEC(bnd), SDT_SYS386TGT, SEL_KPL, + setidt(IDT_BR, &IDTVEC(bnd), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_UD, &IDTVEC(ill), SDT_SYS386TGT, SEL_KPL, + setidt(IDT_UD, &IDTVEC(ill), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_NM, &IDTVEC(dna), SDT_SYS386TGT, SEL_KPL + setidt(IDT_NM, &IDTVEC(dna), SDT_SYS386IGT, SEL_KPL , GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_DF, 0, SDT_SYSTASKGT, SEL_KPL, GSEL(GPANIC_SEL, SEL_KPL)); - setidt(IDT_FPUGP, &IDTVEC(fpusegm), SDT_SYS386TGT, SEL_KPL, + setidt(IDT_FPUGP, &IDTVEC(fpusegm), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_TS, &IDTVEC(tss), SDT_SYS386TGT, SEL_KPL, + setidt(IDT_TS, &IDTVEC(tss), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_NP, &IDTVEC(missing), SDT_SYS386TGT, SEL_KPL, + setidt(IDT_NP, &IDTVEC(missing), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_SS, &IDTVEC(stk), SDT_SYS386TGT, SEL_KPL, + setidt(IDT_SS, &IDTVEC(stk), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_GP, &IDTVEC(prot), SDT_SYS386TGT, SEL_KPL, + setidt(IDT_GP, &IDTVEC(prot), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_PF, &IDTVEC(page), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_MF, &IDTVEC(fpu), SDT_SYS386TGT, SEL_KPL, + setidt(IDT_MF, &IDTVEC(fpu), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_AC, &IDTVEC(align), SDT_SYS386TGT, SEL_KPL, + setidt(IDT_AC, &IDTVEC(align), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_MC, &IDTVEC(mchk), SDT_SYS386TGT, SEL_KPL, + setidt(IDT_MC, &IDTVEC(mchk), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_XF, &IDTVEC(xmm), SDT_SYS386TGT, SEL_KPL, + setidt(IDT_XF, &IDTVEC(xmm), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_SYSCALL, &IDTVEC(int0x80_syscall), SDT_SYS386TGT, SEL_UPL, + setidt(IDT_SYSCALL, &IDTVEC(int0x80_syscall), SDT_SYS386IGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); #ifdef KDTRACE_HOOKS - setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYS386TGT, SEL_UPL, + setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYS386IGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); #endif #ifdef XENHVM @@ -2329,9 +2331,9 @@ init386(int first) clock_init(); finishidentcpu(); /* Final stage of CPU initialization */ - setidt(IDT_UD, &IDTVEC(ill), SDT_SYS386TGT, SEL_KPL, + setidt(IDT_UD, &IDTVEC(ill), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - setidt(IDT_GP, &IDTVEC(prot), SDT_SYS386TGT, SEL_KPL, + setidt(IDT_GP, &IDTVEC(prot), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); initializecpu(); /* Initialize CPU registers */ initializecpucache(); @@ -2436,17 +2438,21 @@ init386(int first) gdt[GPROC0_SEL].sd.sd_type = SDT_SYS386TSS; /* clear busy bit */ ltr(gsel_tss); - /* make a call gate to reenter kernel with */ - gdp = &ldt[LSYS5CALLS_SEL].gd; - - x = (int) &IDTVEC(lcall_syscall); - gdp->gd_looffset = x; - gdp->gd_selector = GSEL(GCODE_SEL,SEL_KPL); - gdp->gd_stkcpy = 1; - gdp->gd_type = SDT_SYS386CGT; - gdp->gd_dpl = SEL_UPL; - gdp->gd_p = 1; - gdp->gd_hioffset = x >> 16; +#ifdef COMPAT_43 + /* + * Make a code descriptor to emulate lcall $7,$0 with int + * $0x80. sd_hibase and sd_lobase are set after the sigtramp + * base in the shared table is known. + */ + gdp = &ldt[LSYS5CALLS_SEL].sd; + gdp->sd_type = SDT_MEMERA; + gdp->sd_dpl = SEL_UPL; + gdp->sd_p = 1; + gdp->sd_def32 = 1; + gdp->sd_gran = 1; + gdp->sd_lolimit = 0xffff; + gdp->sd_hilimit = 0xf; +#endif /* transfer to user mode */ Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Mon Sep 18 20:17:08 2017 (r323721) +++ head/sys/i386/i386/trap.c Mon Sep 18 20:22:42 2017 (r323722) @@ -114,8 +114,6 @@ static int trap_pfault(struct trapframe *, int, vm_off static void trap_fatal(struct trapframe *, vm_offset_t); void dblfault_handler(void); -extern inthand_t IDTVEC(lcall_syscall); - #define MAX_TRAP_MSG 32 static char *trap_msg[] = { "", /* 0 unused */ @@ -629,23 +627,6 @@ user_trctrap_out: case T_TRCTRAP: /* trace trap */ kernel_trctrap: - if (frame->tf_eip == (int)IDTVEC(lcall_syscall)) { - /* - * We've just entered system mode via the - * syscall lcall. Continue single stepping - * silently until the syscall handler has - * saved the flags. - */ - return; - } - if (frame->tf_eip == (int)IDTVEC(lcall_syscall) + 1) { - /* - * The syscall handler has now saved the - * flags. Stop single stepping it. - */ - frame->tf_eflags &= ~PSL_T; - return; - } /* * Ignore debug register trace traps due to * accesses in the user's address space, which Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Mon Sep 18 20:17:08 2017 (r323721) +++ head/sys/i386/include/md_var.h Mon Sep 18 20:22:42 2017 (r323722) @@ -43,6 +43,7 @@ extern int szfreebsd4_sigcode; #endif #ifdef COMPAT_43 extern int szosigcode; +extern int szlcallcode; #endif extern uint32_t *vm_page_dump; Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Mon Sep 18 20:17:08 2017 (r323721) +++ head/sys/i386/isa/npx.c Mon Sep 18 20:22:42 2017 (r323722) @@ -237,7 +237,7 @@ npx_probe(void) } save_idt_npxtrap = idt[IDT_MF]; - setidt(IDT_MF, probetrap, SDT_SYS386TGT, SEL_KPL, + setidt(IDT_MF, probetrap, SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); /* Modified: head/sys/kern/imgact_aout.c ============================================================================== --- head/sys/kern/imgact_aout.c Mon Sep 18 20:17:08 2017 (r323721) +++ head/sys/kern/imgact_aout.c Mon Sep 18 20:22:42 2017 (r323722) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #include #include #include @@ -337,3 +339,18 @@ exec_aout_imgact(struct image_params *imgp) */ static struct execsw aout_execsw = { exec_aout_imgact, "a.out" }; EXEC_SET(aout, aout_execsw); + +#if defined(__i386__) && defined(COMPAT_43) +static void +exec_init_lcall(void *arg __unused) +{ + struct segment_descriptor *gdp; + u_int lcall_addr; + + gdp = &ldt[LSYS5CALLS_SEL].sd; + lcall_addr = aout_sysvec.sv_psstrings - szlcallcode; + gdp->sd_hibase = lcall_addr >> 24; + gdp->sd_lobase = lcall_addr; +} +SYSINIT(aout, SI_SUB_EXEC + 1, SI_ORDER_ANY, exec_init_lcall, NULL); +#endif From owner-svn-src-head@freebsd.org Mon Sep 18 23:30:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD5DAE0F9F7; Mon, 18 Sep 2017 23:30:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B74F32D8; Mon, 18 Sep 2017 23:30:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8INUdSq011441; Mon, 18 Sep 2017 23:30:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8INUd0S011438; Mon, 18 Sep 2017 23:30:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201709182330.v8INUd0S011438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 18 Sep 2017 23:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323723 - in head/sys/ufs: ffs ufs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/ufs: ffs ufs X-SVN-Commit-Revision: 323723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 23:30:41 -0000 Author: jhb Date: Mon Sep 18 23:30:39 2017 New Revision: 323723 URL: https://svnweb.freebsd.org/changeset/base/323723 Log: Add UFS_LINK_MAX for the UFS-specific limit on link counts. ino64 expanded nlink_t to 64 bits, but the on-disk format for UFS is still limited to 16 bits. This is a nop currently but will matter if LINK_MAX is increased in the future. Reviewed by: kib Sponsored by: Chelsio Communications Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ufs/dinode.h head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Sep 18 20:22:42 2017 (r323722) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Sep 18 23:30:39 2017 (r323723) @@ -11532,7 +11532,7 @@ handle_written_inodeblock(inodedep, bp, flags) */ if (inodedep->id_savedsize == -1 || inodedep->id_savedextsize == -1) panic("handle_written_inodeblock: bad size"); - if (inodedep->id_savednlink > LINK_MAX) + if (inodedep->id_savednlink > UFS_LINK_MAX) panic("handle_written_inodeblock: Invalid link count " "%jd for inodedep %p", (uintmax_t)inodedep->id_savednlink, inodedep); Modified: head/sys/ufs/ufs/dinode.h ============================================================================== --- head/sys/ufs/ufs/dinode.h Mon Sep 18 20:22:42 2017 (r323722) +++ head/sys/ufs/ufs/dinode.h Mon Sep 18 23:30:39 2017 (r323723) @@ -186,4 +186,6 @@ struct ufs1_dinode { u_int64_t di_modrev; /* 120: i_modrev for NFSv4 */ }; +#define UFS_LINK_MAX 32767 + #endif /* _UFS_UFS_DINODE_H_ */ Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Mon Sep 18 20:22:42 2017 (r323722) +++ head/sys/ufs/ufs/ufs_vnops.c Mon Sep 18 23:30:39 2017 (r323723) @@ -981,7 +981,7 @@ ufs_link(ap) goto out; } ip = VTOI(vp); - if ((nlink_t)ip->i_nlink >= LINK_MAX) { + if (ip->i_nlink >= UFS_LINK_MAX) { error = EMLINK; goto out; } @@ -1266,7 +1266,7 @@ relock: doingdirectory = 0; newparent = 0; ino = fip->i_number; - if (fip->i_nlink >= LINK_MAX) { + if (fip->i_nlink >= UFS_LINK_MAX) { error = EMLINK; goto unlockout; } @@ -1369,7 +1369,7 @@ relock: * actual link modification is completed when * .. is rewritten below. */ - if ((nlink_t)tdp->i_nlink >= LINK_MAX) { + if (tdp->i_nlink >= UFS_LINK_MAX) { error = EMLINK; goto bad; } @@ -1793,7 +1793,7 @@ ufs_mkdir(ap) panic("ufs_mkdir: no name"); #endif dp = VTOI(dvp); - if ((nlink_t)dp->i_nlink >= LINK_MAX) { + if (dp->i_nlink >= UFS_LINK_MAX) { error = EMLINK; goto out; } @@ -2442,6 +2442,9 @@ ufs_pathconf(ap) error = 0; switch (ap->a_name) { + case _PC_LINK_MAX: + *ap->a_retval = UFS_LINK_MAX; + break; case _PC_NAME_MAX: *ap->a_retval = UFS_MAXNAMLEN; break; From owner-svn-src-head@freebsd.org Mon Sep 18 23:50:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19FA3E10D1B; Mon, 18 Sep 2017 23:50:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD232FAA; Mon, 18 Sep 2017 23:50:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8INoYIi019339; Mon, 18 Sep 2017 23:50:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8INoYoH019337; Mon, 18 Sep 2017 23:50:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201709182350.v8INoYoH019337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 18 Sep 2017 23:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323724 - in head/sys/dev/cxgbe: . firmware X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . firmware X-SVN-Commit-Revision: 323724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Sep 2017 23:50:36 -0000 Author: jhb Date: Mon Sep 18 23:50:34 2017 New Revision: 323724 URL: https://svnweb.freebsd.org/changeset/base/323724 Log: Enable support for lookaside crypto operations by default. This permits ccr(4) to be used with the default firmware configuration file. Discussed with: np Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/firmware/t6fw_cfg.txt head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/firmware/t6fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t6fw_cfg.txt Mon Sep 18 23:30:39 2017 (r323723) +++ head/sys/dev/cxgbe/firmware/t6fw_cfg.txt Mon Sep 18 23:50:34 2017 (r323724) @@ -153,6 +153,7 @@ nexactf = 456 cmask = all pmask = all + ncrypto_lookaside = 16 nclip = 320 # TCAM has 6K cells; each region must start at a multiple of 128 cell. @@ -162,7 +163,7 @@ nserver = 512 nhpfilter = 0 nhash = 16384 - protocol = ofld, rddp, rdmac, iscsi_initiator_pdu, iscsi_target_pdu, iscsi_t10dif + protocol = ofld, rddp, rdmac, iscsi_initiator_pdu, iscsi_target_pdu, iscsi_t10dif, crypto_lookaside tp_l2t = 4096 tp_ddp = 2 tp_ddp_iscsi = 2 @@ -272,7 +273,7 @@ [fini] version = 0x1 - checksum = 0xf438bb8f + checksum = 0x7191019f # # $FreeBSD$ # Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Sep 18 23:30:39 2017 (r323723) +++ head/sys/dev/cxgbe/t4_main.c Mon Sep 18 23:50:34 2017 (r323724) @@ -452,7 +452,7 @@ TUNABLE_INT("hw.cxgbe.toecaps_allowed", &t4_toecaps_al static int t4_rdmacaps_allowed = -1; TUNABLE_INT("hw.cxgbe.rdmacaps_allowed", &t4_rdmacaps_allowed); -static int t4_cryptocaps_allowed = 0; +static int t4_cryptocaps_allowed = -1; TUNABLE_INT("hw.cxgbe.cryptocaps_allowed", &t4_cryptocaps_allowed); static int t4_iscsicaps_allowed = -1; From owner-svn-src-head@freebsd.org Tue Sep 19 06:29:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8888DE25AAA; Tue, 19 Sep 2017 06:29:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51D156C50D; Tue, 19 Sep 2017 06:29:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8J6TcGW084667; Tue, 19 Sep 2017 06:29:38 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8J6Tcje084663; Tue, 19 Sep 2017 06:29:38 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201709190629.v8J6Tcje084663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 19 Sep 2017 06:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323727 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 323727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 06:29:39 -0000 Author: sephe Date: Tue Sep 19 06:29:38 2017 New Revision: 323727 URL: https://svnweb.freebsd.org/changeset/base/323727 Log: hyperv/hn: Apply VF's RSS setting Since in Azure SYN and SYN|ACK go through the synthetic parts while the rest of the same TCP flow goes through the VF, apply VF's RSS settings to synthetic parts to have a consistent hash value/type for the same TCP flow. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12333 Modified: head/sys/dev/hyperv/netvsc/hn_rndis.c head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/hyperv/netvsc/if_hnvar.h head/sys/dev/hyperv/netvsc/ndis.h Modified: head/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_rndis.c Tue Sep 19 05:48:53 2017 (r323726) +++ head/sys/dev/hyperv/netvsc/hn_rndis.c Tue Sep 19 06:29:38 2017 (r323727) @@ -502,7 +502,7 @@ hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_c /* Commit! */ sc->hn_rss_ind_size = indsz; - sc->hn_rss_hash = hash_func | hash_types; + sc->hn_rss_hcap = hash_func | hash_types; *rxr_cnt0 = rxr_cnt; return (0); } Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Tue Sep 19 05:48:53 2017 (r323726) +++ head/sys/dev/hyperv/netvsc/if_hn.c Tue Sep 19 06:29:38 2017 (r323727) @@ -284,6 +284,8 @@ static void hn_xpnt_vf_init_taskfunc(void *, int); static void hn_xpnt_vf_init(struct hn_softc *); static void hn_xpnt_vf_setenable(struct hn_softc *); static void hn_xpnt_vf_setdisable(struct hn_softc *, bool); +static void hn_vf_rss_fixup(struct hn_softc *, bool); +static void hn_vf_rss_restore(struct hn_softc *); static int hn_rndis_rxinfo(const void *, int, struct hn_rxinfo *); @@ -327,6 +329,8 @@ static int hn_rss_key_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rss_ind_sysctl(SYSCTL_HANDLER_ARGS); #endif static int hn_rss_hash_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_rss_hcap_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_rss_mbuf_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_size_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_pkts_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_pktmax_sysctl(SYSCTL_HANDLER_ARGS); @@ -386,8 +390,11 @@ static int hn_rxfilter_config(struct hn_softc *); static int hn_rss_reconfig(struct hn_softc *); #endif static void hn_rss_ind_fixup(struct hn_softc *); +static void hn_rss_mbuf_hash(struct hn_softc *, uint32_t); static int hn_rxpkt(struct hn_rx_ring *, const void *, int, const struct hn_rxinfo *); +static uint32_t hn_rss_type_fromndis(uint32_t); +static uint32_t hn_rss_type_tondis(uint32_t); static int hn_tx_ring_create(struct hn_softc *, int); static void hn_tx_ring_destroy(struct hn_tx_ring *); @@ -1134,11 +1141,13 @@ hn_rxvf_change(struct hn_softc *sc, struct ifnet *ifp, hn_rxvf_set(sc, rxvf ? ifp : NULL); if (rxvf) { + hn_vf_rss_fixup(sc, true); hn_suspend_mgmt(sc); sc->hn_link_flags &= ~(HN_LINK_FLAG_LINKUP | HN_LINK_FLAG_NETCHG); if_link_state_change(hn_ifp, LINK_STATE_DOWN); } else { + hn_vf_rss_restore(sc); hn_resume_mgmt(sc); } @@ -1335,7 +1344,249 @@ hn_mtu_change_fixup(struct hn_softc *sc) #endif } +static uint32_t +hn_rss_type_fromndis(uint32_t rss_hash) +{ + uint32_t types = 0; + + if (rss_hash & NDIS_HASH_IPV4) + types |= RSS_TYPE_IPV4; + if (rss_hash & NDIS_HASH_TCP_IPV4) + types |= RSS_TYPE_TCP_IPV4; + if (rss_hash & NDIS_HASH_IPV6) + types |= RSS_TYPE_IPV6; + if (rss_hash & NDIS_HASH_IPV6_EX) + types |= RSS_TYPE_IPV6_EX; + if (rss_hash & NDIS_HASH_TCP_IPV6) + types |= RSS_TYPE_TCP_IPV6; + if (rss_hash & NDIS_HASH_TCP_IPV6_EX) + types |= RSS_TYPE_TCP_IPV6_EX; + return (types); +} + +static uint32_t +hn_rss_type_tondis(uint32_t types) +{ + uint32_t rss_hash = 0; + + KASSERT((types & + (RSS_TYPE_UDP_IPV4 | RSS_TYPE_UDP_IPV6 | RSS_TYPE_UDP_IPV6_EX)) == 0, + ("UDP4, UDP6 and UDP6EX are not supported")); + + if (types & RSS_TYPE_IPV4) + rss_hash |= NDIS_HASH_IPV4; + if (types & RSS_TYPE_TCP_IPV4) + rss_hash |= NDIS_HASH_TCP_IPV4; + if (types & RSS_TYPE_IPV6) + rss_hash |= NDIS_HASH_IPV6; + if (types & RSS_TYPE_IPV6_EX) + rss_hash |= NDIS_HASH_IPV6_EX; + if (types & RSS_TYPE_TCP_IPV6) + rss_hash |= NDIS_HASH_TCP_IPV6; + if (types & RSS_TYPE_TCP_IPV6_EX) + rss_hash |= NDIS_HASH_TCP_IPV6_EX; + return (rss_hash); +} + static void +hn_rss_mbuf_hash(struct hn_softc *sc, uint32_t mbuf_hash) +{ + int i; + + HN_LOCK_ASSERT(sc); + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) + sc->hn_rx_ring[i].hn_mbuf_hash = mbuf_hash; +} + +static void +hn_vf_rss_fixup(struct hn_softc *sc, bool reconf) +{ + struct ifnet *ifp, *vf_ifp; + struct ifrsshash ifrh; + struct ifrsskey ifrk; + int error; + uint32_t my_types, diff_types, mbuf_types = 0; + + HN_LOCK_ASSERT(sc); + KASSERT(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED, + ("%s: synthetic parts are not attached", sc->hn_ifp->if_xname)); + + if (sc->hn_rx_ring_inuse == 1) { + /* No RSS on synthetic parts; done. */ + return; + } + if ((sc->hn_rss_hcap & NDIS_HASH_FUNCTION_TOEPLITZ) == 0) { + /* Synthetic parts do not support Toeplitz; done. */ + return; + } + + ifp = sc->hn_ifp; + vf_ifp = sc->hn_vf_ifp; + + /* + * Extract VF's RSS key. Only 40 bytes key for Toeplitz is + * supported. + */ + memset(&ifrk, 0, sizeof(ifrk)); + strlcpy(ifrk.ifrk_name, vf_ifp->if_xname, sizeof(ifrk.ifrk_name)); + error = vf_ifp->if_ioctl(vf_ifp, SIOCGIFRSSKEY, (caddr_t)&ifrk); + if (error) { + if_printf(ifp, "%s SIOCGRSSKEY failed: %d\n", + vf_ifp->if_xname, error); + goto done; + } + if (ifrk.ifrk_func != RSS_FUNC_TOEPLITZ) { + if_printf(ifp, "%s RSS function %u is not Toeplitz\n", + vf_ifp->if_xname, ifrk.ifrk_func); + goto done; + } + if (ifrk.ifrk_keylen != NDIS_HASH_KEYSIZE_TOEPLITZ) { + if_printf(ifp, "%s invalid RSS Toeplitz key length %d\n", + vf_ifp->if_xname, ifrk.ifrk_keylen); + goto done; + } + + /* + * Extract VF's RSS hash. Only Toeplitz is supported. + */ + memset(&ifrh, 0, sizeof(ifrh)); + strlcpy(ifrh.ifrh_name, vf_ifp->if_xname, sizeof(ifrh.ifrh_name)); + error = vf_ifp->if_ioctl(vf_ifp, SIOCGIFRSSHASH, (caddr_t)&ifrh); + if (error) { + if_printf(ifp, "%s SIOCGRSSHASH failed: %d\n", + vf_ifp->if_xname, error); + goto done; + } + if (ifrh.ifrh_func != RSS_FUNC_TOEPLITZ) { + if_printf(ifp, "%s RSS function %u is not Toeplitz\n", + vf_ifp->if_xname, ifrh.ifrh_func); + goto done; + } + + my_types = hn_rss_type_fromndis(sc->hn_rss_hcap); + if ((ifrh.ifrh_types & my_types) == 0) { + /* This disables RSS; ignore it then */ + if_printf(ifp, "%s intersection of RSS types failed. " + "VF %#x, mine %#x\n", vf_ifp->if_xname, + ifrh.ifrh_types, my_types); + goto done; + } + + diff_types = my_types ^ ifrh.ifrh_types; + my_types &= ifrh.ifrh_types; + mbuf_types = my_types; + + /* + * Detect RSS hash value/type confliction. + * + * NOTE: + * We don't disable the hash type, but stop delivery the hash + * value/type through mbufs on RX path. + */ + if ((my_types & RSS_TYPE_IPV4) && + (diff_types & ifrh.ifrh_types & + (RSS_TYPE_TCP_IPV4 | RSS_TYPE_UDP_IPV4))) { + /* Conflict; disable IPV4 hash type/value delivery. */ + if_printf(ifp, "disable IPV4 mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_IPV4; + } + if ((my_types & RSS_TYPE_IPV6) && + (diff_types & ifrh.ifrh_types & + (RSS_TYPE_TCP_IPV6 | RSS_TYPE_UDP_IPV6 | + RSS_TYPE_TCP_IPV6_EX | RSS_TYPE_UDP_IPV6_EX | + RSS_TYPE_IPV6_EX))) { + /* Conflict; disable IPV6 hash type/value delivery. */ + if_printf(ifp, "disable IPV6 mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_IPV6; + } + if ((my_types & RSS_TYPE_IPV6_EX) && + (diff_types & ifrh.ifrh_types & + (RSS_TYPE_TCP_IPV6 | RSS_TYPE_UDP_IPV6 | + RSS_TYPE_TCP_IPV6_EX | RSS_TYPE_UDP_IPV6_EX | + RSS_TYPE_IPV6))) { + /* Conflict; disable IPV6_EX hash type/value delivery. */ + if_printf(ifp, "disable IPV6_EX mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_IPV6_EX; + } + if ((my_types & RSS_TYPE_TCP_IPV6) && + (diff_types & ifrh.ifrh_types & RSS_TYPE_TCP_IPV6_EX)) { + /* Conflict; disable TCP_IPV6 hash type/value delivery. */ + if_printf(ifp, "disable TCP_IPV6 mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_TCP_IPV6; + } + if ((my_types & RSS_TYPE_TCP_IPV6_EX) && + (diff_types & ifrh.ifrh_types & RSS_TYPE_TCP_IPV6)) { + /* Conflict; disable TCP_IPV6_EX hash type/value delivery. */ + if_printf(ifp, "disable TCP_IPV6_EX mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_TCP_IPV6_EX; + } + if ((my_types & RSS_TYPE_UDP_IPV6) && + (diff_types & ifrh.ifrh_types & RSS_TYPE_UDP_IPV6_EX)) { + /* Conflict; disable UDP_IPV6 hash type/value delivery. */ + if_printf(ifp, "disable UDP_IPV6 mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_UDP_IPV6; + } + if ((my_types & RSS_TYPE_UDP_IPV6_EX) && + (diff_types & ifrh.ifrh_types & RSS_TYPE_UDP_IPV6)) { + /* Conflict; disable UDP_IPV6_EX hash type/value delivery. */ + if_printf(ifp, "disable UDP_IPV6_EX mbuf hash delivery\n"); + mbuf_types &= ~RSS_TYPE_UDP_IPV6_EX; + } + + /* + * Indirect table does not matter. + */ + + sc->hn_rss_hash = (sc->hn_rss_hcap & NDIS_HASH_FUNCTION_MASK) | + hn_rss_type_tondis(my_types); + memcpy(sc->hn_rss.rss_key, ifrk.ifrk_key, sizeof(sc->hn_rss.rss_key)); + sc->hn_flags |= HN_FLAG_HAS_RSSKEY; + + if (reconf) { + error = hn_rss_reconfig(sc); + if (error) { + /* XXX roll-back? */ + if_printf(ifp, "hn_rss_reconfig failed: %d\n", error); + /* XXX keep going. */ + } + } +done: + /* Hash deliverability for mbufs. */ + hn_rss_mbuf_hash(sc, hn_rss_type_tondis(mbuf_types)); +} + +static void +hn_vf_rss_restore(struct hn_softc *sc) +{ + + HN_LOCK_ASSERT(sc); + KASSERT(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED, + ("%s: synthetic parts are not attached", sc->hn_ifp->if_xname)); + + if (sc->hn_rx_ring_inuse == 1) + goto done; + + /* + * Restore hash types. Key does _not_ matter. + */ + if (sc->hn_rss_hash != sc->hn_rss_hcap) { + int error; + + sc->hn_rss_hash = sc->hn_rss_hcap; + error = hn_rss_reconfig(sc); + if (error) { + if_printf(sc->hn_ifp, "hn_rss_reconfig failed: %d\n", + error); + /* XXX keep going. */ + } + } +done: + /* Hash deliverability for mbufs. */ + hn_rss_mbuf_hash(sc, NDIS_HASH_ALL); +} + +static void hn_xpnt_vf_setready(struct hn_softc *sc) { struct ifnet *ifp, *vf_ifp; @@ -1501,6 +1752,13 @@ hn_xpnt_vf_init(struct hn_softc *sc) */ hn_nvs_set_datapath(sc, HN_NVS_DATAPATH_VF); + /* + * NOTE: + * Fixup RSS related bits _after_ the VF is brought up, since + * many VFs generate RSS key during it's initialization. + */ + hn_vf_rss_fixup(sc, true); + /* Mark transparent mode VF as enabled. */ hn_xpnt_vf_setenable(sc); } @@ -1659,7 +1917,8 @@ hn_ifnet_detevent(void *xsc, struct ifnet *ifp) ifp->if_input = sc->hn_vf_input; sc->hn_vf_input = NULL; - if (sc->hn_xvf_flags & HN_XVFFLAG_ENABLED) + if ((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) && + (sc->hn_xvf_flags & HN_XVFFLAG_ENABLED)) hn_nvs_set_datapath(sc, HN_NVS_DATAPATH_SYNTH); if (sc->hn_vf_rdytick == 0) { @@ -1681,11 +1940,18 @@ hn_ifnet_detevent(void *xsc, struct ifnet *ifp) sc->hn_ifp->if_hw_tsomaxsegsize = sc->hn_saved_tsosegsz; } - /* - * Resume link status management, which was suspended - * by hn_ifnet_attevent(). - */ - hn_resume_mgmt(sc); + if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) { + /* + * Restore RSS settings. + */ + hn_vf_rss_restore(sc); + + /* + * Resume link status management, which was suspended + * by hn_ifnet_attevent(). + */ + hn_resume_mgmt(sc); + } } /* Mark transparent mode VF as disabled. */ @@ -1935,6 +2201,12 @@ hn_attach(device_t dev) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rss_hash", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, hn_rss_hash_sysctl, "A", "RSS hash"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rss_hashcap", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + hn_rss_hcap_sysctl, "A", "RSS hash capabilities"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "mbuf_hash", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + hn_rss_mbuf_sysctl, "A", "RSS hash for mbufs"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rss_ind_size", CTLFLAG_RD, &sc->hn_rss_ind_size, 0, "RSS indirect entry count"); #ifndef RSS @@ -3026,14 +3298,21 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int { struct ifnet *ifp, *hn_ifp = rxr->hn_ifp; struct mbuf *m_new; - int size, do_lro = 0, do_csum = 1; - int hash_type; + int size, do_lro = 0, do_csum = 1, is_vf = 0; + int hash_type = M_HASHTYPE_NONE; - /* - * If the non-transparent mode VF is active, inject this packet - * into the VF. - */ - ifp = rxr->hn_rxvf_ifp ? rxr->hn_rxvf_ifp : hn_ifp; + ifp = hn_ifp; + if (rxr->hn_rxvf_ifp != NULL) { + /* + * Non-transparent mode VF; pretend this packet is from + * the VF. + */ + ifp = rxr->hn_rxvf_ifp; + is_vf = 1; + } else if (rxr->hn_rx_flags & HN_RX_FLAG_XPNT_VF) { + /* Transparent mode VF. */ + is_vf = 1; + } if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { /* @@ -3186,16 +3465,6 @@ skip: * If VF is activated (tranparent/non-transparent mode does not * matter here). * - * - Don't setup mbuf hash, if 'options RSS' is set. - * - * In Azure, when VF is activated, TCP SYN and SYN|ACK go - * through hn(4) while the rest of segments and ACKs belonging - * to the same TCP 4-tuple go through the VF. So don't setup - * mbuf hash, if a VF is activated and 'options RSS' is not - * enabled. hn(4) and the VF may use neither the same RSS - * hash key nor the same RSS hash function, so the hash value - * for packets belonging to the same flow could be different! - * * - Disable LRO * * hn(4) will only receive broadcast packets, multicast packets, @@ -3206,20 +3475,23 @@ skip: * all, since the LRO flush will use hn(4) as the receiving * interface; i.e. hn_ifp->if_input(hn_ifp, m). */ - if (hn_ifp != ifp || (rxr->hn_rx_flags & HN_RX_FLAG_XPNT_VF)) { - do_lro = 0; /* disable LRO. */ -#ifndef RSS - goto skip_hash; /* skip mbuf hash setup */ -#endif - } + if (is_vf) + do_lro = 0; + /* + * If VF is activated (tranparent/non-transparent mode does not + * matter here), do _not_ mess with unsupported hash types or + * functions. + */ if (info->hash_info != HN_NDIS_HASH_INFO_INVALID) { rxr->hn_rss_pkts++; m_new->m_pkthdr.flowid = info->hash_value; - hash_type = M_HASHTYPE_OPAQUE_HASH; + if (!is_vf) + hash_type = M_HASHTYPE_OPAQUE_HASH; if ((info->hash_info & NDIS_HASH_FUNCTION_MASK) == NDIS_HASH_FUNCTION_TOEPLITZ) { - uint32_t type = (info->hash_info & NDIS_HASH_TYPE_MASK); + uint32_t type = (info->hash_info & NDIS_HASH_TYPE_MASK & + rxr->hn_mbuf_hash); /* * NOTE: @@ -3256,15 +3528,12 @@ skip: break; } } - } else { + } else if (!is_vf) { m_new->m_pkthdr.flowid = rxr->hn_rx_idx; hash_type = M_HASHTYPE_OPAQUE; } M_HASHTYPE_SET(m_new, hash_type); -#ifndef RSS -skip_hash: -#endif if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if (hn_ifp != ifp) { const struct ether_header *eh; @@ -3589,20 +3858,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) ifrh->ifrh_func = RSS_FUNC_TOEPLITZ; else ifrh->ifrh_func = RSS_FUNC_PRIVATE; - - ifrh->ifrh_types = 0; - if (sc->hn_rss_hash & NDIS_HASH_IPV4) - ifrh->ifrh_types |= RSS_TYPE_IPV4; - if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV4) - ifrh->ifrh_types |= RSS_TYPE_TCP_IPV4; - if (sc->hn_rss_hash & NDIS_HASH_IPV6) - ifrh->ifrh_types |= RSS_TYPE_IPV6; - if (sc->hn_rss_hash & NDIS_HASH_IPV6_EX) - ifrh->ifrh_types |= RSS_TYPE_IPV6_EX; - if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV6) - ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6; - if (sc->hn_rss_hash & NDIS_HASH_TCP_IPV6_EX) - ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6_EX; + ifrh->ifrh_types = hn_rss_type_fromndis(sc->hn_rss_hash); HN_UNLOCK(sc); break; @@ -4154,6 +4410,16 @@ hn_rss_key_sysctl(SYSCTL_HANDLER_ARGS) if (error || req->newptr == NULL) goto back; + if ((sc->hn_flags & HN_FLAG_RXVF) || + (hn_xpnt_vf && sc->hn_vf_ifp != NULL)) { + /* + * RSS key is synchronized w/ VF's, don't allow users + * to change it. + */ + error = EBUSY; + goto back; + } + error = SYSCTL_IN(req, sc->hn_rss.rss_key, sizeof(sc->hn_rss.rss_key)); if (error) goto back; @@ -4220,6 +4486,34 @@ hn_rss_hash_sysctl(SYSCTL_HANDLER_ARGS) } static int +hn_rss_hcap_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + char hash_str[128]; + uint32_t hash; + + HN_LOCK(sc); + hash = sc->hn_rss_hcap; + HN_UNLOCK(sc); + snprintf(hash_str, sizeof(hash_str), "%b", hash, NDIS_HASH_BITS); + return sysctl_handle_string(oidp, hash_str, sizeof(hash_str), req); +} + +static int +hn_rss_mbuf_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + char hash_str[128]; + uint32_t hash; + + HN_LOCK(sc); + hash = sc->hn_rx_ring[0].hn_mbuf_hash; + HN_UNLOCK(sc); + snprintf(hash_str, sizeof(hash_str), "%b", hash, NDIS_HASH_BITS); + return sysctl_handle_string(oidp, hash_str, sizeof(hash_str), req); +} + +static int hn_vf_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; @@ -4519,6 +4813,7 @@ hn_create_rx_data(struct hn_softc *sc, int ring_cnt) rxr->hn_trust_hcsum |= HN_TRUST_HCSUM_UDP; if (hn_trust_hostip) rxr->hn_trust_hcsum |= HN_TRUST_HCSUM_IP; + rxr->hn_mbuf_hash = NDIS_HASH_ALL; rxr->hn_ifp = sc->hn_ifp; if (i < sc->hn_tx_ring_cnt) rxr->hn_txr = &sc->hn_tx_ring[i]; @@ -5980,6 +6275,7 @@ hn_synth_attach(struct hn_softc *sc, int mtu) /* Clear RSS stuffs. */ sc->hn_rss_ind_size = 0; sc->hn_rss_hash = 0; + sc->hn_rss_hcap = 0; /* * Attach the primary channel _before_ attaching NVS and RNDIS. @@ -6098,6 +6394,12 @@ hn_synth_attach(struct hn_softc *sc, int mtu) hn_rss_ind_fixup(sc); } + sc->hn_rss_hash = sc->hn_rss_hcap; + if ((sc->hn_flags & HN_FLAG_RXVF) || + (sc->hn_xvf_flags & HN_XVFFLAG_ENABLED)) { + /* NOTE: Don't reconfigure RSS; will do immediately. */ + hn_vf_rss_fixup(sc, false); + } error = hn_rndis_conf_rss(sc, NDIS_RSS_FLAG_NONE); if (error) goto failed; Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Sep 19 05:48:53 2017 (r323726) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Sep 19 06:29:38 2017 (r323727) @@ -64,6 +64,7 @@ struct hn_rx_ring { void *hn_pktbuf; int hn_pktbuf_len; int hn_rx_flags; /* HN_RX_FLAG_ */ + uint32_t hn_mbuf_hash; /* NDIS_HASH_ */ uint8_t *hn_rxbuf; /* shadow sc->hn_rxbuf */ int hn_rx_idx; @@ -238,7 +239,8 @@ struct hn_softc { uint32_t hn_rndis_agg_align; int hn_rss_ind_size; - uint32_t hn_rss_hash; /* NDIS_HASH_ */ + uint32_t hn_rss_hash; /* setting, NDIS_HASH_ */ + uint32_t hn_rss_hcap; /* caps, NDIS_HASH_ */ struct ndis_rssprm_toeplitz hn_rss; eventhandler_tag hn_ifaddr_evthand; Modified: head/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/ndis.h Tue Sep 19 05:48:53 2017 (r323726) +++ head/sys/dev/hyperv/netvsc/ndis.h Tue Sep 19 06:29:38 2017 (r323727) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Microsoft Corp. + * Copyright (c) 2016-2017 Microsoft Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,6 +56,13 @@ #define NDIS_HASH_IPV6_EX 0x00000800 #define NDIS_HASH_TCP_IPV6 0x00001000 #define NDIS_HASH_TCP_IPV6_EX 0x00002000 + +#define NDIS_HASH_ALL (NDIS_HASH_IPV4 | \ + NDIS_HASH_TCP_IPV4 | \ + NDIS_HASH_IPV6 | \ + NDIS_HASH_IPV6_EX | \ + NDIS_HASH_TCP_IPV6 | \ + NDIS_HASH_TCP_IPV6_EX) /* Hash description for use with printf(9) %b identifier. */ #define NDIS_HASH_BITS \ From owner-svn-src-head@freebsd.org Tue Sep 19 06:38:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 064FEE2636D; Tue, 19 Sep 2017 06:38:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4A8D6CB16; Tue, 19 Sep 2017 06:38:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8J6cwXt088756; Tue, 19 Sep 2017 06:38:58 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8J6cvP7088752; Tue, 19 Sep 2017 06:38:57 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201709190638.v8J6cvP7088752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 19 Sep 2017 06:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323728 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 323728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 06:38:59 -0000 Author: sephe Date: Tue Sep 19 06:38:57 2017 New Revision: 323728 URL: https://svnweb.freebsd.org/changeset/base/323728 Log: hyperv/hn: Fix MTU setting - Add size of an ethernet header to the value configured to NVS. This does not seem to have any effects if MTU is 1500, but fix hypervisor side's setting if MTU > 1500. - Override the MTU setting according to the view from the hypervisor side. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12352 Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c head/sys/dev/hyperv/netvsc/hn_rndis.c head/sys/dev/hyperv/netvsc/hn_rndis.h head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_nvs.c Tue Sep 19 06:29:38 2017 (r323727) +++ head/sys/dev/hyperv/netvsc/hn_nvs.c Tue Sep 19 06:38:57 2017 (r323728) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -503,7 +504,7 @@ hn_nvs_conf_ndis(struct hn_softc *sc, int mtu) memset(&conf, 0, sizeof(conf)); conf.nvs_type = HN_NVS_TYPE_NDIS_CONF; - conf.nvs_mtu = mtu; + conf.nvs_mtu = mtu + ETHER_HDR_LEN; conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN; if (sc->hn_nvs_ver >= HN_NVS_VERSION_5) conf.nvs_caps |= HN_NVS_NDIS_CONF_SRIOV; Modified: head/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_rndis.c Tue Sep 19 06:29:38 2017 (r323727) +++ head/sys/dev/hyperv/netvsc/hn_rndis.c Tue Sep 19 06:38:57 2017 (r323728) @@ -188,6 +188,24 @@ hn_rndis_get_linkstatus(struct hn_softc *sc, uint32_t return (0); } +int +hn_rndis_get_mtu(struct hn_softc *sc, uint32_t *mtu) +{ + size_t size; + int error; + + size = sizeof(*mtu); + error = hn_rndis_query(sc, OID_GEN_MAXIMUM_FRAME_SIZE, NULL, 0, + mtu, &size); + if (error) + return (error); + if (size != sizeof(uint32_t)) { + if_printf(sc->hn_ifp, "invalid mtu len %zu\n", size); + return (EINVAL); + } + return (0); +} + static const void * hn_rndis_xact_exec1(struct hn_softc *sc, struct vmbus_xact *xact, size_t reqlen, struct hn_nvs_sendctx *sndc, size_t *comp_len) Modified: head/sys/dev/hyperv/netvsc/hn_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_rndis.h Tue Sep 19 06:29:38 2017 (r323727) +++ head/sys/dev/hyperv/netvsc/hn_rndis.h Tue Sep 19 06:38:57 2017 (r323728) @@ -41,6 +41,7 @@ int hn_rndis_get_eaddr(struct hn_softc *sc, uint8_t * /* link_status: NDIS_MEDIA_STATE_ */ int hn_rndis_get_linkstatus(struct hn_softc *sc, uint32_t *link_status); +int hn_rndis_get_mtu(struct hn_softc *sc, uint32_t *mtu); /* filter: NDIS_PACKET_TYPE_. */ int hn_rndis_set_rxfilter(struct hn_softc *sc, uint32_t filter); void hn_rndis_rx_ctrl(struct hn_softc *sc, const void *data, Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Tue Sep 19 06:29:38 2017 (r323727) +++ head/sys/dev/hyperv/netvsc/if_hn.c Tue Sep 19 06:38:57 2017 (r323728) @@ -2003,6 +2003,7 @@ hn_attach(device_t dev) uint8_t eaddr[ETHER_ADDR_LEN]; struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; + uint32_t mtu; sc->hn_dev = dev; sc->hn_prichan = vmbus_get_channel(dev); @@ -2159,6 +2160,12 @@ hn_attach(device_t dev) if (error) goto failed; + error = hn_rndis_get_mtu(sc, &mtu); + if (error) + mtu = ETHERMTU; + else if (bootverbose) + device_printf(dev, "RNDIS mtu %u\n", mtu); + #if __FreeBSD_version >= 1100099 if (sc->hn_rx_ring_inuse > 1) { /* @@ -2343,6 +2350,10 @@ hn_attach(device_t dev) if_printf(ifp, "TSO segcnt %u segsz %u\n", ifp->if_hw_tsomaxsegcount, ifp->if_hw_tsomaxsegsize); } + if (mtu < ETHERMTU) { + if_printf(ifp, "fixup mtu %u -> %u\n", ifp->if_mtu, mtu); + ifp->if_mtu = mtu; + } /* Inform the upper layer about the long frame support. */ ifp->if_hdrlen = sizeof(struct ether_vlan_header); @@ -3587,6 +3598,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) int mask, error = 0; struct ifrsskey *ifrk; struct ifrsshash *ifrh; + uint32_t mtu; switch (cmd) { case SIOCSIFMTU: @@ -3650,11 +3662,23 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; } + error = hn_rndis_get_mtu(sc, &mtu); + if (error) + mtu = ifr->ifr_mtu; + else if (bootverbose) + if_printf(ifp, "RNDIS mtu %u\n", mtu); + /* * Commit the requested MTU, after the synthetic parts * have been successfully attached. */ - ifp->if_mtu = ifr->ifr_mtu; + if (mtu >= ifr->ifr_mtu) { + mtu = ifr->ifr_mtu; + } else { + if_printf(ifp, "fixup mtu %d -> %u\n", + ifr->ifr_mtu, mtu); + } + ifp->if_mtu = mtu; /* * Synthetic parts' reattach may change the chimney From owner-svn-src-head@freebsd.org Tue Sep 19 06:46:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 579F9E268B1; Tue, 19 Sep 2017 06:46:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 252746CF8D; Tue, 19 Sep 2017 06:46:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8J6k0Yj092691; Tue, 19 Sep 2017 06:46:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8J6k0Rv092690; Tue, 19 Sep 2017 06:46:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201709190646.v8J6k0Rv092690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 19 Sep 2017 06:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323729 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 323729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 06:46:01 -0000 Author: sephe Date: Tue Sep 19 06:46:00 2017 New Revision: 323729 URL: https://svnweb.freebsd.org/changeset/base/323729 Log: hyperv/hn: Incease max supported MTU MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12365 Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Sep 19 06:38:57 2017 (r323728) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Sep 19 06:46:00 2017 (r323729) @@ -36,8 +36,7 @@ #define HN_RXBUF_SIZE (16 * 1024 * 1024) #define HN_RXBUF_SIZE_COMPAT (15 * 1024 * 1024) -/* Claimed to be 12232B */ -#define HN_MTU_MAX (9 * 1024) +#define HN_MTU_MAX (65535 - ETHER_ADDR_LEN) #define HN_TXBR_SIZE (128 * PAGE_SIZE) #define HN_RXBR_SIZE (128 * PAGE_SIZE) From owner-svn-src-head@freebsd.org Tue Sep 19 15:00:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46F1FE1763A; Tue, 19 Sep 2017 15:00:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1484A82F3A; Tue, 19 Sep 2017 15:00:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JF0JaJ097156; Tue, 19 Sep 2017 15:00:19 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JF0Juv097155; Tue, 19 Sep 2017 15:00:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709191500.v8JF0Juv097155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 19 Sep 2017 15:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323763 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 323763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 15:00:20 -0000 Author: tuexen Date: Tue Sep 19 15:00:19 2017 New Revision: 323763 URL: https://svnweb.freebsd.org/changeset/base/323763 Log: Remove a no longer used variable. Reported by: Felix Weinrank MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Tue Sep 19 12:43:47 2017 (r323762) +++ head/sys/netinet/sctp_indata.c Tue Sep 19 15:00:19 2017 (r323763) @@ -4213,8 +4213,6 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 again: j = 0; TAILQ_FOREACH(net, &asoc->nets, sctp_next) { - int to_ticks; - if (win_probe_recovery && (net->window_probe)) { win_probe_recovered = 1; /* @@ -4229,11 +4227,6 @@ again: break; } } - } - if (net->RTO == 0) { - to_ticks = MSEC_TO_TICKS(stcb->asoc.initial_rto); - } else { - to_ticks = MSEC_TO_TICKS(net->RTO); } if (net->flight_size) { j++; From owner-svn-src-head@freebsd.org Tue Sep 19 15:08:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BE59E17D0A; Tue, 19 Sep 2017 15:08:32 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5871E8353E; Tue, 19 Sep 2017 15:08:32 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JF8V2a001741; Tue, 19 Sep 2017 15:08:31 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JF8V3P001740; Tue, 19 Sep 2017 15:08:31 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201709191508.v8JF8V3P001740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Tue, 19 Sep 2017 15:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323764 - head/sbin/geom/class/part X-SVN-Group: head X-SVN-Commit-Author: danfe X-SVN-Commit-Paths: head/sbin/geom/class/part X-SVN-Commit-Revision: 323764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 15:08:32 -0000 Author: danfe (ports committer) Date: Tue Sep 19 15:08:31 2017 New Revision: 323764 URL: https://svnweb.freebsd.org/changeset/base/323764 Log: Provide an articulate example of how to properly delete partitions and partitioning scheme. Users often get confused and frustrated when trying to delete partition table and getting ``Device busy'' error because they forgot (or did not ever know that they have) to delete all its partitions first, and while the manual page mentions this briefly, it does not stress it out enough. Approved by: ae, manpages (bjk) PR (as inspiration): 196102 Differential Revision: https://reviews.freebsd.org/D12336 Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Tue Sep 19 15:00:19 2017 (r323763) +++ head/sbin/geom/class/part/gpart.8 Tue Sep 19 15:08:31 2017 (r323764) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 25, 2016 +.Dd September 19, 2017 .Dt GPART 8 .Os .Sh NAME @@ -1324,6 +1324,29 @@ partition to contain a UFS filesystem and aligned on 4 After creating all required partitions, embed bootstrap code into them: .Bd -literal -offset indent /sbin/gpart bootcode -p /boot/boot1 da0 +.Ed +.Ss Deleting partitions and partitioning scheme +If you get a +.Em "Device busy" +error when trying to destroy a partition table, remember that you must +delete all its partitions first with the +.Cm delete +action. +In this example, assume we have +.Pa da0 +with three partitions: +.Bd -literal -offset indent +/sbin/gpart delete -i 3 da0 +/sbin/gpart delete -i 2 da0 +/sbin/gpart delete -i 1 da0 +/sbin/gpart destroy da0 +.Ed +.Pp +Alternatively, you can invoke the +.Cm destroy +action with the +.Fl F +flag. .Ed .Ss Backup and Restore .Pp From owner-svn-src-head@freebsd.org Tue Sep 19 16:38:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F8A7E1C4B3; Tue, 19 Sep 2017 16:38:55 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CC072802; Tue, 19 Sep 2017 16:38:55 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JGcstI040452; Tue, 19 Sep 2017 16:38:54 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JGcsGX040450; Tue, 19 Sep 2017 16:38:54 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201709191638.v8JGcsGX040450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 19 Sep 2017 16:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323767 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 323767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 16:38:55 -0000 Author: eugen (ports committer) Date: Tue Sep 19 16:38:54 2017 New Revision: 323767 URL: https://svnweb.freebsd.org/changeset/base/323767 Log: Add myself and mentorship status to committers files. This was not done right when I got my ports bit, so do them both in one commit: my ports mentors were az@ and vsevolod@ and my src mentors are avg@ and mav@ Approved by: avg (mentor) Modified: head/share/misc/committers-ports.dot head/share/misc/committers-src.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Sep 19 15:50:18 2017 (r323766) +++ head/share/misc/committers-ports.dot Tue Sep 19 16:38:54 2017 (r323767) @@ -99,6 +99,7 @@ edwin [label="Edwin Groothuis\nedwin@FreeBSD.org\n2002 ehaupt [label="Emanuel Haupt\nehaupt@FreeBSD.org\n2005/10/03"] eik [label="Oliver Eikemeier\neik@FreeBSD.org\n2003/11/12"] erwin [label="Erwin Lansing\nerwin@FreeBSD.org\n2003/06/04"] +eugen [label="Eugene Grosbein\neugen@FreeBSD.org\n2017/03/04"] farrokhi [label="Babak Farrokhi\nfarrokhi@FreeBSD.org\n2006/11/07"] feld [label="Mark Felder\nfeld@FreeBSD.org\n2013/06/25"] fjoe [label="Max Khon\nfjoe@FreeBSD.org\n2001/08/06"] @@ -290,6 +291,8 @@ asami -> obrien avilla -> jhale avilla -> rakuco +az -> eugen + bdrewery -> dbn bdrewery -> sbruno bdrewery -> trociny @@ -655,6 +658,8 @@ thierry -> riggs tmclaugh -> itetcu tmclaugh -> xride + +vsevolod -> eugen wen -> cs wen -> culot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Tue Sep 19 15:50:18 2017 (r323766) +++ head/share/misc/committers-src.dot Tue Sep 19 16:38:54 2017 (r323767) @@ -162,6 +162,7 @@ emaste [label="Ed Maste\nemaste@FreeBSD.org\n2005/10/0 emax [label="Maksim Yevmenkin\nemax@FreeBSD.org\n2003/10/12"] eri [label="Ermal Luci\neri@FreeBSD.org\n2008/06/11"] erj [label="Eric Joyner\nerj@FreeBSD.org\n2014/12/14"] +eugen [label="Eugene Grosbein\neugen@FreeBSD.org\n2017/09/19"] fabient [label="Fabien Thomas\nfabient@FreeBSD.org\n2009/03/16"] fanf [label="Tony Finch\nfanf@FreeBSD.org\n2002/05/05"] fjoe [label="Max Khon\nfjoe@FreeBSD.org\n2001/08/06"] @@ -386,6 +387,7 @@ andrew -> manu anholt -> jkim avg -> art +avg -> eugen avg -> pluknet avg -> smh @@ -650,6 +652,7 @@ markm -> jasone markm -> sheldonh mav -> ae +mav -> eugen mdf -> gleb From owner-svn-src-head@freebsd.org Tue Sep 19 16:46:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98D5BE1C9DA; Tue, 19 Sep 2017 16:46:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 639AF2D80; Tue, 19 Sep 2017 16:46:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JGkbNj044433; Tue, 19 Sep 2017 16:46:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JGkbIF044431; Tue, 19 Sep 2017 16:46:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709191646.v8JGkbIF044431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Sep 2017 16:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323768 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 323768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 16:46:38 -0000 Author: kib Date: Tue Sep 19 16:46:37 2017 New Revision: 323768 URL: https://svnweb.freebsd.org/changeset/base/323768 Log: For unlinked files, do not msync(2) or sync on the vnode deactivation. One consequence of the patch is that msyncing unlinked file mappings no longer reduces the amount of the dirty memory in the system, but I do not think that there are users of msync(2) that utilize it for such side-effect. Reported and tested by: tjil PR: 222356 Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D12411 Modified: head/sys/kern/vfs_subr.c head/sys/vm/vm_object.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Sep 19 16:38:54 2017 (r323767) +++ head/sys/kern/vfs_subr.c Tue Sep 19 16:46:37 2017 (r323768) @@ -3054,8 +3054,8 @@ vinactive(struct vnode *vp, struct thread *td) * point that VOP_INACTIVE() is called, there could still be * pending I/O and dirty pages in the object. */ - obj = vp->v_object; - if (obj != NULL && (obj->flags & OBJ_MIGHTBEDIRTY) != 0) { + if ((obj = vp->v_object) != NULL && (vp->v_vflag & VV_NOSYNC) == 0 && + (obj->flags & OBJ_MIGHTBEDIRTY) != 0) { VM_OBJECT_WLOCK(obj); vm_object_page_clean(obj, 0, 0, 0); VM_OBJECT_WUNLOCK(obj); Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Sep 19 16:38:54 2017 (r323767) +++ head/sys/vm/vm_object.c Tue Sep 19 16:46:37 2017 (r323768) @@ -1083,8 +1083,8 @@ vm_object_sync(vm_object_t object, vm_ooffset_t offset * I/O. */ if (object->type == OBJT_VNODE && - (object->flags & OBJ_MIGHTBEDIRTY) != 0) { - vp = object->handle; + (object->flags & OBJ_MIGHTBEDIRTY) != 0 && + ((vp = object->handle)->v_vflag & VV_NOSYNC) == 0) { VM_OBJECT_WUNLOCK(object); (void) vn_start_write(vp, &mp, V_WAIT); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); From owner-svn-src-head@freebsd.org Tue Sep 19 16:49:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0091E1CC29; Tue, 19 Sep 2017 16:49:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCE5D3042; Tue, 19 Sep 2017 16:49:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JGnjBJ044823; Tue, 19 Sep 2017 16:49:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JGnjQB044822; Tue, 19 Sep 2017 16:49:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709191649.v8JGnjQB044822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Sep 2017 16:49:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323769 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 323769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 16:49:47 -0000 Author: kib Date: Tue Sep 19 16:49:45 2017 New Revision: 323769 URL: https://svnweb.freebsd.org/changeset/base/323769 Log: Do not vrele() covered vnode under the mp mutex. If vrele() changes the hold count to zero, it needs to acquire the vnode lock. Sponsored by: The FreeBSD Foundation Discussed with: avg X-MFC with: r323578 Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Tue Sep 19 16:46:37 2017 (r323768) +++ head/sys/kern/vfs_mount.c Tue Sep 19 16:49:45 2017 (r323769) @@ -507,8 +507,6 @@ vfs_mount_destroy(struct mount *mp) KASSERT(mp->mnt_ref == 0, ("%s: invalid refcount in the drain path @ %s:%d", __func__, __FILE__, __LINE__)); - if (mp->mnt_vnodecovered != NULL) - vrele(mp->mnt_vnodecovered); if (mp->mnt_writeopcount != 0) panic("vfs_mount_destroy: nonzero writeopcount"); if (mp->mnt_secondary_writes != 0) @@ -531,6 +529,8 @@ vfs_mount_destroy(struct mount *mp) if (mp->mnt_lockref != 0) panic("vfs_mount_destroy: nonzero lock refcount"); MNT_IUNLOCK(mp); + if (mp->mnt_vnodecovered != NULL) + vrele(mp->mnt_vnodecovered); #ifdef MAC mac_mount_destroy(mp); #endif From owner-svn-src-head@freebsd.org Tue Sep 19 17:57:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3934E21334; Tue, 19 Sep 2017 17:57:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81763657E0; Tue, 19 Sep 2017 17:57:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JHv4sk073677; Tue, 19 Sep 2017 17:57:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JHv4aD073675; Tue, 19 Sep 2017 17:57:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709191757.v8JHv4aD073675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Sep 2017 17:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323772 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 323772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 17:57:05 -0000 Author: kib Date: Tue Sep 19 17:57:04 2017 New Revision: 323772 URL: https://svnweb.freebsd.org/changeset/base/323772 Log: Do not do torn writes to active LDTs. Care must be taken when updating the active LDT, since parallel threads might try to load a segment descriptor which is currently updated. Since the results are undefined, this cannot be ignored by claiming to be an application race. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D12413 Modified: head/sys/amd64/amd64/sys_machdep.c head/sys/i386/i386/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Tue Sep 19 17:12:18 2017 (r323771) +++ head/sys/amd64/amd64/sys_machdep.c Tue Sep 19 17:57:04 2017 (r323772) @@ -583,22 +583,22 @@ amd64_get_ldt(td, uap) } int -amd64_set_ldt(td, uap, descs) - struct thread *td; - struct i386_ldt_args *uap; - struct user_segment_descriptor *descs; +amd64_set_ldt(struct thread *td, struct i386_ldt_args *uap, + struct user_segment_descriptor *descs) { - int error = 0; - unsigned int largest_ld, i; - struct mdproc *mdp = &td->td_proc->p_md; + struct mdproc *mdp; struct proc_ldt *pldt; struct user_segment_descriptor *dp; struct proc *p; + int error; + unsigned int largest_ld, i; #ifdef DEBUG printf("amd64_set_ldt: start=%d num=%d descs=%p\n", uap->start, uap->num, (void *)uap->descs); #endif + mdp = &td->td_proc->p_md; + error = 0; set_pcb_flags(td->td_pcb, PCB_FULL_IRET); p = td->td_proc; @@ -616,10 +616,9 @@ amd64_set_ldt(td, uap, descs) largest_ld = max_ldt_segment; if (largest_ld < uap->start) return (EINVAL); - i = largest_ld - uap->start; mtx_lock(&dt_lock); - bzero(&((struct user_segment_descriptor *)(pldt->ldt_base)) - [uap->start], sizeof(struct user_segment_descriptor) * i); + for (i = uap->start; i < largest_ld; i++) + ((uint64_t *)(pldt->ldt_base))[i] = 0; mtx_unlock(&dt_lock); return (0); } @@ -741,14 +740,18 @@ int amd64_set_ldt_data(struct thread *td, int start, int num, struct user_segment_descriptor *descs) { - struct mdproc *mdp = &td->td_proc->p_md; - struct proc_ldt *pldt = mdp->md_ldt; + struct mdproc *mdp; + struct proc_ldt *pldt; + uint64_t *dst, *src; + int i; mtx_assert(&dt_lock, MA_OWNED); - /* Fill in range */ - bcopy(descs, - &((struct user_segment_descriptor *)(pldt->ldt_base))[start], - num * sizeof(struct user_segment_descriptor)); + mdp = &td->td_proc->p_md; + pldt = mdp->md_ldt; + dst = (uint64_t *)(pldt->ldt_base); + src = (uint64_t *)descs; + for (i = 0; i < num; i++) + dst[start + i] = src[i]; return (0); } Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Tue Sep 19 17:12:18 2017 (r323771) +++ head/sys/i386/i386/sys_machdep.c Tue Sep 19 17:57:04 2017 (r323772) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -546,7 +547,7 @@ i386_set_ldt(td, uap, descs) struct i386_ldt_args *uap; union descriptor *descs; { - int error = 0, i; + int error, i; int largest_ld; struct mdproc *mdp = &td->td_proc->p_md; struct proc_ldt *pldt; @@ -556,6 +557,7 @@ i386_set_ldt(td, uap, descs) printf("i386_set_ldt: start=%d num=%d descs=%p\n", uap->start, uap->num, (void *)uap->descs); #endif + error = 0; if (descs == NULL) { /* Free descriptors */ @@ -578,9 +580,9 @@ i386_set_ldt(td, uap, descs) largest_ld = uap->start + uap->num; if (largest_ld > pldt->ldt_len) largest_ld = pldt->ldt_len; - i = largest_ld - uap->start; - bzero(&((union descriptor *)(pldt->ldt_base))[uap->start], - sizeof(union descriptor) * i); + for (i = uap->start; i < largest_ld; i++) + atomic_store_rel_64(&((uint64_t *)(pldt->ldt_base))[i], + 0); mtx_unlock_spin(&dt_lock); return (0); } @@ -702,17 +704,27 @@ again: static int i386_set_ldt_data(struct thread *td, int start, int num, - union descriptor *descs) + union descriptor *descs) { - struct mdproc *mdp = &td->td_proc->p_md; - struct proc_ldt *pldt = mdp->md_ldt; + struct mdproc *mdp; + struct proc_ldt *pldt; + uint64_t *dst, *src; + int i; mtx_assert(&dt_lock, MA_OWNED); - /* Fill in range */ - bcopy(descs, - &((union descriptor *)(pldt->ldt_base))[start], - num * sizeof(union descriptor)); + mdp = &td->td_proc->p_md; + pldt = mdp->md_ldt; + dst = (uint64_t *)(pldt->ldt_base); + src = (uint64_t *)descs; + + /* + * Atomic(9) is used only to get 64bit atomic store with + * cmpxchg8b when available. There is no op without release + * semantic. + */ + for (i = 0; i < num; i++) + atomic_store_rel_64(&dst[start + i], src[i]); return (0); } From owner-svn-src-head@freebsd.org Tue Sep 19 20:09:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEF0CE016CA; Tue, 19 Sep 2017 20:09:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE2DE6A652; Tue, 19 Sep 2017 20:09:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JK9wx4027640; Tue, 19 Sep 2017 20:09:58 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JK9wV2027639; Tue, 19 Sep 2017 20:09:58 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709192009.v8JK9wV2027639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 19 Sep 2017 20:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323774 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 323774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 20:10:00 -0000 Author: tuexen Date: Tue Sep 19 20:09:58 2017 New Revision: 323774 URL: https://svnweb.freebsd.org/changeset/base/323774 Log: Avoid an overflow when computing the staleness. This issue was found by running libfuzz on the userland stack. MFC after: 1 week Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Sep 19 18:18:24 2017 (r323773) +++ head/sys/netinet/sctp_input.c Tue Sep 19 20:09:58 2017 (r323774) @@ -2553,15 +2553,12 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in /* Expire time is in Ticks, so we convert to seconds */ time_expires.tv_sec = cookie->time_entered.tv_sec + TICKS_TO_SEC(cookie->cookie_life); time_expires.tv_usec = cookie->time_entered.tv_usec; - /* - * TODO sctp_constants.h needs alternative time macros when _KERNEL - * is undefined. - */ if (timevalcmp(&now, &time_expires, >)) { /* cookie is stale! */ struct mbuf *op_err; struct sctp_error_stale_cookie *cause; - uint32_t tim; + struct timeval diff; + uint32_t staleness; op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_error_stale_cookie), 0, M_NOWAIT, 1, MT_DATA); @@ -2575,12 +2572,19 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in cause->cause.code = htons(SCTP_CAUSE_STALE_COOKIE); cause->cause.length = htons((sizeof(struct sctp_paramhdr) + (sizeof(uint32_t)))); - /* seconds to usec */ - tim = (now.tv_sec - time_expires.tv_sec) * 1000000; - /* add in usec */ - if (tim == 0) - tim = now.tv_usec - cookie->time_entered.tv_usec; - cause->stale_time = htonl(tim); + diff = now; + timevalsub(&diff, &time_expires); + if (diff.tv_sec > UINT32_MAX / 1000000) { + staleness = UINT32_MAX; + } else { + staleness = diff.tv_sec * 1000000; + } + if (UINT32_MAX - staleness >= diff.tv_usec) { + staleness += diff.tv_usec; + } else { + staleness = UINT32_MAX; + } + cause->stale_time = htonl(staleness); sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, mflowtype, mflowid, l_inp->fibnum, vrf_id, port); From owner-svn-src-head@freebsd.org Tue Sep 19 20:18:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFFA3E01EB9; Tue, 19 Sep 2017 20:18:42 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9EA56AC25; Tue, 19 Sep 2017 20:18:42 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JKIfOJ031812; Tue, 19 Sep 2017 20:18:41 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JKIfoI031809; Tue, 19 Sep 2017 20:18:41 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201709192018.v8JKIfoI031809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 19 Sep 2017 20:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323775 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 323775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 20:18:43 -0000 Author: rmacklem Date: Tue Sep 19 20:18:41 2017 New Revision: 323775 URL: https://svnweb.freebsd.org/changeset/base/323775 Log: Simplify nfsrpc_layoutcommit() args. Simplify nfsrpc_layoutcommit() args. in preparation for the addition of Flex File layout support, since it also uses a 0 length field. Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Tue Sep 19 20:09:58 2017 (r323774) +++ head/sys/fs/nfs/nfs_var.h Tue Sep 19 20:18:41 2017 (r323775) @@ -484,8 +484,8 @@ int nfsrpc_layoutget(struct nfsmount *, uint8_t *, int int nfsrpc_getdeviceinfo(struct nfsmount *, uint8_t *, int, uint32_t *, struct nfscldevinfo **, struct ucred *, NFSPROC_T *); int nfsrpc_layoutcommit(struct nfsmount *, uint8_t *, int, int, - uint64_t, uint64_t, uint64_t, nfsv4stateid_t *, int, int, uint8_t *, - struct ucred *, NFSPROC_T *, void *); + uint64_t, uint64_t, uint64_t, nfsv4stateid_t *, int, struct ucred *, + NFSPROC_T *, void *); int nfsrpc_layoutreturn(struct nfsmount *, uint8_t *, int, int, int, uint32_t, int, uint64_t, uint64_t, nfsv4stateid_t *, int, uint32_t *, struct ucred *, NFSPROC_T *, void *); Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Tue Sep 19 20:09:58 2017 (r323774) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Tue Sep 19 20:18:41 2017 (r323775) @@ -5030,13 +5030,11 @@ nfsmout: int nfsrpc_layoutcommit(struct nfsmount *nmp, uint8_t *fh, int fhlen, int reclaim, uint64_t off, uint64_t len, uint64_t lastbyte, nfsv4stateid_t *stateidp, - int layouttype, int layoutupdatecnt, uint8_t *layp, struct ucred *cred, - NFSPROC_T *p, void *stuff) + int layouttype, struct ucred *cred, NFSPROC_T *p, void *stuff) { uint32_t *tl; struct nfsrv_descript nfsd, *nd = &nfsd; - int error, outcnt, i; - uint8_t *cp; + int error; nfscl_reqstart(nd, NFSPROC_LAYOUTCOMMIT, nmp, fh, fhlen, NULL, NULL); NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED + 3 * NFSX_HYPER + @@ -5062,17 +5060,8 @@ nfsrpc_layoutcommit(struct nfsmount *nmp, uint8_t *fh, tl += 2; *tl++ = newnfs_false; *tl++ = txdr_unsigned(layouttype); - *tl = txdr_unsigned(layoutupdatecnt); - if (layoutupdatecnt > 0) { - KASSERT(layouttype != NFSLAYOUT_NFSV4_1_FILES, - ("Must be nil for Files Layout")); - outcnt = NFSM_RNDUP(layoutupdatecnt); - NFSM_BUILD(cp, uint8_t *, outcnt); - NFSBCOPY(layp, cp, layoutupdatecnt); - cp += layoutupdatecnt; - for (i = 0; i < (outcnt - layoutupdatecnt); i++) - *cp++ = 0x0; - } + /* All supported layouts are 0 length. */ + *tl = txdr_unsigned(0); nd->nd_flag |= ND_USEGSSNAME; error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Tue Sep 19 20:09:58 2017 (r323774) +++ head/sys/fs/nfsclient/nfs_clstate.c Tue Sep 19 20:18:41 2017 (r323775) @@ -5256,7 +5256,7 @@ nfscl_dolayoutcommit(struct nfsmount *nmp, struct nfsc error = nfsrpc_layoutcommit(nmp, lyp->nfsly_fh, lyp->nfsly_fhlen, 0, flp->nfsfl_off, len, lyp->nfsly_lastbyte, &lyp->nfsly_stateid, - NFSLAYOUT_NFSV4_1_FILES, 0, NULL, cred, p, NULL); + NFSLAYOUT_NFSV4_1_FILES, cred, p, NULL); NFSCL_DEBUG(4, "layoutcommit err=%d\n", error); if (error == NFSERR_NOTSUPP) { /* If not supported, don't bother doing it. */ From owner-svn-src-head@freebsd.org Tue Sep 19 20:24:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DCC5E024FC; Tue, 19 Sep 2017 20:24:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 180416B199; Tue, 19 Sep 2017 20:24:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JKOEuN035817; Tue, 19 Sep 2017 20:24:14 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JKOEZp035816; Tue, 19 Sep 2017 20:24:14 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709192024.v8JKOEZp035816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 19 Sep 2017 20:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323776 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 323776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 20:24:15 -0000 Author: tuexen Date: Tue Sep 19 20:24:13 2017 New Revision: 323776 URL: https://svnweb.freebsd.org/changeset/base/323776 Log: Fix a warning. MFC after: 1 week Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Sep 19 20:18:41 2017 (r323775) +++ head/sys/netinet/sctp_input.c Tue Sep 19 20:24:13 2017 (r323776) @@ -2579,7 +2579,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in } else { staleness = diff.tv_sec * 1000000; } - if (UINT32_MAX - staleness >= diff.tv_usec) { + if (UINT32_MAX - staleness >= (uint32_t)diff.tv_usec) { staleness += diff.tv_usec; } else { staleness = UINT32_MAX; From owner-svn-src-head@freebsd.org Tue Sep 19 20:33:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAEFEE02E77; Tue, 19 Sep 2017 20:33:23 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA3576B8FF; Tue, 19 Sep 2017 20:33:23 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JKXMgc039958; Tue, 19 Sep 2017 20:33:22 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JKXM9g039957; Tue, 19 Sep 2017 20:33:22 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201709192033.v8JKXM9g039957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Tue, 19 Sep 2017 20:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323777 - head/sys/arm/xscale/i8134x X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/arm/xscale/i8134x X-SVN-Commit-Revision: 323777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 20:33:24 -0000 Author: cognet Date: Tue Sep 19 20:33:22 2017 New Revision: 323777 URL: https://svnweb.freebsd.org/changeset/base/323777 Log: i81342 is little endian, not big endian. Modified: head/sys/arm/xscale/i8134x/std.i81342 Modified: head/sys/arm/xscale/i8134x/std.i81342 ============================================================================== --- head/sys/arm/xscale/i8134x/std.i81342 Tue Sep 19 20:24:13 2017 (r323776) +++ head/sys/arm/xscale/i8134x/std.i81342 Tue Sep 19 20:33:22 2017 (r323777) @@ -1,5 +1,6 @@ #XScale i81342 generic configuration #$FreeBSD$ files "../xscale/i8134x/files.i81342" -include "../xscale/std.xscale-be" +include "../xscale/std.xscale" cpu CPU_XSCALE_81342 +machine arm From owner-svn-src-head@freebsd.org Tue Sep 19 20:40:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AFF3E034EC; Tue, 19 Sep 2017 20:40:07 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 657436BC0D; Tue, 19 Sep 2017 20:40:07 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JKe6Vt040247; Tue, 19 Sep 2017 20:40:06 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JKe6Gk040242; Tue, 19 Sep 2017 20:40:06 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201709192040.v8JKe6Gk040242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Tue, 19 Sep 2017 20:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323778 - in head/sys: arm64/conf i386/conf powerpc/conf riscv/conf sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: jpaetzel X-SVN-Commit-Paths: in head/sys: arm64/conf i386/conf powerpc/conf riscv/conf sparc64/conf X-SVN-Commit-Revision: 323778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 20:40:07 -0000 Author: jpaetzel Date: Tue Sep 19 20:40:05 2017 New Revision: 323778 URL: https://svnweb.freebsd.org/changeset/base/323778 Log: Fix indentation for r323068 PR: 220170 Reported by: lidl MFC after: 3 days Pointyhat to: jpaetzel Modified: head/sys/arm64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/riscv/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Tue Sep 19 20:33:22 2017 (r323777) +++ head/sys/arm64/conf/GENERIC Tue Sep 19 20:40:05 2017 (r323778) @@ -29,7 +29,7 @@ options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC # IP (v4/v6) security -options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 +options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_HHOOK # hhook(9) framework for TCP options TCP_OFFLOAD # TCP offload options SCTP # Stream Control Transmission Protocol Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Tue Sep 19 20:33:22 2017 (r323777) +++ head/sys/i386/conf/GENERIC Tue Sep 19 20:40:05 2017 (r323778) @@ -31,7 +31,7 @@ options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC # IP (v4/v6) security -options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 +options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_HHOOK # hhook(9) framework for TCP options TCP_OFFLOAD # TCP offload options SCTP # Stream Control Transmission Protocol Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Tue Sep 19 20:33:22 2017 (r323777) +++ head/sys/powerpc/conf/GENERIC Tue Sep 19 20:40:05 2017 (r323778) @@ -38,7 +38,7 @@ options PREEMPTION #Enable kernel thread preemption options INET #InterNETworking options INET6 #IPv6 communications protocols options IPSEC # IP (v4/v6) security -options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 +options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_HHOOK # hhook(9) framework for TCP options SCTP #Stream Control Transmission Protocol options FFS #Berkeley Fast Filesystem Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Tue Sep 19 20:33:22 2017 (r323777) +++ head/sys/riscv/conf/GENERIC Tue Sep 19 20:40:05 2017 (r323778) @@ -34,7 +34,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP options IPSEC # IP (v4/v6) security -options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 +options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_OFFLOAD # TCP offload options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Tue Sep 19 20:33:22 2017 (r323777) +++ head/sys/sparc64/conf/GENERIC Tue Sep 19 20:40:05 2017 (r323778) @@ -31,7 +31,7 @@ options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC # IP (v4/v6) security -options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 +options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_HHOOK # hhook(9) framework for TCP options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem From owner-svn-src-head@freebsd.org Tue Sep 19 20:45:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 116D6E03A86; Tue, 19 Sep 2017 20:45:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFB9C6C1CD; Tue, 19 Sep 2017 20:45:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JKjQKm044376; Tue, 19 Sep 2017 20:45:26 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JKjPOc044372; Tue, 19 Sep 2017 20:45:25 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201709192045.v8JKjPOc044372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 19 Sep 2017 20:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323779 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 323779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 20:45:27 -0000 Author: rmacklem Date: Tue Sep 19 20:45:25 2017 New Revision: 323779 URL: https://svnweb.freebsd.org/changeset/base/323779 Log: Simplify nfsrpc_layoutreturn() args. Simplify nfsrpc_layoutreturn() args. in preparation for the addition of Flex File layout support, since File layout uses a 0 length field. Flex Files does use a longer field, but that will be added in a subsequent commit. Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Tue Sep 19 20:40:05 2017 (r323778) +++ head/sys/fs/nfs/nfs_var.h Tue Sep 19 20:45:25 2017 (r323779) @@ -487,8 +487,8 @@ int nfsrpc_layoutcommit(struct nfsmount *, uint8_t *, uint64_t, uint64_t, uint64_t, nfsv4stateid_t *, int, struct ucred *, NFSPROC_T *, void *); int nfsrpc_layoutreturn(struct nfsmount *, uint8_t *, int, int, int, uint32_t, - int, uint64_t, uint64_t, nfsv4stateid_t *, int, uint32_t *, struct ucred *, - NFSPROC_T *, void *); + int, uint64_t, uint64_t, nfsv4stateid_t *, struct ucred *, NFSPROC_T *, + void *); int nfsrpc_reclaimcomplete(struct nfsmount *, struct ucred *, NFSPROC_T *); int nfscl_doiods(vnode_t, struct uio *, int *, int *, uint32_t, int, struct ucred *, NFSPROC_T *); Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Tue Sep 19 20:40:05 2017 (r323778) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Tue Sep 19 20:45:25 2017 (r323779) @@ -5078,13 +5078,12 @@ nfsrpc_layoutcommit(struct nfsmount *nmp, uint8_t *fh, int nfsrpc_layoutreturn(struct nfsmount *nmp, uint8_t *fh, int fhlen, int reclaim, int layouttype, uint32_t iomode, int layoutreturn, uint64_t offset, - uint64_t len, nfsv4stateid_t *stateidp, int layoutcnt, uint32_t *layp, - struct ucred *cred, NFSPROC_T *p, void *stuff) + uint64_t len, nfsv4stateid_t *stateidp, struct ucred *cred, NFSPROC_T *p, + void *stuff) { uint32_t *tl; struct nfsrv_descript nfsd, *nd = &nfsd; - int error, outcnt, i; - uint8_t *cp; + int error; nfscl_reqstart(nd, NFSPROC_LAYOUTRETURN, nmp, fh, fhlen, NULL, NULL); NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); @@ -5107,15 +5106,7 @@ nfsrpc_layoutreturn(struct nfsmount *nmp, uint8_t *fh, *tl++ = stateidp->other[0]; *tl++ = stateidp->other[1]; *tl++ = stateidp->other[2]; - *tl = txdr_unsigned(layoutcnt); - if (layoutcnt > 0) { - outcnt = NFSM_RNDUP(layoutcnt); - NFSM_BUILD(cp, uint8_t *, outcnt); - NFSBCOPY(layp, cp, layoutcnt); - cp += layoutcnt; - for (i = 0; i < (outcnt - layoutcnt); i++) - *cp++ = 0x0; - } + *tl = txdr_unsigned(0); } nd->nd_flag |= ND_USEGSSNAME; error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Tue Sep 19 20:40:05 2017 (r323778) +++ head/sys/fs/nfsclient/nfs_clstate.c Tue Sep 19 20:45:25 2017 (r323779) @@ -5235,7 +5235,7 @@ nfscl_layoutreturn(struct nfsmount *nmp, struct nfscll lyp->nfsly_fhlen, 0, NFSLAYOUT_NFSV4_1_FILES, rp->nfsrecly_iomode, rp->nfsrecly_recalltype, rp->nfsrecly_off, rp->nfsrecly_len, - &stateid, 0, NULL, cred, p, NULL); + &stateid, cred, p, NULL); } } From owner-svn-src-head@freebsd.org Tue Sep 19 21:04:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01E94E04C76; Tue, 19 Sep 2017 21:04:57 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E29416CDAD; Tue, 19 Sep 2017 21:04:56 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from aurora.physics.berkeley.edu (aurora.physics.berkeley.edu [128.32.117.67]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id v8JL4mGo013096 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 19 Sep 2017 14:04:49 -0700 Subject: Re: svn commit: r323778 - in head/sys: arm64/conf i386/conf powerpc/conf riscv/conf sparc64/conf To: Josh Paetzel , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201709192040.v8JKe6Gk040242@repo.freebsd.org> From: Nathan Whitehorn Message-ID: Date: Tue, 19 Sep 2017 14:04:48 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201709192040.v8JKe6Gk040242@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVamnJAGddddBAX9DOChiPzpEleKBPC053CsiOg95kiNNENZR7OVD+tgRRfwTzlR1M968cFa2Mp5qb8yMD3y1kT49a24dI6pyEA= X-Sonic-ID: C;uPcFLH6d5xG+hfsKk0eh0A== M;6DJFLH6d5xG+hfsKk0eh0A== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 21:04:57 -0000 Please remember that not all "GENERIC" kernels are named "GENERIC". In particular, the powerpc64 "GENERIC" is called "GENERIC64" (and I am assuming needs the same changes). -Nathan On 09/19/17 13:40, Josh Paetzel wrote: > Author: jpaetzel > Date: Tue Sep 19 20:40:05 2017 > New Revision: 323778 > URL: https://svnweb.freebsd.org/changeset/base/323778 > > Log: > Fix indentation for r323068 > > PR: 220170 > Reported by: lidl > MFC after: 3 days > Pointyhat to: jpaetzel > > Modified: > head/sys/arm64/conf/GENERIC > head/sys/i386/conf/GENERIC > head/sys/powerpc/conf/GENERIC > head/sys/riscv/conf/GENERIC > head/sys/sparc64/conf/GENERIC > > Modified: head/sys/arm64/conf/GENERIC > ============================================================================== > --- head/sys/arm64/conf/GENERIC Tue Sep 19 20:33:22 2017 (r323777) > +++ head/sys/arm64/conf/GENERIC Tue Sep 19 20:40:05 2017 (r323778) > @@ -29,7 +29,7 @@ options PREEMPTION # Enable kernel thread preemption > options INET # InterNETworking > options INET6 # IPv6 communications protocols > options IPSEC # IP (v4/v6) security > -options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 > +options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 > options TCP_HHOOK # hhook(9) framework for TCP > options TCP_OFFLOAD # TCP offload > options SCTP # Stream Control Transmission Protocol > > Modified: head/sys/i386/conf/GENERIC > ============================================================================== > --- head/sys/i386/conf/GENERIC Tue Sep 19 20:33:22 2017 (r323777) > +++ head/sys/i386/conf/GENERIC Tue Sep 19 20:40:05 2017 (r323778) > @@ -31,7 +31,7 @@ options PREEMPTION # Enable kernel thread preemption > options INET # InterNETworking > options INET6 # IPv6 communications protocols > options IPSEC # IP (v4/v6) security > -options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 > +options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 > options TCP_HHOOK # hhook(9) framework for TCP > options TCP_OFFLOAD # TCP offload > options SCTP # Stream Control Transmission Protocol > > Modified: head/sys/powerpc/conf/GENERIC > ============================================================================== > --- head/sys/powerpc/conf/GENERIC Tue Sep 19 20:33:22 2017 (r323777) > +++ head/sys/powerpc/conf/GENERIC Tue Sep 19 20:40:05 2017 (r323778) > @@ -38,7 +38,7 @@ options PREEMPTION #Enable kernel thread preemption > options INET #InterNETworking > options INET6 #IPv6 communications protocols > options IPSEC # IP (v4/v6) security > -options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 > +options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 > options TCP_HHOOK # hhook(9) framework for TCP > options SCTP #Stream Control Transmission Protocol > options FFS #Berkeley Fast Filesystem > > Modified: head/sys/riscv/conf/GENERIC > ============================================================================== > --- head/sys/riscv/conf/GENERIC Tue Sep 19 20:33:22 2017 (r323777) > +++ head/sys/riscv/conf/GENERIC Tue Sep 19 20:40:05 2017 (r323778) > @@ -34,7 +34,7 @@ options INET # InterNETworking > options INET6 # IPv6 communications protocols > options TCP_HHOOK # hhook(9) framework for TCP > options IPSEC # IP (v4/v6) security > -options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 > +options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 > options TCP_OFFLOAD # TCP offload > options SCTP # Stream Control Transmission Protocol > options FFS # Berkeley Fast Filesystem > > Modified: head/sys/sparc64/conf/GENERIC > ============================================================================== > --- head/sys/sparc64/conf/GENERIC Tue Sep 19 20:33:22 2017 (r323777) > +++ head/sys/sparc64/conf/GENERIC Tue Sep 19 20:40:05 2017 (r323778) > @@ -31,7 +31,7 @@ options PREEMPTION # Enable kernel thread preemption > options INET # InterNETworking > options INET6 # IPv6 communications protocols > options IPSEC # IP (v4/v6) security > -options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 > +options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 > options TCP_HHOOK # hhook(9) framework for TCP > options SCTP # Stream Control Transmission Protocol > options FFS # Berkeley Fast Filesystem > From owner-svn-src-head@freebsd.org Tue Sep 19 21:31:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AF34E06435; Tue, 19 Sep 2017 21:31:37 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 515936DA39; Tue, 19 Sep 2017 21:31:37 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JLVaj8064815; Tue, 19 Sep 2017 21:31:36 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JLVau0064813; Tue, 19 Sep 2017 21:31:36 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201709192131.v8JLVau0064813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 19 Sep 2017 21:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323780 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 323780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 21:31:37 -0000 Author: rmacklem Date: Tue Sep 19 21:31:36 2017 New Revision: 323780 URL: https://svnweb.freebsd.org/changeset/base/323780 Log: Add a new function called nfsm_uiombuflist(), similar to nfsm_uiombuf(). This patch adds a new function called nfsm_uiombuflist(), which is similar to nfsm_uiombuf(), but doesn't not use the fields in struct nfsrv_descript. This new function will be used by the pNFS client for writing to mirrors using Flex Files layout. The function is not yet called anywhere. Also, get rid of #ifndef APPLE, which is ancient cruft left over from the Mac OSX port of the NFSv4 client. Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs_clcomsubs.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Tue Sep 19 20:45:25 2017 (r323779) +++ head/sys/fs/nfs/nfs_var.h Tue Sep 19 21:31:36 2017 (r323780) @@ -301,6 +301,7 @@ struct ucred *nfsrv_getgrpscred(struct ucred *); /* nfs_clcomsubs.c */ void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); +struct mbuf *nfsm_uiombuflist(struct uio *, int, struct mbuf **, char **); void nfscl_reqstart(struct nfsrv_descript *, int, struct nfsmount *, u_int8_t *, int, u_int32_t **, struct nfsclsession *); nfsuint64 *nfscl_getcookie(struct nfsnode *, off_t off, int); Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Tue Sep 19 20:45:25 2017 (r323779) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Tue Sep 19 21:31:36 2017 (r323780) @@ -250,7 +250,6 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, NFSINCRGLOBAL(nfsstatsv1.rpccnt[procnum]); } -#ifndef APPLE /* * copies a uio scatter/gather list to an mbuf chain. * NOTE: can ony handle iovcnt == 1 @@ -332,7 +331,89 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *ui nd->nd_bpos = NFSMTOD(mp, caddr_t) + mbuf_len(mp); nd->nd_mb = mp; } -#endif /* !APPLE */ + +/* + * copies a uio scatter/gather list to an mbuf chain. + * This version returns the mbuf list and does not use "nd". + * NOTE: can ony handle iovcnt == 1 + */ +struct mbuf * +nfsm_uiombuflist(struct uio *uiop, int siz, struct mbuf **mbp, char **cpp) +{ + char *uiocp; + struct mbuf *mp, *mp2, *firstmp; + int xfer, left, mlen; + int uiosiz, clflg, rem; + char *cp, *tcp; + + KASSERT(uiop->uio_iovcnt == 1, ("nfsm_uiotombuf: iovcnt != 1")); + + if (siz > ncl_mbuf_mlen) /* or should it >= MCLBYTES ?? */ + clflg = 1; + else + clflg = 0; + rem = NFSM_RNDUP(siz) - siz; + if (clflg != 0) + NFSMCLGET(mp, M_WAITOK); + else + NFSMGET(mp); + mbuf_setlen(mp, 0); + firstmp = mp2 = mp; + while (siz > 0) { + left = uiop->uio_iov->iov_len; + uiocp = uiop->uio_iov->iov_base; + if (left > siz) + left = siz; + uiosiz = left; + while (left > 0) { + mlen = M_TRAILINGSPACE(mp); + if (mlen == 0) { + if (clflg) + NFSMCLGET(mp, M_WAITOK); + else + NFSMGET(mp); + mbuf_setlen(mp, 0); + mbuf_setnext(mp2, mp); + mp2 = mp; + mlen = M_TRAILINGSPACE(mp); + } + xfer = (left > mlen) ? mlen : left; + if (uiop->uio_segflg == UIO_SYSSPACE) + NFSBCOPY(uiocp, NFSMTOD(mp, caddr_t) + + mbuf_len(mp), xfer); + else + copyin(uiocp, NFSMTOD(mp, caddr_t) + + mbuf_len(mp), xfer); + mbuf_setlen(mp, mbuf_len(mp) + xfer); + left -= xfer; + uiocp += xfer; + uiop->uio_offset += xfer; + uiop->uio_resid -= xfer; + } + tcp = (char *)uiop->uio_iov->iov_base; + tcp += uiosiz; + uiop->uio_iov->iov_base = (void *)tcp; + uiop->uio_iov->iov_len -= uiosiz; + siz -= uiosiz; + } + if (rem > 0) { + if (rem > M_TRAILINGSPACE(mp)) { + NFSMGET(mp); + mbuf_setlen(mp, 0); + mbuf_setnext(mp2, mp); + } + cp = NFSMTOD(mp, caddr_t) + mbuf_len(mp); + for (left = 0; left < rem; left++) + *cp++ = '\0'; + mbuf_setlen(mp, mbuf_len(mp) + rem); + if (cpp != NULL) + *cpp = cp; + } else if (cpp != NULL) + *cpp = NFSMTOD(mp, caddr_t) + mbuf_len(mp); + if (mbp != NULL) + *mbp = mp; + return (firstmp); +} /* * Load vnode attributes from the xdr file attributes. From owner-svn-src-head@freebsd.org Tue Sep 19 22:17:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 960D5E09218; Tue, 19 Sep 2017 22:17:32 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 718046F562; Tue, 19 Sep 2017 22:17:32 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JMHViv082689; Tue, 19 Sep 2017 22:17:31 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JMHUtM082688; Tue, 19 Sep 2017 22:17:30 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201709192217.v8JMHUtM082688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 19 Sep 2017 22:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323781 - head/sys/dev/qlxgbe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: head/sys/dev/qlxgbe X-SVN-Commit-Revision: 323781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 22:17:32 -0000 Author: davidcs Date: Tue Sep 19 22:17:30 2017 New Revision: 323781 URL: https://svnweb.freebsd.org/changeset/base/323781 Log: Update minidump template for version 5.4.66 MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_minidump.c Modified: head/sys/dev/qlxgbe/ql_minidump.c ============================================================================== --- head/sys/dev/qlxgbe/ql_minidump.c Tue Sep 19 21:31:36 2017 (r323780) +++ head/sys/dev/qlxgbe/ql_minidump.c Tue Sep 19 22:17:30 2017 (r323781) @@ -41,7 +41,7 @@ unsigned int ql83xx_minidump_version_sub = 66; unsigned char ql83xx_minidump[] = { 0x63, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xaa, 0x05, 0x00, 0x00, 0x04, 0x00, 0x02, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x52, 0x1d, 0x95, 0x7b, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x36, 0x87, 0x40, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x31, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -49,7 +49,7 @@ unsigned char ql83xx_minidump[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0xdc, 0xfb, 0x07, 0x00, - 0x00, 0x8a, 0x2b, 0x00, 0x80, 0x73, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x8a, 0x2b, 0x00, 0x40, 0x6f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x4a, 0x3b, 0x00, 0x00, 0x10, 0x03, 0x08, 0x00, 0x08, 0x31, 0x77, 0x04, 0x08, 0x31, 0x77, 0x08, 0x08, 0x31, 0x77, 0x0c, 0x08, 0x31, 0x77, 0x10, 0x08, 0x31, 0x77, 0x1c, 0x08, 0x31, 0x77, @@ -61,8 +61,8 @@ unsigned char ql83xx_minidump[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc9, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, - 0xe0, 0x91, 0x00, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x11, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, + 0x00, 0x93, 0x00, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x11, 0x01, 0x00, 0x62, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x30, 0x77, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, @@ -2935,10 +2935,26 @@ unsigned char ql83xx_minidump[] = { 0x08, 0xd6, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x18, 0x02, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x20, 0xe8, 0x01, 0x06, 0x00, 0x00, 0x02, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x11, 0x06, 0x00, 0x80, 0x02, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xe0, 0x17, 0x00, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x14, 0x06, 0xe0, 0x17, 0x00, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x55, 0x06, 0xe0, 0x1f, 0x00, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x04, 0xc8, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xd5, 0x00, 0x00, 0x80, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0xd5, 0x00, 0x00, 0x80, 0x02, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x04, 0xca, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -2946,7 +2962,7 @@ unsigned char ql83xx_minidump[] = { 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x14, 0x00, 0x04, 0xc9, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x03, 0x00, 0x0a, 0x14, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x0a, 0x14, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, 0xd7, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -3050,11 +3066,11 @@ unsigned char ql83xx_minidump[] = { 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x02, 0xd8, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0xd4, 0x00, 0x50, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xd4, 0x00, 0x50, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x02, 0xd9, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x76, 0x03, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0x96, 0x03, 0x20, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0xff, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -3151,6 +3167,14 @@ unsigned char ql83xx_minidump[] = { 0x04, 0xff, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x82, 0x00, 0x00, 0x04, 0x00, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x08, 0xcd, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0xc6, 0x01, 0x00, 0x40, 0x00, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, + 0x08, 0xce, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x1a, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -3915,30 +3939,6 @@ unsigned char ql83xx_minidump[] = { 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x80, 0x22, 0x00, 0x00, 0x30, 0x00, 0x11, 0x42, 0x04, 0x01, 0x04, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x15, 0x42, 0x00, 0x00, 0xff, 0xff, @@ -10959,8 +10959,8 @@ unsigned char ql83xx_minidump[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x05, 0x00, 0x40, 0x40, 0x05, 0x04, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x40, 0x40, 0x05, 0x04, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x34, 0x39, 0x7c, 0xbf + 0x00, 0x00, 0x00, 0x00, 0x34, 0x39, 0x7b, 0xbf }; unsigned int ql83xx_minidump_len = 131072; From owner-svn-src-head@freebsd.org Tue Sep 19 23:26:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12877E0D00D; Tue, 19 Sep 2017 23:26:29 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3F7E71370; Tue, 19 Sep 2017 23:26:28 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JNQSTA010890; Tue, 19 Sep 2017 23:26:28 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JNQRpm010888; Tue, 19 Sep 2017 23:26:27 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201709192326.v8JNQRpm010888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 19 Sep 2017 23:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323782 - head/sys/dev/qlxgbe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: head/sys/dev/qlxgbe X-SVN-Commit-Revision: 323782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 23:26:29 -0000 Author: davidcs Date: Tue Sep 19 23:26:27 2017 New Revision: 323782 URL: https://svnweb.freebsd.org/changeset/base/323782 Log: Add sysctl "enable_minidump" to turn on/off automatic minidump retrieval MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_def.h ============================================================================== --- head/sys/dev/qlxgbe/ql_def.h Tue Sep 19 22:17:30 2017 (r323781) +++ head/sys/dev/qlxgbe/ql_def.h Tue Sep 19 23:26:27 2017 (r323782) @@ -239,6 +239,7 @@ struct qla_host { volatile const char *qla_lock; volatile const char *qla_unlock; uint32_t dbg_level; + uint32_t enable_minidump; uint8_t fw_ver_str[32]; Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Tue Sep 19 22:17:30 2017 (r323781) +++ head/sys/dev/qlxgbe/ql_os.c Tue Sep 19 23:26:27 2017 (r323782) @@ -185,6 +185,13 @@ qla_add_sysctls(qla_host_t *ha) OID_AUTO, "debug", CTLFLAG_RW, &ha->dbg_level, ha->dbg_level, "Debug Level"); + ha->enable_minidump = 1; + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "enable_minidump", CTLFLAG_RW, + &ha->enable_minidump, ha->enable_minidump, + "Minidump retrival is enabled only when this is set"); + ha->std_replenish = QL_STD_REPLENISH_THRES; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -2025,7 +2032,8 @@ device_printf(ha->pci_dev, "%s: enter\n", __func__); ha->msg_from_peer = 0; - ql_minidump(ha); + if (ha->enable_minidump) + ql_minidump(ha); (void) ql_init_hw(ha); From owner-svn-src-head@freebsd.org Tue Sep 19 23:28:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 022D6E0D29D; Tue, 19 Sep 2017 23:28:24 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5255715D0; Tue, 19 Sep 2017 23:28:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JNSN9K010995; Tue, 19 Sep 2017 23:28:23 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JNSMwk010992; Tue, 19 Sep 2017 23:28:22 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201709192328.v8JNSMwk010992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 19 Sep 2017 23:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323783 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 323783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 23:28:24 -0000 Author: rmacklem Date: Tue Sep 19 23:28:22 2017 New Revision: 323783 URL: https://svnweb.freebsd.org/changeset/base/323783 Log: Make the nfsrpc_layoutget() function a static. Make the NFSv4 pNFS client function nfsrpc_layoutget() a static, since it is only used in sys/fs/nfsclient/nfs_clrpcops.c. This prepares the code for future patches that add Flex File layout support. Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Tue Sep 19 23:26:27 2017 (r323782) +++ head/sys/fs/nfs/nfs_var.h Tue Sep 19 23:28:22 2017 (r323783) @@ -479,9 +479,6 @@ int nfsrpc_destroysession(struct nfsmount *, struct nf struct ucred *, NFSPROC_T *); int nfsrpc_destroyclient(struct nfsmount *, struct nfsclclient *, struct ucred *, NFSPROC_T *); -int nfsrpc_layoutget(struct nfsmount *, uint8_t *, int, int, uint64_t, uint64_t, - uint64_t, int, nfsv4stateid_t *, int *, struct nfsclflayouthead *, - struct ucred *, NFSPROC_T *, void *); int nfsrpc_getdeviceinfo(struct nfsmount *, uint8_t *, int, uint32_t *, struct nfscldevinfo **, struct ucred *, NFSPROC_T *); int nfsrpc_layoutcommit(struct nfsmount *, uint8_t *, int, int, Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Tue Sep 19 23:26:27 2017 (r323782) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Tue Sep 19 23:28:22 2017 (r323783) @@ -146,6 +146,9 @@ static int nfsrpc_createlayout(vnode_t, char *, int, s struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, struct nfsfh **, int *, int *, void *, int *, nfsv4stateid_t *, int, int, int *, struct nfsclflayouthead *, int *); +static int nfsrpc_layoutget(struct nfsmount *, uint8_t *, int, int, uint64_t, + uint64_t, uint64_t, int, nfsv4stateid_t *, int *, struct nfsclflayouthead *, + struct ucred *, NFSPROC_T *, void *); static int nfsrpc_layoutgetres(struct nfsmount *, vnode_t, uint8_t *, int, nfsv4stateid_t *, int, uint32_t *, struct nfscllayout **, struct nfsclflayouthead *, int, int *, struct ucred *, NFSPROC_T *); @@ -4838,7 +4841,7 @@ nfsrpc_destroyclient(struct nfsmount *nmp, struct nfsc /* * Do the NFSv4.1 LayoutGet. */ -int +static int nfsrpc_layoutget(struct nfsmount *nmp, uint8_t *fhp, int fhlen, int iomode, uint64_t offset, uint64_t len, uint64_t minlen, int layoutlen, nfsv4stateid_t *stateidp, int *retonclosep, struct nfsclflayouthead *flhp, From owner-svn-src-head@freebsd.org Tue Sep 19 23:41:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7855FE0DEA2; Tue, 19 Sep 2017 23:41:56 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47D3271EC4; Tue, 19 Sep 2017 23:41:56 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JNftA2016027; Tue, 19 Sep 2017 23:41:55 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JNftPC016026; Tue, 19 Sep 2017 23:41:55 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201709192341.v8JNftPC016026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Tue, 19 Sep 2017 23:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323784 - head/sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/arm/include X-SVN-Commit-Revision: 323784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Sep 2017 23:41:56 -0000 Author: cognet Date: Tue Sep 19 23:41:55 2017 New Revision: 323784 URL: https://svnweb.freebsd.org/changeset/base/323784 Log: Define CPU_XSCALE_CORE3 when relevant. It was lost when cpuconf.h was deobirted. Modified: head/sys/arm/include/pmap-v4.h Modified: head/sys/arm/include/pmap-v4.h ============================================================================== --- head/sys/arm/include/pmap-v4.h Tue Sep 19 23:28:22 2017 (r323783) +++ head/sys/arm/include/pmap-v4.h Tue Sep 19 23:41:55 2017 (r323784) @@ -356,6 +356,7 @@ extern int pmap_needs_pte_sync; #endif /* ARM_NMMUS > 1 */ #if defined(CPU_XSCALE_81342) +#define CPU_XSCALE_CORE3 #define PMAP_NEEDS_PTE_SYNC 1 #define PMAP_INCLUDE_PTE_SYNC #else From owner-svn-src-head@freebsd.org Wed Sep 20 04:19:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1F3AE1F128; Wed, 20 Sep 2017 04:19:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CFC27E204; Wed, 20 Sep 2017 04:19:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8K4JnJA030538; Wed, 20 Sep 2017 04:19:49 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8K4JnVM030537; Wed, 20 Sep 2017 04:19:49 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201709200419.v8K4JnVM030537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 20 Sep 2017 04:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323785 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 323785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 04:19:50 -0000 Author: alc Date: Wed Sep 20 04:19:49 2017 New Revision: 323785 URL: https://svnweb.freebsd.org/changeset/base/323785 Log: Sync with amd64/arm/arm64/i386/mips pmap change r288256: Exploit r288122 to address a cosmetic issue. Since PV chunk pages don't belong to a vm object, they can't be paged out. Since they can't be paged out, they are never enqueued in a paging queue. Nonetheless, passing PQ_INACTIVE to vm_page_unwire() creates the appearance that these pages are being enqueued in the inactive queue. As of r288122, we can avoid this false impression by passing PQ_NONE. MFC after: 1 week Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Tue Sep 19 23:41:55 2017 (r323784) +++ head/sys/riscv/riscv/pmap.c Wed Sep 20 04:19:49 2017 (r323785) @@ -1614,7 +1614,7 @@ free_pv_chunk(struct pv_chunk *pc) #if 0 /* TODO: For minidump */ dump_drop_page(m->phys_addr); #endif - vm_page_unwire(m, PQ_INACTIVE); + vm_page_unwire(m, PQ_NONE); vm_page_free(m); } From owner-svn-src-head@freebsd.org Wed Sep 20 04:59:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0C24E2174B; Wed, 20 Sep 2017 04:59:53 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B85FB7F618; Wed, 20 Sep 2017 04:59:53 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8K4xq8K046738; Wed, 20 Sep 2017 04:59:52 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8K4xqKY046737; Wed, 20 Sep 2017 04:59:52 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201709200459.v8K4xqKY046737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 20 Sep 2017 04:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323786 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 323786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 04:59:54 -0000 Author: alc Date: Wed Sep 20 04:59:52 2017 New Revision: 323786 URL: https://svnweb.freebsd.org/changeset/base/323786 Log: In r288122, we changed vm_page_unwire() so that it returns a Boolean indicating whether the page's wire count transitioned to zero. Use that return value in zbuf_page_free() rather than checking the wire count. MFC after: 1 week Modified: head/sys/net/bpf_zerocopy.c Modified: head/sys/net/bpf_zerocopy.c ============================================================================== --- head/sys/net/bpf_zerocopy.c Wed Sep 20 04:19:49 2017 (r323785) +++ head/sys/net/bpf_zerocopy.c Wed Sep 20 04:59:52 2017 (r323786) @@ -114,8 +114,7 @@ zbuf_page_free(vm_page_t pp) { vm_page_lock(pp); - vm_page_unwire(pp, PQ_INACTIVE); - if (pp->wire_count == 0 && pp->object == NULL) + if (vm_page_unwire(pp, PQ_INACTIVE) && pp->object == NULL) vm_page_free(pp); vm_page_unlock(pp); } From owner-svn-src-head@freebsd.org Wed Sep 20 07:23:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACEF8E27729; Wed, 20 Sep 2017 07:23:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8981483ACC; Wed, 20 Sep 2017 07:23:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8K7Noi3007471; Wed, 20 Sep 2017 07:23:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8K7NoXb007469; Wed, 20 Sep 2017 07:23:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201709200723.v8K7NoXb007469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 20 Sep 2017 07:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323791 - in head/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-SVN-Commit-Revision: 323791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 07:23:51 -0000 Author: avg Date: Wed Sep 20 07:23:50 2017 New Revision: 323791 URL: https://svnweb.freebsd.org/changeset/base/323791 Log: MFV r323790: 8567 Inconsistent return value in zpool_read_label illumos/illumos-gate@c861bfbd77c4ae780a0341e9cb6926d8b74341cf https://github.com/illumos/illumos-gate/commit/c861bfbd77c4ae780a0341e9cb6926d8b74341cf https://www.illumos.org/issues/8567 If fstat64 fails, pread64 fails, or the label is unintelligible, zpool_read_label will return 0. But if malloc fails, it will return -1. For consistency, it should always return -1 on failure or 0 on success. Reviewed by: Prakash Surya Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Alan Somers MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Sep 20 07:18:09 2017 (r323790) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Sep 20 07:23:50 2017 (r323791) @@ -705,7 +705,7 @@ zpool_do_labelclear(int argc, char **argv) return (1); } - if (zpool_read_label(fd, &config) != 0 || config == NULL) { + if (zpool_read_label(fd, &config) != 0) { (void) fprintf(stderr, gettext("failed to read label from %s\n"), vdev); return (1); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Wed Sep 20 07:18:09 2017 (r323790) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Wed Sep 20 07:23:50 2017 (r323791) @@ -865,6 +865,7 @@ label_offset(uint64_t size, int l) /* * Given a file descriptor, read the label information and return an nvlist * describing the configuration, if there is one. + * Return 0 on success, or -1 on failure */ int zpool_read_label(int fd, nvlist_t **config) @@ -877,7 +878,7 @@ zpool_read_label(int fd, nvlist_t **config) *config = NULL; if (fstat64(fd, &statbuf) == -1) - return (0); + return (-1); size = P2ALIGN_TYPED(statbuf.st_size, sizeof (vdev_label_t), uint64_t); if ((label = malloc(sizeof (vdev_label_t))) == NULL) @@ -911,7 +912,7 @@ zpool_read_label(int fd, nvlist_t **config) free(label); *config = NULL; - return (0); + return (-1); } /* @@ -1148,7 +1149,7 @@ zpool_open_func(void *arg) } #endif /* illumos */ - if ((zpool_read_label(fd, &config)) != 0) { + if ((zpool_read_label(fd, &config)) != 0 && errno == ENOMEM) { (void) close(fd); (void) no_memory(rn->rn_hdl); return; @@ -1649,7 +1650,7 @@ zpool_in_use(libzfs_handle_t *hdl, int fd, pool_state_ *inuse = B_FALSE; - if (zpool_read_label(fd, &config) != 0) { + if (zpool_read_label(fd, &config) != 0 && errno == ENOMEM) { (void) no_memory(hdl); return (-1); } From owner-svn-src-head@freebsd.org Wed Sep 20 07:26:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17997E27964; Wed, 20 Sep 2017 07:26:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D968083E31; Wed, 20 Sep 2017 07:26:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8K7Qr53007691; Wed, 20 Sep 2017 07:26:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8K7Qrhn007690; Wed, 20 Sep 2017 07:26:53 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201709200726.v8K7Qrhn007690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 20 Sep 2017 07:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323793 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 323793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 07:26:54 -0000 Author: avg Date: Wed Sep 20 07:26:52 2017 New Revision: 323793 URL: https://svnweb.freebsd.org/changeset/base/323793 Log: MFV r323792: 8602 remove unused "dp_early_sync_tasks" field from "dsl_pool" structure illumos/illumos-gate@2bcb5458541cc6e8bf7dc541303da29297b82e8b https://github.com/illumos/illumos-gate/commit/2bcb5458541cc6e8bf7dc541303da29297b82e8b https://www.illumos.org/issues/8602 When I landed the fix for 8558, I incorrectly added the "dp_early_sync_tasks" field to the "dsl_pool" structure. This field is used in DelphixOS, but not in illumos. It was incorrectly pulled into illumos, so this bug is to remove it from the structure. Reviewed by: Serapheim Dimitropoulos Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Prakash Surya MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Wed Sep 20 07:24:57 2017 (r323792) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Wed Sep 20 07:26:52 2017 (r323793) @@ -123,7 +123,6 @@ typedef struct dsl_pool { txg_list_t dp_sync_tasks; taskq_t *dp_sync_taskq; taskq_t *dp_zil_clean_taskq; - txg_list_t dp_early_sync_tasks; /* * Protects administrative changes (properties, namespace) From owner-svn-src-head@freebsd.org Wed Sep 20 08:27:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFE99E0231E; Wed, 20 Sep 2017 08:27:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E118228D; Wed, 20 Sep 2017 08:27:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8K8RLgQ032317; Wed, 20 Sep 2017 08:27:21 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8K8RLiK032316; Wed, 20 Sep 2017 08:27:21 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201709200827.v8K8RLiK032316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 20 Sep 2017 08:27:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323796 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 323796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 08:27:22 -0000 Author: avg Date: Wed Sep 20 08:27:21 2017 New Revision: 323796 URL: https://svnweb.freebsd.org/changeset/base/323796 Log: fix memory leak in g_bio zone introduced in r320452, another ABD fallout I overlooked the fact that that ZIO_IOCTL_PIPELINE does not include ZIO_STAGE_VDEV_IO_DONE stage. We do allocate a struct bio for an ioctl zio (a disk cache flush), but we never freed it. This change splits bio handling into two groups, one for normal read/write i/o that passes data around and, thus, needs the abd data tranform; the other group is for "data-less" i/o such as trim and cache flush. PR: 222288 Reported by: Dan Nelson Tested by: Borja Marcos MFC after: 10 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Sep 20 07:28:18 2017 (r323795) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Sep 20 08:27:21 2017 (r323796) @@ -989,6 +989,15 @@ vdev_geom_io_intr(struct bio *bp) break; } + /* + * We have to split bio freeing into two parts, because the ABD code + * cannot be called in this context and vdev_op_io_done is not called + * for ZIO_TYPE_IOCTL zio-s. + */ + if (zio->io_type != ZIO_TYPE_READ && zio->io_type != ZIO_TYPE_WRITE) { + g_destroy_bio(bp); + zio->io_bio = NULL; + } zio_delay_interrupt(zio); } @@ -1090,21 +1099,23 @@ vdev_geom_io_done(zio_t *zio) { struct bio *bp = zio->io_bio; + if (zio->io_type != ZIO_TYPE_READ && zio->io_type != ZIO_TYPE_WRITE) { + ASSERT(bp == NULL); + return; + } + if (bp == NULL) { - ASSERT3S(zio->io_error, !=, 0); - IMPLY(zio->io_type == ZIO_TYPE_READ || - zio->io_type == ZIO_TYPE_WRITE, - zio->io_error == ENXIO); + ASSERT3S(zio->io_error, ==, ENXIO); return; } - if (zio->io_type == ZIO_TYPE_READ) { + if (zio->io_type == ZIO_TYPE_READ) abd_return_buf_copy(zio->io_abd, bp->bio_data, zio->io_size); - } else if (zio->io_type == ZIO_TYPE_WRITE) { + else abd_return_buf(zio->io_abd, bp->bio_data, zio->io_size); - } g_destroy_bio(bp); + zio->io_bio = NULL; } static void From owner-svn-src-head@freebsd.org Wed Sep 20 08:36:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76B71E02A50; Wed, 20 Sep 2017 08:36:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43F0F29B5; Wed, 20 Sep 2017 08:36:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8K8aVfq036211; Wed, 20 Sep 2017 08:36:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8K8aVoT036210; Wed, 20 Sep 2017 08:36:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201709200836.v8K8aVoT036210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 20 Sep 2017 08:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323797 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 323797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 08:36:32 -0000 Author: avg Date: Wed Sep 20 08:36:31 2017 New Revision: 323797 URL: https://svnweb.freebsd.org/changeset/base/323797 Log: add vfs_zfs.abd_chunk_size tunable It is reported that the default value of 4KB results in a substantial memory use overhead (at least, on some configurations). Using 1KB seems to reduce the overhead significantly. PR: 222377 Reported by: Sean Chittenden MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed Sep 20 08:27:21 2017 (r323796) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/abd.c Wed Sep 20 08:36:31 2017 (r323797) @@ -150,6 +150,13 @@ boolean_t zfs_abd_scatter_enabled = B_TRUE; */ size_t zfs_abd_chunk_size = 4096; +#if defined(__FreeBSD__) && defined(_KERNEL) +SYSCTL_DECL(_vfs_zfs); + +SYSCTL_ULONG(_vfs_zfs, OID_AUTO, abd_chunk_size, CTLFLAG_RDTUN, + &zfs_abd_chunk_size, 0, "The size of the chunks ABD allocates"); +#endif + #ifdef _KERNEL extern vmem_t *zio_alloc_arena; #endif From owner-svn-src-head@freebsd.org Wed Sep 20 15:00:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4233E123AE; Wed, 20 Sep 2017 15:00:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E7716E826; Wed, 20 Sep 2017 15:00:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KF00I7094858; Wed, 20 Sep 2017 15:00:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KF00Nd094857; Wed, 20 Sep 2017 15:00:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201709201500.v8KF00Nd094857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Sep 2017 15:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323811 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 323811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 15:00:01 -0000 Author: hselasky Date: Wed Sep 20 15:00:00 2017 New Revision: 323811 URL: https://svnweb.freebsd.org/changeset/base/323811 Log: Regenerate usb.conf . MFC after: 1 week Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Wed Sep 20 14:46:24 2017 (r323810) +++ head/etc/devd/usb.conf Wed Sep 20 15:00:00 2017 (r323811) @@ -809,6 +809,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x050d"; + match "product" "0x258a"; + action "kldload -n udbp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; match "product" "0x4050"; action "kldload -n if_zyd"; }; @@ -2769,7 +2777,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; - match "product" "(0x8712|0x8712)"; + match "product" "(0x8712|0x8713)"; action "kldload -n if_rsu"; }; @@ -3889,7 +3897,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x12d1"; - match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1464|0x1465|0x14ac|0x14c9|0x14cf|0x14d1|0x14fe|0x1505|0x1506|0x1520|0x1521|0x1526)"; + match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1464|0x1465|0x14ac|0x14c4|0x14c9|0x14ca|0x14cf|0x14d1|0x14fe|0x1505|0x1506|0x1520|0x1521|0x1526)"; action "kldload -n u3g"; }; @@ -5320,6 +5328,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x27b8"; + match "product" "0x01ed"; + action "kldload -n uled"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x3195"; match "product" "(0xf190|0xf280|0xf281)"; action "kldload -n uslcom"; @@ -5889,5 +5905,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2751 USB entries processed +# 2754 USB entries processed From owner-svn-src-head@freebsd.org Wed Sep 20 15:49:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F354E14271; Wed, 20 Sep 2017 15:49:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E3806FE54; Wed, 20 Sep 2017 15:49:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KFnCY5015246; Wed, 20 Sep 2017 15:49:12 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KFnCsI015244; Wed, 20 Sep 2017 15:49:12 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201709201549.v8KFnCsI015244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 20 Sep 2017 15:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323812 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 323812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 15:49:13 -0000 Author: gjb Date: Wed Sep 20 15:49:12 2017 New Revision: 323812 URL: https://svnweb.freebsd.org/changeset/base/323812 Log: Bootstrap etcupdate(8) and mergemaster(8) databases when creating virtual machine images and embedded images, similar to what is done when extracting base.txz to the target root filesystem in an new installation. Noticed by: marius Tested with: head@r323729 MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr head/release/tools/vmimage.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Wed Sep 20 15:00:00 2017 (r323811) +++ head/release/tools/arm.subr Wed Sep 20 15:49:12 2017 (r323812) @@ -99,6 +99,16 @@ arm_install_base() { TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ installworld installkernel distribution + + # Bootstrap etcupdate(8) and mergemaster(8) databases. + mkdir -p ${DESTDIR}/var/db/etcupdate + etcupdate extract -B \ + -M "TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH}" \ + -s ${WORLDDIR} -d ${DESTDIR}/var/db/etcupdate + sh ${WORLDDIR}/release/scripts/mm-mtree.sh -m ${WORLDDIR} \ + -F "TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH}" \ + -D ${DESTDIR} + chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos arm_create_user Modified: head/release/tools/vmimage.subr ============================================================================== --- head/release/tools/vmimage.subr Wed Sep 20 15:00:00 2017 (r323811) +++ head/release/tools/vmimage.subr Wed Sep 20 15:49:12 2017 (r323812) @@ -122,6 +122,15 @@ vm_install_base() { installworld installkernel distribution || \ err "\n\nCannot install the base system to ${DESTDIR}." + # Bootstrap etcupdate(8) and mergemaster(8) databases. + mkdir -p ${DESTDIR}/var/db/etcupdate + etcupdate extract -B \ + -M "TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}" \ + -s ${WORLDDIR} -d ${DESTDIR}/var/db/etcupdate + sh ${WORLDDIR}/release/scripts/mm-mtree.sh -m ${WORLDDIR} \ + -F "TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}" \ + -D ${DESTDIR} + echo '# Custom /etc/fstab for FreeBSD VM images' \ > ${DESTDIR}/etc/fstab echo "/dev/${ROOTLABEL}/rootfs / ufs rw 1 1" \ From owner-svn-src-head@freebsd.org Wed Sep 20 16:31:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89403E15E9D; Wed, 20 Sep 2017 16:31:01 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6373171053; Wed, 20 Sep 2017 16:31:01 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KGV0j3031639; Wed, 20 Sep 2017 16:31:00 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KGV0Fh031637; Wed, 20 Sep 2017 16:31:00 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201709201631.v8KGV0Fh031637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 20 Sep 2017 16:31:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323813 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 323813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 16:31:01 -0000 Author: asomers Date: Wed Sep 20 16:31:00 2017 New Revision: 323813 URL: https://svnweb.freebsd.org/changeset/base/323813 Log: MFV r323789: 8473 scrub does not detect errors on active spares illumos/illumos-gate@554675eee75dd2d7398d960aa5c81083ceb8505a https://github.com/illumos/illumos-gate/commit/554675eee75dd2d7398d960aa5c81083ceb8505a https://www.illumos.org/issues/8473 Scrubbing is supposed to detect and repair all errors in the pool. However, it wrongly ignores active spare devices. The problem can easily be reproduced in OpenZFS at git rev 0ef125d with these commands: truncate -s 64m /tmp/a /tmp/b /tmp/c sudo zpool create testpool mirror /tmp/a /tmp/b spare /tmp/c sudo zpool replace testpool /tmp/a /tmp/c /bin/dd if=/dev/zero bs=1024k count=63 oseek=1 conv=notrunc of=/tmp/c sync sudo zpool scrub testpool zpool status testpool # Will show 0 errors, which is wrong sudo zpool offline testpool /tmp/a sudo zpool scrub testpool zpool status testpool # Will show errors on /tmp/c, # which should've already been fixed FreeBSD head is partially affected: the first scrub will detect some errors, but the second scrub will detect more. Reviewed by: Andy Stormont Reviewed by: Matt Ahrens Reviewed by: George Wilson Approved by: Richard Lowe MFC after: 1 week Sponsored by: Spectra Logic Corp Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Wed Sep 20 15:49:12 2017 (r323812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Wed Sep 20 16:31:00 2017 (r323813) @@ -29,6 +29,9 @@ #include #include +#include +#include +#include #include #include #include @@ -52,7 +55,7 @@ typedef struct mirror_map { int *mm_preferred; int mm_preferred_cnt; int mm_children; - boolean_t mm_replacing; + boolean_t mm_resilvering; boolean_t mm_root; mirror_child_t mm_child[]; } mirror_map_t; @@ -119,13 +122,13 @@ vdev_mirror_map_size(int children) } static inline mirror_map_t * -vdev_mirror_map_alloc(int children, boolean_t replacing, boolean_t root) +vdev_mirror_map_alloc(int children, boolean_t resilvering, boolean_t root) { mirror_map_t *mm; mm = kmem_zalloc(vdev_mirror_map_size(children), KM_SLEEP); mm->mm_children = children; - mm->mm_replacing = replacing; + mm->mm_resilvering = resilvering; mm->mm_root = root; mm->mm_preferred = (int *)((uintptr_t)mm + offsetof(mirror_map_t, mm_child[children])); @@ -217,9 +220,39 @@ vdev_mirror_map_init(zio_t *zio) mc->mc_offset = DVA_GET_OFFSET(&dva[c]); } } else { - mm = vdev_mirror_map_alloc(vd->vdev_children, - (vd->vdev_ops == &vdev_replacing_ops || - vd->vdev_ops == &vdev_spare_ops), B_FALSE); + /* + * If we are resilvering, then we should handle scrub reads + * differently; we shouldn't issue them to the resilvering + * device because it might not have those blocks. + * + * We are resilvering iff: + * 1) We are a replacing vdev (ie our name is "replacing-1" or + * "spare-1" or something like that), and + * 2) The pool is currently being resilvered. + * + * We cannot simply check vd->vdev_resilver_txg, because it's + * not set in this path. + * + * Nor can we just check our vdev_ops; there are cases (such as + * when a user types "zpool replace pool odev spare_dev" and + * spare_dev is in the spare list, or when a spare device is + * automatically used to replace a DEGRADED device) when + * resilvering is complete but both the original vdev and the + * spare vdev remain in the pool. That behavior is intentional. + * It helps implement the policy that a spare should be + * automatically removed from the pool after the user replaces + * the device that originally failed. + * + * If a spa load is in progress, then spa_dsl_pool may be + * uninitialized. But we shouldn't be resilvering during a spa + * load anyway. + */ + boolean_t replacing = (vd->vdev_ops == &vdev_replacing_ops || + vd->vdev_ops == &vdev_spare_ops) && + spa_load_state(vd->vdev_spa) == SPA_LOAD_NONE && + dsl_scan_resilvering(vd->vdev_spa->spa_dsl_pool); + mm = vdev_mirror_map_alloc(vd->vdev_children, replacing, + B_FALSE); for (c = 0; c < mm->mm_children; c++) { mc = &mm->mm_child[c]; mc->mc_vd = vd->vdev_child[c]; @@ -448,7 +481,7 @@ vdev_mirror_io_start(zio_t *zio) mm = vdev_mirror_map_init(zio); if (zio->io_type == ZIO_TYPE_READ) { - if ((zio->io_flags & ZIO_FLAG_SCRUB) && !mm->mm_replacing && + if ((zio->io_flags & ZIO_FLAG_SCRUB) && !mm->mm_resilvering && mm->mm_children > 1) { /* * For scrubbing reads we need to allocate a read @@ -589,7 +622,7 @@ vdev_mirror_io_done(zio_t *zio) if (good_copies && spa_writeable(zio->io_spa) && (unexpected_errors || (zio->io_flags & ZIO_FLAG_RESILVER) || - ((zio->io_flags & ZIO_FLAG_SCRUB) && mm->mm_replacing))) { + ((zio->io_flags & ZIO_FLAG_SCRUB) && mm->mm_resilvering))) { /* * Use the good data we have in hand to repair damaged children. */ From owner-svn-src-head@freebsd.org Wed Sep 20 17:53:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C877EE1A6DE; Wed, 20 Sep 2017 17:53:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96034752EA; Wed, 20 Sep 2017 17:53:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KHrPBq070785; Wed, 20 Sep 2017 17:53:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KHrPRd070784; Wed, 20 Sep 2017 17:53:25 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709201753.v8KHrPRd070784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 20 Sep 2017 17:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323820 - head/sys/crypto/aesni X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/crypto/aesni X-SVN-Commit-Revision: 323820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 17:53:26 -0000 Author: cem Date: Wed Sep 20 17:53:25 2017 New Revision: 323820 URL: https://svnweb.freebsd.org/changeset/base/323820 Log: aesni(4): Fix trivial typo (AQUIRE -> ACQUIRE) Sponsored by: Dell EMC Isilon Modified: head/sys/crypto/aesni/aesni.c Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Wed Sep 20 17:49:57 2017 (r323819) +++ head/sys/crypto/aesni/aesni.c Wed Sep 20 17:53:25 2017 (r323820) @@ -61,7 +61,7 @@ struct aesni_softc { struct rwlock lock; }; -#define AQUIRE_CTX(i, ctx) \ +#define ACQUIRE_CTX(i, ctx) \ do { \ (i) = PCPU_GET(cpuid); \ mtx_lock(&ctx_mtx[(i)]); \ @@ -490,7 +490,7 @@ aesni_cipher_setup(struct aesni_session *ses, struct c kt = is_fpu_kern_thread(0); if (!kt) { - AQUIRE_CTX(ctxidx, ctx); + ACQUIRE_CTX(ctxidx, ctx); error = fpu_kern_enter(curthread, ctx, FPU_KERN_NORMAL | FPU_KERN_KTHR); if (error != 0) @@ -547,7 +547,7 @@ aesni_cipher_process(struct aesni_session *ses, struct kt = is_fpu_kern_thread(0); if (!kt) { - AQUIRE_CTX(ctxidx, ctx); + ACQUIRE_CTX(ctxidx, ctx); error = fpu_kern_enter(curthread, ctx, FPU_KERN_NORMAL|FPU_KERN_KTHR); if (error != 0) From owner-svn-src-head@freebsd.org Wed Sep 20 18:30:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26F52E1C42A; Wed, 20 Sep 2017 18:30:39 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8CB576555; Wed, 20 Sep 2017 18:30:38 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KIUcfo083388; Wed, 20 Sep 2017 18:30:38 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KIUbJ0083385; Wed, 20 Sep 2017 18:30:37 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709201830.v8KIUbJ0083385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 20 Sep 2017 18:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323822 - in head/sys/x86: include x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/x86: include x86 X-SVN-Commit-Revision: 323822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 18:30:39 -0000 Author: cem Date: Wed Sep 20 18:30:37 2017 New Revision: 323822 URL: https://svnweb.freebsd.org/changeset/base/323822 Log: x86: Decode AMD "Extended Feature Extensions ID EBX" bits In particular, this determines CPU support for the CLZERO instruction. (No, I am not making this name up.) Sponsored by: Dell EMC Isilon Modified: head/sys/x86/include/specialreg.h head/sys/x86/include/x86_var.h head/sys/x86/x86/identcpu.c Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Wed Sep 20 18:04:28 2017 (r323821) +++ head/sys/x86/include/specialreg.h Wed Sep 20 18:30:37 2017 (r323822) @@ -331,6 +331,13 @@ #define AMDPM_CPB 0x00000200 /* + * AMD extended function 8000_0008h ebx info (amd_extended_feature_extensions) + */ +#define AMDFEID_CLZERO 0x00000001 +#define AMDFEID_IRPERF 0x00000002 +#define AMDFEID_XSAVEERPTR 0x00000004 + +/* * AMD extended function 8000_0008h ecx info */ #define AMDID_CMP_CORES 0x000000ff Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Wed Sep 20 18:04:28 2017 (r323821) +++ head/sys/x86/include/x86_var.h Wed Sep 20 18:30:37 2017 (r323822) @@ -46,6 +46,7 @@ extern u_int amd_feature; extern u_int amd_feature2; extern u_int amd_rascap; extern u_int amd_pminfo; +extern u_int amd_extended_feature_extensions; extern u_int via_feature_rng; extern u_int via_feature_xcrypt; extern u_int cpu_clflush_line_size; Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Wed Sep 20 18:04:28 2017 (r323821) +++ head/sys/x86/x86/identcpu.c Wed Sep 20 18:30:37 2017 (r323822) @@ -93,6 +93,7 @@ u_int amd_feature; /* AMD feature flags */ u_int amd_feature2; /* AMD feature flags */ u_int amd_rascap; /* AMD RAS capabilities */ u_int amd_pminfo; /* AMD advanced power management info */ +u_int amd_extended_feature_extensions; u_int via_feature_rng; /* VIA RNG features */ u_int via_feature_xcrypt; /* VIA ACE features */ u_int cpu_high; /* Highest arg to CPUID */ @@ -992,6 +993,16 @@ printcpuinfo(void) } } + if (amd_extended_feature_extensions != 0) { + printf("\n " + "AMD Extended Feature Extensions ID EBX=" + "0x%b", amd_extended_feature_extensions, + "\020" + "\001CLZERO" + "\002IRPerf" + "\003XSaveErPtr"); + } + if (via_feature_rng != 0 || via_feature_xcrypt != 0) print_via_padlock_info(); @@ -1468,6 +1479,7 @@ finishidentcpu(void) if (cpu_exthigh >= 0x80000008) { do_cpuid(0x80000008, regs); cpu_maxphyaddr = regs[0] & 0xff; + amd_extended_feature_extensions = regs[1]; cpu_procinfo2 = regs[2]; } else { cpu_maxphyaddr = (cpu_feature & CPUID_PAE) != 0 ? 36 : 32; From owner-svn-src-head@freebsd.org Wed Sep 20 18:31:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5BD2E1C660; Wed, 20 Sep 2017 18:31:37 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B00937685D; Wed, 20 Sep 2017 18:31:37 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KIVa2C084137; Wed, 20 Sep 2017 18:31:36 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KIVaeG084136; Wed, 20 Sep 2017 18:31:36 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709201831.v8KIVaeG084136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 20 Sep 2017 18:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323823 - head/sys/crypto/aesni X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/crypto/aesni X-SVN-Commit-Revision: 323823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 18:31:38 -0000 Author: cem Date: Wed Sep 20 18:31:36 2017 New Revision: 323823 URL: https://svnweb.freebsd.org/changeset/base/323823 Log: aesni(4): Fix another trivial typo (aensi -> aesni) Sponsored by: Dell EMC Isilon Modified: head/sys/crypto/aesni/aesni.c Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Wed Sep 20 18:30:37 2017 (r323822) +++ head/sys/crypto/aesni/aesni.c Wed Sep 20 18:31:36 2017 (r323823) @@ -114,7 +114,7 @@ aesni_probe(device_t dev) } static void -aensi_cleanctx(void) +aesni_cleanctx(void) { int i; @@ -198,7 +198,7 @@ aesni_detach(device_t dev) rw_destroy(&sc->lock); - aensi_cleanctx(); + aesni_cleanctx(); return (0); } From owner-svn-src-head@freebsd.org Wed Sep 20 20:07:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32C73E20B7E; Wed, 20 Sep 2017 20:07:47 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0ED507D6E2; Wed, 20 Sep 2017 20:07:46 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KK7k7L024656; Wed, 20 Sep 2017 20:07:46 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KK7kkA024654; Wed, 20 Sep 2017 20:07:46 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201709202007.v8KK7kkA024654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 20 Sep 2017 20:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323824 - head/sys/dev/qlxgbe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: head/sys/dev/qlxgbe X-SVN-Commit-Revision: 323824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 20:07:47 -0000 Author: davidcs Date: Wed Sep 20 20:07:45 2017 New Revision: 323824 URL: https://svnweb.freebsd.org/changeset/base/323824 Log: 1. ql_hw.c: In ql_hw_send() return EINVAL when TSO framelength exceeds max supported length by HW.(davidcs) 2. ql_os.c: In qla_send() call bus_dmamap_unload before freeing mbuf or recreating dmmamap.(davidcs) In qla_fp_taskqueue() Add additional checks for IFF_DRV_RUNNING Fix qla_clear_tx_buf() call bus_dmamap_sync() before freeing mbuf. Submitted by:David.Bachu@netapp.com MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.c Wed Sep 20 18:31:36 2017 (r323823) +++ head/sys/dev/qlxgbe/ql_hw.c Wed Sep 20 20:07:45 2017 (r323824) @@ -2324,7 +2324,7 @@ ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, in if (total_length > QLA_MAX_TSO_FRAME_SIZE) { device_printf(dev, "%s: total length exceeds maxlen(%d)\n", __func__, total_length); - return (-1); + return (EINVAL); } eh = mtod(mp, struct ether_vlan_header *); Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Wed Sep 20 18:31:36 2017 (r323823) +++ head/sys/dev/qlxgbe/ql_os.c Wed Sep 20 20:07:45 2017 (r323824) @@ -1287,6 +1287,7 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 ha->tx_ring[txr_idx].iscsi_pkt_count++; ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head = m_head; } else { + bus_dmamap_unload(ha->tx_tag, map); if (ret == EINVAL) { if (m_head) m_freem(m_head); @@ -1372,7 +1373,8 @@ qla_fp_taskqueue(void *context, int pending) goto qla_fp_taskqueue_exit; } - while (rx_pkts_left && !ha->stop_rcv) { + while (rx_pkts_left && !ha->stop_rcv && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { rx_pkts_left = ql_rcv_isr(ha, fp->txr_idx, 64); #ifdef QL_ENABLE_ISCSI_TLV @@ -1415,6 +1417,11 @@ qla_fp_taskqueue(void *context, int pending) drbr_advance(ifp, fp->tx_br); } + /* Send a copy of the frame to the BPF listener */ + ETHER_BPF_MTAP(ifp, mp); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + break; + mp = drbr_peek(ifp, fp->tx_br); } } @@ -1677,16 +1684,24 @@ qla_clear_tx_buf(qla_host_t *ha, qla_tx_buf_t *txb) { QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); - if (txb->m_head && txb->map) { + if (txb->m_head) { + bus_dmamap_sync(ha->tx_tag, txb->map, + BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(ha->tx_tag, txb->map); m_freem(txb->m_head); txb->m_head = NULL; + + bus_dmamap_destroy(ha->tx_tag, txb->map); + txb->map = NULL; } - if (txb->map) + if (txb->map) { + bus_dmamap_unload(ha->tx_tag, txb->map); bus_dmamap_destroy(ha->tx_tag, txb->map); + txb->map = NULL; + } QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__)); } From owner-svn-src-head@freebsd.org Wed Sep 20 20:40:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9248CE22606; Wed, 20 Sep 2017 20:40:50 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51E617E734; Wed, 20 Sep 2017 20:40:50 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KKenKp036972; Wed, 20 Sep 2017 20:40:49 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KKen3M036971; Wed, 20 Sep 2017 20:40:49 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201709202040.v8KKen3M036971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 20 Sep 2017 20:40:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323825 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 323825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 20:40:50 -0000 Author: shurd Date: Wed Sep 20 20:40:49 2017 New Revision: 323825 URL: https://svnweb.freebsd.org/changeset/base/323825 Log: Fix iflib netmap RX RXQ setup for netmap was broken because netmap_rxq_init was getting called before IFDI_INIT - thus we ended up with ring tail pointer being reset to zero. Reviewed by: sbruno Approved by: sbruno (mentor) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12140 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Sep 20 20:07:45 2017 (r323824) +++ head/sys/net/iflib.c Wed Sep 20 20:40:49 2017 (r323825) @@ -2173,10 +2173,6 @@ iflib_init_locked(if_ctx_t ctx) CALLOUT_UNLOCK(txq); iflib_netmap_txq_init(ctx, txq); } - for (i = 0, rxq = ctx->ifc_rxqs; i < sctx->isc_nrxqsets; i++, rxq++) { - MPASS(rxq->ifr_id == i); - iflib_netmap_rxq_init(ctx, rxq); - } #ifdef INVARIANTS i = if_getdrvflags(ifp); #endif @@ -2184,8 +2180,11 @@ iflib_init_locked(if_ctx_t ctx) MPASS(if_getdrvflags(ifp) == i); for (i = 0, rxq = ctx->ifc_rxqs; i < sctx->isc_nrxqsets; i++, rxq++) { /* XXX this should really be done on a per-queue basis */ - if (if_getcapenable(ifp) & IFCAP_NETMAP) + if (if_getcapenable(ifp) & IFCAP_NETMAP) { + MPASS(rxq->ifr_id == i); + iflib_netmap_rxq_init(ctx, rxq); continue; + } for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) { if (iflib_fl_setup(fl)) { device_printf(ctx->ifc_dev, "freelist setup failed - check cluster settings\n"); @@ -2474,14 +2473,6 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) struct mbuf *m, *mh, *mt; ifp = ctx->ifc_ifp; -#ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - u_int work = 0; - if (netmap_rx_irq(ifp, rxq->ifr_id, &work)) - return (FALSE); - } -#endif - mh = mt = NULL; MPASS(budget > 0); rx_pkts = rx_bytes = 0; @@ -3500,7 +3491,7 @@ _task_fn_tx(void *context) #endif if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) return; - if ((ifp->if_capenable & IFCAP_NETMAP)) { + if (if_getcapenable(ifp) & IFCAP_NETMAP) { if (ctx->isc_txd_credits_update(ctx->ifc_softc, txq->ift_id, false)) netmap_tx_irq(ifp, txq->ift_id); IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); @@ -3532,7 +3523,16 @@ _task_fn_rx(void *context) DBG_COUNTER_INC(task_fn_rxs); if (__predict_false(!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING))) return; - if ((more = iflib_rxeof(rxq, 16 /* XXX */)) == false) { + more = true; +#ifdef DEV_NETMAP + if (if_getcapenable(ctx->ifc_ifp) & IFCAP_NETMAP) { + u_int work = 0; + if (netmap_rx_irq(ctx->ifc_ifp, rxq->ifr_id, &work)) { + more = false; + } + } +#endif + if (more == false || (more = iflib_rxeof(rxq, 16 /* XXX */)) == false) { if (ctx->ifc_flags & IFC_LEGACY) IFDI_INTR_ENABLE(ctx); else { @@ -5106,7 +5106,7 @@ iflib_admin_intr_deferred(if_ctx_t ctx) struct grouptask *gtask; gtask = &ctx->ifc_admin_task; - MPASS(gtask->gt_taskqueue != NULL); + MPASS(gtask != NULL && gtask->gt_taskqueue != NULL); #endif GROUPTASK_ENQUEUE(&ctx->ifc_admin_task); From owner-svn-src-head@freebsd.org Wed Sep 20 21:13:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F17D5E23C99; Wed, 20 Sep 2017 21:13:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF8097FF27; Wed, 20 Sep 2017 21:13:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KLDKDL053536; Wed, 20 Sep 2017 21:13:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KLDKbx053535; Wed, 20 Sep 2017 21:13:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709202113.v8KLDKbx053535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 20 Sep 2017 21:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323828 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 323828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 21:13:22 -0000 Author: imp Date: Wed Sep 20 21:13:20 2017 New Revision: 323828 URL: https://svnweb.freebsd.org/changeset/base/323828 Log: cam iosched: Use the write queue for BIO_ZONE commands Use the write queue for BIO_ZONE commands so they can't get executed ahead of writes that were sent after them. More generally, since they introduce strong ordering into the list, they need to go to the write queue (which is the only queue that BIO_ORDERED is honored for at the moment). In fact, fix mismatch between queueing and dequeueing code by changing this to queue all non-reads (and non-trims) to the write queue. As a side effect this prevents the kernel message: kernel: Found bio_cmd = 0x9 which cam_iosched_next_bio() emits when finding commands other than BIO_READ in the read queue. PR: 221973 Obtained from: ElectroBSD Submitted by: Fabian Keil Differential Revision: https://reviews.freebsd.org/D12353 Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Wed Sep 20 20:59:28 2017 (r323827) +++ head/sys/cam/cam_iosched.c Wed Sep 20 21:13:20 2017 (r323828) @@ -1345,8 +1345,7 @@ cam_iosched_queue_work(struct cam_iosched_softc *isc, #endif } #ifdef CAM_IOSCHED_DYNAMIC - else if (do_dynamic_iosched && - (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH)) { + else if (do_dynamic_iosched && (bp->bio_cmd != BIO_READ)) { if (cam_iosched_sort_queue(isc)) bioq_disksort(&isc->write_queue, bp); else From owner-svn-src-head@freebsd.org Wed Sep 20 21:19:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89057E24138; Wed, 20 Sep 2017 21:19:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5913680235; Wed, 20 Sep 2017 21:19:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KLJsFw053794; Wed, 20 Sep 2017 21:19:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KLJsBR053793; Wed, 20 Sep 2017 21:19:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709202119.v8KLJsBR053793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 20 Sep 2017 21:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323829 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 323829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 21:19:55 -0000 Author: imp Date: Wed Sep 20 21:19:53 2017 New Revision: 323829 URL: https://svnweb.freebsd.org/changeset/base/323829 Log: cam iosched: Add a handler for the quanta sysctl to enforce valid values Invalid values can result in devision-by-zero panics or other undefined behaviour so lets not allow them. PR: 221957 Obtained from: ElectroBSD Submitted by: Fabian Keil Differential Revision: https://reviews.freebsd.org/D12351 Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Wed Sep 20 21:13:20 2017 (r323828) +++ head/sys/cam/cam_iosched.c Wed Sep 20 21:19:53 2017 (r323829) @@ -883,6 +883,27 @@ cam_iosched_sysctl_latencies(SYSCTL_HANDLER_ARGS) return (error); } +static int +cam_iosched_quanta_sysctl(SYSCTL_HANDLER_ARGS) +{ + int *quanta; + int error, value; + + quanta = (unsigned *)arg1; + value = *quanta; + + error = sysctl_handle_int(oidp, (int *)&value, 0, req); + if ((error != 0) || (req->newptr == NULL)) + return (error); + + if (value < 1 || value > hz) + return (EINVAL); + + *quanta = value; + + return (0); +} + static void cam_iosched_iop_stats_sysctl_init(struct cam_iosched_softc *isc, struct iop_stats *ios, char *name) { @@ -1104,9 +1125,9 @@ void cam_iosched_sysctl_init(struct cam_iosched_softc &isc->read_bias, 100, "How biased towards read should we be independent of limits"); - SYSCTL_ADD_INT(ctx, n, - OID_AUTO, "quanta", CTLFLAG_RW, - &isc->quanta, 200, + SYSCTL_ADD_PROC(ctx, n, + OID_AUTO, "quanta", CTLTYPE_UINT | CTLFLAG_RW, + &isc->quanta, 0, cam_iosched_quanta_sysctl, "I", "How many quanta per second do we slice the I/O up into"); SYSCTL_ADD_INT(ctx, n, From owner-svn-src-head@freebsd.org Wed Sep 20 21:25:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF259E2477B; Wed, 20 Sep 2017 21:25:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D34D809A5; Wed, 20 Sep 2017 21:25:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KLPuhk057885; Wed, 20 Sep 2017 21:25:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KLPuZG057884; Wed, 20 Sep 2017 21:25:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709202125.v8KLPuZG057884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 20 Sep 2017 21:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323831 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 323831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 21:25:57 -0000 Author: imp Date: Wed Sep 20 21:25:56 2017 New Revision: 323831 URL: https://svnweb.freebsd.org/changeset/base/323831 Log: cam iosched: Schedule cam_iosched_ticker() quanta times per second Previously callout_reset() was called with a "ticks" value that was off by one. As a result cam_iosched_ticker() was called a bit too frequently: On systems with hz=1000 a quanta value of 200 resulted in ~250 calls and a value of 100 in ~111 calls. For the "queue_depth" and "bandwidth" limiters the difference doesn't matter but the "iops" limiter depends on the scheduling to enforce the correct maximum. PR: 221956 Obtained from: ElectroBSD Submitted by: Fabian Keil Differential Revision: https://reviews.freebsd.org/D12350 Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Wed Sep 20 21:22:20 2017 (r323830) +++ head/sys/cam/cam_iosched.c Wed Sep 20 21:25:56 2017 (r323831) @@ -533,7 +533,7 @@ cam_iosched_ticker(void *arg) sbintime_t now, delta; int pending; - callout_reset(&isc->ticker, hz / isc->quanta - 1, cam_iosched_ticker, isc); + callout_reset(&isc->ticker, hz / isc->quanta, cam_iosched_ticker, isc); now = sbinuptime(); delta = now - isc->last_time; @@ -798,7 +798,7 @@ cam_iosched_limiter_sysctl(SYSCTL_HANDLER_ARGS) return error; } /* Note: disk load averate requires ticker to be always running */ - callout_reset(&isc->ticker, hz / isc->quanta - 1, cam_iosched_ticker, isc); + callout_reset(&isc->ticker, hz / isc->quanta, cam_iosched_ticker, isc); isc->flags |= CAM_IOSCHED_FLAG_CALLOUT_ACTIVE; cam_periph_unlock(isc->periph); @@ -1055,7 +1055,7 @@ cam_iosched_init(struct cam_iosched_softc **iscp, stru callout_init_mtx(&(*iscp)->ticker, cam_periph_mtx(periph), 0); (*iscp)->periph = periph; cam_iosched_cl_init(&(*iscp)->cl, *iscp); - callout_reset(&(*iscp)->ticker, hz / (*iscp)->quanta - 1, cam_iosched_ticker, *iscp); + callout_reset(&(*iscp)->ticker, hz / (*iscp)->quanta, cam_iosched_ticker, *iscp); (*iscp)->flags |= CAM_IOSCHED_FLAG_CALLOUT_ACTIVE; } #endif From owner-svn-src-head@freebsd.org Wed Sep 20 21:26:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F687E247B5; Wed, 20 Sep 2017 21:26:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A270809C4; Wed, 20 Sep 2017 21:26:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KLQ1D7057954; Wed, 20 Sep 2017 21:26:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KLQ1nP057953; Wed, 20 Sep 2017 21:26:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709202126.v8KLQ1nP057953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 20 Sep 2017 21:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323832 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 323832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 21:26:02 -0000 Author: imp Date: Wed Sep 20 21:26:01 2017 New Revision: 323832 URL: https://svnweb.freebsd.org/changeset/base/323832 Log: cam iosched: Call cam_iosched_limiter_init() after ios->current is set to the default Previously ios->current was set to 0 until the first cam_iosched_cl_maybe_steer() call. PR: 221954 Obtained from: ElectroBSD Submitted by: Fabian Keil Differential Revision: https://reviews.freebsd.org/D12349 Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Wed Sep 20 21:25:56 2017 (r323831) +++ head/sys/cam/cam_iosched.c Wed Sep 20 21:26:01 2017 (r323832) @@ -750,9 +750,8 @@ cam_iosched_iop_stats_init(struct cam_iosched_softc *i { ios->limiter = none; - cam_iosched_limiter_init(ios); ios->in = 0; - ios->max = 300000; + ios->max = ios->current = 300000; ios->min = 1; ios->out = 0; ios->pending = 0; @@ -761,6 +760,7 @@ cam_iosched_iop_stats_init(struct cam_iosched_softc *i ios->ema = 0; ios->emvar = 0; ios->softc = isc; + cam_iosched_limiter_init(ios); } static int From owner-svn-src-head@freebsd.org Wed Sep 20 21:29:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7E06E24AB6; Wed, 20 Sep 2017 21:29:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A378880D7B; Wed, 20 Sep 2017 21:29:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KLTs7h058149; Wed, 20 Sep 2017 21:29:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KLTsF1058147; Wed, 20 Sep 2017 21:29:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709202129.v8KLTsF1058147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 20 Sep 2017 21:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323833 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 323833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 21:29:55 -0000 Author: tuexen Date: Wed Sep 20 21:29:54 2017 New Revision: 323833 URL: https://svnweb.freebsd.org/changeset/base/323833 Log: Protect the address workqueue timer by a mutex. MFC after: 1 week Modified: head/sys/netinet/sctp_pcb.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed Sep 20 21:26:01 2017 (r323832) +++ head/sys/netinet/sctp_pcb.c Wed Sep 20 21:29:54 2017 (r323833) @@ -709,12 +709,11 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint3 SCTP_WQ_ADDR_LOCK(); LIST_INSERT_HEAD(&SCTP_BASE_INFO(addr_wq), wi, sctp_nxt_addr); - SCTP_WQ_ADDR_UNLOCK(); - sctp_timer_start(SCTP_TIMER_TYPE_ADDR_WQ, (struct sctp_inpcb *)NULL, (struct sctp_tcb *)NULL, (struct sctp_nets *)NULL); + SCTP_WQ_ADDR_UNLOCK(); } else { /* it's ready for use */ sctp_ifap->localifa_flags &= ~SCTP_ADDR_DEFER_USE; @@ -821,12 +820,11 @@ out_now: * the newest first :-0 */ LIST_INSERT_HEAD(&SCTP_BASE_INFO(addr_wq), wi, sctp_nxt_addr); - SCTP_WQ_ADDR_UNLOCK(); - sctp_timer_start(SCTP_TIMER_TYPE_ADDR_WQ, (struct sctp_inpcb *)NULL, (struct sctp_tcb *)NULL, (struct sctp_nets *)NULL); + SCTP_WQ_ADDR_UNLOCK(); } return; } Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Sep 20 21:26:01 2017 (r323832) +++ head/sys/netinet/sctputil.c Wed Sep 20 21:29:54 2017 (r323833) @@ -1462,13 +1462,11 @@ sctp_handle_addr_wq(void) LIST_INIT(&asc->list_of_work); asc->cnt = 0; - SCTP_WQ_ADDR_LOCK(); LIST_FOREACH_SAFE(wi, &SCTP_BASE_INFO(addr_wq), sctp_nxt_addr, nwi) { LIST_REMOVE(wi, sctp_nxt_addr); LIST_INSERT_HEAD(&asc->list_of_work, wi, sctp_nxt_addr); asc->cnt++; } - SCTP_WQ_ADDR_UNLOCK(); if (asc->cnt == 0) { SCTP_FREE(asc, SCTP_M_ASC_IT); @@ -1492,11 +1490,9 @@ sctp_handle_addr_wq(void) if (SCTP_BASE_VAR(sctp_pcb_initialized) == 0) { sctp_asconf_iterator_end(asc, 0); } else { - SCTP_WQ_ADDR_LOCK(); LIST_FOREACH(wi, &asc->list_of_work, sctp_nxt_addr) { LIST_INSERT_HEAD(&SCTP_BASE_INFO(addr_wq), wi, sctp_nxt_addr); } - SCTP_WQ_ADDR_UNLOCK(); SCTP_FREE(asc, SCTP_M_ASC_IT); } } @@ -1565,8 +1561,7 @@ sctp_timeout_handler(void *t) (tmr->type != SCTP_TIMER_TYPE_SHUTDOWN) && (tmr->type != SCTP_TIMER_TYPE_SHUTDOWNACK) && (tmr->type != SCTP_TIMER_TYPE_SHUTDOWNGUARD) && - (tmr->type != SCTP_TIMER_TYPE_ASOCKILL)) - ) { + (tmr->type != SCTP_TIMER_TYPE_ASOCKILL))) { SCTP_INP_DECR_REF(inp); CURVNET_RESTORE(); return; @@ -1612,6 +1607,12 @@ sctp_timeout_handler(void *t) CURVNET_RESTORE(); return; } + } else if (inp != NULL) { + if (type != SCTP_TIMER_TYPE_INPKILL) { + SCTP_INP_WLOCK(inp); + } + } else { + SCTP_WQ_ADDR_LOCK(); } /* record in stopped what t-o occurred */ tmr->stopped_from = type; @@ -1759,7 +1760,6 @@ sctp_timeout_handler(void *t) } SCTP_STAT_INCR(sctps_timosecret); (void)SCTP_GETTIME_TIMEVAL(&tv); - SCTP_INP_WLOCK(inp); inp->sctp_ep.time_of_secret_change = tv.tv_sec; inp->sctp_ep.last_secret_number = inp->sctp_ep.current_secret_number; @@ -1773,7 +1773,6 @@ sctp_timeout_handler(void *t) inp->sctp_ep.secret_key[secret][i] = sctp_select_initial_TSN(&inp->sctp_ep); } - SCTP_INP_WUNLOCK(inp); sctp_timer_start(SCTP_TIMER_TYPE_NEWCOOKIE, inp, stcb, net); } did_output = 0; @@ -1921,7 +1920,12 @@ sctp_timeout_handler(void *t) get_out: if (stcb) { SCTP_TCB_UNLOCK(stcb); + } else if (inp != NULL) { + SCTP_INP_WUNLOCK(inp); + } else { + SCTP_WQ_ADDR_UNLOCK(); } + out_decr: if (inp) { SCTP_INP_DECR_REF(inp); @@ -6146,11 +6150,11 @@ sctp_dynamic_set_primary(struct sockaddr *sa, uint32_t * newest first :-0 */ LIST_INSERT_HEAD(&SCTP_BASE_INFO(addr_wq), wi, sctp_nxt_addr); - SCTP_WQ_ADDR_UNLOCK(); sctp_timer_start(SCTP_TIMER_TYPE_ADDR_WQ, (struct sctp_inpcb *)NULL, (struct sctp_tcb *)NULL, (struct sctp_nets *)NULL); + SCTP_WQ_ADDR_UNLOCK(); return (0); } From owner-svn-src-head@freebsd.org Wed Sep 20 21:42:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67B33E253A1; Wed, 20 Sep 2017 21:42:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35F3B8160A; Wed, 20 Sep 2017 21:42:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KLgPV2066014; Wed, 20 Sep 2017 21:42:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KLgPba066013; Wed, 20 Sep 2017 21:42:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709202142.v8KLgPba066013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 20 Sep 2017 21:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323834 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 323834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 21:42:26 -0000 Author: imp Date: Wed Sep 20 21:42:25 2017 New Revision: 323834 URL: https://svnweb.freebsd.org/changeset/base/323834 Log: Fix queue depth for nda. 1/4 of the number of queues times queue entries is too limiting. It works up to about 4k IOPS / 3.0GB/s for hardware that can do 4.4k/3.2GB/s with nvd. 3/4 works better, though it highlights issues in the fairness of nda's choice of TRIM vs READ. That will be fixed separately. Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Wed Sep 20 21:29:54 2017 (r323833) +++ head/sys/dev/nvme/nvme_ctrlr.c Wed Sep 20 21:42:25 2017 (r323834) @@ -151,7 +151,7 @@ nvme_ctrlr_construct_io_qpairs(struct nvme_controller * not a hard limit and will need to be revisitted when the upper layers * of the storage system grows multi-queue support. */ - ctrlr->max_hw_pend_io = num_trackers * ctrlr->num_io_queues / 4; + ctrlr->max_hw_pend_io = num_trackers * ctrlr->num_io_queues * 3 / 4; /* * This was calculated previously when setting up interrupts, but From owner-svn-src-head@freebsd.org Wed Sep 20 22:00:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57C81E25C1B; Wed, 20 Sep 2017 22:00:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3116281D4D; Wed, 20 Sep 2017 22:00:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KM07VL070511; Wed, 20 Sep 2017 22:00:07 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KM06ou070506; Wed, 20 Sep 2017 22:00:06 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201709202200.v8KM06ou070506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 20 Sep 2017 22:00:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323836 - in head/sys/netpfil/ipfw: . nat64 nptv6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head/sys/netpfil/ipfw: . nat64 nptv6 X-SVN-Commit-Revision: 323836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 22:00:08 -0000 Author: ae Date: Wed Sep 20 22:00:06 2017 New Revision: 323836 URL: https://svnweb.freebsd.org/changeset/base/323836 Log: Do not acquire IPFW_WLOCK when a named object is created and destroyed. Acquiring of IPFW_WLOCK is requried for cases when we are going to change some data that can be accessed during processing of packets flow. When we create new named object, there are not yet any rules, that references it, thus holding IPFW_UH_WLOCK is enough to safely update needed structures. When we destroy an object, we do this only when its reference counter becomes zero. And it is safe to not acquire IPFW_WLOCK, because noone references it. The another case is when we failed to finish some action and thus we are doing rollback and destroying an object, in this case it is still not referenced by rules and no need to acquire IPFW_WLOCK. This also fixes panic with INVARIANTS due to recursive IPFW_WLOCK acquiring. MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/netpfil/ipfw/ip_fw_table.c head/sys/netpfil/ipfw/nat64/nat64lsn_control.c head/sys/netpfil/ipfw/nat64/nat64stl_control.c head/sys/netpfil/ipfw/nptv6/nptv6.c Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Sep 20 21:51:10 2017 (r323835) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Sep 20 22:00:06 2017 (r323836) @@ -418,9 +418,7 @@ dyn_create(struct ip_fw_chain *ch, struct tid_info *ti return (ENOSPC); } ipfw_objhash_add(ni, &obj->no); - IPFW_WLOCK(ch); SRV_OBJECT(ch, obj->no.kidx) = obj; - IPFW_WUNLOCK(ch); obj->no.refcnt++; *pkidx = obj->no.kidx; IPFW_UH_WUNLOCK(ch); @@ -440,10 +438,8 @@ dyn_destroy(struct ip_fw_chain *ch, struct named_objec no->name, no->etlv, no->kidx, no->refcnt)); DYN_DEBUG("kidx %d", no->kidx); - IPFW_WLOCK(ch); obj = SRV_OBJECT(ch, no->kidx); SRV_OBJECT(ch, no->kidx) = NULL; - IPFW_WUNLOCK(ch); ipfw_objhash_del(CHAIN_TO_SRV(ch), no); ipfw_objhash_free_idx(CHAIN_TO_SRV(ch), no->kidx); Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Wed Sep 20 21:51:10 2017 (r323835) +++ head/sys/netpfil/ipfw/ip_fw_table.c Wed Sep 20 22:00:06 2017 (r323836) @@ -1925,9 +1925,7 @@ create_table_internal(struct ip_fw_chain *ch, struct t tc->no.kidx = kidx; tc->no.etlv = IPFW_TLV_TBL_NAME; - IPFW_WLOCK(ch); link_table(ch, tc); - IPFW_WUNLOCK(ch); } if (compat != 0) @@ -3229,7 +3227,6 @@ link_table(struct ip_fw_chain *ch, struct table_config uint16_t kidx; IPFW_UH_WLOCK_ASSERT(ch); - IPFW_WLOCK_ASSERT(ch); ni = CHAIN_TO_NI(ch); kidx = tc->no.kidx; Modified: head/sys/netpfil/ipfw/nat64/nat64lsn_control.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64lsn_control.c Wed Sep 20 21:51:10 2017 (r323835) +++ head/sys/netpfil/ipfw/nat64/nat64lsn_control.c Wed Sep 20 22:00:06 2017 (r323836) @@ -208,10 +208,7 @@ nat64lsn_create(struct ip_fw_chain *ch, ip_fw3_opheade ipfw_objhash_add(CHAIN_TO_SRV(ch), &cfg->no); /* Okay, let's link data */ - IPFW_WLOCK(ch); SRV_OBJECT(ch, cfg->no.kidx) = cfg; - IPFW_WUNLOCK(ch); - nat64lsn_start_instance(cfg); IPFW_UH_WUNLOCK(ch); @@ -259,10 +256,7 @@ nat64lsn_destroy(struct ip_fw_chain *ch, ip_fw3_ophead return (EBUSY); } - IPFW_WLOCK(ch); SRV_OBJECT(ch, cfg->no.kidx) = NULL; - IPFW_WUNLOCK(ch); - nat64lsn_detach_config(ch, cfg); IPFW_UH_WUNLOCK(ch); Modified: head/sys/netpfil/ipfw/nat64/nat64stl_control.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64stl_control.c Wed Sep 20 21:51:10 2017 (r323835) +++ head/sys/netpfil/ipfw/nat64/nat64stl_control.c Wed Sep 20 22:00:06 2017 (r323836) @@ -220,10 +220,7 @@ nat64stl_create(struct ip_fw_chain *ch, ip_fw3_opheade error = nat64stl_create_internal(ch, cfg, uc); if (error == 0) { /* Okay, let's link data */ - IPFW_WLOCK(ch); SRV_OBJECT(ch, cfg->no.kidx) = cfg; - IPFW_WUNLOCK(ch); - IPFW_UH_WUNLOCK(ch); return (0); } @@ -342,10 +339,7 @@ nat64stl_destroy(struct ip_fw_chain *ch, ip_fw3_ophead return (EBUSY); } - IPFW_WLOCK(ch); SRV_OBJECT(ch, cfg->no.kidx) = NULL; - IPFW_WUNLOCK(ch); - nat64stl_detach_config(ch, cfg); IPFW_UH_WUNLOCK(ch); Modified: head/sys/netpfil/ipfw/nptv6/nptv6.c ============================================================================== --- head/sys/netpfil/ipfw/nptv6/nptv6.c Wed Sep 20 21:51:10 2017 (r323835) +++ head/sys/netpfil/ipfw/nptv6/nptv6.c Wed Sep 20 22:00:06 2017 (r323836) @@ -560,9 +560,7 @@ nptv6_create(struct ip_fw_chain *ch, ip_fw3_opheader * return (ENOSPC); } ipfw_objhash_add(ni, &cfg->no); - IPFW_WLOCK(ch); SRV_OBJECT(ch, cfg->no.kidx) = cfg; - IPFW_WUNLOCK(ch); IPFW_UH_WUNLOCK(ch); return (0); } @@ -599,10 +597,7 @@ nptv6_destroy(struct ip_fw_chain *ch, ip_fw3_opheader return (EBUSY); } - IPFW_WLOCK(ch); SRV_OBJECT(ch, cfg->no.kidx) = NULL; - IPFW_WUNLOCK(ch); - ipfw_objhash_del(CHAIN_TO_SRV(ch), &cfg->no); ipfw_objhash_free_idx(CHAIN_TO_SRV(ch), cfg->no.kidx); IPFW_UH_WUNLOCK(ch); From owner-svn-src-head@freebsd.org Wed Sep 20 22:35:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FB32E26F40; Wed, 20 Sep 2017 22:35:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D6DD82F26; Wed, 20 Sep 2017 22:35:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8KMZSkh086538; Wed, 20 Sep 2017 22:35:28 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8KMZSUG086537; Wed, 20 Sep 2017 22:35:28 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201709202235.v8KMZSUG086537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 20 Sep 2017 22:35:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323839 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 323839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Sep 2017 22:35:29 -0000 Author: ae Date: Wed Sep 20 22:35:28 2017 New Revision: 323839 URL: https://svnweb.freebsd.org/changeset/base/323839 Log: Use in_localip() function instead of unlocked access to addresses hash to determine that an address is our local. PR: 220078 MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Wed Sep 20 22:14:50 2017 (r323838) +++ head/sys/netpfil/ipfw/ip_fw2.c Wed Sep 20 22:35:28 2017 (r323839) @@ -1609,10 +1609,7 @@ do { \ case O_IP_SRC_ME: if (is_ipv4) { - struct ifnet *tif; - - INADDR_TO_IFP(src_ip, tif); - match = (tif != NULL); + match = in_localip(src_ip); break; } #ifdef INET6 @@ -1648,10 +1645,7 @@ do { \ case O_IP_DST_ME: if (is_ipv4) { - struct ifnet *tif; - - INADDR_TO_IFP(dst_ip, tif); - match = (tif != NULL); + match = in_localip(dst_ip); break; } #ifdef INET6 From owner-svn-src-head@freebsd.org Thu Sep 21 00:04:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25BB3E03AED; Thu, 21 Sep 2017 00:04:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4E4B814; Thu, 21 Sep 2017 00:04:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8L040B7023035; Thu, 21 Sep 2017 00:04:00 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8L040pZ023034; Thu, 21 Sep 2017 00:04:00 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201709210004.v8L040pZ023034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 21 Sep 2017 00:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323840 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 323840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 00:04:01 -0000 Author: jkim Date: Thu Sep 21 00:03:59 2017 New Revision: 323840 URL: https://svnweb.freebsd.org/changeset/base/323840 Log: Remove an ancient comment about the existence of READ(16) and WRITE(16). MFC after: 3 days Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Wed Sep 20 22:35:28 2017 (r323839) +++ head/sys/cam/scsi/scsi_all.c Thu Sep 21 00:03:59 2017 (r323840) @@ -468,10 +468,6 @@ static struct op_table_entry scsi_op_codes[] = { { 0x86, ALL & ~(L | R | F), "ACCESS CONTROL IN" }, /* 87 OO OO OOOOOOO ACCESS CONTROL OUT */ { 0x87, ALL & ~(L | R | F), "ACCESS CONTROL OUT" }, - /* - * XXX READ(16)/WRITE(16) were not listed for CD/DVE in op-num.txt - * but we had it since r1.40. Do we really want them? - */ /* 88 MM O O O READ(16) */ { 0x88, D | T | W | O | B, "READ(16)" }, /* 89 O COMPARE AND WRITE*/ From owner-svn-src-head@freebsd.org Thu Sep 21 00:41:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD5FAE0537D; Thu, 21 Sep 2017 00:41:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 996161789; Thu, 21 Sep 2017 00:41:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8L0fCiD036144; Thu, 21 Sep 2017 00:41:12 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8L0fCIE036143; Thu, 21 Sep 2017 00:41:12 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201709210041.v8L0fCIE036143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 21 Sep 2017 00:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323841 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 323841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 00:41:13 -0000 Author: rmacklem Date: Thu Sep 21 00:41:12 2017 New Revision: 323841 URL: https://svnweb.freebsd.org/changeset/base/323841 Log: Add a few definitions for Flex File Layout for pNFS. These definitions will be used by a future commit. Modified: head/sys/fs/nfs/nfs.h Modified: head/sys/fs/nfs/nfs.h ============================================================================== --- head/sys/fs/nfs/nfs.h Thu Sep 21 00:03:59 2017 (r323840) +++ head/sys/fs/nfs/nfs.h Thu Sep 21 00:41:12 2017 (r323841) @@ -177,6 +177,17 @@ struct nfsd_nfsd_args { }; /* + * NFSDEV_MIRRORSTR - string of digits that number the DSs 0->999. + * (To support more than 1000 DSs on an MDS, this needs to be increased.) + * NFSDEV_MAXMIRRORS - Maximum # of mirrors for a DS. + * (Most will only have a single mirror, but this setting allows up to 3.) + * NFSDEV_MAXVERS - maximum number of NFS versions supported by Flex File. + */ +#define NFSDEV_MIRRORSTR 3 +#define NFSDEV_MAXMIRRORS 4 +#define NFSDEV_MAXVERS 4 + +/* * Arguments for use by the callback daemon. */ struct nfsd_nfscbd_args { From owner-svn-src-head@freebsd.org Thu Sep 21 05:46:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80FF2E15563; Thu, 21 Sep 2017 05:46:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FFA66A76D; Thu, 21 Sep 2017 05:46:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8L5kSss061400; Thu, 21 Sep 2017 05:46:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8L5kSlC061399; Thu, 21 Sep 2017 05:46:28 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709210546.v8L5kSlC061399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 21 Sep 2017 05:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323843 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 323843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 05:46:29 -0000 Author: cem Date: Thu Sep 21 05:46:28 2017 New Revision: 323843 URL: https://svnweb.freebsd.org/changeset/base/323843 Log: cryptotest.py: Add a seatbelt that we're actually testing anything Without nist-kat installed, cryptotest.py is a no-op. Showing 'success' in that case is unhelpful. Sponsored by: Dell EMC Isilon Modified: head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Thu Sep 21 03:18:11 2017 (r323842) +++ head/tests/sys/opencrypto/cryptotest.py Thu Sep 21 05:46:28 2017 (r323843) @@ -40,6 +40,7 @@ from glob import iglob katdir = '/usr/local/share/nist-kat' def katg(base, glob): + assert os.path.exists(os.path.join(katdir, base)), "Please 'pkg install nist-kat'" return iglob(os.path.join(katdir, base, glob)) aesmodules = [ 'cryptosoft0', 'aesni0', 'ccr0' ] From owner-svn-src-head@freebsd.org Thu Sep 21 09:18:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7748CE1F0D0; Thu, 21 Sep 2017 09:18:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44C80706E7; Thu, 21 Sep 2017 09:18:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8L9I57Q047982; Thu, 21 Sep 2017 09:18:05 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8L9I5Gw047981; Thu, 21 Sep 2017 09:18:05 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709210918.v8L9I5Gw047981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 21 Sep 2017 09:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323847 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 323847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 09:18:06 -0000 Author: tuexen Date: Thu Sep 21 09:18:05 2017 New Revision: 323847 URL: https://svnweb.freebsd.org/changeset/base/323847 Log: No need to wakeup, since sctp_add_to_readq() does it. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Thu Sep 21 08:20:33 2017 (r323846) +++ head/sys/netinet/sctp_indata.c Thu Sep 21 09:18:05 2017 (r323847) @@ -1617,7 +1617,6 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc control, &stcb->sctp_socket->so_rcv, control->end_added, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); - do_wakeup = 1; } break; } From owner-svn-src-head@freebsd.org Thu Sep 21 09:22:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33FADE1F4E5; Thu, 21 Sep 2017 09:22:43 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0342B70B05; Thu, 21 Sep 2017 09:22:42 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8L9MgZ4051741; Thu, 21 Sep 2017 09:22:42 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8L9MgER051740; Thu, 21 Sep 2017 09:22:42 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201709210922.v8L9MgER051740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Thu, 21 Sep 2017 09:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323848 - head/tools/tools/nanobsd/embedded X-SVN-Group: head X-SVN-Commit-Author: n_hibma X-SVN-Commit-Paths: head/tools/tools/nanobsd/embedded X-SVN-Commit-Revision: 323848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 09:22:43 -0000 Author: n_hibma Date: Thu Sep 21 09:22:41 2017 New Revision: 323848 URL: https://svnweb.freebsd.org/changeset/base/323848 Log: Speling mistakes. Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Thu Sep 21 09:18:05 2017 (r323847) +++ head/tools/tools/nanobsd/embedded/common Thu Sep 21 09:22:41 2017 (r323848) @@ -66,7 +66,7 @@ # o common tooling for creating images for odd-ball platforms # o support for boot loaders other than uboot in the image # or via special instructions -# o No pony support. Sadly, you cannot have a pony. +# o no pony support; sadly, you cannot have a pony # if [ -z $NANO_NAME ]; then @@ -281,7 +281,7 @@ create_diskimage_mbr ( ) ( out=${NANO_DISKIMGDIR}/_.disk.image.${NANO_NAME}${fmt} # below depends on https://reviews.freebsd.org/D4403 not yet in the tree # but there's problems: it marks all partitions as active, so you have to - # boot off parittion 3 or 2 by hand if you're playing around with this WIP + # boot off partition 3 or 2 by hand if you're playing around with this WIP case ${NANO_LAYOUT} in std-embedded) mkimg -a 3 ${skiparg} ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_LOG}/_.s1 \ From owner-svn-src-head@freebsd.org Thu Sep 21 09:27:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E866E1F7E2; Thu, 21 Sep 2017 09:27:46 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 055E070DC3; Thu, 21 Sep 2017 09:27:45 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8L9RjCr052126; Thu, 21 Sep 2017 09:27:45 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8L9RjsP052125; Thu, 21 Sep 2017 09:27:45 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201709210927.v8L9RjsP052125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Thu, 21 Sep 2017 09:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323849 - head/tools/tools/nanobsd X-SVN-Group: head X-SVN-Commit-Author: n_hibma X-SVN-Commit-Paths: head/tools/tools/nanobsd X-SVN-Commit-Revision: 323849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 09:27:46 -0000 Author: n_hibma Date: Thu Sep 21 09:27:44 2017 New Revision: 323849 URL: https://svnweb.freebsd.org/changeset/base/323849 Log: Fix up style for consistency. Modified: head/tools/tools/nanobsd/defaults.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Thu Sep 21 09:22:41 2017 (r323848) +++ head/tools/tools/nanobsd/defaults.sh Thu Sep 21 09:27:44 2017 (r323849) @@ -256,7 +256,6 @@ rm ( ) { # are relative to NANO_WORLDDIR. # tgt_touch ( ) ( - cd "${NANO_WORLDDIR}" for i; do touch $i @@ -270,7 +269,7 @@ tgt_touch ( ) ( # directory is removed and a symlink is created. If we're doing # a nopriv build, then append this fact to the metalog # -tgt_dir2symlink () ( +tgt_dir2symlink ( ) ( dir=$1 symlink=$2 @@ -334,8 +333,6 @@ build_world ( ) ( ) build_kernel ( ) ( - local extra - pprint 2 "build kernel ($NANO_KERNEL)" pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.bk" @@ -402,7 +399,6 @@ install_world ( ) ( ) install_etc ( ) ( - pprint 2 "install /etc" pprint 3 "log: ${NANO_LOG}/_.etc" @@ -418,8 +414,6 @@ install_etc ( ) ( ) install_kernel ( ) ( - local extra - pprint 2 "install kernel ($NANO_KERNEL)" pprint 3 "log: ${NANO_LOG}/_.ik" @@ -458,8 +452,7 @@ native_xtools ( ) ( # Run the requested set of early customization scripts, run before # buildworld. # -run_early_customize() { - +run_early_customize ( ) { pprint 2 "run early customize scripts" for c in $NANO_EARLY_CUSTOMIZE do @@ -492,7 +485,6 @@ run_customize ( ) ( # setup nanobsd, prune empty dirs from /usr, etc # run_late_customize ( ) ( - pprint 2 "run late customize scripts" for c in $NANO_LATE_CUSTOMIZE do @@ -511,7 +503,6 @@ run_late_customize ( ) ( # a user's cfg file would override this. # fixup_before_diskimage ( ) ( - # Run the deduplication script that takes the matalog journal and # combines multiple entries for the same file (see source for # details). We take the extra step of removing the size keywords. This @@ -599,7 +590,6 @@ setup_nanobsd_etc ( ) ( ) prune_usr ( ) ( - # Remove all empty directories in /usr find "${NANO_WORLDDIR}"/usr -type d -depth -print | while read d @@ -754,7 +744,6 @@ cust_install_files ( ) ( # Install packages from ${NANO_PACKAGE_DIR} cust_pkgng ( ) ( - mkdir -p ${NANO_WORLDDIR}/usr/local/etc local PKG_CONF="${NANO_WORLDDIR}/usr/local/etc/pkg.conf" local PKGCMD="env ASSUME_ALWAYS_YES=YES PKG_DBDIR=${NANO_PKG_META_BASE}/pkg SIGNATURE_TYPE=none /usr/sbin/pkg" @@ -820,7 +809,7 @@ cust_pkgng ( ) ( # Register all args as early customize function to run just before # build commences. -early_customize_cmd () { +early_customize_cmd ( ) { NANO_EARLY_CUSTOMIZE="$NANO_EARLY_CUSTOMIZE $*" } From owner-svn-src-head@freebsd.org Thu Sep 21 09:47:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5794CE20712; Thu, 21 Sep 2017 09:47:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 251517165A; Thu, 21 Sep 2017 09:47:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8L9lucs060432; Thu, 21 Sep 2017 09:47:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8L9lupH060431; Thu, 21 Sep 2017 09:47:56 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709210947.v8L9lupH060431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 21 Sep 2017 09:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323850 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 323850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 09:47:57 -0000 Author: tuexen Date: Thu Sep 21 09:47:56 2017 New Revision: 323850 URL: https://svnweb.freebsd.org/changeset/base/323850 Log: Free the control structure after using is, not before. Found by Coverity while scanning the usrsctp library. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Thu Sep 21 09:27:44 2017 (r323849) +++ head/sys/netinet/sctp_indata.c Thu Sep 21 09:47:56 2017 (r323850) @@ -1379,10 +1379,10 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc } if (sctp_place_control_in_stream(strm, asoc, control)) { /* Duplicate SSN? */ - sctp_clean_up_control(stcb, control); sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_6); + sctp_clean_up_control(stcb, control); return; } if ((tsn == (asoc->cumulative_tsn + 1) && (asoc->idata_supported == 0))) { From owner-svn-src-head@freebsd.org Thu Sep 21 10:00:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C56F4E210E0; Thu, 21 Sep 2017 10:00:17 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A264771C1D; Thu, 21 Sep 2017 10:00:17 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LA0GH9064499; Thu, 21 Sep 2017 10:00:16 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LA0G51064496; Thu, 21 Sep 2017 10:00:16 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201709211000.v8LA0G51064496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Thu, 21 Sep 2017 10:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323851 - in head: lib/libnv sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: lib/libnv sys/contrib/libnv X-SVN-Commit-Revision: 323851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 10:00:17 -0000 Author: oshogbo Date: Thu Sep 21 10:00:16 2017 New Revision: 323851 URL: https://svnweb.freebsd.org/changeset/base/323851 Log: Remove redundant initialization. Don't use variable - just return the value. Make scan-build happy by casting to 'void *' instead of 'void **'. Submitted by: pjd@ MFC after: 1 month Found by: scan-build and cppcheck Sponsored by: Wheel Systems Modified: head/lib/libnv/msgio.c head/sys/contrib/libnv/nvlist.c head/sys/contrib/libnv/nvpair.c Modified: head/lib/libnv/msgio.c ============================================================================== --- head/lib/libnv/msgio.c Thu Sep 21 09:47:56 2017 (r323850) +++ head/lib/libnv/msgio.c Thu Sep 21 10:00:16 2017 (r323851) @@ -299,7 +299,6 @@ fd_package_recv(int sock, int *fds, size_t nfds) PJDLOG_ASSERT(nfds > 0); PJDLOG_ASSERT(fds != NULL); - i = 0; bzero(&msg, sizeof(msg)); bzero(&iov, sizeof(iov)); Modified: head/sys/contrib/libnv/nvlist.c ============================================================================== --- head/sys/contrib/libnv/nvlist.c Thu Sep 21 09:47:56 2017 (r323850) +++ head/sys/contrib/libnv/nvlist.c Thu Sep 21 10:00:16 2017 (r323851) @@ -280,8 +280,7 @@ nvlist_get_pararr(const nvlist_t *nvl, void **cookiep) return (ret); } - ret = nvlist_get_parent(nvl, cookiep); - return (ret); + return (nvlist_get_parent(nvl, cookiep)); } bool @@ -709,7 +708,6 @@ static int * nvlist_xdescriptors(const nvlist_t *nvl, int *descs) { nvpair_t *nvp; - const char *name; int type; NVLIST_ASSERT(nvl); @@ -717,7 +715,7 @@ nvlist_xdescriptors(const nvlist_t *nvl, int *descs) nvp = NULL; do { - while ((name = nvlist_next(nvl, &type, (void**)&nvp)) != NULL) { + while (nvlist_next(nvl, &type, (void *)&nvp) != NULL) { switch (type) { case NV_TYPE_DESCRIPTOR: *descs = nvpair_get_descriptor(nvp); @@ -756,7 +754,7 @@ nvlist_xdescriptors(const nvlist_t *nvl, int *descs) } } } - } while ((nvl = nvlist_get_pararr(nvl, (void**)&nvp)) != NULL); + } while ((nvl = nvlist_get_pararr(nvl, (void *)&nvp)) != NULL); return (descs); } @@ -787,7 +785,6 @@ nvlist_ndescriptors(const nvlist_t *nvl) { #ifndef _KERNEL nvpair_t *nvp; - const char *name; size_t ndescs; int type; @@ -797,7 +794,7 @@ nvlist_ndescriptors(const nvlist_t *nvl) ndescs = 0; nvp = NULL; do { - while ((name = nvlist_next(nvl, &type, (void**)&nvp)) != NULL) { + while (nvlist_next(nvl, &type, (void *)&nvp) != NULL) { switch (type) { case NV_TYPE_DESCRIPTOR: ndescs++; @@ -830,7 +827,7 @@ nvlist_ndescriptors(const nvlist_t *nvl) } } } - } while ((nvl = nvlist_get_pararr(nvl, (void**)&nvp)) != NULL); + } while ((nvl = nvlist_get_pararr(nvl, (void *)&nvp)) != NULL); return (ndescs); #else @@ -1258,7 +1255,6 @@ nvlist_send(int sock, const nvlist_t *nvl) return (-1); ret = -1; - data = NULL; fdidx = 0; data = nvlist_xpack(nvl, &fdidx, &datasize); Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Thu Sep 21 09:47:56 2017 (r323850) +++ head/sys/contrib/libnv/nvpair.c Thu Sep 21 10:00:16 2017 (r323851) @@ -1412,7 +1412,6 @@ nvpair_create_nvlist_array(const char *name, const nvl nvp = NULL; nvls = NULL; - ii = 0; if (value == NULL || nitems == 0) { ERRNO_SET(EINVAL); From owner-svn-src-head@freebsd.org Thu Sep 21 10:03:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11722E2158B; Thu, 21 Sep 2017 10:03:16 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFCCA72067; Thu, 21 Sep 2017 10:03:15 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LA3EYK068199; Thu, 21 Sep 2017 10:03:14 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LA3EZA068198; Thu, 21 Sep 2017 10:03:14 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201709211003.v8LA3EZA068198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Thu, 21 Sep 2017 10:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323852 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 323852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 10:03:16 -0000 Author: oshogbo Date: Thu Sep 21 10:03:14 2017 New Revision: 323852 URL: https://svnweb.freebsd.org/changeset/base/323852 Log: The 'while (array != NULL) { }' suggests scan-build that array may be initially NULL, which is not possible. Change the loop to 'do {} while (array != NULL)' to satisfy scan-build and assert that array really cannot be NULL just in case. Submitted by: pjd@ Found by: scan-build MFC after: 1 month Sponsored by: Wheel Systems Modified: head/sys/contrib/libnv/nvlist.c Modified: head/sys/contrib/libnv/nvlist.c ============================================================================== --- head/sys/contrib/libnv/nvlist.c Thu Sep 21 10:00:16 2017 (r323851) +++ head/sys/contrib/libnv/nvlist.c Thu Sep 21 10:03:14 2017 (r323852) @@ -1200,12 +1200,13 @@ nvlist_xunpack(const void *buf, size_t size, const int &array); if (ptr == NULL) goto failed; + PJDLOG_ASSERT(array != NULL); tmpnvl = array; - while (array != NULL) { + do { nvlist_set_parent(array, nvp); array = __DECONST(nvlist_t *, nvlist_get_array_next(array)); - } + } while (array != NULL); ptr = nvlist_unpack_header(tmpnvl, ptr, nfds, &isbe, &left); break; From owner-svn-src-head@freebsd.org Thu Sep 21 10:06:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97E6BE21791; Thu, 21 Sep 2017 10:06:01 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72A607222A; Thu, 21 Sep 2017 10:06:01 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LA60aj068341; Thu, 21 Sep 2017 10:06:00 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LA60B7068339; Thu, 21 Sep 2017 10:06:00 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201709211006.v8LA60B7068339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Thu, 21 Sep 2017 10:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323853 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 323853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 10:06:01 -0000 Author: oshogbo Date: Thu Sep 21 10:06:00 2017 New Revision: 323853 URL: https://svnweb.freebsd.org/changeset/base/323853 Log: Make the code consistent by always using 'fail' label. Submitted by: pjd@ and oshogbo@ MFC after: 1 month Sponsored by: Wheel Systems Modified: head/sys/contrib/libnv/nvlist.c head/sys/contrib/libnv/nvpair.c Modified: head/sys/contrib/libnv/nvlist.c ============================================================================== --- head/sys/contrib/libnv/nvlist.c Thu Sep 21 10:03:14 2017 (r323852) +++ head/sys/contrib/libnv/nvlist.c Thu Sep 21 10:06:00 2017 (r323853) @@ -1067,24 +1067,24 @@ nvlist_unpack_header(nvlist_t *nvl, const unsigned cha int inarrayf; if (*leftp < sizeof(nvlhdr)) - goto failed; + goto fail; memcpy(&nvlhdr, ptr, sizeof(nvlhdr)); if (!nvlist_check_header(&nvlhdr)) - goto failed; + goto fail; if (nvlhdr.nvlh_size != *leftp - sizeof(nvlhdr)) - goto failed; + goto fail; /* * nvlh_descriptors might be smaller than nfds in embedded nvlists. */ if (nvlhdr.nvlh_descriptors > nfds) - goto failed; + goto fail; if ((nvlhdr.nvlh_flags & ~NV_FLAG_ALL_MASK) != 0) - goto failed; + goto fail; inarrayf = (nvl->nvl_flags & NV_FLAG_IN_ARRAY); nvl->nvl_flags = (nvlhdr.nvlh_flags & NV_FLAG_PUBLIC_MASK) | inarrayf; @@ -1095,7 +1095,7 @@ nvlist_unpack_header(nvlist_t *nvl, const unsigned cha *leftp -= sizeof(nvlhdr); return (ptr); -failed: +fail: ERRNO_SET(EINVAL); return (NULL); } @@ -1118,20 +1118,20 @@ nvlist_xunpack(const void *buf, size_t size, const int tmpnvl = array = NULL; nvl = retnvl = nvlist_create(0); if (nvl == NULL) - goto failed; + goto fail; ptr = nvlist_unpack_header(nvl, ptr, nfds, &isbe, &left); if (ptr == NULL) - goto failed; + goto fail; if (nvl->nvl_flags != flags) { ERRNO_SET(EILSEQ); - goto failed; + goto fail; } while (left > 0) { ptr = nvpair_unpack(isbe, ptr, &left, &nvp); if (ptr == NULL) - goto failed; + goto fail; switch (nvpair_type(nvp)) { case NV_TYPE_NULL: ptr = nvpair_unpack_null(isbe, nvp, ptr, &left); @@ -1149,7 +1149,7 @@ nvlist_xunpack(const void *buf, size_t size, const int ptr = nvpair_unpack_nvlist(isbe, nvp, ptr, &left, nfds, &tmpnvl); if (tmpnvl == NULL || ptr == NULL) - goto failed; + goto fail; nvlist_set_parent(tmpnvl, nvp); break; #ifndef _KERNEL @@ -1167,14 +1167,14 @@ nvlist_xunpack(const void *buf, size_t size, const int break; case NV_TYPE_NVLIST_UP: if (nvl->nvl_parent == NULL) - goto failed; + goto fail; nvl = nvpair_nvlist(nvl->nvl_parent); nvpair_free_structure(nvp); continue; case NV_TYPE_NVLIST_ARRAY_NEXT: if (nvl->nvl_array_next == NULL) { if (nvl->nvl_parent == NULL) - goto failed; + goto fail; nvl = nvpair_nvlist(nvl->nvl_parent); } else { nvl = __DECONST(nvlist_t *, @@ -1182,7 +1182,7 @@ nvlist_xunpack(const void *buf, size_t size, const int ptr = nvlist_unpack_header(nvl, ptr, nfds, &isbe, &left); if (ptr == NULL) - goto failed; + goto fail; } nvpair_free_structure(nvp); continue; @@ -1199,7 +1199,7 @@ nvlist_xunpack(const void *buf, size_t size, const int ptr = nvpair_unpack_nvlist_array(isbe, nvp, ptr, &left, &array); if (ptr == NULL) - goto failed; + goto fail; PJDLOG_ASSERT(array != NULL); tmpnvl = array; do { @@ -1214,9 +1214,9 @@ nvlist_xunpack(const void *buf, size_t size, const int PJDLOG_ABORT("Invalid type (%d).", nvpair_type(nvp)); } if (ptr == NULL) - goto failed; + goto fail; if (!nvlist_move_nvpair(nvl, nvp)) - goto failed; + goto fail; if (tmpnvl != NULL) { nvl = tmpnvl; tmpnvl = NULL; @@ -1224,7 +1224,7 @@ nvlist_xunpack(const void *buf, size_t size, const int } return (retnvl); -failed: +fail: nvlist_destroy(retnvl); return (NULL); } Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Thu Sep 21 10:03:14 2017 (r323852) +++ head/sys/contrib/libnv/nvpair.c Thu Sep 21 10:06:00 2017 (r323853) @@ -614,7 +614,7 @@ nvpair_unpack_header(bool isbe, nvpair_t *nvp, const u struct nvpair_header nvphdr; if (*leftp < sizeof(nvphdr)) - goto failed; + goto fail; memcpy(&nvphdr, ptr, sizeof(nvphdr)); ptr += sizeof(nvphdr); @@ -622,12 +622,12 @@ nvpair_unpack_header(bool isbe, nvpair_t *nvp, const u #if NV_TYPE_FIRST > 0 if (nvphdr.nvph_type < NV_TYPE_FIRST) - goto failed; + goto fail; #endif if (nvphdr.nvph_type > NV_TYPE_LAST && nvphdr.nvph_type != NV_TYPE_NVLIST_UP && nvphdr.nvph_type != NV_TYPE_NVLIST_ARRAY_NEXT) { - goto failed; + goto fail; } #if BYTE_ORDER == BIG_ENDIAN @@ -643,14 +643,14 @@ nvpair_unpack_header(bool isbe, nvpair_t *nvp, const u #endif if (nvphdr.nvph_namesize > NV_NAME_MAX) - goto failed; + goto fail; if (*leftp < nvphdr.nvph_namesize) - goto failed; + goto fail; if (nvphdr.nvph_namesize < 1) - goto failed; + goto fail; if (strnlen((const char *)ptr, nvphdr.nvph_namesize) != (size_t)(nvphdr.nvph_namesize - 1)) { - goto failed; + goto fail; } memcpy(nvp->nvp_name, ptr, nvphdr.nvph_namesize); @@ -658,7 +658,7 @@ nvpair_unpack_header(bool isbe, nvpair_t *nvp, const u *leftp -= nvphdr.nvph_namesize; if (*leftp < nvphdr.nvph_datasize) - goto failed; + goto fail; nvp->nvp_type = nvphdr.nvph_type; nvp->nvp_data = 0; @@ -666,7 +666,7 @@ nvpair_unpack_header(bool isbe, nvpair_t *nvp, const u nvp->nvp_nitems = nvphdr.nvph_nitems; return (ptr); -failed: +fail: ERRNO_SET(EINVAL); return (NULL); } @@ -1108,10 +1108,10 @@ nvpair_unpack(bool isbe, const unsigned char *ptr, siz ptr = nvpair_unpack_header(isbe, nvp, ptr, leftp); if (ptr == NULL) - goto failed; + goto fail; tmp = nv_realloc(nvp, sizeof(*nvp) + strlen(nvp->nvp_name) + 1); if (tmp == NULL) - goto failed; + goto fail; nvp = tmp; /* Update nvp_name after realloc(). */ @@ -1120,7 +1120,7 @@ nvpair_unpack(bool isbe, const unsigned char *ptr, siz nvp->nvp_magic = NVPAIR_MAGIC; *nvpp = nvp; return (ptr); -failed: +fail: nv_free(nvp); return (NULL); } From owner-svn-src-head@freebsd.org Thu Sep 21 10:10:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8790BE21BB6; Thu, 21 Sep 2017 10:10:43 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51CCB724B9; Thu, 21 Sep 2017 10:10:43 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LAAgca068624; Thu, 21 Sep 2017 10:10:42 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LAAgmw068623; Thu, 21 Sep 2017 10:10:42 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201709211010.v8LAAgmw068623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Thu, 21 Sep 2017 10:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323854 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 323854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 10:10:43 -0000 Author: oshogbo Date: Thu Sep 21 10:10:42 2017 New Revision: 323854 URL: https://svnweb.freebsd.org/changeset/base/323854 Log: Because nvp wasn't initialized on every loop iteration once we jumped to 'fail' on error it was treated as success, because nvp!=NULL. Fix this by not handling success under 'fail' label and by using separate variable for parent nvpair. If we succeeded to allocate nvlist, but failed to allocated nvpair we would leak nvls[ii] on return. Destroy it when we cannot allocate nvpair, before we goto fail. Submitted by: pjd@ and oshogbo@ (minor changes) Found by: scan-build MFC after: 1 month Sponsored by: Wheel Systems Modified: head/sys/contrib/libnv/nvpair.c Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Thu Sep 21 10:06:00 2017 (r323853) +++ head/sys/contrib/libnv/nvpair.c Thu Sep 21 10:10:42 2017 (r323854) @@ -1407,10 +1407,9 @@ nvpair_create_nvlist_array(const char *name, const nvl { unsigned int ii; nvlist_t **nvls; - nvpair_t *nvp; + nvpair_t *parent; int flags; - nvp = NULL; nvls = NULL; if (value == NULL || nitems == 0) { @@ -1433,33 +1432,40 @@ nvpair_create_nvlist_array(const char *name, const nvl goto fail; if (ii > 0) { + nvpair_t *nvp; + nvp = nvpair_allocv(" ", NV_TYPE_NVLIST, (uint64_t)(uintptr_t)nvls[ii], 0, 0); - if (nvp == NULL) + if (nvp == NULL) { + ERRNO_SAVE(); + nvlist_destroy(nvls[ii]); + ERRNO_RESTORE(); goto fail; + } nvlist_set_array_next(nvls[ii - 1], nvp); } } flags = nvlist_flags(nvls[nitems - 1]) | NV_FLAG_IN_ARRAY; nvlist_set_flags(nvls[nitems - 1], flags); - nvp = nvpair_allocv(name, NV_TYPE_NVLIST_ARRAY, + parent = nvpair_allocv(name, NV_TYPE_NVLIST_ARRAY, (uint64_t)(uintptr_t)nvls, 0, nitems); + if (parent == NULL) + goto fail; -fail: - if (nvp == NULL) { - ERRNO_SAVE(); - for (; ii > 0; ii--) - nvlist_destroy(nvls[ii - 1]); + for (ii = 0; ii < nitems; ii++) + nvlist_set_parent(nvls[ii], parent); - nv_free(nvls); - ERRNO_RESTORE(); - } else { - for (ii = 0; ii < nitems; ii++) - nvlist_set_parent(nvls[ii], nvp); - } + return (parent); - return (nvp); +fail: + ERRNO_SAVE(); + for (; ii > 0; ii--) + nvlist_destroy(nvls[ii - 1]); + nv_free(nvls); + ERRNO_RESTORE(); + + return (NULL); } #ifndef _KERNEL From owner-svn-src-head@freebsd.org Thu Sep 21 10:13:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B315EE21F8E; Thu, 21 Sep 2017 10:13:49 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80920728E5; Thu, 21 Sep 2017 10:13:49 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LADmBT072835; Thu, 21 Sep 2017 10:13:48 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LADmMj072833; Thu, 21 Sep 2017 10:13:48 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201709211013.v8LADmMj072833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Thu, 21 Sep 2017 10:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323855 - head/tools/tools/nanobsd X-SVN-Group: head X-SVN-Commit-Author: n_hibma X-SVN-Commit-Paths: head/tools/tools/nanobsd X-SVN-Commit-Revision: 323855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 10:13:49 -0000 Author: n_hibma Date: Thu Sep 21 10:13:48 2017 New Revision: 323855 URL: https://svnweb.freebsd.org/changeset/base/323855 Log: Remove an 'unused' function. This function was only set in legacy.sh and only at the very end after the disk image had been successfully created. The only difference will be that the message 'Error encountered. Please check...' will not appear if nanobsd.sh exits with an error after the disk image has been created. Modified: head/tools/tools/nanobsd/defaults.sh head/tools/tools/nanobsd/legacy.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Thu Sep 21 10:10:42 2017 (r323854) +++ head/tools/tools/nanobsd/defaults.sh Thu Sep 21 10:13:48 2017 (r323855) @@ -291,11 +291,6 @@ CR0 ( ) { chroot "${NANO_WORLDDIR}" /bin/sh -c "$*" || true } -nano_cleanup ( ) ( - [ $? -eq 0 ] || echo "Error encountered. Check for errors in last log file." 1>&2 - exit $? -) - clean_build ( ) ( pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})" Modified: head/tools/tools/nanobsd/legacy.sh ============================================================================== --- head/tools/tools/nanobsd/legacy.sh Thu Sep 21 10:10:42 2017 (r323854) +++ head/tools/tools/nanobsd/legacy.sh Thu Sep 21 10:13:48 2017 (r323855) @@ -198,7 +198,6 @@ create_diskimage ( ) ( mdconfig -d -u $MD trap - 1 2 15 - trap nano_cleanup EXIT ) > ${NANO_LOG}/_.di 2>&1 ) From owner-svn-src-head@freebsd.org Thu Sep 21 10:14:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8351FE22091; Thu, 21 Sep 2017 10:14:44 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5073B72A45; Thu, 21 Sep 2017 10:14:44 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LAEhde072913; Thu, 21 Sep 2017 10:14:43 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LAEhlK072912; Thu, 21 Sep 2017 10:14:43 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201709211014.v8LAEhlK072912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Thu, 21 Sep 2017 10:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323856 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 323856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 10:14:44 -0000 Author: oshogbo Date: Thu Sep 21 10:14:43 2017 New Revision: 323856 URL: https://svnweb.freebsd.org/changeset/base/323856 Log: Free 'value' only once we are done freeing all individual Submitted by: pjd@ MFC after: 1 month Found by: scan-build Sponsored by: Wheel Systems Modified: head/sys/contrib/libnv/nvpair.c Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Thu Sep 21 10:13:48 2017 (r323855) +++ head/sys/contrib/libnv/nvpair.c Thu Sep 21 10:14:43 2017 (r323856) @@ -1727,8 +1727,8 @@ fail: nvlist_get_pararr(value[ii], NULL) != NULL) { nvlist_destroy(value[ii]); } - nv_free(value); } + nv_free(value); ERRNO_RESTORE(); } else { for (ii = 0; ii < nitems; ii++) From owner-svn-src-head@freebsd.org Thu Sep 21 10:16:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9060FE22265; Thu, 21 Sep 2017 10:16:45 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F73A72D00; Thu, 21 Sep 2017 10:16:45 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LAGi7Q073070; Thu, 21 Sep 2017 10:16:44 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LAGig1073069; Thu, 21 Sep 2017 10:16:44 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201709211016.v8LAGig1073069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Thu, 21 Sep 2017 10:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323858 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 323858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 10:16:45 -0000 Author: oshogbo Date: Thu Sep 21 10:16:44 2017 New Revision: 323858 URL: https://svnweb.freebsd.org/changeset/base/323858 Log: IMHO it is possible that failure will be treated as success because we don't initialize nvp on every loop iteration and the code under 'fail'(!) label detects success by checking of nvp != NULL. Submitted by: pjd@ MFC after: 1 month Sponsored by: Wheel Systems Modified: head/sys/contrib/libnv/nvpair.c Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Thu Sep 21 10:16:25 2017 (r323857) +++ head/sys/contrib/libnv/nvpair.c Thu Sep 21 10:16:44 2017 (r323858) @@ -1690,11 +1690,10 @@ nvpair_move_number_array(const char *name, uint64_t *v nvpair_t * nvpair_move_nvlist_array(const char *name, nvlist_t **value, size_t nitems) { + nvpair_t *parent; unsigned int ii; - nvpair_t *nvp; int flags; - nvp = NULL; if (value == NULL || nitems == 0) { ERRNO_SET(EINVAL); return (NULL); @@ -1707,6 +1706,8 @@ nvpair_move_nvlist_array(const char *name, nvlist_t ** goto fail; } if (ii > 0) { + nvpair_t *nvp; + nvp = nvpair_allocv(" ", NV_TYPE_NVLIST, (uint64_t)(uintptr_t)value[ii], 0, 0); if (nvp == NULL) @@ -1717,25 +1718,27 @@ nvpair_move_nvlist_array(const char *name, nvlist_t ** flags = nvlist_flags(value[nitems - 1]) | NV_FLAG_IN_ARRAY; nvlist_set_flags(value[nitems - 1], flags); - nvp = nvpair_allocv(name, NV_TYPE_NVLIST_ARRAY, + parent = nvpair_allocv(name, NV_TYPE_NVLIST_ARRAY, (uint64_t)(uintptr_t)value, 0, nitems); + if (parent == NULL) + goto fail; + + for (ii = 0; ii < nitems; ii++) + nvlist_set_parent(value[ii], parent); + + return (parent); fail: - if (nvp == NULL) { - ERRNO_SAVE(); - for (ii = 0; ii < nitems; ii++) { - if (value[ii] != NULL && - nvlist_get_pararr(value[ii], NULL) != NULL) { - nvlist_destroy(value[ii]); - } + ERRNO_SAVE(); + for (ii = 0; ii < nitems; ii++) { + if (value[ii] != NULL && + nvlist_get_pararr(value[ii], NULL) != NULL) { + nvlist_destroy(value[ii]); } - nv_free(value); - ERRNO_RESTORE(); - } else { - for (ii = 0; ii < nitems; ii++) - nvlist_set_parent(value[ii], nvp); } + nv_free(value); + ERRNO_RESTORE(); - return (nvp); + return (NULL); } #ifndef _KERNEL From owner-svn-src-head@freebsd.org Thu Sep 21 10:18:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BDEFE223AC; Thu, 21 Sep 2017 10:18:03 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B30872E69; Thu, 21 Sep 2017 10:18:02 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LAI2A3073155; Thu, 21 Sep 2017 10:18:02 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LAI2Yp073154; Thu, 21 Sep 2017 10:18:02 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201709211018.v8LAI2Yp073154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Thu, 21 Sep 2017 10:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323859 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 323859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 10:18:03 -0000 Author: oshogbo Date: Thu Sep 21 10:18:02 2017 New Revision: 323859 URL: https://svnweb.freebsd.org/changeset/base/323859 Log: Simplify the code by _not_ expecting success under 'fail'. Submitted by: pjd@ and oshogbo@ MFC after: 1 month Sponsored by: Wheel Systems Modified: head/sys/contrib/libnv/nvpair.c Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Thu Sep 21 10:16:44 2017 (r323858) +++ head/sys/contrib/libnv/nvpair.c Thu Sep 21 10:18:02 2017 (r323859) @@ -1748,7 +1748,6 @@ nvpair_move_descriptor_array(const char *name, int *va nvpair_t *nvp; size_t i; - nvp = NULL; if (value == NULL || nitems == 0) { ERRNO_SET(EINVAL); return (NULL); @@ -1763,19 +1762,20 @@ nvpair_move_descriptor_array(const char *name, int *va nvp = nvpair_allocv(name, NV_TYPE_DESCRIPTOR_ARRAY, (uint64_t)(uintptr_t)value, sizeof(value[0]) * nitems, nitems); + if (nvp == NULL) + goto fail; + return (nvp); fail: - if (nvp == NULL) { - ERRNO_SAVE(); - for (i = 0; i < nitems; i++) { - if (fd_is_valid(value[i])) - close(value[i]); - } - nv_free(value); - ERRNO_RESTORE(); + ERRNO_SAVE(); + for (i = 0; i < nitems; i++) { + if (fd_is_valid(value[i])) + close(value[i]); } + nv_free(value); + ERRNO_RESTORE(); - return (nvp); + return (NULL); } #endif From owner-svn-src-head@freebsd.org Thu Sep 21 10:28:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FE30E22CEB; Thu, 21 Sep 2017 10:28:24 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EFAE734D9; Thu, 21 Sep 2017 10:28:24 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LASMQf077072; Thu, 21 Sep 2017 10:28:22 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LASMme077071; Thu, 21 Sep 2017 10:28:22 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201709211028.v8LASMme077071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Thu, 21 Sep 2017 10:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323860 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 323860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 10:28:24 -0000 Author: oshogbo Date: Thu Sep 21 10:28:22 2017 New Revision: 323860 URL: https://svnweb.freebsd.org/changeset/base/323860 Log: Plug memory leak in case when nvlist allocation succeeds, but nvpair allocation fails. Submitted by: pjd@ MFC after: 1 month Sponsored by: Wheel Systems Modified: head/sys/contrib/libnv/nvpair.c Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Thu Sep 21 10:18:02 2017 (r323859) +++ head/sys/contrib/libnv/nvpair.c Thu Sep 21 10:28:22 2017 (r323860) @@ -1087,7 +1087,7 @@ nvpair_unpack_nvlist_array(bool isbe __unused, nvpair_ return (ptr); fail: ERRNO_SAVE(); - for (j = 0; j < ii; j++) + for (j = 0; j <= ii; j++) nvlist_destroy(value[j]); nv_free(value); ERRNO_RESTORE(); From owner-svn-src-head@freebsd.org Thu Sep 21 11:56:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23082E26EA3; Thu, 21 Sep 2017 11:56:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECACA76061; Thu, 21 Sep 2017 11:56:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LBuW8J014191; Thu, 21 Sep 2017 11:56:32 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LBuVqS014187; Thu, 21 Sep 2017 11:56:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709211156.v8LBuVqS014187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 21 Sep 2017 11:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323861 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 323861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 11:56:33 -0000 Author: tuexen Date: Thu Sep 21 11:56:31 2017 New Revision: 323861 URL: https://svnweb.freebsd.org/changeset/base/323861 Log: Code cleanup, no functional change. MFC after: 1 week Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Thu Sep 21 10:28:22 2017 (r323860) +++ head/sys/netinet/sctp_constants.h Thu Sep 21 11:56:31 2017 (r323861) @@ -969,9 +969,6 @@ __FBSDID("$FreeBSD$"); #define SCTP_SO_NOT_LOCKED 0 -#define SCTP_HOLDS_LOCK 1 -#define SCTP_NOT_LOCKED 0 - /*- * For address locks, do we hold the lock? */ Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Sep 21 10:28:22 2017 (r323860) +++ head/sys/netinet/sctp_input.c Thu Sep 21 11:56:31 2017 (r323861) @@ -197,8 +197,7 @@ sctp_handle_init(struct mbuf *m, int iphlen, int offse sctp_send_initiate_ack(inp, stcb, net, m, iphlen, offset, src, dst, sh, cp, mflowtype, mflowid, - vrf_id, port, - ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); + vrf_id, port); } outnow: if (stcb == NULL) { Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Sep 21 10:28:22 2017 (r323860) +++ head/sys/netinet/sctp_output.c Thu Sep 21 11:56:31 2017 (r323861) @@ -5491,7 +5491,7 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_chunk *init_chk, uint8_t mflowtype, uint32_t mflowid, - uint32_t vrf_id, uint16_t port, int hold_inp_lock) + uint32_t vrf_id, uint16_t port) { struct sctp_association *asoc; struct mbuf *m, *m_tmp, *m_last, *m_cookie, *op_err; @@ -5839,10 +5839,6 @@ do_a_abort: } else { uint32_t vtag, itsn; - if (hold_inp_lock) { - SCTP_INP_INCR_REF(inp); - SCTP_INP_RUNLOCK(inp); - } if (asoc) { atomic_add_int(&asoc->refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -5862,12 +5858,12 @@ do_a_abort: SCTP_TCB_LOCK(stcb); atomic_add_int(&asoc->refcnt, -1); } else { + SCTP_INP_INCR_REF(inp); + SCTP_INP_RUNLOCK(inp); vtag = sctp_select_a_tag(inp, inp->sctp_lport, sh->src_port, 1); initack->init.initiate_tag = htonl(vtag); /* get a TSN to use too */ initack->init.initial_tsn = htonl(sctp_select_initial_TSN(&inp->sctp_ep)); - } - if (hold_inp_lock) { SCTP_INP_RLOCK(inp); SCTP_INP_DECR_REF(inp); } Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Thu Sep 21 10:28:22 2017 (r323860) +++ head/sys/netinet/sctp_output.h Thu Sep 21 11:56:31 2017 (r323861) @@ -86,7 +86,7 @@ sctp_send_initiate_ack(struct sctp_inpcb *, struct sct struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_init_chunk *, uint8_t, uint32_t, - uint32_t, uint16_t, int); + uint32_t, uint16_t); struct mbuf * sctp_arethere_unrecognized_parameters(struct mbuf *, int, int *, From owner-svn-src-head@freebsd.org Thu Sep 21 14:14:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 429DCE06C38; Thu, 21 Sep 2017 14:14:02 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10A627F96D; Thu, 21 Sep 2017 14:14:01 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LEE1BM072239; Thu, 21 Sep 2017 14:14:01 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LEE1QZ072238; Thu, 21 Sep 2017 14:14:01 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201709211414.v8LEE1QZ072238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 21 Sep 2017 14:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323864 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 323864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 14:14:02 -0000 Author: kp Date: Thu Sep 21 14:14:01 2017 New Revision: 323864 URL: https://svnweb.freebsd.org/changeset/base/323864 Log: bridge: Set module version This ensures that the loader will not load the module if it's also built in to the kernel. PR: 220860 Submitted by: Eugene Grosbein Reported by: Marie Helene Kvello-Aune Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Thu Sep 21 12:37:12 2017 (r323863) +++ head/sys/net/if_bridge.c Thu Sep 21 14:14:01 2017 (r323864) @@ -584,6 +584,7 @@ static moduledata_t bridge_mod = { }; DECLARE_MODULE(if_bridge, bridge_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +MODULE_VERSION(if_bridge, 1); MODULE_DEPEND(if_bridge, bridgestp, 1, 1, 1); /* From owner-svn-src-head@freebsd.org Thu Sep 21 14:14:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F688E06DA7; Thu, 21 Sep 2017 14:14:50 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BF137FB8D; Thu, 21 Sep 2017 14:14:50 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LEEnHH072322; Thu, 21 Sep 2017 14:14:49 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LEEna8072320; Thu, 21 Sep 2017 14:14:49 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201709211414.v8LEEna8072320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 21 Sep 2017 14:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323865 - in head/bin/cat: . tests X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: in head/bin/cat: . tests X-SVN-Commit-Revision: 323865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 14:14:50 -0000 Author: sevan (doc committer) Date: Thu Sep 21 14:14:49 2017 New Revision: 323865 URL: https://svnweb.freebsd.org/changeset/base/323865 Log: Ammend bin/cat/cat.c so the output is the same aside from blank lines being numbered or unnumbered, depending on whether cat was invoked with -ne or -be. At present, when cat is invoked with -be, there is an aditional difference that the '$' on blank lines is placed on the far left of the output. Discussed in bug 210607. While here, revert the workaround from r304035 which skipped the unit test for this issue previously. PR: 210607 Submitted by: myself Reviewed by: bdrewery Obtained from: NetBSD Relnotes: yes Differential Revision: https://reviews.freebsd.org/D12432 Modified: head/bin/cat/cat.c head/bin/cat/tests/Makefile Modified: head/bin/cat/cat.c ============================================================================== --- head/bin/cat/cat.c Thu Sep 21 14:14:01 2017 (r323864) +++ head/bin/cat/cat.c Thu Sep 21 14:14:49 2017 (r323865) @@ -226,10 +226,16 @@ cook_cat(FILE *fp) } else gobble = 0; } - if (nflag && (!bflag || ch != '\n')) { - (void)fprintf(stdout, "%6d\t", ++line); - if (ferror(stdout)) - break; + if (nflag) { + if (!bflag || ch != '\n') { + (void)fprintf(stdout, "%6d\t", ++line); + if (ferror(stdout)) + break; + } else if (eflag) { + (void)fprintf(stdout, "%6s\t", ""); + if (ferror(stdout)) + break; + } } } if (ch == '\n') { Modified: head/bin/cat/tests/Makefile ============================================================================== --- head/bin/cat/tests/Makefile Thu Sep 21 14:14:01 2017 (r323864) +++ head/bin/cat/tests/Makefile Thu Sep 21 14:14:49 2017 (r323865) @@ -17,10 +17,4 @@ ${PACKAGE}FILES+= d_vt_output.out .include -d_align.out: ${TESTSRC}/d_align.out - sed -E -e 's,^[[:space:]]{7}\$$$$,\$$,' < ${.ALLSRC} > ${.TARGET}.tmp - mv ${.TARGET}.tmp ${.TARGET} - -CLEANFILES+= d_align.out d_align.out.tmp - .include From owner-svn-src-head@freebsd.org Thu Sep 21 14:41:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C7A3E087B7; Thu, 21 Sep 2017 14:41:44 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDC3E80C2B; Thu, 21 Sep 2017 14:41:43 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LEfhvh082247; Thu, 21 Sep 2017 14:41:43 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LEfg1w082237; Thu, 21 Sep 2017 14:41:42 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201709211441.v8LEfg1w082237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Thu, 21 Sep 2017 14:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323866 - in head: contrib/tcpdump contrib/traceroute sbin/ping usr.bin/kdump usr.sbin/tcpdump/tcpdump usr.sbin/traceroute X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: contrib/tcpdump contrib/traceroute sbin/ping usr.bin/kdump usr.sbin/tcpdump/tcpdump usr.sbin/traceroute X-SVN-Commit-Revision: 323866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 14:41:44 -0000 Author: oshogbo Date: Thu Sep 21 14:41:41 2017 New Revision: 323866 URL: https://svnweb.freebsd.org/changeset/base/323866 Log: We use a few different ifdef's names to check if we are using Casper or not, let's standardize this. Now we are always use WITH_CASPER name. Discussed with: emaste@ MFC after: 1 month Modified: head/contrib/tcpdump/addrtoname.c head/contrib/tcpdump/tcpdump.c head/contrib/traceroute/traceroute.c head/sbin/ping/Makefile head/sbin/ping/ping.c head/usr.bin/kdump/Makefile head/usr.bin/kdump/kdump.c head/usr.sbin/tcpdump/tcpdump/Makefile head/usr.sbin/tcpdump/tcpdump/config.h head/usr.sbin/traceroute/Makefile Modified: head/contrib/tcpdump/addrtoname.c ============================================================================== --- head/contrib/tcpdump/addrtoname.c Thu Sep 21 14:14:49 2017 (r323865) +++ head/contrib/tcpdump/addrtoname.c Thu Sep 21 14:41:41 2017 (r323866) @@ -26,10 +26,10 @@ #include "config.h" #endif -#ifdef HAVE_CASPER +#ifdef WITH_CASPER #include #include -#endif /* HAVE_CASPER */ +#endif /* WITH_CASPER */ #include @@ -202,7 +202,7 @@ intoa(uint32_t addr) static uint32_t f_netmask; static uint32_t f_localnet; -#ifdef HAVE_CASPER +#ifdef WITH_CASPER extern cap_channel_t *capdns; #endif @@ -250,7 +250,7 @@ getname(netdissect_options *ndo, const u_char *ap) */ if (!ndo->ndo_nflag && (addr & f_netmask) == f_localnet) { -#ifdef HAVE_CASPER +#ifdef WITH_CASPER if (capdns != NULL) { hp = cap_gethostbyaddr(capdns, (char *)&addr, 4, AF_INET); @@ -311,7 +311,7 @@ getname6(netdissect_options *ndo, const u_char *ap) * Do not print names if -n was given. */ if (!ndo->ndo_nflag) { -#ifdef HAVE_CASPER +#ifdef WITH_CASPER if (capdns != NULL) { hp = cap_gethostbyaddr(capdns, (char *)&addr, sizeof(addr), AF_INET6); Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Thu Sep 21 14:14:49 2017 (r323865) +++ head/contrib/tcpdump/tcpdump.c Thu Sep 21 14:41:41 2017 (r323866) @@ -82,10 +82,10 @@ The Regents of the University of California. All righ #include #include #include -#ifdef HAVE_CASPER +#ifdef WITH_CASPER #include #include -#endif /* HAVE_CASPER */ +#endif /* WITH_CASPER */ #endif /* HAVE_CAPSICUM */ #include #include @@ -176,7 +176,7 @@ static int infoprint; char *program_name; -#ifdef HAVE_CASPER +#ifdef WITH_CASPER cap_channel_t *capdns; #endif @@ -730,7 +730,7 @@ get_next_file(FILE *VFile, char *ptr) return ret; } -#ifdef HAVE_CASPER +#ifdef WITH_CASPER static cap_channel_t * capdns_setup(void) { @@ -757,7 +757,7 @@ capdns_setup(void) return (capdnsloc); } -#endif /* HAVE_CASPER */ +#endif /* WITH_CASPER */ #ifdef HAVE_PCAP_SET_TSTAMP_PRECISION static int @@ -1839,10 +1839,10 @@ main(int argc, char **argv) exit_tcpdump(0); } -#ifdef HAVE_CASPER +#ifdef WITH_CASPER if (!ndo->ndo_nflag) capdns = capdns_setup(); -#endif /* HAVE_CASPER */ +#endif /* WITH_CASPER */ init_print(ndo, localnet, netmask, timezone_offset); @@ -2066,11 +2066,11 @@ main(int argc, char **argv) #ifdef HAVE_CAPSICUM cansandbox = (VFileName == NULL && zflag == NULL); -#ifdef HAVE_CASPER +#ifdef WITH_CASPER cansandbox = (cansandbox && (ndo->ndo_nflag || capdns != NULL)); #else cansandbox = (cansandbox && ndo->ndo_nflag); -#endif /* HAVE_CASPER */ +#endif /* WITH_CASPER */ if (cansandbox && cap_enter() < 0 && errno != ENOSYS) error("unable to enter the capability mode"); #endif /* HAVE_CAPSICUM */ Modified: head/contrib/traceroute/traceroute.c ============================================================================== --- head/contrib/traceroute/traceroute.c Thu Sep 21 14:14:49 2017 (r323865) +++ head/contrib/traceroute/traceroute.c Thu Sep 21 14:41:41 2017 (r323866) @@ -227,7 +227,7 @@ static const char rcsid[] = #include -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER #include #include #endif @@ -369,7 +369,7 @@ extern int optind; extern int opterr; extern char *optarg; -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER static cap_channel_t *capdns; #endif @@ -521,7 +521,7 @@ main(int argc, char **argv) int requestPort = -1; int sump = 0; int sockerrno; -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER const char *types[] = { "NAME", "ADDR" }; int families[1]; cap_channel_t *casper; @@ -556,7 +556,7 @@ main(int argc, char **argv) exit(1); } -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER casper = cap_init(); if (casper == NULL) errx(1, "unable to create casper process"); @@ -568,7 +568,7 @@ main(int argc, char **argv) families[0] = AF_INET; if (cap_dns_family_limit(capdns, families, 1) < 0) errx(1, "unable to limit access to system.dns service"); -#endif /* HAVE_LIBCASPER */ +#endif /* WITH_CASPER */ #ifdef IPCTL_DEFTTL { @@ -584,7 +584,7 @@ main(int argc, char **argv) max_ttl = 30; #endif -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER cap_close(casper); #endif @@ -1006,7 +1006,7 @@ main(int argc, char **argv) exit(1); } -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER cansandbox = true; #else if (nflag) @@ -1851,7 +1851,7 @@ inetname(struct in_addr in) else { cp = strchr(domain, '.'); if (cp == NULL) { -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER if (capdns != NULL) hp = cap_gethostbyname(capdns, domain); else @@ -1870,7 +1870,7 @@ inetname(struct in_addr in) } } if (!nflag && in.s_addr != INADDR_ANY) { -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER if (capdns != NULL) hp = cap_gethostbyaddr(capdns, (char *)&in, sizeof(in), AF_INET); @@ -1922,7 +1922,7 @@ gethostinfo(register char *hostname) return (hi); } -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER if (capdns != NULL) hp = cap_gethostbyname(capdns, hostname); else Modified: head/sbin/ping/Makefile ============================================================================== --- head/sbin/ping/Makefile Thu Sep 21 14:14:49 2017 (r323865) +++ head/sbin/ping/Makefile Thu Sep 21 14:41:41 2017 (r323866) @@ -14,7 +14,7 @@ LIBADD= m .if ${MK_CASPER} != "no" && !defined(RESCUE) LIBADD+= casper LIBADD+= cap_dns -CFLAGS+=-DHAVE_LIBCASPER +CFLAGS+=-DWITH_CASPER .endif .if !defined(RELEASE_CRUNCH) Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Thu Sep 21 14:14:49 2017 (r323865) +++ head/sbin/ping/ping.c Thu Sep 21 14:41:41 2017 (r323866) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER #include #include #endif @@ -204,13 +204,13 @@ static double tsumsq = 0.0; /* sum of all times square static volatile sig_atomic_t finish_up; static volatile sig_atomic_t siginfo_p; -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER static cap_channel_t *capdns; #endif static void fill(char *, char *); static u_short in_cksum(u_short *, int); -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER static cap_channel_t *capdns_setup(void); #endif static void check_status(void); @@ -563,7 +563,7 @@ main(int argc, char *const *argv) if (options & F_PINGFILLED) { fill((char *)datap, payload); } -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER capdns = capdns_setup(); #endif if (source) { @@ -572,7 +572,7 @@ main(int argc, char *const *argv) if (inet_aton(source, &sock_in.sin_addr) != 0) { shostname = source; } else { -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER if (capdns != NULL) hp = cap_gethostbyname2(capdns, source, AF_INET); @@ -606,7 +606,7 @@ main(int argc, char *const *argv) if (inet_aton(target, &to->sin_addr) != 0) { hostname = target; } else { -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER if (capdns != NULL) hp = cap_gethostbyname2(capdns, target, AF_INET); else @@ -624,7 +624,7 @@ main(int argc, char *const *argv) hostname = hnamebuf; } -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER /* From now on we will use only reverse DNS lookups. */ if (capdns != NULL) { const char *types[1]; @@ -722,7 +722,7 @@ main(int argc, char *const *argv) if (options & F_NUMERIC) cansandbox = true; -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER else if (capdns != NULL) cansandbox = true; #endif @@ -1707,7 +1707,7 @@ pr_addr(struct in_addr ina) if (options & F_NUMERIC) return inet_ntoa(ina); -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER if (capdns != NULL) hp = cap_gethostbyaddr(capdns, (char *)&ina, 4, AF_INET); else @@ -1791,7 +1791,7 @@ fill(char *bp, char *patp) } } -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER static cap_channel_t * capdns_setup(void) { @@ -1817,7 +1817,7 @@ capdns_setup(void) return (capdnsloc); } -#endif /* HAVE_LIBCASPER */ +#endif /* WITH_CASPER */ #if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC) #define SECOPT " [-P policy]" Modified: head/usr.bin/kdump/Makefile ============================================================================== --- head/usr.bin/kdump/Makefile Thu Sep 21 14:14:49 2017 (r323865) +++ head/usr.bin/kdump/Makefile Thu Sep 21 14:41:41 2017 (r323866) @@ -14,7 +14,7 @@ LIBADD= sysdecode LIBADD+= casper LIBADD+= cap_grp LIBADD+= cap_pwd -CFLAGS+=-DHAVE_LIBCASPER +CFLAGS+=-DWITH_CASPER .endif #NO_WERROR?= YES Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Thu Sep 21 14:14:49 2017 (r323865) +++ head/usr.bin/kdump/kdump.c Thu Sep 21 14:41:41 2017 (r323866) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER #include #endif #include @@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include "ktrace.h" -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER #include #include @@ -164,7 +164,7 @@ struct proc_info static TAILQ_HEAD(trace_procs, proc_info) trace_procs; -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER static cap_channel_t *cappwd, *capgrp; #endif @@ -193,7 +193,7 @@ localtime_init(void) (void)localtime(<ime); } -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER static int cappwdgrp_setup(cap_channel_t **cappwdp, cap_channel_t **capgrpp) { @@ -235,7 +235,7 @@ cappwdgrp_setup(cap_channel_t **cappwdp, cap_channel_t *capgrpp = capgrploc; return (0); } -#endif /* HAVE_LIBCASPER */ +#endif /* WITH_CASPER */ static void print_integer_arg(const char *(*decoder)(int), int value) @@ -443,7 +443,7 @@ main(int argc, char *argv[]) strerror_init(); localtime_init(); -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER if (resolv != 0) { if (cappwdgrp_setup(&cappwd, &capgrp) < 0) { cappwd = NULL; @@ -1874,7 +1874,7 @@ ktrstat(struct stat *statp) if (resolv == 0) { pwd = NULL; } else { -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER if (cappwd != NULL) pwd = cap_getpwuid(cappwd, statp->st_uid); else @@ -1888,7 +1888,7 @@ ktrstat(struct stat *statp) if (resolv == 0) { grp = NULL; } else { -#ifdef HAVE_LIBCASPER +#ifdef WITH_CASPER if (capgrp != NULL) grp = cap_getgrgid(capgrp, statp->st_gid); else Modified: head/usr.sbin/tcpdump/tcpdump/Makefile ============================================================================== --- head/usr.sbin/tcpdump/tcpdump/Makefile Thu Sep 21 14:14:49 2017 (r323865) +++ head/usr.sbin/tcpdump/tcpdump/Makefile Thu Sep 21 14:41:41 2017 (r323866) @@ -190,7 +190,7 @@ LIBADD= l pcap .if ${MK_CASPER} != "no" LIBADD+= casper LIBADD+= cap_dns -CFLAGS+=-DHAVE_CASPER +CFLAGS+=-DWITH_CASPER .endif .if ${MK_OPENSSL} != "no" LIBADD+= crypto Modified: head/usr.sbin/tcpdump/tcpdump/config.h ============================================================================== --- head/usr.sbin/tcpdump/tcpdump/config.h Thu Sep 21 14:14:49 2017 (r323865) +++ head/usr.sbin/tcpdump/tcpdump/config.h Thu Sep 21 14:41:41 2017 (r323866) @@ -18,7 +18,7 @@ /* Casper library support available */ /* See Makefile */ -/* #undef HAVE_CASPER */ +/* #undef WITH_CASPER */ /* Define to 1 if you have the `cap_enter' function. */ #define HAVE_CAP_ENTER 1 Modified: head/usr.sbin/traceroute/Makefile ============================================================================== --- head/usr.sbin/traceroute/Makefile Thu Sep 21 14:14:49 2017 (r323865) +++ head/usr.sbin/traceroute/Makefile Thu Sep 21 14:41:41 2017 (r323866) @@ -33,7 +33,7 @@ LIBADD+= ipsec .if ${MK_CASPER} != "no" LIBADD+= casper LIBADD+= cap_dns -CFLAGS+=-DHAVE_LIBCASPER +CFLAGS+=-DWITH_CASPER .endif CFLAGS+= -I${TRACEROUTE_DISTDIR} From owner-svn-src-head@freebsd.org Thu Sep 21 15:30:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19975E0B37A; Thu, 21 Sep 2017 15:30:22 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCE89828B8; Thu, 21 Sep 2017 15:30:21 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LFULJX002167; Thu, 21 Sep 2017 15:30:21 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LFULoR002166; Thu, 21 Sep 2017 15:30:21 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201709211530.v8LFULoR002166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 21 Sep 2017 15:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323867 - head/sys/boot/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/efi/libefi X-SVN-Commit-Revision: 323867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 15:30:22 -0000 Author: tsoome Date: Thu Sep 21 15:30:20 2017 New Revision: 323867 URL: https://svnweb.freebsd.org/changeset/base/323867 Log: libefi: devicename.c cleanups Remove duplicated free()+return statements, default unit to 0 and improve strtol error processing. Modified: head/sys/boot/efi/libefi/devicename.c Modified: head/sys/boot/efi/libefi/devicename.c ============================================================================== --- head/sys/boot/efi/libefi/devicename.c Thu Sep 21 14:41:41 2017 (r323866) +++ head/sys/boot/efi/libefi/devicename.c Thu Sep 21 15:30:20 2017 (r323867) @@ -87,9 +87,9 @@ efi_parsedev(struct devdesc **dev, const char *devspec { struct devdesc *idev; struct devsw *dv; + int i, unit, err; char *cp; const char *np; - int i, err; /* minimum length check */ if (strlen(devspec) < 2) @@ -105,6 +105,7 @@ efi_parsedev(struct devdesc **dev, const char *devspec return (ENOENT); np = devspec + strlen(dv->dv_name); + idev = NULL; err = 0; switch (dv->dv_type) { @@ -117,10 +118,8 @@ efi_parsedev(struct devdesc **dev, const char *devspec return (ENOMEM); err = disk_parsedev((struct disk_devdesc *)idev, np, path); - if (err != 0) { - free(idev); - return (err); - } + if (err != 0) + goto fail; break; #ifdef EFI_ZFS_BOOT @@ -130,10 +129,8 @@ efi_parsedev(struct devdesc **dev, const char *devspec return (ENOMEM); err = zfs_parsedev((struct zfs_devdesc*)idev, np, path); - if (err != 0) { - free(idev); - return (err); - } + if (err != 0) + goto fail; break; #endif default: @@ -141,20 +138,23 @@ efi_parsedev(struct devdesc **dev, const char *devspec if (idev == NULL) return (ENOMEM); - idev->d_unit = -1; + unit = 0; cp = (char *)np; + if (*np != '\0' && *np != ':') { - idev->d_unit = strtol(np, &cp, 0); - if (cp == np) { - free(idev); - return (EUNIT); + errno = 0; + unit = strtol(np, &cp, 0); + if (errno != 0 || cp == np) { + err = EUNIT; + goto fail; } } if (*cp != '\0' && *cp != ':') { - free(idev); - return (EINVAL); + err = EINVAL; + goto fail; } + idev->d_unit = unit; if (path != NULL) *path = (*cp == 0) ? cp : cp + 1; break; @@ -168,6 +168,10 @@ efi_parsedev(struct devdesc **dev, const char *devspec else free(idev); return (0); + +fail: + free(idev); + return (err); } char * From owner-svn-src-head@freebsd.org Thu Sep 21 15:32:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2161AE0B73A; Thu, 21 Sep 2017 15:32:43 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3F0A82CBB; Thu, 21 Sep 2017 15:32:42 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LFWgpC006135; Thu, 21 Sep 2017 15:32:42 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LFWfwo006133; Thu, 21 Sep 2017 15:32:41 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201709211532.v8LFWfwo006133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 21 Sep 2017 15:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323868 - head/sys/dev/drm2/i915 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/dev/drm2/i915 X-SVN-Commit-Revision: 323868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 15:32:43 -0000 Author: alc Date: Thu Sep 21 15:32:41 2017 New Revision: 323868 URL: https://svnweb.freebsd.org/changeset/base/323868 Log: Modernize calls to vm_page_unwire(). As of r288122, vm_page_unwire() accepts PQ_NONE as the specified queue and returns a Boolean indicating whether the page's wire count transitioned to zero. Use these features in dev/drm2. Reviewed by: kib, markj MFC after: 1 week Modified: head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/i915/i915_gem_gtt.c Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Thu Sep 21 15:30:20 2017 (r323867) +++ head/sys/dev/drm2/i915/i915_gem.c Thu Sep 21 15:32:41 2017 (r323868) @@ -1890,8 +1890,7 @@ i915_gem_object_put_pages_range_locked(struct drm_i915 KASSERT(page->pindex == i, ("pindex %jx %jx", (uintmax_t)page->pindex, (uintmax_t)i)); vm_page_lock(page); - vm_page_unwire(page, PQ_INACTIVE); - if (page->wire_count == 0) + if (vm_page_unwire(page, PQ_INACTIVE)) atomic_add_long(&i915_gem_wired_pages_cnt, -1); vm_page_unlock(page); } Modified: head/sys/dev/drm2/i915/i915_gem_gtt.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem_gtt.c Thu Sep 21 15:30:20 2017 (r323867) +++ head/sys/dev/drm2/i915/i915_gem_gtt.c Thu Sep 21 15:32:41 2017 (r323868) @@ -198,7 +198,7 @@ err_pt_alloc: free(ppgtt->pt_dma_addr, DRM_I915_GEM); for (i = 0; i < ppgtt->num_pd_entries; i++) { if (ppgtt->pt_pages[i]) { - vm_page_unwire(ppgtt->pt_pages[i], PQ_INACTIVE); + vm_page_unwire(ppgtt->pt_pages[i], PQ_NONE); vm_page_free(ppgtt->pt_pages[i]); } } @@ -228,7 +228,7 @@ void i915_gem_cleanup_aliasing_ppgtt(struct drm_device free(ppgtt->pt_dma_addr, DRM_I915_GEM); for (i = 0; i < ppgtt->num_pd_entries; i++) { - vm_page_unwire(ppgtt->pt_pages[i], PQ_INACTIVE); + vm_page_unwire(ppgtt->pt_pages[i], PQ_NONE); vm_page_free(ppgtt->pt_pages[i]); } free(ppgtt->pt_pages, DRM_I915_GEM); From owner-svn-src-head@freebsd.org Thu Sep 21 18:06:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F314E1672A; Thu, 21 Sep 2017 18:06:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CCC763F83; Thu, 21 Sep 2017 18:06:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LI6Lb7070310; Thu, 21 Sep 2017 18:06:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LI6LOe070309; Thu, 21 Sep 2017 18:06:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709211806.v8LI6LOe070309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 21 Sep 2017 18:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323869 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 323869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 18:06:22 -0000 Author: cem Date: Thu Sep 21 18:06:21 2017 New Revision: 323869 URL: https://svnweb.freebsd.org/changeset/base/323869 Log: cryptotest.py: Do not run AES-CBC or AES-GCM tests on non-AES crypto(4) drivers For some reason, we only skipped AES-XTS tests if a driver was not in the aesmodules list. Skip other AES modes as well to prevent spurious failures in non-AES drivers. Sponsored by: Dell EMC Isilon Modified: head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Thu Sep 21 15:32:41 2017 (r323868) +++ head/tests/sys/opencrypto/cryptotest.py Thu Sep 21 18:06:21 2017 (r323869) @@ -62,10 +62,12 @@ def GenTestCase(cname): for i in katg('XTSTestVectors/format tweak value input - data unit seq no', '*.rsp'): self.runXTS(i, cryptodev.CRYPTO_AES_XTS) + @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % `cname`) def test_cbc(self): for i in katg('KAT_AES', 'CBC[GKV]*.rsp'): self.runCBC(i) + @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % `cname`) def test_gcm(self): for i in katg('gcmtestvectors', 'gcmEncrypt*'): self.runGCM(i, 'ENCRYPT') From owner-svn-src-head@freebsd.org Thu Sep 21 20:16:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AF0AE1F53B; Thu, 21 Sep 2017 20:16:12 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0149C687D1; Thu, 21 Sep 2017 20:16:11 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LKGBji024413; Thu, 21 Sep 2017 20:16:11 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LKGBMi024412; Thu, 21 Sep 2017 20:16:11 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201709212016.v8LKGBMi024412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 21 Sep 2017 20:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323873 - head/sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sys/netgraph X-SVN-Commit-Revision: 323873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 20:16:12 -0000 Author: eugen (ports committer) Date: Thu Sep 21 20:16:10 2017 New Revision: 323873 URL: https://svnweb.freebsd.org/changeset/base/323873 Log: Unprotected modification of ng_iface(4) private data leads to kernel panic. Fix a race with per-node read-mostly lock and refcounting for a hook. PR: 220076 Tested by: peixoto.cassiano Approved by: avg (mentor), mav (mentor) MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D12435 Modified: head/sys/netgraph/ng_iface.c Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Thu Sep 21 20:13:03 2017 (r323872) +++ head/sys/netgraph/ng_iface.c Thu Sep 21 20:16:10 2017 (r323873) @@ -64,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -112,9 +113,15 @@ struct ng_iface_private { int unit; /* Interface unit number */ node_p node; /* Our netgraph node */ hook_p hooks[NUM_FAMILIES]; /* Hook for each address family */ + struct rmlock lock; /* Protect private data changes */ }; typedef struct ng_iface_private *priv_p; +#define PRIV_RLOCK(priv, t) rm_rlock(&priv->lock, t) +#define PRIV_RUNLOCK(priv, t) rm_runlock(&priv->lock, t) +#define PRIV_WLOCK(priv) rm_wlock(&priv->lock) +#define PRIV_WUNLOCK(priv) rm_wunlock(&priv->lock) + /* Interface methods */ static void ng_iface_start(struct ifnet *ifp); static int ng_iface_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); @@ -431,8 +438,10 @@ ng_iface_bpftap(struct ifnet *ifp, struct mbuf *m, sa_ static int ng_iface_send(struct ifnet *ifp, struct mbuf *m, sa_family_t sa) { + struct rm_priotracker priv_tracker; const priv_p priv = (priv_p) ifp->if_softc; const iffam_p iffam = get_iffam_from_af(sa); + hook_p hook; int error; int len; @@ -446,10 +455,20 @@ ng_iface_send(struct ifnet *ifp, struct mbuf *m, sa_fa /* Copy length before the mbuf gets invalidated. */ len = m->m_pkthdr.len; - /* Send packet. If hook is not connected, mbuf will get freed. */ + PRIV_RLOCK(priv, &priv_tracker); + hook = *get_hook_from_iffam(priv, iffam); + if (hook == NULL) { + NG_FREE_M(m); + PRIV_RUNLOCK(priv, &priv_tracker); + return ENETDOWN; + } + NG_HOOK_REF(hook); + PRIV_RUNLOCK(priv, &priv_tracker); + NG_OUTBOUND_THREAD_REF(); - NG_SEND_DATA_ONLY(error, *get_hook_from_iffam(priv, iffam), m); + NG_SEND_DATA_ONLY(error, hook, m); NG_OUTBOUND_THREAD_UNREF(); + NG_HOOK_UNREF(hook); /* Update stats. */ if (error == 0) { @@ -516,6 +535,8 @@ ng_iface_constructor(node_p node) return (ENOMEM); } + rm_init(&priv->lock, "ng_iface private rmlock"); + /* Link them together */ ifp->if_softc = priv; priv->ifp = ifp; @@ -562,16 +583,21 @@ static int ng_iface_newhook(node_p node, hook_p hook, const char *name) { const iffam_p iffam = get_iffam_from_name(name); + const priv_p priv = NG_NODE_PRIVATE(node); hook_p *hookptr; if (iffam == NULL) return (EPFNOSUPPORT); - hookptr = get_hook_from_iffam(NG_NODE_PRIVATE(node), iffam); - if (*hookptr != NULL) + PRIV_WLOCK(priv); + hookptr = get_hook_from_iffam(priv, iffam); + if (*hookptr != NULL) { + PRIV_WUNLOCK(priv); return (EISCONN); + } *hookptr = hook; NG_HOOK_HI_STACK(hook); NG_HOOK_SET_TO_INBOUND(hook); + PRIV_WUNLOCK(priv); return (0); } @@ -730,6 +756,7 @@ ng_iface_shutdown(node_p node) CURVNET_RESTORE(); priv->ifp = NULL; free_unr(V_ng_iface_unit, priv->unit); + rm_destroy(&priv->lock); free(priv, M_NETGRAPH_IFACE); NG_NODE_SET_PRIVATE(node, NULL); NG_NODE_UNREF(node); @@ -748,7 +775,9 @@ ng_iface_disconnect(hook_p hook) if (iffam == NULL) panic("%s", __func__); + PRIV_WLOCK(priv); *get_hook_from_iffam(priv, iffam) = NULL; + PRIV_WUNLOCK(priv); return (0); } From owner-svn-src-head@freebsd.org Thu Sep 21 20:27:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0374BE201AB; Thu, 21 Sep 2017 20:27:45 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1D92694E1; Thu, 21 Sep 2017 20:27:44 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LKRiMG028740; Thu, 21 Sep 2017 20:27:44 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LKRhVZ028736; Thu, 21 Sep 2017 20:27:43 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201709212027.v8LKRhVZ028736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Thu, 21 Sep 2017 20:27:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323874 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 323874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 20:27:45 -0000 Author: shurd Date: Thu Sep 21 20:27:43 2017 New Revision: 323874 URL: https://svnweb.freebsd.org/changeset/base/323874 Log: bnxt: Fix driver when attached to a VF - Use HWRM_FUNC_VF_CFG instead of HWRM_FUNC_CFG on VFs - Fix NPAR/VF detection - Clean up flag definitions - Don't allow WoL on VFs Although the bnxt driver doesn't support SR-IOV so can create VFs yet, the PF could be running Linux or ESCi with a VF passed through to a FreeBSD guest. This fixes the driver for that use case. Submitted by: Siva Kallam Reviewed by: shurd, sbruno Approved by: sbruno (mentor) Sponsored by: Broadcom Limited Differential Revision: https://reviews.freebsd.org/D12410 Modified: head/sys/dev/bnxt/bnxt.h head/sys/dev/bnxt/bnxt_hwrm.c head/sys/dev/bnxt/bnxt_hwrm.h head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/bnxt.h ============================================================================== --- head/sys/dev/bnxt/bnxt.h Thu Sep 21 20:16:10 2017 (r323873) +++ head/sys/dev/bnxt/bnxt.h Thu Sep 21 20:27:43 2017 (r323874) @@ -102,7 +102,8 @@ __FBSDID("$FreeBSD$"); #define BNXT_GET_RSS_PROFILE_ID(rss_hash_type) ((rss_hash_type >> 1) & 0x1F) #define BNXT_NO_MORE_WOL_FILTERS 0xFFFF -#define bnxt_wol_supported(softc) ((softc)->flags & BNXT_FLAG_WOL_CAP) +#define bnxt_wol_supported(softc) (!((softc)->flags & BNXT_FLAG_VF) && \ + ((softc)->flags & BNXT_FLAG_WOL_CAP )) /* Completion related defines */ #define CMP_VALID(cmp, v_bit) \ @@ -393,7 +394,6 @@ struct bnxt_vf_info { bus_addr_t hwrm_cmd_req_dma_addr; }; -#define BNXT_FLAG_VF (1<<1) #define BNXT_PF(softc) (!((softc)->flags & BNXT_FLAG_VF)) #define BNXT_VF(softc) ((softc)->flags & BNXT_FLAG_VF) @@ -536,8 +536,9 @@ struct bnxt_softc { struct bnxt_bar_info hwrm_bar; struct bnxt_bar_info doorbell_bar; struct bnxt_link_info link_info; -#define BNXT_FLAG_NPAR 0x1 -#define BNXT_FLAG_WOL_CAP 0x2 +#define BNXT_FLAG_VF 0x0001 +#define BNXT_FLAG_NPAR 0x0002 +#define BNXT_FLAG_WOL_CAP 0x0004 uint32_t flags; uint32_t total_msix; Modified: head/sys/dev/bnxt/bnxt_hwrm.c ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.c Thu Sep 21 20:16:10 2017 (r323873) +++ head/sys/dev/bnxt/bnxt_hwrm.c Thu Sep 21 20:27:43 2017 (r323874) @@ -949,18 +949,32 @@ bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnx } int -bnxt_hwrm_func_cfg(struct bnxt_softc *softc) +bnxt_cfg_async_cr(struct bnxt_softc *softc) { - struct hwrm_func_cfg_input req = {0}; + int rc = 0; + + if (BNXT_PF(softc)) { + struct hwrm_func_cfg_input req = {0}; - bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_CFG); + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_CFG); - req.fid = 0xffff; - req.enables = htole32(HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR); + req.fid = 0xffff; + req.enables = htole32(HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR); + req.async_event_cr = softc->def_cp_ring.ring.phys_id; - req.async_event_cr = softc->def_cp_ring.ring.phys_id; + rc = hwrm_send_message(softc, &req, sizeof(req)); + } + else { + struct hwrm_func_vf_cfg_input req = {0}; - return hwrm_send_message(softc, &req, sizeof(req)); + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_VF_CFG); + + req.enables = htole32(HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR); + req.async_event_cr = softc->def_cp_ring.ring.phys_id; + + rc = hwrm_send_message(softc, &req, sizeof(req)); + } + return rc; } int @@ -1719,4 +1733,3 @@ int bnxt_hwrm_func_rgtr_async_events(struct bnxt_softc return hwrm_send_message(softc, &req, sizeof(req)); } - Modified: head/sys/dev/bnxt/bnxt_hwrm.h ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.h Thu Sep 21 20:16:10 2017 (r323873) +++ head/sys/dev/bnxt/bnxt_hwrm.h Thu Sep 21 20:27:43 2017 (r323874) @@ -61,7 +61,7 @@ int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt_softc *so int bnxt_hwrm_set_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic); int bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, uint32_t hash_type); -int bnxt_hwrm_func_cfg(struct bnxt_softc *softc); +int bnxt_cfg_async_cr(struct bnxt_softc *softc); int bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, uint32_t flags); int bnxt_hwrm_nvm_find_dir_entry(struct bnxt_softc *softc, uint16_t type, Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Thu Sep 21 20:16:10 2017 (r323873) +++ head/sys/dev/bnxt/if_bnxt.c Thu Sep 21 20:27:43 2017 (r323874) @@ -657,7 +657,7 @@ bnxt_attach_pre(if_ctx_t ctx) scctx = softc->scctx; /* TODO: Better way of detecting NPAR/VF is needed */ - switch (softc->sctx->isc_vendor_info->pvi_device_id) { + switch (pci_get_device(softc->dev)) { case BCM57402_NPAR: case BCM57404_NPAR: case BCM57406_NPAR: @@ -980,7 +980,7 @@ bnxt_init(if_ctx_t ctx) goto fail; /* And now set the default CP ring as the async CP ring */ - rc = bnxt_hwrm_func_cfg(softc); + rc = bnxt_cfg_async_cr(softc); if (rc) goto fail; From owner-svn-src-head@freebsd.org Thu Sep 21 20:34:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 098BDE20B5F; Thu, 21 Sep 2017 20:34:35 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAE6869C98; Thu, 21 Sep 2017 20:34:34 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LKYXUq032789; Thu, 21 Sep 2017 20:34:33 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LKYXc6032788; Thu, 21 Sep 2017 20:34:33 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201709212034.v8LKYXc6032788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Thu, 21 Sep 2017 20:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323876 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 323876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 20:34:35 -0000 Author: shurd Date: Thu Sep 21 20:34:33 2017 New Revision: 323876 URL: https://svnweb.freebsd.org/changeset/base/323876 Log: Fix M_GTASKQUEUE definition Previously had the same short and long description as taskqueues. This could cause problems with memguard(9) and vmstat -m which use the short description as a unique identifier. Reviewed by: sbruno Approved by: sbruno (mentor) MFC after: 3 days Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12438 Modified: head/sys/kern/subr_gtaskqueue.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Thu Sep 21 20:29:14 2017 (r323875) +++ head/sys/kern/subr_gtaskqueue.c Thu Sep 21 20:34:33 2017 (r323876) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -static MALLOC_DEFINE(M_GTASKQUEUE, "taskqueue", "Task Queues"); +static MALLOC_DEFINE(M_GTASKQUEUE, "gtaskqueue", "Group Task Queues"); static void gtaskqueue_thread_enqueue(void *); static void gtaskqueue_thread_loop(void *arg); From owner-svn-src-head@freebsd.org Thu Sep 21 21:07:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F56FE22A42; Thu, 21 Sep 2017 21:07:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 369C46B026; Thu, 21 Sep 2017 21:07:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LL7LFM046002; Thu, 21 Sep 2017 21:07:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LL7Lva046001; Thu, 21 Sep 2017 21:07:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709212107.v8LL7Lva046001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 21 Sep 2017 21:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323878 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 323878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 21:07:22 -0000 Author: cem Date: Thu Sep 21 21:07:21 2017 New Revision: 323878 URL: https://svnweb.freebsd.org/changeset/base/323878 Log: cryptotest.py: Actually use NIST-KAT HMAC test vectors and test the right hashes Previously, this test was entirely a no-op as no vector in the NIST-KAT file has a precisely 20-byte key. Additionally, not every vector in the file is SHA1. The length field determines the hash under test, and is now decoded correctly. Finally, due to a limitation I didn't feel like fixing in cryptodev.py, MACs are truncated to 16 bytes in this test. With this change and the uncommitted D12437 (to allow key sizes other than those used in IPSec), the SHA tests in cryptotest.py actually test something and e.g. at least cryptosoft passes the test. Sponsored by: Dell EMC Isilon Modified: head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Thu Sep 21 20:59:36 2017 (r323877) +++ head/tests/sys/opencrypto/cryptotest.py Thu Sep 21 21:07:21 2017 (r323878) @@ -242,22 +242,58 @@ def GenTestCase(cname): self.runSHA1HMAC(i) def runSHA1HMAC(self, fname): - for bogusmode, lines in cryptodev.KATParser(fname, + for hashlength, lines in cryptodev.KATParser(fname, [ 'Count', 'Klen', 'Tlen', 'Key', 'Msg', 'Mac' ]): + # E.g., hashlength will be "L=20" (bytes) + hashlen = int(hashlength.split("=")[1]) + + blocksize = None + if hashlen == 20: + alg = cryptodev.CRYPTO_SHA1_HMAC + blocksize = 64 + elif hashlen == 28: + # Cryptodev doesn't support SHA-224 + # Slurp remaining input in section + for data in lines: + continue + continue + elif hashlen == 32: + alg = cryptodev.CRYPTO_SHA2_256_HMAC + blocksize = 64 + elif hashlen == 48: + alg = cryptodev.CRYPTO_SHA2_384_HMAC + blocksize = 128 + elif hashlen == 64: + alg = cryptodev.CRYPTO_SHA2_512_HMAC + blocksize = 128 + else: + # Skip unsupported hashes + # Slurp remaining input in section + for data in lines: + continue + continue + for data in lines: key = data['Key'].decode('hex') msg = data['Msg'].decode('hex') mac = data['Mac'].decode('hex') + tlen = int(data['Tlen']) - if len(key) != 20: - # XXX - implementation bug + if len(key) > blocksize: continue - c = Crypto(mac=cryptodev.CRYPTO_SHA1_HMAC, - mackey=key, crid=crid) + c = Crypto(mac=alg, mackey=key, + crid=crid) - r = c.encrypt(msg) - self.assertEqual(r, mac, `data`) + _, r = c.encrypt(msg, iv="") + + # A limitation in cryptodev.py means we + # can only store MACs up to 16 bytes. + # That's good enough to validate the + # correct behavior, more or less. + maclen = min(tlen, 16) + self.assertEqual(r[:maclen], mac[:maclen], "Actual: " + \ + repr(r[:maclen].encode("hex")) + " Expected: " + repr(data)) return GendCryptoTestCase From owner-svn-src-head@freebsd.org Thu Sep 21 21:14:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65E4EE2304C; Thu, 21 Sep 2017 21:14:49 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EE776B4CC; Thu, 21 Sep 2017 21:14:49 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LLEmrp050087; Thu, 21 Sep 2017 21:14:48 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LLEmep050086; Thu, 21 Sep 2017 21:14:48 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201709212114.v8LLEmep050086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Thu, 21 Sep 2017 21:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323879 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 323879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 21:14:49 -0000 Author: shurd Date: Thu Sep 21 21:14:48 2017 New Revision: 323879 URL: https://svnweb.freebsd.org/changeset/base/323879 Log: Improved logging of gtaskqueue failues Check the return code of intr_setaffinity() and log any errors it returns. When a qid is not located, log an error before returning failure. Also, use __func__ rather than hardcoding the function name Reviewed by: sbruno Approved by: sbruno (mentor) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12436 Modified: head/sys/kern/subr_gtaskqueue.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Thu Sep 21 21:07:21 2017 (r323878) +++ head/sys/kern/subr_gtaskqueue.c Thu Sep 21 21:14:48 2017 (r323879) @@ -663,7 +663,7 @@ taskqgroup_attach(struct taskqgroup *qgroup, struct gr void *uniq, int irq, char *name) { cpuset_t mask; - int qid; + int qid, error; gtask->gt_uniq = uniq; gtask->gt_name = name; @@ -679,7 +679,9 @@ taskqgroup_attach(struct taskqgroup *qgroup, struct gr CPU_ZERO(&mask); CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask); mtx_unlock(&qgroup->tqg_lock); - intr_setaffinity(irq, CPU_WHICH_IRQ, &mask); + error = intr_setaffinity(irq, CPU_WHICH_IRQ, &mask); + if (error) + printf("%s: setaffinity failed: %d\n", __func__, error); } else mtx_unlock(&qgroup->tqg_lock); } @@ -688,7 +690,7 @@ static void taskqgroup_attach_deferred(struct taskqgroup *qgroup, struct grouptask *gtask) { cpuset_t mask; - int qid, cpu; + int qid, cpu, error; mtx_lock(&qgroup->tqg_lock); qid = taskqgroup_find(qgroup, gtask->gt_uniq); @@ -698,9 +700,11 @@ taskqgroup_attach_deferred(struct taskqgroup *qgroup, CPU_ZERO(&mask); CPU_SET(cpu, &mask); - intr_setaffinity(gtask->gt_irq, CPU_WHICH_IRQ, &mask); - + error = intr_setaffinity(gtask->gt_irq, CPU_WHICH_IRQ, &mask); mtx_lock(&qgroup->tqg_lock); + if (error) + printf("%s: setaffinity failed: %d\n", __func__, error); + } qgroup->tqg_queue[qid].tgc_cnt++; @@ -716,7 +720,7 @@ taskqgroup_attach_cpu(struct taskqgroup *qgroup, struc void *uniq, int cpu, int irq, char *name) { cpuset_t mask; - int i, qid; + int i, qid, error; qid = -1; gtask->gt_uniq = uniq; @@ -732,6 +736,7 @@ taskqgroup_attach_cpu(struct taskqgroup *qgroup, struc } if (qid == -1) { mtx_unlock(&qgroup->tqg_lock); + printf("%s: qid not found for %s cpu=%d\n", __func__, name, cpu); return (EINVAL); } } else @@ -744,8 +749,11 @@ taskqgroup_attach_cpu(struct taskqgroup *qgroup, struc CPU_ZERO(&mask); CPU_SET(cpu, &mask); - if (irq != -1 && tqg_smp_started) - intr_setaffinity(irq, CPU_WHICH_IRQ, &mask); + if (irq != -1 && tqg_smp_started) { + error = intr_setaffinity(irq, CPU_WHICH_IRQ, &mask); + if (error) + printf("%s: setaffinity failed: %d\n", __func__, error); + } return (0); } @@ -753,7 +761,7 @@ static int taskqgroup_attach_cpu_deferred(struct taskqgroup *qgroup, struct grouptask *gtask) { cpuset_t mask; - int i, qid, irq, cpu; + int i, qid, irq, cpu, error; qid = -1; irq = gtask->gt_irq; @@ -767,6 +775,7 @@ taskqgroup_attach_cpu_deferred(struct taskqgroup *qgro } if (qid == -1) { mtx_unlock(&qgroup->tqg_lock); + printf("%s: qid not found for %s cpu=%d\n", __func__, name, cpu); return (EINVAL); } qgroup->tqg_queue[qid].tgc_cnt++; @@ -778,8 +787,11 @@ taskqgroup_attach_cpu_deferred(struct taskqgroup *qgro CPU_ZERO(&mask); CPU_SET(cpu, &mask); - if (irq != -1) - intr_setaffinity(irq, CPU_WHICH_IRQ, &mask); + if (irq != -1) { + error = intr_setaffinity(irq, CPU_WHICH_IRQ, &mask); + if (error) + printf("%s: setaffinity failed: %d\n", __func__, error); + } return (0); } @@ -815,7 +827,7 @@ taskqgroup_binder(void *ctx) thread_unlock(curthread); if (error) - printf("taskqgroup_binder: setaffinity failed: %d\n", + printf("%s: setaffinity failed: %d\n", __func__, error); free(gtask, M_DEVBUF); } @@ -858,7 +870,7 @@ _taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, return (EINVAL); } if (qgroup->tqg_adjusting) { - printf("taskqgroup_adjust failed: adjusting\n"); + printf("%s failed: adjusting\n", __func__); return (EBUSY); } qgroup->tqg_adjusting = 1; From owner-svn-src-head@freebsd.org Thu Sep 21 22:15:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F995E261A1; Thu, 21 Sep 2017 22:15:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C4B86D012; Thu, 21 Sep 2017 22:15:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LMFjlW074548; Thu, 21 Sep 2017 22:15:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LMFjSG074547; Thu, 21 Sep 2017 22:15:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201709212215.v8LMFjSG074547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 Sep 2017 22:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323880 - head/sys/dev/drm2/i915 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/drm2/i915 X-SVN-Commit-Revision: 323880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 22:15:46 -0000 Author: markj Date: Thu Sep 21 22:15:45 2017 New Revision: 323880 URL: https://svnweb.freebsd.org/changeset/base/323880 Log: Simplify i915_gem_wire_page() and avoid unneeded page-busying. Reviewed by: alc, kib MFC after: 1 week Modified: head/sys/dev/drm2/i915/i915_gem.c Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Thu Sep 21 21:14:48 2017 (r323879) +++ head/sys/dev/drm2/i915/i915_gem.c Thu Sep 21 22:15:45 2017 (r323880) @@ -4735,12 +4735,15 @@ i915_gem_wire_page(vm_object_t object, vm_pindex_t pin int rv; VM_OBJECT_ASSERT_WLOCKED(object); - page = vm_page_grab(object, pindex, VM_ALLOC_NORMAL); + page = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | + VM_ALLOC_WIRED); if (page->valid != VM_PAGE_BITS_ALL) { + vm_page_xbusy(page); if (vm_pager_has_page(object, pindex, NULL, NULL)) { rv = vm_pager_get_pages(object, &page, 1, NULL, NULL); if (rv != VM_PAGER_OK) { vm_page_lock(page); + vm_page_unwire(page, PQ_NONE); vm_page_free(page); vm_page_unlock(page); return (NULL); @@ -4754,13 +4757,9 @@ i915_gem_wire_page(vm_object_t object, vm_pindex_t pin if (fresh != NULL) *fresh = false; } - } else if (fresh != NULL) { + vm_page_xunbusy(page); + } else if (fresh != NULL) *fresh = false; - } - vm_page_lock(page); - vm_page_wire(page); - vm_page_unlock(page); - vm_page_xunbusy(page); atomic_add_long(&i915_gem_wired_pages_cnt, 1); return (page); } From owner-svn-src-head@freebsd.org Thu Sep 21 22:34:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82029E270EA; Thu, 21 Sep 2017 22:34:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EF6E6DADD; Thu, 21 Sep 2017 22:34:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LMXxwT082803; Thu, 21 Sep 2017 22:33:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LMXxOe082802; Thu, 21 Sep 2017 22:33:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201709212233.v8LMXxOe082802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 21 Sep 2017 22:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323881 - head/sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sbin/fsck_ffs X-SVN-Commit-Revision: 323881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 22:34:00 -0000 Author: jhb Date: Thu Sep 21 22:33:59 2017 New Revision: 323881 URL: https://svnweb.freebsd.org/changeset/base/323881 Log: Use UFS_LINK_MAX instead of LINK_MAX. Submitted by: bde Sponsored by: Chelsio Communications Modified: head/sbin/fsck_ffs/suj.c Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Thu Sep 21 22:15:45 2017 (r323880) +++ head/sbin/fsck_ffs/suj.c Thu Sep 21 22:33:59 2017 (r323881) @@ -1395,7 +1395,7 @@ ino_adjust(struct suj_ino *sino) } ip = ino_read(ino); mode = DIP(ip, di_mode) & IFMT; - if (nlink > LINK_MAX) + if (nlink > UFS_LINK_MAX) err_suj("ino %ju nlink manipulation error, new %ju, old %d\n", (uintmax_t)ino, (uintmax_t)nlink, DIP(ip, di_nlink)); if (debug) From owner-svn-src-head@freebsd.org Thu Sep 21 23:05:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44FEBE289A6; Thu, 21 Sep 2017 23:05:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 127FB6E9FA; Thu, 21 Sep 2017 23:05:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LN5XZG094927; Thu, 21 Sep 2017 23:05:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LN5XPT094925; Thu, 21 Sep 2017 23:05:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201709212305.v8LN5XPT094925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 21 Sep 2017 23:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323882 - in head/sys: fs/devfs kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: fs/devfs kern X-SVN-Commit-Revision: 323882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 23:05:34 -0000 Author: jhb Date: Thu Sep 21 23:05:32 2017 New Revision: 323882 URL: https://svnweb.freebsd.org/changeset/base/323882 Log: Only handle _PC_MAX_CANON, _PC_MAX_INPUT, and _PC_VDISABLE for TTY devices. Move handling of these three pathconf() variables out of vop_stdpathconf() and into devfs_pathconf() as TTY devices can only be devfs files. In addition, only return settings for these three variables for devfs devices whose device switch has the D_TTY flag set. Discussed with: bde, kib Sponsored by: Chelsio Communications Modified: head/sys/fs/devfs/devfs_vnops.c head/sys/kern/vfs_default.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Thu Sep 21 22:33:59 2017 (r323881) +++ head/sys/fs/devfs/devfs_vnops.c Thu Sep 21 23:05:32 2017 (r323882) @@ -1178,6 +1178,24 @@ devfs_pathconf(struct vop_pathconf_args *ap) { switch (ap->a_name) { + case _PC_MAX_CANON: + if (ap->a_vp->v_vflag & VV_ISTTY) { + *ap->a_retval = MAX_CANON; + return (0); + } + return (EINVAL); + case _PC_MAX_INPUT: + if (ap->a_vp->v_vflag & VV_ISTTY) { + *ap->a_retval = MAX_INPUT; + return (0); + } + return (EINVAL); + case _PC_VDISABLE: + if (ap->a_vp->v_vflag & VV_ISTTY) { + *ap->a_retval = _POSIX_VDISABLE; + return (0); + } + return (EINVAL); case _PC_MAC_PRESENT: #ifdef MAC /* Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Thu Sep 21 22:33:59 2017 (r323881) +++ head/sys/kern/vfs_default.c Thu Sep 21 23:05:32 2017 (r323882) @@ -486,20 +486,11 @@ vop_stdpathconf(ap) case _PC_LINK_MAX: *ap->a_retval = LINK_MAX; return (0); - case _PC_MAX_CANON: - *ap->a_retval = MAX_CANON; - return (0); - case _PC_MAX_INPUT: - *ap->a_retval = MAX_INPUT; - return (0); case _PC_PIPE_BUF: *ap->a_retval = PIPE_BUF; return (0); case _PC_CHOWN_RESTRICTED: *ap->a_retval = 1; - return (0); - case _PC_VDISABLE: - *ap->a_retval = _POSIX_VDISABLE; return (0); default: return (EINVAL); From owner-svn-src-head@freebsd.org Thu Sep 21 23:10:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 600F5E28D4C; Thu, 21 Sep 2017 23:10:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DDBC6EC4D; Thu, 21 Sep 2017 23:10:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LNAu89095197; Thu, 21 Sep 2017 23:10:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LNAuvh095196; Thu, 21 Sep 2017 23:10:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709212310.v8LNAuvh095196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 21 Sep 2017 23:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323883 - head/tools/tools/nanobsd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/tools/nanobsd X-SVN-Commit-Revision: 323883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 23:10:57 -0000 Author: imp Date: Thu Sep 21 23:10:56 2017 New Revision: 323883 URL: https://svnweb.freebsd.org/changeset/base/323883 Log: Always create usr/local/etc -> /etc/local symlink /usr/local/etc gets created and populated by packages. However, if no packages are installed when setup_nanobsd is run, this symlink won't get created, causing problems if packages are installed later (say on first boot). Therefore, always create the symlink and etc/local. It does no harm and may help. Inspired by crochet issue #183 (consuingly says NanoBSD, means crochet) Sponsored by: Netflix Modified: head/tools/tools/nanobsd/defaults.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Thu Sep 21 23:05:32 2017 (r323882) +++ head/tools/tools/nanobsd/defaults.sh Thu Sep 21 23:10:56 2017 (r323883) @@ -527,15 +527,20 @@ setup_nanobsd ( ) ( # have hardcoded paths under ${prefix}/etc are not tweakable. if [ -d usr/local/etc ] ; then ( - mkdir -p etc/local cd usr/local/etc find . -print | cpio -dumpl ../../../etc/local cd .. rm -rf etc - ln -s ../../etc/local etc ) fi + # Always setup the usr/local/etc -> etc/local symlink. + # usr/local/etc gets created by packages, but if no packages + # are installed by this point, but are later in the process, + # the symlink not being here causes problems. It never hurts + # to have the symlink in error though. + ln -s ../../etc/local usr/local/etc + for d in var etc do # link /$d under /conf @@ -581,6 +586,9 @@ setup_nanobsd_etc ( ) ( echo "/dev/${NANO_DRIVE}${NANO_ROOT} / ufs ro 1 1" > etc/fstab echo "/dev/${NANO_DRIVE}${NANO_SLICE_CFG} /cfg ufs rw,noauto 2 2" >> etc/fstab mkdir -p cfg + + # Create directory for eventual /usr/local/etc contents + mkdir -p etc/local ) ) From owner-svn-src-head@freebsd.org Thu Sep 21 23:14:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C20A7E29140; Thu, 21 Sep 2017 23:14:08 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F3676F1D5; Thu, 21 Sep 2017 23:14:08 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LNE7Or099160; Thu, 21 Sep 2017 23:14:07 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LNE73t099157; Thu, 21 Sep 2017 23:14:07 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201709212314.v8LNE73t099157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 21 Sep 2017 23:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323885 - head/sys/boot/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/efi/libefi X-SVN-Commit-Revision: 323885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 23:14:08 -0000 Author: tsoome Date: Thu Sep 21 23:14:07 2017 New Revision: 323885 URL: https://svnweb.freebsd.org/changeset/base/323885 Log: libefi: efi_devpath_match() should return bool The current implementation of efi_devpath_match() is returning values 0 or 1, so it should be updated to return bool. Modified: head/sys/boot/efi/libefi/devpath.c head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/devpath.c ============================================================================== --- head/sys/boot/efi/libefi/devpath.c Thu Sep 21 23:10:59 2017 (r323884) +++ head/sys/boot/efi/libefi/devpath.c Thu Sep 21 23:14:07 2017 (r323885) @@ -139,30 +139,30 @@ efi_devpath_handle(EFI_DEVICE_PATH *devpath) return (h); } -int +bool efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2) { int len; if (devpath1 == NULL || devpath2 == NULL) - return (0); + return (false); - while (1) { + while (true) { if (DevicePathType(devpath1) != DevicePathType(devpath2) || DevicePathSubType(devpath1) != DevicePathSubType(devpath2)) - return (0); + return (false); len = DevicePathNodeLength(devpath1); if (len != DevicePathNodeLength(devpath2)) - return (0); + return (false); if (memcmp(devpath1, devpath2, (size_t)len) != 0) - return (0); + return (false); if (IsDevicePathEnd(devpath1)) break; devpath1 = NextDevicePathNode(devpath1); devpath2 = NextDevicePathNode(devpath2); } - return (1); + return (true); } Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Thu Sep 21 23:10:59 2017 (r323884) +++ head/sys/boot/efi/libefi/efipart.c Thu Sep 21 23:14:07 2017 (r323885) @@ -264,7 +264,7 @@ efipart_cdinfo_add(EFI_HANDLE handle, EFI_HANDLE alias unit = 0; STAILQ_FOREACH(pd, &cdinfo, pd_link) { - if (efi_devpath_match(pd->pd_devpath, devpath) != 0) { + if (efi_devpath_match(pd->pd_devpath, devpath) == true) { pd->pd_handle = handle; pd->pd_alias = alias; return (0); @@ -394,7 +394,7 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE STAILQ_INIT(&pd->pd_part); STAILQ_FOREACH(hd, &hdinfo, pd_link) { - if (efi_devpath_match(hd->pd_devpath, disk_devpath) != 0) { + if (efi_devpath_match(hd->pd_devpath, disk_devpath) == true) { /* Add the partition. */ pd->pd_handle = part_handle; pd->pd_unit = node->PartitionNumber; From owner-svn-src-head@freebsd.org Thu Sep 21 23:22:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEE2EE29908; Thu, 21 Sep 2017 23:22:19 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CDE16F8A9; Thu, 21 Sep 2017 23:22:19 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LNMIBD003273; Thu, 21 Sep 2017 23:22:18 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LNMIFj003272; Thu, 21 Sep 2017 23:22:18 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201709212322.v8LNMIFj003272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 21 Sep 2017 23:22:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323886 - head/sys/boot/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/efi/libefi X-SVN-Commit-Revision: 323886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 23:22:19 -0000 Author: tsoome Date: Thu Sep 21 23:22:18 2017 New Revision: 323886 URL: https://svnweb.freebsd.org/changeset/base/323886 Log: libefi: efipart.c should use calloc() The device specific *_add functions are using malloc() + memset, should use calloc instead. Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Thu Sep 21 23:14:07 2017 (r323885) +++ head/sys/boot/efi/libefi/efipart.c Thu Sep 21 23:22:18 2017 (r323886) @@ -198,12 +198,11 @@ efipart_fdinfo_add(EFI_HANDLE handle, uint32_t uid, EF { pdinfo_t *fd; - fd = malloc(sizeof(pdinfo_t)); + fd = calloc(1, sizeof(pdinfo_t)); if (fd == NULL) { printf("Failed to register floppy %d, out of memory\n", uid); return (ENOMEM); } - memset(fd, 0, sizeof(pdinfo_t)); STAILQ_INIT(&fd->pd_part); fd->pd_unit = uid; @@ -272,12 +271,11 @@ efipart_cdinfo_add(EFI_HANDLE handle, EFI_HANDLE alias unit++; } - cd = malloc(sizeof(pdinfo_t)); + cd = calloc(1, sizeof(pdinfo_t)); if (cd == NULL) { printf("Failed to add cd %d, out of memory\n", unit); return (ENOMEM); } - memset(cd, 0, sizeof(pdinfo_t)); STAILQ_INIT(&cd->pd_part); cd->pd_handle = handle; @@ -385,12 +383,11 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE if (node == NULL) return (ENOENT); /* This should not happen. */ - pd = malloc(sizeof(pdinfo_t)); + pd = calloc(1, sizeof(pdinfo_t)); if (pd == NULL) { printf("Failed to add disk, out of memory\n"); return (ENOMEM); } - memset(pd, 0, sizeof(pdinfo_t)); STAILQ_INIT(&pd->pd_part); STAILQ_FOREACH(hd, &hdinfo, pd_link) { @@ -417,12 +414,11 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE hd->pd_devpath = disk_devpath; STAILQ_INSERT_TAIL(&hdinfo, hd, pd_link); - pd = malloc(sizeof(pdinfo_t)); + pd = calloc(1, sizeof(pdinfo_t)); if (pd == NULL) { printf("Failed to add partition, out of memory\n"); return (ENOMEM); } - memset(pd, 0, sizeof(pdinfo_t)); STAILQ_INIT(&pd->pd_part); /* Add the partition. */ @@ -456,12 +452,11 @@ efipart_hdinfo_add_filepath(EFI_HANDLE disk_handle) if (node == NULL) return (ENOENT); /* This should not happen. */ - pd = malloc(sizeof(pdinfo_t)); + pd = calloc(1, sizeof(pdinfo_t)); if (pd == NULL) { printf("Failed to add disk, out of memory\n"); return (ENOMEM); } - memset(pd, 0, sizeof(pdinfo_t)); STAILQ_INIT(&pd->pd_part); last = STAILQ_LAST(&hdinfo, pdinfo, pd_link); if (last != NULL) From owner-svn-src-head@freebsd.org Thu Sep 21 23:27:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 998A6E29DFD; Thu, 21 Sep 2017 23:27:36 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6734B6FCA9; Thu, 21 Sep 2017 23:27:36 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LNRZQU003619; Thu, 21 Sep 2017 23:27:35 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LNRZKn003618; Thu, 21 Sep 2017 23:27:35 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201709212327.v8LNRZKn003618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Thu, 21 Sep 2017 23:27:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323887 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 323887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Sep 2017 23:27:36 -0000 Author: shurd Date: Thu Sep 21 23:27:35 2017 New Revision: 323887 URL: https://svnweb.freebsd.org/changeset/base/323887 Log: Fix undeclared identifier error introduced in r323879 It doesn't appear to be safe to use gtask->gt_name. Reported by: Mark Johnston, Jenkins Reviewed by: sbruno Approved by: sbruno (mentor) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12448 Modified: head/sys/kern/subr_gtaskqueue.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Thu Sep 21 23:22:18 2017 (r323886) +++ head/sys/kern/subr_gtaskqueue.c Thu Sep 21 23:27:35 2017 (r323887) @@ -775,7 +775,7 @@ taskqgroup_attach_cpu_deferred(struct taskqgroup *qgro } if (qid == -1) { mtx_unlock(&qgroup->tqg_lock); - printf("%s: qid not found for %s cpu=%d\n", __func__, name, cpu); + printf("%s: qid not found for cpu=%d\n", __func__, cpu); return (EINVAL); } qgroup->tqg_queue[qid].tgc_cnt++; From owner-svn-src-head@freebsd.org Fri Sep 22 00:15:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 450A8E02D90; Fri, 22 Sep 2017 00:15:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F60671866; Fri, 22 Sep 2017 00:15:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M0Fs0f024462; Fri, 22 Sep 2017 00:15:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M0FsJ9024461; Fri, 22 Sep 2017 00:15:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201709220015.v8M0FsJ9024461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 22 Sep 2017 00:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323889 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 323889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 00:15:55 -0000 Author: jhb Date: Fri Sep 22 00:15:54 2017 New Revision: 323889 URL: https://svnweb.freebsd.org/changeset/base/323889 Log: Place the AAD before the plaintext/ciphertext for CIOCRYPTAEAD. Software crypto implementations don't care how the buffer is laid out, but hardware implementations may assume that the AAD is always before the plain/cipher text and that the hash/tag is immediately after the end of the plain/cipher text. In particular, this arrangement matches the layout of both IPSec packets and TLS frames. Linux's crypto framework also assumes this layout for AEAD requests. Reviewed by: cem Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D11758 Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Thu Sep 21 23:32:44 2017 (r323888) +++ head/sys/opencrypto/cryptodev.c Fri Sep 22 00:15:54 2017 (r323889) @@ -898,7 +898,7 @@ cryptodev_aead( uio->uio_iov = &cse->iovec; uio->uio_iovcnt = 1; uio->uio_offset = 0; - uio->uio_resid = caead->len + caead->aadlen + cse->thash->hashsize; + uio->uio_resid = caead->aadlen + caead->len + cse->thash->hashsize; uio->uio_segflg = UIO_SYSSPACE; uio->uio_rw = UIO_WRITE; uio->uio_td = td; @@ -916,17 +916,17 @@ cryptodev_aead( crda = crp->crp_desc; crde = crda->crd_next; - if ((error = copyin(caead->src, cse->uio.uio_iov[0].iov_base, - caead->len))) + if ((error = copyin(caead->aad, cse->uio.uio_iov[0].iov_base, + caead->aadlen))) goto bail; - if ((error = copyin(caead->aad, (char *)cse->uio.uio_iov[0].iov_base + - caead->len, caead->aadlen))) + if ((error = copyin(caead->src, (char *)cse->uio.uio_iov[0].iov_base + + caead->aadlen, caead->len))) goto bail; - crda->crd_skip = caead->len; + crda->crd_skip = 0; crda->crd_len = caead->aadlen; - crda->crd_inject = caead->len + caead->aadlen; + crda->crd_inject = caead->aadlen + caead->len; crda->crd_alg = cse->mac; crda->crd_key = cse->mackey; @@ -936,15 +936,15 @@ cryptodev_aead( crde->crd_flags |= CRD_F_ENCRYPT; else crde->crd_flags &= ~CRD_F_ENCRYPT; - /* crde->crd_skip set below */ + crde->crd_skip = caead->aadlen; crde->crd_len = caead->len; - crde->crd_inject = 0; + crde->crd_inject = caead->aadlen; crde->crd_alg = cse->cipher; crde->crd_key = cse->key; crde->crd_klen = cse->keylen * 8; - crp->crp_ilen = caead->len + caead->aadlen; + crp->crp_ilen = caead->aadlen + caead->len; crp->crp_flags = CRYPTO_F_IOV | CRYPTO_F_CBIMM | (caead->flags & COP_F_BATCH); crp->crp_buf = (caddr_t)&cse->uio.uio_iov; @@ -962,10 +962,9 @@ cryptodev_aead( goto bail; bcopy(cse->tmp_iv, crde->crd_iv, caead->ivlen); crde->crd_flags |= CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; - crde->crd_skip = 0; } else { crde->crd_flags |= CRD_F_IV_PRESENT; - crde->crd_skip = cse->txform->blocksize; + crde->crd_skip += cse->txform->blocksize; crde->crd_len -= cse->txform->blocksize; } @@ -1005,12 +1004,13 @@ again: goto bail; } - if (caead->dst && (error = copyout(cse->uio.uio_iov[0].iov_base, - caead->dst, caead->len))) + if (caead->dst && (error = copyout( + (caddr_t)cse->uio.uio_iov[0].iov_base + caead->aadlen, caead->dst, + caead->len))) goto bail; if ((error = copyout((caddr_t)cse->uio.uio_iov[0].iov_base + - caead->len + caead->aadlen, caead->tag, cse->thash->hashsize))) + caead->aadlen + caead->len, caead->tag, cse->thash->hashsize))) goto bail; bail: From owner-svn-src-head@freebsd.org Fri Sep 22 00:21:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F275CE03521; Fri, 22 Sep 2017 00:21:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C637971E11; Fri, 22 Sep 2017 00:21:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M0LwnF026929; Fri, 22 Sep 2017 00:21:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M0LwhQ026926; Fri, 22 Sep 2017 00:21:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201709220021.v8M0LwhQ026926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 22 Sep 2017 00:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323891 - in head: share/man/man4 sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man4 sys/opencrypto X-SVN-Commit-Revision: 323891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 00:22:00 -0000 Author: jhb Date: Fri Sep 22 00:21:58 2017 New Revision: 323891 URL: https://svnweb.freebsd.org/changeset/base/323891 Log: Add a new COP_F_CIPHER_FIRST flag for struct crypt_op. This requests that the cipher be performed before rather than after the HMAC when both are specified for a single operation. Reviewed by: cem Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D11757 Modified: head/share/man/man4/crypto.4 head/sys/opencrypto/cryptodev.c head/sys/opencrypto/cryptodev.h Modified: head/share/man/man4/crypto.4 ============================================================================== --- head/share/man/man4/crypto.4 Fri Sep 22 00:16:46 2017 (r323890) +++ head/share/man/man4/crypto.4 Fri Sep 22 00:21:58 2017 (r323891) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 15, 2015 +.Dd September 21, 2017 .Dt CRYPTO 4 .Os .Sh NAME @@ -127,7 +127,9 @@ Asymmetric operations do not use sessions. .It Submit requests, synchronously with .Dv CIOCCRYPT -(symmetric) +(symmetric), +.Dv CIOCCRYPTAEAD +(symmetric), or .Dv CIOCKEY (asymmetric). @@ -279,6 +281,16 @@ supplies the length of the input buffer; the fields .Fa cr_op-\*[Gt]iv supply the addresses of the input buffer, output buffer, one-way hash, and initialization vector, respectively. +If a session is using both a privacy algorithm and a hash algorithm, +the request will generate a hash of the input buffer before +generating the output buffer by default. +If the +.Dv COP_F_CIPHER_FIRST +flag is included in the +.Fa cr_op-\*[Gt]flags +field, +then the request will generate a hash of the output buffer after +executing the privacy algorithm. .It Dv CIOCCRYPTAEAD Fa struct crypt_aead *cr_aead .Bd -literal struct crypt_aead { Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Fri Sep 22 00:16:46 2017 (r323890) +++ head/sys/opencrypto/cryptodev.c Fri Sep 22 00:21:58 2017 (r323891) @@ -731,18 +731,22 @@ cryptodev_op( goto bail; } - if (cse->thash) { - crda = crp->crp_desc; - if (cse->txform) - crde = crda->crd_next; - } else { - if (cse->txform) + if (cse->thash && cse->txform) { + if (cop->flags & COP_F_CIPHER_FIRST) { crde = crp->crp_desc; - else { - SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); - error = EINVAL; - goto bail; + crda = crde->crd_next; + } else { + crda = crp->crp_desc; + crde = crda->crd_next; } + } else if (cse->thash) { + crda = crp->crp_desc; + } else if (cse->txform) { + crde = crp->crp_desc; + } else { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); + error = EINVAL; + goto bail; } if ((error = copyin(cop->src, cse->uio.uio_iov[0].iov_base, Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Fri Sep 22 00:16:46 2017 (r323890) +++ head/sys/opencrypto/cryptodev.h Fri Sep 22 00:21:58 2017 (r323891) @@ -238,7 +238,8 @@ struct crypt_op { #define COP_ENCRYPT 1 #define COP_DECRYPT 2 u_int16_t flags; -#define COP_F_BATCH 0x0008 /* Batch op if possible */ +#define COP_F_CIPHER_FIRST 0x0001 /* Cipher before MAC. */ +#define COP_F_BATCH 0x0008 /* Batch op if possible */ u_int len; c_caddr_t src; /* become iov[] inside kernel */ caddr_t dst; From owner-svn-src-head@freebsd.org Fri Sep 22 00:34:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0A79E04099; Fri, 22 Sep 2017 00:34:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E436724D3; Fri, 22 Sep 2017 00:34:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M0YkiR032685; Fri, 22 Sep 2017 00:34:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M0Yk9H032684; Fri, 22 Sep 2017 00:34:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201709220034.v8M0Yk9H032684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 22 Sep 2017 00:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323892 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 323892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 00:34:47 -0000 Author: jhb Date: Fri Sep 22 00:34:46 2017 New Revision: 323892 URL: https://svnweb.freebsd.org/changeset/base/323892 Log: Support AEAD requests with non-GCM algorithms. In particular, support chaining an AES cipher with an HMAC for a request including AAD. This permits submitting requests from userland to encrypt objects like IPSec packets using these algorithms. In the non-GCM case, the authentication crypto descriptor covers both the AAD and the ciphertext. The GCM case remains unchanged. This matches the requests created internally in IPSec. For the non-GCM case, the COP_F_CIPHER_FIRST is also supported since the ordering matters. Note that while this can be used to simulate IPSec requests from userland, this ioctl cannot currently be used to perform TLS requests using AES-CBC and MAC-before-encrypt. Reviewed by: cem Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D11759 Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Fri Sep 22 00:21:58 2017 (r323891) +++ head/sys/opencrypto/cryptodev.c Fri Sep 22 00:34:46 2017 (r323892) @@ -917,8 +917,13 @@ cryptodev_aead( goto bail; } - crda = crp->crp_desc; - crde = crda->crd_next; + if (caead->flags & COP_F_CIPHER_FIRST) { + crde = crp->crp_desc; + crda = crde->crd_next; + } else { + crda = crp->crp_desc; + crde = crda->crd_next; + } if ((error = copyin(caead->aad, cse->uio.uio_iov[0].iov_base, caead->aadlen))) @@ -928,8 +933,16 @@ cryptodev_aead( caead->aadlen, caead->len))) goto bail; + /* + * For GCM, crd_len covers only the AAD. For other ciphers + * chained with an HMAC, crd_len covers both the AAD and the + * cipher text. + */ crda->crd_skip = 0; - crda->crd_len = caead->aadlen; + if (cse->cipher == CRYPTO_AES_NIST_GCM_16) + crda->crd_len = caead->aadlen; + else + crda->crd_len = caead->aadlen + caead->len; crda->crd_inject = caead->aadlen + caead->len; crda->crd_alg = cse->mac; From owner-svn-src-head@freebsd.org Fri Sep 22 02:36:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B966BE0A981; Fri, 22 Sep 2017 02:36:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81E677537F; Fri, 22 Sep 2017 02:36:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M2aaXL081757; Fri, 22 Sep 2017 02:36:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M2aaFG081756; Fri, 22 Sep 2017 02:36:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709220236.v8M2aaFG081756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 22 Sep 2017 02:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323894 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 323894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 02:36:37 -0000 Author: imp Date: Fri Sep 22 02:36:36 2017 New Revision: 323894 URL: https://svnweb.freebsd.org/changeset/base/323894 Log: cam iosched: Bettar account IOPS for smoother performance Prevent cam_iosched_iops_tick() from discarding 'unspent' ios unless it's a new accounting interval. Previously ios that weren't used between ticks were lost, as a result the iops limiter could enforce a limit below the configured maximum. Obtained from: ElectroBSD Submitted by: Fabian Keil PR: 221974 Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Fri Sep 22 02:36:32 2017 (r323893) +++ head/sys/cam/cam_iosched.c Fri Sep 22 02:36:36 2017 (r323894) @@ -423,19 +423,30 @@ cam_iosched_iops_init(struct iop_stats *ios) static int cam_iosched_iops_tick(struct iop_stats *ios) { + int new_ios; - if ((ios->softc->total_ticks % ios->softc->quanta) == 0) - ios->l_value2 = 0; - - ios->l_value1 = (int)((ios->current * (uint64_t)ios->softc->this_frac) >> 16); /* * Allow at least one IO per tick until all * the IOs for this interval have been spent. */ - if (ios->l_value1 <= 0 && ios->l_value2 < ios->current) { - ios->l_value1 = 1; + new_ios = (int)((ios->current * (uint64_t)ios->softc->this_frac) >> 16); + if (new_ios < 1 && ios->l_value2 < ios->current) { + new_ios = 1; ios->l_value2++; } + + /* + * If this a new accounting interval, discard any "unspent" ios + * granted in the previous interval. Otherwise add the new ios to + * the previously granted ones that haven't been spent yet. + */ + if ((ios->softc->total_ticks % ios->softc->quanta) == 0) { + ios->l_value1 = new_ios; + ios->l_value2 = 1; + } else { + ios->l_value1 += new_ios; + } + return 0; } From owner-svn-src-head@freebsd.org Fri Sep 22 02:36:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52D8FE0A965; Fri, 22 Sep 2017 02:36:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20A5475373; Fri, 22 Sep 2017 02:36:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M2aWGf081688; Fri, 22 Sep 2017 02:36:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M2aWUN081687; Fri, 22 Sep 2017 02:36:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709220236.v8M2aWUN081687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 22 Sep 2017 02:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323893 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 323893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 02:36:33 -0000 Author: imp Date: Fri Sep 22 02:36:32 2017 New Revision: 323893 URL: https://svnweb.freebsd.org/changeset/base/323893 Log: cam iosched: Enforce iop limits below the quanta value Previously the iops limiter would always allow at least quanta ios per second as cam_iosched_iops_tick() never set ios->l_value1 below 1. Submitted by: Fabian Keil Obtained from: ElectroBSD PR: 221974 Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Fri Sep 22 00:34:46 2017 (r323892) +++ head/sys/cam/cam_iosched.c Fri Sep 22 02:36:32 2017 (r323893) @@ -415,6 +415,7 @@ cam_iosched_iops_init(struct iop_stats *ios) ios->l_value1 = ios->current / ios->softc->quanta; if (ios->l_value1 <= 0) ios->l_value1 = 1; + ios->l_value2 = 0; return 0; } @@ -423,9 +424,18 @@ static int cam_iosched_iops_tick(struct iop_stats *ios) { + if ((ios->softc->total_ticks % ios->softc->quanta) == 0) + ios->l_value2 = 0; + ios->l_value1 = (int)((ios->current * (uint64_t)ios->softc->this_frac) >> 16); - if (ios->l_value1 <= 0) + /* + * Allow at least one IO per tick until all + * the IOs for this interval have been spent. + */ + if (ios->l_value1 <= 0 && ios->l_value2 < ios->current) { ios->l_value1 = 1; + ios->l_value2++; + } return 0; } From owner-svn-src-head@freebsd.org Fri Sep 22 02:53:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA45CE0CA15; Fri, 22 Sep 2017 02:53:02 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86B2175E15; Fri, 22 Sep 2017 02:53:02 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M2r1p2089768; Fri, 22 Sep 2017 02:53:01 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M2r1bZ089767; Fri, 22 Sep 2017 02:53:01 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201709220253.v8M2r1bZ089767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 22 Sep 2017 02:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323895 - head/sys/boot/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/efi/libefi X-SVN-Commit-Revision: 323895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 02:53:02 -0000 Author: tsoome Date: Fri Sep 22 02:53:01 2017 New Revision: 323895 URL: https://svnweb.freebsd.org/changeset/base/323895 Log: libefi: efi_devpath_match local len should be unsigned DevicePathNodeLength() will always return unsigned value. Modified: head/sys/boot/efi/libefi/devpath.c Modified: head/sys/boot/efi/libefi/devpath.c ============================================================================== --- head/sys/boot/efi/libefi/devpath.c Fri Sep 22 02:36:36 2017 (r323894) +++ head/sys/boot/efi/libefi/devpath.c Fri Sep 22 02:53:01 2017 (r323895) @@ -142,7 +142,7 @@ efi_devpath_handle(EFI_DEVICE_PATH *devpath) bool efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2) { - int len; + size_t len; if (devpath1 == NULL || devpath2 == NULL) return (false); @@ -156,7 +156,7 @@ efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVIC if (len != DevicePathNodeLength(devpath2)) return (false); - if (memcmp(devpath1, devpath2, (size_t)len) != 0) + if (memcmp(devpath1, devpath2, len) != 0) return (false); if (IsDevicePathEnd(devpath1)) From owner-svn-src-head@freebsd.org Fri Sep 22 02:56:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94C5BE0CCBB; Fri, 22 Sep 2017 02:56:27 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6405D75FB8; Fri, 22 Sep 2017 02:56:27 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M2uQ3A089946; Fri, 22 Sep 2017 02:56:26 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M2uQAL089945; Fri, 22 Sep 2017 02:56:26 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201709220256.v8M2uQAL089945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 22 Sep 2017 02:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323896 - head/sys/boot/efi/include X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/efi/include X-SVN-Commit-Revision: 323896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 02:56:27 -0000 Author: tsoome Date: Fri Sep 22 02:56:26 2017 New Revision: 323896 URL: https://svnweb.freebsd.org/changeset/base/323896 Log: r323885 did miss efilib.h update The efilib.h update was left out from r323885 by mistake. Modified: head/sys/boot/efi/include/efilib.h Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Fri Sep 22 02:53:01 2017 (r323895) +++ head/sys/boot/efi/include/efilib.h Fri Sep 22 02:56:26 2017 (r323896) @@ -31,6 +31,7 @@ #define _LOADER_EFILIB_H #include +#include #include extern EFI_HANDLE IH; @@ -80,7 +81,7 @@ EFI_DEVICE_PATH *efi_lookup_devpath(EFI_HANDLE); EFI_HANDLE efi_devpath_handle(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_devpath_last_node(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_devpath_trim(EFI_DEVICE_PATH *); -int efi_devpath_match(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *); +bool efi_devpath_match(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *); CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *); void efi_free_devpath_name(CHAR16 *); From owner-svn-src-head@freebsd.org Fri Sep 22 02:58:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1418E0CF85; Fri, 22 Sep 2017 02:58:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90BA976156; Fri, 22 Sep 2017 02:58:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M2wlpd090064; Fri, 22 Sep 2017 02:58:47 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M2wlVE090063; Fri, 22 Sep 2017 02:58:47 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201709220258.v8M2wlVE090063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 22 Sep 2017 02:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323897 - head/sys/boot/efi/include X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/efi/include X-SVN-Commit-Revision: 323897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 02:58:48 -0000 Author: tsoome Date: Fri Sep 22 02:58:47 2017 New Revision: 323897 URL: https://svnweb.freebsd.org/changeset/base/323897 Log: efilib.h: typo in structure member description The link should be replaced by list. Modified: head/sys/boot/efi/include/efilib.h Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Fri Sep 22 02:56:26 2017 (r323896) +++ head/sys/boot/efi/include/efilib.h Fri Sep 22 02:58:47 2017 (r323897) @@ -51,7 +51,7 @@ typedef STAILQ_HEAD(pdinfo_list, pdinfo) pdinfo_list_t typedef struct pdinfo { STAILQ_ENTRY(pdinfo) pd_link; /* link in device list */ - pdinfo_list_t pd_part; /* link of partitions */ + pdinfo_list_t pd_part; /* list of partitions */ EFI_HANDLE pd_handle; EFI_HANDLE pd_alias; EFI_DEVICE_PATH *pd_devpath; From owner-svn-src-head@freebsd.org Fri Sep 22 04:25:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EBEBE129FE; Fri, 22 Sep 2017 04:25:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E72B7CBC8; Fri, 22 Sep 2017 04:25:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M4PiXK027024; Fri, 22 Sep 2017 04:25:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M4PiXA027023; Fri, 22 Sep 2017 04:25:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709220425.v8M4PiXA027023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 22 Sep 2017 04:25:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323898 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 323898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 04:25:45 -0000 Author: cem Date: Fri Sep 22 04:25:44 2017 New Revision: 323898 URL: https://svnweb.freebsd.org/changeset/base/323898 Log: cryptotest.py: Fix whitespace style errors I accidentally introduced different whitespace style in r323878. I'm not used to using tabs for indentation in Python scripts. Whitespace only; no functional change. Sponsored by: Dell EMC Isilon Modified: head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Fri Sep 22 02:58:47 2017 (r323897) +++ head/tests/sys/opencrypto/cryptotest.py Fri Sep 22 04:25:44 2017 (r323898) @@ -249,29 +249,29 @@ def GenTestCase(cname): blocksize = None if hashlen == 20: - alg = cryptodev.CRYPTO_SHA1_HMAC - blocksize = 64 + alg = cryptodev.CRYPTO_SHA1_HMAC + blocksize = 64 elif hashlen == 28: - # Cryptodev doesn't support SHA-224 - # Slurp remaining input in section - for data in lines: + # Cryptodev doesn't support SHA-224 + # Slurp remaining input in section + for data in lines: + continue continue - continue elif hashlen == 32: - alg = cryptodev.CRYPTO_SHA2_256_HMAC - blocksize = 64 + alg = cryptodev.CRYPTO_SHA2_256_HMAC + blocksize = 64 elif hashlen == 48: - alg = cryptodev.CRYPTO_SHA2_384_HMAC - blocksize = 128 + alg = cryptodev.CRYPTO_SHA2_384_HMAC + blocksize = 128 elif hashlen == 64: - alg = cryptodev.CRYPTO_SHA2_512_HMAC - blocksize = 128 + alg = cryptodev.CRYPTO_SHA2_512_HMAC + blocksize = 128 else: - # Skip unsupported hashes - # Slurp remaining input in section - for data in lines: + # Skip unsupported hashes + # Slurp remaining input in section + for data in lines: + continue continue - continue for data in lines: key = data['Key'].decode('hex') From owner-svn-src-head@freebsd.org Fri Sep 22 04:41:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 228D1E146BA; Fri, 22 Sep 2017 04:41:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E42A57D310; Fri, 22 Sep 2017 04:41:49 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M4fn2I034520; Fri, 22 Sep 2017 04:41:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M4fngZ034519; Fri, 22 Sep 2017 04:41:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709220441.v8M4fngZ034519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 22 Sep 2017 04:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323899 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 323899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 04:41:50 -0000 Author: cem Date: Fri Sep 22 04:41:48 2017 New Revision: 323899 URL: https://svnweb.freebsd.org/changeset/base/323899 Log: cryptotest.py: Like r323869, skip SHA HMAC tests on non-SHA drivers Sponsored by: Dell EMC Isilon Modified: head/tests/sys/opencrypto/cryptotest.py Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Fri Sep 22 04:25:44 2017 (r323898) +++ head/tests/sys/opencrypto/cryptotest.py Fri Sep 22 04:41:48 2017 (r323899) @@ -237,6 +237,7 @@ def GenTestCase(cname): #for i in iglob('SHA1*'): # self.runSHA(i) + @unittest.skipIf(cname not in shamodules, 'skipping SHA on %s' % `cname`) def test_sha1hmac(self): for i in katg('hmactestvectors', 'HMAC.rsp'): self.runSHA1HMAC(i) From owner-svn-src-head@freebsd.org Fri Sep 22 06:07:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5664FE1871D; Fri, 22 Sep 2017 06:07:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23CB87FA63; Fri, 22 Sep 2017 06:07:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M67lKA068346; Fri, 22 Sep 2017 06:07:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M67lUL068345; Fri, 22 Sep 2017 06:07:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709220607.v8M67lUL068345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 22 Sep 2017 06:07:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323902 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 323902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 06:07:48 -0000 Author: tuexen Date: Fri Sep 22 06:07:47 2017 New Revision: 323902 URL: https://svnweb.freebsd.org/changeset/base/323902 Log: Add missing socket lock. MFC after: 1 week Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Fri Sep 22 05:14:11 2017 (r323901) +++ head/sys/netinet/sctp_pcb.c Fri Sep 22 06:07:47 2017 (r323902) @@ -2484,7 +2484,9 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id) inp->sctp_flags = (SCTP_PCB_FLAGS_TCPTYPE | SCTP_PCB_FLAGS_UNBOUND); /* Be sure we have blocking IO by default */ + SOCK_LOCK(so); SCTP_CLEAR_SO_NBIO(so); + SOCK_UNLOCK(so); } else { /* * unsupported socket type (RAW, etc)- in case we missed it From owner-svn-src-head@freebsd.org Fri Sep 22 06:33:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAB44E1956A; Fri, 22 Sep 2017 06:33:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89C12807EC; Fri, 22 Sep 2017 06:33:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M6X1qK080531; Fri, 22 Sep 2017 06:33:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M6X1KC080530; Fri, 22 Sep 2017 06:33:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201709220633.v8M6X1KC080530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 22 Sep 2017 06:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323904 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 323904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 06:33:02 -0000 Author: tuexen Date: Fri Sep 22 06:33:01 2017 New Revision: 323904 URL: https://svnweb.freebsd.org/changeset/base/323904 Log: Add missing locking. Found by Coverity while scanning the usrsctp library. MFC after: 1 week Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Fri Sep 22 06:16:21 2017 (r323903) +++ head/sys/netinet/sctp_input.c Fri Sep 22 06:33:01 2017 (r323904) @@ -699,6 +699,14 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) */ struct sctpasochead *head; + if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { + atomic_add_int(&stcb->asoc.refcnt, 1); + SCTP_TCB_UNLOCK(stcb); + SCTP_INP_INFO_WLOCK(); + SCTP_TCB_LOCK(stcb); + atomic_subtract_int(&stcb->asoc.refcnt, 1); + } if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) { /* generate a new vtag and send init */ LIST_REMOVE(stcb, sctp_asocs); @@ -710,6 +718,7 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); + SCTP_INP_INFO_WUNLOCK(); return (1); } if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED) { @@ -731,6 +740,7 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); + SCTP_INP_INFO_WUNLOCK(); return (1); } return (0); From owner-svn-src-head@freebsd.org Fri Sep 22 07:29:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 298BDE1BF0D; Fri, 22 Sep 2017 07:29:28 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6E2281BF2; Fri, 22 Sep 2017 07:29:27 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M7TQiQ001192; Fri, 22 Sep 2017 07:29:26 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M7TQmO001190; Fri, 22 Sep 2017 07:29:26 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201709220729.v8M7TQmO001190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 22 Sep 2017 07:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323905 - in head/sys/boot/efi: include loader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/sys/boot/efi: include loader X-SVN-Commit-Revision: 323905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 07:29:28 -0000 Author: tsoome Date: Fri Sep 22 07:29:26 2017 New Revision: 323905 URL: https://svnweb.freebsd.org/changeset/base/323905 Log: libefi: pdinfo_t pd_unit and pd_open should be unsigned The device index, partition index and reference counter are all positive numbers. However, since our internal partition number may be negative to indicate GPT table, the compare expression need to take care when comparing pdinfo_t and partition data. Modified: head/sys/boot/efi/include/efilib.h head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Fri Sep 22 06:33:01 2017 (r323904) +++ head/sys/boot/efi/include/efilib.h Fri Sep 22 07:29:26 2017 (r323905) @@ -56,8 +56,8 @@ typedef struct pdinfo EFI_HANDLE pd_alias; EFI_DEVICE_PATH *pd_devpath; EFI_BLOCK_IO *pd_blkio; - int pd_unit; /* unit number */ - int pd_open; /* reference counter */ + uint32_t pd_unit; /* unit number */ + uint32_t pd_open; /* reference counter */ void *pd_bcache; /* buffer cache data */ } pdinfo_t; Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Fri Sep 22 06:33:01 2017 (r323904) +++ head/sys/boot/efi/loader/main.c Fri Sep 22 07:29:26 2017 (r323905) @@ -901,7 +901,7 @@ command_chain(int argc, char *argv[]) /* * d_partition should be 255 */ - if (pd->pd_unit == d_dev->d_slice) { + if (pd->pd_unit == (uint32_t)d_dev->d_slice) { loaded_image->DeviceHandle = pd->pd_handle; break; From owner-svn-src-head@freebsd.org Fri Sep 22 07:34:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F710E1C23B; Fri, 22 Sep 2017 07:34:09 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C6FB81FF6; Fri, 22 Sep 2017 07:34:09 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M7Y80C005179; Fri, 22 Sep 2017 07:34:08 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M7Y8xi005178; Fri, 22 Sep 2017 07:34:08 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201709220734.v8M7Y8xi005178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 22 Sep 2017 07:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323906 - head/sys/boot/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/efi/libefi X-SVN-Commit-Revision: 323906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 07:34:09 -0000 Author: tsoome Date: Fri Sep 22 07:34:08 2017 New Revision: 323906 URL: https://svnweb.freebsd.org/changeset/base/323906 Log: libefi: efipart_strategy() should return ENXIO when there is no media We should return ENXIO to indicate the situation with device present, but no media. Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Fri Sep 22 07:29:26 2017 (r323905) +++ head/sys/boot/efi/libefi/efipart.c Fri Sep 22 07:34:08 2017 (r323906) @@ -857,7 +857,7 @@ efipart_strategy(void *devdata, int rw, daddr_t blk, s if (pd->pd_blkio->Media->RemovableMedia && !pd->pd_blkio->Media->MediaPresent) - return (EIO); + return (ENXIO); bcd.dv_strategy = efipart_realstrategy; bcd.dv_devdata = devdata; From owner-svn-src-head@freebsd.org Fri Sep 22 07:37:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E473BE1C3D7; Fri, 22 Sep 2017 07:37:43 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B22D382184; Fri, 22 Sep 2017 07:37:43 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M7bgq1005363; Fri, 22 Sep 2017 07:37:42 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M7bgqw005362; Fri, 22 Sep 2017 07:37:42 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201709220737.v8M7bgqw005362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 22 Sep 2017 07:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323907 - head/sys/boot/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/efi/libefi X-SVN-Commit-Revision: 323907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 07:37:44 -0000 Author: tsoome Date: Fri Sep 22 07:37:42 2017 New Revision: 323907 URL: https://svnweb.freebsd.org/changeset/base/323907 Log: libefi: efipart.c cstyle fix for efipart_print_common() The else statement should have { } Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Fri Sep 22 07:34:08 2017 (r323906) +++ head/sys/boot/efi/libefi/efipart.c Fri Sep 22 07:37:42 2017 (r323907) @@ -632,8 +632,9 @@ efipart_print_common(struct devsw *dev, pdinfo_list_t if (blkio->Media->MediaPresent) { if (blkio->Media->RemovableMedia) printf(" (removable)"); - } else + } else { printf(" (no media)"); + } if ((ret = pager_output("\n")) != 0) break; if (!blkio->Media->MediaPresent) From owner-svn-src-head@freebsd.org Fri Sep 22 07:40:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 773F1E1C579; Fri, 22 Sep 2017 07:40:06 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42F3C823E6; Fri, 22 Sep 2017 07:40:06 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M7e58u005648; Fri, 22 Sep 2017 07:40:05 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M7e5EJ005647; Fri, 22 Sep 2017 07:40:05 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201709220740.v8M7e5EJ005647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 22 Sep 2017 07:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323908 - head/sys/boot/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/efi/libefi X-SVN-Commit-Revision: 323908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 07:40:06 -0000 Author: tsoome Date: Fri Sep 22 07:40:05 2017 New Revision: 323908 URL: https://svnweb.freebsd.org/changeset/base/323908 Log: libefi: efipart_hdinfo_add_filepath should check strtol result Use errno for error checking. Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Fri Sep 22 07:37:42 2017 (r323907) +++ head/sys/boot/efi/libefi/efipart.c Fri Sep 22 07:40:05 2017 (r323908) @@ -489,7 +489,14 @@ efipart_hdinfo_add_filepath(EFI_HANDLE disk_handle) return (0); } p++; /* skip the colon */ + errno = 0; unit = (int)strtol(p, NULL, 0); + if (errno != 0) { + printf("Bad unit number for partition \"%s\"\n", pathname); + free(pathname); + free(pd); + return (EUNIT); + } /* * We should have disk registered, if not, we are receiving From owner-svn-src-head@freebsd.org Fri Sep 22 07:44:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76149E1C9C5; Fri, 22 Sep 2017 07:44:37 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 453F882881; Fri, 22 Sep 2017 07:44:37 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M7iajR009387; Fri, 22 Sep 2017 07:44:36 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M7iauL009386; Fri, 22 Sep 2017 07:44:36 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201709220744.v8M7iauL009386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 22 Sep 2017 07:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323909 - head/sys/boot/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/efi/libefi X-SVN-Commit-Revision: 323909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 07:44:37 -0000 Author: tsoome Date: Fri Sep 22 07:44:36 2017 New Revision: 323909 URL: https://svnweb.freebsd.org/changeset/base/323909 Log: libefi: define EISA PNP constants Define EISA PNP constants and use them, also fix ID for 0x701 Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Fri Sep 22 07:40:05 2017 (r323908) +++ head/sys/boot/efi/libefi/efipart.c Fri Sep 22 07:44:36 2017 (r323909) @@ -58,6 +58,11 @@ static int efipart_printfd(int); static int efipart_printcd(int); static int efipart_printhd(int); +/* EISA PNP ID's for floppy controllers */ +#define PNP0604 0x604 +#define PNP0700 0x700 +#define PNP0701 0x701 + struct devsw efipart_fddev = { .dv_name = "fd", .dv_type = DEVT_FD, @@ -181,9 +186,9 @@ efipart_floppy(EFI_DEVICE_PATH *node) if (DevicePathType(node) == ACPI_DEVICE_PATH && DevicePathSubType(node) == ACPI_DP) { acpi = (ACPI_HID_DEVICE_PATH *) node; - if (acpi->HID == EISA_PNP_ID(0x604) || - acpi->HID == EISA_PNP_ID(0x700) || - acpi->HID == EISA_ID(0x41d1, 0x701)) { + if (acpi->HID == EISA_PNP_ID(PNP0604) || + acpi->HID == EISA_PNP_ID(PNP0700) || + acpi->HID == EISA_PNP_ID(PNP0701)) { return (acpi); } } From owner-svn-src-head@freebsd.org Fri Sep 22 08:12:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69229E1DB9A; Fri, 22 Sep 2017 08:12:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 423418372C; Fri, 22 Sep 2017 08:12:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M8C9tr019975; Fri, 22 Sep 2017 08:12:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M8C9Vn019972; Fri, 22 Sep 2017 08:12:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201709220812.v8M8C9Vn019972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 22 Sep 2017 08:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323910 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Commit-Revision: 323910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 08:12:10 -0000 Author: hselasky Date: Fri Sep 22 08:12:08 2017 New Revision: 323910 URL: https://svnweb.freebsd.org/changeset/base/323910 Log: Add support for 32-bit compatibility IOCTLs in the LinuxKPI. Bump the FreeBSD version to force recompilation of external kernel modules due to structure change. PR: 222504 Submitted by: Greg V MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h head/sys/compat/linuxkpi/common/src/linux_compat.c head/sys/sys/param.h Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/fs.h Fri Sep 22 07:44:36 2017 (r323909) +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Fri Sep 22 08:12:08 2017 (r323910) @@ -137,6 +137,7 @@ struct file_operations { ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *); unsigned int (*poll) (struct file *, struct poll_table_struct *); long (*unlocked_ioctl)(struct file *, unsigned int, unsigned long); + long (*compat_ioctl)(struct file *, unsigned int, unsigned long); int (*mmap)(struct file *, struct vm_area_struct *); int (*open)(struct inode *, struct file *); int (*release)(struct inode *, struct file *); @@ -157,7 +158,6 @@ struct file_operations { int (*readdir)(struct file *, void *, filldir_t); int (*ioctl)(struct inode *, struct file *, unsigned int, unsigned long); - long (*compat_ioctl)(struct file *, unsigned int, unsigned long); int (*flush)(struct file *, fl_owner_t id); int (*fsync)(struct file *, struct dentry *, int datasync); int (*aio_fsync)(struct kiocb *, int datasync); Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Sep 22 07:44:36 2017 (r323909) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Sep 22 08:12:08 2017 (r323910) @@ -906,7 +906,20 @@ linux_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t /* fetch user-space pointer */ data = *(void **)data; } - if (filp->f_op->unlocked_ioctl) +#if defined(__amd64__) + if (td->td_proc->p_elf_machine == EM_386) { + /* try the compat IOCTL handler first */ + if (filp->f_op->compat_ioctl != NULL) + error = -filp->f_op->compat_ioctl(filp, cmd, (u_long)data); + else + error = ENOTTY; + + /* fallback to the regular IOCTL handler, if any */ + if (error == ENOTTY && filp->f_op->unlocked_ioctl != NULL) + error = -filp->f_op->unlocked_ioctl(filp, cmd, (u_long)data); + } else +#endif + if (filp->f_op->unlocked_ioctl != NULL) error = -filp->f_op->unlocked_ioctl(filp, cmd, (u_long)data); else error = ENOTTY; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Sep 22 07:44:36 2017 (r323909) +++ head/sys/sys/param.h Fri Sep 22 08:12:08 2017 (r323910) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200045 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200046 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Fri Sep 22 08:21:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FAD3E1E154; Fri, 22 Sep 2017 08:21:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D13A3B4; Fri, 22 Sep 2017 08:21:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M8LEc8024707; Fri, 22 Sep 2017 08:21:14 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M8LEYa024706; Fri, 22 Sep 2017 08:21:14 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201709220821.v8M8LEYa024706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Sep 2017 08:21:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323915 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 323915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 08:21:15 -0000 Author: avg Date: Fri Sep 22 08:21:14 2017 New Revision: 323915 URL: https://svnweb.freebsd.org/changeset/base/323915 Log: MFV r323914: 8661 remove "zil-cw2" dtrace probe illumos/illumos-gate@bd9d3f904625846bdc61af8897a1072029c7aeb7 https://github.com/illumos/illumos-gate/commit/bd9d3f904625846bdc61af8897a1072029c7aeb7 https://www.illumos.org/issues/8661 The "zil-cw1" dtrace probe was previously removed in 8558, and the "zil-cw2" probe should have been removed in that patch as well. Unfortunately, the "zil- cw2" was not removed in 8558, so this bug is to track it's removal. Reviewed by: Serapheim Dimitropoulos Reviewed by: Matthew Ahrens Reviewed by: Igor Kozhukhov Approved by: Robert Mustacchi Author: Prakash Surya MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri Sep 22 08:18:49 2017 (r323914) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri Sep 22 08:21:14 2017 (r323915) @@ -1574,7 +1574,6 @@ zil_commit_writer(zilog_t *zilog) kmem_free(itx, offsetof(itx_t, itx_lr) + itx->itx_lr.lrc_reclen); } - DTRACE_PROBE1(zil__cw2, zilog_t *, zilog); /* write the last block out */ if (lwb != NULL && lwb->lwb_zio != NULL) From owner-svn-src-head@freebsd.org Fri Sep 22 08:21:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89965E1E330; Fri, 22 Sep 2017 08:21:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58DFB79C; Fri, 22 Sep 2017 08:21:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M8LZhP025434; Fri, 22 Sep 2017 08:21:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M8LZ4T025433; Fri, 22 Sep 2017 08:21:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201709220821.v8M8LZ4T025433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 22 Sep 2017 08:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323916 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 323916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 08:21:36 -0000 Author: hselasky Date: Fri Sep 22 08:21:35 2017 New Revision: 323916 URL: https://svnweb.freebsd.org/changeset/base/323916 Log: Extend sysctl description for hw.usb.disable_enumeration . PR: 222505 Submitted by: Julian H. Stacey MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_hub.c Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Fri Sep 22 08:21:14 2017 (r323915) +++ head/sys/dev/usb/usb_hub.c Fri Sep 22 08:21:35 2017 (r323916) @@ -100,7 +100,9 @@ SYSCTL_INT(_hw_usb, OID_AUTO, power_timeout, CTLFLAG_R #if USB_HAVE_DISABLE_ENUM static int usb_disable_enumeration = 0; SYSCTL_INT(_hw_usb, OID_AUTO, disable_enumeration, CTLFLAG_RWTUN, - &usb_disable_enumeration, 0, "Set to disable all USB device enumeration."); + &usb_disable_enumeration, 0, "Set to disable all USB device enumeration. " + "This can secure against USB devices turning evil, " + "for example a USB memory stick becoming a USB keyboard."); static int usb_disable_port_power = 0; SYSCTL_INT(_hw_usb, OID_AUTO, disable_port_power, CTLFLAG_RWTUN, From owner-svn-src-head@freebsd.org Fri Sep 22 08:27:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91609E1E6C6; Fri, 22 Sep 2017 08:27:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E6C4ED9; Fri, 22 Sep 2017 08:27:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8M8RRfP026782; Fri, 22 Sep 2017 08:27:27 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8M8RRxn026780; Fri, 22 Sep 2017 08:27:27 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201709220827.v8M8RRxn026780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Sep 2017 08:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323918 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 323918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 08:27:28 -0000 Author: avg Date: Fri Sep 22 08:27:27 2017 New Revision: 323918 URL: https://svnweb.freebsd.org/changeset/base/323918 Log: MFV r323917: 8648 Fix range locking in ZIL commit codepath illumos/illumos-gate@42b14111721da2ebd5159e7b45012a3eb0e3384c https://github.com/illumos/illumos-gate/commit/42b14111721da2ebd5159e7b45012a3eb0e3384c https://www.illumos.org/issues/8648 I'm opening this bug to track integration of the following ZFS on Linux commit into illumos: commit f763c3d1df569a8d6b60bcb5e95cf07aa7a189e6 Author: LOLi Date: Mon Aug 21 17:59:48 2017 +0200 Fix range locking in ZIL commit codepath Since OpenZFS 7578 (1b7c1e5) if we have a ZVOL with logbias=throughput we will force WR_INDIRECT itxs in zvol_log_write() setting itx->itx_lr offset and length to the offset and length of the BIO from zvol_write()->zvol_log_write(): these offset and length are later used to take a range lock in zillog->zl_get_data function: zvol_get_data(). Now suppose we have a ZVOL with blocksize=8K and push 4K writes to offset 0: we will only be range-locking 0-4096. This means the ASSERTion we make in dbuf_unoverride() is no longer valid because now dmu_sync() is called from zilog's get_data functions holding a partial lock on the dbuf. Fix this by taking a range lock on the whole block in zvol_get_data(). Reviewed-by: Chunwei Chen Reviewed-by: Brian Behlendorf Signed-off-by: loli10K Reviewed by: Igor Kozhukhov Reviewed by: Matt Ahrens Reviewed by: Andriy Gapon Reviewed by: Alexander Motin Approved by: Robert Mustacchi Author: LOLi MFC after: 10 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Sep 22 08:23:24 2017 (r323917) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Sep 22 08:27:27 2017 (r323918) @@ -1343,7 +1343,7 @@ zfs_get_data(void *arg, lr_write_t *lr, char *buf, zio } else { /* indirect write */ /* * Have to lock the whole block to ensure when it's - * written out and it's checksum is being calculated + * written out and its checksum is being calculated * that no one can change the data. We need to re-check * blocksize after we get the lock in case it's changed! */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Sep 22 08:23:24 2017 (r323917) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Sep 22 08:27:27 2017 (r323918) @@ -1349,7 +1349,6 @@ zvol_get_data(void *arg, lr_write_t *lr, char *buf, zi zgd = kmem_zalloc(sizeof (zgd_t), KM_SLEEP); zgd->zgd_zilog = zv->zv_zilog; - zgd->zgd_rl = zfs_range_lock(&zv->zv_znode, offset, size, RL_READER); /* * Write records come in two flavors: immediate and indirect. @@ -1358,12 +1357,22 @@ zvol_get_data(void *arg, lr_write_t *lr, char *buf, zi * sync the data and get a pointer to it (indirect) so that * we don't have to write the data twice. */ - if (buf != NULL) { /* immediate write */ + if (buf != NULL) { /* immediate write */ + zgd->zgd_rl = zfs_range_lock(&zv->zv_znode, offset, size, + RL_READER); error = dmu_read(os, object, offset, size, buf, DMU_READ_NO_PREFETCH); - } else { + } else { /* indirect write */ + /* + * Have to lock the whole block to ensure when it's written out + * and its checksum is being calculated that no one can change + * the data. Contrarily to zfs_get_data we need not re-check + * blocksize after we get the lock because it cannot be changed. + */ size = zv->zv_volblocksize; offset = P2ALIGN(offset, size); + zgd->zgd_rl = zfs_range_lock(&zv->zv_znode, offset, size, + RL_READER); error = dmu_buf_hold(os, object, offset, zgd, &db, DMU_READ_NO_PREFETCH); if (error == 0) { From owner-svn-src-head@freebsd.org Fri Sep 22 12:07:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7CF7E263D1; Fri, 22 Sep 2017 12:07:04 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3EA66834C; Fri, 22 Sep 2017 12:07:04 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8MC73b9025593; Fri, 22 Sep 2017 12:07:03 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8MC73gm025591; Fri, 22 Sep 2017 12:07:03 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201709221207.v8MC73gm025591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 22 Sep 2017 12:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323922 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 323922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 12:07:05 -0000 Author: scottl Date: Fri Sep 22 12:07:03 2017 New Revision: 323922 URL: https://svnweb.freebsd.org/changeset/base/323922 Log: Clean up error messages related to device discovery Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr_sas_lsi.c head/sys/dev/mps/mps_sas_lsi.c Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Fri Sep 22 10:51:32 2017 (r323921) +++ head/sys/dev/mpr/mpr_sas_lsi.c Fri Sep 22 12:07:03 2017 (r323922) @@ -781,9 +781,11 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 sassc = sc->sassc; mprsas_startup_increment(sassc); - if ((mpr_config_get_sas_device_pg0(sc, &mpi_reply, &config_page, - MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle))) { - printf("%s: error reading SAS device page0\n", __func__); + if (mpr_config_get_sas_device_pg0(sc, &mpi_reply, &config_page, + MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle) != 0) { + mpr_dprint(sc, MPR_INFO|MPR_MAPPING|MPR_FAULT, + "Error reading SAS device %#x page0, iocstatus= 0x%x\n", + handle, mpi_reply.IOCStatus); error = ENXIO; goto out; } @@ -795,12 +797,14 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 Mpi2ConfigReply_t tmp_mpi_reply; Mpi2SasDevicePage0_t parent_config_page; - if ((mpr_config_get_sas_device_pg0(sc, &tmp_mpi_reply, - &parent_config_page, MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, - le16toh(config_page.ParentDevHandle)))) { + if (mpr_config_get_sas_device_pg0(sc, &tmp_mpi_reply, + &parent_config_page, MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, + le16toh(config_page.ParentDevHandle)) != 0) { mpr_dprint(sc, MPR_MAPPING|MPR_FAULT, - "%s: error reading SAS device %#x page0\n", - __func__, le16toh(config_page.ParentDevHandle)); + "Error reading parent SAS device %#x page0, " + "iocstatus= 0x%x\n", + le16toh(config_page.ParentDevHandle), + tmp_mpi_reply.IOCStatus); } else { parent_sas_address = parent_config_page.SASAddress.High; parent_sas_address = (parent_sas_address << 32) | @@ -1148,8 +1152,9 @@ mprsas_get_sata_identify(struct mpr_softc *sc, u16 han * If the request returns an error then we need to do a diag * reset */ - printf("%s: request for page completed with error %d", - __func__, error); + mpr_dprint(sc, MPR_INFO|MPR_FAULT|MPR_MAPPING, + "Request for SATA PASSTHROUGH page completed with error %d", + error); error = ENXIO; goto out; } @@ -1157,8 +1162,9 @@ mprsas_get_sata_identify(struct mpr_softc *sc, u16 han bcopy(reply, mpi_reply, sizeof(Mpi2SataPassthroughReply_t)); if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) { - printf("%s: error reading SATA PASSTHRU; iocstatus = 0x%x\n", - __func__, reply->IOCStatus); + mpr_dprint(sc, MPR_INFO|MPR_MAPPING|MPR_FAULT, + "Error reading device %#x SATA PASSTHRU; iocstatus= 0x%x\n", + handle, reply->IOCStatus); error = ENXIO; goto out; } Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Fri Sep 22 10:51:32 2017 (r323921) +++ head/sys/dev/mps/mps_sas_lsi.c Fri Sep 22 12:07:03 2017 (r323922) @@ -628,9 +628,11 @@ mpssas_add_device(struct mps_softc *sc, u16 handle, u8 sassc = sc->sassc; mpssas_startup_increment(sassc); - if ((mps_config_get_sas_device_pg0(sc, &mpi_reply, &config_page, - MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle))) { - printf("%s: error reading SAS device page0\n", __func__); + if (mps_config_get_sas_device_pg0(sc, &mpi_reply, &config_page, + MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle) != 0) { + mps_dprint(sc, MPS_INFO|MPS_MAPPING|MPS_FAULT, + "Error reading SAS device %#x page0, iocstatus= 0x%x\n", + handle, mpi_reply.IOCStatus); error = ENXIO; goto out; } @@ -642,12 +644,14 @@ mpssas_add_device(struct mps_softc *sc, u16 handle, u8 Mpi2ConfigReply_t tmp_mpi_reply; Mpi2SasDevicePage0_t parent_config_page; - if ((mps_config_get_sas_device_pg0(sc, &tmp_mpi_reply, - &parent_config_page, MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, - le16toh(config_page.ParentDevHandle)))) { + if (mps_config_get_sas_device_pg0(sc, &tmp_mpi_reply, + &parent_config_page, MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, + le16toh(config_page.ParentDevHandle)) != 0) { mps_dprint(sc, MPS_MAPPING|MPS_FAULT, - "%s: error reading SAS device %#x page0\n", - __func__, le16toh(config_page.ParentDevHandle)); + "Error reading parent SAS device %#x page0, " + "iocstatus= 0x%x\n", + le16toh(config_page.ParentDevHandle), + tmp_mpi_reply.IOCStatus); } else { parent_sas_address = parent_config_page.SASAddress.High; parent_sas_address = (parent_sas_address << 32) | @@ -973,8 +977,9 @@ mpssas_get_sata_identify(struct mps_softc *sc, u16 han * If the request returns an error then we need to do a diag * reset */ - printf("%s: request for page completed with error %d", - __func__, error); + mps_dprint(sc, MPS_INFO|MPS_FAULT|MPS_MAPPING, + "Request for SATA PASSTHROUGH page completed with error %d", + error); error = ENXIO; goto out; } @@ -982,8 +987,9 @@ mpssas_get_sata_identify(struct mps_softc *sc, u16 han bcopy(reply, mpi_reply, sizeof(Mpi2SataPassthroughReply_t)); if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) { - printf("%s: error reading SATA PASSTHRU; iocstatus = 0x%x\n", - __func__, reply->IOCStatus); + mps_dprint(sc, MPS_INFO|MPS_MAPPING|MPS_FAULT, + "Error reading device %#x SATA PASSTHRU; iocstatus= 0x%x\n", + handle, reply->IOCStatus); error = ENXIO; goto out; } From owner-svn-src-head@freebsd.org Fri Sep 22 12:45:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD2C2E27905; Fri, 22 Sep 2017 12:45:17 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7E596A836; Fri, 22 Sep 2017 12:45:17 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8MCjHUL043404; Fri, 22 Sep 2017 12:45:17 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8MCjFPv043387; Fri, 22 Sep 2017 12:45:15 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201709221245.v8MCjFPv043387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 22 Sep 2017 12:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323923 - in head: lib/libufs sbin/dumpfs sbin/fsck_ffs sbin/fsdb sbin/newfs sys/kern sys/libkern sys/sys sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: lib/libufs sbin/dumpfs sbin/fsck_ffs sbin/fsdb sbin/newfs sys/kern sys/libkern sys/sys sys/ufs/ffs X-SVN-Commit-Revision: 323923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 12:45:18 -0000 Author: mckusick Date: Fri Sep 22 12:45:15 2017 New Revision: 323923 URL: https://svnweb.freebsd.org/changeset/base/323923 Log: Continuing efforts to provide hardening of FFS, this change adds a check hash to cylinder groups. If a check hash fails when a cylinder group is read, no further allocations are attempted in that cylinder group until it has been fixed by fsck. This avoids a class of filesystem panics related to corrupted cylinder group maps. The hash is done using crc32c. Check hases are added only to UFS2 and not to UFS1 as UFS1 is primarily used in embedded systems with small memories and low-powered processors which need as light-weight a filesystem as possible. Specifics of the changes: sys/sys/buf.h: Add BX_FSPRIV to reserve a set of eight b_xflags that may be used by individual filesystems for their own purpose. Their specific definitions are found in the header files for each filesystem that uses them. Also add fields to struct buf as noted below. sys/kern/vfs_bio.c: It is only necessary to compute a check hash for a cylinder group when it is actually read from disk. When calling bread, you do not know whether the buffer was found in the cache or read. So a new flag (GB_CKHASH) and a pointer to a function to perform the hash has been added to breadn_flags to say that the function should be called to calculate a hash if the data has been read. The check hash is placed in b_ckhash and the B_CKHASH flag is set to indicate that a read was done and a check hash calculated. Though a rather elaborate mechanism, it should also work for check hashing other metadata in the future. A kernel internal API change was to change breada into a static fucntion and add flags and a function pointer to a check-hash function. sys/ufs/ffs/fs.h: Add flags for types of check hashes; stored in a new word in the superblock. Define corresponding BX_ flags for the different types of check hashes. Add a check hash word in the cylinder group. sys/ufs/ffs/ffs_alloc.c: In ffs_getcg do the dance with breadn_flags to get a check hash and if one is provided, check it. sys/ufs/ffs/ffs_vfsops.c: Copy across the BX_FFSTYPES flags in background writes. Update the check hash when writing out buffers that need them. sys/ufs/ffs/ffs_snapshot.c: Recompute check hash when updating snapshot cylinder groups. sys/libkern/crc32.c: lib/libufs/Makefile: lib/libufs/libufs.h: lib/libufs/cgroup.c: Include libkern/crc32.c in libufs and use it to compute check hashes when updating cylinder groups. Four utilities are affected: sbin/newfs/mkfs.c: Add the check hashes when building the cylinder groups. sbin/fsck_ffs/fsck.h: sbin/fsck_ffs/fsutil.c: Verify and update check hashes when checking and writing cylinder groups. sbin/fsck_ffs/pass5.c: Offer to add check hashes to existing filesystems. Precompute check hashes when rebuilding cylinder group (although this will be done when it is written in fsutil.c it is necessary to do it early before comparing with the old cylinder group) sbin/dumpfs/dumpfs.c Print out the new check hash flag(s) sbin/fsdb/Makefile: Needs to add libufs now used by pass5.c imported from fsck_ffs. Reviewed by: kib Tested by: Peter Holm (pho) Modified: head/lib/libufs/Makefile head/lib/libufs/cgroup.c head/lib/libufs/libufs.h head/sbin/dumpfs/dumpfs.c head/sbin/fsck_ffs/fsutil.c head/sbin/fsck_ffs/pass5.c head/sbin/fsdb/Makefile head/sbin/newfs/mkfs.c head/sys/kern/vfs_bio.c head/sys/libkern/crc32.c head/sys/sys/buf.h head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ffs/fs.h Modified: head/lib/libufs/Makefile ============================================================================== --- head/lib/libufs/Makefile Fri Sep 22 12:07:03 2017 (r323922) +++ head/lib/libufs/Makefile Fri Sep 22 12:45:15 2017 (r323923) @@ -5,7 +5,7 @@ LIB= ufs SHLIBDIR?= /lib SHLIB_MAJOR= 6 -SRCS= block.c cgroup.c inode.c sblock.c type.c ffs_subr.c ffs_tables.c +SRCS= block.c cgroup.c crc32.c inode.c sblock.c type.c ffs_subr.c ffs_tables.c INCS= libufs.h MAN= bread.3 cgread.3 libufs.3 sbread.3 ufs_disk_close.3 @@ -18,7 +18,7 @@ MLINKS+= ufs_disk_close.3 ufs_disk_fillout.3 MLINKS+= ufs_disk_close.3 ufs_disk_fillout_blank.3 MLINKS+= ufs_disk_close.3 ufs_disk_write.3 -.PATH: ${SRCTOP}/sys/ufs/ffs +.PATH: ${SRCTOP}/sys/libkern ${SRCTOP}/sys/ufs/ffs WARNS?= 2 Modified: head/lib/libufs/cgroup.c ============================================================================== --- head/lib/libufs/cgroup.c Fri Sep 22 12:07:03 2017 (r323922) +++ head/lib/libufs/cgroup.c Fri Sep 22 12:45:15 2017 (r323923) @@ -214,6 +214,11 @@ cgwrite1(struct uufsd *disk, int c) struct fs *fs; fs = &disk->d_fs; + if ((fs->fs_metackhash & CK_CYLGRP) != 0) { + disk->d_cg.cg_ckhash = 0; + disk->d_cg.cg_ckhash = + calculate_crc32c(~0L, (void *)&disk->d_cg, fs->fs_cgsize); + } if (bwrite(disk, fsbtodb(fs, cgtod(fs, c)), disk->d_cgunion.d_buf, fs->fs_bsize) == -1) { ERROR(disk, "unable to write cylinder group"); Modified: head/lib/libufs/libufs.h ============================================================================== --- head/lib/libufs/libufs.h Fri Sep 22 12:07:03 2017 (r323922) +++ head/lib/libufs/libufs.h Fri Sep 22 12:45:15 2017 (r323923) @@ -144,6 +144,11 @@ int ffs_isblock(struct fs *, u_char *, ufs1_daddr_t); int ffs_isfreeblock(struct fs *, u_char *, ufs1_daddr_t); void ffs_setblock(struct fs *, u_char *, ufs1_daddr_t); +/* + * crc32c.c + */ +uint32_t calculate_crc32c(uint32_t, const void *, size_t); + __END_DECLS #endif /* __LIBUFS_H__ */ Modified: head/sbin/dumpfs/dumpfs.c ============================================================================== --- head/sbin/dumpfs/dumpfs.c Fri Sep 22 12:07:03 2017 (r323922) +++ head/sbin/dumpfs/dumpfs.c Fri Sep 22 12:45:15 2017 (r323923) @@ -276,6 +276,24 @@ dumpfs(const char *name) if (fsflags != 0) printf("unknown flags (%#x)", fsflags); putchar('\n'); + printf("check hashes\t"); + fsflags = afs.fs_metackhash; + if (fsflags == 0) + printf("none"); + if (fsflags & CK_SUPERBLOCK) + printf("superblock "); + if (fsflags & CK_CYLGRP) + printf("cylinder-groups "); + if (fsflags & CK_INODE) + printf("inodes "); + if (fsflags & CK_INDIR) + printf("indirect-blocks "); + if (fsflags & CK_DIR) + printf("directories "); + fsflags &= ~(CK_SUPERBLOCK | CK_CYLGRP | CK_INODE | CK_INDIR | CK_DIR); + if (fsflags != 0) + printf("unknown flags (%#x)", fsflags); + putchar('\n'); printf("fsmnt\t%s\n", afs.fs_fsmnt); printf("volname\t%s\tswuid\t%ju\tprovidersize\t%ju\n", afs.fs_volname, (uintmax_t)afs.fs_swuid, Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Fri Sep 22 12:07:03 2017 (r323922) +++ head/sbin/fsck_ffs/fsutil.c Fri Sep 22 12:45:15 2017 (r323923) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "fsck.h" @@ -349,6 +350,20 @@ flush(int fd, struct bufarea *bp) if (!bp->b_dirty) return; + /* + * Calculate any needed check hashes. + */ + switch (bp->b_type) { + case BT_CYLGRP: + if ((sblock.fs_metackhash & CK_CYLGRP) == 0) + break; + bp->b_un.b_cg->cg_ckhash = 0; + bp->b_un.b_cg->cg_ckhash = + calculate_crc32c(~0L, bp->b_un.b_buf, bp->b_size); + break; + default: + break; + } bp->b_dirty = 0; if (fswritefd < 0) { pfatal("WRITING IN READ_ONLY MODE.\n"); Modified: head/sbin/fsck_ffs/pass5.c ============================================================================== --- head/sbin/fsck_ffs/pass5.c Fri Sep 22 12:07:03 2017 (r323922) +++ head/sbin/fsck_ffs/pass5.c Fri Sep 22 12:45:15 2017 (r323923) @@ -71,6 +71,13 @@ pass5(void) inoinfo(UFS_WINO)->ino_state = USTATE; memset(newcg, 0, (size_t)fs->fs_cgsize); newcg->cg_niblk = fs->fs_ipg; + if (preen == 0 && yflag == 0 && fs->fs_magic == FS_UFS2_MAGIC && + fswritefd != -1 && (fs->fs_metackhash & CK_CYLGRP) == 0 && + reply("ADD CYLINDER GROUP CHECKSUM PROTECTION") != 0) { + fs->fs_metackhash |= CK_CYLGRP; + rewritecg = 1; + sbdirty(); + } if (cvtlevel >= 3) { if (fs->fs_maxcontig < 2 && fs->fs_contigsumsize > 0) { if (preen) @@ -305,6 +312,12 @@ pass5(void) sump[run]++; } } + if ((fs->fs_metackhash & CK_CYLGRP) != 0) { + newcg->cg_ckhash = 0; + newcg->cg_ckhash = + calculate_crc32c(~0L, (void *)newcg, fs->fs_cgsize); + } + if (bkgrdflag != 0) { cstotal.cs_nffree += cg->cg_cs.cs_nffree; cstotal.cs_nbfree += cg->cg_cs.cs_nbfree; Modified: head/sbin/fsdb/Makefile ============================================================================== --- head/sbin/fsdb/Makefile Fri Sep 22 12:07:03 2017 (r323922) +++ head/sbin/fsdb/Makefile Fri Sep 22 12:45:15 2017 (r323923) @@ -10,7 +10,7 @@ SRCS= fsdb.c fsdbutil.c \ pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c globs.c CFLAGS+= -I${.CURDIR:H}/fsck_ffs WARNS?= 2 -LIBADD= edit +LIBADD= edit ufs .PATH: ${.CURDIR:H}/fsck_ffs ${SRCTOP}/sys/ufs/ffs .include Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Fri Sep 22 12:07:03 2017 (r323922) +++ head/sbin/newfs/mkfs.c Fri Sep 22 12:45:15 2017 (r323923) @@ -98,6 +98,7 @@ static void iput(union dinode *, ino_t); static int makedir(struct direct *, int); static void setblock(struct fs *, unsigned char *, int); static void wtfs(ufs2_daddr_t, int, char *); +static void cgckhash(struct cg *); static u_int32_t newfs_random(void); static int @@ -491,6 +492,11 @@ restart: sblock.fs_old_cstotal.cs_nifree = sblock.fs_cstotal.cs_nifree; sblock.fs_old_cstotal.cs_nffree = sblock.fs_cstotal.cs_nffree; } + /* + * Set flags for metadata that is being check-hashed. + */ + if (Oflag > 1) + sblock.fs_metackhash = CK_CYLGRP; /* * Dump out summary information about file system. @@ -791,6 +797,7 @@ initcg(int cylno, time_t utime) } } *cs = acg.cg_cs; + cgckhash(&acg); /* * Write out the duplicate super block, the cylinder group map * and two blocks worth of inodes in a single write. @@ -1006,6 +1013,7 @@ goth: setbit(cg_blksfree(&acg), d + i); } /* XXX cgwrite(&disk, 0)??? */ + cgckhash(&acg); wtfs(fsbtodb(&sblock, cgtod(&sblock, 0)), sblock.fs_cgsize, (char *)&acg); return ((ufs2_daddr_t)d); @@ -1027,6 +1035,7 @@ iput(union dinode *ip, ino_t ino) } acg.cg_cs.cs_nifree--; setbit(cg_inosused(&acg), ino); + cgckhash(&acg); wtfs(fsbtodb(&sblock, cgtod(&sblock, 0)), sblock.fs_cgsize, (char *)&acg); sblock.fs_cstotal.cs_nifree--; @@ -1057,6 +1066,20 @@ wtfs(ufs2_daddr_t bno, int size, char *bf) return; if (bwrite(&disk, part_ofs + bno, bf, size) < 0) err(36, "wtfs: %d bytes at sector %jd", size, (intmax_t)bno); +} + +/* + * Calculate the check-hash of the cylinder group. + */ +static void +cgckhash(cgp) + struct cg *cgp; +{ + + if ((sblock.fs_metackhash & CK_CYLGRP) == 0) + return; + cgp->cg_ckhash = 0; + cgp->cg_ckhash = calculate_crc32c(~0L, (void *)cgp, sblock.fs_cgsize); } /* Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Sep 22 12:07:03 2017 (r323922) +++ head/sys/kern/vfs_bio.c Fri Sep 22 12:45:15 2017 (r323923) @@ -119,6 +119,8 @@ static void vfs_vmio_truncate(struct buf *bp, int npag static void vfs_vmio_extend(struct buf *bp, int npages, int size); static int vfs_bio_clcheck(struct vnode *vp, int size, daddr_t lblkno, daddr_t blkno); +static void breada(struct vnode *, daddr_t *, int *, int, struct ucred *, int, + void (*)(struct buf *)); static int buf_flush(struct vnode *vp, int); static int buf_recycle(bool); static int buf_scan(bool); @@ -1783,15 +1785,14 @@ bufkva_reclaim(vmem_t *vmem, int flags) return; } - /* * Attempt to initiate asynchronous I/O on read-ahead blocks. We must * clear BIO_ERROR and B_INVAL prior to initiating I/O . If B_CACHE is set, * the buffer is valid and we do not have to do anything. */ -void -breada(struct vnode * vp, daddr_t * rablkno, int * rabsize, - int cnt, struct ucred * cred) +static void +breada(struct vnode * vp, daddr_t * rablkno, int * rabsize, int cnt, + struct ucred * cred, int flags, void (*ckhashfunc)(struct buf *)) { struct buf *rabp; int i; @@ -1800,31 +1801,34 @@ breada(struct vnode * vp, daddr_t * rablkno, int * rab if (inmem(vp, *rablkno)) continue; rabp = getblk(vp, *rablkno, *rabsize, 0, 0, 0); - - if ((rabp->b_flags & B_CACHE) == 0) { - if (!TD_IS_IDLETHREAD(curthread)) { + if ((rabp->b_flags & B_CACHE) != 0) { + brelse(rabp); + continue; + } + if (!TD_IS_IDLETHREAD(curthread)) { #ifdef RACCT - if (racct_enable) { - PROC_LOCK(curproc); - racct_add_buf(curproc, rabp, 0); - PROC_UNLOCK(curproc); - } -#endif /* RACCT */ - curthread->td_ru.ru_inblock++; + if (racct_enable) { + PROC_LOCK(curproc); + racct_add_buf(curproc, rabp, 0); + PROC_UNLOCK(curproc); } - rabp->b_flags |= B_ASYNC; - rabp->b_flags &= ~B_INVAL; - rabp->b_ioflags &= ~BIO_ERROR; - rabp->b_iocmd = BIO_READ; - if (rabp->b_rcred == NOCRED && cred != NOCRED) - rabp->b_rcred = crhold(cred); - vfs_busy_pages(rabp, 0); - BUF_KERNPROC(rabp); - rabp->b_iooffset = dbtob(rabp->b_blkno); - bstrategy(rabp); - } else { - brelse(rabp); +#endif /* RACCT */ + curthread->td_ru.ru_inblock++; } + rabp->b_flags |= B_ASYNC; + rabp->b_flags &= ~B_INVAL; + if ((flags & GB_CKHASH) != 0) { + rabp->b_flags |= B_CKHASH; + rabp->b_ckhashcalc = ckhashfunc; + } + rabp->b_ioflags &= ~BIO_ERROR; + rabp->b_iocmd = BIO_READ; + if (rabp->b_rcred == NOCRED && cred != NOCRED) + rabp->b_rcred = crhold(cred); + vfs_busy_pages(rabp, 0); + BUF_KERNPROC(rabp); + rabp->b_iooffset = dbtob(rabp->b_blkno); + bstrategy(rabp); } } @@ -1840,10 +1844,11 @@ breada(struct vnode * vp, daddr_t * rablkno, int * rab */ int breadn_flags(struct vnode *vp, daddr_t blkno, int size, daddr_t *rablkno, - int *rabsize, int cnt, struct ucred *cred, int flags, struct buf **bpp) + int *rabsize, int cnt, struct ucred *cred, int flags, + void (*ckhashfunc)(struct buf *), struct buf **bpp) { struct buf *bp; - int rv = 0, readwait = 0; + int readwait, rv; CTR3(KTR_BUF, "breadn(%p, %jd, %d)", vp, blkno, size); /* @@ -1853,7 +1858,10 @@ breadn_flags(struct vnode *vp, daddr_t blkno, int size if (bp == NULL) return (EBUSY); - /* if not found in cache, do some I/O */ + /* + * If not found in cache, do some I/O + */ + readwait = 0; if ((bp->b_flags & B_CACHE) == 0) { if (!TD_IS_IDLETHREAD(curthread)) { #ifdef RACCT @@ -1867,6 +1875,10 @@ breadn_flags(struct vnode *vp, daddr_t blkno, int size } bp->b_iocmd = BIO_READ; bp->b_flags &= ~B_INVAL; + if ((flags & GB_CKHASH) != 0) { + bp->b_flags |= B_CKHASH; + bp->b_ckhashcalc = ckhashfunc; + } bp->b_ioflags &= ~BIO_ERROR; if (bp->b_rcred == NOCRED && cred != NOCRED) bp->b_rcred = crhold(cred); @@ -1876,8 +1888,12 @@ breadn_flags(struct vnode *vp, daddr_t blkno, int size ++readwait; } - breada(vp, rablkno, rabsize, cnt, cred); + /* + * Attempt to initiate asynchronous I/O on read-ahead blocks. + */ + breada(vp, rablkno, rabsize, cnt, cred, flags, ckhashfunc); + rv = 0; if (readwait) { rv = bufwait(bp); if (rv != 0) { @@ -4048,6 +4064,10 @@ bufdone(struct buf *bp) runningbufwakeup(bp); if (bp->b_iocmd == BIO_WRITE) dropobj = bp->b_bufobj; + else if ((bp->b_flags & B_CKHASH) != 0) { + KASSERT(buf_mapped(bp), ("biodone: bp %p not mapped", bp)); + (*bp->b_ckhashcalc)(bp); + } /* call optional completion function if requested */ if (bp->b_iodone != NULL) { biodone = bp->b_iodone; Modified: head/sys/libkern/crc32.c ============================================================================== --- head/sys/libkern/crc32.c Fri Sep 22 12:07:03 2017 (r323922) +++ head/sys/libkern/crc32.c Fri Sep 22 12:45:15 2017 (r323923) @@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$"); #include + +#ifdef _KERNEL #include #include @@ -57,6 +59,7 @@ __FBSDID("$FreeBSD$"); #if defined(__aarch64__) #include #endif +#endif /* _KERNEL */ const uint32_t crc32_tab[] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, @@ -759,6 +762,7 @@ calculate_crc32c(uint32_t crc32c, const unsigned char *buffer, unsigned int length) { +#ifdef _KERNEL #if defined(__amd64__) || defined(__i386__) if ((cpu_feature2 & CPUID2_SSE42) != 0) { return (sse42_crc32c(crc32c, buffer, length)); @@ -776,6 +780,7 @@ calculate_crc32c(uint32_t crc32c, return (armv8_crc32c(crc32c, buffer, length)); } else #endif +#endif /* _KERNEL */ if (length < 4) { return (singletable_crc32c(crc32c, buffer, length)); } else { Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Fri Sep 22 12:07:03 2017 (r323922) +++ head/sys/sys/buf.h Fri Sep 22 12:45:15 2017 (r323923) @@ -70,7 +70,7 @@ extern struct bio_ops { struct vm_object; struct vm_page; -typedef unsigned char b_xflags_t; +typedef uint32_t b_xflags_t; /* * The buffer header describes an I/O operation in the kernel. @@ -104,6 +104,8 @@ struct buf { off_t b_iooffset; long b_resid; void (*b_iodone)(struct buf *); + void (*b_ckhashcalc)(struct buf *); + uint64_t b_ckhash; /* B_CKHASH requested check-hash */ daddr_t b_blkno; /* Underlying physical block number. */ off_t b_offset; /* Offset into file. */ TAILQ_ENTRY(buf) b_bobufs; /* (V) Buffer's associated vnode. */ @@ -209,7 +211,7 @@ struct buf { #define B_CACHE 0x00000020 /* Bread found us in the cache. */ #define B_VALIDSUSPWRT 0x00000040 /* Valid write during suspension. */ #define B_DELWRI 0x00000080 /* Delay I/O until buffer reused. */ -#define B_00000100 0x00000100 /* Available flag. */ +#define B_CKHASH 0x00000100 /* checksum hash calculated on read */ #define B_DONE 0x00000200 /* I/O completed. */ #define B_EINTR 0x00000400 /* I/O was interrupted */ #define B_NOREUSE 0x00000800 /* Contents not reused once released. */ @@ -242,12 +244,17 @@ struct buf { /* * These flags are kept in b_xflags. + * + * BX_FSPRIV reserves a set of eight flags that may be used by individual + * filesystems for their own purpose. Their specific definitions are + * found in the header files for each filesystem that uses them. */ #define BX_VNDIRTY 0x00000001 /* On vnode dirty list */ #define BX_VNCLEAN 0x00000002 /* On vnode clean list */ #define BX_BKGRDWRITE 0x00000010 /* Do writes in background */ #define BX_BKGRDMARKER 0x00000020 /* Mark buffer for splay tree */ #define BX_ALTDATA 0x00000040 /* Holds extended data */ +#define BX_FSPRIV 0x00FF0000 /* filesystem-specific flags mask */ #define PRINT_BUF_XFLAGS "\20\7altdata\6bkgrdmarker\5bkgrdwrite\2clean\1dirty" @@ -467,6 +474,7 @@ buf_track(struct buf *bp, const char *location) #define GB_NOWAIT_BD 0x0004 /* Do not wait for bufdaemon. */ #define GB_UNMAPPED 0x0008 /* Do not mmap buffer pages. */ #define GB_KVAALLOC 0x0010 /* But allocate KVA. */ +#define GB_CKHASH 0x0020 /* If reading, calc checksum hash */ #ifdef _KERNEL extern int nbuf; /* The number of buffer headers */ @@ -504,15 +512,15 @@ int buf_dirty_count_severe(void); void bremfree(struct buf *); void bremfreef(struct buf *); /* XXX Force bremfree, only for nfs. */ #define bread(vp, blkno, size, cred, bpp) \ - breadn_flags(vp, blkno, size, NULL, NULL, 0, cred, 0, bpp) + breadn_flags(vp, blkno, size, NULL, NULL, 0, cred, 0, NULL, bpp) #define bread_gb(vp, blkno, size, cred, gbflags, bpp) \ breadn_flags(vp, blkno, size, NULL, NULL, 0, cred, \ - gbflags, bpp) + gbflags, NULL, bpp) #define breadn(vp, blkno, size, rablkno, rabsize, cnt, cred, bpp) \ - breadn_flags(vp, blkno, size, rablkno, rabsize, cnt, cred, 0, bpp) + breadn_flags(vp, blkno, size, rablkno, rabsize, cnt, cred, \ + 0, NULL, bpp) int breadn_flags(struct vnode *, daddr_t, int, daddr_t *, int *, int, - struct ucred *, int, struct buf **); -void breada(struct vnode *, daddr_t *, int *, int, struct ucred *); + struct ucred *, int, void (*)(struct buf *), struct buf **); void bdwrite(struct buf *); void bawrite(struct buf *); void babarrierwrite(struct buf *); Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Fri Sep 22 12:07:03 2017 (r323922) +++ head/sys/ufs/ffs/ffs_alloc.c Fri Sep 22 12:45:15 2017 (r323923) @@ -123,6 +123,7 @@ static ufs2_daddr_t ffs_nodealloccg(struct inode *, u_ static ufs1_daddr_t ffs_mapsearch(struct fs *, struct cg *, ufs2_daddr_t, int); static int ffs_reallocblks_ufs1(struct vop_reallocblks_args *); static int ffs_reallocblks_ufs2(struct vop_reallocblks_args *); +static void ffs_ckhash_cg(struct buf *); /* * Allocate a block in the filesystem. @@ -2596,25 +2597,53 @@ ffs_getcg(fs, devvp, cg, bpp, cgpp) { struct buf *bp; struct cg *cgp; - int error; + int flags, error; *bpp = NULL; *cgpp = NULL; - error = bread(devvp, devvp->v_type == VREG ? + flags = 0; + if ((fs->fs_metackhash & CK_CYLGRP) != 0) + flags |= GB_CKHASH; + error = breadn_flags(devvp, devvp->v_type == VREG ? fragstoblks(fs, cgtod(fs, cg)) : fsbtodb(fs, cgtod(fs, cg)), - (int)fs->fs_cgsize, NOCRED, &bp); + (int)fs->fs_cgsize, NULL, NULL, 0, NOCRED, flags, + ffs_ckhash_cg, &bp); if (error != 0) return (error); cgp = (struct cg *)bp->b_data; - if (!cg_chkmagic(cgp) || cgp->cg_cgx != cg) { + if (((fs->fs_metackhash & CK_CYLGRP) != 0 && + (bp->b_flags & B_CKHASH) != 0 && + cgp->cg_ckhash != bp->b_ckhash) || + !cg_chkmagic(cgp) || cgp->cg_cgx != cg) { + printf("checksum failed: cg %u, cgp: 0x%x != bp: 0x%lx\n", + cg, cgp->cg_ckhash, bp->b_ckhash); + bp->b_flags &= ~B_CKHASH; + bp->b_flags |= B_INVAL | B_NOCACHE; brelse(bp); return (EIO); } + bp->b_flags &= ~B_CKHASH; bp->b_xflags |= BX_BKGRDWRITE; + if ((fs->fs_metackhash & CK_CYLGRP) != 0) + bp->b_xflags |= BX_CYLGRP; cgp->cg_old_time = cgp->cg_time = time_second; *bpp = bp; *cgpp = cgp; return (0); +} + +static void +ffs_ckhash_cg(bp) + struct buf *bp; +{ + uint32_t ckhash; + struct cg *cgp; + + cgp = (struct cg *)bp->b_data; + ckhash = cgp->cg_ckhash; + cgp->cg_ckhash = 0; + bp->b_ckhash = calculate_crc32c(~0L, bp->b_data, bp->b_bcount); + cgp->cg_ckhash = ckhash; } /* Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Fri Sep 22 12:07:03 2017 (r323922) +++ head/sys/ufs/ffs/ffs_inode.c Fri Sep 22 12:45:15 2017 (r323923) @@ -110,9 +110,9 @@ ffs_update(vp, waitfor) if (IS_SNAPSHOT(ip)) flags = GB_LOCK_NOWAIT; loop: - error = breadn_flags(ITODEVVP(ip), + error = bread_gb(ITODEVVP(ip), fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), - (int) fs->fs_bsize, 0, 0, 0, NOCRED, flags, &bp); + (int) fs->fs_bsize, NOCRED, flags, &bp); if (error != 0) { if (error != EBUSY) return (error); Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Fri Sep 22 12:07:03 2017 (r323922) +++ head/sys/ufs/ffs/ffs_snapshot.c Fri Sep 22 12:45:15 2017 (r323923) @@ -927,7 +927,7 @@ cgaccount(cg, vp, nbp, passno) error = UFS_BALLOC(vp, lblktosize(fs, (off_t)(base + loc)), fs->fs_bsize, KERNCRED, BA_METAONLY, &ibp); if (error) { - return (error); + goto out; } indiroff = (base + loc - UFS_NDADDR) % NINDIR(fs); for ( ; loc < len; loc++, indiroff++) { @@ -939,7 +939,7 @@ cgaccount(cg, vp, nbp, passno) lblktosize(fs, (off_t)(base + loc)), fs->fs_bsize, KERNCRED, BA_METAONLY, &ibp); if (error) { - return (error); + goto out; } indiroff = 0; } @@ -967,7 +967,21 @@ cgaccount(cg, vp, nbp, passno) if (passno == 2) ibp->b_flags |= B_VALIDSUSPWRT; bdwrite(ibp); - return (0); +out: + /* + * We have to calculate the crc32c here rather than just setting the + * BX_CYLGRP b_xflags because the allocation of the block for the + * the cylinder group map will always be a full size block (fs_bsize) + * even though the cylinder group may be smaller (fs_cgsize). The + * crc32c must be computed only over fs_cgsize whereas the BX_CYLGRP + * flag causes it to be computed over the size of the buffer. + */ + if ((fs->fs_metackhash & CK_CYLGRP) != 0) { + ((struct cg *)nbp->b_data)->cg_ckhash = 0; + ((struct cg *)nbp->b_data)->cg_ckhash = + calculate_crc32c(~0L, nbp->b_data, fs->fs_cgsize); + } + return (error); } /* Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Sep 22 12:07:03 2017 (r323922) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Sep 22 12:45:15 2017 (r323923) @@ -838,7 +838,11 @@ ffs_mountfs(devvp, mp, td) goto out; } fs->fs_fmod = 0; - fs->fs_flags &= ~FS_INDEXDIRS; /* no support for directory indices */ + /* none of these types of check-hashes are maintained */ + fs->fs_metackhash &= ~(CK_SUPERBLOCK | CK_INODE | CK_INDIR | CK_DIR); + /* no support for directory indices or any other undefined flags */ + fs->fs_flags &= ~FS_INDEXDIRS; + fs->fs_flags &= FS_SUPPORTED; fs->fs_flags &= ~FS_UNCLEAN; if (fs->fs_clean == 0) { fs->fs_flags |= FS_UNCLEAN; @@ -2150,7 +2154,8 @@ ffs_bufwrite(struct buf *bp) BO_LOCK(bp->b_bufobj); bp->b_vflags |= BV_BKGRDINPROG; BO_UNLOCK(bp->b_bufobj); - newbp->b_xflags |= BX_BKGRDMARKER; + newbp->b_xflags |= + (bp->b_xflags & BX_FSPRIV) | BX_BKGRDMARKER; newbp->b_lblkno = bp->b_lblkno; newbp->b_blkno = bp->b_blkno; newbp->b_offset = bp->b_offset; @@ -2194,9 +2199,8 @@ static void ffs_geom_strategy(struct bufobj *bo, struct buf *bp) { struct vnode *vp; - int error; struct buf *tbp; - int nocopy; + int error, nocopy; vp = bo2vnode(bo); if (bp->b_iocmd == BIO_WRITE) { @@ -2247,6 +2251,32 @@ ffs_geom_strategy(struct bufobj *bo, struct buf *bp) } #endif + /* + * Check for metadata that needs check-hashes and update them. + */ + switch (bp->b_xflags & BX_FSPRIV) { + case BX_CYLGRP: + ((struct cg *)bp->b_data)->cg_ckhash = 0; + ((struct cg *)bp->b_data)->cg_ckhash = + calculate_crc32c(~0L, bp->b_data, bp->b_bcount); + break; + + case BX_SUPERBLOCK: + case BX_INODE: + case BX_INDIR: + case BX_DIR: + printf("Check-hash write is unimplemented!!!\n"); + break; + + case 0: + break; + + default: + printf("multiple buffer types 0x%b\n", + (u_int)(bp->b_xflags & BX_FSPRIV), + PRINT_UFS_BUF_XFLAGS); + break; + } } g_vfs_strategy(bo, bp); } Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Fri Sep 22 12:07:03 2017 (r323922) +++ head/sys/ufs/ffs/ffs_vnops.c Fri Sep 22 12:45:15 2017 (r323923) @@ -587,7 +587,7 @@ ffs_read(ap) */ u_int nextsize = blksize(fs, ip, nextlbn); error = breadn_flags(vp, lbn, size, &nextlbn, - &nextsize, 1, NOCRED, GB_UNMAPPED, &bp); + &nextsize, 1, NOCRED, GB_UNMAPPED, NULL, &bp); } else { /* * Failing all of the above, just read what the Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Fri Sep 22 12:07:03 2017 (r323922) +++ head/sys/ufs/ffs/fs.h Fri Sep 22 12:45:15 2017 (r323923) @@ -361,7 +361,8 @@ struct fs { int32_t fs_save_cgsize; /* save real cg size to use fs_bsize */ ufs_time_t fs_mtime; /* Last mount or fsck time. */ int32_t fs_sujfree; /* SUJ free list */ - int32_t fs_sparecon32[23]; /* reserved for future constants */ + int32_t fs_sparecon32[22]; /* reserved for future constants */ + u_int32_t fs_metackhash; /* metadata check-hash, see CK_ below */ int32_t fs_flags; /* see FS_ flags below */ int32_t fs_contigsumsize; /* size of cluster summary array */ int32_t fs_maxsymlinklen; /* max length of an internal symlink */ @@ -388,7 +389,6 @@ CTASSERT(sizeof(struct fs) == 1376); #define FS_UFS1_MAGIC 0x011954 /* UFS1 fast filesystem magic number */ #define FS_UFS2_MAGIC 0x19540119 /* UFS2 fast filesystem magic number */ #define FS_BAD_MAGIC 0x19960408 /* UFS incomplete newfs magic number */ -#define FS_OKAY 0x7c269d38 /* superblock checksum */ #define FS_42INODEFMT -1 /* 4.2BSD inode format */ #define FS_44INODEFMT 2 /* 4.4BSD inode format */ @@ -415,7 +415,11 @@ CTASSERT(sizeof(struct fs) == 1376); * on-disk auxiliary indexes (such as B-trees) for speeding directory * accesses. Kernels that do not support auxiliary indices clear the * flag to indicate that the indices need to be rebuilt (by fsck) before - * they can be used. + * they can be used. When a filesystem is mounted, any flags not + * included in FS_SUPPORTED are cleared. This lets newer features + * know that the filesystem has been run on an older version of the + * filesystem and thus that data structures associated with those + * features are out-of-date and need to be rebuilt. * * FS_ACLS indicates that POSIX.1e ACLs are administratively enabled * for the file system, so they should be loaded from extended attributes, @@ -437,8 +441,30 @@ CTASSERT(sizeof(struct fs) == 1376); #define FS_NFS4ACLS 0x0100 /* file system has NFSv4 ACLs enabled */ #define FS_INDEXDIRS 0x0200 /* kernel supports indexed directories */ #define FS_TRIM 0x0400 /* issue BIO_DELETE for deleted blocks */ +#define FS_SUPPORTED 0xFFFF /* supported flags, others cleared at mount */ /* + * The fs_metackhash field indicates the types of metadata check-hash + * that are maintained for a filesystem. Not all filesystems check-hash + * all metadata. + */ +#define CK_SUPERBLOCK 0x0001 /* the superblock */ +#define CK_CYLGRP 0x0002 /* the cylinder groups */ +#define CK_INODE 0x0004 /* inodes */ +#define CK_INDIR 0x0008 /* indirect blocks */ +#define CK_DIR 0x0010 /* directory contents */ +/* + * The BX_FSPRIV buffer b_xflags are used to track types of data in buffers. + */ +#define BX_SUPERBLOCK 0x00010000 /* superblock */ +#define BX_CYLGRP 0x00020000 /* cylinder groups */ +#define BX_INODE 0x00040000 /* inodes */ +#define BX_INDIR 0x00080000 /* indirect blocks */ +#define BX_DIR 0x00100000 /* directory contents */ + +#define PRINT_UFS_BUF_XFLAGS "\20\25dir\24indir\23inode\22cylgrp\21superblock" + +/* * Macros to access bits in the fs_active array. */ #define ACTIVECGNUM(fs, cg) ((fs)->fs_active[(cg) / (NBBY * sizeof(int))]) @@ -506,7 +532,8 @@ struct cg { u_int32_t cg_niblk; /* number of inode blocks this cg */ u_int32_t cg_initediblk; /* last initialized inode */ u_int32_t cg_unrefs; /* number of unreferenced inodes */ - int32_t cg_sparecon32[2]; /* reserved for future use */ + int32_t cg_sparecon32[1]; /* reserved for future use */ + u_int32_t cg_ckhash; /* check-hash of this cg */ ufs_time_t cg_time; /* time last written */ int64_t cg_sparecon64[3]; /* reserved for future use */ u_int8_t cg_space[1]; /* space for cylinder group maps */ From owner-svn-src-head@freebsd.org Fri Sep 22 13:25:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62001E28E69; Fri, 22 Sep 2017 13:25:08 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x232.google.com (mail-qt0-x232.google.com [IPv6:2607:f8b0:400d:c0d::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 18AD16BF9A; Fri, 22 Sep 2017 13:25:08 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x232.google.com with SMTP id s18so1008370qta.3; Fri, 22 Sep 2017 06:25:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tc3VNbaeMXlxgNmxR6ZItJrIK+UiVcVUCfMWLNna6ZU=; b=A32T4dyDprq5aHZaYW/k0Rmt9IUHS3eeuufRu18wDMYVtDMrFrgCvPz5Q23/OsRuYX ELuTJAHcjWnubaQeoZkvEd3VZIa5ltjIGEn8bEuw8rwsJGhZmguw5vCTVrdKMKutCBsO io+qvigzDY5CYUUbLtPJudltbIiH9Xwdy1HMzpRQDUsJ18crGnvSSz/5ZLcKYy8yNTx0 13VtCfsTv+dkLfL3mpq2zImJnpW3BanCqtHcOk7Gu/70LNTaUommlmD19o9ct4cwj7P0 l5ZFEez7nSDXUeAkAu4eGxzpsEsWjSq1k85vkuuOqopb8yJ4Qc3qgZ+np3291lJNeneC evqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tc3VNbaeMXlxgNmxR6ZItJrIK+UiVcVUCfMWLNna6ZU=; b=WicaDZTFaa4T2Zcl5Np+RGGFuMK2WVqo4z/QfWp0FRG4hiwiQbZxWY5htHpi6dOQkH zMowvhN7O9YtpcqOBFrsJzZn4UnDoIRMCwpacUldXoHIRO9vNJTPtO8dXwhQFvDA8ELT Xlfm684ZzIgn4XhotxpZa6lirnV43QNUQY8E6U1X1Au794Njw2Vuh/dTDTH0XJ+9nta0 92Oy6hNCuyePGOuB372KHssM01PiKTItykWSr6JX1epXB695WfFLuTVGPg2QhAVOWOkD mJDAxJYHSSDSwIWzMNiJJ/p1JMWFRk4LOJ1584sFq6QCALeazMdJjOsvNAtezDBmHLGc tbFg== X-Gm-Message-State: AHPjjUhP8mhjYm+VpCsK7mfAHGbDavGj4Sic9HSPIwEKh8pVlNj0rPfu njvcxqJt8vnlXO/OR6/K8uqQNeustZahg8yUKkc= X-Google-Smtp-Source: AOwi7QDsDpsETDhRtQA6ROE33ACc+An6hdWKuyoyHQO5D0zP1EaWgp+k4QTxVUMqFgIrAZZ1e1/3JSCL7w3YiUxhoQQ= X-Received: by 10.200.26.211 with SMTP id h19mr8278714qtk.341.1506086707093; Fri, 22 Sep 2017 06:25:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.63.54 with HTTP; Fri, 22 Sep 2017 06:25:06 -0700 (PDT) In-Reply-To: <20170913223231.GN1055@FreeBSD.org> References: <201709101900.v8AJ0c2N059845@repo.freebsd.org> <20170911111127.B870@besplex.bde.org> <20170913223231.GN1055@FreeBSD.org> From: Mateusz Guzik Date: Fri, 22 Sep 2017 15:25:06 +0200 Message-ID: Subject: Re: svn commit: r323393 - in head/sys: sys vm To: Gleb Smirnoff Cc: Bruce Evans , Mateusz Guzik , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 13:25:08 -0000 On Thu, Sep 14, 2017 at 12:32 AM, Gleb Smirnoff wrote: > On Mon, Sep 11, 2017 at 09:30:10AM +0200, Mateusz Guzik wrote: > M> First, there is a bunch of counter(9) fields. I don't know the original > M> reasoning. I would expect these counters to be statically defined in a > M> per-cpu struct. > > The reasoning was to remove 'struct vmmeter' from the 'struct pcpu', which > sounds inline with your desire to remote struct vmmeter from the kernel > at all. > > Maintainance wise, it is much easier not to bloat 'struct pcpu' with > various global statistics, but keep them as counter(9)s instead. Indeed, > what's the big difference between TCP statistics and VM statistics, why > treat them differently? > > Performance wise, I haven't seen any regressions when collapsed > multiple entities of struct vmmeter sitting in struct pcpu, into > single one with counter(9)s. > My general point is that low-level primitives are weirdly heavier than they need to be. Notable example is critical_enter/exit which are both function calls. As for counter(9), it adds an avoidable read. You are not going to measure the impact as it is due to the kernel being rather pessimized in general. pmc will probably show slight increase in cache misses, but that's it. That said, if maintenance is easier (I don't see why though) that's fine, I'm definitely not interested in fighting over this one. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Fri Sep 22 13:37:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A930E295F7; Fri, 22 Sep 2017 13:37:57 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61C356C6DA; Fri, 22 Sep 2017 13:37:57 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x230.google.com with SMTP id z187so3061003ioz.12; Fri, 22 Sep 2017 06:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=N0osILSmWiaLHjuCcy07nogPj3zkvgC9CU86kgXHUUI=; b=rXeupq21tQqABB9vfnnbk365S00q8b7OzQBTbZlZEGMSmrMPYfeOM80WB+a1W5Zscu ebqHGZfVl3ZT34IEPPSiw5WYc6kRsd+o8TDCV5Vbd9JK8JSVzPwNi4YP2iFBXrlxrWpF yunEdJEf/AdUAeObpYlepwKFNPyixRTaVC9p9JzXfGJ4xrbLnomY990uTFCIkEg9yj7H 48kh/BjboLGMQuGiK4AFTQzL8EUTr1EoW9kkB3PQxf+PzpGSW9dyB1CxiAlrZ5qVgC1x G2ngwqDyYN9d1xhNtNQkuil4wdWHP3YkULY2/kRanOLoNC3uigpI5Y72yQp/VHKs6wjO Q9eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=N0osILSmWiaLHjuCcy07nogPj3zkvgC9CU86kgXHUUI=; b=Ykz+kD6kwNgOHAMXHL4Sza22tWWkQy2AK4xeTtMHLxYAfLR4tOrL2DuKELTY/+gnmi 9yFE+OJuldfI9bwciJCd6gp6snEaXuNnuQHAQwd7CoZtvo0oVleZ5pacZ+DR1Hq6fEIk fGPxKE+Acabu6pqCEPJYzqylsOtngTKF6VpzepEAfdopdJeSEIU5HD8F3Lrpjd0PeVWa sAUyWFLPkFizH0KI9SR07ixa1F17L3OwYKCpM7lAGSnV0TpDWfB7PjEIRiPOmyMYbhvw k2cnfAy6nF48liM62whTcx28yA7vrzf/u3cfkK2IW8ep6UsPrBruxwGYnhu6C0Q1rk6B MljQ== X-Gm-Message-State: AHPjjUhwMXK0qbdjXOm95kWwNJBmmH4X/1PuGJSAfGsKyKCQ0C5xQm9H 82EJDl8yX75Zb8Qc1wyerZqT7H4Tb0Cedb/XGy6nyUSG X-Google-Smtp-Source: AOwi7QCYxwNEbDtWhSGWej7uKBXaiKW5BSkEF3aFz24g8ZcM+I2zRGR2XqNwNRWXQwzcdkj3aTqQFCP9RNaqHmeSWfU= X-Received: by 10.107.7.159 with SMTP id g31mr6843055ioi.250.1506087476308; Fri, 22 Sep 2017 06:37:56 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.197.130 with HTTP; Fri, 22 Sep 2017 06:37:35 -0700 (PDT) In-Reply-To: <201709221245.v8MCjFPv043387@repo.freebsd.org> References: <201709221245.v8MCjFPv043387@repo.freebsd.org> From: Ed Maste Date: Fri, 22 Sep 2017 15:37:35 +0200 X-Google-Sender-Auth: DOkxdTTOSCdKx6GW3j2VraNQ_p0 Message-ID: Subject: Re: svn commit: r323923 - in head: lib/libufs sbin/dumpfs sbin/fsck_ffs sbin/fsdb sbin/newfs sys/kern sys/libkern sys/sys sys/ufs/ffs To: Kirk McKusick Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 13:37:57 -0000 )On 22 September 2017 at 14:45, Kirk McKusick wrote: > Author: mckusick > Date: Fri Sep 22 12:45:15 2017 > New Revision: 323923 > URL: https://svnweb.freebsd.org/changeset/base/323923 > > Log: > Continuing efforts to provide hardening of FFS, this change adds a i386 and others are broken after this change (from https://ci.freebsd.org/job/FreeBSD-head-i386-build/4050/console): 13:25:09 /usr/src/sys/ufs/ffs/ffs_alloc.c:2619:27: error: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat] 13:25:09 cg, cgp->cg_ckhash, bp->b_ckhash); 13:25:09 ^~~~~~~~~~~~ From owner-svn-src-head@freebsd.org Fri Sep 22 14:34:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59685E2AE07; Fri, 22 Sep 2017 14:34:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2429F6E59A; Fri, 22 Sep 2017 14:34:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8MEYSdd089237; Fri, 22 Sep 2017 14:34:28 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8MEYS6Q089236; Fri, 22 Sep 2017 14:34:28 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201709221434.v8MEYS6Q089236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 22 Sep 2017 14:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323924 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 323924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 14:34:29 -0000 Author: gjb Date: Fri Sep 22 14:34:27 2017 New Revision: 323924 URL: https://svnweb.freebsd.org/changeset/base/323924 Log: Revert r323812 from release/tools/arm.subr, which has broken the build on arm/armv6 images. Pointyhat: gjb (myself) MFC after: immediate MFC note: releng/10.4 has broken because of this Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Fri Sep 22 12:45:15 2017 (r323923) +++ head/release/tools/arm.subr Fri Sep 22 14:34:27 2017 (r323924) @@ -99,16 +99,6 @@ arm_install_base() { TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \ installworld installkernel distribution - - # Bootstrap etcupdate(8) and mergemaster(8) databases. - mkdir -p ${DESTDIR}/var/db/etcupdate - etcupdate extract -B \ - -M "TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH}" \ - -s ${WORLDDIR} -d ${DESTDIR}/var/db/etcupdate - sh ${WORLDDIR}/release/scripts/mm-mtree.sh -m ${WORLDDIR} \ - -F "TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH}" \ - -D ${DESTDIR} - chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos arm_create_user From owner-svn-src-head@freebsd.org Fri Sep 22 14:42:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69482E00488; Fri, 22 Sep 2017 14:42:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yw0-f182.google.com (mail-yw0-f182.google.com [209.85.161.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 2E20C6ED15; Fri, 22 Sep 2017 14:42:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yw0-f182.google.com with SMTP id v72so886624ywa.3; Fri, 22 Sep 2017 07:42:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=DtgvmPKGkj+iwcVa0M3bvihXuZzAY/p6VPm4ou5+8N4=; b=kfb+S3pcsngw9FGA/ZN3TNrUyQJnb1arg5gKrIpoyylcMUOMYhUtdfCWFFmnyPmvD6 22l/rC2w8yc4gnYg9iLiQut9O8vmtrcLjTWavg+A/sW5JGq7At4ePkLXgWlCCGRn1KGJ 14XefmnoFZKwJqFBvtM1GgPSUYTBs6e1ed9WrJjxkr45kQeQsDCyKwoKkIAI9NgoH0Vd UrCimjfbSmpWkgeaCZYKQOp8l81jP9IyPf4MtuD3eucFq5R6IAAF+FZum94ObkVMCiTN jkaFFC1jlx17HcfOvbg1ItX1x5RrsRUrfzuPrEr9fW5+rR2MBJSJsTMT72cZbyXGd8US jVTQ== X-Gm-Message-State: AHPjjUinl53sD1EKl/Byr2IDLd+hyKS4pSS1I/zB74T1PLiFzYhXNZK+ c1WtBjRCajyoVnGMQc/Mm4WX0Ftu X-Received: by 10.13.235.197 with SMTP id u188mr3787530ywe.349.1506090859608; Fri, 22 Sep 2017 07:34:19 -0700 (PDT) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com. [209.85.223.181]) by smtp.gmail.com with ESMTPSA id p125sm1509759ywb.29.2017.09.22.07.34.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Sep 2017 07:34:19 -0700 (PDT) Received: by mail-io0-f181.google.com with SMTP id g32so3489747ioj.2; Fri, 22 Sep 2017 07:34:19 -0700 (PDT) X-Google-Smtp-Source: AOwi7QClKTzWbVUPznc9ts098PKAW5Ljwh83VnuwzCWPaImyetB9S8bDX+QfsSwQkfFfE/LsAegzD329b7pkRVjJ5IE= X-Received: by 10.107.97.5 with SMTP id v5mr8803452iob.68.1506090858862; Fri, 22 Sep 2017 07:34:18 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.137.79 with HTTP; Fri, 22 Sep 2017 07:34:18 -0700 (PDT) In-Reply-To: <201709221245.v8MCjFPv043387@repo.freebsd.org> References: <201709221245.v8MCjFPv043387@repo.freebsd.org> From: Conrad Meyer Date: Fri, 22 Sep 2017 07:34:18 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r323923 - in head: lib/libufs sbin/dumpfs sbin/fsck_ffs sbin/fsdb sbin/newfs sys/kern sys/libkern sys/sys sys/ufs/ffs To: Kirk McKusick Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 14:42:20 -0000 On Fri, Sep 22, 2017 at 5:45 AM, Kirk McKusick wrote: > Author: mckusick > Date: Fri Sep 22 12:45:15 2017 > New Revision: 323923 > URL: https://svnweb.freebsd.org/changeset/base/323923 > > Log: > Continuing efforts to provide hardening of FFS, this change adds a > check hash to cylinder groups. If a check hash fails when a cylinder > group is read, no further allocations are attempted in that cylinder > group until it has been fixed by fsck. This avoids a class of > filesystem panics related to corrupted cylinder group maps. The > hash is done using crc32c. > > ... > > Modified: head/sys/libkern/crc32.c > ============================================================================== > --- head/sys/libkern/crc32.c Fri Sep 22 12:07:03 2017 (r323922) > +++ head/sys/libkern/crc32.c Fri Sep 22 12:45:15 2017 (r323923) > @@ -759,6 +762,7 @@ calculate_crc32c(uint32_t crc32c, > const unsigned char *buffer, > unsigned int length) > { > +#ifdef _KERNEL > #if defined(__amd64__) || defined(__i386__) > if ((cpu_feature2 & CPUID2_SSE42) != 0) { > return (sse42_crc32c(crc32c, buffer, length)); > @@ -776,6 +780,7 @@ calculate_crc32c(uint32_t crc32c, > return (armv8_crc32c(crc32c, buffer, length)); > } else > #endif > +#endif /* _KERNEL */ > if (length < 4) { > return (singletable_crc32c(crc32c, buffer, length)); > } else { Userspace x86 ought to be able to use the SSE-enhanced implementation, too. It will just need a cpuid check, and can skip the FPU context manipulation. Best, Conrad From owner-svn-src-head@freebsd.org Fri Sep 22 16:42:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06D30E04A94; Fri, 22 Sep 2017 16:42:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C22B1735C4; Fri, 22 Sep 2017 16:42:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8MGgf55044748; Fri, 22 Sep 2017 16:42:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8MGgf0f044747; Fri, 22 Sep 2017 16:42:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709221642.v8MGgf0f044747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 Sep 2017 16:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323932 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 323932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 16:42:43 -0000 Author: kib Date: Fri Sep 22 16:42:41 2017 New Revision: 323932 URL: https://svnweb.freebsd.org/changeset/base/323932 Log: Fix 32bit build. Reported by: emaste Sponsored by: The FreeBSD Foundation Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Fri Sep 22 15:53:22 2017 (r323931) +++ head/sys/ufs/ffs/ffs_alloc.c Fri Sep 22 16:42:41 2017 (r323932) @@ -2615,8 +2615,8 @@ ffs_getcg(fs, devvp, cg, bpp, cgpp) (bp->b_flags & B_CKHASH) != 0 && cgp->cg_ckhash != bp->b_ckhash) || !cg_chkmagic(cgp) || cgp->cg_cgx != cg) { - printf("checksum failed: cg %u, cgp: 0x%x != bp: 0x%lx\n", - cg, cgp->cg_ckhash, bp->b_ckhash); + printf("checksum failed: cg %u, cgp: 0x%x != bp: 0x%jx\n", + cg, cgp->cg_ckhash, (uintmax_t)bp->b_ckhash); bp->b_flags &= ~B_CKHASH; bp->b_flags |= B_INVAL | B_NOCACHE; brelse(bp); From owner-svn-src-head@freebsd.org Fri Sep 22 17:57:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBB95E06D31; Fri, 22 Sep 2017 17:57:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EF0B751BC; Fri, 22 Sep 2017 17:57:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8MHvcua073676; Fri, 22 Sep 2017 17:57:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8MHvcxS073675; Fri, 22 Sep 2017 17:57:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201709221757.v8MHvcxS073675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 22 Sep 2017 17:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323933 - head/sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/arm/include X-SVN-Commit-Revision: 323933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 17:57:39 -0000 Author: jhb Date: Fri Sep 22 17:57:38 2017 New Revision: 323933 URL: https://svnweb.freebsd.org/changeset/base/323933 Log: Correct HWCAP_VFP3* values to match Linux. Reviewed by: andrew, ian MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12388 Modified: head/sys/arm/include/elf.h Modified: head/sys/arm/include/elf.h ============================================================================== --- head/sys/arm/include/elf.h Fri Sep 22 16:42:41 2017 (r323932) +++ head/sys/arm/include/elf.h Fri Sep 22 17:57:38 2017 (r323933) @@ -117,8 +117,8 @@ __ElfType(Auxinfo); /* Flags passed in AT_HWCAP. */ #define HWCAP_VFP 0x00000040 -#define HWCAP_VFPv3 0x00000200 -#define HWCAP_VFPv3D16 0x00000400 +#define HWCAP_VFPv3 0x00002000 +#define HWCAP_VFPv3D16 0x00004000 #define HWCAP_VFPD32 0x00080000 #endif /* !_MACHINE_ELF_H_ */ From owner-svn-src-head@freebsd.org Fri Sep 22 17:58:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95241E06E56; Fri, 22 Sep 2017 17:58:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62F7575343; Fri, 22 Sep 2017 17:58:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8MHwv9p073762; Fri, 22 Sep 2017 17:58:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8MHwvpa073759; Fri, 22 Sep 2017 17:58:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201709221758.v8MHwvpa073759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 22 Sep 2017 17:58:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323934 - in head/sys/arm: arm include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/arm: arm include X-SVN-Commit-Revision: 323934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 17:58:58 -0000 Author: jhb Date: Fri Sep 22 17:58:57 2017 New Revision: 323934 URL: https://svnweb.freebsd.org/changeset/base/323934 Log: Detect NEON and set HWCAP_NEON if present. Reviewed by: andrew, ian MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12389 Modified: head/sys/arm/arm/vfp.c head/sys/arm/include/elf.h Modified: head/sys/arm/arm/vfp.c ============================================================================== --- head/sys/arm/arm/vfp.c Fri Sep 22 17:57:38 2017 (r323933) +++ head/sys/arm/arm/vfp.c Fri Sep 22 17:58:57 2017 (r323934) @@ -144,6 +144,11 @@ vfp_init(void) initial_fpscr; } } + + if ((tmp & VMVFR1_LS_MASK) >> VMVFR1_LS_OFF == 1 && + (tmp & VMVFR1_I_MASK) >> VMVFR1_I_OFF == 1 && + (tmp & VMVFR1_SP_MASK) >> VMVFR1_SP_OFF == 1) + elf_hwcap |= HWCAP_NEON; } /* initialize the coprocess 10 and 11 calls Modified: head/sys/arm/include/elf.h ============================================================================== --- head/sys/arm/include/elf.h Fri Sep 22 17:57:38 2017 (r323933) +++ head/sys/arm/include/elf.h Fri Sep 22 17:58:57 2017 (r323934) @@ -117,6 +117,7 @@ __ElfType(Auxinfo); /* Flags passed in AT_HWCAP. */ #define HWCAP_VFP 0x00000040 +#define HWCAP_NEON 0x00001000 #define HWCAP_VFPv3 0x00002000 #define HWCAP_VFPv3D16 0x00004000 #define HWCAP_VFPD32 0x00080000 From owner-svn-src-head@freebsd.org Fri Sep 22 20:01:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0FEEE0C182; Fri, 22 Sep 2017 20:01:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB9397C8E5; Fri, 22 Sep 2017 20:01:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8MK1CkJ023642; Fri, 22 Sep 2017 20:01:12 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8MK1CdR023641; Fri, 22 Sep 2017 20:01:12 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709222001.v8MK1CdR023641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 22 Sep 2017 20:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323935 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 323935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Sep 2017 20:01:13 -0000 Author: cem Date: Fri Sep 22 20:01:12 2017 New Revision: 323935 URL: https://svnweb.freebsd.org/changeset/base/323935 Log: ddb(4): Add 'show badstacks' command to show witness badstacks Add a DDB command that mirrors sysctl debug.witness.badstacks. Reported by: rstone Reviewed by: rstone Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12468 Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Fri Sep 22 17:58:57 2017 (r323934) +++ head/sys/kern/subr_witness.c Fri Sep 22 20:01:12 2017 (r323935) @@ -2539,31 +2539,18 @@ DB_SHOW_COMMAND(witness, db_witness_display) } #endif -static int -sysctl_debug_witness_badstacks(SYSCTL_HANDLER_ARGS) +static void +sbuf_print_witness_badstacks(struct sbuf *sb) { struct witness_lock_order_data *data1, *data2, *tmp_data1, *tmp_data2; struct witness *tmp_w1, *tmp_w2, *w1, *w2; - struct sbuf *sb; u_int w_rmatrix1, w_rmatrix2; - int error, generation, i, j; + int generation, i, j; tmp_data1 = NULL; tmp_data2 = NULL; tmp_w1 = NULL; tmp_w2 = NULL; - if (witness_watch < 1) { - error = SYSCTL_OUT(req, w_notrunning, sizeof(w_notrunning)); - return (error); - } - if (witness_cold) { - error = SYSCTL_OUT(req, w_stillcold, sizeof(w_stillcold)); - return (error); - } - error = 0; - sb = sbuf_new(NULL, NULL, badstack_sbuf_size, SBUF_AUTOEXTEND); - if (sb == NULL) - return (ENOMEM); /* Allocate and init temporary storage space. */ tmp_w1 = malloc(sizeof(struct witness), M_TEMP, M_WAITOK | M_ZERO); @@ -2683,13 +2670,55 @@ restart: free(tmp_data2, M_TEMP); free(tmp_w1, M_TEMP); free(tmp_w2, M_TEMP); +} +static int +sysctl_debug_witness_badstacks(SYSCTL_HANDLER_ARGS) +{ + struct sbuf *sb; + int error; + + if (witness_watch < 1) { + error = SYSCTL_OUT(req, w_notrunning, sizeof(w_notrunning)); + return (error); + } + if (witness_cold) { + error = SYSCTL_OUT(req, w_stillcold, sizeof(w_stillcold)); + return (error); + } + error = 0; + sb = sbuf_new(NULL, NULL, badstack_sbuf_size, SBUF_AUTOEXTEND); + if (sb == NULL) + return (ENOMEM); + + sbuf_print_witness_badstacks(sb); + sbuf_finish(sb); error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); return (error); } + +#ifdef DDB +static int +sbuf_db_printf_drain(void *arg __unused, const char *data, int len) +{ + + return (db_printf("%.*s", len, data)); +} + +DB_SHOW_COMMAND(badstacks, db_witness_badstacks) +{ + struct sbuf sb; + char buffer[128]; + + sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN); + sbuf_set_drain(&sb, sbuf_db_printf_drain, NULL); + sbuf_print_witness_badstacks(&sb); + sbuf_finish(&sb); +} +#endif static int sysctl_debug_witness_channel(SYSCTL_HANDLER_ARGS) From owner-svn-src-head@freebsd.org Sat Sep 23 01:33:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68536E1BF10; Sat, 23 Sep 2017 01:33:22 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 448A815D6; Sat, 23 Sep 2017 01:33:22 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8N1XLto063112; Sat, 23 Sep 2017 01:33:21 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8N1XK8E063109; Sat, 23 Sep 2017 01:33:20 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201709230133.v8N1XK8E063109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Sat, 23 Sep 2017 01:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323941 - in head/sys: dev/e1000 net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: in head/sys: dev/e1000 net X-SVN-Commit-Revision: 323941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 01:33:22 -0000 Author: shurd Date: Sat Sep 23 01:33:20 2017 New Revision: 323941 URL: https://svnweb.freebsd.org/changeset/base/323941 Log: Some small packet performance improvements If the packet is smaller than MTU, disable the TSO flags. Move TCP header parsing inside the IS_TSO?() test. Add a new IFLIB_NEED_ZERO_CSUM flag to indicate the checksums need to be zeroed before TX. Reviewed by: sbruno Approved by: sbruno (mentor) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12442 Modified: head/sys/dev/e1000/if_em.c head/sys/net/iflib.c head/sys/net/iflib.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Fri Sep 22 22:19:56 2017 (r323940) +++ head/sys/dev/e1000/if_em.c Sat Sep 23 01:33:20 2017 (r323941) @@ -483,7 +483,7 @@ static struct if_shared_ctx em_sctx_init = { .isc_vendor_info = em_vendor_info_array, .isc_driver_version = em_driver_version, .isc_driver = &em_if_driver, - .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_TSO_INIT_IP, + .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_TSO_INIT_IP | IFLIB_NEED_ZERO_CSUM, .isc_nrxd_min = {EM_MIN_RXD}, .isc_ntxd_min = {EM_MIN_TXD}, @@ -511,7 +511,7 @@ static struct if_shared_ctx igb_sctx_init = { .isc_vendor_info = igb_vendor_info_array, .isc_driver_version = em_driver_version, .isc_driver = &em_if_driver, - .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_TSO_INIT_IP, + .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_TSO_INIT_IP | IFLIB_NEED_ZERO_CSUM, .isc_nrxd_min = {EM_MIN_RXD}, .isc_ntxd_min = {EM_MIN_TXD}, Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Fri Sep 22 22:19:56 2017 (r323940) +++ head/sys/net/iflib.c Sat Sep 23 01:33:20 2017 (r323941) @@ -2696,6 +2696,10 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_ehdrlen = ETHER_HDR_LEN; } + if (if_getmtu(txq->ift_ctx->ifc_ifp) >= pi->ipi_len) { + pi->ipi_csum_flags &= ~(CSUM_IP_TSO|CSUM_IP6_TSO); + } + switch (pi->ipi_etype) { #ifdef INET case ETHERTYPE_IP: @@ -2740,21 +2744,21 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_ipproto = ip->ip_p; pi->ipi_flags |= IPI_TX_IPV4; - if (pi->ipi_csum_flags & CSUM_IP) + if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) ip->ip_sum = 0; - if (pi->ipi_ipproto == IPPROTO_TCP) { - if (__predict_false(th == NULL)) { - txq->ift_pullups++; - if (__predict_false((m = m_pullup(m, (ip->ip_hl << 2) + sizeof(*th))) == NULL)) - return (ENOMEM); - th = (struct tcphdr *)((caddr_t)ip + pi->ipi_ip_hlen); - } - pi->ipi_tcp_hflags = th->th_flags; - pi->ipi_tcp_hlen = th->th_off << 2; - pi->ipi_tcp_seq = th->th_seq; - } if (IS_TSO4(pi)) { + if (pi->ipi_ipproto == IPPROTO_TCP) { + if (__predict_false(th == NULL)) { + txq->ift_pullups++; + if (__predict_false((m = m_pullup(m, (ip->ip_hl << 2) + sizeof(*th))) == NULL)) + return (ENOMEM); + th = (struct tcphdr *)((caddr_t)ip + pi->ipi_ip_hlen); + } + pi->ipi_tcp_hflags = th->th_flags; + pi->ipi_tcp_hlen = th->th_off << 2; + pi->ipi_tcp_seq = th->th_seq; + } if (__predict_false(ip->ip_p != IPPROTO_TCP)) return (ENXIO); th->th_sum = in_pseudo(ip->ip_src.s_addr, @@ -2785,15 +2789,15 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_ipproto = ip6->ip6_nxt; pi->ipi_flags |= IPI_TX_IPV6; - if (pi->ipi_ipproto == IPPROTO_TCP) { - if (__predict_false(m->m_len < pi->ipi_ehdrlen + sizeof(struct ip6_hdr) + sizeof(struct tcphdr))) { - if (__predict_false((m = m_pullup(m, pi->ipi_ehdrlen + sizeof(struct ip6_hdr) + sizeof(struct tcphdr))) == NULL)) - return (ENOMEM); - } - pi->ipi_tcp_hflags = th->th_flags; - pi->ipi_tcp_hlen = th->th_off << 2; - } if (IS_TSO6(pi)) { + if (pi->ipi_ipproto == IPPROTO_TCP) { + if (__predict_false(m->m_len < pi->ipi_ehdrlen + sizeof(struct ip6_hdr) + sizeof(struct tcphdr))) { + if (__predict_false((m = m_pullup(m, pi->ipi_ehdrlen + sizeof(struct ip6_hdr) + sizeof(struct tcphdr))) == NULL)) + return (ENOMEM); + } + pi->ipi_tcp_hflags = th->th_flags; + pi->ipi_tcp_hlen = th->th_off << 2; + } if (__predict_false(ip6->ip6_nxt != IPPROTO_TCP)) return (ENXIO); Modified: head/sys/net/iflib.h ============================================================================== --- head/sys/net/iflib.h Fri Sep 22 22:19:56 2017 (r323940) +++ head/sys/net/iflib.h Sat Sep 23 01:33:20 2017 (r323941) @@ -305,6 +305,10 @@ typedef enum { * Interface doesn't align IP header */ #define IFLIB_DO_RX_FIXUP 0x40 +/* + * Driver needs csum zeroed for offloading + */ +#define IFLIB_NEED_ZERO_CSUM 0x80 From owner-svn-src-head@freebsd.org Sat Sep 23 01:35:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97E16E1C1FA; Sat, 23 Sep 2017 01:35:15 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65AF21816; Sat, 23 Sep 2017 01:35:15 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8N1ZExI063265; Sat, 23 Sep 2017 01:35:14 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8N1ZE6S063264; Sat, 23 Sep 2017 01:35:14 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201709230135.v8N1ZE6S063264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Sat, 23 Sep 2017 01:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323942 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 323942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 01:35:15 -0000 Author: shurd Date: Sat Sep 23 01:35:14 2017 New Revision: 323942 URL: https://svnweb.freebsd.org/changeset/base/323942 Log: Chain mbufs before passing to if_input() Build a list of mbufs to pass to if_input() after LRO. Results in 12% small packet forwarding rate improvement. Reviewed by: sbruno Approved by: sbruno (mentor) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12444 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Sat Sep 23 01:33:20 2017 (r323941) +++ head/sys/net/iflib.c Sat Sep 23 01:35:14 2017 (r323942) @@ -2470,7 +2470,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) * XXX early demux data packets so that if_input processing only handles * acks in interrupt context */ - struct mbuf *m, *mh, *mt; + struct mbuf *m, *mh, *mt, *mf; ifp = ctx->ifc_ifp; mh = mt = NULL; @@ -2541,8 +2541,11 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) __iflib_fl_refill_lt(ctx, fl, budget + 8); lro_enabled = (if_getcapenable(ifp) & IFCAP_LRO); + mt = mf = NULL; while (mh != NULL) { m = mh; + if (mf == NULL) + mf = m; mh = mh->m_nextpkt; m->m_nextpkt = NULL; #ifndef __NO_STRICT_ALIGNMENT @@ -2552,11 +2555,19 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) rx_bytes += m->m_pkthdr.len; rx_pkts++; #if defined(INET6) || defined(INET) - if (lro_enabled && tcp_lro_rx(&rxq->ifr_lc, m, 0) == 0) + if (lro_enabled && tcp_lro_rx(&rxq->ifr_lc, m, 0) == 0) { + if (mf == m) + mf = NULL; continue; + } #endif + if (mt != NULL) + mt->m_nextpkt = m; + mt = m; + } + if (mf != NULL) { + ifp->if_input(ifp, mf); DBG_COUNTER_INC(rx_if_input); - ifp->if_input(ifp, m); } if_inc_counter(ifp, IFCOUNTER_IBYTES, rx_bytes); From owner-svn-src-head@freebsd.org Sat Sep 23 01:37:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E046E1C49A; Sat, 23 Sep 2017 01:37:02 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BB841A3A; Sat, 23 Sep 2017 01:37:01 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8N1b16b063396; Sat, 23 Sep 2017 01:37:01 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8N1b1IK063395; Sat, 23 Sep 2017 01:37:01 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201709230137.v8N1b1IK063395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Sat, 23 Sep 2017 01:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323943 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 323943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 01:37:02 -0000 Author: shurd Date: Sat Sep 23 01:37:01 2017 New Revision: 323943 URL: https://svnweb.freebsd.org/changeset/base/323943 Log: Make the rx budget a tunable This allows tuning the rx budget for special load profiles as well as more easily testing to determine sane defaults. Reviewed by: sbruno Approved by: sbruno (mentor) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12445 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Sat Sep 23 01:35:14 2017 (r323942) +++ head/sys/net/iflib.c Sat Sep 23 01:37:01 2017 (r323943) @@ -185,6 +185,7 @@ struct iflib_ctx { uint16_t ifc_sysctl_ntxqs; uint16_t ifc_sysctl_nrxqs; uint16_t ifc_sysctl_qs_eq_override; + uint16_t ifc_sysctl_rx_budget; qidx_t ifc_sysctl_ntxds[8]; qidx_t ifc_sysctl_nrxds[8]; @@ -3531,6 +3532,7 @@ _task_fn_rx(void *context) if_ctx_t ctx = rxq->ifr_ctx; bool more; int rc; + uint16_t budget; #ifdef IFLIB_DIAGNOSTICS rxq->ifr_cpu_exec_count[curcpu]++; @@ -3547,7 +3549,10 @@ _task_fn_rx(void *context) } } #endif - if (more == false || (more = iflib_rxeof(rxq, 16 /* XXX */)) == false) { + budget = ctx->ifc_sysctl_rx_budget; + if (budget == 0) + budget = 16; /* XXX */ + if (more == false || (more = iflib_rxeof(rxq, budget)) == false) { if (ctx->ifc_flags & IFC_LEGACY) IFDI_INTR_ENABLE(ctx); else { @@ -5486,9 +5491,12 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "override_qs_enable", CTLFLAG_RWTUN, &ctx->ifc_sysctl_qs_eq_override, 0, "permit #txq != #rxq"); - SYSCTL_ADD_INT(ctx_list, oid_list, OID_AUTO, "disable_msix", + SYSCTL_ADD_INT(ctx_list, oid_list, OID_AUTO, "disable_msix", CTLFLAG_RWTUN, &ctx->ifc_softc_ctx.isc_disable_msix, 0, "disable MSIX (default 0)"); + SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "rx_budget", + CTLFLAG_RWTUN, &ctx->ifc_sysctl_rx_budget, 0, + "set the rx budget"); /* XXX change for per-queue sizes */ SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_ntxds", From owner-svn-src-head@freebsd.org Sat Sep 23 01:39:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 456DBE1C830; Sat, 23 Sep 2017 01:39:18 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C6B31CB8; Sat, 23 Sep 2017 01:39:18 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8N1dHOp063546; Sat, 23 Sep 2017 01:39:17 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8N1dGCi063544; Sat, 23 Sep 2017 01:39:16 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201709230139.v8N1dGCi063544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Sat, 23 Sep 2017 01:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323944 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 323944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 01:39:18 -0000 Author: shurd Date: Sat Sep 23 01:39:16 2017 New Revision: 323944 URL: https://svnweb.freebsd.org/changeset/base/323944 Log: Make struct grouptask gt_name member a char array Previously, it was just a pointer which was copied, but some callers pass in a stack variable which will go out of scope. Add GROUPTASK_NAMELEN macro (32) and snprintf() the name into it, using "grouptask" if name is NULL. We can now safely include gtask->gt_name in console messages. Reviewed by: sbruno Approved by: sbruno (mentor) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12449 Modified: head/sys/kern/subr_gtaskqueue.c head/sys/sys/_task.h Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Sat Sep 23 01:37:01 2017 (r323943) +++ head/sys/kern/subr_gtaskqueue.c Sat Sep 23 01:39:16 2017 (r323944) @@ -666,7 +666,7 @@ taskqgroup_attach(struct taskqgroup *qgroup, struct gr int qid, error; gtask->gt_uniq = uniq; - gtask->gt_name = name; + snprintf(gtask->gt_name, GROUPTASK_NAMELEN, "%s", name ? name : "grouptask"); gtask->gt_irq = irq; gtask->gt_cpu = -1; mtx_lock(&qgroup->tqg_lock); @@ -703,7 +703,7 @@ taskqgroup_attach_deferred(struct taskqgroup *qgroup, error = intr_setaffinity(gtask->gt_irq, CPU_WHICH_IRQ, &mask); mtx_lock(&qgroup->tqg_lock); if (error) - printf("%s: setaffinity failed: %d\n", __func__, error); + printf("%s: %s setaffinity failed: %d\n", __func__, gtask->gt_name, error); } qgroup->tqg_queue[qid].tgc_cnt++; @@ -724,7 +724,7 @@ taskqgroup_attach_cpu(struct taskqgroup *qgroup, struc qid = -1; gtask->gt_uniq = uniq; - gtask->gt_name = name; + snprintf(gtask->gt_name, GROUPTASK_NAMELEN, "%s", name ? name : "grouptask"); gtask->gt_irq = irq; gtask->gt_cpu = cpu; mtx_lock(&qgroup->tqg_lock); @@ -736,7 +736,7 @@ taskqgroup_attach_cpu(struct taskqgroup *qgroup, struc } if (qid == -1) { mtx_unlock(&qgroup->tqg_lock); - printf("%s: qid not found for %s cpu=%d\n", __func__, name, cpu); + printf("%s: qid not found for %s cpu=%d\n", __func__, gtask->gt_name, cpu); return (EINVAL); } } else @@ -775,7 +775,7 @@ taskqgroup_attach_cpu_deferred(struct taskqgroup *qgro } if (qid == -1) { mtx_unlock(&qgroup->tqg_lock); - printf("%s: qid not found for cpu=%d\n", __func__, cpu); + printf("%s: qid not found for %s cpu=%d\n", __func__, gtask->gt_name, cpu); return (EINVAL); } qgroup->tqg_queue[qid].tgc_cnt++; @@ -805,7 +805,7 @@ taskqgroup_detach(struct taskqgroup *qgroup, struct gr if (qgroup->tqg_queue[i].tgc_taskq == gtask->gt_taskqueue) break; if (i == qgroup->tqg_cnt) - panic("taskqgroup_detach: task not in group\n"); + panic("taskqgroup_detach: task %s not in group\n", gtask->gt_name); qgroup->tqg_queue[i].tgc_cnt--; LIST_REMOVE(gtask, gt_list); mtx_unlock(&qgroup->tqg_lock); Modified: head/sys/sys/_task.h ============================================================================== --- head/sys/sys/_task.h Sat Sep 23 01:37:01 2017 (r323943) +++ head/sys/sys/_task.h Sat Sep 23 01:39:16 2017 (r323944) @@ -65,7 +65,8 @@ struct grouptask { void *gt_taskqueue; LIST_ENTRY(grouptask) gt_list; void *gt_uniq; - char *gt_name; +#define GROUPTASK_NAMELEN 32 + char gt_name[GROUPTASK_NAMELEN]; int16_t gt_irq; int16_t gt_cpu; }; From owner-svn-src-head@freebsd.org Sat Sep 23 05:16:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB807E25D20; Sat, 23 Sep 2017 05:16:18 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B55067317; Sat, 23 Sep 2017 05:16:17 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id A912825D3860; Sat, 23 Sep 2017 05:16:13 +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 B13B2D1F927; Sat, 23 Sep 2017 05:16:12 +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 YMzB5NPd4IFz; Sat, 23 Sep 2017 05:16:11 +0000 (UTC) Received: from [192.168.124.1] (unknown [IPv6:fde9:577b:c1a9:f001::2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 11745D1F7F6; Sat, 23 Sep 2017 05:16:10 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Stephen Hurd" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323942 - head/sys/net Date: Sat, 23 Sep 2017 05:16:08 +0000 Message-ID: In-Reply-To: <201709230135.v8N1ZE6S063264@repo.freebsd.org> References: <201709230135.v8N1ZE6S063264@repo.freebsd.org> MIME-Version: 1.0 X-Mailer: MailMate (2.0BETAr6091) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 05:16:18 -0000 On 23 Sep 2017, at 1:35, Stephen Hurd wrote: > Author: shurd > Date: Sat Sep 23 01:35:14 2017 > New Revision: 323942 > URL: https://svnweb.freebsd.org/changeset/base/323942 > > Log: > Chain mbufs before passing to if_input() > > Build a list of mbufs to pass to if_input() after LRO. Results in > 12% small packet forwarding rate improvement. forwarding seems a confusing word here.. > Reviewed by: sbruno > Approved by: sbruno (mentor) > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D12444 > > Modified: > head/sys/net/iflib.c From owner-svn-src-head@freebsd.org Sat Sep 23 06:00:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 653C5E26F47; Sat, 23 Sep 2017 06:00:18 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FA7368322; Sat, 23 Sep 2017 06:00:18 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8N60HIi070502; Sat, 23 Sep 2017 06:00:17 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8N60HFw070501; Sat, 23 Sep 2017 06:00:17 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201709230600.v8N60HFw070501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 23 Sep 2017 06:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323945 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 323945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 06:00:18 -0000 Author: cy Date: Sat Sep 23 06:00:17 2017 New Revision: 323945 URL: https://svnweb.freebsd.org/changeset/base/323945 Log: Correct two misspellings. Also align */. Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Sat Sep 23 01:39:16 2017 (r323944) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Sat Sep 23 06:00:17 2017 (r323945) @@ -6093,8 +6093,8 @@ ipf_nat_icmpquerytype(icmptype) { case ICMP_ECHOREPLY: case ICMP_ECHO: - /* route aedvertisement/solliciation is currently unsupported: */ - /* it would require rewriting the ICMP data section */ + /* route advertisement/soliciation is currently unsupported: */ + /* it would require rewriting the ICMP data section */ case ICMP_TSTAMP: case ICMP_TSTAMPREPLY: case ICMP_IREQ: From owner-svn-src-head@freebsd.org Sat Sep 23 06:25:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57F6EE279D1; Sat, 23 Sep 2017 06:25:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x236.google.com (mail-pg0-x236.google.com [IPv6:2607:f8b0:400e:c05::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 2C25369288; Sat, 23 Sep 2017 06:25:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x236.google.com with SMTP id v23so1622156pgc.5; Fri, 22 Sep 2017 23:25:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=BXirKVOkgLelNbaxWdj265gltX3K0KKfwEculIQTQhI=; b=YaoyOHLKWCkDpSrSe3EY0wicxYo0S5p5ozqypgDaVMB6Z0Phl4ir7HYLH3zOamIjQ4 kyBXUdFmQGmdT4a0FayYR1/8Ah5U88+fRhVVLsI5wKT4lCzfb6sseLekrEy1TmqB70hp at922yu+nXG7lH9dmfNpIy29TDB23nTzxigFGBOaQZljmCcLklhvrn/fel874BC4Xlny L6jhg3VKtobeilNJCZ8M84MdjkQobGK2bxVPvbsgmCdceojmNzF0qum121qcHzSprSN0 n3hHUlITu8Qnf4Fn6tMBSjUdfumj+mgAmaLKiBQUFYSZnHfIrilTxaIeKXYzjFXG4CaX NHjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=BXirKVOkgLelNbaxWdj265gltX3K0KKfwEculIQTQhI=; b=m/lkwdM+aIj3ZmFOvlvz0fstZYVvOm1VF6MIiGBYZ/+5L1sXgYXltHgpO55Lq+/VVP sJFtNtj6STUdL687FnAeQVOVbb1ruznhZ6W6RLagWrCpOuOddiq4LyaXrTGLpupnDAHF gFp9uAox2fsLs6SrLcs4IAKl7YaXbOHmV6w5UtPqPTFVUhD1lrZVSdHzrH4g/TQceYbZ Js9jwsDVvspPisxUDR+N433cxX7G5iK4j0pfAaroTfFkb6a4orIIXT0L8m6lv6zK+J2U td6t8XGd2KBsuTHbF31zc1ZNHY3uZSpIpgulvyhvG3AoC+b0pxRsbPyDmMNN/5tDy6xU MjxQ== X-Gm-Message-State: AHPjjUgEyfmHzsIob4fpH9EZsEPPKfG4jI74XSYYcRS4cM6iShtZ7p/N KsJO/x0YoyZA09NvRa5nmoUPUF+e X-Google-Smtp-Source: AOwi7QBVGZTYT4Is9Y3mSxc9RA/gAtLvOcPGKeqrhlzD93mp6etKO80W5SETNVi3jEbLJdhE6P8Z1g== X-Received: by 10.84.176.65 with SMTP id u59mr1337898plb.278.1506147921401; Fri, 22 Sep 2017 23:25:21 -0700 (PDT) Received: from [192.168.3.133] (70-90-173-49-California.hfc.comcastbusiness.net. [70.90.173.49]) by smtp.gmail.com with ESMTPSA id q13sm2607955pfd.100.2017.09.22.23.25.19 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Sep 2017 23:25:20 -0700 (PDT) Subject: Re: svn commit: r323899 - head/tests/sys/opencrypto Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_DA06DE63-4F47-4865-B02B-0D5455B5CFE2"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201709220441.v8M4fngZ034519@repo.freebsd.org> Date: Fri, 22 Sep 2017 23:25:22 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201709220441.v8M4fngZ034519@repo.freebsd.org> To: Conrad Meyer X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 06:25:22 -0000 --Apple-Mail=_DA06DE63-4F47-4865-B02B-0D5455B5CFE2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Sep 21, 2017, at 21:41, Conrad Meyer wrote: >=20 > Author: cem > Date: Fri Sep 22 04:41:48 2017 > New Revision: 323899 > URL: https://svnweb.freebsd.org/changeset/base/323899 >=20 > Log: > cryptotest.py: Like r323869, skip SHA HMAC tests on non-SHA drivers >=20 > Sponsored by: Dell EMC Isilon >=20 > Modified: > head/tests/sys/opencrypto/cryptotest.py >=20 > Modified: head/tests/sys/opencrypto/cryptotest.py > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/tests/sys/opencrypto/cryptotest.py Fri Sep 22 04:25:44 2017 = (r323898) > +++ head/tests/sys/opencrypto/cryptotest.py Fri Sep 22 04:41:48 2017 = (r323899) > @@ -237,6 +237,7 @@ def GenTestCase(cname): > #for i in iglob('SHA1*'): > # self.runSHA(i) >=20 > + @unittest.skipIf(cname not in shamodules, 'skipping SHA = on %s' % `name`) Backticks for stringily=E2=80=99ing things isn=E2=80=99t py3k = compatible, FYI. -Ngie --Apple-Mail=_DA06DE63-4F47-4865-B02B-0D5455B5CFE2 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 iQIcBAEBCgAGBQJZxf5TAAoJEPWDqSZpMIYVlW4P/icAivaHrMaYST8F6KhOh+aV PhVng80eWuyGb8LVIqWhPwZNeyfjrBuaELmq+4/l2gmDr4r5czyAnyGXphmmYd1w LKLKfvBxmuoMltE6YMO+uzWquqL//sYFJDsOxrCuYhao17vavniBTOY48wmz7NRh ONChn/kYlNiCgQNwqgHRnzlNxPRXasHjwedS1FMgeqvMqwJBzWMAl9ZHqPAp/5CR jL+5aziPu4R6fJGUGv7suxyv2pxoPHst8VLIR4kw2rBd75qVT3TcY1HTydYCLXpJ K7+gQUmQlH1b2c9f5NKHFMdM4rP4+Pgp3ghG6OCdHPf1zHcPGrvxZ+hi7R/7MWcG R8b3UDtRmWHfHrp30M2wSO3VRuINXwJS/2/cB+Y1fwiPT0cFYJPZTc6X8yXaRNle vI9R8PinLS3UZJsYbvt5PAWx/awEaY+bxkBfNDf3IGaqpnAyoQEGI3JKVDZ3nloW ANZiGCzJYBSwRDwCQjkTlTlN8wWzwDBBjQq4CoLO9RDd74tbidwPOWX+bgtOEKpn wEF1Zf4VpIv/3mOthc6LRkDkO14W3umFIzciFYaS1oZMhCOD6+yAaQaQ5Vw6DHt6 sCq0gfO0tQpL12TycXhfegPA7vgS7p8w/+2C/0+vzhAM6crwWxJWs8W7j66fbpfJ y5vJu/0VJ3oInfHMvDoH =ki1U -----END PGP SIGNATURE----- --Apple-Mail=_DA06DE63-4F47-4865-B02B-0D5455B5CFE2-- From owner-svn-src-head@freebsd.org Sat Sep 23 06:40:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C830E2804E; Sat, 23 Sep 2017 06:40:06 +0000 (UTC) (envelope-from shurd@sasktel.net) Received: from mail125c7.megamailservers.com (mail525c7.megamailservers.com [209.235.141.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7A626985A; Sat, 23 Sep 2017 06:40:04 +0000 (UTC) (envelope-from shurd@sasktel.net) X-Authenticated-User: hurds.sasktel.net X-VIP: 69.49.109.87 Received: from [192.168.0.33] (ip72-194-73-141.oc.oc.cox.net [72.194.73.141]) (authenticated bits=0) by mail125c7.megamailservers.com (8.14.9/8.13.1) with ESMTP id v8N6WfEP012383; Sat, 23 Sep 2017 02:32:43 -0400 Subject: Re: svn commit: r323942 - head/sys/net To: "Bjoern A. Zeeb" , Stephen Hurd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201709230135.v8N1ZE6S063264@repo.freebsd.org> From: Stephen Hurd Message-ID: <283397c7-a01e-3776-7ed3-b64d68003d0b@sasktel.net> Date: Fri, 22 Sep 2017 23:32:40 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:51.0) Gecko/20100101 Firefox/51.0 SeaMonkey/2.48 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CTCH-RefID: str=0001.0A020204.59C6000D.000B, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.2 cv=fL1J5dSe c=1 sm=1 tr=0 a=l4Y+EJuLrT/8f1z5FvEQ1g==:117 a=l4Y+EJuLrT/8f1z5FvEQ1g==:17 a=IkcTkHD0fZMA:10 a=6I5d2MoRAAAA:8 a=MrGgqHLmt7_Q1xOHqZAA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 06:40:06 -0000 Bjoern A. Zeeb wrote: > On 23 Sep 2017, at 1:35, Stephen Hurd wrote: > >> Author: shurd >> Date: Sat Sep 23 01:35:14 2017 >> New Revision: 323942 >> URL: https://svnweb.freebsd.org/changeset/base/323942 >> >> Log: >> Chain mbufs before passing to if_input() >> >> Build a list of mbufs to pass to if_input() after LRO. Results in >> 12% small packet forwarding rate improvement. > forwarding seems a confusing word here.. The test was small (64 byte frames) received on one interface, then sent out on a different one using the net.inet.ip.forwarding sysctl (controlled via the gateway_enable setting in rc.conf). From owner-svn-src-head@freebsd.org Sat Sep 23 06:41:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB398E280E9; Sat, 23 Sep 2017 06:41:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22b.google.com (mail-pf0-x22b.google.com [IPv6:2607:f8b0:400e:c00::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 B475869A00; Sat, 23 Sep 2017 06:41:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22b.google.com with SMTP id g65so1520556pfe.13; Fri, 22 Sep 2017 23:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=Ioph1ohPHoZdv5bo6qLCRrHh5rD8+vT9D5iOMO4HgPQ=; b=QW7BP0JO4EeNCirDS1wCzVW9ca+yEgh8PSqnBT6zAz0shX2M/xtvjF3Wt4NkcF9nkD rjMnLXXnrWRzRiGzgIOhACPvidibTnwuKnntqMcs0hCcEqysFOK6aAyurvBjSkgjLFff LFSWQ+pMMKF8VBdsOKa7++kfdVzsi3EK7eSkRpErgFIBmzOme1uMS4h6JVoMgnvWuMuA O/YP/uOnhvj4nufEkJPNMyZPwLejyqbglfNeoNAZaX8bpYc8jEGnHgobQqX7EjLh1YiI yLcWC7JnsKAMBqy3/tduEABQJPhrPT0NvCC0xKw36nfLX0YO8p1L7LjnwpWAtRoznSpd ZBBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=Ioph1ohPHoZdv5bo6qLCRrHh5rD8+vT9D5iOMO4HgPQ=; b=j7ThP40J1r+AKjJ9orWZs8gmIpANDDQ+dpNLesT4czwAkK5ZeW83BsLbnaxA7mD/ih kARTKBTfDZ1DyvNDTmQrZKTwAG/MgME2dQSUY3gmPLu8WEevIQ736bWFWYCs/KAe2gE4 odS5eMfgwnJITrQW1R+L7jeQLxOZNFaQRlZHrIjjWnLAmAdQ7bzYi/8Ad46zD3YSWlOw sMYMu0+/i5uVQZHjgGH88vnrsKrEdFs5mka1uE7Dbjvs10pu9a4OhSTot8aXpFujFdRW Dmu7ul53Bi5U68VoGd3kI1mAWVKiTPUStXPNH4yQkcMVEjGagbDA8+H+hXMohuqac/GS SrZg== X-Gm-Message-State: AHPjjUhzjYEfHPBBY4h98/85VcxApyXvUIEeJQpjfrFKWumEKG4NpPn5 WT4rzprvaybgy2n46cg1PX3hoKEV X-Google-Smtp-Source: AOwi7QDNBvAGqWhwxinJ9fx7tRd3QZAbGXTWgEJB1p+Cy7t691JnQ6cCBXwFphez28By1WesWSLGRw== X-Received: by 10.99.42.11 with SMTP id q11mr1344363pgq.7.1506148862969; Fri, 22 Sep 2017 23:41:02 -0700 (PDT) Received: from [192.168.3.133] (70-90-173-49-California.hfc.comcastbusiness.net. [70.90.173.49]) by smtp.gmail.com with ESMTPSA id b65sm2144661pfg.30.2017.09.22.23.41.01 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Sep 2017 23:41:02 -0700 (PDT) Subject: Re: svn commit: r323935 - head/sys/kern Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_DFEBFE8C-4907-490A-A181-5A44C0390825"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201709222001.v8MK1CdR023641@repo.freebsd.org> Date: Fri, 22 Sep 2017 23:41:04 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <8D46CBA5-7213-48E0-81DE-74D5F9517A77@gmail.com> References: <201709222001.v8MK1CdR023641@repo.freebsd.org> To: Conrad Meyer X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 06:41:04 -0000 --Apple-Mail=_DFEBFE8C-4907-490A-A181-5A44C0390825 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Sep 22, 2017, at 13:01, Conrad Meyer wrote: >=20 > Author: cem > Date: Fri Sep 22 20:01:12 2017 > New Revision: 323935 > URL: https://svnweb.freebsd.org/changeset/base/323935 >=20 > Log: > ddb(4): Add 'show badstacks' command to show witness badstacks >=20 > Add a DDB command that mirrors sysctl debug.witness.badstacks. >=20 > Reported by: rstone > Reviewed by: rstone > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D12468 This broke GENERIC: --- subr_witness.o --- /usr/src/sys/kern/subr_witness.c:2577:4: error: use of undeclared = identifier 'req' req->oldidx =3D 0; ^ /usr/src/sys/kern/subr_witness.c:2603:5: error: use of undeclared = identifier 'req' req->oldidx =3D 0; ^ /usr/src/sys/kern/subr_witness.c:2662:3: error: use of undeclared = identifier 'req' req->oldidx =3D 0; ^ --Apple-Mail=_DFEBFE8C-4907-490A-A181-5A44C0390825 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 iQIcBAEBCgAGBQJZxgIBAAoJEPWDqSZpMIYVticP/2fwhu2KRx2p06b8lq+9A5Qv YEt6HrT39wP6nKmfFwlOkEC6vwIQ9S4MwHgd6DfDzczsoAvxK7A/DPj766tpG2Cb yhKNSiABTGEwatW33qOcbHkHEtOFAQIzcDamY7TNqHJmXPlAJ/5/3ajzoHDTHKit 2opGf8ET8pc8HUYJiyYZ82weUgkiArObNfgb82yBxp06XUMo3fzJ3I69ox98VUnq MqvO1topzlJqHoo7lZ1YF9dv6/xtiYQmj7onU8/wXIBe5t17jO5cZZpxbbK0naXP Cydl64qi6vTRDkRjen+aGPTgz2y6BVWOq/dvSOhKJyXfnNUcYDnXZRVI6r0Pru6o +QXHiqIGLNORvKhpb8bJAbNh96rb6sKhhzJApXzHOMXpSvCypuO3QMe7RWRfxNcS +terQtsmznzV7LQ8xbc73nvbAh416vc/zKBlxY1676QKGj8rtpNTdiJI9j3Niq+6 DqTI/K9eV8y0hAi/cGg3pP+hhgpyD8kI/AOcMkfm2kctWk+6xCyYJEmONTbMOQkf TMQwYhwhexIfg2XpWnpBWj1mi85SJmTdczgF5erLsXFDH70SAJq4nhyud0ssE7HT ee8LKgVbS53KMga8M8et2PzWIPaeQQ+zdXoJdGE9jPeIyQ4+b68Y0hgdpcMSyRhd eb7xipa5LHmFWtJjmuHR =bk7a -----END PGP SIGNATURE----- --Apple-Mail=_DFEBFE8C-4907-490A-A181-5A44C0390825-- From owner-svn-src-head@freebsd.org Sat Sep 23 08:26:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39085E2AAFA; Sat, 23 Sep 2017 08:26:44 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1BCD6C002; Sat, 23 Sep 2017 08:26:43 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8N8QhY2030873; Sat, 23 Sep 2017 08:26:43 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8N8QgBd030871; Sat, 23 Sep 2017 08:26:42 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201709230826.v8N8QgBd030871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sat, 23 Sep 2017 08:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323946 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 323946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 08:26:44 -0000 Author: scottl Date: Sat Sep 23 08:26:42 2017 New Revision: 323946 URL: https://svnweb.freebsd.org/changeset/base/323946 Log: Garbage collect usued fields Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr_sas.h head/sys/dev/mps/mps_sas.h Modified: head/sys/dev/mpr/mpr_sas.h ============================================================================== --- head/sys/dev/mpr/mpr_sas.h Sat Sep 23 06:00:17 2017 (r323945) +++ head/sys/dev/mpr/mpr_sas.h Sat Sep 23 08:26:42 2017 (r323946) @@ -70,9 +70,6 @@ struct mprsas_target { uint16_t parent_handle; uint64_t parent_sasaddr; uint32_t parent_devinfo; - struct sysctl_ctx_list sysctl_ctx; - struct sysctl_oid *sysctl_tree; - TAILQ_ENTRY(mprsas_target) sysctl_link; uint64_t issued; uint64_t completed; unsigned int outstanding; Modified: head/sys/dev/mps/mps_sas.h ============================================================================== --- head/sys/dev/mps/mps_sas.h Sat Sep 23 06:00:17 2017 (r323945) +++ head/sys/dev/mps/mps_sas.h Sat Sep 23 08:26:42 2017 (r323946) @@ -67,9 +67,6 @@ struct mpssas_target { uint16_t parent_handle; uint64_t parent_sasaddr; uint32_t parent_devinfo; - struct sysctl_ctx_list sysctl_ctx; - struct sysctl_oid *sysctl_tree; - TAILQ_ENTRY(mpssas_target) sysctl_link; uint64_t issued; uint64_t completed; unsigned int outstanding; From owner-svn-src-head@freebsd.org Sat Sep 23 08:37:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0019E2AD17; Sat, 23 Sep 2017 08:37:50 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 812DE6C410; Sat, 23 Sep 2017 08:37:49 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 450B425D3891; Sat, 23 Sep 2017 08:37:44 +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 53701D1F928; Sat, 23 Sep 2017 08:37:43 +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 F1m1wvRgmdGk; Sat, 23 Sep 2017 08:37:39 +0000 (UTC) Received: from [192.168.124.1] (fresh-ayiya.sbone.de [IPv6:fde9:577b:c1a9:f001::2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 5A4F5D1F894; Sat, 23 Sep 2017 08:37:38 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Stephen Hurd" Cc: "Stephen Hurd" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323942 - head/sys/net Date: Sat, 23 Sep 2017 08:37:30 +0000 Message-ID: <6F5DC92C-2CF6-4A33-9663-BFECB7DB65F2@lists.zabbadoz.net> In-Reply-To: <283397c7-a01e-3776-7ed3-b64d68003d0b@sasktel.net> References: <201709230135.v8N1ZE6S063264@repo.freebsd.org> <283397c7-a01e-3776-7ed3-b64d68003d0b@sasktel.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailer: MailMate (2.0BETAr6091) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 08:37:50 -0000 On 23 Sep 2017, at 6:32, Stephen Hurd wrote: > Bjoern A. Zeeb wrote: >> On 23 Sep 2017, at 1:35, Stephen Hurd wrote: >> >>> Author: shurd >>> Date: Sat Sep 23 01:35:14 2017 >>> New Revision: 323942 >>> URL: https://svnweb.freebsd.org/changeset/base/323942 >>> >>> Log: >>> Chain mbufs before passing to if_input() >>> >>> Build a list of mbufs to pass to if_input() after LRO. Results in >>> 12% small packet forwarding rate improvement. >> forwarding seems a confusing word here.. > > The test was small (64 byte frames) received on one interface, then > sent out on a different one using the net.inet.ip.forwarding sysctl > (controlled via the gateway_enable setting in rc.conf). Then this makes no sense as we don’t do LRO if forwarding is enabled on the machine; https://svnweb.freebsd.org/base/head/sys/netinet/tcp_lro.c?annotate=317390#l645 From owner-svn-src-head@freebsd.org Sat Sep 23 08:56:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E033E003A4; Sat, 23 Sep 2017 08:56:32 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE0FF6CCAB; Sat, 23 Sep 2017 08:56:31 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm0-x241.google.com with SMTP id x17so3057216wmd.5; Sat, 23 Sep 2017 01:56:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=KC9ka/o/qNA5PFmIC2rGcCZ4Xp1XK65qAyFW+6NWxXk=; b=CGJr2lsWk6q3Qjx9djK4ubIZ76uk6/OQ2RYkpFNSgczhR9qIWre+MZYwdvAMk+FI6F Fnja8N7Ran07TKZoBulIphLZvXYd1XIrYf5vdG6BBsamZE1PZ61LqScDB9efdt865Mm+ mybzbWnBulUU0BpBBobhAsaZ60WCadlR+JC87KGnLmWTxo2Hn+sCmsU5SFjU6I52Q9mg aDS23pnb57ajwlcHF244g19uv/oAqLqOHABzVOu1oUq8BoQxhgwFCAjzvr9FucnNUmB6 lYj7And5u6RdmLKdCLtV2B0v1oGmdogYDdDH+WzHmVYgVfabWCskFFgo0JFveLPUujT8 Bytw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=KC9ka/o/qNA5PFmIC2rGcCZ4Xp1XK65qAyFW+6NWxXk=; b=K4w9DKTlv+n7plhZh4fgMYF8rrAUJzR0+xyCUMBlNEYk5bBL0fdBIiFrLWVbxR9bp4 OaQlvnReIqpCXA17mMItXsQ0S9Bv8yU2GNm++6t0I7WwFWBPnkdYQoJZHhASH3NBY+xv NEzyOf3RmjD4H7JYCyKdQSYXBT467esK0Qee8zwmD/tXDSUHJRn+xnfy6NErpEZZsUYj laNhGNrk1foozYr4iXxBZbwSHqxeLt8jHla1F06GmkQ0g96PVZ4vamUUEdGLiW7xh5WG UivYFL6olrJqDVmL6hjQA7AizNTXgGYxLgkBSveia8nDG5gvuZXq+nFIpCUSplZ5XcD7 y0yw== X-Gm-Message-State: AHPjjUj7/yoacM9knGKwelnfIjAK+N2yjx/SGMyPdrZEuJpV88Bazn00 La08/EllULRLf5zXv7rei7W81g== X-Google-Smtp-Source: AOwi7QA9uyMoV8oQ6WLlRkHDWjgQ1TEvuCFsG2WJjb04dHYVbUhxQP9TpAuxHDuxBYdaO1TmCFqORw== X-Received: by 10.28.94.85 with SMTP id s82mr5222440wmb.13.1506156990246; Sat, 23 Sep 2017 01:56:30 -0700 (PDT) Received: from ernst.home (p4FCA62DB.dip0.t-ipconnect.de. [79.202.98.219]) by smtp.gmail.com with ESMTPSA id h128sm1367046wmf.9.2017.09.23.01.56.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Sep 2017 01:56:29 -0700 (PDT) Date: Sat, 23 Sep 2017 10:56:28 +0200 From: Gary Jennejohn To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323945 - head/sys/contrib/ipfilter/netinet Message-ID: <20170923105628.739240b5@ernst.home> In-Reply-To: <201709230600.v8N60HFw070501@repo.freebsd.org> References: <201709230600.v8N60HFw070501@repo.freebsd.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 08:56:32 -0000 On Sat, 23 Sep 2017 06:00:17 +0000 (UTC) Cy Schubert wrote: > Author: cy > Date: Sat Sep 23 06:00:17 2017 > New Revision: 323945 > URL: https://svnweb.freebsd.org/changeset/base/323945 > > Log: > Correct two misspellings. Also align */. > > Modified: > head/sys/contrib/ipfilter/netinet/ip_nat.c > > Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c > ============================================================================== > --- head/sys/contrib/ipfilter/netinet/ip_nat.c Sat Sep 23 01:39:16 2017 (r323944) > +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Sat Sep 23 06:00:17 2017 (r323945) > @@ -6093,8 +6093,8 @@ ipf_nat_icmpquerytype(icmptype) > { > case ICMP_ECHOREPLY: > case ICMP_ECHO: > - /* route aedvertisement/solliciation is currently unsupported: */ > - /* it would require rewriting the ICMP data section */ > + /* route advertisement/soliciation is currently unsupported: */ ^^^^^^^^^ still wrong - should be solicitation. > + /* it would require rewriting the ICMP data section */ > case ICMP_TSTAMP: > case ICMP_TSTAMPREPLY: > case ICMP_IREQ: > -- Gary Jennejohn From owner-svn-src-head@freebsd.org Sat Sep 23 12:35:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E88C7E048F6; Sat, 23 Sep 2017 12:35:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C43E272121; Sat, 23 Sep 2017 12:35:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8NCZkof033208; Sat, 23 Sep 2017 12:35:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8NCZkKA033207; Sat, 23 Sep 2017 12:35:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201709231235.v8NCZkKA033207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 23 Sep 2017 12:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323951 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 323951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 12:35:48 -0000 Author: emaste Date: Sat Sep 23 12:35:46 2017 New Revision: 323951 URL: https://svnweb.freebsd.org/changeset/base/323951 Log: Revert r323935 as it broke the build subr_witness.c:2577:4: error: use of undeclared identifier 'req' req->oldidx = 0; ^ Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Sat Sep 23 12:32:11 2017 (r323950) +++ head/sys/kern/subr_witness.c Sat Sep 23 12:35:46 2017 (r323951) @@ -2539,18 +2539,31 @@ DB_SHOW_COMMAND(witness, db_witness_display) } #endif -static void -sbuf_print_witness_badstacks(struct sbuf *sb) +static int +sysctl_debug_witness_badstacks(SYSCTL_HANDLER_ARGS) { struct witness_lock_order_data *data1, *data2, *tmp_data1, *tmp_data2; struct witness *tmp_w1, *tmp_w2, *w1, *w2; + struct sbuf *sb; u_int w_rmatrix1, w_rmatrix2; - int generation, i, j; + int error, generation, i, j; tmp_data1 = NULL; tmp_data2 = NULL; tmp_w1 = NULL; tmp_w2 = NULL; + if (witness_watch < 1) { + error = SYSCTL_OUT(req, w_notrunning, sizeof(w_notrunning)); + return (error); + } + if (witness_cold) { + error = SYSCTL_OUT(req, w_stillcold, sizeof(w_stillcold)); + return (error); + } + error = 0; + sb = sbuf_new(NULL, NULL, badstack_sbuf_size, SBUF_AUTOEXTEND); + if (sb == NULL) + return (ENOMEM); /* Allocate and init temporary storage space. */ tmp_w1 = malloc(sizeof(struct witness), M_TEMP, M_WAITOK | M_ZERO); @@ -2670,55 +2683,13 @@ restart: free(tmp_data2, M_TEMP); free(tmp_w1, M_TEMP); free(tmp_w2, M_TEMP); -} -static int -sysctl_debug_witness_badstacks(SYSCTL_HANDLER_ARGS) -{ - struct sbuf *sb; - int error; - - if (witness_watch < 1) { - error = SYSCTL_OUT(req, w_notrunning, sizeof(w_notrunning)); - return (error); - } - if (witness_cold) { - error = SYSCTL_OUT(req, w_stillcold, sizeof(w_stillcold)); - return (error); - } - error = 0; - sb = sbuf_new(NULL, NULL, badstack_sbuf_size, SBUF_AUTOEXTEND); - if (sb == NULL) - return (ENOMEM); - - sbuf_print_witness_badstacks(sb); - sbuf_finish(sb); error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); return (error); } - -#ifdef DDB -static int -sbuf_db_printf_drain(void *arg __unused, const char *data, int len) -{ - - return (db_printf("%.*s", len, data)); -} - -DB_SHOW_COMMAND(badstacks, db_witness_badstacks) -{ - struct sbuf sb; - char buffer[128]; - - sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN); - sbuf_set_drain(&sb, sbuf_db_printf_drain, NULL); - sbuf_print_witness_badstacks(&sb); - sbuf_finish(&sb); -} -#endif static int sysctl_debug_witness_channel(SYSCTL_HANDLER_ARGS) From owner-svn-src-head@freebsd.org Sat Sep 23 12:44:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CE16E04B8E; Sat, 23 Sep 2017 12:44:43 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 394F1725DA; Sat, 23 Sep 2017 12:44:43 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8NCig33037356; Sat, 23 Sep 2017 12:44:42 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8NCig1O037355; Sat, 23 Sep 2017 12:44:42 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201709231244.v8NCig1O037355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 23 Sep 2017 12:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323952 - head/sys/boot/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/boot/i386/libi386 X-SVN-Commit-Revision: 323952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 12:44:43 -0000 Author: oshogbo Date: Sat Sep 23 12:44:42 2017 New Revision: 323952 URL: https://svnweb.freebsd.org/changeset/base/323952 Log: After the r317886 support for TFTP and NFS can be enable simultaneously. The cleanup of this distinction was done in the r318988, but this Makefile was omitted. Submitted by: kczekirda@ Modified: head/sys/boot/i386/libi386/Makefile Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Sat Sep 23 12:35:46 2017 (r323951) +++ head/sys/boot/i386/libi386/Makefile Sat Sep 23 12:44:42 2017 (r323952) @@ -12,10 +12,10 @@ SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp .PATH: ${.CURDIR}/../../zfs SRCS+= devicename_stubs.c -# Enable PXE TFTP or NFS support, not both. .if defined(LOADER_TFTP_SUPPORT) CFLAGS+= -DLOADER_TFTP_SUPPORT -.else +.endif +.if defined(LOADER_NFS_SUPPORT) CFLAGS+= -DLOADER_NFS_SUPPORT .endif From owner-svn-src-head@freebsd.org Sat Sep 23 15:53:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF195E08147; Sat, 23 Sep 2017 15:53:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.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 B225477434; Sat, 23 Sep 2017 15:53:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id EF16110A82D; Sat, 23 Sep 2017 11:53:53 -0400 (EDT) From: John Baldwin To: Mariusz Zaborski Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323952 - head/sys/boot/i386/libi386 Date: Sat, 23 Sep 2017 08:50:48 -0700 Message-ID: <32112779.upWhmOh2nn@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201709231244.v8NCig1O037355@repo.freebsd.org> References: <201709231244.v8NCig1O037355@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Sat, 23 Sep 2017 11:53:54 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 15:53:56 -0000 On Saturday, September 23, 2017 12:44:42 PM Mariusz Zaborski wrote: > Author: oshogbo > Date: Sat Sep 23 12:44:42 2017 > New Revision: 323952 > URL: https://svnweb.freebsd.org/changeset/base/323952 > > Log: > After the r317886 support for TFTP and NFS can be enable simultaneously. > > The cleanup of this distinction was done in the r318988, but this Makefile > was omitted. > > Submitted by: kczekirda@ > > Modified: > head/sys/boot/i386/libi386/Makefile > > Modified: head/sys/boot/i386/libi386/Makefile > ============================================================================== > --- head/sys/boot/i386/libi386/Makefile Sat Sep 23 12:35:46 2017 (r323951) > +++ head/sys/boot/i386/libi386/Makefile Sat Sep 23 12:44:42 2017 (r323952) > @@ -12,10 +12,10 @@ SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp > .PATH: ${.CURDIR}/../../zfs > SRCS+= devicename_stubs.c > > -# Enable PXE TFTP or NFS support, not both. > .if defined(LOADER_TFTP_SUPPORT) > CFLAGS+= -DLOADER_TFTP_SUPPORT > -.else > +.endif > +.if defined(LOADER_NFS_SUPPORT) > CFLAGS+= -DLOADER_NFS_SUPPORT > .endif Is LOADER_NFS_SUPPORT defined by default? If not, I think you just turned off NFS in the default loader. One option would be to add a new 'LOADER_NO_NFS_SUPPORT' and include NFS unless that is defined. We could also just always include NFS support. Finally, if we want to retain the ability to choose loader bits, these should probably change to real src options: WITH/WITHOUT_LOADER_TFTP_SUPPORT and WITH/WITHOUT_LOADER_NFS_SUPPORT and have this Makefile check MK_LOADER_TFTP/NFS_SUPPORT. Then we could choose defaults in src.opts.mk. -- John Baldwin From owner-svn-src-head@freebsd.org Sat Sep 23 16:46:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40706E09126; Sat, 23 Sep 2017 16:46:32 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A41A7C9D6; Sat, 23 Sep 2017 16:46:32 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8NGkVHv040627; Sat, 23 Sep 2017 16:46:31 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8NGkVk5040625; Sat, 23 Sep 2017 16:46:31 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201709231646.v8NGkVk5040625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Sat, 23 Sep 2017 16:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323954 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 323954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 16:46:32 -0000 Author: shurd Date: Sat Sep 23 16:46:30 2017 New Revision: 323954 URL: https://svnweb.freebsd.org/changeset/base/323954 Log: Have ifmp_ring_enqueue() abdicate instead of switch to a consumer Move TX out of the enqueue() path. As a result, we need to have ifmp_ring_check_drainage() pick up from the abdicate state. We also need to either enqueue the TX task, or check drainage after calling ifmp_ring_enqueue() to ensure it's sent. This change results in a 30% small packet forwarding improvement. Reviewed by: olivier, sbruno Approved by: sbruno (mentor) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12439 Modified: head/sys/net/iflib.c head/sys/net/mp_ring.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Sat Sep 23 13:37:02 2017 (r323953) +++ head/sys/net/iflib.c Sat Sep 23 16:46:30 2017 (r323954) @@ -3515,8 +3515,7 @@ _task_fn_tx(void *context) } if (txq->ift_db_pending) ifmp_ring_enqueue(txq->ift_br, (void **)&txq, 1, TX_BATCH_SIZE); - else - ifmp_ring_check_drainage(txq->ift_br, TX_BATCH_SIZE); + ifmp_ring_check_drainage(txq->ift_br, TX_BATCH_SIZE); if (ctx->ifc_flags & IFC_LEGACY) IFDI_INTR_ENABLE(ctx); else { @@ -3718,16 +3717,14 @@ iflib_if_transmit(if_t ifp, struct mbuf *m) DBG_COUNTER_INC(tx_seen); err = ifmp_ring_enqueue(txq->ift_br, (void **)&m, 1, TX_BATCH_SIZE); + GROUPTASK_ENQUEUE(&txq->ift_task); if (err) { - GROUPTASK_ENQUEUE(&txq->ift_task); /* support forthcoming later */ #ifdef DRIVER_BACKPRESSURE txq->ift_closed = TRUE; #endif ifmp_ring_check_drainage(txq->ift_br, TX_BATCH_SIZE); m_freem(m); - } else if (TXQ_AVAIL(txq) < (txq->ift_size >> 1)) { - GROUPTASK_ENQUEUE(&txq->ift_task); } return (err); Modified: head/sys/net/mp_ring.c ============================================================================== --- head/sys/net/mp_ring.c Sat Sep 23 13:37:02 2017 (r323953) +++ head/sys/net/mp_ring.c Sat Sep 23 16:46:30 2017 (r323954) @@ -454,18 +454,12 @@ ifmp_ring_enqueue(struct ifmp_ring *r, void **items, i do { os.state = ns.state = r->state; ns.pidx_tail = pidx_stop; - ns.flags = BUSY; + if (os.flags == IDLE) + ns.flags = ABDICATED; } while (atomic_cmpset_rel_64(&r->state, os.state, ns.state) == 0); critical_exit(); counter_u64_add(r->enqueues, n); - /* - * Turn into a consumer if some other thread isn't active as a consumer - * already. - */ - if (os.flags != BUSY) - drain_ring_lockless(r, ns, os.flags, budget); - return (0); } #endif @@ -476,7 +470,9 @@ ifmp_ring_check_drainage(struct ifmp_ring *r, int budg union ring_state os, ns; os.state = r->state; - if (os.flags != STALLED || os.pidx_head != os.pidx_tail || r->can_drain(r) == 0) + if ((os.flags != STALLED && os.flags != ABDICATED) || // Only continue in STALLED and ABDICATED + os.pidx_head != os.pidx_tail || // Require work to be available + (os.flags != ABDICATED && r->can_drain(r) == 0)) // Can either drain, or everyone left return; MPASS(os.cidx != os.pidx_tail); /* implied by STALLED */ From owner-svn-src-head@freebsd.org Sat Sep 23 16:48:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 760EEE091D3; Sat, 23 Sep 2017 16:48:52 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A9857CB50; Sat, 23 Sep 2017 16:48:51 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id vnbkd3iNfDJTWvnbldTTTs; Sat, 23 Sep 2017 10:48:49 -0600 X-Authority-Analysis: v=2.2 cv=B4DJ6KlM c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=2JCJgTwv5E4A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=9OrMMSz_Y9faLxoPUMAA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id C8D1411F5; Sat, 23 Sep 2017 09:48:47 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v8NGmlBJ019577; Sat, 23 Sep 2017 09:48:47 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201709231648.v8NGmlBJ019577@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: gljennjohn@gmail.com cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323945 - head/sys/contrib/ipfilter/netinet In-Reply-To: Message from Gary Jennejohn of "Sat, 23 Sep 2017 10:56:28 +0200." <20170923105628.739240b5@ernst.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 23 Sep 2017 09:48:47 -0700 X-CMAE-Envelope: MS4wfFbH/2fbMO0YO3HwU+bKjbltFsOy8dqU71Wfkzmcu551foIGdDjh/3Nz9s8dzyM3zaoHxIOgYVL51/V0kKTS1mic1i2yzT/KkKmvJ1XPpO62fpBS+7UU QIuNCDNUsMJGO6io4ne6pdu2HTrgdCzuVmaWKkjU/KBTVxjexxV2i0iEourCwkxH9N99M/TvpoPOXnghJlF7SyOCVskau8/7oeAvjt5wESZSD0k+E5f9E5rD /WFIgAMxQXjmDNm6505lbHCLFIclTqNxDnIK6u2xwUm/m3+xEtDyYjyZNqazQ9TnwkdpqTZDtxNhfQyGCHQ0jw== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 16:48:52 -0000 In message <20170923105628.739240b5@ernst.home>, Gary Jennejohn writes: > On Sat, 23 Sep 2017 06:00:17 +0000 (UTC) > Cy Schubert wrote: > > > Author: cy > > Date: Sat Sep 23 06:00:17 2017 > > New Revision: 323945 > > URL: https://svnweb.freebsd.org/changeset/base/323945 > > > > Log: > > Correct two misspellings. Also align */. > > > > Modified: > > head/sys/contrib/ipfilter/netinet/ip_nat.c > > > > Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c > > =========================================================================== > === > > --- head/sys/contrib/ipfilter/netinet/ip_nat.c Sat Sep 23 01:39:16 201 > 7 (r323944) > > +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Sat Sep 23 06:00:17 201 > 7 (r323945) > > @@ -6093,8 +6093,8 @@ ipf_nat_icmpquerytype(icmptype) > > { > > case ICMP_ECHOREPLY: > > case ICMP_ECHO: > > - /* route aedvertisement/solliciation is currently unsupported: */ > > - /* it would require rewriting the ICMP data section */ > > + /* route advertisement/soliciation is currently unsupported: */ > ^^^^^^^^^ still wrong - should b > e solicitation. pfft. Silly me. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Sep 23 16:59:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68B87E094C4; Sat, 23 Sep 2017 16:59:39 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 448757CF7B; Sat, 23 Sep 2017 16:59:39 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8NGxcAU044869; Sat, 23 Sep 2017 16:59:38 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8NGxbo0044863; Sat, 23 Sep 2017 16:59:37 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201709231659.v8NGxbo0044863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Sat, 23 Sep 2017 16:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323955 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 323955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 16:59:39 -0000 Author: shurd Date: Sat Sep 23 16:59:37 2017 New Revision: 323955 URL: https://svnweb.freebsd.org/changeset/base/323955 Log: bnxt: Choose better HW LRO defaults for performance 1) Choose correct Firmware options for HW LRO for best performance 2) Delete TBD and other comments which are not required. 3) Added sysctl interface to enable / disable / modify different factors of HW LRO. 4) Disabled HW LRO by default to avoid issues with packet forwarding This allows much better control over the LRO configuration via sysctls, and uses much better defaults. Hardware LRO can now be enabled/disabled independantly from the software LRO, and the tuning parameters are exposed. manpage updates coming soon. Submitted by: Bhargava Chenna Marreddy Reviewed by: shurd, sbruno Approved by: sbruno (mentor) Sponsored by: Broadcom Limited Differential Revision: https://reviews.freebsd.org/D12223 Modified: head/sys/dev/bnxt/bnxt.h head/sys/dev/bnxt/bnxt_hwrm.c head/sys/dev/bnxt/bnxt_hwrm.h head/sys/dev/bnxt/bnxt_sysctl.c head/sys/dev/bnxt/bnxt_sysctl.h head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/bnxt.h ============================================================================== --- head/sys/dev/bnxt/bnxt.h Sat Sep 23 16:46:30 2017 (r323954) +++ head/sys/dev/bnxt/bnxt.h Sat Sep 23 16:59:37 2017 (r323955) @@ -526,6 +526,14 @@ struct bnxt_func_qcfg { uint16_t alloc_vnics; }; +struct bnxt_hw_lro { + uint16_t enable; + uint16_t is_mode_gro; + uint16_t max_agg_segs; + uint16_t max_aggs; + uint32_t min_agg_len; +}; + struct bnxt_softc { device_t dev; if_ctx_t ctx; @@ -586,10 +594,13 @@ struct bnxt_softc { struct sysctl_ctx_list hw_stats; struct sysctl_oid *hw_stats_oid; + struct sysctl_ctx_list hw_lro_ctx; + struct sysctl_oid *hw_lro_oid; struct bnxt_ver_info *ver_info; struct bnxt_nvram_info *nvm_info; bool wol; + struct bnxt_hw_lro hw_lro; uint8_t wol_filter_id; uint16_t rx_coal_usecs; uint16_t rx_coal_usecs_irq; Modified: head/sys/dev/bnxt/bnxt_hwrm.c ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.c Sat Sep 23 16:46:30 2017 (r323954) +++ head/sys/dev/bnxt/bnxt_hwrm.c Sat Sep 23 16:59:37 2017 (r323955) @@ -977,29 +977,53 @@ bnxt_cfg_async_cr(struct bnxt_softc *softc) return rc; } +void +bnxt_validate_hw_lro_settings(struct bnxt_softc *softc) +{ + softc->hw_lro.enable = min(softc->hw_lro.enable, 1); + + softc->hw_lro.is_mode_gro = min(softc->hw_lro.is_mode_gro, 1); + + softc->hw_lro.max_agg_segs = min(softc->hw_lro.max_agg_segs, + HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX); + + softc->hw_lro.max_aggs = min(softc->hw_lro.max_aggs, + HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX); + + softc->hw_lro.min_agg_len = min(softc->hw_lro.min_agg_len, BNXT_MAX_MTU); +} + int -bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, - uint32_t flags) +bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc) { struct hwrm_vnic_tpa_cfg_input req = {0}; + uint32_t flags; bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_TPA_CFG); - req.flags = htole32(flags); - req.vnic_id = htole16(vnic->id); - req.enables = htole32(HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS | - HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS | - /* HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER | */ - HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN); - /* TODO: Calculate this based on ring size? */ - req.max_agg_segs = htole16(3); - /* Base this in the allocated TPA start size... */ - req.max_aggs = htole16(7); - /* - * TODO: max_agg_timer? - * req.mag_agg_timer = htole32(XXX); - */ - req.min_agg_len = htole32(0); + if (softc->hw_lro.enable) { + flags = HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA | + HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA | + HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN | + HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ; + + if (softc->hw_lro.is_mode_gro) + flags |= HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO; + else + flags |= HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE; + + req.flags = htole32(flags); + + req.enables = htole32(HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS | + HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS | + HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN); + + req.max_agg_segs = htole16(softc->hw_lro.max_agg_segs); + req.max_aggs = htole16(softc->hw_lro.max_aggs); + req.min_agg_len = htole32(softc->hw_lro.min_agg_len); + } + + req.vnic_id = htole16(softc->vnic_info.id); return hwrm_send_message(softc, &req, sizeof(req)); } Modified: head/sys/dev/bnxt/bnxt_hwrm.h ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.h Sat Sep 23 16:46:30 2017 (r323954) +++ head/sys/dev/bnxt/bnxt_hwrm.h Sat Sep 23 16:59:37 2017 (r323955) @@ -62,8 +62,8 @@ int bnxt_hwrm_set_filter(struct bnxt_softc *softc, str int bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, uint32_t hash_type); int bnxt_cfg_async_cr(struct bnxt_softc *softc); -int bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc, - struct bnxt_vnic_info *vnic, uint32_t flags); +int bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc); +void bnxt_validate_hw_lro_settings(struct bnxt_softc *softc); int bnxt_hwrm_nvm_find_dir_entry(struct bnxt_softc *softc, uint16_t type, uint16_t *ordinal, uint16_t ext, uint16_t *index, bool use_index, uint8_t search_opt, uint32_t *data_length, uint32_t *item_length, Modified: head/sys/dev/bnxt/bnxt_sysctl.c ============================================================================== --- head/sys/dev/bnxt/bnxt_sysctl.c Sat Sep 23 16:46:30 2017 (r323954) +++ head/sys/dev/bnxt/bnxt_sysctl.c Sat Sep 23 16:59:37 2017 (r323955) @@ -84,6 +84,16 @@ bnxt_init_sysctl_ctx(struct bnxt_softc *softc) return ENOMEM; } + sysctl_ctx_init(&softc->hw_lro_ctx); + ctx = device_get_sysctl_ctx(softc->dev); + softc->hw_lro_oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)), OID_AUTO, + "hw_lro", CTLFLAG_RD, 0, "hardware lro"); + if (!softc->hw_lro_oid) { + sysctl_ctx_free(&softc->hw_lro_ctx); + return ENOMEM; + } + return 0; } @@ -114,6 +124,13 @@ bnxt_free_sysctl_ctx(struct bnxt_softc *softc) else softc->nvm_info->nvm_oid = NULL; } + if (softc->hw_lro_oid != NULL) { + orc = sysctl_ctx_free(&softc->hw_lro_ctx); + if (orc) + rc = orc; + else + softc->hw_lro_oid = NULL; + } return rc; } @@ -1210,6 +1227,74 @@ bnxt_create_config_sysctls_pre(struct bnxt_softc *soft return 0; } +#define BNXT_HW_LRO_FN(fn_name, arg) \ +static int \ +fn_name(SYSCTL_HANDLER_ARGS) { \ + struct bnxt_softc *softc = arg1; \ + int rc; \ + int val; \ + \ + if (softc == NULL) \ + return EBUSY; \ + \ + val = softc->hw_lro.arg; \ + rc = sysctl_handle_int(oidp, &val, 0, req); \ + if (rc || !req->newptr) \ + return rc; \ + \ + if ((if_getdrvflags(iflib_get_ifp(softc->ctx)) & IFF_DRV_RUNNING)) \ + return EBUSY; \ + \ + softc->hw_lro.arg = val; \ + bnxt_validate_hw_lro_settings(softc); \ + rc = bnxt_hwrm_vnic_tpa_cfg(softc); \ + \ + return rc; \ +} + +BNXT_HW_LRO_FN(bnxt_hw_lro_enable_disable, enable) +BNXT_HW_LRO_FN(bnxt_hw_lro_set_mode, is_mode_gro) +BNXT_HW_LRO_FN(bnxt_hw_lro_set_max_agg_segs, max_agg_segs) +BNXT_HW_LRO_FN(bnxt_hw_lro_set_max_aggs, max_aggs) +BNXT_HW_LRO_FN(bnxt_hw_lro_set_min_agg_len, min_agg_len) + +int +bnxt_create_hw_lro_sysctls(struct bnxt_softc *softc) +{ + struct sysctl_oid *oid = softc->hw_lro_oid; + + if (!oid) + return ENOMEM; + + SYSCTL_ADD_PROC(&softc->hw_lro_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "enable", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, + bnxt_hw_lro_enable_disable, "A", + "Enable or Disable HW LRO: 0 / 1"); + + SYSCTL_ADD_PROC(&softc->hw_lro_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "gro_mode", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, + bnxt_hw_lro_set_mode, "A", + "Set mode: 1 = GRO mode, 0 = RSC mode"); + + SYSCTL_ADD_PROC(&softc->hw_lro_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "max_agg_segs", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, + bnxt_hw_lro_set_max_agg_segs, "A", + "Set Max Agg Seg Value (unit is Log2): " + "0 (= 1 seg) / 1 (= 2 segs) / ... / 31 (= 2^31 segs)"); + + SYSCTL_ADD_PROC(&softc->hw_lro_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "max_aggs", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, + bnxt_hw_lro_set_max_aggs, "A", + "Set Max Aggs Value (unit is Log2): " + "0 (= 1 agg) / 1 (= 2 aggs) / ... / 7 (= 2^7 segs)"); + + SYSCTL_ADD_PROC(&softc->hw_lro_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "min_agg_len", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, + bnxt_hw_lro_set_min_agg_len, "A", + "Min Agg Len: 1 to 9000"); + + return 0; +} static int bnxt_vlan_only_sysctl(SYSCTL_HANDLER_ARGS) { struct bnxt_softc *softc = arg1; Modified: head/sys/dev/bnxt/bnxt_sysctl.h ============================================================================== --- head/sys/dev/bnxt/bnxt_sysctl.h Sat Sep 23 16:46:30 2017 (r323954) +++ head/sys/dev/bnxt/bnxt_sysctl.h Sat Sep 23 16:59:37 2017 (r323955) @@ -40,3 +40,4 @@ int bnxt_create_ver_sysctls(struct bnxt_softc *softc); int bnxt_create_nvram_sysctls(struct bnxt_nvram_info *ni); int bnxt_create_config_sysctls_pre(struct bnxt_softc *softc); int bnxt_create_config_sysctls_post(struct bnxt_softc *softc); +int bnxt_create_hw_lro_sysctls(struct bnxt_softc *softc); Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Sat Sep 23 16:46:30 2017 (r323954) +++ head/sys/dev/bnxt/if_bnxt.c Sat Sep 23 16:59:37 2017 (r323955) @@ -826,6 +826,17 @@ bnxt_attach_pre(if_ctx_t ctx) /* iflib will map and release this bar */ scctx->isc_msix_bar = pci_msix_table_bar(softc->dev); + /* + * Default settings for HW LRO (TPA): + * Disable HW LRO by default + * Can be enabled after taking care of 'packet forwarding' + */ + softc->hw_lro.enable = 0; + softc->hw_lro.is_mode_gro = 0; + softc->hw_lro.max_agg_segs = 5; /* 2^5 = 32 segs */ + softc->hw_lro.max_aggs = HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX; + softc->hw_lro.min_agg_len = 512; + /* Allocate the default completion ring */ softc->def_cp_ring.stats_ctx_id = HWRM_NA_SIGNATURE; softc->def_cp_ring.ring.phys_id = (uint16_t)HWRM_NA_SIGNATURE; @@ -861,6 +872,10 @@ bnxt_attach_pre(if_ctx_t ctx) if (rc) goto failed; + rc = bnxt_create_hw_lro_sysctls(softc); + if (rc) + goto failed; + /* Initialize the vlan list */ SLIST_INIT(&softc->vnic_info.vlan_tags); softc->vnic_info.vlan_tag_list.idi_vaddr = NULL; @@ -1071,15 +1086,7 @@ bnxt_init(if_ctx_t ctx) if (rc) goto fail; - /* - * Enable LRO/TPA/GRO - * TBD: - * Enable / Disable HW_LRO based on - * ifconfig lro / ifconfig -lro setting - */ - rc = bnxt_hwrm_vnic_tpa_cfg(softc, &softc->vnic_info, - (if_getcapenable(iflib_get_ifp(ctx)) & IFCAP_LRO) ? - HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA : 0); + rc = bnxt_hwrm_vnic_tpa_cfg(softc); if (rc) goto fail; From owner-svn-src-head@freebsd.org Sat Sep 23 17:48:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E492E0A368; Sat, 23 Sep 2017 17:48:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74F297DF93; Sat, 23 Sep 2017 17:48:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8NHmnfm066052; Sat, 23 Sep 2017 17:48:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8NHmnWh066051; Sat, 23 Sep 2017 17:48:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709231748.v8NHmnWh066051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 23 Sep 2017 17:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323956 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 323956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 17:48:50 -0000 Author: cem Date: Sat Sep 23 17:48:49 2017 New Revision: 323956 URL: https://svnweb.freebsd.org/changeset/base/323956 Log: ddb(4): Add 'show badstacks' command to show witness badstacks Add a DDB command that mirrors sysctl debug.witness.badstacks. Reapply r323935 after fixing trivial deficiency. I forgot to compile with WITNESS enabled. Thanks emaste@ for fixing the build while I was asleep. Reported by: rstone Reviewed by: rstone (previous version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12468 Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Sat Sep 23 16:59:37 2017 (r323955) +++ head/sys/kern/subr_witness.c Sat Sep 23 17:48:49 2017 (r323956) @@ -2539,31 +2539,18 @@ DB_SHOW_COMMAND(witness, db_witness_display) } #endif -static int -sysctl_debug_witness_badstacks(SYSCTL_HANDLER_ARGS) +static void +sbuf_print_witness_badstacks(struct sbuf *sb, size_t *oldidx) { struct witness_lock_order_data *data1, *data2, *tmp_data1, *tmp_data2; struct witness *tmp_w1, *tmp_w2, *w1, *w2; - struct sbuf *sb; u_int w_rmatrix1, w_rmatrix2; - int error, generation, i, j; + int generation, i, j; tmp_data1 = NULL; tmp_data2 = NULL; tmp_w1 = NULL; tmp_w2 = NULL; - if (witness_watch < 1) { - error = SYSCTL_OUT(req, w_notrunning, sizeof(w_notrunning)); - return (error); - } - if (witness_cold) { - error = SYSCTL_OUT(req, w_stillcold, sizeof(w_stillcold)); - return (error); - } - error = 0; - sb = sbuf_new(NULL, NULL, badstack_sbuf_size, SBUF_AUTOEXTEND); - if (sb == NULL) - return (ENOMEM); /* Allocate and init temporary storage space. */ tmp_w1 = malloc(sizeof(struct witness), M_TEMP, M_WAITOK | M_ZERO); @@ -2587,7 +2574,7 @@ restart: mtx_unlock_spin(&w_mtx); /* The graph has changed, try again. */ - req->oldidx = 0; + *oldidx = 0; sbuf_clear(sb); goto restart; } @@ -2613,7 +2600,7 @@ restart: mtx_unlock_spin(&w_mtx); /* The graph has changed, try again. */ - req->oldidx = 0; + *oldidx = 0; sbuf_clear(sb); goto restart; } @@ -2672,7 +2659,7 @@ restart: * The graph changed while we were printing stack data, * try again. */ - req->oldidx = 0; + *oldidx = 0; sbuf_clear(sb); goto restart; } @@ -2683,13 +2670,56 @@ restart: free(tmp_data2, M_TEMP); free(tmp_w1, M_TEMP); free(tmp_w2, M_TEMP); +} +static int +sysctl_debug_witness_badstacks(SYSCTL_HANDLER_ARGS) +{ + struct sbuf *sb; + int error; + + if (witness_watch < 1) { + error = SYSCTL_OUT(req, w_notrunning, sizeof(w_notrunning)); + return (error); + } + if (witness_cold) { + error = SYSCTL_OUT(req, w_stillcold, sizeof(w_stillcold)); + return (error); + } + error = 0; + sb = sbuf_new(NULL, NULL, badstack_sbuf_size, SBUF_AUTOEXTEND); + if (sb == NULL) + return (ENOMEM); + + sbuf_print_witness_badstacks(sb, &req->oldidx); + sbuf_finish(sb); error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); return (error); } + +#ifdef DDB +static int +sbuf_db_printf_drain(void *arg __unused, const char *data, int len) +{ + + return (db_printf("%.*s", len, data)); +} + +DB_SHOW_COMMAND(badstacks, db_witness_badstacks) +{ + struct sbuf sb; + char buffer[128]; + size_t dummy; + + sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN); + sbuf_set_drain(&sb, sbuf_db_printf_drain, NULL); + sbuf_print_witness_badstacks(&sb, &dummy); + sbuf_finish(&sb); +} +#endif static int sysctl_debug_witness_channel(SYSCTL_HANDLER_ARGS) From owner-svn-src-head@freebsd.org Sat Sep 23 18:34:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B676CE0C5F9 for ; Sat, 23 Sep 2017 18:34:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::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 885267F4DE for ; Sat, 23 Sep 2017 18:34:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id d192so3933156itd.1 for ; Sat, 23 Sep 2017 11:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=I2Q/roWrPFiXnlCP7Z7wmK2HG8AW07pZOS44e9Qtjn4=; b=T3W4zhuPm53hxXSpjwMWepP/fzIHWkRUi9Jwih1Y1eo8RemCceYFTUdMznDbSmr0A6 i1vHw+PcSzELIlDxv+vnV4RWf8qN45zyRfQkN+m1ksIOfhFOduGI9GI/vjaK+0E3GzaC R+/VXH8NB7zWIJgw+SwfEKfztxPfAJ9r4hrS3Hc6JH9IzWFquooVss+Q3b3JPqGoZoQ6 uy9xSH/tU6AGkJN4QCQsCNqOay5M8qyFBJdvzWgJmVSmvfM0/QF1ulbsbGROsegZr1/9 Ieic5kJIb4lPolDBcjw6fbci6wsM2e372ZSjkwawaxpkdYL11xSeogfZb3T5jYrch3Ac Fa6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=I2Q/roWrPFiXnlCP7Z7wmK2HG8AW07pZOS44e9Qtjn4=; b=fUXlwyPs/LfHyk7BCGy80AxqhQhZVyfqstSjn172DnASgNNFb7cc+N+5ml+ofZ/8QT G5eOsgU7gF4CwE/e83qzjumD5dHU25gtqTRwKcsr8c+4EEuE9G85Ae2WfEq57Y540JqJ lxghJX6Crxl80ZDIkSIMzuf/q6pbC1Mzji002RB3r3saKN27SIq8UELJJYvwjC2oDEaz HW7ydiVEpzHUfHVPtJeirrg6b+kcfTDe6WUYrfh1j8dZsplo9JEYcfmJNJqgTKtExCwm eP5ErPTVnltOiyor+qtQBnKLdswevpMgaNjvCTvZxMzXRMa5yy3dOA+JPT2T4uQmA+NG IgSg== X-Gm-Message-State: AHPjjUjFkWx3ti+AevqYSWngUu+v4L+PD7bglwjJXNc/Ppvy/bSmacVw 40/ulye4ZuynQcvucdyMM3Hon53dicgmgO5oFT9Qnw== X-Google-Smtp-Source: AOwi7QAIAHSFRp2myi4V7lxi9ufm3zyZs+VEyx6HMk2cgg7QoUm2MotoDA0fkyaqISJyLhKZijmAY0nzloNKIBamx1Y= X-Received: by 10.36.6.18 with SMTP id 18mr13003373itv.15.1506191671801; Sat, 23 Sep 2017 11:34:31 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.2.194 with HTTP; Sat, 23 Sep 2017 11:34:31 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:b191:5184:17d7:e002] In-Reply-To: <32112779.upWhmOh2nn@ralph.baldwin.cx> References: <201709231244.v8NCig1O037355@repo.freebsd.org> <32112779.upWhmOh2nn@ralph.baldwin.cx> From: Warner Losh Date: Sat, 23 Sep 2017 12:34:31 -0600 X-Google-Sender-Auth: OV9W-5fINmF3MVh58SkZB3AJtjs Message-ID: Subject: Re: svn commit: r323952 - head/sys/boot/i386/libi386 To: John Baldwin Cc: Mariusz Zaborski , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 18:34:32 -0000 On Sat, Sep 23, 2017 at 9:50 AM, John Baldwin wrote: > On Saturday, September 23, 2017 12:44:42 PM Mariusz Zaborski wrote: > > Author: oshogbo > > Date: Sat Sep 23 12:44:42 2017 > > New Revision: 323952 > > URL: https://svnweb.freebsd.org/changeset/base/323952 > > > > Log: > > After the r317886 support for TFTP and NFS can be enable > simultaneously. > > > > The cleanup of this distinction was done in the r318988, but this > Makefile > > was omitted. > > > > Submitted by: kczekirda@ > > > > Modified: > > head/sys/boot/i386/libi386/Makefile > > > > Modified: head/sys/boot/i386/libi386/Makefile > > ============================================================ > ================== > > --- head/sys/boot/i386/libi386/Makefile Sat Sep 23 12:35:46 2017 > (r323951) > > +++ head/sys/boot/i386/libi386/Makefile Sat Sep 23 12:44:42 2017 > (r323952) > > @@ -12,10 +12,10 @@ SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c > biospnp > > .PATH: ${.CURDIR}/../../zfs > > SRCS+= devicename_stubs.c > > > > -# Enable PXE TFTP or NFS support, not both. > > .if defined(LOADER_TFTP_SUPPORT) > > CFLAGS+= -DLOADER_TFTP_SUPPORT > > -.else > > +.endif > > +.if defined(LOADER_NFS_SUPPORT) > > CFLAGS+= -DLOADER_NFS_SUPPORT > > .endif > > Is LOADER_NFS_SUPPORT defined by default? If not, I think you just turned > off NFS > in the default loader. One option would be to add a new > 'LOADER_NO_NFS_SUPPORT' > and include NFS unless that is defined. We could also just always include > NFS > support. Finally, if we want to retain the ability to choose loader bits, > these > should probably change to real src options: WITH/WITHOUT_LOADER_TFTP_SUPPORT > and > WITH/WITHOUT_LOADER_NFS_SUPPORT and have this Makefile check > MK_LOADER_TFTP/NFS_SUPPORT. Then we could choose defaults in src.opts.mk. > I've wanted all the 'ad-hoc' options in the tree to wind up in src.opts.mk. These would be a great addition. Warner From owner-svn-src-head@freebsd.org Sat Sep 23 19:49:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3962E0E0B2; Sat, 23 Sep 2017 19:49:13 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9158F812D8; Sat, 23 Sep 2017 19:49:13 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8NJnCWF016166; Sat, 23 Sep 2017 19:49:12 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8NJnCZw016165; Sat, 23 Sep 2017 19:49:12 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201709231949.v8NJnCZw016165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sat, 23 Sep 2017 19:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323958 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 323958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 19:49:13 -0000 Author: fsu Date: Sat Sep 23 19:49:12 2017 New Revision: 323958 URL: https://svnweb.freebsd.org/changeset/base/323958 Log: Add myself as src committer. Approved by: pfg (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sat Sep 23 18:37:37 2017 (r323957) +++ head/share/misc/committers-src.dot Sat Sep 23 19:49:12 2017 (r323958) @@ -167,6 +167,7 @@ fabient [label="Fabien Thomas\nfabient@FreeBSD.org\n20 fanf [label="Tony Finch\nfanf@FreeBSD.org\n2002/05/05"] fjoe [label="Max Khon\nfjoe@FreeBSD.org\n2001/08/06"] flz [label="Florent Thoumie\nflz@FreeBSD.org\n2006/03/30"] +fsu [label="Fedor Uporov\nfsu@FreeBSD.org\n2017/08/28"] gabor [label="Gabor Kovesdan\ngabor@FreeBSD.org\n2010/02/02"] gad [label="Garance A. Drosehn\ngad@FreeBSD.org\n2000/10/27"] gallatin [label="Andrew Gallatin\ngallatin@FreeBSD.org\n1999/01/15"] @@ -689,6 +690,8 @@ obrien -> groudier obrien -> gshapiro obrien -> kan obrien -> sam + +pfg -> fsu peter -> asmodai peter -> jayanth From owner-svn-src-head@freebsd.org Sat Sep 23 23:33:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FE2AE1408C; Sat, 23 Sep 2017 23:33:28 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3208D3404; Sat, 23 Sep 2017 23:33:28 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wm0-x230.google.com with SMTP id q124so11265158wmb.0; Sat, 23 Sep 2017 16:33:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GSmvvxETpbylxZPoJPmFDysvWLT30z5wZLjVfcR7gF4=; b=UDRSV/adcSW7SLh7jRk3poqILr3T77nWIhFrjBTdZLl/PGACd4iSgN8FPX3o5KUwqE HpAcNWMhYEuQFRyW5SQUENxKt0kbE4Z9NEygYbONYlHAA8LoLCMNKvu5vtdJv4Izzf1E HUxRIYmATWmbycmThoeS3HGJr3/m6eIaYm3E9jVzxGkkDbwXoCST8ud/kC0mmQQfn/YD L2qdVdDdt8aJqWUPCMyOy7RWQHj1b5JChRxxlTMs6CMoo0zSj8M4jN20Ow0UPvuBDnrl T0/oNhn/FJu+hc17wp2WpO9yY4dElZHKm4yfwONa1iUMkCimJP+rUFAytchY826x9Sg/ sxJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GSmvvxETpbylxZPoJPmFDysvWLT30z5wZLjVfcR7gF4=; b=TTgjKuNk6wMwRBzVl1PAZzRowHt39SCPWuuva8Mbs1gKaAiC/wsvuVlngsVkD9xhoQ oZH5E2Cizygv0ny9RFBo+YSal6ZrW/65btY1bEbOq74eacTY4OqXrhGxG9sr9OpwqBmY kb5CjRJrL2nOASfGv7f4cfjhlhx/I1OqspQlCWD9r68JbNXXEemZkaBiDqlqr4kHiQ1A n2gL2179tXR3ncsuEP2Cak9zqYz1yG18bVH1+wT2YJJ1TTV5/bSe7siNzXown/aVfO2S xx27/tdni7eG4tUt308So3GTdV8sO7ms3mtDwJKkIhQllHUl9McG4Vx6osNAaiAF7oQX rmUg== X-Gm-Message-State: AHPjjUgfTSnI14t/3w3rFT9sQchvNAYP4z2GwerEWqJIg9OA7ntR7wSb SepTFkhwrz4NMGrB7CXz+UVZXxyEHuKXjm1h7wcvUO/f X-Google-Smtp-Source: AOwi7QAxbrejgJ1NIDkz0+qztwUJOVFb1v7TGEKhlv3wSJags2pJmyV80dlIwhUD8LGBb3O6gMyDU4foSh846rBj4Tc= X-Received: by 10.28.218.209 with SMTP id r200mr6504066wmg.97.1506209606557; Sat, 23 Sep 2017 16:33:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.157.10 with HTTP; Sat, 23 Sep 2017 16:33:26 -0700 (PDT) In-Reply-To: <6F5DC92C-2CF6-4A33-9663-BFECB7DB65F2@lists.zabbadoz.net> References: <201709230135.v8N1ZE6S063264@repo.freebsd.org> <283397c7-a01e-3776-7ed3-b64d68003d0b@sasktel.net> <6F5DC92C-2CF6-4A33-9663-BFECB7DB65F2@lists.zabbadoz.net> From: Jonathan Looney Date: Sat, 23 Sep 2017 19:33:26 -0400 Message-ID: Subject: Re: svn commit: r323942 - head/sys/net To: "Bjoern A. Zeeb" Cc: Stephen Hurd , Stephen Hurd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Sep 2017 23:33:28 -0000 On Sat, Sep 23, 2017 at 4:37 AM, Bjoern A. Zeeb < bzeeb-lists@lists.zabbadoz.net> wrote: > > Then this makes no sense as we don=E2=80=99t do LRO if forwarding is enab= led on > the machine; > https://svnweb.freebsd.org/base/head/sys/netinet/tcp_lro.c? > annotate=3D317390#l645 Yes, that is true. However, this change still makes a difference. Previously, if LRO was not enabled or the packet was not eligible for LRO, the iflib code would call ifp->if_input() once for each packet. Now, the iflib code will build a chain of packets for which it couldn't do LRO and call ifp->if_input() once for the entire chain. (I agree that was not obvious from the rather short commit message and the diff in the email. The lack of comments or meaningful variable names did not help to alleviate the confusion. Nonetheless, when I looked at the diff with enough surrounding context, it became clear.) Jonathan