From owner-svn-src-head@freebsd.org Sun Aug 14 00:24:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A1C0BB802C; Sun, 14 Aug 2016 00:24:01 +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 596971C2C; Sun, 14 Aug 2016 00:24:01 +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 u7E0O0XG029987; Sun, 14 Aug 2016 00:24:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E0O0K8029986; Sun, 14 Aug 2016 00:24:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608140024.u7E0O0K8029986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 14 Aug 2016 00:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304066 - head/usr.bin/nfsstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 00:24:01 -0000 Author: markj Date: Sun Aug 14 00:24:00 2016 New Revision: 304066 URL: https://svnweb.freebsd.org/changeset/base/304066 Log: nfsstat depends on libdevstat as of r304058. X-MFC-With: r304058 Modified: head/usr.bin/nfsstat/Makefile Modified: head/usr.bin/nfsstat/Makefile ============================================================================== --- head/usr.bin/nfsstat/Makefile Sat Aug 13 23:35:20 2016 (r304065) +++ head/usr.bin/nfsstat/Makefile Sun Aug 14 00:24:00 2016 (r304066) @@ -4,4 +4,6 @@ PROG= nfsstat CFLAGS+=-DNFS +LIBADD+= devstat + .include From owner-svn-src-head@freebsd.org Sun Aug 14 03:49:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61BC0BB904E; Sun, 14 Aug 2016 03:49:38 +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 31AFC14FF; Sun, 14 Aug 2016 03:49:38 +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 u7E3nbLM004537; Sun, 14 Aug 2016 03:49:37 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E3nbnY004536; Sun, 14 Aug 2016 03:49:37 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608140349.u7E3nbnY004536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 14 Aug 2016 03:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304068 - head/sys/powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 03:49:38 -0000 Author: jhibbits Date: Sun Aug 14 03:49:37 2016 New Revision: 304068 URL: https://svnweb.freebsd.org/changeset/base/304068 Log: Only flush bp_kernload from the dcache, no need to sync the icache on the boot CPU. __syncicache() only syncs the icache on the current CPU, it doesn't touch the cache on any other core. Replace the call with cpu_flush_dcache() instead. Since bp_kernload is not touched again by the boot CPU in this code path, dcbf is no less efficient than the dcbst from __syncicache() by invalidating the cache line. Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sun Aug 14 00:40:17 2016 (r304067) +++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sun Aug 14 03:49:37 2016 (r304068) @@ -404,7 +404,7 @@ mpc85xx_smp_start_cpu(platform_t plat, s * bp_kernload is in the boot page. Sync the cache because ePAPR * booting has the other core(s) already running. */ - __syncicache(&bp_kernload, sizeof(bp_kernload)); + cpu_flush_dcache(&bp_kernload, sizeof(bp_kernload)); ap_pcpu = pc; __asm __volatile("msync; isync"); From owner-svn-src-head@freebsd.org Sun Aug 14 04:11:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29F52BB9403; Sun, 14 Aug 2016 04:11:38 +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 EAE891DF9; Sun, 14 Aug 2016 04:11:37 +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 u7E4BbX3014022; Sun, 14 Aug 2016 04:11:37 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E4BbtY014021; Sun, 14 Aug 2016 04:11:37 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608140411.u7E4BbtY014021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 14 Aug 2016 04:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304069 - head/sys/powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 04:11:38 -0000 Author: jhibbits Date: Sun Aug 14 04:11:36 2016 New Revision: 304069 URL: https://svnweb.freebsd.org/changeset/base/304069 Log: Return 0 instead of an error code on failure to find dcsr. mpc85xx_map_dcsr() returns a vm_offset_t, not an error code. mpc85xx_fix_errata() will gracefully exit if mpc85xx_map_dcsr() returns 0, as that indicates an error (NULL pointer). Modified: head/sys/powerpc/mpc85xx/mpc85xx.c Modified: head/sys/powerpc/mpc85xx/mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.c Sun Aug 14 03:49:37 2016 (r304068) +++ head/sys/powerpc/mpc85xx/mpc85xx.c Sun Aug 14 04:11:36 2016 (r304069) @@ -358,10 +358,10 @@ mpc85xx_map_dcsr(void) * Find the node the long way. */ if ((node = OF_finddevice("/")) == -1) - return (ENXIO); + return (0); if ((node = ofw_bus_find_compatible(node, "fsl,dcsr")) == 0) - return (ENXIO); + return (0); moveon: err = fdt_get_range(node, 0, &b, &s); From owner-svn-src-head@freebsd.org Sun Aug 14 05:10:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60B95BB9ECD; Sun, 14 Aug 2016 05:10:27 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E06D16CA; Sun, 14 Aug 2016 05:10:27 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7E5AQhr033959; Sun, 14 Aug 2016 05:10:26 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E5AQQb033958; Sun, 14 Aug 2016 05:10:26 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201608140510.u7E5AQQb033958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 14 Aug 2016 05:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304071 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 05:10:27 -0000 Author: mmel Date: Sun Aug 14 05:10:26 2016 New Revision: 304071 URL: https://svnweb.freebsd.org/changeset/base/304071 Log: OFWPCI: Don't strip RF_ACTIVE from flags when parent bus method is called. Reviewed by: nwhitehorn MFC after: 3 weeks Modified: head/sys/dev/ofw/ofwpci.c Modified: head/sys/dev/ofw/ofwpci.c ============================================================================== --- head/sys/dev/ofw/ofwpci.c Sun Aug 14 04:35:04 2016 (r304070) +++ head/sys/dev/ofw/ofwpci.c Sun Aug 14 05:10:26 2016 (r304071) @@ -414,14 +414,14 @@ #if defined(NEW_PCIB) && defined(PCI_RES_BUS) if (type == PCI_RES_BUS) { return (pci_domain_alloc_bus(sc->sc_pci_domain, child, rid, - start, end, count, flags)); + start, end, count, flags | needactivate)); } #endif rm = ofw_pci_get_rman(sc, type, flags); if (rm == NULL) { return (bus_generic_alloc_resource(bus, child, type, rid, - start, end, count, flags)); + start, end, count, flags | needactivate)); } rv = rman_reserve_resource(rm, start, end, count, flags, child); From owner-svn-src-head@freebsd.org Sun Aug 14 05:18:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40067BB9035; Sun, 14 Aug 2016 05:18:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1012C1AB5; Sun, 14 Aug 2016 05:18:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7E5IcpD037515; Sun, 14 Aug 2016 05:18:38 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E5Icf1037514; Sun, 14 Aug 2016 05:18:38 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201608140518.u7E5Icf1037514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 14 Aug 2016 05:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304072 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 05:18:39 -0000 Author: delphij Date: Sun Aug 14 05:18:38 2016 New Revision: 304072 URL: https://svnweb.freebsd.org/changeset/base/304072 Log: Now that the portsnap buildbox is generating the raw bits for INDEX-12, add it to the set of INDEX files built by portsnap. Switch to INDEX-12 for head/. Modified: head/etc/portsnap.conf Modified: head/etc/portsnap.conf ============================================================================== --- head/etc/portsnap.conf Sun Aug 14 05:10:26 2016 (r304071) +++ head/etc/portsnap.conf Sun Aug 14 05:18:38 2016 (r304072) @@ -32,4 +32,5 @@ # List of INDEX files to build and the DESCRIBE file to use for each #INDEX INDEX-9 DESCRIBE.9 #INDEX INDEX-10 DESCRIBE.10 -INDEX INDEX-11 DESCRIBE.11 +#INDEX INDEX-11 DESCRIBE.11 +INDEX INDEX-12 DESCRIBE.12 From owner-svn-src-head@freebsd.org Sun Aug 14 07:42:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA98DBB9DD2; Sun, 14 Aug 2016 07:42:42 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf0-x22d.google.com (mail-pf0-x22d.google.com [IPv6:2607:f8b0:400e:c00::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A567C196C; Sun, 14 Aug 2016 07:42:42 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf0-x22d.google.com with SMTP id p64so8620200pfb.1; Sun, 14 Aug 2016 00:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=c6kH7SjAZNvpappXSOm7aNNBKXhK/Q6KldfHYpN8Ey0=; b=Nt/dSrzvwi1YoLwCwceaajn+240FCqHHBhua1xnBxHeTYCO9kfqklB9ZypH/spI0Wf KSIRO7FtiKVR6FlMbTLo+ryryXssp1+wG7KRXTtu5hfP0bav6HpRSy7h3F+CCVHFEN6a MYHV9G/A1+4gfVwBEY8nOZOEPwODi+ZNor3WghcYL+8pgVKkgJ+HyPs6wTnZFf6nbmba tVF7Lc0AAxRJf4HAqz+H715dfaOWb48SgU0R0JRvsXNCy01JVe6i9Kni9JTZsDovGpVm KmBIX6a3BX+H9lUZvKeKbEMNBtdohyDEJTBOVTycOyCyk1+rmVajqdy0Ovu8V7xsJWRp GlbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:reply-to:subject:references:to:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=c6kH7SjAZNvpappXSOm7aNNBKXhK/Q6KldfHYpN8Ey0=; b=Uju/YM2TMG2YrC8scub0OpnJRE3ZiyMKktrC4MDa4+sB0WdhIuDhrURNTzn7hVsLqb MLMp25Lp8X9y8jmOhYCuoR69xJIG0Yj/SfQe7YprROh8aGjVCdAX8lTkB+2MKt31dHgM AnMa3KEbEr1hyFdAgeHQjFyV7bUnc3BUCgCmlxcsNRci0pgbjZkaaJjJdkUeR541I4f8 JLaqdahGh1DA9ZStOfNaZOwWnB7WMamBl/UaVtW7DFVcBqMOSuBtGHb4AJFca6GBOOde 2SYvNDug7uIeOZZOFe4nBYbddss4r14yRdA0peTiaUHDJoBIa1o3d/ajgPQwKgQvdqP4 lA3g== X-Gm-Message-State: AEkoouuty2ZEmsZbASYqWkBcZTYKglNMdHjiEa9zT6rfr3M+qSTvjsV5sjZ8X7oK5zqg8w== X-Received: by 10.98.51.131 with SMTP id z125mr43017425pfz.109.1471160562005; Sun, 14 Aug 2016 00:42:42 -0700 (PDT) Received: from ?IPv6:2001:44b8:31ae:7b01:f985:3c4b:2a0c:8bea? (2001-44b8-31ae-7b01-f985-3c4b-2a0c-8bea.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:f985:3c4b:2a0c:8bea]) by smtp.gmail.com with ESMTPSA id e2sm24421703pfd.45.2016.08.14.00.42.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Aug 2016 00:42:41 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r304072 - head/etc References: <201608140518.u7E5Icf1037514@repo.freebsd.org> To: Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Kubilay Kocak Message-ID: <7ac3c224-fcdd-1132-207f-e1533b0c5141@FreeBSD.org> Date: Sun, 14 Aug 2016 17:42:33 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Thunderbird/50.0a2 MIME-Version: 1.0 In-Reply-To: <201608140518.u7E5Icf1037514@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-AU Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 07:42:43 -0000 On 14/08/2016 3:18 PM, Xin LI wrote: > Author: delphij Date: Sun Aug 14 05:18:38 2016 New Revision: 304072 > URL: https://svnweb.freebsd.org/changeset/base/304072 > > Log: Now that the portsnap buildbox is generating the raw bits for > INDEX-12, add it to the set of INDEX files built by portsnap. Thank you! > Switch to INDEX-12 for head/. > > Modified: head/etc/portsnap.conf > > Modified: head/etc/portsnap.conf > ============================================================================== > > --- head/etc/portsnap.conf Sun Aug 14 05:10:26 2016 (r304071) > +++ head/etc/portsnap.conf Sun Aug 14 05:18:38 2016 (r304072) @@ > -32,4 +32,5 @@ # List of INDEX files to build and the DESCRIBE file > to use for each #INDEX INDEX-9 DESCRIBE.9 #INDEX INDEX-10 > DESCRIBE.10 -INDEX INDEX-11 DESCRIBE.11 +#INDEX INDEX-11 DESCRIBE.11 > +INDEX INDEX-12 DESCRIBE.12 > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head To > unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Sun Aug 14 09:26:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D79DBB7655; Sun, 14 Aug 2016 09:26:15 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9D051671; Sun, 14 Aug 2016 09:26:14 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7E9QEYx030879; Sun, 14 Aug 2016 09:26:14 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E9QBfT030848; Sun, 14 Aug 2016 09:26:11 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201608140926.u7E9QBfT030848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sun, 14 Aug 2016 09:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304075 - in head: contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/t... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 09:26:15 -0000 Author: mm Date: Sun Aug 14 09:26:10 2016 New Revision: 304075 URL: https://svnweb.freebsd.org/changeset/base/304075 Log: MFV r304060: Sync libarchive with vendor including three security fixes Vendor issues fixed: Issue #744: Very long pathnames evade symlink checks Issue #748: libarchive can compress, but cannot decompress zip some files PR #750: ustar: fix out of bounds read on empty string ("") filename PR #755: fix use of acl_get_flagset_np() on FreeBSD MFC after: 3 days Added: head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c - copied unchanged from r304060, vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.c head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu - copied unchanged from r304060, vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.zip.uu head/contrib/libarchive/libarchive/test/test_write_disk_secure744.c - copied unchanged from r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure744.c head/contrib/libarchive/libarchive/test/test_write_disk_secure745.c - copied unchanged from r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure745.c head/contrib/libarchive/libarchive/test/test_write_disk_secure746.c - copied unchanged from r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure746.c Modified: head/contrib/libarchive/cat/test/test_version.c head/contrib/libarchive/cpio/cmdline.c head/contrib/libarchive/cpio/test/test_option_version.c head/contrib/libarchive/libarchive/archive_match.c head/contrib/libarchive/libarchive/archive_ppmd7_private.h head/contrib/libarchive/libarchive/archive_read_add_passphrase.c head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_disk_posix.c head/contrib/libarchive/libarchive/archive_read_private.h head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c head/contrib/libarchive/libarchive/archive_read_support_format_lha.c head/contrib/libarchive/libarchive/archive_read_support_format_warc.c head/contrib/libarchive/libarchive/archive_util.c head/contrib/libarchive/libarchive/archive_write_disk_acl.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c head/contrib/libarchive/libarchive/archive_write_set_format_ustar.c head/contrib/libarchive/libarchive/test/main.c head/contrib/libarchive/libarchive/test/test.h head/contrib/libarchive/libarchive/test/test_archive_string_conversion.c head/contrib/libarchive/libarchive/test/test_fuzz.c head/contrib/libarchive/libarchive/test/test_read_format_rar.c head/contrib/libarchive/tar/cmdline.c head/contrib/libarchive/tar/test/test_version.c head/lib/libarchive/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) head/contrib/libarchive/cpio/ (props changed) head/contrib/libarchive/libarchive/ (props changed) head/contrib/libarchive/tar/ (props changed) Modified: head/contrib/libarchive/cat/test/test_version.c ============================================================================== --- head/contrib/libarchive/cat/test/test_version.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/cat/test/test_version.c Sun Aug 14 09:26:10 2016 (r304075) @@ -83,7 +83,7 @@ DEFINE_TEST(test_version) if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') ++q; /* Skip arbitrary third-party version numbers. */ - while (s > 0 && (*q == ' ' || *q == '/' || *q == '.' || isalnum(*q))) { + while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) { ++q; --s; } Modified: head/contrib/libarchive/cpio/cmdline.c ============================================================================== --- head/contrib/libarchive/cpio/cmdline.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/cpio/cmdline.c Sun Aug 14 09:26:10 2016 (r304075) @@ -63,6 +63,7 @@ static const struct option { } cpio_longopts[] = { { "b64encode", 0, OPTION_B64ENCODE }, { "create", 0, 'o' }, + { "dereference", 0, 'L' }, { "dot", 0, 'V' }, { "extract", 0, 'i' }, { "file", 1, 'F' }, Modified: head/contrib/libarchive/cpio/test/test_option_version.c ============================================================================== --- head/contrib/libarchive/cpio/test/test_option_version.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/cpio/test/test_option_version.c Sun Aug 14 09:26:10 2016 (r304075) @@ -75,7 +75,7 @@ verify(const char *p, size_t s) if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') ++q; /* Skip arbitrary third-party version numbers. */ - while (s > 0 && (*q == ' ' || *q == '/' || *q == '.' || isalnum(*q))) { + while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) { ++q; --s; } Modified: head/contrib/libarchive/libarchive/archive_match.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_match.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_match.c Sun Aug 14 09:26:10 2016 (r304075) @@ -655,7 +655,7 @@ add_pattern_from_file(struct archive_mat } } - /* If something error happend, report it immediately. */ + /* If an error occurred, report it immediately. */ if (r < ARCHIVE_OK) { archive_copy_error(&(a->archive), ar); archive_read_free(ar); Modified: head/contrib/libarchive/libarchive/archive_ppmd7_private.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_ppmd7_private.h Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_ppmd7_private.h Sun Aug 14 09:26:10 2016 (r304075) @@ -19,7 +19,7 @@ If you need the compatibility with origi #define PPMD7_MAX_ORDER 64 #define PPMD7_MIN_MEM_SIZE (1 << 11) -#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFF - 12 * 3) +#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFFu - 12 * 3) struct CPpmd7_Context_; Modified: head/contrib/libarchive/libarchive/archive_read_add_passphrase.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_add_passphrase.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_read_add_passphrase.c Sun Aug 14 09:26:10 2016 (r304075) @@ -125,7 +125,7 @@ void __archive_read_reset_passphrase(struct archive_read *a) { - a->passphrases.candiate = -1; + a->passphrases.candidate = -1; } /* @@ -137,31 +137,31 @@ __archive_read_next_passphrase(struct ar struct archive_read_passphrase *p; const char *passphrase; - if (a->passphrases.candiate < 0) { + if (a->passphrases.candidate < 0) { /* Count out how many passphrases we have. */ int cnt = 0; for (p = a->passphrases.first; p != NULL; p = p->next) cnt++; - a->passphrases.candiate = cnt; + a->passphrases.candidate = cnt; p = a->passphrases.first; - } else if (a->passphrases.candiate > 1) { + } else if (a->passphrases.candidate > 1) { /* Rotate a passphrase list. */ - a->passphrases.candiate--; + a->passphrases.candidate--; p = remove_passphrases_from_head(a); add_passphrase_to_tail(a, p); - /* Pick a new passphrase candiate up. */ + /* Pick a new passphrase candidate up. */ p = a->passphrases.first; - } else if (a->passphrases.candiate == 1) { - /* This case is that all cadiates failed to decryption. */ - a->passphrases.candiate = 0; + } else if (a->passphrases.candidate == 1) { + /* This case is that all candidates failed to decrypt. */ + a->passphrases.candidate = 0; if (a->passphrases.first->next != NULL) { /* Rotate a passphrase list. */ p = remove_passphrases_from_head(a); add_passphrase_to_tail(a, p); } p = NULL; - } else /* There is no passphrase candaite. */ + } else /* There is no passphrase candidate. */ p = NULL; if (p != NULL) @@ -177,7 +177,7 @@ __archive_read_next_passphrase(struct ar if (p == NULL) return (NULL); insert_passphrase_to_head(a, p); - a->passphrases.candiate = 1; + a->passphrases.candidate = 1; } } else passphrase = NULL; Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sun Aug 14 09:26:10 2016 (r304075) @@ -641,13 +641,16 @@ translate_acl(struct archive_read_disk * * Libarchive stores "flag" (NFSv4 inheritance bits) * in the ae_perm bitmap. */ - acl_get_flagset_np(acl_entry, &acl_flagset); - for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (acl_get_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit)) - ae_perm |= acl_inherit_map[i].archive_inherit; - - } + // XXX acl_get_flagset_np on FreeBSD returns EINVAL for + // non-NFSv4 ACLs + r = acl_get_flagset_np(acl_entry, &acl_flagset); + if (r == 0) { + for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { + if (acl_get_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit)) + ae_perm |= acl_inherit_map[i].archive_inherit; + } + } #endif acl_get_permset(acl_entry, &acl_permset); Modified: head/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_posix.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_read_disk_posix.c Sun Aug 14 09:26:10 2016 (r304075) @@ -938,7 +938,7 @@ next_entry(struct archive_read_disk *a, r = archive_match_path_excluded(a->matching, entry); if (r < 0) { archive_set_error(&(a->archive), errno, - "Faild : %s", archive_error_string(a->matching)); + "Failed : %s", archive_error_string(a->matching)); return (r); } if (r) { @@ -1041,7 +1041,7 @@ next_entry(struct archive_read_disk *a, r = archive_match_time_excluded(a->matching, entry); if (r < 0) { archive_set_error(&(a->archive), errno, - "Faild : %s", archive_error_string(a->matching)); + "Failed : %s", archive_error_string(a->matching)); return (r); } if (r) { @@ -1067,7 +1067,7 @@ next_entry(struct archive_read_disk *a, r = archive_match_owner_excluded(a->matching, entry); if (r < 0) { archive_set_error(&(a->archive), errno, - "Faild : %s", archive_error_string(a->matching)); + "Failed : %s", archive_error_string(a->matching)); return (r); } if (r) { Modified: head/contrib/libarchive/libarchive/archive_read_private.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_private.h Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_read_private.h Sun Aug 14 09:26:10 2016 (r304075) @@ -221,7 +221,7 @@ struct archive_read { struct { struct archive_read_passphrase *first; struct archive_read_passphrase **last; - int candiate; + int candidate; archive_passphrase_callback *callback; void *client_data; } passphrases; Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c Sun Aug 14 09:26:10 2016 (r304075) @@ -595,7 +595,7 @@ lz4_filter_read_data_block(struct archiv #endif } - /* Check if an error happend in decompression process. */ + /* Check if an error occurred in the decompression process. */ if (uncompressed_size < 0) { archive_set_error(&(self->archive->archive), ARCHIVE_ERRNO_MISC, "lz4 decompression failed"); Modified: head/contrib/libarchive/libarchive/archive_read_support_format_lha.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_lha.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_read_support_format_lha.c Sun Aug 14 09:26:10 2016 (r304075) @@ -1715,8 +1715,11 @@ lha_crc16(uint16_t crc, const void *pp, #undef bswap16 #if defined(_MSC_VER) && _MSC_VER >= 1400 /* Visual Studio */ # define bswap16(x) _byteswap_ushort(x) -#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8) \ - || defined(__clang__) +#elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4) +/* GCC 4.8 and later has __builtin_bswap16() */ +# define bswap16(x) __builtin_bswap16(x) +#elif defined(__clang__) +/* All clang versions have __builtin_bswap16() */ # define bswap16(x) __builtin_bswap16(x) #else # define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8)) Modified: head/contrib/libarchive/libarchive/archive_read_support_format_warc.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_warc.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_read_support_format_warc.c Sun Aug 14 09:26:10 2016 (r304075) @@ -318,7 +318,7 @@ start_over: } memcpy(w->pool.str, fnam.str, fnam.len); w->pool.str[fnam.len] = '\0'; - /* let noone else know about the pool, it's a secret, shhh */ + /* let no one else know about the pool, it's a secret, shhh */ fnam.str = w->pool.str; /* snarf mtime or deduce from rtime Modified: head/contrib/libarchive/libarchive/archive_util.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_util.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_util.c Sun Aug 14 09:26:10 2016 (r304075) @@ -580,7 +580,7 @@ void __archive_ensure_cloexec_flag(int fd) { #if defined(_WIN32) && !defined(__CYGWIN__) - (void)fd; /* UNSED */ + (void)fd; /* UNUSED */ #else int flags; Modified: head/contrib/libarchive/libarchive/archive_write_disk_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_acl.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_write_disk_acl.c Sun Aug 14 09:26:10 2016 (r304075) @@ -145,7 +145,7 @@ set_acl(struct archive *a, int fd, const gid_t ae_gid; const char *ae_name; int entries; - int i; + int i, r; ret = ARCHIVE_OK; entries = archive_acl_reset(abstract_acl, ae_requested_type); @@ -223,12 +223,16 @@ set_acl(struct archive *a, int fd, const } #ifdef ACL_TYPE_NFS4 - acl_get_flagset_np(acl_entry, &acl_flagset); - acl_clear_flags_np(acl_flagset); - for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (ae_permset & acl_inherit_map[i].archive_inherit) - acl_add_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit); + // XXX acl_get_flagset_np on FreeBSD returns EINVAL for + // non-NFSv4 ACLs + r = acl_get_flagset_np(acl_entry, &acl_flagset); + if (r == 0) { + acl_clear_flags_np(acl_flagset); + for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { + if (ae_permset & acl_inherit_map[i].archive_inherit) + acl_add_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit); + } } #endif } Modified: head/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_posix.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_write_disk_posix.c Sun Aug 14 09:26:10 2016 (r304075) @@ -1796,7 +1796,7 @@ edit_deep_directories(struct archive_wri char *tail = a->name; /* If path is short, avoid the open() below. */ - if (strlen(tail) <= PATH_MAX) + if (strlen(tail) < PATH_MAX) return; /* Try to record our starting dir. */ @@ -1806,7 +1806,7 @@ edit_deep_directories(struct archive_wri return; /* As long as the path is too long... */ - while (strlen(tail) > PATH_MAX) { + while (strlen(tail) >= PATH_MAX) { /* Locate a dir prefix shorter than PATH_MAX. */ tail += PATH_MAX - 8; while (tail > a->name && *tail != '/') Modified: head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Sun Aug 14 09:26:10 2016 (r304075) @@ -436,7 +436,7 @@ struct iso_option { * Type : string * Default: Auto detect * : We check a size of boot image; - * : If ths size is just 1.22M/1.44M/2.88M, + * : If the size is just 1.22M/1.44M/2.88M, * : we assume boot_type is 'fd'; * : otherwise boot_type is 'no-emulation'. * COMPAT : Modified: head/contrib/libarchive/libarchive/archive_write_set_format_ustar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_ustar.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_write_set_format_ustar.c Sun Aug 14 09:26:10 2016 (r304075) @@ -307,7 +307,7 @@ archive_write_ustar_header(struct archiv * case getting WCS failed. On POSIX, this is a * normal operation. */ - if (p != NULL && p[strlen(p) - 1] != '/') { + if (p != NULL && p[0] != '\0' && p[strlen(p) - 1] != '/') { struct archive_string as; archive_string_init(&as); Modified: head/contrib/libarchive/libarchive/test/main.c ============================================================================== --- head/contrib/libarchive/libarchive/test/main.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/test/main.c Sun Aug 14 09:26:10 2016 (r304075) @@ -1440,6 +1440,31 @@ assertion_file_size(const char *file, in return (0); } +/* Verify mode of 'pathname'. */ +int +assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode) +{ + int mode; + int r; + + assertion_count(file, line); +#if defined(_WIN32) && !defined(__CYGWIN__) + failure_start(file, line, "assertFileMode not yet implemented for Windows"); +#else + { + struct stat st; + r = lstat(pathname, &st); + mode = (int)(st.st_mode & 0777); + } + if (r == 0 && mode == expected_mode) + return (1); + failure_start(file, line, "File %s has mode %o, expected %o", + pathname, mode, expected_mode); +#endif + failure_finish(NULL); + return (0); +} + /* Assert that 'pathname' is a dir. If mode >= 0, verify that too. */ int assertion_is_dir(const char *file, int line, const char *pathname, int mode) Modified: head/contrib/libarchive/libarchive/test/test.h ============================================================================== --- head/contrib/libarchive/libarchive/test/test.h Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/test/test.h Sun Aug 14 09:26:10 2016 (r304075) @@ -182,6 +182,8 @@ assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks) #define assertFileSize(pathname, size) \ assertion_file_size(__FILE__, __LINE__, pathname, size) +#define assertFileMode(pathname, mode) \ + assertion_file_mode(__FILE__, __LINE__, pathname, mode) #define assertTextFileContents(text, pathname) \ assertion_text_file_contents(__FILE__, __LINE__, text, pathname) #define assertFileContainsLinesAnyOrder(pathname, lines) \ @@ -246,6 +248,7 @@ int assertion_file_mtime_recent(const ch int assertion_file_nlinks(const char *, int, const char *, int); int assertion_file_not_exists(const char *, int, const char *); int assertion_file_size(const char *, int, const char *, long); +int assertion_file_mode(const char *, int, const char *, int); int assertion_is_dir(const char *, int, const char *, int); int assertion_is_hardlink(const char *, int, const char *, const char *); int assertion_is_not_hardlink(const char *, int, const char *, const char *); Modified: head/contrib/libarchive/libarchive/test/test_archive_string_conversion.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_archive_string_conversion.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/test/test_archive_string_conversion.c Sun Aug 14 09:26:10 2016 (r304075) @@ -800,8 +800,8 @@ DEFINE_TEST(test_archive_string_conversi assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assert((fp = fopen(testdata, "w")) != NULL); while ((size = archive_read_data(a, buff, 512)) > 0) - fwrite(buff, 1, size, fp); - fclose(fp); + assertEqualInt(size, fwrite(buff, 1, size, fp)); + assertEqualInt(0, fclose(fp)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); test_archive_string_normalization_nfc(testdata); Modified: head/contrib/libarchive/libarchive/test/test_fuzz.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_fuzz.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/test/test_fuzz.c Sun Aug 14 09:26:10 2016 (r304075) @@ -110,13 +110,17 @@ test_fuzz(const struct files *filesets) for (i = 0; filesets[n].names[i] != NULL; ++i) { tmp = slurpfile(&size, filesets[n].names[i]); - rawimage = (char *)realloc(rawimage, oldsize + size); + char *newraw = (char *)realloc(rawimage, oldsize + size); + if (!assert(newraw != NULL)) + { + free(rawimage); + continue; + } + rawimage = newraw; memcpy(rawimage + oldsize, tmp, size); oldsize += size; size = oldsize; free(tmp); - if (!assert(rawimage != NULL)) - continue; } } if (size == 0) Modified: head/contrib/libarchive/libarchive/test/test_read_format_rar.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_format_rar.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/test/test_read_format_rar.c Sun Aug 14 09:26:10 2016 (r304075) @@ -3603,7 +3603,7 @@ DEFINE_TEST(test_read_format_rar_multivo assertEqualIntA(a, 0, archive_read_data(a, buff, sizeof(buff))); /* - * Eigth header. + * Eighth header. */ assertA(0 == archive_read_next_header(a, &ae)); assertEqualString("testdir/testsymlink6", archive_entry_pathname(ae)); Copied: head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c (from r304060, vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c Sun Aug 14 09:26:10 2016 (r304075, copy of r304060, vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.c) @@ -0,0 +1,143 @@ +/*- + * Copyright (c) 2016 Tim Kientzle + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD"); + +#include + + +/* + * Github Issue 748 reported problems with end-of-entry handling + * with highly-compressible data. This resulted in the end of the + * data being truncated (extracted as zero bytes). + */ + +/* + * Extract the specific test archive that was used to diagnose + * Issue 748: + */ +DEFINE_TEST(test_read_format_zip_high_compression) +{ + const char *refname = "test_read_format_zip_high_compression.zip"; + char *p; + size_t archive_size; + struct archive *a; + struct archive_entry *entry; + + const void *pv; + size_t s; + int64_t o; + + extract_reference_file(refname); + p = slurpfile(&archive_size, refname); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, p, archive_size, 16 * 1024)); + assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &entry)); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(262144, s); + assertEqualInt(0, o); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(160, s); + assertEqualInt(262144, o); + + assertEqualInt(ARCHIVE_EOF, archive_read_data_block(a, &pv, &s, &o)); + + assertEqualInt(ARCHIVE_OK, archive_free(a)); + free(p); +} + +/* + * Synthesize a lot of varying inputs that are highly compressible. + */ +DEFINE_TEST(test_read_format_zip_high_compression2) +{ + const size_t body_size = 1024 * 1024; + const size_t buff_size = 2 * 1024 * 1024; + char *body, *body_read, *buff; + int n; + + assert((body = malloc(body_size)) != NULL); + assert((body_read = malloc(body_size)) != NULL); + assert((buff = malloc(buff_size)) != NULL); + + /* Highly-compressible data: all bytes 255, except for a + * single 1 byte. + * The body is always 256k + 6 bytes long (the internal deflation + * buffer is exactly 256k). + */ + + for(n = 1024; n < (int)body_size; n += 1024) { + struct archive *a; + struct archive_entry *entry; + size_t used = 0; + const void *pv; + size_t s; + int64_t o; + + memset(body, 255, body_size); + body[n] = 1; + + /* Write an archive with a single entry of n bytes. */ + assert((a = archive_write_new()) != NULL); + assertEqualInt(ARCHIVE_OK, archive_write_set_format_zip(a)); + assertEqualInt(ARCHIVE_OK, archive_write_open_memory(a, buff, buff_size, &used)); + + entry = archive_entry_new2(a); + archive_entry_set_pathname(entry, "test"); + archive_entry_set_filetype(entry, AE_IFREG); + archive_entry_set_size(entry, 262150); + assertEqualInt(ARCHIVE_OK, archive_write_header(a, entry)); + archive_entry_free(entry); + assertEqualInt(262150, archive_write_data(a, body, 262150)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Read back the entry and verify the contents. */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory(a, buff, used, 17)); + assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &entry)); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(262144, s); + assertEqualInt(0, o); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(6, s); + assertEqualInt(262144, o); + + assertEqualInt(ARCHIVE_EOF, archive_read_data_block(a, &pv, &s, &o)); + + assertEqualInt(ARCHIVE_OK, archive_free(a)); + } + + free(body); + free(body_read); + free(buff); +} Copied: head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu (from r304060, vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.zip.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu Sun Aug 14 09:26:10 2016 (r304075, copy of r304060, vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.zip.uu) @@ -0,0 +1,18 @@ +begin 644 test_read_format_zip_high_compression.zip +M4$L#!!0`"``(`*=Y]4@``````````*``!``(`"``8VAA +MD5>>))%7GB215W5X"P`!!/8!```$%````.W=06K#,!`%T&E)P8LL?*2XC@N% +M)#5QO>AM@9WDJ6!%\6$K/Q6T3LAX]N/GQ'Z9G&KA^*K1'S +M.`[GOIM*[TP_Q_>O0[G_:3X.Y\^^V/X2<>))%7=7@+``$$]@$```04````4$L%!@`````!``$`5@````L"```` +!```` +` +end Copied: head/contrib/libarchive/libarchive/test/test_write_disk_secure744.c (from r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure744.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_write_disk_secure744.c Sun Aug 14 09:26:10 2016 (r304075, copy of r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure744.c) @@ -0,0 +1,95 @@ +/*- + * Copyright (c) 2003-2007,2016 Tim Kientzle + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +#define UMASK 022 + +/* + * Github Issue #744 describes a bug in the sandboxing code that + * causes very long pathnames to not get checked for symlinks. + */ + +DEFINE_TEST(test_write_disk_secure744) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + size_t buff_size = 8192; + char *buff = malloc(buff_size); + char *p = buff; + int n = 0; + int t; + + assert(buff != NULL); + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_SYMLINKS); + + while (p + 500 < buff + buff_size) { + memset(p, 'x', 100); + p += 100; + p[0] = '\0'; + + buff[0] = ((n / 1000) % 10) + '0'; + buff[1] = ((n / 100) % 10)+ '0'; + buff[2] = ((n / 10) % 10)+ '0'; + buff[3] = ((n / 1) % 10)+ '0'; + buff[4] = '_'; + ++n; + + /* Create a symlink pointing to the testworkdir */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, buff); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_copy_symlink(ae, testworkdir); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + *p++ = '/'; + sprintf(p, "target%d", n); + + /* Try to create a file through the symlink, should fail. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, buff); + archive_entry_set_mode(ae, S_IFDIR | 0777); + + t = archive_write_header(a, ae); + archive_entry_free(ae); + failure("Attempt to create target%d via %d-character symlink should have failed", n, (int)strlen(buff)); + if(!assertEqualInt(ARCHIVE_FAILED, t)) { + break; + } + } + archive_free(a); + free(buff); +#endif +} Copied: head/contrib/libarchive/libarchive/test/test_write_disk_secure745.c (from r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure745.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_write_disk_secure745.c Sun Aug 14 09:26:10 2016 (r304075, copy of r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure745.c) @@ -0,0 +1,76 @@ +/*- + * Copyright (c) 2003-2007,2016 Tim Kientzle + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +#define UMASK 022 + +/* + * Github Issue #745 describes a bug in the sandboxing code that + * allows one to use a symlink to edit the permissions on a file or + * directory outside of the sandbox. + */ + +DEFINE_TEST(test_write_disk_secure745) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_SYMLINKS); + + /* The target dir: The one we're going to try to change permission on */ + assertMakeDir("target", 0700); + + /* The sandbox dir we're going to run inside of. */ + assertMakeDir("sandbox", 0700); + assertChdir("sandbox"); + + /* Create a symlink pointing to the target directory */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "sym"); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_copy_symlink(ae, "../target"); + assert(0 == archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Try to alter the target dir through the symlink; this should fail. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "sym"); + archive_entry_set_mode(ae, S_IFDIR | 0777); + assert(0 == archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Permission of target dir should not have changed. */ + assertFileMode("../target", 0700); +#endif +} Copied: head/contrib/libarchive/libarchive/test/test_write_disk_secure746.c (from r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure746.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_write_disk_secure746.c Sun Aug 14 09:26:10 2016 (r304075, copy of r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure746.c) @@ -0,0 +1,125 @@ +/*- + * Copyright (c) 2003-2007,2016 Tim Kientzle + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +#define UMASK 022 + +/* + * Github Issue #746 describes a problem in which hardlink targets are + * not adequately checked and can be used to modify entries outside of + * the sandbox. + */ + +/* + * Verify that ARCHIVE_EXTRACT_SECURE_NODOTDOT disallows '..' in hardlink + * targets. + */ +DEFINE_TEST(test_write_disk_secure746a) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* The target directory we're going to try to affect. */ + assertMakeDir("target", 0700); + assertMakeFile("target/foo", 0700, "unmodified"); + + /* The sandbox dir we're going to work within. */ + assertMakeDir("sandbox", 0700); + assertChdir("sandbox"); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_NODOTDOT); + + /* Attempt to hardlink to the target directory. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "bar"); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_set_size(ae, 8); + archive_entry_copy_hardlink(ae, "../target/foo"); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); + assertEqualInt(ARCHIVE_FAILED, archive_write_data(a, "modified", 8)); + archive_entry_free(ae); + + /* Verify that target file contents are unchanged. */ + assertTextFileContents("unmodified", "../target/foo"); +#endif +} + +/* + * Verify that ARCHIVE_EXTRACT_SECURE_NOSYMLINK disallows symlinks in hardlink + * targets. + */ +DEFINE_TEST(test_write_disk_secure746b) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* The target directory we're going to try to affect. */ + assertMakeDir("target", 0700); + assertMakeFile("target/foo", 0700, "unmodified"); + + /* The sandbox dir we're going to work within. */ + assertMakeDir("sandbox", 0700); + assertChdir("sandbox"); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_SYMLINKS); + + /* Create a symlink to the target directory. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "symlink"); + archive_entry_copy_symlink(ae, "../target"); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Attempt to hardlink to the target directory via the symlink. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "bar"); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_set_size(ae, 8); + archive_entry_copy_hardlink(ae, "symlink/foo"); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); + assertEqualInt(ARCHIVE_FAILED, archive_write_data(a, "modified", 8)); + archive_entry_free(ae); + + /* Verify that target file contents are unchanged. */ + assertTextFileContents("unmodified", "../target/foo"); +#endif +} Modified: head/contrib/libarchive/tar/cmdline.c ============================================================================== --- head/contrib/libarchive/tar/cmdline.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/tar/cmdline.c Sun Aug 14 09:26:10 2016 (r304075) @@ -68,6 +68,7 @@ static const struct bsdtar_option { { "auto-compress", 0, 'a' }, { "b64encode", 0, OPTION_B64ENCODE }, { "block-size", 1, 'b' }, + { "blocking-factor", 1, 'b' }, { "bunzip2", 0, 'j' }, { "bzip", 0, 'j' }, { "bzip2", 0, 'j' }, Modified: head/contrib/libarchive/tar/test/test_version.c ============================================================================== --- head/contrib/libarchive/tar/test/test_version.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/tar/test/test_version.c Sun Aug 14 09:26:10 2016 (r304075) @@ -88,7 +88,7 @@ DEFINE_TEST(test_version) if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') ++q; /* Skip arbitrary third-party version numbers. */ - while (s > 0 && (*q == ' ' || *q == '/' || *q == '.' || isalnum(*q))) { + while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) { ++q; --s; } Modified: head/lib/libarchive/tests/Makefile ============================================================================== --- head/lib/libarchive/tests/Makefile Sun Aug 14 07:59:34 2016 (r304074) +++ head/lib/libarchive/tests/Makefile Sun Aug 14 09:26:10 2016 (r304075) @@ -175,6 +175,7 @@ TESTS_SRCS= \ test_read_format_zip_encryption_header.c \ test_read_format_zip_encryption_partially.c \ test_read_format_zip_filename.c \ + test_read_format_zip_high_compression.c \ test_read_format_zip_mac_metadata.c \ test_read_format_zip_malformed.c \ test_read_format_zip_msdos.c \ @@ -209,6 +210,9 @@ TESTS_SRCS= \ test_write_disk_no_hfs_compression.c \ test_write_disk_perms.c \ test_write_disk_secure.c \ + test_write_disk_secure744.c \ + test_write_disk_secure745.c \ + test_write_disk_secure746.c \ test_write_disk_sparse.c \ test_write_disk_symlink.c \ test_write_disk_times.c \ @@ -504,6 +508,7 @@ ${PACKAGE}FILES+= test_read_format_zip_f ${PACKAGE}FILES+= test_read_format_zip_filename_utf8_jp.zip.uu ${PACKAGE}FILES+= test_read_format_zip_filename_utf8_ru.zip.uu ${PACKAGE}FILES+= test_read_format_zip_filename_utf8_ru2.zip.uu +${PACKAGE}FILES+= test_read_format_zip_high_compression.zip.uu ${PACKAGE}FILES+= test_read_format_zip_length_at_end.zip.uu ${PACKAGE}FILES+= test_read_format_zip_mac_metadata.zip.uu ${PACKAGE}FILES+= test_read_format_zip_malformed1.zip.uu From owner-svn-src-head@freebsd.org Sun Aug 14 13:15:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27134BB991F; Sun, 14 Aug 2016 13:15:12 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0098.outbound.protection.outlook.com [65.55.169.98]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7ACBB1881; Sun, 14 Aug 2016 13:15:10 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQBPR01MB0401.CANPRD01.PROD.OUTLOOK.COM (10.169.142.147) by YQBPR01MB0404.CANPRD01.PROD.OUTLOOK.COM (10.169.142.150) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21; Sun, 14 Aug 2016 12:59:52 +0000 Received: from YQBPR01MB0401.CANPRD01.PROD.OUTLOOK.COM ([10.169.142.147]) by YQBPR01MB0401.CANPRD01.PROD.OUTLOOK.COM ([10.169.142.147]) with mapi id 15.01.0557.021; Sun, 14 Aug 2016 12:59:52 +0000 From: Rick Macklem To: Mark Johnston , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r304066 - head/usr.bin/nfsstat Thread-Topic: svn commit: r304066 - head/usr.bin/nfsstat Thread-Index: AQHR9cIyxorfsJ37wE2jgtMo7Us9JaBIay6L Date: Sun, 14 Aug 2016 12:59:52 +0000 Message-ID: References: <201608140024.u7E0O0K8029986@repo.freebsd.org> In-Reply-To: <201608140024.u7E0O0K8029986@repo.freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-originating-ip: [24.57.164.61] x-ms-office365-filtering-correlation-id: 5e38a7ab-7976-41d0-0f5c-08d3c442e198 x-microsoft-exchange-diagnostics: 1; YQBPR01MB0404; 6:TvLvVtvf2xyox4fQcs2f0GL7yBA3jFS3WdA/f87slPWh/Sf2m/80g1BxHZb90DeY/hHsrfUmLZcEwHZtBOTu0WzzJjxyMwqTO9jWzIXwWoz7t81Ad+U+J1DBXtGPT1ZDGTBOb3o2uODYg/mtXpw1V2MXBqYVYm3SuyRqU5m3mKCIrIWpy5N7Jei+V33oG53QQPWOZZJeoyyp+Te/YtdLk1kC6isG6IzDeKZUSkGiCwNOX45Za6H1u7b4WG6IrW/OQla/wQ1Ljv/k32rMuY6TY5kcZsLeoYdh2jiKGvNr1gBcrOP3bzke2mH/W2Mx2L6E; 5:qtOHWiosk9KTgRa57e2d4FruipsnHW4d48gyWcT3nMHpC6ccIOyflEwirz9WWGF8cPX3Qj8xdprLCL64y8bgEkv04CsYK+Ty5Nezobl3W/molE+IFAUUn+IhKm9xrmq8n4ZkLdj9fXMar5E3QxeURg==; 24:5N3b6+GdJY478FNpFumfwROFJJ934++RFhJCOl4l3HkXtY0BZCe2P/3PwW6bQgNExZcDMUfshn3IBQox28FECrjO7yuSxHnrmYqgQwsf3Oc=; 7:DdM5xuHy/GfO7xNJXo5Q00zJe30kaCei1Vqu6eTawai5GGZ9yEqlnFc3i++gx+Q6pSJAjKxcaSI+jiscJfVsiFI4c4+E0nUJNWcGQoZy5u9tkUA64aHyKDTCcHYFBOVKLGlaZV7JAx1lwm02lFmQkH31I1rT9OYCnYV6QEdLQ3jIaLjCYbOwy1jgUS2BlDwkahY+UTOA6dkVZAxASZRKaGoKXQdk9YmFrG+5ZiOfXmAKNhKwSux2mXazzfkK9Kc6 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:YQBPR01MB0404; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(56005881305849); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040176)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6042046)(6043046); SRVR:YQBPR01MB0404; BCL:0; PCL:0; RULEID:; SRVR:YQBPR01MB0404; x-forefront-prvs: 00342DD5BC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(7916002)(199003)(24454002)(189002)(19625215002)(106116001)(105586002)(101416001)(107886002)(15975445007)(77096005)(450100001)(66066001)(189998001)(2501003)(7906003)(81156014)(74316002)(81166006)(3660700001)(10400500002)(3846002)(7736002)(9686002)(19580395003)(5002640100001)(7696003)(11100500001)(68736007)(5001770100001)(54356999)(97736004)(8936002)(76176999)(6116002)(586003)(7846002)(102836003)(3280700002)(50986999)(2201001)(8676002)(86362001)(106356001)(33656002)(19627405001)(74482002)(19617315012)(16236675004)(2900100001)(2950100001)(122556002)(2906002)(87936001)(558084003)(92566002); DIR:OUT; SFP:1101; SCL:1; SRVR:YQBPR01MB0404; H:YQBPR01MB0401.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Aug 2016 12:59:52.0305 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR01MB0404 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 13:15:12 -0000 Mark Johnson wrote: >Author: markj >Date: Sun Aug 14 00:24:00 2016 >New Revision: 304066 >URL: https://svnweb.freebsd.org/changeset/base/304066 > >Log: > nfsstat depends on libdevstat as of r304058. Oops, sorry. I missed committing the Makefile change. Thanks for doing it, = rick From owner-svn-src-head@freebsd.org Sun Aug 14 13:17:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C21AFBB99EB; Sun, 14 Aug 2016 13:17:56 +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 9E4991A05; Sun, 14 Aug 2016 13:17:56 +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 u7EDHteR016398; Sun, 14 Aug 2016 13:17:55 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EDHtNS016395; Sun, 14 Aug 2016 13:17:55 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608141317.u7EDHtNS016395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 14 Aug 2016 13:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304076 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 13:17:56 -0000 Author: ae Date: Sun Aug 14 13:17:55 2016 New Revision: 304076 URL: https://svnweb.freebsd.org/changeset/base/304076 Log: Make statistics nat64lsn, nat64stl an nptv6 output netstat-like: "@value @description" and fix build due to -Wformat errors. Modified: head/sbin/ipfw/nat64lsn.c head/sbin/ipfw/nat64stl.c head/sbin/ipfw/nptv6.c Modified: head/sbin/ipfw/nat64lsn.c ============================================================================== --- head/sbin/ipfw/nat64lsn.c Sun Aug 14 09:26:10 2016 (r304075) +++ head/sbin/ipfw/nat64lsn.c Sun Aug 14 13:17:55 2016 (r304076) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -687,7 +688,6 @@ nat64lsn_get_stats(const char *name, uin return (-1); } -#define _P_STAT(_s, _f) printf("%8s:\t%lu\n", #_f, _s._f) static void nat64lsn_stats(const char *name, uint8_t set) { @@ -696,34 +696,61 @@ nat64lsn_stats(const char *name, uint8_t if (nat64lsn_get_stats(name, set, &stats) != 0) err(EX_OSERR, "Error retrieving stats"); - _P_STAT(stats, opcnt64); - _P_STAT(stats, opcnt46); - _P_STAT(stats, ofrags); - _P_STAT(stats, ifrags); - _P_STAT(stats, oerrors); - _P_STAT(stats, noroute4); - _P_STAT(stats, noroute6); - _P_STAT(stats, noproto); - _P_STAT(stats, nomem); - _P_STAT(stats, dropped); - - _P_STAT(stats, hostcount); - _P_STAT(stats, tcpchunks); - _P_STAT(stats, udpchunks); - _P_STAT(stats, icmpchunks); - _P_STAT(stats, jcalls); - _P_STAT(stats, jrequests); - _P_STAT(stats, jhostsreq); - _P_STAT(stats, jportreq); - _P_STAT(stats, jhostfails); - _P_STAT(stats, jportfails); - _P_STAT(stats, jreinjected); - _P_STAT(stats, jmaxlen); - _P_STAT(stats, jnomem); - _P_STAT(stats, screated); - _P_STAT(stats, sdeleted); - _P_STAT(stats, spgcreated); - _P_STAT(stats, spgdeleted); + if (co.use_set != 0 || set != 0) + printf("set %u ", set); + printf("nat64lsn %s\n", name); + printf("\t%ju packets translated from IPv6 to IPv4\n", + (uintmax_t)stats.opcnt64); + printf("\t%ju packets translated from IPv4 to IPv6\n", + (uintmax_t)stats.opcnt46); + printf("\t%ju IPv6 fragments created\n", + (uintmax_t)stats.ofrags); + printf("\t%ju IPv4 fragments received\n", + (uintmax_t)stats.ifrags); + printf("\t%ju output packets dropped due to no bufs, etc.\n", + (uintmax_t)stats.oerrors); + printf("\t%ju output packets discarded due to no IPv4 route\n", + (uintmax_t)stats.noroute4); + printf("\t%ju output packets discarded due to no IPv6 route\n", + (uintmax_t)stats.noroute6); + printf("\t%ju packets discarded due to unsupported protocol\n", + (uintmax_t)stats.noproto); + printf("\t%ju packets discarded due to memory allocation problems\n", + (uintmax_t)stats.nomem); + printf("\t%ju packets discarded due to some errors\n", + (uintmax_t)stats.dropped); + printf("\t%ju packets not matched with IPv4 prefix\n", + (uintmax_t)stats.nomatch4); + + printf("\t%ju mbufs queued for post processing\n", + (uintmax_t)stats.jreinjected); + printf("\t%ju times the job queue was processed\n", + (uintmax_t)stats.jcalls); + printf("\t%ju job requests queued\n", + (uintmax_t)stats.jrequests); + printf("\t%ju job requests queue limit reached\n", + (uintmax_t)stats.jmaxlen); + printf("\t%ju job requests failed due to memory allocation problems\n", + (uintmax_t)stats.jnomem); + + printf("\t%ju hosts allocated\n", (uintmax_t)stats.hostcount); + printf("\t%ju hosts requested\n", (uintmax_t)stats.jhostsreq); + printf("\t%ju host requests failed\n", (uintmax_t)stats.jhostfails); + + printf("\t%ju portgroups requested\n", (uintmax_t)stats.jportreq); + printf("\t%ju portgroups allocated\n", (uintmax_t)stats.spgcreated); + printf("\t%ju portgroups deleted\n", (uintmax_t)stats.spgdeleted); + printf("\t%ju portgroup requests failed\n", + (uintmax_t)stats.jportfails); + printf("\t%ju portgroups allocated for TCP\n", + (uintmax_t)stats.tcpchunks); + printf("\t%ju portgroups allocated for UDP\n", + (uintmax_t)stats.udpchunks); + printf("\t%ju portgroups allocated for ICMP\n", + (uintmax_t)stats.icmpchunks); + + printf("\t%ju states created\n", (uintmax_t)stats.screated); + printf("\t%ju states deleted\n", (uintmax_t)stats.sdeleted); } static int Modified: head/sbin/ipfw/nat64stl.c ============================================================================== --- head/sbin/ipfw/nat64stl.c Sun Aug 14 09:26:10 2016 (r304075) +++ head/sbin/ipfw/nat64stl.c Sun Aug 14 13:17:55 2016 (r304076) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -386,7 +387,6 @@ nat64stl_get_stats(const char *name, uin return (-1); } -#define _P_STAT(_s, _f) printf("%8s:\t%lu\n", #_f, _s._f) static void nat64stl_stats(const char *name, uint8_t set) { @@ -395,16 +395,30 @@ nat64stl_stats(const char *name, uint8_t if (nat64stl_get_stats(name, set, &stats) != 0) err(EX_OSERR, "Error retrieving stats"); - _P_STAT(stats, opcnt64); - _P_STAT(stats, opcnt46); - _P_STAT(stats, ofrags); - _P_STAT(stats, ifrags); - _P_STAT(stats, oerrors); - _P_STAT(stats, noroute4); - _P_STAT(stats, noroute6); - _P_STAT(stats, noproto); - _P_STAT(stats, nomem); - _P_STAT(stats, dropped); + if (co.use_set != 0 || set != 0) + printf("set %u ", set); + printf("nat64stl %s\n", name); + + printf("\t%ju packets translated from IPv6 to IPv4\n", + (uintmax_t)stats.opcnt64); + printf("\t%ju packets translated from IPv4 to IPv6\n", + (uintmax_t)stats.opcnt46); + printf("\t%ju IPv6 fragments created\n", + (uintmax_t)stats.ofrags); + printf("\t%ju IPv4 fragments received\n", + (uintmax_t)stats.ifrags); + printf("\t%ju output packets dropped due to no bufs, etc.\n", + (uintmax_t)stats.oerrors); + printf("\t%ju output packets discarded due to no IPv4 route\n", + (uintmax_t)stats.noroute4); + printf("\t%ju output packets discarded due to no IPv6 route\n", + (uintmax_t)stats.noroute6); + printf("\t%ju packets discarded due to unsupported protocol\n", + (uintmax_t)stats.noproto); + printf("\t%ju packets discarded due to memory allocation problems\n", + (uintmax_t)stats.nomem); + printf("\t%ju packets discarded due to some errors\n", + (uintmax_t)stats.dropped); } /* Modified: head/sbin/ipfw/nptv6.c ============================================================================== --- head/sbin/ipfw/nptv6.c Sun Aug 14 09:26:10 2016 (r304075) +++ head/sbin/ipfw/nptv6.c Sun Aug 14 13:17:55 2016 (r304076) @@ -309,11 +309,14 @@ nptv6_stats(const char *name, uint8_t se if (nptv6_get_stats(name, set, &stats) != 0) err(EX_OSERR, "Error retrieving stats"); - printf("Number of packets translated (internal to external): %ju\n", + if (co.use_set != 0 || set != 0) + printf("set %u ", set); + printf("nptv6 %s\n", name); + printf("\t%ju packets translated (internal to external)\n", (uintmax_t)stats.in2ex); - printf("Number of packets translated (external to internal): %ju\n", + printf("\t%ju packets translated (external to internal)\n", (uintmax_t)stats.ex2in); - printf("Number of packets dropped due to some error: %ju\n", + printf("\t%ju packets dropped due to some error\n", (uintmax_t)stats.dropped); } From owner-svn-src-head@freebsd.org Sun Aug 14 13:18:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AFF7BB9A0A; Sun, 14 Aug 2016 13:18:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9AA21A36; Sun, 14 Aug 2016 13:18:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EDI0XW016450; Sun, 14 Aug 2016 13:18:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EDI0lS016446; Sun, 14 Aug 2016 13:18:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608141318.u7EDI0lS016446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 14 Aug 2016 13:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304077 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 13:18:01 -0000 Author: manu Date: Sun Aug 14 13:17:59 2016 New Revision: 304077 URL: https://svnweb.freebsd.org/changeset/base/304077 Log: Correct the size of the softc in a10_ehci Reported by: andrew MFC after: 1 week Modified: head/sys/arm/allwinner/a10_ehci.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Sun Aug 14 13:17:55 2016 (r304076) +++ head/sys/arm/allwinner/a10_ehci.c Sun Aug 14 13:17:59 2016 (r304077) @@ -358,7 +358,7 @@ static device_method_t ehci_methods[] = static driver_t ehci_driver = { .name = "ehci", .methods = ehci_methods, - .size = sizeof(ehci_softc_t), + .size = sizeof(struct aw_ehci_softc), }; static devclass_t ehci_devclass; From owner-svn-src-head@freebsd.org Sun Aug 14 13:23:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61A65BB9C6D; Sun, 14 Aug 2016 13:23:03 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DD52118D; Sun, 14 Aug 2016 13:23:03 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EDN2V1020105; Sun, 14 Aug 2016 13:23:02 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EDN2DI020104; Sun, 14 Aug 2016 13:23:02 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608141323.u7EDN2DI020104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 14 Aug 2016 13:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304078 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 13:23:03 -0000 Author: bde Date: Sun Aug 14 13:23:02 2016 New Revision: 304078 URL: https://svnweb.freebsd.org/changeset/base/304078 Log: Don't print an extra newline after the instruction when printing for single stepping of multiple instructions (e.g., s/p, and n/p). db_print_loc_and_inst() already prints a newline on all arches although it probably shouldn't. Especially on SMP systems, single stepping tends to deadlock or panic too quickly to be useful for anything except finding bugs in itself, but with printing "itself" includes console drivers so it is useful for generating stress tests for console drivers. Modified: head/sys/ddb/db_run.c Modified: head/sys/ddb/db_run.c ============================================================================== --- head/sys/ddb/db_run.c Sun Aug 14 13:17:59 2016 (r304077) +++ head/sys/ddb/db_run.c Sun Aug 14 13:23:02 2016 (r304078) @@ -145,7 +145,6 @@ db_stop_at_pc(bool *is_breakpoint) if (db_sstep_print) { db_printf("\t\t"); db_print_loc_and_inst(pc); - db_printf("\n"); } return (false); /* continue */ } @@ -165,7 +164,6 @@ db_stop_at_pc(bool *is_breakpoint) for (i = db_call_depth; --i > 0; ) db_printf(" "); db_print_loc_and_inst(pc); - db_printf("\n"); } } if (inst_call(ins)) From owner-svn-src-head@freebsd.org Sun Aug 14 15:26:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6FF7BBAB9D; Sun, 14 Aug 2016 15:26:41 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 650C317FC; Sun, 14 Aug 2016 15:26:41 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EFQegI064978; Sun, 14 Aug 2016 15:26:40 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EFQeUe064977; Sun, 14 Aug 2016 15:26:40 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608141526.u7EFQeUe064977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 14 Aug 2016 15:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304080 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 15:26:41 -0000 Author: bde Date: Sun Aug 14 15:26:40 2016 New Revision: 304080 URL: https://svnweb.freebsd.org/changeset/base/304080 Log: In ddb ps, left justify the non-numeric fields 'state' and 'wmesg' and the fixed-width numeric field 'wchan', as in ps(1). They were sort of centered, although the template shows 'state' as right-justified. The `wmesg' field very rarely has a prefix of '*' (for lock names) that is still to the left of the header, and the width of this field is reduced from 8 to 7 (more than 6 is an error). The 'wmesg' and 'wchan' fields are still misnamed and poorly handled. They are named sort of backwards relative to ps(1): - wmesg in ddb = mwchan in ps - wmesg in ddb = wchan in ps (if it is a wait channel name, not a lock name) - wchan in ddb = nwchan in ps ddb ps wastes lots of space for the unimportant 'wchan' field (20 columns altogether on 64-bit arches). ps(1) documents using a compressed format, but the compression only omits leading nybbles of 0 so it has neveqr worked on arches that put the kernel in the top half of the address space. It just avoids wasting space for an 0x prefix. Modified: head/sys/ddb/db_ps.c Modified: head/sys/ddb/db_ps.c ============================================================================== --- head/sys/ddb/db_ps.c Sun Aug 14 14:50:32 2016 (r304079) +++ head/sys/ddb/db_ps.c Sun Aug 14 15:26:40 2016 (r304080) @@ -69,10 +69,10 @@ DB_SHOW_ALL_COMMAND(procs, db_procs_cmd) * * 1 2 3 4 5 6 7 * 1234567890123456789012345678901234567890123456789012345678901234567890 - * pid ppid pgrp uid state wmesg wchan cmd - * < wmesg > < wchan > + * pid ppid pgrp uid state wmesg wchan cmd + * * (threaded) - * < wmesg > < wchan > + * * * For machines with 64-bit pointers, we expand the wchan field 8 more * characters. @@ -95,9 +95,9 @@ db_ps(db_expr_t addr, bool hasaddr, db_e p = &proc0; #ifdef __LP64__ - db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); + db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); #else - db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); + db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); #endif while (--np >= 0 && !db_pager_quit) { if (p == NULL) { @@ -279,15 +279,15 @@ dumpthread(volatile struct proc *p, vola wmesg = ""; wchan = NULL; } - db_printf("%c%-8.8s ", wprefix, wmesg); + db_printf("%c%-7.7s ", wprefix, wmesg); if (wchan == NULL) #ifdef __LP64__ - db_printf("%18s ", ""); + db_printf("%18s ", ""); #else - db_printf("%10s ", ""); + db_printf("%10s ", ""); #endif else - db_printf("%p ", wchan); + db_printf("%p ", wchan); if (p->p_flag & P_SYSTEM) db_printf("["); if (td->td_name[0] != '\0') From owner-svn-src-head@freebsd.org Sun Aug 14 15:52:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33D2BBB9365; Sun, 14 Aug 2016 15:52:01 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0540918D6; Sun, 14 Aug 2016 15:52:00 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EFq06M073970; Sun, 14 Aug 2016 15:52:00 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EFq0tu073969; Sun, 14 Aug 2016 15:52:00 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608141552.u7EFq0tu073969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 14 Aug 2016 15:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304083 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 15:52:01 -0000 Author: bde Date: Sun Aug 14 15:52:00 2016 New Revision: 304083 URL: https://svnweb.freebsd.org/changeset/base/304083 Log: Print the tid of curthread in "show pcpu" in ddb. It was remarkably hard to trace all current threads. "show pcpu" only showed the pid, and there was nothing (?) better than searching ps output to find the tids on CPUs. This change simplifies the search, but you still have to trace the tid for each CPU manually. Modified: head/sys/kern/subr_pcpu.c Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Sun Aug 14 15:50:38 2016 (r304082) +++ head/sys/kern/subr_pcpu.c Sun Aug 14 15:52:00 2016 (r304083) @@ -354,8 +354,8 @@ show_pcpu(struct pcpu *pc) db_printf("curthread = "); td = pc->pc_curthread; if (td != NULL) - db_printf("%p: pid %d \"%s\"\n", td, td->td_proc->p_pid, - td->td_name); + db_printf("%p: pid %d tid %d \"%s\"\n", td, td->td_proc->p_pid, + td->td_tid, td->td_name); else db_printf("none\n"); db_printf("curpcb = %p\n", pc->pc_curpcb); From owner-svn-src-head@freebsd.org Sun Aug 14 16:51:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A1C1BBA02E; Sun, 14 Aug 2016 16:51:27 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9A341368; Sun, 14 Aug 2016 16:51:26 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EGpQEx095944; Sun, 14 Aug 2016 16:51:26 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EGpQRr095942; Sun, 14 Aug 2016 16:51:26 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608141651.u7EGpQRr095942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 14 Aug 2016 16:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304085 - in head/sys/i386: i386 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 16:51:27 -0000 Author: bde Date: Sun Aug 14 16:51:25 2016 New Revision: 304085 URL: https://svnweb.freebsd.org/changeset/base/304085 Log: Fix the variables $esp, $ds, $es, $fs, $gs and $ss in vm86 mode. Fix PC_REGS() so that printing of instructions works in some useful cases. ddb only understands a single flat address space, but this macro allows mapping $cs:$eip into vm86's flat address space well enough for the MI parts of ddb. This doesn't work for the MD parts that do stack traces, and there are no similar macros for data addresses. PC_REGS() has to use the trapframe pointer instead of the pcb for this. For other CPUs, the trapframe pointer is not available except by tracing back to it. But tracing back through vm86 trapframes is broken even starting with one. Modified: head/sys/i386/i386/db_trace.c head/sys/i386/include/db_machdep.h Modified: head/sys/i386/i386/db_trace.c ============================================================================== --- head/sys/i386/i386/db_trace.c Sun Aug 14 16:32:23 2016 (r304084) +++ head/sys/i386/i386/db_trace.c Sun Aug 14 16:51:25 2016 (r304085) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -81,8 +82,8 @@ struct db_variable *db_eregs = db_regs + static __inline int get_esp(struct trapframe *tf) { - return ((ISPL(tf->tf_cs)) ? tf->tf_esp : - (db_expr_t)tf + (uintptr_t)DB_OFFSET(tf_esp)); + return ((ISPL(tf->tf_cs) || kdb_frame->tf_eflags & PSL_VM) ? + tf->tf_esp : (intptr_t)&tf->tf_esp); } static int @@ -104,12 +105,32 @@ db_frame(struct db_variable *vp, db_expr static int db_frame_seg(struct db_variable *vp, db_expr_t *valuep, int op) { + struct trapframe_vm86 *tfp; + int off; uint16_t *reg; if (kdb_frame == NULL) return (0); - reg = (uint16_t *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); + off = (intptr_t)vp->valuep; + if (kdb_frame->tf_eflags & PSL_VM) { + tfp = (void *)kdb_frame; + switch ((intptr_t)vp->valuep) { + case (intptr_t)DB_OFFSET(tf_cs): + reg = (uint16_t *)&tfp->tf_cs; + break; + case (intptr_t)DB_OFFSET(tf_ds): + reg = (uint16_t *)&tfp->tf_vm86_ds; + break; + case (intptr_t)DB_OFFSET(tf_es): + reg = (uint16_t *)&tfp->tf_vm86_es; + break; + case (intptr_t)DB_OFFSET(tf_fs): + reg = (uint16_t *)&tfp->tf_vm86_fs; + break; + } + } else + reg = (uint16_t *)((uintptr_t)kdb_frame + off); if (op == DB_VAR_GET) *valuep = *reg; else @@ -134,7 +155,16 @@ db_esp(struct db_variable *vp, db_expr_t static int db_gs(struct db_variable *vp, db_expr_t *valuep, int op) { + struct trapframe_vm86 *tfp; + if (kdb_frame != NULL && kdb_frame->tf_eflags & PSL_VM) { + tfp = (void *)kdb_frame; + if (op == DB_VAR_GET) + *valuep = tfp->tf_vm86_gs; + else + tfp->tf_vm86_gs = *valuep; + return (1); + } if (op == DB_VAR_GET) *valuep = rgs(); else @@ -150,8 +180,9 @@ db_ss(struct db_variable *vp, db_expr_t return (0); if (op == DB_VAR_GET) - *valuep = (ISPL(kdb_frame->tf_cs)) ? kdb_frame->tf_ss : rss(); - else if (ISPL(kdb_frame->tf_cs)) + *valuep = (ISPL(kdb_frame->tf_cs) || + kdb_frame->tf_eflags & PSL_VM) ? kdb_frame->tf_ss : rss(); + else if (ISPL(kdb_frame->tf_cs) || kdb_frame->tf_eflags & PSL_VM) kdb_frame->tf_ss = *valuep; return (1); } Modified: head/sys/i386/include/db_machdep.h ============================================================================== --- head/sys/i386/include/db_machdep.h Sun Aug 14 16:32:23 2016 (r304084) +++ head/sys/i386/include/db_machdep.h Sun Aug 14 16:51:25 2016 (r304085) @@ -35,7 +35,10 @@ typedef vm_offset_t db_addr_t; /* address - unsigned */ typedef int db_expr_t; /* expression - signed */ -#define PC_REGS() ((db_addr_t)kdb_thrctx->pcb_eip) +#define PC_REGS() ((db_addr_t)(kdb_frame->tf_eflags & PSL_VM ? \ + (kdb_frame->tf_eip & 0xffff) + \ + ((kdb_frame->tf_cs & 0xffff) << 4) : \ + kdb_frame->tf_eip)) #define BKPT_INST 0xcc /* breakpoint instruction */ #define BKPT_SIZE (1) /* size of breakpoint inst */ From owner-svn-src-head@freebsd.org Sun Aug 14 18:05:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E064CBBAF0E; Sun, 14 Aug 2016 18:05:42 +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 B09A81640; Sun, 14 Aug 2016 18:05:42 +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 u7EI5fVO024737; Sun, 14 Aug 2016 18:05:41 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EI5fmu024736; Sun, 14 Aug 2016 18:05:41 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608141805.u7EI5fmu024736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 14 Aug 2016 18:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304087 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 18:05:43 -0000 Author: ae Date: Sun Aug 14 18:05:41 2016 New Revision: 304087 URL: https://svnweb.freebsd.org/changeset/base/304087 Log: Do not warn about ambiguous state name when we inspect a comment token. Reported by: lev Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Sun Aug 14 16:57:10 2016 (r304086) +++ head/sbin/ipfw/ipfw2.c Sun Aug 14 18:05:41 2016 (r304087) @@ -3718,11 +3718,14 @@ compile_rule(char *av[], uint32_t *rbuf, } if (strcmp(*av, "any") == 0) action->arg1 = 0; - else if (match_token(rule_options, *av) != -1) { + else if ((i = match_token(rule_options, *av)) != -1) { action->arg1 = pack_object(tstate, default_state_name, IPFW_TLV_STATE_NAME); - warn("Ambiguous state name '%s', '%s' used instead.\n", - *av, default_state_name); + if (i != TOK_COMMENT) + warn("Ambiguous state name '%s', '%s'" + " used instead.\n", *av, + default_state_name); + break; } else if (state_check_name(*av) == 0) action->arg1 = pack_object(tstate, *av, IPFW_TLV_STATE_NAME); @@ -4563,8 +4566,8 @@ read_options: errx(EX_USAGE, "only one of keep-state " "and limit is allowed"); if (*av == NULL || - match_token(rule_options, *av) != -1) { - if (*av != NULL) + (i = match_token(rule_options, *av)) != -1) { + if (*av != NULL && i != TOK_COMMENT) warn("Ambiguous state name '%s'," " '%s' used instead.\n", *av, default_state_name); @@ -4615,8 +4618,8 @@ read_options: av++; if (*av == NULL || - match_token(rule_options, *av) != -1) { - if (*av != NULL) + (i = match_token(rule_options, *av)) != -1) { + if (*av != NULL && i != TOK_COMMENT) warn("Ambiguous state name '%s'," " '%s' used instead.\n", *av, default_state_name); From owner-svn-src-head@freebsd.org Sun Aug 14 18:34:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60182BB95F3; Sun, 14 Aug 2016 18:34:17 +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 29DD91497; Sun, 14 Aug 2016 18:34:17 +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 u7EIYG79035899; Sun, 14 Aug 2016 18:34:16 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EIYGwf035898; Sun, 14 Aug 2016 18:34:16 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608141834.u7EIYGwf035898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 14 Aug 2016 18:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304089 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 18:34:17 -0000 Author: ae Date: Sun Aug 14 18:34:16 2016 New Revision: 304089 URL: https://svnweb.freebsd.org/changeset/base/304089 Log: Add an ability to attach comment to check-state rules. MFC after: 1 week Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Sun Aug 14 18:30:30 2016 (r304088) +++ head/sbin/ipfw/ipfw2.c Sun Aug 14 18:34:16 2016 (r304089) @@ -4120,8 +4120,17 @@ chkarg: cmd = next_cmd(cmd, &cblen); } - if (have_state) /* must be a check-state, we are done */ + if (have_state) { /* must be a check-state, we are done */ + if (*av != NULL && + match_token(rule_options, *av) == TOK_COMMENT) { + /* check-state has a comment */ + av++; + fill_comment(cmd, av, cblen); + cmd = next_cmd(cmd, &cblen); + av[0] = NULL; + } goto done; + } #define OR_START(target) \ if (av[0] && (*av[0] == '(' || *av[0] == '{')) { \ From owner-svn-src-head@freebsd.org Sun Aug 14 19:04:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FD05BBA0BF; Sun, 14 Aug 2016 19:04:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4FC91D47; Sun, 14 Aug 2016 19:04:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EJ4cYk047795; Sun, 14 Aug 2016 19:04:38 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EJ4cpg047794; Sun, 14 Aug 2016 19:04:38 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608141904.u7EJ4cpg047794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 14 Aug 2016 19:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304096 - head/lib/libthr/arch/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 19:04:39 -0000 Author: adrian Date: Sun Aug 14 19:04:37 2016 New Revision: 304096 URL: https://svnweb.freebsd.org/changeset/base/304096 Log: [mips] convert over =v to =r for the inline assembly. Later gcc and clang have deprecated =v (which maps to a specific temp register) and instead we should just use =r to have the assembler (hopefully!) save/restore things appropriately after choosing a register. Tested: * AR9344 SoC, with userreg support * AR9331 SoC, with no userreg support Sponsored by: Sponsored by: DARPA, AFRL (MIPS TLS user register work) Modified: head/lib/libthr/arch/mips/include/pthread_md.h Modified: head/lib/libthr/arch/mips/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/mips/include/pthread_md.h Sun Aug 14 19:03:33 2016 (r304095) +++ head/lib/libthr/arch/mips/include/pthread_md.h Sun Aug 14 19:04:37 2016 (r304096) @@ -84,7 +84,7 @@ _tcb_get(void) ".set\tmips64r2\n\t" "rdhwr\t%0, $29\n\t" ".set\tpop" - : "=v" (_rv)); + : "=r" (_rv)); /* * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' @@ -106,7 +106,7 @@ _tcb_get(void) ".set\tmips32r2\n\t" "rdhwr\t%0, $29\n\t" ".set\tpop" - : "=v" (_rv)); + : "=r" (_rv)); /* * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' From owner-svn-src-head@freebsd.org Sun Aug 14 22:00:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DBFABBA4E5; Sun, 14 Aug 2016 22:00:47 +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 E606C1C66; Sun, 14 Aug 2016 22:00:46 +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 u7EM0kI1011638; Sun, 14 Aug 2016 22:00:46 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EM0jpA011635; Sun, 14 Aug 2016 22:00:45 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608142200.u7EM0jpA011635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 14 Aug 2016 22:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304102 - in head/sys: kern vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 22:00:47 -0000 Author: alc Date: Sun Aug 14 22:00:45 2016 New Revision: 304102 URL: https://svnweb.freebsd.org/changeset/base/304102 Log: Eliminate unneeded vm_page_xbusy() and vm_page_xunbusy() operations when neither vm_pager_has_page() nor vm_pager_get_pages() is called. Reviewed by: kib, markj MFC after: 3 weeks Modified: head/sys/kern/kern_exec.c head/sys/kern/uipc_shm.c head/sys/vm/vm_glue.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sun Aug 14 20:22:03 2016 (r304101) +++ head/sys/kern/kern_exec.c Sun Aug 14 22:00:45 2016 (r304102) @@ -984,8 +984,9 @@ exec_map_first_page(imgp) #if VM_NRESERVLEVEL > 0 vm_object_color(object, 0); #endif - ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL); + ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY); if (ma[0]->valid != VM_PAGE_BITS_ALL) { + vm_page_xbusy(ma[0]); if (!vm_pager_has_page(object, 0, NULL, &after)) { vm_page_lock(ma[0]); vm_page_free(ma[0]); @@ -1021,10 +1022,10 @@ exec_map_first_page(imgp) VM_OBJECT_WUNLOCK(object); return (EIO); } + vm_page_xunbusy(ma[0]); for (i = 1; i < initial_pagein; i++) vm_page_readahead_finish(ma[i]); } - vm_page_xunbusy(ma[0]); vm_page_lock(ma[0]); vm_page_hold(ma[0]); vm_page_activate(ma[0]); Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Sun Aug 14 20:22:03 2016 (r304101) +++ head/sys/kern/uipc_shm.c Sun Aug 14 22:00:45 2016 (r304102) @@ -182,8 +182,9 @@ uiomove_object_page(vm_object_t obj, siz * lock to page out tobj's pages because tobj is a OBJT_SWAP * type object. */ - m = vm_page_grab(obj, idx, VM_ALLOC_NORMAL); + m = vm_page_grab(obj, idx, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY); if (m->valid != VM_PAGE_BITS_ALL) { + vm_page_xbusy(m); if (vm_pager_has_page(obj, idx, NULL, NULL)) { rv = vm_pager_get_pages(obj, &m, 1, NULL, NULL); if (rv != VM_PAGER_OK) { @@ -198,8 +199,8 @@ uiomove_object_page(vm_object_t obj, siz } } else vm_page_zero_invalid(m, TRUE); + vm_page_xunbusy(m); } - vm_page_xunbusy(m); vm_page_lock(m); vm_page_hold(m); if (m->queue == PQ_NONE) { Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Sun Aug 14 20:22:03 2016 (r304101) +++ head/sys/vm/vm_glue.c Sun Aug 14 22:00:45 2016 (r304102) @@ -236,8 +236,9 @@ vm_imgact_hold_page(vm_object_t object, VM_OBJECT_WLOCK(object); pindex = OFF_TO_IDX(offset); - m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL); + m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY); if (m->valid != VM_PAGE_BITS_ALL) { + vm_page_xbusy(m); rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); if (rv != VM_PAGER_OK) { vm_page_lock(m); @@ -246,8 +247,8 @@ vm_imgact_hold_page(vm_object_t object, m = NULL; goto out; } + vm_page_xunbusy(m); } - vm_page_xunbusy(m); vm_page_lock(m); vm_page_hold(m); vm_page_activate(m); From owner-svn-src-head@freebsd.org Sun Aug 14 23:38:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6413BB99B9; Sun, 14 Aug 2016 23:38:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A2C91DC8; Sun, 14 Aug 2016 23:38:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7ENcpJ7048187; Sun, 14 Aug 2016 23:38:51 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ENcpiY048179; Sun, 14 Aug 2016 23:38:51 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201608142338.u7ENcpiY048179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 14 Aug 2016 23:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304106 - in head: include lib/libc/string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 14 Aug 2016 23:38:52 -0000 Author: delphij Date: Sun Aug 14 23:38:50 2016 New Revision: 304106 URL: https://svnweb.freebsd.org/changeset/base/304106 Log: Add timingsafe_bcmp and timingsafe_memcmp. Obtained from: OpenBSD Reviewed by: trasz MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D7280 Added: head/lib/libc/string/timingsafe_bcmp.3 (contents, props changed) head/lib/libc/string/timingsafe_bcmp.c (contents, props changed) head/lib/libc/string/timingsafe_memcmp.c (contents, props changed) Modified: head/include/string.h head/lib/libc/string/Makefile.inc head/lib/libc/string/Symbol.map head/lib/libc/string/bcmp.3 head/lib/libc/string/memcmp.3 Modified: head/include/string.h ============================================================================== --- head/include/string.h Sun Aug 14 22:58:06 2016 (r304105) +++ head/include/string.h Sun Aug 14 23:38:50 2016 (r304106) @@ -134,6 +134,8 @@ typedef __ssize_t ssize_t; void swab(const void * __restrict, void * __restrict, ssize_t); #endif /* _SWAB_DECLARED */ +int timingsafe_bcmp(const void *, const void *, size_t); +int timingsafe_memcmp(const void *, const void *, size_t); #endif /* __BSD_VISIBLE */ #if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) Modified: head/lib/libc/string/Makefile.inc ============================================================================== --- head/lib/libc/string/Makefile.inc Sun Aug 14 22:58:06 2016 (r304105) +++ head/lib/libc/string/Makefile.inc Sun Aug 14 23:38:50 2016 (r304106) @@ -16,7 +16,10 @@ MISRCS+=bcmp.c bcopy.c bzero.c explicit_ strcspn.c strdup.c strerror.c strlcat.c strlcpy.c strlen.c strmode.c \ strncat.c strncmp.c strncpy.c strndup.c strnlen.c strnstr.c \ strpbrk.c strrchr.c strsep.c strsignal.c strspn.c strstr.c strtok.c \ - strxfrm.c swab.c wcpcpy.c wcpncpy.c wcscasecmp.c wcscat.c \ + strxfrm.c swab.c \ + timingsafe_bcmp.c \ + timingsafe_memcmp.c \ + wcpcpy.c wcpncpy.c wcscasecmp.c wcscat.c \ wcschr.c wcscmp.c wcscoll.c wcscpy.c wcscspn.c wcsdup.c \ wcslcat.c wcslcpy.c wcslen.c wcsncasecmp.c wcsncat.c wcsncmp.c \ wcsncpy.c wcsnlen.c wcspbrk.c \ @@ -34,7 +37,9 @@ MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 f memcmp.3 memcpy.3 memmem.3 memmove.3 memset.3 strcasecmp.3 strcat.3 \ strchr.3 strcmp.3 strcoll.3 strcpy.3 strdup.3 strerror.3 \ string.3 strlcpy.3 strlen.3 strmode.3 strpbrk.3 strsep.3 \ - strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 wcscoll.3 wcstok.3 \ + strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 \ + timingsafe_bcmp.3 \ + wcscoll.3 wcstok.3 \ wcswidth.3 wcsxfrm.3 wmemchr.3 MLINKS+=bzero.3 explicit_bzero.3 @@ -69,6 +74,7 @@ MLINKS+=strstr.3 strcasestr.3 \ strstr.3 strcasestr_l.3 MLINKS+=strtok.3 strtok_r.3 MLINKS+=strxfrm.3 strxfrm_l.3 +MLINKS+=timingsafe_bcmp.3 timingsafe_memcmp.3 MLINKS+=wmemchr.3 wcpcpy.3 \ wmemchr.3 wcpncpy.3 \ wmemchr.3 wcscasecmp.3 \ Modified: head/lib/libc/string/Symbol.map ============================================================================== --- head/lib/libc/string/Symbol.map Sun Aug 14 22:58:06 2016 (r304105) +++ head/lib/libc/string/Symbol.map Sun Aug 14 23:38:50 2016 (r304106) @@ -104,6 +104,11 @@ FBSD_1.4 { explicit_bzero; }; +FBSD_1.5 { + timingsafe_bcmp; + timingsafe_memcmp; +}; + FBSDprivate_1.0 { __strtok_r; }; Modified: head/lib/libc/string/bcmp.3 ============================================================================== --- head/lib/libc/string/bcmp.3 Sun Aug 14 22:58:06 2016 (r304105) +++ head/lib/libc/string/bcmp.3 Sun Aug 14 23:38:50 2016 (r304106) @@ -30,7 +30,7 @@ .\" @(#)bcmp.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd August 15, 2016 .Dt BCMP 3 .Os .Sh NAME @@ -62,7 +62,8 @@ The strings may overlap. .Xr strcasecmp 3 , .Xr strcmp 3 , .Xr strcoll 3 , -.Xr strxfrm 3 +.Xr strxfrm 3 , +.Xr timingsafe_bcmp 3 .Sh HISTORY A .Fn bcmp Modified: head/lib/libc/string/memcmp.3 ============================================================================== --- head/lib/libc/string/memcmp.3 Sun Aug 14 22:58:06 2016 (r304105) +++ head/lib/libc/string/memcmp.3 Sun Aug 14 23:38:50 2016 (r304106) @@ -32,7 +32,7 @@ .\" @(#)memcmp.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd August 15, 2016 .Dt MEMCMP 3 .Os .Sh NAME @@ -75,6 +75,7 @@ Zero-length strings are always identical .Xr strcmp 3 , .Xr strcoll 3 , .Xr strxfrm 3 , +.Xr timingsafe_memcmp 3 , .Xr wmemcmp 3 .Sh STANDARDS The Added: head/lib/libc/string/timingsafe_bcmp.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/string/timingsafe_bcmp.3 Sun Aug 14 23:38:50 2016 (r304106) @@ -0,0 +1,92 @@ +.\" $OpenBSD: timingsafe_bcmp.3,v 1.2 2014/06/21 20:22:15 tedu Exp $ +.\" +.\" Copyright (c) 2014 Google Inc. +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $FreeBSD$ +.Dd August 15, 2016 +.Dt TIMINGSAFE_BCMP 3 +.Os +.Sh NAME +.Nm timingsafe_bcmp , +.Nm timingsafe_memcmp +.Nd timing-safe byte sequence comparisons +.Sh SYNOPSIS +.In string.h +.Ft int +.Fn timingsafe_bcmp "const void *b1" "const void *b2" "size_t len" +.Ft int +.Fn timingsafe_memcmp "const void *b1" "const void *b2" "size_t len" +.Sh DESCRIPTION +The +.Fn timingsafe_bcmp +and +.Fn timingsafe_memcmp +functions lexicographically compare the first +.Fa len +bytes (each interpreted as an +.Vt unsigned char ) +pointed to by +.Fa b1 +and +.Fa b2 . +.Pp +Additionally, their running times are independent of the byte sequences compared, +making them safe to use for comparing secret values such as cryptographic MACs. +In contrast, +.Xr bcmp 3 +and +.Xr memcmp 3 +may short-circuit after finding the first differing byte. +.Sh RETURN VALUES +The +.Fn timingsafe_bcmp +function returns 0 or not zero if the byte sequence pointed to by +.Fa b1 +compares equal to or not equal to (respectively) +the byte sequence pointed to by +.Fa b2 . +.Pp +The +.Fn timingsafe_memcmp +function returns a negative value, 0, or positive value if the byte sequence +pointed to by +.Fa b1 +compares less than, equal to, or greater than (respectively) +the byte sequence pointed to by +.Fa b2 . +.Sh SEE ALSO +.Xr bcmp 3 , +.Xr memcmp 3 +.Sh STANDARDS +The +.Fn timingsafe_bcmp +and +.Fn timingsafe_memcmp +functions are +.Fx +extensions. +.Sh HISTORY +The +.Fn timingsafe_bcmp +function first appeared in +.Ox 4.9 . +.Pp +The +.Fn timingsafe_memcmp +function first appeared in +.Ox 5.6 . +.Pp +Both functions first appeared in +.Fx 12.0 . Added: head/lib/libc/string/timingsafe_bcmp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/string/timingsafe_bcmp.c Sun Aug 14 23:38:50 2016 (r304106) @@ -0,0 +1,36 @@ +/* $OpenBSD: timingsafe_bcmp.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */ +/* + * Copyright (c) 2010 Damien Miller. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +int __timingsafe_bcmp(const void *, const void *, size_t); + +int +__timingsafe_bcmp(const void *b1, const void *b2, size_t n) +{ + const unsigned char *p1 = b1, *p2 = b2; + int ret = 0; + + for (; n > 0; n--) + ret |= *p1++ ^ *p2++; + return (ret != 0); +} + +__weak_reference(__timingsafe_bcmp, timingsafe_bcmp); Added: head/lib/libc/string/timingsafe_memcmp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/string/timingsafe_memcmp.c Sun Aug 14 23:38:50 2016 (r304106) @@ -0,0 +1,53 @@ +/* $OpenBSD: timingsafe_memcmp.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */ +/* + * Copyright (c) 2014 Google Inc. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +int __timingsafe_memcmp(const void *, const void *, size_t); + +int +__timingsafe_memcmp(const void *b1, const void *b2, size_t len) +{ + const unsigned char *p1 = b1, *p2 = b2; + size_t i; + int res = 0, done = 0; + + for (i = 0; i < len; i++) { + /* lt is -1 if p1[i] < p2[i]; else 0. */ + int lt = (p1[i] - p2[i]) >> CHAR_BIT; + + /* gt is -1 if p1[i] > p2[i]; else 0. */ + int gt = (p2[i] - p1[i]) >> CHAR_BIT; + + /* cmp is 1 if p1[i] > p2[i]; -1 if p1[i] < p2[i]; else 0. */ + int cmp = lt - gt; + + /* set res = cmp if !done. */ + res |= cmp & ~done; + + /* set done if p1[i] != p2[i]. */ + done |= lt | gt; + } + + return (res); +} + +__weak_reference(__timingsafe_memcmp, timingsafe_memcmp); From owner-svn-src-head@freebsd.org Mon Aug 15 01:30:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 672F6BB8380; Mon, 15 Aug 2016 01:30:11 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 51FED1990; Mon, 15 Aug 2016 01:30:10 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from ford.home.vangyzen.net (unknown [76.164.15.242]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 96AB2564A3; Sun, 14 Aug 2016 20:30:03 -0500 (CDT) Subject: Re: svn commit: r304046 - in head: sbin/ipfw sys/conf sys/modules sys/modules/ipfw_nat64 sys/netinet sys/netinet6 sys/netpfil/ipfw/nat64 To: "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608131609.u7DG9nLe044837@repo.freebsd.org> From: Eric van Gyzen Message-ID: <258b2981-7738-9f3b-305c-4776b5a6fdc4@FreeBSD.org> Date: Sun, 14 Aug 2016 20:29:24 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608131609.u7DG9nLe044837@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 01:30:11 -0000 On 08/13/16 11:09 AM, Andrey V. Elsukov wrote: > Author: ae > Date: Sat Aug 13 16:09:49 2016 > New Revision: 304046 > URL: https://svnweb.freebsd.org/changeset/base/304046 > > Log: > Add ipfw_nat64 module that implements stateless and stateful NAT64. Thanks for contributing this. When you get a moment, "make universe" is now broken: /usr/src/sys/amd64/conf/LINT: unknown option "IPFIREWALL_NAT64" *** [buildkernel] Error code 1 Cheers, Eric From owner-svn-src-head@freebsd.org Mon Aug 15 04:59:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4DCCBB7D80; Mon, 15 Aug 2016 04:59: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 9603211D6; Mon, 15 Aug 2016 04:59: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 u7F4xcdp066990; Mon, 15 Aug 2016 04:59:38 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F4xc0L066989; Mon, 15 Aug 2016 04:59:38 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608150459.u7F4xc0L066989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 15 Aug 2016 04:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304108 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 04:59:39 -0000 Author: sephe Date: Mon Aug 15 04:59:38 2016 New Revision: 304108 URL: https://svnweb.freebsd.org/changeset/base/304108 Log: Unbreak LINT build. Sponsored by: Microsoft Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Aug 15 04:48:29 2016 (r304107) +++ head/sys/conf/options Mon Aug 15 04:59:38 2016 (r304108) @@ -418,6 +418,7 @@ IPFILTER_LOOKUP opt_ipfilter.h IPFIREWALL opt_ipfw.h IPFIREWALL_DEFAULT_TO_ACCEPT opt_ipfw.h IPFIREWALL_NAT opt_ipfw.h +IPFIREWALL_NAT64 opt_ipfw.h IPFIREWALL_NAT64_DIRECT_OUTPUT opt_ipfw.h IPFIREWALL_NPTV6 opt_ipfw.h IPFIREWALL_VERBOSE opt_ipfw.h From owner-svn-src-head@freebsd.org Mon Aug 15 05:00:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B988BB7DF1; Mon, 15 Aug 2016 05:00: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 F2E651355; Mon, 15 Aug 2016 05:00:38 +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 u7F50cmp067860; Mon, 15 Aug 2016 05:00:38 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F50cEt067858; Mon, 15 Aug 2016 05:00:38 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608150500.u7F50cEt067858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 15 Aug 2016 05:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304109 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 05:00:39 -0000 Author: sephe Date: Mon Aug 15 05:00:37 2016 New Revision: 304109 URL: https://svnweb.freebsd.org/changeset/base/304109 Log: hyperv/hn: Simplify chimney sending buffer disconnection. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7479 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/if_hnreg.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 15 04:59:38 2016 (r304108) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 15 05:00:37 2016 (r304109) @@ -436,33 +436,24 @@ hv_nv_destroy_rx_buffer(netvsc_dev *net_ static int hv_nv_destroy_send_buffer(netvsc_dev *net_dev) { - nvsp_msg *revoke_pkt; int ret = 0; - /* - * If we got a section count, it means we received a - * send_rx_buf_complete msg - * (ie sent nvsp_msg_1_type_send_rx_buf msg) therefore, - * we need to send a revoke msg here - */ if (net_dev->send_section_size) { - /* Send the revoke send buffer */ - revoke_pkt = &net_dev->revoke_packet; - memset(revoke_pkt, 0, sizeof(nvsp_msg)); - - revoke_pkt->hdr.msg_type = - nvsp_msg_1_type_revoke_send_buf; - revoke_pkt->msgs.vers_1_msgs.revoke_send_buf.id = - NETVSC_SEND_BUFFER_ID; + struct hn_nvs_chim_disconn disconn; - ret = vmbus_chan_send(net_dev->sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, 0, revoke_pkt, sizeof(nvsp_msg), - (uint64_t)(uintptr_t)&hn_send_ctx_none); /* - * If we failed here, we might as well return and have a leak - * rather than continue and a bugchk + * Disconnect chimney sending buffer from NVS. */ + memset(&disconn, 0, sizeof(disconn)); + disconn.nvs_type = HN_NVS_TYPE_CHIM_DISCONN; + disconn.nvs_sig = HN_NVS_CHIM_SIG; + + ret = vmbus_chan_send(net_dev->sc->hn_prichan, + VMBUS_CHANPKT_TYPE_INBAND, 0, &disconn, sizeof(disconn), + (uint64_t)(uintptr_t)&hn_send_ctx_none); if (ret != 0) { + if_printf(net_dev->sc->hn_ifp, + "send chim disconn failed: %d\n", ret); return (ret); } } Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Mon Aug 15 04:59:38 2016 (r304108) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Mon Aug 15 05:00:37 2016 (r304109) @@ -45,6 +45,7 @@ #define HN_NVS_TYPE_RXBUF_DISCONN 103 #define HN_NVS_TYPE_CHIM_CONN 104 #define HN_NVS_TYPE_CHIM_CONNRESP 105 +#define HN_NVS_TYPE_CHIM_DISCONN 106 #define HN_NVS_TYPE_NDIS_CONF 125 /* @@ -135,4 +136,12 @@ struct hn_nvs_chim_connresp { uint32_t nvs_sectsz; /* section size */ } __packed; +/* No response */ +struct hn_nvs_chim_disconn { + uint32_t nvs_type; /* HN_NVS_TYPE_CHIM_DISCONN */ + uint16_t nvs_sig; /* HN_NVS_CHIM_SIG */ + uint8_t nvs_rsvd[26]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_chim_disconn) >= HN_NVS_REQSIZE_MIN); + #endif /* !_IF_HNREG_H_ */ From owner-svn-src-head@freebsd.org Mon Aug 15 05:08:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 855ABBBA158; Mon, 15 Aug 2016 05:08:43 +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 461771A85; Mon, 15 Aug 2016 05:08:43 +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 u7F58gXV070897; Mon, 15 Aug 2016 05:08:42 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F58g3v070893; Mon, 15 Aug 2016 05:08:42 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608150508.u7F58g3v070893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 15 Aug 2016 05:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304111 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 05:08:43 -0000 Author: sephe Date: Mon Aug 15 05:08:41 2016 New Revision: 304111 URL: https://svnweb.freebsd.org/changeset/base/304111 Log: hyperv/hn: Switch to vmbus xact APIs for sub-channel alloc request. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7480 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnreg.h head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 15 05:07:02 2016 (r304110) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 15 05:08:41 2016 (r304111) @@ -73,9 +73,6 @@ static void hv_nv_on_receive(netvsc_dev static void hn_nvs_sent_none(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, const struct nvsp_msg_ *msg, int); -static void hn_nvs_sent_xact(struct hn_send_ctx *sndc, - struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, - const struct nvsp_msg_ *msg, int dlen); static struct hn_send_ctx hn_send_ctx_none = HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL); @@ -756,16 +753,6 @@ hv_nv_on_device_remove(struct hn_softc * } void -hn_nvs_sent_wakeup(struct hn_send_ctx *sndc __unused, - struct netvsc_dev_ *net_dev, struct vmbus_channel *chan __unused, - const struct nvsp_msg_ *msg, int dlen __unused) -{ - /* Copy the response back */ - memcpy(&net_dev->channel_init_packet, msg, sizeof(nvsp_msg)); - sema_post(&net_dev->channel_init_sema); -} - -static void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev __unused, struct vmbus_channel *chan __unused, const struct nvsp_msg_ *msg, int dlen) Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 15 05:07:02 2016 (r304110) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 15 05:08:41 2016 (r304111) @@ -46,9 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include "hv_net_vsc.h" -#include "hv_rndis.h" -#include "hv_rndis_filter.h" +#include +#include +#include +#include +#include struct hv_rf_recvinfo { const ndis_8021q_info *vlan_info; @@ -1060,12 +1062,16 @@ hv_rf_on_device_add(struct hn_softc *sc, int ret; netvsc_dev *net_dev; rndis_device *rndis_dev; - nvsp_msg *init_pkt; rndis_offload_params offloads; struct rndis_recv_scale_cap rsscaps; uint32_t rsscaps_size = sizeof(struct rndis_recv_scale_cap); netvsc_device_info *dev_info = (netvsc_device_info *)additl_info; device_t dev = sc->hn_dev; + struct hn_nvs_subch_req *req; + const struct hn_nvs_subch_resp *resp; + size_t resp_len; + struct vmbus_xact *xact; + uint32_t status, nsubch; rndis_dev = hv_get_rndis_device(); if (rndis_dev == NULL) { @@ -1153,36 +1159,65 @@ hv_rf_on_device_add(struct hn_softc *sc, goto out; } - /* request host to create sub channels */ - init_pkt = &net_dev->channel_init_packet; - memset(init_pkt, 0, sizeof(nvsp_msg)); - - init_pkt->hdr.msg_type = nvsp_msg5_type_subchannel; - init_pkt->msgs.vers_5_msgs.subchannel_request.op = - NVSP_SUBCHANNE_ALLOCATE; - init_pkt->msgs.vers_5_msgs.subchannel_request.num_subchannels = - net_dev->num_channel - 1; + /* + * Ask NVS to allocate sub-channels. + */ + xact = vmbus_xact_get(sc->hn_xact, sizeof(*req)); + if (xact == NULL) { + if_printf(sc->hn_ifp, "no xact for nvs subch req\n"); + ret = ENXIO; + goto out; + } + + req = vmbus_xact_req_data(xact); + req->nvs_type = HN_NVS_TYPE_SUBCH_REQ; + req->nvs_op = HN_NVS_SUBCH_OP_ALLOC; + req->nvs_nsubch = net_dev->num_channel - 1; + + hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); + vmbus_xact_activate(xact); - hn_send_ctx_init_simple(&sndc, hn_nvs_sent_wakeup, NULL); ret = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)&sndc); + req, sizeof(*req), (uint64_t)(uintptr_t)&sndc); if (ret != 0) { - device_printf(dev, "Fail to allocate subchannel\n"); + if_printf(sc->hn_ifp, "send nvs subch req failed: %d\n", ret); + vmbus_xact_deactivate(xact); + vmbus_xact_put(xact); goto out; } - sema_wait(&net_dev->channel_init_sema); - - if (init_pkt->msgs.vers_5_msgs.subchn_complete.status != - nvsp_status_success) { - ret = ENODEV; - device_printf(dev, "sub channel complete error\n"); + resp = vmbus_xact_wait(xact, &resp_len); + if (resp_len < sizeof(*resp)) { + if_printf(sc->hn_ifp, "invalid subch resp length %zu\n", + resp_len); + vmbus_xact_put(xact); + ret = EINVAL; + goto out; + } + if (resp->nvs_type != HN_NVS_TYPE_SUBCH_RESP) { + if_printf(sc->hn_ifp, "not subch resp, type %u\n", + resp->nvs_type); + vmbus_xact_put(xact); + ret = EINVAL; goto out; } - net_dev->num_channel = 1 + - init_pkt->msgs.vers_5_msgs.subchn_complete.num_subchannels; + status = resp->nvs_status; + nsubch = resp->nvs_nsubch; + vmbus_xact_put(xact); + + if (status != HN_NVS_STATUS_OK) { + if_printf(sc->hn_ifp, "subch req failed: %x\n", status); + ret = EIO; + goto out; + } + if (nsubch > net_dev->num_channel - 1) { + if_printf(sc->hn_ifp, "%u subchans are allocated, requested %u\n", + nsubch, net_dev->num_channel - 1); + nsubch = net_dev->num_channel - 1; + } + net_dev->num_channel = nsubch + 1; ret = hv_rf_set_rss_param(rndis_dev, net_dev->num_channel); Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Mon Aug 15 05:07:02 2016 (r304110) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Mon Aug 15 05:08:41 2016 (r304111) @@ -47,6 +47,8 @@ #define HN_NVS_TYPE_CHIM_CONNRESP 105 #define HN_NVS_TYPE_CHIM_DISCONN 106 #define HN_NVS_TYPE_NDIS_CONF 125 +#define HN_NVS_TYPE_SUBCH_REQ 133 +#define HN_NVS_TYPE_SUBCH_RESP 133 /* same as SUBCH_REQ */ /* * Any size less than this one will _not_ work, e.g. hn_nvs_init @@ -144,4 +146,20 @@ struct hn_nvs_chim_disconn { } __packed; CTASSERT(sizeof(struct hn_nvs_chim_disconn) >= HN_NVS_REQSIZE_MIN); +#define HN_NVS_SUBCH_OP_ALLOC 1 + +struct hn_nvs_subch_req { + uint32_t nvs_type; /* HN_NVS_TYPE_SUBCH_REQ */ + uint32_t nvs_op; /* HN_NVS_SUBCH_OP_ */ + uint32_t nvs_nsubch; + uint8_t nvs_rsvd[20]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_subch_req) >= HN_NVS_REQSIZE_MIN); + +struct hn_nvs_subch_resp { + uint32_t nvs_type; /* HN_NVS_TYPE_SUBCH_RESP */ + uint32_t nvs_status; /* HN_NVS_STATUS_ */ + uint32_t nvs_nsubch; +} __packed; + #endif /* !_IF_HNREG_H_ */ Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Aug 15 05:07:02 2016 (r304110) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Aug 15 05:08:41 2016 (r304111) @@ -75,7 +75,7 @@ hn_send_ctx_init_simple(struct hn_send_c NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX, 0); } -void hn_nvs_sent_wakeup(struct hn_send_ctx *sndc, +void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, const struct nvsp_msg_ *msg, int dlen); void hn_chim_free(struct netvsc_dev_ *net_dev, uint32_t chim_idx); From owner-svn-src-head@freebsd.org Mon Aug 15 09:23:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D323BBAD6D; Mon, 15 Aug 2016 09:23:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F5F01890; Mon, 15 Aug 2016 09:23:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F9N9Cr069127; Mon, 15 Aug 2016 09:23:09 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F9N9AA069125; Mon, 15 Aug 2016 09:23:09 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608150923.u7F9N9AA069125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Aug 2016 09:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304140 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 09:23:10 -0000 Author: andrew Date: Mon Aug 15 09:23:08 2016 New Revision: 304140 URL: https://svnweb.freebsd.org/changeset/base/304140 Log: Add the ARMv8.1 identification registers to the list we print when booting. MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/armreg.h Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Mon Aug 15 09:19:26 2016 (r304139) +++ head/sys/arm64/arm64/identcpu.c Mon Aug 15 09:23:08 2016 (r304140) @@ -188,6 +188,27 @@ print_cpu_features(u_int cpu) if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_ISAR0) != 0) { printed = 0; printf(" Instruction Set Attributes 0 = <"); + + switch (ID_AA64ISAR0_RDM(cpu_desc[cpu].id_aa64isar0)) { + case ID_AA64ISAR0_RDM_NONE: + break; + case ID_AA64ISAR0_RDM_IMPL: + printf("%sRDM", SEP_STR); + break; + default: + printf("%sUnknown RDM", SEP_STR); + } + + switch (ID_AA64ISAR0_ATOMIC(cpu_desc[cpu].id_aa64isar0)) { + case ID_AA64ISAR0_ATOMIC_NONE: + break; + case ID_AA64ISAR0_ATOMIC_IMPL: + printf("%sAtomic", SEP_STR); + break; + default: + printf("%sUnknown Atomic", SEP_STR); + } + switch (ID_AA64ISAR0_AES(cpu_desc[cpu].id_aa64isar0)) { case ID_AA64ISAR0_AES_NONE: break; @@ -466,8 +487,82 @@ print_cpu_features(u_int cpu) /* AArch64 Memory Model Feature Register 1 */ if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_MMFR1) != 0) { - printf(" Memory Model Features 1 = <%#lx>\n", - cpu_desc[cpu].id_aa64mmfr1); + printed = 0; + printf(" Memory Model Features 1 = <"); + + switch (ID_AA64MMFR1_PAN(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_PAN_NONE: + break; + case ID_AA64MMFR1_PAN_IMPL: + printf("%sPAN", SEP_STR); + break; + default: + printf("%sUnknown PAN", SEP_STR); + break; + } + + switch (ID_AA64MMFR1_LO(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_LO_NONE: + break; + case ID_AA64MMFR1_LO_IMPL: + printf("%sLO", SEP_STR); + break; + default: + printf("%sUnknown LO", SEP_STR); + break; + } + + switch (ID_AA64MMFR1_HPDS(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_HPDS_NONE: + break; + case ID_AA64MMFR1_HPDS_IMPL: + printf("%sHPDS", SEP_STR); + break; + default: + printf("%sUnknown HPDS", SEP_STR); + break; + } + + switch (ID_AA64MMFR1_VH(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_VH_NONE: + break; + case ID_AA64MMFR1_VH_IMPL: + printf("%sVHE", SEP_STR); + break; + default: + printf("%sUnknown VHE", SEP_STR); + break; + } + + switch (ID_AA64MMFR1_VMIDBITS(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_VMIDBITS_8: + break; + case ID_AA64MMFR1_VMIDBITS_16: + printf("%s16 VMID bits", SEP_STR); + break; + default: + printf("%sUnknown VMID bits", SEP_STR); + break; + } + + switch (ID_AA64MMFR1_HAFDBS(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_HAFDBS_NONE: + break; + case ID_AA64MMFR1_HAFDBS_AF: + printf("%sAF", SEP_STR); + break; + case ID_AA64MMFR1_HAFDBS_AF_DBS: + printf("%sAF+DBS", SEP_STR); + break; + default: + printf("%sUnknown Hardware update AF/DBS", SEP_STR); + break; + } + + if ((cpu_desc[cpu].id_aa64mmfr1 & ~ID_AA64MMFR1_MASK) != 0) + printf("%s%#lx", SEP_STR, + cpu_desc[cpu].id_aa64mmfr1 & ~ID_AA64MMFR1_MASK); + printf(">\n"); } /* AArch64 Debug Feature Register 0 */ @@ -489,6 +584,9 @@ print_cpu_features(u_int cpu) case ID_AA64DFR0_PMU_VER_3: printf("%sPMUv3", SEP_STR); break; + case ID_AA64DFR0_PMU_VER_3_1: + printf("%sPMUv3+16 bit evtCount", SEP_STR); + break; case ID_AA64DFR0_PMU_VER_IMPL: printf("%sImplementation defined PMU", SEP_STR); break; @@ -512,6 +610,9 @@ print_cpu_features(u_int cpu) case ID_AA64DFR0_DEBUG_VER_8: printf("%sDebug v8", SEP_STR); break; + case ID_AA64DFR0_DEBUG_VER_8_VHE: + printf("%sDebug v8+VHE", SEP_STR); + break; default: printf("%sUnknown Debug", SEP_STR); break; Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Mon Aug 15 09:19:26 2016 (r304139) +++ head/sys/arm64/include/armreg.h Mon Aug 15 09:23:08 2016 (r304140) @@ -172,6 +172,7 @@ #define ID_AA64DFR0_DEBUG_VER_MASK (0xf << ID_AA64DFR0_DEBUG_VER_SHIFT) #define ID_AA64DFR0_DEBUG_VER(x) ((x) & ID_AA64DFR0_DEBUG_VER_MASK) #define ID_AA64DFR0_DEBUG_VER_8 (0x6 << ID_AA64DFR0_DEBUG_VER_SHIFT) +#define ID_AA64DFR0_DEBUG_VER_8_VHE (0x7 << ID_AA64DFR0_DEBUG_VER_SHIFT) #define ID_AA64DFR0_TRACE_VER_SHIFT 4 #define ID_AA64DFR0_TRACE_VER_MASK (0xf << ID_AA64DFR0_TRACE_VER_SHIFT) #define ID_AA64DFR0_TRACE_VER(x) ((x) & ID_AA64DFR0_TRACE_VER_MASK) @@ -182,6 +183,7 @@ #define ID_AA64DFR0_PMU_VER(x) ((x) & ID_AA64DFR0_PMU_VER_MASK) #define ID_AA64DFR0_PMU_VER_NONE (0x0 << ID_AA64DFR0_PMU_VER_SHIFT) #define ID_AA64DFR0_PMU_VER_3 (0x1 << ID_AA64DFR0_PMU_VER_SHIFT) +#define ID_AA64DFR0_PMU_VER_3_1 (0x4 << ID_AA64DFR0_PMU_VER_SHIFT) #define ID_AA64DFR0_PMU_VER_IMPL (0xf << ID_AA64DFR0_PMU_VER_SHIFT) #define ID_AA64DFR0_BRPS_SHIFT 12 #define ID_AA64DFR0_BRPS_MASK (0xf << ID_AA64DFR0_BRPS_SHIFT) @@ -197,7 +199,7 @@ ((((x) >> ID_AA64DFR0_CTX_CMPS_SHIFT) & 0xf) + 1) /* ID_AA64ISAR0_EL1 */ -#define ID_AA64ISAR0_MASK 0x000ffff0 +#define ID_AA64ISAR0_MASK 0xf0fffff0 #define ID_AA64ISAR0_AES_SHIFT 4 #define ID_AA64ISAR0_AES_MASK (0xf << ID_AA64ISAR0_AES_SHIFT) #define ID_AA64ISAR0_AES(x) ((x) & ID_AA64ISAR0_AES_MASK) @@ -219,6 +221,16 @@ #define ID_AA64ISAR0_CRC32(x) ((x) & ID_AA64ISAR0_CRC32_MASK) #define ID_AA64ISAR0_CRC32_NONE (0x0 << ID_AA64ISAR0_CRC32_SHIFT) #define ID_AA64ISAR0_CRC32_BASE (0x1 << ID_AA64ISAR0_CRC32_SHIFT) +#define ID_AA64ISAR0_ATOMIC_SHIFT 20 +#define ID_AA64ISAR0_ATOMIC_MASK (0xf << ID_AA64ISAR0_ATOMIC_SHIFT) +#define ID_AA64ISAR0_ATOMIC(x) ((x) & ID_AA64ISAR0_ATOMIC_MASK) +#define ID_AA64ISAR0_ATOMIC_NONE (0x0 << ID_AA64ISAR0_ATOMIC_SHIFT) +#define ID_AA64ISAR0_ATOMIC_IMPL (0x2 << ID_AA64ISAR0_ATOMIC_SHIFT) +#define ID_AA64ISAR0_RDM_SHIFT 28 +#define ID_AA64ISAR0_RDM_MASK (0xf << ID_AA64ISAR0_RDM_SHIFT) +#define ID_AA64ISAR0_RDM(x) ((x) & ID_AA64ISAR0_RDM_MASK) +#define ID_AA64ISAR0_RDM_NONE (0x0 << ID_AA64ISAR0_RDM_SHIFT) +#define ID_AA64ISAR0_RDM_IMPL (0x1 << ID_AA64ISAR0_RDM_SHIFT) /* ID_AA64MMFR0_EL1 */ #define ID_AA64MMFR0_MASK 0xffffffff @@ -267,6 +279,40 @@ #define ID_AA64MMFR0_TGRAN4_IMPL (0x0 << ID_AA64MMFR0_TGRAN4_SHIFT) #define ID_AA64MMFR0_TGRAN4_NONE (0xf << ID_AA64MMFR0_TGRAN4_SHIFT) +/* ID_AA64MMFR1_EL1 */ +#define ID_AA64MMFR1_MASK 0x00ffffff +#define ID_AA64MMFR1_HAFDBS_SHIFT 0 +#define ID_AA64MMFR1_HAFDBS_MASK (0xf << ID_AA64MMFR1_HAFDBS_SHIFT) +#define ID_AA64MMFR1_HAFDBS(x) ((x) & ID_AA64MMFR1_HAFDBS_MASK) +#define ID_AA64MMFR1_HAFDBS_NONE (0x0 << ID_AA64MMFR1_HAFDBS_SHIFT) +#define ID_AA64MMFR1_HAFDBS_AF (0x1 << ID_AA64MMFR1_HAFDBS_SHIFT) +#define ID_AA64MMFR1_HAFDBS_AF_DBS (0x2 << ID_AA64MMFR1_HAFDBS_SHIFT) +#define ID_AA64MMFR1_VMIDBITS_SHIFT 4 +#define ID_AA64MMFR1_VMIDBITS_MASK (0xf << ID_AA64MMFR1_VMIDBITS_SHIFT) +#define ID_AA64MMFR1_VMIDBITS(x) ((x) & ID_AA64MMFR1_VMIDBITS_MASK) +#define ID_AA64MMFR1_VMIDBITS_8 (0x0 << ID_AA64MMFR1_VMIDBITS_SHIFT) +#define ID_AA64MMFR1_VMIDBITS_16 (0x2 << ID_AA64MMFR1_VMIDBITS_SHIFT) +#define ID_AA64MMFR1_VH_SHIFT 8 +#define ID_AA64MMFR1_VH_MASK (0xf << ID_AA64MMFR1_VH_SHIFT) +#define ID_AA64MMFR1_VH(x) ((x) & ID_AA64MMFR1_VH_MASK) +#define ID_AA64MMFR1_VH_NONE (0x0 << ID_AA64MMFR1_VH_SHIFT) +#define ID_AA64MMFR1_VH_IMPL (0x1 << ID_AA64MMFR1_VH_SHIFT) +#define ID_AA64MMFR1_HPDS_SHIFT 12 +#define ID_AA64MMFR1_HPDS_MASK (0xf << ID_AA64MMFR1_HPDS_SHIFT) +#define ID_AA64MMFR1_HPDS(x) ((x) & ID_AA64MMFR1_HPDS_MASK) +#define ID_AA64MMFR1_HPDS_NONE (0x0 << ID_AA64MMFR1_HPDS_SHIFT) +#define ID_AA64MMFR1_HPDS_IMPL (0x1 << ID_AA64MMFR1_HPDS_SHIFT) +#define ID_AA64MMFR1_LO_SHIFT 16 +#define ID_AA64MMFR1_LO_MASK (0xf << ID_AA64MMFR1_LO_SHIFT) +#define ID_AA64MMFR1_LO(x) ((x) & ID_AA64MMFR1_LO_MASK) +#define ID_AA64MMFR1_LO_NONE (0x0 << ID_AA64MMFR1_LO_SHIFT) +#define ID_AA64MMFR1_LO_IMPL (0x1 << ID_AA64MMFR1_LO_SHIFT) +#define ID_AA64MMFR1_PAN_SHIFT 20 +#define ID_AA64MMFR1_PAN_MASK (0xf << ID_AA64MMFR1_PAN_SHIFT) +#define ID_AA64MMFR1_PAN(x) ((x) & ID_AA64MMFR1_PAN_MASK) +#define ID_AA64MMFR1_PAN_NONE (0x0 << ID_AA64MMFR1_PAN_SHIFT) +#define ID_AA64MMFR1_PAN_IMPL (0x1 << ID_AA64MMFR1_PAN_SHIFT) + /* ID_AA64PFR0_EL1 */ #define ID_AA64PFR0_MASK 0x0fffffff #define ID_AA64PFR0_EL0_SHIFT 0 From owner-svn-src-head@freebsd.org Mon Aug 15 09:24:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7342FBBAE1A; Mon, 15 Aug 2016 09:24:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 4CF081A28; Mon, 15 Aug 2016 09:24:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 3911118BA; Mon, 15 Aug 2016 09:24:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id E5D951A848; Mon, 15 Aug 2016 09:24:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id mOq0gK9RogEG; Mon, 15 Aug 2016 09:24:44 +0000 (UTC) Subject: Re: svn commit: r303019 - head/sys/geom DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com A961F1A843 To: Warner Losh , Ngie Cooper References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> <7372bf93-69a2-f5f5-1d07-204fd31f252c@FreeBSD.org> <20160812151117.GA52309@mithlond.kdm.org> <20160812151745.GA52527@mithlond.kdm.org> Cc: "Kenneth D. Merry" , "Andrey V. Elsukov" , Peter Wemm , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , src-committers From: Bryan Drewery Organization: FreeBSD Message-ID: <8c39aecd-d9b5-615e-455f-7f35c0616470@FreeBSD.org> Date: Mon, 15 Aug 2016 10:24:40 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="JKuIoU9JciIhoC98rqA0Ip4rxHc4R5f7F" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 09:24:47 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --JKuIoU9JciIhoC98rqA0Ip4rxHc4R5f7F Content-Type: multipart/mixed; boundary="xLPgIbPwd4waUXgBw3KtR912TJLqhBUkq" From: Bryan Drewery To: Warner Losh , Ngie Cooper Cc: "Kenneth D. Merry" , "Andrey V. Elsukov" , Peter Wemm , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , src-committers Message-ID: <8c39aecd-d9b5-615e-455f-7f35c0616470@FreeBSD.org> Subject: Re: svn commit: r303019 - head/sys/geom References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> <7372bf93-69a2-f5f5-1d07-204fd31f252c@FreeBSD.org> <20160812151117.GA52309@mithlond.kdm.org> <20160812151745.GA52527@mithlond.kdm.org> In-Reply-To: --xLPgIbPwd4waUXgBw3KtR912TJLqhBUkq Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/13/16 5:45 AM, Warner Losh wrote: > On Fri, Aug 12, 2016 at 3:06 PM, Ngie Cooper wr= ote: >> On Fri, Aug 12, 2016 at 8:23 AM, Bryan Drewery = wrote: >> >> ... >> >>> No, I was missing r303637. Hard to say if it is related... Andrey sa= ys >>> it's not. I haven't dived into it yet and it's so far only happened >>> once (out of a few tests). We do have various customizations but I'm= >>> inclined to think it's the stock code having problems. >> >> I hit it again on our internal vendor tree (what bdrewery was noting >> previously). I can provide some details about the panic if need be. >=20 > Ideally, you'd reproduce it on an unmodified -current. In a vendor tree= there's > many chances that something else is odd or off that would make it hard = for > the community to help. >=20 > Warner >=20 #4 0xffffffff80477b82 in g_resize_provider_event (arg=3D0xfffff80007f8d3a0, flag=3D) at /b/mnt/src/sys/geom/geom_subr.c:668 668 KASSERT(!(pp->flags & G_PF_WITHER), (gdb) p pp->mediasize $2 =3D 0 It seems that r303637 really does cover the panic we're hitting since the g_resize_provider_event was posted with mediasize=3D=3D0 which r30363= 7 avoids. --=20 Regards, Bryan Drewery --xLPgIbPwd4waUXgBw3KtR912TJLqhBUkq-- --JKuIoU9JciIhoC98rqA0Ip4rxHc4R5f7F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXsYpZAAoJEDXXcbtuRpfPtzsIAM1iTnWgen4l5t6XEvtktGwg S23dRkhmnjyDzqDQJQNhL44wZEjeHdLGsGGg9CHIkkh7yf5p8YHJC3TTTk5cOm7E rGxnKt+EmbQ0O1g5IS9Qtp6RG4nWI0/+vOe542L+Sd4V+/xTxSNjSSck5lBbMczP XSktR6SPlLszqUgq1iQTd4CxkLrG7nCn7YqPTqvuxJ7yPkVJfj9LsOvW9f0Qnk5F URVVNJmX2UzNdEgYpYsv12lYRLLZ16Jj2LRogyt3b2V+i/rvV5R9s1wQHdY0EhyD XMkIMSBCeT1VSt51FOnKl2E4O4+4dR+mBK26I9qL/z7fSoprZmrrfBSPNzt1q7Y= =g8vW -----END PGP SIGNATURE----- --JKuIoU9JciIhoC98rqA0Ip4rxHc4R5f7F-- From owner-svn-src-head@freebsd.org Mon Aug 15 09:30:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17327BBA01B; Mon, 15 Aug 2016 09:30:23 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9CB61EB1; Mon, 15 Aug 2016 09:30:22 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F9ULud069577; Mon, 15 Aug 2016 09:30:21 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F9UL1V069576; Mon, 15 Aug 2016 09:30:21 GMT (envelope-from des@FreeBSD.org) Message-Id: <201608150930.u7F9UL1V069576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Mon, 15 Aug 2016 09:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 09:30:23 -0000 Author: des Date: Mon Aug 15 09:30:21 2016 New Revision: 304142 URL: https://svnweb.freebsd.org/changeset/base/304142 Log: Ensure that the sector size is a multiple of 4096 to avoid creating unaligned partitions when the actual sector size is hidden from us. PR: 211361 MFC after: 3 days Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Aug 15 09:27:15 2016 (r304141) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Aug 15 09:30:21 2016 (r304142) @@ -795,6 +795,7 @@ gpart_max_free(struct ggeom *geom, intma { struct gconfig *gc; struct gprovider *pp, **providers; + intmax_t sectorsize, stripesize, offset; intmax_t lastend; intmax_t start, end; intmax_t maxsize, maxstart; @@ -845,12 +846,25 @@ gpart_max_free(struct ggeom *geom, intma pp = LIST_FIRST(&geom->lg_consumer)->lg_provider; - /* Compute beginning of new partition and maximum available space */ - if (pp->lg_stripesize > 0 && - (maxstart*pp->lg_sectorsize % pp->lg_stripesize) != 0) { - intmax_t offset = (pp->lg_stripesize - - ((maxstart*pp->lg_sectorsize) % pp->lg_stripesize)) / - pp->lg_sectorsize; + /* + * Round the start and size of the largest available space up to + * the nearest multiple of the adjusted stripe size. + * + * The adjusted stripe size is the least common multiple of the + * actual stripe size, or the sector size if no stripe size was + * reported, and 4096. The reason for this is that contemporary + * disks often have 4096-byte physical sectors but report 512 + * bytes instead for compatibility with older / broken operating + * systems and BIOSes. For the same reasons, virtualized storage + * may also report a 512-byte stripe size, or none at all. + */ + sectorsize = pp->lg_sectorsize; + if ((stripesize = pp->lg_stripesize) == 0) + stripesize = sectorsize; + while (stripesize % 4096 != 0) + stripesize *= 2; + if ((offset = maxstart * sectorsize % stripesize) != 0) { + offset = (stripesize - offset) / sectorsize; maxstart += offset; maxsize -= offset; } From owner-svn-src-head@freebsd.org Mon Aug 15 10:16:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32D7EBB9218; Mon, 15 Aug 2016 10:16:09 +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 05A121F40; Mon, 15 Aug 2016 10:16:08 +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 u7FAG8W5088722; Mon, 15 Aug 2016 10:16:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FAG8RF088721; Mon, 15 Aug 2016 10:16:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608151016.u7FAG8RF088721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 15 Aug 2016 10:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304146 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 10:16:09 -0000 Author: tuexen Date: Mon Aug 15 10:16:08 2016 New Revision: 304146 URL: https://svnweb.freebsd.org/changeset/base/304146 Log: Ensure that sctp_it_ctl.cur_it does not point to a free object (during a small time window). Thanks to Byron Campen for reporting the issue and suggesting a fix. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon Aug 15 09:39:26 2016 (r304145) +++ head/sys/netinet/sctputil.c Mon Aug 15 10:16:08 2016 (r304146) @@ -1280,6 +1280,7 @@ sctp_iterator_work(struct sctp_iterator SCTP_INP_INFO_RLOCK(); SCTP_ITERATOR_LOCK(); + sctp_it_ctl.cur_it = it; if (it->inp) { SCTP_INP_RLOCK(it->inp); SCTP_INP_DECR_REF(it->inp); @@ -1287,6 +1288,7 @@ sctp_iterator_work(struct sctp_iterator if (it->inp == NULL) { /* iterator is complete */ done_with_iterator: + sctp_it_ctl.cur_it = NULL; SCTP_ITERATOR_UNLOCK(); SCTP_INP_INFO_RUNLOCK(); if (it->function_atend != NULL) { @@ -1427,13 +1429,11 @@ sctp_iterator_worker(void) sctp_it_ctl.iterator_running = 1; TAILQ_FOREACH_SAFE(it, &sctp_it_ctl.iteratorhead, sctp_nxt_itr, nit) { - sctp_it_ctl.cur_it = it; /* now lets work on this one */ TAILQ_REMOVE(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); SCTP_IPI_ITERATOR_WQ_UNLOCK(); CURVNET_SET(it->vn); sctp_iterator_work(it); - sctp_it_ctl.cur_it = NULL; CURVNET_RESTORE(); SCTP_IPI_ITERATOR_WQ_LOCK(); /* sa_ignore FREED_MEMORY */ From owner-svn-src-head@freebsd.org Mon Aug 15 10:46:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89E4EBB9B44; Mon, 15 Aug 2016 10:46:34 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D1DF1E64; Mon, 15 Aug 2016 10:46:34 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FAkXr8099608; Mon, 15 Aug 2016 10:46:33 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FAkX5g099607; Mon, 15 Aug 2016 10:46:33 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151046.u7FAkX5g099607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 10:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304147 - head/sys/i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 10:46:34 -0000 Author: bde Date: Mon Aug 15 10:46:33 2016 New Revision: 304147 URL: https://svnweb.freebsd.org/changeset/base/304147 Log: Remove duplicate definition of get_pcb_td(). gcc works for detecting this error. Modified: head/sys/i386/include/md_var.h Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Mon Aug 15 10:16:08 2016 (r304146) +++ head/sys/i386/include/md_var.h Mon Aug 15 10:46:33 2016 (r304147) @@ -69,6 +69,5 @@ void ppro_reenable_apic(void); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); union savefpu *get_pcb_user_save_td(struct thread *td); union savefpu *get_pcb_user_save_pcb(struct pcb *pcb); -struct pcb *get_pcb_td(struct thread *td); #endif /* !_MACHINE_MD_VAR_H_ */ From owner-svn-src-head@freebsd.org Mon Aug 15 11:24:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54EC4BBA78E; Mon, 15 Aug 2016 11:24:32 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 241F5160D; Mon, 15 Aug 2016 11:24:32 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FBOVa3015074; Mon, 15 Aug 2016 11:24:31 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FBOUlp015068; Mon, 15 Aug 2016 11:24:30 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201608151124.u7FBOUlp015068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 15 Aug 2016 11:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304149 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 11:24:32 -0000 Author: sbruno Date: Mon Aug 15 11:24:30 2016 New Revision: 304149 URL: https://svnweb.freebsd.org/changeset/base/304149 Log: e1000: Add support for Kaby Lake IDs Fixup some errors when transitioning to/from low power states. Submitted by: erj Reviewed by: Jeffery Piper (jeffrey.e.piper@intel.com) MFC after: 3 days Relnotes: yes Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D7478 Modified: head/sys/dev/e1000/e1000_api.c head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/e1000_ich8lan.h head/sys/dev/e1000/e1000_phy.c head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/e1000_api.c ============================================================================== --- head/sys/dev/e1000/e1000_api.c Mon Aug 15 11:16:43 2016 (r304148) +++ head/sys/dev/e1000/e1000_api.c Mon Aug 15 11:24:30 2016 (r304149) @@ -304,6 +304,10 @@ s32 e1000_set_mac_type(struct e1000_hw * case E1000_DEV_ID_PCH_SPT_I219_LM2: case E1000_DEV_ID_PCH_SPT_I219_V2: case E1000_DEV_ID_PCH_LBG_I219_LM3: + case E1000_DEV_ID_PCH_SPT_I219_LM4: + case E1000_DEV_ID_PCH_SPT_I219_V4: + case E1000_DEV_ID_PCH_SPT_I219_LM5: + case E1000_DEV_ID_PCH_SPT_I219_V5: mac->type = e1000_pch_spt; break; case E1000_DEV_ID_82575EB_COPPER: Modified: head/sys/dev/e1000/e1000_hw.h ============================================================================== --- head/sys/dev/e1000/e1000_hw.h Mon Aug 15 11:16:43 2016 (r304148) +++ head/sys/dev/e1000/e1000_hw.h Mon Aug 15 11:24:30 2016 (r304149) @@ -142,6 +142,10 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_SPT_I219_LM2 0x15B7 /* Sunrise Point-H PCH */ #define E1000_DEV_ID_PCH_SPT_I219_V2 0x15B8 /* Sunrise Point-H PCH */ #define E1000_DEV_ID_PCH_LBG_I219_LM3 0x15B9 /* LEWISBURG PCH */ +#define E1000_DEV_ID_PCH_SPT_I219_LM4 0x15D7 +#define E1000_DEV_ID_PCH_SPT_I219_V4 0x15D8 +#define E1000_DEV_ID_PCH_SPT_I219_LM5 0x15E3 +#define E1000_DEV_ID_PCH_SPT_I219_V5 0x15D6 #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 @@ -957,9 +961,13 @@ struct e1000_dev_spec_ich8lan { E1000_MUTEX nvm_mutex; E1000_MUTEX swflag_mutex; bool nvm_k1_enabled; + bool disable_k1_off; bool eee_disable; u16 eee_lp_ability; enum e1000_ulp_state ulp_state; + bool ulp_capability_disabled; + bool during_suspend_flow; + bool during_dpg_exit; }; struct e1000_dev_spec_82575 { Modified: head/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.c Mon Aug 15 11:16:43 2016 (r304148) +++ head/sys/dev/e1000/e1000_ich8lan.c Mon Aug 15 11:24:30 2016 (r304149) @@ -288,7 +288,7 @@ static void e1000_toggle_lanphypc_pch_lp mac_reg &= ~E1000_CTRL_LANPHYPC_VALUE; E1000_WRITE_REG(hw, E1000_CTRL, mac_reg); E1000_WRITE_FLUSH(hw); - usec_delay(10); + msec_delay(1); mac_reg &= ~E1000_CTRL_LANPHYPC_OVERRIDE; E1000_WRITE_REG(hw, E1000_CTRL, mac_reg); E1000_WRITE_FLUSH(hw); @@ -1625,7 +1625,17 @@ static s32 e1000_check_for_copper_link_i hw->phy.ops.write_reg_locked(hw, I217_PLL_CLOCK_GATE_REG, phy_reg); - } + + if (speed == SPEED_1000) { + hw->phy.ops.read_reg_locked(hw, HV_PM_CTRL, + &phy_reg); + + phy_reg |= HV_PM_CTRL_K1_CLK_REQ; + + hw->phy.ops.write_reg_locked(hw, HV_PM_CTRL, + phy_reg); + } + } hw->phy.ops.release(hw); if (ret_val) @@ -1718,7 +1728,8 @@ static s32 e1000_check_for_copper_link_i u32 pcieanacfg = E1000_READ_REG(hw, E1000_PCIEANACFG); u32 fextnvm6 = E1000_READ_REG(hw, E1000_FEXTNVM6); - if (pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE) + if ((pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE) && + (hw->dev_spec.ich8lan.disable_k1_off == FALSE)) fextnvm6 |= E1000_FEXTNVM6_K1_OFF_ENABLE; else fextnvm6 &= ~E1000_FEXTNVM6_K1_OFF_ENABLE; Modified: head/sys/dev/e1000/e1000_ich8lan.h ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.h Mon Aug 15 11:16:43 2016 (r304148) +++ head/sys/dev/e1000/e1000_ich8lan.h Mon Aug 15 11:24:30 2016 (r304149) @@ -239,7 +239,7 @@ /* PHY Power Management Control */ #define HV_PM_CTRL PHY_REG(770, 17) -#define HV_PM_CTRL_PLL_STOP_IN_K1_GIGA 0x100 +#define HV_PM_CTRL_K1_CLK_REQ 0x200 #define HV_PM_CTRL_K1_ENABLE 0x4000 #define I217_PLL_CLOCK_GATE_REG PHY_REG(772, 28) Modified: head/sys/dev/e1000/e1000_phy.c ============================================================================== --- head/sys/dev/e1000/e1000_phy.c Mon Aug 15 11:16:43 2016 (r304148) +++ head/sys/dev/e1000/e1000_phy.c Mon Aug 15 11:24:30 2016 (r304149) @@ -4146,12 +4146,13 @@ s32 e1000_read_phy_reg_mphy(struct e1000 *data = E1000_READ_REG(hw, E1000_MPHY_DATA); /* Disable access to mPHY if it was originally disabled */ - if (locked) { + if (locked) ready = e1000_is_mphy_ready(hw); - if (!ready) - return -E1000_ERR_PHY; - } - E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS); + if (!ready) + return -E1000_ERR_PHY; + E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, + E1000_MPHY_DIS_ACCESS); + return E1000_SUCCESS; } @@ -4210,12 +4211,13 @@ s32 e1000_write_phy_reg_mphy(struct e100 E1000_WRITE_REG(hw, E1000_MPHY_DATA, data); /* Disable access to mPHY if it was originally disabled */ - if (locked) { + if (locked) ready = e1000_is_mphy_ready(hw); - if (!ready) - return -E1000_ERR_PHY; - } - E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS); + if (!ready) + return -E1000_ERR_PHY; + E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, + E1000_MPHY_DIS_ACCESS); + return E1000_SUCCESS; } Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Aug 15 11:16:43 2016 (r304148) +++ head/sys/dev/e1000/if_em.c Mon Aug 15 11:24:30 2016 (r304149) @@ -193,6 +193,12 @@ static em_vendor_info_t em_vendor_info_a { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V2, PCI_ANY_ID, PCI_ANY_ID, 0}, { 0x8086, E1000_DEV_ID_PCH_LBG_I219_LM3, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_LM4, + PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V4, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_LM5, + PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V5, PCI_ANY_ID, PCI_ANY_ID, 0}, /* required last entry */ { 0, 0, 0, 0, 0} }; From owner-svn-src-head@freebsd.org Mon Aug 15 11:54:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D067BBBAD79; Mon, 15 Aug 2016 11:54:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D0951525; Mon, 15 Aug 2016 11:54:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FBsdNQ026070; Mon, 15 Aug 2016 11:54:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FBsd14026069; Mon, 15 Aug 2016 11:54:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608151154.u7FBsd14026069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Aug 2016 11:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304151 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 11:54:40 -0000 Author: emaste Date: Mon Aug 15 11:54:39 2016 New Revision: 304151 URL: https://svnweb.freebsd.org/changeset/base/304151 Log: elfcopy: silence GCC 5.3 unitialized variable warning Although it's a false positive there is little cost to initializing it always. Submitted by: adrian Modified: head/contrib/elftoolchain/elfcopy/ascii.c Modified: head/contrib/elftoolchain/elfcopy/ascii.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/ascii.c Mon Aug 15 11:54:29 2016 (r304150) +++ head/contrib/elftoolchain/elfcopy/ascii.c Mon Aug 15 11:54:39 2016 (r304151) @@ -251,6 +251,7 @@ create_elf_from_srec(struct elfcopy *ecp sec_index = 1; sec_addr = entry = 0; while (fgets(line, _LINE_BUFSZ, ifp) != NULL) { + sz = 0; /* Silence GCC 5.3 unintialized variable warning */ if (line[0] == '\r' || line[0] == '\n') continue; if (line[0] == '$' && line[1] == '$') { From owner-svn-src-head@freebsd.org Mon Aug 15 12:13:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32AB4BBBDAB; Mon, 15 Aug 2016 12:13:15 +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 02BCF180E; Mon, 15 Aug 2016 12:13:14 +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 u7FCDE25033807; Mon, 15 Aug 2016 12:13:14 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FCDExP033806; Mon, 15 Aug 2016 12:13:14 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201608151213.u7FCDExP033806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 15 Aug 2016 12:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304152 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 12:13:15 -0000 Author: kp Date: Mon Aug 15 12:13:14 2016 New Revision: 304152 URL: https://svnweb.freebsd.org/changeset/base/304152 Log: pf: Add missing byte-order swap to pf_match_addr_range Without this, rules using address ranges (e.g. "10.1.1.1 - 10.1.1.5") did not match addresses correctly on little-endian systems. PR: 211796 Obtained from: OpenBSD (sthen) MFC after: 3 days Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Mon Aug 15 11:54:39 2016 (r304151) +++ head/sys/netpfil/pf/pf.c Mon Aug 15 12:13:14 2016 (r304152) @@ -2600,8 +2600,8 @@ pf_match_addr_range(struct pf_addr *b, s switch (af) { #ifdef INET case AF_INET: - if ((a->addr32[0] < b->addr32[0]) || - (a->addr32[0] > e->addr32[0])) + if ((ntohl(a->addr32[0]) < ntohl(b->addr32[0])) || + (ntohl(a->addr32[0]) > ntohl(e->addr32[0]))) return (0); break; #endif /* INET */ @@ -2611,15 +2611,15 @@ pf_match_addr_range(struct pf_addr *b, s /* check a >= b */ for (i = 0; i < 4; ++i) - if (a->addr32[i] > b->addr32[i]) + if (ntohl(a->addr32[i]) > ntohl(b->addr32[i])) break; - else if (a->addr32[i] < b->addr32[i]) + else if (ntohl(a->addr32[i]) < ntohl(b->addr32[i])) return (0); /* check a <= e */ for (i = 0; i < 4; ++i) - if (a->addr32[i] < e->addr32[i]) + if (ntohl(a->addr32[i]) < ntohl(e->addr32[i])) break; - else if (a->addr32[i] > e->addr32[i]) + else if (ntohl(a->addr32[i]) > ntohl(e->addr32[i])) return (0); break; } From owner-svn-src-head@freebsd.org Mon Aug 15 12:56:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87B25BB97E8; Mon, 15 Aug 2016 12:56:46 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 511261C56; Mon, 15 Aug 2016 12:56:46 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FCujWE048834; Mon, 15 Aug 2016 12:56:45 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FCujHw048832; Mon, 15 Aug 2016 12:56:45 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151256.u7FCujHw048832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 12:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304153 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 12:56:46 -0000 Author: bde Date: Mon Aug 15 12:56:45 2016 New Revision: 304153 URL: https://svnweb.freebsd.org/changeset/base/304153 Log: Quick fix for locking fixes in r172250. The lock added there was per- virtual-device, but needs to be per-physical-device so that it protects shared data. Usually, scp->sc->write_in_progress got corrupted first and further corruption was limited when this variable was left at nonzero with no write in progress. Attempt to fix missing lock destruction in r162285. Put it with the lock destruction for r172250 after moving the latter. Both might be unreachable. To demonstrate the bug, find a buggy syscall or sysctl that calls printf(9) and run this often. Run hd /dev/zero >/dev/ttyvN for any N != 0. The console spam goes to ttyv0 and the non-console spam goes to ttyvN, so the lock provided no protection (but it helped for N == 0). Modified: head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 12:13:14 2016 (r304152) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 12:56:45 2016 (r304153) @@ -2688,13 +2688,13 @@ sc_puts(scr_stat *scp, u_char *buf, int #endif if (scp->tsw) { - if (!kdb_active && !mtx_owned(&scp->scr_lock)) { + if (!kdb_active && !mtx_owned(&scp->sc->scr_lock)) { need_unlock = 1; - mtx_lock_spin(&scp->scr_lock); + mtx_lock_spin(&scp->sc->scr_lock); } (*scp->tsw->te_puts)(scp, buf, len, kernel); if (need_unlock) - mtx_unlock_spin(&scp->scr_lock); + mtx_unlock_spin(&scp->sc->scr_lock); } if (scp->sc->delayed_next_scr) @@ -2859,8 +2859,10 @@ scinit(int unit, int flags) * disappeared... */ sc = sc_get_softc(unit, flags & SC_KERNEL_CONSOLE); - if ((sc->flags & SC_INIT_DONE) == 0) + if ((sc->flags & SC_INIT_DONE) == 0) { + mtx_init(&sc->scr_lock, "scrlock", NULL, MTX_SPIN); SC_VIDEO_LOCKINIT(sc); + } adp = NULL; if (sc->adapter >= 0) { @@ -3077,7 +3079,8 @@ scterm(int unit, int flags) (*scp->tsw->te_term)(scp, &scp->ts); if (scp->ts != NULL) free(scp->ts, M_DEVBUF); - mtx_destroy(&scp->scr_lock); + mtx_destroy(&sc->scr_lock); + mtx_destroy(&sc->video_mtx); /* clear the structure */ if (!(flags & SC_KERNEL_CONSOLE)) { @@ -3302,8 +3305,6 @@ init_scp(sc_softc_t *sc, int vty, scr_st scp->history = NULL; scp->history_pos = 0; scp->history_size = 0; - - mtx_init(&scp->scr_lock, "scrlock", NULL, MTX_SPIN); } int Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Mon Aug 15 12:13:14 2016 (r304152) +++ head/sys/dev/syscons/syscons.h Mon Aug 15 12:56:45 2016 (r304153) @@ -230,6 +230,7 @@ typedef struct sc_softc { char switch_in_progress; char write_in_progress; char blink_in_progress; + struct mtx scr_lock; /* mutex for sc_puts() */ struct mtx video_mtx; long scrn_time_stamp; @@ -344,7 +345,6 @@ typedef struct scr_stat { int splash_save_mode; /* saved mode for splash screen */ int splash_save_status; /* saved status for splash screen */ - struct mtx scr_lock; /* mutex for sc_puts() */ #ifdef _SCR_MD_STAT_DECLARED_ scr_md_stat_t md; /* machine dependent vars */ #endif From owner-svn-src-head@freebsd.org Mon Aug 15 13:06:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19E12BB9D16; Mon, 15 Aug 2016 13:06:31 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE6E71635; Mon, 15 Aug 2016 13:06:30 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FD6USx052655; Mon, 15 Aug 2016 13:06:30 GMT (envelope-from oleg@FreeBSD.org) Received: (from oleg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FD6UUQ052654; Mon, 15 Aug 2016 13:06:30 GMT (envelope-from oleg@FreeBSD.org) Message-Id: <201608151306.u7FD6UUQ052654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oleg set sender to oleg@FreeBSD.org using -f From: Oleg Bulyzhin Date: Mon, 15 Aug 2016 13:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304154 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 13:06:31 -0000 Author: oleg Date: Mon Aug 15 13:06:29 2016 New Revision: 304154 URL: https://svnweb.freebsd.org/changeset/base/304154 Log: Fix command: ipfw set (enable|disable) N (where N > 4). enable_sets() expects set bitmasks, not set numbers. MFC after: 3 days Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Mon Aug 15 12:56:45 2016 (r304153) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Mon Aug 15 13:06:29 2016 (r304154) @@ -1420,8 +1420,10 @@ manage_sets(struct ip_fw_chain *chain, i if (rh->range.head.length != sizeof(ipfw_range_tlv)) return (1); - if (rh->range.set >= IPFW_MAX_SETS || - rh->range.new_set >= IPFW_MAX_SETS) + /* enable_sets() expects bitmasks. */ + if (op3->opcode != IP_FW_SET_ENABLE && + (rh->range.set >= IPFW_MAX_SETS || + rh->range.new_set >= IPFW_MAX_SETS)) return (EINVAL); ret = 0; From owner-svn-src-head@freebsd.org Mon Aug 15 13:16:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CED2BB9F73 for ; Mon, 15 Aug 2016 13:16:05 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt0-x235.google.com (mail-qt0-x235.google.com [IPv6:2607:f8b0:400d:c0d::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8CB21B8B for ; Mon, 15 Aug 2016 13:16:04 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt0-x235.google.com with SMTP id u25so20786818qtb.1 for ; Mon, 15 Aug 2016 06:16:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rTotQyaQ+ZvGaAJ60OJ8mn9rowvJG+3s20l8E/eXMec=; b=hRhpntNWeSv9mlYz2ptbe4b44j1cOiLS1IjsLlCFtCfNwvhceWSqHwS5ApeGJ5U0Zm cyCBqjarE6hPqFIEJw5xND6rBKmRFO+SShhdQyDH36PzMhFbmWIWbRWSlSxbFLdveAt7 seFOGMiI21JcrygOWBcpKCLOxwQEJ+UWD3mD4alxMTiEnCOKxYZJTIRjBmCOV54rV3/I RDQGjIlcXJRtcx9FfNal3+l06AOWSGVjZEqE+ltkJRDmDDXiL1sNiiEmz0bVM10OwN/o ZFRA3cAolc9mNnX0nuXB4ep4E+vViw4hfRpqfhf1xfynGaDyHltC3frK6i7PPuyScUSA gdYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rTotQyaQ+ZvGaAJ60OJ8mn9rowvJG+3s20l8E/eXMec=; b=ko/QngwWnlBh+EZum3xBwReHWdpOWOGkCYXREu+ep+i+PsxvGsvthNDlvcrZ9grmMr zVy7wEgWUhrUj2L7v+WZBt0bseSy487c8j9G3mzIS8Jm3fYquH120Q/viRUZWOmqOn9o s8vIAZ3ZAZooPgzep0trjEH6O505v4arZCUYV+uksN5Q8YPzu9L90tNb7GPonTY9QHMl VIu5CYOTYMjV7a7cA3I+vvZPfxx1P2Ridthy3iH+9cekJGGVl4zMSAs6xZSXxovV+T3s /VOoAQwWxGg5lpBV2bpxvRX6haBw1CjRTvmetikvE5NpSAuvoKgPMHIb5V3/uHX7XKKf KM7w== X-Gm-Message-State: AEkoouusBvUTo6GPf925KhPYizhzCd3gXAFY2hhG4JJ+f2iMdbeJePMsacaJHOBpy+vz1h1w X-Received: by 10.200.43.105 with SMTP id 38mr32459868qtv.73.1471266963940; Mon, 15 Aug 2016 06:16:03 -0700 (PDT) Received: from mutt-hardenedbsd (pool-100-16-219-226.bltmmd.fios.verizon.net. [100.16.219.226]) by smtp.gmail.com with ESMTPSA id w184sm11013537qkw.38.2016.08.15.06.16.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Aug 2016 06:16:02 -0700 (PDT) Date: Mon, 15 Aug 2016 09:16:00 -0400 From: Shawn Webb To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304153 - head/sys/dev/syscons Message-ID: <20160815131600.GA86798@mutt-hardenedbsd> References: <201608151256.u7FCujHw048832@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jRHKVT23PllUwdXP" Content-Disposition: inline In-Reply-To: <201608151256.u7FCujHw048832@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 13:16:05 -0000 --jRHKVT23PllUwdXP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 15, 2016 at 12:56:45PM +0000, Bruce Evans wrote: > Author: bde > Date: Mon Aug 15 12:56:45 2016 > New Revision: 304153 > URL: https://svnweb.freebsd.org/changeset/base/304153 >=20 > Log: > Quick fix for locking fixes in r172250. The lock added there was per- > virtual-device, but needs to be per-physical-device so that it protects > shared data. Usually, scp->sc->write_in_progress got corrupted first > and further corruption was limited when this variable was left at nonze= ro > with no write in progress. > =20 > Attempt to fix missing lock destruction in r162285. Put it with the > lock destruction for r172250 after moving the latter. Both might be > unreachable. > =20 > To demonstrate the bug, find a buggy syscall or sysctl that calls > printf(9) and run this often. Run hd /dev/zero >/dev/ttyvN for any > N !=3D 0. The console spam goes to ttyv0 and the non-console spam goes > to ttyvN, so the lock provided no protection (but it helped for > N =3D=3D 0). >=20 Hey Bruce, Should this be MFC'd after some point? Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --jRHKVT23PllUwdXP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXscCMAAoJEGqEZY9SRW7uxugP/iMpq3pF0akMPnu0Jf/WyuHw CGNCn2bCde1OP0PHUG0u+zkD5ri0N5r2wPanQtbKpw4fS+5SZB0iSnus21BhzUb0 vGkUrfe8TRv0IWwDW5JRa6dFqs5mW7WA+4YpVxH8huarJ00GGyKVpFuSUEPmURHR kCXswD8bx9J4b16myW/wpBv5nvRwtJ5bGoRszDnG/Stk3DMnSRlTYiHr6Wfgi7dz jbHrH4OzdOz9WXzN+JsQ3SOnyX1ruCVzsidLflzdB8O4PXtdB5khewQnSTUiltY4 P5nPpx6drQKCaZeCI+ZnIzc4VScxRaP67YOIgES4EZAtQ310+HoWqWkhIUDcdC6D qDnG71nHiuhhzEyJBKVY2FO+9pLr6e1q0ecDrouv9D2J6O3s2fh8Tmnds+ONRMe/ pNZr5r2QukATM+0NSZSQtF9yVpO+dcFda9neDI6wIWj3Dfx2Tyh3K5LNiioUC3hJ MvYmpYwcwi3dj1GPJXVlDxEusk0n+4w3uOMwXihfwSlK23soVourL1SyvlaEazUd +knWqHKaWQxaytBr/f9KPXEuJ9GsSLu/jv4NdbekocrDFNv1Zv7YyAEkRBj2RsQD 9EzCmbBbqiUNha8Bv9GKPBxOLVTEywwU57my4nznqqpUTT2NtqUDAKATOchvM0zM RHdM/geV/5MhW7IkizzJ =s/uo -----END PGP SIGNATURE----- --jRHKVT23PllUwdXP-- From owner-svn-src-head@freebsd.org Mon Aug 15 14:00:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D25E9BBB35A; Mon, 15 Aug 2016 14:00:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 9D8841BAF; Mon, 15 Aug 2016 14:00:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 4499E785D5B; Mon, 15 Aug 2016 23:40:50 +1000 (AEST) Date: Mon, 15 Aug 2016 23:40:49 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Shawn Webb cc: Bruce Evans , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r304153 - head/sys/dev/syscons In-Reply-To: <20160815131600.GA86798@mutt-hardenedbsd> Message-ID: <20160815231956.X2752@besplex.bde.org> References: <201608151256.u7FCujHw048832@repo.freebsd.org> <20160815131600.GA86798@mutt-hardenedbsd> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=Pl7VVdGIrsZcu9rEHXcA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 14:00:37 -0000 On Mon, 15 Aug 2016, Shawn Webb wrote: > On Mon, Aug 15, 2016 at 12:56:45PM +0000, Bruce Evans wrote: >> >> Log: >> Quick fix for locking fixes in r172250. The lock added there was per- >> virtual-device, but needs to be per-physical-device so that it protects >> shared data. Usually, scp->sc->write_in_progress got corrupted first >> and further corruption was limited when this variable was left at nonzero >> with no write in progress. > ... > > Should this be MFC'd after some point? Possibly. This is a small part of ~60K of patches for locking bugs in console drivers (only ones that I use, syscons and sio) and subr_prf.c and subr_msgbuf.c. It is meant to be safe and easy to merge by itself, but I have too many little patches to merge one at a time. Bruce From owner-svn-src-head@freebsd.org Mon Aug 15 14:28:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8ECABBBBDE7; Mon, 15 Aug 2016 14:28:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61676170C; Mon, 15 Aug 2016 14:28:09 +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 u7FES8Zu084254; Mon, 15 Aug 2016 14:28:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FES8cR084252; Mon, 15 Aug 2016 14:28:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608151428.u7FES8cR084252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Aug 2016 14:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304160 - head/contrib/elftoolchain/libelftc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 14:28:09 -0000 Author: emaste Date: Mon Aug 15 14:28:08 2016 New Revision: 304160 URL: https://svnweb.freebsd.org/changeset/base/304160 Log: elfcopy: add elf64-littleaarch64 output target support Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Modified: head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Mon Aug 15 14:24:47 2016 (r304159) +++ head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Mon Aug 15 14:28:08 2016 (r304160) @@ -89,6 +89,7 @@ Known descriptor names and their propert .It Li elf64-ia64-big Ta ELF Ta MSB Ta 64 .It Li elf64-ia64-little Ta ELF Ta LSB Ta 64 .It Li elf64-little Ta ELF Ta LSB Ta 64 +.It Li elf64-littleaarch64 Ta ELF Ta LSB Ta 64 .It Li elf64-littlemips Ta ELF Ta LSB Ta 64 .It Li elf64-powerpc Ta ELF Ta MSB Ta 64 .It Li elf64-powerpcle Ta ELF Ta LSB Ta 64 Modified: head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Mon Aug 15 14:24:47 2016 (r304159) +++ head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Mon Aug 15 14:28:08 2016 (r304160) @@ -250,6 +250,14 @@ struct _Elftc_Bfd_Target _libelftc_targe }, { + .bt_name = "elf64-littleaarch64", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2LSB, + .bt_elfclass = ELFCLASS64, + .bt_machine = EM_AARCH64, + }, + + { .bt_name = "elf64-littlemips", .bt_type = ETF_ELF, .bt_byteorder = ELFDATA2LSB, From owner-svn-src-head@freebsd.org Mon Aug 15 14:28:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09EF1BBBE25; Mon, 15 Aug 2016 14:28:18 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D866218C5; Mon, 15 Aug 2016 14:28:17 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FESHC1084305; Mon, 15 Aug 2016 14:28:17 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FESH7F084304; Mon, 15 Aug 2016 14:28:17 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151428.u7FESH7F084304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 14:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304161 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 14:28:18 -0000 Author: bde Date: Mon Aug 15 14:28:16 2016 New Revision: 304161 URL: https://svnweb.freebsd.org/changeset/base/304161 Log: Change all uses of 'debugger' to kdb_active and remove this variable. This restores avoidance of doing dangerous things like calling wakeup() and callouts while in ddb. Initialization of 'debugger' was broken by removing the cndbctl() console method that was used mainly in this driver to initialize 'debugger' and switch to the console screen on entry to ddb. The screen switch was restored using the cngrab() method, but cngrab() is more general so it should not initialize 'debugger' and never did. 'debugger' was just an over-engineered alias for kdb_active anyway. It existed because kdb_active (when it was named ddb_active) was considered as a private kdb variable, and there are ordering problems initializing the variables atomically with the state that they represent, but an extra variable and method to set it increased these problems. The bug caused LORs, but WITNESS is normally misconfigured with WITNESS_SKIPSIN so it doesn't check the spinlocks used by wakeup() and callouts. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 14:28:08 2016 (r304160) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 14:28:16 2016 (r304161) @@ -172,8 +172,6 @@ SYSCTL_INT(_machdep, OID_AUTO, enable_pa #define VTY_WCHAN(sc, vty) (&SC_DEV(sc, vty)) -static int debugger; - /* prototypes */ static int sc_allocate_keyboard(sc_softc_t *sc, int unit); static int scvidprobe(int unit, int flags, int cons); @@ -1815,7 +1813,7 @@ sccnupdate(scr_stat *scp) if (suspend_in_progress || scp->sc->font_loading_in_progress) return; - if (debugger > 0 || panicstr || shutdown_in_progress) { + if (kdb_active || panicstr || shutdown_in_progress) { sc_touch_scrn_saver(); } else if (scp != scp->sc->cur_scp) { return; @@ -1884,7 +1882,7 @@ scrn_timer(void *arg) #endif /* PC98 */ /* should we stop the screen saver? */ - if (debugger > 0 || panicstr || shutdown_in_progress) + if (kdb_active || panicstr || shutdown_in_progress) sc_touch_scrn_saver(); if (run_scrn_saver) { if (time_uptime > sc->scrn_time_stamp + scrn_blank_time) @@ -2279,7 +2277,7 @@ stop_scrn_saver(sc_softc_t *sc, void (*s mark_all(sc->cur_scp); if (sc->delayed_next_scr) sc_switch_scr(sc, sc->delayed_next_scr - 1); - if (debugger == 0) + if (!kdb_active) wakeup(&scrn_blanked); } @@ -2474,7 +2472,7 @@ sc_switch_scr(sc_softc_t *sc, u_int next DPRINTF(5, ("error 2, requested vty isn't open!\n")); return EINVAL; } - if ((debugger > 0) && (SC_STAT(tp)->smode.mode == VT_PROCESS)) { + if (kdb_active && SC_STAT(tp)->smode.mode == VT_PROCESS) { splx(s); DPRINTF(5, ("error 3, requested vty is in the VT_PROCESS mode\n")); return EINVAL; @@ -2495,7 +2493,7 @@ sc_switch_scr(sc_softc_t *sc, u_int next * is supposed to be locked by splhigh(), but the debugger may * be invoked at splhigh(). */ - if (debugger == 0) + if (!kdb_active) wakeup(VTY_WCHAN(sc,next_scr)); splx(s); DPRINTF(5, ("switch done (new == old)\n")); @@ -2518,7 +2516,7 @@ sc_switch_scr(sc_softc_t *sc, u_int next s = spltty(); /* wake up processes waiting for this vty */ - if (debugger == 0) + if (!kdb_active) wakeup(VTY_WCHAN(sc,next_scr)); /* wait for the controlling process to acknowledge, if necessary */ From owner-svn-src-head@freebsd.org Mon Aug 15 14:58:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE631BB9831; Mon, 15 Aug 2016 14:58:26 +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 BF5211C2F; Mon, 15 Aug 2016 14:58:26 +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 u7FEwP5c095538; Mon, 15 Aug 2016 14:58:25 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FEwPjt095537; Mon, 15 Aug 2016 14:58:25 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201608151458.u7FEwPjt095537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 15 Aug 2016 14:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304162 - head/etc/periodic/daily X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 14:58:27 -0000 Author: asomers Date: Mon Aug 15 14:58:25 2016 New Revision: 304162 URL: https://svnweb.freebsd.org/changeset/base/304162 Log: Decrease the anti-congestion sleep in 480.leapfile-ntpd to 1 hour 24 hours is too long. Periodic scripts are executed serially, so when combined with the sleep in 410.pkg-audit periodic could actually take more than 24 hours and block the next invocation. Reviewed by: cy MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D7481 Modified: head/etc/periodic/daily/480.leapfile-ntpd Modified: head/etc/periodic/daily/480.leapfile-ntpd ============================================================================== --- head/etc/periodic/daily/480.leapfile-ntpd Mon Aug 15 14:28:16 2016 (r304161) +++ head/etc/periodic/daily/480.leapfile-ntpd Mon Aug 15 14:58:25 2016 (r304162) @@ -16,7 +16,7 @@ case "$daily_ntpd_leapfile_enable" in case "$daily_ntpd_avoid_congestion" in [Yy][Ee][Ss]) # Avoid dogpiling - (sleep $(jot -r 1 0 86400); service ntpd onefetch) & + (sleep $(jot -r 1 0 3600); service ntpd onefetch) & ;; *) service ntpd onefetch From owner-svn-src-head@freebsd.org Mon Aug 15 15:04:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B2F8BB9ABD; Mon, 15 Aug 2016 15:04:35 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3FF311F4; Mon, 15 Aug 2016 15:04:34 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7FF4QsD010802 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 15 Aug 2016 08:04:26 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608150930.u7F9UL1V069576@repo.freebsd.org> From: Nathan Whitehorn Message-ID: Date: Mon, 15 Aug 2016 08:04:26 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201608150930.u7F9UL1V069576@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVb1e6vFjtl//K5a9p8n/04csfrrJgbdILv/jOPBoIVnE7PDyDxFA6m2+zCbrWZpkexRPiif6eI+MLiJERfd5iuTHtm8rUBUCuM= X-Sonic-ID: C;pJyvjvli5hG3j6Dx2xNB0g== M;5rcBj/li5hG3j6Dx2xNB0g== 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.22 Precedence: list List-Id: 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, 15 Aug 2016 15:04:35 -0000 As a note for people who weren't paying attention to the bug, we need to fix this in a better way outside of the constraints of getting 11.0 out the door. The system (gpart, the installer, ZFS, etc.) uses the reported GEOM stripesize for partition alignment and IO block size selection. If that is wrong, we should identify devices on which it is wrong and fix them, and maybe also add some global tunable that sets a floor on the numbers reported by GEOM_DISK. Hacking the installer like this is triage, which is fine, but not viable as a permanent solution to anything. -Nathan On 08/15/16 02:30, Dag-Erling Smørgrav wrote: > Author: des > Date: Mon Aug 15 09:30:21 2016 > New Revision: 304142 > URL: https://svnweb.freebsd.org/changeset/base/304142 > > Log: > Ensure that the sector size is a multiple of 4096 to avoid creating > unaligned partitions when the actual sector size is hidden from us. > > PR: 211361 > MFC after: 3 days > > Modified: > head/usr.sbin/bsdinstall/partedit/gpart_ops.c > > Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c > ============================================================================== > --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Aug 15 09:27:15 2016 (r304141) > +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Aug 15 09:30:21 2016 (r304142) > @@ -795,6 +795,7 @@ gpart_max_free(struct ggeom *geom, intma > { > struct gconfig *gc; > struct gprovider *pp, **providers; > + intmax_t sectorsize, stripesize, offset; > intmax_t lastend; > intmax_t start, end; > intmax_t maxsize, maxstart; > @@ -845,12 +846,25 @@ gpart_max_free(struct ggeom *geom, intma > > pp = LIST_FIRST(&geom->lg_consumer)->lg_provider; > > - /* Compute beginning of new partition and maximum available space */ > - if (pp->lg_stripesize > 0 && > - (maxstart*pp->lg_sectorsize % pp->lg_stripesize) != 0) { > - intmax_t offset = (pp->lg_stripesize - > - ((maxstart*pp->lg_sectorsize) % pp->lg_stripesize)) / > - pp->lg_sectorsize; > + /* > + * Round the start and size of the largest available space up to > + * the nearest multiple of the adjusted stripe size. > + * > + * The adjusted stripe size is the least common multiple of the > + * actual stripe size, or the sector size if no stripe size was > + * reported, and 4096. The reason for this is that contemporary > + * disks often have 4096-byte physical sectors but report 512 > + * bytes instead for compatibility with older / broken operating > + * systems and BIOSes. For the same reasons, virtualized storage > + * may also report a 512-byte stripe size, or none at all. > + */ > + sectorsize = pp->lg_sectorsize; > + if ((stripesize = pp->lg_stripesize) == 0) > + stripesize = sectorsize; > + while (stripesize % 4096 != 0) > + stripesize *= 2; > + if ((offset = maxstart * sectorsize % stripesize) != 0) { > + offset = (stripesize - offset) / sectorsize; > maxstart += offset; > maxsize -= offset; > } > From owner-svn-src-head@freebsd.org Mon Aug 15 15:34:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8D8EBBA29F; Mon, 15 Aug 2016 15:34:54 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 810CD17B1; Mon, 15 Aug 2016 15:34:54 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FFYrvK011506; Mon, 15 Aug 2016 15:34:53 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FFYrwj011505; Mon, 15 Aug 2016 15:34:53 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151534.u7FFYrwj011505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 15:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304164 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 15:34:54 -0000 Author: bde Date: Mon Aug 15 15:34:53 2016 New Revision: 304164 URL: https://svnweb.freebsd.org/changeset/base/304164 Log: Disable some more unsafe things in (low level) console mode: - never call up to the tty layer to restart output for keyboard input in console mode. This was already disallowed in kdb mode. Other cases are rarely reached. - disable the reboot, halt and powerdown keys in console mode. The suspend, standby and panic keys are still allowed, and aren't even conditonal on excessive configuration options. Some of these actions are still available in ddb mode as ddb commands which are equally unsafe. Some are useful at input prompts and should be restored when the locking is fixed. - disallow bells in kdb mode (should be in console mode, but the flag for that is not available). Visual bell gives very alarming behaviour by trying to use callouts which don't work in kdb mode. Audio bell uses timeouts and hardware resources with mutexes that can deadlock in reasonable use of ddb. Screen switches in kdb mode are not very safe, but they are important functionality and there is a lot of code to make them sort of work. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 15:23:45 2016 (r304163) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 15:34:53 2016 (r304164) @@ -3505,8 +3505,9 @@ next_code: scp->status |= CURSOR_ENABLED; sc_draw_cursor_image(scp); } + /* Only safe in Giant-locked context. */ tp = SC_DEV(sc, scp->index); - if (!kdb_active && tty_opened_ns(tp)) + if (!(flags & SCGETC_CN) && tty_opened_ns(tp)) sctty_outwakeup(tp); #endif } @@ -3557,21 +3558,21 @@ next_code: case RBT: #ifndef SC_DISABLE_REBOOT - if (enable_reboot) + if (enable_reboot && !(flags & SCGETC_CN)) shutdown_nice(0); #endif break; case HALT: #ifndef SC_DISABLE_REBOOT - if (enable_reboot) + if (enable_reboot && !(flags & SCGETC_CN)) shutdown_nice(RB_HALT); #endif break; case PDWN: #ifndef SC_DISABLE_REBOOT - if (enable_reboot) + if (enable_reboot && !(flags & SCGETC_CN)) shutdown_nice(RB_HALT|RB_POWEROFF); #endif break; @@ -3842,7 +3843,7 @@ sc_respond(scr_stat *scp, const u_char * void sc_bell(scr_stat *scp, int pitch, int duration) { - if (cold || shutdown_in_progress || !enable_bell) + if (cold || kdb_active || shutdown_in_progress || !enable_bell) return; if (scp != scp->sc->cur_scp && (scp->sc->flags & SC_QUIET_BELL)) From owner-svn-src-head@freebsd.org Mon Aug 15 17:08:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75544BBBF43; Mon, 15 Aug 2016 17:08:26 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45D3D1F0E; Mon, 15 Aug 2016 17:08:26 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FH8PRc046275; Mon, 15 Aug 2016 17:08:25 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FH8Pfp046274; Mon, 15 Aug 2016 17:08:25 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151708.u7FH8Pfp046274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 17:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304165 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 17:08:26 -0000 Author: bde Date: Mon Aug 15 17:08:25 2016 New Revision: 304165 URL: https://svnweb.freebsd.org/changeset/base/304165 Log: Like scr_lock, the grab count needs to be per-physical-device to work. This bug corrupted the grab count on both vtys if the ungrabbed vty is different from the console, and failed to restore the keyboard state on the ungrabbed vty, but not restoring the latter usually left the keyboard mode part of it uncorrupted at 1 (K_XLATE), while after this fix the keyboard mode part is usually corrupted to 0 (K_RAW). While here, rename the grab count from 'grabbed' to grab_level. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 15:34:53 2016 (r304164) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 17:08:25 2016 (r304165) @@ -1661,7 +1661,7 @@ sc_cngrab(struct consdev *cp) if (scp->sc->kbd == NULL) return; - if (scp->grabbed++ > 0) + if (scp->sc->grab_level++ > 0) return; /* @@ -1687,7 +1687,7 @@ sc_cnungrab(struct consdev *cp) if (scp->sc->kbd == NULL) return; - if (--scp->grabbed > 0) + if (--scp->sc->grab_level > 0) return; kbdd_poll(scp->sc->kbd, FALSE); From owner-svn-src-head@freebsd.org Mon Aug 15 17:11:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F6B5BBA051; Mon, 15 Aug 2016 17:11:07 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E309612F2; Mon, 15 Aug 2016 17:11:06 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FHB6Kn046460; Mon, 15 Aug 2016 17:11:06 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FHB6n9046459; Mon, 15 Aug 2016 17:11:06 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151711.u7FHB6n9046459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 17:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304166 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 17:11:07 -0000 Author: bde Date: Mon Aug 15 17:11:05 2016 New Revision: 304166 URL: https://svnweb.freebsd.org/changeset/base/304166 Log: [Oops, the previous commit was missing the update to syscons.h.] Like scr_lock, the grab count needs to be per-physical-device to work. This bug corrupted the grab count on both vtys if the ungrabbed vty is different from the console, and failed to restore the keyboard state on the ungrabbed vty, but not restoring it usually left the keyboard mode part of the keyboard state uncorrupted at 1 (K_XLATE), while after this fix the keyboard mode part is usually corrupted to 0 (K_RAW). While here, rename the grab count from grabbed to grab_level. Modified: head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Mon Aug 15 17:08:25 2016 (r304165) +++ head/sys/dev/syscons/syscons.h Mon Aug 15 17:11:05 2016 (r304166) @@ -230,6 +230,7 @@ typedef struct sc_softc { char switch_in_progress; char write_in_progress; char blink_in_progress; + int grab_level; struct mtx scr_lock; /* mutex for sc_puts() */ struct mtx video_mtx; @@ -304,7 +305,6 @@ typedef struct scr_stat { void *ts; int status; /* status (bitfield) */ - int grabbed; int kbd_mode; /* keyboard I/O mode */ int kbd_prev_mode; /* keyboard I/O mode */ From owner-svn-src-head@freebsd.org Mon Aug 15 17:40:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4A71BBAA66; Mon, 15 Aug 2016 17:40:06 +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 ACB8A1921; Mon, 15 Aug 2016 17:40:06 +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 u7FHe5BL057957; Mon, 15 Aug 2016 17:40:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FHe5vh057953; Mon, 15 Aug 2016 17:40:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608151740.u7FHe5vh057953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Aug 2016 17:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304168 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 17:40:06 -0000 Author: jhb Date: Mon Aug 15 17:40:05 2016 New Revision: 304168 URL: https://svnweb.freebsd.org/changeset/base/304168 Log: Make SGE parameter handling more VF-friendly. Add fields to hold the SGE control register and free list buffer sizes to the sge_params structure. Populate these new fields in t4_init_sge_params() for PF devices and change t4_read_chip_settings() to pull these values out of the params structure instead of reading registers directly. This will permit t4_read_chip_settings() to be reused for VF devices which cannot read SGE registers directly. While here, move the call to t4_init_sge_params() to get_params__post_init(). The VF driver will populate the SGE parameters structure via a different method before calling t4_read_chip_settings(). Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7476 Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Mon Aug 15 17:37:28 2016 (r304167) +++ head/sys/dev/cxgbe/common/common.h Mon Aug 15 17:40:05 2016 (r304168) @@ -215,6 +215,8 @@ struct sge_params { int pad_boundary; int pack_boundary; int fl_pktshift; + u32 sge_control; + u32 sge_fl_buffer_size[SGE_FLBUF_SIZES]; }; struct tp_params { Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 15 17:37:28 2016 (r304167) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 15 17:40:05 2016 (r304168) @@ -7644,6 +7644,7 @@ int t4_init_sge_params(struct adapter *a { u32 r; struct sge_params *sp = &adapter->params.sge; + unsigned i; r = t4_read_reg(adapter, A_SGE_INGRESS_RX_THRESHOLD); sp->counter_val[0] = G_THRESHOLD_0(r); @@ -7686,6 +7687,7 @@ int t4_init_sge_params(struct adapter *a sp->page_shift = (r & M_HOSTPAGESIZEPF0) + 10; r = t4_read_reg(adapter, A_SGE_CONTROL); + sp->sge_control = r; sp->spg_len = r & F_EGRSTATUSPAGESIZE ? 128 : 64; sp->fl_pktshift = G_PKTSHIFT(r); sp->pad_boundary = 1 << (G_INGPADBOUNDARY(r) + 5); @@ -7698,6 +7700,9 @@ int t4_init_sge_params(struct adapter *a else sp->pack_boundary = 1 << (G_INGPACKBOUNDARY(r) + 5); } + for (i = 0; i < SGE_FLBUF_SIZES; i++) + sp->sge_fl_buffer_size[i] = t4_read_reg(adapter, + A_SGE_FL_BUFFER_SIZE0 + (4 * i)); return 0; } Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Aug 15 17:37:28 2016 (r304167) +++ head/sys/dev/cxgbe/t4_main.c Mon Aug 15 17:40:05 2016 (r304168) @@ -3332,6 +3332,8 @@ get_params__post_init(struct adapter *sc sc->vres.iscsi.size = val[1] - val[0] + 1; } + t4_init_sge_params(sc); + /* * We've got the params we wanted to query via the firmware. Now grab * some others directly from the chip. Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Aug 15 17:37:28 2016 (r304167) +++ head/sys/dev/cxgbe/t4_sge.c Mon Aug 15 17:40:05 2016 (r304168) @@ -625,11 +625,9 @@ t4_read_chip_settings(struct adapter *sc struct sw_zone_info *swz, *safe_swz; struct hw_buf_info *hwb; - t4_init_sge_params(sc); - m = F_RXPKTCPLMODE; v = F_RXPKTCPLMODE; - r = t4_read_reg(sc, A_SGE_CONTROL); + r = sc->params.sge.sge_control; if ((r & m) != v) { device_printf(sc->dev, "invalid SGE_CONTROL(0x%x)\n", r); rc = EINVAL; @@ -647,7 +645,7 @@ t4_read_chip_settings(struct adapter *sc /* Filter out unusable hw buffer sizes entirely (mark with -2). */ hwb = &s->hw_buf_info[0]; for (i = 0; i < nitems(s->hw_buf_info); i++, hwb++) { - r = t4_read_reg(sc, A_SGE_FL_BUFFER_SIZE0 + (4 * i)); + r = sc->params.sge.sge_fl_buffer_size[i]; hwb->size = r; hwb->zidx = hwsz_ok(sc, r) ? -1 : -2; hwb->next = -1; From owner-svn-src-head@freebsd.org Mon Aug 15 17:41:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82662BBACB9; Mon, 15 Aug 2016 17:41:35 +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 38EE61D04; Mon, 15 Aug 2016 17:41: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 u7FHfYOW059280; Mon, 15 Aug 2016 17:41:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FHfY7a059279; Mon, 15 Aug 2016 17:41:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608151741.u7FHfY7a059279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Aug 2016 17:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304169 - head/sys/dev/cxgbe/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 17:41:35 -0000 Author: jhb Date: Mon Aug 15 17:41:34 2016 New Revision: 304169 URL: https://svnweb.freebsd.org/changeset/base/304169 Log: Update mailbox writes to work with VF devices. - Use alternate register locations for the data and control registers for VFs. - Do a dummy read to force the writes to the mailbox data registers to post before the write to the control register on VFs. - Do not check the PCI-e firmware register for errors on VFs. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7483 Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 15 17:40:05 2016 (r304168) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 15 17:41:34 2016 (r304169) @@ -289,6 +289,14 @@ int t4_wr_mbox_meat_timeout(struct adapt if ((size & 15) || size > MBOX_LEN) return -EINVAL; + if (adap->flags & IS_VF) { + if (is_t6(adap)) + data_reg = FW_T6VF_MBDATA_BASE_ADDR; + else + data_reg = FW_T4VF_MBDATA_BASE_ADDR; + ctl_reg = VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL); + } + /* * If we have a negative timeout, that implies that we can't sleep. */ @@ -343,6 +351,22 @@ int t4_wr_mbox_meat_timeout(struct adapt for (i = 0; i < size; i += 8, p++) t4_write_reg64(adap, data_reg + i, be64_to_cpu(*p)); + if (adap->flags & IS_VF) { + /* + * For the VFs, the Mailbox Data "registers" are + * actually backed by T4's "MA" interface rather than + * PL Registers (as is the case for the PFs). Because + * these are in different coherency domains, the write + * to the VF's PL-register-backed Mailbox Control can + * race in front of the writes to the MA-backed VF + * Mailbox Data "registers". So we need to do a + * read-back on at least one byte of the VF Mailbox + * Data registers before doing the write to the VF + * Mailbox Control register. + */ + t4_read_reg(adap, data_reg); + } + CH_DUMP_MBOX(adap, mbox, data_reg); t4_write_reg(adap, ctl_reg, F_MBMSGVALID | V_MBOWNER(X_MBOWNER_FW)); @@ -355,10 +379,13 @@ int t4_wr_mbox_meat_timeout(struct adapt * Loop waiting for the reply; bail out if we time out or the firmware * reports an error. */ - for (i = 0; - !((pcie_fw = t4_read_reg(adap, A_PCIE_FW)) & F_PCIE_FW_ERR) && - i < timeout; - i += ms) { + pcie_fw = 0; + for (i = 0; i < timeout; i += ms) { + if (!(adap->flags & IS_VF)) { + pcie_fw = t4_read_reg(adap, A_PCIE_FW); + if (pcie_fw & F_PCIE_FW_ERR) + break; + } if (sleep_ok) { ms = delay[delay_idx]; /* last element may repeat */ if (delay_idx < ARRAY_SIZE(delay) - 1) From owner-svn-src-head@freebsd.org Mon Aug 15 17:42:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEA1CBBAD41; Mon, 15 Aug 2016 17:42: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 C9FE31147; Mon, 15 Aug 2016 17:42: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 u7FHgttX061375; Mon, 15 Aug 2016 17:42:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FHgsXs061373; Mon, 15 Aug 2016 17:42:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608151742.u7FHgsXs061373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Aug 2016 17:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304170 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 17:42:56 -0000 Author: jhb Date: Mon Aug 15 17:42:54 2016 New Revision: 304170 URL: https://svnweb.freebsd.org/changeset/base/304170 Log: Add support for register dumps on VF devices. - Add handling of VF register sets to t4_get_regs_len() and t4_get_regs(). - While here, use t4_get_regs_len() in the ioctl handler for regdump instead of inlining it. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7484 Modified: head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 15 17:41:34 2016 (r304169) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 15 17:42:54 2016 (r304170) @@ -725,10 +725,14 @@ unsigned int t4_get_regs_len(struct adap switch (chip_version) { case CHELSIO_T4: + if (adapter->flags & IS_VF) + return FW_T4VF_REGMAP_SIZE; return T4_REGMAP_SIZE; case CHELSIO_T5: case CHELSIO_T6: + if (adapter->flags & IS_VF) + return FW_T4VF_REGMAP_SIZE; return T5_REGMAP_SIZE; } @@ -1207,6 +1211,18 @@ void t4_get_regs(struct adapter *adap, u 0x27e00, 0x27e04, }; + static const unsigned int t4vf_reg_ranges[] = { + VF_SGE_REG(A_SGE_VF_KDOORBELL), VF_SGE_REG(A_SGE_VF_GTS), + VF_MPS_REG(A_MPS_VF_CTL), + VF_MPS_REG(A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H), + VF_PL_REG(A_PL_VF_WHOAMI), VF_PL_REG(A_PL_VF_WHOAMI), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_STATUS), + FW_T4VF_MBDATA_BASE_ADDR, + FW_T4VF_MBDATA_BASE_ADDR + + ((NUM_CIM_PF_MAILBOX_DATA_INSTANCES - 1) * 4), + }; + static const unsigned int t5_reg_ranges[] = { 0x1008, 0x10c0, 0x10cc, 0x10f8, @@ -1982,6 +1998,18 @@ void t4_get_regs(struct adapter *adap, u 0x51300, 0x51308, }; + static const unsigned int t5vf_reg_ranges[] = { + VF_SGE_REG(A_SGE_VF_KDOORBELL), VF_SGE_REG(A_SGE_VF_GTS), + VF_MPS_REG(A_MPS_VF_CTL), + VF_MPS_REG(A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H), + VF_PL_REG(A_PL_VF_WHOAMI), VF_PL_REG(A_PL_VF_REVISION), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_STATUS), + FW_T4VF_MBDATA_BASE_ADDR, + FW_T4VF_MBDATA_BASE_ADDR + + ((NUM_CIM_PF_MAILBOX_DATA_INSTANCES - 1) * 4), + }; + static const unsigned int t6_reg_ranges[] = { 0x1008, 0x101c, 0x1024, 0x10a8, @@ -2559,6 +2587,18 @@ void t4_get_regs(struct adapter *adap, u 0x51300, 0x51324, }; + static const unsigned int t6vf_reg_ranges[] = { + VF_SGE_REG(A_SGE_VF_KDOORBELL), VF_SGE_REG(A_SGE_VF_GTS), + VF_MPS_REG(A_MPS_VF_CTL), + VF_MPS_REG(A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H), + VF_PL_REG(A_PL_VF_WHOAMI), VF_PL_REG(A_PL_VF_REVISION), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_STATUS), + FW_T6VF_MBDATA_BASE_ADDR, + FW_T6VF_MBDATA_BASE_ADDR + + ((NUM_CIM_PF_MAILBOX_DATA_INSTANCES - 1) * 4), + }; + u32 *buf_end = (u32 *)(buf + buf_size); const unsigned int *reg_ranges; int reg_ranges_size, range; @@ -2570,18 +2610,33 @@ void t4_get_regs(struct adapter *adap, u */ switch (chip_version) { case CHELSIO_T4: - reg_ranges = t4_reg_ranges; - reg_ranges_size = ARRAY_SIZE(t4_reg_ranges); + if (adap->flags & IS_VF) { + reg_ranges = t4vf_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t4vf_reg_ranges); + } else { + reg_ranges = t4_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t4_reg_ranges); + } break; case CHELSIO_T5: - reg_ranges = t5_reg_ranges; - reg_ranges_size = ARRAY_SIZE(t5_reg_ranges); + if (adap->flags & IS_VF) { + reg_ranges = t5vf_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t5vf_reg_ranges); + } else { + reg_ranges = t5_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t5_reg_ranges); + } break; case CHELSIO_T6: - reg_ranges = t6_reg_ranges; - reg_ranges_size = ARRAY_SIZE(t6_reg_ranges); + if (adap->flags & IS_VF) { + reg_ranges = t6vf_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t6vf_reg_ranges); + } else { + reg_ranges = t6_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t6_reg_ranges); + } break; default: Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Aug 15 17:41:34 2016 (r304169) +++ head/sys/dev/cxgbe/t4_main.c Mon Aug 15 17:42:54 2016 (r304170) @@ -8765,7 +8765,7 @@ t4_ioctl(struct cdev *dev, unsigned long } case CHELSIO_T4_REGDUMP: { struct t4_regdump *regs = (struct t4_regdump *)data; - int reglen = is_t4(sc) ? T4_REGDUMP_SIZE : T5_REGDUMP_SIZE; + int reglen = t4_get_regs_len(sc); uint8_t *buf; if (regs->len < reglen) { From owner-svn-src-head@freebsd.org Mon Aug 15 18:02:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E195BBB6CD; Mon, 15 Aug 2016 18:02:38 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63B2D136A; Mon, 15 Aug 2016 18:02:38 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FI2blC069370; Mon, 15 Aug 2016 18:02:37 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FI2bBf069368; Mon, 15 Aug 2016 18:02:37 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151802.u7FI2bBf069368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 18:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304173 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 18:02:38 -0000 Author: bde Date: Mon Aug 15 18:02:37 2016 New Revision: 304173 URL: https://svnweb.freebsd.org/changeset/base/304173 Log: Fix restoring the kbd_mode part of the keyboard state in grab/ungrab. Simply change the mode to K_XLATE using a local variable and use the grab level as a flag to tell screen switches not to change it again, so that we don't need to switch scp->kbd_mode. We did the latter, but didn't have the complications to update the keyboard mode switch for every screen switch. sc->kbd_mode remains at its user setting for all scp's and ungrabbing restores to it. Modified: head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 17:58:12 2016 (r304172) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 18:02:37 2016 (r304173) @@ -1649,6 +1649,7 @@ static void sc_cngrab(struct consdev *cp) { scr_stat *scp; + int kbd_mode; if (!cold && sc_console->sc->cur_scp->index != sc_console->index && @@ -1670,11 +1671,9 @@ sc_cngrab(struct consdev *cp) */ kbdd_enable(scp->sc->kbd); - /* we shall always use the keyboard in the XLATE mode here */ - scp->kbd_prev_mode = scp->kbd_mode; - scp->kbd_mode = K_XLATE; - (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); - + /* Switch the keyboard to console mode (K_XLATE, polled) on all scp's. */ + kbd_mode = K_XLATE; + (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&kbd_mode); kbdd_poll(scp->sc->kbd, TRUE); } @@ -1690,10 +1689,10 @@ sc_cnungrab(struct consdev *cp) if (--scp->sc->grab_level > 0) return; + /* Restore keyboard mode (for the current, possibly-changed scp). */ kbdd_poll(scp->sc->kbd, FALSE); - - scp->kbd_mode = scp->kbd_prev_mode; (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + kbdd_disable(scp->sc->kbd); } @@ -2667,7 +2666,7 @@ exchange_scr(sc_softc_t *sc) sc_set_border(scp, scp->border); /* set up the keyboard for the new screen */ - if (sc->old_scp->kbd_mode != scp->kbd_mode) + if (sc->grab_level == 0 && sc->old_scp->kbd_mode != scp->kbd_mode) (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); update_kbd_state(scp, scp->status, LOCK_MASK); @@ -3412,7 +3411,7 @@ next_code: if (!(flags & SCGETC_CN)) random_harvest_queue(&c, sizeof(c), 1, RANDOM_KEYBOARD); - if (scp->kbd_mode != K_XLATE) + if (sc->grab_level == 0 && scp->kbd_mode != K_XLATE) return KEYCHAR(c); /* if scroll-lock pressed allow history browsing */ Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Mon Aug 15 17:58:12 2016 (r304172) +++ head/sys/dev/syscons/syscons.h Mon Aug 15 18:02:37 2016 (r304173) @@ -306,7 +306,6 @@ typedef struct scr_stat { int status; /* status (bitfield) */ int kbd_mode; /* keyboard I/O mode */ - int kbd_prev_mode; /* keyboard I/O mode */ int cursor_pos; /* cursor buffer position */ int cursor_oldpos; /* cursor old buffer position */ From owner-svn-src-head@freebsd.org Mon Aug 15 18:15:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F9A0BBBA2A; Mon, 15 Aug 2016 18:15:52 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB07C1B7B; Mon, 15 Aug 2016 18:15:51 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.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 0F2B81FE022; Mon, 15 Aug 2016 20:15:47 +0200 (CEST) Subject: Re: svn commit: r303848 - head/sys/netgraph To: "Ngie Cooper (yaneurabeya)" , Gleb Smirnoff References: <201608081931.u78JV1Ve026577@repo.freebsd.org> <20160812183845.GJ1076@FreeBSD.org> <96EEC230-97EA-4686-9AFC-D5D6F98E70E8@gmail.com> Cc: Sean Bruno , Michael Zhilin , Garrett Cooper , sergey.dyatko@gmail.com, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <9055748a-51c1-c6d7-b22d-52abde4d01f7@selasky.org> Date: Mon, 15 Aug 2016 20:20:15 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <96EEC230-97EA-4686-9AFC-D5D6F98E70E8@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 18:15:52 -0000 On 08/13/16 00:23, Ngie Cooper (yaneurabeya) wrote: > >> On Aug 12, 2016, at 11:38, Gleb Smirnoff wrote: >> >> Hi! >> >> Sorry, I'm afraid this isn't a correct fix. Simply adding checks >> against NULL to avoid panics at race conditions isn't a solution. >> >> I can provide help with this problem. It must be related to my >> callout changes, in case if this is a very recent problem. >> >> Is it a recent problem or an old one? > > I should have requested that the change be revised or further qualified first… as I said in the CR: > > “â€â€ > In D7209#150056, @bz wrote: > Is this sudden problem possibly related to glebius' callout changes? I am not properly tracking things but if invariants changed and weren't reflected in the callers, that might explain. > I don't know to be honest. > > I'll add glebius (I should have done that in the first place). > “â€â€ > Hi Ngie, Is this problem reproducable with projects/hps_head? --HPS From owner-svn-src-head@freebsd.org Mon Aug 15 18:49:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 778F0BBBF0D; Mon, 15 Aug 2016 18:49:01 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com [IPv6:2607:f8b0:400e:c03::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4620419BD; Mon, 15 Aug 2016 18:49:01 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x22f.google.com with SMTP id pp5so18292124pac.3; Mon, 15 Aug 2016 11:49:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=9kXm3y3lUyP1rygkDzpm4lf/INCaGxNu8b4WtOhmvU8=; b=mKFqAOza48FwG6T1B2Jmx8QQTkF+cfsxG6/u7JUAB72rG6CYogYTFFsyWNwWKvL770 T8MQN61GsdqHfawWivLZve+kWrn5j+gnwECBBgIeoVi2H5hEBxX2PTvdReUn3q0lrXg2 H2Oo65M+ChCeG/sd/XFYUz405P9IgSjA8LYk79Y8I7FG3YL/u+CULkGjaByuS8m72Y2H IzRF90PkpOk5RZhScrDdLHiAOeBObeVrC9+srCzSoergGqQYaQ1gd3im7TkRp0HUtGBY o0jpSQtsF0gV1T4vS5pG7gJDVu6VsS5dKoRiIBbwAQNIMMzSAk8Raw2O+VHUKBg8JYME vaag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=9kXm3y3lUyP1rygkDzpm4lf/INCaGxNu8b4WtOhmvU8=; b=kFkpRDiuo6aEI9Wlz5SQQ0xG9IVH6GuaOQWDIINgm8+c3owoOsCQyvH4/eBTcI2TlV Cu+yhhx1Ad18SLH9lPD3HXRjD1sptV5YPtWfSf4X6P+F4NJRoB9EZ7aprDfv7V8NDdrE dSf/u2E82XJGcNB+wyw7PWiK+ViP8jHc8qnzdT3P1spE0k7kYDsRj3VNFvyE8gLZQd0N pQCwahsUzeJzP1pfj4t7PAPdtXErNGBdM3opCIm26nL2is+XcCacvvIUCRyTfHhygnF9 t/rrdh9lx51j3CZyCKcS74BtKqiiZhLYu9dCe2hPBh1PawlvTeWwCddlBDyKxRVEyGzd ZH8Q== X-Gm-Message-State: AEkoousbmb4nxRpBaMzx2BtVtxp+gF7SXAhEqBu2LgKPCd0RdRPlW4OqrChktOrJYdcnAA== X-Received: by 10.67.1.35 with SMTP id bd3mr56400238pad.16.1471286940729; Mon, 15 Aug 2016 11:49:00 -0700 (PDT) Received: from [21.177.19.242] ([172.56.42.172]) by smtp.gmail.com with ESMTPSA id fe8sm33321749pad.2.2016.08.15.11.48.59 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Aug 2016 11:49:00 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r303848 - head/sys/netgraph From: Ngie Cooper X-Mailer: iPhone Mail (13G35) In-Reply-To: <9055748a-51c1-c6d7-b22d-52abde4d01f7@selasky.org> Date: Mon, 15 Aug 2016 11:48:58 -0700 Cc: Gleb Smirnoff , Sean Bruno , Michael Zhilin , Garrett Cooper , sergey.dyatko@gmail.com, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <94EC323B-F059-43F4-8775-4FEDAB6C17B1@gmail.com> References: <201608081931.u78JV1Ve026577@repo.freebsd.org> <20160812183845.GJ1076@FreeBSD.org> <96EEC230-97EA-4686-9AFC-D5D6F98E70E8@gmail.com> <9055748a-51c1-c6d7-b22d-52abde4d01f7@selasky.org> To: Hans Petter Selasky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 18:49:01 -0000 Hi Hans, > On Aug 15, 2016, at 11:20, Hans Petter Selasky wrote: ...=20 > Hi Ngie, >=20 > Is this problem reproducable with projects/hps_head? I never reproed the issue before.. I'd have to look at the suggested repro f= rom the CR poster. Thanks! -Ngie= From owner-svn-src-head@freebsd.org Mon Aug 15 18:55:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72DFDBBA1AC; Mon, 15 Aug 2016 18:55:34 +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 433A61F47; Mon, 15 Aug 2016 18:55:34 +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 u7FItXc0088164; Mon, 15 Aug 2016 18:55:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FItX6L088163; Mon, 15 Aug 2016 18:55:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608151855.u7FItX6L088163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Aug 2016 18:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304174 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 18:55:34 -0000 Author: kib Date: Mon Aug 15 18:55:33 2016 New Revision: 304174 URL: https://svnweb.freebsd.org/changeset/base/304174 Log: VOP_FSYNC() does not take cred as an argument. Correct comment. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Mon Aug 15 18:02:37 2016 (r304173) +++ head/sys/kern/vfs_default.c Mon Aug 15 18:55:33 2016 (r304174) @@ -640,7 +640,6 @@ int vop_stdfsync(ap) struct vop_fsync_args /* { struct vnode *a_vp; - struct ucred *a_cred; int a_waitfor; struct thread *a_td; } */ *ap; From owner-svn-src-head@freebsd.org Mon Aug 15 19:05:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15B1DBBA493; Mon, 15 Aug 2016 19:05:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6CDE1732; Mon, 15 Aug 2016 19:05:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FJ5foP091783; Mon, 15 Aug 2016 19:05:41 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJ5fch091782; Mon, 15 Aug 2016 19:05:41 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608151905.u7FJ5fch091782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 15 Aug 2016 19:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304175 - head/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 19:05:43 -0000 Author: ed Date: Mon Aug 15 19:05:41 2016 New Revision: 304175 URL: https://svnweb.freebsd.org/changeset/base/304175 Log: Disable tests for non-standard behaviour of dirname(3)/basename(3). The NetBSD ATF tests explicitly check that these functions do not modify their input. These tests are NetBSD-specific. They test for something that is not part of POSIX. PR: 211873 Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D7506 Modified: head/contrib/netbsd-tests/lib/libc/gen/t_basedirname.c Modified: head/contrib/netbsd-tests/lib/libc/gen/t_basedirname.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_basedirname.c Mon Aug 15 18:55:33 2016 (r304174) +++ head/contrib/netbsd-tests/lib/libc/gen/t_basedirname.c Mon Aug 15 19:05:41 2016 (r304175) @@ -111,6 +111,7 @@ ATF_TC_BODY(basename_posix, tc) } else base = basename(NULL); +#ifdef __NetBSD__ /* * basename(3) is allowed to modify the input buffer. * However, that is considered hostile by some programs, @@ -127,6 +128,7 @@ ATF_TC_BODY(basename_posix, tc) test_basename_table[i].input); atf_tc_fail("Input buffer was modified."); } +#endif /* Make sure the result is correct. */ if (strcmp(test_basename_table[i].output, base) != 0) { @@ -162,6 +164,7 @@ ATF_TC_BODY(dirname_posix, tc) } else base = dirname(NULL); +#ifdef __NetBSD__ /* * dirname(3) is allowed to modify the input buffer. * However, that is considered hostile by some programs, @@ -178,6 +181,7 @@ ATF_TC_BODY(dirname_posix, tc) test_dirname_table[i].input); atf_tc_fail("Input buffer was modified."); } +#endif /* Make sure the result is correct. */ if (strcmp(test_dirname_table[i].output, base) != 0) { From owner-svn-src-head@freebsd.org Mon Aug 15 19:08:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54544BBA814; Mon, 15 Aug 2016 19:08:53 +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 3081B1A37; Mon, 15 Aug 2016 19:08:53 +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 u7FJ8qtp091946; Mon, 15 Aug 2016 19:08:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJ8phh091939; Mon, 15 Aug 2016 19:08:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608151908.u7FJ8phh091939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Aug 2016 19:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304176 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 19:08:53 -0000 Author: kib Date: Mon Aug 15 19:08:51 2016 New Revision: 304176 URL: https://svnweb.freebsd.org/changeset/base/304176 Log: Add an implementation of fdatasync(2). The syscall is a trivial wrapper around new VOP_FDATASYNC(), sharing code with fsync(2). For all filesystems, this commit provides the implementation which delegates the work of VOP_FDATASYNC() to VOP_FSYNC(). This is functionally correct but not efficient. This is not yet POSIX-compliant implementation, because it does not ensure that queued AIO requests are completed before returning. Reviewed by: mckusick Discussed with: avg (ZFS), jhb (AIO part) Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D7471 Modified: head/include/unistd.h head/lib/libc/sys/Symbol.map head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master head/sys/kern/vfs_default.c head/sys/kern/vfs_syscalls.c head/sys/kern/vnode_if.src Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Mon Aug 15 19:05:41 2016 (r304175) +++ head/include/unistd.h Mon Aug 15 19:08:51 2016 (r304176) @@ -384,6 +384,7 @@ extern int optind, opterr, optopt; /* ISO/IEC 9945-1: 1996 */ #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE int fsync(int); +int fdatasync(int); /* * ftruncate() was in the POSIX Realtime Extension (it's used for shared Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Mon Aug 15 19:05:41 2016 (r304175) +++ head/lib/libc/sys/Symbol.map Mon Aug 15 19:08:51 2016 (r304176) @@ -400,6 +400,10 @@ FBSD_1.4 { recvmmsg; }; +FBSD_1.5 { + fdatasync; +}; + FBSDprivate_1.0 { ___acl_aclcheck_fd; __sys___acl_aclcheck_fd; @@ -594,6 +598,8 @@ FBSDprivate_1.0 { __sys_fstatfs; _fsync; __sys_fsync; + _fdatasync; + __sys_fdatasync; _futimes; __sys_futimes; _getaudit; Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Mon Aug 15 19:05:41 2016 (r304175) +++ head/sys/compat/freebsd32/syscalls.master Mon Aug 15 19:08:51 2016 (r304176) @@ -1081,3 +1081,4 @@ 549 AUE_NULL NOPROTO { int numa_setaffinity(cpuwhich_t which, \ id_t id, \ const struct vm_domain_policy *policy); } +550 AUE_FSYNC NOPROTO { int fdatasync(int fd); } Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Mon Aug 15 19:05:41 2016 (r304175) +++ head/sys/kern/syscalls.master Mon Aug 15 19:08:51 2016 (r304176) @@ -993,8 +993,9 @@ id_t id, \ struct vm_domain_policy_entry *policy); } 549 AUE_NULL STD { int numa_setaffinity(cpuwhich_t which, \ - id_t id, \ - const struct vm_domain_policy_entry *policy); } + id_t id, const struct \ + vm_domain_policy_entry *policy); } +550 AUE_FSYNC STD { int fdatasync(int fd); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Mon Aug 15 19:05:41 2016 (r304175) +++ head/sys/kern/vfs_default.c Mon Aug 15 19:08:51 2016 (r304176) @@ -83,6 +83,7 @@ static int vop_stdset_text(struct vop_se static int vop_stdunset_text(struct vop_unset_text_args *ap); static int vop_stdget_writecount(struct vop_get_writecount_args *ap); static int vop_stdadd_writecount(struct vop_add_writecount_args *ap); +static int vop_stdfdatasync(struct vop_fdatasync_args *ap); static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); /* @@ -111,6 +112,7 @@ struct vop_vector default_vnodeops = { .vop_bmap = vop_stdbmap, .vop_close = VOP_NULL, .vop_fsync = VOP_NULL, + .vop_fdatasync = vop_stdfdatasync, .vop_getpages = vop_stdgetpages, .vop_getpages_async = vop_stdgetpages_async, .vop_getwritemount = vop_stdgetwritemount, @@ -726,6 +728,13 @@ loop2: return (error); } +static int +vop_stdfdatasync(struct vop_fdatasync_args *ap) +{ + + return (VOP_FSYNC(ap->a_vp, MNT_WAIT, ap->a_td)); +} + /* XXX Needs good comment and more info in the manpage (VOP_GETPAGES(9)). */ int vop_stdgetpages(ap) Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Aug 15 19:05:41 2016 (r304175) +++ head/sys/kern/vfs_syscalls.c Mon Aug 15 19:08:51 2016 (r304176) @@ -3354,20 +3354,8 @@ freebsd6_ftruncate(struct thread *td, st } #endif -/* - * Sync an open file. - */ -#ifndef _SYS_SYSPROTO_H_ -struct fsync_args { - int fd; -}; -#endif -int -sys_fsync(td, uap) - struct thread *td; - struct fsync_args /* { - int fd; - } */ *uap; +static int +kern_fsync(struct thread *td, int fd, bool fullsync) { struct vnode *vp; struct mount *mp; @@ -3375,11 +3363,15 @@ sys_fsync(td, uap) cap_rights_t rights; int error, lock_flags; - AUDIT_ARG_FD(uap->fd); - error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_FSYNC), &fp); + AUDIT_ARG_FD(fd); + error = getvnode(td, fd, cap_rights_init(&rights, CAP_FSYNC), &fp); if (error != 0) return (error); vp = fp->f_vnode; +#if 0 + if (!fullsync) + /* XXXKIB: compete outstanding aio writes */; +#endif error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error != 0) goto drop; @@ -3396,8 +3388,7 @@ sys_fsync(td, uap) vm_object_page_clean(vp->v_object, 0, 0, 0); VM_OBJECT_WUNLOCK(vp->v_object); } - error = VOP_FSYNC(vp, MNT_WAIT, td); - + error = fullsync ? VOP_FSYNC(vp, MNT_WAIT, td) : VOP_FDATASYNC(vp, td); VOP_UNLOCK(vp, 0); vn_finished_write(mp); drop: @@ -3406,6 +3397,28 @@ drop: } /* + * Sync an open file. + */ +#ifndef _SYS_SYSPROTO_H_ +struct fsync_args { + int fd; +}; +#endif +int +sys_fsync(struct thread *td, struct fsync_args *uap) +{ + + return (kern_fsync(td, uap->fd, true)); +} + +int +sys_fdatasync(struct thread *td, struct fdatasync_args *uap) +{ + + return (kern_fsync(td, uap->fd, false)); +} + +/* * Rename files. Source and destination must either both be directories, or * both not be directories. If target is a directory, it must be empty. */ Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Mon Aug 15 19:05:41 2016 (r304175) +++ head/sys/kern/vnode_if.src Mon Aug 15 19:08:51 2016 (r304176) @@ -703,6 +703,14 @@ vop_add_writecount { IN int inc; }; +%% fdatasync vp L L L + +vop_fdatasync { + IN struct vnode *vp; + IN struct thread *td; +}; + + # The VOPs below are spares at the end of the table to allow new VOPs to be # added in stable branches without breaking the KBI. New VOPs in HEAD should # be added above these spares. When merging a new VOP to a stable branch, From owner-svn-src-head@freebsd.org Mon Aug 15 19:15:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EDD7BBAA7D; Mon, 15 Aug 2016 19:15:49 +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 D73F61F70; Mon, 15 Aug 2016 19:15:48 +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 u7FJFm4W095566; Mon, 15 Aug 2016 19:15:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJFlfc095555; Mon, 15 Aug 2016 19:15:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608151915.u7FJFlfc095555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Aug 2016 19:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304177 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 19:15:49 -0000 Author: kib Date: Mon Aug 15 19:15:46 2016 New Revision: 304177 URL: https://svnweb.freebsd.org/changeset/base/304177 Log: Regen after r304176, fdatasync(2) addition. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/compat/freebsd32/freebsd32_proto.h Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 303699 2016-08-03 06:33:04Z ed + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 303699 2016-08-03 06:33:04Z ed + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -457,4 +457,5 @@ #define FREEBSD32_SYS_freebsd32_utimensat 547 #define FREEBSD32_SYS_numa_getaffinity 548 #define FREEBSD32_SYS_numa_setaffinity 549 -#define FREEBSD32_SYS_MAXSYSCALL 550 +#define FREEBSD32_SYS_fdatasync 550 +#define FREEBSD32_SYS_MAXSYSCALL 551 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 303699 2016-08-03 06:33:04Z ed + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib */ const char *freebsd32_syscallnames[] = { @@ -583,4 +583,5 @@ const char *freebsd32_syscallnames[] = { "freebsd32_utimensat", /* 547 = freebsd32_utimensat */ "numa_getaffinity", /* 548 = numa_getaffinity */ "numa_setaffinity", /* 549 = numa_setaffinity */ + "fdatasync", /* 550 = fdatasync */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 303699 2016-08-03 06:33:04Z ed + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib */ #include "opt_compat.h" @@ -626,4 +626,5 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_utimensat_args), (sy_call_t *)freebsd32_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 547 = freebsd32_utimensat */ { AS(numa_getaffinity_args), (sy_call_t *)sys_numa_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 548 = numa_getaffinity */ { AS(numa_setaffinity_args), (sy_call_t *)sys_numa_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 549 = numa_setaffinity */ + { AS(fdatasync_args), (sy_call_t *)sys_fdatasync, AUE_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 550 = fdatasync */ }; Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Aug 15 19:15:46 2016 (r304177) @@ -3316,6 +3316,13 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } + /* fdatasync */ + case 550: { + struct fdatasync_args *p = params; + iarg[0] = p->fd; /* int */ + *n_args = 1; + break; + } default: *n_args = 0; break; @@ -8902,6 +8909,16 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* fdatasync */ + case 550: + switch(ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10783,6 +10800,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* fdatasync */ + case 550: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/kern/init_sysent.c Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 303729 2016-08-03 18:48:56Z bdrewery + * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib */ #include "opt_compat.h" @@ -596,4 +596,5 @@ struct sysent sysent[] = { { AS(utimensat_args), (sy_call_t *)sys_utimensat, AUE_FUTIMESAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 547 = utimensat */ { AS(numa_getaffinity_args), (sy_call_t *)sys_numa_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 548 = numa_getaffinity */ { AS(numa_setaffinity_args), (sy_call_t *)sys_numa_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 549 = numa_setaffinity */ + { AS(fdatasync_args), (sy_call_t *)sys_fdatasync, AUE_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 550 = fdatasync */ }; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/kern/syscalls.c Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 303729 2016-08-03 18:48:56Z bdrewery + * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib */ const char *syscallnames[] = { @@ -557,4 +557,5 @@ const char *syscallnames[] = { "utimensat", /* 547 = utimensat */ "numa_getaffinity", /* 548 = numa_getaffinity */ "numa_setaffinity", /* 549 = numa_setaffinity */ + "fdatasync", /* 550 = fdatasync */ }; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/kern/systrace_args.c Mon Aug 15 19:15:46 2016 (r304177) @@ -3326,6 +3326,13 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } + /* fdatasync */ + case 550: { + struct fdatasync_args *p = params; + iarg[0] = p->fd; /* int */ + *n_args = 1; + break; + } default: *n_args = 0; break; @@ -8862,6 +8869,16 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* fdatasync */ + case 550: + switch(ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10778,6 +10795,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* fdatasync */ + case 550: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/sys/syscall.h Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 303729 2016-08-03 18:48:56Z bdrewery + * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib */ #define SYS_syscall 0 @@ -467,4 +467,5 @@ #define SYS_utimensat 547 #define SYS_numa_getaffinity 548 #define SYS_numa_setaffinity 549 -#define SYS_MAXSYSCALL 550 +#define SYS_fdatasync 550 +#define SYS_MAXSYSCALL 551 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/sys/syscall.mk Mon Aug 15 19:15:46 2016 (r304177) @@ -1,7 +1,7 @@ # FreeBSD system call object files. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 303729 2016-08-03 18:48:56Z bdrewery +# created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib MIASM = \ syscall.o \ exit.o \ @@ -395,4 +395,5 @@ MIASM = \ futimens.o \ utimensat.o \ numa_getaffinity.o \ - numa_setaffinity.o + numa_setaffinity.o \ + fdatasync.o Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/sys/sysproto.h Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 303729 2016-08-03 18:48:56Z bdrewery + * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib */ #ifndef _SYS_SYSPROTO_H_ @@ -1788,6 +1788,9 @@ struct numa_setaffinity_args { char id_l_[PADL_(id_t)]; id_t id; char id_r_[PADR_(id_t)]; char policy_l_[PADL_(const struct vm_domain_policy_entry *)]; const struct vm_domain_policy_entry * policy; char policy_r_[PADR_(const struct vm_domain_policy_entry *)]; }; +struct fdatasync_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2174,6 +2177,7 @@ int sys_futimens(struct thread *, struct int sys_utimensat(struct thread *, struct utimensat_args *); int sys_numa_getaffinity(struct thread *, struct numa_getaffinity_args *); int sys_numa_setaffinity(struct thread *, struct numa_setaffinity_args *); +int sys_fdatasync(struct thread *, struct fdatasync_args *); #ifdef COMPAT_43 @@ -2951,6 +2955,7 @@ int freebsd10_pipe(struct thread *, stru #define SYS_AUE_utimensat AUE_FUTIMESAT #define SYS_AUE_numa_getaffinity AUE_NULL #define SYS_AUE_numa_setaffinity AUE_NULL +#define SYS_AUE_fdatasync AUE_FSYNC #undef PAD_ #undef PADL_ From owner-svn-src-head@freebsd.org Mon Aug 15 19:17:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87440BBAB9D; Mon, 15 Aug 2016 19:17:02 +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 3A4A012D2; Mon, 15 Aug 2016 19:17:02 +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 u7FJH1Se095668; Mon, 15 Aug 2016 19:17:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJH1d3095665; Mon, 15 Aug 2016 19:17:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608151917.u7FJH1d3095665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Aug 2016 19:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304178 - in head/sys: fs/msdosfs kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 19:17:02 -0000 Author: kib Date: Mon Aug 15 19:17:00 2016 New Revision: 304178 URL: https://svnweb.freebsd.org/changeset/base/304178 Log: Implement VOP_FDATASYNC() for msdosfs. Standard VOP_FSYNC() implementation just syncs data buffers, and due to this, is the correct and efficient implementation for msdosfs or any other filesystem which uses bufer cache trivially. Provide globally visible wrapper vop_stdfdatasync_buf() for future consumption by other filesystems. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D7471 Modified: head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/kern/vfs_default.c head/sys/sys/vnode.h Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Mon Aug 15 19:15:46 2016 (r304177) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Mon Aug 15 19:17:00 2016 (r304178) @@ -1897,6 +1897,7 @@ struct vop_vector msdosfs_vnodeops = { .vop_close = msdosfs_close, .vop_create = msdosfs_create, .vop_fsync = msdosfs_fsync, + .vop_fdatasync = vop_stdfdatasync_buf, .vop_getattr = msdosfs_getattr, .vop_inactive = msdosfs_inactive, .vop_link = msdosfs_link, Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Mon Aug 15 19:15:46 2016 (r304177) +++ head/sys/kern/vfs_default.c Mon Aug 15 19:17:00 2016 (r304178) @@ -735,6 +735,17 @@ vop_stdfdatasync(struct vop_fdatasync_ar return (VOP_FSYNC(ap->a_vp, MNT_WAIT, ap->a_td)); } +int +vop_stdfdatasync_buf(struct vop_fdatasync_args *ap) +{ + struct vop_fsync_args apf; + + apf.a_vp = ap->a_vp; + apf.a_waitfor = MNT_WAIT; + apf.a_td = ap->a_td; + return (vop_stdfsync(&apf)); +} + /* XXX Needs good comment and more info in the manpage (VOP_GETPAGES(9)). */ int vop_stdgetpages(ap) Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Mon Aug 15 19:15:46 2016 (r304177) +++ head/sys/sys/vnode.h Mon Aug 15 19:17:00 2016 (r304178) @@ -720,6 +720,7 @@ int vfs_write_suspend(struct mount *mp, int vfs_write_suspend_umnt(struct mount *mp); void vnlru_free(int, struct vfsops *); int vop_stdbmap(struct vop_bmap_args *); +int vop_stdfdatasync_buf(struct vop_fdatasync_args *); int vop_stdfsync(struct vop_fsync_args *); int vop_stdgetwritemount(struct vop_getwritemount_args *); int vop_stdgetpages(struct vop_getpages_args *); From owner-svn-src-head@freebsd.org Mon Aug 15 19:22:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FD64BBAF15; Mon, 15 Aug 2016 19:22:25 +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 18C48198C; Mon, 15 Aug 2016 19:22:25 +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 u7FJMOe1099412; Mon, 15 Aug 2016 19:22:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJMOmT099410; Mon, 15 Aug 2016 19:22:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608151922.u7FJMOmT099410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Aug 2016 19:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304180 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 19:22:25 -0000 Author: kib Date: Mon Aug 15 19:22:23 2016 New Revision: 304180 URL: https://svnweb.freebsd.org/changeset/base/304180 Log: Implement VOP_FDATASYNC() for UFS. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D7471 Modified: head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Mon Aug 15 19:18:10 2016 (r304179) +++ head/sys/ufs/ffs/ffs_extern.h Mon Aug 15 19:22:23 2016 (r304180) @@ -174,6 +174,11 @@ void softdep_freework(struct workhead *) * deadlock when flushing snapshot inodes while holding snaplk. */ #define NO_INO_UPDT 0x00000001 +/* + * Request data sync only from ffs_syncvnode(), not touching even more + * metadata than NO_INO_UPDT. + */ +#define DATA_ONLY 0x00000002 int ffs_rdonly(struct inode *); Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Mon Aug 15 19:18:10 2016 (r304179) +++ head/sys/ufs/ffs/ffs_vnops.c Mon Aug 15 19:22:23 2016 (r304180) @@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$"); extern int ffs_rawread(struct vnode *vp, struct uio *uio, int *workdone); #endif static vop_fsync_t ffs_fsync; +static vop_fdatasync_t ffs_fdatasync; static vop_lock1_t ffs_lock; static vop_read_t ffs_read; static vop_write_t ffs_write; @@ -123,6 +124,7 @@ static vop_vptofh_t ffs_vptofh; struct vop_vector ffs_vnodeops1 = { .vop_default = &ufs_vnodeops, .vop_fsync = ffs_fsync, + .vop_fdatasync = ffs_fdatasync, .vop_getpages = vnode_pager_local_getpages, .vop_getpages_async = vnode_pager_local_getpages_async, .vop_lock1 = ffs_lock, @@ -135,6 +137,7 @@ struct vop_vector ffs_vnodeops1 = { struct vop_vector ffs_fifoops1 = { .vop_default = &ufs_fifoops, .vop_fsync = ffs_fsync, + .vop_fdatasync = ffs_fdatasync, .vop_reallocblks = ffs_reallocblks, /* XXX: really ??? */ .vop_vptofh = ffs_vptofh, }; @@ -143,6 +146,7 @@ struct vop_vector ffs_fifoops1 = { struct vop_vector ffs_vnodeops2 = { .vop_default = &ufs_vnodeops, .vop_fsync = ffs_fsync, + .vop_fdatasync = ffs_fdatasync, .vop_getpages = vnode_pager_local_getpages, .vop_getpages_async = vnode_pager_local_getpages_async, .vop_lock1 = ffs_lock, @@ -161,6 +165,7 @@ struct vop_vector ffs_vnodeops2 = { struct vop_vector ffs_fifoops2 = { .vop_default = &ufs_fifoops, .vop_fsync = ffs_fsync, + .vop_fdatasync = ffs_fdatasync, .vop_lock1 = ffs_lock, .vop_reallocblks = ffs_reallocblks, .vop_strategy = ffsext_strategy, @@ -216,10 +221,10 @@ ffs_syncvnode(struct vnode *vp, int wait { struct inode *ip; struct bufobj *bo; - struct buf *bp; - struct buf *nbp; + struct buf *bp, *nbp; ufs_lbn_t lbn; - int error, wait, passes; + int error, passes; + bool still_dirty, wait; ip = VTOI(vp); ip->i_flag &= ~IN_NEEDSYNC; @@ -238,7 +243,7 @@ ffs_syncvnode(struct vnode *vp, int wait */ error = 0; passes = 0; - wait = 0; /* Always do an async pass first. */ + wait = false; /* Always do an async pass first. */ lbn = lblkno(ip->i_fs, (ip->i_size + ip->i_fs->fs_bsize - 1)); BO_LOCK(bo); loop: @@ -254,15 +259,23 @@ loop: if ((bp->b_vflags & BV_SCANNED) != 0) continue; bp->b_vflags |= BV_SCANNED; - /* Flush indirects in order. */ + /* + * Flush indirects in order, if requested. + * + * Note that if only datasync is requested, we can + * skip indirect blocks when softupdates are not + * active. Otherwise we must flush them with data, + * since dependencies prevent data block writes. + */ if (waitfor == MNT_WAIT && bp->b_lblkno <= -NDADDR && - lbn_level(bp->b_lblkno) >= passes) + (lbn_level(bp->b_lblkno) >= passes || + ((flags & DATA_ONLY) != 0 && !DOINGSOFTDEP(vp)))) continue; if (bp->b_lblkno > lbn) panic("ffs_syncvnode: syncing truncated data."); if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) == 0) { BO_UNLOCK(bo); - } else if (wait != 0) { + } else if (wait) { if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, BO_LOCKPTR(bo)) != 0) { @@ -330,31 +343,59 @@ next: * these will be done with one sync and one async pass. */ if (bo->bo_dirty.bv_cnt > 0) { - /* Write the inode after sync passes to flush deps. */ - if (wait && DOINGSOFTDEP(vp) && (flags & NO_INO_UPDT) == 0) { - BO_UNLOCK(bo); - ffs_update(vp, 1); - BO_LOCK(bo); + if ((flags & DATA_ONLY) == 0) { + still_dirty = true; + } else { + /* + * For data-only sync, dirty indirect buffers + * are ignored. + */ + still_dirty = false; + TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) { + if (bp->b_lblkno > -NDADDR) { + still_dirty = true; + break; + } + } } - /* switch between sync/async. */ - wait = !wait; - if (wait == 1 || ++passes < NIADDR + 2) - goto loop; + + if (still_dirty) { + /* Write the inode after sync passes to flush deps. */ + if (wait && DOINGSOFTDEP(vp) && + (flags & NO_INO_UPDT) == 0) { + BO_UNLOCK(bo); + ffs_update(vp, 1); + BO_LOCK(bo); + } + /* switch between sync/async. */ + wait = !wait; + if (wait || ++passes < NIADDR + 2) + goto loop; #ifdef INVARIANTS - if (!vn_isdisk(vp, NULL)) - vn_printf(vp, "ffs_fsync: dirty "); + if (!vn_isdisk(vp, NULL)) + vn_printf(vp, "ffs_fsync: dirty "); #endif + } } BO_UNLOCK(bo); error = 0; - if ((flags & NO_INO_UPDT) == 0) - error = ffs_update(vp, 1); - if (DOINGSUJ(vp)) - softdep_journal_fsync(VTOI(vp)); + if ((flags & DATA_ONLY) == 0) { + if ((flags & NO_INO_UPDT) == 0) + error = ffs_update(vp, 1); + if (DOINGSUJ(vp)) + softdep_journal_fsync(VTOI(vp)); + } return (error); } static int +ffs_fdatasync(struct vop_fdatasync_args *ap) +{ + + return (ffs_syncvnode(ap->a_vp, MNT_WAIT, DATA_ONLY)); +} + +static int ffs_lock(ap) struct vop_lock1_args /* { struct vnode *a_vp; From owner-svn-src-head@freebsd.org Mon Aug 15 19:37:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B75DBBB21A; Mon, 15 Aug 2016 19:37:20 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA1AF114C; Mon, 15 Aug 2016 19:37:19 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FJbIln003512; Mon, 15 Aug 2016 19:37:18 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJbINn003511; Mon, 15 Aug 2016 19:37:18 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151937.u7FJbINn003511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 19:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304181 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 19:37:20 -0000 Author: bde Date: Mon Aug 15 19:37:18 2016 New Revision: 304181 URL: https://svnweb.freebsd.org/changeset/base/304181 Log: Restructure the grabbing functions into mere wrappers of new open and close functions. Scattered calls to sc_cnputc() and sc_cngetc() were broken by turning the semi-reentrant inline context-switching code in these functions into the grabbing functions. cncheckc() calls for panic dumps are the main broken case. The grabbing functions have special behaviour (mainly screen switching in sc_cngrab()) which makes them unsuitable as replacements for the inline code. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 19:22:23 2016 (r304180) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 19:37:18 2016 (r304181) @@ -1645,8 +1645,12 @@ sc_cnterm(struct consdev *cp) sc_console = NULL; } +struct sc_cnstate; /* not used yet */ +static void sccnclose(sc_softc_t *sc, struct sc_cnstate *sp); +static void sccnopen(sc_softc_t *sc, struct sc_cnstate *sp, int flags); + static void -sc_cngrab(struct consdev *cp) +sccnopen(sc_softc_t *sc, struct sc_cnstate *sp, int flags) { scr_stat *scp; int kbd_mode; @@ -1662,9 +1666,6 @@ sc_cngrab(struct consdev *cp) if (scp->sc->kbd == NULL) return; - if (scp->sc->grab_level++ > 0) - return; - /* * Make sure the keyboard is accessible even when the kbd device * driver is disabled. @@ -1678,7 +1679,7 @@ sc_cngrab(struct consdev *cp) } static void -sc_cnungrab(struct consdev *cp) +sccnclose(sc_softc_t *sc, struct sc_cnstate *sp) { scr_stat *scp; @@ -1686,9 +1687,6 @@ sc_cnungrab(struct consdev *cp) if (scp->sc->kbd == NULL) return; - if (--scp->sc->grab_level > 0) - return; - /* Restore keyboard mode (for the current, possibly-changed scp). */ kbdd_poll(scp->sc->kbd, FALSE); (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); @@ -1697,6 +1695,26 @@ sc_cnungrab(struct consdev *cp) } static void +sc_cngrab(struct consdev *cp) +{ + sc_softc_t *sc; + + sc = sc_console->sc; + if (sc->grab_level++ == 0) + sccnopen(sc, NULL, 0); +} + +static void +sc_cnungrab(struct consdev *cp) +{ + sc_softc_t *sc; + + sc = sc_console->sc; + if (--sc->grab_level == 0) + sccnclose(sc, NULL); +} + +static void sc_cnputc(struct consdev *cd, int c) { u_char buf[1]; From owner-svn-src-head@freebsd.org Mon Aug 15 19:42:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69778BBB411; Mon, 15 Aug 2016 19:42:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 367831661; Mon, 15 Aug 2016 19:42:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FJgL3k007374; Mon, 15 Aug 2016 19:42:21 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJgL99007373; Mon, 15 Aug 2016 19:42:21 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608151942.u7FJgL99007373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 15 Aug 2016 19:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304182 - head/sys/compat/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 19:42:22 -0000 Author: ed Date: Mon Aug 15 19:42:21 2016 New Revision: 304182 URL: https://svnweb.freebsd.org/changeset/base/304182 Log: Let CloudABI use fdatasync() as well. Now that FreeBSD supports fdatasync() natively, we can tidy up CloudABI's equivalent system call to use that instead. Modified: head/sys/compat/cloudabi/cloudabi_fd.c Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 15 19:37:18 2016 (r304181) +++ head/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 15 19:42:21 2016 (r304182) @@ -172,12 +172,11 @@ int cloudabi_sys_fd_datasync(struct thread *td, struct cloudabi_sys_fd_datasync_args *uap) { - struct fsync_args fsync_args = { + struct fdatasync_args fdatasync_args = { .fd = uap->fd }; - /* Call into fsync(), as FreeBSD lacks fdatasync(). */ - return (sys_fsync(td, &fsync_args)); + return (sys_fdatasync(td, &fdatasync_args)); } int From owner-svn-src-head@freebsd.org Mon Aug 15 19:47:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD0E3BBB58B; Mon, 15 Aug 2016 19:47:05 +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 8FBEF1942; Mon, 15 Aug 2016 19:47:05 +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 u7FJl4Si007584; Mon, 15 Aug 2016 19:47:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJl4PS007583; Mon, 15 Aug 2016 19:47:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608151947.u7FJl4PS007583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 15 Aug 2016 19:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304183 - head/cddl/usr.sbin/dtrace/tests/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 19:47:05 -0000 Author: markj Date: Mon Aug 15 19:47:04 2016 New Revision: 304183 URL: https://svnweb.freebsd.org/changeset/base/304183 Log: dtraceUtil/tst.DataModel32.d.ksh passes on amd64. Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Mon Aug 15 19:42:21 2016 (r304182) +++ head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Mon Aug 15 19:47:04 2016 (r304183) @@ -27,7 +27,6 @@ exclude() } exclude EXFAIL common/aggs/tst.subr.d -exclude EXFAIL common/dtraceUtil/tst.DataModel32.d.ksh exclude EXFAIL common/dtraceUtil/tst.ELFGenerationOut.d.ksh exclude EXFAIL common/dtraceUtil/tst.ELFGenerationWithO.d.ksh exclude EXFAIL common/funcs/tst.copyin.d From owner-svn-src-head@freebsd.org Mon Aug 15 19:56:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C583BBB72B; Mon, 15 Aug 2016 19:56:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D80E1DCE; Mon, 15 Aug 2016 19:56:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7FJuiZm062107 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 15 Aug 2016 22:56:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7FJuiZm062107 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7FJuiPI062106; Mon, 15 Aug 2016 22:56:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 Aug 2016 22:56:44 +0300 From: Konstantin Belousov To: Ed Schouten Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304182 - head/sys/compat/cloudabi Message-ID: <20160815195644.GC83214@kib.kiev.ua> References: <201608151942.u7FJgL99007373@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608151942.u7FJgL99007373@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 19:56:49 -0000 On Mon, Aug 15, 2016 at 07:42:21PM +0000, Ed Schouten wrote: > Author: ed > Date: Mon Aug 15 19:42:21 2016 > New Revision: 304182 > URL: https://svnweb.freebsd.org/changeset/base/304182 > > Log: > Let CloudABI use fdatasync() as well. > > Now that FreeBSD supports fdatasync() natively, we can tidy up > CloudABI's equivalent system call to use that instead. > > Modified: > head/sys/compat/cloudabi/cloudabi_fd.c > > Modified: head/sys/compat/cloudabi/cloudabi_fd.c > ============================================================================== > --- head/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 15 19:37:18 2016 (r304181) > +++ head/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 15 19:42:21 2016 (r304182) > @@ -172,12 +172,11 @@ int > cloudabi_sys_fd_datasync(struct thread *td, > struct cloudabi_sys_fd_datasync_args *uap) > { > - struct fsync_args fsync_args = { > + struct fdatasync_args fdatasync_args = { > .fd = uap->fd > }; > > - /* Call into fsync(), as FreeBSD lacks fdatasync(). */ > - return (sys_fsync(td, &fsync_args)); > + return (sys_fdatasync(td, &fdatasync_args)); > } > Please make kern_fsync() non-static and use it instead of providing fake fdatasync_args structure. From owner-svn-src-head@freebsd.org Mon Aug 15 20:09:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87C5BBBBA93; Mon, 15 Aug 2016 20:09:10 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E3611641; Mon, 15 Aug 2016 20:09:10 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FK99lj014847; Mon, 15 Aug 2016 20:09:09 GMT (envelope-from badger@FreeBSD.org) Received: (from badger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FK99Yj014846; Mon, 15 Aug 2016 20:09:09 GMT (envelope-from badger@FreeBSD.org) Message-Id: <201608152009.u7FK99Yj014846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: badger set sender to badger@FreeBSD.org using -f From: Eric Badger Date: Mon, 15 Aug 2016 20:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304184 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 20:09:10 -0000 Author: badger Date: Mon Aug 15 20:09:09 2016 New Revision: 304184 URL: https://svnweb.freebsd.org/changeset/base/304184 Log: sem_post(): wake up the sleeper only after adjusting has_waiters If the caller of sem_post() wakes up a thread sleeping via sem_wait() before it clears the has_waiters flag, the caller of sem_wait() has no way of knowing when it is safe to destroy the semaphore and reuse the memory. This is because the caller of sem_post() may be interrupted between the wake step and the clearing of has_waiters. It will then write into the has_waiters flag in userspace after being preempted for some unknown amount of time. Reviewed by: jhb, kib, vangyzen Approved by: kib (mentor), vangyzen (mentor) MFC after: 2 weeks Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D7505 Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Mon Aug 15 19:47:04 2016 (r304183) +++ head/sys/kern/kern_umtx.c Mon Aug 15 20:09:09 2016 (r304184) @@ -3123,7 +3123,6 @@ do_sem_wake(struct thread *td, struct _u umtxq_busy(&key); cnt = umtxq_count(&key); if (cnt > 0) { - umtxq_signal(&key, 1); /* * Check if count is greater than 0, this means the memory is * still being referenced by user code, so we can safely @@ -3136,6 +3135,7 @@ do_sem_wake(struct thread *td, struct _u if (error == -1) error = EFAULT; } + umtxq_signal(&key, 1); } umtxq_unbusy(&key); umtxq_unlock(&key); @@ -3235,8 +3235,6 @@ do_sem2_wake(struct thread *td, struct _ umtxq_busy(&key); cnt = umtxq_count(&key); if (cnt > 0) { - umtxq_signal(&key, 1); - /* * If this was the last sleeping thread, clear the waiters * flag in _count. @@ -3251,6 +3249,8 @@ do_sem2_wake(struct thread *td, struct _ error = EFAULT; umtxq_lock(&key); } + + umtxq_signal(&key, 1); } umtxq_unbusy(&key); umtxq_unlock(&key); From owner-svn-src-head@freebsd.org Mon Aug 15 20:11:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E068EBBBBFC; Mon, 15 Aug 2016 20:11:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A368C1A08; Mon, 15 Aug 2016 20:11:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FKBqH9017724; Mon, 15 Aug 2016 20:11:52 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FKBq8h017720; Mon, 15 Aug 2016 20:11:52 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608152011.u7FKBq8h017720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 15 Aug 2016 20:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304185 - in head/sys: compat/cloudabi compat/linux kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 20:11:54 -0000 Author: ed Date: Mon Aug 15 20:11:52 2016 New Revision: 304185 URL: https://svnweb.freebsd.org/changeset/base/304185 Log: Eliminate use of sys_fsync() and sys_fdatasync(). Make the kern_fsync() function public, so that it can be used by other parts of the kernel. Fix up existing consumers to make use of it. Requested by: kib Modified: head/sys/compat/cloudabi/cloudabi_fd.c head/sys/compat/linux/linux_file.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 15 20:09:09 2016 (r304184) +++ head/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 15 20:11:52 2016 (r304185) @@ -172,11 +172,8 @@ int cloudabi_sys_fd_datasync(struct thread *td, struct cloudabi_sys_fd_datasync_args *uap) { - struct fdatasync_args fdatasync_args = { - .fd = uap->fd - }; - return (sys_fdatasync(td, &fdatasync_args)); + return (kern_fsync(td, uap->fd, false)); } int @@ -556,9 +553,6 @@ cloudabi_sys_fd_stat_put(struct thread * int cloudabi_sys_fd_sync(struct thread *td, struct cloudabi_sys_fd_sync_args *uap) { - struct fsync_args fsync_args = { - .fd = uap->fd - }; - return (sys_fsync(td, &fsync_args)); + return (kern_fsync(td, uap->fd, true)); } Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Mon Aug 15 20:09:09 2016 (r304184) +++ head/sys/compat/linux/linux_file.c Mon Aug 15 20:11:52 2016 (r304185) @@ -1013,10 +1013,8 @@ linux_fdatasync(td, uap) struct thread *td; struct linux_fdatasync_args *uap; { - struct fsync_args bsd; - bsd.fd = uap->fd; - return (sys_fsync(td, &bsd)); + return (kern_fsync(td, uap->fd, false)); } int Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Aug 15 20:09:09 2016 (r304184) +++ head/sys/kern/vfs_syscalls.c Mon Aug 15 20:11:52 2016 (r304185) @@ -3354,7 +3354,7 @@ freebsd6_ftruncate(struct thread *td, st } #endif -static int +int kern_fsync(struct thread *td, int fd, bool fullsync) { struct vnode *vp; Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Mon Aug 15 20:09:09 2016 (r304184) +++ head/sys/sys/syscallsubr.h Mon Aug 15 20:11:52 2016 (r304185) @@ -100,6 +100,7 @@ int kern_fhstat(struct thread *td, fhand int kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf); int kern_fstat(struct thread *td, int fd, struct stat *sbp); int kern_fstatfs(struct thread *td, int fd, struct statfs *buf); +int kern_fsync(struct thread *td, int fd, bool fullsync); int kern_ftruncate(struct thread *td, int fd, off_t length); int kern_futimes(struct thread *td, int fd, struct timeval *tptr, enum uio_seg tptrseg); From owner-svn-src-head@freebsd.org Mon Aug 15 20:14:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D34CBBBC7F; Mon, 15 Aug 2016 20:14:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24F771CA5; Mon, 15 Aug 2016 20:14:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7FKDvi1065831 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 15 Aug 2016 23:13:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7FKDvi1065831 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7FKDvUs065830; Mon, 15 Aug 2016 23:13:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 Aug 2016 23:13:57 +0300 From: Konstantin Belousov To: Ed Schouten Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304185 - in head/sys: compat/cloudabi compat/linux kern sys Message-ID: <20160815201357.GE83214@kib.kiev.ua> References: <201608152011.u7FKBq8h017720@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608152011.u7FKBq8h017720@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 20:14:02 -0000 On Mon, Aug 15, 2016 at 08:11:52PM +0000, Ed Schouten wrote: > Author: ed > Date: Mon Aug 15 20:11:52 2016 > New Revision: 304185 > URL: https://svnweb.freebsd.org/changeset/base/304185 > > Log: > Eliminate use of sys_fsync() and sys_fdatasync(). > > Make the kern_fsync() function public, so that it can be used by other > parts of the kernel. Fix up existing consumers to make use of it. > > Requested by: kib > > Modified: > head/sys/compat/cloudabi/cloudabi_fd.c > head/sys/compat/linux/linux_file.c > head/sys/kern/vfs_syscalls.c > head/sys/sys/syscallsubr.h Thank you, and esp. thank you for handling of linux.ko. From owner-svn-src-head@freebsd.org Mon Aug 15 20:15:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 205E1BBBCFB for ; Mon, 15 Aug 2016 20:15:18 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x229.google.com (mail-yw0-x229.google.com [IPv6:2607:f8b0:4002:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBDFE1E49 for ; Mon, 15 Aug 2016 20:15:17 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x229.google.com with SMTP id z8so32362222ywa.1 for ; Mon, 15 Aug 2016 13:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=aUIczATfb8agAtP2ugWP1UtVkdQKjsjKcAuzsj+oJKM=; b=TSBvJ2n7S4vC0ZMbjdaYuq36syNc3ezCo9By9sIsXUFY4uXK/9keBxiWVzr5XduEuN PxWJSljB8SvxWVBkkFi785hyjY4VknjODR91YSRiInq/qZVi9c0oCBBdhoSiNJJsMA9C NFZcq8djNNgcYE8Qzm/NGu175XioB9fXzLIuO8+9vFGBJbHEbwYDjhDbLF1RDkaoes0Q Zh0JbLzMbHhnYTp9/MM1BQqsbQH8e9ucs02aqnaGm3z7uoR2Y7rbUl7bizOUSTZiU6es cDCRM2nqP57plWUgtfh1g3IV7NEOTOAs1WlZiwxxHN7XiU1cwt4L3XTmyLTbUjZWZx00 PdXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=aUIczATfb8agAtP2ugWP1UtVkdQKjsjKcAuzsj+oJKM=; b=PqPZN3K/x3wtHRUbyoXiIFEJ5SOmnbY9AcDwuJdm7MfSYYCVmemmznTybBf7qrNKl5 xnHs4p9ap8wi2d2ub9lwHWAwG+s7Hzj7DKGPYvd5+JfK/VZFgK1T1OjQX0xTtwmI4p6b N2ZDvkhd6ICoqSYL+ChDpEtqLA1iZ/T6LdlKi5GNTr03s7mJPFkBSzKcxxJqJf49QpcU hp765vgksrbXSI/yZl8/m5x2Pqgw3c6X1sIcHxZOf69dt58KCMeWJ25w9/uxooQ7IFa2 BFCbSlQXOfa8BpbqBEp/VTTcZhPH4Yt3qCP04P06vytLQvxHAzomsWMSutdS/Q67+vz2 aT2g== X-Gm-Message-State: AEkoousZNHaXm2h4rXaQjVbA64py5XulMYWA7zKi2XwJESLcR71X9yEFc09be2O8Z4cue54ffUfG+IX8B2pGzg== X-Received: by 10.13.253.134 with SMTP id n128mr20980604ywf.20.1471292117075; Mon, 15 Aug 2016 13:15:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Mon, 15 Aug 2016 13:15:16 -0700 (PDT) In-Reply-To: <20160815201357.GE83214@kib.kiev.ua> References: <201608152011.u7FKBq8h017720@repo.freebsd.org> <20160815201357.GE83214@kib.kiev.ua> From: Ed Schouten Date: Mon, 15 Aug 2016 22:15:16 +0200 Message-ID: Subject: Re: svn commit: r304185 - in head/sys: compat/cloudabi compat/linux kern sys To: Konstantin Belousov Cc: Ed Schouten , 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.22 Precedence: list List-Id: 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, 15 Aug 2016 20:15:18 -0000 2016-08-15 22:13 GMT+02:00 Konstantin Belousov : > Thank you, and esp. thank you for handling of linux.ko. And thank you for adding fdatasync() support in the first place. \o/ -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Mon Aug 15 20:17:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FDA4BBA0C1; Mon, 15 Aug 2016 20:17:49 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 574491434; Mon, 15 Aug 2016 20:17:49 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FKHmdW018813; Mon, 15 Aug 2016 20:17:48 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FKHmwG018812; Mon, 15 Aug 2016 20:17:48 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608152017.u7FKHmwG018812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 20:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304186 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 20:17:49 -0000 Author: bde Date: Mon Aug 15 20:17:48 2016 New Revision: 304186 URL: https://svnweb.freebsd.org/changeset/base/304186 Log: Clean up the new sc cn open and close functions (old sc cn grab and ungrab functions). Mainly, spell sc as itself instead of as scp->sc. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 20:11:52 2016 (r304185) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 20:17:48 2016 (r304186) @@ -1652,46 +1652,40 @@ static void sccnopen(sc_softc_t *sc, str static void sccnopen(sc_softc_t *sc, struct sc_cnstate *sp, int flags) { - scr_stat *scp; int kbd_mode; if (!cold && - sc_console->sc->cur_scp->index != sc_console->index && - sc_console->sc->cur_scp->smode.mode == VT_AUTO && + sc->cur_scp->index != sc_console->index && + sc->cur_scp->smode.mode == VT_AUTO && sc_console->smode.mode == VT_AUTO) - sc_switch_scr(sc_console->sc, sc_console->index); - - scp = sc_console->sc->cur_scp; + sc_switch_scr(sc, sc_console->index); - if (scp->sc->kbd == NULL) + if (sc->kbd == NULL) return; /* * Make sure the keyboard is accessible even when the kbd device * driver is disabled. */ - kbdd_enable(scp->sc->kbd); + kbdd_enable(sc->kbd); /* Switch the keyboard to console mode (K_XLATE, polled) on all scp's. */ kbd_mode = K_XLATE; - (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&kbd_mode); - kbdd_poll(scp->sc->kbd, TRUE); + (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&kbd_mode); + kbdd_poll(sc->kbd, TRUE); } static void sccnclose(sc_softc_t *sc, struct sc_cnstate *sp) { - scr_stat *scp; - - scp = sc_console->sc->cur_scp; /* XXX */ - if (scp->sc->kbd == NULL) + if (sc->kbd == NULL) return; /* Restore keyboard mode (for the current, possibly-changed scp). */ - kbdd_poll(scp->sc->kbd, FALSE); - (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + kbdd_poll(sc->kbd, FALSE); + (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&sc->cur_scp->kbd_mode); - kbdd_disable(scp->sc->kbd); + kbdd_disable(sc->kbd); } static void From owner-svn-src-head@freebsd.org Mon Aug 15 20:38:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE14DBBA59B; Mon, 15 Aug 2016 20:38:03 +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 919E91DBA; Mon, 15 Aug 2016 20:38:03 +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 u7FKc2q1026335; Mon, 15 Aug 2016 20:38:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FKc2NL026330; Mon, 15 Aug 2016 20:38:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608152038.u7FKc2NL026330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Aug 2016 20:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 20:38:03 -0000 Author: jhb Date: Mon Aug 15 20:38:02 2016 New Revision: 304187 URL: https://svnweb.freebsd.org/changeset/base/304187 Log: Remove the mcd(4) driver for Mitsumi CD-ROM players. This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in the manpage, this driver is only useful as a backend to cdcontrol to play audio CDs since it doesn't use DMA, so its data performance is "abysmal" (and that was true in the mid 90's). Deleted: head/share/man/man4/mcd.4 head/sys/dev/mcd/ head/sys/modules/mcd/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Aug 15 20:17:48 2016 (r304186) +++ head/ObsoleteFiles.inc Mon Aug 15 20:38:02 2016 (r304187) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160815: Remove mcd(4) +OLD_FILES+=usr/share/man/man4/mcd.4.gz # 20160703: POSIXify locales with variants OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_CTYPE Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Aug 15 20:17:48 2016 (r304186) +++ head/share/man/man4/Makefile Mon Aug 15 20:38:02 2016 (r304187) @@ -269,7 +269,6 @@ MAN= aac.4 \ mac_stub.4 \ mac_test.4 \ malo.4 \ - mcd.4 \ md.4 \ mdio.4 \ me.4 \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Aug 15 20:17:48 2016 (r304186) +++ head/sys/conf/NOTES Mon Aug 15 20:38:02 2016 (r304187) @@ -2412,15 +2412,10 @@ options SND_OLDSTEREO # Miscellaneous hardware: # # scd: Sony CD-ROM using proprietary (non-ATAPI) interface -# mcd: Mitsumi CD-ROM using proprietary (non-ATAPI) interface # bktr: Brooktree bt848/848a/849a/878/879 video capture and TV Tuner board # joy: joystick (including IO DATA PCJOY PC Card joystick) # cmx: OmniKey CardMan 4040 pccard smartcard reader -# Mitsumi CD-ROM -device mcd -hint.mcd.0.at="isa" -hint.mcd.0.port="0x300" # for the Sony CDU31/33A CDROM device scd hint.scd.0.at="isa" Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Aug 15 20:17:48 2016 (r304186) +++ head/sys/conf/files Mon Aug 15 20:38:02 2016 (r304187) @@ -2018,8 +2018,6 @@ dev/malo/if_malohal.c optional malo dev/malo/if_malo_pci.c optional malo pci dev/mc146818/mc146818.c optional mc146818 dev/mca/mca_bus.c optional mca -dev/mcd/mcd.c optional mcd isa nowerror -dev/mcd/mcd_isa.c optional mcd isa nowerror dev/md/md.c optional md dev/mdio/mdio_if.m optional miiproxy | mdio dev/mdio/mdio.c optional miiproxy | mdio Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Aug 15 20:17:48 2016 (r304186) +++ head/sys/modules/Makefile Mon Aug 15 20:38:02 2016 (r304187) @@ -224,7 +224,6 @@ SUBDIR= \ mac_stub \ mac_test \ malo \ - mcd \ md \ mdio \ mem \ From owner-svn-src-head@freebsd.org Mon Aug 15 20:54:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0474BBAF1A; Mon, 15 Aug 2016 20:54:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D0761D2C; Mon, 15 Aug 2016 20:54:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 68B2FB98E; Mon, 15 Aug 2016 16:54:51 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd Date: Mon, 15 Aug 2016 13:54:48 -0700 Message-ID: <2065331.KaGOSftJhd@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201608152038.u7FKc2NL026330@repo.freebsd.org> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 15 Aug 2016 16:54:51 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 20:54:52 -0000 On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: > Author: jhb > Date: Mon Aug 15 20:38:02 2016 > New Revision: 304187 > URL: https://svnweb.freebsd.org/changeset/base/304187 > > Log: > Remove the mcd(4) driver for Mitsumi CD-ROM players. > > This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in > the manpage, this driver is only useful as a backend to cdcontrol to > play audio CDs since it doesn't use DMA, so its data performance is > "abysmal" (and that was true in the mid 90's). No one stepped up to test patches for it either when I last posted patches to convert it from timeout(9) to callout(9). I have a few more drivers that are both very old and that people have no business using in 12 (think ISA adapters that don't do DMA and can't be used with pccard) that I will be removing over the next little while. I brought up a list of drivers on arch@ a couple of years ago and the conversation drifted off into the weeds about trimming GENERIC, etc. No one objected to the specific drivers I listed though (and I got a few pleas of "please remove"). If someone shows up desperately clutching an ISA adapter they can always dig up the source from svn and deal with forward porting it for whatever API changes have happened since it was removed. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Aug 15 21:10:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B081BBBB255; Mon, 15 Aug 2016 21:10:17 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 2E430153F; Mon, 15 Aug 2016 21:10:17 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd To: John Baldwin , src-committers@freebsd.org References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Jung-uk Kim Message-ID: Date: Mon, 15 Aug 2016 17:10:12 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <2065331.KaGOSftJhd@ralph.baldwin.cx> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xjwi2KCDAbSGiIuWpMMrA29e9ssG53fJh" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 21:10:17 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xjwi2KCDAbSGiIuWpMMrA29e9ssG53fJh Content-Type: multipart/mixed; boundary="TovMIslaq2J9Qv5MAorjAKVuCHj1PlIsS" From: Jung-uk Kim To: John Baldwin , src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> In-Reply-To: <2065331.KaGOSftJhd@ralph.baldwin.cx> --TovMIslaq2J9Qv5MAorjAKVuCHj1PlIsS Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 08/15/2016 16:54, John Baldwin wrote: > On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >> Author: jhb >> Date: Mon Aug 15 20:38:02 2016 >> New Revision: 304187 >> URL: https://svnweb.freebsd.org/changeset/base/304187 >> >> Log: >> Remove the mcd(4) driver for Mitsumi CD-ROM players. >> =20 >> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in >> the manpage, this driver is only useful as a backend to cdcontrol to= >> play audio CDs since it doesn't use DMA, so its data performance is >> "abysmal" (and that was true in the mid 90's). >=20 > No one stepped up to test patches for it either when I last posted patc= hes to > convert it from timeout(9) to callout(9). I have a few more drivers th= at are > both very old and that people have no business using in 12 (think ISA > adapters that don't do DMA and can't be used with pccard) that I will b= e > removing over the next little while. I brought up a list of drivers on= arch@ > a couple of years ago and the conversation drifted off into the weeds a= bout > trimming GENERIC, etc. No one objected to the specific drivers I liste= d > though (and I got a few pleas of "please remove"). If someone shows up= > desperately clutching an ISA adapter they can always dig up the source = from > svn and deal with forward porting it for whatever API changes have happ= ened > since it was removed. I have one of these Mitsumi CD-ROM drives somewhere in my basement but I haven't used it for many years. I think I only used it with "PAO", thoug= h. http://www.jp.freebsd.org/PAO/index.html Maybe we should kill APM, too! ;-) Jung-uk Kim --TovMIslaq2J9Qv5MAorjAKVuCHj1PlIsS-- --xjwi2KCDAbSGiIuWpMMrA29e9ssG53fJh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXsi+0AAoJEHyflib82/FGEpgH/2hKMen6wtd1S8KiJXHq6n7e N503KLULuG6ZR8+nYMh5WapeSGKiET9Vg9VQ3nMFOsBcliw9N+Z4S9Yx2qb07760 rP6q/aKjExSULFH7+WHZfyGbwQiwl8a11P6ECV0NWG3cGp61SLs/0pSB0hN4pI8J SHW7WOYsHPkIC9zfRW90P6h1sxffUeSe5/jkuFzEbIow17HkYoDuxZT3rZ0BmJ+D oE5Yz9y3FsuOsGMhWgw/zfqcJNYe35DTuOVXVvULE9hPLfnhH7OBkwV5xjEQk9+w eV9M+BPk4V+A8KPcnPU5XGjddcBiC1DIxGCYSbLfo8fapP7oOYlEaX0d0VrA50Q= =gFZq -----END PGP SIGNATURE----- --xjwi2KCDAbSGiIuWpMMrA29e9ssG53fJh-- From owner-svn-src-head@freebsd.org Mon Aug 15 22:48:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85D4CBB9B53; Mon, 15 Aug 2016 22:48:17 +0000 (UTC) (envelope-from jkim@niksun.com) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sg2apc01on0136.outbound.protection.outlook.com [104.47.125.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAC021CDD; Mon, 15 Aug 2016 22:48:16 +0000 (UTC) (envelope-from jkim@niksun.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niksunipl.onmicrosoft.com; s=selector1-niksun-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GoDVM2xz1vBy/iO3ayUq+VyvlByzYQNeCx+tTxAzJYU=; b=QFR25Zc/xcfzboXW1pbs0ArPE5JJeXEmaPiiDtLC/7EP0DyxMvU6BvpwSbsI0VZIQ5ETD6Fu3FRXV8/7MsVNDns5zHru1al8uJzbtHTpJU8fDeU9gohCpcOf8LRF+M6z8WhbIFf6Rr+gkmJ7fcHENo95DF0YEMGbPVJIuIFY7KI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jkim@niksun.com; Received: from hammer.pct.niksun.com (24.104.71.38) by PS1PR0301MB2012.apcprd03.prod.outlook.com (10.167.50.146) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21; Mon, 15 Aug 2016 22:14:09 +0000 From: Jung-uk Kim Subject: Re: svn commit: r304045 - head/share/timedef To: Baptiste Daroussin , , , References: <201608131559.u7DFxI68040959@repo.freebsd.org> Organization: NIKSUN, Inc. Message-ID: <36f052d3-7cbd-eaad-29b2-b647b35603a5@niksun.com> Date: Mon, 15 Aug 2016 18:13:51 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608131559.u7DFxI68040959@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [24.104.71.38] X-ClientProxiedBy: CY1PR0101CA0001.prod.exchangelabs.com (10.162.170.11) To PS1PR0301MB2012.apcprd03.prod.outlook.com (10.167.50.146) X-MS-Office365-Filtering-Correlation-Id: 787927ef-a74c-4aaf-cb57-08d3c5597be7 X-Microsoft-Exchange-Diagnostics: 1; PS1PR0301MB2012; 2:oQIXiLcz5IqfsnOVM4jF7g1vFtcMLrJTh2+BdhH3vhExODjJQTOhW2Mry6DrrAsWsKDl4BDnjVTItHgNjUWGEEF+Csbwbf/eiYLxEzWmWV1CVhvCFO3GfqCwOP8mZ1pU0TQoeama73iWgnf+ASWZevE99Fa9gdJiOMqueanWb0Zsooy6eavDSJxJvETNXxze; 3:UE+yPKHdye4Xon54/NjGuxxnmV/i2FRWLYdRXliSnHHMMD2UewNGB0Q4p8aNacSh68wUu9XZ9Zasu1M0WgJQKgG+i26odyWWE+Cac/PJiMDFCBRvGEgu1xFbaQN8sUGo X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:PS1PR0301MB2012; X-Microsoft-Exchange-Diagnostics: 1; PS1PR0301MB2012; 25:WChy5LXTob489a+l5lquYq34Q3t80CGKBGP9Mjlt3HtTUku/am9WV6Pf36Eeb2DH2C/QxMZm+yRyEZqU9wa9CIz8E7duPIkdniJX3My5CK0ap/aKIdoM9XwYNSaImQmYfXY7s8NYmMvIcXrs5mka4xmWRvozablxNLADi0JI4CWFq1Fz2yWUwrs9UL1lZ2gUnLU1wESyZljfsGiSmJYKLK1Bdw3jDS94gXRsgerrf1fskf0RC5DIx/bW10BVxJeRQM8ZxC+QCs0WQKTouJJGl37XhfuBWKBZxKGeH4w5XtAQgnft7BPY7khmqkfRr6Z69UrdQ9uEEazL2oSuGvO4W3zQteTGsmklr8jeRhZdK4WZ1aZDnBf3hcptmo8+TBJIKxzecxdgxokd8jT55qUwWRvbcghGa+Yvi8+FICBpUy5yScUI3PLDGMD6bYNowtP1oK8hrUCbB1lfR3WYYPoKvskX9BaIWCVszoo5qiKDZTjcWvqkpUwXX1cy159ob1fv+XpUgjt2Aqt5RO4NtjU2Ngf5qNqvkCtjCtlT4RjGTqMRyJdHlf71i0dDanCarRO2XF69oYFYrjJjj44lPN5Q1Ybda9/2UbTYkARLY4AFzB/nATcZFVkaF8Cad77PIk7hK1ycgq6AdMFV2C/IExMLB6eRsrefiHY7OpLQ2uij2JL71fxzlHxCmXJgM8kqIg663KeYq/msWZhlorqrluQdGYKtlvez4AMzkN46kY5IdR/BqK3uHcPZnrQakbtcX3v92Fylm3EZc/Q0KtgcRABjYkcKQAuP0C8x/4bQRPU6ZXstHIRFX5lDaoeSoBnavSAG X-Microsoft-Exchange-Diagnostics: 1; PS1PR0301MB2012; 31:U2CjbDy7w2RgmyXlZO0lnuOGFeRh/U8QhbFBJFZbO44yRDZMSfyOElzm9htNwnRRk5HEmweDIJm8bxPHKC8mwuGr4dD7OJskJmmG07oFo+n+BBFtaKT5NbIlVYgk/1DXWKWNkTDeduQWMS1Bse6+CLEloM+CqpPUdWOeBglWnixxA756U95ixLyOYGbdtGmGWID9Ae8k0bJfga8v+/aMWHMnWvrs13LXKCTsNmK98og=; 20:atpZjDxziFcQpLERcgERrO5OlGZPDx1TQ2/0z1RHVvN4R8h3WaYvOHk3oW3C9f1javQ+n3QEX7BMIR/xE3Qyey9+ef+Qp3/Gvr8i5e5/ZTB6mtDvB89xeJTLZ+LBNS8gFpsNXeLQseXf+rgRNkzK7xPkccbl4eyRLtAP3LU2XUaSL94lc0rNGeLGX3anX9twl6wzXsrht4yUV2n3mYWjBeUdpqj4wOTMNCVmmRbGGgIUN8tTq1RbLK8rgHJ28YJjd8w4SOoBe1vPeLVI46ufB4rfVwM27BBYWk5/B4mFkeE7NqU+e7+tEXyoXSWl+2LMuEh0mMVQlAlUeFANJ/Ph6OLr5EPVF79HOk0ytKEcQUBqyxET0Vs0f659GfRK6n29/V9UZEYqOEWxwA1HFx8f/ArnP+UKnvr3tqMYSLyrZ85AsYy8aRr1wFUDlLXjEfwA5CGcHIiPXyqUVTwjQIBrd73clHIA/x8uu6BBLGfS4kLS8xgnLXs7U1Xd3PaHGPPO X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(56005881305849); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6043046)(6042046); SRVR:PS1PR0301MB2012; BCL:0; PCL:0; RULEID:; SRVR:PS1PR0301MB2012; X-Microsoft-Exchange-Diagnostics: 1; PS1PR0301MB2012; 4:i9ZGscwoDR+EI++iIKR0Sy8FJmiv6jqhdcnLHUclpuOX0QPHi9MAhcmcBltDH2PxEMBrPX/1QTFYUyH6gjbxyRMH4Jq9nsKhrE4o6NFJhfGfE3CV5Q3qsri+AF0BHGY3upODVZbDd0x7JGku/X4luJ1WN5YLZ4JmyfYLSsH/oPJNlRnZAQWAHp9/JetL53n2gXRbcbJSJQ6b7HBnzPbqS5xBrSrz77C0Qk3LqfT5JRbwLrlcrn4oK96kWPpmMBgFMQeJTaBRvtRUvJasqNxjTubyBRzTZQLTUIeQjM67RZ+CoGGkevIV2k3e2IbPxVi0sQdUvGTB9OOOHn32z86KQCbhR1R/iS8924jfbGL3I+7AqO8KcVmLeRyh9JkZWA6Sejgm3xOzXiy9tVOrV2hxwM7aNdOWe2LJl5V7DFhqkpROBkKhb+AgffA7+PYfknL7gHgwZ/FCdkIIBDH+bKn7QQzh65Q7Ht5VrOW+X2G9yE8= X-Forefront-PRVS: 0035B15214 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(24454002)(199003)(189002)(31696002)(450100001)(189998001)(92566002)(83506001)(36756003)(65806001)(47776003)(4001350100001)(23676002)(107886002)(33646002)(105586002)(5001770100001)(65956001)(106356001)(66066001)(97736004)(76176999)(50986999)(230700001)(77096005)(5820100001)(305945005)(2906002)(19580395003)(586003)(7846002)(68736007)(31686004)(101416001)(3846002)(50466002)(54356999)(7736002)(64126003)(6116002)(42186005)(2201001)(81156014)(81166006)(2950100001)(15975445007)(86362001)(8676002)(65826006); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR0301MB2012; H:hammer.pct.niksun.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: niksun.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtQUzFQUjAzMDFNQjIwMTI7MjM6Ny8vMWVOS1pPR2xzeHl6aGdzTjhmSVk3?= =?utf-8?B?R1c4ZmRrQktXUjFvUGFjcE5mYU8raHJGNWZIOVRXUXdpS1JhS2RUdk0xdFBF?= =?utf-8?B?M1ZLaXdBNmtkNzVVc1RoYTFMMzR5enBseXRjdi9GWEw5dk4ybWVkbUI2aVNw?= =?utf-8?B?TVJKeE5MbjNJeE16RUM0NXpDTjhxUGNKcWI1Ui9nTE5qRzhaWjYvUERLRGEw?= =?utf-8?B?TmxOQzBlWUdnSFJIUlg1anNueE1EZnI0R2FabEVCaDZ2QUhneTNOaTZ6aXRF?= =?utf-8?B?VndqZGJTdHQ5UXg3ejhBMjNmOGgvOGFtWXd0c0xCbEsreHhvdWRkRXVqU1Fu?= =?utf-8?B?NzBSN0J3RmZzQXhNQ3dpWlVLVnFKWi9keXRtK0FuWkZwd0xMR0Y5RUZIeUJP?= =?utf-8?B?blI1bysvT3dhSEVmU0N2Nm03d2J5bDBBUXV3N0ZMRng3U0NCMGlWbEN4T01K?= =?utf-8?B?aXBjbktxaitoVFhJVUhtWTF0cXpKeXYyK2RqYVhNT2E4M200cTcreTk5MTRE?= =?utf-8?B?eHpMQmhjK0xMZ1l1a2Q5QlIyTG5MQ2k1cjZlVkNHRlRqbThhV0syTkoraWx1?= =?utf-8?B?THlHQWVEZGs1Tk9qZ1I0TDJxSUZMcnpuZGxSbzBURVJGN0dyN0dHL2IyU09v?= =?utf-8?B?ZmQ5M0I4eGo4NU9kMUhZeFp1enhlaVZ6UU1PN25lQVBHeTBJbU5uUVJMZStu?= =?utf-8?B?a3IxOVJxVTdxN0xFbXBkQ2kwT2tzOE90eFRadXJ2T05xVHdubW1yN1M1M0Y0?= =?utf-8?B?QTlCdUpVdXErWndidWdFZ1F4ZThjWCt2THpPZWxudVRvaDdlNldZdFQzaU9u?= =?utf-8?B?VkpSQk1Xc0RLKy9ZYkFaVE9Jd0tHWGhicVgxR1hieVVueWFGbjY1RmhpTHBX?= =?utf-8?B?eE82aSttMnE2bHpZZEoya3lYSHlpb044cVVXb0V1NEQ5cjdEc1A3a2twOE8y?= =?utf-8?B?MGdtZzhaZG5iTU1XQUN5NE1mYXpMSW5HTC9KM2Ftc1FCQXNMd3FPYTlzMmpP?= =?utf-8?B?dFNyNVB4S0xYLzRZd1lWY3g5VWR0VjJVN01TRmxEeXJZM2pSeGRkc0M3RXdi?= =?utf-8?B?M3RmZFpMK25aTllyb0JJUU1HcXMwejFBVkZ5ZW03K0p4YzR6UHZUd1QyYjNu?= =?utf-8?B?VFlIRzVMOHlDS0tJL3ZXTWYrdVNxZVVWTnMvTVM1QTVxeVJzVWtYN25FOEQ3?= =?utf-8?B?VjhkT1Juc3BuK1dxWXQ3SHh0UjQ4eVBYS2dYaExVelNkMXBZYkl6UXl6VTVO?= =?utf-8?B?Q1VaQWxGRUY3bjk4UUZhOWl0RFFNM2JzTmNhaE9CZDdjVnM4MHU4TW1aU2lu?= =?utf-8?B?djlnMTZtcm5id2tqWmxWa1pScDMwYnYxZFdLRGxUYzRrVDFzc0lUcDBhWHl2?= =?utf-8?B?LzZrUXg4VVpSMGNjcTNvZHJ6a2VDOG1zWVdkVnoxUXIzVUl4Z3pJZlpHcjFp?= =?utf-8?B?a0k2R0M0WG0vczQzR3Boc0VraTZ6T0cyRTlqZUF0Qit1S1N1Ny9WdTZHb1Y0?= =?utf-8?B?c1FXcHRHTkoyYlg2M3JYaXh0YXdBOFNNdkNHSXhOb1EzSHJiQks3QVdZdnFC?= =?utf-8?B?cU9IYWFCY1A1OXl6a3J6c1hOM1lXRjV5cmJxRlZiU3I5TmoxZDZuUE1uQkl6?= =?utf-8?B?Y3JFV1hiMGtPcW56RWRnTDFBK0l1cWluQWpBb2dFc1pxK1Y1aTRGMnpWSFdD?= =?utf-8?B?NjVMZWxMSG5IbFhjcXpsenNUSjFsSS9paFNpVFlDbU10eVBtRXU5UXNkOW5M?= =?utf-8?Q?l674/x2nbioamhkak4WSLSRMdSMyW11V5LQkxRQ=3D?= X-Microsoft-Exchange-Diagnostics: 1; PS1PR0301MB2012; 6:v+xAyO8L/58GzZqhRdx6gs3wlCHWGh+zpSeNXN0gDopacQwYNUJ9q1AfBDbQncXbuUboea+bYBHGJDqoxP/HB+PtWU7qQMTA5frYjYxHvSgLhmr+ZWVarQ1wiMDgVsrqutb0xslchiLT51TXevTGzPGX0VqtnDCV8rl46dcNXmieaC8j5ArrB8XVgDzLbburPfPAujYh96rwJUA5SnI53vJ9b+BxjOjjq9dxFBQmiisxDv3aINXBEILt3M0frERg1mD8ldLmP5bHplvqnFyI/8whyrUYVVkVmPixKLbFXb31kignRYGZW9GbDW3P8rOw; 5:lwWGvgdN5EpIlGgvhyRC5n8ZNWFHDAMqkaT121BcERyY5kIogGMxvxCVMtQV+hZU/8xGuoSYsgqInobNZE+F4hI40smfhlSnOv8forPzMu3bo37i6egD6imLz/LZrCAk8UBIfYdczJY9fPJpYHCptg==; 24:i89xbpsfZgXkZkGLDQ3IL9YXS6kNe9/pNVFqaq0HO1QA2BZRYX/4NVQIRuNfrilXc/d6xEOSxLaKUXSH0CUrnGGElVY5R5fO3okKpZ2bQw8=; 7:Po61cz3JkrLFjtwN0sFhvia2cb7fTn/M3VKpuigO1givQ7AzsoBWrTIWhmW8eD0YRHaQK4F8BhMtSHADb/8/2hsLRNxG09XUOuXt9d69pvA0C5+BQjc2QEvyGDRzXNaLAeK4eAnU2jkJcG/i/f6N4H6r9MQgHKS94lOMnPtXb7YXg2zddXVhUvDIJVBPsOH0E6qNmb33F9/AB7xFq4p1Eu4YWZVoczw5B8t9I2lKlkZUXRcir34ZXscgR6ABtS6B SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: niksun.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2016 22:14:09.7890 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR0301MB2012 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 22:48:17 -0000 On 08/13/2016 11:59, Baptiste Daroussin wrote: > Author: bapt > Date: Sat Aug 13 15:59:18 2016 > New Revision: 304045 > URL: https://svnweb.freebsd.org/changeset/base/304045 > > Log: > Set date and time formats back to what they were before CLDR ... This broke ko_KR.* and zh_* date formats. Try env LANG=ko_KR.UTF-8 date env LANG=zh_CN.UTF-8 date You'll see "" is repeated. Jung-uk Kim From owner-svn-src-head@freebsd.org Mon Aug 15 23:20:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B5BABBB15B; Mon, 15 Aug 2016 23:20: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 6CA501AAA; Mon, 15 Aug 2016 23:20: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 u7FNKt5l085212; Mon, 15 Aug 2016 23:20:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FNKt2C085210; Mon, 15 Aug 2016 23:20:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608152320.u7FNKt2C085210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Aug 2016 23:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304191 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 15 Aug 2016 23:20:56 -0000 Author: emaste Date: Mon Aug 15 23:20:55 2016 New Revision: 304191 URL: https://svnweb.freebsd.org/changeset/base/304191 Log: elfcopy: correct comment typo in r304151 Modified: head/contrib/elftoolchain/elfcopy/ascii.c Modified: head/contrib/elftoolchain/elfcopy/ascii.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/ascii.c Mon Aug 15 21:44:06 2016 (r304190) +++ head/contrib/elftoolchain/elfcopy/ascii.c Mon Aug 15 23:20:55 2016 (r304191) @@ -251,7 +251,7 @@ create_elf_from_srec(struct elfcopy *ecp sec_index = 1; sec_addr = entry = 0; while (fgets(line, _LINE_BUFSZ, ifp) != NULL) { - sz = 0; /* Silence GCC 5.3 unintialized variable warning */ + sz = 0; /* Silence GCC 5.3 uninitialized variable warning */ if (line[0] == '\r' || line[0] == '\n') continue; if (line[0] == '$' && line[1] == '$') { From owner-svn-src-head@freebsd.org Tue Aug 16 00:15:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11403BBBF24; Tue, 16 Aug 2016 00:15:17 +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 DC7A81227; Tue, 16 Aug 2016 00:15:16 +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 u7G0FGv4007175; Tue, 16 Aug 2016 00:15:16 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G0FF5M007167; Tue, 16 Aug 2016 00:15:15 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201608160015.u7G0FF5M007167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 16 Aug 2016 00:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304192 - head/share/timedef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 00:15:17 -0000 Author: jkim Date: Tue Aug 16 00:15:15 2016 New Revision: 304192 URL: https://svnweb.freebsd.org/changeset/base/304192 Log: Fix ko_KR, zh_CN, zh_HK, and zh_TW locales. r304045 did not fully revert date/time formats for these locales. Modified: head/share/timedef/ko_KR.UTF-8.src head/share/timedef/ko_KR.eucKR.src (contents, props changed) head/share/timedef/zh_CN.GB2312.src (contents, props changed) head/share/timedef/zh_CN.GBK.src (contents, props changed) head/share/timedef/zh_CN.UTF-8.src head/share/timedef/zh_CN.eucCN.src (contents, props changed) head/share/timedef/zh_HK.UTF-8.src (contents, props changed) head/share/timedef/zh_TW.Big5.src (contents, props changed) head/share/timedef/zh_TW.UTF-8.src (contents, props changed) Modified: head/share/timedef/ko_KR.UTF-8.src ============================================================================== --- head/share/timedef/ko_KR.UTF-8.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/ko_KR.UTF-8.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names - 1ì›” - 2ì›” - 3ì›” - 4ì›” - 5ì›” - 6ì›” - 7ì›” - 8ì›” - 9ì›” -10ì›” -11ì›” -12ì›” + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) 1ì›” Modified: head/share/timedef/ko_KR.eucKR.src ============================================================================== --- head/share/timedef/ko_KR.eucKR.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/ko_KR.eucKR.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names - 1¿ù - 2¿ù - 3¿ù - 4¿ù - 5¿ù - 6¿ù - 7¿ù - 8¿ù - 9¿ù -10¿ù -11¿ù -12¿ù + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) 1¿ù Modified: head/share/timedef/zh_CN.GB2312.src ============================================================================== --- head/share/timedef/zh_CN.GB2312.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/zh_CN.GB2312.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,53 +4,53 @@ # ----------------------------------------------------------------------------- # # Short month names -!!#1TB -!!#2TB -!!#3TB -!!#4TB -!!#5TB -!!#6TB -!!#7TB -!!#8TB -!!#9TB -#1#0TB -#1#1TB -#1#2TB + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) -R;TB -6~TB -H}TB -KDTB -NeTB -AyTB -F_TB -0KTB ->ETB -J.TB -J.R;TB -J.6~TB +Ò»Ô +¶þÔ +ÈýÔ +ËÄÔ +ÎåÔ +ÁùÔ +ÆßÔ +°ËÔ +¾ÅÔ +ʮԠ+ʮһÔ +Ê®¶þÔ # # Short weekday names -V\HU -V\R; -V\6~ -V\H} -V\KD -V\Ne -V\Ay +ÖÜÈÕ +ÖÜÒ» +Öܶþ +ÖÜÈý +ÖÜËÄ +ÖÜÎå +ÖÜÁù # # Long weekday names -PGFZHU -PGFZR; -PGFZ6~ -PGFZH} -PGFZKD -PGFZNe -PGFZAy +ÐÇÆÚÈÕ +ÐÇÆÚÒ» +ÐÇÆÚ¶þ +ÐÇÆÚÈý +ÐÇÆÚËÄ +ÐÇÆÚÎå +ÐÇÆÚÁù # # X_fmt -%Hʱ%M·Ö%SÃë +%Hʱ%M·Ö%SÃë # # x_fmt %Y/%m/%d @@ -59,25 +59,25 @@ PGFZAy %a %b/%e %T %Y # # AM/PM -IONg -OBNg +ÉÏÎç +ÏÂÎç # # date_fmt -%YÄê%bÔÂ%eÈÕ %A %X %Z +%YÄê%bÔÂ%eÈÕ %A %X %Z # # Long month names (without case ending) -R;TB -6~TB -H}TB -KDTB -NeTB -AyTB -F_TB -0KTB ->ETB -J.TB -J.R;TB -J.6~TB +Ò»Ô +¶þÔ +ÈýÔ +ËÄÔ +ÎåÔ +ÁùÔ +ÆßÔ +°ËÔ +¾ÅÔ +ʮԠ+ʮһÔ +Ê®¶þÔ # # md_order md Modified: head/share/timedef/zh_CN.GBK.src ============================================================================== --- head/share/timedef/zh_CN.GBK.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/zh_CN.GBK.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names - 1Ô - 2Ô - 3Ô - 4Ô - 5Ô - 6Ô - 7Ô - 8Ô - 9Ô -10Ô -11Ô -12Ô + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) Ò»Ô Modified: head/share/timedef/zh_CN.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/zh_CN.eucCN.src ============================================================================== --- head/share/timedef/zh_CN.eucCN.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/zh_CN.eucCN.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names -¡¡£±Ô -¡¡£²Ô -¡¡£³Ô -¡¡£´Ô -¡¡£µÔ -¡¡£¶Ô -¡¡£·Ô -¡¡£¸Ô -¡¡£¹Ô -£±£°Ô -£±£±Ô -£±£²Ô + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) Ò»Ô Modified: head/share/timedef/zh_HK.UTF-8.src ============================================================================== --- head/share/timedef/zh_HK.UTF-8.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/zh_HK.UTF-8.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names - 1月 - 2月 - 3月 - 4月 - 5月 - 6月 - 7月 - 8月 - 9月 -10月 -11月 -12月 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) 1月 Modified: head/share/timedef/zh_TW.Big5.src ============================================================================== --- head/share/timedef/zh_TW.Big5.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/zh_TW.Big5.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,32 +4,32 @@ # ----------------------------------------------------------------------------- # # Short month names -¡@¢°¤ë -¡@¢±¤ë -¡@¢²¤ë -¡@¢³¤ë -¡@¢´¤ë -¡@¢µ¤ë -¡@¢¶¤ë -¡@¢·¤ë -¡@¢¸¤ë -¢°¢¯¤ë -¢°¢°¤ë -¢°¢±¤ë + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) -¢°¤ë -¢±¤ë -¢²¤ë -¢³¤ë -¢´¤ë -¢µ¤ë -¢¶¤ë -¢·¤ë -¢¸¤ë -¢°¢¯¤ë -¢°¢°¤ë -¢°¢±¤ë +1¤ë +2¤ë +3¤ë +4¤ë +5¤ë +6¤ë +7¤ë +8¤ë +9¤ë +10¤ë +11¤ë +12¤ë # # Short weekday names ¶g¤é @@ -62,21 +62,22 @@ ¤W¤È ¤U¤È # +# date_fmt %Y¦~%b¤ë%e¤é %A %X %Z # # Long month names (without case ending) -¢°¤ë -¢±¤ë -¢²¤ë -¢³¤ë -¢´¤ë -¢µ¤ë -¢¶¤ë -¢·¤ë -¢¸¤ë -¢°¢¯¤ë -¢°¢°¤ë -¢°¢±¤ë +1¤ë +2¤ë +3¤ë +4¤ë +5¤ë +6¤ë +7¤ë +8¤ë +9¤ë +10¤ë +11¤ë +12¤ë # # md_order md Modified: head/share/timedef/zh_TW.UTF-8.src ============================================================================== --- head/share/timedef/zh_TW.UTF-8.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/zh_TW.UTF-8.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names - 1月 - 2月 - 3月 - 4月 - 5月 - 6月 - 7月 - 8月 - 9月 -10月 -11月 -12月 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) 1月 From owner-svn-src-head@freebsd.org Tue Aug 16 00:48:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9DD2BBA698; Tue, 16 Aug 2016 00:48:14 +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 A95091FA1; Tue, 16 Aug 2016 00:48:14 +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 u7G0mDLr018205; Tue, 16 Aug 2016 00:48:13 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G0mDMl018204; Tue, 16 Aug 2016 00:48:13 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201608160048.u7G0mDMl018204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 16 Aug 2016 00:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304194 - head/usr.bin/nfsstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 00:48:15 -0000 Author: rmacklem Date: Tue Aug 16 00:48:13 2016 New Revision: 304194 URL: https://svnweb.freebsd.org/changeset/base/304194 Log: Fix r304026 so that it builds for gcc. Reported by: np Tested by: np MFC after: 1 month Modified: head/usr.bin/nfsstat/nfsstat.c Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Tue Aug 16 00:40:38 2016 (r304193) +++ head/usr.bin/nfsstat/nfsstat.c Tue Aug 16 00:48:13 2016 (r304194) @@ -130,7 +130,8 @@ static void compute_new_stats(struct nfs struct stattypes { int stat_type; int nfs_type; -} static statstruct[] = { +}; +static struct stattypes statstruct[] = { {STAT_TYPE_READ, NFSV4OP_READ}, {STAT_TYPE_WRITE, NFSV4OP_WRITE}, {STAT_TYPE_COMMIT, NFSV4OP_COMMIT} From owner-svn-src-head@freebsd.org Tue Aug 16 02:14:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51016BBBE5F; Tue, 16 Aug 2016 02:14:39 +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 EA2B91610; Tue, 16 Aug 2016 02:14:38 +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 u7G2Ebib051095; Tue, 16 Aug 2016 02:14:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G2EbAp051094; Tue, 16 Aug 2016 02:14:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608160214.u7G2EbAp051094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 02:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304195 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 02:14:39 -0000 Author: markj Date: Tue Aug 16 02:14:36 2016 New Revision: 304195 URL: https://svnweb.freebsd.org/changeset/base/304195 Log: MFV r304056: 5396 fix longjmp clobbering errors illumos/illumos-gate@67a4bb8f9ad4c49e9aa9e21e2114a7c093c3a73a Reviewed by: Josef 'Jeff' Sipek Reviewed by: Igor Kozhukhov Approved by: Richard Lowe Author: Gary Mills Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Tue Aug 16 00:48:13 2016 (r304194) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Tue Aug 16 02:14:36 2016 (r304195) @@ -23,6 +23,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright 2015 Gary Mills */ /* @@ -2435,7 +2436,7 @@ dt_compile(dtrace_hdl_t *dtp, int contex dt_node_t *dnp; dt_decl_t *ddp; dt_pcb_t pcb; - void *rv; + void *volatile rv; int err; if ((fp == NULL && s == NULL) || (cflags & ~DTRACE_C_MASK) != 0) { From owner-svn-src-head@freebsd.org Tue Aug 16 02:16:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4FDCBBBF16; Tue, 16 Aug 2016 02:16:55 +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 98C6F1877; Tue, 16 Aug 2016 02:16:55 +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 u7G2GsB3051248; Tue, 16 Aug 2016 02:16:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G2GsUV051244; Tue, 16 Aug 2016 02:16:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608160216.u7G2GsUV051244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 02:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304196 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 02:16:55 -0000 Author: markj Date: Tue Aug 16 02:16:54 2016 New Revision: 304196 URL: https://svnweb.freebsd.org/changeset/base/304196 Log: MFV r296989: 6734 dtrace_canstore_statvar() fails for some valid static variables Reviewed by: Dan McDonald Approved by: Richard Lowe Author: Bryan Cantrill illumos/illumos-gate@d65f2bb4e50559c6c375a2aa9f728cbc34379015 MFC after: 2 weeks Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d - copied unchanged from r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d - copied unchanged from r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d (from r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d Tue Aug 16 02:16:54 2016 (r304196, copy of r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d) @@ -0,0 +1,32 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2016, Joyent, Inc. All rights reserved. + */ + +#pragma D option strsize=16k + +char *k; + +BEGIN +{ + j = probeprov; + k = j; + k[0] = 'D'; + k[1] = 'T'; +} + +BEGIN +{ + trace(stringof(k)); + exit(k == "DTrace" ? 0 : 1); +} Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d (from r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d Tue Aug 16 02:16:54 2016 (r304196, copy of r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d) @@ -0,0 +1,29 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2016, Joyent, Inc. All rights reserved. + */ + +#pragma D option strsize=16k + +BEGIN +{ + this->j = probeprov; + this->j[0] = 'D'; + this->j[1] = 'T'; +} + +BEGIN +{ + trace(this->j); + exit(this->j == "DTrace" ? 0 : 1); +} Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:14:36 2016 (r304195) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:16:54 2016 (r304196) @@ -707,8 +707,8 @@ dtrace_canstore_statvar(uint64_t addr, s if (nsvars == 0) return (0); - maxglobalsize = dtrace_statvar_maxsize; - maxlocalsize = (maxglobalsize + sizeof (uint64_t)) * NCPU; + maxglobalsize = dtrace_statvar_maxsize + sizeof (uint64_t); + maxlocalsize = maxglobalsize * NCPU; for (i = 0; i < nsvars; i++) { dtrace_statvar_t *svar = svars[i]; @@ -726,8 +726,8 @@ dtrace_canstore_statvar(uint64_t addr, s * DTrace to escalate an orthogonal kernel heap corruption bug * into the ability to store to arbitrary locations in memory. */ - VERIFY((scope == DIFV_SCOPE_GLOBAL && size < maxglobalsize) || - (scope == DIFV_SCOPE_LOCAL && size < maxlocalsize)); + VERIFY((scope == DIFV_SCOPE_GLOBAL && size <= maxglobalsize) || + (scope == DIFV_SCOPE_LOCAL && size <= maxlocalsize)); if (DTRACE_INRANGE(addr, sz, svar->dtsv_data, svar->dtsv_size)) return (1); From owner-svn-src-head@freebsd.org Tue Aug 16 02:18:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65958BBBFD7; Tue, 16 Aug 2016 02:18:35 +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 1D42E19FE; Tue, 16 Aug 2016 02:18:35 +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 u7G2IYwJ051358; Tue, 16 Aug 2016 02:18:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G2IYDj051357; Tue, 16 Aug 2016 02:18:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608160218.u7G2IYDj051357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 02:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304197 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 02:18:35 -0000 Author: markj Date: Tue Aug 16 02:18:34 2016 New Revision: 304197 URL: https://svnweb.freebsd.org/changeset/base/304197 Log: MFV r301524: 7034 negative record sizes should be rejected Reviewed by: Patrick Mooney Reviewed by: Bryan Cantrill Approved by: Matthew Ahrens Author: Alex Wilson illumos/illumos-gate@0b8049bfb0e291160e960697b554596289d7f0bc MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:16:54 2016 (r304196) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:18:34 2016 (r304197) @@ -11017,7 +11017,7 @@ dtrace_ecb_enable(dtrace_ecb_t *ecb) } } -static void +static int dtrace_ecb_resize(dtrace_ecb_t *ecb) { dtrace_action_t *act; @@ -11051,6 +11051,8 @@ dtrace_ecb_resize(dtrace_ecb_t *ecb) curneeded = P2ROUNDUP(curneeded, rec->dtrd_alignment); rec->dtrd_offset = curneeded; + if (curneeded + rec->dtrd_size < curneeded) + return (EINVAL); curneeded += rec->dtrd_size; ecb->dte_needed = MAX(ecb->dte_needed, curneeded); @@ -11075,6 +11077,8 @@ dtrace_ecb_resize(dtrace_ecb_t *ecb) } curneeded = P2ROUNDUP(curneeded, rec->dtrd_alignment); rec->dtrd_offset = curneeded; + if (curneeded + rec->dtrd_size < curneeded) + return (EINVAL); curneeded += rec->dtrd_size; } else { /* tuples must be followed by an aggregation */ @@ -11084,6 +11088,8 @@ dtrace_ecb_resize(dtrace_ecb_t *ecb) ecb->dte_size = P2ROUNDUP(ecb->dte_size, rec->dtrd_alignment); rec->dtrd_offset = ecb->dte_size; + if (ecb->dte_size + rec->dtrd_size < ecb->dte_size) + return (EINVAL); ecb->dte_size += rec->dtrd_size; ecb->dte_needed = MAX(ecb->dte_needed, ecb->dte_size); } @@ -11103,6 +11109,7 @@ dtrace_ecb_resize(dtrace_ecb_t *ecb) ecb->dte_needed = P2ROUNDUP(ecb->dte_needed, (sizeof (dtrace_epid_t))); ecb->dte_state->dts_needed = MAX(ecb->dte_state->dts_needed, ecb->dte_needed); + return (0); } static dtrace_action_t * @@ -11788,7 +11795,10 @@ dtrace_ecb_create(dtrace_state_t *state, } } - dtrace_ecb_resize(ecb); + if ((enab->dten_error = dtrace_ecb_resize(ecb)) != 0) { + dtrace_ecb_destroy(ecb); + return (NULL); + } return (dtrace_ecb_create_cache = ecb); } From owner-svn-src-head@freebsd.org Tue Aug 16 02:20:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A57FBBA04F; Tue, 16 Aug 2016 02:20:03 +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 093701BCB; Tue, 16 Aug 2016 02:20:02 +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 u7G2K2gU051483; Tue, 16 Aug 2016 02:20:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G2K2Yu051482; Tue, 16 Aug 2016 02:20:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608160220.u7G2K2Yu051482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 02:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304198 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 02:20:03 -0000 Author: markj Date: Tue Aug 16 02:20:02 2016 New Revision: 304198 URL: https://svnweb.freebsd.org/changeset/base/304198 Log: MFV r301525: 7033 ustack helper should fault on bad return values Reviewed by: Patrick Mooney Reviewed by: Bryan Cantrill Approved by: Matthew Ahrens Author: Alex Wilson illumos/illumos-gate@a2f72b65ebc430aaf277ad797e554bb4deba9b95 MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:18:34 2016 (r304197) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:20:02 2016 (r304198) @@ -6929,6 +6929,7 @@ dtrace_action_ustack(dtrace_mstate_t *ms uint64_t *pcs = &buf[1], *fps; char *str = (char *)&pcs[nframes]; int size, offs = 0, i, j; + size_t rem; uintptr_t old = mstate->dtms_scratch_ptr, saved; uint16_t *flags = &cpu_core[curcpu].cpuc_dtrace_flags; char *sym; @@ -7000,12 +7001,18 @@ dtrace_action_ustack(dtrace_mstate_t *ms continue; } + if (!dtrace_strcanload((uintptr_t)sym, strsize, &rem, mstate, + &(state->dts_vstate))) { + str[offs++] = '\0'; + continue; + } + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); /* * Now copy in the string that the helper returned to us. */ - for (j = 0; offs + j < strsize; j++) { + for (j = 0; offs + j < strsize && j < rem; j++) { if ((str[offs + j] = sym[j]) == '\0') break; } From owner-svn-src-head@freebsd.org Tue Aug 16 02:25:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C59BBA215; Tue, 16 Aug 2016 02:25:21 +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 E03811F9A; Tue, 16 Aug 2016 02:25:20 +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 u7G2PKh3054941; Tue, 16 Aug 2016 02:25:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G2PKZI054939; Tue, 16 Aug 2016 02:25:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608160225.u7G2PKZI054939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 02:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304199 - in head/sys/cddl/contrib/opensolaris/uts/common: dtrace sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 02:25:21 -0000 Author: markj Date: Tue Aug 16 02:25:19 2016 New Revision: 304199 URL: https://svnweb.freebsd.org/changeset/base/304199 Log: MFV r301526: 7035 string-related subroutines should validate input earlier Reviewed by: Alex Wilson Reviewed by: Bryan Cantrill Approved by: Matthew Ahrens Author: Patrick Mooney illumos/illumos-gate@771e39c3b1d6e2e0ba230442d782d83c60098296 MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:20:02 2016 (r304198) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:25:19 2016 (r304199) @@ -480,6 +480,14 @@ static kmutex_t dtrace_errlock; (testaddr) + (testsz) - (uintptr_t)(baseaddr) <= (basesz) && \ (testaddr) + (testsz) >= (testaddr)) +#define DTRACE_RANGE_REMAIN(remp, addr, baseaddr, basesz) \ +do { \ + if ((remp) != NULL) { \ + *(remp) = (uintptr_t)(baseaddr) + (basesz) - (addr); \ + } \ +_NOTE(CONSTCOND) } while (0) + + /* * Test whether alloc_sz bytes will fit in the scratch region. We isolate * alloc_sz on the righthand side of the comparison in order to avoid overflow @@ -588,6 +596,10 @@ dtrace_dynvar_t *dtrace_dynvar(dtrace_ds uintptr_t dtrace_dif_varstr(uintptr_t, dtrace_state_t *, dtrace_mstate_t *); static int dtrace_priv_proc(dtrace_state_t *); static void dtrace_getf_barrier(void); +static int dtrace_canload_remains(uint64_t, size_t, size_t *, + dtrace_mstate_t *, dtrace_vstate_t *); +static int dtrace_canstore_remains(uint64_t, size_t, size_t *, + dtrace_mstate_t *, dtrace_vstate_t *); /* * DTrace Probe Context Functions @@ -698,7 +710,7 @@ dtrace_inscratch(uintptr_t dest, size_t } static int -dtrace_canstore_statvar(uint64_t addr, size_t sz, +dtrace_canstore_statvar(uint64_t addr, size_t sz, size_t *remain, dtrace_statvar_t **svars, int nsvars) { int i; @@ -729,8 +741,12 @@ dtrace_canstore_statvar(uint64_t addr, s VERIFY((scope == DIFV_SCOPE_GLOBAL && size <= maxglobalsize) || (scope == DIFV_SCOPE_LOCAL && size <= maxlocalsize)); - if (DTRACE_INRANGE(addr, sz, svar->dtsv_data, svar->dtsv_size)) + if (DTRACE_INRANGE(addr, sz, svar->dtsv_data, + svar->dtsv_size)) { + DTRACE_RANGE_REMAIN(remain, addr, svar->dtsv_data, + svar->dtsv_size); return (1); + } } return (0); @@ -746,12 +762,26 @@ static int dtrace_canstore(uint64_t addr, size_t sz, dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) { + return (dtrace_canstore_remains(addr, sz, NULL, mstate, vstate)); +} + +/* + * Implementation of dtrace_canstore which communicates the upper bound of the + * allowed memory region. + */ +static int +dtrace_canstore_remains(uint64_t addr, size_t sz, size_t *remain, + dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) +{ /* * First, check to see if the address is in scratch space... */ if (DTRACE_INRANGE(addr, sz, mstate->dtms_scratch_base, - mstate->dtms_scratch_size)) + mstate->dtms_scratch_size)) { + DTRACE_RANGE_REMAIN(remain, addr, mstate->dtms_scratch_base, + mstate->dtms_scratch_size); return (1); + } /* * Now check to see if it's a dynamic variable. This check will pick @@ -804,6 +834,7 @@ dtrace_canstore(uint64_t addr, size_t sz ((dvar->dtdv_tuple.dtt_nkeys - 1) * sizeof (dtrace_key_t))) return (0); + DTRACE_RANGE_REMAIN(remain, addr, dvar, dstate->dtds_chunksize); return (1); } @@ -811,11 +842,11 @@ dtrace_canstore(uint64_t addr, size_t sz * Finally, check the static local and global variables. These checks * take the longest, so we perform them last. */ - if (dtrace_canstore_statvar(addr, sz, + if (dtrace_canstore_statvar(addr, sz, remain, vstate->dtvs_locals, vstate->dtvs_nlocals)) return (1); - if (dtrace_canstore_statvar(addr, sz, + if (dtrace_canstore_statvar(addr, sz, remain, vstate->dtvs_globals, vstate->dtvs_nglobals)) return (1); @@ -836,6 +867,17 @@ static int dtrace_canload(uint64_t addr, size_t sz, dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) { + return (dtrace_canload_remains(addr, sz, NULL, mstate, vstate)); +} + +/* + * Implementation of dtrace_canload which communicates the uppoer bound of the + * allowed memory region. + */ +static int +dtrace_canload_remains(uint64_t addr, size_t sz, size_t *remain, + dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) +{ volatile uintptr_t *illval = &cpu_core[curcpu].cpuc_dtrace_illval; file_t *fp; @@ -843,21 +885,27 @@ dtrace_canload(uint64_t addr, size_t sz, * If we hold the privilege to read from kernel memory, then * everything is readable. */ - if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) + if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) { + DTRACE_RANGE_REMAIN(remain, addr, addr, sz); return (1); + } /* * You can obviously read that which you can store. */ - if (dtrace_canstore(addr, sz, mstate, vstate)) + if (dtrace_canstore_remains(addr, sz, remain, mstate, vstate)) return (1); /* * We're allowed to read from our own string table. */ if (DTRACE_INRANGE(addr, sz, mstate->dtms_difo->dtdo_strtab, - mstate->dtms_difo->dtdo_strlen)) + mstate->dtms_difo->dtdo_strlen)) { + DTRACE_RANGE_REMAIN(remain, addr, + mstate->dtms_difo->dtdo_strtab, + mstate->dtms_difo->dtdo_strlen); return (1); + } if (vstate->dtvs_state != NULL && dtrace_priv_proc(vstate->dtvs_state)) { @@ -879,27 +927,38 @@ dtrace_canload(uint64_t addr, size_t sz, * deallocated and reallocated as something else while it's * being operated upon. */ - if (DTRACE_INRANGE(addr, sz, curthread, sizeof (kthread_t))) + if (DTRACE_INRANGE(addr, sz, curthread, sizeof (kthread_t))) { + DTRACE_RANGE_REMAIN(remain, addr, curthread, + sizeof (kthread_t)); return (1); + } if ((p = curthread->t_procp) != NULL && DTRACE_INRANGE(addr, sz, curthread->t_procp, sizeof (proc_t))) { + DTRACE_RANGE_REMAIN(remain, addr, curthread->t_procp, + sizeof (proc_t)); return (1); } if (curthread->t_cred != NULL && DTRACE_INRANGE(addr, sz, curthread->t_cred, sizeof (cred_t))) { + DTRACE_RANGE_REMAIN(remain, addr, curthread->t_cred, + sizeof (cred_t)); return (1); } #ifdef illumos if (p != NULL && p->p_pidp != NULL && DTRACE_INRANGE(addr, sz, &(p->p_pidp->pid_id), sizeof (pid_t))) { + DTRACE_RANGE_REMAIN(remain, addr, &(p->p_pidp->pid_id), + sizeof (pid_t)); return (1); } if (curthread->t_cpu != NULL && DTRACE_INRANGE(addr, sz, curthread->t_cpu, offsetof(cpu_t, cpu_pause_thread))) { + DTRACE_RANGE_REMAIN(remain, addr, curthread->t_cpu, + offsetof(cpu_t, cpu_pause_thread)); return (1); } #endif @@ -922,31 +981,46 @@ dtrace_canload(uint64_t addr, size_t sz, * either dtms_getf itself or its f_vnode member to reference * freed memory). */ - if (DTRACE_INRANGE(addr, sz, fp, sizeof (file_t))) + if (DTRACE_INRANGE(addr, sz, fp, sizeof (file_t))) { + DTRACE_RANGE_REMAIN(remain, addr, fp, sizeof (file_t)); return (1); + } if ((vp = fp->f_vnode) != NULL) { + size_t slen; #ifdef illumos - if (DTRACE_INRANGE(addr, sz, &vp->v_path, psz)) + if (DTRACE_INRANGE(addr, sz, &vp->v_path, psz)) { + DTRACE_RANGE_REMAIN(remain, addr, &vp->v_path, + psz); return (1); - if (vp->v_path != NULL && DTRACE_INRANGE(addr, sz, - vp->v_path, strlen(vp->v_path) + 1)) { + } + slen = strlen(vp->v_path) + 1; + if (DTRACE_INRANGE(addr, sz, vp->v_path, slen)) { + DTRACE_RANGE_REMAIN(remain, addr, vp->v_path, + slen); return (1); } #endif - if (DTRACE_INRANGE(addr, sz, &vp->v_op, psz)) + if (DTRACE_INRANGE(addr, sz, &vp->v_op, psz)) { + DTRACE_RANGE_REMAIN(remain, addr, &vp->v_op, + psz); return (1); + } #ifdef illumos if ((op = vp->v_op) != NULL && DTRACE_INRANGE(addr, sz, &op->vnop_name, psz)) { + DTRACE_RANGE_REMAIN(remain, addr, + &op->vnop_name, psz); return (1); } if (op != NULL && op->vnop_name != NULL && DTRACE_INRANGE(addr, sz, op->vnop_name, - strlen(op->vnop_name) + 1)) { + (slen = strlen(op->vnop_name) + 1))) { + DTRACE_RANGE_REMAIN(remain, addr, + op->vnop_name, slen); return (1); } #endif @@ -965,21 +1039,41 @@ dtrace_canload(uint64_t addr, size_t sz, * calls in the event that the user has all privileges. */ static int -dtrace_strcanload(uint64_t addr, size_t sz, dtrace_mstate_t *mstate, - dtrace_vstate_t *vstate) +dtrace_strcanload(uint64_t addr, size_t sz, size_t *remain, + dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) { - size_t strsz; + size_t rsize; /* * If we hold the privilege to read from kernel memory, then * everything is readable. */ - if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) + if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) { + DTRACE_RANGE_REMAIN(remain, addr, addr, sz); return (1); + } - strsz = 1 + dtrace_strlen((char *)(uintptr_t)addr, sz); - if (dtrace_canload(addr, strsz, mstate, vstate)) - return (1); + /* + * Even if the caller is uninterested in querying the remaining valid + * range, it is required to ensure that the access is allowed. + */ + if (remain == NULL) { + remain = &rsize; + } + if (dtrace_canload_remains(addr, 0, remain, mstate, vstate)) { + size_t strsz; + /* + * Perform the strlen after determining the length of the + * memory region which is accessible. This prevents timing + * information from being used to find NULs in memory which is + * not accessible to the caller. + */ + strsz = 1 + dtrace_strlen((char *)(uintptr_t)addr, + MIN(sz, *remain)); + if (strsz <= *remain) { + return (1); + } + } return (0); } @@ -989,26 +1083,49 @@ dtrace_strcanload(uint64_t addr, size_t * region in which a load may be issued given the user's privilege level. */ static int -dtrace_vcanload(void *src, dtrace_diftype_t *type, dtrace_mstate_t *mstate, - dtrace_vstate_t *vstate) +dtrace_vcanload(void *src, dtrace_diftype_t *type, size_t *remain, + dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) { size_t sz; ASSERT(type->dtdt_flags & DIF_TF_BYREF); /* + * Calculate the max size before performing any checks since even + * DTRACE_ACCESS_KERNEL-credentialed callers expect that this function + * return the max length via 'remain'. + */ + if (type->dtdt_kind == DIF_TYPE_STRING) { + dtrace_state_t *state = vstate->dtvs_state; + + if (state != NULL) { + sz = state->dts_options[DTRACEOPT_STRSIZE]; + } else { + /* + * In helper context, we have a NULL state; fall back + * to using the system-wide default for the string size + * in this case. + */ + sz = dtrace_strsize_default; + } + } else { + sz = type->dtdt_size; + } + + /* * If we hold the privilege to read from kernel memory, then * everything is readable. */ - if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) + if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) { + DTRACE_RANGE_REMAIN(remain, (uintptr_t)src, src, sz); return (1); + } - if (type->dtdt_kind == DIF_TYPE_STRING) - sz = dtrace_strlen(src, - vstate->dtvs_state->dts_options[DTRACEOPT_STRSIZE]) + 1; - else - sz = type->dtdt_size; - - return (dtrace_canload((uintptr_t)src, sz, mstate, vstate)); + if (type->dtdt_kind == DIF_TYPE_STRING) { + return (dtrace_strcanload((uintptr_t)src, sz, remain, mstate, + vstate)); + } + return (dtrace_canload_remains((uintptr_t)src, sz, remain, mstate, + vstate)); } /* @@ -1198,14 +1315,14 @@ dtrace_strcpy(const void *src, void *dst * specified type; we assume that we can store to directly. */ static void -dtrace_vcopy(void *src, void *dst, dtrace_diftype_t *type) +dtrace_vcopy(void *src, void *dst, dtrace_diftype_t *type, size_t limit) { ASSERT(type->dtdt_flags & DIF_TF_BYREF); if (type->dtdt_kind == DIF_TYPE_STRING) { - dtrace_strcpy(src, dst, type->dtdt_size); + dtrace_strcpy(src, dst, MIN(type->dtdt_size, limit)); } else { - dtrace_bcopy(src, dst, type->dtdt_size); + dtrace_bcopy(src, dst, MIN(type->dtdt_size, limit)); } } @@ -4503,31 +4620,30 @@ dtrace_dif_subr(uint_t subr, uint_t rd, uintptr_t kaddr = tupregs[0].dttk_value; uintptr_t uaddr = tupregs[1].dttk_value; uint64_t size = tupregs[2].dttk_value; + size_t lim; if (!dtrace_destructive_disallow && dtrace_priv_proc_control(state) && !dtrace_istoxic(kaddr, size) && - dtrace_strcanload(kaddr, size, mstate, vstate)) { + dtrace_strcanload(kaddr, size, &lim, mstate, vstate)) { DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - dtrace_copyoutstr(kaddr, uaddr, size, flags); + dtrace_copyoutstr(kaddr, uaddr, lim, flags); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); } break; } case DIF_SUBR_STRLEN: { - size_t sz; + size_t size = state->dts_options[DTRACEOPT_STRSIZE]; uintptr_t addr = (uintptr_t)tupregs[0].dttk_value; - sz = dtrace_strlen((char *)addr, - state->dts_options[DTRACEOPT_STRSIZE]); + size_t lim; - if (!dtrace_canload(addr, sz + 1, mstate, vstate)) { + if (!dtrace_strcanload(addr, size, &lim, mstate, vstate)) { regs[rd] = 0; break; } - regs[rd] = sz; - + regs[rd] = dtrace_strlen((char *)addr, lim); break; } @@ -4540,12 +4656,19 @@ dtrace_dif_subr(uint_t subr, uint_t rd, * is DIF_SUBR_STRRCHR, we will look for the last occurrence * of the specified character instead of the first. */ - uintptr_t saddr = tupregs[0].dttk_value; uintptr_t addr = tupregs[0].dttk_value; - uintptr_t limit = addr + state->dts_options[DTRACEOPT_STRSIZE]; + uintptr_t addr_limit; + uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; + size_t lim; char c, target = (char)tupregs[1].dttk_value; - for (regs[rd] = 0; addr < limit; addr++) { + if (!dtrace_strcanload(addr, size, &lim, mstate, vstate)) { + regs[rd] = 0; + break; + } + addr_limit = addr + lim; + + for (regs[rd] = 0; addr < addr_limit; addr++) { if ((c = dtrace_load8(addr)) == target) { regs[rd] = addr; @@ -4556,12 +4679,6 @@ dtrace_dif_subr(uint_t subr, uint_t rd, if (c == '\0') break; } - - if (!dtrace_canload(saddr, addr - saddr, mstate, vstate)) { - regs[rd] = 0; - break; - } - break; } @@ -4719,7 +4836,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, uintptr_t addr = tupregs[0].dttk_value; uintptr_t tokaddr = tupregs[1].dttk_value; uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; - uintptr_t limit, toklimit = tokaddr + size; + uintptr_t limit, toklimit; + size_t clim; uint8_t c = 0, tokmap[32]; /* 256 / 8 */ char *dest = (char *)mstate->dtms_scratch_ptr; int i; @@ -4728,10 +4846,11 @@ dtrace_dif_subr(uint_t subr, uint_t rd, * Check both the token buffer and (later) the input buffer, * since both could be non-scratch addresses. */ - if (!dtrace_strcanload(tokaddr, size, mstate, vstate)) { + if (!dtrace_strcanload(tokaddr, size, &clim, mstate, vstate)) { regs[rd] = 0; break; } + toklimit = tokaddr + clim; if (!DTRACE_INSCRATCH(mstate, size)) { DTRACE_CPUFLAG_SET(CPU_DTRACE_NOSCRATCH); @@ -4748,6 +4867,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, * it behaves like an implicit clause-local variable. */ addr = mstate->dtms_strtok; + limit = mstate->dtms_strtok_limit; } else { /* * If the user-specified address is non-NULL we must @@ -4757,10 +4877,12 @@ dtrace_dif_subr(uint_t subr, uint_t rd, * (when we fetch addr from mstate->dtms_strtok) * would fail this access check. */ - if (!dtrace_strcanload(addr, size, mstate, vstate)) { + if (!dtrace_strcanload(addr, size, &clim, mstate, + vstate)) { regs[rd] = 0; break; } + limit = addr + clim; } /* @@ -4779,10 +4901,10 @@ dtrace_dif_subr(uint_t subr, uint_t rd, tokmap[c >> 3] |= (1 << (c & 0x7)); } - for (limit = addr + size; addr < limit; addr++) { + for (; addr < limit; addr++) { /* - * We're looking for a character that is _not_ contained - * in the token string. + * We're looking for a character that is _not_ + * contained in the token string. */ if ((c = dtrace_load8(addr)) == '\0') break; @@ -4800,6 +4922,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, */ regs[rd] = 0; mstate->dtms_strtok = 0; + mstate->dtms_strtok_limit = 0; break; } @@ -4822,6 +4945,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, regs[rd] = (uintptr_t)dest; mstate->dtms_scratch_ptr += size; mstate->dtms_strtok = addr; + mstate->dtms_strtok_limit = limit; break; } @@ -5199,10 +5323,12 @@ dtrace_dif_subr(uint_t subr, uint_t rd, uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; uintptr_t s1 = tupregs[0].dttk_value; uintptr_t s2 = tupregs[1].dttk_value; - int i = 0; + int i = 0, j = 0; + size_t lim1, lim2; + char c; - if (!dtrace_strcanload(s1, size, mstate, vstate) || - !dtrace_strcanload(s2, size, mstate, vstate)) { + if (!dtrace_strcanload(s1, size, &lim1, mstate, vstate) || + !dtrace_strcanload(s2, size, &lim2, mstate, vstate)) { regs[rd] = 0; break; } @@ -5219,8 +5345,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, regs[rd] = 0; break; } - - if ((d[i++] = dtrace_load8(s1++)) == '\0') { + c = (i >= lim1) ? '\0' : dtrace_load8(s1++); + if ((d[i++] = c) == '\0') { i--; break; } @@ -5233,7 +5359,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, break; } - if ((d[i++] = dtrace_load8(s2++)) == '\0') + c = (j++ >= lim2) ? '\0' : dtrace_load8(s2++); + if ((d[i++] = c) == '\0') break; } @@ -5248,6 +5375,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, case DIF_SUBR_STRTOLL: { uintptr_t s = tupregs[0].dttk_value; uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; + size_t lim; int base = 10; if (nargs > 1) { @@ -5258,12 +5386,12 @@ dtrace_dif_subr(uint_t subr, uint_t rd, } } - if (!dtrace_strcanload(s, size, mstate, vstate)) { + if (!dtrace_strcanload(s, size, &lim, mstate, vstate)) { regs[rd] = INT64_MIN; break; } - regs[rd] = dtrace_strtoll((char *)s, base, size); + regs[rd] = dtrace_strtoll((char *)s, base, lim); break; } @@ -5498,12 +5626,13 @@ dtrace_dif_subr(uint_t subr, uint_t rd, char *dest = (char *)mstate->dtms_scratch_ptr, c; uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; uintptr_t src = tupregs[0].dttk_value; + size_t lim; int i = 0, j = 0; #ifdef illumos zone_t *z; #endif - if (!dtrace_strcanload(src, size, mstate, vstate)) { + if (!dtrace_strcanload(src, size, &lim, mstate, vstate)) { regs[rd] = 0; break; } @@ -5518,7 +5647,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, * Move forward, loading each character. */ do { - c = dtrace_load8(src + i++); + c = (i >= lim) ? '\0' : dtrace_load8(src + i++); next: if (j + 5 >= size) /* 5 = strlen("/..c\0") */ break; @@ -5528,7 +5657,7 @@ next: continue; } - c = dtrace_load8(src + i++); + c = (i >= lim) ? '\0' : dtrace_load8(src + i++); if (c == '/') { /* @@ -5549,7 +5678,7 @@ next: continue; } - c = dtrace_load8(src + i++); + c = (i >= lim) ? '\0' : dtrace_load8(src + i++); if (c == '/') { /* @@ -5572,7 +5701,7 @@ next: continue; } - c = dtrace_load8(src + i++); + c = (i >= lim) ? '\0' : dtrace_load8(src + i++); if (c != '/' && c != '\0') { /* @@ -6211,15 +6340,17 @@ dtrace_dif_emulate(dtrace_difo_t *difo, size_t sz = state->dts_options[DTRACEOPT_STRSIZE]; uintptr_t s1 = regs[r1]; uintptr_t s2 = regs[r2]; + size_t lim1, lim2; if (s1 != 0 && - !dtrace_strcanload(s1, sz, mstate, vstate)) + !dtrace_strcanload(s1, sz, &lim1, mstate, vstate)) break; if (s2 != 0 && - !dtrace_strcanload(s2, sz, mstate, vstate)) + !dtrace_strcanload(s2, sz, &lim2, mstate, vstate)) break; - cc_r = dtrace_strncmp((char *)s1, (char *)s2, sz); + cc_r = dtrace_strncmp((char *)s1, (char *)s2, + MIN(lim1, lim2)); cc_n = cc_r < 0; cc_z = cc_r == 0; @@ -6278,6 +6409,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) { uintptr_t a = (uintptr_t)svar->dtsv_data; + size_t lim; ASSERT(a != 0); ASSERT(svar->dtsv_size != 0); @@ -6291,11 +6423,11 @@ dtrace_dif_emulate(dtrace_difo_t *difo, } if (!dtrace_vcanload( (void *)(uintptr_t)regs[rd], &v->dtdv_type, - mstate, vstate)) + &lim, mstate, vstate)) break; dtrace_vcopy((void *)(uintptr_t)regs[rd], - (void *)a, &v->dtdv_type); + (void *)a, &v->dtdv_type, lim); break; } @@ -6334,6 +6466,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) { uintptr_t a = (uintptr_t)svar->dtsv_data; size_t sz = v->dtdv_type.dtdt_size; + size_t lim; sz += sizeof (uint64_t); ASSERT(svar->dtsv_size == NCPU * sz); @@ -6373,6 +6506,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) { uintptr_t a = (uintptr_t)svar->dtsv_data; size_t sz = v->dtdv_type.dtdt_size; + size_t lim; sz += sizeof (uint64_t); ASSERT(svar->dtsv_size == NCPU * sz); @@ -6388,11 +6522,11 @@ dtrace_dif_emulate(dtrace_difo_t *difo, if (!dtrace_vcanload( (void *)(uintptr_t)regs[rd], &v->dtdv_type, - mstate, vstate)) + &lim, mstate, vstate)) break; dtrace_vcopy((void *)(uintptr_t)regs[rd], - (void *)a, &v->dtdv_type); + (void *)a, &v->dtdv_type, lim); break; } @@ -6466,13 +6600,15 @@ dtrace_dif_emulate(dtrace_difo_t *difo, break; if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) { + size_t lim; + if (!dtrace_vcanload( (void *)(uintptr_t)regs[rd], - &v->dtdv_type, mstate, vstate)) + &v->dtdv_type, &lim, mstate, vstate)) break; dtrace_vcopy((void *)(uintptr_t)regs[rd], - dvar->dtdv_data, &v->dtdv_type); + dvar->dtdv_data, &v->dtdv_type, lim); } else { *((uint64_t *)dvar->dtdv_data) = regs[rd]; } @@ -6614,13 +6750,15 @@ dtrace_dif_emulate(dtrace_difo_t *difo, break; if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) { + size_t lim; + if (!dtrace_vcanload( (void *)(uintptr_t)regs[rd], &v->dtdv_type, - mstate, vstate)) + &lim, mstate, vstate)) break; dtrace_vcopy((void *)(uintptr_t)regs[rd], - dvar->dtdv_data, &v->dtdv_type); + dvar->dtdv_data, &v->dtdv_type, lim); } else { *((uint64_t *)dvar->dtdv_data) = regs[rd]; } @@ -7747,7 +7885,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t a if (dp->dtdo_rtype.dtdt_flags & DIF_TF_BYREF && !dtrace_vcanload((void *)(uintptr_t)val, - &dp->dtdo_rtype, &mstate, vstate)) + &dp->dtdo_rtype, NULL, &mstate, vstate)) continue; dtrace_store_by_ref(dp, tomax, size, &valoffs, Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h Tue Aug 16 02:20:02 2016 (r304198) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h Tue Aug 16 02:25:19 2016 (r304199) @@ -23,12 +23,12 @@ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. * Use is subject to license terms. */ /* - * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright 2016 Joyent, Inc. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_DTRACE_IMPL_H @@ -932,6 +932,7 @@ typedef struct dtrace_mstate { int dtms_ipl; /* cached interrupt pri lev */ int dtms_fltoffs; /* faulting DIFO offset */ uintptr_t dtms_strtok; /* saved strtok() pointer */ + uintptr_t dtms_strtok_limit; /* upper bound of strtok ptr */ uint32_t dtms_access; /* memory access rights */ dtrace_difo_t *dtms_difo; /* current dif object */ file_t *dtms_getf; /* cached rval of getf() */ From owner-svn-src-head@freebsd.org Tue Aug 16 02:30:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3570BBA2CC; Tue, 16 Aug 2016 02:30:21 +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 6DF511304; Tue, 16 Aug 2016 02:30:21 +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 u7G2UKBY055175; Tue, 16 Aug 2016 02:30:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G2UKBQ055166; Tue, 16 Aug 2016 02:30:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608160230.u7G2UKBQ055166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 02:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304200 - in head/cddl: contrib/opensolaris/cmd/dtrace/test/cmd/scripts contrib/opensolaris/cmd/dtrace/test/tst/common/sugar contrib/opensolaris/lib/libdtrace/common lib/libdtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 02:30:21 -0000 Author: markj Date: Tue Aug 16 02:30:19 2016 New Revision: 304200 URL: https://svnweb.freebsd.org/changeset/base/304200 Log: MFV r304057: 7085 add support for "if" and "else" statements in dtrace illumos/illumos-gate@c3bd3abd8856e8e75d820f65c58031cd6cbac818 Add syntactic sugar to dtrace: "if" and "else" statements. The sugar is baked down to standard dtrace features by adding additional clauses with the appropriate predicates. Reviewed by: Adam Leventhal Reviewed by: Sebastien Roy Reviewed by: Paul Dagnelie Reviewed by: Bryan Cantrill Approved by: Richard Lowe Author: Matthew Ahrens MFC after: 2 weeks Relnotes: yes Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sugar/ - copied from r304057, vendor/illumos/dist/cmd/dtrace/test/tst/common/sugar/ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c - copied unchanged from r304057, vendor/illumos/dist/lib/libdtrace/common/dt_sugar.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h head/cddl/lib/libdtrace/Makefile Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl Tue Aug 16 02:25:19 2016 (r304199) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl Tue Aug 16 02:30:19 2016 (r304200) @@ -25,6 +25,10 @@ # Use is subject to license terms. # +# +# Copyright (c) 2014, 2016 by Delphix. All rights reserved. +# + require 5.8.4; $PNAME = $0; @@ -131,7 +135,8 @@ sub dstyle } if (!/^enum/ && !/^\t*struct/ && !/^\t*union/ && !/^typedef/ && - !/^translator/ && !/^provider/) { + !/^translator/ && !/^provider/ && !/\tif / && + !/ else /) { if (/[\w\s]+{/) { err "left brace not on its own line"; } @@ -141,7 +146,7 @@ sub dstyle } } - if (!/;$/) { + if (!/;$/ && !/\t*}$/ && !/ else /) { if (/[\w\s]+}/) { err "right brace not on its own line"; } Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Tue Aug 16 02:25:19 2016 (r304199) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Tue Aug 16 02:30:19 2016 (r304200) @@ -21,8 +21,8 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2015 Gary Mills */ @@ -120,7 +120,6 @@ static const dtrace_diftype_t dt_int_rty static void *dt_compile(dtrace_hdl_t *, int, dtrace_probespec_t, void *, uint_t, int, char *const[], FILE *, const char *); - /*ARGSUSED*/ static int dt_idreset(dt_idhash_t *dhp, dt_ident_t *idp, void *ignored) @@ -2519,6 +2518,28 @@ dt_compile(dtrace_hdl_t *dtp, int contex } /* + * Perform sugar transformations (for "if" / "else") and replace the + * existing clause chain with the new one. + */ + if (context == DT_CTX_DPROG) { + dt_node_t *dnp, *next_dnp; + dt_node_t *new_list = NULL; + + for (dnp = yypcb->pcb_root->dn_list; + dnp != NULL; dnp = next_dnp) { + /* remove this node from the list */ + next_dnp = dnp->dn_list; + dnp->dn_list = NULL; + + if (dnp->dn_kind == DT_NODE_CLAUSE) + dnp = dt_compile_sugar(dtp, dnp); + /* append node to the new list */ + new_list = dt_node_link(new_list, dnp); + } + yypcb->pcb_root->dn_list = new_list; + } + + /* * If we have successfully created a parse tree for a D program, loop * over the clauses and actions and instantiate the corresponding * libdtrace program. If we are parsing a D expression, then we @@ -2538,6 +2559,8 @@ dt_compile(dtrace_hdl_t *dtp, int contex for (; dnp != NULL; dnp = dnp->dn_list) { switch (dnp->dn_kind) { case DT_NODE_CLAUSE: + if (DT_TREEDUMP_PASS(dtp, 4)) + dt_printd(dnp, stderr, 0); dt_compile_clause(dtp, dnp); break; case DT_NODE_XLATOR: Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y Tue Aug 16 02:25:19 2016 (r304199) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y Tue Aug 16 02:30:19 2016 (r304200) @@ -23,8 +23,9 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ + /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2014, 2016 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -155,6 +156,8 @@ %type probe_specifier_list %type probe_specifier %type statement_list +%type statement_list_impl +%type statement_or_block %type statement %type declaration %type init_declarator_list @@ -319,9 +322,11 @@ probe_definition: "or actions following probe description\n"); } $$ = dt_node_clause($1, NULL, NULL); + yybegin(YYS_CLAUSE); } | probe_specifiers '{' statement_list '}' { $$ = dt_node_clause($1, NULL, $3); + yybegin(YYS_CLAUSE); } | probe_specifiers DT_TOK_DIV expression DT_TOK_EPRED { dnerror($3, D_SYNTAX, "expected actions { } following " @@ -330,6 +335,7 @@ probe_definition: | probe_specifiers DT_TOK_DIV expression DT_TOK_EPRED '{' statement_list '}' { $$ = dt_node_clause($1, $3, $6); + yybegin(YYS_CLAUSE); } ; @@ -349,12 +355,30 @@ probe_specifier: | DT_TOK_INT { $$ = dt_node_pdesc_by_id($1); } ; -statement_list: statement { $$ = $1; } - | statement_list ';' statement { $$ = LINK($1, $3); } +statement_list_impl: /* empty */ { $$ = NULL; } + | statement_list_impl statement { $$ = LINK($1, $2); } + ; + +statement_list: + statement_list_impl { $$ = $1; } + | statement_list_impl expression { + $$ = LINK($1, dt_node_statement($2)); + } ; -statement: /* empty */ { $$ = NULL; } - | expression { $$ = dt_node_statement($1); } +statement_or_block: + statement + | '{' statement_list '}' { $$ = $2; } + +statement: ';' { $$ = NULL; } + | expression ';' { $$ = dt_node_statement($1); } + | DT_KEY_IF DT_TOK_LPAR expression DT_TOK_RPAR statement_or_block { + $$ = dt_node_if($3, $5, NULL); + } + | DT_KEY_IF DT_TOK_LPAR expression DT_TOK_RPAR + statement_or_block DT_KEY_ELSE statement_or_block { + $$ = dt_node_if($3, $5, $7); + } ; argument_expression_list: Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Tue Aug 16 02:25:19 2016 (r304199) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Tue Aug 16 02:30:19 2016 (r304200) @@ -26,7 +26,7 @@ /* * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. */ #ifndef _DT_IMPL_H @@ -362,6 +362,7 @@ struct dtrace_hdl { int dt_indent; /* recommended flow indent */ dtrace_epid_t dt_last_epid; /* most recently consumed EPID */ uint64_t dt_last_timestamp; /* most recently consumed timestamp */ + boolean_t dt_has_sugar; /* syntactic sugar used? */ }; /* Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Tue Aug 16 02:25:19 2016 (r304199) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Tue Aug 16 02:30:19 2016 (r304200) @@ -22,7 +22,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. */ #include @@ -130,8 +130,9 @@ #define DT_VERS_1_11 DT_VERSION_NUMBER(1, 11, 0) #define DT_VERS_1_12 DT_VERSION_NUMBER(1, 12, 0) #define DT_VERS_1_12_1 DT_VERSION_NUMBER(1, 12, 1) -#define DT_VERS_LATEST DT_VERS_1_12_1 -#define DT_VERS_STRING "Sun D 1.12.1" +#define DT_VERS_1_13 DT_VERSION_NUMBER(1, 13, 0) +#define DT_VERS_LATEST DT_VERS_1_13 +#define DT_VERS_STRING "Sun D 1.13" const dt_version_t _dtrace_versions[] = { DT_VERS_1_0, /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */ @@ -157,6 +158,7 @@ const dt_version_t _dtrace_versions[] = DT_VERS_1_11, /* D API 1.11 */ DT_VERS_1_12, /* D API 1.12 */ DT_VERS_1_12_1, /* D API 1.12.1 */ + DT_VERS_1_13, /* D API 1.13 */ 0 }; Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Tue Aug 16 02:25:19 2016 (r304199) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Tue Aug 16 02:30:19 2016 (r304200) @@ -23,7 +23,7 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2013, Joyent Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -2143,6 +2143,17 @@ dt_node_statement(dt_node_t *expr) } dt_node_t * +dt_node_if(dt_node_t *pred, dt_node_t *acts, dt_node_t *else_acts) +{ + dt_node_t *dnp = dt_node_alloc(DT_NODE_IF); + dnp->dn_conditional = pred; + dnp->dn_body = acts; + dnp->dn_alternate_body = else_acts; + + return (dnp); +} + +dt_node_t * dt_node_pdesc_by_name(char *spec) { dtrace_hdl_t *dtp = yypcb->pcb_hdl; @@ -2211,7 +2222,6 @@ dt_node_clause(dt_node_t *pdescs, dt_nod dnp->dn_pred = pred; dnp->dn_acts = acts; - yybegin(YYS_CLAUSE); return (dnp); } @@ -3203,8 +3213,9 @@ dt_cook_op2(dt_node_t *dnp, uint_t idfla dt_xcook_ident(lp, dhp, idkind, B_TRUE); else dt_xcook_ident(lp, dhp, idp->di_kind, B_FALSE); - } else + } else { lp = dnp->dn_left = dt_node_cook(lp, 0); + } /* * Switch op to '+' for *(E1 + E2) array mode in these cases: @@ -3218,10 +3229,12 @@ dt_cook_op2(dt_node_t *dnp, uint_t idfla if (lp->dn_ident->di_kind == DT_IDENT_ARRAY) { if (lp->dn_args != NULL) op = DT_TOK_ADD; - } else if (!dt_ident_unref(lp->dn_ident)) + } else if (!dt_ident_unref(lp->dn_ident)) { op = DT_TOK_ADD; - } else if (lp->dn_kind != DT_NODE_AGG) + } + } else if (lp->dn_kind != DT_NODE_AGG) { op = DT_TOK_ADD; + } } switch (op) { @@ -3645,45 +3658,34 @@ asgn_common: case DT_TOK_PTR: /* - * If the left-hand side of operator -> is the name "self", - * then we permit a TLS variable to be created or referenced. + * If the left-hand side of operator -> is one of the scoping + * keywords, permit a local or thread variable to be created or + * referenced. */ - if (lp->dn_kind == DT_NODE_IDENT && - strcmp(lp->dn_string, "self") == 0) { - if (rp->dn_kind != DT_NODE_VAR) { - dt_xcook_ident(rp, dtp->dt_tls, - DT_IDENT_SCALAR, B_TRUE); - } - - if (idflags != 0) - rp = dt_node_cook(rp, idflags); - - dnp->dn_right = dnp->dn_left; /* avoid freeing rp */ - dt_node_free(dnp); - return (rp); - } + if (lp->dn_kind == DT_NODE_IDENT) { + dt_idhash_t *dhp = NULL; - /* - * If the left-hand side of operator -> is the name "this", - * then we permit a local variable to be created or referenced. - */ - if (lp->dn_kind == DT_NODE_IDENT && - strcmp(lp->dn_string, "this") == 0) { - if (rp->dn_kind != DT_NODE_VAR) { - dt_xcook_ident(rp, yypcb->pcb_locals, - DT_IDENT_SCALAR, B_TRUE); + if (strcmp(lp->dn_string, "self") == 0) { + dhp = dtp->dt_tls; + } else if (strcmp(lp->dn_string, "this") == 0) { + dhp = yypcb->pcb_locals; } + if (dhp != NULL) { + if (rp->dn_kind != DT_NODE_VAR) { + dt_xcook_ident(rp, dhp, + DT_IDENT_SCALAR, B_TRUE); + } - if (idflags != 0) - rp = dt_node_cook(rp, idflags); + if (idflags != 0) + rp = dt_node_cook(rp, idflags); - dnp->dn_right = dnp->dn_left; /* avoid freeing rp */ - dt_node_free(dnp); - return (rp); + /* avoid freeing rp */ + dnp->dn_right = dnp->dn_left; + dt_node_free(dnp); + return (rp); + } } - /*FALLTHRU*/ - case DT_TOK_DOT: lp = dnp->dn_left = dt_node_cook(lp, DT_IDFLG_REF); @@ -4502,7 +4504,8 @@ static dt_node_t *(*dt_cook_funcs[])(dt_ dt_cook_xlator, /* DT_NODE_XLATOR */ dt_cook_none, /* DT_NODE_PROBE */ dt_cook_provider, /* DT_NODE_PROVIDER */ - dt_cook_none /* DT_NODE_PROG */ + dt_cook_none, /* DT_NODE_PROG */ + dt_cook_none, /* DT_NODE_IF */ }; /* @@ -4517,6 +4520,8 @@ dt_node_cook(dt_node_t *dnp, uint_t idfl yylineno = dnp->dn_line; + assert(dnp->dn_kind < + sizeof (dt_cook_funcs) / sizeof (dt_cook_funcs[0])); dnp = dt_cook_funcs[dnp->dn_kind](dnp, idflags); dnp->dn_flags |= DT_NF_COOKED; @@ -4619,6 +4624,181 @@ dt_node_diftype(dtrace_hdl_t *dtp, const tp->dtdt_size = ctf_type_size(dnp->dn_ctfp, dnp->dn_type); } +/* + * Output the parse tree as D. The "-xtree=8" argument will call this + * function to print out the program after any syntactic sugar + * transformations have been applied (e.g. to implement "if"). The + * resulting output can be used to understand the transformations + * applied by these features, or to run such a script on a system that + * does not support these features + * + * Note that the output does not express precisely the same program as + * the input. In particular: + * - Only the clauses are output. #pragma options, variable + * declarations, etc. are excluded. + * - Command argument substitution has already been done, so the output + * will not contain e.g. $$1, but rather the substituted string. + */ +void +dt_printd(dt_node_t *dnp, FILE *fp, int depth) +{ + dt_node_t *arg; + + switch (dnp->dn_kind) { + case DT_NODE_INT: + (void) fprintf(fp, "0x%llx", (u_longlong_t)dnp->dn_value); + if (!(dnp->dn_flags & DT_NF_SIGNED)) + (void) fprintf(fp, "u"); + break; + + case DT_NODE_STRING: { + char *escd = strchr2esc(dnp->dn_string, strlen(dnp->dn_string)); + (void) fprintf(fp, "\"%s\"", escd); + free(escd); + break; + } + + case DT_NODE_IDENT: + (void) fprintf(fp, "%s", dnp->dn_string); + break; + + case DT_NODE_VAR: + (void) fprintf(fp, "%s%s", + (dnp->dn_ident->di_flags & DT_IDFLG_LOCAL) ? "this->" : + (dnp->dn_ident->di_flags & DT_IDFLG_TLS) ? "self->" : "", + dnp->dn_ident->di_name); + + if (dnp->dn_args != NULL) { + (void) fprintf(fp, "["); + + for (arg = dnp->dn_args; arg != NULL; + arg = arg->dn_list) { + dt_printd(arg, fp, 0); + if (arg->dn_list != NULL) + (void) fprintf(fp, ", "); + } + + (void) fprintf(fp, "]"); + } + break; + + case DT_NODE_SYM: { + const dtrace_syminfo_t *dts = dnp->dn_ident->di_data; + (void) fprintf(fp, "%s`%s", dts->dts_object, dts->dts_name); + break; + } + case DT_NODE_FUNC: + (void) fprintf(fp, "%s(", dnp->dn_ident->di_name); + + for (arg = dnp->dn_args; arg != NULL; arg = arg->dn_list) { + dt_printd(arg, fp, 0); + if (arg->dn_list != NULL) + (void) fprintf(fp, ", "); + } + (void) fprintf(fp, ")"); + break; + + case DT_NODE_OP1: + (void) fprintf(fp, "%s(", opstr(dnp->dn_op)); + dt_printd(dnp->dn_child, fp, 0); + (void) fprintf(fp, ")"); + break; + + case DT_NODE_OP2: + (void) fprintf(fp, "("); + dt_printd(dnp->dn_left, fp, 0); + if (dnp->dn_op == DT_TOK_LPAR) { + (void) fprintf(fp, ")"); + dt_printd(dnp->dn_right, fp, 0); + break; + } + if (dnp->dn_op == DT_TOK_PTR || dnp->dn_op == DT_TOK_DOT || + dnp->dn_op == DT_TOK_LBRAC) + (void) fprintf(fp, "%s", opstr(dnp->dn_op)); + else + (void) fprintf(fp, " %s ", opstr(dnp->dn_op)); + dt_printd(dnp->dn_right, fp, 0); + if (dnp->dn_op == DT_TOK_LBRAC) { + dt_node_t *ln = dnp->dn_right; + while (ln->dn_list != NULL) { + (void) fprintf(fp, ", "); + dt_printd(ln->dn_list, fp, depth); + ln = ln->dn_list; + } + (void) fprintf(fp, "]"); + } + (void) fprintf(fp, ")"); + break; + + case DT_NODE_OP3: + (void) fprintf(fp, "("); + dt_printd(dnp->dn_expr, fp, 0); + (void) fprintf(fp, " ? "); + dt_printd(dnp->dn_left, fp, 0); + (void) fprintf(fp, " : "); + dt_printd(dnp->dn_right, fp, 0); + (void) fprintf(fp, ")"); + break; + + case DT_NODE_DEXPR: + case DT_NODE_DFUNC: + (void) fprintf(fp, "%*s", depth * 8, ""); + dt_printd(dnp->dn_expr, fp, depth + 1); + (void) fprintf(fp, ";\n"); + break; + + case DT_NODE_PDESC: + (void) fprintf(fp, "%s:%s:%s:%s", + dnp->dn_desc->dtpd_provider, dnp->dn_desc->dtpd_mod, + dnp->dn_desc->dtpd_func, dnp->dn_desc->dtpd_name); + break; + + case DT_NODE_CLAUSE: + for (arg = dnp->dn_pdescs; arg != NULL; arg = arg->dn_list) { + dt_printd(arg, fp, 0); + if (arg->dn_list != NULL) + (void) fprintf(fp, ","); + (void) fprintf(fp, "\n"); + } + + if (dnp->dn_pred != NULL) { + (void) fprintf(fp, "/"); + dt_printd(dnp->dn_pred, fp, 0); + (void) fprintf(fp, "/\n"); + } + (void) fprintf(fp, "{\n"); + + for (arg = dnp->dn_acts; arg != NULL; arg = arg->dn_list) + dt_printd(arg, fp, depth + 1); + (void) fprintf(fp, "}\n"); + (void) fprintf(fp, "\n"); + break; + + case DT_NODE_IF: + (void) fprintf(fp, "%*sif (", depth * 8, ""); + dt_printd(dnp->dn_conditional, fp, 0); + (void) fprintf(fp, ") {\n"); + + for (arg = dnp->dn_body; arg != NULL; arg = arg->dn_list) + dt_printd(arg, fp, depth + 1); + if (dnp->dn_alternate_body == NULL) { + (void) fprintf(fp, "%*s}\n", depth * 8, ""); + } else { + (void) fprintf(fp, "%*s} else {\n", depth * 8, ""); + for (arg = dnp->dn_alternate_body; arg != NULL; + arg = arg->dn_list) + dt_printd(arg, fp, depth + 1); + (void) fprintf(fp, "%*s}\n", depth * 8, ""); + } + + break; + + default: + (void) fprintf(fp, "/* bad node %p, kind %d */\n", + (void *)dnp, dnp->dn_kind); + } +} + void dt_node_printr(dt_node_t *dnp, FILE *fp, int depth) { @@ -4729,6 +4909,13 @@ dt_node_printr(dt_node_t *dnp, FILE *fp, (void) fprintf(fp, "OP2 %s (%s)\n", opstr(dnp->dn_op), buf); dt_node_printr(dnp->dn_left, fp, depth + 1); dt_node_printr(dnp->dn_right, fp, depth + 1); + if (dnp->dn_op == DT_TOK_LBRAC) { + dt_node_t *ln = dnp->dn_right; + while (ln->dn_list != NULL) { + dt_node_printr(ln->dn_list, fp, depth + 1); + ln = ln->dn_list; + } + } break; case DT_NODE_OP3: @@ -4790,6 +4977,7 @@ dt_node_printr(dt_node_t *dnp, FILE *fp, for (arg = dnp->dn_acts; arg != NULL; arg = arg->dn_list) dt_node_printr(arg, fp, depth + 1); + (void) fprintf(fp, "\n"); break; case DT_NODE_INLINE: @@ -4840,6 +5028,24 @@ dt_node_printr(dt_node_t *dnp, FILE *fp, dt_node_printr(arg, fp, depth + 1); break; + case DT_NODE_IF: + (void) fprintf(fp, "IF attr=%s CONDITION:\n", a); + + dt_node_printr(dnp->dn_conditional, fp, depth + 1); + + (void) fprintf(fp, "%*sIF BODY: \n", depth * 2, ""); + for (arg = dnp->dn_body; arg != NULL; arg = arg->dn_list) + dt_node_printr(arg, fp, depth + 1); + + if (dnp->dn_alternate_body != NULL) { + (void) fprintf(fp, "%*sIF ELSE: \n", depth * 2, ""); + for (arg = dnp->dn_alternate_body; arg != NULL; + arg = arg->dn_list) + dt_node_printr(arg, fp, depth + 1); + } + + break; + default: (void) fprintf(fp, "\n", (void *)dnp, dnp->dn_kind); Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h Tue Aug 16 02:25:19 2016 (r304199) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h Tue Aug 16 02:30:19 2016 (r304200) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ @@ -105,6 +105,12 @@ typedef struct dt_node { struct dt_node *_probes; /* list of probe nodes */ int _redecl; /* provider redeclared */ } _provider; + + struct { + struct dt_node *_conditional; + struct dt_node *_body; + struct dt_node *_alternate_body; + } _conditional; } dn_u; struct dt_node *dn_list; /* parse tree list link */ @@ -140,6 +146,11 @@ typedef struct dt_node { #define dn_provred dn_u._provider._redecl /* DT_NODE_PROVIDER */ #define dn_probes dn_u._provider._probes /* DT_NODE_PROVIDER */ +/* DT_NODE_IF: */ +#define dn_conditional dn_u._conditional._conditional +#define dn_body dn_u._conditional._body +#define dn_alternate_body dn_u._conditional._alternate_body + #define DT_NODE_FREE 0 /* unused node (waiting to be freed) */ #define DT_NODE_INT 1 /* integer value */ #define DT_NODE_STRING 2 /* string value */ @@ -162,6 +173,7 @@ typedef struct dt_node { #define DT_NODE_PROBE 19 /* probe definition */ #define DT_NODE_PROVIDER 20 /* provider definition */ #define DT_NODE_PROG 21 /* program translation unit */ +#define DT_NODE_IF 22 /* if statement */ #define DT_NF_SIGNED 0x01 /* data is a signed quantity (else unsigned) */ #define DT_NF_COOKED 0x02 /* data is a known type (else still cooking) */ @@ -213,6 +225,7 @@ extern dt_node_t *dt_node_xlator(dt_decl extern dt_node_t *dt_node_probe(char *, int, dt_node_t *, dt_node_t *); extern dt_node_t *dt_node_provider(char *, dt_node_t *); extern dt_node_t *dt_node_program(dt_node_t *); +extern dt_node_t *dt_node_if(dt_node_t *, dt_node_t *, dt_node_t *); extern dt_node_t *dt_node_link(dt_node_t *, dt_node_t *); extern dt_node_t *dt_node_cook(dt_node_t *, uint_t); @@ -237,6 +250,7 @@ extern void dt_node_promote(dt_node_t *, extern void dt_node_diftype(dtrace_hdl_t *, const dt_node_t *, dtrace_diftype_t *); extern void dt_node_printr(dt_node_t *, FILE *, int); +extern void dt_printd(dt_node_t *, FILE *, int); extern const char *dt_node_name(const dt_node_t *, char *, size_t); extern int dt_node_root(dt_node_t *); Copied: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c (from r304057, vendor/illumos/dist/lib/libdtrace/common/dt_sugar.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c Tue Aug 16 02:30:19 2016 (r304200, copy of r304057, vendor/illumos/dist/lib/libdtrace/common/dt_sugar.c) @@ -0,0 +1,516 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + */ + +/* + * Syntactic sugar features are implemented by transforming the D parse tree + * such that it only uses the subset of D that is supported by the rest of the + * compiler / the kernel. A clause containing these language features is + * referred to as a "super-clause", and its transformation typically entails + * creating several "sub-clauses" to implement it. For diagnosability, the + * sub-clauses will be printed if the "-xtree=8" flag is specified. + * + * Currently, the only syntactic sugar feature is "if/else" statements. Each + * basic block (e.g. the body of the "if" and "else" statements, and the + * statements before and after) is turned into its own sub-clause, with a + * predicate that causes it to be executed only if the code flows to this point. + * Nested if/else statements are supported. + * + * This infrastructure is designed to accommodate other syntactic sugar features + * in the future. + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct dt_sugar_parse { + dtrace_hdl_t *dtsp_dtp; /* dtrace handle */ + dt_node_t *dtsp_pdescs; /* probe descriptions */ + int dtsp_num_conditions; /* number of condition variables */ + int dtsp_num_ifs; /* number of "if" statements */ + dt_node_t *dtsp_clause_list; /* list of clauses */ +} dt_sugar_parse_t; + +static void dt_sugar_visit_stmts(dt_sugar_parse_t *, dt_node_t *, int); + +/* + * Return a node for "self->%error". + * + * Note that the "%" is part of the variable name, and is included so that + * this variable name can not collide with any user-specified variable. + * + * This error variable is used to keep track of if there has been an error + * in any of the sub-clauses, and is used to prevent execution of subsequent + * sub-clauses following an error. + */ +static dt_node_t * +dt_sugar_new_error_var(void) +{ + return (dt_node_op2(DT_TOK_PTR, dt_node_ident(strdup("self")), + dt_node_ident(strdup("%error")))); +} + +/* + * Append this clause to the clause list. + */ +static void +dt_sugar_append_clause(dt_sugar_parse_t *dp, dt_node_t *clause) +{ + dp->dtsp_clause_list = dt_node_link(dp->dtsp_clause_list, clause); +} + +/* + * Prepend this clause to the clause list. + */ +static void +dt_sugar_prepend_clause(dt_sugar_parse_t *dp, dt_node_t *clause) +{ + dp->dtsp_clause_list = dt_node_link(clause, dp->dtsp_clause_list); +} + +/* + * Return a node for "this->%condition_", or NULL if condid==0. + * + * Note that the "%" is part of the variable name, and is included so that + * this variable name can not collide with any user-specified variable. + */ +static dt_node_t * +dt_sugar_new_condition_var(int condid) +{ + char *str; + + if (condid == 0) + return (NULL); + assert(condid > 0); + + (void) asprintf(&str, "%%condition_%d", ABS(condid)); + return (dt_node_op2(DT_TOK_PTR, dt_node_ident(strdup("this")), + dt_node_ident(str))); +} + +/* + * Return new clause to evaluate predicate and set newcond. condid is + * the condition that we are already under, or 0 if none. + * The new clause will be of the form: + * + * dp_pdescs + * /!self->%error/ + * { + * this->%condition_ = + * (this->%condition_ && pred); + * } + * + * Note: if condid==0, we will instead do "... = (1 && pred)", to effectively + * convert the pred to a boolean. + * + * Note: Unless an error has been encountered, we always set the condition + * variable (either to 0 or 1). This lets us avoid resetting the condition + * variables back to 0 when the super-clause completes. + */ +static dt_node_t * +dt_sugar_new_condition_impl(dt_sugar_parse_t *dp, + dt_node_t *pred, int condid, int newcond) +{ + dt_node_t *value, *body, *newpred; + + /* predicate is !self->%error */ + newpred = dt_node_op1(DT_TOK_LNEG, dt_sugar_new_error_var()); + + if (condid == 0) { + /* + * value is (1 && pred) + * + * Note, D doesn't allow a probe-local "this" variable to + * be reused as a different type, even from a different probe. + * Therefore, value can't simply be , because then + * its type could be different when we reuse this condid + * in a different meta-clause. + */ + value = dt_node_op2(DT_TOK_LAND, dt_node_int(1), pred); + } else { + /* value is (this->%condition_ && pred) */ + value = dt_node_op2(DT_TOK_LAND, + dt_sugar_new_condition_var(condid), pred); + } + + /* body is "this->%condition_ = ;" */ + body = dt_node_statement(dt_node_op2(DT_TOK_ASGN, + dt_sugar_new_condition_var(newcond), value)); + + return (dt_node_clause(dp->dtsp_pdescs, newpred, body)); +} + +/* + * Generate a new clause to evaluate predicate and set a new condition variable, + * whose ID will be returned. The new clause will be appended to + * dp_first_new_clause. + */ +static int +dt_sugar_new_condition(dt_sugar_parse_t *dp, dt_node_t *pred, int condid) +{ + dp->dtsp_num_conditions++; + dt_sugar_append_clause(dp, dt_sugar_new_condition_impl(dp, + pred, condid, dp->dtsp_num_conditions)); + return (dp->dtsp_num_conditions); +} + +/* + * Visit the specified node and all of its descendants. Currently this is only + * used to count the number of "if" statements (dtsp_num_ifs). + */ +static void +dt_sugar_visit_all(dt_sugar_parse_t *dp, dt_node_t *dnp) +{ + dt_node_t *arg; + + switch (dnp->dn_kind) { + case DT_NODE_FREE: + case DT_NODE_INT: + case DT_NODE_STRING: + case DT_NODE_SYM: + case DT_NODE_TYPE: + case DT_NODE_PROBE: + case DT_NODE_PDESC: + case DT_NODE_IDENT: + break; + + case DT_NODE_FUNC: + for (arg = dnp->dn_args; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + break; + + case DT_NODE_OP1: + dt_sugar_visit_all(dp, dnp->dn_child); + break; + + case DT_NODE_OP2: + dt_sugar_visit_all(dp, dnp->dn_left); + dt_sugar_visit_all(dp, dnp->dn_right); + if (dnp->dn_op == DT_TOK_LBRAC) { + dt_node_t *ln = dnp->dn_right; + while (ln->dn_list != NULL) { + dt_sugar_visit_all(dp, ln->dn_list); + ln = ln->dn_list; + } + } + break; + + case DT_NODE_OP3: + dt_sugar_visit_all(dp, dnp->dn_expr); + dt_sugar_visit_all(dp, dnp->dn_left); + dt_sugar_visit_all(dp, dnp->dn_right); + break; + + case DT_NODE_DEXPR: + case DT_NODE_DFUNC: + dt_sugar_visit_all(dp, dnp->dn_expr); + break; + + case DT_NODE_AGG: + for (arg = dnp->dn_aggtup; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + + if (dnp->dn_aggfun) + dt_sugar_visit_all(dp, dnp->dn_aggfun); + break; + + case DT_NODE_CLAUSE: + for (arg = dnp->dn_pdescs; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + + if (dnp->dn_pred != NULL) + dt_sugar_visit_all(dp, dnp->dn_pred); + + for (arg = dnp->dn_acts; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + break; + + case DT_NODE_INLINE: { + const dt_idnode_t *inp = dnp->dn_ident->di_iarg; + + dt_sugar_visit_all(dp, inp->din_root); + break; + } + case DT_NODE_MEMBER: + if (dnp->dn_membexpr) + dt_sugar_visit_all(dp, dnp->dn_membexpr); + break; + + case DT_NODE_XLATOR: + for (arg = dnp->dn_members; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + break; + + case DT_NODE_PROVIDER: + for (arg = dnp->dn_probes; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + break; + + case DT_NODE_PROG: + for (arg = dnp->dn_list; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + break; + + case DT_NODE_IF: + dp->dtsp_num_ifs++; + dt_sugar_visit_all(dp, dnp->dn_conditional); + + for (arg = dnp->dn_body; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + for (arg = dnp->dn_alternate_body; arg != NULL; + arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + + break; + + default: + (void) dnerror(dnp, D_UNKNOWN, "bad node %p, kind %d\n", + (void *)dnp, dnp->dn_kind); + } +} + +/* + * Return a new clause which resets the error variable to zero: + * + * dp_pdescs{ self->%error = 0; } + * + * This clause will be executed at the beginning of each meta-clause, to + * ensure the error variable is unset (in case the previous meta-clause + * failed). + */ +static dt_node_t * +dt_sugar_new_clearerror_clause(dt_sugar_parse_t *dp) +{ + dt_node_t *stmt = dt_node_statement(dt_node_op2(DT_TOK_ASGN, + dt_sugar_new_error_var(), dt_node_int(0))); + return (dt_node_clause(dp->dtsp_pdescs, NULL, stmt)); +} + +/* + * Evaluate the conditional, and recursively visit the body of the "if" + * statement (and the "else", if present). + */ +static void +dt_sugar_do_if(dt_sugar_parse_t *dp, dt_node_t *if_stmt, int precondition) +{ + int newid; + + assert(if_stmt->dn_kind == DT_NODE_IF); + + /* condition */ + newid = dt_sugar_new_condition(dp, + if_stmt->dn_conditional, precondition); + + /* body of if */ + dt_sugar_visit_stmts(dp, if_stmt->dn_body, newid); + + /* + * Visit the body of the "else" statement, if present. Note that we + * generate a new condition which is the inverse of the previous + * condition. + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Aug 16 02:34:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D220BBA53C; Tue, 16 Aug 2016 02:34:26 +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 523BE1859; Tue, 16 Aug 2016 02:34:26 +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 u7G2YP1P058583; Tue, 16 Aug 2016 02:34:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G2YPet058579; Tue, 16 Aug 2016 02:34:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608160234.u7G2YPet058579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 02:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304201 - in head: cddl/usr.sbin/dtrace/tests/common cddl/usr.sbin/dtrace/tests/common/scalars cddl/usr.sbin/dtrace/tests/common/sugar etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 02:34:26 -0000 Author: markj Date: Tue Aug 16 02:34:25 2016 New Revision: 304201 URL: https://svnweb.freebsd.org/changeset/base/304201 Log: Regenerate DTrace tests. Added: head/cddl/usr.sbin/dtrace/tests/common/sugar/ head/cddl/usr.sbin/dtrace/tests/common/sugar/Makefile (contents, props changed) Modified: head/cddl/usr.sbin/dtrace/tests/common/Makefile head/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile head/etc/mtree/BSD.tests.dist Modified: head/cddl/usr.sbin/dtrace/tests/common/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/Makefile Tue Aug 16 02:30:19 2016 (r304200) +++ head/cddl/usr.sbin/dtrace/tests/common/Makefile Tue Aug 16 02:34:25 2016 (r304201) @@ -69,6 +69,7 @@ TESTS_SUBDIRS+= aggs \ strlen \ strtoll \ struct \ + sugar \ syscall \ tick-n \ trace \ Modified: head/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile Tue Aug 16 02:30:19 2016 (r304200) +++ head/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile Tue Aug 16 02:34:25 2016 (r304201) @@ -18,6 +18,8 @@ ${PACKAGE}FILES= \ err.D_SYNTAX.declare.d \ err.bigglobal.d \ err.biglocal.d \ + tst.16kglobal.d \ + tst.16klocal.d \ tst.basicvar.d \ tst.basicvar.d.out \ tst.localvar.d \ Added: head/cddl/usr.sbin/dtrace/tests/common/sugar/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/dtrace/tests/common/sugar/Makefile Tue Aug 16 02:34:25 2016 (r304201) @@ -0,0 +1,25 @@ +# $FreeBSD$ + +# +# This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. +# + +PACKAGE= tests + +${PACKAGE}FILES= \ + tst.else.d \ + tst.if.d \ + tst.if2.d \ + tst.if_before_after.d \ + tst.if_nested.d \ + tst.if_trailing_semicolon.d \ + tst.if_trailing_semicolon2.d \ + +TESTEXES= \ + + +CFILES= \ + + + +.include "../../dtrace.test.mk" Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Tue Aug 16 02:30:19 2016 (r304200) +++ head/etc/mtree/BSD.tests.dist Tue Aug 16 02:34:25 2016 (r304201) @@ -183,6 +183,8 @@ .. struct .. + sugar + .. syscall .. sysevent From owner-svn-src-head@freebsd.org Tue Aug 16 06:40:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81292BBBB44; Tue, 16 Aug 2016 06:40:28 +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 5244917AA; Tue, 16 Aug 2016 06:40:28 +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 u7G6eRIj047551; Tue, 16 Aug 2016 06:40:27 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G6eRGg047550; Tue, 16 Aug 2016 06:40:27 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608160640.u7G6eRGg047550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 16 Aug 2016 06:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304202 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 06:40:28 -0000 Author: sephe Date: Tue Aug 16 06:40:27 2016 New Revision: 304202 URL: https://svnweb.freebsd.org/changeset/base/304202 Log: tcp/lro: Make # of LRO entries tunable Reviewed by: hps, gallatin Obtained from: rrs, gallatin MFC after: 2 weeks Sponsored by: Netflix (rrs, gallatin), Microsoft (sephe) Differential Revision: https://reviews.freebsd.org/D7499 Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Tue Aug 16 02:34:25 2016 (r304201) +++ head/sys/netinet/tcp_lro.c Tue Aug 16 06:40:27 2016 (r304202) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -55,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -71,6 +73,14 @@ static void tcp_lro_rx_done(struct lro_c static int tcp_lro_rx2(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum, int use_hash); +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, lro, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "TCP LRO"); + +static unsigned tcp_lro_entries = TCP_LRO_ENTRIES; +SYSCTL_UINT(_net_inet_tcp_lro, OID_AUTO, entries, + CTLFLAG_RDTUN | CTLFLAG_MPSAFE, &tcp_lro_entries, 0, + "default number of LRO entries"); + static __inline void tcp_lro_active_insert(struct lro_ctrl *lc, struct lro_head *bucket, struct lro_entry *le) @@ -91,7 +101,7 @@ tcp_lro_active_remove(struct lro_entry * int tcp_lro_init(struct lro_ctrl *lc) { - return (tcp_lro_init_args(lc, NULL, TCP_LRO_ENTRIES, 0)); + return (tcp_lro_init_args(lc, NULL, tcp_lro_entries, 0)); } int From owner-svn-src-head@freebsd.org Tue Aug 16 07:26:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52033BBB8F2; Tue, 16 Aug 2016 07:26:55 +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 1467311FC; Tue, 16 Aug 2016 07:26:55 +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 u7G7QsIU065561; Tue, 16 Aug 2016 07:26:54 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G7Qr4T065557; Tue, 16 Aug 2016 07:26:53 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608160726.u7G7Qr4T065557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 16 Aug 2016 07:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304204 - in head/sys/dev/hyperv: include netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 07:26:55 -0000 Author: sephe Date: Tue Aug 16 07:26:53 2016 New Revision: 304204 URL: https://svnweb.freebsd.org/changeset/base/304204 Log: hyperv/hn: Factor out hn_nvs_send/hn_nvs_send_sglist Avoid unnecessary message type setting and centralize the send context to transaction id cast. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7500 Modified: head/sys/dev/hyperv/include/vmbus.h head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/include/vmbus.h ============================================================================== --- head/sys/dev/hyperv/include/vmbus.h Tue Aug 16 07:14:09 2016 (r304203) +++ head/sys/dev/hyperv/include/vmbus.h Tue Aug 16 07:26:53 2016 (r304204) @@ -83,6 +83,7 @@ struct vmbus_chanpkt_hdr { #define VMBUS_CHANPKT_TYPE_GPA 0x0009 #define VMBUS_CHANPKT_TYPE_COMP 0x000b +#define VMBUS_CHANPKT_FLAG_NONE 0 #define VMBUS_CHANPKT_FLAG_RC 0x0001 /* report completion */ #define VMBUS_CHANPKT_CONST_DATA(pkt) \ Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 16 07:14:09 2016 (r304203) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 16 07:26:53 2016 (r304204) @@ -206,9 +206,8 @@ hv_nv_init_rx_buffer_with_net_vsp(struct hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); vmbus_xact_activate(xact); - error = vmbus_chan_send(sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - conn, sizeof(*conn), (uint64_t)(uintptr_t)&sndc); + error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, + conn, sizeof(*conn), &sndc); if (error != 0) { if_printf(sc->hn_ifp, "send nvs rxbuf conn failed: %d\n", error); @@ -313,9 +312,8 @@ hv_nv_init_send_buffer_with_net_vsp(stru hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); vmbus_xact_activate(xact); - error = vmbus_chan_send(sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - chim, sizeof(*chim), (uint64_t)(uintptr_t)&sndc); + error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, + chim, sizeof(*chim), &sndc); if (error) { if_printf(sc->hn_ifp, "send nvs chim conn failed: %d\n", error); @@ -393,9 +391,10 @@ hv_nv_destroy_rx_buffer(netvsc_dev *net_ disconn.nvs_type = HN_NVS_TYPE_RXBUF_DISCONN; disconn.nvs_sig = HN_NVS_RXBUF_SIG; - ret = vmbus_chan_send(net_dev->sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, 0, &disconn, sizeof(disconn), - (uint64_t)(uintptr_t)&hn_send_ctx_none); + /* NOTE: No response. */ + ret = hn_nvs_send(net_dev->sc->hn_prichan, + VMBUS_CHANPKT_FLAG_NONE, &disconn, sizeof(disconn), + &hn_send_ctx_none); if (ret != 0) { if_printf(net_dev->sc->hn_ifp, "send rxbuf disconn failed: %d\n", ret); @@ -445,9 +444,10 @@ hv_nv_destroy_send_buffer(netvsc_dev *ne disconn.nvs_type = HN_NVS_TYPE_CHIM_DISCONN; disconn.nvs_sig = HN_NVS_CHIM_SIG; - ret = vmbus_chan_send(net_dev->sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, 0, &disconn, sizeof(disconn), - (uint64_t)(uintptr_t)&hn_send_ctx_none); + /* NOTE: No response. */ + ret = hn_nvs_send(net_dev->sc->hn_prichan, + VMBUS_CHANPKT_FLAG_NONE, &disconn, sizeof(disconn), + &hn_send_ctx_none); if (ret != 0) { if_printf(net_dev->sc->hn_ifp, "send chim disconn failed: %d\n", ret); @@ -509,9 +509,8 @@ hv_nv_negotiate_nvsp_protocol(struct hn_ vmbus_xact_activate(xact); hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); - error = vmbus_chan_send(sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - init, sizeof(*init), (uint64_t)(uintptr_t)&sndc); + error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, + init, sizeof(*init), &sndc); if (error) { if_printf(sc->hn_ifp, "send nvs init failed: %d\n", error); vmbus_xact_deactivate(xact); @@ -560,8 +559,9 @@ hv_nv_send_ndis_config(struct hn_softc * conf.nvs_mtu = mtu; conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN; - error = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0, - &conf, sizeof(conf), (uint64_t)(uintptr_t)&hn_send_ctx_none); + /* NOTE: No response. */ + error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE, + &conf, sizeof(conf), &hn_send_ctx_none); if (error) if_printf(sc->hn_ifp, "send nvs ndis conf failed: %d\n", error); return (error); @@ -627,8 +627,9 @@ hv_nv_connect_to_vsp(struct hn_softc *sc else ndis.nvs_ndis_minor = NDIS_VERSION_MINOR_30; - ret = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0, - &ndis, sizeof(ndis), (uint64_t)(uintptr_t)&hn_send_ctx_none); + /* NOTE: No response. */ + ret = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE, + &ndis, sizeof(ndis), &hn_send_ctx_none); if (ret != 0) { if_printf(sc->hn_ifp, "send nvs ndis init failed: %d\n", ret); goto cleanup; @@ -834,12 +835,11 @@ hv_nv_on_send(struct vmbus_channel *chan sndc->hn_chim_sz; if (gpa_cnt) { - ret = vmbus_chan_send_sglist(chan, gpa, gpa_cnt, - &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)sndc); + ret = hn_nvs_send_sglist(chan, gpa, gpa_cnt, + &send_msg, sizeof(nvsp_msg), sndc); } else { - ret = vmbus_chan_send(chan, - VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)sndc); + ret = hn_nvs_send(chan, VMBUS_CHANPKT_FLAG_RC, + &send_msg, sizeof(nvsp_msg), sndc); } return (ret); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 16 07:14:09 2016 (r304203) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 16 07:26:53 2016 (r304204) @@ -1177,9 +1177,8 @@ hv_rf_on_device_add(struct hn_softc *sc, hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); vmbus_xact_activate(xact); - ret = vmbus_chan_send(sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - req, sizeof(*req), (uint64_t)(uintptr_t)&sndc); + ret = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, + req, sizeof(*req), &sndc); if (ret != 0) { if_printf(sc->hn_ifp, "send nvs subch req failed: %d\n", ret); vmbus_xact_deactivate(xact); Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Aug 16 07:14:09 2016 (r304203) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Aug 16 07:26:53 2016 (r304204) @@ -30,6 +30,8 @@ #define _IF_HNVAR_H_ #include + +#include #include struct netvsc_dev_; @@ -61,6 +63,7 @@ static __inline void hn_send_ctx_init(struct hn_send_ctx *sndc, hn_sent_callback_t cb, void *cbarg, uint32_t chim_idx, int chim_sz) { + sndc->hn_cb = cb; sndc->hn_cbarg = cbarg; sndc->hn_chim_idx = chim_idx; @@ -71,10 +74,29 @@ static __inline void hn_send_ctx_init_simple(struct hn_send_ctx *sndc, hn_sent_callback_t cb, void *cbarg) { + hn_send_ctx_init(sndc, cb, cbarg, NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX, 0); } +static __inline int +hn_nvs_send(struct vmbus_channel *chan, uint16_t flags, + void *nvs_msg, int nvs_msglen, struct hn_send_ctx *sndc) +{ + + return (vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_INBAND, flags, + nvs_msg, nvs_msglen, (uint64_t)(uintptr_t)sndc)); +} + +static __inline int +hn_nvs_send_sglist(struct vmbus_channel *chan, struct vmbus_gpa sg[], int sglen, + void *nvs_msg, int nvs_msglen, struct hn_send_ctx *sndc) +{ + + return (vmbus_chan_send_sglist(chan, sg, sglen, nvs_msg, nvs_msglen, + (uint64_t)(uintptr_t)sndc)); +} + void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, const struct nvsp_msg_ *msg, int dlen); From owner-svn-src-head@freebsd.org Tue Aug 16 07:37:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CECFDBBBAF6; Tue, 16 Aug 2016 07:37:03 +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 AA386172C; Tue, 16 Aug 2016 07:37:03 +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 u7G7b2ZG069172; Tue, 16 Aug 2016 07:37:02 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G7b2vm069166; Tue, 16 Aug 2016 07:37:02 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608160737.u7G7b2vm069166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 16 Aug 2016 07:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304205 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 07:37:03 -0000 Author: sephe Date: Tue Aug 16 07:37:02 2016 New Revision: 304205 URL: https://svnweb.freebsd.org/changeset/base/304205 Log: hyperv/hn: Simplify RNDIS NVS message sending. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7501 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnreg.h head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 16 07:26:53 2016 (r304204) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 16 07:37:02 2016 (r304205) @@ -118,7 +118,7 @@ hv_nv_get_next_send_section(netvsc_dev * unsigned long bitsmap_words = net_dev->bitsmap_words; unsigned long *bitsmap = net_dev->send_section_bitsmap; unsigned long idx; - int ret = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; + int ret = HN_NVS_CHIM_IDX_INVALID; int i; for (i = 0; i < bitsmap_words; i++) { @@ -814,32 +814,23 @@ hv_nv_on_send_completion(netvsc_dev *net * Returns 0 on success, non-zero on failure. */ int -hv_nv_on_send(struct vmbus_channel *chan, bool is_data_pkt, +hv_nv_on_send(struct vmbus_channel *chan, uint32_t rndis_mtype, struct hn_send_ctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt) { - nvsp_msg send_msg; + struct hn_nvs_rndis rndis; int ret; - send_msg.hdr.msg_type = nvsp_msg_1_type_send_rndis_pkt; - if (is_data_pkt) { - /* 0 is RMC_DATA */ - send_msg.msgs.vers_1_msgs.send_rndis_pkt.chan_type = 0; - } else { - /* 1 is RMC_CONTROL */ - send_msg.msgs.vers_1_msgs.send_rndis_pkt.chan_type = 1; - } - - send_msg.msgs.vers_1_msgs.send_rndis_pkt.send_buf_section_idx = - sndc->hn_chim_idx; - send_msg.msgs.vers_1_msgs.send_rndis_pkt.send_buf_section_size = - sndc->hn_chim_sz; + rndis.nvs_type = HN_NVS_TYPE_RNDIS; + rndis.nvs_rndis_mtype = rndis_mtype; + rndis.nvs_chim_idx = sndc->hn_chim_idx; + rndis.nvs_chim_sz = sndc->hn_chim_sz; if (gpa_cnt) { ret = hn_nvs_send_sglist(chan, gpa, gpa_cnt, - &send_msg, sizeof(nvsp_msg), sndc); + &rndis, sizeof(rndis), sndc); } else { ret = hn_nvs_send(chan, VMBUS_CHANPKT_FLAG_RC, - &send_msg, sizeof(nvsp_msg), sndc); + &rndis, sizeof(rndis), sndc); } return (ret); Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Aug 16 07:26:53 2016 (r304204) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Aug 16 07:37:02 2016 (r304205) @@ -1256,7 +1256,7 @@ netvsc_dev *hv_nv_on_device_add(struct h void *additional_info, struct hn_rx_ring *rxr); int hv_nv_on_device_remove(struct hn_softc *sc, boolean_t destroy_channel); -int hv_nv_on_send(struct vmbus_channel *chan, bool is_data_pkt, +int hv_nv_on_send(struct vmbus_channel *chan, uint32_t rndis_mtype, struct hn_send_ctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt); int hv_nv_get_next_send_section(netvsc_dev *net_dev); void hv_nv_subchan_attach(struct vmbus_channel *chan, Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Aug 16 07:26:53 2016 (r304204) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Aug 16 07:37:02 2016 (r304205) @@ -798,7 +798,7 @@ hn_tx_done(struct hn_send_ctx *sndc, str struct hn_txdesc *txd = sndc->hn_cbarg; struct hn_tx_ring *txr; - if (sndc->hn_chim_idx != NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) + if (sndc->hn_chim_idx != HN_NVS_CHIM_IDX_INVALID) hn_chim_free(net_dev, sndc->hn_chim_idx); txr = txd->txr; @@ -988,8 +988,7 @@ hn_encap(struct hn_tx_ring *txr, struct txr->hn_tx_chimney_tried++; send_buf_section_idx = hv_nv_get_next_send_section(net_dev); - if (send_buf_section_idx != - NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) { + if (send_buf_section_idx != HN_NVS_CHIM_IDX_INVALID) { uint8_t *dest = ((uint8_t *)net_dev->send_buf + (send_buf_section_idx * net_dev->send_section_size)); @@ -1045,7 +1044,7 @@ hn_encap(struct hn_tx_ring *txr, struct gpa->gpa_len = segs[i].ds_len; } - send_buf_section_idx = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; + send_buf_section_idx = HN_NVS_CHIM_IDX_INVALID; send_buf_section_size = 0; done: txd->m = m_head; @@ -1072,8 +1071,8 @@ again: * Make sure that txd is not freed before ETHER_BPF_MTAP. */ hn_txdesc_hold(txd); - error = hv_nv_on_send(txr->hn_chan, true, &txd->send_ctx, - txr->hn_gpa, txr->hn_gpa_cnt); + error = hv_nv_on_send(txr->hn_chan, HN_NVS_RNDIS_MTYPE_DATA, + &txd->send_ctx, txr->hn_gpa, txr->hn_gpa_cnt); if (!error) { ETHER_BPF_MTAP(ifp, txd->m); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 16 07:26:53 2016 (r304204) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 16 07:37:02 2016 (r304205) @@ -277,8 +277,7 @@ hv_rf_send_request(rndis_device *device, if (tot_data_buf_len < net_dev->send_section_size) { send_buf_section_idx = hv_nv_get_next_send_section(net_dev); - if (send_buf_section_idx != - NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) { + if (send_buf_section_idx != HN_NVS_CHIM_IDX_INVALID) { char *dest = ((char *)net_dev->send_buf + send_buf_section_idx * net_dev->send_section_size); @@ -289,14 +288,14 @@ hv_rf_send_request(rndis_device *device, } /* Failed to allocate chimney send buffer; move on */ } - send_buf_section_idx = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; + send_buf_section_idx = HN_NVS_CHIM_IDX_INVALID; send_buf_section_size = 0; sendit: hn_send_ctx_init(&request->send_ctx, cb, request, send_buf_section_idx, send_buf_section_size); - return hv_nv_on_send(device->net_dev->sc->hn_prichan, false, - &request->send_ctx, gpa, gpa_cnt); + return hv_nv_on_send(device->net_dev->sc->hn_prichan, + HN_NVS_RNDIS_MTYPE_CTRL, &request->send_ctx, gpa, gpa_cnt); } /* @@ -1276,7 +1275,7 @@ hn_rndis_sent_cb(struct hn_send_ctx *snd struct vmbus_channel *chan __unused, const struct nvsp_msg_ *msg __unused, int dlen __unused) { - if (sndc->hn_chim_idx != NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) + if (sndc->hn_chim_idx != HN_NVS_CHIM_IDX_INVALID) hn_chim_free(net_dev, sndc->hn_chim_idx); } @@ -1287,7 +1286,7 @@ hn_rndis_sent_halt(struct hn_send_ctx *s { rndis_request *request = sndc->hn_cbarg; - if (sndc->hn_chim_idx != NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) + if (sndc->hn_chim_idx != HN_NVS_CHIM_IDX_INVALID) hn_chim_free(net_dev, sndc->hn_chim_idx); /* Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Tue Aug 16 07:26:53 2016 (r304204) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Tue Aug 16 07:37:02 2016 (r304205) @@ -35,8 +35,19 @@ #define HN_NVS_RXBUF_SIG 0xcafe #define HN_NVS_CHIM_SIG 0xface +#define HN_NVS_CHIM_IDX_INVALID 0xffffffff + +#define HN_NVS_RNDIS_MTYPE_DATA 0 +#define HN_NVS_RNDIS_MTYPE_CTRL 1 + +/* + * NVS message transacion status codes. + */ #define HN_NVS_STATUS_OK 1 +/* + * NVS request/response message types. + */ #define HN_NVS_TYPE_INIT 1 #define HN_NVS_TYPE_INIT_RESP 2 #define HN_NVS_TYPE_NDIS_INIT 100 @@ -46,6 +57,7 @@ #define HN_NVS_TYPE_CHIM_CONN 104 #define HN_NVS_TYPE_CHIM_CONNRESP 105 #define HN_NVS_TYPE_CHIM_DISCONN 106 +#define HN_NVS_TYPE_RNDIS 107 #define HN_NVS_TYPE_NDIS_CONF 125 #define HN_NVS_TYPE_SUBCH_REQ 133 #define HN_NVS_TYPE_SUBCH_RESP 133 /* same as SUBCH_REQ */ @@ -162,4 +174,21 @@ struct hn_nvs_subch_resp { uint32_t nvs_nsubch; } __packed; +struct hn_nvs_rndis { + uint32_t nvs_type; /* HN_NVS_TYPE_RNDIS */ + uint32_t nvs_rndis_mtype;/* HN_NVS_RNDIS_MTYPE_ */ + /* + * Chimney sending buffer index and size. + * + * NOTE: + * If nvs_chim_idx is set to HN_NVS_CHIM_IDX_INVALID + * and nvs_chim_sz is set to 0, then chimney sending + * buffer is _not_ used by this RNDIS message. + */ + uint32_t nvs_chim_idx; + uint32_t nvs_chim_sz; + uint8_t nvs_rsvd[16]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_rndis) >= HN_NVS_REQSIZE_MIN); + #endif /* !_IF_HNREG_H_ */ Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Aug 16 07:26:53 2016 (r304204) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Aug 16 07:37:02 2016 (r304205) @@ -32,7 +32,7 @@ #include #include -#include +#include struct netvsc_dev_; struct nvsp_msg_; @@ -51,12 +51,12 @@ struct hn_send_ctx { int hn_chim_sz; }; -#define HN_SEND_CTX_INITIALIZER(cb, cbarg) \ -{ \ - .hn_cb = cb, \ - .hn_cbarg = cbarg, \ - .hn_chim_idx = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX, \ - .hn_chim_sz = 0 \ +#define HN_SEND_CTX_INITIALIZER(cb, cbarg) \ +{ \ + .hn_cb = cb, \ + .hn_cbarg = cbarg, \ + .hn_chim_idx = HN_NVS_CHIM_IDX_INVALID, \ + .hn_chim_sz = 0 \ } static __inline void @@ -75,8 +75,7 @@ hn_send_ctx_init_simple(struct hn_send_c void *cbarg) { - hn_send_ctx_init(sndc, cb, cbarg, - NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX, 0); + hn_send_ctx_init(sndc, cb, cbarg, HN_NVS_CHIM_IDX_INVALID, 0); } static __inline int From owner-svn-src-head@freebsd.org Tue Aug 16 07:45:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1CE0BBBEDA; Tue, 16 Aug 2016 07:45:36 +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 598F31D60; Tue, 16 Aug 2016 07:45:36 +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 u7G7jZA9072851; Tue, 16 Aug 2016 07:45:35 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G7jZuC072849; Tue, 16 Aug 2016 07:45:35 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608160745.u7G7jZuC072849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 16 Aug 2016 07:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304206 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 07:45:36 -0000 Author: sephe Date: Tue Aug 16 07:45:35 2016 New Revision: 304206 URL: https://svnweb.freebsd.org/changeset/base/304206 Log: hyperv/hn: Simplify RNDIS message checks on RX path. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7502 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/if_hnreg.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 16 07:37:02 2016 (r304205) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 16 07:45:35 2016 (r304206) @@ -847,19 +847,18 @@ hv_nv_on_receive(netvsc_dev *net_dev, st struct vmbus_channel *chan, const struct vmbus_chanpkt_hdr *pkthdr) { const struct vmbus_chanpkt_rxbuf *pkt; - const nvsp_msg *nvsp_msg_pkt; + const struct hn_nvs_hdr *nvs_hdr; netvsc_packet vsc_pkt; netvsc_packet *net_vsc_pkt = &vsc_pkt; int count = 0; int i = 0; int status = nvsp_status_success; - nvsp_msg_pkt = VMBUS_CHANPKT_CONST_DATA(pkthdr); - - /* Make sure this is a valid nvsp packet */ - if (nvsp_msg_pkt->hdr.msg_type != nvsp_msg_1_type_send_rndis_pkt) { - if_printf(rxr->hn_ifp, "packet hdr type %u is invalid!\n", - nvsp_msg_pkt->hdr.msg_type); + /* Make sure that this is a RNDIS message. */ + nvs_hdr = VMBUS_CHANPKT_CONST_DATA(pkthdr); + if (__predict_false(nvs_hdr->nvs_type != HN_NVS_TYPE_RNDIS)) { + if_printf(rxr->hn_ifp, "nvs type %u, not RNDIS\n", + nvs_hdr->nvs_type); return; } Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Tue Aug 16 07:37:02 2016 (r304205) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Tue Aug 16 07:45:35 2016 (r304206) @@ -69,6 +69,11 @@ */ #define HN_NVS_REQSIZE_MIN 32 +/* NVS message common header */ +struct hn_nvs_hdr { + uint32_t nvs_type; +} __packed; + struct hn_nvs_init { uint32_t nvs_type; /* HN_NVS_TYPE_INIT */ uint32_t nvs_ver_min; From owner-svn-src-head@freebsd.org Tue Aug 16 07:51:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C396BBB01B; Tue, 16 Aug 2016 07:51:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D6FF10FC; Tue, 16 Aug 2016 07:51:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G7p5ns073085; Tue, 16 Aug 2016 07:51:05 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G7p5GB073084; Tue, 16 Aug 2016 07:51:05 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608160751.u7G7p5GB073084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 16 Aug 2016 07:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304207 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 07:51:06 -0000 Author: adrian Date: Tue Aug 16 07:51:05 2016 New Revision: 304207 URL: https://svnweb.freebsd.org/changeset/base/304207 Log: [mips] fix use-before-initialised. Found by: gcc-5.3 Modified: head/sys/mips/mips/cpu.c Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Tue Aug 16 07:45:35 2016 (r304206) +++ head/sys/mips/mips/cpu.c Tue Aug 16 07:51:05 2016 (r304207) @@ -164,6 +164,8 @@ mips_get_identity(struct mips_cpuinfo *c cfg1 = mips_rd_config1(); /* Get the Config2 and Config3 registers as well. */ + cfg2 = 0; + cfg3 = 0; if (cfg1 & MIPS_CONFIG1_M) { cfg2 = mips_rd_config2(); if (cfg2 & MIPS_CONFIG2_M) From owner-svn-src-head@freebsd.org Tue Aug 16 08:27:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33888BBBBA6; Tue, 16 Aug 2016 08:27: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 E9E171812; Tue, 16 Aug 2016 08:27:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G8R4dG088311; Tue, 16 Aug 2016 08:27:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G8R3re088305; Tue, 16 Aug 2016 08:27:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608160827.u7G8R3re088305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Aug 2016 08:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304209 - in head: lib/libc/include lib/libc/sys lib/libthr/thread share/man/man3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 08:27:05 -0000 Author: kib Date: Tue Aug 16 08:27:03 2016 New Revision: 304209 URL: https://svnweb.freebsd.org/changeset/base/304209 Log: The fdatasync(2) call must be cancellation point. Sponsored by: The FreeBSD Foundation MFC after: 13 days Added: head/lib/libc/sys/fdatasync.c (contents, props changed) Modified: head/lib/libc/include/libc_private.h head/lib/libc/sys/Makefile.inc head/lib/libc/sys/interposing_table.c head/lib/libthr/thread/thr_syscalls.c head/share/man/man3/pthread_testcancel.3 Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Tue Aug 16 08:16:54 2016 (r304208) +++ head/lib/libc/include/libc_private.h Tue Aug 16 08:27:03 2016 (r304209) @@ -228,6 +228,7 @@ enum { INTERPOS_wait6, INTERPOS_ppoll, INTERPOS_map_stacks_exec, + INTERPOS_fdatasync, INTERPOS_MAX }; @@ -318,6 +319,7 @@ int __sys_clock_gettime(__clockid_t, st int __sys_close(int); int __sys_connect(int, const struct sockaddr *, __socklen_t); int __sys_fcntl(int, int, ...); +int __sys_fdatasync(int); int __sys_fsync(int); __pid_t __sys_fork(void); int __sys_ftruncate(int, __off_t); Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Tue Aug 16 08:16:54 2016 (r304208) +++ head/lib/libc/sys/Makefile.inc Tue Aug 16 08:27:03 2016 (r304209) @@ -37,6 +37,7 @@ INTERPOSED = \ close \ connect \ fcntl \ + fdatasync \ fsync \ fork \ kevent \ Added: head/lib/libc/sys/fdatasync.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/fdatasync.c Tue Aug 16 08:27:03 2016 (r304209) @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016 The FreeBSD Foundation. + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice(s), this list of conditions and the following disclaimer as + * the first lines of this file unmodified other than the possible + * addition of one or more copyright notices. + * 2. Redistributions in binary form must reproduce the above copyright + * notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include "libc_private.h" + +int +fdatasync(int fd) +{ + + return (((int (*)(int))__libc_interposing[INTERPOS_fdatasync])(fd)); +} Modified: head/lib/libc/sys/interposing_table.c ============================================================================== --- head/lib/libc/sys/interposing_table.c Tue Aug 16 08:16:54 2016 (r304208) +++ head/lib/libc/sys/interposing_table.c Tue Aug 16 08:27:03 2016 (r304209) @@ -79,6 +79,7 @@ interpos_func_t __libc_interposing[INTER SLOT(wait6, __sys_wait6), SLOT(ppoll, __sys_ppoll), SLOT(map_stacks_exec, __libc_map_stacks_exec), + SLOT(fdatasync, __sys_fdatasync), }; #undef SLOT Modified: head/lib/libthr/thread/thr_syscalls.c ============================================================================== --- head/lib/libthr/thread/thr_syscalls.c Tue Aug 16 08:16:54 2016 (r304208) +++ head/lib/libthr/thread/thr_syscalls.c Tue Aug 16 08:27:03 2016 (r304209) @@ -227,6 +227,20 @@ __thr_fsync(int fd) return (ret); } +static int +__thr_fdatasync(int fd) +{ + struct pthread *curthread; + int ret; + + curthread = _get_curthread(); + _thr_cancel_enter2(curthread, 0); + ret = __sys_fdatasync(fd); + _thr_cancel_leave(curthread, 1); + + return (ret); +} + /* * Cancellation behavior: * Thread may be canceled after system call. @@ -653,6 +667,7 @@ __thr_interpose_libc(void) SLOT(wait6); SLOT(ppoll); SLOT(map_stacks_exec); + SLOT(fdatasync); #undef SLOT *(__libc_interposing_slot( INTERPOS__pthread_mutex_init_calloc_cb)) = Modified: head/share/man/man3/pthread_testcancel.3 ============================================================================== --- head/share/man/man3/pthread_testcancel.3 Tue Aug 16 08:16:54 2016 (r304208) +++ head/share/man/man3/pthread_testcancel.3 Tue Aug 16 08:27:03 2016 (r304209) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd April 16, 2015 +.Dd August 16, 2016 .Dt PTHREAD_TESTCANCEL 3 .Os .Sh NAME @@ -114,6 +114,7 @@ function is a cancellation point if .Fa cmd is .Dv F_SETLKW . +.It Fn fdatasync .It Fn fsync .It Fn kevent The From owner-svn-src-head@freebsd.org Tue Aug 16 10:30:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C881FBBC8B1; Tue, 16 Aug 2016 10:30:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id AF7BC12CE; Tue, 16 Aug 2016 10:30:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id A8225147B; Tue, 16 Aug 2016 10:30:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 464891A659; Tue, 16 Aug 2016 10:30:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 5Y0Yr1KytyYa; Tue, 16 Aug 2016 10:30:09 +0000 (UTC) Subject: Re: svn commit: r304011 - head/libexec/rtld-elf DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com A60101A651 To: Ngie Cooper , Konstantin Belousov References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Tue, 16 Aug 2016 11:30:03 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tOQ6TfqKtFFu5FG8N2MeohgvCKEl6Tn7s" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 10:30:12 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tOQ6TfqKtFFu5FG8N2MeohgvCKEl6Tn7s Content-Type: multipart/mixed; boundary="1tmoJ9oFT615DRfQwj82gUPDVcj9t81C4" From: Bryan Drewery To: Ngie Cooper , Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r304011 - head/libexec/rtld-elf References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> In-Reply-To: <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> --1tmoJ9oFT615DRfQwj82gUPDVcj9t81C4 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 8/12/16 7:34 PM, Ngie Cooper wrote: >=20 >> On Aug 12, 2016, at 11:29, Konstantin Belousov wrote= : >> >> Author: kib >> Date: Fri Aug 12 18:29:11 2016 >> New Revision: 304011 >> URL: https://svnweb.freebsd.org/changeset/base/304011 >> >> Log: >> Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf. >=20 > Why? >=20 It's a somewhat error-prone and dangerous macro. See r302908. --=20 Regards, Bryan Drewery --1tmoJ9oFT615DRfQwj82gUPDVcj9t81C4-- --tOQ6TfqKtFFu5FG8N2MeohgvCKEl6Tn7s Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXsusrAAoJEDXXcbtuRpfPhqsIAOEMaM5PyHc/+6edkrGvsMWt MBxDEkU9gzaH93sfpulmbnc818WnwmteVGxlBzkeHXR7O1nS/YT/a8W1m/3WUKUg nqYJbf8r6qaGPq2aYslS1Y/uAA7iq43thxtkMDQ/hDRzxXUAgTDWTN8p21jaSXi9 6rRedwIEhKxJntTMSxE5D1F/92P1mODF+hGnc1yi/HX2tlLwKtNsEGvdJouX44Ht QBDioOEZcQt1a3LV2ScpXgEIi7hWR9OwEE6nADOvS6LKEQ3zFuol3mbGKsvQ9n5D JCzkRYRH0vGSqu1raXEXlvxnnmPpns6AoHPXTEIXCBzx6m4pde5euyX+osLWsVE= =9Oyc -----END PGP SIGNATURE----- --tOQ6TfqKtFFu5FG8N2MeohgvCKEl6Tn7s-- From owner-svn-src-head@freebsd.org Tue Aug 16 11:38:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0240BBC61F; Tue, 16 Aug 2016 11:38:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8268D1391; Tue, 16 Aug 2016 11:38:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GBcjxm059774; Tue, 16 Aug 2016 11:38:45 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GBcjAQ059773; Tue, 16 Aug 2016 11:38:45 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201608161138.u7GBcjAQ059773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 16 Aug 2016 11:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304216 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 11:38:46 -0000 Author: brooks Date: Tue Aug 16 11:38:45 2016 New Revision: 304216 URL: https://svnweb.freebsd.org/changeset/base/304216 Log: Don't conflate enum nss_status return values values with int (NS_SUCCESS, NS_RETURN) values. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D6046 Modified: head/lib/libc/net/nss_compat.c Modified: head/lib/libc/net/nss_compat.c ============================================================================== --- head/lib/libc/net/nss_compat.c Tue Aug 16 09:12:45 2016 (r304215) +++ head/lib/libc/net/nss_compat.c Tue Aug 16 11:38:45 2016 (r304216) @@ -97,9 +97,9 @@ __nss_compat_getgrnam_r(void *retval, vo const char *name; struct group *grp; char *buffer; - int *errnop; + int *errnop, ns_status; size_t bufsize; - enum nss_status status; + enum nss_status nss_status; fn = mdata; name = va_arg(ap, const char *); @@ -107,11 +107,11 @@ __nss_compat_getgrnam_r(void *retval, vo buffer = va_arg(ap, char *); bufsize = va_arg(ap, size_t); errnop = va_arg(ap, int *); - status = fn(name, grp, buffer, bufsize, errnop); - status = __nss_compat_result(status, *errnop); - if (status == NS_SUCCESS) + nss_status = fn(name, grp, buffer, bufsize, errnop); + ns_status = __nss_compat_result(nss_status, *errnop); + if (ns_status == NS_SUCCESS) *(struct group **)retval = grp; - return (status); + return (ns_status); } @@ -122,9 +122,9 @@ __nss_compat_getgrgid_r(void *retval, vo gid_t gid; struct group *grp; char *buffer; - int *errnop; + int *errnop, ns_status; size_t bufsize; - enum nss_status status; + enum nss_status nss_status; fn = mdata; gid = va_arg(ap, gid_t); @@ -132,11 +132,11 @@ __nss_compat_getgrgid_r(void *retval, vo buffer = va_arg(ap, char *); bufsize = va_arg(ap, size_t); errnop = va_arg(ap, int *); - status = fn(gid, grp, buffer, bufsize, errnop); - status = __nss_compat_result(status, *errnop); - if (status == NS_SUCCESS) + nss_status = fn(gid, grp, buffer, bufsize, errnop); + ns_status = __nss_compat_result(nss_status, *errnop); + if (ns_status == NS_SUCCESS) *(struct group **)retval = grp; - return (status); + return (ns_status); } @@ -146,9 +146,9 @@ __nss_compat_getgrent_r(void *retval, vo int (*fn)(struct group *, char *, size_t, int *); struct group *grp; char *buffer; - int *errnop; + int *errnop, ns_status; size_t bufsize; - enum nss_status status; + enum nss_status nss_status; if (CHECK_TERMINATOR(group)) return (NS_NOTFOUND); @@ -157,13 +157,13 @@ __nss_compat_getgrent_r(void *retval, vo buffer = va_arg(ap, char *); bufsize = va_arg(ap, size_t); errnop = va_arg(ap, int *); - status = fn(grp, buffer, bufsize, errnop); - status = __nss_compat_result(status, *errnop); - if (status == NS_SUCCESS) + nss_status = fn(grp, buffer, bufsize, errnop); + ns_status = __nss_compat_result(nss_status, *errnop); + if (ns_status == NS_SUCCESS) *(struct group **)retval = grp; - else if (status != NS_RETURN) + else if (ns_status != NS_RETURN) SET_TERMINATOR(group, &terminator); - return (status); + return (ns_status); } @@ -198,9 +198,9 @@ __nss_compat_getpwnam_r(void *retval, vo const char *name; struct passwd *pwd; char *buffer; - int *errnop; + int *errnop, ns_status; size_t bufsize; - enum nss_status status; + enum nss_status nss_status; fn = mdata; name = va_arg(ap, const char *); @@ -208,11 +208,11 @@ __nss_compat_getpwnam_r(void *retval, vo buffer = va_arg(ap, char *); bufsize = va_arg(ap, size_t); errnop = va_arg(ap, int *); - status = fn(name, pwd, buffer, bufsize, errnop); - status = __nss_compat_result(status, *errnop); - if (status == NS_SUCCESS) + nss_status = fn(name, pwd, buffer, bufsize, errnop); + ns_status = __nss_compat_result(nss_status, *errnop); + if (ns_status == NS_SUCCESS) *(struct passwd **)retval = pwd; - return (status); + return (ns_status); } @@ -223,9 +223,9 @@ __nss_compat_getpwuid_r(void *retval, vo uid_t uid; struct passwd *pwd; char *buffer; - int *errnop; + int *errnop, ns_status; size_t bufsize; - enum nss_status status; + enum nss_status nss_status; fn = mdata; uid = va_arg(ap, uid_t); @@ -233,11 +233,11 @@ __nss_compat_getpwuid_r(void *retval, vo buffer = va_arg(ap, char *); bufsize = va_arg(ap, size_t); errnop = va_arg(ap, int *); - status = fn(uid, pwd, buffer, bufsize, errnop); - status = __nss_compat_result(status, *errnop); - if (status == NS_SUCCESS) + nss_status = fn(uid, pwd, buffer, bufsize, errnop); + ns_status = __nss_compat_result(nss_status, *errnop); + if (ns_status == NS_SUCCESS) *(struct passwd **)retval = pwd; - return (status); + return (ns_status); } @@ -247,9 +247,9 @@ __nss_compat_getpwent_r(void *retval, vo int (*fn)(struct passwd *, char *, size_t, int *); struct passwd *pwd; char *buffer; - int *errnop; + int *errnop, ns_status; size_t bufsize; - enum nss_status status; + enum nss_status nss_status; if (CHECK_TERMINATOR(passwd)) return (NS_NOTFOUND); @@ -258,13 +258,13 @@ __nss_compat_getpwent_r(void *retval, vo buffer = va_arg(ap, char *); bufsize = va_arg(ap, size_t); errnop = va_arg(ap, int *); - status = fn(pwd, buffer, bufsize, errnop); - status = __nss_compat_result(status, *errnop); - if (status == NS_SUCCESS) + nss_status = fn(pwd, buffer, bufsize, errnop); + ns_status = __nss_compat_result(nss_status, *errnop); + if (ns_status == NS_SUCCESS) *(struct passwd **)retval = pwd; - else if (status != NS_RETURN) + else if (ns_status != NS_RETURN) SET_TERMINATOR(passwd, &terminator); - return (status); + return (ns_status); } From owner-svn-src-head@freebsd.org Tue Aug 16 12:13:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45A8BBBB6B8; Tue, 16 Aug 2016 12:13:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15F461BA8; Tue, 16 Aug 2016 12:13:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GCDCfS074156; Tue, 16 Aug 2016 12:13:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GCDCXJ074155; Tue, 16 Aug 2016 12:13:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608161213.u7GCDCXJ074155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Aug 2016 12:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304217 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 12:13:13 -0000 Author: bdrewery Date: Tue Aug 16 12:13:12 2016 New Revision: 304217 URL: https://svnweb.freebsd.org/changeset/base/304217 Log: Trim unneeded bootstrap after r301470 made 9.1 the minimum supported release. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Aug 16 11:38:45 2016 (r304216) +++ head/Makefile.inc1 Tue Aug 16 12:13:12 2016 (r304217) @@ -1581,10 +1581,6 @@ _groff= gnu/usr.bin/groff \ _vtfontcvt= usr.bin/vtfontcvt .endif -.if ${BOOTSTRAPPING} < 900002 -_sed= usr.bin/sed -.endif - .if ${BOOTSTRAPPING} < 1000033 _libopenbsd= lib/libopenbsd _m4= usr.bin/m4 @@ -1623,10 +1619,6 @@ _crunchide= usr.sbin/crunch/crunchide _crunchgen= usr.sbin/crunch/crunchgen .endif -.if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 -_awk= usr.bin/awk -.endif - # r296926 -P keymap search path, MFC to stable/10 in r298297 .if ${BOOTSTRAPPING} < 1003501 || \ (${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103) @@ -1694,7 +1686,6 @@ bootstrap-tools: .PHONY ${_gperf} \ ${_groff} \ ${_dtc} \ - ${_awk} \ ${_cat} \ ${_dd} \ ${_kbdcontrol} \ @@ -1702,7 +1693,6 @@ bootstrap-tools: .PHONY ${_libopenbsd} \ ${_makewhatis} \ usr.bin/rpcgen \ - ${_sed} \ ${_yacc} \ ${_m4} \ ${_lex} \ From owner-svn-src-head@freebsd.org Tue Aug 16 12:40:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B48DBBB0B5; Tue, 16 Aug 2016 12:40:58 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B5491B1D; Tue, 16 Aug 2016 12:40:58 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GCevX2082120; Tue, 16 Aug 2016 12:40:57 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GCeuWS082118; Tue, 16 Aug 2016 12:40:56 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201608161240.u7GCeuWS082118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 16 Aug 2016 12:40:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304218 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 12:40:58 -0000 Author: rrs Date: Tue Aug 16 12:40:56 2016 New Revision: 304218 URL: https://svnweb.freebsd.org/changeset/base/304218 Log: This cleans up the timer code in TCP and also makes it so we do not take the INFO lock *unless* we are really going to delete the TCB. Differential Revision: D7136 Modified: head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Tue Aug 16 12:13:12 2016 (r304217) +++ head/sys/netinet/tcp_timer.c Tue Aug 16 12:40:56 2016 (r304218) @@ -294,11 +294,6 @@ tcp_timer_delack(void *xtp) CURVNET_RESTORE(); return; } - KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, - ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); - KASSERT((tp->t_timers->tt_flags & TT_DELACK) != 0, - ("%s: tp %p delack callout should be running", __func__, tp)); - tp->t_flags |= TF_ACKNOW; TCPSTAT_INC(tcps_delack); (void) tp->t_fb->tfb_tcp_output(tp); @@ -306,6 +301,39 @@ tcp_timer_delack(void *xtp) CURVNET_RESTORE(); } +int +tcp_inpinfo_lock_add(struct inpcb *inp) +{ + in_pcbref(inp); + INP_WUNLOCK(inp); + INP_INFO_RLOCK(&V_tcbinfo); + INP_WLOCK(inp); + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { + return(1); + } + return(0); + +} + +void +tcp_inpinfo_lock_del(struct inpcb *inp, struct tcpcb *tp) +{ + INP_INFO_RUNLOCK(&V_tcbinfo); + if (inp && (tp == NULL)) { + /* + * If tcp_close/drop() gets called and tp + * returns NULL, then the function dropped + * the inp lock, we hold a reference keeping + * this around, so we must re-aquire the + * INP_WLOCK() in order to proceed with + * our dropping the inp reference. + */ + INP_WLOCK(inp); + } + if (inp && in_pcbrele_wlocked(inp) == 0) + INP_WUNLOCK(inp); +} + void tcp_timer_2msl(void *xtp) { @@ -317,7 +345,6 @@ tcp_timer_2msl(void *xtp) ostate = tp->t_state; #endif - INP_INFO_RLOCK(&V_tcbinfo); inp = tp->t_inpcb; KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", __func__, tp)); INP_WLOCK(inp); @@ -325,21 +352,17 @@ tcp_timer_2msl(void *xtp) if (callout_pending(&tp->t_timers->tt_2msl) || !callout_active(&tp->t_timers->tt_2msl)) { INP_WUNLOCK(tp->t_inpcb); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_2msl); if ((inp->inp_flags & INP_DROPPED) != 0) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); - KASSERT((tp->t_timers->tt_flags & TT_2MSL) != 0, - ("%s: tp %p 2msl callout should be running", __func__, tp)); /* * 2 MSL timeout in shutdown went off. If we're closed but * still waiting for peer to close and connection has been idle @@ -355,7 +378,6 @@ tcp_timer_2msl(void *xtp) */ if ((inp->inp_flags & INP_TIMEWAIT) != 0) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } @@ -363,15 +385,26 @@ tcp_timer_2msl(void *xtp) tp->t_inpcb && tp->t_inpcb->inp_socket && (tp->t_inpcb->inp_socket->so_rcv.sb_state & SBS_CANTRCVMORE)) { TCPSTAT_INC(tcps_finwait2_drops); + if (tcp_inpinfo_lock_add(inp)) { + tcp_inpinfo_lock_del(inp, tp); + goto out; + } tp = tcp_close(tp); + tcp_inpinfo_lock_del(inp, tp); + goto out; } else { if (ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) { - if (!callout_reset(&tp->t_timers->tt_2msl, - TP_KEEPINTVL(tp), tcp_timer_2msl, tp)) { - tp->t_timers->tt_flags &= ~TT_2MSL_RST; + callout_reset(&tp->t_timers->tt_2msl, + TP_KEEPINTVL(tp), tcp_timer_2msl, tp); + } else { + if (tcp_inpinfo_lock_add(inp)) { + tcp_inpinfo_lock_del(inp, tp); + goto out; } - } else - tp = tcp_close(tp); + tp = tcp_close(tp); + tcp_inpinfo_lock_del(inp, tp); + goto out; + } } #ifdef TCPDEBUG @@ -383,7 +416,7 @@ tcp_timer_2msl(void *xtp) if (tp != NULL) INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); +out: CURVNET_RESTORE(); } @@ -399,28 +432,23 @@ tcp_timer_keep(void *xtp) ostate = tp->t_state; #endif - INP_INFO_RLOCK(&V_tcbinfo); inp = tp->t_inpcb; KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", __func__, tp)); INP_WLOCK(inp); if (callout_pending(&tp->t_timers->tt_keep) || !callout_active(&tp->t_timers->tt_keep)) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_keep); if ((inp->inp_flags & INP_DROPPED) != 0) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); - KASSERT((tp->t_timers->tt_flags & TT_KEEP) != 0, - ("%s: tp %p keep callout should be running", __func__, tp)); /* * Keep-alive timer went off; send something * or drop connection if idle for too long. @@ -452,14 +480,11 @@ tcp_timer_keep(void *xtp) tp->rcv_nxt, tp->snd_una - 1, 0); free(t_template, M_TEMP); } - if (!callout_reset(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp), - tcp_timer_keep, tp)) { - tp->t_timers->tt_flags &= ~TT_KEEP_RST; - } - } else if (!callout_reset(&tp->t_timers->tt_keep, TP_KEEPIDLE(tp), - tcp_timer_keep, tp)) { - tp->t_timers->tt_flags &= ~TT_KEEP_RST; - } + callout_reset(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp), + tcp_timer_keep, tp); + } else + callout_reset(&tp->t_timers->tt_keep, TP_KEEPIDLE(tp), + tcp_timer_keep, tp); #ifdef TCPDEBUG if (inp->inp_socket->so_options & SO_DEBUG) @@ -468,12 +493,16 @@ tcp_timer_keep(void *xtp) #endif TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; dropit: TCPSTAT_INC(tcps_keepdrops); + + if (tcp_inpinfo_lock_add(inp)) { + tcp_inpinfo_lock_del(inp, tp); + goto out; + } tp = tcp_drop(tp, ETIMEDOUT); #ifdef TCPDEBUG @@ -482,9 +511,8 @@ dropit: PRU_SLOWTIMO); #endif TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); - if (tp != NULL) - INP_WUNLOCK(tp->t_inpcb); - INP_INFO_RUNLOCK(&V_tcbinfo); + tcp_inpinfo_lock_del(inp, tp); +out: CURVNET_RESTORE(); } @@ -499,28 +527,23 @@ tcp_timer_persist(void *xtp) ostate = tp->t_state; #endif - INP_INFO_RLOCK(&V_tcbinfo); inp = tp->t_inpcb; KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", __func__, tp)); INP_WLOCK(inp); if (callout_pending(&tp->t_timers->tt_persist) || !callout_active(&tp->t_timers->tt_persist)) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_persist); if ((inp->inp_flags & INP_DROPPED) != 0) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); - KASSERT((tp->t_timers->tt_flags & TT_PERSIST) != 0, - ("%s: tp %p persist callout should be running", __func__, tp)); /* * Persistence timer into zero window. * Force a byte to be output, if possible. @@ -537,7 +560,12 @@ tcp_timer_persist(void *xtp) (ticks - tp->t_rcvtime >= tcp_maxpersistidle || ticks - tp->t_rcvtime >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { TCPSTAT_INC(tcps_persistdrop); + if (tcp_inpinfo_lock_add(inp)) { + tcp_inpinfo_lock_del(inp, tp); + goto out; + } tp = tcp_drop(tp, ETIMEDOUT); + tcp_inpinfo_lock_del(inp, tp); goto out; } /* @@ -547,7 +575,12 @@ tcp_timer_persist(void *xtp) if (tp->t_state > TCPS_CLOSE_WAIT && (ticks - tp->t_rcvtime) >= TCPTV_PERSMAX) { TCPSTAT_INC(tcps_persistdrop); + if (tcp_inpinfo_lock_add(inp)) { + tcp_inpinfo_lock_del(inp, tp); + goto out; + } tp = tcp_drop(tp, ETIMEDOUT); + tcp_inpinfo_lock_del(inp, tp); goto out; } tcp_setpersist(tp); @@ -555,15 +588,13 @@ tcp_timer_persist(void *xtp) (void) tp->t_fb->tfb_tcp_output(tp); tp->t_flags &= ~TF_FORCEDATA; -out: #ifdef TCPDEBUG if (tp != NULL && tp->t_inpcb->inp_socket->so_options & SO_DEBUG) tcp_trace(TA_USER, ostate, tp, NULL, NULL, PRU_SLOWTIMO); #endif TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); - if (tp != NULL) - INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_WUNLOCK(inp); +out: CURVNET_RESTORE(); } @@ -573,36 +604,29 @@ tcp_timer_rexmt(void * xtp) struct tcpcb *tp = xtp; CURVNET_SET(tp->t_vnet); int rexmt; - int headlocked; struct inpcb *inp; #ifdef TCPDEBUG int ostate; ostate = tp->t_state; #endif - - INP_INFO_RLOCK(&V_tcbinfo); inp = tp->t_inpcb; KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", __func__, tp)); INP_WLOCK(inp); if (callout_pending(&tp->t_timers->tt_rexmt) || !callout_active(&tp->t_timers->tt_rexmt)) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_rexmt); if ((inp->inp_flags & INP_DROPPED) != 0) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); - KASSERT((tp->t_timers->tt_flags & TT_REXMT) != 0, - ("%s: tp %p rexmt callout should be running", __func__, tp)); tcp_free_sackholes(tp); if (tp->t_fb->tfb_tcp_rexmit_tmr) { /* The stack has a timer action too. */ @@ -616,14 +640,15 @@ tcp_timer_rexmt(void * xtp) if (++tp->t_rxtshift > TCP_MAXRXTSHIFT) { tp->t_rxtshift = TCP_MAXRXTSHIFT; TCPSTAT_INC(tcps_timeoutdrop); - + if (tcp_inpinfo_lock_add(inp)) { + tcp_inpinfo_lock_del(inp, tp); + goto out; + } tp = tcp_drop(tp, tp->t_softerror ? tp->t_softerror : ETIMEDOUT); - headlocked = 1; + tcp_inpinfo_lock_del(inp, tp); goto out; } - INP_INFO_RUNLOCK(&V_tcbinfo); - headlocked = 0; if (tp->t_state == TCPS_SYN_SENT) { /* * If the SYN was retransmitted, indicate CWND to be @@ -811,17 +836,14 @@ tcp_timer_rexmt(void * xtp) (void) tp->t_fb->tfb_tcp_output(tp); -out: #ifdef TCPDEBUG if (tp != NULL && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) tcp_trace(TA_USER, ostate, tp, (void *)0, (struct tcphdr *)0, PRU_SLOWTIMO); #endif TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); - if (tp != NULL) - INP_WUNLOCK(inp); - if (headlocked) - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_WUNLOCK(inp); +out: CURVNET_RESTORE(); } @@ -832,7 +854,6 @@ tcp_timer_activate(struct tcpcb *tp, uin timeout_t *f_callout; struct inpcb *inp = tp->t_inpcb; int cpu = inp_to_cpuid(inp); - uint32_t f_reset; #ifdef TCP_OFFLOAD if (tp->t_flags & TF_TOE) @@ -846,27 +867,22 @@ tcp_timer_activate(struct tcpcb *tp, uin case TT_DELACK: t_callout = &tp->t_timers->tt_delack; f_callout = tcp_timer_delack; - f_reset = TT_DELACK_RST; break; case TT_REXMT: t_callout = &tp->t_timers->tt_rexmt; f_callout = tcp_timer_rexmt; - f_reset = TT_REXMT_RST; break; case TT_PERSIST: t_callout = &tp->t_timers->tt_persist; f_callout = tcp_timer_persist; - f_reset = TT_PERSIST_RST; break; case TT_KEEP: t_callout = &tp->t_timers->tt_keep; f_callout = tcp_timer_keep; - f_reset = TT_KEEP_RST; break; case TT_2MSL: t_callout = &tp->t_timers->tt_2msl; f_callout = tcp_timer_2msl; - f_reset = TT_2MSL_RST; break; default: if (tp->t_fb->tfb_tcp_timer_activate) { @@ -876,24 +892,9 @@ tcp_timer_activate(struct tcpcb *tp, uin panic("tp %p bad timer_type %#x", tp, timer_type); } if (delta == 0) { - if ((tp->t_timers->tt_flags & timer_type) && - (callout_stop(t_callout) > 0) && - (tp->t_timers->tt_flags & f_reset)) { - tp->t_timers->tt_flags &= ~(timer_type | f_reset); - } + callout_stop(t_callout); } else { - if ((tp->t_timers->tt_flags & timer_type) == 0) { - tp->t_timers->tt_flags |= (timer_type | f_reset); - callout_reset_on(t_callout, delta, f_callout, tp, cpu); - } else { - /* Reset already running callout on the same CPU. */ - if (!callout_reset(t_callout, delta, f_callout, tp)) { - /* - * Callout not cancelled, consider it as not - * properly restarted. */ - tp->t_timers->tt_flags &= ~f_reset; - } - } + callout_reset_on(t_callout, delta, f_callout, tp, cpu); } } @@ -931,30 +932,23 @@ void tcp_timer_stop(struct tcpcb *tp, uint32_t timer_type) { struct callout *t_callout; - uint32_t f_reset; tp->t_timers->tt_flags |= TT_STOPPED; - switch (timer_type) { case TT_DELACK: t_callout = &tp->t_timers->tt_delack; - f_reset = TT_DELACK_RST; break; case TT_REXMT: t_callout = &tp->t_timers->tt_rexmt; - f_reset = TT_REXMT_RST; break; case TT_PERSIST: t_callout = &tp->t_timers->tt_persist; - f_reset = TT_PERSIST_RST; break; case TT_KEEP: t_callout = &tp->t_timers->tt_keep; - f_reset = TT_KEEP_RST; break; case TT_2MSL: t_callout = &tp->t_timers->tt_2msl; - f_reset = TT_2MSL_RST; break; default: if (tp->t_fb->tfb_tcp_timer_stop) { @@ -968,15 +962,13 @@ tcp_timer_stop(struct tcpcb *tp, uint32_ panic("tp %p bad timer_type %#x", tp, timer_type); } - if (tp->t_timers->tt_flags & timer_type) { - if (callout_async_drain(t_callout, tcp_timer_discard) == 0) { - /* - * Can't stop the callout, defer tcpcb actual deletion - * to the last one. We do this using the async drain - * function and incrementing the count in - */ - tp->t_timers->tt_draincnt++; - } + if (callout_async_drain(t_callout, tcp_timer_discard) == 0) { + /* + * Can't stop the callout, defer tcpcb actual deletion + * to the last one. We do this using the async drain + * function and incrementing the count in + */ + tp->t_timers->tt_draincnt++; } } Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Tue Aug 16 12:13:12 2016 (r304217) +++ head/sys/netinet/tcp_timer.h Tue Aug 16 12:40:56 2016 (r304218) @@ -191,6 +191,9 @@ extern int tcp_syn_backoff[]; extern int tcp_finwait2_timeout; extern int tcp_fast_finwait2_recycle; +int tcp_inpinfo_lock_add(struct inpcb *inp); +void tcp_inpinfo_lock_del(struct inpcb *inp, struct tcpcb *tp); + void tcp_timer_init(void); void tcp_timer_2msl(void *xtp); void tcp_timer_discard(void *); From owner-svn-src-head@freebsd.org Tue Aug 16 12:54:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C64C8BBB951; Tue, 16 Aug 2016 12:54:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 916581A4C; Tue, 16 Aug 2016 12:54:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.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 83A781FE022; Tue, 16 Aug 2016 14:54:16 +0200 (CEST) Subject: Re: svn commit: r304218 - head/sys/netinet To: Randall Stewart , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608161240.u7GCeuWS082118@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <92a3cfc1-56bc-813f-dd12-ac19c66fd716@selasky.org> Date: Tue, 16 Aug 2016 14:58:45 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201608161240.u7GCeuWS082118@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 12:54:18 -0000 On 08/16/16 14:40, Randall Stewart wrote: > +int > +tcp_inpinfo_lock_add(struct inpcb *inp) > +{ > + in_pcbref(inp); > + INP_WUNLOCK(inp); > + INP_INFO_RLOCK(&V_tcbinfo); > + INP_WLOCK(inp); > + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { > + return(1); > + } > + return(0); > + > +} Hi, Could you add some comments describing how it is considered safe to drop the INP write-lock and then pick it up again? My first impression is that because you are dropping the inp lock, multiple threads can enter the code in question, leaving the window open to races? --HPS From owner-svn-src-head@freebsd.org Tue Aug 16 13:01:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64422BBBCED for ; Tue, 16 Aug 2016 13:01:59 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pf0-x230.google.com (mail-pf0-x230.google.com [IPv6:2607:f8b0:400e:c00::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 3657612D1 for ; Tue, 16 Aug 2016 13:01:59 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-pf0-x230.google.com with SMTP id h186so27565323pfg.3 for ; Tue, 16 Aug 2016 06:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=xAHEblL8eUsmHnnowv72BymcS7UGih1pp+NaTqJkMH0=; b=Cxp/KMkH5KAgt2Wi1KZCi/rQmjDvXuRfuhT9W22UBCqUZmAptACD5nL8y1kdsdiCs/ dkLSavJrPB9toMOT4dXhgOQ13mtBDlODylKbayXBRGnTr8vFxn2IPGkGxL/7xyXv+LgO z12fe+aOfJHg10TOnb8QTjv+fUiWZ+weSIoF8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=xAHEblL8eUsmHnnowv72BymcS7UGih1pp+NaTqJkMH0=; b=DMH7YQtcjgrO3GbXvvxb9MPJfBxQIKVTc4ngVi/W4iUEYT9vBV3wcEkRRxP+tmJ3JT Lngb6IMWR87Fv9vdBVzxIvfpm5Q/Bu+6LFQtSjxnUFZ3ziSAwduK9GTyq44fnSNU6uqd h4RKTJeNwdZ8uQMzSn34L1n6+8Eb0uy0neD6FmXymw7DQXjmdtOJhdAnkhOvV5rz5W94 6RVHryTvA39J/TReqw6C3fopCLZMicWh8hvg7Hjbt28GGAO3AmtwRkaQ2wcpwI+YJW8i wObh6RCKUlMFjo6jQkdH3/fuEhcTIo5wSNT9MhrwzNYe73XBYaqFfCUEPrlLHlUZPrwh PJcw== X-Gm-Message-State: AEkoousnWamvsqKjzB3Coz3EEnxsDUHeKPi/Kmg4lhNdh8WVxUmURum6cIqNKiBvgizIsOZk X-Received: by 10.98.35.145 with SMTP id q17mr64087317pfj.42.1471352518665; Tue, 16 Aug 2016 06:01:58 -0700 (PDT) Received: from [100.127.65.50] ([69.53.245.200]) by smtp.gmail.com with ESMTPSA id g13sm39322491pfb.7.2016.08.16.06.01.57 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Aug 2016 06:01:58 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304218 - head/sys/netinet From: Randall Stewart In-Reply-To: <92a3cfc1-56bc-813f-dd12-ac19c66fd716@selasky.org> Date: Tue, 16 Aug 2016 06:01:57 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <272AD783-2988-4EE7-89A5-EC6FA1313122@netflix.com> References: <201608161240.u7GCeuWS082118@repo.freebsd.org> <92a3cfc1-56bc-813f-dd12-ac19c66fd716@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 13:01:59 -0000 Sure Let me add some comments for you. The idea her is that you pick-up a = reference to the PCB.. so it can=E2=80=99t be removed. Thus when you re-lock the = INP you check the dropped flag (just in case someone did get in). Let me get that in comments.. (note thats also why when using this = function you have to use its companion function to drop the reference). > On Aug 16, 2016, at 5:58 AM, Hans Petter Selasky = wrote: >=20 > On 08/16/16 14:40, Randall Stewart wrote: >> +int >> +tcp_inpinfo_lock_add(struct inpcb *inp) >> +{ >> + in_pcbref(inp); >> + INP_WUNLOCK(inp); >> + INP_INFO_RLOCK(&V_tcbinfo); >> + INP_WLOCK(inp); >> + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { >> + return(1); >> + } >> + return(0); >> + >> +} >=20 > Hi, >=20 > Could you add some comments describing how it is considered safe to = drop the INP write-lock and then pick it up again? >=20 > My first impression is that because you are dropping the inp lock, = multiple threads can enter the code in question, leaving the window open = to races? >=20 > --HPS -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-head@freebsd.org Tue Aug 16 13:08:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 056F2BBBDF8; Tue, 16 Aug 2016 13:08:05 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC42615F6; Tue, 16 Aug 2016 13:08:04 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GD833v093051; Tue, 16 Aug 2016 13:08:03 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GD83Nx093050; Tue, 16 Aug 2016 13:08:03 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201608161308.u7GD83Nx093050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 16 Aug 2016 13:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304219 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 13:08:05 -0000 Author: rrs Date: Tue Aug 16 13:08:03 2016 New Revision: 304219 URL: https://svnweb.freebsd.org/changeset/base/304219 Log: Comments describing how to properly use the new lock_add functions and its respective companion. Sponsored by: Netflix Inc. Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Tue Aug 16 12:40:56 2016 (r304218) +++ head/sys/netinet/tcp_timer.c Tue Aug 16 13:08:03 2016 (r304219) @@ -301,6 +301,25 @@ tcp_timer_delack(void *xtp) CURVNET_RESTORE(); } +/* + * When a timer wants to remove a TCB it must + * hold the INP_INFO_RLOCK(). The timer function + * should only have grabbed the INP_WLOCK() when + * it entered. To safely switch to holding both the + * INP_INFO_RLOCK() and the INP_WLOCK() we must first + * grab a reference on the inp, this will hold the inp + * so that it can't be removed. We then unlock and grab + * the info-read lock. Once we have the INP_INFO_RLOCK() we + * proceed again to get the INP_WLOCK() but after that + * we must check if someone else deleted the pcb i.e. + * the inp_flags check. If so we return 1 otherwise + * we return 0. + * + * No matter which the tcp_inpinfo_lock_add() function + * returns the caller must afterwards call tcp_inpinfo_lock_del() + * to drop the locks and reference properly. + */ + int tcp_inpinfo_lock_add(struct inpcb *inp) { From owner-svn-src-head@freebsd.org Tue Aug 16 13:09:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B70FCBBBE8B; Tue, 16 Aug 2016 13:09:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82B491771; Tue, 16 Aug 2016 13:09:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.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 E55D51FE022; Tue, 16 Aug 2016 15:09:40 +0200 (CEST) Subject: Re: svn commit: r304218 - head/sys/netinet To: Randall Stewart References: <201608161240.u7GCeuWS082118@repo.freebsd.org> <92a3cfc1-56bc-813f-dd12-ac19c66fd716@selasky.org> <272AD783-2988-4EE7-89A5-EC6FA1313122@netflix.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <61c62080-1529-a717-fbfc-4f4baed56c3e@selasky.org> Date: Tue, 16 Aug 2016 15:14:09 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <272AD783-2988-4EE7-89A5-EC6FA1313122@netflix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 13:09:42 -0000 On 08/16/16 15:01, Randall Stewart wrote: > Sure > > Let me add some comments for you. The idea her is that you pick-up a reference > to the PCB.. so it can’t be removed. Thus when you re-lock the INP you check the > dropped flag (just in case someone did get in). And this code is only used before tcp_close() / tcp_drop(), so if others got in it is safe to assume that the inp is dead? --HPS From owner-svn-src-head@freebsd.org Tue Aug 16 13:14:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49B58BBB07B for ; Tue, 16 Aug 2016 13:14:47 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1ACBC1BE8 for ; Tue, 16 Aug 2016 13:14:47 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-pf0-x231.google.com with SMTP id y134so27665770pfg.0 for ; Tue, 16 Aug 2016 06:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=IZjI1JC58ckslmgn+ZQ9AmzqRpmCrBDhpjRRvgVkh8Y=; b=alfbdIoH7uHheqVaKgQ6mLM7GLT0VAG7omH/C8eHWdN36HexblTzYplAFxfzRU6siV 6e2caOYlX1CLwmjcay0oXUNNM/yMVw8WQBhvyP05gYhSe0TRw7zOXkpZtI7GWwuwp+ZY BZhpOoKMIb9pA2DPB40X0u1KymVY9DcXDwXzE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=IZjI1JC58ckslmgn+ZQ9AmzqRpmCrBDhpjRRvgVkh8Y=; b=WBx8Zz1lHAELzzywNRnDtlSVitsVAjmcMHEf0AZ0vwVu6yG9owH9gkKvpoxt2cnUf2 yBhhKBi59CudetrWy3uNzH6V0hExQjVuEzR+nSRWQZ/bdL/ALBONYVm72EjHs9piy0/H Y7hDUHukA8hP36fAemu9pv4iGpS0C3CWxk7RtnF7fRDrpoEEOfNVceSzd2v9ncdGBSky c+qB+46OgsxTMGB3ehsSSbfWudz85ghr419pDtC1pFn6qnSpjX3hWGYpIkEdz75YGkaE OejZiiRrHLRWOzMqNAoKg6IfDo/hmMHojaH45t83evtJJRE+/B/NlNUfwpja/HHTKyxB zD8A== X-Gm-Message-State: AEkoouvAyprX/tfwXQnNl1WiwBE4B7mUJ6nnjIIIodZmxSqB91hNhWgPEkiPH0IK2nVJz6p7 X-Received: by 10.98.58.73 with SMTP id h70mr63305000pfa.125.1471353286521; Tue, 16 Aug 2016 06:14:46 -0700 (PDT) Received: from [100.127.65.50] ([69.53.245.200]) by smtp.gmail.com with ESMTPSA id s12sm39369097pfj.73.2016.08.16.06.14.45 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Aug 2016 06:14:45 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304218 - head/sys/netinet From: Randall Stewart In-Reply-To: <61c62080-1529-a717-fbfc-4f4baed56c3e@selasky.org> Date: Tue, 16 Aug 2016 06:14:44 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6BDE71C4-7C3C-4025-8D49-A87BF65CBFEE@netflix.com> References: <201608161240.u7GCeuWS082118@repo.freebsd.org> <92a3cfc1-56bc-813f-dd12-ac19c66fd716@selasky.org> <272AD783-2988-4EE7-89A5-EC6FA1313122@netflix.com> <61c62080-1529-a717-fbfc-4f4baed56c3e@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 13:14:47 -0000 Hans: Take a look at the comments maybe they will help you understand whats = going on. The idea of it is that you *only* need the INFO_RLOCK when the timer = function wants to destroy the tcb (not all timers do this).. and yes usually the = timer function is going to call the drop/close path to purge the TCB. So in order to = pick-up the info lock you do the refcnt/lock-dance to get both locks in the proper lock = order. This means that someone could possibly come in and purge the tcb on you while you = are in the process of doing the lock-dance.=20 If that occurs (the return code is 1) all the caller has to do is call = the drop-lock function (the mate to the add_lock) and then return (since the pcb is in the state the = caller wants.. i.e. gone). If the return code is 0, the caller can proceed to purge the tcb.. and = then call the drop_lock function. Note that in theory this could be used outside of wanting to kill the = tcb.. but I am not sure why one would want to hold the INFO_RLOCK if one did not want to purge the tcb. R > On Aug 16, 2016, at 6:14 AM, Hans Petter Selasky = wrote: >=20 > On 08/16/16 15:01, Randall Stewart wrote: >> Sure >>=20 >> Let me add some comments for you. The idea her is that you pick-up a = reference >> to the PCB.. so it can=E2=80=99t be removed. Thus when you re-lock = the INP you check the >> dropped flag (just in case someone did get in). >=20 > And this code is only used before tcp_close() / tcp_drop(), so if = others got in it is safe to assume that the inp is dead? >=20 > --HPS -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-head@freebsd.org Tue Aug 16 13:18:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F469BBB19F; Tue, 16 Aug 2016 13:18:15 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54A051E40; Tue, 16 Aug 2016 13:18:15 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bZeFp-000FvW-N7; Tue, 16 Aug 2016 16:18:05 +0300 Date: Tue, 16 Aug 2016 16:18:05 +0300 From: Slawa Olhovchenkov To: Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304218 - head/sys/netinet Message-ID: <20160816131805.GK22212@zxy.spb.ru> References: <201608161240.u7GCeuWS082118@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608161240.u7GCeuWS082118@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 13:18:15 -0000 On Tue, Aug 16, 2016 at 12:40:56PM +0000, Randall Stewart wrote: > Author: rrs > Date: Tue Aug 16 12:40:56 2016 > New Revision: 304218 > URL: https://svnweb.freebsd.org/changeset/base/304218 > > Log: > This cleans up the timer code in TCP and also makes it so we do not > take the INFO lock *unless* we are really going to delete the TCB. > > Differential Revision: D7136 Is this related to stable/10? From owner-svn-src-head@freebsd.org Tue Aug 16 13:21:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 469BABBB3DE for ; Tue, 16 Aug 2016 13:21:17 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pf0-x230.google.com (mail-pf0-x230.google.com [IPv6:2607:f8b0:400e:c00::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 1874C1313 for ; Tue, 16 Aug 2016 13:21:17 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-pf0-x230.google.com with SMTP id x72so27779270pfd.2 for ; Tue, 16 Aug 2016 06:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FzuQxInis9r3AweyFKzHYKIwFcjL8baaQlEANO/H5CE=; b=hRe20XuzRCr+1OdJNjv7Ld5VEEI/bSDxwEE9bXO/eBHy4mQGn48FRVUJ+xhuyD6Dck HCqMGRSmKVYEHpUSHFzFOc/KdLw4eNjf9d8+v4HnYhyvdPA9Skp0u7Zz9mI1aIfSgRfM cpiYdwptszRCMTbfqAnaiSmcfcpWwMVyJKIeY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FzuQxInis9r3AweyFKzHYKIwFcjL8baaQlEANO/H5CE=; b=KGcF3HgQOzx5rCs15I4eIT+0wUUqhge6RAOeCQcDS+tpwltuWLoRzNXcmVUDBvUIvY 5QMeKfHo3V6dg/WvihgWiGdGgyISG9+pSVuIvs5v+DxqWBVPiruAJnvXZPPXwZ3CVdbZ H6PUkRKlTtxNn5SgUB1NHw2eNiT//mpkoH818K/eA9qD21tjL4cbkQ0CYOGuFHMyKyRr sVrEiB4APv/B8afxUB2cetQP5i5pyS0VCTZKIS/oxxxN1ujNJQEX2SGcVTJwC/H1OIdL fHK7v3IpSg5/MYTd2/0wPvjlrocETzq+FyMQf4iT+gH5QmT27e1FBP2WVOj+tfn4nHoO nvLA== X-Gm-Message-State: AEkooutJK2ugDNL2/z85zob281D45VTpKI8Zno61QT70A9wRxXaNW0srHmEuIR5LMVSVeDHH X-Received: by 10.98.84.65 with SMTP id i62mr63584114pfb.72.1471353676616; Tue, 16 Aug 2016 06:21:16 -0700 (PDT) Received: from [100.127.65.50] ([69.53.245.200]) by smtp.gmail.com with ESMTPSA id q4sm39454475pfb.18.2016.08.16.06.21.15 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Aug 2016 06:21:16 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304218 - head/sys/netinet From: Randall Stewart In-Reply-To: <20160816131805.GK22212@zxy.spb.ru> Date: Tue, 16 Aug 2016 06:21:14 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <16561701-B1C6-4BE3-B9BA-3535F564620F@netflix.com> References: <201608161240.u7GCeuWS082118@repo.freebsd.org> <20160816131805.GK22212@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 13:21:17 -0000 In theory it *could* be MFC=E2=80=99d to stable-10 and 11 but I am not = sure we want to do that. I am told by Drew that it does improve performance since in stable-10 you are = getting the INFO_WLOCK() but I am not sure if folks want it MFC=E2=80=99d=E2=80=A6 One thing that this code leads us towards is we *in theory* could move = the lock acquisition to the timer code itself (I think).. we would have to make sure that the = callout functions did do the unlock since thats part of the lock-dance with reference=E2=80=A6 but = its theoretically possible :-) R > On Aug 16, 2016, at 6:18 AM, Slawa Olhovchenkov = wrote: >=20 > On Tue, Aug 16, 2016 at 12:40:56PM +0000, Randall Stewart wrote: >=20 >> Author: rrs >> Date: Tue Aug 16 12:40:56 2016 >> New Revision: 304218 >> URL: https://svnweb.freebsd.org/changeset/base/304218 >>=20 >> Log: >> This cleans up the timer code in TCP and also makes it so we do not >> take the INFO lock *unless* we are really going to delete the TCB. >>=20 >> Differential Revision: D7136 >=20 > Is this related to stable/10? -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-head@freebsd.org Tue Aug 16 13:37:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D2CFBBB955; Tue, 16 Aug 2016 13:37:12 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 102D21D24; Tue, 16 Aug 2016 13:37:12 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bZeYH-000GNm-Gn; Tue, 16 Aug 2016 16:37:09 +0300 Date: Tue, 16 Aug 2016 16:37:09 +0300 From: Slawa Olhovchenkov To: Randall Stewart Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r304218 - head/sys/netinet Message-ID: <20160816133709.GL22212@zxy.spb.ru> References: <201608161240.u7GCeuWS082118@repo.freebsd.org> <20160816131805.GK22212@zxy.spb.ru> <16561701-B1C6-4BE3-B9BA-3535F564620F@netflix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <16561701-B1C6-4BE3-B9BA-3535F564620F@netflix.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 13:37:12 -0000 On Tue, Aug 16, 2016 at 06:21:14AM -0700, Randall Stewart via svn-src-all wrote: > > In theory it *could* be MFC’d to stable-10 and 11 but I am not sure we want to do that. I am > told by Drew that it does improve performance since in stable-10 you are getting the INFO_WLOCK() > but I am not sure if folks want it MFC’d… > > One thing that this code leads us towards is we *in theory* could move the lock acquisition to the > timer code itself (I think).. we would have to make sure that the callout functions did do the > unlock since thats part of the lock-dance with reference… but its theoretically possible :-) What reason to not MFC? I mean MFCed all don't break API/ABI. From owner-svn-src-head@freebsd.org Tue Aug 16 14:15:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C86C0BBC443; Tue, 16 Aug 2016 14:15:10 +0000 (UTC) (envelope-from sbz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98BCE19B3; Tue, 16 Aug 2016 14:15:10 +0000 (UTC) (envelope-from sbz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GEF9Co018385; Tue, 16 Aug 2016 14:15:09 GMT (envelope-from sbz@FreeBSD.org) Received: (from sbz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GEF9A6018384; Tue, 16 Aug 2016 14:15:09 GMT (envelope-from sbz@FreeBSD.org) Message-Id: <201608161415.u7GEF9A6018384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbz set sender to sbz@FreeBSD.org using -f From: Sofian Brabez Date: Tue, 16 Aug 2016 14:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304220 - head/usr.bin/tty X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 14:15:10 -0000 Author: sbz (ports committer) Date: Tue Aug 16 14:15:09 2016 New Revision: 304220 URL: https://svnweb.freebsd.org/changeset/base/304220 Log: tty: Use proper definition of exit status code and stdin macro Reviewed by: bapt, bdrewery Differential Revision: https://reviews.freebsd.org/D6828 Modified: head/usr.bin/tty/tty.c Modified: head/usr.bin/tty/tty.c ============================================================================== --- head/usr.bin/tty/tty.c Tue Aug 16 13:08:03 2016 (r304219) +++ head/usr.bin/tty/tty.c Tue Aug 16 14:15:09 2016 (r304220) @@ -63,17 +63,18 @@ main(int argc, char *argv[]) case '?': default: usage(); + /* NOTREACHED */ } - t = ttyname(0); + t = ttyname(STDIN_FILENO); if (!sflag) puts(t ? t : "not a tty"); - exit(t ? 0 : 1); + exit(t ? EXIT_SUCCESS : EXIT_FAILURE); } static void usage(void) { - fprintf(stderr, "usage: tty [-s]\n"); + fprintf(stderr, "usage: %s [-s]\n", getprogname()); exit(2); } From owner-svn-src-head@freebsd.org Tue Aug 16 14:23:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1747EBBC6DB; Tue, 16 Aug 2016 14:23:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D76E11EDE; Tue, 16 Aug 2016 14:23:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GENZdJ021958; Tue, 16 Aug 2016 14:23:35 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GENZJi021956; Tue, 16 Aug 2016 14:23:35 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608161423.u7GENZJi021956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Aug 2016 14:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304221 - head/sys/boot/efi/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 14:23:37 -0000 Author: manu Date: Tue Aug 16 14:23:35 2016 New Revision: 304221 URL: https://svnweb.freebsd.org/changeset/base/304221 Log: Use %ju modifier for u_int64_t and %jd modifier for off_t. off_t is long long on arm32 and long on amd64 MFC after: 1 week Modified: head/sys/boot/efi/boot1/ufs_module.c head/sys/boot/efi/boot1/zfs_module.c Modified: head/sys/boot/efi/boot1/ufs_module.c ============================================================================== --- head/sys/boot/efi/boot1/ufs_module.c Tue Aug 16 14:15:09 2016 (r304220) +++ head/sys/boot/efi/boot1/ufs_module.c Tue Aug 16 14:23:35 2016 (r304221) @@ -56,7 +56,7 @@ dskread(void *buf, u_int64_t lba, int nb devinfo->dev->Media->MediaId, lba, size, buf); if (status != EFI_SUCCESS) { - DPRINTF("dskread: failed dev: %p, id: %u, lba: %lu, size: %d, " + DPRINTF("dskread: failed dev: %p, id: %u, lba: %zu, size: %d, " "status: %lu\n", devinfo->dev, devinfo->dev->Media->MediaId, lba, size, EFI_ERROR_CODE(status)); Modified: head/sys/boot/efi/boot1/zfs_module.c ============================================================================== --- head/sys/boot/efi/boot1/zfs_module.c Tue Aug 16 14:15:09 2016 (r304220) +++ head/sys/boot/efi/boot1/zfs_module.c Tue Aug 16 14:23:35 2016 (r304221) @@ -53,7 +53,7 @@ vdev_read(vdev_t *vdev, void *priv, off_ status = devinfo->dev->ReadBlocks(devinfo->dev, devinfo->dev->Media->MediaId, lba, bytes, buf); if (status != EFI_SUCCESS) { - DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %zu, size: %zu," + DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %jd, size: %zu," " status: %lu\n", devinfo->dev, devinfo->dev->Media->MediaId, lba, bytes, EFI_ERROR_CODE(status)); From owner-svn-src-head@freebsd.org Tue Aug 16 14:33:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E84C7BBC8F6; Tue, 16 Aug 2016 14:33:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B876115BE; Tue, 16 Aug 2016 14:33:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GEXPKF025657; Tue, 16 Aug 2016 14:33:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GEXPrP025656; Tue, 16 Aug 2016 14:33:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608161433.u7GEXPrP025656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Aug 2016 14:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304222 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 14:33:27 -0000 Author: manu Date: Tue Aug 16 14:33:25 2016 New Revision: 304222 URL: https://svnweb.freebsd.org/changeset/base/304222 Log: Only use WaitForKeys event if it exists, this is not the case in u-boot efi implementation. Reviewed by: jhb, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6781 Modified: head/sys/boot/efi/libefi/efi_console.c Modified: head/sys/boot/efi/libefi/efi_console.c ============================================================================== --- head/sys/boot/efi/libefi/efi_console.c Tue Aug 16 14:23:35 2016 (r304221) +++ head/sys/boot/efi/libefi/efi_console.c Tue Aug 16 14:33:25 2016 (r304222) @@ -438,8 +438,10 @@ efi_cons_getchar() /* Try to read a key stroke. We wait for one if none is pending. */ status = conin->ReadKeyStroke(conin, &key); - if (status == EFI_NOT_READY) { - BS->WaitForEvent(1, &conin->WaitForKey, &junk); + while (status == EFI_NOT_READY) { + /* Some EFI implementation (u-boot for example) do not support WaitForKey */ + if (conin->WaitForKey != NULL) + BS->WaitForEvent(1, &conin->WaitForKey, &junk); status = conin->ReadKeyStroke(conin, &key); } switch (key.ScanCode) { @@ -454,6 +456,9 @@ efi_cons_getchar() int efi_cons_poll() { + + if (conin->WaitForKey == NULL) + return (1); /* This can clear the signaled state. */ return (BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS); } From owner-svn-src-head@freebsd.org Tue Aug 16 14:57:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D050BBCFF3 for ; Tue, 16 Aug 2016 14:57:07 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yb0-x22a.google.com (mail-yb0-x22a.google.com [IPv6:2607:f8b0:4002:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40A8C11B7 for ; Tue, 16 Aug 2016 14:57:07 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yb0-x22a.google.com with SMTP id a1so7466628ybi.0 for ; Tue, 16 Aug 2016 07:57:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tqkcaX36QYOEALx41ugFpCOJXFRmtYPFxqx0EfjoXXE=; b=goj0qIBqhPItcjZ9rlGoKAR0tMc1mUMfBvdlW05AC6IZpRsox7tzROLT4WsYKUA+WX btPUNjQeh0vZtlTssQeePnwrJSpUOjdpLsVFXoX/Mz9q9HzKpv/5KjSnJJn1whpVN25r 3Q9qvCvY15aG9/c8eYzqLqfnHdEHJvdHXbF36pzgxofrdkXQ9tqJcT6E+wXHGZQTRryL mzA3Ee3Livt5VNFYMCQCfSchnfIQ4HhuZrOJAP7uX4mW4LJ5ISgsX8Qd/QEmu4x1miz4 JeKhAngSgBVk2tgS+/7tzv83w/BhsOsWh5i/Ijg6vSsM6ON3cfKmVn2797s9wd7ewyVv 7njQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tqkcaX36QYOEALx41ugFpCOJXFRmtYPFxqx0EfjoXXE=; b=Wn+QpYsS7U++Rg7pg+aVzPp2/STqCPWoVsZUEztSCj3Bmm7N1kLobQpmnpDpn/qHLz P6ljOOBTx24/7ptdId3kVvwr7fuBRiAQZ340Hr6NGpSsOApJI1IqzvisxUfFkeR3a5xl 7pyFQ+bqAlfFaQ1WZ6fAvHlwS6FDUurQVugD47gWupSGj8zmMBt68KCppiNtb1Jaz5JX yBR7B/MVpD4+QuHFBV0iXe8NCjZacYtsPaojzO4gzemZP/gJ0dWudnIPy7mYSrlhQ9tQ rMOhR/yqmHdukIkirFGjpfBeiyfep3cqQCNsRim8oxc/082Cpx+IfeE4z+mWHTA5nUS5 TqVQ== X-Gm-Message-State: AEkoouvWbN73Ka/iSG6cB11qmBSd9ZdF+2Y3SMZbgia4UklD7VxAV82nokeTQcgHwkxTGSjNhdEL0E5aDwq/XA== X-Received: by 10.37.57.85 with SMTP id g82mr23936800yba.163.1471359426210; Tue, 16 Aug 2016 07:57:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Tue, 16 Aug 2016 07:57:05 -0700 (PDT) In-Reply-To: <201608161423.u7GENZJi021956@repo.freebsd.org> References: <201608161423.u7GENZJi021956@repo.freebsd.org> From: Ed Schouten Date: Tue, 16 Aug 2016 16:57:05 +0200 Message-ID: Subject: Re: svn commit: r304221 - head/sys/boot/efi/boot1 To: Emmanuel Vadot 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.22 Precedence: list List-Id: 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, 16 Aug 2016 14:57:07 -0000 Hi Emmanuel, 2016-08-16 16:23 GMT+02:00 Emmanuel Vadot : > Author: manu > Date: Tue Aug 16 14:23:35 2016 > New Revision: 304221 > URL: https://svnweb.freebsd.org/changeset/base/304221 > > Log: > Use %ju modifier for u_int64_t and %jd modifier for off_t. > off_t is long long on arm32 and long on amd64 I think both of these should be solved differently: - For uint64_t, you can use 's PRIu64 in the formatting string. In kernel space, I suspect you need to use something like . - For off_t, it's all right to print it with %jd, but then be sure to also add a cast to the argument itself. It may not necessarily be equal to an intmax_t. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Tue Aug 16 15:11:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CF00BBB3AA; Tue, 16 Aug 2016 15:11:48 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20CDC18D9; Tue, 16 Aug 2016 15:11:48 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GFBlSL037973; Tue, 16 Aug 2016 15:11:47 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GFBkJQ037962; Tue, 16 Aug 2016 15:11:46 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201608161511.u7GFBkJQ037962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 16 Aug 2016 15:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304223 - in head: share/man/man4 share/man/man9 sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 15:11:48 -0000 Author: rrs Date: Tue Aug 16 15:11:46 2016 New Revision: 304223 URL: https://svnweb.freebsd.org/changeset/base/304223 Log: Here we update the modular tcp to be able to switch to an alternate TCP stack in other then the closed state (pre-listen/connect). The idea is that *if* that is supported by the alternate stack, it is asked if its ok to switch. If it approves the "handoff" then we allow the switch to happen. Also the fini() function now gets a flag to tell if you are switching away *or* the tcb is destroyed. The init() call into the alternate stack is moved to the end so the tcb is more fully formed before the init transpires. Sponsored by: Netflix Inc. Differential Revision: D6790 Modified: head/share/man/man4/tcp.4 head/share/man/man9/tcp_functions.9 head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Tue Aug 16 14:33:25 2016 (r304222) +++ head/share/man/man4/tcp.4 Tue Aug 16 15:11:46 2016 (r304223) @@ -633,7 +633,8 @@ when trying to use a TCP function block .Xr mod_cc 4 , .Xr siftr 4 , .Xr syncache 4 , -.Xr setkey 8 +.Xr setkey 8 , +.Xr tcp_functions 9 .Rs .%A "V. Jacobson" .%A "R. Braden" Modified: head/share/man/man9/tcp_functions.9 ============================================================================== --- head/share/man/man9/tcp_functions.9 Tue Aug 16 14:33:25 2016 (r304222) +++ head/share/man/man9/tcp_functions.9 Tue Aug 16 15:11:46 2016 (r304223) @@ -114,14 +114,17 @@ struct tcp_function_block { struct inpcb *inp, struct tcpcb *tp); /* Optional memory allocation/free routine */ void (*tfb_tcp_fb_init)(struct tcpcb *); - void (*tfb_tcp_fb_fini)(struct tcpcb *); + void (*tfb_tcp_fb_fini)(struct tcpcb *, int); /* Optional timers, must define all if you define one */ int (*tfb_tcp_timer_stop_all)(struct tcpcb *); void (*tfb_tcp_timer_activate)(struct tcpcb *, uint32_t, u_int); int (*tfb_tcp_timer_active)(struct tcpcb *, uint32_t); void (*tfb_tcp_timer_stop)(struct tcpcb *, uint32_t); + /* Optional functions */ void (*tfb_tcp_rexmit_tmr)(struct tcpcb *); + void (*tfb_tcp_handoff_ok)(struct tcpcb *); + /* System use */ volatile uint32_t tfb_refcnt; uint32_t tfb_flags; }; @@ -157,6 +160,16 @@ in the .Va tfb_tcp_fb_fini field. .Pp +If the +.Va tfb_tcp_fb_fini +argument is non-NULL, the function to which it points is called when the +kernel is destroying the TCP control block or when the socket is transitioning +to use a different TCP stack. +The function is called with arguments of the TCP control block and an integer +flag. +The flag will be zero if the socket is transitioning to use another TCP stack +or one if the TCP control block is being destroyed. +.Pp If the TCP stack implements additional timers, the TCP stack should set a non-NULL pointer in the .Va tfb_tcp_timer_stop_all , @@ -193,6 +206,37 @@ However, care must be taken to ensure th TCP control block in a valid state for the remainder of the retransmit timer logic. .Pp +A user may select a new TCP stack before calling +.Xr connect 2 +or +.Xr listen 2 . +Optionally, a TCP stack may also allow a user to begin using the TCP stack for +a connection that is in a later state by setting a non-NULL function pointer in +the +.Va tfb_tcp_handoff_ok +field. +If this field is non-NULL and a user attempts to select that TCP stack after +calling +.Xr connect 2 +or +.Xr listen 2 +for that socket, the kernel will call the function pointed to by the +.Va tfb_tcp_handoff_ok +field. +The function should return 0 if the user is allowed to switch the socket to use +the TCP stack. Otherwise, the function should return an error code, which will +be returned to the user. +If the +.Va tfb_tcp_handoff_ok +field is +.Dv NULL +and a user attempts to select the TCP stack after calling +.Xr connect 2 +or +.Xr listen 2 +for that socket, the operation will fail and the kernel will return +.Er EINVAL . +.Pp The .Va tfb_refcnt and @@ -269,8 +313,10 @@ The .Fa blk argument references a function block that is not currently registered. .Sh SEE ALSO -.Xr malloc 9 , -.Xr tcp 4 +.Xr connect 2 , +.Xr listen 2 , +.Xr tcp 4 , +.Xr malloc 9 .Sh HISTORY This framework first appeared in .Fx 11.0 . Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Aug 16 14:33:25 2016 (r304222) +++ head/sys/netinet/tcp_subr.c Tue Aug 16 15:11:46 2016 (r304223) @@ -1187,9 +1187,6 @@ tcp_newtcpcb(struct inpcb *inp) tp->t_fb = tcp_func_set_ptr; refcount_acquire(&tp->t_fb->tfb_refcnt); rw_runlock(&tcp_function_lock); - if (tp->t_fb->tfb_tcp_fb_init) { - (*tp->t_fb->tfb_tcp_fb_init)(tp); - } /* * Use the current system default CC algorithm. */ @@ -1201,7 +1198,7 @@ tcp_newtcpcb(struct inpcb *inp) if (CC_ALGO(tp)->cb_init != NULL) if (CC_ALGO(tp)->cb_init(tp->ccv) > 0) { if (tp->t_fb->tfb_tcp_fb_fini) - (*tp->t_fb->tfb_tcp_fb_fini)(tp); + (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); refcount_release(&tp->t_fb->tfb_refcnt); uma_zfree(V_tcpcb_zone, tm); return (NULL); @@ -1210,7 +1207,7 @@ tcp_newtcpcb(struct inpcb *inp) tp->osd = &tm->osd; if (khelp_init_osd(HELPER_CLASS_TCP, tp->osd)) { if (tp->t_fb->tfb_tcp_fb_fini) - (*tp->t_fb->tfb_tcp_fb_fini)(tp); + (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); refcount_release(&tp->t_fb->tfb_refcnt); uma_zfree(V_tcpcb_zone, tm); return (NULL); @@ -1271,6 +1268,9 @@ tcp_newtcpcb(struct inpcb *inp) */ tcp_pcap_tcpcb_init(tp); #endif + if (tp->t_fb->tfb_tcp_fb_init) { + (*tp->t_fb->tfb_tcp_fb_init)(tp); + } return (tp); /* XXX */ } @@ -1484,7 +1484,7 @@ tcp_discardcb(struct tcpcb *tp) if (tp->t_timers->tt_draincnt == 0) { /* We own the last reference on tcpcb, let's free it. */ if (tp->t_fb->tfb_tcp_fb_fini) - (*tp->t_fb->tfb_tcp_fb_fini)(tp); + (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); refcount_release(&tp->t_fb->tfb_refcnt); tp->t_inpcb = NULL; uma_zfree(V_tcpcb_zone, tp); @@ -1513,7 +1513,7 @@ tcp_timer_discard(void *ptp) if (tp->t_timers->tt_draincnt == 0) { /* We own the last reference on this tcpcb, let's free it. */ if (tp->t_fb->tfb_tcp_fb_fini) - (*tp->t_fb->tfb_tcp_fb_fini)(tp); + (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); refcount_release(&tp->t_fb->tfb_refcnt); tp->t_inpcb = NULL; uma_zfree(V_tcpcb_zone, tp); Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Tue Aug 16 14:33:25 2016 (r304222) +++ head/sys/netinet/tcp_syncache.c Tue Aug 16 15:11:46 2016 (r304223) @@ -842,7 +842,7 @@ syncache_socket(struct syncache *sc, str KASSERT(rblk != NULL, ("cannot find blk %p out of syncache?", blk)); if (tp->t_fb->tfb_tcp_fb_fini) - (*tp->t_fb->tfb_tcp_fb_fini)(tp); + (*tp->t_fb->tfb_tcp_fb_fini)(tp, 0); refcount_release(&tp->t_fb->tfb_refcnt); tp->t_fb = rblk; if (tp->t_fb->tfb_tcp_fb_init) { Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Tue Aug 16 14:33:25 2016 (r304222) +++ head/sys/netinet/tcp_usrreq.c Tue Aug 16 15:11:46 2016 (r304223) @@ -1420,40 +1420,59 @@ tcp_ctloutput(struct socket *so, struct if (error) return (error); INP_WLOCK_RECHECK(inp); - if (tp->t_state != TCPS_CLOSED) { - /* - * The user has advanced the state - * past the initial point, we can't - * switch since we are down the road - * and a new set of functions may - * not be compatibile. - */ - INP_WUNLOCK(inp); - return(EINVAL); - } blk = find_and_ref_tcp_functions(&fsn); if (blk == NULL) { INP_WUNLOCK(inp); return (ENOENT); } - if (tp->t_fb != blk) { - if (blk->tfb_flags & TCP_FUNC_BEING_REMOVED) { + if (tp->t_fb == blk) { + /* You already have this */ + refcount_release(&blk->tfb_refcnt); + INP_WUNLOCK(inp); + return (0); + } + if (tp->t_state != TCPS_CLOSED) { + int error=EINVAL; + /* + * The user has advanced the state + * past the initial point, we may not + * be able to switch. + */ + if (blk->tfb_tcp_handoff_ok != NULL) { + /* + * Does the stack provide a + * query mechanism, if so it may + * still be possible? + */ + error = (*blk->tfb_tcp_handoff_ok)(tp); + } + if (error) { refcount_release(&blk->tfb_refcnt); INP_WUNLOCK(inp); - return (ENOENT); + return(error); } + } + if (blk->tfb_flags & TCP_FUNC_BEING_REMOVED) { + refcount_release(&blk->tfb_refcnt); + INP_WUNLOCK(inp); + return (ENOENT); + } + /* + * Release the old refcnt, the + * lookup acquired a ref on the + * new one already. + */ + if (tp->t_fb->tfb_tcp_fb_fini) { /* - * Release the old refcnt, the - * lookup acquires a ref on the - * new one. + * Tell the stack to cleanup with 0 i.e. + * the tcb is not going away. */ - if (tp->t_fb->tfb_tcp_fb_fini) - (*tp->t_fb->tfb_tcp_fb_fini)(tp); - refcount_release(&tp->t_fb->tfb_refcnt); - tp->t_fb = blk; - if (tp->t_fb->tfb_tcp_fb_init) { - (*tp->t_fb->tfb_tcp_fb_init)(tp); - } + (*tp->t_fb->tfb_tcp_fb_fini)(tp, 0); + } + refcount_release(&tp->t_fb->tfb_refcnt); + tp->t_fb = blk; + if (tp->t_fb->tfb_tcp_fb_init) { + (*tp->t_fb->tfb_tcp_fb_init)(tp); } #ifdef TCP_OFFLOAD if (tp->t_flags & TF_TOE) { Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue Aug 16 14:33:25 2016 (r304222) +++ head/sys/netinet/tcp_var.h Tue Aug 16 15:11:46 2016 (r304223) @@ -116,6 +116,18 @@ struct socket; * does not know your callbacks you must provide a * stop_all function that loops through and calls * tcp_timer_stop() with each of your defined timers. + * Adding a tfb_tcp_handoff_ok function allows the socket + * option to change stacks to query you even if the + * connection is in a later stage. You return 0 to + * say you can take over and run your stack, you return + * non-zero (an error number) to say no you can't. + * If the function is undefined you can only change + * in the early states (before connect or listen). + * tfb_tcp_fb_fini is changed to add a flag to tell + * the old stack if the tcb is being destroyed or + * not. A one in the flag means the TCB is being + * destroyed, a zero indicates its transitioning to + * another stack (via socket option). */ struct tcp_function_block { char tfb_tcp_block_name[TCP_FUNCTION_NAME_LEN_MAX]; @@ -128,7 +140,7 @@ struct tcp_function_block { struct inpcb *inp, struct tcpcb *tp); /* Optional memory allocation/free routine */ void (*tfb_tcp_fb_init)(struct tcpcb *); - void (*tfb_tcp_fb_fini)(struct tcpcb *); + void (*tfb_tcp_fb_fini)(struct tcpcb *, int); /* Optional timers, must define all if you define one */ int (*tfb_tcp_timer_stop_all)(struct tcpcb *); void (*tfb_tcp_timer_activate)(struct tcpcb *, @@ -136,6 +148,7 @@ struct tcp_function_block { int (*tfb_tcp_timer_active)(struct tcpcb *, uint32_t); void (*tfb_tcp_timer_stop)(struct tcpcb *, uint32_t); void (*tfb_tcp_rexmit_tmr)(struct tcpcb *); + int (*tfb_tcp_handoff_ok)(struct tcpcb *); volatile uint32_t tfb_refcnt; uint32_t tfb_flags; }; From owner-svn-src-head@freebsd.org Tue Aug 16 15:17:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3439BBBB4CB; Tue, 16 Aug 2016 15:17:37 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 074231CD5; Tue, 16 Aug 2016 15:17:36 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GFHaHY040831; Tue, 16 Aug 2016 15:17:36 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GFHavn040830; Tue, 16 Aug 2016 15:17:36 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201608161517.u7GFHavn040830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 16 Aug 2016 15:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304224 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 15:17:37 -0000 Author: rrs Date: Tue Aug 16 15:17:36 2016 New Revision: 304224 URL: https://svnweb.freebsd.org/changeset/base/304224 Log: A few more wording tweaks as suggested (with some modifications as well) by Ravi Pokala. Thanks for the comments :-) Sponsored by: Netflix Inc. Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Tue Aug 16 15:11:46 2016 (r304223) +++ head/sys/netinet/tcp_timer.c Tue Aug 16 15:17:36 2016 (r304224) @@ -307,15 +307,15 @@ tcp_timer_delack(void *xtp) * should only have grabbed the INP_WLOCK() when * it entered. To safely switch to holding both the * INP_INFO_RLOCK() and the INP_WLOCK() we must first - * grab a reference on the inp, this will hold the inp - * so that it can't be removed. We then unlock and grab - * the info-read lock. Once we have the INP_INFO_RLOCK() we - * proceed again to get the INP_WLOCK() but after that - * we must check if someone else deleted the pcb i.e. - * the inp_flags check. If so we return 1 otherwise - * we return 0. + * grab a reference on the inp, which will hold the inp + * so that it can't be removed. We then unlock the INP_WLOCK(), + * and grab the INP_INFO_RLOCK() lock. Once we have the INP_INFO_RLOCK() + * we proceed again to get the INP_WLOCK() (this preserves proper + * lock order). After acquiring the INP_WLOCK we must check if someone + * else deleted the pcb i.e. the inp_flags check. + * If so we return 1 otherwise we return 0. * - * No matter which the tcp_inpinfo_lock_add() function + * No matter what the tcp_inpinfo_lock_add() function * returns the caller must afterwards call tcp_inpinfo_lock_del() * to drop the locks and reference properly. */ From owner-svn-src-head@freebsd.org Tue Aug 16 15:32:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C61CBBB9F8; Tue, 16 Aug 2016 15:32:54 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp002.me.com (mr11p00im-asmtp002.me.com [17.110.69.253]) (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 5FAC116F8; Tue, 16 Aug 2016 15:32:54 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp002.me.com by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OC000F00DQWRI00@mr11p00im-asmtp002.me.com>; Tue, 16 Aug 2016 15:32:47 +0000 (GMT) Received: from [192.168.1.4] (c-67-188-225-23.hsd1.ca.comcast.net [67.188.225.23]) by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OC0007T9DUKUI30@mr11p00im-asmtp002.me.com>; Tue, 16 Aug 2016 15:32:46 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-16_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1608160183 User-Agent: Microsoft-MacOutlook/f.18.0.160709 Date: Tue, 16 Aug 2016 08:32:43 -0700 Subject: Re: svn commit: r304011 - head/libexec/rtld-elf From: Ravi Pokala Sender: "Pokala, Ravi" To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <457F4AE9-A909-44C9-A38B-CD8C28E3068F@panasas.com> Thread-topic: svn commit: r304011 - head/libexec/rtld-elf References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> In-reply-to: MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1471361567; bh=XexgUX0UrGHzAj/vu5sjK034zo15tnz7eVtJlIvyGH4=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=YmtdskqmKxyprT6s0I331hdktUiPkD8bfaMlqSk3znghpJ/c+mo9jlDY6geW3OARR iCOeu5qFbzEzS1qMR33tKOEHiZAb73pB5loTt5qY761QMrGqF7rUBIYhSd3hMJEQbn BKzZS2gifhwzuUDykeRPWxr1LAaw1wMXZbSqor4/ydtXcBIUtF/lTbJ2Vg6kiJW89G qM3y1BbEWl4y2tMG/81bkVCiKHMsNbPTAnKTpVx04UTLSdzh7X9gy+jMBpOyCqLgGC huqthU1rB39j3o7V9B7miG65V+npKj9YMo5sJG52EcHPZxs54NuvLEncfVIg4O66v9 0evmor50H+rww== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 15:32:54 -0000 -----Original Message----- From: on behalf of Bryan Drewery Organization: FreeBSD Date: 2016-08-16, Tuesday at 03:30 To: Ngie Cooper , Konstantin Belousov Cc: , , Subject: Re: svn commit: r304011 - head/libexec/rtld-elf >On 8/12/16 7:34 PM, Ngie Cooper wrote: >> >> ... >> >>> Log: >>> Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf. >> >> Why? >> > > It's a somewhat error-prone and dangerous macro. See r302908. I'll grant you "error-prone", but why do you consider it "dangerous"? It's inefficient to walk the whole list when passing NULL as the starting pointer, but I'm not sure what the danger is. And, if it really *is* dangerous, perhaps we should purge the TAILQ_FOREACH_FROM APIs entirely? It looks like rtld-elf was the last (in-tree) user: [freebsd/base/head] rpokala% grep -rl TAILQ_FOREACH_FROM . ./share/man/man3/Makefile ./share/man/man3/queue.3 ./sys/sys/queue.h I confirmed that queue.h just defines the (S)TAILQ_FOREACH_FROM(_SAFE) macros, but doesn't use them internally to define anything else. -Ravi (rpokala@) > -- > Regards, > Bryan Drewery From owner-svn-src-head@freebsd.org Tue Aug 16 15:35:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA81CBBBA88; Tue, 16 Aug 2016 15:35:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 99F8818BC; Tue, 16 Aug 2016 15:35:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 8D9911D7A; Tue, 16 Aug 2016 15:35:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 3EF011AC16; Tue, 16 Aug 2016 15:35:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id ou0fLNojrF5N; Tue, 16 Aug 2016 15:35:19 +0000 (UTC) Subject: Re: svn commit: r304011 - head/libexec/rtld-elf DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 55B8E1AC0C To: Ravi Pokala References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> <457F4AE9-A909-44C9-A38B-CD8C28E3068F@panasas.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Tue, 16 Aug 2016 16:35:16 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <457F4AE9-A909-44C9-A38B-CD8C28E3068F@panasas.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="EN5vBwOgnMHS8Hfm0mdDPF5U8AjCk0TPt" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 15:35:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EN5vBwOgnMHS8Hfm0mdDPF5U8AjCk0TPt Content-Type: multipart/mixed; boundary="5Ccw6cSeC65aD447LNviEajGxCPnrV1gH" From: Bryan Drewery To: Ravi Pokala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r304011 - head/libexec/rtld-elf References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> <457F4AE9-A909-44C9-A38B-CD8C28E3068F@panasas.com> In-Reply-To: <457F4AE9-A909-44C9-A38B-CD8C28E3068F@panasas.com> --5Ccw6cSeC65aD447LNviEajGxCPnrV1gH Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/16/16 4:32 PM, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Bryan Drewery > Organization: FreeBSD > Date: 2016-08-16, Tuesday at 03:30 > To: Ngie Cooper , Konstantin Belousov > Cc: , , > Subject: Re: svn commit: r304011 - head/libexec/rtld-elf >=20 >> On 8/12/16 7:34 PM, Ngie Cooper wrote: >>> >>> ... >>> >>>> Log: >>>> Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf. >>> >>> Why? >>> >> >> It's a somewhat error-prone and dangerous macro. See r302908. >=20 > I'll grant you "error-prone", but why do you consider it "dangerous"? I= t's inefficient to walk the whole list when passing NULL as the starting = pointer, but I'm not sure what the danger is. >=20 I don't mean "dangerous" here as in security, but as in "doing the right thing" or "doing what is expected", which it did not as seen in r302908. Granted, the original commit for _FROM noted this problem, but it is very much not obvious. > And, if it really *is* dangerous, perhaps we should purge the TAILQ_FOR= EACH_FROM APIs entirely? It looks like rtld-elf was the last (in-tree) us= er: >=20 I'm not a fan of having it with this behavior, but I understand why it was designed like this. > [freebsd/base/head] rpokala% grep -rl TAILQ_FOREACH_FROM . > ./share/man/man3/Makefile > ./share/man/man3/queue.3 > ./sys/sys/queue.h >=20 > I confirmed that queue.h just defines the (S)TAILQ_FOREACH_FROM(_SAFE) = macros, but doesn't use them internally to define anything else. >=20 > -Ravi (rpokala@) >=20 >> --=20 >> Regards, >> Bryan Drewery=20 >=20 >=20 >=20 --=20 Regards, Bryan Drewery --5Ccw6cSeC65aD447LNviEajGxCPnrV1gH-- --EN5vBwOgnMHS8Hfm0mdDPF5U8AjCk0TPt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXszK0AAoJEDXXcbtuRpfPOeAH/0KMfBjmKxdRGDTm0IjZAkcc 7uvBZ3o4EqFnS85Pjzgqq9uOcB8p745fMAGj/pacwWKUlPwTBRSr7uPrXMYe9tEU DeG/xLQ2F9mIclqFbS0PGR9gQDVChhR4tlpbNzC863zWnUF6XM8oOOhw1fRNP9Zo F6ludxdCBsVLvvq6Ofhg0tM/HCeay/hBSjh+rRb3WPG/5IvBPNPuh8e7fDaWa5tY ur2BjYzLuEh2wHy/NJgyRn9QMxclDa0xgFJzycmf0Z3W5mEHvZTN1Yl2P2gIZLjh pexwhwlqg+R1IZP1YwjjsMq70yLM3CUtbEaubh73wzXRhopEd1K/gs8eglCJ01Q= =qTZe -----END PGP SIGNATURE----- --EN5vBwOgnMHS8Hfm0mdDPF5U8AjCk0TPt-- From owner-svn-src-head@freebsd.org Tue Aug 16 15:52:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D15BDBBC20B; Tue, 16 Aug 2016 15:52:11 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E2A818C4; Tue, 16 Aug 2016 15:52:11 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GFqA0L055556; Tue, 16 Aug 2016 15:52:10 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GFqAtE055555; Tue, 16 Aug 2016 15:52:10 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201608161552.u7GFqAtE055555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 16 Aug 2016 15:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304225 - head/usr.bin/systat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 15:52:11 -0000 Author: araujo Date: Tue Aug 16 15:52:10 2016 New Revision: 304225 URL: https://svnweb.freebsd.org/changeset/base/304225 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Modified: head/usr.bin/systat/main.c Modified: head/usr.bin/systat/main.c ============================================================================== --- head/usr.bin/systat/main.c Tue Aug 16 15:17:36 2016 (r304224) +++ head/usr.bin/systat/main.c Tue Aug 16 15:52:10 2016 (r304225) @@ -261,7 +261,7 @@ display(void) int i, j; /* Get the load average over the last minute. */ - (void) getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0])); + (void) getloadavg(avenrun, nitems(avenrun)); (*curcmd->c_fetch)(); if (curcmd->c_flags & CF_LOADAV) { j = 5.0*avenrun[0] + 0.5; @@ -293,7 +293,7 @@ display(void) GETSYSCTL("kstat.zfs.misc.arcstats.l2_hdr_size", arc[5]); GETSYSCTL("kstat.zfs.misc.arcstats.other_size", arc[6]); wmove(wload, 0, 0); wclrtoeol(wload); - for (i = 0 ; i < sizeof(arc) / sizeof(arc[0]) ; i++) { + for (i = 0 ; i < nitems(arc); i++) { if (arc[i] > 10llu * 1024 * 1024 * 1024 ) { wprintw(wload, "%7lluG", arc[i] >> 30); } @@ -318,7 +318,7 @@ void load(void) { - (void) getloadavg(avenrun, sizeof(avenrun)/sizeof(avenrun[0])); + (void) getloadavg(avenrun, nitems(avenrun)); mvprintw(CMDLINE, 0, "%4.1f %4.1f %4.1f", avenrun[0], avenrun[1], avenrun[2]); clrtoeol(); From owner-svn-src-head@freebsd.org Tue Aug 16 15:53:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7448FBBC320; Tue, 16 Aug 2016 15:53:06 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 447771A8E; Tue, 16 Aug 2016 15:53:06 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GFr5tm055628; Tue, 16 Aug 2016 15:53:05 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GFr5LE055627; Tue, 16 Aug 2016 15:53:05 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201608161553.u7GFr5LE055627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 16 Aug 2016 15:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304226 - head/usr.bin/rpcgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 15:53:06 -0000 Author: araujo Date: Tue Aug 16 15:53:05 2016 New Revision: 304226 URL: https://svnweb.freebsd.org/changeset/base/304226 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Modified: head/usr.bin/rpcgen/rpc_main.c Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Tue Aug 16 15:52:10 2016 (r304225) +++ head/usr.bin/rpcgen/rpc_main.c Tue Aug 16 15:53:05 2016 (r304226) @@ -82,11 +82,11 @@ static char pathbuf[MAXPATHLEN + 1]; static const char *allv[] = { "rpcgen", "-s", "udp", "-s", "tcp", }; -static int allc = sizeof (allv)/sizeof (allv[0]); +static int allc = nitems(allv); static const char *allnv[] = { "rpcgen", "-s", "netpath", }; -static int allnc = sizeof (allnv)/sizeof (allnv[0]); +static int allnc = nitems(allnv); /* * machinations for handling expanding argument list From owner-svn-src-head@freebsd.org Tue Aug 16 15:58:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40C6FBBC3FD; Tue, 16 Aug 2016 15:58:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0A9661D6A; Tue, 16 Aug 2016 15:58:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id C90133C1F0B; Wed, 17 Aug 2016 01:29:49 +1000 (AEST) Date: Wed, 17 Aug 2016 01:29:49 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten cc: Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304221 - head/sys/boot/efi/boot1 In-Reply-To: Message-ID: <20160817010752.S2142@besplex.bde.org> References: <201608161423.u7GENZJi021956@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=CoZCCSMD c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=4GrCeSYe2VWqUJf7sEoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 15:58:48 -0000 On Tue, 16 Aug 2016, Ed Schouten wrote: > Hi Emmanuel, >> >> Log: >> Use %ju modifier for u_int64_t and %jd modifier for off_t. >> off_t is long long on arm32 and long on amd64 > > I think both of these should be solved differently: > > - For uint64_t, you can use 's PRIu64 in the formatting > string. In kernel space, I suspect you need to use something like > . Ugh. > - For off_t, it's all right to print it with %jd, but then be sure to > also add a cast to the argument itself. It may not necessarily be > equal to an intmax_t. This shows how stupid the PRI* macros are. They might be available for 0.1% of typedefed types in a medium-sized source tree. But to use them, you have to know their exact type, and change all printfs using them whenever the typedef is changed. If it is changed to a non-fixed width type, then the printfs need lots of editing to change to a cast. Their only advantage is that they are more space and time efficient, especially on 16-bit systems. Extensive use of fixed-width type is another bug. It asks for a fixed ABI at any cost to efficiency or space. FreeBSD almost never uses "fast" or "least" integer types. However, if you use these types, there are PRI* mistakes for them too. The SCN* macros are not quite as stupid as PRI*, but they should never be used. scanf() is already unusable since it gives undefined behaviour on overflow. These macros are not quite as stupid as PRI* since casts don't work so well for input. The corrsponding thing is to scan input into variables of type [u]intmax_t and convert to the corresponding type, of course without any bounds checking so that you get similar undefined behaviour on overflow as when using SCN*. Bruce From owner-svn-src-head@freebsd.org Tue Aug 16 16:49:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC6DBBBCFF6; Tue, 16 Aug 2016 16:49:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95A041982; Tue, 16 Aug 2016 16:49:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GGnuUY074277; Tue, 16 Aug 2016 16:49:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GGnu6W074276; Tue, 16 Aug 2016 16:49:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608161649.u7GGnu6W074276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Aug 2016 16:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304227 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 16:49:58 -0000 Author: kib Date: Tue Aug 16 16:49:56 2016 New Revision: 304227 URL: https://svnweb.freebsd.org/changeset/base/304227 Log: In ffs_balloc_ufs{1,2} routines, assert that unwind records do not overflow local arrays. This is not immediately obvious from the static code inspection, due to retry logic. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_balloc.c Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 15:53:05 2016 (r304226) +++ head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 16:49:56 2016 (r304227) @@ -255,6 +255,8 @@ ffs_balloc_ufs1(struct vnode *vp, off_t } pref = newb + fs->fs_frag; nb = newb; + MPASS(allocblk < allociblk + nitems(allociblk)); + MPASS(lbns_remfree < lbns + nitems(lbns)); *allocblk++ = nb; *lbns_remfree++ = indirs[1].in_lbn; bp = getblk(vp, indirs[1].in_lbn, fs->fs_bsize, 0, 0, gbflags); @@ -325,6 +327,8 @@ retry: } pref = newb + fs->fs_frag; nb = newb; + MPASS(allocblk < allociblk + nitems(allociblk)); + MPASS(lbns_remfree < lbns + nitems(lbns)); *allocblk++ = nb; *lbns_remfree++ = indirs[i].in_lbn; nbp = getblk(vp, indirs[i].in_lbn, fs->fs_bsize, 0, 0, 0); @@ -401,6 +405,8 @@ retry: goto fail; } nb = newb; + MPASS(allocblk < allociblk + nitems(allociblk)); + MPASS(lbns_remfree < lbns + nitems(lbns)); *allocblk++ = nb; *lbns_remfree++ = lbn; nbp = getblk(vp, lbn, fs->fs_bsize, 0, 0, gbflags); @@ -818,6 +824,8 @@ ffs_balloc_ufs2(struct vnode *vp, off_t } pref = newb + fs->fs_frag; nb = newb; + MPASS(allocblk < allociblk + nitems(allociblk)); + MPASS(lbns_remfree < lbns + nitems(lbns)); *allocblk++ = nb; *lbns_remfree++ = indirs[1].in_lbn; bp = getblk(vp, indirs[1].in_lbn, fs->fs_bsize, 0, 0, @@ -889,6 +897,8 @@ retry: } pref = newb + fs->fs_frag; nb = newb; + MPASS(allocblk < allociblk + nitems(allociblk)); + MPASS(lbns_remfree < lbns + nitems(lbns)); *allocblk++ = nb; *lbns_remfree++ = indirs[i].in_lbn; nbp = getblk(vp, indirs[i].in_lbn, fs->fs_bsize, 0, 0, @@ -966,6 +976,8 @@ retry: goto fail; } nb = newb; + MPASS(allocblk < allociblk + nitems(allociblk)); + MPASS(lbns_remfree < lbns + nitems(lbns)); *allocblk++ = nb; *lbns_remfree++ = lbn; nbp = getblk(vp, lbn, fs->fs_bsize, 0, 0, gbflags); From owner-svn-src-head@freebsd.org Tue Aug 16 16:50:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68601BBC055; Tue, 16 Aug 2016 16:50:49 +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 1FE911B89; Tue, 16 Aug 2016 16:50:49 +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 u7GGomDn074370; Tue, 16 Aug 2016 16:50:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GGomGx074369; Tue, 16 Aug 2016 16:50:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608161650.u7GGomGx074369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Aug 2016 16:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304228 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 16:50:49 -0000 Author: kib Date: Tue Aug 16 16:50:48 2016 New Revision: 304228 URL: https://svnweb.freebsd.org/changeset/base/304228 Log: When block allocation fails in UFS_BALLOC(), and the volume does not have SU enabled, there is no point in calling softdep_request_cleanup(). The call cannot produce free blocks, but we unecessarily lock ufsmount and do inode block write. Usual point of not doing optimizations for the corner case of the full volume is not applicable there, the work is easily avoidable, and the addition CPU and disk io load do not lead to succeeding retry. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_balloc.c Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 16:49:56 2016 (r304227) +++ head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 16:50:48 2016 (r304228) @@ -311,7 +311,7 @@ retry: if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, flags | IO_BUFLOCKED, cred, &newb)) != 0) { brelse(bp); - if (++reclaimed == 1) { + if (DOINGSOFTDEP(vp) && ++reclaimed == 1) { UFS_LOCK(ump); softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT); @@ -390,7 +390,7 @@ retry: flags | IO_BUFLOCKED, cred, &newb); if (error) { brelse(bp); - if (++reclaimed == 1) { + if (DOINGSOFTDEP(vp) && ++reclaimed == 1) { UFS_LOCK(ump); softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT); @@ -881,7 +881,7 @@ retry: if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, flags | IO_BUFLOCKED, cred, &newb)) != 0) { brelse(bp); - if (++reclaimed == 1) { + if (DOINGSOFTDEP(vp) && ++reclaimed == 1) { UFS_LOCK(ump); softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT); @@ -961,7 +961,7 @@ retry: flags | IO_BUFLOCKED, cred, &newb); if (error) { brelse(bp); - if (++reclaimed == 1) { + if (DOINGSOFTDEP(vp) && ++reclaimed == 1) { UFS_LOCK(ump); softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT); From owner-svn-src-head@freebsd.org Tue Aug 16 17:05:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AAC8BBC662; Tue, 16 Aug 2016 17:05:17 +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 C4AA1175F; Tue, 16 Aug 2016 17:05:16 +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 u7GH5FCY082260; Tue, 16 Aug 2016 17:05:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GH5FPg082259; Tue, 16 Aug 2016 17:05:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608161705.u7GH5FPg082259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Aug 2016 17:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304229 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 17:05:17 -0000 Author: kib Date: Tue Aug 16 17:05:15 2016 New Revision: 304229 URL: https://svnweb.freebsd.org/changeset/base/304229 Log: When looking up dandling buffers for unwing after failing block allocation in UFS_BALLOC(), there is no need to map them. Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_balloc.c Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 16:50:48 2016 (r304228) +++ head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 17:05:15 2016 (r304229) @@ -484,7 +484,8 @@ fail: * We shall not leave the freed blocks on the vnode * buffer object lists. */ - bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, GB_NOCREAT); + bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, + GB_NOCREAT | GB_UNMAPPED); if (bp != NULL) { bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~B_ASYNC; @@ -1061,7 +1062,8 @@ fail: * We shall not leave the freed blocks on the vnode * buffer object lists. */ - bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, GB_NOCREAT); + bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, + GB_NOCREAT | GB_UNMAPPED); if (bp != NULL) { bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~B_ASYNC; From owner-svn-src-head@freebsd.org Tue Aug 16 17:07:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48299BBC76F; Tue, 16 Aug 2016 17:07:49 +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 25D9E1A0E; Tue, 16 Aug 2016 17:07:49 +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 u7GH7mgM082436; Tue, 16 Aug 2016 17:07:48 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GH7mMK082434; Tue, 16 Aug 2016 17:07:48 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201608161707.u7GH7mMK082434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 16 Aug 2016 17:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304230 - in head: share/man/man3 sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 17:07:49 -0000 Author: mckusick Date: Tue Aug 16 17:07:48 2016 New Revision: 304230 URL: https://svnweb.freebsd.org/changeset/base/304230 Log: Add two new macros, SLIST_CONCAT and LIST_CONCAT. Note in both the queue.h header file and in the queue.3 manual page that they are O(n) so should be used only in low-usage paths with short lists (otherwise an STAILQ or TAILQ should be used). Reviewed by: kib Modified: head/share/man/man3/queue.3 head/sys/sys/queue.h Modified: head/share/man/man3/queue.3 ============================================================================== --- head/share/man/man3/queue.3 Tue Aug 16 17:05:15 2016 (r304229) +++ head/share/man/man3/queue.3 Tue Aug 16 17:07:48 2016 (r304230) @@ -28,12 +28,13 @@ .\" @(#)queue.3 8.2 (Berkeley) 1/24/94 .\" $FreeBSD$ .\" -.Dd June 24, 2015 +.Dd August 15, 2016 .Dt QUEUE 3 .Os .Sh NAME .Nm SLIST_CLASS_ENTRY , .Nm SLIST_CLASS_HEAD , +.Nm SLIST_CONCAT , .Nm SLIST_EMPTY , .Nm SLIST_ENTRY , .Nm SLIST_FIRST , @@ -75,6 +76,7 @@ .Nm STAILQ_SWAP , .Nm LIST_CLASS_ENTRY , .Nm LIST_CLASS_HEAD , +.Nm LIST_CONCAT , .Nm LIST_EMPTY , .Nm LIST_ENTRY , .Nm LIST_FIRST , @@ -125,6 +127,7 @@ lists and tail queues .\" .Fn SLIST_CLASS_ENTRY "CLASSTYPE" .Fn SLIST_CLASS_HEAD "HEADNAME" "CLASSTYPE" +.Fn SLIST_CONCAT "SLIST_HEAD *head1" "SLIST_HEAD *head2" "TYPE" "SLIST_ENTRY NAME" .Fn SLIST_EMPTY "SLIST_HEAD *head" .Fn SLIST_ENTRY "TYPE" .Fn SLIST_FIRST "SLIST_HEAD *head" @@ -168,6 +171,7 @@ lists and tail queues .\" .Fn LIST_CLASS_ENTRY "CLASSTYPE" .Fn LIST_CLASS_HEAD "HEADNAME" "CLASSTYPE" +.Fn LIST_CONCAT "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE" "LIST_ENTRY NAME" .Fn LIST_EMPTY "LIST_HEAD *head" .Fn LIST_ENTRY "TYPE" .Fn LIST_FIRST "LIST_HEAD *head" @@ -249,6 +253,8 @@ Singly-linked lists add the following fu .Bl -enum -compact -offset indent .It O(n) removal of any entry in the list. +.It +O(n) concatenation of two lists. .El .Pp Singly-linked tail queues add the following functionality: @@ -296,6 +302,8 @@ Linked lists are the simplest of the dou They add the following functionality over the above: .Bl -enum -compact -offset indent .It +O(n) concatenation of two lists. +.It They may be traversed backwards. .El However: @@ -401,6 +409,19 @@ evaluates to an initializer for the list .Fa head . .Pp The macro +.Nm SLIST_CONCAT +concatenates the list headed by +.Fa head2 +onto the end of the one headed by +.Fa head1 +removing all entries from the former. +Use of this macro should be avoided as it traverses the entirety of the +.Fa head1 +list. +A singly-linked tail queue should be used if this macro is needed in +high-usage code paths or to operate on long lists. +.Pp +The macro .Nm SLIST_EMPTY evaluates to true if there are no elements in the list. .Pp @@ -508,6 +529,9 @@ The macro removes the element .Fa elm from the list. +Use of this macro should be avoided as it traverses the entire list. +A doubly-linked list should be used if this macro is needed in +high-usage code paths or to operate on long lists. .Pp The macro .Nm SLIST_SWAP @@ -724,6 +748,9 @@ The macro removes the element .Fa elm from the tail queue. +Use of this macro should be avoided as it traverses the entire list. +A doubly-linked tail queue should be used if this macro is needed in +high-usage code paths or to operate on long tail queues. .Pp The macro .Nm STAILQ_SWAP @@ -823,6 +850,19 @@ evaluates to an initializer for the list .Fa head . .Pp The macro +.Nm LIST_CONCAT +concatenates the list headed by +.Fa head2 +onto the end of the one headed by +.Fa head1 +removing all entries from the former. +Use of this macro should be avoided as it traverses the entirety of the +.Fa head1 +list. +A tail queue should be used if this macro is needed in +high-usage code paths or to operate on long lists. +.Pp +The macro .Nm LIST_EMPTY evaluates to true if there are no elements in the list. .Pp Modified: head/sys/sys/queue.h ============================================================================== --- head/sys/sys/queue.h Tue Aug 16 17:05:15 2016 (r304229) +++ head/sys/sys/queue.h Tue Aug 16 17:07:48 2016 (r304230) @@ -76,6 +76,10 @@ * * For details on the use of these macros, see the queue(3) manual page. * + * Below is a summary of implemented functions where: + * + means the macro is available + * - means the macro is not available + * s means the macro is available but is slow (runs in O(n) time) * * SLIST LIST STAILQ TAILQ * _HEAD + + + + @@ -101,10 +105,10 @@ * _INSERT_BEFORE - + - + * _INSERT_AFTER + + + + * _INSERT_TAIL - - + + - * _CONCAT - - + + + * _CONCAT s s + + * _REMOVE_AFTER + - + - * _REMOVE_HEAD + - + - - * _REMOVE + + + + + * _REMOVE s + s + * _SWAP + + + + * */ @@ -183,6 +187,19 @@ struct { \ /* * Singly-linked List functions. */ +#define SLIST_CONCAT(head1, head2, type, field) do { \ + QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head1); \ + if (curelm == NULL) { \ + if ((SLIST_FIRST(head1) = SLIST_FIRST(head2)) != NULL) \ + SLIST_INIT(head2); \ + } else if (SLIST_FIRST(head2) != NULL) { \ + while (SLIST_NEXT(curelm, field) != NULL) \ + curelm = SLIST_NEXT(curelm, field); \ + SLIST_NEXT(curelm, field) = SLIST_FIRST(head2); \ + SLIST_INIT(head2); \ + } \ +} while (0) + #define SLIST_EMPTY(head) ((head)->slh_first == NULL) #define SLIST_FIRST(head) ((head)->slh_first) @@ -447,6 +464,23 @@ struct { \ #define QMD_LIST_CHECK_PREV(elm, field) #endif /* (_KERNEL && INVARIANTS) */ +#define LIST_CONCAT(head1, head2, type, field) do { \ + QUEUE_TYPEOF(type) *curelm = LIST_FIRST(head1); \ + if (curelm == NULL) { \ + if ((LIST_FIRST(head1) = LIST_FIRST(head2)) != NULL) { \ + LIST_FIRST(head2)->field.le_prev = \ + &LIST_FIRST((head1)); \ + LIST_INIT(head2); \ + } \ + } else if (LIST_FIRST(head2) != NULL) { \ + while (LIST_NEXT(curelm, field) != NULL) \ + curelm = LIST_NEXT(curelm, field); \ + LIST_NEXT(curelm, field) = LIST_FIRST(head2); \ + LIST_FIRST(head2)->field.le_prev = &LIST_NEXT(curelm, field); \ + LIST_INIT(head2); \ + } \ +} while (0) + #define LIST_EMPTY(head) ((head)->lh_first == NULL) #define LIST_FIRST(head) ((head)->lh_first) From owner-svn-src-head@freebsd.org Tue Aug 16 17:18:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72BAEBBCB79; Tue, 16 Aug 2016 17:18:39 +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 36B9F1506; Tue, 16 Aug 2016 17:18:39 +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 u7GHIcC9086477; Tue, 16 Aug 2016 17:18:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GHIc6f086476; Tue, 16 Aug 2016 17:18:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608161718.u7GHIc6f086476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Aug 2016 17:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304231 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 17:18:39 -0000 Author: kib Date: Tue Aug 16 17:18:38 2016 New Revision: 304231 URL: https://svnweb.freebsd.org/changeset/base/304231 Log: On unwind after failed block allocation in ffs_balloc_ufs{1,2}, assert that recorded allocated blocks numbers match the physical block numbers of dandling buffers which are released. When finally freeing the blocks during unwind, assert that dandling buffers where not re-allocated. They shouldn't, because the vnode lock is owned exclusive. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_balloc.c Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 17:07:48 2016 (r304230) +++ head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 17:18:38 2016 (r304231) @@ -487,6 +487,11 @@ fail: bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, GB_NOCREAT | GB_UNMAPPED); if (bp != NULL) { + KASSERT(bp->b_blkno == fsbtodb(fs, *blkp), + ("mismatch1 l %jd %jd b %ju %ju", + (intmax_t)bp->b_lblkno, (uintmax_t)*lbns_remfree, + (uintmax_t)bp->b_blkno, + (uintmax_t)fsbtodb(fs, *blkp))); bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~B_ASYNC; brelse(bp); @@ -531,6 +536,18 @@ fail: * cleared, free the blocks. */ for (blkp = allociblk; blkp < allocblk; blkp++) { +#ifdef INVARIANTS + if (blkp == allociblk) + lbns_remfree = lbns; + bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, + GB_NOCREAT | GB_UNMAPPED); + if (bp != NULL) { + panic("zombie1 %jd %ju %ju", + (intmax_t)bp->b_lblkno, (uintmax_t)bp->b_blkno, + (uintmax_t)fsbtodb(fs, *blkp)); + } + lbns_remfree++; +#endif ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize, ip->i_number, vp->v_type, NULL); } @@ -1065,6 +1082,11 @@ fail: bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, GB_NOCREAT | GB_UNMAPPED); if (bp != NULL) { + KASSERT(bp->b_blkno == fsbtodb(fs, *blkp), + ("mismatch2 l %jd %jd b %ju %ju", + (intmax_t)bp->b_lblkno, (uintmax_t)*lbns_remfree, + (uintmax_t)bp->b_blkno, + (uintmax_t)fsbtodb(fs, *blkp))); bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~B_ASYNC; brelse(bp); @@ -1109,6 +1131,18 @@ fail: * cleared, free the blocks. */ for (blkp = allociblk; blkp < allocblk; blkp++) { +#ifdef INVARIANTS + if (blkp == allociblk) + lbns_remfree = lbns; + bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, + GB_NOCREAT | GB_UNMAPPED); + if (bp != NULL) { + panic("zombie2 %jd %ju %ju", + (intmax_t)bp->b_lblkno, (uintmax_t)bp->b_blkno, + (uintmax_t)fsbtodb(fs, *blkp)); + } + lbns_remfree++; +#endif ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize, ip->i_number, vp->v_type, NULL); } From owner-svn-src-head@freebsd.org Tue Aug 16 17:31:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29462BBCEE1; Tue, 16 Aug 2016 17:31:00 +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 CF23D1EAE; Tue, 16 Aug 2016 17:30:59 +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 u7GHUwZJ091528; Tue, 16 Aug 2016 17:30:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GHUwQG091527; Tue, 16 Aug 2016 17:30:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608161730.u7GHUwQG091527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Aug 2016 17:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304232 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 17:31:00 -0000 Author: kib Date: Tue Aug 16 17:30:58 2016 New Revision: 304232 URL: https://svnweb.freebsd.org/changeset/base/304232 Log: In UFS_BALLOC(), invalidate pages of indirect buffers on failed block allocation unwinding. Dandling buffers are released on UFS_BALLOC() failure to ensure that later attempt to allocate blocks in close range do not find the blocks with invalid content, since possible partial block allocations are unwound. As such, it is not enough to just release the buffers, the pages must also invalidated and removed from the vnode vm_object queue. Otherwise the pages might be found later and used to reconstruct indirect buffers when doing allocations at offset close to the failure point, and their stale content compromise the filesystem integrity. Note that just marking the buffer as B_INVAL is not enough, B_NOCACHE is required. To be sure, clear the B_CACHE flag as well. This complements the r174973, which started releasing buffers. Reported and tested by: pho Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_balloc.c Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 17:18:38 2016 (r304231) +++ head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 17:30:58 2016 (r304232) @@ -492,8 +492,8 @@ fail: (intmax_t)bp->b_lblkno, (uintmax_t)*lbns_remfree, (uintmax_t)bp->b_blkno, (uintmax_t)fsbtodb(fs, *blkp))); - bp->b_flags |= (B_INVAL | B_RELBUF); - bp->b_flags &= ~B_ASYNC; + bp->b_flags |= B_INVAL | B_RELBUF | B_NOCACHE; + bp->b_flags &= ~(B_ASYNC | B_CACHE); brelse(bp); } deallocated += fs->fs_bsize; @@ -1087,8 +1087,8 @@ fail: (intmax_t)bp->b_lblkno, (uintmax_t)*lbns_remfree, (uintmax_t)bp->b_blkno, (uintmax_t)fsbtodb(fs, *blkp))); - bp->b_flags |= (B_INVAL | B_RELBUF); - bp->b_flags &= ~B_ASYNC; + bp->b_flags |= B_INVAL | B_RELBUF | B_NOCACHE; + bp->b_flags &= ~(B_ASYNC | B_CACHE); brelse(bp); } deallocated += fs->fs_bsize; From owner-svn-src-head@freebsd.org Tue Aug 16 18:16:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A4F1BBCA1E for ; Tue, 16 Aug 2016 18:16:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AB3F15DF for ; Tue, 16 Aug 2016 18:16:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x242.google.com with SMTP id f6so6039249ith.2 for ; Tue, 16 Aug 2016 11:16:31 -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=n0TQNVExKJPEOBzjY0Vm3z3vsr6k5lC+iO/PH3N5x+0=; b=VQK2G3HCuUERdAk9YEVt7IiMuKAyaRAP65vSCYDtR5NeztpZjudiJBXrkN8NY1vIGU VMuhk5B8dSOpT1gHiD/g3zkqs2S3MSTryU20lEyYfDxX7gCbiMhpwMazMyVaKgh1x0NZ 6OnAmFqaEsPAf7BEWvCQ4RSQtp9Ama+H5qaNRAt8Sp3/CHdTDAg3keOBapF8FSlSGabK n+O7CNEPMPV/Dbt6pGWwUqD2eDEEbTJapFwPeNrid0RXgpO37n43EwnQVFlhejJd0NWy DBDiysM0KVxGLR3kNuxsJqkW3eZL9x7Z1hJ9Ivlei/JRijiIhiB2dZsI9+dpYiHAONg9 OTIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=n0TQNVExKJPEOBzjY0Vm3z3vsr6k5lC+iO/PH3N5x+0=; b=OUG4+EtXltx6srSmIQVAQEXHbVkzQzdnYj+h720S60hJrVjQ1NMrIMObZhlZqNgtRY YM3VP1tO8tTWui57uD5xTGyaUQ+k9DQ1bEN8/h5b3/i87/leH9SzIMj0xRwjahx9KDB4 HfnVdMVx72C3P7rqA/9nsTxPUtJ6nn60inOoXLGgzYbThS6LC+VT/E9vlW6FMXtO1vDH kmw0dxiY/5/0SLCCACIUXN9uEomvgtnKBTuD8WrttIIXqy2RjFNN5b99cPMA9R4cTCBW eJbPSFmXL6gxHuIslv45g4T07i8U15l14DSrI5sWocV1pEtLZ9/pSk3lf3rVWxldPCf1 QoAQ== X-Gm-Message-State: AEkoouswGFbcmGwvlHuUFYgxSaPASuZg5BCLJpUVw2dIUlijb8WS8dMR0lS9MkJ1kcmMcu52Et9Tq/57428g3A== X-Received: by 10.36.84.147 with SMTP id t141mr11154023ita.14.1471371390529; Tue, 16 Aug 2016 11:16:30 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.96.202 with HTTP; Tue, 16 Aug 2016 11:16:30 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: References: <201608161423.u7GENZJi021956@repo.freebsd.org> From: Warner Losh Date: Tue, 16 Aug 2016 12:16:30 -0600 X-Google-Sender-Auth: K_zkFLPTxYAop3JYedALsXphzsQ Message-ID: Subject: Re: svn commit: r304221 - head/sys/boot/efi/boot1 To: Ed Schouten Cc: Emmanuel Vadot , 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.22 Precedence: list List-Id: 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, 16 Aug 2016 18:16:31 -0000 On Tue, Aug 16, 2016 at 8:57 AM, Ed Schouten wrote: > Hi Emmanuel, > > 2016-08-16 16:23 GMT+02:00 Emmanuel Vadot : >> Author: manu >> Date: Tue Aug 16 14:23:35 2016 >> New Revision: 304221 >> URL: https://svnweb.freebsd.org/changeset/base/304221 >> >> Log: >> Use %ju modifier for u_int64_t and %jd modifier for off_t. >> off_t is long long on arm32 and long on amd64 > > I think both of these should be solved differently: > > - For uint64_t, you can use 's PRIu64 in the formatting > string. In kernel space, I suspect you need to use something like > . cast it to intmax_t and use %jd. We've shunned PRIu64 in the tree. It's existing practice, but I'm sure bruce will voice mild distaste. > - For off_t, it's all right to print it with %jd, but then be sure to > also add a cast to the argument itself. It may not necessarily be > equal to an intmax_t. The cast is important. Warner From owner-svn-src-head@freebsd.org Tue Aug 16 19:43:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DC20BBC11A; Tue, 16 Aug 2016 19:43:18 +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 2AAE116C7; Tue, 16 Aug 2016 19:43:18 +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 u7GJhHOh041813; Tue, 16 Aug 2016 19:43:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GJhHOq041812; Tue, 16 Aug 2016 19:43:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608161943.u7GJhHOq041812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 19:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304235 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 19:43:18 -0000 Author: markj Date: Tue Aug 16 19:43:17 2016 New Revision: 304235 URL: https://svnweb.freebsd.org/changeset/base/304235 Log: Remove prototypes missed in r303951. Modified: head/sys/sys/buf.h Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Tue Aug 16 18:56:56 2016 (r304234) +++ head/sys/sys/buf.h Tue Aug 16 19:43:17 2016 (r304235) @@ -536,9 +536,6 @@ void reassignbuf(struct buf *); struct buf *trypbuf(int *); void bwait(struct buf *, u_char, const char *); void bdone(struct buf *); -void bpin(struct buf *); -void bunpin(struct buf *); -void bunpin_wait(struct buf *); #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Tue Aug 16 20:35:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE313BBB146; Tue, 16 Aug 2016 20:35:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE97017E9; Tue, 16 Aug 2016 20:35:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GKZaiT060855; Tue, 16 Aug 2016 20:35:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GKZaB9060854; Tue, 16 Aug 2016 20:35:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608162035.u7GKZaB9060854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 16 Aug 2016 20:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304238 - head/tests/sys/kern/acct X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 20:35:38 -0000 Author: ngie Date: Tue Aug 16 20:35:36 2016 New Revision: 304238 URL: https://svnweb.freebsd.org/changeset/base/304238 Log: Only expect :encode_tv_random_million to fail on 64-bit platforms It passes on i386 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/kern/acct/acct_test.c Directory Properties: head/ (props changed) Modified: head/tests/sys/kern/acct/acct_test.c ============================================================================== --- head/tests/sys/kern/acct/acct_test.c Tue Aug 16 20:32:08 2016 (r304237) +++ head/tests/sys/kern/acct/acct_test.c Tue Aug 16 20:35:36 2016 (r304238) @@ -204,7 +204,10 @@ ATF_TC_BODY(encode_tv_random_million, tc struct timeval tv; long k; - atf_tc_expect_fail("the testcase violates FLT_EPSILON"); +#ifdef __LP64__ + atf_tc_expect_fail("the testcase violates FLT_EPSILON on 64-bit " + "platforms, e.g. amd64"); +#endif ATF_REQUIRE_MSG(unsetenv("TZ") == 0, "unsetting TZ failed; errno=%d", errno); From owner-svn-src-head@freebsd.org Tue Aug 16 21:02:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C5F4BBB7E4; Tue, 16 Aug 2016 21:02:31 +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 48B6118CB; Tue, 16 Aug 2016 21:02:31 +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 u7GL2UJH072274; Tue, 16 Aug 2016 21:02:30 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GL2Uix072272; Tue, 16 Aug 2016 21:02:30 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201608162102.u7GL2Uix072272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 16 Aug 2016 21:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304239 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 21:02:31 -0000 Author: mckusick Date: Tue Aug 16 21:02:30 2016 New Revision: 304239 URL: https://svnweb.freebsd.org/changeset/base/304239 Log: Bug 211013 reports that a write error to a UFS filesystem running with softupdates panics the kernel. The problem that has been pointed out is that when there is a transient write error on certain metadata blocks, specifically directory blocks (PAGEDEP), inode blocks (INODEDEP), indirect pointer blocks (INDIRDEPS), and cylinder group (BMSAFEMAP, but only when journaling is enabled), we get a panic in one of the routines called by softdep_disk_io_initiation that the I/O is "already started" when we retry the write. These dependency types potentially need to do roll-backs when called by softdep_disk_io_initiation before doing a write and then a roll-forward when called by softdep_disk_write_complete after the I/O completes. The panic happens when there is a transient error. At the top of softdep_disk_write_complete we check to see if the write had an error and if an error occurred we just return. This return is correct most of the time because the main role of the routines called by softdep_disk_write_complete is to process the now-completed dependencies so that the next I/O steps can happen. But for the four types listed above, they do not get to do their rollback operations. This causes the panic when softdep_disk_io_initiation gets called on the second attempt to do the write and the roll-back routines find that the roll-backs have already been done. As an aside I note that there is also the problem that the buffer will have been unlocked and thus made visible to the filesystem and to user applications with the roll-backs in place. The way to resolve the problem is to add a flag to the routines called by softdep_disk_write_complete for the four dependency types noted that indicates whether the write was successful (WRITESUCCEEDED). If the write does not succeed, they do just the roll-backs and then return. If the write was successful they also do their usual processing of the now-completed dependencies. The fix was tested by selectively injecting write errors for buffers holding dependencies of each of the four types noted above and then verifying that the kernel no longer paniced and that following the successful retry of the write that the filesystem could be unmounted and successfully checked cleanly. PR: 211013 Reviewed by: kib Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/softdep.h Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue Aug 16 20:35:36 2016 (r304238) +++ head/sys/ufs/ffs/ffs_softdep.c Tue Aug 16 21:02:30 2016 (r304239) @@ -752,16 +752,16 @@ static int flush_newblk_dep(struct vnode static int flush_inodedep_deps(struct vnode *, struct mount *, ino_t); static int flush_deplist(struct allocdirectlst *, int, int *); static int sync_cgs(struct mount *, int); -static int handle_written_filepage(struct pagedep *, struct buf *); +static int handle_written_filepage(struct pagedep *, struct buf *, int); static int handle_written_sbdep(struct sbdep *, struct buf *); static void initiate_write_sbdep(struct sbdep *); static void diradd_inode_written(struct diradd *, struct inodedep *); static int handle_written_indirdep(struct indirdep *, struct buf *, - struct buf**); -static int handle_written_inodeblock(struct inodedep *, struct buf *); + struct buf**, int); +static int handle_written_inodeblock(struct inodedep *, struct buf *, int); static int jnewblk_rollforward(struct jnewblk *, struct fs *, struct cg *, uint8_t *); -static int handle_written_bmsafemap(struct bmsafemap *, struct buf *); +static int handle_written_bmsafemap(struct bmsafemap *, struct buf *, int); static void handle_written_jaddref(struct jaddref *); static void handle_written_jremref(struct jremref *); static void handle_written_jseg(struct jseg *, struct buf *); @@ -10874,6 +10874,10 @@ initiate_write_bmsafemap(bmsafemap, bp) struct fs *fs; ino_t ino; + /* + * If this is a background write, we did this at the time that + * the copy was made, so do not need to do it again. + */ if (bmsafemap->sm_state & IOSTARTED) return; bmsafemap->sm_state |= IOSTARTED; @@ -10947,10 +10951,39 @@ softdep_disk_write_complete(bp) /* * If an error occurred while doing the write, then the data - * has not hit the disk and the dependencies cannot be unrolled. + * has not hit the disk and the dependencies cannot be processed. + * But we do have to go through and roll forward any dependencies + * that were rolled back before the disk write. */ - if ((bp->b_ioflags & BIO_ERROR) != 0 && (bp->b_flags & B_INVAL) == 0) + if ((bp->b_ioflags & BIO_ERROR) != 0 && (bp->b_flags & B_INVAL) == 0) { + LIST_FOREACH(wk, &bp->b_dep, wk_list) { + switch (wk->wk_type) { + + case D_PAGEDEP: + handle_written_filepage(WK_PAGEDEP(wk), bp, 0); + continue; + + case D_INODEDEP: + handle_written_inodeblock(WK_INODEDEP(wk), + bp, 0); + continue; + + case D_BMSAFEMAP: + handle_written_bmsafemap(WK_BMSAFEMAP(wk), + bp, 0); + continue; + + case D_INDIRDEP: + handle_written_indirdep(WK_INDIRDEP(wk), + bp, &sbp, 0); + continue; + default: + /* nothing to roll forward */ + continue; + } + } return; + } if ((wk = LIST_FIRST(&bp->b_dep)) == NULL) return; ump = VFSTOUFS(wk->wk_mp); @@ -10970,17 +11003,20 @@ softdep_disk_write_complete(bp) switch (wk->wk_type) { case D_PAGEDEP: - if (handle_written_filepage(WK_PAGEDEP(wk), bp)) + if (handle_written_filepage(WK_PAGEDEP(wk), bp, + WRITESUCCEEDED)) WORKLIST_INSERT(&reattach, wk); continue; case D_INODEDEP: - if (handle_written_inodeblock(WK_INODEDEP(wk), bp)) + if (handle_written_inodeblock(WK_INODEDEP(wk), bp, + WRITESUCCEEDED)) WORKLIST_INSERT(&reattach, wk); continue; case D_BMSAFEMAP: - if (handle_written_bmsafemap(WK_BMSAFEMAP(wk), bp)) + if (handle_written_bmsafemap(WK_BMSAFEMAP(wk), bp, + WRITESUCCEEDED)) WORKLIST_INSERT(&reattach, wk); continue; @@ -10999,7 +11035,8 @@ softdep_disk_write_complete(bp) continue; case D_INDIRDEP: - if (handle_written_indirdep(WK_INDIRDEP(wk), bp, &sbp)) + if (handle_written_indirdep(WK_INDIRDEP(wk), bp, &sbp, + WRITESUCCEEDED)) WORKLIST_INSERT(&reattach, wk); continue; @@ -11299,12 +11336,17 @@ handle_bufwait(inodedep, refhd) * Called from within softdep_disk_write_complete above to restore * in-memory inode block contents to their most up-to-date state. Note * that this routine is always called from interrupt level with further - * splbio interrupts blocked. + * interrupts from this device blocked. + * + * If the write did not succeed, we will do all the roll-forward + * operations, but we will not take the actions that will allow its + * dependencies to be processed. */ static int -handle_written_inodeblock(inodedep, bp) +handle_written_inodeblock(inodedep, bp, flags) struct inodedep *inodedep; struct buf *bp; /* buffer containing the inode block */ + int flags; { struct freefile *freefile; struct allocdirect *adp, *nextadp; @@ -11334,7 +11376,8 @@ handle_written_inodeblock(inodedep, bp) /* * Leave this inodeblock dirty until it's in the list. */ - if ((inodedep->id_state & (UNLINKED | UNLINKONLIST)) == UNLINKED) { + if ((inodedep->id_state & (UNLINKED | UNLINKONLIST)) == UNLINKED && + (flags & WRITESUCCEEDED)) { struct inodedep *inon; inon = TAILQ_NEXT(inodedep, id_unlinked); @@ -11373,7 +11416,8 @@ handle_written_inodeblock(inodedep, bp) goto bufwait; return (1); } - inodedep->id_state |= COMPLETE; + if (flags & WRITESUCCEEDED) + inodedep->id_state |= COMPLETE; /* * Roll forward anything that had to be rolled back before * the inode could be updated. @@ -11488,6 +11532,13 @@ handle_written_inodeblock(inodedep, bp) bdirty(bp); bufwait: /* + * If the write did not succeed, we have done all the roll-forward + * operations, but we cannot take the actions that will allow its + * dependencies to be processed. + */ + if ((flags & WRITESUCCEEDED) == 0) + return (hadchanges); + /* * Process any allocdirects that completed during the update. */ if ((adp = TAILQ_FIRST(&inodedep->id_inoupdt)) != NULL) @@ -11544,11 +11595,20 @@ bufwait: return (hadchanges); } +/* + * Perform needed roll-forwards and kick off any dependencies that + * can now be processed. + * + * If the write did not succeed, we will do all the roll-forward + * operations, but we will not take the actions that will allow its + * dependencies to be processed. + */ static int -handle_written_indirdep(indirdep, bp, bpp) +handle_written_indirdep(indirdep, bp, bpp, flags) struct indirdep *indirdep; struct buf *bp; struct buf **bpp; + int flags; { struct allocindir *aip; struct buf *sbp; @@ -11573,6 +11633,16 @@ handle_written_indirdep(indirdep, bp, bp indirdep->ir_state &= ~(UNDONE | IOSTARTED); indirdep->ir_state |= ATTACHED; /* + * If the write did not succeed, we have done all the roll-forward + * operations, but we cannot take the actions that will allow its + * dependencies to be processed. + */ + if ((flags & WRITESUCCEEDED) == 0) { + stat_indir_blk_ptrs++; + bdirty(bp); + return (1); + } + /* * Move allocindirs with written pointers to the completehd if * the indirdep's pointer is not yet written. Otherwise * free them here. @@ -11726,11 +11796,16 @@ jnewblk_rollforward(jnewblk, fs, cgp, bl * Complete a write to a bmsafemap structure. Roll forward any bitmap * changes if it's not a background write. Set all written dependencies * to DEPCOMPLETE and free the structure if possible. + * + * If the write did not succeed, we will do all the roll-forward + * operations, but we will not take the actions that will allow its + * dependencies to be processed. */ static int -handle_written_bmsafemap(bmsafemap, bp) +handle_written_bmsafemap(bmsafemap, bp, flags) struct bmsafemap *bmsafemap; struct buf *bp; + int flags; { struct newblk *newblk; struct inodedep *inodedep; @@ -11746,15 +11821,20 @@ handle_written_bmsafemap(bmsafemap, bp) int chgs; if ((bmsafemap->sm_state & IOSTARTED) == 0) - panic("initiate_write_bmsafemap: Not started\n"); + panic("handle_written_bmsafemap: Not started\n"); ump = VFSTOUFS(bmsafemap->sm_list.wk_mp); chgs = 0; bmsafemap->sm_state &= ~IOSTARTED; foreground = (bp->b_xflags & BX_BKGRDMARKER) == 0; /* - * Release journal work that was waiting on the write. + * If write was successful, release journal work that was waiting + * on the write. Otherwise move the work back. */ - handle_jwork(&bmsafemap->sm_freewr); + if (flags & WRITESUCCEEDED) + handle_jwork(&bmsafemap->sm_freewr); + else + LIST_CONCAT(&bmsafemap->sm_freehd, &bmsafemap->sm_freewr, + worklist, wk_list); /* * Restore unwritten inode allocation pending jaddref writes. @@ -11804,6 +11884,20 @@ handle_written_bmsafemap(bmsafemap, bp) free_jnewblk(jnewblk); } } + /* + * If the write did not succeed, we have done all the roll-forward + * operations, but we cannot take the actions that will allow its + * dependencies to be processed. + */ + if ((flags & WRITESUCCEEDED) == 0) { + LIST_CONCAT(&bmsafemap->sm_newblkhd, &bmsafemap->sm_newblkwr, + newblk, nb_deps); + LIST_CONCAT(&bmsafemap->sm_freehd, &bmsafemap->sm_freewr, + worklist, wk_list); + if (foreground) + bdirty(bp); + return (1); + } while ((newblk = LIST_FIRST(&bmsafemap->sm_newblkwr))) { newblk->nb_state |= DEPCOMPLETE; newblk->nb_state &= ~ONDEPLIST; @@ -11907,12 +12001,17 @@ free_pagedep(pagedep) * A write operation was just completed. Removed inodes can * now be freed and associated block pointers may be committed. * Note that this routine is always called from interrupt level - * with further splbio interrupts blocked. + * with further interrupts from this device blocked. + * + * If the write did not succeed, we will do all the roll-forward + * operations, but we will not take the actions that will allow its + * dependencies to be processed. */ static int -handle_written_filepage(pagedep, bp) +handle_written_filepage(pagedep, bp, flags) struct pagedep *pagedep; struct buf *bp; /* buffer containing the written page */ + int flags; { struct dirrem *dirrem; struct diradd *dap, *nextdap; @@ -11922,6 +12021,8 @@ handle_written_filepage(pagedep, bp) if ((pagedep->pd_state & IOSTARTED) == 0) panic("handle_written_filepage: not started"); pagedep->pd_state &= ~IOSTARTED; + if ((flags & WRITESUCCEEDED) == 0) + goto rollforward; /* * Process any directory removals that have been committed. */ @@ -11941,6 +12042,7 @@ handle_written_filepage(pagedep, bp) if ((pagedep->pd_state & NEWBLOCK) == 0) while ((dap = LIST_FIRST(&pagedep->pd_pendinghd)) != NULL) free_diradd(dap, NULL); +rollforward: /* * Uncommitted directory entries must be restored. */ @@ -11973,7 +12075,7 @@ handle_written_filepage(pagedep, bp) * marked dirty so that its will eventually get written back in * its correct form. */ - if (chgs) { + if (chgs || (flags & WRITESUCCEEDED) == 0) { if ((bp->b_flags & B_DELWRI) == 0) stat_dir_entry++; bdirty(bp); Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Tue Aug 16 20:35:36 2016 (r304238) +++ head/sys/ufs/ffs/softdep.h Tue Aug 16 21:02:30 2016 (r304239) @@ -140,6 +140,7 @@ #define UNLINKPREV 0x100000 /* inodedep is pointed at in the unlink list */ #define UNLINKONLIST 0x200000 /* inodedep is in the unlinked list on disk */ #define UNLINKLINKS (UNLINKNEXT | UNLINKPREV) +#define WRITESUCCEEDED 0x400000 /* the disk write completed successfully */ #define ALLCOMPLETE (ATTACHED | COMPLETE | DEPCOMPLETE) From owner-svn-src-head@freebsd.org Tue Aug 16 21:20:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C3B2BBBDE9; Tue, 16 Aug 2016 21:20:06 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33FF21766; Tue, 16 Aug 2016 21:20:06 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GLK5xM076268; Tue, 16 Aug 2016 21:20:05 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GLK53I076266; Tue, 16 Aug 2016 21:20:05 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201608162120.u7GLK53I076266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Tue, 16 Aug 2016 21:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304242 - head/sys/dev/bhnd/bhndb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 21:20:06 -0000 Author: landonf Date: Tue Aug 16 21:20:05 2016 New Revision: 304242 URL: https://svnweb.freebsd.org/changeset/base/304242 Log: bhndb(4): Drop MIPS-incompatible __builtin_ctz dependency. This replaces the bitfield representation of the bhndb register window freelist with the bitstring API, eliminating a dependency on (MIPS-unsupported) __builtin_ctz(). Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7495 Modified: head/sys/dev/bhnd/bhndb/bhndb_private.h head/sys/dev/bhnd/bhndb/bhndb_subr.c Modified: head/sys/dev/bhnd/bhndb/bhndb_private.h ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_private.h Tue Aug 16 21:17:51 2016 (r304241) +++ head/sys/dev/bhnd/bhndb/bhndb_private.h Tue Aug 16 21:20:05 2016 (r304242) @@ -33,6 +33,7 @@ #define _BHND_BHNDB_PRIVATE_H_ #include +#include #include #include @@ -184,21 +185,23 @@ struct bhndb_resources { struct bhndb_dw_alloc *dw_alloc; /**< dynamic window allocation records */ size_t dwa_count; /**< number of dynamic windows available. */ - uint32_t dwa_freelist; /**< dynamic window free list */ + bitstr_t *dwa_freelist; /**< dynamic window free list */ bhndb_priority_t min_prio; /**< minimum resource priority required to allocate a dynamic window */ }; /** - * Returns true if the all dynamic windows have been exhausted, false + * Returns true if the all dynamic windows are marked free, false * otherwise. * * @param br The resource state to check. */ static inline bool -bhndb_dw_exhausted(struct bhndb_resources *br) +bhndb_dw_all_free(struct bhndb_resources *br) { - return (br->dwa_freelist == 0); + int bit; + bit_ffs(br->dwa_freelist, br->dwa_count, &bit); + return (bit == -1); } /** @@ -209,12 +212,14 @@ bhndb_dw_exhausted(struct bhndb_resource static inline struct bhndb_dw_alloc * bhndb_dw_next_free(struct bhndb_resources *br) { - struct bhndb_dw_alloc *dw_free; + struct bhndb_dw_alloc *dw_free; + int bit; - if (bhndb_dw_exhausted(br)) + bit_ffc(br->dwa_freelist, br->dwa_count, &bit); + if (bit == -1) return (NULL); - dw_free = &br->dw_alloc[__builtin_ctz(br->dwa_freelist)]; + dw_free = &br->dw_alloc[bit]; KASSERT(LIST_EMPTY(&dw_free->refs), ("free list out of sync with refs")); @@ -233,7 +238,7 @@ bhndb_dw_is_free(struct bhndb_resources { bool is_free = LIST_EMPTY(&dwa->refs); - KASSERT(is_free == ((br->dwa_freelist & (1 << dwa->rnid)) != 0), + KASSERT(is_free == !bit_test(br->dwa_freelist, dwa->rnid), ("refs out of sync with free list")); return (is_free); Modified: head/sys/dev/bhnd/bhndb/bhndb_subr.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_subr.c Tue Aug 16 21:17:51 2016 (r304241) +++ head/sys/dev/bhnd/bhndb/bhndb_subr.c Tue Aug 16 21:20:05 2016 (r304242) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "bhndb_private.h" #include "bhndbvar.h" @@ -264,7 +265,7 @@ bhndb_alloc_resources(device_t dev, devi const struct bhndb_regwin *win; bus_size_t last_window_size; size_t res_num; - u_int rnid; + int rnid; int error; bool free_parent_res; bool free_ht_mem, free_br_mem; @@ -371,10 +372,10 @@ bhndb_alloc_resources(device_t dev, devi } /* Fetch the dynamic regwin count and verify that it does not exceed - * what is representable via our freelist bitmask. */ + * what is representable via our freelist bitstring. */ r->dwa_count = bhndb_regwin_count(cfg->register_windows, BHNDB_REGWIN_T_DYN); - if (r->dwa_count >= (8 * sizeof(r->dwa_freelist))) { + if (r->dwa_count >= INT_MAX) { device_printf(r->dev, "max dynamic regwin count exceeded\n"); goto failed; } @@ -385,8 +386,12 @@ bhndb_alloc_resources(device_t dev, devi if (r->dw_alloc == NULL) goto failed; - /* Initialize the dynamic window table and freelist. */ - r->dwa_freelist = 0; + /* Allocate the dynamic window allocation freelist */ + r->dwa_freelist = bit_alloc(r->dwa_count, M_BHND, M_NOWAIT); + if (r->dwa_freelist == NULL) + goto failed; + + /* Initialize the dynamic window table */ rnid = 0; last_window_size = 0; for (win = cfg->register_windows; @@ -446,9 +451,6 @@ bhndb_alloc_resources(device_t dev, devi goto failed; } - /* Add to freelist */ - r->dwa_freelist |= (1 << rnid); - rnid++; } @@ -473,6 +475,9 @@ failed: if (r->dw_alloc != NULL) free(r->dw_alloc, M_BHND); + if (r->dwa_freelist != NULL) + free(r->dwa_freelist, M_BHND); + free (r, M_BHND); return (NULL); @@ -491,9 +496,17 @@ bhndb_free_resources(struct bhndb_resour struct bhndb_dw_rentry *dwr, *dwr_next; /* No window regions may still be held */ - if (__builtin_popcount(br->dwa_freelist) != br->dwa_count) { - device_printf(br->dev, "leaked %llu dynamic register regions\n", - (unsigned long long) br->dwa_count - br->dwa_freelist); + if (!bhndb_dw_all_free(br)) { + for (int i = 0; i < br->dwa_count; i++) { + dwa = &br->dw_alloc[i]; + + /* Skip free dynamic windows */ + if (bhndb_dw_is_free(br, dwa)) + continue; + + device_printf(br->dev, + "leaked dynamic register window %d\n", dwa->rnid); + } } /* Release resources allocated through our parent. */ @@ -523,6 +536,7 @@ bhndb_free_resources(struct bhndb_resour free(br->res, M_BHND); free(br->res_spec, M_BHND); free(br->dw_alloc, M_BHND); + free(br->dwa_freelist, M_BHND); } /** @@ -765,7 +779,7 @@ bhndb_dw_retain(struct bhndb_resources * LIST_INSERT_HEAD(&dwa->refs, rentry, dw_link); /* Update the free list */ - br->dwa_freelist &= ~(1 << (dwa->rnid)); + bit_set(br->dwa_freelist, dwa->rnid); return (0); } @@ -794,7 +808,7 @@ bhndb_dw_release(struct bhndb_resources /* If this was the last reference, update the free list */ if (LIST_EMPTY(&dwa->refs)) - br->dwa_freelist |= (1 << (dwa->rnid)); + bit_clear(br->dwa_freelist, dwa->rnid); } /** From owner-svn-src-head@freebsd.org Tue Aug 16 21:32:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DD6FBBC18A; Tue, 16 Aug 2016 21:32:07 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6FB71E65; Tue, 16 Aug 2016 21:32:06 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GLW6kB083497; Tue, 16 Aug 2016 21:32:06 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GLW5Q2083485; Tue, 16 Aug 2016 21:32:05 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201608162132.u7GLW5Q2083485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Tue, 16 Aug 2016 21:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304243 - in head/sys: conf dev/bhnd dev/bhnd/cores/chipc dev/bhnd/nvram dev/bhnd/tools dev/bwn mips/conf modules/bhnd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 21:32:07 -0000 Author: landonf Date: Tue Aug 16 21:32:05 2016 New Revision: 304243 URL: https://svnweb.freebsd.org/changeset/base/304243 Log: bhnd(4): Implement NVRAM support required for PMU bring-up. - Added a generic bhnd_nvram_parser API, with support for the TLV format used on WGT634U devices, the standard BCM NVRAM format used on most modern devices, and the "board text file" format used on some hardware to supply external NVRAM data at runtime (e.g. via an EFI variable). - Extended the bhnd_bus_if and bhnd_nvram_if interfaces to support both string-based and primitive data type variable access, required for common behavior across both SPROM and NVRAM data sources. - Extended the existing SPROM implementation to support the new string-based NVRAM APIs. - Added an abstract bhnd_nvram driver, implementing the bhnd_nvram_if atop the bhnd_nvram_parser API. - Added a CFE-based bhnd_nvram driver to provide read-only access to NVRAM data on MIPS SoCs, pending implementation of a flash-aware bhnd_nvram driver. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7489 Added: head/sys/dev/bhnd/nvram/bhnd_nvram.c (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_nvram_cfe.c (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_nvram_common.c (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_nvram_common.h - copied, changed from r304242, head/sys/dev/bhnd/nvram/nvramvar.h head/sys/dev/bhnd/nvram/bhnd_nvram_parser.c (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_nvram_parser.h (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_nvram_parserreg.h (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_nvram_parservar.h (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_nvramvar.h - copied, changed from r304242, head/sys/dev/bhnd/nvram/bhnd_spromreg.h head/sys/dev/bhnd/nvram/bhnd_sprom_parser.c - copied, changed from r304242, head/sys/dev/bhnd/nvram/bhnd_sprom_subr.c head/sys/dev/bhnd/nvram/bhnd_sprom_parser.h - copied, changed from r304242, head/sys/dev/bhnd/nvram/bhnd_spromvar.h head/sys/dev/bhnd/nvram/bhnd_sprom_parservar.h - copied, changed from r304242, head/sys/dev/bhnd/nvram/bhnd_spromreg.h Deleted: head/sys/dev/bhnd/nvram/bhnd_sprom_subr.c head/sys/dev/bhnd/nvram/bhnd_spromreg.h head/sys/dev/bhnd/nvram/nvram_subr.c head/sys/dev/bhnd/nvram/nvramvar.h Modified: head/sys/conf/files head/sys/dev/bhnd/bhnd.c head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhnd_types.h head/sys/dev/bhnd/bhndvar.h head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/nvram/bhnd_nvram.h head/sys/dev/bhnd/nvram/bhnd_nvram_if.m head/sys/dev/bhnd/nvram/bhnd_sprom.c head/sys/dev/bhnd/nvram/bhnd_spromvar.h head/sys/dev/bhnd/tools/nvram_map_gen.awk head/sys/dev/bwn/bwn_mac.c head/sys/mips/conf/BCM head/sys/mips/conf/BCM.hints head/sys/mips/conf/SENTRY5 head/sys/mips/conf/SENTRY5.hints head/sys/modules/bhnd/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/conf/files Tue Aug 16 21:32:05 2016 (r304243) @@ -1163,10 +1163,14 @@ dev/bhnd/cores/pci/bhnd_pcib.c optional dev/bhnd/cores/pcie2/bhnd_pcie2.c optional bhnd pci dev/bhnd/cores/pcie2/bhnd_pcie2_hostb.c optional bhndb bhnd pci dev/bhnd/cores/pcie2/bhnd_pcie2b.c optional bhnd_pcie2b bhnd pci +dev/bhnd/nvram/bhnd_nvram.c optional bhnd +dev/bhnd/nvram/bhnd_nvram_common.c optional bhnd +dev/bhnd/nvram/bhnd_nvram_cfe.c optional bhnd siba_nexus cfe | \ + bhnd bcma_nexus cfe dev/bhnd/nvram/bhnd_nvram_if.m optional bhnd +dev/bhnd/nvram/bhnd_nvram_parser.c optional bhnd dev/bhnd/nvram/bhnd_sprom.c optional bhnd -dev/bhnd/nvram/bhnd_sprom_subr.c optional bhnd -dev/bhnd/nvram/nvram_subr.c optional bhnd +dev/bhnd/nvram/bhnd_sprom_parser.c optional bhnd dev/bhnd/siba/siba.c optional siba bhnd dev/bhnd/siba/siba_bhndb.c optional siba bhnd bhndb dev/bhnd/siba/siba_nexus.c optional siba_nexus siba bhnd Modified: head/sys/dev/bhnd/bhnd.c ============================================================================== --- head/sys/dev/bhnd/bhnd.c Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/bhnd.c Tue Aug 16 21:32:05 2016 (r304243) @@ -361,7 +361,7 @@ bhnd_finish_attach(struct bhnd_softc *sc if (ccaps->nvram_src != BHND_NVRAM_SRC_UNKNOWN) { if ((sc->nvram_dev = bhnd_find_nvram(sc)) == NULL) { device_printf(sc->dev, - "warning: %s NVRAM device not found\n", + "warning: NVRAM %s device not found\n", bhnd_nvram_src_name(ccaps->nvram_src)); } } @@ -459,6 +459,11 @@ bhnd_find_platform_dev(struct bhnd_softc } child = device_find_child(chipc, classname, -1); + if (child != NULL) + goto found; + + /* Look for a parent-attached device (e.g. nexus0 -> bhnd_nvram) */ + child = device_find_child(device_get_parent(sc->dev), classname, -1); if (child == NULL) return (NULL); @@ -651,7 +656,7 @@ bhnd_generic_is_region_valid(device_t de */ int bhnd_generic_get_nvram_var(device_t dev, device_t child, const char *name, - void *buf, size_t *size) + void *buf, size_t *size, bhnd_nvram_type type) { struct bhnd_softc *sc; device_t nvram, parent; @@ -660,14 +665,14 @@ bhnd_generic_get_nvram_var(device_t dev, /* If a NVRAM device is available, consult it first */ if ((nvram = bhnd_find_nvram(sc)) != NULL) - return BHND_NVRAM_GETVAR(nvram, name, buf, size); + return BHND_NVRAM_GETVAR(nvram, name, buf, size, type); /* Otherwise, try to delegate to parent */ if ((parent = device_get_parent(dev)) == NULL) return (ENODEV); return (BHND_BUS_GET_NVRAM_VAR(device_get_parent(dev), child, - name, buf, size)); + name, buf, size, type)); } /** Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/bhnd.h Tue Aug 16 21:32:05 2016 (r304243) @@ -321,6 +321,31 @@ void bhnd_set_custom_core_desc(devic const char *name); void bhnd_set_default_core_desc(device_t dev); +int bhnd_nvram_getvar_str(device_t dev, + const char *name, char *buf, size_t len, + size_t *rlen); + +int bhnd_nvram_getvar_uint(device_t dev, + const char *name, void *value, int width); +int bhnd_nvram_getvar_uint8(device_t dev, + const char *name, uint8_t *value); +int bhnd_nvram_getvar_uint16(device_t dev, + const char *name, uint16_t *value); +int bhnd_nvram_getvar_uint32(device_t dev, + const char *name, uint32_t *value); + +int bhnd_nvram_getvar_int(device_t dev, + const char *name, void *value, int width); +int bhnd_nvram_getvar_int8(device_t dev, + const char *name, int8_t *value); +int bhnd_nvram_getvar_int16(device_t dev, + const char *name, int16_t *value); +int bhnd_nvram_getvar_int32(device_t dev, + const char *name, int32_t *value); + +int bhnd_nvram_getvar_array(device_t dev, + const char *name, void *buf, size_t count, + bhnd_nvram_type type); bool bhnd_bus_generic_is_hw_disabled(device_t dev, device_t child); @@ -329,7 +354,8 @@ bool bhnd_bus_generic_is_region_vali u_int port, u_int region); int bhnd_bus_generic_get_nvram_var(device_t dev, device_t child, const char *name, - void *buf, size_t *size); + void *buf, size_t *size, + bhnd_nvram_type type); const struct bhnd_chipid *bhnd_bus_generic_get_chipid(device_t dev, device_t child); int bhnd_bus_generic_read_board_info(device_t dev, @@ -428,55 +454,36 @@ bhnd_read_board_info(device_t dev, struc } /** - * Determine an NVRAM variable's expected size. - * - * @param dev A bhnd bus child device. - * @param name The variable name. - * @param[out] len On success, the variable's size, in bytes. - * - * @retval 0 success - * @retval ENOENT The requested variable was not found. - * @retval ENODEV No valid NVRAM source could be found. - * @retval non-zero If reading @p name otherwise fails, a regular unix - * error code will be returned. - */ -static inline int -bhnd_nvram_getvarlen(device_t dev, const char *name, size_t *len) -{ - return (BHND_BUS_GET_NVRAM_VAR(device_get_parent(dev), dev, name, NULL, - len)); -} - -/** - * Read an NVRAM variable. - * - * @param dev A bhnd bus child device. - * @param name The NVRAM variable name. - * @param buf A buffer large enough to hold @p len bytes. On success, - * the requested value will be written to this buffer. - * @param len The required variable length. + * Read an NVRAM variable, coerced to the requested @p type. * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] buf A buffer large enough to hold @p len bytes. On + * success, the requested value will be written to + * this buffer. This argment may be NULL if + * the value is not desired. + * @param[in,out] len The maximum capacity of @p buf. On success, + * will be set to the actual size of the requested + * value. + * @param type The desired data representation to be written + * to @p buf. + * * @retval 0 success * @retval ENOENT The requested variable was not found. - * @retval EINVAL If @p len does not match the actual variable size. * @retval ENODEV No valid NVRAM source could be found. + * @retval ENOMEM If a buffer of @p size is too small to hold the + * requested value. + * @retval EOPNOTSUPP If the value cannot be coerced to @p type. + * @retval ERANGE If value coercion would overflow @p type. * @retval non-zero If reading @p name otherwise fails, a regular unix * error code will be returned. */ static inline int -bhnd_nvram_getvar(device_t dev, const char *name, void *buf, size_t len) +bhnd_nvram_getvar(device_t dev, const char *name, void *buf, size_t *len, + bhnd_nvram_type type) { - size_t var_len; - int error; - - if ((error = bhnd_nvram_getvarlen(dev, name, &var_len))) - return (error); - - if (len != var_len) - return (EINVAL); - return (BHND_BUS_GET_NVRAM_VAR(device_get_parent(dev), dev, name, buf, - &len)); + len, type)); } /** Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/bhnd_bus_if.m Tue Aug 16 21:32:05 2016 (r304243) @@ -116,7 +116,7 @@ CODE { static int bhnd_bus_null_get_nvram_var(device_t dev, device_t child, - const char *name, void *buf, size_t *size) + const char *name, void *buf, size_t *size, bhnd_nvram_type type) { return (ENODEV); } @@ -492,12 +492,15 @@ METHOD int get_region_addr { * the value is not desired. * @param[in,out] size The capacity of @p buf. On success, will be set * to the actual size of the requested value. + * @param type The data type to be written to @p buf. * * @retval 0 success * @retval ENOENT The requested variable was not found. * @retval ENOMEM If @p buf is non-NULL and a buffer of @p size is too * small to hold the requested value. * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the @p name's data type cannot be coerced to @p type. + * @retval ERANGE If value coercion would overflow @p type. * @retval non-zero If reading @p name otherwise fails, a regular unix * error code will be returned. */ @@ -507,6 +510,7 @@ METHOD int get_nvram_var { const char *name; void *buf; size_t *size; + bhnd_nvram_type type; } DEFAULT bhnd_bus_null_get_nvram_var; Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/bhnd_subr.c Tue Aug 16 21:32:05 2016 (r304243) @@ -30,7 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -881,6 +880,325 @@ cleanup: } /** + * Read an NVRAM variable's NUL-terminated string value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] buf A buffer large enough to hold @p len bytes. On + * success, the NUL-terminated string value will be + * written to this buffer. This argment may be NULL if + * the value is not desired. + * @param len The maximum capacity of @p buf. + * @param[out] rlen On success, will be set to the actual size of + * the requested value (including NUL termination). This + * argment may be NULL if the size is not desired. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval ENOMEM If @p buf is non-NULL and a buffer of @p len is too + * small to hold the requested value. + * @retval EFTYPE If the variable data cannot be coerced to a valid + * string representation. + * @retval ERANGE If value coercion would overflow @p type. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_str(device_t dev, const char *name, char *buf, size_t len, + size_t *rlen) +{ + size_t larg; + int error; + + larg = len; + error = bhnd_nvram_getvar(dev, name, buf, &larg, BHND_NVRAM_TYPE_CSTR); + if (rlen != NULL) + *rlen = larg; + + return (error); +} + +/** + * Read an NVRAM variable's unsigned integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * @param width The output integer type width (1, 2, or + * 4 bytes). + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid unsigned integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) an + * unsigned representation of the given @p width. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_uint(device_t dev, const char *name, void *value, int width) +{ + bhnd_nvram_type type; + size_t len; + + switch (width) { + case 1: + type = BHND_NVRAM_TYPE_UINT8; + break; + case 2: + type = BHND_NVRAM_TYPE_UINT16; + break; + case 4: + type = BHND_NVRAM_TYPE_UINT32; + break; + default: + device_printf(dev, "unsupported NVRAM integer width: %d\n", + width); + return (EINVAL); + } + + len = width; + return (bhnd_nvram_getvar(dev, name, value, &len, type)); +} + +/** + * Read an NVRAM variable's unsigned 8-bit integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid unsigned integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) uint8_t. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_uint8(device_t dev, const char *name, uint8_t *value) +{ + return (bhnd_nvram_getvar_uint(dev, name, value, sizeof(*value))); +} + +/** + * Read an NVRAM variable's unsigned 16-bit integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid unsigned integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) + * uint16_t. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_uint16(device_t dev, const char *name, uint16_t *value) +{ + return (bhnd_nvram_getvar_uint(dev, name, value, sizeof(*value))); +} + +/** + * Read an NVRAM variable's unsigned 32-bit integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid unsigned integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) + * uint32_t. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_uint32(device_t dev, const char *name, uint32_t *value) +{ + return (bhnd_nvram_getvar_uint(dev, name, value, sizeof(*value))); +} + +/** + * Read an NVRAM variable's signed integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * @param width The output integer type width (1, 2, or + * 4 bytes). + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) an + * signed representation of the given @p width. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_int(device_t dev, const char *name, void *value, int width) +{ + bhnd_nvram_type type; + size_t len; + + switch (width) { + case 1: + type = BHND_NVRAM_TYPE_INT8; + break; + case 2: + type = BHND_NVRAM_TYPE_INT16; + break; + case 4: + type = BHND_NVRAM_TYPE_INT32; + break; + default: + device_printf(dev, "unsupported NVRAM integer width: %d\n", + width); + return (EINVAL); + } + + len = width; + return (bhnd_nvram_getvar(dev, name, value, &len, type)); +} + +/** + * Read an NVRAM variable's signed 8-bit integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) int8_t. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_int8(device_t dev, const char *name, int8_t *value) +{ + return (bhnd_nvram_getvar_int(dev, name, value, sizeof(*value))); +} + +/** + * Read an NVRAM variable's signed 16-bit integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) + * int16_t. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_int16(device_t dev, const char *name, int16_t *value) +{ + return (bhnd_nvram_getvar_int(dev, name, value, sizeof(*value))); +} + +/** + * Read an NVRAM variable's signed 32-bit integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) + * int32_t. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_int32(device_t dev, const char *name, int32_t *value) +{ + return (bhnd_nvram_getvar_int(dev, name, value, sizeof(*value))); +} + + +/** + * Read an NVRAM variable's array value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] buf A buffer large enough to hold @p size bytes. + * On success, the requested value will be written + * to this buffer. + * @param[in,out] size The required number of bytes to write to + * @p buf. + * @param type The desired array element data representation. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval ENXIO If less than @p size bytes are available. + * @retval ENOMEM If a buffer of @p size is too small to hold the + * requested value. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid instance of @p type. + * @retval ERANGE If value coercion would overflow (or underflow) a + * representation of @p type. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_array(device_t dev, const char *name, void *buf, size_t size, + bhnd_nvram_type type) +{ + size_t nbytes; + int error; + + /* Attempt read */ + nbytes = size; + if ((error = bhnd_nvram_getvar(dev, name, buf, &nbytes, type))) + return (error); + + /* Verify that the expected number of bytes were fetched */ + if (nbytes < size) + return (ENXIO); + + return (0); +} + +/** * Using the bhnd(4) bus-level core information and a custom core name, * populate @p dev's device description. * @@ -953,7 +1271,8 @@ bhnd_bus_generic_get_chipid(device_t dev /* nvram board_info population macros for bhnd_bus_generic_read_board_info() */ #define BHND_GV(_dest, _name) \ - bhnd_nvram_getvar(child, BHND_NVAR_ ## _name, &_dest, sizeof(_dest)) + bhnd_nvram_getvar_uint(child, BHND_NVAR_ ## _name, &_dest, \ + sizeof(_dest)) #define REQ_BHND_GV(_dest, _name) do { \ if ((error = BHND_GV(_dest, _name))) { \ @@ -1017,7 +1336,7 @@ bhnd_bus_generic_read_board_info(device_ */ int bhnd_bus_generic_get_nvram_var(device_t dev, device_t child, const char *name, - void *buf, size_t *size) + void *buf, size_t *size, bhnd_nvram_type type) { device_t nvram; device_t parent; @@ -1027,14 +1346,14 @@ bhnd_bus_generic_get_nvram_var(device_t /* Look for a directly-attached NVRAM child */ if ((nvram = device_find_child(dev, "bhnd_nvram", -1)) != NULL) - return BHND_NVRAM_GETVAR(nvram, name, buf, size); + return BHND_NVRAM_GETVAR(nvram, name, buf, size, type); /* Try to delegate to parent */ if ((parent = device_get_parent(dev)) == NULL) return (ENODEV); return (BHND_BUS_GET_NVRAM_VAR(device_get_parent(dev), child, - name, buf, size)); + name, buf, size, type)); } /** Modified: head/sys/dev/bhnd/bhnd_types.h ============================================================================== --- head/sys/dev/bhnd/bhnd_types.h Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/bhnd_types.h Tue Aug 16 21:32:05 2016 (r304243) @@ -34,6 +34,8 @@ #include +#include "nvram/bhnd_nvram.h" + /** bhnd(4) device classes. */ typedef enum { BHND_DEVCLASS_CC, /**< chipcommon i/o controller */ Modified: head/sys/dev/bhnd/bhndvar.h ============================================================================== --- head/sys/dev/bhnd/bhndvar.h Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/bhndvar.h Tue Aug 16 21:32:05 2016 (r304243) @@ -92,6 +92,6 @@ int bhnd_generic_resume_child(device_ int bhnd_generic_get_nvram_var(device_t dev, device_t child, const char *name, void *buf, - size_t *size); + size_t *size, bhnd_nvram_type type); #endif /* _BHND_BHNDVAR_H_ */ Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Tue Aug 16 21:32:05 2016 (r304243) @@ -369,19 +369,11 @@ chipc_find_nvram_src(struct chipc_softc { uint32_t otp_st, srom_ctrl; - /* Very early devices vend SPROM/OTP/CIS (if at all) via the - * host bridge interface instead of ChipCommon. */ - if (!CHIPC_QUIRK(sc, SUPPORTS_SPROM)) - return (BHND_NVRAM_SRC_UNKNOWN); - /* - * Later chipset revisions standardized the SPROM capability flags and - * register interfaces. - * * We check for hardware presence in order of precedence. For example, * SPROM is is always used in preference to internal OTP if found. */ - if (caps->sprom) { + if (CHIPC_QUIRK(sc, SUPPORTS_SPROM) && caps->sprom) { srom_ctrl = bhnd_bus_read_4(sc->core, CHIPC_SPROM_CTRL); if (srom_ctrl & CHIPC_SRC_PRESENT) return (BHND_NVRAM_SRC_SPROM); Added: head/sys/dev/bhnd/nvram/bhnd_nvram.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/nvram/bhnd_nvram.c Tue Aug 16 21:32:05 2016 (r304243) @@ -0,0 +1,189 @@ +/*- + * Copyright (c) 2016 Landon Fuller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * BHND CFE NVRAM driver. + * + * Provides access to device NVRAM via CFE. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +#include "bhnd_nvram_if.h" + +#include "bhnd_nvramvar.h" + +/** + * Default bhnd_nvram driver implementation of DEVICE_PROBE(). + */ +int +bhnd_nvram_probe(device_t dev) +{ + device_set_desc(dev, "Broadcom NVRAM"); + + /* Refuse wildcard attachments */ + return (BUS_PROBE_NOWILDCARD); +} + +/** + * Call from subclass DEVICE_ATTACH() implementations to handle + * device attachment. + * + * @param dev BHND NVRAM device. + * @param data NVRAM data to be copied and parsed. No reference to data + * will be held after return. + * @param size Size of @p data, in bytes. + * @param fmt NVRAM format. + */ +int +bhnd_nvram_attach(device_t dev, void *data, size_t size, bhnd_nvram_format fmt) +{ + struct bhnd_nvram_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + + /* Initialize NVRAM parser */ + error = bhnd_nvram_parser_init(&sc->nvram, dev, data, size, fmt); + if (error) + return (error); + + /* Initialize mutex */ + BHND_NVRAM_LOCK_INIT(sc); + + return (0); +} + +/** + * Default bhnd_nvram driver implementation of DEVICE_RESUME(). + */ +int +bhnd_nvram_resume(device_t dev) +{ + return (0); +} + +/** + * Default bhnd_nvram driver implementation of DEVICE_SUSPEND(). + */ +int +bhnd_nvram_suspend(device_t dev) +{ + return (0); +} + +/** + * Default bhnd_nvram driver implementation of DEVICE_DETACH(). + */ +int +bhnd_nvram_detach(device_t dev) +{ + struct bhnd_nvram_softc *sc; + + sc = device_get_softc(dev); + + bhnd_nvram_parser_fini(&sc->nvram); + BHND_NVRAM_LOCK_DESTROY(sc); + + return (0); +} + +/** + * Default bhnd_nvram driver implementation of BHND_NVRAM_GETVAR(). + */ +static int +bhnd_nvram_getvar_method(device_t dev, const char *name, void *buf, size_t *len, + bhnd_nvram_type type) +{ + struct bhnd_nvram_softc *sc; + int error; + + sc = device_get_softc(dev); + + BHND_NVRAM_LOCK(sc); + error = bhnd_nvram_parser_getvar(&sc->nvram, name, buf, len, type); + BHND_NVRAM_UNLOCK(sc); + + return (error); +} + +/** + * Default bhnd_nvram driver implementation of BHND_NVRAM_SETVAR(). + */ +static int +bhnd_nvram_setvar_method(device_t dev, const char *name, const void *buf, + size_t len, bhnd_nvram_type type) +{ + struct bhnd_nvram_softc *sc; + int error; + + sc = device_get_softc(dev); + + BHND_NVRAM_LOCK(sc); + error = bhnd_nvram_parser_setvar(&sc->nvram, name, buf, len, type); + BHND_NVRAM_UNLOCK(sc); + + return (error); +} + +static device_method_t bhnd_nvram_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bhnd_nvram_probe), + DEVMETHOD(device_resume, bhnd_nvram_resume), + DEVMETHOD(device_suspend, bhnd_nvram_suspend), + DEVMETHOD(device_detach, bhnd_nvram_detach), + + /* NVRAM interface */ + DEVMETHOD(bhnd_nvram_getvar, bhnd_nvram_getvar_method), + DEVMETHOD(bhnd_nvram_setvar, bhnd_nvram_setvar_method), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(bhnd_nvram, bhnd_nvram_driver, bhnd_nvram_methods, sizeof(struct bhnd_nvram_softc)); Modified: head/sys/dev/bhnd/nvram/bhnd_nvram.h ============================================================================== --- head/sys/dev/bhnd/nvram/bhnd_nvram.h Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/nvram/bhnd_nvram.h Tue Aug 16 21:32:05 2016 (r304243) @@ -67,4 +67,50 @@ typedef enum { */ } bhnd_nvram_src; +/** Supported NVRAM formats. */ +typedef enum { + BHND_NVRAM_FMT_BCM = 0, /**< Broadcom NUL-delimited key=value pairs */ + BHND_NVRAM_FMT_TLV = 1, /**< CFE TLV encoding, as used on WGT634U */ + BHND_NVRAM_FMT_BTXT = 2, /**< Broadcom board text file. This is used + to provide external NVRAM data for some + fullmac WiFi devices. */ + BHND_NVRAM_FMT_SPROM = 3, /**< SPROM/OTP-specific encoding used by + Broadcom network adapters */ + BHND_NVRAM_FMT_CIS = 4, /**< A mostly CIS-compatible encoding used + on some Broadcom network adapters */ + BHND_NVRAM_FMT_UNKNOWN = 5 /**< Unknown or unrecognized format */ +} bhnd_nvram_format; + + +/** bhnd_nvram_type bit flags */ +enum { + BHND_NVRAM_TF_SIGNED = (1<<7), +}; + +#define BHND_NVRAM_TYPE_ID_MASK 0xF +#define BHND_NVRAM_TYPE_FLAGS_MASK 0x70 + +#define BHND_NVRAM_TYPE_ID(_id, _flags) \ + (((_id) & BHND_NVRAM_TYPE_ID_MASK) | \ + ((_flags) & BHND_NVRAM_TYPE_FLAGS_MASK)) + +/** Supported NVRAM data types */ +typedef enum { + BHND_NVRAM_TYPE_UINT8 = BHND_NVRAM_TYPE_ID(0, 0), /**< unsigned 8-bit integer */ + BHND_NVRAM_TYPE_UINT16 = BHND_NVRAM_TYPE_ID(1, 0), /**< unsigned 16-bit integer */ + BHND_NVRAM_TYPE_UINT32 = BHND_NVRAM_TYPE_ID(2, 0), /**< unsigned 32-bit integer */ + BHND_NVRAM_TYPE_INT8 = BHND_NVRAM_TYPE_ID(4, BHND_NVRAM_TF_SIGNED), /**< signed 8-bit integer */ + BHND_NVRAM_TYPE_INT16 = BHND_NVRAM_TYPE_ID(5, BHND_NVRAM_TF_SIGNED), /**< signed 16-bit integer */ + BHND_NVRAM_TYPE_INT32 = BHND_NVRAM_TYPE_ID(6, BHND_NVRAM_TF_SIGNED), /**< signed 32-bit integer */ + BHND_NVRAM_TYPE_CHAR = BHND_NVRAM_TYPE_ID(7, BHND_NVRAM_TF_SIGNED), /**< ASCII character */ + BHND_NVRAM_TYPE_CSTR = BHND_NVRAM_TYPE_ID(8, 0), /**< NUL-terminated C string */ +} bhnd_nvram_type; + +#undef BHND_NVRAM_TYPE_ID_MASK +#undef BHND_NVRAM_TYPE_FLAGS_MASK +#undef BHND_NVRAM_TYPE_ID + +#define BHND_NVRAM_SIGNED_TYPE(_type) \ + (((_type) & BHND_NVRAM_TF_SIGNED) == BHND_NVRAM_TF_SIGNED) + #endif /* _BHND_NVRAM_BHND_NVRAM_H_ */ Added: head/sys/dev/bhnd/nvram/bhnd_nvram_cfe.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/nvram/bhnd_nvram_cfe.c Tue Aug 16 21:32:05 2016 (r304243) @@ -0,0 +1,373 @@ +/*- + * Copyright (c) 2016 Landon Fuller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * BHND CFE NVRAM driver. + * + * Provides access to device NVRAM via CFE. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +#include "bhnd_nvram_if.h" + +#include "bhnd_nvramvar.h" + +static int nvram_open_cfedev(device_t dev, char *devname, int fd, + int64_t *offset, uint32_t *size, bhnd_nvram_format fmt); +static char *nvram_find_cfedev(device_t dev, int *fd, int64_t *offset, + uint32_t *size, bhnd_nvram_format *fmt); + +/** Known CFE NVRAM device names, in probe order. */ +static char *nvram_cfe_devs[] = { + "nflash0.nvram", /* NAND */ + "nflash1.nvram", + "flash0.nvram", + "flash1.nvram", +}; + +/** Supported CFE NVRAM formats, in probe order. */ +bhnd_nvram_format nvram_cfe_fmts[] = { + BHND_NVRAM_FMT_BCM, + BHND_NVRAM_FMT_TLV +}; + + +static int +bhnd_nvram_cfe_probe(device_t dev) +{ + char *devname; + bhnd_nvram_format fmt; + int64_t offset; + uint32_t size; + int error; + int fd; + + /* Defer to default driver implementation */ + if ((error = bhnd_nvram_probe(dev)) > 0) + return (error); + + /* Locate a usable CFE device */ + devname = nvram_find_cfedev(dev, &fd, &offset, &size, &fmt); + if (devname == NULL) + return (ENXIO); + cfe_close(fd); + + switch (fmt) { + case BHND_NVRAM_FMT_BCM: + device_set_desc(dev, "Broadcom NVRAM"); + break; + case BHND_NVRAM_FMT_TLV: + device_set_desc(dev, "Broadcom WGT634U NVRAM"); + break; + default: + device_printf(dev, "unknown NVRAM format: %d\n", fmt); + return (ENXIO); + } + + /* Refuse wildcard attachments */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Aug 16 21:53:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2C31BBC62C; Tue, 16 Aug 2016 21:53:58 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A61E11FA; Tue, 16 Aug 2016 21:53:58 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 32198B808A; Tue, 16 Aug 2016 23:53:54 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 91F8928494; Tue, 16 Aug 2016 23:53:55 +0200 (CEST) Date: Tue, 16 Aug 2016 23:53:55 +0200 From: Jilles Tjoelker To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304180 - head/sys/ufs/ffs Message-ID: <20160816215355.GB12199@stack.nl> References: <201608151922.u7FJMOmT099410@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608151922.u7FJMOmT099410@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 21:53:58 -0000 On Mon, Aug 15, 2016 at 07:22:24PM +0000, Konstantin Belousov wrote: > [snip] > @@ -254,15 +259,23 @@ loop: > if ((bp->b_vflags & BV_SCANNED) != 0) > continue; > bp->b_vflags |= BV_SCANNED; > - /* Flush indirects in order. */ > + /* > + * Flush indirects in order, if requested. > + * > + * Note that if only datasync is requested, we can > + * skip indirect blocks when softupdates are not > + * active. Otherwise we must flush them with data, > + * since dependencies prevent data block writes. > + */ > if (waitfor == MNT_WAIT && bp->b_lblkno <= -NDADDR && > - lbn_level(bp->b_lblkno) >= passes) > + (lbn_level(bp->b_lblkno) >= passes || > + ((flags & DATA_ONLY) != 0 && !DOINGSOFTDEP(vp)))) > continue; > if (bp->b_lblkno > lbn) > panic("ffs_syncvnode: syncing truncated data."); > if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) == 0) { > BO_UNLOCK(bo); > - } else if (wait != 0) { > + } else if (wait) { > if (BUF_LOCK(bp, > LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, > BO_LOCKPTR(bo)) != 0) { Hmm, some people interpret POSIX differently than I do, but I think it is clear that XBD 3.384 Synchronized I/O Data Integrity Completion requires the indirect blocks to be written (because "all file system information required to retrieve the data is successfully transferred"). The Linux man page matches this interpretation except that an fsync of the parent directory may be required. If the whole file is being considered, then any change to indirect blocks is needed to access some data (because the file was extended, a hole was filled or snapshotted data was overwritten). For other overwrites, there is no change to indirect blocks and no conflict with fdatasync's performance objectives. > @@ -330,31 +343,59 @@ next: > * these will be done with one sync and one async pass. > */ > if (bo->bo_dirty.bv_cnt > 0) { > - /* Write the inode after sync passes to flush deps. */ > - if (wait && DOINGSOFTDEP(vp) && (flags & NO_INO_UPDT) == 0) { > - BO_UNLOCK(bo); > - ffs_update(vp, 1); > - BO_LOCK(bo); > + if ((flags & DATA_ONLY) == 0) { > + still_dirty = true; > + } else { > + /* > + * For data-only sync, dirty indirect buffers > + * are ignored. > + */ > + still_dirty = false; > + TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) { > + if (bp->b_lblkno > -NDADDR) { > + still_dirty = true; > + break; > + } > + } > } > - /* switch between sync/async. */ > - wait = !wait; > - if (wait == 1 || ++passes < NIADDR + 2) > - goto loop; > + > + if (still_dirty) { > + /* Write the inode after sync passes to flush deps. */ > + if (wait && DOINGSOFTDEP(vp) && > + (flags & NO_INO_UPDT) == 0) { > + BO_UNLOCK(bo); > + ffs_update(vp, 1); > + BO_LOCK(bo); > + } > + /* switch between sync/async. */ > + wait = !wait; > + if (wait || ++passes < NIADDR + 2) > + goto loop; > #ifdef INVARIANTS > - if (!vn_isdisk(vp, NULL)) > - vn_printf(vp, "ffs_fsync: dirty "); > + if (!vn_isdisk(vp, NULL)) > + vn_printf(vp, "ffs_fsync: dirty "); > #endif > + } > } > BO_UNLOCK(bo); > error = 0; > - if ((flags & NO_INO_UPDT) == 0) > - error = ffs_update(vp, 1); > - if (DOINGSUJ(vp)) > - softdep_journal_fsync(VTOI(vp)); > + if ((flags & DATA_ONLY) == 0) { > + if ((flags & NO_INO_UPDT) == 0) > + error = ffs_update(vp, 1); > + if (DOINGSUJ(vp)) > + softdep_journal_fsync(VTOI(vp)); > + } > return (error); > } Ideally, a changed i_size would also cause the inode to be written, but I don't know how to determine that (there is no i_flag for it). Always writing the inode would defeat the point of fdatasync. -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Tue Aug 16 21:55:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A98FBBC6C6; Tue, 16 Aug 2016 21:55:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BAF71384; Tue, 16 Aug 2016 21:55:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GLtYRo091233; Tue, 16 Aug 2016 21:55:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GLtYp4091232; Tue, 16 Aug 2016 21:55:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201608162155.u7GLtYp4091232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 16 Aug 2016 21:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304244 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 21:55:35 -0000 Author: glebius Date: Tue Aug 16 21:55:34 2016 New Revision: 304244 URL: https://svnweb.freebsd.org/changeset/base/304244 Log: We should not be allowing a timeout to reset when a drain is in progress on it (either async or sync drain). At this moment the only user of drain is TCP, but TCP wouldn't reschedule a callout after it has drained it, since it drains only when a tcpcb is closed. This for now the problem isn't observed. Submitted by: rrs Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Tue Aug 16 21:32:05 2016 (r304243) +++ head/sys/kern/kern_timeout.c Tue Aug 16 21:55:34 2016 (r304244) @@ -1061,7 +1061,7 @@ callout_reset_sbt_on(struct callout *c, */ if (c->c_lock != NULL && !cc_exec_cancel(cc, direct)) cancelled = cc_exec_cancel(cc, direct) = true; - if (cc_exec_waiting(cc, direct)) { + if (cc_exec_waiting(cc, direct) || cc_exec_drain(cc, dir)) { /* * Someone has called callout_drain to kill this * callout. Don't reschedule. From owner-svn-src-head@freebsd.org Tue Aug 16 22:43:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6452BBBC18F; Tue, 16 Aug 2016 22:43:29 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (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 0B6501F66; Tue, 16 Aug 2016 22:43:29 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id i5so18934764wmg.2; Tue, 16 Aug 2016 15:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=lI0I1jHarMEp0rN9+RvuTZ2uhs6xkNeHvKVW2Zbo8/0=; b=dMXk2sMCJkjqFiXDshQIOpFASh9uSASY2OZEfVG/RTGv3pJYU/bzpK54cR4g4/iA3M tkxc/VpXfFEGcW2hbwKlhrNrllxYdzneJeFWxctYMFRxTobVXdAH2NOKn8eGzI8sOU0X Zj44UoKa7wJO2VdNOCSmtwFN4t4RFcmhlQdH7VIxp7sPM24UlqBFrYd5PotKhBjEBP3P BvayssdpCBlNBuMCWFlwDme/us1H/0PVij43M0tz4VpHMldoTVYkahxYBnyEQICuv9xd stQd8uQC4lhFtaGyx5s7/1tdYSTxPcEagYLSe4DQZ4pfM1df3jb3bP4IuemoLZ/P1Cae RKyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=lI0I1jHarMEp0rN9+RvuTZ2uhs6xkNeHvKVW2Zbo8/0=; b=euhCeXuEwdfxOzHMPNj73WG0lkEY1Re4WAoyeYDccFirnY84XvKeR+oGmPz1hpGaer QHw1m4Owpup+Ew120vW+c5WguPHZWzUlEf20ieqp5lJzPhDN4BEfY+E2AjCrqYvRERPK ucg4XUHmww3YhRNxfjAxWKC5nSAzeYBMh/YTaoe7TbCa67YCpM4XTzl+zqOrZbz6s9Ra s2r6LAeE476WETxcyemiCY3+jsSuXB81IC5VPaj2hRFaSRgzlyqCk3mzvNH/vjvyY5wq 38Cz0Au7U7J4m6oEG6UsBjRCADocSkst0+Oxgv0hMWb0kaWCbmS3YXj4ESKBAZ/sQ0Cn Y1kA== X-Gm-Message-State: AEkoout+Sk5xGbjTcE7c9bfGKp288eHPRlKKU8EzAd1ZIhDIaSOlY4980knqU6Iu2GHt3Q== X-Received: by 10.194.29.2 with SMTP id f2mr38633703wjh.161.1471387406323; Tue, 16 Aug 2016 15:43:26 -0700 (PDT) Received: from ernst.home (p578E3980.dip0.t-ipconnect.de. [87.142.57.128]) by smtp.gmail.com with ESMTPSA id i66sm23749285wmg.9.2016.08.16.15.43.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Aug 2016 15:43:25 -0700 (PDT) Date: Wed, 17 Aug 2016 00:43:23 +0200 From: Gary Jennejohn To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304244 - head/sys/kern Message-ID: <20160817004323.5383bf7f@ernst.home> In-Reply-To: <201608162155.u7GLtYp4091232@repo.freebsd.org> References: <201608162155.u7GLtYp4091232@repo.freebsd.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.29; amd64-portbld-freebsd11.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.22 Precedence: list List-Id: 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, 16 Aug 2016 22:43:29 -0000 On Tue, 16 Aug 2016 21:55:34 +0000 (UTC) Gleb Smirnoff wrote: > Author: glebius > Date: Tue Aug 16 21:55:34 2016 > New Revision: 304244 > URL: https://svnweb.freebsd.org/changeset/base/304244 > > Log: > We should not be allowing a timeout to reset when a drain is in progress on > it (either async or sync drain). > > At this moment the only user of drain is TCP, but TCP wouldn't reschedule a > callout after it has drained it, since it drains only when a tcpcb is closed. > This for now the problem isn't observed. > > Submitted by: rrs > > Modified: > head/sys/kern/kern_timeout.c > > Modified: head/sys/kern/kern_timeout.c > ============================================================================== > --- head/sys/kern/kern_timeout.c Tue Aug 16 21:32:05 2016 (r304243) > +++ head/sys/kern/kern_timeout.c Tue Aug 16 21:55:34 2016 (r304244) > @@ -1061,7 +1061,7 @@ callout_reset_sbt_on(struct callout *c, > */ > if (c->c_lock != NULL && !cc_exec_cancel(cc, direct)) > cancelled = cc_exec_cancel(cc, direct) = true; > - if (cc_exec_waiting(cc, direct)) { > + if (cc_exec_waiting(cc, direct) || cc_exec_drain(cc, dir)) { <== dir in this line should really be direct. > /* > * Someone has called callout_drain to kill this > * callout. Don't reschedule. -- Gary Jennejohn From owner-svn-src-head@freebsd.org Tue Aug 16 23:00:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72F55BBC699; Tue, 16 Aug 2016 23:00:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4422B1A46; Tue, 16 Aug 2016 23:00:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GN0NrW013898; Tue, 16 Aug 2016 23:00:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GN0NV1013897; Tue, 16 Aug 2016 23:00:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201608162300.u7GN0NV1013897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 16 Aug 2016 23:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304245 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 16 Aug 2016 23:00:24 -0000 Author: glebius Date: Tue Aug 16 23:00:22 2016 New Revision: 304245 URL: https://svnweb.freebsd.org/changeset/base/304245 Log: Fix a stupid typo (or copy/paste buffer malfunction). Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Tue Aug 16 21:55:34 2016 (r304244) +++ head/sys/kern/kern_timeout.c Tue Aug 16 23:00:22 2016 (r304245) @@ -1061,7 +1061,7 @@ callout_reset_sbt_on(struct callout *c, */ if (c->c_lock != NULL && !cc_exec_cancel(cc, direct)) cancelled = cc_exec_cancel(cc, direct) = true; - if (cc_exec_waiting(cc, direct) || cc_exec_drain(cc, dir)) { + if (cc_exec_waiting(cc, direct) || cc_exec_drain(cc, direct)) { /* * Someone has called callout_drain to kill this * callout. Don't reschedule. From owner-svn-src-head@freebsd.org Wed Aug 17 00:10:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C61FBBCE40; Wed, 17 Aug 2016 00:10:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 151AE1EB6; Wed, 17 Aug 2016 00:10:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u7H09r5E006541 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 16 Aug 2016 17:09:53 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u7H09rJR006540; Tue, 16 Aug 2016 17:09:53 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 16 Aug 2016 17:09:53 -0700 From: Gleb Smirnoff To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303646 - head/sys/ofed/drivers/infiniband/ulp/ipoib Message-ID: <20160817000953.GB1069@FreeBSD.org> References: <201608012222.u71MMB4E018482@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608012222.u71MMB4E018482@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 00:10:01 -0000 Mark, On Mon, Aug 01, 2016 at 10:22:11PM +0000, Mark Johnston wrote: M> Author: markj M> Date: Mon Aug 1 22:22:11 2016 M> New Revision: 303646 M> URL: https://svnweb.freebsd.org/changeset/base/303646 M> M> Log: M> ipoib: Bound the number of egress mbufs buffered during pathrec lookups. M> M> In pathological situations where the master subnet manager becomes M> unresponsive for an extended period, we may otherwise end up queuing all M> of the system's mbufs while waiting for a response to a path record lookup. M> M> This addresses the same issue as commit 1e85b806f9 in Linux. M> M> Reviewed by: cem, ngie M> MFC after: 2 weeks M> Sponsored by: EMC / Isilon Storage Division M> M> Modified: M> head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c M> M> Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c M> ============================================================================== M> --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 1 22:19:23 2016 (r303645) M> +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 1 22:22:11 2016 (r303646) M> @@ -660,7 +660,13 @@ ipoib_unicast_send(struct mbuf *mb, stru M> new_path = 1; M> } M> if (path) { M> - _IF_ENQUEUE(&path->queue, mb); M> + if (_IF_QLEN(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) M> + _IF_ENQUEUE(&path->queue, mb); M> + else { M> + if_inc_counter(priv->dev, IFCOUNTER_OERRORS, 1); M> + m_freem(mb); M> + } Shouldn't that be IFCOUNTER_ODROPS? -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Wed Aug 17 00:36:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F675BBA62D; Wed, 17 Aug 2016 00:36:56 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74C2D1D57; Wed, 17 Aug 2016 00:36:56 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id h186so32307519pfg.3; Tue, 16 Aug 2016 17:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EyvcQuKITxGeDJX45pDLL64gXT3PjBY5tFqIMT74s4U=; b=NKq+Gq5GzrcUg8/7JYbgP96Bz0/rkO4TTUAqRF1MYAy2EMNjwjAki1a6xBCf6bf5pg ok4rrw4LDU+j8YSkEEQbTkVbKNx+mwWxSrR5nDeqeTEXFoIJdh0PDHMBsVOYgBVNPwRq yAscGIWotvCefotawZaMer95/FOYUjYhVKZ3ljn2YWmKKwVnKYkAuR/+boSpuhyy80Aw pDeHnmz7lqY22kvM0U+E44ijRAIbe0Zd8r/AvBzQ/Lci6kTzz7cavFcmOEDn4DhxDgPI IsgvGYz7wNmygDlVFghGliC4YIoW5YKXoLt/YJOJegu7dcgnmh/p8SJCacfL/1NxWsI2 4lPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=EyvcQuKITxGeDJX45pDLL64gXT3PjBY5tFqIMT74s4U=; b=RGV3VD1gk9+N8A+WOMGR+kcpwvvVUB1IR9sMGR1UZWgSZiH7dTS/JE9dno+of48Pfq yb+1YhpY4+aAKFRSrhULtz8+yP/b5+wIuf6QAtJOYokkjXOlNEQlIPM+haK6qi2JRXa8 lRglkgRvyC+w1XFnES8bULPaAREj6jg3VJ/zgSd2Xxytq5MRqIeLxFgGZ62jxx6KZVzs kZEFe+yyD6aqPNrT/JScwUFKfzRZtpQjz18N+5MIOZofQjBX8mUQxcfCklkzM2A8mzDq E52Ky7tRRzFq+p9ufyEUl5oMo+VrzVDuOQcQ4Ep4EBAA9yI/HI9hGMRV9YkUp8PTA6ff pRfw== X-Gm-Message-State: AEkoouswwd/BszYHh4WIfcJtB8wN1nWTuOjua92Knb0IjLW42TF7clrMGT40wOJDdjhZAw== X-Received: by 10.98.103.214 with SMTP id t83mr69306515pfj.158.1471394215614; Tue, 16 Aug 2016 17:36:55 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id q26sm42046071pfj.53.2016.08.16.17.36.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Aug 2016 17:36:55 -0700 (PDT) Sender: Mark Johnston Date: Tue, 16 Aug 2016 17:41:28 -0700 From: Mark Johnston To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303646 - head/sys/ofed/drivers/infiniband/ulp/ipoib Message-ID: <20160817004128.GB94062@wkstn-mjohnston.west.isilon.com> References: <201608012222.u71MMB4E018482@repo.freebsd.org> <20160817000953.GB1069@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160817000953.GB1069@FreeBSD.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 00:36:56 -0000 On Tue, Aug 16, 2016 at 05:09:53PM -0700, Gleb Smirnoff wrote: > Mark, > > On Mon, Aug 01, 2016 at 10:22:11PM +0000, Mark Johnston wrote: > M> Author: markj > M> Date: Mon Aug 1 22:22:11 2016 > M> New Revision: 303646 > M> URL: https://svnweb.freebsd.org/changeset/base/303646 > M> > M> Log: > M> ipoib: Bound the number of egress mbufs buffered during pathrec lookups. > M> > M> In pathological situations where the master subnet manager becomes > M> unresponsive for an extended period, we may otherwise end up queuing all > M> of the system's mbufs while waiting for a response to a path record lookup. > M> > M> This addresses the same issue as commit 1e85b806f9 in Linux. > M> > M> Reviewed by: cem, ngie > M> MFC after: 2 weeks > M> Sponsored by: EMC / Isilon Storage Division > M> > M> Modified: > M> head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c > M> > M> Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c > M> ============================================================================== > M> --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 1 22:19:23 2016 (r303645) > M> +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 1 22:22:11 2016 (r303646) > M> @@ -660,7 +660,13 @@ ipoib_unicast_send(struct mbuf *mb, stru > M> new_path = 1; > M> } > M> if (path) { > M> - _IF_ENQUEUE(&path->queue, mb); > M> + if (_IF_QLEN(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) > M> + _IF_ENQUEUE(&path->queue, mb); > M> + else { > M> + if_inc_counter(priv->dev, IFCOUNTER_OERRORS, 1); > M> + m_freem(mb); > M> + } > > Shouldn't that be IFCOUNTER_ODROPS? I'm not sure. I used IFCOUNTER_OERRORS to be consistent with other error cases in this function. This error case doesn't represent the normal source of outbound packet drops but rather indicates that a key routing agent on the network is not responding. OQDROPS seems like it's specifically for the case that we can't buffer packets because the transmitter isn't keeping up. From owner-svn-src-head@freebsd.org Wed Aug 17 01:24:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72316BBC589; Wed, 17 Aug 2016 01:24:35 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 357EA15C5; Wed, 17 Aug 2016 01:24:35 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H1OYjT070591; Wed, 17 Aug 2016 01:24:34 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H1OYXQ070590; Wed, 17 Aug 2016 01:24:34 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201608170124.u7H1OYXQ070590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 17 Aug 2016 01:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304246 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 01:24:35 -0000 Author: vangyzen Date: Wed Aug 17 01:24:34 2016 New Revision: 304246 URL: https://svnweb.freebsd.org/changeset/base/304246 Log: PCIe HotPlug: Detect bridges that are not really HotPlug capable Some devices report that they have an MRL when they actually do not. Since they always report that the MRL is open, child devices would be ignored. Try to detect these devices and ignore their claim of HotPlug support. Specifically, if there is an open MRL but the Data Link Layer is active, the MRL is not real. Revert r303645 to re-enable HotPlug support for slots with power controllers, since it works correctly in my testing. Start the DLL state-change timer if Presence /or/ MRL state changes, along with other conditions. Previously, we started the timer iff Presence changed. If there is an MRL, it must be closed for power to be turned on, so Presence is unlikely to change on an MRL-close event. Add a printf() of interesting registers on HotPlug interrupts and commands (one from erj@). These were very useful for debugging. Guard them with bootverbose, since they're spam in normal operation. In collaboration with: jhb Reviewed by: jhb MFC after: 1 day Relnotes: yes (re-enable HotPlug support for slots with power controllers) Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D7509 Modified: head/sys/dev/pci/pci_pci.c Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Tue Aug 16 23:00:22 2016 (r304245) +++ head/sys/dev/pci/pci_pci.c Wed Aug 17 01:24:34 2016 (r304246) @@ -918,6 +918,7 @@ static void pcib_probe_hotplug(struct pcib_softc *sc) { device_t dev; + uint16_t link_sta, slot_sta; if (!pci_enable_pcie_hp) return; @@ -932,15 +933,29 @@ pcib_probe_hotplug(struct pcib_softc *sc sc->pcie_link_cap = pcie_read_config(dev, PCIER_LINK_CAP, 4); sc->pcie_slot_cap = pcie_read_config(dev, PCIER_SLOT_CAP, 4); + if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC) == 0) + return; + /* - * XXX: Handling of slots with a power controller needs to be - * reexamined. Ignore hotplug on such slots for now. + * Some devices report that they have an MRL when they actually + * do not. Since they always report that the MRL is open, child + * devices would be ignored. Try to detect these devices and + * ignore their claim of HotPlug support. + * + * If there is an open MRL but the Data Link Layer is active, + * the MRL is not real. */ - if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_PCP) - return; - - if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC) - sc->flags |= PCIB_HOTPLUG; + if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_MRLSP) != 0 && + (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) != 0) { + link_sta = pcie_read_config(dev, PCIER_LINK_STA, 2); + slot_sta = pcie_read_config(dev, PCIER_SLOT_STA, 2); + if ((slot_sta & PCIEM_SLOT_STA_MRLSS) != 0 && + (link_sta & PCIEM_LINK_STA_DL_ACTIVE) != 0) { + return; + } + } + + sc->flags |= PCIB_HOTPLUG; } /* @@ -966,6 +981,8 @@ pcib_pcie_hotplug_command(struct pcib_so new = (ctl & ~mask) | val; if (new == ctl) return; + if (bootverbose) + device_printf(dev, "HotPlug command: %04x -> %04x\n", ctl, new); pcie_write_config(dev, PCIER_SLOT_CTL, new, 2); if (!(sc->pcie_slot_cap & PCIEM_SLOT_CAP_NCCS) && (ctl & new) & PCIEM_SLOT_CTL_CCIE) { @@ -1028,9 +1045,6 @@ pcib_hotplug_inserted(struct pcib_softc static int pcib_hotplug_present(struct pcib_softc *sc) { - device_t dev; - - dev = sc->dev; /* Card must be inserted. */ if (!pcib_hotplug_inserted(sc)) @@ -1059,7 +1073,7 @@ pcib_pcie_hotplug_update(struct pcib_sof { bool card_inserted, ei_engaged; - /* Clear DETACHING if Present Detect has cleared. */ + /* Clear DETACHING if Presence Detect has cleared. */ if ((sc->pcie_slot_sta & (PCIEM_SLOT_STA_PDC | PCIEM_SLOT_STA_PDS)) == PCIEM_SLOT_STA_PDC) sc->flags &= ~PCIB_DETACHING; @@ -1101,14 +1115,15 @@ pcib_pcie_hotplug_update(struct pcib_sof /* * Start a timer to see if the Data Link Layer times out. - * Note that we only start the timer if Presence Detect + * Note that we only start the timer if Presence Detect or MRL Sensor * changed on this interrupt. Stop any scheduled timer if * the Data Link Layer is active. */ if (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) { if (card_inserted && !(sc->pcie_link_sta & PCIEM_LINK_STA_DL_ACTIVE) && - sc->pcie_slot_sta & PCIEM_SLOT_STA_PDC) { + sc->pcie_slot_sta & + (PCIEM_SLOT_STA_MRLSC | PCIEM_SLOT_STA_PDC)) { if (cold) device_printf(sc->dev, "Data Link Layer inactive\n"); @@ -1144,6 +1159,10 @@ pcib_pcie_intr(void *arg) /* Clear the events just reported. */ pcie_write_config(dev, PCIER_SLOT_STA, sc->pcie_slot_sta, 2); + if (bootverbose) + device_printf(dev, "HotPlug interrupt: %#x\n", + sc->pcie_slot_sta); + if (sc->pcie_slot_sta & PCIEM_SLOT_STA_ABP) { if (sc->flags & PCIB_DETACH_PENDING) { device_printf(dev, @@ -1165,7 +1184,7 @@ pcib_pcie_intr(void *arg) sc->pcie_slot_sta & PCIEM_SLOT_STA_MRLSS ? "open" : "closed"); if (bootverbose && sc->pcie_slot_sta & PCIEM_SLOT_STA_PDC) - device_printf(dev, "Present Detect Changed to %s\n", + device_printf(dev, "Presence Detect Changed to %s\n", sc->pcie_slot_sta & PCIEM_SLOT_STA_PDS ? "card present" : "empty"); if (sc->pcie_slot_sta & PCIEM_SLOT_STA_CC) @@ -1234,7 +1253,7 @@ pcib_pcie_cc_timeout(void *arg) sta = pcie_read_config(dev, PCIER_SLOT_STA, 2); if (!(sta & PCIEM_SLOT_STA_CC)) { device_printf(dev, - "Hotplug Command Timed Out - forcing detach\n"); + "HotPlug Command Timed Out - forcing detach\n"); sc->flags &= ~(PCIB_HOTPLUG_CMD_PENDING | PCIB_DETACH_PENDING); sc->flags |= PCIB_DETACHING; pcib_pcie_hotplug_update(sc, 0, 0, true); From owner-svn-src-head@freebsd.org Wed Aug 17 01:56:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 836BEBBCD9F; Wed, 17 Aug 2016 01:56:39 +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 F1CDB133D; Wed, 17 Aug 2016 01:56:38 +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 u7H1ucK6081927; Wed, 17 Aug 2016 01:56:38 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H1ubw8081923; Wed, 17 Aug 2016 01:56:37 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201608170156.u7H1ubw8081923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 17 Aug 2016 01:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304247 - head/sys/dev/qlxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 01:56:39 -0000 Author: davidcs Date: Wed Aug 17 01:56:37 2016 New Revision: 304247 URL: https://svnweb.freebsd.org/changeset/base/304247 Log: Upgrade fw, bootloader and minidump template to version 5.4.58 Add minidump retrieval code MFC after: 5 days Modified: head/sys/dev/qlxgbe/ql_boot.c head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_fw.c head/sys/dev/qlxgbe/ql_glbl.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_ioctl.c head/sys/dev/qlxgbe/ql_ioctl.h head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_minidump.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_reset.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_boot.c ============================================================================== --- head/sys/dev/qlxgbe/ql_boot.c Wed Aug 17 01:24:34 2016 (r304246) +++ head/sys/dev/qlxgbe/ql_boot.c Wed Aug 17 01:56:37 2016 (r304247) @@ -34,14 +34,14 @@ __FBSDID("$FreeBSD$"); #include "ql_os.h" unsigned int ql83xx_bootloader_version_major = 5; -unsigned int ql83xx_bootloader_version_minor = 2; -unsigned int ql83xx_bootloader_version_sub = 7; +unsigned int ql83xx_bootloader_version_minor = 4; +unsigned int ql83xx_bootloader_version_sub = 58; unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x04, 0x00, 0x80, 0x82, 0x05, 0x1f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0xc0, 0x81, 0x05, 0x1f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1e, 0x02, 0x21, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, @@ -1384,7 +1384,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x81, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x14, 0xe0, 0x11, 0x20, 0xa2, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbb, 0x11, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x40, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x02, 0x00, 0x80, 0x40, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0b, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, @@ -1421,14 +1421,14 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x11, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x02, 0x16, 0x04, 0x00, 0x00, 0x00, 0x60, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x49, 0x07, + 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x49, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa2, 0x07, 0x00, 0x00, 0x26, 0x00, 0xe0, 0x04, 0x00, 0xa0, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x80, 0x01, 0xa0, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x40, 0x00, 0x00, 0x0c, 0x1c, 0x00, 0x00, 0x00, 0x40, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x00, 0x5e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfe, 0x1f, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, @@ -1535,7 +1535,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x20, 0x50, 0x00, 0x02, 0x00, 0x00, 0x00, 0x60, 0x52, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb8, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, + 0xb5, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0xa0, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1589,7 +1589,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x14, 0x7c, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb5, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x40, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0xa0, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, @@ -1624,7 +1624,7 @@ unsigned char ql83xx_bootloader[] = { 0x04, 0x00, 0x00, 0x00, 0x0e, 0x04, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x08, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x38, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x35, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x4c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x08, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x8d, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x4c, 0x01, @@ -1739,13 +1739,13 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x05, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x04, 0x00, 0x00, 0x40, 0x14, 0x00, 0x00, 0x00, 0xa8, 0x22, 0x00, 0x40, 0x02, 0x00, 0xa0, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0a, 0x17, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x17, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x07, 0x17, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x07, 0x17, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x0d, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x08, 0x00, 0x00, 0x00, 0x04, 0x07, 0x00, 0x00, 0x00, 0x20, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x08, 0x00, 0x00, 0x40, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x17, 0x7c, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x17, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x20, 0x50, 0x04, 0x00, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x00, 0xe0, 0x33, 0x00, 0x00, 0x02, 0x00, 0xa0, @@ -1803,8 +1803,8 @@ unsigned char ql83xx_bootloader[] = { 0x0e, 0x1e, 0x00, 0x00, 0x00, 0x80, 0x31, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x10, 0x00, 0x80, 0x40, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xb8, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0x38, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0xb5, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x35, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0xf8, 0x0e, 0x00, 0xe0, 0x01, 0xa0, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x06, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x01, 0x00, @@ -1827,8 +1827,8 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x20, 0x50, 0x04, 0x01, 0x8d, 0x02, 0x32, 0x04, 0x1b, 0x08, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x80, 0x01, 0xa0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5f, 0x19, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x19, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x5c, 0x19, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x19, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x0d, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x08, 0x00, 0x85, 0x01, 0x40, 0x06, 0x00, 0x00, 0x00, 0x78, 0x38, 0x04, 0x00, 0x82, 0x01, 0xa0, 0x00, 0x00, 0x84, 0x02, @@ -1988,7 +1988,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x29, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xa5, 0x03, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc3, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x18, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x80, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, @@ -2104,7 +2104,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x40, 0x00, 0x80, 0x40, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xd2, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0xcf, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, @@ -2119,7 +2119,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xd3, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, + 0xd0, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -2135,7 +2135,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x4d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x0a, 0x00, 0x80, 0x01, 0xa0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xd5, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc1, 0x01, + 0xd2, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x08, 0x05, 0x00, 0x40, 0x16, 0x00, 0x00, @@ -2196,7 +2196,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x02, 0x00, 0xe0, 0x01, 0xa0, 0x00, 0x10, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xd3, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x80, 0xd0, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, @@ -2209,7 +2209,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd7, 0x15, 0x7c, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x4c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, @@ -2903,7 +2903,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xd9, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc1, 0x02, + 0xd6, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x08, 0x05, 0x00, 0x40, 0x16, 0x00, 0x00, @@ -3097,7 +3097,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x08, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x78, 0x00, 0x00, 0xe0, 0x01, 0xa0, - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xda, 0x15, 0x7c, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xd7, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x41, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x78, 0x00, 0x00, 0xe0, 0x01, 0xa0, @@ -3147,7 +3147,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdc, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, + 0xd9, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -3264,7 +3264,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x2d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xde, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0xdb, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x08, 0x09, 0x00, @@ -3313,7 +3313,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x80, 0x01, 0xa0, 0x00, 0x0a, 0x0c, 0x03, 0x08, 0x92, 0x20, 0x0b, 0x00, 0x08, 0xf8, 0x08, 0x00, 0x82, 0x01, 0xa0, 0x80, 0x00, 0xcc, 0x02, 0x06, 0x0f, 0x00, 0x00, 0x00, 0x08, 0xf8, 0x09, 0x00, 0x82, 0x01, 0xa0, - 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x15, 0x7c, 0x00, + 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbd, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x8c, 0x00, 0x42, 0x03, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x0a, 0xe0, 0x82, 0x01, 0xa0, 0x0a, 0x94, 0xa0, 0x01, 0xa0, 0x7b, 0x10, 0x80, 0x01, 0x13, 0xe8, 0x00, 0xb0, 0x02, 0x40, 0x81, @@ -3329,7 +3329,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x02, 0x00, 0xa0, 0x00, 0x00, 0x7a, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x20, 0x50, 0x00, 0x01, 0x00, 0xc0, 0x41, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x15, 0x7c, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbd, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x40, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x08, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x01, 0x00, 0xc0, 0x01, 0x00, 0xa0, @@ -3361,18 +3361,18 @@ unsigned char ql83xx_bootloader[] = { 0xe0, 0x04, 0x00, 0xa0, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0x15, 0x7c, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xdd, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x41, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x08, 0x09, 0x00, 0x40, 0x16, 0x00, 0x00, 0x00, 0xd8, 0x78, 0x00, 0x00, 0xe2, 0x01, 0xa0, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xe2, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x01, 0x01, + 0xdf, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9b, 0x0a, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x78, 0x00, 0x00, 0xe0, 0x01, 0xa0, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xe2, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x80, 0xdf, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x4c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, @@ -3683,7 +3683,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xe4, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x0c, 0x03, + 0xe1, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -3707,7 +3707,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xe6, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x81, 0x01, + 0xe3, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x08, 0x09, 0x00, 0x40, 0x16, 0x00, 0x00, @@ -3888,7 +3888,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xe8, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0xe5, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x4c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x41, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, @@ -4067,7 +4067,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0xcd, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x0a, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xea, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, + 0xe7, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -4143,7 +4143,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xeb, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc1, 0x00, + 0xe8, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x08, 0x09, 0x00, 0x40, 0x16, 0x00, 0x00, @@ -4373,7 +4373,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xed, 0x15, 0x7c, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xea, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, @@ -4448,7 +4448,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xef, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0xec, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x08, 0x05, 0x00, @@ -5093,17 +5093,17 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x08, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x0b, 0x20, 0x80, 0x01, 0xa0, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xd0, 0x15, 0x7c, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xcd, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, - 0xd4, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x20, 0x00, 0x0d, 0x01, + 0xd1, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x20, 0x00, 0x0d, 0x01, 0x40, 0x0a, 0x00, 0x00, 0x00, 0x08, 0xf8, 0x08, 0x00, 0x82, 0x01, 0xa0, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x08, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfb, 0x0b, 0x00, 0x80, 0x01, 0xa0, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf9, 0x15, 0x7c, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfd, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x08, + 0xfa, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x08, 0x20, 0x0f, 0x07, 0x04, 0x00, 0x00, 0x00, 0x02, 0x88, 0xc3, 0x01, 0x81, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -5773,7 +5773,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25, 0x10, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x16, 0x7c, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x10, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, @@ -5800,7 +5800,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x5a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0x02, 0x16, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x80, 0xff, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x10, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x01, 0x00, @@ -5840,7 +5840,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x10, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x38, 0x00, 0x00, 0xe0, 0x01, 0xa0, 0x00, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0x04, 0x16, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x80, 0x01, 0x16, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x45, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x10, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x01, 0x00, @@ -7047,7 +7047,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x20, 0x50, 0x80, 0x00, 0xcd, 0x41, 0x40, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x07, 0x16, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x04, 0x00, 0x00, + 0x04, 0x16, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x85, 0x0a, 0x00, 0x00, 0x34, 0x00, 0x20, 0x04, 0x00, 0xa0, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x80, 0x01, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x60, 0x08, 0x00, 0x04, @@ -7103,11 +7103,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x80, 0x00, 0x00, 0x0e, 0x1e, 0x00, 0x00, - 0x00, 0x00, 0x31, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x80, 0x00, 0x00, - 0x2e, 0x1e, 0x00, 0x00, 0x00, 0x80, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, - 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x70, 0x00, 0x80, 0x00, 0x00, 0x0e, 0x1e, 0x00, 0x00, - 0x00, 0x80, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x31, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x30, 0x07, 0x77, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x61, 0x0e, 0xee, 0x00, 0x00, 0x00, 0x00, @@ -10957,8 +10953,12 @@ unsigned char ql83xx_bootloader[] = { 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, - 0x02, 0x00, 0x40, 0x40, 0x05, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, + 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, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x02, 0x00, 0x40, 0x40, 0x05, 0x04, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc7, 0xf8, 0x13, 0xc6 + 0x00, 0x00, 0x00, 0x00, 0x93, 0x37, 0x14, 0x77 }; unsigned int ql83xx_bootloader_len = 131072; Modified: head/sys/dev/qlxgbe/ql_def.h ============================================================================== --- head/sys/dev/qlxgbe/ql_def.h Wed Aug 17 01:24:34 2016 (r304246) +++ head/sys/dev/qlxgbe/ql_def.h Wed Aug 17 01:56:37 2016 (r304247) @@ -119,11 +119,11 @@ typedef struct _qla_tx_ring { struct qla_host { volatile struct { volatile uint32_t + qla_interface_up :1, qla_callout_init :1, qla_watchdog_active :1, qla_watchdog_exit :1, qla_watchdog_pause :1, - lro_init :1, stop_rcv :1, parent_tag :1, lock_init :1; Modified: head/sys/dev/qlxgbe/ql_fw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_fw.c Wed Aug 17 01:24:34 2016 (r304246) +++ head/sys/dev/qlxgbe/ql_fw.c Wed Aug 17 01:56:37 2016 (r304247) @@ -35,32 +35,32 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_firmware_version_major = 5; unsigned int ql83xx_firmware_version_minor = 4; -unsigned int ql83xx_firmware_version_sub = 56; +unsigned int ql83xx_firmware_version_sub = 58; unsigned char ql83xx_firmware[] = { - 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x60, 0x44, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x65, 0x29, 0xa5, 0xc3, 0x36, 0x3d, 0x7d, 0x98, + 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xa4, 0x58, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xa8, 0xde, 0x79, 0x42, 0x73, 0xa8, 0x26, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x3e, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xea, 0x03, 0x00, + 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0xef, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x2c, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x40, 0x11, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf3, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xf7, 0x8e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x2e, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x9b, 0x4e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, 0xf9, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x4a, 0x9a, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x42, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xcf, 0x4e, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xe7, 0x82, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x77, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x65, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x83, 0x93, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x75, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x23, 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, @@ -69,127 +69,127 @@ unsigned char ql83xx_firmware[] = { 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, 0x00, 0x00, 0x5e, 0x8d, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7e, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x65, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf8, 0x9d, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7e, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x40, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdc, 0xa2, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x76, 0xb3, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0xa7, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x92, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xf8, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x38, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0xb8, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x93, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x38, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3e, 0xba, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x36, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x66, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xd0, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xd5, 0xca, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf7, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x7c, 0x66, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x60, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x74, 0xd8, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0b, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xcc, 0xe9, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf1, 0x0b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x23, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0xe4, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xb7, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xb4, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xf5, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xbb, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x17, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x11, 0xeb, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x77, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x66, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x78, 0xfc, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x71, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x6a, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x88, 0x0e, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0b, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe9, 0x1f, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x94, 0x19, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x89, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x54, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x55, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x2a, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xa4, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x55, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1d, 0x36, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2a, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x67, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x76, 0x47, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x26, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x1a, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x47, 0x3f, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9c, 0x50, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x16, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x47, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xe0, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x58, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x51, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x30, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xad, 0x4a, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x28, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x67, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x5c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x26, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x04, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xd5, 0x4c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x0a, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x27, 0x5e, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcb, 0x0a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x29, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, 0x57, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, 0x68, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb6, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x1c, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x6d, 0x00, 0x00, + 0x00, 0x6c, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x6d, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x55, 0x78, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x81, 0x9e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xa8, 0x89, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2b, 0xa1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x06, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xd6, 0x16, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xd3, 0x2a, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x90, 0x17, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x45, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0xd1, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x8d, 0x2b, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x4d, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xd1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x05, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0c, 0x8c, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x8c, 0x8c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x0c, 0x8c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xd5, 0x3c, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x8c, 0x8c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xda, 0x50, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x58, 0xe0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -232,9 +232,9 @@ unsigned char ql83xx_firmware[] = { 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, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x46, 0x1a, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x25, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xcc, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xae, 0x05, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x5a, 0x1a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x63, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x14, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xb0, 0x05, 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, @@ -250,143091 +250,143498 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xda, 0xec, 0x3d, 0x6d, 0x70, 0x5c, 0xd5, 0x75, 0xf7, 0x7d, 0xec, 0xee, 0xd3, 0x6a, 0x57, - 0x5a, 0x1b, 0xd9, 0x11, 0x42, 0xd4, 0xcf, 0xc6, 0xd8, 0xe2, 0x23, 0xcc, - 0xb3, 0x31, 0x8e, 0x31, 0x6e, 0x78, 0x92, 0x65, 0xc7, 0x36, 0x12, 0xa8, - 0xa1, 0x01, 0xf3, 0x11, 0x10, 0x69, 0x43, 0x04, 0x21, 0x58, 0x74, 0xa0, - 0x23, 0x13, 0x0f, 0x7e, 0xb2, 0x25, 0xd9, 0x80, 0x9c, 0xc8, 0xd8, 0x71, - 0x1c, 0x42, 0x61, 0x25, 0xdb, 0x94, 0xb4, 0xb4, 0x5d, 0x26, 0x1f, 0x65, - 0xda, 0xce, 0xb0, 0xb6, 0x33, 0xb1, 0x21, 0x78, 0xe2, 0xfc, 0xa0, 0x0d, - 0xe9, 0xd0, 0x6c, 0x27, 0x4d, 0x47, 0x25, 0x40, 0x37, 0xed, 0x94, 0xc8, - 0xa4, 0x86, 0xde, 0xef, 0xf7, 0xee, 0xdd, 0xf7, 0xde, 0xee, 0x95, 0x65, - 0x67, 0xd2, 0xb1, 0x32, 0x13, 0x74, 0x7c, 0xef, 0x39, 0xef, 0xdc, 0x73, - 0xcf, 0x3d, 0xe7, 0xdc, 0x73, 0xce, 0x7b, 0x02, 0x1a, 0x20, 0x3f, 0x26, - 0x30, 0x80, 0x0e, 0xee, 0x01, 0xe7, 0xe1, 0xdf, 0x4d, 0x98, 0xfc, 0xf4, - 0x52, 0xf8, 0xe4, 0xdb, 0x6f, 0xe1, 0xff, 0x7d, 0xa9, 0x02, 0x16, 0x7f, - 0x0a, 0x12, 0x9c, 0x57, 0x84, 0x3d, 0x1d, 0xd8, 0xf8, 0x97, 0x3d, 0x29, - 0xfc, 0x9f, 0xfe, 0x8a, 0xf9, 0x1a, 0xf0, 0xdc, 0x5c, 0x00, 0xa6, 0xbf, - 0xdb, 0xf9, 0x0c, 0xe1, 0x17, 0x14, 0x0d, 0xc6, 0x3a, 0x00, 0x75, 0x79, - 0x93, 0x00, 0x3d, 0xb7, 0x93, 0x9f, 0xfb, 0xa3, 0x9e, 0xb7, 0x0e, 0x44, - 0x3c, 0x4f, 0x11, 0x66, 0xf4, 0x4e, 0xcc, 0x30, 0xbd, 0x85, 0xda, 0xcc, - 0xd2, 0x5b, 0x3a, 0xc3, 0xf4, 0x36, 0xe9, 0xd3, 0xa3, 0xc7, 0xf0, 0xef, - 0x30, 0xa7, 0x85, 0x1f, 0xa2, 0x6f, 0x8e, 0x87, 0x48, 0x5d, 0xb6, 0xf4, - 0xae, 0xf5, 0xb3, 0xc0, 0xd0, 0xd7, 0x20, 0x49, 0x04, 0x9f, 0x6c, 0x1b, - 0x7a, 0xe3, 0xb5, 0x2e, 0x2d, 0xb7, 0x1b, 0xa2, 0x20, 0x38, 0xff, 0xc0, - 0xc5, 0xab, 0x56, 0x02, 0x3c, 0x5e, 0x66, 0xe3, 0xef, 0x3c, 0xa8, 0xe5, - 0xe1, 0xb8, 0x33, 0x88, 0xf0, 0xef, 0xbf, 0xf9, 0xd8, 0x55, 0x97, 0x10, - 0xfc, 0x41, 0x3a, 0xde, 0xb0, 0x5b, 0x73, 0x9e, 0x82, 0xf8, 0x83, 0x8c, - 0xfe, 0x8f, 0x09, 0xfe, 0xa0, 0x48, 0xdf, 0xd9, 0x06, 0xe1, 0x9e, 0xf5, - 0x57, 0x25, 0x2e, 0xfb, 0x38, 0xc1, 0xdf, 0x46, 0xc7, 0x3f, 0xfd, 0x86, - 0xd6, 0xb3, 0x07, 0xe2, 0x23, 0xb8, 0x77, 0xe5, 0xed, 0xcf, 0x3f, 0x90, - 0x24, 0xf8, 0x6c, 0xfc, 0xe1, 0x5f, 0x6b, 0xbd, 0x63, 0x10, 0x7f, 0x3b, - 0xa7, 0xaf, 0x61, 0xfc, 0xed, 0x12, 0xff, 0x08, 0xce, 0xbf, 0xf2, 0xab, - 0x85, 0xcb, 0x2d, 0x82, 0xcf, 0xc6, 0x5f, 0xbe, 0x0e, 0xf4, 0xa0, 0xe7, - 0x0f, 0x41, 0xb8, 0x3f, 0x77, 0xcc, 0x6d, 0x22, 0xeb, 0xeb, 0x1f, 0xa2, - 0xe3, 0x3f, 0xfd, 0xec, 0x63, 0x16, 0xa4, 0x5f, 0x40, 0x70, 0x6f, 0x66, - 0xc4, 0xc9, 0xb5, 0x10, 0x7c, 0x36, 0xbe, 0xea, 0x73, 0x8f, 0xed, 0x44, - 0xcf, 0x1f, 0x46, 0xfc, 0x5b, 0x6b, 0xec, 0x0c, 0x5d, 0xff, 0x30, 0x1d, - 0xef, 0x18, 0x7a, 0xcc, 0x42, 0xcf, 0x47, 0xb0, 0x6b, 0x9a, 0x39, 0x2b, - 0x43, 0xf0, 0xd9, 0xf8, 0x1f, 0x3f, 0xff, 0xd8, 0x4e, 0xf4, 0xfc, 0x11, - 0xd3, 0xdf, 0x0f, 0x48, 0xaf, 0x5f, 0x82, 0x0b, 0x12, 0x5c, 0x96, 0x60, - 0x67, 0x87, 0x84, 0x2f, 0xc1, 0x05, 0x09, 0x2e, 0x4b, 0xb0, 0xb3, 0x13, - 0xf1, 0xd7, 0xb4, 0xf6, 0x9e, 0x56, 0x3b, 0x77, 0xcd, 0xd3, 0x10, 0x1f, - 0xc1, 0x79, 0xe7, 0x73, 0xe6, 0x15, 0x9b, 0xb6, 0xa2, 0xf5, 0x15, 0x10, - 0xdc, 0xd3, 0xbc, 0xe3, 0xa1, 0xa6, 0xcb, 0xf0, 0x78, 0x99, 0x8d, 0x77, - 0xef, 0xde, 0x8a, 0xd6, 0xe7, 0x3c, 0x8e, 0xe4, 0xd3, 0x7a, 0x44, 0x33, - 0x97, 0x12, 0xfc, 0xc7, 0xe9, 0xf8, 0xa6, 0x6f, 0x6f, 0x45, 0xeb, 0x2b, - 0x20, 0xb8, 0xbf, 0x55, 0xcb, 0x59, 0xd7, 0x11, 0x7c, 0x36, 0xbe, 0xfb, - 0x8d, 0xad, 0x16, 0xd4, 0x0f, 0xe7, 0x09, 0xc2, 0xcf, 0xa2, 0x56, 0x9b, - 0xf0, 0x8f, 0xe1, 0xfa, 0x0c, 0xb0, 0xba, 0xef, 0xc1, 0xfc, 0xd3, 0xf1, - 0x65, 0x74, 0xbc, 0x8c, 0xe1, 0x27, 0x35, 0x36, 0xee, 0x3c, 0x29, 0xad, - 0x5f, 0x82, 0x0b, 0x12, 0x5c, 0x96, 0x60, 0x67, 0x54, 0xc2, 0x97, 0xe0, - 0x82, 0x04, 0x97, 0x25, 0xd8, 0xd9, 0x25, 0xe1, 0x4b, 0x70, 0x41, 0x82, - 0xcb, 0x12, 0xec, 0x7c, 0x45, 0xc2, 0x97, 0xe0, 0x82, 0x04, 0x97, 0x25, - 0xd8, 0xf9, 0xaa, 0x84, 0x2f, 0xc1, 0x05, 0x09, 0x2e, 0x4b, 0xb0, 0xe3, - 0x42, 0xd8, 0xeb, 0x7b, 0x27, 0xc9, 0xf0, 0x11, 0x5c, 0xba, 0xe4, 0xa7, - 0x7f, 0xca, 0xf0, 0x11, 0x5c, 0xfc, 0xe0, 0xf8, 0x88, 0x41, 0xf1, 0x11, - 0x9c, 0x7f, 0xe9, 0xc3, 0xf7, 0x29, 0xec, 0xb4, 0x43, 0x38, 0xb7, 0xeb, - 0x9a, 0x3a, 0x97, 0xe2, 0x23, 0xb8, 0xbf, 0xf3, 0x92, 0xcd, 0x14, 0x2e, - 0x20, 0xb8, 0x67, 0xde, 0xee, 0x5d, 0xab, 0x29, 0x3e, 0x82, 0x9d, 0x7f, - 0xdc, 0x71, 0x9a, 0xc2, 0x4e, 0x87, 0xc4, 0xbf, 0x04, 0x17, 0x24, 0xb8, - 0x2c, 0xc1, 0xce, 0x6a, 0x09, 0x5f, 0x82, 0x0b, 0x12, 0x5c, 0x96, 0x60, - 0xa7, 0x53, 0xc2, 0x97, 0xe0, 0x82, 0x04, 0x97, 0x25, 0xd8, 0x59, 0x23, - 0xe1, 0x4b, 0x70, 0x41, 0x82, 0xcb, 0x12, 0xec, 0xac, 0x95, 0xf0, 0x25, - 0xb8, 0x20, 0xc1, 0x65, 0x09, 0x76, 0x3e, 0x25, 0xe1, 0x4b, 0x70, 0x41, - 0x82, 0xcb, 0x12, 0xec, 0xac, 0x43, 0xfb, 0xf3, 0x99, 0x37, 0xd8, 0x7e, - 0xf6, 0x23, 0xf8, 0xe4, 0x23, 0x6f, 0x31, 0xb8, 0x80, 0xc7, 0xf7, 0xfd, - 0x82, 0xc1, 0x65, 0x3c, 0xfe, 0xbd, 0x77, 0xf9, 0xfe, 0xaf, 0x47, 0xe7, - 0xff, 0xba, 0xbf, 0x3c, 0xcd, 0xf0, 0x31, 0x7c, 0xc7, 0x77, 0x18, 0x5c, - 0xc0, 0xf0, 0x97, 0x87, 0x19, 0x5c, 0x46, 0x70, 0xf9, 0xb9, 0xaf, 0x30, - 0xd8, 0xd9, 0x80, 0xe0, 0x57, 0xc6, 0x38, 0x3e, 0x86, 0x7f, 0xf6, 0x0d, - 0x8e, 0x8f, 0x60, 0x30, 0x6b, 0xc1, 0x29, 0x86, 0x8f, 0xe0, 0xb1, 0x6b, - 0xae, 0x60, 0xb0, 0x73, 0x03, 0x84, 0xed, 0x0e, 0x93, 0xc1, 0xfd, 0x08, - 0x2e, 0xdc, 0x9b, 0x65, 0x70, 0x01, 0xc1, 0xee, 0xce, 0x1c, 0xc7, 0x47, - 0xf0, 0xc9, 0x17, 0x2f, 0xe4, 0xf8, 0x5d, 0x88, 0x7e, 0xf1, 0x18, 0x5f, - 0x7f, 0x17, 0x91, 0x4f, 0x99, 0xe1, 0x4b, 0x70, 0x59, 0x82, 0x9d, 0x6e, - 0x11, 0xee, 0x97, 0xe0, 0x82, 0x04, 0x97, 0x25, 0xd8, 0xb9, 0x51, 0xc2, - 0x97, 0xe0, 0x82, 0x04, 0x97, 0x25, 0xd8, 0xb9, 0x49, 0xc2, 0x97, 0xe0, - 0x82, 0x04, 0x97, 0x25, 0x58, 0x8c, 0xef, 0x2a, 0xe3, 0x83, 0x59, 0x41, - 0xb8, 0x6a, 0xbc, 0x61, 0xb3, 0xdf, 0x34, 0x1a, 0x54, 0xd2, 0x87, 0x35, - 0x6a, 0x3c, 0xc8, 0xac, 0x12, 0xaf, 0xf4, 0x6b, 0x6e, 0x40, 0x3f, 0x09, - 0xbd, 0x44, 0x02, 0xda, 0x7f, 0x14, 0x73, 0xc3, 0xf1, 0xdb, 0x13, 0x74, - 0xec, 0xc3, 0x79, 0xc0, 0xee, 0xa9, 0x4e, 0x4f, 0x8d, 0x7f, 0x7a, 0x36, - 0x4a, 0x1f, 0x91, 0x9f, 0x4d, 0xea, 0xf1, 0xd4, 0x8c, 0xc2, 0x85, 0xea, - 0xfb, 0xa3, 0x06, 0xd3, 0xf5, 0x95, 0x23, 0xd6, 0x57, 0xf5, 0x79, 0x55, - 0xf0, 0xab, 0xde, 0x57, 0x14, 0x9f, 0xe7, 0x71, 0x5b, 0xe5, 0x32, 0xfd, - 0xc9, 0xd2, 0xfb, 0x4a, 0x1f, 0x1c, 0xd5, 0xf8, 0x7d, 0x06, 0x00, 0x0b, - 0x8f, 0xfb, 0xc6, 0xd9, 0x06, 0xfb, 0x8f, 0x6a, 0x83, 0x20, 0x57, 0x04, - 0x56, 0x33, 0x99, 0x6f, 0x6f, 0x83, 0xf3, 0xc1, 0x95, 0x3a, 0x25, 0xfd, - 0x51, 0xb8, 0xfe, 0x64, 0x44, 0xfa, 0xe0, 0x75, 0x3a, 0x34, 0x49, 0xe1, - 0xdf, 0xee, 0xfe, 0x55, 0x93, 0xd7, 0x79, 0xf8, 0xcc, 0xce, 0xff, 0xd9, - 0x87, 0x67, 0x96, 0x1f, 0x1b, 0x48, 0xf9, 0x07, 0xf8, 0x0f, 0x9f, 0x6c, - 0x09, 0xcc, 0xa7, 0xf6, 0x97, 0x8f, 0x83, 0xef, 0x03, 0x51, 0xbf, 0x73, - 0x19, 0x11, 0x46, 0x27, 0x2a, 0x09, 0xfc, 0x73, 0x05, 0x91, 0xd2, 0xce, - 0x50, 0x47, 0x7b, 0x1b, 0x91, 0x2f, 0xa4, 0x9f, 0x6e, 0x21, 0xe7, 0xcb, - 0xd6, 0x83, 0xf6, 0xd8, 0x3b, 0x7d, 0x36, 0xec, 0x71, 0x75, 0xb8, 0x31, - 0x00, 0xd6, 0xf2, 0x7c, 0x36, 0xdf, 0x6b, 0x50, 0x9b, 0x0f, 0x2e, 0x56, - 0xa4, 0x7f, 0x85, 0x22, 0xfd, 0x95, 0x8a, 0xf4, 0xd7, 0x29, 0xd2, 0xbf, - 0x55, 0x91, 0xfe, 0xe7, 0x15, 0xe9, 0x3f, 0xac, 0x48, 0x7f, 0x9b, 0x22, - 0xfd, 0xdd, 0x8a, 0xf4, 0x9f, 0x53, 0xa4, 0xff, 0xd7, 0x8a, 0xf4, 0xff, - 0x41, 0x91, 0xfe, 0x0f, 0x15, 0xe9, 0xbf, 0xa9, 0x48, 0x7f, 0x52, 0x91, - 0xfe, 0xfb, 0x8a, 0xf4, 0x13, 0x9a, 0x1a, 0xfd, 0x0b, 0xd4, 0xe6, 0x83, - 0x05, 0x8a, 0xf4, 0x1d, 0x45, 0xfa, 0xd7, 0x2b, 0xd2, 0xef, 0x56, 0xa4, - 0x7f, 0xa7, 0x22, 0xfd, 0xfb, 0x15, 0xe9, 0x6f, 0x56, 0xa4, 0xbf, 0x43, - 0x91, 0xfe, 0x3e, 0x45, 0xfa, 0x07, 0x15, 0xe9, 0x7f, 0x5b, 0x91, 0xfe, - 0x61, 0x45, 0xfa, 0x27, 0x15, 0xe9, 0xff, 0x8b, 0x22, 0xfd, 0x77, 0x15, - 0xe9, 0xff, 0x46, 0x91, 0x7e, 0x5a, 0x57, 0xa3, 0xdf, 0xac, 0x36, 0x1f, - 0x2c, 0x56, 0xa4, 0x7f, 0x8d, 0x22, 0xfd, 0x4e, 0x45, 0xfa, 0x9f, 0x56, - 0xa4, 0x7f, 0x8f, 0x22, 0xfd, 0x4d, 0x8a, 0xf4, 0x1f, 0x53, 0xa4, 0x3f, - 0xaa, 0x48, 0xff, 0x9b, 0x8a, 0xf4, 0xbf, 0xa5, 0x48, 0xff, 0x65, 0x45, - 0xfa, 0x3f, 0x50, 0xa4, 0xff, 0x86, 0x22, 0xfd, 0x9f, 0x2b, 0xd2, 0xff, - 0x2f, 0x45, 0xfa, 0xc0, 0x50, 0xa3, 0xdf, 0xa8, 0x36, 0xdf, 0xbb, 0x58, - 0x91, 0xfe, 0x95, 0x8a, 0xf4, 0x57, 0x2a, 0xd2, 0x5f, 0xaf, 0x48, 0xff, - 0x56, 0x45, 0xfa, 0xf7, 0x2a, 0xd2, 0x7f, 0x58, 0x91, 0xfe, 0x76, 0x45, - 0xfa, 0xbb, 0x15, 0xe9, 0xe7, 0x8d, 0x73, 0x71, 0xff, 0xf0, 0xba, 0xc1, - 0x55, 0xbf, 0x87, 0x7e, 0xfd, 0xe5, 0xf5, 0x00, 0xe7, 0x13, 0x4e, 0xd0, - 0x0a, 0x70, 0x5f, 0x82, 0xdc, 0x9f, 0xb2, 0x34, 0xbf, 0x30, 0x69, 0x22, - 0x98, 0xd5, 0xeb, 0x0e, 0xf4, 0xb0, 0xe7, 0xed, 0x62, 0xf9, 0x05, 0x93, - 0xce, 0x67, 0xf7, 0x31, 0x0d, 0x0c, 0x6a, 0x79, 0x72, 0xed, 0x7a, 0x1a, - 0xde, 0xda, 0x16, 0x81, 0x92, 0xe9, 0xd7, 0x6b, 0xf3, 0xee, 0xb5, 0xf8, - 0x2a, 0x06, 0xff, 0xa9, 0xa9, 0xcd, 0x00, 0xad, 0x88, 0x95, 0xfc, 0x51, - 0x6d, 0x90, 0xd7, 0x03, 0xc7, 0x09, 0x7d, 0x0b, 0x68, 0xc0, 0x45, 0xa9, - 0xfc, 0x8d, 0x03, 0x80, 0xf0, 0x27, 0xf2, 0xcf, 0xe6, 0x1f, 0x7e, 0x38, - 0x7c, 0xfd, 0xb6, 0x05, 0x80, 0x9b, 0xb6, 0xeb, 0xc1, 0xd4, 0x27, 0x40, - 0x29, 0x05, 0x0e, 0x00, 0x9d, 0xe6, 0x7b, 0x3e, 0x81, 0x13, 0x30, 0xbd, - 0xfc, 0x82, 0xdd, 0xe6, 0x52, 0x7e, 0xdc, 0x39, 0x90, 0x9f, 0x67, 0x7e, - 0xb0, 0xb0, 0x39, 0xb9, 0xa4, 0x69, 0xc4, 0xb3, 0xc0, 0xae, 0xc1, 0x3d, - 0xb8, 0x94, 0x30, 0x69, 0x04, 0xd7, 0xcf, 0xf8, 0x03, 0x5a, 0xf7, 0x51, - 0x52, 0x8f, 0xee, 0xd3, 0xf1, 0xfa, 0x5d, 0x76, 0xc7, 0xc4, 0x72, 0xe8, - 0x45, 0x59, 0x1c, 0xcc, 0xbf, 0xe5, 0x00, 0xf8, 0x6c, 0x96, 0x6f, 0x02, - 0xb7, 0xd0, 0x7a, 0xb5, 0xb5, 0x7d, 0xbc, 0x1e, 0x29, 0xc7, 0x7c, 0xaa, - 0x24, 0x95, 0xf4, 0xeb, 0x8e, 0x50, 0xfa, 0x42, 0x7e, 0xe8, 0x1e, 0x4a, - 0x1f, 0x2d, 0xc7, 0xd5, 0x2b, 0xe9, 0xdf, 0x4a, 0xe9, 0xa7, 0x07, 0xc7, - 0x11, 0x0b, 0xde, 0x65, 0x91, 0xf4, 0x35, 0x91, 0xbe, 0x9b, 0x3d, 0x32, - 0xbf, 0x95, 0xee, 0x1f, 0x84, 0xad, 0x0a, 0xf9, 0x90, 0x9f, 0x8d, 0x94, - 0x7e, 0x05, 0x3d, 0xae, 0x0f, 0x93, 0x14, 0x7f, 0x97, 0x81, 0xd7, 0x4f, - 0xe9, 0xb1, 0xf9, 0x7f, 0x43, 0xe7, 0x9b, 0x12, 0x7d, 0x00, 0x46, 0x59, - 0xf8, 0x8f, 0xe5, 0xed, 0x82, 0xd7, 0x35, 0x17, 0x3d, 0xaa, 0xf9, 0x01, - 0x1d, 0xe5, 0xbb, 0x28, 0x3f, 0xde, 0x6d, 0xac, 0xde, 0x8f, 0xf7, 0x73, - 0xa4, 0x0e, 0xe5, 0x53, 0xbd, 0x04, 0x54, 0xa2, 0xf6, 0xee, 0x23, 0x5a, - 0x2b, 0xdc, 0xf5, 0xa9, 0x4d, 0x46, 0x69, 0x58, 0x1b, 0xbf, 0xf3, 0x46, - 0xcf, 0x2c, 0x81, 0x15, 0xba, 0x06, 0x5e, 0x48, 0xbc, 0x06, 0xc0, 0x0e, - 0xb8, 0x5f, 0x47, 0xb2, 0x39, 0x9f, 0xbf, 0x4a, 0xfe, 0x99, 0xbe, 0xb3, - 0xf5, 0x9f, 0xd0, 0x56, 0x85, 0xf0, 0x7f, 0x87, 0xc8, 0xbf, 0xf7, 0x59, - 0xc6, 0x0f, 0xd2, 0xb7, 0xb9, 0x88, 0x5f, 0xb2, 0x1f, 0x88, 0xdf, 0x24, - 0xea, 0x65, 0x38, 0x4e, 0x60, 0x00, 0x56, 0xa4, 0x28, 0x4a, 0x32, 0xfc, - 0xbe, 0xc2, 0xcf, 0x9f, 0x46, 0xce, 0x53, 0x17, 0x3b, 0x5f, 0x58, 0x1e, - 0x4c, 0x5e, 0x77, 0x47, 0xc8, 0xdf, 0x02, 0xdd, 0x06, 0xe1, 0x97, 0xac, - 0x8f, 0xf1, 0xb7, 0x26, 0x72, 0xbe, 0x28, 0x4f, 0xae, 0xaf, 0xd2, 0xf9, - 0x9a, 0x9d, 0x10, 0xd6, 0xdb, 0xa3, 0x91, 0x44, 0x4c, 0xaf, 0x9f, 0x5f, - 0x9c, 0xd4, 0xc3, 0xf2, 0x89, 0x48, 0xd4, 0x2e, 0x22, 0xba, 0x7f, 0x01, - 0x5d, 0x7f, 0x17, 0x63, 0x29, 0x51, 0xcb, 0x7d, 0x2d, 0x42, 0xde, 0xe0, - 0x8f, 0x28, 0xbf, 0x67, 0x7b, 0x7d, 0x16, 0xb4, 0x67, 0x58, 0x9e, 0x53, - 0x9b, 0xe3, 0xf6, 0x1f, 0xdc, 0xcb, 0xfb, 0x4f, 0xc2, 0xf9, 0x3f, 0xd0, - 0x40, 0xe6, 0xa3, 0x59, 0xab, 0x4c, 0xdb, 0x40, 0xfa, 0x5a, 0x4a, 0x80, - 0x71, 0x62, 0x2f, 0x26, 0x1a, 0xb8, 0x7d, 0x04, 0x0d, 0x80, 0x1f, 0x55, - 0x05, 0xf9, 0xbc, 0x05, 0x7c, 0x7e, 0x50, 0x41, 0x13, 0xb4, 0x31, 0x7d, - 0xe3, 0xe7, 0x49, 0x0f, 0xf2, 0xbf, 0x39, 0x5d, 0x9b, 0xbf, 0x60, 0xf3, - 0xef, 0xae, 0x57, 0x9b, 0x2f, 0x9f, 0x8f, 0xbe, 0x2a, 0xf2, 0x59, 0x78, - 0x86, 0xf4, 0xef, 0xe3, 0xf4, 0xbb, 0xd8, 0x7a, 0x13, 0xe1, 0xf9, 0xed, - 0x51, 0xc9, 0x5f, 0x79, 0x26, 0x8c, 0xa4, 0x50, 0x49, 0x4d, 0x7b, 0xf9, - 0x28, 0x18, 0xac, 0xf0, 0xa7, 0xd0, 0x41, 0x34, 0x60, 0xff, 0x78, 0x09, - 0x95, 0xa7, 0x4c, 0xcf, 0x0c, 0x94, 0x1f, 0x2b, 0xea, 0x4f, 0x01, 0xff, - 0x7a, 0x0a, 0xfb, 0x57, 0x1b, 0xee, 0xaa, 0x3b, 0x7b, 0x6f, 0x02, 0xd8, - 0x0e, 0x28, 0xa6, 0xe0, 0xfe, 0x83, 0xdb, 0xa8, 0x36, 0x7a, 0x4d, 0x68, - 0xbf, 0x3d, 0x70, 0xa2, 0xdd, 0x6d, 0x08, 0x9c, 0x7f, 0xaa, 0xc0, 0x3f, - 0xfa, 0x73, 0xba, 0x3e, 0xfc, 0xb4, 0xe1, 0x34, 0xd2, 0x1f, 0x3b, 0xe0, - 0x4f, 0xc1, 0x7e, 0x64, 0xbe, 0x09, 0x7f, 0x50, 0x69, 0xcd, 0xda, 0xf3, - 0xc9, 0x17, 0xc4, 0xc6, 0x0f, 0xfc, 0xbc, 0xfc, 0x64, 0x51, 0xe8, 0xfa, - 0xd9, 0x7e, 0x78, 0x77, 0x27, 0x85, 0xf3, 0xe0, 0x01, 0xd7, 0x08, 0xfa, - 0x0b, 0xdd, 0x5b, 0x6b, 0x04, 0xcf, 0x27, 0x9b, 0x4f, 0x97, 0x57, 0xf8, - 0xd2, 0x45, 0x20, 0x54, 0x3f, 0xd8, 0x2f, 0xcf, 0xe8, 0xb5, 0xf1, 0x17, - 0xcd, 0x4f, 0xbb, 0x71, 0x76, 0xe9, 0x77, 0x9c, 0x65, 0xfa, 0xab, 0xcf, - 0x32, 0xfd, 0x1b, 0xe8, 0xfe, 0x80, 0x62, 0xbb, 0x1e, 0x17, 0x3f, 0xbe, - 0x2e, 0xf9, 0xa7, 0xa8, 0xf3, 0xb2, 0x24, 0xfc, 0xbc, 0xb0, 0xf3, 0xe0, - 0xbe, 0x23, 0xc5, 0x9b, 0x93, 0x29, 0x44, 0x2f, 0x07, 0xfd, 0x2f, 0xf6, - 0x17, 0xcd, 0x9b, 0x52, 0xc5, 0x6d, 0xbe, 0xbd, 0x3a, 0x7c, 0x33, 0xb3, - 0x9f, 0xbb, 0x8c, 0x86, 0xe4, 0x10, 0xb4, 0x65, 0xa7, 0x93, 0xf9, 0x11, - 0x88, 0x8f, 0x79, 0x9d, 0xa8, 0xf3, 0xed, 0x67, 0x9d, 0x16, 0xf4, 0x2f, - 0x08, 0x7b, 0x69, 0x5a, 0x38, 0xff, 0xcc, 0xbf, 0x27, 0x41, 0x89, 0x9c, - 0x2f, 0xec, 0xaf, 0xa7, 0xae, 0x26, 0xfc, 0x42, 0x7b, 0xbc, 0xe8, 0x62, - 0x84, 0x4e, 0xf9, 0x67, 0xfd, 0x90, 0x63, 0x06, 0xaa, 0x01, 0xc3, 0xf3, - 0xba, 0x31, 0xde, 0x3e, 0xd3, 0xf8, 0xcf, 0x5d, 0x7d, 0xad, 0xa0, 0xcf, - 0xdf, 0xe3, 0xfb, 0xf3, 0x38, 0x8b, 0xa7, 0xb3, 0xc1, 0x78, 0x91, 0xcd, - 0xa7, 0xe7, 0xa1, 0x3f, 0x35, 0xbe, 0x90, 0xe2, 0xbf, 0x0a, 0x84, 0xf9, - 0xe0, 0xb8, 0x16, 0x84, 0x99, 0xfd, 0xf3, 0x1e, 0x32, 0x04, 0xff, 0xc7, - 0xe4, 0x65, 0x81, 0x57, 0xb5, 0x06, 0xb4, 0xd5, 0xde, 0x29, 0x12, 0x3f, - 0x63, 0x7b, 0x31, 0x91, 0xf1, 0xe5, 0x95, 0x11, 0xe4, 0x85, 0x98, 0x5b, - 0x21, 0xec, 0x3f, 0x8f, 0x3f, 0x88, 0xbc, 0xb0, 0xfd, 0xf2, 0xe5, 0x85, - 0xd8, 0x5f, 0x90, 0x0d, 0xc8, 0x0b, 0x2d, 0x20, 0x7f, 0x63, 0xbd, 0x8f, - 0x7f, 0x91, 0x92, 0x3f, 0x63, 0xbf, 0x1c, 0xe7, 0xf2, 0x5a, 0xcf, 0xe2, - 0x8b, 0x06, 0xbc, 0x7e, 0xda, 0xb7, 0x98, 0x3a, 0xcc, 0xe4, 0x53, 0xa7, - 0x07, 0xc7, 0xd1, 0xe3, 0xc9, 0x7a, 0x97, 0x08, 0xfa, 0xce, 0xe4, 0x41, - 0xe5, 0xe5, 0x32, 0x79, 0x11, 0x4b, 0x39, 0x91, 0xf6, 0xe5, 0x91, 0xae, - 0xd0, 0x9f, 0x65, 0xe9, 0x50, 0xfd, 0x27, 0xf2, 0x80, 0xf2, 0x74, 0x9b, - 0x7d, 0x79, 0x20, 0xf1, 0xb6, 0xd5, 0x05, 0xe4, 0x41, 0xd7, 0xf1, 0xbc, - 0xc9, 0xf0, 0x6f, 0x9b, 0x96, 0x3c, 0xde, 0xe4, 0xf2, 0x78, 0x95, 0x3d, - 0xbf, 0x81, 0xc4, 0xc7, 0x54, 0x1e, 0x2f, 0x31, 0x79, 0x3c, 0x2e, 0x8c, - 0xd7, 0x28, 0x0f, 0x30, 0xc4, 0xe4, 0x81, 0x15, 0x70, 0xa2, 0xde, 0x97, - 0x47, 0x7d, 0x85, 0x7e, 0x2c, 0x8f, 0xd3, 0x0f, 0x38, 0x1b, 0xdf, 0x27, - 0xd8, 0x79, 0x42, 0xcd, 0x2c, 0x73, 0x02, 0xf2, 0x60, 0xfe, 0xea, 0x05, - 0x14, 0x8e, 0xa0, 0xf3, 0xd4, 0x3a, 0x2d, 0x79, 0xfc, 0xb2, 0x42, 0x3f, - 0xfa, 0x1a, 0x89, 0xfd, 0xa0, 0xf1, 0x66, 0x33, 0x5c, 0xa7, 0xc1, 0xe4, - 0x3f, 0x04, 0x77, 0xc4, 0x41, 0x71, 0x11, 0xc4, 0x5f, 0xaf, 0x07, 0xe7, - 0xd7, 0xaa, 0x2f, 0xb5, 0xca, 0x07, 0x61, 0x2f, 0x17, 0xed, 0x8d, 0xa0, - 0x2f, 0xdc, 0x1e, 0x33, 0xf9, 0xe0, 0xd1, 0x3d, 0x16, 0xe2, 0x0f, 0xa0, - 0x78, 0x10, 0x46, 0x25, 0xbb, 0x9b, 0x82, 0xf8, 0xb7, 0x4f, 0x4b, 0x3e, - 0xff, 0xeb, 0xdb, 0x1b, 0xf6, 0xfc, 0x5c, 0xe0, 0xfe, 0x68, 0x1b, 0x16, - 0xf3, 0xb7, 0x75, 0x46, 0x70, 0xbc, 0x46, 0x79, 0x78, 0x5c, 0x1e, 0x78, - 0x78, 0x22, 0xeb, 0xcb, 0x23, 0x5b, 0xa1, 0x2f, 0x2b, 0x45, 0x7d, 0x89, - 0xb5, 0xbf, 0x28, 0x40, 0x59, 0xd4, 0x28, 0xd9, 0x5f, 0xfb, 0x26, 0xcb, - 0xc7, 0x6f, 0x9e, 0x96, 0x3c, 0x68, 0x97, 0x45, 0xbf, 0xbf, 0xff, 0x93, - 0x8d, 0x81, 0xfb, 0x6d, 0xce, 0x97, 0x07, 0xb7, 0xb7, 0x8d, 0x61, 0xf1, - 0x23, 0x93, 0xc7, 0xc4, 0x67, 0x22, 0xf2, 0x0d, 0x64, 0x34, 0xc1, 0xe4, - 0x41, 0xe5, 0x55, 0x1c, 0x8c, 0xb4, 0xcf, 0xeb, 0x89, 0x7d, 0x2e, 0x6e, - 0xa6, 0xf9, 0x0d, 0xa6, 0x2f, 0x93, 0xc1, 0xfb, 0x9e, 0x17, 0x89, 0xaf, - 0xa1, 0xfd, 0x1a, 0xb1, 0x40, 0x71, 0x09, 0x2a, 0x73, 0x8f, 0x07, 0xee, - 0x63, 0x18, 0x1f, 0x4d, 0x77, 0x5b, 0x44, 0xfb, 0x74, 0x79, 0x9d, 0xef, - 0x9f, 0xf7, 0xd1, 0x70, 0x39, 0x09, 0x56, 0x2c, 0xdb, 0x6b, 0x80, 0x1d, - 0xfd, 0xae, 0xc1, 0x17, 0xe3, 0xea, 0x1a, 0x8c, 0x87, 0x41, 0xab, 0x9d, - 0xdd, 0x1e, 0x15, 0x4f, 0xe6, 0xb7, 0x41, 0x4f, 0xe2, 0x2e, 0xb7, 0x53, - 0xb9, 0x2c, 0xaa, 0xa0, 0x83, 0x83, 0xfa, 0xe1, 0xf1, 0xad, 0xf0, 0xdf, - 0x9b, 0x0e, 0x3f, 0x84, 0x05, 0x3a, 0xdc, 0x64, 0xbf, 0x40, 0x94, 0xc1, - 0xba, 0x92, 0xe0, 0xdb, 0x2c, 0x5e, 0x85, 0x0f, 0xc7, 0xf1, 0x2a, 0xcb, - 0x17, 0xc1, 0xd3, 0x1a, 0xba, 0x9f, 0x74, 0xdc, 0x1d, 0x10, 0xee, 0xb3, - 0xab, 0xa9, 0xbf, 0x64, 0xf2, 0xd8, 0x2b, 0xdd, 0xf7, 0xf4, 0xc0, 0x7d, - 0x2f, 0xa8, 0xcf, 0xcc, 0xfe, 0x74, 0xae, 0xbe, 0x36, 0x78, 0x7f, 0x74, - 0x99, 0x7c, 0x01, 0x77, 0xf8, 0x03, 0x20, 0x78, 0x5f, 0x62, 0xf2, 0x86, - 0xe7, 0x85, 0x6a, 0xcc, 0xc0, 0x2c, 0xdf, 0x1f, 0x4d, 0x58, 0xbe, 0xfe, - 0x5b, 0x15, 0xf6, 0xc0, 0x89, 0xb1, 0x07, 0xdc, 0x5e, 0x31, 0x7b, 0x80, - 0xb5, 0x73, 0x6f, 0x5d, 0xd0, 0x1e, 0xec, 0x99, 0x01, 0x7b, 0xb0, 0xca, - 0x90, 0xed, 0xc1, 0x24, 0xe1, 0x9f, 0xad, 0x67, 0xff, 0xa9, 0x59, 0x0a, - 0xe7, 0xbf, 0xb8, 0xa3, 0xba, 0x3d, 0x4c, 0xd6, 0xe4, 0x2f, 0xaa, 0xf2, - 0x7f, 0x31, 0xfb, 0xdd, 0x0c, 0x5b, 0xaf, 0x87, 0xfc, 0x4d, 0xc1, 0x4e, - 0xa1, 0xfb, 0x14, 0x89, 0x37, 0x07, 0x92, 0xd3, 0x91, 0xcf, 0x8d, 0x46, - 0x85, 0x3f, 0xd1, 0x04, 0xf9, 0xe4, 0x06, 0x28, 0x6c, 0x49, 0xf1, 0xaf, - 0x44, 0x8f, 0xac, 0xd5, 0x33, 0x58, 0x7e, 0x02, 0xc7, 0x07, 0x30, 0x5e, - 0xb5, 0x1c, 0x60, 0x27, 0x91, 0x3f, 0xcc, 0x7a, 0x16, 0xf2, 0x87, 0xf6, - 0xbb, 0x54, 0x9f, 0x5d, 0x0d, 0xe5, 0x3f, 0x47, 0xc0, 0xd4, 0xf5, 0x97, - 0xc3, 0xfb, 0xa7, 0x0b, 0xba, 0xf5, 0x15, 0x58, 0xe5, 0x1f, 0xd4, 0x4a, - 0xd0, 0x1e, 0x40, 0x6b, 0xb7, 0xbf, 0xcb, 0x04, 0xcf, 0x3c, 0xb2, 0x87, - 0xe4, 0x47, 0x11, 0x66, 0xaf, 0x75, 0x20, 0x81, 0x48, 0x6f, 0x0c, 0xc9, - 0x97, 0xc2, 0x78, 0x9a, 0xd9, 0x57, 0x3d, 0x78, 0x5e, 0x9e, 0x8c, 0xb4, - 0x3f, 0xd2, 0xf9, 0x50, 0xb6, 0xe7, 0x99, 0x58, 0xff, 0x8f, 0x7e, 0xb5, - 0xe5, 0x78, 0xc8, 0xeb, 0xaa, 0xf3, 0xf1, 0x2f, 0x9c, 0x96, 0x3e, 0xdf, - 0xc7, 0xf7, 0x8b, 0xfb, 0xaf, 0x26, 0x61, 0xbf, 0x06, 0x06, 0x9a, 0x54, - 0xf4, 0xf9, 0xc9, 0xaa, 0xf1, 0x60, 0x94, 0x7d, 0x12, 0xcf, 0x73, 0x14, - 0xbf, 0x0f, 0x57, 0x9e, 0x3f, 0x91, 0x5f, 0x30, 0xa5, 0xc2, 0x2f, 0x18, - 0xad, 0x7a, 0xfe, 0xa2, 0xf8, 0xad, 0xed, 0xfc, 0x6d, 0xad, 0x3c, 0x0f, - 0x73, 0x44, 0x7e, 0x07, 0xe6, 0xc4, 0xf9, 0x47, 0xbf, 0x3e, 0x10, 0x61, - 0xcf, 0xc1, 0x7b, 0x58, 0xff, 0x89, 0x43, 0x99, 0x48, 0x31, 0xfe, 0x99, - 0xfd, 0x66, 0xe7, 0xa7, 0x85, 0xe8, 0x7f, 0xab, 0x06, 0xed, 0x31, 0xce, - 0xdf, 0x42, 0x03, 0xdd, 0xdb, 0x90, 0x42, 0x2d, 0xfe, 0x89, 0x15, 0xe4, - 0x3c, 0x9c, 0x24, 0xfd, 0x5d, 0x96, 0x0d, 0x92, 0x36, 0x08, 0x39, 0x0f, - 0x5a, 0xf0, 0x3c, 0x20, 0xf5, 0x6b, 0x40, 0xff, 0x97, 0x5f, 0xc2, 0xe3, - 0x0d, 0x64, 0x82, 0x99, 0x3c, 0x73, 0xa0, 0x1b, 0xac, 0xb2, 0x02, 0xf9, - 0x23, 0x2d, 0xab, 0xd1, 0xfc, 0x78, 0x52, 0xea, 0x9f, 0x4c, 0x84, 0xf9, - 0x07, 0xb2, 0x3f, 0xcf, 0xe9, 0xfe, 0x7e, 0x04, 0xe4, 0xed, 0xc5, 0xdd, - 0xbf, 0xd8, 0x7e, 0xb1, 0x76, 0xe0, 0xa9, 0xb9, 0xe4, 0x79, 0x3c, 0x1e, - 0xa8, 0xd1, 0x5e, 0x0e, 0xb3, 0xf9, 0x73, 0x59, 0xfe, 0x28, 0x8d, 0xe2, - 0x2b, 0x97, 0xd8, 0xc7, 0x1c, 0x1a, 0xcd, 0xd9, 0x26, 0xb0, 0x96, 0x11, - 0x7b, 0x04, 0xd6, 0xb1, 0x7c, 0xf4, 0xa9, 0x79, 0x24, 0xff, 0x04, 0x79, - 0x4f, 0xa5, 0x90, 0x1d, 0x75, 0x87, 0x90, 0x3e, 0xd2, 0xfc, 0xa7, 0xfb, - 0x80, 0x66, 0xc7, 0xec, 0xf7, 0x5e, 0x29, 0x1f, 0x7a, 0x94, 0xdf, 0x7f, - 0x77, 0xb2, 0x7a, 0x10, 0x40, 0xfc, 0xb3, 0xf9, 0x1f, 0xbb, 0x45, 0xf4, - 0xd7, 0xff, 0xcc, 0xe7, 0xb3, 0xfc, 0x5d, 0x9f, 0x45, 0xd6, 0x1f, 0xc0, - 0x27, 0xf2, 0x30, 0xb8, 0x3c, 0x08, 0x3f, 0x29, 0x92, 0xbf, 0x2b, 0xc5, - 0xe7, 0xef, 0xdc, 0x85, 0xc4, 0xfe, 0xb0, 0xfc, 0x43, 0xf1, 0x14, 0xcd, - 0x3f, 0x64, 0x05, 0x7b, 0xe9, 0xe7, 0xdf, 0xc4, 0x7c, 0xe9, 0xd3, 0x3d, - 0xe1, 0xf5, 0x0d, 0xd9, 0xff, 0xb3, 0xf5, 0xa4, 0x23, 0xf2, 0xd1, 0x4c, - 0x3e, 0xf5, 0x52, 0xfe, 0x3a, 0x53, 0x25, 0x7f, 0x9d, 0xa5, 0xe3, 0x39, - 0x96, 0x2c, 0x94, 0xf0, 0xe7, 0x04, 0xe2, 0x1d, 0x2c, 0xdf, 0xc8, 0xfa, - 0x4c, 0x56, 0x13, 0xeb, 0x1b, 0xe1, 0xf9, 0xf0, 0x63, 0x3d, 0x62, 0xbc, - 0x9f, 0xd6, 0xe7, 0x9a, 0x71, 0xf9, 0x73, 0x69, 0x7e, 0x51, 0x71, 0x3e, - 0xa8, 0xa7, 0xf3, 0xd9, 0xf3, 0x66, 0x53, 0x58, 0x9e, 0x4f, 0xd7, 0x57, - 0x7a, 0x74, 0xfc, 0xbd, 0x44, 0x5c, 0x3e, 0xf9, 0x9f, 0xee, 0x50, 0xcb, - 0x27, 0x7f, 0xfe, 0x4f, 0x6a, 0xad, 0x9f, 0xf2, 0xf8, 0x4e, 0x29, 0x3f, - 0xbf, 0xd1, 0x56, 0xe3, 0x67, 0x42, 0x57, 0x9b, 0xff, 0xee, 0x2a, 0x55, - 0xfe, 0xc3, 0xe3, 0x29, 0x5e, 0x3f, 0x90, 0xe8, 0xf7, 0xdd, 0x21, 0xc8, - 0x1f, 0x14, 0xed, 0x6c, 0x6c, 0xbe, 0xf6, 0x17, 0x46, 0x38, 0x3f, 0xb5, - 0xd2, 0xcf, 0xcf, 0xcb, 0xc6, 0xd6, 0x0b, 0xf6, 0x3c, 0xa2, 0xbc, 0xde, - 0x94, 0xca, 0x7e, 0x15, 0x6e, 0x17, 0xf5, 0xd3, 0xae, 0xc2, 0xcf, 0x6f, - 0x34, 0xb5, 0xfd, 0xfa, 0xd7, 0xfd, 0x22, 0xfd, 0x6a, 0xf2, 0x4c, 0x9b, - 0x6a, 0xf4, 0xaf, 0x8f, 0xac, 0xef, 0xd4, 0x4b, 0xf5, 0x0a, 0xe6, 0x8f, - 0x49, 0x7d, 0x8b, 0xdd, 0x8f, 0x4a, 0x1f, 0x5e, 0x48, 0xfc, 0xef, 0x1e, - 0x1b, 0x67, 0x73, 0x3f, 0x35, 0xbf, 0x4f, 0x0b, 0xbb, 0xff, 0xc9, 0xf5, - 0xdc, 0x0c, 0x3b, 0xef, 0xf0, 0x72, 0xe7, 0x2a, 0xac, 0xbf, 0xda, 0x7e, - 0x77, 0xfc, 0x81, 0xda, 0xfa, 0x6f, 0xda, 0x57, 0x25, 0x1f, 0x0e, 0x96, - 0xc4, 0xe5, 0xc3, 0xe1, 0xb5, 0x82, 0xd4, 0x2f, 0x6a, 0x9f, 0xdf, 0x2e, - 0xce, 0x2f, 0x3b, 0xb1, 0xf3, 0x01, 0x98, 0xaf, 0x64, 0x1f, 0x35, 0x6a, - 0x0f, 0xa3, 0xd6, 0x7b, 0xe5, 0x32, 0x35, 0xf9, 0x2c, 0x6e, 0x14, 0xe9, - 0x37, 0xdd, 0xa9, 0xc5, 0xca, 0xff, 0x47, 0x4b, 0xaa, 0x9c, 0xe7, 0xbc, - 0xb8, 0xde, 0xad, 0xf5, 0xe2, 0x79, 0xbe, 0x75, 0x0b, 0xe0, 0xfe, 0x0a, - 0xcf, 0xef, 0x15, 0xe7, 0x8f, 0x49, 0xf3, 0x1b, 0x8e, 0x19, 0xb1, 0xfc, - 0x3c, 0x71, 0xb5, 0xda, 0x7a, 0x6f, 0xa9, 0x53, 0x9b, 0xff, 0xfe, 0x05, - 0x6a, 0xf3, 0xb7, 0xaf, 0x52, 0x9b, 0xff, 0xf7, 0x8a, 0xf5, 0xce, 0x53, - 0x59, 0x45, 0xff, 0xb1, 0x46, 0x6d, 0xfe, 0x86, 0x9b, 0xa6, 0xd7, 0x3f, - 0xc4, 0xf0, 0xdf, 0xbc, 0x41, 0xed, 0x79, 0x5f, 0xf8, 0xa1, 0xa1, 0x76, - 0x9e, 0x7f, 0xac, 0x36, 0xff, 0xd8, 0x6b, 0x6a, 0xf3, 0xbf, 0xfb, 0x49, - 0x35, 0xfe, 0xbf, 0xf5, 0xac, 0x1a, 0xfd, 0x6d, 0x8a, 0xf6, 0x7b, 0x22, - 0x19, 0x3e, 0x5f, 0x07, 0xa3, 0x47, 0x49, 0x7d, 0x8e, 0xc6, 0x9f, 0x20, - 0x23, 0xc4, 0xaf, 0x7e, 0x7d, 0x82, 0xf5, 0x63, 0x44, 0xc4, 0xc3, 0xc5, - 0x25, 0x62, 0x3c, 0xec, 0xb2, 0x78, 0x58, 0xac, 0x67, 0x07, 0xe2, 0x61, - 0x2d, 0xee, 0xbe, 0xf7, 0x9f, 0x16, 0xa5, 0xef, 0xa2, 0xf8, 0x78, 0x2f, - 0xc4, 0x18, 0xd0, 0x8a, 0xc3, 0xda, 0x78, 0xd4, 0xfc, 0x46, 0xc5, 0xf3, - 0xf8, 0x6f, 0x49, 0xa9, 0xbf, 0x41, 0x75, 0xbe, 0xe5, 0xc4, 0xd6, 0xaf, - 0x0f, 0xd7, 0xfc, 0xfd, 0x89, 0x86, 0x69, 0xc5, 0x7f, 0x7f, 0x11, 0x11, - 0x0f, 0xf1, 0x4a, 0x3d, 0x8d, 0xd7, 0x51, 0x3d, 0x27, 0x83, 0xce, 0x3a, - 0xed, 0x1f, 0xc2, 0xfe, 0xd8, 0x4d, 0x66, 0x82, 0xf4, 0x55, 0xea, 0xfb, - 0x3a, 0xb8, 0x3a, 0xb6, 0xbe, 0x5f, 0x59, 0xef, 0x1d, 0x95, 0xf2, 0x5f, - 0x5c, 0x9f, 0xc2, 0xf3, 0x5d, 0x92, 0x7e, 0x99, 0x54, 0xbf, 0x72, 0xed, - 0xd5, 0xea, 0xbf, 0x54, 0xdf, 0x72, 0xac, 0x20, 0xc7, 0xfc, 0xff, 0x2e, - 0xe1, 0xf9, 0x5e, 0xc7, 0x09, 0xcd, 0x6d, 0xbd, 0x30, 0x35, 0x66, 0x92, - 0xe7, 0xbb, 0xc0, 0x25, 0xfd, 0x60, 0x53, 0x9b, 0x40, 0xe9, 0x00, 0xa9, - 0x47, 0xea, 0xb3, 0x71, 0x84, 0x46, 0xdf, 0xdf, 0xba, 0x8f, 0x25, 0xb0, - 0xc9, 0xfb, 0x90, 0x3d, 0x50, 0x23, 0x71, 0x89, 0x49, 0xf3, 0xbc, 0x59, - 0xb6, 0x5f, 0x6f, 0x40, 0xfb, 0xa2, 0x83, 0x71, 0x96, 0x8f, 0x76, 0x07, - 0x59, 0x3f, 0x5d, 0xce, 0xc2, 0xfd, 0x74, 0x88, 0xfe, 0xf6, 0xf9, 0xe3, - 0x68, 0x7e, 0x72, 0x6e, 0x90, 0xfe, 0x45, 0x22, 0xfd, 0x5e, 0xe0, 0x8d, - 0x22, 0xfa, 0xae, 0xe6, 0xe5, 0x11, 0xfd, 0x6a, 0xfd, 0x20, 0xa1, 0xf9, - 0xc2, 0x2e, 0x9c, 0xef, 0xb5, 0x49, 0xfd, 0x9a, 0x6d, 0x65, 0x7d, 0x98, - 0x7e, 0xd1, 0x7a, 0x5f, 0xf9, 0x23, 0x9d, 0xd5, 0x2b, 0xbe, 0xc8, 0x42, - 0x8a, 0x88, 0x7c, 0x0f, 0x92, 0x30, 0xfa, 0xa2, 0x81, 0x05, 0xf0, 0xb3, - 0xa4, 0xf5, 0xe8, 0x15, 0xf4, 0xd8, 0xfa, 0xbc, 0x0f, 0xc3, 0xd6, 0x27, - 0xe7, 0xab, 0x51, 0x3f, 0xcb, 0x72, 0xd4, 0xcf, 0x82, 0xf8, 0x4f, 0xe0, - 0x7e, 0x16, 0xc6, 0x8f, 0x15, 0xc5, 0x3f, 0xd9, 0xbf, 0xab, 0x79, 0x7f, - 0x1c, 0x00, 0xfb, 0x0c, 0x1f, 0x1f, 0x65, 0xe0, 0x5d, 0x0d, 0xf3, 0x6b, - 0x55, 0xf2, 0x0b, 0xc0, 0x75, 0xb2, 0xfc, 0xc9, 0xfb, 0x7b, 0x63, 0x86, - 0x57, 0x34, 0xec, 0x48, 0x7f, 0xf5, 0x92, 0x19, 0x1d, 0xbf, 0xa0, 0x9f, - 0x9f, 0x4d, 0xc4, 0xdf, 0xbf, 0x7f, 0x3e, 0x31, 0xbd, 0xfe, 0xb1, 0x6a, - 0xe7, 0xcb, 0x84, 0xe7, 0x6b, 0x95, 0x19, 0x3c, 0x5f, 0x51, 0xf9, 0x8b, - 0xf0, 0xf3, 0xc4, 0xf7, 0xc3, 0x9a, 0x8f, 0xf5, 0x19, 0x3d, 0xd0, 0x4d, - 0xdb, 0x75, 0x1d, 0xf5, 0xcb, 0x40, 0xa9, 0x11, 0x1c, 0xb0, 0x33, 0x19, - 0x43, 0xaf, 0x1f, 0xfe, 0xa2, 0x36, 0x3c, 0xa0, 0xd9, 0x23, 0xda, 0x78, - 0xcb, 0xd3, 0x76, 0x69, 0xfb, 0xdf, 0x2d, 0xf4, 0x3a, 0xe0, 0x6d, 0x68, - 0xff, 0xac, 0x84, 0x97, 0xf6, 0x96, 0x90, 0x75, 0x58, 0x6d, 0x39, 0x9c, - 0x87, 0x18, 0x9e, 0x8f, 0xf8, 0xf3, 0xbe, 0x43, 0x2c, 0x89, 0x67, 0x7e, - 0xc3, 0x2e, 0x19, 0xe8, 0x3e, 0x6e, 0x31, 0xfb, 0x72, 0xb3, 0xf0, 0x3e, - 0x7b, 0xd5, 0xfe, 0x63, 0xde, 0xff, 0xf4, 0x36, 0x3e, 0xef, 0xfe, 0x6b, - 0x98, 0x2b, 0x88, 0xbe, 0xd1, 0x7c, 0x79, 0xe2, 0x41, 0xde, 0x2f, 0x61, - 0x94, 0x70, 0x7e, 0x2f, 0x0f, 0x8a, 0x24, 0xbf, 0xa7, 0x17, 0x1b, 0x53, - 0x43, 0x06, 0xd1, 0xf0, 0x1d, 0x00, 0xac, 0x67, 0xe7, 0x23, 0x87, 0xf5, - 0x4b, 0x13, 0xf1, 0xd1, 0x6e, 0xb8, 0x69, 0xb1, 0x3f, 0x01, 0x80, 0xaf, - 0x25, 0x51, 0xbf, 0x14, 0x14, 0xf6, 0x38, 0xb5, 0x9c, 0xa5, 0xc5, 0x09, - 0xb6, 0x1f, 0x69, 0x30, 0x1d, 0x7b, 0x2e, 0xe7, 0x73, 0xfe, 0xfd, 0xa0, - 0xd4, 0xff, 0xc9, 0xfa, 0x71, 0x35, 0x50, 0x9c, 0x8f, 0x16, 0x5d, 0x1c, - 0x4a, 0xbb, 0x39, 0xa4, 0x9f, 0x6d, 0xa9, 0x60, 0x3e, 0x1d, 0x5e, 0x92, - 0x3c, 0xb7, 0x55, 0xf9, 0x79, 0xde, 0xdb, 0x07, 0x85, 0xfc, 0x0f, 0xf8, - 0xd5, 0xc1, 0x78, 0xfd, 0xfd, 0xef, 0x83, 0xd3, 0xec, 0xef, 0x94, 0xea, - 0x87, 0x56, 0xc8, 0xfe, 0xa5, 0x51, 0xac, 0xfc, 0x82, 0x18, 0xcf, 0xff, - 0xad, 0xc9, 0xe8, 0x75, 0xeb, 0xc4, 0x5f, 0x33, 0x7f, 0xb2, 0x4b, 0xf2, - 0x2f, 0xbc, 0xbf, 0x5c, 0xa8, 0xef, 0xfd, 0x4f, 0xfc, 0x7a, 0xf8, 0xf3, - 0x7d, 0x87, 0xb7, 0x92, 0x9d, 0x37, 0x01, 0xf6, 0xbf, 0x67, 0x46, 0x61, - 0xbf, 0x7e, 0x9c, 0xa3, 0xf2, 0x17, 0xc6, 0x2b, 0xec, 0x1b, 0xc9, 0x6e, - 0x26, 0x02, 0xf5, 0x38, 0xf4, 0x73, 0x72, 0xa6, 0xf5, 0xe7, 0x03, 0x79, - 0x7f, 0x98, 0xfe, 0xb8, 0xa0, 0xf8, 0xf1, 0xd6, 0xed, 0x3a, 0x7d, 0x3e, - 0xa4, 0x77, 0x95, 0xa8, 0x3f, 0xf2, 0xf7, 0xd0, 0x6a, 0xd4, 0x9f, 0x0f, - 0xcf, 0x95, 0xfe, 0x48, 0xfd, 0x31, 0x96, 0xbc, 0x3f, 0x10, 0xdd, 0x42, - 0x2d, 0x42, 0x5e, 0xa4, 0xfe, 0x18, 0x24, 0x7e, 0x1b, 0xd0, 0xa4, 0x7c, - 0xad, 0xa4, 0x4f, 0x82, 0xfe, 0x80, 0xc4, 0xa1, 0x6a, 0xfa, 0xb3, 0x52, - 0xca, 0x37, 0xd3, 0x7a, 0x79, 0x65, 0x7d, 0xc7, 0x10, 0xe3, 0x6b, 0xb8, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Aug 17 01:57:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75C41BBCE2E; Wed, 17 Aug 2016 01:57:59 +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 50E39152C; Wed, 17 Aug 2016 01:57:59 +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 u7H1vwGt082021; Wed, 17 Aug 2016 01:57:58 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H1vwrg082020; Wed, 17 Aug 2016 01:57:58 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201608170157.u7H1vwrg082020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 17 Aug 2016 01:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304248 - head/sys/dev/qlxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 01:57:59 -0000 Author: davidcs Date: Wed Aug 17 01:57:58 2016 New Revision: 304248 URL: https://svnweb.freebsd.org/changeset/base/304248 Log: Add ql_minidump.h MFC after:5 days Added: head/sys/dev/qlxgbe/ql_minidump.h (contents, props changed) Added: head/sys/dev/qlxgbe/ql_minidump.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/qlxgbe/ql_minidump.h Wed Aug 17 01:57:58 2016 (r304248) @@ -0,0 +1,470 @@ +/* + * Copyright (c) 2013-2016 Qlogic Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + */ + +/* + * File: ql_minidump.h + * + * $FreeBSD$ + */ +#ifndef _QL_MINIDUMP_H_ +#define _QL_MINIDUMP_H_ + +#define QL_DBG_STATE_ARRAY_LEN 16 +#define QL_DBG_CAP_SIZE_ARRAY_LEN 8 +#define QL_NO_OF_OCM_WINDOWS 16 + + +typedef struct ql_mdump_tmplt_hdr { + uint32_t entry_type ; + uint32_t first_entry_offset ; + uint32_t size_of_template ; + uint32_t recommended_capture_mask; + + uint32_t num_of_entries ; + uint32_t version ; + uint32_t driver_timestamp ; + uint32_t checksum ; + + uint32_t driver_capture_mask ; + uint32_t driver_info_word2 ; + uint32_t driver_info_word3 ; + uint32_t driver_info_word4 ; + + uint32_t saved_state_array[QL_DBG_STATE_ARRAY_LEN] ; + uint32_t capture_size_array[QL_DBG_CAP_SIZE_ARRAY_LEN] ; + + uint32_t ocm_window_array[QL_NO_OF_OCM_WINDOWS] ; +} ql_minidump_template_hdr_t ; + +/* + * MIU AGENT ADDRESSES. + */ + +#define MD_TA_CTL_ENABLE 0x2 +#define MD_TA_CTL_START 0x1 +#define MD_TA_CTL_BUSY 0x8 +#define MD_TA_CTL_CHECK 1000 + +#define MD_MIU_TEST_AGT_CTRL 0x41000090 +#define MD_MIU_TEST_AGT_ADDR_LO 0x41000094 +#define MD_MIU_TEST_AGT_ADDR_HI 0x41000098 + +#define MD_MIU_TEST_AGT_RDDATA_0_31 0x410000A8 +#define MD_MIU_TEST_AGT_RDDATA_32_63 0x410000AC +#define MD_MIU_TEST_AGT_RDDATA_64_95 0x410000B8 +#define MD_MIU_TEST_AGT_RDDATA_96_127 0x410000BC + +#define MD_MIU_TEST_AGT_WRDATA_0_31 0x410000A0 +#define MD_MIU_TEST_AGT_WRDATA_32_63 0x410000A4 +#define MD_MIU_TEST_AGT_WRDATA_64_95 0x410000B0 +#define MD_MIU_TEST_AGT_WRDATA_96_127 0x410000B4 + +/* + * ROM Read Address + */ + +#define MD_DIRECT_ROM_WINDOW 0x42110030 +#define MD_DIRECT_ROM_READ_BASE 0x42150000 + +/* + * Entry Type Defines + */ + +#define RDNOP 0 +#define RDCRB 1 +#define RDMUX 2 +#define QUEUE 3 +#define BOARD 4 +#define RDOCM 6 +#define L1DAT 11 +#define L1INS 12 +#define L2DTG 21 +#define L2ITG 22 +#define L2DAT 23 +#define L2INS 24 +#define POLLRD 35 +#define RDMUX2 36 +#define POLLRDMWR 37 +#define RDROM 71 +#define RDMEM 72 +#define CNTRL 98 +#define TLHDR 99 +#define RDEND 255 + +/* + * Index of State Table. The Template header maintains + * an array of 8 (0..7) words that is used to store some + * "State Information" from the board. + */ + +#define QL_PCIE_FUNC_INDX 0 +#define QL_CLK_STATE_INDX 1 +#define QL_SRE_STATE_INDX 2 +#define QL_OCM0_ADDR_INDX 3 + +#define QL_REVID_STATE_INDX 4 +#define QL_MAJVER_STATE_INDX 5 +#define QL_MINVER_STATE_INDX 6 +#define QL_SUBVER_STATE_INDX 7 + +/* + * Opcodes for Control Entries. + * These Flags are bit fields. + */ + +#define QL_DBG_OPCODE_WR 0x01 +#define QL_DBG_OPCODE_RW 0x02 +#define QL_DBG_OPCODE_AND 0x04 +#define QL_DBG_OPCODE_OR 0x08 +#define QL_DBG_OPCODE_POLL 0x10 +#define QL_DBG_OPCODE_RDSTATE 0x20 +#define QL_DBG_OPCODE_WRSTATE 0x40 +#define QL_DBG_OPCODE_MDSTATE 0x80 + +typedef struct ql_minidump_entry_hdr_s { + uint32_t entry_type ; + uint32_t entry_size ; + uint32_t entry_capture_size ; + union { + struct { + uint8_t entry_capture_mask ; + uint8_t entry_code ; + uint8_t driver_code ; + uint8_t driver_flags ; + }; + uint32_t entry_ctrl_word ; + }; +} ql_minidump_entry_hdr_t ; + +/* + * Driver Flags + */ +#define QL_DBG_SKIPPED_FLAG 0x80 /* driver skipped this entry */ +#define QL_DBG_SIZE_ERR_FLAG 0x40 /* entry size vs capture size mismatch*/ + +/* + * Generic Entry Including Header + */ + +typedef struct ql_minidump_entry_s { + ql_minidump_entry_hdr_t hdr ; + + uint32_t entry_data00 ; + uint32_t entry_data01 ; + uint32_t entry_data02 ; + uint32_t entry_data03 ; + + uint32_t entry_data04 ; + uint32_t entry_data05 ; + uint32_t entry_data06 ; + uint32_t entry_data07 ; +} ql_minidump_entry_t; + +/* + * Read CRB Entry Header + */ + +typedef struct ql_minidump_entry_rdcrb_s { + ql_minidump_entry_hdr_t h; + + uint32_t addr ; + union { + struct { + uint8_t addr_stride ; + uint8_t rsvd_0; + uint16_t rsvd_1 ; + } ; + uint32_t addr_cntrl ; + } ; + + uint32_t data_size ; + uint32_t op_count; + + uint32_t rsvd_2 ; + uint32_t rsvd_3 ; + uint32_t rsvd_4 ; + uint32_t rsvd_5 ; + +} ql_minidump_entry_rdcrb_t ; + +/* + * Cache Entry Header + */ + +typedef struct ql_minidump_entry_cache_s { + ql_minidump_entry_hdr_t h; + + uint32_t tag_reg_addr ; + union { + struct { + uint16_t tag_value_stride ; + uint16_t init_tag_value ; + } ; + uint32_t select_addr_cntrl ; + } ; + + uint32_t data_size ; + uint32_t op_count; + + uint32_t control_addr ; + union { + struct { + uint16_t write_value ; + uint8_t poll_mask ; + uint8_t poll_wait ; + }; + uint32_t control_value ; + } ; + + uint32_t read_addr ; + union { + struct { + uint8_t read_addr_stride ; + uint8_t read_addr_cnt ; + uint16_t rsvd_1 ; + } ; + uint32_t read_addr_cntrl ; + } ; +} ql_minidump_entry_cache_t ; + + +/* + * Read OCM Entry Header + */ + +typedef struct ql_minidump_entry_rdocm_s { + ql_minidump_entry_hdr_t h; + + uint32_t rsvd_0 ; + uint32_t rsvd_1 ; + + uint32_t data_size ; + uint32_t op_count; + + uint32_t rsvd_2 ; + uint32_t rsvd_3 ; + + uint32_t read_addr ; + uint32_t read_addr_stride ; + +} ql_minidump_entry_rdocm_t ; + +/* + * Read MEM Entry Header + */ + +typedef struct ql_minidump_entry_rdmem_s { + ql_minidump_entry_hdr_t h; + + uint32_t rsvd_0[6] ; + + uint32_t read_addr ; + uint32_t read_data_size ; + +} ql_minidump_entry_rdmem_t ; + +/* + * Read ROM Entry Header + */ + +typedef struct ql_minidump_entry_rdrom_s { + ql_minidump_entry_hdr_t h; + + uint32_t rsvd_0[6] ; + + uint32_t read_addr ; + uint32_t read_data_size ; + +} ql_minidump_entry_rdrom_t ; + +/* + * Read MUX Entry Header + */ + +typedef struct ql_minidump_entry_mux_s { + ql_minidump_entry_hdr_t h; + + uint32_t select_addr ; + union { + struct { + uint32_t rsvd_0 ; + } ; + uint32_t select_addr_cntrl ; + } ; + + uint32_t data_size ; + uint32_t op_count; + + uint32_t select_value ; + uint32_t select_value_stride ; + + uint32_t read_addr ; + uint32_t rsvd_1 ; + +} ql_minidump_entry_mux_t ; + +/* + * Read MUX2 Entry Header + */ + +typedef struct ql_minidump_entry_mux2_s { + ql_minidump_entry_hdr_t h; + + uint32_t select_addr_1; + uint32_t select_addr_2; + uint32_t select_value_1; + uint32_t select_value_2; + uint32_t select_value_count; + uint32_t select_value_mask; + uint32_t read_addr; + union { + struct { + uint8_t select_value_stride; + uint8_t data_size; + uint8_t reserved_0; + uint8_t reserved_1; + }; + uint32_t select_addr_value_cntrl; + }; + +} ql_minidump_entry_mux2_t; + +/* + * Read QUEUE Entry Header + */ + +typedef struct ql_minidump_entry_queue_s { + ql_minidump_entry_hdr_t h; + + uint32_t select_addr ; + union { + struct { + uint16_t queue_id_stride ; + uint16_t rsvd_0 ; + } ; + uint32_t select_addr_cntrl ; + } ; + + uint32_t data_size ; + uint32_t op_count ; + + uint32_t rsvd_1 ; + uint32_t rsvd_2 ; + + uint32_t read_addr ; + union { + struct { + uint8_t read_addr_stride ; + uint8_t read_addr_cnt ; + uint16_t rsvd_3 ; + } ; + uint32_t read_addr_cntrl ; + } ; + +} ql_minidump_entry_queue_t ; + +/* + * Control Entry Header + */ + +typedef struct ql_minidump_entry_cntrl_s { + ql_minidump_entry_hdr_t h; + + uint32_t addr ; + union { + struct { + uint8_t addr_stride ; + uint8_t state_index_a ; + uint16_t poll_timeout ; + } ; + uint32_t addr_cntrl ; + } ; + + uint32_t data_size ; + uint32_t op_count; + + union { + struct { + uint8_t opcode ; + uint8_t state_index_v ; + uint8_t shl ; + uint8_t shr ; + } ; + uint32_t control_value ; + } ; + + uint32_t value_1 ; + uint32_t value_2 ; + uint32_t value_3 ; +} ql_minidump_entry_cntrl_t ; + +/* + * Read with poll. + */ + +typedef struct ql_minidump_entry_rdcrb_with_poll_s { + ql_minidump_entry_hdr_t h; + + uint32_t select_addr; + uint32_t read_addr; + uint32_t select_value; + union { + struct { + uint16_t select_value_stride; + uint16_t op_count; + }; + uint32_t select_value_cntrl; + }; + + uint32_t poll; + uint32_t mask; + + uint32_t data_size; + uint32_t rsvd_0; + +} ql_minidump_entry_pollrd_t; + +/* + * Read_Modify_Write with poll. + */ + +typedef struct ql_minidump_entry_rd_modify_wr_with_poll_s { + ql_minidump_entry_hdr_t h; + + uint32_t addr_1; + uint32_t addr_2; + uint32_t value_1; + uint32_t value_2; + uint32_t poll; + uint32_t mask; + uint32_t modify_mask; + uint32_t data_size; + +} ql_minidump_entry_rd_modify_wr_with_poll_t; + +#endif /* #ifndef _QL_MINIDUMP_H_ */ + From owner-svn-src-head@freebsd.org Wed Aug 17 02:22:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 204A8BBC6D6; Wed, 17 Aug 2016 02:22:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 08E1315C6; Wed, 17 Aug 2016 02:22:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u7H2MrxE006924 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 16 Aug 2016 19:22:53 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u7H2Mrbw006923; Tue, 16 Aug 2016 19:22:53 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 16 Aug 2016 19:22:53 -0700 From: Gleb Smirnoff To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303646 - head/sys/ofed/drivers/infiniband/ulp/ipoib Message-ID: <20160817022253.GD1069@FreeBSD.org> References: <201608012222.u71MMB4E018482@repo.freebsd.org> <20160817000953.GB1069@FreeBSD.org> <20160817004128.GB94062@wkstn-mjohnston.west.isilon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160817004128.GB94062@wkstn-mjohnston.west.isilon.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 02:22:55 -0000 On Tue, Aug 16, 2016 at 05:41:28PM -0700, Mark Johnston wrote: M> > M> Log: M> > M> ipoib: Bound the number of egress mbufs buffered during pathrec lookups. M> > M> M> > M> In pathological situations where the master subnet manager becomes M> > M> unresponsive for an extended period, we may otherwise end up queuing all M> > M> of the system's mbufs while waiting for a response to a path record lookup. M> > M> M> > M> This addresses the same issue as commit 1e85b806f9 in Linux. M> > M> M> > M> Reviewed by: cem, ngie M> > M> MFC after: 2 weeks M> > M> Sponsored by: EMC / Isilon Storage Division M> > M> M> > M> Modified: M> > M> head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c M> > M> M> > M> Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c M> > M> ============================================================================== M> > M> --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 1 22:19:23 2016 (r303645) M> > M> +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 1 22:22:11 2016 (r303646) M> > M> @@ -660,7 +660,13 @@ ipoib_unicast_send(struct mbuf *mb, stru M> > M> new_path = 1; M> > M> } M> > M> if (path) { M> > M> - _IF_ENQUEUE(&path->queue, mb); M> > M> + if (_IF_QLEN(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) M> > M> + _IF_ENQUEUE(&path->queue, mb); M> > M> + else { M> > M> + if_inc_counter(priv->dev, IFCOUNTER_OERRORS, 1); M> > M> + m_freem(mb); M> > M> + } M> > M> > Shouldn't that be IFCOUNTER_ODROPS? M> M> I'm not sure. I used IFCOUNTER_OERRORS to be consistent with other error M> cases in this function. This error case doesn't represent the normal M> source of outbound packet drops but rather indicates that a key routing M> agent on the network is not responding. OQDROPS seems like it's M> specifically for the case that we can't buffer packets because the M> transmitter isn't keeping up. I see. The fact that this is an if_queue has confused me. I expected that it is an ifqueue belonging to an ifnet. btw, may be this ifqueue can be reduced to mbufq. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Wed Aug 17 02:40:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94DD2BBCAA2; Wed, 17 Aug 2016 02:40:19 +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 66C041BE1; Wed, 17 Aug 2016 02:40:19 +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 u7H2eIWN097690; Wed, 17 Aug 2016 02:40:18 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H2eIED097684; Wed, 17 Aug 2016 02:40:18 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201608170240.u7H2eIED097684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 17 Aug 2016 02:40:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304249 - head/sys/dev/qlxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 02:40:19 -0000 Author: davidcs Date: Wed Aug 17 02:40:17 2016 New Revision: 304249 URL: https://svnweb.freebsd.org/changeset/base/304249 Log: Add support for set/get cam search mode MFC after: 5 days Modified: head/sys/dev/qlxgbe/ql_dbg.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_dbg.h ============================================================================== --- head/sys/dev/qlxgbe/ql_dbg.h Wed Aug 17 01:57:58 2016 (r304248) +++ head/sys/dev/qlxgbe/ql_dbg.h Wed Aug 17 02:40:17 2016 (r304249) @@ -52,6 +52,7 @@ extern void ql_dump_buf32(qla_host_t *ha #define INJCT_MBX_CMD_FAILURE 0x00008 #define INJCT_HEARTBEAT_FAILURE 0x00009 #define INJCT_TEMPERATURE_FAILURE 0x0000A +#define INJCT_M_GETCL_M_GETJCL_FAILURE 0x0000B #ifdef QL_DBG Modified: head/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.c Wed Aug 17 01:57:58 2016 (r304248) +++ head/sys/dev/qlxgbe/ql_hw.c Wed Aug 17 02:40:17 2016 (r304249) @@ -74,6 +74,8 @@ static int qla_query_fw_dcbx_caps(qla_ho static int qla_set_port_config(qla_host_t *ha, uint32_t cfg_bits); static int qla_get_port_config(qla_host_t *ha, uint32_t *cfg_bits); static void qla_get_quick_stats(qla_host_t *ha); +static int qla_set_cam_search_mode(qla_host_t *ha, uint32_t search_mode); +static int qla_get_cam_search_mode(qla_host_t *ha); static void ql_minidump_free(qla_host_t *ha); @@ -94,11 +96,22 @@ qla_sysctl_get_drvr_stats(SYSCTL_HANDLER ha = (qla_host_t *)arg1; - for (i = 0; i < ha->hw.num_sds_rings; i++) + for (i = 0; i < ha->hw.num_sds_rings; i++) { + device_printf(ha->pci_dev, "%s: sds_ring[%d] = %p\n", __func__,i, (void *)ha->hw.sds[i].intr_count); + device_printf(ha->pci_dev, + "%s: sds_ring[%d].spurious_intr_count = %p\n", + __func__, + i, (void *)ha->hw.sds[i].spurious_intr_count); + + device_printf(ha->pci_dev, + "%s: sds_ring[%d].rx_free = %d\n", __func__,i, + ha->hw.sds[i].rx_free); + } + for (i = 0; i < ha->hw.num_tx_rings; i++) device_printf(ha->pci_dev, "%s: tx[%d] = %p\n", __func__,i, @@ -255,6 +268,47 @@ qla_sysctl_set_port_cfg_exit: return err; } +static int +qla_sysctl_set_cam_search_mode(SYSCTL_HANDLER_ARGS) +{ + int err, ret = 0; + qla_host_t *ha; + + err = sysctl_handle_int(oidp, &ret, 0, req); + + if (err || !req->newptr) + return (err); + + ha = (qla_host_t *)arg1; + + if ((ret == Q8_HW_CONFIG_CAM_SEARCH_MODE_INTERNAL) || + (ret == Q8_HW_CONFIG_CAM_SEARCH_MODE_AUTO)) { + err = qla_set_cam_search_mode(ha, (uint32_t)ret); + } else { + device_printf(ha->pci_dev, "%s: ret = %d\n", __func__, ret); + } + + return (err); +} + +static int +qla_sysctl_get_cam_search_mode(SYSCTL_HANDLER_ARGS) +{ + int err, ret = 0; + qla_host_t *ha; + + err = sysctl_handle_int(oidp, &ret, 0, req); + + if (err || !req->newptr) + return (err); + + ha = (qla_host_t *)arg1; + err = qla_get_cam_search_mode(ha); + + return (err); +} + + /* * Name: ql_hw_add_sysctls * Function: Add P3Plus specific sysctls @@ -362,6 +416,24 @@ ql_hw_add_sysctls(qla_host_t *ha) " 1 = xmt only; 2 = rcv only;\n" ); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "set_cam_search_mode", CTLTYPE_INT | CTLFLAG_RW, + (void *)ha, 0, + qla_sysctl_set_cam_search_mode, "I", + "Set CAM Search Mode" + "\t 1 = search mode internal\n" + "\t 2 = search mode auto\n"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "get_cam_search_mode", CTLTYPE_INT | CTLFLAG_RW, + (void *)ha, 0, + qla_sysctl_get_cam_search_mode, "I", + "Get CAM Search Mode" + "\t 1 = search mode internal\n" + "\t 2 = search mode auto\n"); + ha->hw.enable_9kb = 1; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), @@ -407,7 +479,8 @@ ql_hw_add_sysctls(qla_host_t *ha) "\t\t\t 7: ocm: offchip memory rd_wr failure\n" "\t\t\t 8: mbx: mailbox command failure\n" "\t\t\t 9: heartbeat failure\n" - "\t\t\t A: temperature failure\n" ); + "\t\t\t A: temperature failure\n" + "\t\t\t 11: m_getcl or m_getjcl failure\n" ); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -1299,6 +1372,85 @@ qla_config_fw_lro(qla_host_t *ha, uint16 return 0; } +static int +qla_set_cam_search_mode(qla_host_t *ha, uint32_t search_mode) +{ + device_t dev; + q80_hw_config_t *hw_config; + q80_hw_config_rsp_t *hw_config_rsp; + uint32_t err; + + dev = ha->pci_dev; + + hw_config = (q80_hw_config_t *)ha->hw.mbox; + bzero(hw_config, sizeof (q80_hw_config_t)); + + hw_config->opcode = Q8_MBX_HW_CONFIG; + hw_config->count_version = Q8_HW_CONFIG_SET_CAM_SEARCH_MODE_COUNT; + hw_config->count_version |= Q8_MBX_CMD_VERSION; + + hw_config->cmd = Q8_HW_CONFIG_SET_CAM_SEARCH_MODE; + + hw_config->u.set_cam_search_mode.mode = search_mode; + + if (qla_mbx_cmd(ha, (uint32_t *)hw_config, + (sizeof (q80_hw_config_t) >> 2), + ha->hw.mbox, (sizeof (q80_hw_config_rsp_t) >> 2), 0)) { + device_printf(dev, "%s: failed\n", __func__); + return -1; + } + hw_config_rsp = (q80_hw_config_rsp_t *)ha->hw.mbox; + + err = Q8_MBX_RSP_STATUS(hw_config_rsp->regcnt_status); + + if (err) { + device_printf(dev, "%s: failed [0x%08x]\n", __func__, err); + } + + return 0; +} + +static int +qla_get_cam_search_mode(qla_host_t *ha) +{ + device_t dev; + q80_hw_config_t *hw_config; + q80_hw_config_rsp_t *hw_config_rsp; + uint32_t err; + + dev = ha->pci_dev; + + hw_config = (q80_hw_config_t *)ha->hw.mbox; + bzero(hw_config, sizeof (q80_hw_config_t)); + + hw_config->opcode = Q8_MBX_HW_CONFIG; + hw_config->count_version = Q8_HW_CONFIG_GET_CAM_SEARCH_MODE_COUNT; + hw_config->count_version |= Q8_MBX_CMD_VERSION; + + hw_config->cmd = Q8_HW_CONFIG_GET_CAM_SEARCH_MODE; + + if (qla_mbx_cmd(ha, (uint32_t *)hw_config, + (sizeof (q80_hw_config_t) >> 2), + ha->hw.mbox, (sizeof (q80_hw_config_rsp_t) >> 2), 0)) { + device_printf(dev, "%s: failed\n", __func__); + return -1; + } + hw_config_rsp = (q80_hw_config_rsp_t *)ha->hw.mbox; + + err = Q8_MBX_RSP_STATUS(hw_config_rsp->regcnt_status); + + if (err) { + device_printf(dev, "%s: failed [0x%08x]\n", __func__, err); + } else { + device_printf(dev, "%s: cam search mode [0x%08x]\n", __func__, + hw_config_rsp->u.get_cam_search_mode.mode); + } + + return 0; +} + + + static void qla_xmt_stats(qla_host_t *ha, q80_xmt_stats_t *xstat, int i) { Modified: head/sys/dev/qlxgbe/ql_hw.h ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.h Wed Aug 17 01:57:58 2016 (r304248) +++ head/sys/dev/qlxgbe/ql_hw.h Wed Aug 17 02:40:17 2016 (r304249) @@ -255,6 +255,7 @@ #define Q8_MBX_LINK_EVENT_REQ 0x0048 #define Q8_MBX_CONFIG_MAC_RX_MODE 0x0049 #define Q8_MBX_CONFIG_FW_LRO 0x004A +#define Q8_MBX_HW_CONFIG 0x004C #define Q8_MBX_INIT_NIC_FUNC 0x0060 #define Q8_MBX_STOP_NIC_FUNC 0x0061 #define Q8_MBX_IDC_REQ 0x0062 @@ -622,6 +623,87 @@ typedef struct _q80_config_md_templ_cmd_ } __packed q80_config_md_templ_cmd_rsp_t; /* + * Hardware Configuration Commands + */ + +typedef struct _q80_hw_config { + uint16_t opcode; + uint16_t count_version; +#define Q8_HW_CONFIG_SET_MDIO_REG_COUNT 0x06 +#define Q8_HW_CONFIG_GET_MDIO_REG_COUNT 0x05 +#define Q8_HW_CONFIG_SET_CAM_SEARCH_MODE_COUNT 0x03 +#define Q8_HW_CONFIG_GET_CAM_SEARCH_MODE_COUNT 0x02 +#define Q8_HW_CONFIG_SET_TEMP_THRESHOLD_COUNT 0x03 +#define Q8_HW_CONFIG_GET_TEMP_THRESHOLD_COUNT 0x02 +#define Q8_HW_CONFIG_GET_ECC_COUNTS_COUNT 0x02 + + uint32_t cmd; +#define Q8_HW_CONFIG_SET_MDIO_REG 0x01 +#define Q8_HW_CONFIG_GET_MDIO_REG 0x02 +#define Q8_HW_CONFIG_SET_CAM_SEARCH_MODE 0x03 +#define Q8_HW_CONFIG_GET_CAM_SEARCH_MODE 0x04 +#define Q8_HW_CONFIG_SET_TEMP_THRESHOLD 0x07 +#define Q8_HW_CONFIG_GET_TEMP_THRESHOLD 0x08 +#define Q8_HW_CONFIG_GET_ECC_COUNTS 0x0A + + union { + struct { + uint32_t phys_port_number; + uint32_t phy_dev_addr; + uint32_t reg_addr; + uint32_t data; + } set_mdio; + + struct { + uint32_t phys_port_number; + uint32_t phy_dev_addr; + uint32_t reg_addr; + } get_mdio; + + struct { + uint32_t mode; +#define Q8_HW_CONFIG_CAM_SEARCH_MODE_INTERNAL 0x1 +#define Q8_HW_CONFIG_CAM_SEARCH_MODE_AUTO 0x2 + + } set_cam_search_mode; + + struct { + uint32_t value; + } set_temp_threshold; + } u; +} __packed q80_hw_config_t; + +typedef struct _q80_hw_config_rsp { + uint16_t opcode; + uint16_t regcnt_status; + + union { + struct { + uint32_t value; + } get_mdio; + + struct { + uint32_t mode; + } get_cam_search_mode; + + struct { + uint32_t temp_warn; + uint32_t curr_temp; + uint32_t osc_ring_rate; + uint32_t core_voltage; + } get_temp_threshold; + + struct { + uint32_t ddr_ecc_error_count; + uint32_t ocm_ecc_error_count; + uint32_t l2_dcache_ecc_error_count; + uint32_t l2_icache_ecc_error_count; + uint32_t eport_ecc_error_count; + } get_ecc_counts; + } u; +} __packed q80_hw_config_rsp_t; + +/* * Link Event Request Command */ typedef struct _q80_link_event { @@ -1407,6 +1489,7 @@ typedef struct _qla_sds { volatile uint32_t rcv_active; uint32_t sds_consumer; uint64_t intr_count; + uint64_t spurious_intr_count; } qla_sds_t; #define Q8_MAX_LRO_CONT_DESC 7 Modified: head/sys/dev/qlxgbe/ql_isr.c ============================================================================== --- head/sys/dev/qlxgbe/ql_isr.c Wed Aug 17 01:57:58 2016 (r304248) +++ head/sys/dev/qlxgbe/ql_isr.c Wed Aug 17 02:40:17 2016 (r304249) @@ -463,6 +463,8 @@ qla_rcv_isr(qla_host_t *ha, uint32_t sds qla_sgl_comp_t sgc; uint16_t nhandles; uint32_t sds_replenish_threshold = 0; + uint32_t r_idx = 0; + qla_sds_t *sdsp; dev = ha->pci_dev; hw = &ha->hw; @@ -705,8 +707,18 @@ qla_rcv_isr(qla_host_t *ha, uint32_t sds if (hw->sds[sds_idx].sdsr_next != comp_idx) { QL_UPDATE_SDS_CONSUMER_INDEX(ha, sds_idx, comp_idx); + hw->sds[sds_idx].sdsr_next = comp_idx; + } else { + hw->sds[sds_idx].spurious_intr_count++; + + if (ha->hw.num_rds_rings > 1) + r_idx = sds_idx; + + sdsp = &ha->hw.sds[sds_idx]; + + if (sdsp->rx_free > ha->std_replenish) + qla_replenish_normal_rx(ha, sdsp, r_idx); } - hw->sds[sds_idx].sdsr_next = comp_idx; sdesc = (q80_stat_desc_t *)&hw->sds[sds_idx].sds_ring_base[comp_idx]; opcode = Q8_STAT_DESC_OPCODE((sdesc->data[1])); @@ -826,6 +838,20 @@ ql_mbx_isr(void *arg) device_printf(ha->pci_dev, "%s: sfp removed]\n", __func__); break; + case 0x8140: + { + uint32_t ombx[3]; + + ombx[0] = READ_REG32(ha, (Q8_FW_MBOX0 + 4)); + ombx[1] = READ_REG32(ha, (Q8_FW_MBOX0 + 8)); + ombx[2] = READ_REG32(ha, (Q8_FW_MBOX0 + 12)); + + device_printf(ha->pci_dev, "%s: " + "0x%08x 0x%08x 0x%08x 0x%08x \n", + __func__, data, ombx[0], ombx[1], ombx[2]); + } + break; + default: device_printf(ha->pci_dev, "%s: AEN[0x%08x]\n", __func__, data); break; @@ -872,8 +898,8 @@ qla_replenish_normal_rx(qla_host_t *ha, rdesc->rx_next = 0; } else { device_printf(ha->pci_dev, - "%s: ql_get_mbuf [0,(%d),(%d)] failed\n", - __func__, rdesc->rx_in, rxb->handle); + "%s: qla_get_mbuf [(%d),(%d),(%d)] failed\n", + __func__, r_idx, rdesc->rx_in, rxb->handle); rxb->m_head = NULL; rxb->next = sdsp->rxb_free; Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Wed Aug 17 01:57:58 2016 (r304248) +++ head/sys/dev/qlxgbe/ql_os.c Wed Aug 17 02:40:17 2016 (r304249) @@ -1592,6 +1592,9 @@ ql_get_mbuf(qla_host_t *ha, qla_rx_buf_t if (mp == NULL) { + if (QL_ERR_INJECT(ha, INJCT_M_GETCL_M_GETJCL_FAILURE)) + return(-1); + if (ha->hw.enable_9kb) mp = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, mbuf_size); else Modified: head/sys/dev/qlxgbe/ql_ver.h ============================================================================== --- head/sys/dev/qlxgbe/ql_ver.h Wed Aug 17 01:57:58 2016 (r304248) +++ head/sys/dev/qlxgbe/ql_ver.h Wed Aug 17 02:40:17 2016 (r304249) @@ -36,6 +36,6 @@ #define QLA_VERSION_MAJOR 3 #define QLA_VERSION_MINOR 10 -#define QLA_VERSION_BUILD 29 +#define QLA_VERSION_BUILD 30 #endif /* #ifndef _QL_VER_H_ */ From owner-svn-src-head@freebsd.org Wed Aug 17 05:02:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07011BBC176; Wed, 17 Aug 2016 05:02:20 +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 B968B1B24; Wed, 17 Aug 2016 05:02:19 +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 u7H52IZP054313; Wed, 17 Aug 2016 05:02:18 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H52I0i054311; Wed, 17 Aug 2016 05:02:18 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170502.u7H52I0i054311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 05:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304251 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 05:02:20 -0000 Author: sephe Date: Wed Aug 17 05:02:18 2016 New Revision: 304251 URL: https://svnweb.freebsd.org/changeset/base/304251 Log: hyperv/storvsc: Deliver CAM_SEL_TIMEOUT upon SRB status error. SRB status is set to 0x20 by the hypervisor, if the specified LUN is unaccessible, and even worse the INQUIRY response will not be set by the hypervisor at all under this situation. Additionally, SRB status is 0x20 too, for TUR on an unaccessible LUN. Deliver CAM_SEL_TIMEOUT to CAM upon SRB status errors as suggested by Scott Long, other values seems improper. This commit fixes the Hyper-V disk hotplug support. Submitted by: Hongjiang Zhang MFC after: 3 days Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7521 Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c head/sys/dev/hyperv/storvsc/hv_vstorage.h Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Aug 17 04:41:47 2016 (r304250) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Aug 17 05:02:18 2016 (r304251) @@ -742,6 +742,7 @@ hv_storvsc_on_iocompletion(struct storvs * because the fields will be used later in storvsc_io_done(). */ request->vstor_packet.u.vm_srb.scsi_status = vm_srb->scsi_status; + request->vstor_packet.u.vm_srb.srb_status = vm_srb->srb_status; request->vstor_packet.u.vm_srb.transfer_len = vm_srb->transfer_len; if (((vm_srb->scsi_status & 0xFF) == SCSI_STATUS_CHECK_COND) && @@ -2007,28 +2008,6 @@ create_storvsc_request(union ccb *ccb, s return(0); } -/* - * SCSI Inquiry checks qualifier and type. - * If qualifier is 011b, means the device server is not capable - * of supporting a peripheral device on this logical unit, and - * the type should be set to 1Fh. - * - * Return 1 if it is valid, 0 otherwise. - */ -static inline int -is_inquiry_valid(const struct scsi_inquiry_data *inq_data) -{ - uint8_t type; - if (SID_QUAL(inq_data) != SID_QUAL_LU_CONNECTED) { - return (0); - } - type = SID_TYPE(inq_data); - if (type == T_NODEVICE) { - return (0); - } - return (1); -} - /** * @brief completion function before returning to CAM * @@ -2047,7 +2026,6 @@ storvsc_io_done(struct hv_storvsc_reques struct vmscsi_req *vm_srb = &reqp->vstor_packet.u.vm_srb; bus_dma_segment_t *ori_sglist = NULL; int ori_sg_count = 0; - /* destroy bounce buffer if it is used */ if (reqp->bounce_sgl_count) { ori_sglist = (bus_dma_segment_t *)ccb->csio.data_ptr; @@ -2102,88 +2080,71 @@ storvsc_io_done(struct hv_storvsc_reques ccb->ccb_h.status &= ~CAM_STATUS_MASK; if (vm_srb->scsi_status == SCSI_STATUS_OK) { const struct scsi_generic *cmd; - /* - * Check whether the data for INQUIRY cmd is valid or - * not. Windows 10 and Windows 2016 send all zero - * inquiry data to VM even for unpopulated slots. - */ + + if (vm_srb->srb_status != SRB_STATUS_SUCCESS) { + if (vm_srb->srb_status == SRB_STATUS_INVALID_LUN) { + xpt_print(ccb->ccb_h.path, "invalid LUN %d\n", + vm_srb->lun); + } else { + xpt_print(ccb->ccb_h.path, "Unknown SRB flag: %d\n", + vm_srb->srb_status); + } + /* + * If there are errors, for example, invalid LUN, + * host will inform VM through SRB status. + */ + ccb->ccb_h.status |= CAM_SEL_TIMEOUT; + } else { + ccb->ccb_h.status |= CAM_REQ_CMP; + } + cmd = (const struct scsi_generic *) ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); if (cmd->opcode == INQUIRY) { - /* - * The host of Windows 10 or 2016 server will response - * the inquiry request with invalid data for unexisted device: - [0x7f 0x0 0x5 0x2 0x1f ... ] - * But on windows 2012 R2, the response is: - [0x7f 0x0 0x0 0x0 0x0 ] - * That is why here wants to validate the inquiry response. - * The validation will skip the INQUIRY whose response is short, - * which is less than SHORT_INQUIRY_LENGTH (36). - * - * For more information about INQUIRY, please refer to: - * ftp://ftp.avc-pioneer.com/Mtfuji_7/Proposal/Jun09/INQUIRY.pdf - */ - struct scsi_inquiry_data *inq_data = - (struct scsi_inquiry_data *)csio->data_ptr; - uint8_t* resp_buf = (uint8_t*)csio->data_ptr; - /* Get the buffer length reported by host */ - int resp_xfer_len = vm_srb->transfer_len; - /* Get the available buffer length */ - int resp_buf_len = resp_xfer_len >= 5 ? resp_buf[4] + 5 : 0; - int data_len = (resp_buf_len < resp_xfer_len) ? resp_buf_len : resp_xfer_len; - if (data_len < SHORT_INQUIRY_LENGTH) { - ccb->ccb_h.status |= CAM_REQ_CMP; - if (bootverbose && data_len >= 5) { - mtx_lock(&sc->hs_lock); - xpt_print(ccb->ccb_h.path, - "storvsc skips the validation for short inquiry (%d)" - " [%x %x %x %x %x]\n", - data_len,resp_buf[0],resp_buf[1],resp_buf[2], - resp_buf[3],resp_buf[4]); - mtx_unlock(&sc->hs_lock); - } - } else if (is_inquiry_valid(inq_data) == 0) { - ccb->ccb_h.status |= CAM_DEV_NOT_THERE; + struct scsi_inquiry_data *inq_data = + (struct scsi_inquiry_data *)csio->data_ptr; + uint8_t *resp_buf = (uint8_t *)csio->data_ptr; + int resp_xfer_len, resp_buf_len, data_len; + + /* Get the buffer length reported by host */ + resp_xfer_len = vm_srb->transfer_len; + /* Get the available buffer length */ + resp_buf_len = resp_xfer_len >= 5 ? resp_buf[4] + 5 : 0; + data_len = (resp_buf_len < resp_xfer_len) ? + resp_buf_len : resp_xfer_len; + if (bootverbose && data_len >= 5) { - mtx_lock(&sc->hs_lock); - xpt_print(ccb->ccb_h.path, - "storvsc uninstalled invalid device" - " [%x %x %x %x %x]\n", - resp_buf[0],resp_buf[1],resp_buf[2],resp_buf[3],resp_buf[4]); - mtx_unlock(&sc->hs_lock); + xpt_print(ccb->ccb_h.path, "storvsc inquiry " + "(%d) [%x %x %x %x %x ... ]\n", data_len, + resp_buf[0], resp_buf[1], resp_buf[2], + resp_buf[3], resp_buf[4]); } - } else { - char vendor[16]; - cam_strvis(vendor, inq_data->vendor, sizeof(inq_data->vendor), - sizeof(vendor)); - /** - * XXX: upgrade SPC2 to SPC3 if host is WIN8 or WIN2012 R2 - * in order to support UNMAP feature - */ - if (!strncmp(vendor,"Msft",4) && - SID_ANSI_REV(inq_data) == SCSI_REV_SPC2 && - (vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN8_1 || - vmstor_proto_version== VMSTOR_PROTOCOL_VERSION_WIN8)) { - inq_data->version = SCSI_REV_SPC3; - if (bootverbose) { - mtx_lock(&sc->hs_lock); - xpt_print(ccb->ccb_h.path, - "storvsc upgrades SPC2 to SPC3\n"); - mtx_unlock(&sc->hs_lock); + if (vm_srb->srb_status == SRB_STATUS_SUCCESS && + data_len > SHORT_INQUIRY_LENGTH) { + char vendor[16]; + + cam_strvis(vendor, inq_data->vendor, + sizeof(inq_data->vendor), sizeof(vendor)); + + /* + * XXX: Upgrade SPC2 to SPC3 if host is WIN8 or + * WIN2012 R2 in order to support UNMAP feature. + */ + if (!strncmp(vendor, "Msft", 4) && + SID_ANSI_REV(inq_data) == SCSI_REV_SPC2 && + (vmstor_proto_version == + VMSTOR_PROTOCOL_VERSION_WIN8_1 || + vmstor_proto_version == + VMSTOR_PROTOCOL_VERSION_WIN8)) { + inq_data->version = SCSI_REV_SPC3; + if (bootverbose) { + xpt_print(ccb->ccb_h.path, + "storvsc upgrades " + "SPC2 to SPC3\n"); + } } } - ccb->ccb_h.status |= CAM_REQ_CMP; - if (bootverbose) { - mtx_lock(&sc->hs_lock); - xpt_print(ccb->ccb_h.path, - "storvsc has passed inquiry response (%d) validation\n", - data_len); - mtx_unlock(&sc->hs_lock); - } - } - } else { - ccb->ccb_h.status |= CAM_REQ_CMP; } } else { mtx_lock(&sc->hs_lock); Modified: head/sys/dev/hyperv/storvsc/hv_vstorage.h ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_vstorage.h Wed Aug 17 04:41:47 2016 (r304250) +++ head/sys/dev/hyperv/storvsc/hv_vstorage.h Wed Aug 17 05:02:18 2016 (r304251) @@ -249,9 +249,9 @@ struct vstor_packet { /** * SRB Status Masks (can be combined with above status codes) */ -#define SRB_STATUS_QUEUE_FROZEN 0x40 -#define SRB_STATUS_AUTOSENSE_VALID 0x80 - +#define SRB_STATUS_QUEUE_FROZEN 0x40 +#define SRB_STATUS_AUTOSENSE_VALID 0x80 +#define SRB_STATUS_INVALID_LUN 0X20 /** * Packet flags From owner-svn-src-head@freebsd.org Wed Aug 17 05:14:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE5B5BBC3DE; Wed, 17 Aug 2016 05:14:27 +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 8E085121E; Wed, 17 Aug 2016 05:14:27 +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 u7H5EQqK058404; Wed, 17 Aug 2016 05:14:26 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H5EQrI058402; Wed, 17 Aug 2016 05:14:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170514.u7H5EQrI058402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 05:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304252 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 05:14:27 -0000 Author: sephe Date: Wed Aug 17 05:14:26 2016 New Revision: 304252 URL: https://svnweb.freebsd.org/changeset/base/304252 Log: hyperv/hn: Ignore the useless TX table. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7514 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/if_hnreg.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:02:18 2016 (r304251) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:14:26 2016 (r304252) @@ -930,44 +930,17 @@ retry_send_cmplt: } } -/* - * Net VSC receiving vRSS send table from VSP - */ static void -hv_nv_send_table(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt) +hn_proc_notify(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt) { - netvsc_dev *net_dev; - const nvsp_msg *nvsp_msg_pkt; - int i; - uint32_t count; - const uint32_t *table; - - net_dev = hv_nv_get_inbound_net_device(sc); - if (!net_dev) - return; + const struct hn_nvs_hdr *hdr; - nvsp_msg_pkt = VMBUS_CHANPKT_CONST_DATA(pkt); - - if (nvsp_msg_pkt->hdr.msg_type != - nvsp_msg5_type_send_indirection_table) { - printf("Netvsc: !Warning! receive msg type not " - "send_indirection_table. type = %d\n", - nvsp_msg_pkt->hdr.msg_type); + hdr = VMBUS_CHANPKT_CONST_DATA(pkt); + if (hdr->nvs_type == HN_NVS_TYPE_TXTBL_NOTE) { + /* Useless; ignore */ return; } - - count = nvsp_msg_pkt->msgs.vers_5_msgs.send_table.count; - if (count != VRSS_SEND_TABLE_SIZE) { - printf("Netvsc: Received wrong send table size: %u\n", count); - return; - } - - table = (const uint32_t *) - ((const uint8_t *)&nvsp_msg_pkt->msgs.vers_5_msgs.send_table + - nvsp_msg_pkt->msgs.vers_5_msgs.send_table.offset); - - for (i = 0; i < count; i++) - net_dev->vrss_send_table[i] = table[i]; + if_printf(sc->hn_ifp, "got notify, nvs type %u\n", hdr->nvs_type); } /* @@ -1005,7 +978,7 @@ hv_nv_on_channel_callback(struct vmbus_c hv_nv_on_receive(net_dev, rxr, chan, pkt); break; case VMBUS_CHANPKT_TYPE_INBAND: - hv_nv_send_table(sc, pkt); + hn_proc_notify(sc, pkt); break; default: if_printf(rxr->hn_ifp, Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Wed Aug 17 05:02:18 2016 (r304251) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Wed Aug 17 05:14:26 2016 (r304252) @@ -59,8 +59,11 @@ #define HN_NVS_TYPE_CHIM_DISCONN 106 #define HN_NVS_TYPE_RNDIS 107 #define HN_NVS_TYPE_NDIS_CONF 125 +#define HN_NVS_TYPE_VFASSOC_NOTE 128 /* notification */ +#define HN_NVS_TYPE_SET_DATAPATH 129 #define HN_NVS_TYPE_SUBCH_REQ 133 #define HN_NVS_TYPE_SUBCH_RESP 133 /* same as SUBCH_REQ */ +#define HN_NVS_TYPE_TXTBL_NOTE 134 /* notification */ /* * Any size less than this one will _not_ work, e.g. hn_nvs_init From owner-svn-src-head@freebsd.org Wed Aug 17 05:25:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81CCCBBC6A1; Wed, 17 Aug 2016 05:25:48 +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 2BD561703; Wed, 17 Aug 2016 05:25:48 +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 u7H5Pl2h062167; Wed, 17 Aug 2016 05:25:47 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H5PlU1062165; Wed, 17 Aug 2016 05:25:47 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170525.u7H5PlU1062165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 05:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304253 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 05:25:48 -0000 Author: sephe Date: Wed Aug 17 05:25:47 2016 New Revision: 304253 URL: https://svnweb.freebsd.org/changeset/base/304253 Log: hyperv/hn: Simplify RNDIS RX packets acknowledgement. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7515 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/if_hnreg.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:14:26 2016 (r304252) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:25:47 2016 (r304253) @@ -902,20 +902,17 @@ static void hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid, uint32_t status) { - nvsp_msg rx_comp_msg; + struct hn_nvs_rndis_ack ack; int retries = 0; int ret = 0; - rx_comp_msg.hdr.msg_type = nvsp_msg_1_type_send_rndis_pkt_complete; - - /* Pass in the status */ - rx_comp_msg.msgs.vers_1_msgs.send_rndis_pkt_complete.status = - status; + ack.nvs_type = HN_NVS_TYPE_RNDIS_ACK; + ack.nvs_status = status; retry_send_cmplt: /* Send the completion */ - ret = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_COMP, 0, - &rx_comp_msg, sizeof(nvsp_msg), tid); + ret = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_COMP, + VMBUS_CHANPKT_FLAG_NONE, &ack, sizeof(ack), tid); if (ret == 0) { /* success */ /* no-op */ Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Wed Aug 17 05:14:26 2016 (r304252) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Wed Aug 17 05:25:47 2016 (r304253) @@ -44,6 +44,7 @@ * NVS message transacion status codes. */ #define HN_NVS_STATUS_OK 1 +#define HN_NVS_STATUS_FAILED 2 /* * NVS request/response message types. @@ -58,6 +59,7 @@ #define HN_NVS_TYPE_CHIM_CONNRESP 105 #define HN_NVS_TYPE_CHIM_DISCONN 106 #define HN_NVS_TYPE_RNDIS 107 +#define HN_NVS_TYPE_RNDIS_ACK 108 #define HN_NVS_TYPE_NDIS_CONF 125 #define HN_NVS_TYPE_VFASSOC_NOTE 128 /* notification */ #define HN_NVS_TYPE_SET_DATAPATH 129 @@ -199,4 +201,11 @@ struct hn_nvs_rndis { } __packed; CTASSERT(sizeof(struct hn_nvs_rndis) >= HN_NVS_REQSIZE_MIN); +struct hn_nvs_rndis_ack { + uint32_t nvs_type; /* HN_NVS_TYPE_RNDIS_ACK */ + uint32_t nvs_status; /* HN_NVS_STATUS_ */ + uint8_t nvs_rsvd[24]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_rndis_ack) >= HN_NVS_REQSIZE_MIN); + #endif /* !_IF_HNREG_H_ */ From owner-svn-src-head@freebsd.org Wed Aug 17 05:34:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 999ADBBC9CD; Wed, 17 Aug 2016 05:34:03 +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 5CB591CD1; Wed, 17 Aug 2016 05:34:03 +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 u7H5Y2Fv065918; Wed, 17 Aug 2016 05:34:02 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H5Y2DO065914; Wed, 17 Aug 2016 05:34:02 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170534.u7H5Y2DO065914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 05:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304254 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 05:34:03 -0000 Author: sephe Date: Wed Aug 17 05:34:02 2016 New Revision: 304254 URL: https://svnweb.freebsd.org/changeset/base/304254 Log: hyperv/hn: Remove reference to nvsp_msg MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7516 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:25:47 2016 (r304253) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:34:02 2016 (r304254) @@ -72,7 +72,7 @@ static void hv_nv_on_receive(netvsc_dev const struct vmbus_chanpkt_hdr *pkt); static void hn_nvs_sent_none(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, - const struct nvsp_msg_ *msg, int); + const void *, int); static struct hn_send_ctx hn_send_ctx_none = HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL); @@ -756,16 +756,16 @@ hv_nv_on_device_remove(struct hn_softc * void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev __unused, struct vmbus_channel *chan __unused, - const struct nvsp_msg_ *msg, int dlen) + const void *data, int dlen) { - vmbus_xact_wakeup(sndc->hn_cbarg, msg, dlen); + vmbus_xact_wakeup(sndc->hn_cbarg, data, dlen); } static void hn_nvs_sent_none(struct hn_send_ctx *sndc __unused, struct netvsc_dev_ *net_dev __unused, struct vmbus_channel *chan __unused, - const struct nvsp_msg_ *msg __unused, int dlen __unused) + const void *data __unused, int dlen __unused) { /* EMPTY */ } Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Aug 17 05:25:47 2016 (r304253) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Aug 17 05:34:02 2016 (r304254) @@ -792,8 +792,7 @@ hn_txeof(struct hn_tx_ring *txr) static void hn_tx_done(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, - struct vmbus_channel *chan, const struct nvsp_msg_ *msg __unused, - int dlen __unused) + struct vmbus_channel *chan, const void *data __unused, int dlen __unused) { struct hn_txdesc *txd = sndc->hn_cbarg; struct hn_tx_ring *txr; Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 17 05:25:47 2016 (r304253) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 17 05:34:02 2016 (r304254) @@ -93,10 +93,10 @@ hv_rf_send_offload_request(struct hn_sof static void hn_rndis_sent_halt(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, - const struct nvsp_msg_ *msg, int dlen); + const void *data, int dlen); static void hn_rndis_sent_cb(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, - const struct nvsp_msg_ *msg, int dlen); + const void *data, int dlen); /* * Set the Per-Packet-Info with the specified type @@ -1272,7 +1272,7 @@ hv_rf_on_close(struct hn_softc *sc) static void hn_rndis_sent_cb(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, - struct vmbus_channel *chan __unused, const struct nvsp_msg_ *msg __unused, + struct vmbus_channel *chan __unused, const void *data __unused, int dlen __unused) { if (sndc->hn_chim_idx != HN_NVS_CHIM_IDX_INVALID) @@ -1281,7 +1281,7 @@ hn_rndis_sent_cb(struct hn_send_ctx *snd static void hn_rndis_sent_halt(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, - struct vmbus_channel *chan __unused, const struct nvsp_msg_ *msg __unused, + struct vmbus_channel *chan __unused, const void *data __unused, int dlen __unused) { rndis_request *request = sndc->hn_cbarg; Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Wed Aug 17 05:25:47 2016 (r304253) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Wed Aug 17 05:34:02 2016 (r304254) @@ -42,7 +42,7 @@ struct hn_send_ctx; typedef void (*hn_sent_callback_t) (struct hn_send_ctx *, struct netvsc_dev_ *, - struct vmbus_channel *, const struct nvsp_msg_ *, int); + struct vmbus_channel *, const void *, int); struct hn_send_ctx { hn_sent_callback_t hn_cb; @@ -98,7 +98,7 @@ hn_nvs_send_sglist(struct vmbus_channel void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, - const struct nvsp_msg_ *msg, int dlen); + const void *data, int dlen); void hn_chim_free(struct netvsc_dev_ *net_dev, uint32_t chim_idx); #endif /* !_IF_HNVAR_H_ */ From owner-svn-src-head@freebsd.org Wed Aug 17 05:45:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90354BBCD44; Wed, 17 Aug 2016 05:45:58 +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 5461913CD; Wed, 17 Aug 2016 05:45: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 u7H5jv9w069956; Wed, 17 Aug 2016 05:45:57 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H5jvMe069954; Wed, 17 Aug 2016 05:45:57 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170545.u7H5jvMe069954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 05:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304255 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 05:45:58 -0000 Author: sephe Date: Wed Aug 17 05:45:57 2016 New Revision: 304255 URL: https://svnweb.freebsd.org/changeset/base/304255 Log: hyperv/hn: Remove reference to nvsp_status MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7517 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:34:02 2016 (r304254) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:45:57 2016 (r304255) @@ -852,7 +852,7 @@ hv_nv_on_receive(netvsc_dev *net_dev, st netvsc_packet *net_vsc_pkt = &vsc_pkt; int count = 0; int i = 0; - int status = nvsp_status_success; + int status = HN_NVS_STATUS_OK; /* Make sure that this is a RNDIS message. */ nvs_hdr = VMBUS_CHANPKT_CONST_DATA(pkthdr); @@ -874,15 +874,16 @@ hv_nv_on_receive(netvsc_dev *net_dev, st /* Each range represents 1 RNDIS pkt that contains 1 Ethernet frame */ for (i = 0; i < count; i++) { - net_vsc_pkt->status = nvsp_status_success; + net_vsc_pkt->status = HN_NVS_STATUS_OK; net_vsc_pkt->data = ((uint8_t *)net_dev->rx_buf + pkt->cp_rxbuf[i].rb_ofs); net_vsc_pkt->tot_data_buf_len = pkt->cp_rxbuf[i].rb_len; hv_rf_on_receive(net_dev, rxr, net_vsc_pkt); - if (net_vsc_pkt->status != nvsp_status_success) { - status = nvsp_status_failure; - } + + /* XXX pretty broken; whack it */ + if (net_vsc_pkt->status != HN_NVS_STATUS_OK) + status = HN_NVS_STATUS_FAILED; } /* Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 17 05:34:02 2016 (r304254) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 17 05:45:57 2016 (r304255) @@ -544,7 +544,7 @@ hv_rf_receive_data(struct hn_rx_ring *rx pkt->tot_data_buf_len -= data_offset; if (pkt->tot_data_buf_len < rndis_pkt->data_length) { - pkt->status = nvsp_status_failure; + pkt->status = HN_NVS_STATUS_FAILED; if_printf(rxr->hn_ifp, "total length %u is less than data length %u\n", pkt->tot_data_buf_len, rndis_pkt->data_length); @@ -555,7 +555,7 @@ hv_rf_receive_data(struct hn_rx_ring *rx pkt->data = (void *)((unsigned long)pkt->data + data_offset); if (hv_rf_find_recvinfo(rndis_pkt, &info)) { - pkt->status = nvsp_status_failure; + pkt->status = HN_NVS_STATUS_FAILED; if_printf(rxr->hn_ifp, "recvinfo parsing failed\n"); return; } @@ -580,13 +580,13 @@ hv_rf_on_receive(netvsc_dev *net_dev, /* Make sure the rndis device state is initialized */ if (net_dev->extension == NULL) { - pkt->status = nvsp_status_failure; + pkt->status = HN_NVS_STATUS_FAILED; return (ENODEV); } rndis_dev = (rndis_device *)net_dev->extension; if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) { - pkt->status = nvsp_status_failure; + pkt->status = HN_NVS_STATUS_FAILED; return (EINVAL); } From owner-svn-src-head@freebsd.org Wed Aug 17 05:57:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AEB8BBCFC4; Wed, 17 Aug 2016 05:57:11 +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 F225919FF; Wed, 17 Aug 2016 05:57:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H5vAiF073759; Wed, 17 Aug 2016 05:57:10 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H5vASH073757; Wed, 17 Aug 2016 05:57:10 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170557.u7H5vASH073757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 05:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304256 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 05:57:11 -0000 Author: sephe Date: Wed Aug 17 05:57:10 2016 New Revision: 304256 URL: https://svnweb.freebsd.org/changeset/base/304256 Log: hyperv/hn: Get rid of unused bits MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7518 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:45:57 2016 (r304255) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:57:10 2016 (r304256) @@ -690,8 +690,6 @@ hv_nv_on_device_add(struct hn_softc *sc, /* Initialize the NetVSC channel extension */ - sema_init(&net_dev->channel_init_sema, 0, "netdev_sema"); - /* * Open the channel */ @@ -722,7 +720,6 @@ cleanup: * Free the packet buffers on the netvsc device packet queue. * Release other resources. */ - sema_destroy(&net_dev->channel_init_sema); free(net_dev, M_NETVSC); return (NULL); @@ -747,7 +744,6 @@ hv_nv_on_device_remove(struct hn_softc * vmbus_chan_close(sc->hn_prichan); - sema_destroy(&net_dev->channel_init_sema); free(net_dev, M_NETVSC); return (0); Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Aug 17 05:45:57 2016 (r304255) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Aug 17 05:57:10 2016 (r304256) @@ -177,834 +177,6 @@ typedef struct rndis_recv_scale_param_ { uint32_t processor_masks_entry_size; } rndis_recv_scale_param; -typedef enum nvsp_msg_type_ { - nvsp_msg_type_none = 0, - - /* - * Init Messages - */ - nvsp_msg_type_init = 1, - nvsp_msg_type_init_complete = 2, - - nvsp_version_msg_start = 100, - - /* - * Version 1 Messages - */ - nvsp_msg_1_type_send_ndis_vers = nvsp_version_msg_start, - - nvsp_msg_1_type_send_rx_buf, - nvsp_msg_1_type_send_rx_buf_complete, - nvsp_msg_1_type_revoke_rx_buf, - - nvsp_msg_1_type_send_send_buf, - nvsp_msg_1_type_send_send_buf_complete, - nvsp_msg_1_type_revoke_send_buf, - - nvsp_msg_1_type_send_rndis_pkt, - nvsp_msg_1_type_send_rndis_pkt_complete, - - /* - * Version 2 Messages - */ - nvsp_msg_2_type_send_chimney_delegated_buf, - nvsp_msg_2_type_send_chimney_delegated_buf_complete, - nvsp_msg_2_type_revoke_chimney_delegated_buf, - - nvsp_msg_2_type_resume_chimney_rx_indication, - - nvsp_msg_2_type_terminate_chimney, - nvsp_msg_2_type_terminate_chimney_complete, - - nvsp_msg_2_type_indicate_chimney_event, - - nvsp_msg_2_type_send_chimney_packet, - nvsp_msg_2_type_send_chimney_packet_complete, - - nvsp_msg_2_type_post_chimney_rx_request, - nvsp_msg_2_type_post_chimney_rx_request_complete, - - nvsp_msg_2_type_alloc_rx_buf, - nvsp_msg_2_type_alloc_rx_buf_complete, - - nvsp_msg_2_type_free_rx_buf, - - nvsp_msg_2_send_vmq_rndis_pkt, - nvsp_msg_2_send_vmq_rndis_pkt_complete, - - nvsp_msg_2_type_send_ndis_config, - - nvsp_msg_2_type_alloc_chimney_handle, - nvsp_msg_2_type_alloc_chimney_handle_complete, - - nvsp_msg2_max = nvsp_msg_2_type_alloc_chimney_handle_complete, - - /* - * Version 4 Messages - */ - nvsp_msg4_type_send_vf_association, - nvsp_msg4_type_switch_data_path, - nvsp_msg4_type_uplink_connect_state_deprecated, - - nvsp_msg4_max = nvsp_msg4_type_uplink_connect_state_deprecated, - - /* - * Version 5 Messages - */ - nvsp_msg5_type_oid_query_ex, - nvsp_msg5_type_oid_query_ex_comp, - nvsp_msg5_type_subchannel, - nvsp_msg5_type_send_indirection_table, - - nvsp_msg5_max = nvsp_msg5_type_send_indirection_table, -} nvsp_msg_type; - -typedef enum nvsp_status_ { - nvsp_status_none = 0, - nvsp_status_success, - nvsp_status_failure, - /* Deprecated */ - nvsp_status_prot_vers_range_too_new, - /* Deprecated */ - nvsp_status_prot_vers_range_too_old, - nvsp_status_invalid_rndis_pkt, - nvsp_status_busy, - nvsp_status_max, -} nvsp_status; - -typedef struct nvsp_msg_hdr_ { - uint32_t msg_type; -} __packed nvsp_msg_hdr; - -/* - * Init Messages - */ - -/* - * This message is used by the VSC to initialize the channel - * after the channels has been opened. This message should - * never include anything other then versioning (i.e. this - * message will be the same for ever). - * - * Forever is a long time. The values have been redefined - * in Win7 to indicate major and minor protocol version - * number. - */ -typedef struct nvsp_msg_init_ { - union { - struct { - uint16_t minor_protocol_version; - uint16_t major_protocol_version; - } s; - /* Formerly min_protocol_version */ - uint32_t protocol_version; - } p1; - /* Formerly max_protocol_version */ - uint32_t protocol_version_2; -} __packed nvsp_msg_init; - -/* - * This message is used by the VSP to complete the initialization - * of the channel. This message should never include anything other - * then versioning (i.e. this message will be the same forever). - */ -typedef struct nvsp_msg_init_complete_ { - /* Deprecated */ - uint32_t negotiated_prot_vers; - uint32_t max_mdl_chain_len; - uint32_t status; -} __packed nvsp_msg_init_complete; - -typedef union nvsp_msg_init_uber_ { - nvsp_msg_init init; - nvsp_msg_init_complete init_compl; -} __packed nvsp_msg_init_uber; - -/* - * Version 1 Messages - */ - -/* - * This message is used by the VSC to send the NDIS version - * to the VSP. The VSP can use this information when handling - * OIDs sent by the VSC. - */ -typedef struct nvsp_1_msg_send_ndis_version_ { - uint32_t ndis_major_vers; - /* Deprecated */ - uint32_t ndis_minor_vers; -} __packed nvsp_1_msg_send_ndis_version; - -/* - * This message is used by the VSC to send a receive buffer - * to the VSP. The VSP can then use the receive buffer to - * send data to the VSC. - */ -typedef struct nvsp_1_msg_send_rx_buf_ { - uint32_t gpadl_handle; - uint16_t id; -} __packed nvsp_1_msg_send_rx_buf; - -typedef struct nvsp_1_rx_buf_section_ { - uint32_t offset; - uint32_t sub_allocation_size; - uint32_t num_sub_allocations; - uint32_t end_offset; -} __packed nvsp_1_rx_buf_section; - -/* - * This message is used by the VSP to acknowledge a receive - * buffer send by the VSC. This message must be sent by the - * VSP before the VSP uses the receive buffer. - */ -typedef struct nvsp_1_msg_send_rx_buf_complete_ { - uint32_t status; - uint32_t num_sections; - - /* - * The receive buffer is split into two parts, a large - * suballocation section and a small suballocation - * section. These sections are then suballocated by a - * certain size. - * - * For example, the following break up of the receive - * buffer has 6 large suballocations and 10 small - * suballocations. - * - * | Large Section | | Small Section | - * ------------------------------------------------------------ - * | | | | | | | | | | | | | | | | | | - * | | - * LargeOffset SmallOffset - */ - nvsp_1_rx_buf_section sections[1]; - -} __packed nvsp_1_msg_send_rx_buf_complete; - -/* - * This message is sent by the VSC to revoke the receive buffer. - * After the VSP completes this transaction, the VSP should never - * use the receive buffer again. - */ -typedef struct nvsp_1_msg_revoke_rx_buf_ { - uint16_t id; -} __packed nvsp_1_msg_revoke_rx_buf; - -/* - * This message is used by the VSC to send a send buffer - * to the VSP. The VSC can then use the send buffer to - * send data to the VSP. - */ -typedef struct nvsp_1_msg_send_send_buf_ { - uint32_t gpadl_handle; - uint16_t id; -} __packed nvsp_1_msg_send_send_buf; - -/* - * This message is used by the VSP to acknowledge a send - * buffer sent by the VSC. This message must be sent by the - * VSP before the VSP uses the sent buffer. - */ -typedef struct nvsp_1_msg_send_send_buf_complete_ { - uint32_t status; - - /* - * The VSC gets to choose the size of the send buffer and - * the VSP gets to choose the sections size of the buffer. - * This was done to enable dynamic reconfigurations when - * the cost of GPA-direct buffers decreases. - */ - uint32_t section_size; -} __packed nvsp_1_msg_send_send_buf_complete; - -/* - * This message is sent by the VSC to revoke the send buffer. - * After the VSP completes this transaction, the vsp should never - * use the send buffer again. - */ -typedef struct nvsp_1_msg_revoke_send_buf_ { - uint16_t id; -} __packed nvsp_1_msg_revoke_send_buf; - -/* - * This message is used by both the VSP and the VSC to send - * an RNDIS message to the opposite channel endpoint. - */ -typedef struct nvsp_1_msg_send_rndis_pkt_ { - /* - * This field is specified by RNIDS. They assume there's - * two different channels of communication. However, - * the Network VSP only has one. Therefore, the channel - * travels with the RNDIS packet. - */ - uint32_t chan_type; - - /* - * This field is used to send part or all of the data - * through a send buffer. This values specifies an - * index into the send buffer. If the index is - * 0xFFFFFFFF, then the send buffer is not being used - * and all of the data was sent through other VMBus - * mechanisms. - */ - uint32_t send_buf_section_idx; - uint32_t send_buf_section_size; -} __packed nvsp_1_msg_send_rndis_pkt; - -/* - * This message is used by both the VSP and the VSC to complete - * a RNDIS message to the opposite channel endpoint. At this - * point, the initiator of this message cannot use any resources - * associated with the original RNDIS packet. - */ -typedef struct nvsp_1_msg_send_rndis_pkt_complete_ { - uint32_t status; -} __packed nvsp_1_msg_send_rndis_pkt_complete; - - -/* - * Version 2 Messages - */ - -/* - * This message is used by the VSC to send the NDIS version - * to the VSP. The VSP can use this information when handling - * OIDs sent by the VSC. - */ -typedef struct nvsp_2_netvsc_capabilities_ { - union { - uint64_t as_uint64; - struct { - uint64_t vmq : 1; - uint64_t chimney : 1; - uint64_t sriov : 1; - uint64_t ieee8021q : 1; - uint64_t correlationid : 1; - uint64_t teaming : 1; - } u2; - } u1; -} __packed nvsp_2_netvsc_capabilities; - -typedef struct nvsp_2_msg_send_ndis_config_ { - uint32_t mtu; - uint32_t reserved; - nvsp_2_netvsc_capabilities capabilities; -} __packed nvsp_2_msg_send_ndis_config; - -/* - * NvspMessage2TypeSendChimneyDelegatedBuffer - */ -typedef struct nvsp_2_msg_send_chimney_buf_ -{ - /* - * On WIN7 beta, delegated_obj_max_size is defined as a uint32_t - * Since WIN7 RC, it was split into two uint16_t. To have the same - * struct layout, delegated_obj_max_size shall be the first field. - */ - uint16_t delegated_obj_max_size; - - /* - * The revision # of chimney protocol used between NVSC and NVSP. - * - * This revision is NOT related to the chimney revision between - * NDIS protocol and miniport drivers. - */ - uint16_t revision; - - uint32_t gpadl_handle; -} __packed nvsp_2_msg_send_chimney_buf; - - -/* Unsupported chimney revision 0 (only present in WIN7 beta) */ -#define NVSP_CHIMNEY_REVISION_0 0 - -/* WIN7 Beta Chimney QFE */ -#define NVSP_CHIMNEY_REVISION_1 1 - -/* The chimney revision since WIN7 RC */ -#define NVSP_CHIMNEY_REVISION_2 2 - - -/* - * NvspMessage2TypeSendChimneyDelegatedBufferComplete - */ -typedef struct nvsp_2_msg_send_chimney_buf_complete_ { - uint32_t status; - - /* - * Maximum number outstanding sends and pre-posted receives. - * - * NVSC should not post more than SendQuota/ReceiveQuota packets. - * Otherwise, it can block the non-chimney path for an indefinite - * amount of time. - * (since chimney sends/receives are affected by the remote peer). - * - * Note: NVSP enforces the quota restrictions on a per-VMBCHANNEL - * basis. It doesn't enforce the restriction separately for chimney - * send/receive. If NVSC doesn't voluntarily enforce "SendQuota", - * it may kill its own network connectivity. - */ - uint32_t send_quota; - uint32_t rx_quota; -} __packed nvsp_2_msg_send_chimney_buf_complete; - -/* - * NvspMessage2TypeRevokeChimneyDelegatedBuffer - */ -typedef struct nvsp_2_msg_revoke_chimney_buf_ { - uint32_t gpadl_handle; -} __packed nvsp_2_msg_revoke_chimney_buf; - - -#define NVSP_CHIMNEY_OBJECT_TYPE_NEIGHBOR 0 -#define NVSP_CHIMNEY_OBJECT_TYPE_PATH4 1 -#define NVSP_CHIMNEY_OBJECT_TYPE_PATH6 2 -#define NVSP_CHIMNEY_OBJECT_TYPE_TCP 3 - -/* - * NvspMessage2TypeAllocateChimneyHandle - */ -typedef struct nvsp_2_msg_alloc_chimney_handle_ { - uint64_t vsc_context; - uint32_t object_type; -} __packed nvsp_2_msg_alloc_chimney_handle; - -/* - * NvspMessage2TypeAllocateChimneyHandleComplete - */ -typedef struct nvsp_2_msg_alloc_chimney_handle_complete_ { - uint32_t vsp_handle; -} __packed nvsp_2_msg_alloc_chimney_handle_complete; - - -/* - * NvspMessage2TypeResumeChimneyRXIndication - */ -typedef struct nvsp_2_msg_resume_chimney_rx_indication { - /* - * Handle identifying the offloaded connection - */ - uint32_t vsp_tcp_handle; -} __packed nvsp_2_msg_resume_chimney_rx_indication; - - -#define NVSP_2_MSG_TERMINATE_CHIMNEY_FLAGS_FIRST_STAGE (0x01u) -#define NVSP_2_MSG_TERMINATE_CHIMNEY_FLAGS_RESERVED (~(0x01u)) - -/* - * NvspMessage2TypeTerminateChimney - */ -typedef struct nvsp_2_msg_terminate_chimney_ { - /* - * Handle identifying the offloaded object - */ - uint32_t vsp_handle; - - /* - * Terminate Offload Flags - * Bit 0: - * When set to 0, terminate the offload at the destination NIC - * Bit 1-31: Reserved, shall be zero - */ - uint32_t flags; - - union { - /* - * This field is valid only when bit 0 of flags is clear. - * It specifies the index into the premapped delegated - * object buffer. The buffer was sent through the - * NvspMessage2TypeSendChimneyDelegatedBuffer - * message at initialization time. - * - * NVSP will write the delegated state into the delegated - * buffer upon upload completion. - */ - uint32_t index; - - /* - * This field is valid only when bit 0 of flags is set. - * - * The seqence number of the most recently accepted RX - * indication when VSC sets its TCP context into - * "terminating" state. - * - * This allows NVSP to determines if there are any in-flight - * RX indications for which the acceptance state is still - * undefined. - */ - uint64_t last_accepted_rx_seq_no; - } f0; -} __packed nvsp_2_msg_terminate_chimney; - - -#define NVSP_TERMINATE_CHIMNEY_COMPLETE_FLAG_DATA_CORRUPTED 0x0000001u - -/* - * NvspMessage2TypeTerminateChimneyComplete - */ -typedef struct nvsp_2_msg_terminate_chimney_complete_ { - uint64_t vsc_context; - uint32_t flags; -} __packed nvsp_2_msg_terminate_chimney_complete; - -/* - * NvspMessage2TypeIndicateChimneyEvent - */ -typedef struct nvsp_2_msg_indicate_chimney_event_ { - /* - * When VscTcpContext is 0, event_type is an NDIS_STATUS event code - * Otherwise, EventType is an TCP connection event (defined in - * NdisTcpOffloadEventHandler chimney DDK document). - */ - uint32_t event_type; - - /* - * When VscTcpContext is 0, EventType is an NDIS_STATUS event code - * Otherwise, EventType is an TCP connection event specific information - * (defined in NdisTcpOffloadEventHandler chimney DDK document). - */ - uint32_t event_specific_info; - - /* - * If not 0, the event is per-TCP connection event. This field - * contains the VSC's TCP context. - * If 0, the event indication is global. - */ - uint64_t vsc_tcp_context; -} __packed nvsp_2_msg_indicate_chimney_event; - - -#define NVSP_1_CHIMNEY_SEND_INVALID_OOB_INDEX 0xffffu -#define NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX 0xffffffff - -/* - * NvspMessage2TypeSendChimneyPacket - */ -typedef struct nvsp_2_msg_send_chimney_pkt_ { - /* - * Identify the TCP connection for which this chimney send is - */ - uint32_t vsp_tcp_handle; - - /* - * This field is used to send part or all of the data - * through a send buffer. This values specifies an - * index into the send buffer. If the index is - * 0xFFFF, then the send buffer is not being used - * and all of the data was sent through other VMBus - * mechanisms. - */ - uint16_t send_buf_section_index; - uint16_t send_buf_section_size; - - /* - * OOB Data Index - * This an index to the OOB data buffer. If the index is 0xFFFFFFFF, - * then there is no OOB data. - * - * This field shall be always 0xFFFFFFFF for now. It is reserved for - * the future. - */ - uint16_t oob_data_index; - - /* - * DisconnectFlags = 0 - * Normal chimney send. See MiniportTcpOffloadSend for details. - * - * DisconnectFlags = TCP_DISCONNECT_GRACEFUL_CLOSE (0x01) - * Graceful disconnect. See MiniportTcpOffloadDisconnect for details. - * - * DisconnectFlags = TCP_DISCONNECT_ABORTIVE_CLOSE (0x02) - * Abortive disconnect. See MiniportTcpOffloadDisconnect for details. - */ - uint16_t disconnect_flags; - - uint32_t seq_no; -} __packed nvsp_2_msg_send_chimney_pkt; - -/* - * NvspMessage2TypeSendChimneyPacketComplete - */ -typedef struct nvsp_2_msg_send_chimney_pkt_complete_ { - /* - * The NDIS_STATUS for the chimney send - */ - uint32_t status; - - /* - * Number of bytes that have been sent to the peer (and ACKed by the peer). - */ - uint32_t bytes_transferred; -} __packed nvsp_2_msg_send_chimney_pkt_complete; - - -#define NVSP_1_CHIMNEY_RECV_FLAG_NO_PUSH 0x0001u -#define NVSP_1_CHIMNEY_RECV_INVALID_OOB_INDEX 0xffffu - -/* - * NvspMessage2TypePostChimneyRecvRequest - */ -typedef struct nvsp_2_msg_post_chimney_rx_request_ { - /* - * Identify the TCP connection which this chimney receive request - * is for. - */ - uint32_t vsp_tcp_handle; - - /* - * OOB Data Index - * This an index to the OOB data buffer. If the index is 0xFFFFFFFF, - * then there is no OOB data. - * - * This field shall be always 0xFFFFFFFF for now. It is reserved for - * the future. - */ - uint32_t oob_data_index; - - /* - * Bit 0 - * When it is set, this is a "no-push" receive. - * When it is clear, this is a "push" receive. - * - * Bit 1-15: Reserved and shall be zero - */ - uint16_t flags; - - /* - * For debugging and diagnoses purpose. - * The SeqNo is per TCP connection and starts from 0. - */ - uint32_t seq_no; -} __packed nvsp_2_msg_post_chimney_rx_request; - -/* - * NvspMessage2TypePostChimneyRecvRequestComplete - */ -typedef struct nvsp_2_msg_post_chimney_rx_request_complete_ { - /* - * The NDIS_STATUS for the chimney send - */ - uint32_t status; - - /* - * Number of bytes that have been sent to the peer (and ACKed by - * the peer). - */ - uint32_t bytes_xferred; -} __packed nvsp_2_msg_post_chimney_rx_request_complete; - -/* - * NvspMessage2TypeAllocateReceiveBuffer - */ -typedef struct nvsp_2_msg_alloc_rx_buf_ { - /* - * Allocation ID to match the allocation request and response - */ - uint32_t allocation_id; - - /* - * Length of the VM shared memory receive buffer that needs to - * be allocated - */ - uint32_t length; -} __packed nvsp_2_msg_alloc_rx_buf; - -/* - * NvspMessage2TypeAllocateReceiveBufferComplete - */ -typedef struct nvsp_2_msg_alloc_rx_buf_complete_ { - /* - * The NDIS_STATUS code for buffer allocation - */ - uint32_t status; - - /* - * Allocation ID from NVSP_2_MESSAGE_ALLOCATE_RECEIVE_BUFFER - */ - uint32_t allocation_id; - - /* - * GPADL handle for the allocated receive buffer - */ - uint32_t gpadl_handle; - - /* - * Receive buffer ID that is further used in - * NvspMessage2SendVmqRndisPacket - */ - uint64_t rx_buf_id; -} __packed nvsp_2_msg_alloc_rx_buf_complete; - -/* - * NvspMessage2TypeFreeReceiveBuffer - */ -typedef struct nvsp_2_msg_free_rx_buf_ { - /* - * Receive buffer ID previous returned in - * NvspMessage2TypeAllocateReceiveBufferComplete message - */ - uint64_t rx_buf_id; -} __packed nvsp_2_msg_free_rx_buf; - -/* - * This structure is used in defining the buffers in - * NVSP_2_MESSAGE_SEND_VMQ_RNDIS_PACKET structure - */ -typedef struct nvsp_xfer_page_range_ { - /* - * Specifies the ID of the receive buffer that has the buffer. This - * ID can be the general receive buffer ID specified in - * NvspMessage1TypeSendReceiveBuffer or it can be the shared memory - * receive buffer ID allocated by the VSC and specified in - * NvspMessage2TypeAllocateReceiveBufferComplete message - */ - uint64_t xfer_page_set_id; - - /* - * Number of bytes - */ - uint32_t byte_count; - - /* - * Offset in bytes from the beginning of the buffer - */ - uint32_t byte_offset; -} __packed nvsp_xfer_page_range; - -/* - * NvspMessage2SendVmqRndisPacket - */ -typedef struct nvsp_2_msg_send_vmq_rndis_pkt_ { - /* - * This field is specified by RNIDS. They assume there's - * two different channels of communication. However, - * the Network VSP only has one. Therefore, the channel - * travels with the RNDIS packet. It must be RMC_DATA - */ - uint32_t channel_type; - - /* - * Only the Range element corresponding to the RNDIS header of - * the first RNDIS message in the multiple RNDIS messages sent - * in one NVSP message. Information about the data portions as well - * as the subsequent RNDIS messages in the same NVSP message are - * embedded in the RNDIS header itself - */ - nvsp_xfer_page_range range; -} __packed nvsp_2_msg_send_vmq_rndis_pkt; - -/* - * This message is used by the VSC to complete - * a RNDIS VMQ message to the VSP. At this point, - * the initiator of this message can use any resources - * associated with the original RNDIS VMQ packet. - */ -typedef struct nvsp_2_msg_send_vmq_rndis_pkt_complete_ -{ - uint32_t status; -} __packed nvsp_2_msg_send_vmq_rndis_pkt_complete; - -/* - * Version 5 messages - */ -enum nvsp_subchannel_operation { - NVSP_SUBCHANNEL_NONE = 0, - NVSP_SUBCHANNE_ALLOCATE, - NVSP_SUBCHANNE_MAX -}; - -typedef struct nvsp_5_subchannel_request_ -{ - uint32_t op; - uint32_t num_subchannels; -} __packed nvsp_5_subchannel_request; - -typedef struct nvsp_5_subchannel_complete_ -{ - uint32_t status; - /* Actual number of subchannels allocated */ - uint32_t num_subchannels; -} __packed nvsp_5_subchannel_complete; - -typedef struct nvsp_5_send_indirect_table_ -{ - /* The number of entries in the send indirection table */ - uint32_t count; - /* - * The offset of the send indireciton table from top of - * this struct. The send indirection table tells which channel - * to put the send traffic on. Each entry is a channel number. - */ - uint32_t offset; -} __packed nvsp_5_send_indirect_table; - -typedef union nvsp_1_msg_uber_ { - nvsp_1_msg_send_ndis_version send_ndis_vers; - - nvsp_1_msg_send_rx_buf send_rx_buf; - nvsp_1_msg_send_rx_buf_complete send_rx_buf_complete; - nvsp_1_msg_revoke_rx_buf revoke_rx_buf; - - nvsp_1_msg_send_send_buf send_send_buf; - nvsp_1_msg_send_send_buf_complete send_send_buf_complete; - nvsp_1_msg_revoke_send_buf revoke_send_buf; - - nvsp_1_msg_send_rndis_pkt send_rndis_pkt; - nvsp_1_msg_send_rndis_pkt_complete send_rndis_pkt_complete; -} __packed nvsp_1_msg_uber; - - -typedef union nvsp_2_msg_uber_ { - nvsp_2_msg_send_ndis_config send_ndis_config; - - nvsp_2_msg_send_chimney_buf send_chimney_buf; - nvsp_2_msg_send_chimney_buf_complete send_chimney_buf_complete; - nvsp_2_msg_revoke_chimney_buf revoke_chimney_buf; - - nvsp_2_msg_resume_chimney_rx_indication resume_chimney_rx_indication; - nvsp_2_msg_terminate_chimney terminate_chimney; - nvsp_2_msg_terminate_chimney_complete terminate_chimney_complete; - nvsp_2_msg_indicate_chimney_event indicate_chimney_event; - - nvsp_2_msg_send_chimney_pkt send_chimney_packet; - nvsp_2_msg_send_chimney_pkt_complete send_chimney_packet_complete; - nvsp_2_msg_post_chimney_rx_request post_chimney_rx_request; - nvsp_2_msg_post_chimney_rx_request_complete - post_chimney_rx_request_complete; - - nvsp_2_msg_alloc_rx_buf alloc_rx_buffer; - nvsp_2_msg_alloc_rx_buf_complete alloc_rx_buffer_complete; - nvsp_2_msg_free_rx_buf free_rx_buffer; - - nvsp_2_msg_send_vmq_rndis_pkt send_vmq_rndis_pkt; - nvsp_2_msg_send_vmq_rndis_pkt_complete send_vmq_rndis_pkt_complete; - nvsp_2_msg_alloc_chimney_handle alloc_chimney_handle; - nvsp_2_msg_alloc_chimney_handle_complete alloc_chimney_handle_complete; -} __packed nvsp_2_msg_uber; - -typedef union nvsp_5_msg_uber_ -{ - nvsp_5_subchannel_request subchannel_request; - nvsp_5_subchannel_complete subchn_complete; - nvsp_5_send_indirect_table send_table; -} __packed nvsp_5_msg_uber; - -typedef union nvsp_all_msgs_ { - nvsp_msg_init_uber init_msgs; - nvsp_1_msg_uber vers_1_msgs; - nvsp_2_msg_uber vers_2_msgs; - nvsp_5_msg_uber vers_5_msgs; -} __packed nvsp_all_msgs; - -/* - * ALL Messages - */ -typedef struct nvsp_msg_ { - nvsp_msg_hdr hdr; - nvsp_all_msgs msgs; -} __packed nvsp_msg; - - /* * The following arguably belongs in a separate header file */ @@ -1061,13 +233,6 @@ typedef struct netvsc_dev_ { uint32_t rx_buf_gpadl_handle; uint32_t rx_section_count; - /* Used for NetVSP initialization protocol */ - struct sema channel_init_sema; - nvsp_msg channel_init_packet; - - nvsp_msg revoke_packet; - /*uint8_t hw_mac_addr[ETHER_ADDR_LEN];*/ - /* Holds rndis device info */ void *extension; @@ -1079,7 +244,6 @@ typedef struct netvsc_dev_ { struct hyperv_dma rxbuf_dma; struct hyperv_dma txbuf_dma; - uint32_t vrss_send_table[VRSS_SEND_TABLE_SIZE]; } netvsc_dev; struct vmbus_channel; From owner-svn-src-head@freebsd.org Wed Aug 17 07:25:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B561CBBB6E1; Wed, 17 Aug 2016 07:25:51 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85AE815BC; Wed, 17 Aug 2016 07:25:51 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H7PoRV007726; Wed, 17 Aug 2016 07:25:50 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H7Pola007725; Wed, 17 Aug 2016 07:25:50 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201608170725.u7H7Pola007725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 17 Aug 2016 07:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304268 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 07:25:51 -0000 Author: kevlo Date: Wed Aug 17 07:25:50 2016 New Revision: 304268 URL: https://svnweb.freebsd.org/changeset/base/304268 Log: - Add the 'restrict' type qualifier to match function prototype. - Use .Lb libc rather than libpthread. Reviewed by: delphij Modified: head/lib/libc/gen/sem_timedwait.3 Modified: head/lib/libc/gen/sem_timedwait.3 ============================================================================== --- head/lib/libc/gen/sem_timedwait.3 Wed Aug 17 07:25:21 2016 (r304267) +++ head/lib/libc/gen/sem_timedwait.3 Wed Aug 17 07:25:50 2016 (r304268) @@ -34,18 +34,18 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2008 +.Dd August 17, 2016 .Dt SEM_TIMEDWAIT 3 .Os .Sh NAME .Nm sem_timedwait .Nd "lock a semaphore" .Sh LIBRARY -.Lb libpthread +.Lb libc .Sh SYNOPSIS .In semaphore.h .Ft int -.Fn sem_timedwait "sem_t *sem" "const struct timespec *abs_timeout" +.Fn sem_timedwait "sem_t * restrict sem" "const struct timespec * restrict abs_timeout" .Sh DESCRIPTION The .Fn sem_timedwait From owner-svn-src-head@freebsd.org Wed Aug 17 08:11:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F080DBBC63A; Wed, 17 Aug 2016 08:11:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AC501EB6; Wed, 17 Aug 2016 08:11:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7H8AtKg097120 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 17 Aug 2016 11:10:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7H8AtKg097120 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7H8AtER097113; Wed, 17 Aug 2016 11:10:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 17 Aug 2016 11:10:55 +0300 From: Konstantin Belousov To: Jilles Tjoelker Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304180 - head/sys/ufs/ffs Message-ID: <20160817081055.GM83214@kib.kiev.ua> References: <201608151922.u7FJMOmT099410@repo.freebsd.org> <20160816215355.GB12199@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160816215355.GB12199@stack.nl> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 08:11:01 -0000 On Tue, Aug 16, 2016 at 11:53:55PM +0200, Jilles Tjoelker wrote: > Hmm, some people interpret POSIX differently than I do, but I think it > is clear that XBD 3.384 Synchronized I/O Data Integrity Completion > requires the indirect blocks to be written (because "all file system > information required to retrieve the data is successfully transferred"). > The Linux man page matches this interpretation except that an fsync of > the parent directory may be required. > > If the whole file is being considered, then any change to indirect > blocks is needed to access some data (because the file was extended, a > hole was filled or snapshotted data was overwritten). For other > overwrites, there is no change to indirect blocks and no conflict with > fdatasync's performance objectives. Note that the same argument is applicable to the inode block: the di_db and di_ib pointers to the direct blocks and to root indirect blocks are required to retrieve the written data. ... > Ideally, a changed i_size would also cause the inode to be written, but > I don't know how to determine that (there is no i_flag for it). Always > writing the inode would defeat the point of fdatasync. Which was my reasoning behind omitting the indirect block flushing. There is no practical difference between inode block and indirect blocks for metadata consistency. Note that the affected case is only the async mounts (not sync mounts, not any variants of softdeps). I can restore indirect block flushing and wait for them for DATA_ONLY sync, but then I should also add ffs_update() call. From owner-svn-src-head@freebsd.org Wed Aug 17 08:26:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B0B8BBCA72; Wed, 17 Aug 2016 08:26:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E82711892; Wed, 17 Aug 2016 08:26:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H8Q90i029851; Wed, 17 Aug 2016 08:26:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H8Q92B029850; Wed, 17 Aug 2016 08:26:09 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170826.u7H8Q92B029850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 08:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304270 - head/sys/dev/hyperv/utilities X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 08:26:10 -0000 Author: sephe Date: Wed Aug 17 08:26:08 2016 New Revision: 304270 URL: https://svnweb.freebsd.org/changeset/base/304270 Log: hyperv/util: Don't reference hn_softc in KVP hn_softc is private data struct. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7519 Modified: head/sys/dev/hyperv/utilities/hv_kvp.c Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Wed Aug 17 07:30:23 2016 (r304269) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Wed Aug 17 08:26:08 2016 (r304270) @@ -54,17 +54,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#include -#include -#include - #include -#include #include #include "hv_util.h" @@ -333,13 +329,11 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru for (devcnt = devcnt - 1; devcnt >= 0; devcnt--) { /* XXX access other driver's softc? are you kidding? */ device_t dev = devs[devcnt]; - struct hn_softc *sc = device_get_softc(dev); struct vmbus_channel *chan; char buf[HYPERV_GUID_STRLEN]; /* * Trying to find GUID of Network Device - * TODO: need vmbus interface. */ chan = vmbus_get_channel(dev); hyperv_guid2str(vmbus_chan_guid_inst(chan), @@ -348,7 +342,7 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru if (strncmp(buf, (char *)umsg->body.kvp_ip_val.adapter_id, HYPERV_GUID_STRLEN - 1) == 0) { strlcpy((char *)umsg->body.kvp_ip_val.adapter_id, - sc->hn_ifp->if_xname, MAX_ADAPTER_ID_SIZE); + device_get_nameunit(dev), MAX_ADAPTER_ID_SIZE); break; } } From owner-svn-src-head@freebsd.org Wed Aug 17 08:29:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9F51BBCB46; Wed, 17 Aug 2016 08:29:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA7A81A74; Wed, 17 Aug 2016 08:29:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H8TUgB029994; Wed, 17 Aug 2016 08:29:30 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H8TUhV029992; Wed, 17 Aug 2016 08:29:30 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608170829.u7H8TUhV029992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Aug 2016 08:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304271 - head/sys/boot/efi/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 08:29:32 -0000 Author: manu Date: Wed Aug 17 08:29:30 2016 New Revision: 304271 URL: https://svnweb.freebsd.org/changeset/base/304271 Log: Correctly print and cast u_int64_t and off_t. Reported by: ed, imp MFC after: 1 week Modified: head/sys/boot/efi/boot1/ufs_module.c head/sys/boot/efi/boot1/zfs_module.c Modified: head/sys/boot/efi/boot1/ufs_module.c ============================================================================== --- head/sys/boot/efi/boot1/ufs_module.c Wed Aug 17 08:26:08 2016 (r304270) +++ head/sys/boot/efi/boot1/ufs_module.c Wed Aug 17 08:29:30 2016 (r304271) @@ -56,9 +56,9 @@ dskread(void *buf, u_int64_t lba, int nb devinfo->dev->Media->MediaId, lba, size, buf); if (status != EFI_SUCCESS) { - DPRINTF("dskread: failed dev: %p, id: %u, lba: %zu, size: %d, " + DPRINTF("dskread: failed dev: %p, id: %u, lba: %ju, size: %d, " "status: %lu\n", devinfo->dev, - devinfo->dev->Media->MediaId, lba, size, + devinfo->dev->Media->MediaId, (uintmax_t)lba, size, EFI_ERROR_CODE(status)); return (-1); } Modified: head/sys/boot/efi/boot1/zfs_module.c ============================================================================== --- head/sys/boot/efi/boot1/zfs_module.c Wed Aug 17 08:26:08 2016 (r304270) +++ head/sys/boot/efi/boot1/zfs_module.c Wed Aug 17 08:29:30 2016 (r304271) @@ -54,9 +54,9 @@ vdev_read(vdev_t *vdev, void *priv, off_ devinfo->dev->Media->MediaId, lba, bytes, buf); if (status != EFI_SUCCESS) { DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %jd, size: %zu," - " status: %lu\n", devinfo->dev, - devinfo->dev->Media->MediaId, lba, bytes, - EFI_ERROR_CODE(status)); + " status: %lu\n", devinfo->dev, + devinfo->dev->Media->MediaId, (intmax_t)lba, bytes, + EFI_ERROR_CODE(status)); return (-1); } From owner-svn-src-head@freebsd.org Wed Aug 17 08:32:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C8D9BBCD31; Wed, 17 Aug 2016 08:32:27 +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 41F1C1E69; Wed, 17 Aug 2016 08:32:25 +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 b6d34547; Wed, 17 Aug 2016 10:32:16 +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=kB47U7MuPNfxjwhBCLDkvrQAYp4=; b=J5KJeikMT1hfOgToim0QQ4rUDWFK nncvEI+b3uI9YsHV79vMqrs10u5fy03UPGWF6nrvprd4bwNtqnFZo6kYxxu64EdR 7446PQRKVsh8D7xNwgzib9HF6Jvwy/N2GU73Oh44GwrshkMCCjTHNbbpXorhiZFw 4Jzyz1JN2X1VvKw= 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=i0iiy0daMvUN+S8W7P5dOz9SlKZw2PoIPOtSOU7IXmtFblq7voOBrX6L ClmW3sLUwKwp0hRMTlkdv5jFi9/B5OvX64r/2tbeLb+L0ss73RZb7BhJiskRXxGz DMw49IMPiXLzRf7SqC0bKzIBappP0i7RB6fFTaQd78P4c9xmFaI= 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 68084b43 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Wed, 17 Aug 2016 10:32:16 +0200 (CEST) Date: Wed, 17 Aug 2016 10:32:13 +0200 From: Emmanuel Vadot To: Warner Losh Cc: Ed Schouten , Emmanuel Vadot , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r304221 - head/sys/boot/efi/boot1 Message-Id: <20160817103213.e69dcfcbe18591a3fca30d9a@bidouilliste.com> In-Reply-To: References: <201608161423.u7GENZJi021956@repo.freebsd.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.29; 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.22 Precedence: list List-Id: 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, 17 Aug 2016 08:32:27 -0000 On Tue, 16 Aug 2016 12:16:30 -0600 Warner Losh wrote: > On Tue, Aug 16, 2016 at 8:57 AM, Ed Schouten wrote: > > Hi Emmanuel, > > > > 2016-08-16 16:23 GMT+02:00 Emmanuel Vadot : > >> Author: manu > >> Date: Tue Aug 16 14:23:35 2016 > >> New Revision: 304221 > >> URL: https://svnweb.freebsd.org/changeset/base/304221 > >> > >> Log: > >> Use %ju modifier for u_int64_t and %jd modifier for off_t. > >> off_t is long long on arm32 and long on amd64 > > > > I think both of these should be solved differently: > > > > - For uint64_t, you can use 's PRIu64 in the formatting > > string. In kernel space, I suspect you need to use something like > > . > > cast it to intmax_t and use %jd. We've shunned PRIu64 in the tree. > It's existing practice, but I'm sure bruce will voice mild distaste. > > > - For off_t, it's all right to print it with %jd, but then be sure to > > also add a cast to the argument itself. It may not necessarily be > > equal to an intmax_t. > > The cast is important. > > Warner Thanks to all of you, I didn't know about PRI* (but I guess this was a good thing to not know about them). -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Wed Aug 17 08:38:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC3EDBBCFBC; Wed, 17 Aug 2016 08:38:51 +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 6A6A9143C; Wed, 17 Aug 2016 08:38:51 +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 u7H8cofw033827; Wed, 17 Aug 2016 08:38:50 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H8coRS033821; Wed, 17 Aug 2016 08:38:50 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170838.u7H8coRS033821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 08:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304273 - head/sys/dev/hyperv/utilities X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 08:38:51 -0000 Author: sephe Date: Wed Aug 17 08:38:49 2016 New Revision: 304273 URL: https://svnweb.freebsd.org/changeset/base/304273 Log: hyperv/util: Factor out helper for IC device_probe DEVMETHOD MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7530 Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c head/sys/dev/hyperv/utilities/hv_kvp.c head/sys/dev/hyperv/utilities/hv_shutdown.c head/sys/dev/hyperv/utilities/hv_timesync.c head/sys/dev/hyperv/utilities/hv_util.c head/sys/dev/hyperv/utilities/hv_util.h Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_heartbeat.c Wed Aug 17 08:37:40 2016 (r304272) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Wed Aug 17 08:38:49 2016 (r304273) @@ -41,10 +41,15 @@ #include "hv_util.h" #include "vmbus_if.h" -/* Heartbeat Service */ -static const struct hyperv_guid service_guid = { .hv_guid = - {0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e, - 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d} }; +static const struct vmbus_ic_desc vmbus_heartbeat_descs[] = { + { + .ic_guid = { .hv_guid = { + 0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e, + 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d} }, + .ic_desc = "Hyper-V Heartbeat" + }, + VMBUS_IC_DESC_END +}; /** * Process heartbeat message @@ -96,14 +101,8 @@ hv_heartbeat_cb(struct vmbus_channel *ch static int hv_heartbeat_probe(device_t dev) { - if (resource_disabled("hvheartbeat", 0)) - return ENXIO; - if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, &service_guid) == 0) { - device_set_desc(dev, "Hyper-V Heartbeat Service"); - return BUS_PROBE_DEFAULT; - } - return ENXIO; + return (vmbus_ic_probe(dev, vmbus_heartbeat_descs)); } static int Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Wed Aug 17 08:37:40 2016 (r304272) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Wed Aug 17 08:38:49 2016 (r304273) @@ -87,9 +87,15 @@ static int hv_kvp_log = 0; log(LOG_INFO, "hv_kvp: " __VA_ARGS__); \ } while (0) -static const struct hyperv_guid service_guid = { .hv_guid = - {0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, - 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6} }; +static const struct vmbus_ic_desc vmbus_kvp_descs[] = { + { + .ic_guid = { .hv_guid = { + 0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, + 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6 } }, + .ic_desc = "Hyper-V KVP" + }, + VMBUS_IC_DESC_END +}; /* character device prototypes */ static d_open_t hv_kvp_dev_open; @@ -867,14 +873,8 @@ hv_kvp_dev_daemon_poll(struct cdev *dev, static int hv_kvp_probe(device_t dev) { - if (resource_disabled("hvkvp", 0)) - return ENXIO; - if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, &service_guid) == 0) { - device_set_desc(dev, "Hyper-V KVP Service"); - return BUS_PROBE_DEFAULT; - } - return ENXIO; + return (vmbus_ic_probe(dev, vmbus_kvp_descs)); } static int Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_shutdown.c Wed Aug 17 08:37:40 2016 (r304272) +++ head/sys/dev/hyperv/utilities/hv_shutdown.c Wed Aug 17 08:38:49 2016 (r304273) @@ -46,9 +46,15 @@ #include "hv_util.h" #include "vmbus_if.h" -static const struct hyperv_guid service_guid = { .hv_guid = - {0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49, - 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB} }; +static const struct vmbus_ic_desc vmbus_shutdown_descs[] = { + { + .ic_guid = { .hv_guid = { + 0x31, 0x60, 0x0b, 0x0e, 0x13, 0x52, 0x34, 0x49, + 0x81, 0x8b, 0x38, 0xd9, 0x0c, 0xed, 0x39, 0xdb } }, + .ic_desc = "Hyper-V Shutdown" + }, + VMBUS_IC_DESC_END +}; /** * Shutdown @@ -118,14 +124,8 @@ hv_shutdown_cb(struct vmbus_channel *cha static int hv_shutdown_probe(device_t dev) { - if (resource_disabled("hvshutdown", 0)) - return ENXIO; - if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, &service_guid) == 0) { - device_set_desc(dev, "Hyper-V Shutdown Service"); - return BUS_PROBE_DEFAULT; - } - return ENXIO; + return (vmbus_ic_probe(dev, vmbus_shutdown_descs)); } static int Modified: head/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_timesync.c Wed Aug 17 08:37:40 2016 (r304272) +++ head/sys/dev/hyperv/utilities/hv_timesync.c Wed Aug 17 08:38:49 2016 (r304273) @@ -58,10 +58,15 @@ typedef struct { uint64_t data; } time_sync_data; - /* Time Synch Service */ -static const struct hyperv_guid service_guid = {.hv_guid = - {0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49, - 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf } }; +static const struct vmbus_ic_desc vmbus_timesync_descs[] = { + { + .ic_guid = { .hv_guid = { + 0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49, + 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf } }, + .ic_desc = "Hyper-V Timesync" + }, + VMBUS_IC_DESC_END +}; struct hv_ictimesync_data { uint64_t parenttime; @@ -174,14 +179,8 @@ hv_timesync_cb(struct vmbus_channel *cha static int hv_timesync_probe(device_t dev) { - if (resource_disabled("hvtimesync", 0)) - return ENXIO; - if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, &service_guid) == 0) { - device_set_desc(dev, "Hyper-V Time Synch Service"); - return BUS_PROBE_DEFAULT; - } - return ENXIO; + return (vmbus_ic_probe(dev, vmbus_timesync_descs)); } static int Modified: head/sys/dev/hyperv/utilities/hv_util.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.c Wed Aug 17 08:37:40 2016 (r304272) +++ head/sys/dev/hyperv/utilities/hv_util.c Wed Aug 17 08:38:49 2016 (r304273) @@ -42,7 +42,9 @@ #include #include #include -#include "hv_util.h" +#include + +#include "vmbus_if.h" #define VMBUS_IC_BRSIZE (4 * PAGE_SIZE) @@ -75,6 +77,24 @@ hv_negotiate_version(struct hv_vmbus_icm } int +vmbus_ic_probe(device_t dev, const struct vmbus_ic_desc descs[]) +{ + device_t bus = device_get_parent(dev); + const struct vmbus_ic_desc *d; + + if (resource_disabled(device_get_name(dev), 0)) + return (ENXIO); + + for (d = descs; d->ic_desc != NULL; ++d) { + if (VMBUS_PROBE_GUID(bus, dev, &d->ic_guid) == 0) { + device_set_desc(dev, d->ic_desc); + return (BUS_PROBE_DEFAULT); + } + } + return (ENXIO); +} + +int hv_util_attach(device_t dev, vmbus_chan_callback_t cb) { struct hv_util_sc *sc = device_get_softc(dev); Modified: head/sys/dev/hyperv/utilities/hv_util.h ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.h Wed Aug 17 08:37:40 2016 (r304272) +++ head/sys/dev/hyperv/utilities/hv_util.h Wed Aug 17 08:38:49 2016 (r304273) @@ -31,6 +31,7 @@ #ifndef _HVUTIL_H_ #define _HVUTIL_H_ +#include #include /** @@ -42,9 +43,17 @@ typedef struct hv_util_sc { int ic_buflen; } hv_util_sc; +struct vmbus_ic_desc { + const struct hyperv_guid ic_guid; + const char *ic_desc; +}; + +#define VMBUS_IC_DESC_END { .ic_desc = NULL } + void hv_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, uint8_t *buf); -int hv_util_attach(device_t dev, vmbus_chan_callback_t cb); -int hv_util_detach(device_t dev); +int hv_util_attach(device_t dev, vmbus_chan_callback_t cb); +int hv_util_detach(device_t dev); +int vmbus_ic_probe(device_t dev, const struct vmbus_ic_desc descs[]); #endif From owner-svn-src-head@freebsd.org Wed Aug 17 09:20:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1630CBBC983; Wed, 17 Aug 2016 09:20:06 +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 DAB491BCC; Wed, 17 Aug 2016 09:20: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 u7H9K59C049769; Wed, 17 Aug 2016 09:20:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H9K5FS049768; Wed, 17 Aug 2016 09:20:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608170920.u7H9K5FS049768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Aug 2016 09:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304279 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 09:20:06 -0000 Author: kib Date: Wed Aug 17 09:20:04 2016 New Revision: 304279 URL: https://svnweb.freebsd.org/changeset/base/304279 Log: By default, allow all to read the HPET registers pages. At the same time, by, by default disallow writes to the mmaped HPET pages. Intent is to allow userspace to use HPET as fast (i.e. no-syscall) timecounter for gettimeofday(2). Unfortunately, the permission model does not make it possible to safely unhide /dev/hpet in the jails even if default mode is set to 0444, because untrusted jailed root may change device permissions to writeable. Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/sys/dev/acpica/acpi_hpet.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Wed Aug 17 09:12:02 2016 (r304278) +++ head/sys/dev/acpica/acpi_hpet.c Wed Aug 17 09:20:04 2016 (r304279) @@ -762,14 +762,14 @@ hpet_attach(device_t dev) mda.mda_devsw = &hpet_cdevsw; mda.mda_uid = UID_ROOT; mda.mda_gid = GID_WHEEL; - mda.mda_mode = 0600; + mda.mda_mode = 0644; mda.mda_si_drv1 = sc; error = make_dev_s(&mda, &sc->pdev, "hpet%d", device_get_unit(dev)); if (error == 0) { sc->mmap_allow = 1; TUNABLE_INT_FETCH("hw.acpi.hpet.mmap_allow", &sc->mmap_allow); - sc->mmap_allow_write = 1; + sc->mmap_allow_write = 0; TUNABLE_INT_FETCH("hw.acpi.hpet.mmap_allow_write", &sc->mmap_allow_write); SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), From owner-svn-src-head@freebsd.org Wed Aug 17 09:52:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4252BBD812; Wed, 17 Aug 2016 09:52:13 +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 4ECFE1BED; Wed, 17 Aug 2016 09:52:13 +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 u7H9qCrJ064355; Wed, 17 Aug 2016 09:52:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H9qA2B064331; Wed, 17 Aug 2016 09:52:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608170952.u7H9qA2B064331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Aug 2016 09:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304285 - in head: lib/libc lib/libc/aarch64/sys lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/sys lib/libc/x86 lib/libc/x86/sys sys/arm/arm sys/arm/include sys/arm64/a... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 09:52:13 -0000 Author: kib Date: Wed Aug 17 09:52:09 2016 New Revision: 304285 URL: https://svnweb.freebsd.org/changeset/base/304285 Log: Implement userspace gettimeofday(2) with HPET timecounter. Right now, userspace (fast) gettimeofday(2) on x86 only works for RDTSC. For older machines, like Core2, where RDTSC is not C2/C3 invariant, and which fall to HPET hardware, this means that the call has both the penalty of the syscall and of the uncached hw behind the QPI or PCIe connection to the sought bridge. Nothing can me done against the access latency, but the syscall overhead can be removed. System already provides mappable /dev/hpetX devices, which gives straight access to the HPET registers page. Add yet another algorithm to the x86 'vdso' timehands. Libc is updated to handle both RDTSC and HPET. For HPET, the index of the hpet device to mmap is passed from kernel to userspace, index might be changed and libc invalidates its mapping as needed. Remove cpu_fill_vdso_timehands() KPI, instead require that timecounters which can be used from userspace, to provide tc_fill_vdso_timehands{,32}() methods. Merge i386 and amd64 libc//sys/__vdso_gettc.c into one source file in the new libc/x86/sys location. __vdso_gettc() internal interface is changed to move timecounter algorithm detection into the MD code. Measurements show that RDTSC even with the syscall overhead is faster than userspace HPET access. But still, userspace HPET is three-four times faster than syscall HPET on several Core2 and SandyBridge machines. Tested by: Howard Su Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D7473 Added: head/lib/libc/x86/ head/lib/libc/x86/sys/ head/lib/libc/x86/sys/Makefile.inc (contents, props changed) head/lib/libc/x86/sys/__vdso_gettc.c - copied, changed from r304281, head/lib/libc/i386/sys/__vdso_gettc.c Deleted: head/lib/libc/amd64/sys/__vdso_gettc.c head/lib/libc/i386/sys/__vdso_gettc.c Modified: head/lib/libc/Makefile head/lib/libc/aarch64/sys/__vdso_gettc.c head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/arm/sys/__vdso_gettc.c head/lib/libc/i386/sys/Makefile.inc head/lib/libc/sys/__vdso_gettimeofday.c head/lib/libc/sys/trivial-vdso_tc.c head/sys/arm/arm/generic_timer.c head/sys/arm/arm/machdep.c head/sys/arm/include/md_var.h head/sys/arm/include/vdso.h head/sys/arm64/arm64/machdep.c head/sys/arm64/include/md_var.h head/sys/arm64/include/vdso.h head/sys/dev/acpica/acpi_hpet.c head/sys/dev/acpica/acpi_hpet.h head/sys/kern/kern_tc.c head/sys/sys/timetc.h head/sys/sys/vdso.h head/sys/x86/include/vdso.h head/sys/x86/x86/tsc.c Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Wed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/Makefile Wed Aug 17 09:52:09 2016 (r304285) @@ -110,6 +110,9 @@ NOASM= ${LIBC_ARCH} == "mips" .include "${LIBC_SRCTOP}/softfloat/Makefile.inc" .endif +.if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64" +.include "${LIBC_SRCTOP}/x86/sys/Makefile.inc" +.endif .if ${MK_NIS} != "no" CFLAGS+= -DYP .include "${LIBC_SRCTOP}/yp/Makefile.inc" Modified: head/lib/libc/aarch64/sys/__vdso_gettc.c ============================================================================== --- head/lib/libc/aarch64/sys/__vdso_gettc.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/aarch64/sys/__vdso_gettc.c Wed Aug 17 09:52:09 2016 (r304285) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libc_private.h" static inline uint64_t @@ -55,14 +56,15 @@ cp15_cntpct_get(void) } #pragma weak __vdso_gettc -u_int -__vdso_gettc(const struct vdso_timehands *th) +int +__vdso_gettc(const struct vdso_timehands *th, u_int *tc) { - uint64_t val; + if (th->th_algo != VDSO_TH_ALGO_ARM_GENTIM) + return (ENOSYS); __asm __volatile("isb" : : : "memory"); - val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); - return (val); + *tc = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); + return (0); } #pragma weak __vdso_gettimekeep Modified: head/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- head/lib/libc/amd64/sys/Makefile.inc Wed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/amd64/sys/Makefile.inc Wed Aug 17 09:52:09 2016 (r304285) @@ -2,7 +2,7 @@ # $FreeBSD$ SRCS+= amd64_get_fsbase.c amd64_get_gsbase.c amd64_set_fsbase.c \ - amd64_set_gsbase.c __vdso_gettc.c + amd64_set_gsbase.c MDASM= vfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \ sbrk.S setlogin.S sigreturn.S Modified: head/lib/libc/arm/sys/__vdso_gettc.c ============================================================================== --- head/lib/libc/arm/sys/__vdso_gettc.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/arm/sys/__vdso_gettc.c Wed Aug 17 09:52:09 2016 (r304285) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libc_private.h" #if __ARM_ARCH >= 6 @@ -58,11 +59,12 @@ cp15_cntpct_get(void) #endif #pragma weak __vdso_gettc -u_int -__vdso_gettc(const struct vdso_timehands *th) +int +__vdso_gettc(const struct vdso_timehands *th, u_int *tc) { - uint64_t val; + if (th->th_algo != VDSO_TH_ALGO_ARM_GENTIM) + return (ENOSYS); #if __ARM_ARCH >= 6 /* * Userspace gettimeofday() is only enabled on ARMv7 CPUs, but @@ -70,11 +72,12 @@ __vdso_gettc(const struct vdso_timehands * armv7-a directive does not work. */ __asm __volatile(".word\t0xf57ff06f" : : : "memory"); /* isb */ - val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); + *tc = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); + return (0); #else - val = 0; + *tc = 0; + return (ENOSYS); #endif - return (val); } #pragma weak __vdso_gettimekeep Modified: head/lib/libc/i386/sys/Makefile.inc ============================================================================== --- head/lib/libc/i386/sys/Makefile.inc Wed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/i386/sys/Makefile.inc Wed Aug 17 09:52:09 2016 (r304285) @@ -5,8 +5,7 @@ SRCS+= i386_clr_watch.c i386_set_watch.c i386_vm86.c .endif SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \ - i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c \ - __vdso_gettc.c + i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \ sbrk.S setlogin.S sigreturn.S syscall.S Modified: head/lib/libc/sys/__vdso_gettimeofday.c ============================================================================== --- head/lib/libc/sys/__vdso_gettimeofday.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/sys/__vdso_gettimeofday.c Wed Aug 17 09:52:09 2016 (r304285) @@ -34,12 +34,16 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" -static u_int -tc_delta(const struct vdso_timehands *th) +static int +tc_delta(const struct vdso_timehands *th, u_int *delta) { + int error; + u_int tc; - return ((__vdso_gettc(th) - th->th_offset_count) & - th->th_counter_mask); + error = __vdso_gettc(th, &tc); + if (error == 0) + *delta = (tc - th->th_offset_count) & th->th_counter_mask; + return (error); } /* @@ -56,6 +60,8 @@ binuptime(struct bintime *bt, struct vds { struct vdso_timehands *th; uint32_t curr, gen; + u_int delta; + int error; do { if (!tk->tk_enabled) @@ -63,11 +69,14 @@ binuptime(struct bintime *bt, struct vds curr = atomic_load_acq_32(&tk->tk_current); th = &tk->tk_th[curr]; - if (th->th_algo != VDSO_TH_ALGO_1) - return (ENOSYS); gen = atomic_load_acq_32(&th->th_gen); *bt = th->th_offset; - bintime_addx(bt, th->th_scale * tc_delta(th)); + error = tc_delta(th, &delta); + if (error == EAGAIN) + continue; + if (error != 0) + return (error); + bintime_addx(bt, th->th_scale * delta); if (abs) bintime_add(bt, &th->th_boottime); Modified: head/lib/libc/sys/trivial-vdso_tc.c ============================================================================== --- head/lib/libc/sys/trivial-vdso_tc.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/sys/trivial-vdso_tc.c Wed Aug 17 09:52:09 2016 (r304285) @@ -32,11 +32,11 @@ __FBSDID("$FreeBSD$"); #include #pragma weak __vdso_gettc -u_int -__vdso_gettc(const struct vdso_timehands *th) +int +__vdso_gettc(const struct vdso_timehands *th, u_int *tc) { - return (0); + return (ENOSYS); } #pragma weak __vdso_gettimekeep Added: head/lib/libc/x86/sys/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/x86/sys/Makefile.inc Wed Aug 17 09:52:09 2016 (r304285) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.PATH: ${LIBC_SRCTOP}/x86/sys + +SRCS+= \ + __vdso_gettc.c Copied and modified: head/lib/libc/x86/sys/__vdso_gettc.c (from r304281, head/lib/libc/i386/sys/__vdso_gettc.c) ============================================================================== --- head/lib/libc/i386/sys/__vdso_gettc.c Wed Aug 17 09:21:55 2016 (r304281, copy source) +++ head/lib/libc/x86/sys/__vdso_gettc.c Wed Aug 17 09:52:09 2016 (r304285) @@ -1,5 +1,10 @@ /*- * Copyright (c) 2012 Konstantin Belousov + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,19 +31,27 @@ #include __FBSDID("$FreeBSD$"); -#include +#include +#include "namespace.h" #include +#include +#include #include #include +#include +#include +#include +#include "un-namespace.h" #include #include +#include #include "libc_private.h" -static int lfence_works = -1; - -static int -get_lfence_usage(void) +static void +lfence_mb(void) { +#if defined(__i386__) + static int lfence_works = -1; u_int cpuid_supported, p[4]; if (lfence_works == -1) { @@ -57,7 +70,7 @@ get_lfence_usage(void) " jmp 2f\n" "1: movl $0,%0\n" "2:\n" - : "=r" (cpuid_supported) : : "eax", "ecx"); + : "=r" (cpuid_supported) : : "eax", "ecx", "cc"); if (cpuid_supported) { __asm __volatile( " pushl %%ebx\n" @@ -70,16 +83,21 @@ get_lfence_usage(void) } else lfence_works = 0; } - return (lfence_works); + if (lfence_works == 1) + lfence(); +#elif defined(__amd64__) + lfence(); +#else +#error "arch" +#endif } static u_int -__vdso_gettc_low(const struct vdso_timehands *th) +__vdso_gettc_rdtsc_low(const struct vdso_timehands *th) { u_int rv; - if (get_lfence_usage() == 1) - lfence(); + lfence_mb(); __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" : "=a" (rv) : "c" (th->th_x86_shift) : "edx"); return (rv); @@ -88,21 +106,68 @@ __vdso_gettc_low(const struct vdso_timeh static u_int __vdso_rdtsc32(void) { - u_int rv; - if (get_lfence_usage() == 1) - lfence(); - rv = rdtsc32(); - return (rv); + lfence_mb(); + return (rdtsc32()); +} + +static char *hpet_dev_map = NULL; +static uint32_t hpet_idx = 0xffffffff; + +static void +__vdso_init_hpet(uint32_t u) +{ + static const char devprefix[] = "/dev/hpet"; + char devname[64], *c, *c1, t; + int fd; + + c1 = c = stpcpy(devname, devprefix); + u = hpet_idx; + do { + *c++ = u % 10 + '0'; + u /= 10; + } while (u != 0); + *c = '\0'; + for (c--; c1 != c; c1++, c--) { + t = *c1; + *c1 = *c; + *c = t; + } + fd = _open(devname, O_RDONLY); + if (fd == -1) { + hpet_dev_map = MAP_FAILED; + return; + } + if (hpet_dev_map != NULL && hpet_dev_map != MAP_FAILED) + munmap(hpet_dev_map, PAGE_SIZE); + hpet_dev_map = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, fd, 0); + _close(fd); } #pragma weak __vdso_gettc -u_int -__vdso_gettc(const struct vdso_timehands *th) +int +__vdso_gettc(const struct vdso_timehands *th, u_int *tc) { + uint32_t tmp; - return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : - __vdso_rdtsc32()); + switch (th->th_algo) { + case VDSO_TH_ALGO_X86_TSC: + *tc = th->th_x86_shift > 0 ? __vdso_gettc_rdtsc_low(th) : + __vdso_rdtsc32(); + return (0); + case VDSO_TH_ALGO_X86_HPET: + tmp = th->th_x86_hpet_idx; + if (hpet_dev_map == NULL || tmp != hpet_idx) { + hpet_idx = tmp; + __vdso_init_hpet(hpet_idx); + } + if (hpet_dev_map == MAP_FAILED) + return (ENOSYS); + *tc = *(volatile uint32_t *)(hpet_dev_map + HPET_MAIN_COUNTER); + return (0); + default: + return (ENOSYS); + } } #pragma weak __vdso_gettimekeep Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/arm/arm/generic_timer.c Wed Aug 17 09:52:09 2016 (r304285) @@ -105,6 +105,10 @@ static struct resource_spec timer_spec[] { -1, 0 } }; +static uint32_t arm_tmr_fill_vdso_timehands(struct vdso_timehands *vdso_th, + struct timecounter *tc); +static void arm_tmr_do_delay(int usec, void *); + static timecounter_get_t arm_tmr_get_timecount; static struct timecounter arm_tmr_timecount = { @@ -114,6 +118,7 @@ static struct timecounter arm_tmr_timeco .tc_counter_mask = ~0u, .tc_frequency = 0, .tc_quality = 1000, + .tc_fill_vdso_timehands = arm_tmr_fill_vdso_timehands, }; #ifdef __arm__ @@ -128,10 +133,6 @@ static struct timecounter arm_tmr_timeco #define set_el1(x, val) WRITE_SPECIALREG(x ##_el1, val) #endif -static uint32_t arm_tmr_fill_vdso_timehands(struct vdso_timehands *vdso_th, - struct timecounter *tc); -static void arm_tmr_do_delay(int usec, void *); - static int get_freq(void) { @@ -412,8 +413,6 @@ arm_tmr_attach(device_t dev) } } - arm_cpu_fill_vdso_timehands = arm_tmr_fill_vdso_timehands; - arm_tmr_timecount.tc_frequency = sc->clkfreq; tc_init(&arm_tmr_timecount); @@ -535,7 +534,8 @@ arm_tmr_fill_vdso_timehands(struct vdso_ struct timecounter *tc) { + vdso_th->th_algo = VDSO_TH_ALGO_ARM_GENTIM; vdso_th->th_physical = arm_tmr_sc->physical; bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); - return (tc == &arm_tmr_timecount); + return (1); } Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/arm/arm/machdep.c Wed Aug 17 09:52:09 2016 (r304285) @@ -2003,14 +2003,3 @@ initarm(struct arm_boot_params *abp) #endif /* __ARM_ARCH < 6 */ #endif /* FDT */ - -uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, - struct timecounter *); - -uint32_t -cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) -{ - - return (arm_cpu_fill_vdso_timehands != NULL ? - arm_cpu_fill_vdso_timehands(vdso_th, tc) : 0); -} Modified: head/sys/arm/include/md_var.h ============================================================================== --- head/sys/arm/include/md_var.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/arm/include/md_var.h Wed Aug 17 09:52:09 2016 (r304285) @@ -45,11 +45,6 @@ extern int (*_arm_bzero)(void *, int, in extern int _min_memcpy_size; extern int _min_bzero_size; -struct vdso_timehands; -struct timecounter; -extern uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, - struct timecounter *); - #define DST_IS_USER 0x1 #define SRC_IS_USER 0x2 #define IS_PHYSICAL 0x4 Modified: head/sys/arm/include/vdso.h ============================================================================== --- head/sys/arm/include/vdso.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/arm/include/vdso.h Wed Aug 17 09:52:09 2016 (r304285) @@ -32,4 +32,6 @@ uint32_t th_physical; \ uint32_t th_res[7]; +#define VDSO_TH_ALGO_ARM_GENTIM VDSO_TH_ALGO_1 + #endif Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/arm64/arm64/machdep.c Wed Aug 17 09:52:09 2016 (r304285) @@ -1005,17 +1005,6 @@ initarm(struct arm64_bootparams *abp) early_boot = 0; } -uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, - struct timecounter *); - -uint32_t -cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) -{ - - return (arm_cpu_fill_vdso_timehands != NULL ? - arm_cpu_fill_vdso_timehands(vdso_th, tc) : 0); -} - #ifdef DDB #include Modified: head/sys/arm64/include/md_var.h ============================================================================== --- head/sys/arm64/include/md_var.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/arm64/include/md_var.h Wed Aug 17 09:52:09 2016 (r304285) @@ -47,9 +47,4 @@ void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); int minidumpsys(struct dumperinfo *); -struct vdso_timehands; -struct timecounter; -extern uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, - struct timecounter *); - #endif /* !_MACHINE_MD_VAR_H_ */ Modified: head/sys/arm64/include/vdso.h ============================================================================== --- head/sys/arm64/include/vdso.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/arm64/include/vdso.h Wed Aug 17 09:52:09 2016 (r304285) @@ -32,4 +32,6 @@ uint32_t th_physical; \ uint32_t th_res[7]; +#define VDSO_TH_ALGO_ARM_GENTIM VDSO_TH_ALGO_1 + #endif /* !_MACHINE_VDSO_H_ */ Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/dev/acpica/acpi_hpet.c Wed Aug 17 09:52:09 2016 (r304285) @@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" +#include "opt_compat.h" + #if defined(__amd64__) #define DEV_APIC #else @@ -47,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -141,6 +144,35 @@ hpet_get_timecount(struct timecounter *t return (bus_read_4(sc->mem_res, HPET_MAIN_COUNTER)); } +uint32_t +hpet_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) +{ + struct hpet_softc *sc; + + sc = tc->tc_priv; + vdso_th->th_algo = VDSO_TH_ALGO_X86_HPET; + vdso_th->th_x86_shift = 0; + vdso_th->th_x86_hpet_idx = device_get_unit(sc->dev); + bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); + return (sc->mmap_allow != 0); +} + +#ifdef COMPAT_FREEBSD32 +uint32_t +hpet_vdso_timehands32(struct vdso_timehands32 *vdso_th32, + struct timecounter *tc) +{ + struct hpet_softc *sc; + + sc = tc->tc_priv; + vdso_th32->th_algo = VDSO_TH_ALGO_X86_HPET; + vdso_th32->th_x86_shift = 0; + vdso_th32->th_x86_hpet_idx = device_get_unit(sc->dev); + bzero(vdso_th32->th_res, sizeof(vdso_th32->th_res)); + return (sc->mmap_allow != 0); +} +#endif + static void hpet_enable(struct hpet_softc *sc) { @@ -537,6 +569,10 @@ hpet_attach(device_t dev) sc->tc.tc_quality = 950, sc->tc.tc_frequency = sc->freq; sc->tc.tc_priv = sc; + sc->tc.tc_fill_vdso_timehands = hpet_vdso_timehands; +#ifdef COMPAT_FREEBSD32 + sc->tc.tc_fill_vdso_timehands32 = hpet_vdso_timehands32; +#endif tc_init(&sc->tc); } /* If not disabled - setup and announce event timers. */ Modified: head/sys/dev/acpica/acpi_hpet.h ============================================================================== --- head/sys/dev/acpica/acpi_hpet.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/dev/acpica/acpi_hpet.h Wed Aug 17 09:52:09 2016 (r304285) @@ -64,4 +64,15 @@ #define HPET_MIN_CYCLES 128 /* Period considered reliable. */ +#ifdef _KERNEL +struct timecounter; +struct vdso_timehands; +struct vdso_timehands32; + +uint32_t hpet_vdso_timehands(struct vdso_timehands *vdso_th, + struct timecounter *tc); +uint32_t hpet_vdso_timehands32(struct vdso_timehands32 *vdso_th32, + struct timecounter *tc); +#endif + #endif /* !__ACPI_HPET_H__ */ Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/kern/kern_tc.c Wed Aug 17 09:52:09 2016 (r304285) @@ -6,11 +6,14 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * Copyright (c) 2011 The FreeBSD Foundation + * Copyright (c) 2011, 2015, 2016 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Julien Ridoux at the University * of Melbourne under sponsorship from the FreeBSD Foundation. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. */ #include @@ -2130,13 +2133,16 @@ tc_fill_vdso_timehands(struct vdso_timeh uint32_t enabled; th = timehands; - vdso_th->th_algo = VDSO_TH_ALGO_1; vdso_th->th_scale = th->th_scale; vdso_th->th_offset_count = th->th_offset_count; vdso_th->th_counter_mask = th->th_counter->tc_counter_mask; vdso_th->th_offset = th->th_offset; vdso_th->th_boottime = th->th_boottime; - enabled = cpu_fill_vdso_timehands(vdso_th, th->th_counter); + if (th->th_counter->tc_fill_vdso_timehands != NULL) { + enabled = th->th_counter->tc_fill_vdso_timehands(vdso_th, + th->th_counter); + } else + enabled = 0; if (!vdso_th_enable) enabled = 0; return (enabled); @@ -2150,7 +2156,6 @@ tc_fill_vdso_timehands32(struct vdso_tim uint32_t enabled; th = timehands; - vdso_th32->th_algo = VDSO_TH_ALGO_1; *(uint64_t *)&vdso_th32->th_scale[0] = th->th_scale; vdso_th32->th_offset_count = th->th_offset_count; vdso_th32->th_counter_mask = th->th_counter->tc_counter_mask; @@ -2158,7 +2163,11 @@ tc_fill_vdso_timehands32(struct vdso_tim *(uint64_t *)&vdso_th32->th_offset.frac[0] = th->th_offset.frac; vdso_th32->th_boottime.sec = th->th_boottime.sec; *(uint64_t *)&vdso_th32->th_boottime.frac[0] = th->th_boottime.frac; - enabled = cpu_fill_vdso_timehands32(vdso_th32, th->th_counter); + if (th->th_counter->tc_fill_vdso_timehands32 != NULL) { + enabled = th->th_counter->tc_fill_vdso_timehands32(vdso_th32, + th->th_counter); + } else + enabled = 0; if (!vdso_th_enable) enabled = 0; return (enabled); Modified: head/sys/sys/timetc.h ============================================================================== --- head/sys/sys/timetc.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/sys/timetc.h Wed Aug 17 09:52:09 2016 (r304285) @@ -28,8 +28,14 @@ */ struct timecounter; +struct vdso_timehands; +struct vdso_timehands32; typedef u_int timecounter_get_t(struct timecounter *); typedef void timecounter_pps_t(struct timecounter *); +typedef uint32_t timecounter_fill_vdso_timehands_t(struct vdso_timehands *, + struct timecounter *); +typedef uint32_t timecounter_fill_vdso_timehands32_t(struct vdso_timehands32 *, + struct timecounter *); struct timecounter { timecounter_get_t *tc_get_timecount; @@ -68,6 +74,8 @@ struct timecounter { /* Pointer to the timecounter's private parts. */ struct timecounter *tc_next; /* Pointer to the next timecounter. */ + timecounter_fill_vdso_timehands_t *tc_fill_vdso_timehands; + timecounter_fill_vdso_timehands32_t *tc_fill_vdso_timehands32; }; extern struct timecounter *timecounter; Modified: head/sys/sys/vdso.h ============================================================================== --- head/sys/sys/vdso.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/sys/vdso.h Wed Aug 17 09:52:09 2016 (r304285) @@ -53,6 +53,7 @@ struct vdso_timekeep { #define VDSO_TK_VER_1 0x1 #define VDSO_TK_VER_CURR VDSO_TK_VER_1 #define VDSO_TH_ALGO_1 0x1 +#define VDSO_TH_ALGO_2 0x2 #ifndef _KERNEL @@ -62,7 +63,7 @@ struct timezone; int __vdso_clock_gettime(clockid_t clock_id, struct timespec *ts); int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz); -u_int __vdso_gettc(const struct vdso_timehands *vdso_th); +int __vdso_gettc(const struct vdso_timehands *vdso_th, u_int *tc); int __vdso_gettimekeep(struct vdso_timekeep **tk); #endif Modified: head/sys/x86/include/vdso.h ============================================================================== --- head/sys/x86/include/vdso.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/x86/include/vdso.h Wed Aug 17 09:52:09 2016 (r304285) @@ -1,7 +1,11 @@ /*- * Copyright 2012 Konstantin Belousov . + * Copyright 2016 The FreeBSD Foundation. * All rights reserved. * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -30,7 +34,11 @@ #define VDSO_TIMEHANDS_MD \ uint32_t th_x86_shift; \ - uint32_t th_res[7]; + uint32_t th_x86_hpet_idx; \ + uint32_t th_res[6]; + +#define VDSO_TH_ALGO_X86_TSC VDSO_TH_ALGO_1 +#define VDSO_TH_ALGO_X86_HPET VDSO_TH_ALGO_2 #ifdef _KERNEL #ifdef COMPAT_FREEBSD32 Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/x86/x86/tsc.c Wed Aug 17 09:52:09 2016 (r304285) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "cpufreq_if.h" @@ -93,14 +94,22 @@ static unsigned tsc_get_timecount_low_lf static unsigned tsc_get_timecount_mfence(struct timecounter *tc); static unsigned tsc_get_timecount_low_mfence(struct timecounter *tc); static void tsc_levels_changed(void *arg, int unit); +static uint32_t x86_tsc_vdso_timehands(struct vdso_timehands *vdso_th, + struct timecounter *tc); +#ifdef COMPAT_FREEBSD32 +static uint32_t x86_tsc_vdso_timehands32(struct vdso_timehands32 *vdso_th32, + struct timecounter *tc); +#endif static struct timecounter tsc_timecounter = { - tsc_get_timecount, /* get_timecount */ - 0, /* no poll_pps */ - ~0u, /* counter_mask */ - 0, /* frequency */ - "TSC", /* name */ - 800, /* quality (adjusted in code) */ + .tc_get_timecount = tsc_get_timecount, + .tc_counter_mask = ~0u, + .tc_name = "TSC", + .tc_quality = 800, /* adjusted in code */ + .tc_fill_vdso_timehands = x86_tsc_vdso_timehands, +#ifdef COMPAT_FREEBSD32 + .tc_fill_vdso_timehands32 = x86_tsc_vdso_timehands32, +#endif }; static void @@ -724,23 +733,27 @@ tsc_get_timecount_low_mfence(struct time return (tsc_get_timecount_low(tc)); } -uint32_t -cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) +static uint32_t +x86_tsc_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) { + vdso_th->th_algo = VDSO_TH_ALGO_X86_TSC; vdso_th->th_x86_shift = (int)(intptr_t)tc->tc_priv; + vdso_th->th_x86_hpet_idx = 0xffffffff; bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); - return (tc == &tsc_timecounter); + return (1); } #ifdef COMPAT_FREEBSD32 -uint32_t -cpu_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32, +static uint32_t +x86_tsc_vdso_timehands32(struct vdso_timehands32 *vdso_th32, struct timecounter *tc) { + vdso_th32->th_algo = VDSO_TH_ALGO_X86_TSC; vdso_th32->th_x86_shift = (int)(intptr_t)tc->tc_priv; + vdso_th32->th_x86_hpet_idx = 0xffffffff; bzero(vdso_th32->th_res, sizeof(vdso_th32->th_res)); - return (tc == &tsc_timecounter); + return (1); } #endif From owner-svn-src-head@freebsd.org Wed Aug 17 10:09:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F5A3BBDDCF; Wed, 17 Aug 2016 10:09:18 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id ED0C7170C; Wed, 17 Aug 2016 10:09:17 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id D11D72591; Wed, 17 Aug 2016 10:09:16 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 0854325F4; Wed, 17 Aug 2016 12:07:51 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> Date: Wed, 17 Aug 2016 12:07:50 +0200 In-Reply-To: (Nathan Whitehorn's message of "Mon, 15 Aug 2016 08:04:26 -0700") Message-ID: <861t1n6749.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 10:09:18 -0000 Nathan Whitehorn writes: > As a note for people who weren't paying attention to the bug, we need > to fix this in a better way outside of the constraints of getting 11.0 > out the door. The system (gpart, the installer, ZFS, etc.) uses the > reported GEOM stripesize for partition alignment and IO block size > selection. If that is wrong, we should identify devices on which it is > wrong and fix them, and maybe also add some global tunable that sets a > floor on the numbers reported by GEOM_DISK. Hacking the installer like > this is triage, which is fine, but not viable as a permanent solution > to anything. Modifying GEOM to report a bogus number when none is provided by the lower layer(s) is absolutely not going to happen. You have absolutely no idea what your proposed change will break. And you keep refusing to address the fact that most drivers don't report a stripe size, except by repeating your claim that they do, with no evidence to back it up. Feel free to 'grep -r stripesize /usr/src/sys/dev'. Go on, I'll wait. Your contention that the installer does not make policy decisions is equally spurious. The installer makes many policy decisions, including the disk layout, the size of the swap partition, the name of the pool, the use of boot environments (which I dislike but am not allowed to override), the number of filesets and their mountpoints (which I also dislike and am not allowed to override either), etc. The Unix philosophy is to push such decisions up the stack, not down. The decision to align partitions on 4096-byte boundaries because we're not sure of the correct number but know for a fact that using a smaller number can have a huge impact on performance is the installer's to make. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Wed Aug 17 10:14:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49341BBDFA7; Wed, 17 Aug 2016 10:14:23 +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 1A4BF1C0A; Wed, 17 Aug 2016 10:14:23 +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 u7HAEMpd071639; Wed, 17 Aug 2016 10:14:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HAEMHA071638; Wed, 17 Aug 2016 10:14:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608171014.u7HAEMHA071638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Aug 2016 10:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304286 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 10:14:23 -0000 Author: kib Date: Wed Aug 17 10:14:22 2016 New Revision: 304286 URL: https://svnweb.freebsd.org/changeset/base/304286 Log: Remove duplicated code. aio_aqueue() calls aio_init_aioinfo() as the first action. There is no need to duplicate the code in kern_aio_fsync(). Also fix indent for aio_aqueue() definition. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D7523 Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Wed Aug 17 09:52:09 2016 (r304285) +++ head/sys/kern/vfs_aio.c Wed Aug 17 10:14:22 2016 (r304286) @@ -1441,7 +1441,7 @@ static struct aiocb_ops aiocb_ops_osigev */ int aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lj, - int type, struct aiocb_ops *ops) + int type, struct aiocb_ops *ops) { struct proc *p = td->td_proc; cap_rights_t rights; @@ -2476,14 +2476,9 @@ static int kern_aio_fsync(struct thread *td, int op, struct aiocb *ujob, struct aiocb_ops *ops) { - struct proc *p = td->td_proc; - struct kaioinfo *ki; if (op != O_SYNC) /* XXX lack of O_DSYNC */ return (EINVAL); - ki = p->p_aioinfo; - if (ki == NULL) - aio_init_aioinfo(p); return (aio_aqueue(td, ujob, NULL, LIO_SYNC, ops)); } From owner-svn-src-head@freebsd.org Wed Aug 17 10:16:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7508EBBC0E9; Wed, 17 Aug 2016 10:16: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 530921EA9; Wed, 17 Aug 2016 10:16:43 +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 u7HAGgOE071758; Wed, 17 Aug 2016 10:16:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HAGgdt071756; Wed, 17 Aug 2016 10:16:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608171016.u7HAGgdt071756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Aug 2016 10:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304287 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 10:16:43 -0000 Author: kib Date: Wed Aug 17 10:16:42 2016 New Revision: 304287 URL: https://svnweb.freebsd.org/changeset/base/304287 Log: Add fdatasync(2) man page, combined with fsync(2). Reviewed by: emaste, rpokala, wblock Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D7522 Modified: head/lib/libc/sys/Makefile.inc head/lib/libc/sys/fsync.2 Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Wed Aug 17 10:14:22 2016 (r304286) +++ head/lib/libc/sys/Makefile.inc Wed Aug 17 10:16:42 2016 (r304287) @@ -366,6 +366,7 @@ MLINKS+=ffclock.2 ffclock_getcounter.2 \ ffclock.2 ffclock_getestimate.2 \ ffclock.2 ffclock_setestimate.2 MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2 +MLINKS+=fsync.2 fdatasync.2 MLINKS+=getdirentries.2 getdents.2 MLINKS+=getfh.2 lgetfh.2 MLINKS+=getgid.2 getegid.2 Modified: head/lib/libc/sys/fsync.2 ============================================================================== --- head/lib/libc/sys/fsync.2 Wed Aug 17 10:14:22 2016 (r304286) +++ head/lib/libc/sys/fsync.2 Wed Aug 17 10:16:42 2016 (r304287) @@ -1,5 +1,11 @@ .\" Copyright (c) 1983, 1993 .\" The Regents of the University of California. All rights reserved. +.\" Copyright (c) 2016 The FreeBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Parts of this documentation were written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -28,40 +34,65 @@ .\" @(#)fsync.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd August 17, 2016 .Dt FSYNC 2 .Os .Sh NAME -.Nm fsync +.Nm fdatasync, fsync .Nd "synchronise changes to a file" .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In unistd.h .Ft int +.Fn fdatasync "int fd" +.Ft int .Fn fsync "int fd" .Sh DESCRIPTION The .Fn fsync system call -causes all modified data and attributes of +causes all modified data and attributes of the file referenced by +the file descriptor .Fa fd to be moved to a permanent storage device. This normally results in all in-core modified copies of buffers for the associated file to be written to a disk. .Pp The +.Fn fdatasync +system call causes all modified data of +.Fa fd +to be moved to a permanent storage device. +Unlike +.Fn fsync , +the system call does not guarantee that file attributes or +metadata necessary to access the file are committed to the permanent storage. +.Pp +The .Fn fsync system call should be used by programs that require a file to be in a known state, for example, in building a simple transaction facility. +If the file metadata has already been committed, using +.Fn fdatasync +can be more efficient than +.Fn fsync . +.Pp +Both +.Fn fdatasync +and +.Fn fsync +calls are cancellation points. .Sh RETURN VALUES .Rv -std fsync .Sh ERRORS The .Fn fsync -fails if: +and +.Fn fdatasync +calls fail if: .Bl -tag -width Er .It Bq Er EBADF The @@ -85,3 +116,15 @@ The .Fn fsync system call appeared in .Bx 4.2 . +The +.Fn fdatasync +system call appeared in +.Fx 12.0 +.Sh BUGS +The +.Fn fdatasync +system call currently does not guarantee that enqueued +.Xr aio 4 +requests for the file referenced by +.Fa fd +are completed before the syscall returns. From owner-svn-src-head@freebsd.org Wed Aug 17 10:20:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96FB1BBC1FD; Wed, 17 Aug 2016 10:20:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63CD41275; Wed, 17 Aug 2016 10:20:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HAK5fe071929; Wed, 17 Aug 2016 10:20:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HAK5Rj071927; Wed, 17 Aug 2016 10:20:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608171020.u7HAK5Rj071927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 17 Aug 2016 10:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304288 - in head: lib/libc/sys sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 10:20:06 -0000 Author: bdrewery Date: Wed Aug 17 10:20:05 2016 New Revision: 304288 URL: https://svnweb.freebsd.org/changeset/base/304288 Log: Garbage collect _umtx_lock(2)/_umtx_unlock(2) references removed in r263318. This has no real impact on the resulting libc.so file. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/sys/Symbol.map head/sys/kern/capabilities.conf Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Wed Aug 17 10:16:42 2016 (r304287) +++ head/lib/libc/sys/Symbol.map Wed Aug 17 10:20:05 2016 (r304288) @@ -34,9 +34,7 @@ FBSD_1.0 { __setugid; __syscall; __sysctl; - _umtx_lock; _umtx_op; - _umtx_unlock; abort2; accept; access; @@ -459,12 +457,8 @@ FBSDprivate_1.0 { __sys___syscall; ___sysctl; __sys___sysctl; - __umtx_lock; - __sys__umtx_lock; __umtx_op; __sys__umtx_op; - __umtx_unlock; - __sys__umtx_unlock; _abort2; __sys_abort2; _accept; Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Wed Aug 17 10:16:42 2016 (r304287) +++ head/sys/kern/capabilities.conf Wed Aug 17 10:20:05 2016 (r304288) @@ -64,9 +64,7 @@ __sysctl ## ## XXRW: Need to check this very carefully. ## -_umtx_lock _umtx_op -_umtx_unlock ## ## Allow process termination using abort2(2). From owner-svn-src-head@freebsd.org Wed Aug 17 10:20:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51BF8BBC2CB; Wed, 17 Aug 2016 10:20:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C54114A3; Wed, 17 Aug 2016 10:20:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HAKaU4071990; Wed, 17 Aug 2016 10:20:36 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HAKaki071989; Wed, 17 Aug 2016 10:20:36 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608171020.u7HAKaki071989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Aug 2016 10:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304289 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 10:20:37 -0000 Author: manu Date: Wed Aug 17 10:20:36 2016 New Revision: 304289 URL: https://svnweb.freebsd.org/changeset/base/304289 Log: a10_gpio_get_function now returns the whole function not only GPIO_INPUT/GPIO_OUTPUT. a10_gpio_get_pud now returns the whole pud not only PULLDOWN/PULLUP. Add a10_gpio_get_drv to get the current drive strenght. During fdt pin configure, avoid setting function/drive/pud if it's already in the correct value. Tested on Allwinner H3 and A20 MFC after: 1 week Modified: head/sys/arm/allwinner/a10_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 10:20:05 2016 (r304288) +++ head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 10:20:36 2016 (r304289) @@ -210,14 +210,8 @@ a10_gpio_get_function(struct a10_gpio_so offset = ((pin & 0x07) << 2); func = A10_GPIO_READ(sc, A10_GPIO_GP_CFG(bank, pin >> 3)); - switch ((func >> offset) & 0x7) { - case A10_GPIO_INPUT: - return (GPIO_PIN_INPUT); - case A10_GPIO_OUTPUT: - return (GPIO_PIN_OUTPUT); - } - return (0); + return ((func >> offset) & 0x7); } static int @@ -257,14 +251,8 @@ a10_gpio_get_pud(struct a10_gpio_softc * offset = ((pin & 0x0f) << 1); val = A10_GPIO_READ(sc, A10_GPIO_GP_PUL(bank, pin >> 4)); - switch ((val >> offset) & 0x3) { - case A10_GPIO_PULLDOWN: - return (GPIO_PIN_PULLDOWN); - case A10_GPIO_PULLUP: - return (GPIO_PIN_PULLUP); - } - return (0); + return ((val >> offset) & AW_GPIO_PUD_MASK); } static void @@ -285,6 +273,23 @@ a10_gpio_set_pud(struct a10_gpio_softc * A10_GPIO_WRITE(sc, A10_GPIO_GP_PUL(bank, pin >> 4), val); } +static uint32_t +a10_gpio_get_drv(struct a10_gpio_softc *sc, uint32_t pin) +{ + uint32_t bank, offset, val; + + /* Must be called with lock held. */ + A10_GPIO_LOCK_ASSERT(sc); + + bank = sc->padconf->pins[pin].port; + pin = sc->padconf->pins[pin].pin; + offset = ((pin & 0x0f) << 1); + + val = A10_GPIO_READ(sc, A10_GPIO_GP_DRV(bank, pin >> 4)); + + return ((val >> offset) & AW_GPIO_DRV_MASK); +} + static void a10_gpio_set_drv(struct a10_gpio_softc *sc, uint32_t pin, uint32_t drive) { @@ -373,14 +378,39 @@ static int a10_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) { struct a10_gpio_softc *sc; + uint32_t func; + uint32_t pud; sc = device_get_softc(dev); if (pin >= sc->padconf->npins) return (EINVAL); A10_GPIO_LOCK(sc); - *flags = a10_gpio_get_function(sc, pin); - *flags |= a10_gpio_get_pud(sc, pin); + func = a10_gpio_get_function(sc, pin); + switch (func) { + case A10_GPIO_INPUT: + *flags = GPIO_PIN_INPUT; + break; + case A10_GPIO_OUTPUT: + *flags = GPIO_PIN_OUTPUT; + break; + default: + *flags = 0; + break; + } + + pud = a10_gpio_get_pud(sc, pin); + switch (pud) { + case A10_GPIO_PULLDOWN: + *flags |= GPIO_PIN_PULLDOWN; + break; + case A10_GPIO_PULLUP: + *flags |= GPIO_PIN_PULLUP; + break; + default: + break; + } + A10_GPIO_UNLOCK(sc); return (0); @@ -564,9 +594,13 @@ aw_fdt_configure_pins(device_t dev, phan } A10_GPIO_LOCK(sc); - a10_gpio_set_function(sc, pin_num, pin_func); - a10_gpio_set_drv(sc, pin_num, pin_drive); - a10_gpio_set_pud(sc, pin_num, pin_pull); + + if (a10_gpio_get_function(sc, pin_num) != pin_func) + a10_gpio_set_function(sc, pin_num, pin_func); + if (a10_gpio_get_drv(sc, pin_num) != pin_drive) + a10_gpio_set_drv(sc, pin_num, pin_drive); + if (a10_gpio_get_pud(sc, pin_num) != pin_pull) + a10_gpio_set_pud(sc, pin_num, pin_pull); A10_GPIO_UNLOCK(sc); } From owner-svn-src-head@freebsd.org Wed Aug 17 11:11:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C880DBBB5DE; Wed, 17 Aug 2016 11:11:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 750291484; Wed, 17 Aug 2016 11:11:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 34ED1104750F; Wed, 17 Aug 2016 20:40:59 +1000 (AEST) Date: Wed, 17 Aug 2016 20:40:58 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Jilles Tjoelker , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304180 - head/sys/ufs/ffs In-Reply-To: <20160817081055.GM83214@kib.kiev.ua> Message-ID: <20160817191239.A3117@besplex.bde.org> References: <201608151922.u7FJMOmT099410@repo.freebsd.org> <20160816215355.GB12199@stack.nl> <20160817081055.GM83214@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=I9sqMnmzHltNhR3enRgA:9 a=kSGpwUHVDBIaL0fO:21 a=A_BSZxN6wfCI-H8q:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 11:11:01 -0000 On Wed, 17 Aug 2016, Konstantin Belousov wrote: > On Tue, Aug 16, 2016 at 11:53:55PM +0200, Jilles Tjoelker wrote: >> Hmm, some people interpret POSIX differently than I do, but I think it >> is clear that XBD 3.384 Synchronized I/O Data Integrity Completion >> requires the indirect blocks to be written (because "all file system >> information required to retrieve the data is successfully transferred"). >> The Linux man page matches this interpretation except that an fsync of >> the parent directory may be required. All related directories must be synced. It is almost useless to sync the data if the data cannot be found later using normal file system operations. Not quite useless if the file can be recovered by fsck and saved in lost+found, but the metadata needed to guarantee that that works probably requires a lot of writes anyway. >> If the whole file is being considered, then any change to indirect >> blocks is needed to access some data (because the file was extended, a >> hole was filled or snapshotted data was overwritten). For other >> overwrites, there is no change to indirect blocks and no conflict with >> fdatasync's performance objectives. > Note that the same argument is applicable to the inode block: the di_db > and di_ib pointers to the direct blocks and to root indirect blocks are > required to retrieve the written data. I would never have guessed that you left out either. > ... > >> Ideally, a changed i_size would also cause the inode to be written, but >> I don't know how to determine that (there is no i_flag for it). Always >> writing the inode would defeat the point of fdatasync. My version does a bcmp() of the in-core copy with the disk copy to avoid null changes. This turned out to be not very useful. It was intended mainly to avoid writing null changes for timestamps. By I already avoid most timestamp changes by mounting with -noatime and not having large data. I use only seconds granularity for timestamps. With nanoseconds granularity, any change to a file is guaranteed to change its in-core inode, so the bcmp() wouldn't work. But timestamps are about the only metadata that obviously doesn't need syncing. Especially atimes. POSIX doesn't allow turning off atimes, but it also doesn't require syncing them before the system crashes except probably using FSYNC of metadata. There is an i_flag for critical metadata like i_size. It is IN_MODIFIED. This flag is often mismanaged. Many places set only IN_CHANGE after making a critical change. ufs_chown() is one such place. Ownerships are fairly critical metadata. They are not considered critical enough to sync immediately, but they should be synced by FSYNC of metadata. But the implementation is to set only IN_CHANGE. i_ctime is usually updated much later and IN_MODIFIED is set then to say that the relatively unimportant i_ctime has been modified. This inhibits the optimization of syncing for chown() but not syncing for ctime changes. > Which was my reasoning behind omitting the indirect block flushing. > There is no practical difference between inode block and indirect blocks > for metadata consistency. Ugh. > Note that the affected case is only the async mounts (not sync mounts, > not any variants of softdeps). I fixed the non-syncing of inodes for the async mount case ~15 years ago in my version, and finally merged the changes to my version of -current a few months OK. It was stupid that ordinary fsync() synced the indirect blocks but not the more important inode. Directory metadata is still not synced by fsync() in the async mount case. > I can restore indirect block flushing and wait for them for DATA_ONLY sync, > but then I should also add ffs_update() call. Here are my ffs fixes for -current. The are mostly to sprinkle missing DOINGASYNC() checks and finally fix ffs_update(): X Index: ffs/ffs_balloc.c X =================================================================== X --- ffs/ffs_balloc.c (revision 304069) X +++ ffs/ffs_balloc.c (working copy) X @@ -155,4 +155,6 @@ X if (flags & IO_SYNC) X bwrite(bp); X + else if (DOINGASYNC(vp)) X + bdwrite(bp); X else X bawrite(bp); X @@ -265,12 +267,10 @@ X newb, 0, fs->fs_bsize, 0, bp); X bdwrite(bp); X + } else if ((flags & IO_SYNC) == 0 && DOINGASYNC(vp)) { X + if (bp->b_bufsize == fs->fs_bsize) X + bp->b_flags |= B_CLUSTEROK; X + bdwrite(bp); This restructures the code a little to fix the DOINGASYNC() check. IO_SYNC was not checked. X } else { X - /* X - * Write synchronously so that indirect blocks X - * never point at garbage. X - */ X - if (DOINGASYNC(vp)) X - bdwrite(bp); X - else if ((error = bwrite(bp)) != 0) X + if ((error = bwrite(bp)) != 0) X goto fail; X } The comment was banal and duplicated ad nauseum, except it was wrong when the DOINGASYNC() check was under it. X @@ -335,9 +335,9 @@ X indirs[i - 1].in_off, nb); X bdwrite(nbp); X + } else if ((flags & IO_SYNC) == 0 && DOINGASYNC(vp)) { X + if (nbp->b_bufsize == fs->fs_bsize) X + nbp->b_flags |= B_CLUSTEROK; X + bdwrite(nbp); X } else { X - /* X - * Write synchronously so that indirect blocks X - * never point at garbage. X - */ X if ((error = bwrite(nbp)) != 0) { X brelse(bp); Here the DOINGASYNC() check was missing and the comment wasn't broken. X @@ -829,12 +829,10 @@ X newb, 0, fs->fs_bsize, 0, bp); X bdwrite(bp); X + } else if ((flags & IO_SYNC) == 0 && DOINGASYNC(vp)) { X + if (bp->b_bufsize == fs->fs_bsize) X + bp->b_flags |= B_CLUSTEROK; X + bdwrite(bp); X } else { X - /* X - * Write synchronously so that indirect blocks X - * never point at garbage. X - */ X - if (DOINGASYNC(vp)) X - bdwrite(bp); X - else if ((error = bwrite(bp)) != 0) X + if ((error = bwrite(bp)) != 0) X goto fail; X } X @@ -900,9 +898,9 @@ X indirs[i - 1].in_off, nb); X bdwrite(nbp); X + } else if ((flags & IO_SYNC) == 0 && DOINGASYNC(vp)) { X + if (nbp->b_bufsize == fs->fs_bsize) X + nbp->b_flags |= B_CLUSTEROK; X + bdwrite(nbp); X } else { X - /* X - * Write synchronously so that indirect blocks X - * never point at garbage. X - */ X if ((error = bwrite(nbp)) != 0) { X brelse(bp); There are 4 instances of almost the same code (not exactly the same). I changed them to be as identical as possbile. X Index: ffs/ffs_inode.c X =================================================================== X --- ffs/ffs_inode.c (revision 304069) X +++ ffs/ffs_inode.c (working copy) X @@ -155,5 +155,5 @@ X random_harvest_queue(&(ip->i_din2), sizeof(ip->i_din2), 1, RANDOM_FS_ATIME); X } X - if (waitfor && !DOINGASYNC(vp)) X + if (waitfor) X error = bwrite(bp); X else if (vm_page_count_severe() || buf_dirty_count_severe()) { This fixes ffs_update() by removing dyson's old DOINGASYNC() hack. This is a very safe change, but it needs a havy sprinkling of DOINGASYNC() in callers to avoid passing waitfor = TRUE too often. Many callers have already been fixed. X @@ -265,5 +265,5 @@ X } X ip->i_flag |= IN_CHANGE; X - if ((error = ffs_update(vp, !DOINGASYNC(vp)))) X + if ((error = ffs_update(vp, (flags & IO_SYNC) != 0))) X return (error); X for (i = 0; i < NXADDR; i++) { This was a broken caller. It and the next few fixes are in ffs_truncate(). ffs_truncate() has already converted (!DOINGASYNC() && !DOINGSOFTDEP()) to IO_ASYNC in flags here, so (flags & IO_SYNC) must be checked here so as to not lose the caller's setting of IO_SYNC. This gives the same precedence to IO_SYNC as in the checks above. ffs_truncate() used to do separate checks like the ones above. This was more readable but not as fail-safe when a check was forgotten. X @@ -291,5 +291,5 @@ X if (needextclean) X goto extclean; X - return (ffs_update(vp, !DOINGASYNC(vp))); X + return (ffs_update(vp, (flags & IO_SYNC) != 0)); X } X if (ip->i_size == length) { X @@ -329,5 +329,5 @@ X bawrite(bp); X ip->i_flag |= IN_CHANGE | IN_UPDATE; X - return (ffs_update(vp, !DOINGASYNC(vp))); X + return (ffs_update(vp, (flags & IO_SYNC) != 0)); X } X /* X @@ -358,8 +358,8 @@ X if (blkno != 0) X brelse(bp); X - else if (DOINGSOFTDEP(vp) || DOINGASYNC(vp)) X - bdwrite(bp); X - else X + else if (flags & IO_SYNC) X bwrite(bp); X + else X + bdwrite(bp); X } X /* Better check the DOINGSOFTDEP() part of ths fix. The caller's IO_SYNC flag and previous logic were defeated by checking DOINGSOFTDEP() again here. Note that callers were changed to not check DOING*() before calling ffs_update(). They just pass IO_SYNC if they want to force a sync. Most callers don't want to force it, so they pass 0 and syncing is controlled by DOINGSOFTDEP() and DOINGASYNC() in the usual way. This gives ufs's old fail-safe behaviour of sync metadata for ffs_truncate() in the non-softdep non-async mount case. Old versions were not so careful and depending on callers calculating the flag. X @@ -479,5 +479,5 @@ X } X ip->i_flag |= IN_CHANGE | IN_UPDATE; X - allerror = ffs_update(vp, !DOINGASYNC(vp)); X + allerror = ffs_update(vp, (flags & IO_SYNC) != 0); X X /* X @@ -611,5 +611,5 @@ X else X softdep_setup_freeblocks(ip, length, IO_EXT); X - return (ffs_update(vp, (flags & IO_SYNC) != 0 || !DOINGASYNC(vp))); X + return (ffs_update(vp, (flags & IO_SYNC) != 0)); X } X End of fixes for ffs_truncate(). X Index: ffs/ffs_vnops.c X =================================================================== X --- ffs/ffs_vnops.c (revision 304069) X +++ ffs/ffs_vnops.c (working copy) X @@ -717,5 +717,5 @@ X else X flags = seqcount << BA_SEQSHIFT; X - if ((ioflag & IO_SYNC) && !DOINGASYNC(vp)) X + if (ioflag & IO_SYNC) X flags |= IO_SYNC; X flags |= BA_UNMAPPED; X @@ -1037,5 +1037,5 @@ X osize = dp->di_extsize; X flags = IO_EXT; X - if ((ioflag & IO_SYNC) && !DOINGASYNC(vp)) X + if (ioflag & IO_SYNC) X flags |= IO_SYNC; X Examples of the ffs_write() and ffs_extwrite() callers calculating the flag wrong. There must be some magic for DOINGSOFTDEP() here and I hope I didn't break it. The old code forces IO_SYNC when the caller doesn't ask for it. This is the correct fail-safe behaviour for the old non-softdep non-async non-sync mount case, but is pessimal. It avoided here for the async mount case, but for the softdep case IO_SYNC is bogusly set here and then soft updates have to magically dishonor IO_SYNC to avoid all writes become since (just ordered and delayed for soft updates). I don't see how soft updates can work write here. If it dishonors IO_SYNC at lower levels, then this breaks the caller's reques tof sync writes, and if it doesn't dishonor IO_SYNC at lower levels, then the usual case is pessimized. X Index: ufs/ufs_lookup.c X =================================================================== X --- ufs/ufs_lookup.c (revision 304069) X +++ ufs/ufs_lookup.c (working copy) X @@ -1249,5 +1249,5 @@ X if (flags & DOWHITEOUT) X error = bwrite(bp); X - else if (DOINGASYNC(dvp) && dp->i_count != 0) X + else if (DOINGASYNC(dvp)) X bdwrite(bp); X else A pure async mount case fix -- don't do anything sync unless asked for. X Index: ufs/ufs_vnops.c X =================================================================== X --- ufs/ufs_vnops.c (revision 304069) X +++ ufs/ufs_vnops.c (working copy) X @@ -992,5 +992,5 @@ X if (DOINGSOFTDEP(vp)) X softdep_setup_link(VTOI(tdvp), ip); X - error = UFS_UPDATE(vp, !(DOINGSOFTDEP(vp) | DOINGASYNC(vp))); X + error = UFS_UPDATE(vp, !DOINGSOFTDEP(vp) && !DOINGASYNC(vp)); X if (!error) { X ufs_makedirentry(ip, cnp, &newdir); X @@ -1336,5 +1336,5 @@ X if (DOINGSOFTDEP(fvp)) X softdep_setup_link(tdp, fip); X - error = UFS_UPDATE(fvp, !(DOINGSOFTDEP(fvp) | DOINGASYNC(fvp))); X + error = UFS_UPDATE(fvp, !DOINGSOFTDEP(fvp) && !DOINGASYNC(fvp)); X if (error) X goto bad; X @@ -1489,6 +1489,6 @@ X if (DOINGSOFTDEP(tdvp)) X softdep_setup_dotdot_link(tdp, fip); X - error = UFS_UPDATE(tdvp, !(DOINGSOFTDEP(tdvp) | X - DOINGASYNC(tdvp))); X + error = UFS_UPDATE(tdvp, !DOINGSOFTDEP(tdvp) && X + !DOINGASYNC(tdvp)); X /* Don't go to bad here as the new link exists. */ X if (error) Use consistent logic, and don't do manual optimizations of logical expressions. X @@ -1534,5 +1534,6 @@ X ufsdirhash_dirtrunc(tdp, endoff); X #endif X - UFS_TRUNCATE(tdvp, endoff, IO_NORMAL | IO_SYNC, tcnp->cn_cred); X + UFS_TRUNCATE(tdvp, endoff, IO_NORMAL | X + (DOINGASYNC(tdvp) ? 0 : IO_SYNC), tcnp->cn_cred); X } X if (error == 0 && tdp->i_flag & IN_NEEDSYNC) This looks wrong. Why do we want to override IO_NORMAL? IIRC, I wrote it like this since I didn't want to change the policy for soft updates. This is near the directory compaction fix. I completed this set of patches after understanding the simplifications given by IO_NORMAL letting ffs_truncate() handle the details. X @@ -1879,5 +1880,5 @@ X if (DOINGSOFTDEP(dvp)) X softdep_setup_mkdir(dp, ip); X - error = UFS_UPDATE(dvp, !(DOINGSOFTDEP(dvp) | DOINGASYNC(dvp))); X + error = UFS_UPDATE(dvp, !DOINGSOFTDEP(dvp) && !DOINGASYNC(dvp)); X if (error) X goto bad; X @@ -1936,6 +1937,6 @@ X } X } X - if ((error = UFS_UPDATE(tvp, !(DOINGSOFTDEP(tvp) | X - DOINGASYNC(tvp)))) != 0) { X + if ((error = UFS_UPDATE(tvp, !DOINGSOFTDEP(tvp) && X + !DOINGASYNC(tvp))) != 0) { X (void)bwrite(bp); X goto bad; X @@ -2671,5 +2672,5 @@ X * Make sure inode goes to disk before directory entry. X */ X - error = UFS_UPDATE(tvp, !(DOINGSOFTDEP(tvp) | DOINGASYNC(tvp))); X + error = UFS_UPDATE(tvp, !DOINGSOFTDEP(tvp) && !DOINGASYNC(tvp)); X if (error) X goto bad; Lots more style fixes to remove home made optimizations. Bruce From owner-svn-src-head@freebsd.org Wed Aug 17 13:09:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F3CFBBD762; Wed, 17 Aug 2016 13:09:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3222B1ECA; Wed, 17 Aug 2016 13:09:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HD9VF6036483; Wed, 17 Aug 2016 13:09:31 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HD9VCh036482; Wed, 17 Aug 2016 13:09:31 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608171309.u7HD9VCh036482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Aug 2016 13:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304290 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 13:09:32 -0000 Author: manu Date: Wed Aug 17 13:09:31 2016 New Revision: 304290 URL: https://svnweb.freebsd.org/changeset/base/304290 Log: Only set pud settings if this is a pullup or pulldown configuration. This removes the need to set the MMC pins with pullups in our DTS. Thanks to jmcneill@ for spotting this. Tested on Orange Pi One (Allwinner H3). MFC after: 1 week Modified: head/sys/arm/allwinner/a10_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 10:20:36 2016 (r304289) +++ head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 13:09:31 2016 (r304290) @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #if defined(__aarch64__) #include "opt_soc.h" #endif @@ -599,7 +601,9 @@ aw_fdt_configure_pins(device_t dev, phan a10_gpio_set_function(sc, pin_num, pin_func); if (a10_gpio_get_drv(sc, pin_num) != pin_drive) a10_gpio_set_drv(sc, pin_num, pin_drive); - if (a10_gpio_get_pud(sc, pin_num) != pin_pull) + if (a10_gpio_get_pud(sc, pin_num) != pin_pull && + (pin_pull == SUN4I_PINCTRL_PULL_UP || + pin_pull == SUN4I_PINCTRL_PULL_DOWN)) a10_gpio_set_pud(sc, pin_num, pin_pull); A10_GPIO_UNLOCK(sc); } From owner-svn-src-head@freebsd.org Wed Aug 17 13:19:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9618BBDAC7; Wed, 17 Aug 2016 13:19:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89DFE17A8; Wed, 17 Aug 2016 13:19:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HDJSrS040397; Wed, 17 Aug 2016 13:19:28 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HDJSdt040396; Wed, 17 Aug 2016 13:19:28 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608171319.u7HDJSdt040396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Aug 2016 13:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304291 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 13:19:29 -0000 Author: manu Date: Wed Aug 17 13:19:28 2016 New Revision: 304291 URL: https://svnweb.freebsd.org/changeset/base/304291 Log: Remove pullup settings for MMC pins, this is not needed since r304290 MFC after: 1 week Modified: head/sys/boot/fdt/dts/arm/bananapi.dts Modified: head/sys/boot/fdt/dts/arm/bananapi.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/bananapi.dts Wed Aug 17 13:09:31 2016 (r304290) +++ head/sys/boot/fdt/dts/arm/bananapi.dts Wed Aug 17 13:19:28 2016 (r304291) @@ -41,7 +41,3 @@ }; }; }; - -&mmc0_pins_a { - allwinner,pull = ; -}; From owner-svn-src-head@freebsd.org Wed Aug 17 14:36:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AA21BBD156; Wed, 17 Aug 2016 14:36:07 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3531A1774; Wed, 17 Aug 2016 14:36:06 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net ([128.54.117.176]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7HEa0P5006569 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 17 Aug 2016 07:36:01 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> Date: Wed, 17 Aug 2016 07:36:00 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <861t1n6749.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVb4EAMaBaW94IvkrbqJOuc277FbO3w/nQosgRFWeFnhLSfkhOOIqmsosANZbmQDQIMpj4Ejr+Kxe49oFwwBGrlh0blyFwEbqHo= X-Sonic-ID: C;JPrl6odk5hGnlqDx2xNB0g== M;Yrpa64dk5hGnlqDx2xNB0g== 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.22 Precedence: list List-Id: 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, 17 Aug 2016 14:36:07 -0000 On 08/17/16 03:07, Dag-Erling Smørgrav wrote: > Nathan Whitehorn writes: >> As a note for people who weren't paying attention to the bug, we need >> to fix this in a better way outside of the constraints of getting 11.0 >> out the door. The system (gpart, the installer, ZFS, etc.) uses the >> reported GEOM stripesize for partition alignment and IO block size >> selection. If that is wrong, we should identify devices on which it is >> wrong and fix them, and maybe also add some global tunable that sets a >> floor on the numbers reported by GEOM_DISK. Hacking the installer like >> this is triage, which is fine, but not viable as a permanent solution >> to anything. > Modifying GEOM to report a bogus number when none is provided by the > lower layer(s) is absolutely not going to happen. You have absolutely > no idea what your proposed change will break. And you keep refusing to > address the fact that most drivers don't report a stripe size, except by > repeating your claim that they do, with no evidence to back it up. Feel > free to 'grep -r stripesize /usr/src/sys/dev'. Go on, I'll wait. And yet, if you look at the GEOM XML, it is reported and there. And, look, it's even right for the AF 512e disks in my machine! 512 4096 I've literally never seen a case where we don't already do the right thing here. The GEOM stripesize is, whether you like it or not, the way we have long ago decided to communicate the information about optimal alignment from the disk drivers to userland. We do a good job of it, too. It's correct, as far as I can tell, 100% of the time on all possible variants of AF disks. One could argue that calling this the "stripesize" is a hack, and I would agree, but it's what the operating system does and has done for many years. As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev, as I'm sure you know, and you will find all the code that handles this there. > Your contention that the installer does not make policy decisions is > equally spurious. The installer makes many policy decisions, including > the disk layout, the size of the swap partition, the name of the pool, > the use of boot environments (which I dislike but am not allowed to > override), the number of filesets and their mountpoints (which I also > dislike and am not allowed to override either), etc. The Unix > philosophy is to push such decisions up the stack, not down. The > decision to align partitions on 4096-byte boundaries because we're not > sure of the correct number but know for a fact that using a smaller > number can have a huge impact on performance is the installer's to make. Those are all things that the operating system does not have defaults for: there are no tools like, say, gpart or newfs that layout disks in any even vaguely automated way, and so no tools that would ever have defaults for, say, the size of a swap partition except for the installer. As such, the defaults are quite properly in the installer. This is quite different: there are many tools that care about disk alignment (say, gpart) and, by default, use the GEOM stripesize. The installer is, after this patch, overriding what was meant to be a system-wide default. My concern is that pushing this into the installer means that newfs, zfs, gpart, etc., which all look at the GEOM stripesize for preferred alignment, will still have suboptimal behavior on systems affected by your patch. If we identified which drivers are reporting the wrong alignment, we could fix the whole system at a go by changing it there. As it is, we now have inconsistent default behavior for partitions between tools (the installer and sade will now use a different alignment than gpart on whatever systems you were trying to fix here) and between pre- and post-installation environments. You are papering over a bug in some unspecified driver with some unspecified disks by hacking the installer. This is fine as an expedient for 11.0, but is a ridiculous solution to the problem otherwise. We should just fix the driver for whatever weird disk you have in your machine (what is it, by the way?). Since making the reported "stripe size" match the physical sector size is what GEOM has done since at least 2009, I doubt very much that fixing any bugs in that reported value would have the weird unintended consequences you imply it might. -Nathan > > DES From owner-svn-src-head@freebsd.org Wed Aug 17 14:44:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F272BBD6AF; Wed, 17 Aug 2016 14:44:49 +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 E5CF61EDB; Wed, 17 Aug 2016 14:44: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 u7HEim4c074353; Wed, 17 Aug 2016 14:44:48 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HEimsD074352; Wed, 17 Aug 2016 14:44:48 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608171444.u7HEimsD074352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 17 Aug 2016 14:44:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304292 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 14:44:49 -0000 Author: tuexen Date: Wed Aug 17 14:44:47 2016 New Revision: 304292 URL: https://svnweb.freebsd.org/changeset/base/304292 Log: Use names for SCTP and UDPLite when reporting the input histogram. MFC after: 3 days Modified: head/usr.bin/netstat/inet6.c Modified: head/usr.bin/netstat/inet6.c ============================================================================== --- head/usr.bin/netstat/inet6.c Wed Aug 17 13:19:28 2016 (r304291) +++ head/usr.bin/netstat/inet6.c Wed Aug 17 14:44:47 2016 (r304292) @@ -207,11 +207,11 @@ static const char *ip6nh[] = { "#129", "#130", "#131", - "#132", + "SCTP", "#133", "#134", "#135", - "#136", + "UDPLite", "#137", "#138", "#139", From owner-svn-src-head@freebsd.org Wed Aug 17 14:49:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E53D3BBD75D; Wed, 17 Aug 2016 14:49:54 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A51E1225; Wed, 17 Aug 2016 14:49:54 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1ba2A4-0002Qi-Sk; Wed, 17 Aug 2016 17:49:44 +0300 Date: Wed, 17 Aug 2016 17:49:44 +0300 From: Slawa Olhovchenkov To: Nathan Whitehorn Cc: Dag-Erling =?utf-8?B?U23DuHJncmF2?= , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit Message-ID: <20160817144944.GM22212@zxy.spb.ru> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 14:49:55 -0000 On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote: > > Your contention that the installer does not make policy decisions is > > equally spurious. The installer makes many policy decisions, including > > the disk layout, the size of the swap partition, the name of the pool, > > the use of boot environments (which I dislike but am not allowed to > > override), the number of filesets and their mountpoints (which I also > > dislike and am not allowed to override either), etc. The Unix > > philosophy is to push such decisions up the stack, not down. The > > decision to align partitions on 4096-byte boundaries because we're not > > sure of the correct number but know for a fact that using a smaller > > number can have a huge impact on performance is the installer's to make. > > Those are all things that the operating system does not have defaults > for: there are no tools like, say, gpart or newfs that layout disks in > any even vaguely automated way, and so no tools that would ever have > defaults for, say, the size of a swap partition except for the > installer. As such, the defaults are quite properly in the installer. > This is quite different: there are many tools that care about disk > alignment (say, gpart) and, by default, use the GEOM stripesize. The > installer is, after this patch, overriding what was meant to be a > system-wide default. > > My concern is that pushing this into the installer means that newfs, > zfs, gpart, etc., which all look at the GEOM stripesize for preferred > alignment, will still have suboptimal behavior on systems affected by > your patch. If we identified which drivers are reporting the wrong > alignment, we could fix the whole system at a go by changing it there. > As it is, we now have inconsistent default behavior for partitions > between tools (the installer and sade will now use a different alignment > than gpart on whatever systems you were trying to fix here) and between > pre- and post-installation environments. In long term, prefered aligment is forsing 4k (or may be more): install system on 512b [mirror] disk aligment now may be need required replace disk to 4k aligment. For more flexsible in future now best chois is 4k or more. From owner-svn-src-head@freebsd.org Wed Aug 17 14:55:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95BD2BBD92E; Wed, 17 Aug 2016 14:55:51 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D749169C; Wed, 17 Aug 2016 14:55:51 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.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 EACCE1FE022; Wed, 17 Aug 2016 16:55:47 +0200 (CEST) Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Slawa Olhovchenkov , Nathan Whitehorn References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <20160817144944.GM22212@zxy.spb.ru> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Hans Petter Selasky Message-ID: <4a28f419-5293-0753-068d-1e07ddb01c2d@selasky.org> Date: Wed, 17 Aug 2016 17:00:16 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160817144944.GM22212@zxy.spb.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 14:55:51 -0000 On 08/17/16 16:49, Slawa Olhovchenkov wrote: > On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote: > > In long term, prefered aligment is forsing 4k (or may be more): > install system on 512b [mirror] disk aligment now may be need required replace > disk to 4k aligment. For more flexsible in future now best chois is 4k > or more. Hi, Not sure if it is an issue, but what will happen if a magic disk has a size less than 4K and uses a block size of 512bytes and the disk alignment gets rounded up to 4K. Will any of logic in this patch fail or hang? --HPS From owner-svn-src-head@freebsd.org Wed Aug 17 15:05:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF716BBDB78; Wed, 17 Aug 2016 15:05:12 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id B924C1B66; Wed, 17 Aug 2016 15:05:12 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id C40212C47; Wed, 17 Aug 2016 15:05:10 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id E87798EAE; Wed, 17 Aug 2016 17:03:44 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> Date: Wed, 17 Aug 2016 17:03:44 +0200 In-Reply-To: <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> (Nathan Whitehorn's message of "Wed, 17 Aug 2016 07:36:00 -0700") Message-ID: <86wpjf4eun.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 15:05:13 -0000 Nathan Whitehorn writes: > Dag-Erling Sm=C3=B8rgrav writes: > > [...] And you keep refusing to address the fact that most drivers > > don't report a stripe size, except by repeating your claim that they > > do, with no evidence to back it up. Feel free to 'grep -r > > stripesize /usr/src/sys/dev'. Go on, I'll wait. > And yet, if you look at the GEOM XML, it is reported and there. And, > look, it's even right for the AF 512e disks in my machine! Yes, that is one of the few cases where we get it right, as previously mentioned. But it only works because it's known to us (listed in the quirk table) and directly attached. If you replace that drive with a brand new one a year from now, you have no guarantee that the new drive will be recognized as an AF drive. > I've literally never seen a case where we don't already do the right > thing here. The I can only conclude that you have very little real-world experience. I have mentioned several examples to you, and even told you how to confirm, by inspecting the source code, that most drivers do *not* set the stripe size. > It's correct, as far as I can tell, 100% of the time on all possible > variants of AF disks. You keep repeating this, as if it somehow proves me wrong. It doesn't. > One could argue that calling this the "stripesize" is a hack, and I > would agree, One could, but one would be wrong. > As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev, > as I'm sure you know, and you will find all the code that handles this > there. Only for directly attached drives, and most drives do not report the correct physical sector size, which is why we have quirk tables. > We should just fix the driver for whatever weird disk you have in your > machine (what is it, by the way?). Oh please. Now you're just being an . DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Wed Aug 17 15:05:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76A16BBDBCC; Wed, 17 Aug 2016 15:05:43 +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 5680F1CF1; Wed, 17 Aug 2016 15:05:43 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net ([128.54.117.176]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7HF5Xwu007627 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 17 Aug 2016 08:05:33 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Slawa Olhovchenkov References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <20160817144944.GM22212@zxy.spb.ru> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Nathan Whitehorn Message-ID: Date: Wed, 17 Aug 2016 08:05:33 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160817144944.GM22212@zxy.spb.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVY0KSf7VD9Zfubr+ZpkYcRaUXT1pxoj4TvCRRVM0SS5bJMk3PnnZ9rL0VzhOWk3egwnO0UiwR5A/GEgjOh8h0h1ypsui/GRNZY= X-Sonic-ID: C;cCx/C4xk5hGvKq/hcgQksw== M;Ug+1C4xk5hGvKq/hcgQksw== 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.22 Precedence: list List-Id: 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, 17 Aug 2016 15:05:43 -0000 On 08/17/16 07:49, Slawa Olhovchenkov wrote: > On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote: > >>> Your contention that the installer does not make policy decisions is >>> equally spurious. The installer makes many policy decisions, including >>> the disk layout, the size of the swap partition, the name of the pool, >>> the use of boot environments (which I dislike but am not allowed to >>> override), the number of filesets and their mountpoints (which I also >>> dislike and am not allowed to override either), etc. The Unix >>> philosophy is to push such decisions up the stack, not down. The >>> decision to align partitions on 4096-byte boundaries because we're not >>> sure of the correct number but know for a fact that using a smaller >>> number can have a huge impact on performance is the installer's to make. >> Those are all things that the operating system does not have defaults >> for: there are no tools like, say, gpart or newfs that layout disks in >> any even vaguely automated way, and so no tools that would ever have >> defaults for, say, the size of a swap partition except for the >> installer. As such, the defaults are quite properly in the installer. >> This is quite different: there are many tools that care about disk >> alignment (say, gpart) and, by default, use the GEOM stripesize. The >> installer is, after this patch, overriding what was meant to be a >> system-wide default. >> >> My concern is that pushing this into the installer means that newfs, >> zfs, gpart, etc., which all look at the GEOM stripesize for preferred >> alignment, will still have suboptimal behavior on systems affected by >> your patch. If we identified which drivers are reporting the wrong >> alignment, we could fix the whole system at a go by changing it there. >> As it is, we now have inconsistent default behavior for partitions >> between tools (the installer and sade will now use a different alignment >> than gpart on whatever systems you were trying to fix here) and between >> pre- and post-installation environments. > In long term, prefered aligment is forsing 4k (or may be more): > install system on 512b [mirror] disk aligment now may be need required replace > disk to 4k aligment. For more flexsible in future now best chois is 4k > or more. For future-proofing in such circumstances, it might be worth expanding the vfs.zfs.min_auto_ashift tunable into some global thing that the disk drivers (or geom_disk) read to round up the physical sector sizes they would otherwise report. That would ensure that gpart, zfs, etc. all behave consistently in such cases. -Nathan From owner-svn-src-head@freebsd.org Wed Aug 17 15:06:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A93E7BBDC37; Wed, 17 Aug 2016 15:06:58 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 716FE1E6F; Wed, 17 Aug 2016 15:06:57 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 8A0CE2C5C; Wed, 17 Aug 2016 15:06:56 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id BE9468EB1; Wed, 17 Aug 2016 17:05:30 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Hans Petter Selasky Cc: Slawa Olhovchenkov , Nathan Whitehorn , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <20160817144944.GM22212@zxy.spb.ru> <4a28f419-5293-0753-068d-1e07ddb01c2d@selasky.org> Date: Wed, 17 Aug 2016 17:05:30 +0200 In-Reply-To: <4a28f419-5293-0753-068d-1e07ddb01c2d@selasky.org> (Hans Petter Selasky's message of "Wed, 17 Aug 2016 17:00:16 +0200") Message-ID: <86shu34erp.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 15:06:58 -0000 Hans Petter Selasky writes: > Not sure if it is an issue, but what will happen if a magic disk has a > size less than 4K and uses a block size of 512bytes and the disk > alignment gets rounded up to 4K. Will any of logic in this patch fail > or hang? What is a magic disk, and why would you want to install FreeBSD on a drive with less than 4096 bytes available? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Wed Aug 17 15:07:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20688BBDC82; Wed, 17 Aug 2016 15:07:16 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5CD1113B; Wed, 17 Aug 2016 15:07:15 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1ba2Qz-0002vR-Vl; Wed, 17 Aug 2016 18:07:13 +0300 Date: Wed, 17 Aug 2016 18:07:13 +0300 From: Slawa Olhovchenkov To: Hans Petter Selasky Cc: Nathan Whitehorn , Dag-Erling =?utf-8?B?U23DuHJncmF2?= , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit Message-ID: <20160817150713.GO8192@zxy.spb.ru> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <20160817144944.GM22212@zxy.spb.ru> <4a28f419-5293-0753-068d-1e07ddb01c2d@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4a28f419-5293-0753-068d-1e07ddb01c2d@selasky.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 15:07:16 -0000 On Wed, Aug 17, 2016 at 05:00:16PM +0200, Hans Petter Selasky wrote: > On 08/17/16 16:49, Slawa Olhovchenkov wrote: > > On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote: > > > > > In long term, prefered aligment is forsing 4k (or may be more): > > install system on 512b [mirror] disk aligment now may be need required replace > > disk to 4k aligment. For more flexsible in future now best chois is 4k > > or more. > > Hi, > > Not sure if it is an issue, but what will happen if a magic disk has a > size less than 4K and uses a block size of 512bytes and the disk > alignment gets rounded up to 4K. Will any of logic in this patch fail or > hang? I am not sure about understunding you. Do you talk about disk total size of 1536 bytes and less? From owner-svn-src-head@freebsd.org Wed Aug 17 15:16:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6640BBC03C; Wed, 17 Aug 2016 15:16:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EC8E1832; Wed, 17 Aug 2016 15:16:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.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 A70CF1FE022; Wed, 17 Aug 2016 17:16:46 +0200 (CEST) Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <20160817144944.GM22212@zxy.spb.ru> <4a28f419-5293-0753-068d-1e07ddb01c2d@selasky.org> <86shu34erp.fsf@desk.des.no> Cc: Slawa Olhovchenkov , Nathan Whitehorn , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Hans Petter Selasky Message-ID: Date: Wed, 17 Aug 2016 17:21:15 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <86shu34erp.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 15:16:54 -0000 On 08/17/16 17:05, Dag-Erling Smørgrav wrote: > Hans Petter Selasky writes: >> Not sure if it is an issue, but what will happen if a magic disk has a >> size less than 4K and uses a block size of 512bytes and the disk >> alignment gets rounded up to 4K. Will any of logic in this patch fail >> or hang? > > What is a magic disk, and why would you want to install FreeBSD on a > drive with less than 4096 bytes available? > Hi, My intention is not to install FreeBSD on a 3K disk. My question is pure mathematical, if the bsdinstall will segfault, division by zero or anything like that, if one should try to install FreeBSD on a 3K disk, because you round up the size of the disk to be bigger than it actually is. Should there be a check for too small disks in there? --HPS From owner-svn-src-head@freebsd.org Wed Aug 17 15:27:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65B6EBBC38D; Wed, 17 Aug 2016 15:27:13 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 547D01F2C; Wed, 17 Aug 2016 15:27:12 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net ([128.54.117.176]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7HFR0Tj010256 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 17 Aug 2016 08:27:00 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> Date: Wed, 17 Aug 2016 08:26:59 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <86wpjf4eun.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVauyAqj5D59L9d0QuN0zBMVNDOaOVZqi33i5R04TrQjZxWiMikqeUTfFdKKNYjKECq/OJ34p50jI2xIHmOQQl0AanFmcraZIEw= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 15:27:13 -0000 On 08/17/16 08:03, Dag-Erling Smørgrav wrote: > Nathan Whitehorn writes: >> Dag-Erling Smørgrav writes: >>> [...] And you keep refusing to address the fact that most drivers >>> don't report a stripe size, except by repeating your claim that they >>> do, with no evidence to back it up. Feel free to 'grep -r >>> stripesize /usr/src/sys/dev'. Go on, I'll wait. >> And yet, if you look at the GEOM XML, it is reported and there. And, >> look, it's even right for the AF 512e disks in my machine! > Yes, that is one of the few cases where we get it right, as previously > mentioned. But it only works because it's known to us (listed in the > quirk table) and directly attached. If you replace that drive with a > brand new one a year from now, you have no guarantee that the new drive > will be recognized as an AF drive. Not true at all. All modern disks report their physical sector size, as distinct from the logical one, in their ATA IDENTIFY data and ata_da.c uses that. There is also a small quirks table for some older spinning disks and a few SSDs that lie and mostly hasn't needed additions in quite some time. camcontrol identify correctly reports 4096 for the physical sector size on 5 different random AF-512e disks I just checked (some of those are also, redundantly, in the quirks table). Since this seems to have become the standard, I can't imagine that the quirks table would need to grow much in the future for this issue. > >> I've literally never seen a case where we don't already do the right >> thing here. > The I can only conclude that you have very little real-world experience. > I have mentioned several examples to you, and even told you how to > confirm, by inspecting the source code, that most drivers do *not* set > the stripe size. Most drivers? Yes, sure. Most drivers that people use? No. And I am aware of how to use grep, thanks. > >> It's correct, as far as I can tell, 100% of the time on all possible >> variants of AF disks. > You keep repeating this, as if it somehow proves me wrong. It doesn't. > >> One could argue that calling this the "stripesize" is a hack, and I >> would agree, > One could, but one would be wrong. >> As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev, >> as I'm sure you know, and you will find all the code that handles this >> there. > Only for directly attached drives, and most drives do not report the > correct physical sector size, which is why we have quirk tables. Which disks? Your original email said that VMware reports too-small values and that there is a bug in the LSI MegaRAID driver. I'm not sure which actual drivers those were (e.g. mfid or through CAM), or how they were set up (RAID or passthrough), but that's a small list and those issues can presumably be fixed. I would be happy to help make those changes if you can provide some more information. >> We should just fix the driver for whatever weird disk you have in your >> machine (what is it, by the way?). > Oh please. Now you're just being an . I somehow still don't know what problem, on what hardware, you are actually trying to fix. Instead, I get delightful personal invective. The patch is fine for 11.0. I would like to know what bugs it was fixing, so we can fix them more broadly after the release. Is that so much to ask? -Nathan > DES From owner-svn-src-head@freebsd.org Wed Aug 17 15:41:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFFEEBBC7D2; Wed, 17 Aug 2016 15:41:27 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 776611905; Wed, 17 Aug 2016 15:41:27 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id E4C702D4B; Wed, 17 Aug 2016 15:41:25 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 1AD428EB6; Wed, 17 Aug 2016 17:40:00 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Hans Petter Selasky Cc: Slawa Olhovchenkov , Nathan Whitehorn , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <20160817144944.GM22212@zxy.spb.ru> <4a28f419-5293-0753-068d-1e07ddb01c2d@selasky.org> <86shu34erp.fsf@desk.des.no> Date: Wed, 17 Aug 2016 17:39:59 +0200 In-Reply-To: (Hans Petter Selasky's message of "Wed, 17 Aug 2016 17:21:15 +0200") Message-ID: <86oa4r4d68.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 15:41:27 -0000 Hans Petter Selasky writes: > My intention is not to install FreeBSD on a 3K disk. My question is > pure mathematical, if the bsdinstall will segfault, division by zero > or anything like that, if one should try to install FreeBSD on a 3K > disk, because you round up the size of the disk to be bigger than it > actually is. The code in question computes the offset and size of the largest block of contiguous free space on a disk that already has a partition table. If you even got this far, it would round the offset up to 4096 and the size down by and equivalent amount and you'd get an error box saying "No free space left on device". Say you have a 3584-byte provider with 512-byte sectors formatted with MBR, leaving 3072 bytes (6 sectors) free at offset 512 (1); stripe size is unreported and is arbitrarily set to the smallest common multiple of 512 and 4096, which is 4096; misalignment is 512 % 4096 =3D=3D 512 bytes; adjustment is (4096 - 512) / 512 =3D=3D 7 sectors; adjusted offset is 8 sectors, adjusted size is -1 sectors which the caller rejects (and yes, the variables are unsigned and the check is for <=3D 0, not =3D=3D 0, so everything works as intended). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Wed Aug 17 15:46:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 216D5BBCB5E; Wed, 17 Aug 2016 15:46:31 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id DEB701EF3; Wed, 17 Aug 2016 15:46:30 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id A58C82DAA; Wed, 17 Aug 2016 15:46:29 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id E0E088EB9; Wed, 17 Aug 2016 17:45:03 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> Date: Wed, 17 Aug 2016 17:45:03 +0200 In-Reply-To: <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> (Nathan Whitehorn's message of "Wed, 17 Aug 2016 08:26:59 -0700") Message-ID: <86k2ff4cxs.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 15:46:31 -0000 Nathan Whitehorn writes: > Dag-Erling Sm=C3=B8rgrav writes: > > I have mentioned several examples to you, and even told you how to > > confirm, by inspecting the source code, that most drivers do *not* > > set the stripe size. > Most drivers? Yes, sure. Most drivers that people use? No. Every. Single. Dell. Server. Probably every single HP server as well, I haven't checked. VirtualBox gets it wrong. Xen gets it wrong. I believe KVM (including RHEV) and VMWare get it wrong too, but haven't been able to verify. I guess those aren't important to you? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Wed Aug 17 15:51:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E125BBCF0C for ; Wed, 17 Aug 2016 15:51:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CA4917BE for ; Wed, 17 Aug 2016 15:51:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x242.google.com with SMTP id d65so9752409ith.0 for ; Wed, 17 Aug 2016 08:51:19 -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=JYv1HpFsXQQRe/172PSgaDrpEqVyQrRQoZp/b+yaMaI=; b=f7LhX+p303RsnS+bW9b0zpcgPfVL91pNeuhhRkCJg6ccZ3xFg/HhlBMVBB6PZ6T8nA r/tg+xlegkIxsPK50JTBv899HFBzAxSYCtenMKIVSQqrzprKzJfFnUrqLESJnE2D4b54 pHB6+Vw6oPoiMmFx47Xi+AVzPd6eKsKQfEp4oiFk2wKj0I/05c5v+FBOKmnHYEfKVfr4 PRJPiW/h3SoqK8ugXEjX0vCoquj9WO5AjRm2V9P5TRy294DJ+Izyx7CFEB4u+fOsYIJc 1TjV+1TE009POeC8olPxo5GN8Vmaj6u2+w7YbViJe+WDJi8oV+DxUnlSpiO/QlM7KQeL TrLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=JYv1HpFsXQQRe/172PSgaDrpEqVyQrRQoZp/b+yaMaI=; b=KPUbrDN3BNjfCYXkezjjAVgUi1Gn8+nitydd+cmZwJ0MYrFyxTex68QwJ9MywDtFvj bkSTumIibdm9F9lA3f2mmC4R0OTUcGLYTlNpaeICPUNyDF6PeGbbjA12HUaTCEGDa1sf rRHmO9p4G/yqh8Pdb+0Y3dXDhuYMlmvw8XDnes3TbSZPO+swj4WuP6mIBAahrIvtSLDJ 3qccWuHvWShqTZUnHRoZ/qOBsoKPxd2/CCRd4Ij2xqSZ+2hcfXhRTc6bds+0ULHuofLB RYi5I11zLZGqV98nnDi8Ll+an7FGRxxnyZdYAYO5EsvnS7PNxDq9lRMv9TmO5Yej0QNg 2xAA== X-Gm-Message-State: AEkoouucEIoAKjaVZdyk/FSSgUwsJEDvYPStY7fyucOFPTvizsqDes1+uYQfhre6T/hpjqsG90BQNgwbvwL0jg== X-Received: by 10.36.116.193 with SMTP id o184mr1312981itc.14.1471449078665; Wed, 17 Aug 2016 08:51:18 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Wed, 17 Aug 2016 08:51:17 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> From: Warner Losh Date: Wed, 17 Aug 2016 09:51:17 -0600 X-Google-Sender-Auth: uZkeXaP3Q4A-Hf5Z2gUPrmbwsv0 Message-ID: Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Nathan Whitehorn Cc: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , 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.22 Precedence: list List-Id: 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, 17 Aug 2016 15:51:19 -0000 On Wed, Aug 17, 2016 at 8:36 AM, Nathan Whitehorn wrote: > As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev, as > I'm sure you know, and you will find all the code that handles this there. There's at least a dozen disk drivers that aren't CAM. The code in CAM that handles this is, at best, a set of heuristics that can and does get it wrong. These two facts alone severely undermine your argument. Warner From owner-svn-src-head@freebsd.org Wed Aug 17 15:57:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4512BBD286 for ; Wed, 17 Aug 2016 15:57:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::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 7B6551B48 for ; Wed, 17 Aug 2016 15:57:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id f6so95270825ith.0 for ; Wed, 17 Aug 2016 08:57:45 -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=OWdDeo5p8TbGZXEy2BHOYjfW5WQFv/tv5+s847PJkv0=; b=bLfvT3X40eHSZ4tK4Fq0j0zrEUPsBu4gDdNxAehVVrrU0ns3G5dLkHNaYZ85bPYPMZ 3tllWb52S6PKgVliaCJEO6to+Aw37ZivIqtrFqoOgT3wL0yjVcG9QazWvDZS1gpZRPgP Z5DQIXhU9QQz85TWuWCTjlcJILFAqvqAdvi5GULFJOfvXMXQ9MPCwnmwyl5r8mLgshRB vObkcHB0jsDPL/Bu5pexA1o1LI282wWq+qWJnHykJKO09yG08S7Z8t4T7LaDnTWAsvTD PW9G5ibJtzh42mqopAAvfTXaKOkV1QFX6xOt3Y8dfw40gCW6q7cv/K0/52Bh5umhhBbh N2fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OWdDeo5p8TbGZXEy2BHOYjfW5WQFv/tv5+s847PJkv0=; b=H0ZyF24jKgY4rtlaeHLzIeZJ6OXHNTLtXpV9U+IAT9lUx8Mld/i1DYnZpv8YiRgXyK dtMjfm9RQfPswMtH9pPfXJR0lb86nVazUDiQMNnRIsj+SreqKTeYqn1/AcM1VoRagZca 2iQVkflYfzLx6qMFmRrRdhd4c9/MyAZEJn2jq7KEPvBE8a+1aPjOFrLew0EpfoyCvl74 Ll86NrpfTuOxGol3FwIKKuXTf6HRGmch37BQHv02vpJu2SvpLNCcelyEabJfLxsq1ID7 OVSUL46s7TOfx3ws+ZAgTIh+zJZks1Y74sIHmwF3WgJF20QDitHkgbKX/K/KdhQbHwUj DIww== X-Gm-Message-State: AEkoouvh31/SDrVMimGJO5mUpv4DoEyZQJsxkH7iF8/EWW1oFJo/Ei0qByGuL82g0sRzGlc1DF3yD/ufG4BcLg== X-Received: by 10.36.213.131 with SMTP id a125mr28507079itg.14.1471449464862; Wed, 17 Aug 2016 08:57:44 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Wed, 17 Aug 2016 08:57:44 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> From: Warner Losh Date: Wed, 17 Aug 2016 09:57:44 -0600 X-Google-Sender-Auth: 0hCCn9pT0_4YusyeE7b6_TZ72PA Message-ID: Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Nathan Whitehorn Cc: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , 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.22 Precedence: list List-Id: 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, 17 Aug 2016 15:57:45 -0000 On Wed, Aug 17, 2016 at 9:26 AM, Nathan Whitehorn wrote: > Not true at all. All modern disks report their physical sector size, as > distinct from the logical one, in their ATA IDENTIFY data and ata_da.c uses > that. You are correct that there are two fields in the ATA IDENTIFY. However, you are incorrect in thinking that all modern disks report their actual physical sector size instead of a 'compatibility' number. We have dozens of quirks and are adding them at the rate of a couple a month to make the current imperfect magic happen. > There is also a small quirks table for some older spinning disks and a > few SSDs that lie and mostly hasn't needed additions in quite some time. > camcontrol identify correctly reports 4096 for the physical sector size on 5 > different random AF-512e disks I just checked (some of those are also, > redundantly, in the quirks table). Since this seems to have become the > standard, I can't imagine that the quirks table would need to grow much in > the future for this issue. Any yet the table continues to grow. As someone who evaluates disks for a large streaming media company, you cannot begin to imagine the number of things that vendors get wrong... Life would be so much easier if you could actually trust vendors to report things correctly in their ATA IDENTIFY command. SCSI is better, but still not perfect. You should really listen to people that have been on the front line here. CAM does a decent job of getting things right. It isn't perfect and can never be perfect. Expecting it to magically change to be perfect is unreasonable and will literally never happen. Warner From owner-svn-src-head@freebsd.org Wed Aug 17 16:04:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8592BBD456 for ; Wed, 17 Aug 2016 16:04:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E2A21012 for ; Wed, 17 Aug 2016 16:04:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id b62so139428164iod.3 for ; Wed, 17 Aug 2016 09:04:11 -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:content-transfer-encoding; bh=QRWZtKbWPpkJCCQ/imWTJrvm6XS25Sq3TXTC6Sup3Kg=; b=AQzkDk0YuL7+lDjc+9AqoPE7J4E9fZJGpUBG079hpeTPeKpXuJ3pdcM8doPbbKcUhW 8u75wCXWsJTCfcMDycOLBew15EIlwapDIbX+1fOABjL4SfF36qPGD7zS3xaZgVfvUdeu 2Qt02hadCnLi/hY8DrcI2V3ssbI+3yOfFG6rfc2MkEfg68UYVCMHskAknIgxT18ou7Gf Yu4vAsPxpk01MpHLUZ6v3qULfpYOjEB5QvndNDUyuckhkKBrB74C9z3RBhtI5NXihkPR GwW4+Nfgi2Urizsyb0Z5Nc07tAdmpBhFTh86PkriWuUBQY2t7oU3XxnnCXZp8VP76nN+ jayw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=QRWZtKbWPpkJCCQ/imWTJrvm6XS25Sq3TXTC6Sup3Kg=; b=ASlw64Pj+lbjMjG8Q5LPI2NvPm7W/hf+Aw/qnCmOwOwvJ2Vvs9nzcioDtv/NMVmSJh DrkS18gD3CbNlifqFUnV288+ZNSH/f1zTPpfOAKbi8xC3kRl7So10TyPFJMeywogjbjK 7Fq9viwLnQz2F3GBpuEgNZhY1XYkcOU/GFBT74VdxcMWSQHm5ncPIDY7K6DOepE/G9K6 lEz1z0DNHrMsIi8/KUpuFVKyQkJ7wyf85y18vtLaiQ+zETI71HeK3RPhjXm0izbjA+KZ iu7Whp8MPi72q71mJfuLxh5CXyyQKSpk+OfF+hbryyabrKxGi4L/bhfC0Ry2/4LanT4i BXHg== X-Gm-Message-State: AEkooutw54Wl0KZbqW+U/IXdxi9TxUdMPLHMCLRgKJnbmHEHxlGnMvQhJmuzwIzNGPISNmSvotpwIcOPO1O+0A== X-Received: by 10.107.21.134 with SMTP id 128mr46020959iov.59.1471449850980; Wed, 17 Aug 2016 09:04:10 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Wed, 17 Aug 2016 09:04:10 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <86k2ff4cxs.fsf@desk.des.no> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> From: Warner Losh Date: Wed, 17 Aug 2016 10:04:10 -0600 X-Google-Sender-Auth: pzwaT3jDht6bHzP9EtcMvqdBvx0 Message-ID: Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 16:04:11 -0000 On Wed, Aug 17, 2016 at 9:45 AM, Dag-Erling Sm=C3=B8rgrav wrot= e: > Nathan Whitehorn writes: >> Dag-Erling Sm=C3=B8rgrav writes: >> > I have mentioned several examples to you, and even told you how to >> > confirm, by inspecting the source code, that most drivers do *not* >> > set the stripe size. >> Most drivers? Yes, sure. Most drivers that people use? No. > > Every. Single. Dell. Server. > > Probably every single HP server as well, I haven't checked. > > VirtualBox gets it wrong. Xen gets it wrong. I believe KVM (including > RHEV) and VMWare get it wrong too, but haven't been able to verify. > > I guess those aren't important to you? Also, SD cards get it wrong. It is reported, true enough, but it is often wrong in the sense it can be suboptimal. Different SD cards report different things for the number of sectors to erase at a time. Some vendors do an excellent job of reporting the optimal amount. Others do not (often because the Warner From owner-svn-src-head@freebsd.org Wed Aug 17 16:07:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84640BBD4FE for ; Wed, 17 Aug 2016 16:07:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 491B612FA for ; Wed, 17 Aug 2016 16:07:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22e.google.com with SMTP id m101so139494491ioi.2 for ; Wed, 17 Aug 2016 09:07:18 -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:content-transfer-encoding; bh=sXOymg03wEIXSHlZsbXXBAyULcIHHA5ZOFE62g7kR8c=; b=vwfRnSuNmJaoNFVgN9GdgWrWdkF6kobpLz5HoDc6G/1NHljUFTlClghT6PYEepqJS1 bo6C9sk2wO1o+cPI6zMrUtptn76u/aD7LNRrGdeFr2UUhIQbF2j2M9zu5yesk5jV7fj7 1uhc2UF9JucuDdw9bj1eFGMSJiiR7LT1uTd3aacRnJOyPQCc27RwKnlyLWKgHYgCMR4u xKyLABkzdNLAN7vNSBHgxpQNDtWGTI86v6g8JWChxrbsEy/UvqoWNR6osGW83FaNNBun Q0HVRCWS6vBdDBObCk9Pd710qzcLu6IhZGnfbu4pEtgLFrQYisA2COq6K5O3+mrJtkkR eC1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=sXOymg03wEIXSHlZsbXXBAyULcIHHA5ZOFE62g7kR8c=; b=XS1bI/y2hl9MV4m4m8/3YY8ZPgWXiUU/IzFNQP86lqKUQvzPRiNNHLiekZhMPuJNqv qyOwAGY/hNLpYJnsEAAztVuucy+Dle3DkjHyaztri9m/+Qrs+0Y+62s7Gas1wGC2p3C+ 1P2gO2ruKv3uFKhgeGu6O0+mKc+kPIJ533CsN6rOgV45lzV1qugYciWhjA1MaIlEWo17 4gqkeEkt9EDCE7B/SCuXXRrwo6FSgrrS0zYm5FEJ1TpCdZPDGbR27Ic8f8ljr+ChmEjz lOwGMpU7LB0qkNZ4CYvDQiJsYbPkwvtwCZ4ZEXJ3j2Pq2xYo/ZqEDkfaKmNO03h+XiTY BN4A== X-Gm-Message-State: AEkoouuXnz9Xen/CR+eSRmOEUbPd0QWATWpvA7ms0VTsPRvvlztzbq8wXqZsnSvM0mnlv/74T+nuAp8XmxyyoA== X-Received: by 10.107.21.134 with SMTP id 128mr46043999iov.59.1471450037657; Wed, 17 Aug 2016 09:07:17 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Wed, 17 Aug 2016 09:07:16 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> From: Warner Losh Date: Wed, 17 Aug 2016 10:07:16 -0600 X-Google-Sender-Auth: FzpSm3LweYC1M_S-iLcYqXcjSqA Message-ID: Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 16:07:18 -0000 On Wed, Aug 17, 2016 at 10:04 AM, Warner Losh wrote: > On Wed, Aug 17, 2016 at 9:45 AM, Dag-Erling Sm=C3=B8rgrav wr= ote: >> Nathan Whitehorn writes: >>> Dag-Erling Sm=C3=B8rgrav writes: >>> > I have mentioned several examples to you, and even told you how to >>> > confirm, by inspecting the source code, that most drivers do *not* >>> > set the stripe size. >>> Most drivers? Yes, sure. Most drivers that people use? No. >> >> Every. Single. Dell. Server. >> >> Probably every single HP server as well, I haven't checked. >> >> VirtualBox gets it wrong. Xen gets it wrong. I believe KVM (including >> RHEV) and VMWare get it wrong too, but haven't been able to verify. >> >> I guess those aren't important to you? > > Also, SD cards get it wrong. It is reported, true enough, but it is often > wrong in the sense it can be suboptimal. Different SD cards report > different things for the number of sectors to erase at a time. Some > vendors do an excellent job of reporting the optimal amount. Others > do not (often because [stupid gmail] often because they copy from last year's design. I've had to override the reported size numerous times to get decent performance from SD cards in the past. Almost all of the recent embedded boards that FreeBSD supports use SD cards. While we provide images to just boot off of, there are several designs that have both a SD card and an embedded eMMC or similar card that we should be able to run the installer on. Warner From owner-svn-src-head@freebsd.org Wed Aug 17 16:30:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8BAEBBDCDD; Wed, 17 Aug 2016 16:30:14 +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 C833812E4; Wed, 17 Aug 2016 16:30:14 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net ([169.228.189.36]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7HGUA9k019851 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 17 Aug 2016 09:30:10 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: Date: Wed, 17 Aug 2016 09:30:10 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <86k2ff4cxs.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVbU5fKK7v1KoKr1/TS73Krui+yWVRtIZt9HPU8bT3ZHmC6m1WuQ2YcB8JDJp1JXGg9q3KlKF9MPZLDDw6yiPAGL+nmqd22ePms= X-Sonic-ID: C;fJeO3Zdk5hGtYK/hcgQksw== M;vB3X3Zdk5hGtYK/hcgQksw== 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.22 Precedence: list List-Id: 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, 17 Aug 2016 16:30:15 -0000 On 08/17/16 08:45, Dag-Erling Smørgrav wrote: > Nathan Whitehorn writes: >> Dag-Erling Smørgrav writes: >>> I have mentioned several examples to you, and even told you how to >>> confirm, by inspecting the source code, that most drivers do *not* >>> set the stripe size. >> Most drivers? Yes, sure. Most drivers that people use? No. > Every. Single. Dell. Server. > > Probably every single HP server as well, I haven't checked. > > VirtualBox gets it wrong. Xen gets it wrong. I believe KVM (including > RHEV) and VMWare get it wrong too, but haven't been able to verify. > > I guess those aren't important to you? > > DES OK. In which configurations? My Dell servers, for instance, don't do this. How are they set up? What drivers are being used? Is this something that affects passthrough disks, RAIDs, disk images? The point is that *if the reported stripe size is wrong*, more things than partition alignment in the installer will suffer for it. Fixing the installer with a bandaid in the run-up to a release is fine, but *we need to fix the underlying problem*. -Nathan From owner-svn-src-head@freebsd.org Wed Aug 17 16:36:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73C11BBDFF1; Wed, 17 Aug 2016 16:36:17 +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 5E2DE190A; Wed, 17 Aug 2016 16:36:17 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net ([169.228.189.36]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7HGaCAs026713 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 17 Aug 2016 09:36:13 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Warner Losh References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Nathan Whitehorn Message-ID: <445700cb-c4b4-9272-df17-a851a6200543@freebsd.org> Date: Wed, 17 Aug 2016 09:36:12 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVaNaPsK1U2+5Er4m0/6y4VC+uZX4higp+OnDJSIsGNtmD4TzmkNfLifRmuQbCpgLDvyKNm7IAk+q0U6Wk83UCTSsL1RBki5VNY= X-Sonic-ID: C;zlvRtZhk5hGvua/hcgQksw== M;UJz6tZhk5hGvua/hcgQksw== 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.22 Precedence: list List-Id: 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, 17 Aug 2016 16:36:17 -0000 On 08/17/16 08:57, Warner Losh wrote: > On Wed, Aug 17, 2016 at 9:26 AM, Nathan Whitehorn > wrote: >> Not true at all. All modern disks report their physical sector size, as >> distinct from the logical one, in their ATA IDENTIFY data and ata_da.c uses >> that. > You are correct that there are two fields in the ATA IDENTIFY. However, > you are incorrect in thinking that all modern disks report their actual > physical sector size instead of a 'compatibility' number. We have dozens > of quirks and are adding them at the rate of a couple a month to make the > current imperfect magic happen. > >> There is also a small quirks table for some older spinning disks and a >> few SSDs that lie and mostly hasn't needed additions in quite some time. >> camcontrol identify correctly reports 4096 for the physical sector size on 5 >> different random AF-512e disks I just checked (some of those are also, >> redundantly, in the quirks table). Since this seems to have become the >> standard, I can't imagine that the quirks table would need to grow much in >> the future for this issue. > Any yet the table continues to grow. As someone who evaluates disks for a large > streaming media company, you cannot begin to imagine the number of things > that vendors get wrong... Life would be so much easier if you could actually > trust vendors to report things correctly in their ATA IDENTIFY command. > SCSI is better, but still not perfect. > > You should really listen to people that have been on the front line here. > CAM does a decent job of getting things right. It isn't perfect and can never > be perfect. Expecting it to magically change to be perfect is unreasonable > and will literally never happen. > > Warner > OK, so then what is the solution here? We have a number of tools that need to know this information: gpart, sade, bsdinstall, zfs, graid, etc. If we want to have a consistent set of defaults -- for example, to use 4K across the board, which I think is a good idea -- there should be a central place to set this that does not involve hacking a variety of independent tools. Do you disagree? I don't care how that happens. It happens that the way we currently encode this is geom stripesize. If we feel like we can't get this right in drivers, then we should provide a tunable to set a minimum default alignment. You could implement this in lots of different ways. But having static values hardcoded in random places that makes similar tools (sade, gpart) behave inconsistently cannot possibly be the answer. This is my point, from beginning to end. Is there any reason -- at all -- that we should prefer per-tool one-off changes to fixing the central mechanism we already have to give consistent results that we think are reliable? -Nathan From owner-svn-src-head@freebsd.org Wed Aug 17 16:56:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9A56BBD633; Wed, 17 Aug 2016 16:56:21 +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 967DF163A; Wed, 17 Aug 2016 16:56:21 +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 u7HGuKm2023171; Wed, 17 Aug 2016 16:56:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HGuKHE023170; Wed, 17 Aug 2016 16:56:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608171656.u7HGuKHE023170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 17 Aug 2016 16:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304295 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 16:56:21 -0000 Author: tuexen Date: Wed Aug 17 16:56:20 2016 New Revision: 304295 URL: https://svnweb.freebsd.org/changeset/base/304295 Log: Fix the output for scope statistics. MFC after: 3 days Modified: head/usr.bin/netstat/inet6.c Modified: head/usr.bin/netstat/inet6.c ============================================================================== --- head/usr.bin/netstat/inet6.c Wed Aug 17 15:50:56 2016 (r304294) +++ head/usr.bin/netstat/inet6.c Wed Aug 17 16:56:20 2016 (r304295) @@ -488,8 +488,8 @@ ip6_stats(u_long off, const char *name, "{N:/global%s}\n");\ break;\ default:\ - xo_emit("\t\t{qke:name/%x}{:count/%ju} " \ - "addresses scope=%x\n",\ + xo_emit("\t\t{qke:name/%#x}{:count/%ju} " \ + "{N:/addresses scope=%#x}\n",\ i, (uintmax_t)ip6stat.s, i); \ }\ } while (0); From owner-svn-src-head@freebsd.org Wed Aug 17 17:57:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23085BBD7D2; Wed, 17 Aug 2016 17:57:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D6C361604; Wed, 17 Aug 2016 17:57:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA10915; Wed, 17 Aug 2016 20:57:28 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ba55j-000ID5-UU; Wed, 17 Aug 2016 20:57:27 +0300 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Nathan Whitehorn , Warner Losh References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <445700cb-c4b4-9272-df17-a851a6200543@freebsd.org> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Andriy Gapon Message-ID: Date: Wed, 17 Aug 2016 20:56:31 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <445700cb-c4b4-9272-df17-a851a6200543@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 17:57:37 -0000 On 17/08/2016 19:36, Nathan Whitehorn wrote: > OK, so then what is the solution here? We have a number of tools that need to > know this information: gpart, sade, bsdinstall, zfs, graid, etc. If we want to > have a consistent set of defaults -- for example, to use 4K across the board, > which I think is a good idea -- there should be a central place to set this that > does not involve hacking a variety of independent tools. Do you disagree? > > I don't care how that happens. It happens that the way we currently encode this > is geom stripesize. If we feel like we can't get this right in drivers, then we > should provide a tunable to set a minimum default alignment. You could implement > this in lots of different ways. But having static values hardcoded in random > places that makes similar tools (sade, gpart) behave inconsistently cannot > possibly be the answer. > > This is my point, from beginning to end. Is there any reason -- at all -- that > we should prefer per-tool one-off changes to fixing the central mechanism we > already have to give consistent results that we think are reliable? It would be perfect to get a correct description of a disk and to do that in central place. But still I, as a user / administrator, want to be able to _force_ the alignment that I want when I partition a disk, create a filesystem, etc. That is, even if the kernel reports the perfectly correct information and the tools know how to automatically do what's best for me, I still want to eb able to override. And I think that installers and administrative tools should provide a way to do that. And many already do, e.g. 'gpart add -a X'. So, I do not see how striving for the better disk detection (in a central place) and having more knobs in the administration tools are mutually exclusive or conflicting goals. Just my two bits. -- Andriy Gapon From owner-svn-src-head@freebsd.org Wed Aug 17 17:59:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0A2BBBD8B2; Wed, 17 Aug 2016 17:59:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A127117C3; Wed, 17 Aug 2016 17:59:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HHx93M045058; Wed, 17 Aug 2016 17:59:09 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HHx93Z045057; Wed, 17 Aug 2016 17:59:09 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608171759.u7HHx93Z045057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Aug 2016 17:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304297 - head/sys/modules/dtb/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 17:59:10 -0000 Author: manu Date: Wed Aug 17 17:59:09 2016 New Revision: 304297 URL: https://svnweb.freebsd.org/changeset/base/304297 Log: Add sun5i-a13-olinuxino to the build. Modified: head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Wed Aug 17 17:54:24 2016 (r304296) +++ head/sys/modules/dtb/allwinner/Makefile Wed Aug 17 17:59:09 2016 (r304297) @@ -8,6 +8,7 @@ DTS= \ olimex-a20-som-evb.dts \ olinuxino-lime.dts \ pcduino3.dts \ - sinovoip-bpi-m3.dts + sinovoip-bpi-m3.dts \ + sun5i-a13-olinuxino.dts .include From owner-svn-src-head@freebsd.org Wed Aug 17 18:00:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33FA6BBD95B; Wed, 17 Aug 2016 18:00:28 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16D0E199B; Wed, 17 Aug 2016 18:00:27 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net ([169.228.189.36]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7HI0L49005836 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 17 Aug 2016 11:00:21 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Andriy Gapon , Warner Losh References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <445700cb-c4b4-9272-df17-a851a6200543@freebsd.org> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Nathan Whitehorn Message-ID: Date: Wed, 17 Aug 2016 11:00:20 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVYFIqqtA+yJncLr5Or0QwCYVKjmrfBlc9pzSgMAArO9tTOHCI7G34u7CIZR0VDDz/SsDfULAI0+GYGruHbj8cS2nvNzrZB44iE= X-Sonic-ID: C;BB+2dqRk5hGmWKDx2xNB0g== M;kGj+dqRk5hGmWKDx2xNB0g== 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.22 Precedence: list List-Id: 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, 17 Aug 2016 18:00:28 -0000 On 08/17/16 10:56, Andriy Gapon wrote: > On 17/08/2016 19:36, Nathan Whitehorn wrote: >> OK, so then what is the solution here? We have a number of tools that need to >> know this information: gpart, sade, bsdinstall, zfs, graid, etc. If we want to >> have a consistent set of defaults -- for example, to use 4K across the board, >> which I think is a good idea -- there should be a central place to set this that >> does not involve hacking a variety of independent tools. Do you disagree? >> >> I don't care how that happens. It happens that the way we currently encode this >> is geom stripesize. If we feel like we can't get this right in drivers, then we >> should provide a tunable to set a minimum default alignment. You could implement >> this in lots of different ways. But having static values hardcoded in random >> places that makes similar tools (sade, gpart) behave inconsistently cannot >> possibly be the answer. >> >> This is my point, from beginning to end. Is there any reason -- at all -- that >> we should prefer per-tool one-off changes to fixing the central mechanism we >> already have to give consistent results that we think are reliable? > It would be perfect to get a correct description of a disk and to do that in > central place. But still I, as a user / administrator, want to be able to > _force_ the alignment that I want when I partition a disk, create a filesystem, > etc. That is, even if the kernel reports the perfectly correct information and > the tools know how to automatically do what's best for me, I still want to eb > able to override. And I think that installers and administrative tools should > provide a way to do that. And many already do, e.g. 'gpart add -a X'. > So, I do not see how striving for the better disk detection (in a central place) > and having more knobs in the administration tools are mutually exclusive or > conflicting goals. > > Just my two bits. Agreed 100%. The issue here is that this kind of patch unconditionally overrides the kernel in an unsettable way. I think the right scheme is: 1. Try to get the real values as much as possible. 2. Provide a global hint to all tools that you want some value (e.g. 4K) unless the drivers are *sure* it's the wrong answer. 3. Have options in individual tools to force other values. We have (1), though it can probably be improved, and (3) and just need (2). -Nathan From owner-svn-src-head@freebsd.org Wed Aug 17 20:20:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E411ABBC96D; Wed, 17 Aug 2016 20:20:43 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E9C01E48; Wed, 17 Aug 2016 20:20:43 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 894443592E5; Wed, 17 Aug 2016 22:20:40 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 5D3A928494; Wed, 17 Aug 2016 22:20:40 +0200 (CEST) Date: Wed, 17 Aug 2016 22:20:40 +0200 From: Jilles Tjoelker To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304176 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern Message-ID: <20160817202040.GA21263@stack.nl> References: <201608151908.u7FJ8phh091939@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608151908.u7FJ8phh091939@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 20:20:44 -0000 On Mon, Aug 15, 2016 at 07:08:51PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon Aug 15 19:08:51 2016 > New Revision: 304176 > URL: https://svnweb.freebsd.org/changeset/base/304176 > Log: > Add an implementation of fdatasync(2). > The syscall is a trivial wrapper around new VOP_FDATASYNC(), sharing > code with fsync(2). For all filesystems, this commit provides the > implementation which delegates the work of VOP_FDATASYNC() to > VOP_FSYNC(). This is functionally correct but not efficient. > This is not yet POSIX-compliant implementation, because it does not > ensure that queued AIO requests are completed before returning. > Reviewed by: mckusick > Discussed with: avg (ZFS), jhb (AIO part) > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > Differential revision: https://reviews.freebsd.org/D7471 > Modified: > head/include/unistd.h > head/lib/libc/sys/Symbol.map > head/sys/compat/freebsd32/syscalls.master > head/sys/kern/syscalls.master > head/sys/kern/vfs_default.c > head/sys/kern/vfs_syscalls.c > head/sys/kern/vnode_if.src > Modified: head/include/unistd.h > ============================================================================== > --- head/include/unistd.h Mon Aug 15 19:05:41 2016 (r304175) > +++ head/include/unistd.h Mon Aug 15 19:08:51 2016 (r304176) > @@ -384,6 +384,7 @@ extern int optind, opterr, optopt; > /* ISO/IEC 9945-1: 1996 */ > #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE > int fsync(int); > +int fdatasync(int); > > /* > * ftruncate() was in the POSIX Realtime Extension (it's used for shared Apparently these functions were added closely enough in time that they can stay together here :) > [snip] > Modified: head/sys/kern/vfs_syscalls.c > ============================================================================== > --- head/sys/kern/vfs_syscalls.c Mon Aug 15 19:05:41 2016 (r304175) > +++ head/sys/kern/vfs_syscalls.c Mon Aug 15 19:08:51 2016 (r304176) > @@ -3354,20 +3354,8 @@ freebsd6_ftruncate(struct thread *td, st > } > #endif > > -/* > - * Sync an open file. > - */ > -#ifndef _SYS_SYSPROTO_H_ > -struct fsync_args { > - int fd; > -}; > -#endif > -int > -sys_fsync(td, uap) > - struct thread *td; > - struct fsync_args /* { > - int fd; > - } */ *uap; > +static int > +kern_fsync(struct thread *td, int fd, bool fullsync) > { > struct vnode *vp; > struct mount *mp; > @@ -3375,11 +3363,15 @@ sys_fsync(td, uap) > cap_rights_t rights; > int error, lock_flags; > > - AUDIT_ARG_FD(uap->fd); > - error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_FSYNC), &fp); > + AUDIT_ARG_FD(fd); > + error = getvnode(td, fd, cap_rights_init(&rights, CAP_FSYNC), &fp); > if (error != 0) > return (error); > vp = fp->f_vnode; > +#if 0 > + if (!fullsync) > + /* XXXKIB: compete outstanding aio writes */; Under the _POSIX_SYNCHRONIZED_IO option, completing outstanding I/O requests is in fact required for fsync() as well. The fdatasync() function is completely under the _POSIX_SYNCHRONIZED_IO option. We do not implement this option, but keeping fdatasync()'s guarantees a subset of fsync()'s guarantees seems sensible. > +#endif > error = vn_start_write(vp, &mp, V_WAIT | PCATCH); > if (error != 0) > goto drop; > [snip] > Modified: head/sys/kern/vnode_if.src > ============================================================================== > --- head/sys/kern/vnode_if.src Mon Aug 15 19:05:41 2016 (r304175) > +++ head/sys/kern/vnode_if.src Mon Aug 15 19:08:51 2016 (r304176) > @@ -703,6 +703,14 @@ vop_add_writecount { > IN int inc; > }; > > +%% fdatasync vp L L L > + > +vop_fdatasync { > + IN struct vnode *vp; > + IN struct thread *td; > +}; > + > + > # The VOPs below are spares at the end of the table to allow new VOPs to be > # added in stable branches without breaking the KBI. New VOPs in HEAD should > # be added above these spares. When merging a new VOP to a stable branch, A waitfor parameter like in vop_fsync may be useful to implement aio_fsync(O_DSYNC) later on. -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Wed Aug 17 20:21:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11486BBC9D4; Wed, 17 Aug 2016 20:21:35 +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 B8BA1126B; Wed, 17 Aug 2016 20:21:34 +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 u7HKLXaj001586; Wed, 17 Aug 2016 20:21:33 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HKLXJ4001584; Wed, 17 Aug 2016 20:21:33 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608172021.u7HKLXJ4001584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 17 Aug 2016 20:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304313 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 20:21:35 -0000 Author: ae Date: Wed Aug 17 20:21:33 2016 New Revision: 304313 URL: https://svnweb.freebsd.org/changeset/base/304313 Log: Teach netisr_get_cpuid() to limit a given value to supported by netisr. Use netisr_get_cpuid() in netisr_select_cpuid() to limit cpuid value returned by protocol to be sure that it is not greather than nws_count. PR: 211836 Reviewed by: adrian MFC after: 3 days Modified: head/sys/net/if_epair.c head/sys/net/netisr.c Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Wed Aug 17 19:43:45 2016 (r304312) +++ head/sys/net/if_epair.c Wed Aug 17 20:21:33 2016 (r304313) @@ -807,9 +807,9 @@ epair_clone_create(struct if_clone *ifc, * cache locality but we can at least allow parallelism. */ sca->cpuid = - netisr_get_cpuid(sca->ifp->if_index % netisr_get_cpucount()); + netisr_get_cpuid(sca->ifp->if_index); scb->cpuid = - netisr_get_cpuid(scb->ifp->if_index % netisr_get_cpucount()); + netisr_get_cpuid(scb->ifp->if_index); /* Initialise pseudo media types. */ ifmedia_init(&sca->media, 0, epair_media_change, epair_media_status); Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Wed Aug 17 19:43:45 2016 (r304312) +++ head/sys/net/netisr.c Wed Aug 17 20:21:33 2016 (r304313) @@ -272,10 +272,7 @@ u_int netisr_get_cpuid(u_int cpunumber) { - KASSERT(cpunumber < nws_count, ("%s: %u > %u", __func__, cpunumber, - nws_count)); - - return (nws_array[cpunumber]); + return (nws_array[cpunumber % nws_count]); } /* @@ -810,10 +807,12 @@ netisr_select_cpuid(struct netisr_proto * dispatch. In the queued case, fall back on the SOURCE * policy. */ - if (*cpuidp != NETISR_CPUID_NONE) + if (*cpuidp != NETISR_CPUID_NONE) { + *cpuidp = netisr_get_cpuid(*cpuidp); return (m); + } if (dispatch_policy == NETISR_DISPATCH_HYBRID) { - *cpuidp = curcpu; + *cpuidp = netisr_get_cpuid(curcpu); return (m); } policy = NETISR_POLICY_SOURCE; From owner-svn-src-head@freebsd.org Wed Aug 17 20:24:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D47FCBBCAF6; Wed, 17 Aug 2016 20:24:15 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B09A6165C; Wed, 17 Aug 2016 20:24:15 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HKOEIN002396; Wed, 17 Aug 2016 20:24:14 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HKOECi002393; Wed, 17 Aug 2016 20:24:14 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201608172024.u7HKOECi002393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Wed, 17 Aug 2016 20:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304314 - in head/sys/mips: broadcom conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 20:24:15 -0000 Author: landonf Date: Wed Aug 17 20:24:14 2016 New Revision: 304314 URL: https://svnweb.freebsd.org/changeset/base/304314 Log: mips/broadcom: Implement CFE-based EARLY_PRINTF support. This adds support for EARLY_PRINTF via the CFE console; the aim is to provide a fix for the otherwise cyclic dependency between PMU discovery and console printf/DELAY: - We need to parse the bhnd(4) core table to determine the address (and type) of the PMU/PLL registers and calculate the CPU clock frequency. - The core table parsing code will emit a printf() if a parse error is hit. - Safely calling printf() without EARLY_PRINTF requires a working DELAY+cninit, which means we need the PMU. Errors in core table parsing shouldn't happen, but lack of EARLY_PRINTF makes debugging more difficult. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7498 Modified: head/sys/mips/broadcom/bcm_machdep.c head/sys/mips/conf/BCM head/sys/mips/conf/SENTRY5 Modified: head/sys/mips/broadcom/bcm_machdep.c ============================================================================== --- head/sys/mips/broadcom/bcm_machdep.c Wed Aug 17 20:21:33 2016 (r304313) +++ head/sys/mips/broadcom/bcm_machdep.c Wed Aug 17 20:24:14 2016 (r304314) @@ -198,6 +198,21 @@ platform_start(__register_t a0, __regist /* Initialize pcpu stuff */ mips_pcpu0_init(); +#ifdef CFE + /* + * Initialize CFE firmware trampolines. This must be done + * before any CFE APIs are called, including writing + * to the CFE console. + * + * CFE passes the following values in registers: + * a0: firmware handle + * a2: firmware entry point + * a3: entry point seal + */ + if (a3 == CFE_EPTSEAL) + cfe_init(a0, a2); +#endif + #if 0 /* * Probe the Broadcom on-chip PLL clock registers @@ -234,23 +249,40 @@ platform_start(__register_t a0, __regist mips_timer_early_init(platform_counter_freq); -#ifdef CFE - /* - * Initialize CFE firmware trampolines before - * we initialize the low-level console. - * - * CFE passes the following values in registers: - * a0: firmware handle - * a2: firmware entry point - * a3: entry point seal - */ - if (a3 == CFE_EPTSEAL) - cfe_init(a0, a2); -#endif - cninit(); mips_init(); mips_timer_init_params(platform_counter_freq, socinfo->double_count); } + +/* + * CFE-based EARLY_PRINTF support. To use, add the following to the kernel + * config: + * option EARLY_PRINTF + * option CFE + * device cfe + */ +#if defined(EARLY_PRINTF) && defined(CFE) +static void +bcm_cfe_eputc(int c) +{ + static int fd = -1; + unsigned char ch; + + ch = (unsigned char) c; + + if (fd == -1) { + if ((fd = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE)) < 0) + return; + } + + if (ch == '\n') + early_putc('\r'); + + while ((cfe_write(fd, &ch, 1)) == 0) + continue; +} + +early_putc_t *early_putc = bcm_cfe_eputc; +#endif /* EARLY_PRINTF */ Modified: head/sys/mips/conf/BCM ============================================================================== --- head/sys/mips/conf/BCM Wed Aug 17 20:21:33 2016 (r304313) +++ head/sys/mips/conf/BCM Wed Aug 17 20:24:14 2016 (r304314) @@ -52,6 +52,7 @@ options INVARIANT_SUPPORT #options BHND_LOGLEVEL=BHND_DEBUG_LEVEL #options BUS_DEBUG #makeoptions BUS_DEBUG +options EARLY_PRINTF #options VERBOSE_SYSINIT #makeoptions VERBOSE_SYSINIT Modified: head/sys/mips/conf/SENTRY5 ============================================================================== --- head/sys/mips/conf/SENTRY5 Wed Aug 17 20:21:33 2016 (r304313) +++ head/sys/mips/conf/SENTRY5 Wed Aug 17 20:24:14 2016 (r304314) @@ -31,9 +31,8 @@ makeoptions TRAMPLOADADDR=0x807963c0 hints "SENTRY5.hints" include "../broadcom/std.broadcom" -# sentry5 normally ships with cfe firmware; use the console for now +# sentry5 normally ships with cfe firmware options CFE -options CFE_CONSOLE options ALT_BREAK_TO_DEBUGGER device cfe @@ -57,6 +56,7 @@ options INVARIANT_SUPPORT #options BUS_DEBUG #makeoptions BUS_DEBUG +options EARLY_PRINTF device bhnd device siba From owner-svn-src-head@freebsd.org Wed Aug 17 20:27:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EE0DBBCB78; Wed, 17 Aug 2016 20:27:05 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4477A1828; Wed, 17 Aug 2016 20:27:05 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HKR4UF002536; Wed, 17 Aug 2016 20:27:04 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HKR46H002535; Wed, 17 Aug 2016 20:27:04 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201608172027.u7HKR46H002535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 17 Aug 2016 20:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304315 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 20:27:05 -0000 Author: jilles Date: Wed Aug 17 20:27:04 2016 New Revision: 304315 URL: https://svnweb.freebsd.org/changeset/base/304315 Log: rights(4): CAP_FSYNC also permits fdatasync(2). Modified: head/share/man/man4/rights.4 Modified: head/share/man/man4/rights.4 ============================================================================== --- head/share/man/man4/rights.4 Wed Aug 17 20:24:14 2016 (r304314) +++ head/share/man/man4/rights.4 Wed Aug 17 20:27:04 2016 (r304315) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 27, 2015 +.Dd August 17, 2016 .Dt RIGHTS 4 .Os .Sh NAME @@ -254,6 +254,7 @@ Permit .It Dv CAP_FSYNC Permit .Xr aio_fsync 2 , +.Xr fdatasync 2 , .Xr fsync 2 and .Xr openat 2 From owner-svn-src-head@freebsd.org Wed Aug 17 20:32:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FAC7BBD0C3; Wed, 17 Aug 2016 20:32:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1CCC1EA2; Wed, 17 Aug 2016 20:32:09 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HKW9oS002750; Wed, 17 Aug 2016 20:32:09 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HKW8YD002746; Wed, 17 Aug 2016 20:32:08 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608172032.u7HKW8YD002746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Aug 2016 20:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304316 - in head/sys/arm: allwinner allwinner/a10 conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 20:32:10 -0000 Author: manu Date: Wed Aug 17 20:32:08 2016 New Revision: 304316 URL: https://svnweb.freebsd.org/changeset/base/304316 Log: Rename kernel config A10 into ALLWINNER_UP as it is intend to work with all Allwinner Uniprocessor SoC. As of now it works with A10 and A13 (and possibly R8 as it is the same as the A13). Move files.a10 into a1o subdirectory as it should be. Rename std.a10 into std.allwinner_up Added: head/sys/arm/allwinner/a10/files.a10 (contents, props changed) - copied, changed from r304315, head/sys/arm/allwinner/files.a10 head/sys/arm/allwinner/files.allwinner_up (contents, props changed) head/sys/arm/allwinner/std.allwinner_up (contents, props changed) - copied, changed from r304315, head/sys/arm/allwinner/std.a10 head/sys/arm/conf/ALLWINNER_UP (contents, props changed) - copied, changed from r304315, head/sys/arm/conf/A10 Deleted: head/sys/arm/allwinner/files.a10 head/sys/arm/allwinner/std.a10 head/sys/arm/conf/A10 Copied and modified: head/sys/arm/allwinner/a10/files.a10 (from r304315, head/sys/arm/allwinner/files.a10) ============================================================================== --- head/sys/arm/allwinner/files.a10 Wed Aug 17 20:27:04 2016 (r304315, copy source) +++ head/sys/arm/allwinner/a10/files.a10 Wed Aug 17 20:32:08 2016 (r304316) @@ -2,4 +2,3 @@ arm/allwinner/a10/a10_intc.c standard arm/allwinner/a10_padconf.c standard -arm/allwinner/timer.c standard Added: head/sys/arm/allwinner/files.allwinner_up ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/files.allwinner_up Wed Aug 17 20:32:08 2016 (r304316) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +arm/allwinner/timer.c standard Copied and modified: head/sys/arm/allwinner/std.allwinner_up (from r304315, head/sys/arm/allwinner/std.a10) ============================================================================== --- head/sys/arm/allwinner/std.a10 Wed Aug 17 20:27:04 2016 (r304315, copy source) +++ head/sys/arm/allwinner/std.allwinner_up Wed Aug 17 20:32:08 2016 (r304316) @@ -1,4 +1,4 @@ -# Allwinner A10 common options +# Allwinner Uniprocessor common options #$FreeBSD$ cpu CPU_CORTEXA @@ -8,6 +8,7 @@ makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0200000 options KERNVIRTADDR=0xc0200000 +files "../allwinner/files.allwinner_up" files "../allwinner/files.allwinner" -files "../allwinner/files.a10" +files "../allwinner/a10/files.a10" files "../allwinner/a13/files.a13" Copied and modified: head/sys/arm/conf/ALLWINNER_UP (from r304315, head/sys/arm/conf/A10) ============================================================================== --- head/sys/arm/conf/A10 Wed Aug 17 20:27:04 2016 (r304315, copy source) +++ head/sys/arm/conf/ALLWINNER_UP Wed Aug 17 20:32:08 2016 (r304316) @@ -1,5 +1,5 @@ # -# A10 -- Custom configuration for the AllWinner A10 SoC +# ALLWINNER_UP -- Custom configuration for the AllWinner Uniprocessor SoC # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: @@ -18,10 +18,10 @@ # # $FreeBSD$ -ident A10 +ident ALLWINNER_UP include "std.armv6" -include "../allwinner/std.a10" +include "../allwinner/std.allwinner_up" options INTRNG From owner-svn-src-head@freebsd.org Wed Aug 17 21:29:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1511BBBD42E; Wed, 17 Aug 2016 21:29:59 +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 DA43817E8; Wed, 17 Aug 2016 21:29:58 +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 u7HLTw7e025632; Wed, 17 Aug 2016 21:29:58 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HLTwn2025631; Wed, 17 Aug 2016 21:29:58 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201608172129.u7HLTwn2025631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 17 Aug 2016 21:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304317 - head/sys/boot/efi/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 21:29:59 -0000 Author: tsoome Date: Wed Aug 17 21:29:57 2016 New Revision: 304317 URL: https://svnweb.freebsd.org/changeset/base/304317 Log: boot1.efi Free() should check for NULL to provide consistent behavior with libstand Free(). Reviewed by: imp Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D7497 Modified: head/sys/boot/efi/boot1/boot1.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Wed Aug 17 20:32:08 2016 (r304316) +++ head/sys/boot/efi/boot1/boot1.c Wed Aug 17 21:29:57 2016 (r304317) @@ -78,7 +78,8 @@ Malloc(size_t len, const char *file __un void Free(void *buf, const char *file __unused, int line __unused) { - (void)bs->FreePool(buf); + if (buf != NULL) + (void)bs->FreePool(buf); } /* From owner-svn-src-head@freebsd.org Wed Aug 17 21:44:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B092EBBDC00; Wed, 17 Aug 2016 21:44:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7487C1782; Wed, 17 Aug 2016 21:44:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HLi3Hi032960; Wed, 17 Aug 2016 21:44:03 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HLi2XJ032947; Wed, 17 Aug 2016 21:44:02 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608172144.u7HLi2XJ032947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Aug 2016 21:44:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304318 - in head/sys/arm/allwinner: . clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 21:44:04 -0000 Author: manu Date: Wed Aug 17 21:44:02 2016 New Revision: 304318 URL: https://svnweb.freebsd.org/changeset/base/304318 Log: Rename allwinner_machdep.{c.h} to aw_machdep.{c.h} as all allwinner source files are name aw_* Added: head/sys/arm/allwinner/aw_machdep.c - copied, changed from r304317, head/sys/arm/allwinner/allwinner_machdep.c head/sys/arm/allwinner/aw_machdep.h - copied, changed from r304317, head/sys/arm/allwinner/allwinner_machdep.h Deleted: head/sys/arm/allwinner/allwinner_machdep.c head/sys/arm/allwinner/allwinner_machdep.h Modified: head/sys/arm/allwinner/a10_ehci.c head/sys/arm/allwinner/a10_gpio.c head/sys/arm/allwinner/a10_mmc.c head/sys/arm/allwinner/aw_if_dwc.c head/sys/arm/allwinner/aw_mp.c head/sys/arm/allwinner/aw_rtc.c head/sys/arm/allwinner/clk/aw_pll.c head/sys/arm/allwinner/files.allwinner head/sys/arm/allwinner/timer.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/a10_ehci.c Wed Aug 17 21:44:02 2016 (r304318) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 21:44:02 2016 (r304318) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- head/sys/arm/allwinner/a10_mmc.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/a10_mmc.c Wed Aug 17 21:44:02 2016 (r304318) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/arm/allwinner/aw_if_dwc.c ============================================================================== --- head/sys/arm/allwinner/aw_if_dwc.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/aw_if_dwc.c Wed Aug 17 21:44:02 2016 (r304318) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include Copied and modified: head/sys/arm/allwinner/aw_machdep.c (from r304317, head/sys/arm/allwinner/allwinner_machdep.c) ============================================================================== --- head/sys/arm/allwinner/allwinner_machdep.c Wed Aug 17 21:29:57 2016 (r304317, copy source) +++ head/sys/arm/allwinner/aw_machdep.c Wed Aug 17 21:44:02 2016 (r304318) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012 Ganbold Tsagaankhuu - * Copyright (c) 2015-2016 Emmanuel Vadot + * Copyright (c) 2015-2016 Emmanuel Vadot * All rights reserved. * * This code is derived from software written for Brini by Mark Brinicombe @@ -26,6 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * from: FreeBSD: //depot/projects/arm/src/sys/arm/ti/ti_machdep.c */ @@ -52,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "platform_if.h" Copied and modified: head/sys/arm/allwinner/aw_machdep.h (from r304317, head/sys/arm/allwinner/allwinner_machdep.h) ============================================================================== --- head/sys/arm/allwinner/allwinner_machdep.h Wed Aug 17 21:29:57 2016 (r304317, copy source) +++ head/sys/arm/allwinner/aw_machdep.h Wed Aug 17 21:44:02 2016 (r304318) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Emmanuel Vadot + * Copyright (c) 2015 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/aw_mp.c ============================================================================== --- head/sys/arm/allwinner/aw_mp.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/aw_mp.c Wed Aug 17 21:44:02 2016 (r304318) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include /* Register for all dual-core SoC */ #define A20_CPUCFG_BASE 0x01c25c00 Modified: head/sys/arm/allwinner/aw_rtc.c ============================================================================== --- head/sys/arm/allwinner/aw_rtc.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/aw_rtc.c Wed Aug 17 21:44:02 2016 (r304318) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "clock_if.h" Modified: head/sys/arm/allwinner/clk/aw_pll.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_pll.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/clk/aw_pll.c Wed Aug 17 21:44:02 2016 (r304318) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include "clkdev_if.h" Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/files.allwinner Wed Aug 17 21:44:02 2016 (r304318) @@ -16,7 +16,7 @@ arm/allwinner/aw_rsb.c optional rsb arm/allwinner/aw_rtc.c standard arm/allwinner/aw_wdog.c standard arm/allwinner/a20/a20_cpu_cfg.c standard -arm/allwinner/allwinner_machdep.c standard +arm/allwinner/aw_machdep.c standard arm/allwinner/aw_mp.c optional smp arm/allwinner/axp209.c optional axp209 arm/allwinner/axp81x.c optional axp81x Modified: head/sys/arm/allwinner/timer.c ============================================================================== --- head/sys/arm/allwinner/timer.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/timer.c Wed Aug 17 21:44:02 2016 (r304318) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include /** * Timer registers addr From owner-svn-src-head@freebsd.org Wed Aug 17 21:57:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96BA4BBD0A4; Wed, 17 Aug 2016 21:57:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C6E51FC1; Wed, 17 Aug 2016 21:57:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HLvBF3036681; Wed, 17 Aug 2016 21:57:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HLvBhu036678; Wed, 17 Aug 2016 21:57:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608172157.u7HLvBhu036678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Aug 2016 21:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304319 - in head: contrib/llvm/lib/Target/X86 contrib/llvm/tools/clang/lib/Basic lib/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 21:57:12 -0000 Author: dim Date: Wed Aug 17 21:57:11 2016 New Revision: 304319 URL: https://svnweb.freebsd.org/changeset/base/304319 Log: Pull in r262772 from upstream clang trunk (by Simon Pilgrim): [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't support XSAVE. Differential Revision: http://reviews.llvm.org/D17682 Pull in r262782 from upstream llvm trunk (by Simon Pilgrim): [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't support XSAVE. Differential Revision: http://reviews.llvm.org/D17683 This ensures clang does not emit AVX instructions for CPUTYPE=btver1. Reported by: Michel Depeige PR: 211864 MFC after: 3 days Modified: head/contrib/llvm/lib/Target/X86/X86.td head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/lib/clang/freebsd_cc_version.h Modified: head/contrib/llvm/lib/Target/X86/X86.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86.td Wed Aug 17 21:44:02 2016 (r304318) +++ head/contrib/llvm/lib/Target/X86/X86.td Wed Aug 17 21:57:11 2016 (r304319) @@ -576,7 +576,6 @@ def : Proc<"btver1", [ FeaturePRFCHW, FeatureLZCNT, FeaturePOPCNT, - FeatureXSAVE, FeatureSlowSHLD, FeatureLAHFSAHF ]>; Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Wed Aug 17 21:44:02 2016 (r304318) +++ head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Wed Aug 17 21:57:11 2016 (r304319) @@ -2731,7 +2731,6 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "prfchw", true); setFeatureEnabledImpl(Features, "cx16", true); setFeatureEnabledImpl(Features, "fxsr", true); - setFeatureEnabledImpl(Features, "xsave", true); break; case CK_BDVER4: setFeatureEnabledImpl(Features, "avx2", true); Modified: head/lib/clang/freebsd_cc_version.h ============================================================================== --- head/lib/clang/freebsd_cc_version.h Wed Aug 17 21:44:02 2016 (r304318) +++ head/lib/clang/freebsd_cc_version.h Wed Aug 17 21:57:11 2016 (r304319) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1200000 +#define FREEBSD_CC_VERSION 1200001 From owner-svn-src-head@freebsd.org Wed Aug 17 22:13:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEECABBD5AF; Wed, 17 Aug 2016 22:13:41 +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 808951BCD; Wed, 17 Aug 2016 22:13:41 +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 u7HMDevU043965; Wed, 17 Aug 2016 22:13:40 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HMDdcC043955; Wed, 17 Aug 2016 22:13:39 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201608172213.u7HMDdcC043955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 17 Aug 2016 22:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304320 - head/secure/lib/libcrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 17 Aug 2016 22:13:41 -0000 Author: jkim Date: Wed Aug 17 22:13:39 2016 New Revision: 304320 URL: https://svnweb.freebsd.org/changeset/base/304320 Log: Disable assembly sources when compiler/assembler cannot compile certain instructions. For example, GCC 4.2.1 + binutils 2.17.50 does not support AVX instructions. Reported by: bde MFC after: 2 weeks Added: head/secure/lib/libcrypto/opensslconf-aarch64.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-aarch64.h head/secure/lib/libcrypto/opensslconf-arm.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-arm.h head/secure/lib/libcrypto/opensslconf-mips.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-mips.h head/secure/lib/libcrypto/opensslconf-powerpc.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-powerpc.h head/secure/lib/libcrypto/opensslconf-riscv.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-riscv.h head/secure/lib/libcrypto/opensslconf-sparc64.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-sparc64.h head/secure/lib/libcrypto/opensslconf-x86.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-x86.h Deleted: head/secure/lib/libcrypto/opensslconf-aarch64.h head/secure/lib/libcrypto/opensslconf-arm.h head/secure/lib/libcrypto/opensslconf-mips.h head/secure/lib/libcrypto/opensslconf-powerpc.h head/secure/lib/libcrypto/opensslconf-riscv.h head/secure/lib/libcrypto/opensslconf-sparc64.h head/secure/lib/libcrypto/opensslconf-x86.h Modified: head/secure/lib/libcrypto/Makefile head/secure/lib/libcrypto/Makefile.asm head/secure/lib/libcrypto/Makefile.inc Modified: head/secure/lib/libcrypto/Makefile ============================================================================== --- head/secure/lib/libcrypto/Makefile Wed Aug 17 21:57:11 2016 (r304319) +++ head/secure/lib/libcrypto/Makefile Wed Aug 17 22:13:39 2016 (r304320) @@ -22,9 +22,9 @@ MAN+= config.5 des_modes.7 # base sources SRCS= cpt_err.c cryptlib.c cversion.c ex_data.c mem.c mem_dbg.c o_dir.c \ o_fips.c o_init.c o_str.c o_time.c uid.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= x86_64cpuid.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= x86cpuid.S .else SRCS+= mem_clr.c @@ -33,10 +33,10 @@ INCS+= crypto.h ebcdic.h opensslv.h ossl # aes SRCS+= aes_cfb.c aes_ctr.c aes_ecb.c aes_ige.c aes_misc.c aes_ofb.c aes_wrap.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= aes-x86_64.S aesni-mb-x86_64.S aesni-sha1-x86_64.S \ aesni-sha256-x86_64.S aesni-x86_64.S bsaes-x86_64.S vpaes-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= aes-586.S aesni-x86.S vpaes-x86.S .else SRCS+= aes_cbc.c aes_core.c @@ -60,7 +60,7 @@ INCS+= asn1.h asn1_mac.h asn1t.h # bf SRCS+= bf_cfb64.c bf_ecb.c bf_ofb64.c bf_skey.c -.if ${MACHINE_CPUARCH} == "i386" +.if defined(ASM_i386) .if ${MACHINE_CPU:Mi686} SRCS+= bf-686.S .else @@ -82,10 +82,10 @@ SRCS+= bn_add.c bn_blind.c bn_const.c bn bn_exp.c bn_exp2.c bn_gcd.c bn_gf2m.c bn_kron.c bn_lib.c bn_mod.c \ bn_mont.c bn_mpi.c bn_mul.c bn_nist.c bn_prime.c bn_print.c bn_rand.c \ bn_recp.c bn_shift.c bn_sqr.c bn_sqrt.c bn_word.c bn_x931p.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= rsaz-avx2.S rsaz-x86_64.S rsaz_exp.c x86_64-gcc.c x86_64-gf2m.S \ x86_64-mont.S x86_64-mont5.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S .else SRCS+= bn_asm.c @@ -98,9 +98,9 @@ INCS+= buffer.h # camellia SRCS+= cmll_cfb.c cmll_ctr.c cmll_ecb.c cmll_ofb.c cmll_utl.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= cmll_misc.c cmll-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= cmll-x86.S .else SRCS+= camellia.c cmll_cbc.c cmll_misc.c @@ -135,7 +135,7 @@ SRCS+= cbc_cksm.c cbc_enc.c cfb64ede.c c des_old2.c ecb3_enc.c ecb_enc.c ede_cbcm_enc.c enc_read.c enc_writ.c \ fcrypt.c ofb64ede.c ofb64enc.c ofb_enc.c pcbc_enc.c qud_cksm.c \ rand_key.c read2pwd.c rpc_enc.c set_key.c str2key.c xcbc_enc.c -.if ${MACHINE_CPUARCH} == "i386" +.if defined(ASM_i386) SRCS+= crypt586.S des-586.S .else SRCS+= des_enc.c fcrypt_b.c @@ -161,7 +161,7 @@ SRCS+= ec2_mult.c ec2_oct.c ec2_smpl.c e ec_curve.c ec_cvt.c ec_err.c ec_key.c ec_lib.c ec_mult.c ec_oct.c \ ec_pmeth.c ec_print.c eck_prn.c ecp_mont.c ecp_nist.c ecp_oct.c \ ecp_smpl.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= ecp_nistz256.c ecp_nistz256-x86_64.S .endif INCS+= ec.h @@ -218,9 +218,9 @@ INCS+= md4.h # md5 SRCS+= md5_dgst.c md5_one.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= md5-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= md5-586.S .endif INCS+= md5.h @@ -232,9 +232,9 @@ INCS+= mdc2.h # modes SRCS+= cbc128.c ccm128.c cfb128.c ctr128.c cts128.c gcm128.c ofb128.c \ wrap128.c xts128.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= aesni-gcm-x86_64.S ghash-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= ghash-x86.S .endif INCS+= modes.h @@ -278,9 +278,9 @@ INCS+= rc2.h # rc4 SRCS+= rc4_utl.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= rc4-md5-x86_64.S rc4-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= rc4-586.S .else SRCS+= rc4_enc.c rc4_skey.c @@ -289,7 +289,7 @@ INCS+= rc4.h # rc5 SRCS+= rc5_ecb.c rc5_skey.c rc5cfb64.c rc5ofb64.c -.if ${MACHINE_CPUARCH} == "i386" +.if defined(ASM_i386) SRCS+= rc5-586.S .else SRCS+= rc5_enc.c @@ -298,7 +298,7 @@ INCS+= rc5.h # ripemd SRCS+= rmd_dgst.c rmd_one.c -.if ${MACHINE_CPUARCH} == "i386" +.if defined(ASM_i386) SRCS+= rmd-586.S .endif INCS+= ripemd.h @@ -316,10 +316,10 @@ INCS+= seed.h # sha SRCS+= sha1_one.c sha1dgst.c sha256.c sha512.c sha_dgst.c sha_one.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= sha1-mb-x86_64.S sha1-x86_64.S sha256-mb-x86_64.S sha256-x86_64.S \ sha512-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= sha1-586.S sha256-586.S sha512-586.S .endif INCS+= sha.h @@ -348,9 +348,9 @@ INCS+= ui.h ui_compat.h # whrlpool SRCS+= wp_dgst.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= wp-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= wp-mmx.S wp_block.c .else SRCS+= wp_block.c @@ -389,13 +389,7 @@ CFLAGS+= -I${LCRYPTO_SRC}/crypto/modes ACFLAGS+= -Wa,--noexecstack .endif -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -OPENSSLCONF_H= opensslconf-x86.h -.else -OPENSSLCONF_H= opensslconf-${MACHINE_CPUARCH}.h -.endif - -CLEANFILES= buildinf.h opensslconf.h +CLEANFILES= buildinf.h opensslconf.h opensslconf.h.tmp buildinf.h: Makefile ( echo "#ifndef MK1MF_BUILD"; \ @@ -404,17 +398,21 @@ buildinf.h: Makefile echo " #define PLATFORM \"platform: FreeBSD-${MACHINE_ARCH}\""; \ echo "#endif" ) > ${.TARGET} -opensslconf.h: ${OPENSSLCONF_H} - ${CP} ${.ALLSRC} ${.TARGET} +opensslconf.h: opensslconf-${MACHINE_CPUARCH:C/^(amd64|i386)$/x86/}.h.in +.if defined(ASM_${MACHINE_CPUARCH}) + sed 's/%%ASM%%//; /%%NO_ASM%%/d' ${.ALLSRC} > ${.TARGET}.tmp +.else + sed '/%%ASM%%/d; s/%%NO_ASM%%//' ${.ALLSRC} > ${.TARGET}.tmp +.endif + ${CP} ${.TARGET}.tmp ${.TARGET} .include -.if ${MACHINE_CPUARCH} == "amd64" -_bn_asmpath= ${LCRYPTO_SRC}/crypto/bn/asm -.endif - -.if exists(${.CURDIR}/${MACHINE_CPUARCH}) +.if defined(ASM_${MACHINE_CPUARCH}) .PATH: ${.CURDIR}/${MACHINE_CPUARCH} +.if defined(ASM_amd64) +.PATH: ${LCRYPTO_SRC}/crypto/bn/asm +.endif .endif .PATH: ${LCRYPTO_SRC}/crypto \ @@ -423,7 +421,6 @@ _bn_asmpath= ${LCRYPTO_SRC}/crypto/bn/as ${LCRYPTO_SRC}/crypto/bf \ ${LCRYPTO_SRC}/crypto/bio \ ${LCRYPTO_SRC}/crypto/bn \ - ${_bn_asmpath} \ ${LCRYPTO_SRC}/crypto/buffer \ ${LCRYPTO_SRC}/crypto/camellia \ ${LCRYPTO_SRC}/crypto/cast \ Modified: head/secure/lib/libcrypto/Makefile.asm ============================================================================== --- head/secure/lib/libcrypto/Makefile.asm Wed Aug 17 21:57:11 2016 (r304319) +++ head/secure/lib/libcrypto/Makefile.asm Wed Aug 17 22:13:39 2016 (r304320) @@ -6,7 +6,7 @@ .include "Makefile.inc" -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) .PATH: ${LCRYPTO_SRC}/crypto \ ${LCRYPTO_SRC}/crypto/aes/asm \ @@ -78,7 +78,7 @@ ${s}.S: ${s}.s cat ${s}.s ) > ${.TARGET} .endfor -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) .PATH: ${LCRYPTO_SRC}/crypto \ ${LCRYPTO_SRC}/crypto/aes/asm \ Modified: head/secure/lib/libcrypto/Makefile.inc ============================================================================== --- head/secure/lib/libcrypto/Makefile.inc Wed Aug 17 21:57:11 2016 (r304319) +++ head/secure/lib/libcrypto/Makefile.inc Wed Aug 17 22:13:39 2016 (r304320) @@ -21,7 +21,17 @@ CFLAGS+=-DL_ENDIAN CFLAGS+=-DB_ENDIAN .endif -.if ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +_ASM_AVX!= { \ + echo vzeroall | \ + ${CC} -x assembler -o /dev/null -c - 2> /dev/null; \ + } && echo yes || echo no +.if ${_ASM_AVX} == yes +ASM_${MACHINE_CPUARCH}= +.endif +.endif + +.if defined(ASM_amd64) CFLAGS+=-DOPENSSL_IA32_SSE2 CFLAGS+=-DAES_ASM -DBSAES_ASM -DVPAES_ASM CFLAGS+=-DECP_NISTZ256_ASM @@ -30,7 +40,7 @@ CFLAGS+=-DMD5_ASM CFLAGS+=-DGHASH_ASM CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM CFLAGS+=-DWHIRLPOOL_ASM -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) CFLAGS+=-DOPENSSL_IA32_SSE2 CFLAGS+=-DAES_ASM -DVPAES_ASM CFLAGS+=-DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m Copied and modified: head/secure/lib/libcrypto/opensslconf-aarch64.h.in (from r304319, head/secure/lib/libcrypto/opensslconf-aarch64.h) ============================================================================== --- head/secure/lib/libcrypto/opensslconf-aarch64.h Wed Aug 17 21:57:11 2016 (r304319, copy source) +++ head/secure/lib/libcrypto/opensslconf-aarch64.h.in Wed Aug 17 22:13:39 2016 (r304320) @@ -51,9 +51,9 @@ extern "C" { #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif -#ifndef OPENSSL_NO_ASM -# define OPENSSL_NO_ASM -#endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif #ifndef OPENSSL_NO_STATIC_ENGINE # define OPENSSL_NO_STATIC_ENGINE #endif @@ -101,6 +101,8 @@ extern "C" { # endif #endif +%%ASM%%#define OPENSSL_CPUID_OBJ +%%ASM%% /* crypto/opensslconf.h.in */ /* Generate 80386 code? */ Copied and modified: head/secure/lib/libcrypto/opensslconf-arm.h.in (from r304319, head/secure/lib/libcrypto/opensslconf-arm.h) ============================================================================== --- head/secure/lib/libcrypto/opensslconf-arm.h Wed Aug 17 21:57:11 2016 (r304319, copy source) +++ head/secure/lib/libcrypto/opensslconf-arm.h.in Wed Aug 17 22:13:39 2016 (r304320) @@ -51,9 +51,9 @@ extern "C" { #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif -#ifndef OPENSSL_NO_ASM -# define OPENSSL_NO_ASM -#endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif #ifndef OPENSSL_NO_STATIC_ENGINE # define OPENSSL_NO_STATIC_ENGINE #endif @@ -101,6 +101,8 @@ extern "C" { # endif #endif +%%ASM%%#define OPENSSL_CPUID_OBJ +%%ASM%% /* crypto/opensslconf.h.in */ /* Generate 80386 code? */ Copied and modified: head/secure/lib/libcrypto/opensslconf-mips.h.in (from r304319, head/secure/lib/libcrypto/opensslconf-mips.h) ============================================================================== --- head/secure/lib/libcrypto/opensslconf-mips.h Wed Aug 17 21:57:11 2016 (r304319, copy source) +++ head/secure/lib/libcrypto/opensslconf-mips.h.in Wed Aug 17 22:13:39 2016 (r304320) @@ -51,9 +51,9 @@ extern "C" { #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif -#ifndef OPENSSL_NO_ASM -# define OPENSSL_NO_ASM -#endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif #ifndef OPENSSL_NO_STATIC_ENGINE # define OPENSSL_NO_STATIC_ENGINE #endif Copied and modified: head/secure/lib/libcrypto/opensslconf-powerpc.h.in (from r304319, head/secure/lib/libcrypto/opensslconf-powerpc.h) ============================================================================== --- head/secure/lib/libcrypto/opensslconf-powerpc.h Wed Aug 17 21:57:11 2016 (r304319, copy source) +++ head/secure/lib/libcrypto/opensslconf-powerpc.h.in Wed Aug 17 22:13:39 2016 (r304320) @@ -51,9 +51,9 @@ extern "C" { #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif -#ifndef OPENSSL_NO_ASM -# define OPENSSL_NO_ASM -#endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif #ifndef OPENSSL_NO_STATIC_ENGINE # define OPENSSL_NO_STATIC_ENGINE #endif @@ -101,6 +101,8 @@ extern "C" { # endif #endif +%%ASM%%#define OPENSSL_CPUID_OBJ +%%ASM%% /* crypto/opensslconf.h.in */ /* Generate 80386 code? */ Copied and modified: head/secure/lib/libcrypto/opensslconf-riscv.h.in (from r304319, head/secure/lib/libcrypto/opensslconf-riscv.h) ============================================================================== --- head/secure/lib/libcrypto/opensslconf-riscv.h Wed Aug 17 21:57:11 2016 (r304319, copy source) +++ head/secure/lib/libcrypto/opensslconf-riscv.h.in Wed Aug 17 22:13:39 2016 (r304320) @@ -51,9 +51,9 @@ extern "C" { #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif -#ifndef OPENSSL_NO_ASM -# define OPENSSL_NO_ASM -#endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif #ifndef OPENSSL_NO_STATIC_ENGINE # define OPENSSL_NO_STATIC_ENGINE #endif Copied and modified: head/secure/lib/libcrypto/opensslconf-sparc64.h.in (from r304319, head/secure/lib/libcrypto/opensslconf-sparc64.h) ============================================================================== --- head/secure/lib/libcrypto/opensslconf-sparc64.h Wed Aug 17 21:57:11 2016 (r304319, copy source) +++ head/secure/lib/libcrypto/opensslconf-sparc64.h.in Wed Aug 17 22:13:39 2016 (r304320) @@ -51,9 +51,9 @@ extern "C" { #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif -#ifndef OPENSSL_NO_ASM -# define OPENSSL_NO_ASM -#endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif #ifndef OPENSSL_NO_STATIC_ENGINE # define OPENSSL_NO_STATIC_ENGINE #endif @@ -101,6 +101,8 @@ extern "C" { # endif #endif +%%ASM%%#define OPENSSL_CPUID_OBJ +%%ASM%% /* crypto/opensslconf.h.in */ /* Generate 80386 code? */ Copied and modified: head/secure/lib/libcrypto/opensslconf-x86.h.in (from r304319, head/secure/lib/libcrypto/opensslconf-x86.h) ============================================================================== --- head/secure/lib/libcrypto/opensslconf-x86.h Wed Aug 17 21:57:11 2016 (r304319, copy source) +++ head/secure/lib/libcrypto/opensslconf-x86.h.in Wed Aug 17 22:13:39 2016 (r304320) @@ -51,6 +51,9 @@ extern "C" { #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif #ifndef OPENSSL_NO_STATIC_ENGINE # define OPENSSL_NO_STATIC_ENGINE #endif @@ -98,8 +101,8 @@ extern "C" { # endif #endif -#define OPENSSL_CPUID_OBJ - +%%ASM%%#define OPENSSL_CPUID_OBJ +%%ASM%% /* crypto/opensslconf.h.in */ /* Generate 80386 code? */ From owner-svn-src-head@freebsd.org Thu Aug 18 00:37:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EB2ABBCBB5; Thu, 18 Aug 2016 00:37:10 +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 B56BD1B78; Thu, 18 Aug 2016 00:37: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 u7I0b841095671; Thu, 18 Aug 2016 00:37:08 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I0b77A095653; Thu, 18 Aug 2016 00:37:07 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201608180037.u7I0b77A095653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 18 Aug 2016 00:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 00:37:10 -0000 Author: tsoome Date: Thu Aug 18 00:37:07 2016 New Revision: 304321 URL: https://svnweb.freebsd.org/changeset/base/304321 Log: Add SHA512, skein, large blocks support for loader zfs. Updated sha512 from illumos. Using skein from freebsd crypto tree. Since loader itself is using 64MB memory for heap, updated zfsboot to use same, and this also allows to support zfs large blocks. Note, adding additional features does increate zfsboot code, therefore this update does increase zfsboot code to 128k, also I have ported gptldr.S update to zfsldr.S to support 64k+ code. With this update, boot1.efi has almost reached the current limit of the size set for it, so one of the future patches for boot1.efi will need to increase the limit. Currently known missing zfs features in boot loader are edonr and gzip support. Reviewed by: delphij, imp Approved by: imp (mentor) Obtained from: sha256.c update and skein_zfs.c stub from illumos. Differential Revision: https://reviews.freebsd.org/D7418 Added: head/sys/cddl/boot/zfs/skein_zfs.c (contents, props changed) Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptboot/gptldr.S head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/i386/zfsboot/zfsboot.c head/sys/boot/i386/zfsboot/zfsldr.S head/sys/boot/userboot/ficl/Makefile head/sys/boot/userboot/userboot/Makefile head/sys/boot/userboot/zfs/Makefile head/sys/boot/zfs/Makefile head/sys/boot/zfs/zfsimpl.c head/sys/cddl/boot/zfs/fletcher.c head/sys/cddl/boot/zfs/sha256.c head/sys/cddl/boot/zfs/zfsimpl.h head/sys/cddl/boot/zfs/zfssubr.c Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/efi/boot1/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -19,12 +19,16 @@ CWARNFLAGS.zfs_module.c += -Wno-missing- CWARNFLAGS.zfs_module.c += -Wno-sign-compare CWARNFLAGS.zfs_module.c += -Wno-unused-parameter CWARNFLAGS.zfs_module.c += -Wno-unused-function +CWARNFLAGS.skein.c += -Wno-cast-align +CWARNFLAGS.skein.c += -Wno-missing-variable-declarations .endif # architecture-specific loader code SRCS= boot1.c self_reloc.c start.S ufs_module.c .if ${MK_ZFS} != "no" SRCS+= zfs_module.c +SRCS+= skein.c skein_block.c +.PATH: ${.CURDIR}/../../../crypto/skein .endif CFLAGS+= -I. @@ -40,6 +44,7 @@ CFLAGS+= -DEFI_DEBUG .if ${MK_ZFS} != "no" CFLAGS+= -I${.CURDIR}/../../zfs/ CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs/ +CFLAGS+= -I${.CURDIR}/../../../crypto/skein CFLAGS+= -DEFI_ZFS_BOOT .endif Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/efi/loader/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -24,6 +24,8 @@ SRCS= autoload.c \ .if ${MK_ZFS} != "no" SRCS+= zfs.c .PATH: ${.CURDIR}/../../zfs +SRCS+= skein.c skein_block.c +.PATH: ${.CURDIR}/../../../crypto/skein # Disable warnings that are currently incompatible with the zfs boot code CWARNFLAGS.zfs.c+= -Wno-sign-compare @@ -53,6 +55,7 @@ CFLAGS+= -I${.CURDIR}/../../i386/libi386 .if ${MK_ZFS} != "no" CFLAGS+= -I${.CURDIR}/../../zfs CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +CFLAGS+= -I${.CURDIR}/../../../crypto/skein CFLAGS+= -DEFI_ZFS_BOOT .endif CFLAGS+= -DNO_PCI -DEFI Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/boot2/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -33,7 +33,7 @@ CFLAGS= -fomit-frame-pointer \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${.CURDIR}/../../common \ -I${.CURDIR}/../btx/lib -I. \ - -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/gptboot/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -32,10 +32,10 @@ CFLAGS= -DBOOTPROG=\"gptboot\" \ -I${.CURDIR}/../btx/lib -I. \ -I${.CURDIR}/../boot2 \ -I${.CURDIR}/../../.. \ - -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline + -Winline -Wno-pointer-sign CFLAGS.gcc+= --param max-inline-insns-single=100 Modified: head/sys/boot/i386/gptboot/gptldr.S ============================================================================== --- head/sys/boot/i386/gptboot/gptldr.S Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/gptboot/gptldr.S Thu Aug 18 00:37:07 2016 (r304321) @@ -45,7 +45,7 @@ /* Misc. Constants */ .set SIZ_PAG,0x1000 # Page size .set SIZ_SEC,0x200 # Sector size - .set COPY_BLKS,0x4 # Number of blocks + .set COPY_BLKS,0x8 # Number of blocks # to copy for boot2 .set COPY_BLK_SZ,0x8000 # Copy in 32k blocks; must be # a multiple of 16 bytes Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/gptzfsboot/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -2,7 +2,7 @@ .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../gptboot \ ${.CURDIR}/../zfsboot ${.CURDIR}/../common \ - ${.CURDIR}/../../common + ${.CURDIR}/../../common ${.CURDIR}/../../../crypto/skein FILES= gptzfsboot MAN= gptzfsboot.8 @@ -27,13 +27,14 @@ CFLAGS= -DBOOTPROG=\"gptzfsboot\" \ -I${.CURDIR}/../common \ -I${.CURDIR}/../../zfs \ -I${.CURDIR}/../../../cddl/boot/zfs \ + -I${.CURDIR}/../../../crypto/skein \ -I${.CURDIR}/../btx/lib -I. \ -I${.CURDIR}/../boot2 \ -I${.CURDIR}/../../.. \ - -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline + -Winline -Wno-tentative-definition-incomplete-type -Wno-pointer-sign .if !defined(LOADER_NO_GELI_SUPPORT) CFLAGS+= -DLOADER_GELI_SUPPORT @@ -67,12 +68,13 @@ gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \ - drv.o gpt.o util.o ${OPENCRYPTO_XTS} + drv.o gpt.o util.o skein.o skein_block.o ${OPENCRYPTO_XTS} gptzfsboot.bin: gptzfsboot.out ${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET} -gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o ${OPENCRYPTO_XTS} +gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o \ + skein.o skein_block.o ${OPENCRYPTO_XTS} ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} ${LIBGELIBOOT} zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/zfsboot/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -1,6 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common +.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common \ + ${.CURDIR}/../../common ${.CURDIR}/../../../crypto/skein FILES= zfsboot MAN= zfsboot.8 @@ -25,9 +26,10 @@ CFLAGS= -DBOOTPROG=\"zfsboot\" \ -I${.CURDIR}/../common \ -I${.CURDIR}/../../zfs \ -I${.CURDIR}/../../../cddl/boot/zfs \ + -I${.CURDIR}/../../../crypto/skein \ -I${.CURDIR}/../btx/lib -I. \ -I${.CURDIR}/../boot2 \ - -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline @@ -55,12 +57,13 @@ zfsldr.out: zfsldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o CLEANFILES+= zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \ - zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o util.o + zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o util.o \ + skein.o skein_block.o -# We currently allow 65536 bytes for zfsboot - in practice it could be +# We currently allow 128k bytes for zfsboot - in practice it could be # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr. # -BOOT2SIZE= 65536 +BOOT2SIZE= 131072 zfsboot2: zfsboot.ld @set -- `ls -l zfsboot.ld`; x=$$((${BOOT2SIZE}-$$5)); \ @@ -77,7 +80,7 @@ zfsboot.ldr: zfsboot.bin: zfsboot.out ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET} -zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o +zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o skein.o skein_block.o ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} SRCS= zfsboot.c Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/zfsboot/zfsboot.c Thu Aug 18 00:37:07 2016 (r304321) @@ -105,7 +105,7 @@ static struct bios_smap smap; /* * The minimum amount of memory to reserve in bios_extmem for the heap. */ -#define HEAP_MIN (3 * 1024 * 1024) +#define HEAP_MIN (64 * 1024 * 1024) static char *heap_next; static char *heap_end; Modified: head/sys/boot/i386/zfsboot/zfsldr.S ============================================================================== --- head/sys/boot/i386/zfsboot/zfsldr.S Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/zfsboot/zfsldr.S Thu Aug 18 00:37:07 2016 (r304321) @@ -32,8 +32,11 @@ /* Misc. Constants */ .set SIZ_PAG,0x1000 # Page size .set SIZ_SEC,0x200 # Sector size - - .set NSECT,0x80 + .set COPY_BLKS,0x8 # Number of blocks + # to copy for boot2 + .set COPY_BLK_SZ,0x8000 # Copy in 32k blocks; must be + # a multiple of 16 bytes + .set NSECT,(COPY_BLK_SZ / SIZ_SEC * COPY_BLKS) .globl start .code16 @@ -88,12 +91,12 @@ main.3: add $0x10,%si # Next entry /* * Ok, we have a slice and drive in %dx now, so use that to locate and * load boot2. %si references the start of the slice we are looking - * for, so go ahead and load up the 128 sectors starting at sector 1024 - * (i.e. after the two vdev labels). We don't have do anything fancy - * here to allow for an extra copy of boot1 and a partition table - * (compare to this section of the UFS bootstrap) so we just load it - * all at 0x9000. The first part of boot2 is BTX, which wants to run - * at 0x9000. The boot2.bin binary starts right after the end of BTX, + * for, so go ahead and load up the COPY_BLKS*COPY_BLK_SZ/SIZ_SEC sectors + * starting at sector 1024 (i.e. after the two vdev labels). We don't + * have do anything fancy here to allow for an extra copy of boot1 and + * a partition table (compare to this section of the UFS bootstrap) so we + * just load it all at 0x9000. The first part of boot2 is BTX, which wants + * to run at 0x9000. The boot2.bin binary starts right after the end of BTX, * so we have to figure out where the start of it is and then move the * binary to 0xc000. Normally, BTX clients start at MEM_USR, or 0xa000, * but when we use btxld to create zfsboot2, we use an entry point of @@ -116,23 +119,37 @@ main.6: pushal # Save params incl %eax # Advance to add $SIZ_SEC,%ebx # next sector loop main.6 # If not last, read another - mov MEM_BTX+0xa,%bx # Get BTX length - mov $NSECT*SIZ_SEC-1,%di # Size of load area (less one) - mov %di,%si # End of load area, 0x9000 rel - sub %bx,%di # End of client, 0xc000 rel - mov %di,%cx # Size of - inc %cx # client - mov $(MEM_BTX)>>4,%dx # Segment - mov %dx,%ds # addressing 0x9000 - mov $(MEM_USR+2*SIZ_PAG)>>4,%dx # Segment - mov %dx,%es # addressing 0xc000 - std # Move with decrement - rep # Relocate - movsb # client + + mov $MEM_BTX,%bx # BTX + mov 0xa(%bx),%si # Get BTX length and set + add %bx,%si # %si to start of boot2 + dec %si # Set %ds:%si to point at the + mov %si,%ax # last byte we want to copy + shr $4,%ax # from boot2, with %si made as + add $(COPY_BLKS*COPY_BLK_SZ/16),%ax # small as possible. + and $0xf,%si # + mov %ax,%ds # + mov $(MEM_USR+2*SIZ_PAG)/16,%ax # Set %es:(-1) to point at + add $(COPY_BLKS*COPY_BLK_SZ/16),%ax # the last byte we + mov %ax,%es # want to copy boot2 into. + mov $COPY_BLKS,%bx # Copy COPY_BLKS 32k blocks +copyloop: + add $COPY_BLK_SZ,%si # Adjust %ds:%si to point at + mov %ds,%ax # the end of the next 32k to + sub $COPY_BLK_SZ/16,%ax # copy from boot2 + mov %ax,%ds + mov $COPY_BLK_SZ-1,%di # Adjust %es:%di to point at + mov %es,%ax # the end of the next 32k into + sub $COPY_BLK_SZ/16,%ax # which we want boot2 copied + mov %ax,%es + mov $COPY_BLK_SZ,%cx # Copy 32k + std + rep movsb + dec %bx + jnz copyloop + mov %cx,%ds # Reset %ds and %es + mov %cx,%es cld # Back to increment - xor %dx,%dx # Back - mov %ds,%dx # to zero - mov %dx,%es # segment /* * Enable A20 so we can access memory above 1 meg. Modified: head/sys/boot/userboot/ficl/Makefile ============================================================================== --- head/sys/boot/userboot/ficl/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/userboot/ficl/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -10,6 +10,9 @@ BASE_SRCS= dict.c ficl.c fileaccess.c fl SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o + +CWARNFLAGS.loader.c.c += -Wno-implicit-function-declaration + .if HAVE_PNP CFLAGS+= -DHAVE_PNP .endif Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/userboot/userboot/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -35,6 +35,8 @@ CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../../../lib/libstand CFLAGS+= -ffreestanding -I. +CWARNFLAGS.main.c += -Wno-implicit-function-declaration + LDFLAGS+= -nostdlib -Wl,-Bsymbolic NEWVERSWHAT= "User boot" ${MACHINE_CPUARCH} Modified: head/sys/boot/userboot/zfs/Makefile ============================================================================== --- head/sys/boot/userboot/zfs/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/userboot/zfs/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -2,15 +2,16 @@ S= ${.CURDIR}/../../zfs -.PATH: ${S} +.PATH: ${S} ${.CURDIR}/../../../crypto/skein LIB= zfsboot INTERNALLIB= -SRCS+= zfs.c +SRCS+= zfs.c skein.c skein_block.c CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. CFLAGS+= -I${.CURDIR}/../../../../lib/libstand CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +CFLAGS+= -I${.CURDIR}/../../../crypto/skein CFLAGS+= -ffreestanding -fPIC CFLAGS+= -Wformat -Wall Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/zfs/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -5,10 +5,14 @@ INTERNALLIB= SRCS+= zfs.c +SRCS+= skein.c skein_block.c +.PATH: ${.CURDIR}/../../crypto/skein + CFLAGS+= -DBOOTPROG=\"zfsloader\" CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../.. -I. CFLAGS+= -I${.CURDIR}/../../../lib/libstand CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs +CFLAGS+= -I${.CURDIR}/../../crypto/skein .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -march=i386 Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/zfs/zfsimpl.c Thu Aug 18 00:37:07 2016 (r304321) @@ -58,6 +58,8 @@ static const char *features_for_read[] = "com.delphix:extensible_dataset", "com.delphix:embedded_data", "org.open-zfs:large_blocks", + "org.illumos:sha512", + "org.illumos:skein", NULL }; @@ -78,6 +80,9 @@ static char *zfs_temp_buf, *zfs_temp_end static int zio_read(const spa_t *spa, const blkptr_t *bp, void *buf); static int zfs_get_root(const spa_t *spa, uint64_t *objid); static int zfs_rlookup(const spa_t *spa, uint64_t objnum, char *result); +static int zap_lookup(const spa_t *spa, const dnode_phys_t *dnode, + const char *name, uint64_t integer_size, uint64_t num_integers, + void *value); static void zfs_init(void) @@ -420,7 +425,7 @@ vdev_read_phys(vdev_t *vdev, const blkpt rc = vdev->v_phys_read(vdev, vdev->v_read_priv, offset, buf, psize); if (rc) return (rc); - if (bp && zio_checksum_verify(bp, buf)) + if (bp && zio_checksum_verify(vdev->spa, bp, buf)) return (EIO); return (0); @@ -1074,6 +1079,7 @@ vdev_probe(vdev_phys_read_t *read, void } zfs_free(upbuf, VDEV_UBERBLOCK_SIZE(vdev)); + vdev->spa = spa; if (spap) *spap = spa; return (0); @@ -1122,7 +1128,7 @@ zio_read_gang(const spa_t *spa, const bl pbuf += BP_GET_PSIZE(gbp); } - if (zio_checksum_verify(bp, buf)) + if (zio_checksum_verify(spa, bp, buf)) return (EIO); return (0); } @@ -1224,7 +1230,8 @@ dnode_read(const spa_t *spa, const dnode int i, rc; if (bsize > SPA_MAXBLOCKSIZE) { - printf("ZFS: I/O error - blocks larger than 128K are not supported\n"); + printf("ZFS: I/O error - blocks larger than %llu are not " + "supported\n", SPA_MAXBLOCKSIZE); return (EIO); } @@ -1364,12 +1371,73 @@ fzap_leaf_value(const zap_leaf_t *zl, co return value; } +static void +stv(int len, void *addr, uint64_t value) +{ + switch (len) { + case 1: + *(uint8_t *)addr = value; + return; + case 2: + *(uint16_t *)addr = value; + return; + case 4: + *(uint32_t *)addr = value; + return; + case 8: + *(uint64_t *)addr = value; + return; + } +} + +/* + * Extract a array from a zap leaf entry. + */ +static void +fzap_leaf_array(const zap_leaf_t *zl, const zap_leaf_chunk_t *zc, + uint64_t integer_size, uint64_t num_integers, void *buf) +{ + uint64_t array_int_len = zc->l_entry.le_value_intlen; + uint64_t value = 0; + uint64_t *u64 = buf; + char *p = buf; + int len = MIN(zc->l_entry.le_value_numints, num_integers); + int chunk = zc->l_entry.le_value_chunk; + int byten = 0; + + if (integer_size == 8 && len == 1) { + *u64 = fzap_leaf_value(zl, zc); + return; + } + + while (len > 0) { + struct zap_leaf_array *la = &ZAP_LEAF_CHUNK(zl, chunk).l_array; + int i; + + ASSERT3U(chunk, <, ZAP_LEAF_NUMCHUNKS(zl)); + for (i = 0; i < ZAP_LEAF_ARRAY_BYTES && len > 0; i++) { + value = (value << 8) | la->la_array[i]; + byten++; + if (byten == array_int_len) { + stv(integer_size, p, value); + byten = 0; + len--; + if (len == 0) + return; + p += integer_size; + } + } + chunk = la->la_next; + } +} + /* * Lookup a value in a fatzap directory. Assumes that the zap scratch * buffer contains the directory header. */ static int -fzap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) +fzap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, + uint64_t integer_size, uint64_t num_integers, void *value) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; @@ -1436,9 +1504,10 @@ fzap_lookup(const spa_t *spa, const dnod zc = &ZAP_LEAF_CHUNK(&zl, zc->l_entry.le_next); } if (fzap_name_equal(&zl, zc, name)) { - if (zc->l_entry.le_value_intlen * zc->l_entry.le_value_numints > 8) + if (zc->l_entry.le_value_intlen * zc->l_entry.le_value_numints > + integer_size * num_integers) return (E2BIG); - *value = fzap_leaf_value(&zl, zc); + fzap_leaf_array(&zl, zc, integer_size, num_integers, value); return (0); } @@ -1449,7 +1518,8 @@ fzap_lookup(const spa_t *spa, const dnod * Lookup a name in a zap object and return its value as a uint64_t. */ static int -zap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) +zap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, + uint64_t integer_size, uint64_t num_integers, void *value) { int rc; uint64_t zap_type; @@ -1462,8 +1532,10 @@ zap_lookup(const spa_t *spa, const dnode zap_type = *(uint64_t *) zap_scratch; if (zap_type == ZBT_MICRO) return mzap_lookup(dnode, name, value); - else if (zap_type == ZBT_HEADER) - return fzap_lookup(spa, dnode, name, value); + else if (zap_type == ZBT_HEADER) { + return fzap_lookup(spa, dnode, name, integer_size, + num_integers, value); + } printf("ZFS: invalid zap_type=%d\n", (int)zap_type); return (EIO); } @@ -1802,7 +1874,8 @@ zfs_lookup_dataset(const spa_t *spa, con if (objset_get_dnode(spa, &spa->spa_mos, DMU_POOL_DIRECTORY_OBJECT, &dir)) return (EIO); - if (zap_lookup(spa, &dir, DMU_POOL_ROOT_DATASET, &dir_obj)) + if (zap_lookup(spa, &dir, DMU_POOL_ROOT_DATASET, sizeof (dir_obj), + 1, &dir_obj)) return (EIO); p = name; @@ -1832,7 +1905,8 @@ zfs_lookup_dataset(const spa_t *spa, con return (EIO); /* Actual loop condition #2. */ - if (zap_lookup(spa, &child_dir_zap, element, &dir_obj) != 0) + if (zap_lookup(spa, &child_dir_zap, element, sizeof (dir_obj), + 1, &dir_obj) != 0) return (ENOENT); } @@ -1962,9 +2036,9 @@ zfs_get_root(const spa_t *spa, uint64_t /* * Lookup the pool_props and see if we can find a bootfs. */ - if (zap_lookup(spa, &dir, DMU_POOL_PROPS, &props) == 0 + if (zap_lookup(spa, &dir, DMU_POOL_PROPS, sizeof (props), 1, &props) == 0 && objset_get_dnode(spa, &spa->spa_mos, props, &propdir) == 0 - && zap_lookup(spa, &propdir, "bootfs", &bootfs) == 0 + && zap_lookup(spa, &propdir, "bootfs", sizeof (bootfs), 1, &bootfs) == 0 && bootfs != 0) { *objid = bootfs; @@ -1973,7 +2047,7 @@ zfs_get_root(const spa_t *spa, uint64_t /* * Lookup the root dataset directory */ - if (zap_lookup(spa, &dir, DMU_POOL_ROOT_DATASET, &root) + if (zap_lookup(spa, &dir, DMU_POOL_ROOT_DATASET, sizeof (root), 1, &root) || objset_get_dnode(spa, &spa->spa_mos, root, &dir)) { printf("ZFS: can't find root dsl_dir\n"); return (EIO); @@ -2047,7 +2121,8 @@ check_mos_features(const spa_t *spa) if ((rc = objset_get_dnode(spa, &spa->spa_mos, DMU_OT_OBJECT_DIRECTORY, &dir)) != 0) return (rc); - if ((rc = zap_lookup(spa, &dir, DMU_POOL_FEATURES_FOR_READ, &objnum)) != 0) + if ((rc = zap_lookup(spa, &dir, DMU_POOL_FEATURES_FOR_READ, + sizeof (objnum), 1, &objnum)) != 0) return (rc); if ((rc = objset_get_dnode(spa, &spa->spa_mos, objnum, &dir)) != 0) @@ -2072,6 +2147,7 @@ check_mos_features(const spa_t *spa) static int zfs_spa_init(spa_t *spa) { + dnode_phys_t dir; int rc; if (zio_read(spa, &spa->spa_uberblock.ub_rootbp, &spa->spa_mos)) { @@ -2083,6 +2159,17 @@ zfs_spa_init(spa_t *spa) return (EIO); } + if (objset_get_dnode(spa, &spa->spa_mos, DMU_POOL_DIRECTORY_OBJECT, + &dir)) { + printf("ZFS: failed to read pool %s directory object\n", + spa->spa_name); + return (EIO); + } + /* this is allowed to fail, older pools do not have salt */ + rc = zap_lookup(spa, &dir, DMU_POOL_CHECKSUM_SALT, 1, + sizeof (spa->spa_cksum_salt.zcs_bytes), + spa->spa_cksum_salt.zcs_bytes); + rc = check_mos_features(spa); if (rc != 0) { printf("ZFS: pool %s is not supported\n", spa->spa_name); @@ -2173,7 +2260,7 @@ zfs_lookup(const struct zfsmount *mount, if (rc) return (rc); - rc = zap_lookup(spa, &dn, ZFS_ROOT_OBJ, &rootnum); + rc = zap_lookup(spa, &dn, ZFS_ROOT_OBJ, sizeof (rootnum), 1, &rootnum); if (rc) return (rc); @@ -2205,7 +2292,7 @@ zfs_lookup(const struct zfsmount *mount, return (ENOTDIR); parentnum = objnum; - rc = zap_lookup(spa, &dn, element, &objnum); + rc = zap_lookup(spa, &dn, element, sizeof (objnum), 1, &objnum); if (rc) return (rc); objnum = ZFS_DIRENT_OBJ(objnum); Modified: head/sys/cddl/boot/zfs/fletcher.c ============================================================================== --- head/sys/cddl/boot/zfs/fletcher.c Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/cddl/boot/zfs/fletcher.c Thu Aug 18 00:37:07 2016 (r304321) @@ -23,10 +23,9 @@ * Use is subject to license terms. */ -/*#pragma ident "%Z%%M% %I% %E% SMI"*/ - static void -fletcher_2_native(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_2_native(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) { const uint64_t *ip = buf; const uint64_t *ipend = ip + (size / sizeof (uint64_t)); @@ -43,7 +42,8 @@ fletcher_2_native(const void *buf, uint6 } static void -fletcher_2_byteswap(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_2_byteswap(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) { const uint64_t *ip = buf; const uint64_t *ipend = ip + (size / sizeof (uint64_t)); @@ -60,7 +60,8 @@ fletcher_2_byteswap(const void *buf, uin } static void -fletcher_4_native(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_4_native(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) { const uint32_t *ip = buf; const uint32_t *ipend = ip + (size / sizeof (uint32_t)); @@ -77,7 +78,8 @@ fletcher_4_native(const void *buf, uint6 } static void -fletcher_4_byteswap(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_4_byteswap(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) { const uint32_t *ip = buf; const uint32_t *ipend = ip + (size / sizeof (uint32_t)); Modified: head/sys/cddl/boot/zfs/sha256.c ============================================================================== --- head/sys/cddl/boot/zfs/sha256.c Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/cddl/boot/zfs/sha256.c Thu Aug 18 00:37:07 2016 (r304321) @@ -23,19 +23,21 @@ * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - -/*#pragma ident "%Z%%M% %I% %E% SMI"*/ +/* + * Copyright 2013 Saso Kiselkov. All rights reserved. + * Copyright 2015 Toomas Soome + */ /* - * SHA-256 checksum, as specified in FIPS 180-2, available at: + * SHA-256 and SHA-512/256 hashes, as specified in FIPS 180-4, available at: * http://csrc.nist.gov/cryptval * - * This is a very compact implementation of SHA-256. + * This is a very compact implementation of SHA-256 and SHA-512/256. * It is designed to be simple and portable, not to be fast. */ /* - * The literal definitions according to FIPS180-2 would be: + * The literal definitions according to FIPS180-4 would be: * * Ch(x, y, z) (((x) & (y)) ^ ((~(x)) & (z))) * Maj(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) @@ -44,12 +46,21 @@ */ #define Ch(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) #define Maj(x, y, z) (((x) & (y)) ^ ((z) & ((x) ^ (y)))) -#define Rot32(x, s) (((x) >> s) | ((x) << (32 - s))) -#define SIGMA0(x) (Rot32(x, 2) ^ Rot32(x, 13) ^ Rot32(x, 22)) -#define SIGMA1(x) (Rot32(x, 6) ^ Rot32(x, 11) ^ Rot32(x, 25)) -#define sigma0(x) (Rot32(x, 7) ^ Rot32(x, 18) ^ ((x) >> 3)) -#define sigma1(x) (Rot32(x, 17) ^ Rot32(x, 19) ^ ((x) >> 10)) +#define ROTR(x, n) (((x) >> (n)) | ((x) << ((sizeof (x) * NBBY)-(n)))) + +/* SHA-224/256 operations */ +#define BIGSIGMA0_256(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) +#define BIGSIGMA1_256(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) +#define SIGMA0_256(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ ((x) >> 3)) +#define SIGMA1_256(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ ((x) >> 10)) + +/* SHA-384/512 operations */ +#define BIGSIGMA0_512(x) (ROTR((x), 28) ^ ROTR((x), 34) ^ ROTR((x), 39)) +#define BIGSIGMA1_512(x) (ROTR((x), 14) ^ ROTR((x), 18) ^ ROTR((x), 41)) +#define SIGMA0_512(x) (ROTR((x), 1) ^ ROTR((x), 8) ^ ((x) >> 7)) +#define SIGMA1_512(x) (ROTR((x), 19) ^ ROTR((x), 61) ^ ((x) >> 6)) +/* SHA-256 round constants */ static const uint32_t SHA256_K[64] = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, @@ -69,46 +80,134 @@ static const uint32_t SHA256_K[64] = { 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 }; +/* SHA-512 round constants */ +static const uint64_t SHA512_K[80] = { + 0x428A2F98D728AE22ULL, 0x7137449123EF65CDULL, + 0xB5C0FBCFEC4D3B2FULL, 0xE9B5DBA58189DBBCULL, + 0x3956C25BF348B538ULL, 0x59F111F1B605D019ULL, + 0x923F82A4AF194F9BULL, 0xAB1C5ED5DA6D8118ULL, + 0xD807AA98A3030242ULL, 0x12835B0145706FBEULL, + 0x243185BE4EE4B28CULL, 0x550C7DC3D5FFB4E2ULL, + 0x72BE5D74F27B896FULL, 0x80DEB1FE3B1696B1ULL, + 0x9BDC06A725C71235ULL, 0xC19BF174CF692694ULL, + 0xE49B69C19EF14AD2ULL, 0xEFBE4786384F25E3ULL, + 0x0FC19DC68B8CD5B5ULL, 0x240CA1CC77AC9C65ULL, + 0x2DE92C6F592B0275ULL, 0x4A7484AA6EA6E483ULL, + 0x5CB0A9DCBD41FBD4ULL, 0x76F988DA831153B5ULL, + 0x983E5152EE66DFABULL, 0xA831C66D2DB43210ULL, + 0xB00327C898FB213FULL, 0xBF597FC7BEEF0EE4ULL, + 0xC6E00BF33DA88FC2ULL, 0xD5A79147930AA725ULL, + 0x06CA6351E003826FULL, 0x142929670A0E6E70ULL, + 0x27B70A8546D22FFCULL, 0x2E1B21385C26C926ULL, + 0x4D2C6DFC5AC42AEDULL, 0x53380D139D95B3DFULL, + 0x650A73548BAF63DEULL, 0x766A0ABB3C77B2A8ULL, + 0x81C2C92E47EDAEE6ULL, 0x92722C851482353BULL, + 0xA2BFE8A14CF10364ULL, 0xA81A664BBC423001ULL, + 0xC24B8B70D0F89791ULL, 0xC76C51A30654BE30ULL, + 0xD192E819D6EF5218ULL, 0xD69906245565A910ULL, + 0xF40E35855771202AULL, 0x106AA07032BBD1B8ULL, + 0x19A4C116B8D2D0C8ULL, 0x1E376C085141AB53ULL, + 0x2748774CDF8EEB99ULL, 0x34B0BCB5E19B48A8ULL, + 0x391C0CB3C5C95A63ULL, 0x4ED8AA4AE3418ACBULL, + 0x5B9CCA4F7763E373ULL, 0x682E6FF3D6B2B8A3ULL, + 0x748F82EE5DEFB2FCULL, 0x78A5636F43172F60ULL, + 0x84C87814A1F0AB72ULL, 0x8CC702081A6439ECULL, + 0x90BEFFFA23631E28ULL, 0xA4506CEBDE82BDE9ULL, + 0xBEF9A3F7B2C67915ULL, 0xC67178F2E372532BULL, + 0xCA273ECEEA26619CULL, 0xD186B8C721C0C207ULL, + 0xEADA7DD6CDE0EB1EULL, 0xF57D4F7FEE6ED178ULL, + 0x06F067AA72176FBAULL, 0x0A637DC5A2C898A6ULL, + 0x113F9804BEF90DAEULL, 0x1B710B35131C471BULL, + 0x28DB77F523047D84ULL, 0x32CAAB7B40C72493ULL, + 0x3C9EBE0A15C9BEBCULL, 0x431D67C49C100D4CULL, + 0x4CC5D4BECB3E42B6ULL, 0x597F299CFC657E2AULL, + 0x5FCB6FAB3AD6FAECULL, 0x6C44198C4A475817ULL +}; + static void SHA256Transform(uint32_t *H, const uint8_t *cp) { uint32_t a, b, c, d, e, f, g, h, t, T1, T2, W[64]; - for (t = 0; t < 16; t++, cp += 4) + /* copy chunk into the first 16 words of the message schedule */ + for (t = 0; t < 16; t++, cp += sizeof (uint32_t)) W[t] = (cp[0] << 24) | (cp[1] << 16) | (cp[2] << 8) | cp[3]; + /* extend the first 16 words into the remaining 48 words */ for (t = 16; t < 64; t++) - W[t] = sigma1(W[t - 2]) + W[t - 7] + - sigma0(W[t - 15]) + W[t - 16]; + W[t] = SIGMA1_256(W[t - 2]) + W[t - 7] + + SIGMA0_256(W[t - 15]) + W[t - 16]; + /* init working variables to the current hash value */ a = H[0]; b = H[1]; c = H[2]; d = H[3]; e = H[4]; f = H[5]; g = H[6]; h = H[7]; + /* iterate the compression function for all rounds of the hash */ for (t = 0; t < 64; t++) { - T1 = h + SIGMA1(e) + Ch(e, f, g) + SHA256_K[t] + W[t]; - T2 = SIGMA0(a) + Maj(a, b, c); + T1 = h + BIGSIGMA1_256(e) + Ch(e, f, g) + SHA256_K[t] + W[t]; + T2 = BIGSIGMA0_256(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; } + /* add the compressed chunk to the current hash value */ H[0] += a; H[1] += b; H[2] += c; H[3] += d; H[4] += e; H[5] += f; H[6] += g; H[7] += h; } static void -zio_checksum_SHA256(const void *buf, uint64_t size, zio_cksum_t *zcp) +SHA512Transform(uint64_t *H, const uint8_t *cp) +{ + uint64_t a, b, c, d, e, f, g, h, t, T1, T2, W[80]; + + /* copy chunk into the first 16 words of the message schedule */ + for (t = 0; t < 16; t++, cp += sizeof (uint64_t)) + W[t] = ((uint64_t)cp[0] << 56) | ((uint64_t)cp[1] << 48) | + ((uint64_t)cp[2] << 40) | ((uint64_t)cp[3] << 32) | + ((uint64_t)cp[4] << 24) | ((uint64_t)cp[5] << 16) | + ((uint64_t)cp[6] << 8) | (uint64_t)cp[7]; + + /* extend the first 16 words into the remaining 64 words */ + for (t = 16; t < 80; t++) + W[t] = SIGMA1_512(W[t - 2]) + W[t - 7] + + SIGMA0_512(W[t - 15]) + W[t - 16]; + + /* init working variables to the current hash value */ + a = H[0]; b = H[1]; c = H[2]; d = H[3]; + e = H[4]; f = H[5]; g = H[6]; h = H[7]; + + /* iterate the compression function for all rounds of the hash */ + for (t = 0; t < 80; t++) { + T1 = h + BIGSIGMA1_512(e) + Ch(e, f, g) + SHA512_K[t] + W[t]; + T2 = BIGSIGMA0_512(a) + Maj(a, b, c); + h = g; g = f; f = e; e = d + T1; + d = c; c = b; b = a; a = T1 + T2; + } + + /* add the compressed chunk to the current hash value */ + H[0] += a; H[1] += b; H[2] += c; H[3] += d; + H[4] += e; H[5] += f; H[6] += g; H[7] += h; +} + +/* + * Implements the SHA-224 and SHA-256 hash algos - to select between them + * pass the appropriate initial values of 'H' and truncate the last 32 bits + * in case of SHA-224. + */ +static void +SHA256(uint32_t *H, const void *buf, uint64_t size, zio_cksum_t *zcp) { - uint32_t H[8] = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, - 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 }; uint8_t pad[128]; - int padsize = size & 63; - int i; + unsigned padsize = size & 63; + unsigned i, k; + /* process all blocks up to the last one */ for (i = 0; i < size - padsize; i += 64) SHA256Transform(H, (uint8_t *)buf + i); - for (i = 0; i < padsize; i++) - pad[i] = ((uint8_t *)buf)[i]; + /* process the last block and padding */ + for (k = 0; k < padsize; k++) + pad[k] = ((uint8_t *)buf)[k+i]; for (pad[padsize++] = 0x80; (padsize & 63) != 56; padsize++) pad[padsize] = 0; @@ -125,3 +224,102 @@ zio_checksum_SHA256(const void *buf, uin (uint64_t)H[4] << 32 | H[5], (uint64_t)H[6] << 32 | H[7]); } + +/* + * encode 64bit data in big-endian format. + */ +static void +Encode64(uint8_t *output, uint64_t *input, size_t len) +{ + size_t i, j; + for (i = 0, j = 0; j < len; i++, j += 8) { + output[j] = (input[i] >> 56) & 0xff; + output[j + 1] = (input[i] >> 48) & 0xff; + output[j + 2] = (input[i] >> 40) & 0xff; + output[j + 3] = (input[i] >> 32) & 0xff; + output[j + 4] = (input[i] >> 24) & 0xff; + output[j + 5] = (input[i] >> 16) & 0xff; + output[j + 6] = (input[i] >> 8) & 0xff; + output[j + 7] = input[i] & 0xff; + } +} + +/* + * Implements the SHA-384, SHA-512 and SHA-512/t hash algos - to select + * between them pass the appropriate initial values for 'H'. The output + * of this function is truncated to the first 256 bits that fit into 'zcp'. + */ +static void +SHA512(uint64_t *H, const void *buf, uint64_t size, zio_cksum_t *zcp) +{ + uint64_t c64[2]; + uint8_t pad[256]; + unsigned padsize = size & 127; + unsigned i, k; + + /* process all blocks up to the last one */ + for (i = 0; i < size - padsize; i += 128) + SHA512Transform(H, (uint8_t *)buf + i); + + /* process the last block and padding */ + for (k = 0; k < padsize; k++) + pad[k] = ((uint8_t *)buf)[k+i]; + + if (padsize < 112) { + for (pad[padsize++] = 0x80; padsize < 112; padsize++) + pad[padsize] = 0; + } else { + for (pad[padsize++] = 0x80; padsize < 240; padsize++) + pad[padsize] = 0; + } + + c64[0] = 0; + c64[1] = size << 3; + Encode64(pad+padsize, c64, sizeof (c64)); + padsize += sizeof (c64); + + for (i = 0; i < padsize; i += 128) + SHA512Transform(H, pad + i); + + /* truncate the output to the first 256 bits which fit into 'zcp' */ + Encode64((uint8_t *)zcp, H, sizeof (uint64_t) * 4); +} + +static void +zio_checksum_SHA256(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) +{ + /* SHA-256 as per FIPS 180-4. */ + uint32_t H[] = { + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, + 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 + }; + SHA256(H, buf, size, zcp); +} + +static void +zio_checksum_SHA512_native(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) +{ + /* SHA-512/256 as per FIPS 180-4. */ + uint64_t H[] = { + 0x22312194FC2BF72CULL, 0x9F555FA3C84C64C2ULL, + 0x2393B86B6F53B151ULL, 0x963877195940EABDULL, + 0x96283EE2A88EFFE3ULL, 0xBE5E1E2553863992ULL, + 0x2B0199FC2C85B8AAULL, 0x0EB72DDC81C52CA2ULL + }; + SHA512(H, buf, size, zcp); +} + +static void +zio_checksum_SHA512_byteswap(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + zio_cksum_t tmp; + + zio_checksum_SHA512_native(buf, size, ctx_template, &tmp); + zcp->zc_word[0] = BSWAP_64(tmp.zc_word[0]); + zcp->zc_word[1] = BSWAP_64(tmp.zc_word[1]); + zcp->zc_word[2] = BSWAP_64(tmp.zc_word[2]); + zcp->zc_word[3] = BSWAP_64(tmp.zc_word[3]); +} Added: head/sys/cddl/boot/zfs/skein_zfs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/boot/zfs/skein_zfs.c Thu Aug 18 00:37:07 2016 (r304321) @@ -0,0 +1,92 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://opensource.org/licenses/CDDL-1.0. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD$ + */ +/* + * Copyright 2013 Saso Kiselkov. All rights reserved. + */ +#include + +/* + * Computes a native 256-bit skein MAC checksum. Please note that this + * function requires the presence of a ctx_template that should be allocated + * using zio_checksum_skein_tmpl_init. + */ +/*ARGSUSED*/ +static void +zio_checksum_skein_native(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + Skein_512_Ctxt_t ctx; + + ASSERT(ctx_template != NULL); + bcopy(ctx_template, &ctx, sizeof (ctx)); + (void) Skein_512_Update(&ctx, buf, size); + (void) Skein_512_Final(&ctx, (uint8_t *)zcp); + bzero(&ctx, sizeof (ctx)); +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Aug 18 01:25:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D750CBBD8AB; Thu, 18 Aug 2016 01:25:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA32B1316; Thu, 18 Aug 2016 01:25:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I1PCe4014170; Thu, 18 Aug 2016 01:25:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I1PCs3014169; Thu, 18 Aug 2016 01:25:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608180125.u7I1PCs3014169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 18 Aug 2016 01:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304322 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 01:25:13 -0000 Author: adrian Date: Thu Aug 18 01:25:12 2016 New Revision: 304322 URL: https://svnweb.freebsd.org/changeset/base/304322 Log: [net80211] correctly lock the ifp before accessing the lladdr. Tested by: dhw Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Aug 18 00:37:07 2016 (r304321) +++ head/sys/net80211/ieee80211_ioctl.c Thu Aug 18 01:25:12 2016 (r304322) @@ -3394,10 +3394,12 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon * Check if the MAC address was changed * via SIOCSIFLLADDR ioctl. */ + if_addr_rlock(ifp); if ((ifp->if_flags & IFF_UP) == 0 && !IEEE80211_ADDR_EQ(vap->iv_myaddr, IF_LLADDR(ifp))) IEEE80211_ADDR_COPY(vap->iv_myaddr, IF_LLADDR(ifp)); + if_addr_runlock(ifp); } break; case SIOCADDMULTI: From owner-svn-src-head@freebsd.org Thu Aug 18 01:48:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED2EDBBDD51; Thu, 18 Aug 2016 01:48:59 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFB691B35; Thu, 18 Aug 2016 01:48:59 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I1mxn9021654; Thu, 18 Aug 2016 01:48:59 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I1mwTi021652; Thu, 18 Aug 2016 01:48:58 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180148.u7I1mwTi021652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 01:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304323 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 01:49:00 -0000 Author: yongari Date: Thu Aug 18 01:48:58 2016 New Revision: 304323 URL: https://svnweb.freebsd.org/changeset/base/304323 Log: Pass PHY location information and remove PHY access hack. Modified: head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 01:25:12 2016 (r304322) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 01:48:58 2016 (r304323) @@ -303,8 +303,6 @@ axge_miibus_writereg(device_t dev, int p int locked; sc = device_get_softc(dev); - if (sc->sc_phyno != phy) - return (0); locked = mtx_owned(&sc->sc_mtx); if (!locked) AXGE_LOCK(sc); @@ -434,7 +432,6 @@ axge_attach_post(struct usb_ether *ue) struct axge_softc *sc; sc = uether_getsc(ue); - sc->sc_phyno = 3; /* Initialize controller and get station address. */ axge_chip_init(sc); @@ -466,7 +463,7 @@ axge_attach_post_sub(struct usb_ether *u mtx_lock(&Giant); error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp, uether_ifmedia_upd, ue->ue_methods->ue_mii_sts, - BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, MIIF_DOPAUSE); + BMSR_DEFCAPMASK, AXGE_PHY_ADDR, MII_OFFSET_ANY, MIIF_DOPAUSE); mtx_unlock(&Giant); return (error); Modified: head/sys/dev/usb/net/if_axgereg.h ============================================================================== --- head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 01:25:12 2016 (r304322) +++ head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 01:48:58 2016 (r304323) @@ -158,11 +158,12 @@ enum { AXGE_N_TRANSFER, }; +#define AXGE_PHY_ADDR 3 + struct axge_softc { struct usb_ether sc_ue; struct mtx sc_mtx; struct usb_xfer *sc_xfer[AXGE_N_TRANSFER]; - int sc_phyno; int sc_flags; #define AXGE_FLAG_LINK 0x0001 /* got a link */ From owner-svn-src-head@freebsd.org Thu Aug 18 02:14:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C881FBBE45B; Thu, 18 Aug 2016 02:14:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 998DE18B5; Thu, 18 Aug 2016 02:14:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I2EdgI032507; Thu, 18 Aug 2016 02:14:39 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I2Edk7032506; Thu, 18 Aug 2016 02:14:39 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180214.u7I2Edk7032506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 02:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304324 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 02:14:40 -0000 Author: yongari Date: Thu Aug 18 02:14:39 2016 New Revision: 304324 URL: https://svnweb.freebsd.org/changeset/base/304324 Log: Don't explicitly call MIIBUS_STATCHG() method handler. Link state change should be handled by PHY driver. Some broken PHY H/Ws may need that workaround but it seems axge(4) don't use such PHYs. Modified: head/sys/dev/usb/net/if_axge.c Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 01:48:58 2016 (r304323) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 02:14:39 2016 (r304324) @@ -724,11 +724,6 @@ axge_tick(struct usb_ether *ue) AXGE_LOCK_ASSERT(sc, MA_OWNED); mii_tick(mii); - if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) { - axge_miibus_statchg(ue->ue_dev); - if ((sc->sc_flags & AXGE_FLAG_LINK) != 0) - axge_start(ue); - } } static void From owner-svn-src-head@freebsd.org Thu Aug 18 04:25:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3581FBBDFF0; Thu, 18 Aug 2016 04:25:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB96B15EC; Thu, 18 Aug 2016 04:25:18 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I4PIU8081873; Thu, 18 Aug 2016 04:25:18 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I4PHED081871; Thu, 18 Aug 2016 04:25:17 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180425.u7I4PHED081871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 04:25:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304325 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 04:25:19 -0000 Author: yongari Date: Thu Aug 18 04:25:17 2016 New Revision: 304325 URL: https://svnweb.freebsd.org/changeset/base/304325 Log: Rename cryptic RX filter constants with more readable ones. No functional change. Modified: head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 02:14:39 2016 (r304324) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 04:25:17 2016 (r304325) @@ -743,11 +743,11 @@ axge_setmulti(struct usb_ether *ue) rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { - rxmode |= RCR_AMALL; + rxmode |= RCR_ACPT_ALL_MCAST; axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); return; } - rxmode &= ~RCR_AMALL; + rxmode &= ~RCR_ACPT_ALL_MCAST; if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { @@ -775,9 +775,9 @@ axge_setpromisc(struct usb_ether *ue) rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); if (ifp->if_flags & IFF_PROMISC) - rxmode |= RCR_PRO; + rxmode |= RCR_PROMISC; else - rxmode &= ~RCR_PRO; + rxmode &= ~RCR_PROMISC; axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); axge_setmulti(ue); @@ -828,16 +828,16 @@ axge_init(struct usb_ether *ue) axge_csum_cfg(ue); /* Configure RX settings. */ - rxmode = (RCR_AM | RCR_SO | RCR_DROP_CRCE); + rxmode = (RCR_ACPT_MCAST | RCR_START | RCR_DROP_CRCERR); if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) rxmode |= RCR_IPE; /* If we want promiscuous mode, set the allframes bit. */ if (ifp->if_flags & IFF_PROMISC) - rxmode |= RCR_PRO; + rxmode |= RCR_PROMISC; if (ifp->if_flags & IFF_BROADCAST) - rxmode |= RCR_AB; + rxmode |= RCR_ACPT_BCAST; axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); Modified: head/sys/dev/usb/net/if_axgereg.h ============================================================================== --- head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 02:14:39 2016 (r304324) +++ head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 04:25:17 2016 (r304325) @@ -57,13 +57,14 @@ /* Rx control register */ #define AXGE_RCR 0x0b #define RCR_STOP 0x0000 -#define RCR_PRO 0x0001 -#define RCR_AMALL 0x0002 -#define RCR_AB 0x0008 -#define RCR_AM 0x0010 -#define RCR_AP 0x0020 -#define RCR_SO 0x0080 -#define RCR_DROP_CRCE 0x0100 +#define RCR_PROMISC 0x0001 +#define RCR_ACPT_ALL_MCAST 0x0002 +#define RCR_AUTOPAD_BNDRY 0x0004 +#define RCR_ACPT_BCAST 0x0008 +#define RCR_ACPT_MCAST 0x0010 +#define RCR_ACPT_PHY_MCAST 0x0020 +#define RCR_START 0x0080 +#define RCR_DROP_CRCERR 0x0100 #define RCR_IPE 0x0200 #define RCR_TX_CRC_PAD 0x0400 From owner-svn-src-head@freebsd.org Thu Aug 18 05:07:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA948BBCCD1; Thu, 18 Aug 2016 05:07:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E18017C7; Thu, 18 Aug 2016 05:07:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I572nm096521; Thu, 18 Aug 2016 05:07:02 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I572ZI096519; Thu, 18 Aug 2016 05:07:02 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180507.u7I572ZI096519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 05:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304326 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 05:07:03 -0000 Author: yongari Date: Thu Aug 18 05:07:02 2016 New Revision: 304326 URL: https://svnweb.freebsd.org/changeset/base/304326 Log: Switch to TX header format rather than directly manipulating header structures. This simplifies mbuf copy operation to USB buffers as well as improving readability. The controller supports Microsoft LSOv1(aka TSO) but this change set does not include the support due to copying overhead to USB buffers and large amount of memory waste. Remove useless ZLP padding which seems to come from Linux. Required bits the code tried to set was not copied into USB buffer so it had no effect. Unlike Linux, FreeBSD USB stack automatically generates ZLP so no explicit padding is required in driver.[1] Micro-optimize updating IFCOUNTER_OPACKETS counter by moving it out of TX loop since updating counter is not cheap operation as it did long time ago and we already know how many number of packets were queued after exiting the loop. While here, fix a checksum offloading bug which will happen when upper stack computes checksum while H/W checksum offloading is active. The controller should be notified to not recompute the checksum in this case. Reviewed by: kevlo (initial version), hselasky Pointed out by: hselasky [1] Modified: head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 04:25:17 2016 (r304325) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 05:07:02 2016 (r304326) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -144,8 +145,8 @@ static const struct usb_config axge_conf .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .frames = 16, - .bufsize = 16 * MCLBYTES, + .frames = AXGE_N_FRAMES, + .bufsize = AXGE_N_FRAMES * MCLBYTES, .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, .callback = axge_bulk_write_callback, .timeout = 10000, /* 10 seconds */ @@ -630,7 +631,7 @@ axge_bulk_write_callback(struct usb_xfer struct ifnet *ifp; struct usb_page_cache *pc; struct mbuf *m; - uint32_t txhdr; + struct axge_frame_txhdr txhdr; int nframes, pos; sc = usbd_xfer_softc(xfer); @@ -651,36 +652,25 @@ tr_setup: return; } - for (nframes = 0; nframes < 16 && + for (nframes = 0; nframes < AXGE_N_FRAMES && !IFQ_DRV_IS_EMPTY(&ifp->if_snd); nframes++) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; usbd_xfer_set_frame_offset(xfer, nframes * MCLBYTES, - nframes); - pos = 0; + nframes); pc = usbd_xfer_get_frame(xfer, nframes); - txhdr = htole32(m->m_pkthdr.len); - usbd_copy_in(pc, 0, &txhdr, sizeof(txhdr)); - txhdr = 0; - txhdr = htole32(txhdr); - usbd_copy_in(pc, 4, &txhdr, sizeof(txhdr)); - pos += 8; + txhdr.mss = 0; + txhdr.len = htole32(AXGE_TXBYTES(m->m_pkthdr.len)); + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0 && + (m->m_pkthdr.csum_flags & AXGE_CSUM_FEATURES) == 0) + txhdr.len |= htole32(AXGE_CSUM_DISABLE); + + pos = 0; + usbd_copy_in(pc, pos, &txhdr, sizeof(txhdr)); + pos += sizeof(txhdr); usbd_m_copy_in(pc, pos, m, 0, m->m_pkthdr.len); pos += m->m_pkthdr.len; - if ((pos % usbd_xfer_max_framelen(xfer)) == 0) - txhdr |= 0x80008000; - - /* - * XXX - * Update TX packet counter here. This is not - * correct way but it seems that there is no way - * to know how many packets are sent at the end - * of transfer because controller combines - * multiple writes into single one if there is - * room in TX buffer of controller. - */ - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* * if there's a BPF listener, bounce a copy @@ -694,6 +684,16 @@ tr_setup: usbd_xfer_set_frame_len(xfer, nframes, pos); } if (nframes != 0) { + /* + * XXX + * Update TX packet counter here. This is not + * correct way but it seems that there is no way + * to know how many packets are sent at the end + * of transfer because controller combines + * multiple writes into single one if there is + * room in TX buffer of controller. + */ + if_inc_counter(ifp, IFCOUNTER_OPACKETS, nframes); usbd_xfer_set_frames(xfer, nframes); usbd_transfer_submit(xfer); ifp->if_drv_flags |= IFF_DRV_OACTIVE; Modified: head/sys/dev/usb/net/if_axgereg.h ============================================================================== --- head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 04:25:17 2016 (r304325) +++ head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 05:07:02 2016 (r304326) @@ -159,6 +159,26 @@ enum { AXGE_N_TRANSFER, }; +#define AXGE_N_FRAMES 16 + +struct axge_frame_txhdr { +#if BYTE_ORDER == LITTLE_ENDIAN + uint32_t len; +#define AXGE_TXLEN_MASK 0x0001FFFF +#define AXGE_VLAN_INSERT 0x20000000 +#define AXGE_CSUM_DISABLE 0x80000000 + uint32_t mss; +#define AXGE_MSS_MASK 0x00003FFF +#define AXGE_PADDING 0x80008000 +#define AXGE_VLAN_TAG_MASK 0xFFFF0000 +#else + uint32_t mss; + uint32_t len; +#endif +} __packed; + +#define AXGE_TXBYTES(x) ((x) & AXGE_TXLEN_MASK) + #define AXGE_PHY_ADDR 3 struct axge_softc { From owner-svn-src-head@freebsd.org Thu Aug 18 05:33:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFD60BBE365; Thu, 18 Aug 2016 05:33: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 91BED1503; Thu, 18 Aug 2016 05:33:59 +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 u7I5XwSP007504; Thu, 18 Aug 2016 05:33:58 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I5XwHv007496; Thu, 18 Aug 2016 05:33:58 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608180533.u7I5XwHv007496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Aug 2016 05:33:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304327 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 05:34:00 -0000 Author: sephe Date: Thu Aug 18 05:33:58 2016 New Revision: 304327 URL: https://svnweb.freebsd.org/changeset/base/304327 Log: hyperv/hn: Pass RX packet info to netvsc_recv. This paves to nuke netvsc_packet, which does not serves much purpose now. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7541 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:07:02 2016 (r304326) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:33:58 2016 (r304327) @@ -275,7 +275,6 @@ typedef void (*pfn_on_send_rx_completion #endif typedef struct netvsc_packet_ { - uint16_t vlan_tci; uint32_t status; uint32_t tot_data_buf_len; void *data; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 18 05:07:02 2016 (r304326) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 18 05:33:58 2016 (r304327) @@ -1278,9 +1278,7 @@ hn_lro_rx(struct lro_ctrl *lc, struct mb */ int netvsc_recv(struct hn_rx_ring *rxr, netvsc_packet *packet, - const rndis_tcp_ip_csum_info *csum_info, - const struct rndis_hash_info *hash_info, - const struct rndis_hash_value *hash_value) + const struct hn_recvinfo *info) { struct ifnet *ifp = rxr->hn_ifp; struct mbuf *m_new; @@ -1332,28 +1330,28 @@ netvsc_recv(struct hn_rx_ring *rxr, netv do_csum = 0; /* receive side checksum offload */ - if (csum_info != NULL) { + if (info->csum_info != NULL) { /* IP csum offload */ - if (csum_info->receive.ip_csum_succeeded && do_csum) { + if (info->csum_info->receive.ip_csum_succeeded && do_csum) { m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); rxr->hn_csum_ip++; } /* TCP/UDP csum offload */ - if ((csum_info->receive.tcp_csum_succeeded || - csum_info->receive.udp_csum_succeeded) && do_csum) { + if ((info->csum_info->receive.tcp_csum_succeeded || + info->csum_info->receive.udp_csum_succeeded) && do_csum) { m_new->m_pkthdr.csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; - if (csum_info->receive.tcp_csum_succeeded) + if (info->csum_info->receive.tcp_csum_succeeded) rxr->hn_csum_tcp++; else rxr->hn_csum_udp++; } - if (csum_info->receive.ip_csum_succeeded && - csum_info->receive.tcp_csum_succeeded) + if (info->csum_info->receive.ip_csum_succeeded && + info->csum_info->receive.tcp_csum_succeeded) do_lro = 1; } else { const struct ether_header *eh; @@ -1409,19 +1407,18 @@ netvsc_recv(struct hn_rx_ring *rxr, netv } } skip: - if ((packet->vlan_tci != 0) && - (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) { - m_new->m_pkthdr.ether_vtag = packet->vlan_tci; + if (info->vlan_info != NULL) { + m_new->m_pkthdr.ether_vtag = info->vlan_info->u1.s1.vlan_id; m_new->m_flags |= M_VLANTAG; } - if (hash_info != NULL && hash_value != NULL) { + if (info->hash_info != NULL && info->hash_value != NULL) { rxr->hn_rss_pkts++; - m_new->m_pkthdr.flowid = hash_value->hash_value; - if ((hash_info->hash_info & NDIS_HASH_FUNCTION_MASK) == + m_new->m_pkthdr.flowid = info->hash_value->hash_value; + if ((info->hash_info->hash_info & NDIS_HASH_FUNCTION_MASK) == NDIS_HASH_FUNCTION_TOEPLITZ) { uint32_t type = - (hash_info->hash_info & NDIS_HASH_TYPE_MASK); + (info->hash_info->hash_info & NDIS_HASH_TYPE_MASK); switch (type) { case NDIS_HASH_IPV4: @@ -1450,8 +1447,8 @@ skip: } } } else { - if (hash_value != NULL) { - m_new->m_pkthdr.flowid = hash_value->hash_value; + if (info->hash_value != NULL) { + m_new->m_pkthdr.flowid = info->hash_value->hash_value; } else { m_new->m_pkthdr.flowid = rxr->hn_rx_idx; hash_type = M_HASHTYPE_OPAQUE; Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Thu Aug 18 05:07:02 2016 (r304326) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Thu Aug 18 05:33:58 2016 (r304327) @@ -1088,11 +1088,10 @@ typedef struct rndismp_rx_bufs_info_ { */ struct hn_rx_ring; struct hn_tx_ring; +struct hn_recvinfo; int netvsc_recv(struct hn_rx_ring *rxr, - netvsc_packet *packet, const rndis_tcp_ip_csum_info *csum_info, - const struct rndis_hash_info *hash_info, - const struct rndis_hash_value *hash_value); + netvsc_packet *packet, const struct hn_recvinfo *info); void netvsc_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); void* hv_set_rppi_data(rndis_msg *rndis_mesg, Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 18 05:07:02 2016 (r304326) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 18 05:33:58 2016 (r304327) @@ -52,13 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct hv_rf_recvinfo { - const ndis_8021q_info *vlan_info; - const rndis_tcp_ip_csum_info *csum_info; - const struct rndis_hash_info *hash_info; - const struct rndis_hash_value *hash_value; -}; - #define HV_RF_RECVINFO_VLAN 0x1 #define HV_RF_RECVINFO_CSUM 0x2 #define HV_RF_RECVINFO_HASHINF 0x4 @@ -444,7 +437,7 @@ hv_rf_receive_indicate_status(rndis_devi } static int -hv_rf_find_recvinfo(const rndis_packet *rpkt, struct hv_rf_recvinfo *info) +hv_rf_find_recvinfo(const rndis_packet *rpkt, struct hn_recvinfo *info) { const rndis_per_packet_info *ppi; uint32_t mask, len; @@ -530,7 +523,7 @@ hv_rf_receive_data(struct hn_rx_ring *rx { rndis_packet *rndis_pkt; uint32_t data_offset; - struct hv_rf_recvinfo info; + struct hn_recvinfo info; rndis_pkt = &message->msg.packet; @@ -559,13 +552,7 @@ hv_rf_receive_data(struct hn_rx_ring *rx if_printf(rxr->hn_ifp, "recvinfo parsing failed\n"); return; } - - if (info.vlan_info != NULL) - pkt->vlan_tci = info.vlan_info->u1.s1.vlan_id; - else - pkt->vlan_tci = 0; - - netvsc_recv(rxr, pkt, info.csum_info, info.hash_info, info.hash_value); + netvsc_recv(rxr, pkt, &info); } /* Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Thu Aug 18 05:07:02 2016 (r304326) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Thu Aug 18 05:33:58 2016 (r304327) @@ -35,7 +35,6 @@ #include struct netvsc_dev_; -struct nvsp_msg_; struct vmbus_channel; struct hn_send_ctx; @@ -51,6 +50,18 @@ struct hn_send_ctx { int hn_chim_sz; }; +struct rndis_hash_info; +struct rndix_hash_value; +struct ndis_8021q_info_; +struct rndis_tcp_ip_csum_info_; + +struct hn_recvinfo { + const struct ndis_8021q_info_ *vlan_info; + const struct rndis_tcp_ip_csum_info_ *csum_info; + const struct rndis_hash_info *hash_info; + const struct rndis_hash_value *hash_value; +}; + #define HN_SEND_CTX_INITIALIZER(cb, cbarg) \ { \ .hn_cb = cb, \ From owner-svn-src-head@freebsd.org Thu Aug 18 05:45:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20651BBE730; Thu, 18 Aug 2016 05:45:00 +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 CB98B1C9C; Thu, 18 Aug 2016 05:44:59 +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 u7I5ixTv011307; Thu, 18 Aug 2016 05:44:59 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I5ix1Q011306; Thu, 18 Aug 2016 05:44:59 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608180544.u7I5ix1Q011306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Aug 2016 05:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304329 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 05:45:00 -0000 Author: sephe Date: Thu Aug 18 05:44:58 2016 New Revision: 304329 URL: https://svnweb.freebsd.org/changeset/base/304329 Log: hyperv/hn: Constify RNDIS messages on RX path. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7542 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 18 05:35:43 2016 (r304328) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 18 05:44:58 2016 (r304329) @@ -67,10 +67,11 @@ __FBSDID("$FreeBSD$"); */ static int hv_rf_send_request(rndis_device *device, rndis_request *request, uint32_t message_type); -static void hv_rf_receive_response(rndis_device *device, rndis_msg *response); +static void hv_rf_receive_response(rndis_device *device, + const rndis_msg *response); static void hv_rf_receive_indicate_status(rndis_device *device, - rndis_msg *response); -static void hv_rf_receive_data(struct hn_rx_ring *rxr, rndis_msg *message, + const rndis_msg *response); +static void hv_rf_receive_data(struct hn_rx_ring *rxr, const rndis_msg *message, netvsc_packet *pkt); static int hv_rf_query_device(rndis_device *device, uint32_t oid, void *result, uint32_t *result_size); @@ -295,7 +296,7 @@ sendit: * RNDIS filter receive response */ static void -hv_rf_receive_response(rndis_device *device, rndis_msg *response) +hv_rf_receive_response(rndis_device *device, const rndis_msg *response) { rndis_request *request = NULL; rndis_request *next_request; @@ -417,9 +418,9 @@ cleanup: * RNDIS filter receive indicate status */ static void -hv_rf_receive_indicate_status(rndis_device *device, rndis_msg *response) +hv_rf_receive_indicate_status(rndis_device *device, const rndis_msg *response) { - rndis_indicate_status *indicate = &response->msg.indicate_status; + const rndis_indicate_status *indicate = &response->msg.indicate_status; switch(indicate->status) { case RNDIS_STATUS_MEDIA_CONNECT: @@ -518,10 +519,10 @@ skip: * RNDIS filter receive data */ static void -hv_rf_receive_data(struct hn_rx_ring *rxr, rndis_msg *message, +hv_rf_receive_data(struct hn_rx_ring *rxr, const rndis_msg *message, netvsc_packet *pkt) { - rndis_packet *rndis_pkt; + const rndis_packet *rndis_pkt; uint32_t data_offset; struct hn_recvinfo info; @@ -563,7 +564,7 @@ hv_rf_on_receive(netvsc_dev *net_dev, struct hn_rx_ring *rxr, netvsc_packet *pkt) { rndis_device *rndis_dev; - rndis_msg *rndis_hdr; + const rndis_msg *rndis_hdr; /* Make sure the rndis device state is initialized */ if (net_dev->extension == NULL) { From owner-svn-src-head@freebsd.org Thu Aug 18 05:52:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1545EBBE94D; Thu, 18 Aug 2016 05:52:05 +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 CACD112D0; Thu, 18 Aug 2016 05:52:04 +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 u7I5q4CA015006; Thu, 18 Aug 2016 05:52:04 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I5q3O0015000; Thu, 18 Aug 2016 05:52:03 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608180552.u7I5q3O0015000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Aug 2016 05:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304330 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 05:52:05 -0000 Author: sephe Date: Thu Aug 18 05:52:03 2016 New Revision: 304330 URL: https://svnweb.freebsd.org/changeset/base/304330 Log: hyperv/hn: Get rid of the useless netvsc_packet MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7544 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Aug 18 05:44:58 2016 (r304329) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Aug 18 05:52:03 2016 (r304330) @@ -66,7 +66,7 @@ static int hv_nv_connect_to_vsp(struct static void hv_nv_on_send_completion(netvsc_dev *net_dev, struct vmbus_channel *, const struct vmbus_chanpkt_hdr *pkt); static void hv_nv_on_receive_completion(struct vmbus_channel *chan, - uint64_t tid, uint32_t status); + uint64_t tid); static void hv_nv_on_receive(netvsc_dev *net_dev, struct hn_rx_ring *rxr, struct vmbus_channel *chan, const struct vmbus_chanpkt_hdr *pkt); @@ -844,11 +844,8 @@ hv_nv_on_receive(netvsc_dev *net_dev, st { const struct vmbus_chanpkt_rxbuf *pkt; const struct hn_nvs_hdr *nvs_hdr; - netvsc_packet vsc_pkt; - netvsc_packet *net_vsc_pkt = &vsc_pkt; int count = 0; int i = 0; - int status = HN_NVS_STATUS_OK; /* Make sure that this is a RNDIS message. */ nvs_hdr = VMBUS_CHANPKT_CONST_DATA(pkthdr); @@ -870,16 +867,9 @@ hv_nv_on_receive(netvsc_dev *net_dev, st /* Each range represents 1 RNDIS pkt that contains 1 Ethernet frame */ for (i = 0; i < count; i++) { - net_vsc_pkt->status = HN_NVS_STATUS_OK; - net_vsc_pkt->data = ((uint8_t *)net_dev->rx_buf + - pkt->cp_rxbuf[i].rb_ofs); - net_vsc_pkt->tot_data_buf_len = pkt->cp_rxbuf[i].rb_len; - - hv_rf_on_receive(net_dev, rxr, net_vsc_pkt); - - /* XXX pretty broken; whack it */ - if (net_vsc_pkt->status != HN_NVS_STATUS_OK) - status = HN_NVS_STATUS_FAILED; + hv_rf_on_receive(net_dev, rxr, + (const uint8_t *)net_dev->rx_buf + pkt->cp_rxbuf[i].rb_ofs, + pkt->cp_rxbuf[i].rb_len); } /* @@ -887,7 +877,7 @@ hv_nv_on_receive(netvsc_dev *net_dev, st * messages (not just data messages) will trigger a response * message back to the host. */ - hv_nv_on_receive_completion(chan, pkt->cp_hdr.cph_xactid, status); + hv_nv_on_receive_completion(chan, pkt->cp_hdr.cph_xactid); } /* @@ -896,15 +886,14 @@ hv_nv_on_receive(netvsc_dev *net_dev, st * Send a receive completion packet to RNDIS device (ie NetVsp) */ static void -hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid, - uint32_t status) +hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid) { struct hn_nvs_rndis_ack ack; int retries = 0; int ret = 0; ack.nvs_type = HN_NVS_TYPE_RNDIS_ACK; - ack.nvs_status = status; + ack.nvs_status = HN_NVS_STATUS_OK; retry_send_cmplt: /* Send the completion */ Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:44:58 2016 (r304329) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:52:03 2016 (r304330) @@ -274,12 +274,6 @@ typedef void (*pfn_on_send_rx_completion #define BITS_PER_LONG 32 #endif -typedef struct netvsc_packet_ { - uint32_t status; - uint32_t tot_data_buf_len; - void *data; -} netvsc_packet; - typedef struct { uint8_t mac_addr[6]; /* Assumption unsigned long */ uint8_t link_state; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 18 05:44:58 2016 (r304329) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 18 05:52:03 2016 (r304330) @@ -1277,7 +1277,7 @@ hn_lro_rx(struct lro_ctrl *lc, struct mb * Note: This is no longer used as a callback */ int -netvsc_recv(struct hn_rx_ring *rxr, netvsc_packet *packet, +netvsc_recv(struct hn_rx_ring *rxr, const void *data, int dlen, const struct hn_recvinfo *info) { struct ifnet *ifp = rxr->hn_ifp; @@ -1291,17 +1291,16 @@ netvsc_recv(struct hn_rx_ring *rxr, netv /* * Bail out if packet contains more data than configured MTU. */ - if (packet->tot_data_buf_len > (ifp->if_mtu + ETHER_HDR_LEN)) { + if (dlen > (ifp->if_mtu + ETHER_HDR_LEN)) { return (0); - } else if (packet->tot_data_buf_len <= MHLEN) { + } else if (dlen <= MHLEN) { m_new = m_gethdr(M_NOWAIT, MT_DATA); if (m_new == NULL) { if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return (0); } - memcpy(mtod(m_new, void *), packet->data, - packet->tot_data_buf_len); - m_new->m_pkthdr.len = m_new->m_len = packet->tot_data_buf_len; + memcpy(mtod(m_new, void *), data, dlen); + m_new->m_pkthdr.len = m_new->m_len = dlen; rxr->hn_small_pkts++; } else { /* @@ -1311,7 +1310,7 @@ netvsc_recv(struct hn_rx_ring *rxr, netv * if looped around to the Hyper-V TX channel, so avoid them. */ size = MCLBYTES; - if (packet->tot_data_buf_len > MCLBYTES) { + if (dlen > MCLBYTES) { /* 4096 */ size = MJUMPAGESIZE; } @@ -1322,7 +1321,7 @@ netvsc_recv(struct hn_rx_ring *rxr, netv return (0); } - hv_m_append(m_new, packet->tot_data_buf_len, packet->data); + hv_m_append(m_new, dlen, data); } m_new->m_pkthdr.rcvif = ifp; Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Thu Aug 18 05:44:58 2016 (r304329) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Thu Aug 18 05:52:03 2016 (r304330) @@ -1090,8 +1090,8 @@ struct hn_rx_ring; struct hn_tx_ring; struct hn_recvinfo; -int netvsc_recv(struct hn_rx_ring *rxr, - netvsc_packet *packet, const struct hn_recvinfo *info); +int netvsc_recv(struct hn_rx_ring *rxr, const void *data, int dlen, + const struct hn_recvinfo *info); void netvsc_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); void* hv_set_rppi_data(rndis_msg *rndis_mesg, Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 18 05:44:58 2016 (r304329) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 18 05:52:03 2016 (r304330) @@ -71,8 +71,8 @@ static void hv_rf_receive_response(rndis const rndis_msg *response); static void hv_rf_receive_indicate_status(rndis_device *device, const rndis_msg *response); -static void hv_rf_receive_data(struct hn_rx_ring *rxr, const rndis_msg *message, - netvsc_packet *pkt); +static void hv_rf_receive_data(struct hn_rx_ring *rxr, + const void *data, int dlen); static int hv_rf_query_device(rndis_device *device, uint32_t oid, void *result, uint32_t *result_size); static inline int hv_rf_query_device_mac(rndis_device *device); @@ -519,9 +519,9 @@ skip: * RNDIS filter receive data */ static void -hv_rf_receive_data(struct hn_rx_ring *rxr, const rndis_msg *message, - netvsc_packet *pkt) +hv_rf_receive_data(struct hn_rx_ring *rxr, const void *data, int dlen) { + const rndis_msg *message = data; const rndis_packet *rndis_pkt; uint32_t data_offset; struct hn_recvinfo info; @@ -536,24 +536,22 @@ hv_rf_receive_data(struct hn_rx_ring *rx /* Remove rndis header, then pass data packet up the stack */ data_offset = RNDIS_HEADER_SIZE + rndis_pkt->data_offset; - pkt->tot_data_buf_len -= data_offset; - if (pkt->tot_data_buf_len < rndis_pkt->data_length) { - pkt->status = HN_NVS_STATUS_FAILED; + dlen -= data_offset; + if (dlen < rndis_pkt->data_length) { if_printf(rxr->hn_ifp, "total length %u is less than data length %u\n", - pkt->tot_data_buf_len, rndis_pkt->data_length); + dlen, rndis_pkt->data_length); return; } - pkt->tot_data_buf_len = rndis_pkt->data_length; - pkt->data = (void *)((unsigned long)pkt->data + data_offset); + dlen = rndis_pkt->data_length; + data = (const uint8_t *)data + data_offset; if (hv_rf_find_recvinfo(rndis_pkt, &info)) { - pkt->status = HN_NVS_STATUS_FAILED; if_printf(rxr->hn_ifp, "recvinfo parsing failed\n"); return; } - netvsc_recv(rxr, pkt, &info); + netvsc_recv(rxr, data, dlen, &info); } /* @@ -561,30 +559,25 @@ hv_rf_receive_data(struct hn_rx_ring *rx */ int hv_rf_on_receive(netvsc_dev *net_dev, - struct hn_rx_ring *rxr, netvsc_packet *pkt) + struct hn_rx_ring *rxr, const void *data, int dlen) { rndis_device *rndis_dev; const rndis_msg *rndis_hdr; /* Make sure the rndis device state is initialized */ - if (net_dev->extension == NULL) { - pkt->status = HN_NVS_STATUS_FAILED; + if (net_dev->extension == NULL) return (ENODEV); - } rndis_dev = (rndis_device *)net_dev->extension; - if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) { - pkt->status = HN_NVS_STATUS_FAILED; + if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) return (EINVAL); - } - - rndis_hdr = pkt->data; + rndis_hdr = data; switch (rndis_hdr->ndis_msg_type) { /* data message */ case REMOTE_NDIS_PACKET_MSG: - hv_rf_receive_data(rxr, rndis_hdr, pkt); + hv_rf_receive_data(rxr, data, dlen); break; /* completion messages */ case REMOTE_NDIS_INITIALIZE_CMPLT: Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Thu Aug 18 05:44:58 2016 (r304329) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Thu Aug 18 05:52:03 2016 (r304330) @@ -115,8 +115,8 @@ typedef struct rndis_device_ { struct hn_softc; struct hn_rx_ring; -int hv_rf_on_receive(netvsc_dev *net_dev, - struct hn_rx_ring *rxr, netvsc_packet *pkt); +int hv_rf_on_receive(netvsc_dev *net_dev, struct hn_rx_ring *rxr, + const void *data, int dlen); void hv_rf_receive_rollup(netvsc_dev *net_dev); void hv_rf_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, int nchan, From owner-svn-src-head@freebsd.org Thu Aug 18 06:03:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35DE6BBEAEA; Thu, 18 Aug 2016 06:03:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 01B611897; Thu, 18 Aug 2016 06:03:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 10DCE104B4F3; Thu, 18 Aug 2016 16:03:03 +1000 (AEST) Date: Thu, 18 Aug 2016 16:03:02 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304320 - head/secure/lib/libcrypto In-Reply-To: <201608172213.u7HMDdcC043955@repo.freebsd.org> Message-ID: <20160818155154.F822@besplex.bde.org> References: <201608172213.u7HMDdcC043955@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=K1TFXFyNfQ2oaDB8vgkA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 06:03:13 -0000 On Wed, 17 Aug 2016, Jung-uk Kim wrote: > Log: > Disable assembly sources when compiler/assembler cannot compile certain > instructions. For example, GCC 4.2.1 + binutils 2.17.50 does not support > AVX instructions. > > Reported by: bde > MFC after: 2 weeks Thanks. I tried WITHOUT_SSL to work around this, but that was broken too. WITHOUT_SSL removes too many things, but not enough for makeworld to actually work. I sent the list to bdrewery. He already knows about the problem of course. Bruce From owner-svn-src-head@freebsd.org Thu Aug 18 06:03:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F240BBEB51; Thu, 18 Aug 2016 06:03:56 +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 2C1FA1A10; Thu, 18 Aug 2016 06:03:56 +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 u7I63tYv018818; Thu, 18 Aug 2016 06:03:55 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I63tWj018817; Thu, 18 Aug 2016 06:03:55 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608180603.u7I63tWj018817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Aug 2016 06:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304331 - head/sys/dev/hyperv/utilities X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 06:03:56 -0000 Author: sephe Date: Thu Aug 18 06:03:55 2016 New Revision: 304331 URL: https://svnweb.freebsd.org/changeset/base/304331 Log: hyperv/kvp: Remove unnecessary function parameter. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7550 Modified: head/sys/dev/hyperv/utilities/hv_kvp.c Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Thu Aug 18 05:52:03 2016 (r304330) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Thu Aug 18 06:03:55 2016 (r304331) @@ -217,10 +217,9 @@ hv_kvp_transaction_init(hv_kvp_sc *sc, u * hv_kvp - version neogtiation function */ static void -hv_kvp_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, - struct hv_vmbus_icmsg_negotiate *negop, - uint8_t *buf) +hv_kvp_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, uint8_t *buf) { + struct hv_vmbus_icmsg_negotiate *negop; int icframe_vercnt; int icmsg_vercnt; @@ -641,7 +640,7 @@ hv_kvp_process_request(void *context, in hv_kvp_transaction_init(sc, recvlen, requestid, kvp_buf); if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - hv_kvp_negotiate_version(icmsghdrp, NULL, kvp_buf); + hv_kvp_negotiate_version(icmsghdrp, kvp_buf); hv_kvp_respond_host(sc, ret); /* From owner-svn-src-head@freebsd.org Thu Aug 18 06:29:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76936BBEE42; Thu, 18 Aug 2016 06:29:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5298F141A; Thu, 18 Aug 2016 06:29:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I6T7O4026394; Thu, 18 Aug 2016 06:29:07 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I6T7ik026391; Thu, 18 Aug 2016 06:29:07 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180629.u7I6T7ik026391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 06:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304332 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 06:29:08 -0000 Author: yongari Date: Thu Aug 18 06:29:07 2016 New Revision: 304332 URL: https://svnweb.freebsd.org/changeset/base/304332 Log: Introduce axge_rxfilter() which configures RX filtering and replace axge_setmulti()/axge_setpromisc() with axge_rxfilter(). Multicast filter programming and promiscuous mode requires access to a common RX configuration register so there is no need to use separate functions with added complexity. axge_rxfilter() does not read back AXGE_RCR register since accessing a register in USB is too slow and we already have all knowledge of required configuration. Rebuilding RX filter configuration is simpler and faster than manipulating every bits after reading back the register. Note, axge_rxfilter() does not set RCR_IPE(IP header alignment on 32bit boundary) to disable extra padding bytes insertion. The extra padding wastes ethernet to USB host bandwidth as well as complicating RX handling logic. Current USB framework requires copying RX frames to mbufs so there is no need to worry about alignment. Previously axge_rx_frame() performed wrong bound check due to the extra padding and it was broken when RX checksum offloading is disabled. See added comment in axge_rx_frame () for actual RX packet layout. In axge_init(), disable WOL. It's meaningless to enable WOL in normal operation. In axge_rxeof(), use properly sized mbuf rather than blindly allocating a mbuf cluster. Use RX H/W checksum offloading only when administrator requested RX checksum offloading. Previously it always used RX H/W checksum offloading result regardless of RX checksum offloading state. Separate L4 checksum offloading validation from L3 one and properly set required offloading bits for each layer. This is to fix setting L4 checksum offloading bits for L3 packets. There are still lots of RX errors(probably RX FIFO overflows) under moderate load. Users are strongly recommended to enable ethernet flow control. Reviewed by: kevlo (initial version), hselasky Modified: head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:03:55 2016 (r304331) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:29:07 2016 (r304332) @@ -104,8 +104,7 @@ static uether_fn_t axge_init; static uether_fn_t axge_stop; static uether_fn_t axge_start; static uether_fn_t axge_tick; -static uether_fn_t axge_setmulti; -static uether_fn_t axge_setpromisc; +static uether_fn_t axge_rxfilter; static int axge_read_mem(struct axge_softc *, uint8_t, uint16_t, uint16_t, void *, int); @@ -200,8 +199,8 @@ static const struct usb_ether_methods ax .ue_init = axge_init, .ue_stop = axge_stop, .ue_tick = axge_tick, - .ue_setmulti = axge_setmulti, - .ue_setpromisc = axge_setpromisc, + .ue_setmulti = axge_rxfilter, + .ue_setpromisc = axge_rxfilter, .ue_mii_upd = axge_ifmedia_upd, .ue_mii_sts = axge_ifmedia_sts, }; @@ -727,7 +726,7 @@ axge_tick(struct usb_ether *ue) } static void -axge_setmulti(struct usb_ether *ue) +axge_rxfilter(struct usb_ether *ue) { struct axge_softc *sc; struct ifnet *ifp; @@ -741,14 +740,26 @@ axge_setmulti(struct usb_ether *ue) h = 0; AXGE_LOCK_ASSERT(sc, MA_OWNED); - rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); + /* + * Configure RX settings. + * Don't set RCR_IPE(IP header alignment on 32bit boundary) to disable + * inserting extra padding bytes. This wastes ethernet to USB host + * bandwidth as well as complicating RX handling logic. Current USB + * framework requires copying RX frames to mbufs so there is no need + * to worry about alignment. + */ + rxmode = RCR_DROP_CRCERR | RCR_START; + if (ifp->if_flags & IFF_BROADCAST) + rxmode |= RCR_ACPT_BCAST; if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + if (ifp->if_flags & IFF_PROMISC) + rxmode |= RCR_PROMISC; rxmode |= RCR_ACPT_ALL_MCAST; axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); return; } - rxmode &= ~RCR_ACPT_ALL_MCAST; + rxmode |= RCR_ACPT_MCAST; if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -764,26 +775,6 @@ axge_setmulti(struct usb_ether *ue) } static void -axge_setpromisc(struct usb_ether *ue) -{ - struct axge_softc *sc; - struct ifnet *ifp; - uint16_t rxmode; - - sc = uether_getsc(ue); - ifp = uether_getifp(ue); - rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); - - if (ifp->if_flags & IFF_PROMISC) - rxmode |= RCR_PROMISC; - else - rxmode &= ~RCR_PROMISC; - - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); - axge_setmulti(ue); -} - -static void axge_start(struct usb_ether *ue) { struct axge_softc *sc; @@ -801,7 +792,6 @@ axge_init(struct usb_ether *ue) { struct axge_softc *sc; struct ifnet *ifp; - uint16_t rxmode; sc = uether_getsc(ue); ifp = uether_getifp(ue); @@ -827,25 +817,22 @@ axge_init(struct usb_ether *ue) /* Configure TX/RX checksum offloading. */ axge_csum_cfg(ue); - /* Configure RX settings. */ - rxmode = (RCR_ACPT_MCAST | RCR_START | RCR_DROP_CRCERR); - if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) - rxmode |= RCR_IPE; - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) - rxmode |= RCR_PROMISC; - - if (ifp->if_flags & IFF_BROADCAST) - rxmode |= RCR_ACPT_BCAST; - - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); + /* Configure RX filters. */ + axge_rxfilter(ue); - axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_MMSR, - MMSR_PME_TYPE | MMSR_PME_POL | MMSR_RWMP); + /* + * XXX + * Controller supports wakeup on link change detection, + * magic packet and wakeup frame recpetion. But it seems + * there is no framework for USB ethernet suspend/wakeup. + * Disable all wakeup functions. + */ + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_MMSR, 0); + (void)axge_read_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_MMSR); - /* Load the multicast filter. */ - axge_setmulti(ue); + /* Configure default medium type. */ + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MSR, MSR_GM | MSR_FD | + MSR_RFC | MSR_TFC | MSR_RE); usbd_xfer_set_stall(sc->sc_xfer[AXGE_BULK_DT_WR]); @@ -921,12 +908,12 @@ axge_ioctl(struct ifnet *ifp, u_long cmd static void axge_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen) { - uint32_t pos; - uint32_t pkt_cnt; + struct axge_frame_rxhdr pkt_hdr; uint32_t rxhdr; - uint32_t pkt_hdr; + uint32_t pos; + uint32_t pkt_cnt, pkt_end; uint32_t hdr_off; - uint32_t pktlen; + uint32_t pktlen; /* verify we have enough data */ if (actlen < (int)sizeof(rxhdr)) @@ -937,41 +924,47 @@ axge_rx_frame(struct usb_ether *ue, stru usbd_copy_out(pc, actlen - sizeof(rxhdr), &rxhdr, sizeof(rxhdr)); rxhdr = le32toh(rxhdr); - pkt_cnt = (uint16_t)rxhdr; - hdr_off = (uint16_t)(rxhdr >> 16); + pkt_cnt = rxhdr & 0xFFFF; + hdr_off = pkt_end = (rxhdr >> 16) & 0xFFFF; + /* + * <----------------------- actlen ------------------------> + * [frame #0]...[frame #N][pkt_hdr #0]...[pkt_hdr #N][rxhdr] + * Each RX frame would be aligned on 8 bytes boundary. If + * RCR_IPE bit is set in AXGE_RCR register, there would be 2 + * padding bytes and 6 dummy bytes(as the padding also should + * be aligned on 8 bytes boundary) for each RX frame to align + * IP header on 32bits boundary. Driver don't set RCR_IPE bit + * of AXGE_RCR register, so there should be no padding bytes + * which simplifies RX logic a lot. + */ while (pkt_cnt--) { /* verify the header offset */ if ((int)(hdr_off + sizeof(pkt_hdr)) > actlen) { DPRINTF("End of packet headers\n"); break; } - if ((int)pos >= actlen) { + usbd_copy_out(pc, hdr_off, &pkt_hdr, sizeof(pkt_hdr)); + pkt_hdr.status = le32toh(pkt_hdr.status); + pktlen = AXGE_RXBYTES(pkt_hdr.status); + if (pos + pktlen > pkt_end) { DPRINTF("Data position reached end\n"); break; } - usbd_copy_out(pc, hdr_off, &pkt_hdr, sizeof(pkt_hdr)); - pkt_hdr = le32toh(pkt_hdr); - pktlen = (pkt_hdr >> 16) & 0x1fff; - if (pkt_hdr & (AXGE_RXHDR_CRC_ERR | AXGE_RXHDR_DROP_ERR)) { + if (AXGE_RX_ERR(pkt_hdr.status) != 0) { DPRINTF("Dropped a packet\n"); if_inc_counter(ue->ue_ifp, IFCOUNTER_IERRORS, 1); - } - if (pktlen >= 6 && (int)(pos + pktlen) <= actlen) { - axge_rxeof(ue, pc, pos + 2, pktlen - 6, pkt_hdr); - } else { - DPRINTF("Invalid packet pos=%d len=%d\n", - (int)pos, (int)pktlen); - } + } else + axge_rxeof(ue, pc, pos, pktlen, pkt_hdr.status); pos += (pktlen + 7) & ~7; hdr_off += sizeof(pkt_hdr); } } static void -axge_rxeof(struct usb_ether *ue, struct usb_page_cache *pc, - unsigned int offset, unsigned int len, uint32_t pkt_hdr) +axge_rxeof(struct usb_ether *ue, struct usb_page_cache *pc, unsigned int offset, + unsigned int len, uint32_t status) { struct ifnet *ifp; struct mbuf *m; @@ -982,29 +975,34 @@ axge_rxeof(struct usb_ether *ue, struct return; } - m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (len > MHLEN - ETHER_ALIGN) + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + else + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return; } m->m_pkthdr.rcvif = ifp; - m->m_len = m->m_pkthdr.len = len + ETHER_ALIGN; - m_adj(m, ETHER_ALIGN); + m->m_len = m->m_pkthdr.len = len; + m->m_data += ETHER_ALIGN; usbd_copy_out(pc, offset, mtod(m, uint8_t *), len); - if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - - if ((pkt_hdr & (AXGE_RXHDR_L4CSUM_ERR | AXGE_RXHDR_L3CSUM_ERR)) == 0) { - if ((pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) == - AXGE_RXHDR_L4_TYPE_TCP || - (pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) == - AXGE_RXHDR_L4_TYPE_UDP) { + if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) { + if ((status & AXGE_RX_L3_CSUM_ERR) == 0 && + (status & AXGE_RX_L3_TYPE_MASK) == AXGE_RX_L3_TYPE_IPV4) + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED | + CSUM_IP_VALID; + if ((status & AXGE_RX_L4_CSUM_ERR) == 0 && + ((status & AXGE_RX_L4_TYPE_MASK) == AXGE_RX_L4_TYPE_UDP || + (status & AXGE_RX_L4_TYPE_MASK) == AXGE_RX_L4_TYPE_TCP)) { m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | - CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | CSUM_IP_VALID; + CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } } + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); _IF_ENQUEUE(&ue->ue_rxq, m); } Modified: head/sys/dev/usb/net/if_axgereg.h ============================================================================== --- head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 06:03:55 2016 (r304331) +++ head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 06:29:07 2016 (r304332) @@ -142,14 +142,6 @@ #define AXGE_CONFIG_IDX 0 /* config number 1 */ #define AXGE_IFACE_IDX 0 -#define AXGE_RXHDR_L4_TYPE_MASK 0x1c -#define AXGE_RXHDR_L4CSUM_ERR 1 -#define AXGE_RXHDR_L3CSUM_ERR 2 -#define AXGE_RXHDR_L4_TYPE_UDP 4 -#define AXGE_RXHDR_L4_TYPE_TCP 16 -#define AXGE_RXHDR_CRC_ERR 0x20000000 -#define AXGE_RXHDR_DROP_ERR 0x80000000 - #define GET_MII(sc) uether_getmii(&(sc)->sc_ue) /* The interrupt endpoint is currently unused by the ASIX part. */ @@ -181,6 +173,33 @@ struct axge_frame_txhdr { #define AXGE_PHY_ADDR 3 +struct axge_frame_rxhdr { + uint32_t status; +#define AXGE_RX_L4_CSUM_ERR 0x00000001 +#define AXGE_RX_L3_CSUM_ERR 0x00000002 +#define AXGE_RX_L4_TYPE_UDP 0x00000004 +#define AXGE_RX_L4_TYPE_ICMP 0x00000008 +#define AXGE_RX_L4_TYPE_IGMP 0x0000000C +#define AXGE_RX_L4_TYPE_TCP 0x00000010 +#define AXGE_RX_L4_TYPE_MASK 0x0000001C +#define AXGE_RX_L3_TYPE_IPV4 0x00000020 +#define AXGE_RX_L3_TYPE_IPV6 0x00000040 +#define AXGE_RX_L3_TYPE_MASK 0x00000060 +#define AXGE_RX_VLAN_IND_MASK 0x00000700 +#define AXGE_RX_GOOD_PKT 0x00000800 +#define AXGE_RX_VLAN_PRI_MASK 0x00007000 +#define AXGE_RX_MBCAST 0x00008000 +#define AXGE_RX_LEN_MASK 0x1FFF0000 +#define AXGE_RX_CRC_ERR 0x20000000 +#define AXGE_RX_MII_ERR 0x40000000 +#define AXGE_RX_DROP_PKT 0x80000000 +#define AXGE_RX_LEN_SHIFT 16 +} __packed; + +#define AXGE_RXBYTES(x) (((x) & AXGE_RX_LEN_MASK) >> AXGE_RX_LEN_SHIFT) +#define AXGE_RX_ERR(x) \ + ((x) & (AXGE_RX_CRC_ERR | AXGE_RX_MII_ERR | AXGE_RX_DROP_PKT)) + struct axge_softc { struct usb_ether sc_ue; struct mtx sc_mtx; From owner-svn-src-head@freebsd.org Thu Aug 18 06:35:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 096BBBBEF97; Thu, 18 Aug 2016 06:35:11 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEC13183A; Thu, 18 Aug 2016 06:35:10 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I6ZAhL030092; Thu, 18 Aug 2016 06:35:10 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I6ZAVh030091; Thu, 18 Aug 2016 06:35:10 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180635.u7I6ZAVh030091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 06:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304333 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 06:35:11 -0000 Author: yongari Date: Thu Aug 18 06:35:09 2016 New Revision: 304333 URL: https://svnweb.freebsd.org/changeset/base/304333 Log: When usbd_transfer_setup() fails, don't call usbd_transfer_unsetup(). Modified: head/sys/dev/usb/net/if_axge.c Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:29:07 2016 (r304332) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:35:09 2016 (r304333) @@ -553,7 +553,8 @@ axge_attach(device_t dev) sc->sc_xfer, axge_config, AXGE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { device_printf(dev, "allocating USB transfers failed\n"); - goto detach; + mtx_destroy(&sc->sc_mtx); + return (ENXIO); } ue->ue_sc = sc; From owner-svn-src-head@freebsd.org Thu Aug 18 06:39:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27A68BBD015; Thu, 18 Aug 2016 06:39:11 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02E0119F3; Thu, 18 Aug 2016 06:39:10 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I6dAmB030263; Thu, 18 Aug 2016 06:39:10 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I6d9op030256; Thu, 18 Aug 2016 06:39:09 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201608180639.u7I6d9op030256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 18 Aug 2016 06:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304334 - in head/lib/libc: net sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 06:39:11 -0000 Author: kevlo Date: Thu Aug 18 06:39:09 2016 New Revision: 304334 URL: https://svnweb.freebsd.org/changeset/base/304334 Log: Remove from the SYNOPSIS. Modified: head/lib/libc/net/inet_net.3 head/lib/libc/sys/bind.2 head/lib/libc/sys/connect.2 head/lib/libc/sys/listen.2 head/lib/libc/sys/recv.2 head/lib/libc/sys/send.2 head/lib/libc/sys/socket.2 Modified: head/lib/libc/net/inet_net.3 ============================================================================== --- head/lib/libc/net/inet_net.3 Thu Aug 18 06:35:09 2016 (r304333) +++ head/lib/libc/net/inet_net.3 Thu Aug 18 06:39:09 2016 (r304334) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 26, 2006 +.Dd August 18, 2016 .Dt INET_NET 3 .Os .Sh NAME @@ -42,7 +42,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .In netinet/in.h .In arpa/inet.h Modified: head/lib/libc/sys/bind.2 ============================================================================== --- head/lib/libc/sys/bind.2 Thu Aug 18 06:35:09 2016 (r304333) +++ head/lib/libc/sys/bind.2 Thu Aug 18 06:39:09 2016 (r304334) @@ -28,7 +28,7 @@ .\" @(#)bind.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 26, 2014 +.Dd August 18, 2016 .Dt BIND 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft int .Fn bind "int s" "const struct sockaddr *addr" "socklen_t addrlen" Modified: head/lib/libc/sys/connect.2 ============================================================================== --- head/lib/libc/sys/connect.2 Thu Aug 18 06:35:09 2016 (r304333) +++ head/lib/libc/sys/connect.2 Thu Aug 18 06:39:09 2016 (r304334) @@ -28,7 +28,7 @@ .\" @(#)connect.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 4, 2016 +.Dd August 18, 2016 .Dt CONNECT 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft int .Fn connect "int s" "const struct sockaddr *name" "socklen_t namelen" Modified: head/lib/libc/sys/listen.2 ============================================================================== --- head/lib/libc/sys/listen.2 Thu Aug 18 06:35:09 2016 (r304333) +++ head/lib/libc/sys/listen.2 Thu Aug 18 06:39:09 2016 (r304334) @@ -28,7 +28,7 @@ .\" From: @(#)listen.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd July 15, 2014 +.Dd August 18, 2016 .Dt LISTEN 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft int .Fn listen "int s" "int backlog" Modified: head/lib/libc/sys/recv.2 ============================================================================== --- head/lib/libc/sys/recv.2 Thu Aug 18 06:35:09 2016 (r304333) +++ head/lib/libc/sys/recv.2 Thu Aug 18 06:39:09 2016 (r304334) @@ -28,7 +28,7 @@ .\" @(#)recv.2 8.3 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd January 29, 2016 +.Dd August 18, 2016 .Dt RECV 2 .Os .Sh NAME @@ -40,7 +40,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft ssize_t .Fn recv "int s" "void *buf" "size_t len" "int flags" Modified: head/lib/libc/sys/send.2 ============================================================================== --- head/lib/libc/sys/send.2 Thu Aug 18 06:35:09 2016 (r304333) +++ head/lib/libc/sys/send.2 Thu Aug 18 06:39:09 2016 (r304334) @@ -28,7 +28,7 @@ .\" From: @(#)send.2 8.2 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd January 29, 2016 +.Dd August 18, 2016 .Dt SEND 2 .Os .Sh NAME @@ -40,7 +40,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft ssize_t .Fn send "int s" "const void *msg" "size_t len" "int flags" Modified: head/lib/libc/sys/socket.2 ============================================================================== --- head/lib/libc/sys/socket.2 Thu Aug 18 06:35:09 2016 (r304333) +++ head/lib/libc/sys/socket.2 Thu Aug 18 06:39:09 2016 (r304334) @@ -28,7 +28,7 @@ .\" From: @(#)socket.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 19, 2013 +.Dd August 18, 2016 .Dt SOCKET 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft int .Fn socket "int domain" "int type" "int protocol" From owner-svn-src-head@freebsd.org Thu Aug 18 06:46:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B780BBD420; Thu, 18 Aug 2016 06:46:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E34F11B3; Thu, 18 Aug 2016 06:46:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I6kE8H033790; Thu, 18 Aug 2016 06:46:14 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I6kE4f033789; Thu, 18 Aug 2016 06:46:14 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180646.u7I6kE4f033789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 06:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304335 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 06:46:15 -0000 Author: yongari Date: Thu Aug 18 06:46:14 2016 New Revision: 304335 URL: https://svnweb.freebsd.org/changeset/base/304335 Log: In axge_stop(), clear medium receive enable bit which will stop RX MAC operation. Modified: head/sys/dev/usb/net/if_axge.c Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:39:09 2016 (r304334) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:46:14 2016 (r304335) @@ -847,12 +847,17 @@ axge_stop(struct usb_ether *ue) { struct axge_softc *sc; struct ifnet *ifp; + uint16_t val; sc = uether_getsc(ue); ifp = uether_getifp(ue); AXGE_LOCK_ASSERT(sc, MA_OWNED); + val = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MSR); + val &= ~MSR_RE; + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MSR, val); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->sc_flags &= ~AXGE_FLAG_LINK; From owner-svn-src-head@freebsd.org Thu Aug 18 06:50:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E3FBBBD5EE; Thu, 18 Aug 2016 06:50:25 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B2CF13E0; Thu, 18 Aug 2016 06:50:25 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-226-8.lns20.per1.internode.on.net [121.45.226.8]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u7I6oEwm000886 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 17 Aug 2016 23:50:17 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd To: John Baldwin , src-committers@freebsd.org References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Julian Elischer Message-ID: <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> Date: Thu, 18 Aug 2016 14:50:08 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <2065331.KaGOSftJhd@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 06:50:25 -0000 On 16/08/2016 4:54 AM, John Baldwin wrote: > On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >> Author: jhb >> Date: Mon Aug 15 20:38:02 2016 >> New Revision: 304187 >> URL: https://svnweb.freebsd.org/changeset/base/304187 >> >> Log: >> Remove the mcd(4) driver for Mitsumi CD-ROM players. >> >> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in >> the manpage, this driver is only useful as a backend to cdcontrol to >> play audio CDs since it doesn't use DMA, so its data performance is >> "abysmal" (and that was true in the mid 90's). > No one stepped up to test patches for it either when I last posted patches to > convert it from timeout(9) to callout(9). I have a few more drivers that are > both very old and that people have no business using in 12 (think ISA > adapters that don't do DMA and can't be used with pccard) that I will be > removing over the next little while. I brought up a list of drivers on arch@ > a couple of years ago and the conversation drifted off into the weeds about > trimming GENERIC, etc. No one objected to the specific drivers I listed > though (and I got a few pleas of "please remove"). If someone shows up > desperately clutching an ISA adapter they can always dig up the source from > svn and deal with forward porting it for whatever API changes have happened > since it was removed. I would imagine any machine still holding one of these probably has not enough memory to run FreeBSD. would we still run in 2MB? > From owner-svn-src-head@freebsd.org Thu Aug 18 07:11:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC22FBBDB83; Thu, 18 Aug 2016 07:11:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC72B1D5E; Thu, 18 Aug 2016 07:11:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I7BVGY044701; Thu, 18 Aug 2016 07:11:31 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I7BVRt044700; Thu, 18 Aug 2016 07:11:31 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180711.u7I7BVRt044700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 07:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304336 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 07:11:33 -0000 Author: yongari Date: Thu Aug 18 07:11:31 2016 New Revision: 304336 URL: https://svnweb.freebsd.org/changeset/base/304336 Log: When device is detached make sure to stop the controller and make it return zero-length USB packet. Modified: head/sys/dev/usb/net/if_axge.c Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:46:14 2016 (r304335) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 07:11:31 2016 (r304336) @@ -580,9 +580,27 @@ axge_detach(device_t dev) { struct axge_softc *sc; struct usb_ether *ue; + uint16_t val; sc = device_get_softc(dev); ue = &sc->sc_ue; + if (device_is_attached(dev)) { + AXGE_LOCK(sc); + /* + * XXX + * ether_ifdetach(9) should be called first. + */ + axge_stop(ue); + /* Force bulk-in to return a zero-length USB packet. */ + val = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_EPPRCR); + val |= EPPRCR_BZ | EPPRCR_IPRL; + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_EPPRCR, val); + /* Change clock. */ + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_CLK_SELECT, 0); + /* Disable MAC. */ + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, 0); + AXGE_UNLOCK(sc); + } usbd_transfer_unsetup(sc->sc_xfer, AXGE_N_TRANSFER); uether_ifdetach(ue); mtx_destroy(&sc->sc_mtx); From owner-svn-src-head@freebsd.org Thu Aug 18 07:53:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4919DBBE7B4; Thu, 18 Aug 2016 07:53:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD9E318CC; Thu, 18 Aug 2016 07:53:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7I7rHwY063896 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 18 Aug 2016 10:53:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7I7rHwY063896 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7I7rGlP063895; Thu, 18 Aug 2016 10:53:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Aug 2016 10:53:16 +0300 From: Konstantin Belousov To: Jilles Tjoelker Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304176 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern Message-ID: <20160818075316.GW83214@kib.kiev.ua> References: <201608151908.u7FJ8phh091939@repo.freebsd.org> <20160817202040.GA21263@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160817202040.GA21263@stack.nl> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 07:53:22 -0000 On Wed, Aug 17, 2016 at 10:20:40PM +0200, Jilles Tjoelker wrote: > On Mon, Aug 15, 2016 at 07:08:51PM +0000, Konstantin Belousov wrote: > > /* ISO/IEC 9945-1: 1996 */ > > #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE > > int fsync(int); > > +int fdatasync(int); > > > > /* > > * ftruncate() was in the POSIX Realtime Extension (it's used for shared > > Apparently these functions were added closely enough in time that they > can stay together here :) Is this a form of suggestion to use other value for POSIX_VISIBLE ? > > +#if 0 > > + if (!fullsync) > > + /* XXXKIB: compete outstanding aio writes */; > > Under the _POSIX_SYNCHRONIZED_IO option, completing outstanding I/O > requests is in fact required for fsync() as well. The fdatasync() > function is completely under the _POSIX_SYNCHRONIZED_IO option. > > We do not implement this option, but keeping fdatasync()'s guarantees a > subset of fsync()'s guarantees seems sensible. I will consider this if and when the AIO flush would be implemented. I looked at the AIO code to estimate the needed work, but did not started coding and quite possible it would be postponed. > > +%% fdatasync vp L L L > > + > > +vop_fdatasync { > > + IN struct vnode *vp; > > + IN struct thread *td; > > +}; > A waitfor parameter like in vop_fsync may be useful to implement > aio_fsync(O_DSYNC) later on. I really do not see how would it be. aio_fsync(O_DSYNC) is equivalent to fdatasync(2) in the async context. Completion of the aio request indicates that virtual fdatasync(2) execution did finished in that context. The use of waitfor in the VOP_FSYNC() is to allow syncer to initiate flush without waiting, or getting notification for the completion. Could you, please, elaborate ? If the KPI change is needed there, it is obviously desirable to make it right before MFC to stable. From owner-svn-src-head@freebsd.org Thu Aug 18 08:49:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2776EBB66BE; Thu, 18 Aug 2016 08:49:03 +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 EE114151B; Thu, 18 Aug 2016 08:49:02 +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 u7I8n2aH078504; Thu, 18 Aug 2016 08:49:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I8n2jc078503; Thu, 18 Aug 2016 08:49:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608180849.u7I8n2jc078503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Aug 2016 08:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304342 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 08:49:03 -0000 Author: hselasky Date: Thu Aug 18 08:49:02 2016 New Revision: 304342 URL: https://svnweb.freebsd.org/changeset/base/304342 Log: Add support for setting blocking and non-blocking mode on /dev/rdma_cm by returning success on FIONBIO and FIOASYNC IOCTLs. The actual flags handling is done by the kern_ioctl() function. Reported by: Alex Bowden Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/core/ucma.c Modified: head/sys/ofed/drivers/infiniband/core/ucma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ucma.c Thu Aug 18 08:47:06 2016 (r304341) +++ head/sys/ofed/drivers/infiniband/core/ucma.c Thu Aug 18 08:49:02 2016 (r304342) @@ -42,6 +42,8 @@ #include #include +#include + #include #include #include @@ -1345,11 +1347,25 @@ static int ucma_close(struct inode *inod return 0; } +static long +ucma_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) +{ + + switch (cmd) { + case FIONBIO: + case FIOASYNC: + return (0); + default: + return (-ENOTTY); + } +} + static const struct file_operations ucma_fops = { .owner = THIS_MODULE, .open = ucma_open, .release = ucma_close, .write = ucma_write, + .unlocked_ioctl = ucma_ioctl, .poll = ucma_poll, .llseek = no_llseek, }; From owner-svn-src-head@freebsd.org Thu Aug 18 09:52:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6766EBBDC74; Thu, 18 Aug 2016 09:52:17 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 2F6791BB0; Thu, 18 Aug 2016 09:52:16 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 407982384; Thu, 18 Aug 2016 09:52:10 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id CB73E8F4E; Thu, 18 Aug 2016 11:50:43 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> Date: Thu, 18 Aug 2016 11:50:43 +0200 In-Reply-To: (Nathan Whitehorn's message of "Wed, 17 Aug 2016 09:30:10 -0700") Message-ID: <86fuq24d8s.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 09:52:17 -0000 Nathan Whitehorn writes: > OK. In which configurations? My Dell servers, for instance, don't do > this. How are they set up? What drivers are being used? Is this > something that affects passthrough disks, RAIDs, disk images? Most LSI MegaRAID controllers don't have real passthrough, only JBOD. You can query the drive with "camcontrol identify passX", but the controller does not report a stripe size for the volume (mfidY). > The point is that *if the reported stripe size is wrong*, more things > than partition alignment in the installer will suffer for it. It's not wrong, it's non-existent, and I'm getting really tired of repeating myself. > Fixing the installer with a bandaid in the run-up to a release is > fine, but *we need to fix the underlying problem*. We can't, because hardware sucks, and I'm getting really tired of repeating myself. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Thu Aug 18 10:18:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAC29BBE713; Thu, 18 Aug 2016 10:18:12 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B99E1D88; Thu, 18 Aug 2016 10:18:12 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAIBSx014784; Thu, 18 Aug 2016 10:18:11 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAIBnL014783; Thu, 18 Aug 2016 10:18:11 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608181018.u7IAIBnL014783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 18 Aug 2016 10:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304374 - head/usr.bin/calendar/calendars/ru_RU.UTF-8 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 10:18:12 -0000 Author: ache Date: Thu Aug 18 10:18:11 2016 New Revision: 304374 URL: https://svnweb.freebsd.org/changeset/base/304374 Log: Fix TAB replaced with spaces in prev. commit. Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan ============================================================================== --- head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Thu Aug 18 09:39:45 2016 (r304373) +++ head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Thu Aug 18 10:18:11 2016 (r304374) @@ -35,7 +35,7 @@ Paskha=ПаÑха 14 Ñент. День Волха Змеевича 22 Ñент.* Поворот к зиме (оÑеннее равноденÑтвие) 10 ноÑб. День Макоши -21 ноÑб. День Сварога и Семаргла +21 ноÑб. День Сварога и Семаргла 9 дек. День Дажьбога и Марены #endif /* !_ru_RU_UTF_8_pagan_ */ From owner-svn-src-head@freebsd.org Thu Aug 18 10:26:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DB04BBEAE6; Thu, 18 Aug 2016 10:26:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EBCF1843; Thu, 18 Aug 2016 10:26:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAQFT6018562; Thu, 18 Aug 2016 10:26:15 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAQFjG018561; Thu, 18 Aug 2016 10:26:15 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201608181026.u7IAQFjG018561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 18 Aug 2016 10:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304378 - head/sys/netpfil/ipfw/nat64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 10:26:16 -0000 Author: bz Date: Thu Aug 18 10:26:15 2016 New Revision: 304378 URL: https://svnweb.freebsd.org/changeset/base/304378 Log: Try to fix gcc compilation errors (which are right). nat64_getlasthdr() returns an int, which can be -1 in case of error, storing the result in an uint8_t and then comparing to < 0 is not helpful. Do what is done in the rest of the code and make proto an int here as well. Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64_translate.c Thu Aug 18 10:25:07 2016 (r304377) +++ head/sys/netpfil/ipfw/nat64/nat64_translate.c Thu Aug 18 10:26:15 2016 (r304378) @@ -1415,8 +1415,7 @@ nat64_do_handle_ip6(struct mbuf *m, uint struct sockaddr *dst; uint16_t *csum; uint32_t mtu; - int plen, hlen; - uint8_t proto; + int plen, hlen, proto; /* * XXX: we expect ipfw_chk() did m_pullup() up to upper level From owner-svn-src-head@freebsd.org Thu Aug 18 10:50:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEC53BBE5AA; Thu, 18 Aug 2016 10:50:42 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86F721D84; Thu, 18 Aug 2016 10:50:42 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAofRU026879; Thu, 18 Aug 2016 10:50:41 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAoeI5026862; Thu, 18 Aug 2016 10:50:40 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201608181050.u7IAoeI5026862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 18 Aug 2016 10:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304395 - in head: lib/libc/aarch64/sys lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/mips/sys lib/libc/powerpc/sys lib/libc/powerpc64/sys lib/libc/riscv/sys lib/libc/s... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 10:50:42 -0000 Author: gnn Date: Thu Aug 18 10:50:40 2016 New Revision: 304395 URL: https://svnweb.freebsd.org/changeset/base/304395 Log: Remove unusedd and obsolete openbsd_poll system call. (Phase 1) Reported by: brooks Reviewed by: brooks,jhb Differential Revision: https://reviews.freebsd.org/D7548 Modified: head/lib/libc/aarch64/sys/Makefile.inc head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/arm/sys/Makefile.inc head/lib/libc/i386/sys/Makefile.inc head/lib/libc/mips/sys/Makefile.inc head/lib/libc/powerpc/sys/Makefile.inc head/lib/libc/powerpc64/sys/Makefile.inc head/lib/libc/riscv/sys/Makefile.inc head/lib/libc/sparc64/sys/Makefile.inc head/sys/compat/freebsd32/syscalls.master head/sys/kern/capabilities.conf head/sys/kern/sys_generic.c head/sys/kern/syscalls.master head/sys/sys/param.h Modified: head/lib/libc/aarch64/sys/Makefile.inc ============================================================================== --- head/lib/libc/aarch64/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/aarch64/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -15,7 +15,6 @@ MDASM= cerror.S \ NOASM= break.o \ exit.o \ getlogin.o \ - openbsd_poll.o \ sbrk.o \ sstk.o \ vfork.o \ Modified: head/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- head/lib/libc/amd64/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/amd64/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -8,6 +8,6 @@ MDASM= vfork.S brk.S cerror.S exect.S ge sbrk.S setlogin.S sigreturn.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o +NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o PSEUDO= _getlogin.o _exit.o Modified: head/lib/libc/arm/sys/Makefile.inc ============================================================================== --- head/lib/libc/arm/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/arm/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -5,6 +5,6 @@ SRCS+= __vdso_gettc.c MDASM= Ovfork.S brk.S cerror.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o +NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o PSEUDO= _exit.o _getlogin.o Modified: head/lib/libc/i386/sys/Makefile.inc ============================================================================== --- head/lib/libc/i386/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/i386/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -11,7 +11,7 @@ MDASM= Ovfork.S brk.S cerror.S exect.S g sbrk.S setlogin.S sigreturn.S syscall.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o +NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o PSEUDO= _getlogin.o _exit.o Modified: head/lib/libc/mips/sys/Makefile.inc ============================================================================== --- head/lib/libc/mips/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/mips/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -6,6 +6,6 @@ MDASM= Ovfork.S brk.S cerror.S exect.S ptrace.S sbrk.S syscall.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o +NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o PSEUDO= _exit.o _getlogin.o Modified: head/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/powerpc/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -3,6 +3,6 @@ MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o +NOASM= break.o exit.o getlogin.o sstk.o yield.o PSEUDO= _getlogin.o _exit.o Modified: head/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc64/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/powerpc64/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -3,6 +3,6 @@ MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o +NOASM= break.o exit.o getlogin.o sstk.o yield.o PSEUDO= _getlogin.o _exit.o Modified: head/lib/libc/riscv/sys/Makefile.inc ============================================================================== --- head/lib/libc/riscv/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/riscv/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -13,7 +13,6 @@ MDASM= cerror.S \ NOASM= break.o \ exit.o \ getlogin.o \ - openbsd_poll.o \ sbrk.o \ sstk.o \ vfork.o \ Modified: head/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/sparc64/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -15,6 +15,6 @@ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S sigaction1.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o +NOASM= break.o exit.o getlogin.o sstk.o yield.o PSEUDO= _getlogin.o _exit.o Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Thu Aug 18 10:50:27 2016 (r304394) +++ head/sys/compat/freebsd32/syscalls.master Thu Aug 18 10:50:40 2016 (r304395) @@ -474,8 +474,7 @@ 250 AUE_MINHERIT NOPROTO { int minherit(void *addr, size_t len, \ int inherit); } 251 AUE_RFORK NOPROTO { int rfork(int flags); } -252 AUE_POLL NOPROTO { int openbsd_poll(struct pollfd *fds, \ - u_int nfds, int timeout); } +252 AUE_NULL OBSOL openbsd_poll 253 AUE_ISSETUGID NOPROTO { int issetugid(void); } 254 AUE_LCHOWN NOPROTO { int lchown(char *path, int uid, int gid); } 255 AUE_NULL STD { int freebsd32_aio_read( \ Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Thu Aug 18 10:50:27 2016 (r304394) +++ head/sys/kern/capabilities.conf Thu Aug 18 10:50:40 2016 (r304395) @@ -463,14 +463,6 @@ utimensat open ## -## Allow poll(2), which will be scoped by capability rights. -## -## XXXRW: Perhaps we don't need the OpenBSD version? -## XXXRW: We don't yet do that scoping. -## -openbsd_poll - -## ## Process descriptor-related system calls are allowed. ## pdfork Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Thu Aug 18 10:50:27 2016 (r304394) +++ head/sys/kern/sys_generic.c Thu Aug 18 10:50:40 2016 (r304395) @@ -1608,26 +1608,6 @@ pollscan(td, fds, nfd) } /* - * OpenBSD poll system call. - * - * XXX this isn't quite a true representation.. OpenBSD uses select ops. - */ -#ifndef _SYS_SYSPROTO_H_ -struct openbsd_poll_args { - struct pollfd *fds; - u_int nfds; - int timeout; -}; -#endif -int -sys_openbsd_poll(td, uap) - register struct thread *td; - register struct openbsd_poll_args *uap; -{ - return (sys_poll(td, (struct poll_args *)uap)); -} - -/* * XXX This was created specifically to support netncp and netsmb. This * allows the caller to specify a socket to wait for events on. It returns * 0 if any events matched and an error otherwise. There is no way to Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Thu Aug 18 10:50:27 2016 (r304394) +++ head/sys/kern/syscalls.master Thu Aug 18 10:50:40 2016 (r304395) @@ -472,8 +472,7 @@ 250 AUE_MINHERIT STD { int minherit(void *addr, size_t len, \ int inherit); } 251 AUE_RFORK STD { int rfork(int flags); } -252 AUE_POLL STD { int openbsd_poll(struct pollfd *fds, \ - u_int nfds, int timeout); } +252 AUE_NULL OBSOL openbsd_poll 253 AUE_ISSETUGID STD { int issetugid(void); } 254 AUE_LCHOWN STD { int lchown(char *path, int uid, int gid); } 255 AUE_NULL STD { int aio_read(struct aiocb *aiocbp); } Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Aug 18 10:50:27 2016 (r304394) +++ head/sys/sys/param.h Thu Aug 18 10:50:40 2016 (r304395) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200001 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200002 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Thu Aug 18 10:54:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A32D2BBE9C2; Thu, 18 Aug 2016 10:54:41 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7535F1BB4; Thu, 18 Aug 2016 10:54:41 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAseRv030823; Thu, 18 Aug 2016 10:54:40 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAsd6j030811; Thu, 18 Aug 2016 10:54:39 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201608181054.u7IAsd6j030811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 18 Aug 2016 10:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304402 - in head: . sys/compat/freebsd32 sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 10:54:41 -0000 Author: gnn Date: Thu Aug 18 10:54:39 2016 New Revision: 304402 URL: https://svnweb.freebsd.org/changeset/base/304402 Log: Remove the obsolete and unused openbsd_poll system call. (Phase 2) Reported by: brooks Reviewed by: brooks, jhb Differential Revision: https://reviews.freebsd.org/D7548 Modified: head/UPDATING head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Aug 18 10:54:21 2016 (r304401) +++ head/UPDATING Thu Aug 18 10:54:39 2016 (r304402) @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160818: + Remove the openbsd_poll system call. + __FreeBSD_version has been bumped because of this. + 20160622: The libc stub for the pipe(2) system call has been replaced with a wrapper that calls the pipe2(2) system call and the pipe(2) Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ #define FREEBSD32_SYS_syscall 0 @@ -218,7 +218,7 @@ #define FREEBSD32_SYS_freebsd32_clock_getcpuclockid2 247 #define FREEBSD32_SYS_minherit 250 #define FREEBSD32_SYS_rfork 251 -#define FREEBSD32_SYS_openbsd_poll 252 + /* 252 is obsolete openbsd_poll */ #define FREEBSD32_SYS_issetugid 253 #define FREEBSD32_SYS_lchown 254 #define FREEBSD32_SYS_freebsd32_aio_read 255 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ const char *freebsd32_syscallnames[] = { @@ -262,7 +262,7 @@ const char *freebsd32_syscallnames[] = { "#249", /* 249 = nosys */ "minherit", /* 250 = minherit */ "rfork", /* 251 = rfork */ - "openbsd_poll", /* 252 = openbsd_poll */ + "obs_openbsd_poll", /* 252 = obsolete openbsd_poll */ "issetugid", /* 253 = issetugid */ "lchown", /* 254 = lchown */ "freebsd32_aio_read", /* 255 = freebsd32_aio_read */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ #include "opt_compat.h" @@ -305,7 +305,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 249 = nosys */ { AS(minherit_args), (sy_call_t *)sys_minherit, AUE_MINHERIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = minherit */ { AS(rfork_args), (sy_call_t *)sys_rfork, AUE_RFORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 251 = rfork */ - { AS(openbsd_poll_args), (sy_call_t *)sys_openbsd_poll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 252 = openbsd_poll */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 252 = obsolete openbsd_poll */ { 0, (sy_call_t *)sys_issetugid, AUE_ISSETUGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 253 = issetugid */ { AS(lchown_args), (sy_call_t *)sys_lchown, AUE_LCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = lchown */ { AS(freebsd32_aio_read_args), (sy_call_t *)freebsd32_aio_read, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 255 = freebsd32_aio_read */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 18 10:54:39 2016 (r304402) @@ -1286,15 +1286,6 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } - /* openbsd_poll */ - case 252: { - struct openbsd_poll_args *p = params; - uarg[0] = (intptr_t) p->fds; /* struct pollfd * */ - uarg[1] = p->nfds; /* u_int */ - iarg[2] = p->timeout; /* int */ - *n_args = 3; - break; - } /* issetugid */ case 253: { *n_args = 0; @@ -5357,22 +5348,6 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* openbsd_poll */ - case 252: - switch(ndx) { - case 0: - p = "struct pollfd *"; - break; - case 1: - p = "u_int"; - break; - case 2: - p = "int"; - break; - default: - break; - }; - break; /* issetugid */ case 253: break; @@ -9666,11 +9641,6 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* openbsd_poll */ - case 252: - if (ndx == 0 || ndx == 1) - p = "int"; - break; /* issetugid */ case 253: /* lchown */ Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/kern/init_sysent.c Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/kern/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ #include "opt_compat.h" @@ -298,7 +298,7 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 249 = nosys */ { AS(minherit_args), (sy_call_t *)sys_minherit, AUE_MINHERIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 250 = minherit */ { AS(rfork_args), (sy_call_t *)sys_rfork, AUE_RFORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 251 = rfork */ - { AS(openbsd_poll_args), (sy_call_t *)sys_openbsd_poll, AUE_POLL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 252 = openbsd_poll */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 252 = obsolete openbsd_poll */ { 0, (sy_call_t *)sys_issetugid, AUE_ISSETUGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 253 = issetugid */ { AS(lchown_args), (sy_call_t *)sys_lchown, AUE_LCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = lchown */ { AS(aio_read_args), (sy_call_t *)sys_aio_read, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 255 = aio_read */ Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/kern/syscalls.c Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/kern/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ const char *syscallnames[] = { @@ -259,7 +259,7 @@ const char *syscallnames[] = { "#249", /* 249 = nosys */ "minherit", /* 250 = minherit */ "rfork", /* 251 = rfork */ - "openbsd_poll", /* 252 = openbsd_poll */ + "obs_openbsd_poll", /* 252 = obsolete openbsd_poll */ "issetugid", /* 253 = issetugid */ "lchown", /* 254 = lchown */ "aio_read", /* 255 = aio_read */ Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/kern/systrace_args.c Thu Aug 18 10:54:39 2016 (r304402) @@ -1322,15 +1322,6 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } - /* openbsd_poll */ - case 252: { - struct openbsd_poll_args *p = params; - uarg[0] = (intptr_t) p->fds; /* struct pollfd * */ - uarg[1] = p->nfds; /* u_int */ - iarg[2] = p->timeout; /* int */ - *n_args = 3; - break; - } /* issetugid */ case 253: { *n_args = 0; @@ -5426,22 +5417,6 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* openbsd_poll */ - case 252: - switch(ndx) { - case 0: - p = "struct pollfd *"; - break; - case 1: - p = "u_int"; - break; - case 2: - p = "int"; - break; - default: - break; - }; - break; /* issetugid */ case 253: break; @@ -9648,11 +9623,6 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* openbsd_poll */ - case 252: - if (ndx == 0 || ndx == 1) - p = "int"; - break; /* issetugid */ case 253: /* lchown */ Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/sys/syscall.h Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/kern/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ #define SYS_syscall 0 @@ -223,7 +223,7 @@ #define SYS_ntp_gettime 248 #define SYS_minherit 250 #define SYS_rfork 251 -#define SYS_openbsd_poll 252 + /* 252 is obsolete openbsd_poll */ #define SYS_issetugid 253 #define SYS_lchown 254 #define SYS_aio_read 255 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/sys/syscall.mk Thu Aug 18 10:54:39 2016 (r304402) @@ -1,7 +1,7 @@ # FreeBSD system call object files. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib +# created from FreeBSD: head/sys/kern/syscalls.master 304395 2016-08-18 10:50:40Z gnn MIASM = \ syscall.o \ exit.o \ @@ -163,7 +163,6 @@ MIASM = \ ntp_gettime.o \ minherit.o \ rfork.o \ - openbsd_poll.o \ issetugid.o \ lchown.o \ aio_read.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/sys/sysproto.h Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/kern/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ #ifndef _SYS_SYSPROTO_H_ @@ -714,11 +714,6 @@ struct minherit_args { struct rfork_args { char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; -struct openbsd_poll_args { - char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)]; - char nfds_l_[PADL_(u_int)]; u_int nfds; char nfds_r_[PADR_(u_int)]; - char timeout_l_[PADL_(int)]; int timeout; char timeout_r_[PADR_(int)]; -}; struct issetugid_args { register_t dummy; }; @@ -1946,7 +1941,6 @@ int sys_clock_getcpuclockid2(struct thre int sys_ntp_gettime(struct thread *, struct ntp_gettime_args *); int sys_minherit(struct thread *, struct minherit_args *); int sys_rfork(struct thread *, struct rfork_args *); -int sys_openbsd_poll(struct thread *, struct openbsd_poll_args *); int sys_issetugid(struct thread *, struct issetugid_args *); int sys_lchown(struct thread *, struct lchown_args *); int sys_aio_read(struct thread *, struct aio_read_args *); @@ -2717,7 +2711,6 @@ int freebsd10_pipe(struct thread *, stru #define SYS_AUE_ntp_gettime AUE_NULL #define SYS_AUE_minherit AUE_MINHERIT #define SYS_AUE_rfork AUE_RFORK -#define SYS_AUE_openbsd_poll AUE_POLL #define SYS_AUE_issetugid AUE_ISSETUGID #define SYS_AUE_lchown AUE_LCHOWN #define SYS_AUE_aio_read AUE_NULL From owner-svn-src-head@freebsd.org Thu Aug 18 12:56:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8295EBBD8C2; Thu, 18 Aug 2016 12:56:59 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 627F51C26; Thu, 18 Aug 2016 12:56:58 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from T530-Allan.ScaleEngine.net (unknown [37.205.61.203]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id C13F81B32; Thu, 18 Aug 2016 12:56:56 +0000 (UTC) Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , Nathan Whitehorn References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Allan Jude Message-ID: <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> Date: Thu, 18 Aug 2016 08:56:55 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <86fuq24d8s.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 12:56:59 -0000 On 08/18/16 05:50 AM, Dag-Erling Smørgrav wrote: > Nathan Whitehorn writes: >> OK. In which configurations? My Dell servers, for instance, don't do >> this. How are they set up? What drivers are being used? Is this >> something that affects passthrough disks, RAIDs, disk images? > > Most LSI MegaRAID controllers don't have real passthrough, only JBOD. > You can query the drive with "camcontrol identify passX", but the > controller does not report a stripe size for the volume (mfidY). > >> The point is that *if the reported stripe size is wrong*, more things >> than partition alignment in the installer will suffer for it. > > It's not wrong, it's non-existent, and I'm getting really tired of > repeating myself. > >> Fixing the installer with a bandaid in the run-up to a release is >> fine, but *we need to fix the underlying problem*. > > We can't, because hardware sucks, and I'm getting really tired of > repeating myself. > > DES > Which makes more sense: A) If stripesize == 0, use some sane value like 4096 B) Some other combination that uses the reported stripe size, unless it is 0, in which case it uses 4096 (or some other value controlled by a different new sysctl) C) create kern.geom.min_stripe_size with a default of 512, but users can set 4096 if they use only 4k devices. (doesn't really solve the problem for the installer) -- Allan Jude From owner-svn-src-head@freebsd.org Thu Aug 18 13:23:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3858BBDEE9; Thu, 18 Aug 2016 13:23:42 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FDFC1C06; Thu, 18 Aug 2016 13:23:42 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1baNIJ-000AlV-1x; Thu, 18 Aug 2016 16:23:39 +0300 Date: Thu, 18 Aug 2016 16:23:39 +0300 From: Slawa Olhovchenkov To: Allan Jude Cc: Dag-Erling =?utf-8?B?U23DuHJncmF2?= , Nathan Whitehorn , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit Message-ID: <20160818132338.GN22212@zxy.spb.ru> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 13:23:43 -0000 On Thu, Aug 18, 2016 at 08:56:55AM -0400, Allan Jude wrote: > A) If stripesize == 0, use some sane value like 4096 > > B) Some other combination that uses the reported stripe size, unless it > is 0, in which case it uses 4096 (or some other value controlled by a > different new sysctl) > > C) create kern.geom.min_stripe_size with a default of 512, but users can > set 4096 if they use only 4k devices. (doesn't really solve the problem > for the installer) As I am already pointed default mus be 4096, user can reduce to 512 (or 256/128). From owner-svn-src-head@freebsd.org Thu Aug 18 15:02:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 169B0BBDD47; Thu, 18 Aug 2016 15:02:44 +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 0130117C3; Thu, 18 Aug 2016 15:02:43 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7IF2cNI031156 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 18 Aug 2016 08:02:39 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: <544c64f4-693a-c5bc-1fb2-e696589583b3@freebsd.org> Date: Thu, 18 Aug 2016 08:02:38 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <86fuq24d8s.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVZiw3lp/x93PsK+cJvbsJ38gzyLnyx5VDHwJa7dJAXKcGFy+krTGExz0+ktgYwTSfI5BntWbKSgUfvXHyeN6s/fC1a8sPA+GQo= X-Sonic-ID: C;nHnUzVRl5hG3q6/hcgQksw== M;imYmzlRl5hG3q6/hcgQksw== 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.22 Precedence: list List-Id: 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, 18 Aug 2016 15:02:44 -0000 On 08/18/16 02:50, Dag-Erling Smørgrav wrote: > Nathan Whitehorn writes: >> OK. In which configurations? My Dell servers, for instance, don't do >> this. How are they set up? What drivers are being used? Is this >> something that affects passthrough disks, RAIDs, disk images? > Most LSI MegaRAID controllers don't have real passthrough, only JBOD. > You can query the drive with "camcontrol identify passX", but the > controller does not report a stripe size for the volume (mfidY). OK, so it's mfid. That's good to know. > >> The point is that *if the reported stripe size is wrong*, more things >> than partition alignment in the installer will suffer for it. > It's not wrong, it's non-existent, and I'm getting really tired of > repeating myself. For some drivers, this interface is not implemented. This is a bug, which should be fixed. > >> Fixing the installer with a bandaid in the run-up to a release is >> fine, but *we need to fix the underlying problem*. > We can't, because hardware sucks, and I'm getting really tired of > repeating myself. > > DES As am I. Here's the point: We have a mechanism (GEOM stripe size) for drivers to supply a default alignment to userland. If we think we can get that right, great. If we don't think we can get it right, the default system policy in the absence of real information from drivers should be modified to report a number that we think is more likely to be safe than the current defaults (the logical sector size, usually 512 bytes) and potentially tunable by the user. Hacking the userland tools one-by-one to impose their own default policies to override the systemwide one is, while a perfectly valid stopgap right before a release, a ridiculous long-term solution. Do you disagree with any of that? -Nathan From owner-svn-src-head@freebsd.org Thu Aug 18 15:13:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B04CEBBDFBE; Thu, 18 Aug 2016 15:13:36 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 6A8C41E99; Thu, 18 Aug 2016 15:13:35 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 899096741; Thu, 18 Aug 2016 15:13:34 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 31DCA8F76; Thu, 18 Aug 2016 17:12:08 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <544c64f4-693a-c5bc-1fb2-e696589583b3@freebsd.org> Date: Thu, 18 Aug 2016 17:12:08 +0200 In-Reply-To: <544c64f4-693a-c5bc-1fb2-e696589583b3@freebsd.org> (Nathan Whitehorn's message of "Thu, 18 Aug 2016 08:02:38 -0700") Message-ID: <867fbe3yd3.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 15:13:36 -0000 Nathan Whitehorn writes: > We have a mechanism (GEOM stripe size) for drivers to supply a default > alignment to userland. If we think we can get that right, great. If we > don't think we can get it right, the default system policy in the > absence of real information from drivers should be modified to report > a number that we think is more likely to be safe than the current > defaults (the logical sector size, usually 512 bytes) and potentially > tunable by the user. Hacking the userland tools one-by-one to impose > their own default policies to override the systemwide one is, while a > perfectly valid stopgap right before a release, a ridiculous long-term > solution. Do you disagree with any of that? I'll tell you whether I agree or disagree when you stop putting words in my mouth. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Thu Aug 18 15:42:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB77ABBE6CD; Thu, 18 Aug 2016 15:42:19 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 954F41CFF; Thu, 18 Aug 2016 15:42:19 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7IFg8mv013316 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 18 Aug 2016 08:42:09 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Allan Jude , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: <97b0baf3-94f6-2572-65c8-4cb614448307@freebsd.org> Date: Thu, 18 Aug 2016 08:42:08 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVaEMksO9UNn/zdRmusFPb5n2JLyxE45Vtn1taEGnBhqA4pG9fJIs/WE1tCPayWSqvngIS7eOaoPxNPBhgIg9YEOqZD8n/OK0zo= X-Sonic-ID: C;RI1rUlpl5hGwT6Dx2xNB0g== M;nh7LUlpl5hGwT6Dx2xNB0g== 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.22 Precedence: list List-Id: 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, 18 Aug 2016 15:42:19 -0000 On 08/18/16 05:56, Allan Jude wrote: > On 08/18/16 05:50 AM, Dag-Erling Smørgrav wrote: >> Nathan Whitehorn writes: >>> OK. In which configurations? My Dell servers, for instance, don't do >>> this. How are they set up? What drivers are being used? Is this >>> something that affects passthrough disks, RAIDs, disk images? >> Most LSI MegaRAID controllers don't have real passthrough, only JBOD. >> You can query the drive with "camcontrol identify passX", but the >> controller does not report a stripe size for the volume (mfidY). >> >>> The point is that *if the reported stripe size is wrong*, more things >>> than partition alignment in the installer will suffer for it. >> It's not wrong, it's non-existent, and I'm getting really tired of >> repeating myself. >> >>> Fixing the installer with a bandaid in the run-up to a release is >>> fine, but *we need to fix the underlying problem*. >> We can't, because hardware sucks, and I'm getting really tired of >> repeating myself. >> >> DES >> > Which makes more sense: > > A) If stripesize == 0, use some sane value like 4096 > > B) Some other combination that uses the reported stripe size, unless it > is 0, in which case it uses 4096 (or some other value controlled by a > different new sysctl) > > C) create kern.geom.min_stripe_size with a default of 512, but users can > set 4096 if they use only 4k devices. (doesn't really solve the problem > for the installer) I think "B" does what we want here best, but any of these approaches would work well. -Nathan From owner-svn-src-head@freebsd.org Thu Aug 18 16:22:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 503DBBBE154; Thu, 18 Aug 2016 16:22:41 +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 23460130D; Thu, 18 Aug 2016 16:22:41 +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 u7IGMena055856; Thu, 18 Aug 2016 16:22:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IGMeoq055855; Thu, 18 Aug 2016 16:22:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608181622.u7IGMeoq055855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 18 Aug 2016 16:22:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304430 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 16:22:41 -0000 Author: emaste Date: Thu Aug 18 16:22:40 2016 New Revision: 304430 URL: https://svnweb.freebsd.org/changeset/base/304430 Log: vt: fix old keyboard release in CONS_SETKBD On the first switch we previously released the newly allocated keyboard instead of the old one. Keyboard state was very confused afterwards for further keyboard switches. Submitted by: bde Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu Aug 18 14:10:36 2016 (r304429) +++ head/sys/dev/vt/vt_core.c Thu Aug 18 16:22:40 2016 (r304430) @@ -2359,6 +2359,7 @@ skip_thunk: (void *)vd, vt_kbdevent, vd); if (i >= 0) { if (vd->vd_keyboard != -1) { + kbd = kbd_get_keyboard(vd->vd_keyboard); vt_save_kbd_state(vd->vd_curwindow, kbd); kbd_release(kbd, (void *)vd); } From owner-svn-src-head@freebsd.org Thu Aug 18 16:44:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9414BBBE6C9; Thu, 18 Aug 2016 16:44:45 +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 22B901D48; Thu, 18 Aug 2016 16:44:43 +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 1E43A25D38A5; Thu, 18 Aug 2016 16:44:35 +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 3C164D1F8E3; Thu, 18 Aug 2016 16:44:34 +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 ArOOsJTTbGLe; Thu, 18 Aug 2016 16:44:31 +0000 (UTC) Received: from [10.248.105.13] (fresh-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4920:2ef0:eeff:fe03:ee34]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 0D219D1F890; Thu, 18 Aug 2016 16:44:30 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Pyun YongHyeon" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304326 - head/sys/dev/usb/net Date: Thu, 18 Aug 2016 16:44:29 +0000 Message-ID: In-Reply-To: <201608180507.u7I572ZI096519@repo.freebsd.org> References: <201608180507.u7I572ZI096519@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Mailer: MailMate (2.0BETAr6051) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 16:44:45 -0000 On 18 Aug 2016, at 5:07, Pyun YongHyeon wrote: > Author: yongari > Date: Thu Aug 18 05:07:02 2016 > New Revision: 304326 > URL: https://svnweb.freebsd.org/changeset/base/304326 > > Log: > Switch to TX header format rather than directly manipulating header > structures. This simplifies mbuf copy operation to USB buffers as > well as improving readability. The controller supports Microsoft > LSOv1(aka TSO) but this change set does not include the support due > to copying overhead to USB buffers and large amount of memory waste. > > Remove useless ZLP padding which seems to come from Linux. Required > bits the code tried to set was not copied into USB buffer so it had > no effect. Unlike Linux, FreeBSD USB stack automatically generates > ZLP so no explicit padding is required in driver.[1] > > Micro-optimize updating IFCOUNTER_OPACKETS counter by moving it out > of TX loop since updating counter is not cheap operation as it did > long time ago and we already know how many number of packets were > queued after exiting the loop. > > While here, fix a checksum offloading bug which will happen when > upper stack computes checksum while H/W checksum offloading is > active. The controller should be notified to not recompute the > checksum in this case. > > Reviewed by: kevlo (initial version), hselasky > Pointed out by: hselasky [1] > > Modified: > head/sys/dev/usb/net/if_axge.c > head/sys/dev/usb/net/if_axgereg.h > > Modified: head/sys/dev/usb/net/if_axge.c > ============================================================================== > --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 04:25:17 2016 (r304325) > +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 05:07:02 2016 (r304326) > @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -144,8 +145,8 @@ static const struct usb_config axge_conf > .type = UE_BULK, > .endpoint = UE_ADDR_ANY, > .direction = UE_DIR_OUT, > - .frames = 16, > - .bufsize = 16 * MCLBYTES, > + .frames = AXGE_N_FRAMES, > + .bufsize = AXGE_N_FRAMES * MCLBYTES, > .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, > .callback = axge_bulk_write_callback, > .timeout = 10000, /* 10 seconds */ > @@ -630,7 +631,7 @@ axge_bulk_write_callback(struct usb_xfer > struct ifnet *ifp; > struct usb_page_cache *pc; > struct mbuf *m; > - uint32_t txhdr; > + struct axge_frame_txhdr txhdr; > int nframes, pos; > > sc = usbd_xfer_softc(xfer); > @@ -651,36 +652,25 @@ tr_setup: > return; > } > > - for (nframes = 0; nframes < 16 && > + for (nframes = 0; nframes < AXGE_N_FRAMES && > !IFQ_DRV_IS_EMPTY(&ifp->if_snd); nframes++) { > IFQ_DRV_DEQUEUE(&ifp->if_snd, m); > if (m == NULL) > break; > usbd_xfer_set_frame_offset(xfer, nframes * MCLBYTES, > - nframes); > - pos = 0; > + nframes); > pc = usbd_xfer_get_frame(xfer, nframes); > - txhdr = htole32(m->m_pkthdr.len); > - usbd_copy_in(pc, 0, &txhdr, sizeof(txhdr)); > - txhdr = 0; > - txhdr = htole32(txhdr); > - usbd_copy_in(pc, 4, &txhdr, sizeof(txhdr)); > - pos += 8; > + txhdr.mss = 0; > + txhdr.len = htole32(AXGE_TXBYTES(m->m_pkthdr.len)); > + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0 && > + (m->m_pkthdr.csum_flags & AXGE_CSUM_FEATURES) == 0) > + txhdr.len |= htole32(AXGE_CSUM_DISABLE); > + > + pos = 0; > + usbd_copy_in(pc, pos, &txhdr, sizeof(txhdr)); > + pos += sizeof(txhdr); > usbd_m_copy_in(pc, pos, m, 0, m->m_pkthdr.len); > pos += m->m_pkthdr.len; > - if ((pos % usbd_xfer_max_framelen(xfer)) == 0) > - txhdr |= 0x80008000; > - > - /* > - * XXX > - * Update TX packet counter here. This is not > - * correct way but it seems that there is no way > - * to know how many packets are sent at the end > - * of transfer because controller combines > - * multiple writes into single one if there is > - * room in TX buffer of controller. > - */ > - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); > > /* > * if there's a BPF listener, bounce a copy > @@ -694,6 +684,16 @@ tr_setup: > usbd_xfer_set_frame_len(xfer, nframes, pos); > } > if (nframes != 0) { > + /* > + * XXX > + * Update TX packet counter here. This is not > + * correct way but it seems that there is no way > + * to know how many packets are sent at the end > + * of transfer because controller combines > + * multiple writes into single one if there is > + * room in TX buffer of controller. > + */ > + if_inc_counter(ifp, IFCOUNTER_OPACKETS, nframes); > usbd_xfer_set_frames(xfer, nframes); > usbd_transfer_submit(xfer); > ifp->if_drv_flags |= IFF_DRV_OACTIVE; > > Modified: head/sys/dev/usb/net/if_axgereg.h > ============================================================================== > --- head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 04:25:17 > 2016 (r304325) > +++ head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 05:07:02 > 2016 (r304326) > @@ -159,6 +159,26 @@ enum { > AXGE_N_TRANSFER, > }; > > +#define AXGE_N_FRAMES 16 > + > +struct axge_frame_txhdr { > +#if BYTE_ORDER == LITTLE_ENDIAN > + uint32_t len; > +#define AXGE_TXLEN_MASK 0x0001FFFF > +#define AXGE_VLAN_INSERT 0x20000000 > +#define AXGE_CSUM_DISABLE 0x80000000 > + uint32_t mss; > +#define AXGE_MSS_MASK 0x00003FFF > +#define AXGE_PADDING 0x80008000 > +#define AXGE_VLAN_TAG_MASK 0xFFFF0000 > +#else > + uint32_t mss; > + uint32_t len; > +#endif > +} __packed; > + > +#define AXGE_TXBYTES(x) ((x) & AXGE_TXLEN_MASK) AXGE_TXLEN_MASK is only defined for LITTLE_ENDIAN and thus breaks builds on others. AXGE_CSUM_DISABLE as well .. > + > #define AXGE_PHY_ADDR 3 > > struct axge_softc { > From owner-svn-src-head@freebsd.org Thu Aug 18 17:28:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18C2DBBE53D; Thu, 18 Aug 2016 17:28:00 +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 C552619B4; Thu, 18 Aug 2016 17:27:59 +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 u7IHRxQO078722; Thu, 18 Aug 2016 17:27:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IHRxZf078721; Thu, 18 Aug 2016 17:27:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608181727.u7IHRxZf078721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 18 Aug 2016 17:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304431 - head/cddl/contrib/opensolaris/cmd/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 17:28:00 -0000 Author: markj Date: Thu Aug 18 17:27:58 2016 New Revision: 304431 URL: https://svnweb.freebsd.org/changeset/base/304431 Log: Add a SIGINFO handler for dtrace(1). Have it print the contents of aggregations, if any. Otherwise, one needs to kill the running script to view the collected data, or add code to periodically print it. Discussed with: gnn MFC after: 1 month Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Thu Aug 18 16:22:40 2016 (r304430) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Thu Aug 18 17:27:58 2016 (r304431) @@ -93,6 +93,9 @@ static int g_flowindent; static int g_intr; static int g_impatient; static int g_newline; +#ifdef __FreeBSD__ +static int g_siginfo; +#endif static int g_total; static int g_cflags; static int g_oflags; @@ -1260,6 +1263,16 @@ intr(int signo) g_impatient = 1; } +#ifdef __FreeBSD__ +static void +siginfo(int signo __unused) +{ + + g_siginfo++; + g_newline = 1; +} +#endif + static void installsighands(void) { @@ -1275,12 +1288,16 @@ installsighands(void) if (sigaction(SIGTERM, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) (void) sigaction(SIGTERM, &act, NULL); -#ifndef illumos +#ifdef __FreeBSD__ if (sigaction(SIGPIPE, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) (void) sigaction(SIGPIPE, &act, NULL); if (sigaction(SIGUSR1, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) (void) sigaction(SIGUSR1, &act, NULL); + + act.sa_handler = siginfo; + if (sigaction(SIGINFO, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) + (void) sigaction(SIGINFO, &act, NULL); #endif } @@ -1944,6 +1961,13 @@ main(int argc, char *argv[]) if (!g_intr && !done) dtrace_sleep(g_dtp); +#ifdef __FreeBSD__ + if (g_siginfo) { + (void)dtrace_aggregate_print(g_dtp, g_ofp, NULL); + g_siginfo = 0; + } +#endif + if (g_newline) { /* * Output a newline just to make the output look From owner-svn-src-head@freebsd.org Thu Aug 18 18:35:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D59BBBE321; Thu, 18 Aug 2016 18:35:25 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5D21A3D; Thu, 18 Aug 2016 18:35:24 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7IIZISQ008154 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 18 Aug 2016 11:35:19 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <544c64f4-693a-c5bc-1fb2-e696589583b3@freebsd.org> <867fbe3yd3.fsf@desk.des.no> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: <4d097835-66ce-72b6-c774-a87e38d88625@freebsd.org> Date: Thu, 18 Aug 2016 11:35:18 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <867fbe3yd3.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVY+PfC1Zk3fvRZt5VHY2S2InuksnGWzfztin2dMLgz9BcMgUM/UW6wRlOr8+w2xCoN8RuxLFXUncP+NebpMRweg0QILodJ8QZk= X-Sonic-ID: C;mOmZg3Jl5hGzSaDx2xNB0g== M;ND3mg3Jl5hGzSaDx2xNB0g== 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.22 Precedence: list List-Id: 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, 18 Aug 2016 18:35:25 -0000 On 08/18/16 08:12, Dag-Erling Smørgrav wrote: > Nathan Whitehorn writes: >> We have a mechanism (GEOM stripe size) for drivers to supply a default >> alignment to userland. If we think we can get that right, great. If we >> don't think we can get it right, the default system policy in the >> absence of real information from drivers should be modified to report >> a number that we think is more likely to be safe than the current >> defaults (the logical sector size, usually 512 bytes) and potentially >> tunable by the user. Hacking the userland tools one-by-one to impose >> their own default policies to override the systemwide one is, while a >> perfectly valid stopgap right before a release, a ridiculous long-term >> solution. Do you disagree with any of that? > I'll tell you whether I agree or disagree when you stop putting words in > my mouth. > > DES This is ridiculous. I've asked a series of technical questions about generalizing a patch you made and that I think is a good idea. In response, those questions have been met with a non-stop torrent of insults and abuse instead of answers, with only one eventual nugget of information in response to one of them -- that you ran into problems with mfid -- to redeem it. I'm done with this discussion. Hopefully we can have a real conversation about this at this some point after the release. -Nathan From owner-svn-src-head@freebsd.org Thu Aug 18 21:39:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA62ABBFB40; Thu, 18 Aug 2016 21:39:45 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 94FD61531; Thu, 18 Aug 2016 21:39:45 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 8F008358C5F; Thu, 18 Aug 2016 23:39:42 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 48E8228494; Thu, 18 Aug 2016 23:39:42 +0200 (CEST) Date: Thu, 18 Aug 2016 23:39:42 +0200 From: Jilles Tjoelker To: Konstantin Belousov Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304176 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern Message-ID: <20160818213941.GA1539@stack.nl> References: <201608151908.u7FJ8phh091939@repo.freebsd.org> <20160817202040.GA21263@stack.nl> <20160818075316.GW83214@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160818075316.GW83214@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 21:39:45 -0000 On Thu, Aug 18, 2016 at 10:53:16AM +0300, Konstantin Belousov wrote: > On Wed, Aug 17, 2016 at 10:20:40PM +0200, Jilles Tjoelker wrote: > > On Mon, Aug 15, 2016 at 07:08:51PM +0000, Konstantin Belousov wrote: > > > /* ISO/IEC 9945-1: 1996 */ > > > #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE > > > int fsync(int); > > > +int fdatasync(int); > > > > > > /* > > > * ftruncate() was in the POSIX Realtime Extension (it's used for shared > > Apparently these functions were added closely enough in time that they > > can stay together here :) > Is this a form of suggestion to use other value for POSIX_VISIBLE ? No, no change is necessary. > > > +#if 0 > > > + if (!fullsync) > > > + /* XXXKIB: compete outstanding aio writes */; > > Under the _POSIX_SYNCHRONIZED_IO option, completing outstanding I/O > > requests is in fact required for fsync() as well. The fdatasync() > > function is completely under the _POSIX_SYNCHRONIZED_IO option. > > We do not implement this option, but keeping fdatasync()'s guarantees a > > subset of fsync()'s guarantees seems sensible. > I will consider this if and when the AIO flush would be implemented. > I looked at the AIO code to estimate the needed work, but did not started > coding and quite possible it would be postponed. OK. > > > +%% fdatasync vp L L L > > > + > > > +vop_fdatasync { > > > + IN struct vnode *vp; > > > + IN struct thread *td; > > > +}; > > A waitfor parameter like in vop_fsync may be useful to implement > > aio_fsync(O_DSYNC) later on. > I really do not see how would it be. aio_fsync(O_DSYNC) is equivalent > to fdatasync(2) in the async context. Completion of the aio request > indicates that virtual fdatasync(2) execution did finished in that > context. The use of waitfor in the VOP_FSYNC() is to allow syncer > to initiate flush without waiting, or getting notification for the > completion. > Could you, please, elaborate ? If the KPI change is needed there, it > is obviously desirable to make it right before MFC to stable. Oh, you're right. No change is needed. A MNT_NOWAIT fsync operation does not provide any feedback when it is complete, so it is not useful for AIO. In fact, aio_fsync() eventually calls VOP_FSYNC with MNT_WAIT on a worker thread. -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Thu Aug 18 22:59:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2BF0BBEF94; Thu, 18 Aug 2016 22:59:01 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DCCD1249; Thu, 18 Aug 2016 22:59:01 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IMx0Ir001970; Thu, 18 Aug 2016 22:59:00 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IMx0bx001967; Thu, 18 Aug 2016 22:59:00 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201608182259.u7IMx0bx001967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 18 Aug 2016 22:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304435 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 22:59:01 -0000 Author: rstone Date: Thu Aug 18 22:59:00 2016 New Revision: 304435 URL: https://svnweb.freebsd.org/changeset/base/304435 Log: Don't iterate over the ifnet addr list in ip_output() For almost every packet that is transmitted through ip_output(), a call to in_broadcast() was made to decide if the destination IP was a broadcast address. in_broadcast() iterates over the ifnet's address to find a source IP matching the subnet of the destination IP, and then checks if the IP is a broadcast in that subnet. This is completely redundant as we have already performed the route lookup, so the source IP is already known. Just use that address to directly check whether the destination IP is a broadcast address or not. MFC after: 2 months Sponsored By: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7266 Modified: head/sys/netinet/in.c head/sys/netinet/in.h head/sys/netinet/ip_output.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Thu Aug 18 22:01:52 2016 (r304434) +++ head/sys/netinet/in.c Thu Aug 18 22:59:00 2016 (r304435) @@ -928,6 +928,25 @@ in_ifscrub_all(void) IFNET_RUNLOCK(); } +int +in_ifaddr_broadcast(struct in_addr in, struct in_ifaddr *ia) +{ + + return ((in.s_addr == ia->ia_broadaddr.sin_addr.s_addr || + /* + * Check for old-style (host 0) broadcast, but + * taking into account that RFC 3021 obsoletes it. + */ + (ia->ia_subnetmask != IN_RFC3021_MASK && + ntohl(in.s_addr) == ia->ia_subnet)) && + /* + * Check for an all one subnetmask. These + * only exist when an interface gets a secondary + * address. + */ + ia->ia_subnetmask != (u_long)0xffffffff); +} + /* * Return 1 if the address might be a local broadcast address. */ @@ -935,37 +954,21 @@ int in_broadcast(struct in_addr in, struct ifnet *ifp) { register struct ifaddr *ifa; - u_long t; if (in.s_addr == INADDR_BROADCAST || in.s_addr == INADDR_ANY) return (1); if ((ifp->if_flags & IFF_BROADCAST) == 0) return (0); - t = ntohl(in.s_addr); /* * Look through the list of addresses for a match * with a broadcast address. */ -#define ia ((struct in_ifaddr *)ifa) TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) if (ifa->ifa_addr->sa_family == AF_INET && - (in.s_addr == ia->ia_broadaddr.sin_addr.s_addr || - /* - * Check for old-style (host 0) broadcast, but - * taking into account that RFC 3021 obsoletes it. - */ - (ia->ia_subnetmask != IN_RFC3021_MASK && - t == ia->ia_subnet)) && - /* - * Check for an all one subnetmask. These - * only exist when an interface gets a secondary - * address. - */ - ia->ia_subnetmask != (u_long)0xffffffff) + in_ifaddr_broadcast(in, (struct in_ifaddr *)ifa)) return (1); return (0); -#undef ia } /* Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Thu Aug 18 22:01:52 2016 (r304434) +++ head/sys/netinet/in.h Thu Aug 18 22:59:00 2016 (r304435) @@ -637,8 +637,10 @@ int getsourcefilter(int, uint32_t, struc #ifdef _KERNEL struct ifnet; struct mbuf; /* forward declarations for Standard C */ +struct in_ifaddr; int in_broadcast(struct in_addr, struct ifnet *); +int in_ifaddr_broadcast(struct in_addr, struct in_ifaddr *); int in_canforward(struct in_addr); int in_localaddr(struct in_addr); int in_localip(struct in_addr); Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Aug 18 22:01:52 2016 (r304434) +++ head/sys/netinet/ip_output.c Thu Aug 18 22:59:00 2016 (r304435) @@ -350,7 +350,7 @@ again: have_ia_ref = 1; ifp = ia->ia_ifp; ip->ip_ttl = 1; - isbroadcast = in_broadcast(dst->sin_addr, ifp); + isbroadcast = in_ifaddr_broadcast(dst->sin_addr, ia); } else if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) && imo != NULL && imo->imo_multicast_ifp != NULL) { /* @@ -404,7 +404,7 @@ again: if (rte->rt_flags & RTF_HOST) isbroadcast = (rte->rt_flags & RTF_BROADCAST); else - isbroadcast = in_broadcast(gw->sin_addr, ifp); + isbroadcast = in_ifaddr_broadcast(gw->sin_addr, ia); } /* From owner-svn-src-head@freebsd.org Thu Aug 18 22:59:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FA0DBBEFC8; Thu, 18 Aug 2016 22:59:07 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9CDD12A8; Thu, 18 Aug 2016 22:59:06 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IMx56K002020; Thu, 18 Aug 2016 22:59:05 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IMx5oW002018; Thu, 18 Aug 2016 22:59:05 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201608182259.u7IMx5oW002018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 18 Aug 2016 22:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304436 - in head: . sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 22:59:07 -0000 Author: rstone Date: Thu Aug 18 22:59:05 2016 New Revision: 304436 URL: https://svnweb.freebsd.org/changeset/base/304436 Log: Don't check for broadcast IPs on non-bcast pkts in_broadcast() can be quite expensive, so skip calling it if the incoming mbuf wasn't sent to a broadcast L2 address in the first place. Reviewed by: gnn MFC after: 2 months Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7309 Modified: head/UPDATING head/sys/netinet/udp_usrreq.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Aug 18 22:59:00 2016 (r304435) +++ head/UPDATING Thu Aug 18 22:59:05 2016 (r304436) @@ -32,6 +32,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20160818: + The UDP receive code has been updated to only treat incoming UDP + packets that were addressed to an L2 broadcast address as L3 + broadcast packets. It is not expected that this will affect any + standards-conforming UDP application. The new behaviour can be + disabled by setting the sysctl net.inet.udp.require_l2_bcast to + 0. + +20160818: Remove the openbsd_poll system call. __FreeBSD_version has been bumped because of this. Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Aug 18 22:59:00 2016 (r304435) +++ head/sys/netinet/udp_usrreq.c Thu Aug 18 22:59:05 2016 (r304436) @@ -126,6 +126,11 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, blac &VNET_NAME(udp_blackhole), 0, "Do not send port unreachables for refused connects"); +static VNET_DEFINE(int, udp_require_l2_bcast) = 1; +SYSCTL_INT(_net_inet_udp, OID_AUTO, require_l2_bcast, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(udp_require_l2_bcast), 0, + "Only treat packets sent to an L2 broadcast address as broadcast packets"); + u_long udp_sendspace = 9216; /* really max datagram size */ SYSCTL_ULONG(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW, &udp_sendspace, 0, "Maximum outgoing UDP datagram size"); @@ -523,7 +528,8 @@ udp_input(struct mbuf **mp, int *offp, i pcbinfo = udp_get_inpcbinfo(proto); if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || - in_broadcast(ip->ip_dst, ifp)) { + ((!VNET_NAME(udp_require_l2_bcast) || m->m_flags & M_BCAST) && + in_broadcast(ip->ip_dst, ifp))) { struct inpcb *last; struct inpcbhead *pcblist; struct ip_moptions *imo; From owner-svn-src-head@freebsd.org Thu Aug 18 22:59:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE5B5BBEFFD; Thu, 18 Aug 2016 22:59:11 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEA4C13DE; Thu, 18 Aug 2016 22:59:11 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IMxAVZ002068; Thu, 18 Aug 2016 22:59:10 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IMxAbm002067; Thu, 18 Aug 2016 22:59:10 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201608182259.u7IMxAbm002067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 18 Aug 2016 22:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304437 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 18 Aug 2016 22:59:12 -0000 Author: rstone Date: Thu Aug 18 22:59:10 2016 New Revision: 304437 URL: https://svnweb.freebsd.org/changeset/base/304437 Log: Fix unlocked access to ifnet address list in_broadcast() was iterating over the ifnet address list without first taking an IF_ADDR_RLOCK. This could cause a panic if a concurrent operation modified the list. Reviewed by: bz MFC after: 2 months Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7227 Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Thu Aug 18 22:59:05 2016 (r304436) +++ head/sys/netinet/in.c Thu Aug 18 22:59:10 2016 (r304437) @@ -954,21 +954,27 @@ int in_broadcast(struct in_addr in, struct ifnet *ifp) { register struct ifaddr *ifa; + int found; if (in.s_addr == INADDR_BROADCAST || in.s_addr == INADDR_ANY) return (1); if ((ifp->if_flags & IFF_BROADCAST) == 0) return (0); + found = 0; /* * Look through the list of addresses for a match * with a broadcast address. */ + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) if (ifa->ifa_addr->sa_family == AF_INET && - in_ifaddr_broadcast(in, (struct in_ifaddr *)ifa)) - return (1); - return (0); + in_ifaddr_broadcast(in, (struct in_ifaddr *)ifa)) { + found = 1; + break; + } + IF_ADDR_RUNLOCK(ifp); + return (found); } /* From owner-svn-src-head@freebsd.org Fri Aug 19 00:03:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88E37BBE866; Fri, 19 Aug 2016 00:03:43 +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 489A31190; Fri, 19 Aug 2016 00:03:43 +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 u7J03gO0027942; Fri, 19 Aug 2016 00:03:42 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J03g80027938; Fri, 19 Aug 2016 00:03:42 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201608190003.u7J03g80027938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 19 Aug 2016 00:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304438 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 00:03:43 -0000 Author: mckusick Date: Fri Aug 19 00:03:41 2016 New Revision: 304438 URL: https://svnweb.freebsd.org/changeset/base/304438 Log: Fsck_ufs was using an int rather than a ufs2_daddr_t to store the alternate superblock location when given in the -b option. When int is 32-bits, block numbers larger than 2^32 would get truncated. This commit changes the storage fpr the alternate superblock location to a ufs2_daddr_t. Submitted by: Dmitry Sivachenko Modified: head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/globs.c head/sbin/fsck_ffs/main.c head/sbin/fsck_ffs/setup.c Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Thu Aug 18 22:59:10 2016 (r304437) +++ head/sbin/fsck_ffs/fsck.h Fri Aug 19 00:03:41 2016 (r304438) @@ -305,7 +305,7 @@ extern u_int real_dev_bsize; /* actual extern char nflag; /* assume a no response */ extern char yflag; /* assume a yes response */ extern int bkgrdflag; /* use a snapshot to run on an active system */ -extern int bflag; /* location of alternate super block */ +extern ufs2_daddr_t bflag; /* location of alternate super block */ extern int debug; /* output debugging info */ extern int Eflag; /* delete empty data blocks */ extern int Zflag; /* zero empty data blocks */ Modified: head/sbin/fsck_ffs/globs.c ============================================================================== --- head/sbin/fsck_ffs/globs.c Thu Aug 18 22:59:10 2016 (r304437) +++ head/sbin/fsck_ffs/globs.c Fri Aug 19 00:03:41 2016 (r304438) @@ -77,7 +77,7 @@ u_int real_dev_bsize; /* actual disk se char nflag; /* assume a no response */ char yflag; /* assume a yes response */ int bkgrdflag; /* use a snapshot to run on an active system */ -int bflag; /* location of alternate super block */ +ufs2_daddr_t bflag; /* location of alternate super block */ int debug; /* output debugging info */ int Eflag; /* delete empty data blocks */ int Zflag; /* zero empty data blocks */ Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Thu Aug 18 22:59:10 2016 (r304437) +++ head/sbin/fsck_ffs/main.c Fri Aug 19 00:03:41 2016 (r304438) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -68,7 +69,7 @@ __FBSDID("$FreeBSD$"); int restarts; static void usage(void) __dead2; -static int argtoi(int flag, const char *req, const char *str, int base); +static intmax_t argtoimax(int flag, const char *req, const char *str, int base); static int checkfilesys(char *filesys); static int chkdoreload(struct statfs *mntp); static struct statfs *getmntpt(const char *); @@ -88,8 +89,8 @@ main(int argc, char *argv[]) switch (ch) { case 'b': skipclean = 0; - bflag = argtoi('b', "number", optarg, 10); - printf("Alternate super block location: %d\n", bflag); + bflag = argtoimax('b', "number", optarg, 10); + printf("Alternate super block location: %jd\n", bflag); break; case 'B': @@ -98,7 +99,8 @@ main(int argc, char *argv[]) case 'c': skipclean = 0; - cvtlevel = argtoi('c', "conversion level", optarg, 10); + cvtlevel = argtoimax('c', "conversion level", optarg, + 10); if (cvtlevel < 3) errx(EEXIT, "cannot do level %d conversion", cvtlevel); @@ -121,7 +123,7 @@ main(int argc, char *argv[]) break; case 'm': - lfmode = argtoi('m', "mode", optarg, 8); + lfmode = argtoimax('m', "mode", optarg, 8); if (lfmode &~ 07777) errx(EEXIT, "bad mode to -m: %o", lfmode); printf("** lost+found creation mode %o\n", lfmode); @@ -203,13 +205,13 @@ main(int argc, char *argv[]) exit(ret); } -static int -argtoi(int flag, const char *req, const char *str, int base) +static intmax_t +argtoimax(int flag, const char *req, const char *str, int base) { char *cp; - int ret; + intmax_t ret; - ret = (int)strtol(str, &cp, base); + ret = strtoimax(str, &cp, base); if (cp == str || *cp) errx(EEXIT, "-%c flag requires a %s", flag, req); return (ret); Modified: head/sbin/fsck_ffs/setup.c ============================================================================== --- head/sbin/fsck_ffs/setup.c Thu Aug 18 22:59:10 2016 (r304437) +++ head/sbin/fsck_ffs/setup.c Fri Aug 19 00:03:41 2016 (r304438) @@ -196,7 +196,7 @@ setup(char *dev) bflag = 0; return(0); } - pwarn("USING ALTERNATE SUPERBLOCK AT %d\n", bflag); + pwarn("USING ALTERNATE SUPERBLOCK AT %jd\n", bflag); bflag = 0; } if (skipclean && ckclean && sblock.fs_clean) { @@ -329,7 +329,7 @@ readsb(int listerr) } if (sblock.fs_magic != FS_UFS1_MAGIC && sblock.fs_magic != FS_UFS2_MAGIC) { - fprintf(stderr, "%d is not a file system superblock\n", + fprintf(stderr, "%jd is not a file system superblock\n", bflag); return (0); } From owner-svn-src-head@freebsd.org Fri Aug 19 00:50:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5307BBF45D; Fri, 19 Aug 2016 00:50:33 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 780E3168E; Fri, 19 Aug 2016 00:50:33 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J0oWV6043172; Fri, 19 Aug 2016 00:50:32 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J0oWkW043171; Fri, 19 Aug 2016 00:50:32 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608190050.u7J0oWkW043171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Fri, 19 Aug 2016 00:50:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304439 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 00:50:33 -0000 Author: yongari Date: Fri Aug 19 00:50:32 2016 New Revision: 304439 URL: https://svnweb.freebsd.org/changeset/base/304439 Log: Fix build on big-endian systems. Reported by: bz Modified: head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axgereg.h ============================================================================== --- head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:03:41 2016 (r304438) +++ head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:50:32 2016 (r304439) @@ -156,19 +156,20 @@ enum { struct axge_frame_txhdr { #if BYTE_ORDER == LITTLE_ENDIAN uint32_t len; -#define AXGE_TXLEN_MASK 0x0001FFFF -#define AXGE_VLAN_INSERT 0x20000000 -#define AXGE_CSUM_DISABLE 0x80000000 uint32_t mss; -#define AXGE_MSS_MASK 0x00003FFF -#define AXGE_PADDING 0x80008000 -#define AXGE_VLAN_TAG_MASK 0xFFFF0000 #else uint32_t mss; uint32_t len; #endif } __packed; +#define AXGE_TXLEN_MASK 0x0001FFFF +#define AXGE_VLAN_INSERT 0x20000000 +#define AXGE_CSUM_DISABLE 0x80000000 +#define AXGE_MSS_MASK 0x00003FFF +#define AXGE_PADDING 0x80008000 +#define AXGE_VLAN_TAG_MASK 0xFFFF0000 + #define AXGE_TXBYTES(x) ((x) & AXGE_TXLEN_MASK) #define AXGE_PHY_ADDR 3 From owner-svn-src-head@freebsd.org Fri Aug 19 00:52:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 415B7BBF584; Fri, 19 Aug 2016 00:52:35 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pf0-x232.google.com (mail-pf0-x232.google.com [IPv6:2607:f8b0:400e:c00::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F8211A48; Fri, 19 Aug 2016 00:52:35 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by mail-pf0-x232.google.com with SMTP id p64so3571131pfb.1; Thu, 18 Aug 2016 17:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=z35zIDMNVqrVL1pPSopQWkffNi9B1esU733WVr/lGVE=; b=cNRrdKSl+KlKVCVw2cCGFScnat8tA6AS300wCdfjqLC4o8jGmlClUmgpORxIb+kItS 6O5aXYX2GezsDEf9/KN0ybqgK2IjiBPM2P631f25NgWq3X+rkhh77hkN9a7gaLmqVS9Z jdkDIoIqzflOKP7HBsgen7toIb09+iltUOrv/VV90g7Ya5Z7IFOsqx0xXChyyc9PQslu 3gVPwSYlJyZAJoJFg199cHDsbVlV2deY/YxstxzbH+j1Hb2Xb0IKkJTWeQoXEg4by4f7 njYnVAyyG6BlyViWLnSAz3cu7ivvOcP/n4u9L160mg4i8V8PoseOdRII4eMR+zYi6UKp kWvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=z35zIDMNVqrVL1pPSopQWkffNi9B1esU733WVr/lGVE=; b=IXogO3zDX/JCnlsc6xNd+1Ir1tJ0r2Gx6DJd6gzIt8ANSZ2/m2C7rjzbwGUIWFP47c vbj4eQ0JpMela8Xp3/rc0jDQJIgQoJrmJ0/jJSwaTJpCAeMX/WsRjDLi7R1FLUrwDJF9 6/P7VuHLBwQnBCHx4t5FiWH8ptgeRX8yjkVKmFsg/vaSidQcvrt8714o+DnmzsZrPT3a eRoPdyVVA0/vt8elZsPXpCEH9xZYXoD7YCmyKJAcI7wzhFxghWTO814wwaMZ9pxSynwQ 8rrRvPfKQ+SsDDDzJtGoI1RIM46RKvmptM7ImZlZYpD5qHB8QmgXP4vyAXoapzVeXYmR wGbQ== X-Gm-Message-State: AEkoouvH0lbcq1DVIJ0JcZzJYt/ojZdpS+1bUz+7PSYDQlIITQ4B2ueCSFIKsBnA5TAfWQ== X-Received: by 10.98.18.221 with SMTP id 90mr9243526pfs.3.1471567954616; Thu, 18 Aug 2016 17:52:34 -0700 (PDT) Received: from localhost ([106.247.248.2]) by smtp.gmail.com with ESMTPSA id y9sm6458108pay.25.2016.08.18.17.52.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Aug 2016 17:52:31 -0700 (PDT) From: YongHyeon PYUN X-Google-Original-From: "YongHyeon PYUN" Received: by localhost (sSMTP sendmail emulation); Fri, 19 Aug 2016 09:52:25 +0900 Date: Fri, 19 Aug 2016 09:52:25 +0900 To: "Bjoern A. Zeeb" Cc: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304326 - head/sys/dev/usb/net Message-ID: <20160819005225.GA1234@michelle.fasterthan.co.kr> Reply-To: pyunyh@gmail.com References: <201608180507.u7I572ZI096519@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 00:52:35 -0000 On Thu, Aug 18, 2016 at 04:44:29PM +0000, Bjoern A. Zeeb wrote: > On 18 Aug 2016, at 5:07, Pyun YongHyeon wrote: > > >Author: yongari > >Date: Thu Aug 18 05:07:02 2016 > >New Revision: 304326 > >URL: https://svnweb.freebsd.org/changeset/base/304326 > > [...] > >+struct axge_frame_txhdr { > >+#if BYTE_ORDER == LITTLE_ENDIAN > >+ uint32_t len; > >+#define AXGE_TXLEN_MASK 0x0001FFFF > >+#define AXGE_VLAN_INSERT 0x20000000 > >+#define AXGE_CSUM_DISABLE 0x80000000 > >+ uint32_t mss; > >+#define AXGE_MSS_MASK 0x00003FFF > >+#define AXGE_PADDING 0x80008000 > >+#define AXGE_VLAN_TAG_MASK 0xFFFF0000 > >+#else > >+ uint32_t mss; > >+ uint32_t len; > >+#endif > >+} __packed; > >+ > >+#define AXGE_TXBYTES(x) ((x) & AXGE_TXLEN_MASK) > > > AXGE_TXLEN_MASK is only defined for LITTLE_ENDIAN and thus breaks builds > on others. > > AXGE_CSUM_DISABLE as well .. > Oops, fixed in r304439. Thanks. From owner-svn-src-head@freebsd.org Fri Aug 19 01:27:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39A91BBFC41; Fri, 19 Aug 2016 01:27:25 +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 090FE1B7D; Fri, 19 Aug 2016 01:27:24 +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 u7J1RO0i057998; Fri, 19 Aug 2016 01:27:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J1ROOq057997; Fri, 19 Aug 2016 01:27:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608190127.u7J1ROOq057997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Aug 2016 01:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304440 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 01:27:25 -0000 Author: markj Date: Fri Aug 19 01:27:24 2016 New Revision: 304440 URL: https://svnweb.freebsd.org/changeset/base/304440 Log: Correct a check for P2_PTRACE_FSTP in ptracestop(). MFC after: 1 day Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Fri Aug 19 00:50:32 2016 (r304439) +++ head/sys/kern/kern_sig.c Fri Aug 19 01:27:24 2016 (r304440) @@ -2537,7 +2537,7 @@ ptracestop(struct thread *td, int sig) * a chance to report itself upon the next iteration. */ if ((td->td_dbgflags & TDB_FSTP) != 0 || - ((p->p_flag & P2_PTRACE_FSTP) == 0 && + ((p->p_flag2 & P2_PTRACE_FSTP) == 0 && p->p_xthread == NULL)) { p->p_xsig = sig; p->p_xthread = td; From owner-svn-src-head@freebsd.org Fri Aug 19 03:28:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCC6ABBF6B4 for ; Fri, 19 Aug 2016 03:28:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (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 9024C1867 for ; Fri, 19 Aug 2016 03:28:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x243.google.com with SMTP id d65so844687ith.0 for ; Thu, 18 Aug 2016 20:28:58 -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=NTanaiVjvrtP3VCPIm9mlNsY9Ob+83e+XZDe2wlZvKM=; b=jHLPATfY1unby5UD+nw0F9fF1mXEmFE4EpmyOP2cIJOpFbqdWLN6OJaUB3BUbYyWrX Lp3kLRS37uwcTEC+Nv+zsyQKu2XaSa7cnibRWqlj6toTiDOJgr9DMZN75o33HCj01Y+n AWUI/TNkktkHYPjTuqTHMoPPME/12ibP8WIwh99gidl/OH/PcC2ynIpc/AIynHWTnyQW rnrdbBgewxNITItPJIFf5JP/6Z9QMkIBSFAu8VeQ4zdrRp2AXf2zPI3QlDNkSEPtQUih O7Ek9a9/n4c/5OqRgF6iAQxckySSlZFLAAmGBy5C5CGagftLticJ2B3fIILpgCfklnw/ VGng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=NTanaiVjvrtP3VCPIm9mlNsY9Ob+83e+XZDe2wlZvKM=; b=YkG2XbtqHC1NNiPYIjB1bfjkyQ3096lgOUD3sR21YMTxiWN2FH4beVpVus77Jdbrrl sEaS4hrp3xaNHHYmnAVGg4GpIzviy/Y/YITOjZYFAFsQYiCR3c2iOYLv5CU181P0aLoC ap6yXQmDvGHf1Wkw2elPw2KcKuZIP3k5oR+74esVxSnvjFeJToWVwYMbcb3VTjF6qU+B a2hkCbW0q48XiCnkRdWedLU14JMZkr76YO1ouow5/Iud9D23PMr+kiMe+xxfdBSAX99m 12SwiRWOBgKCBoaUamRaUAJihTPFvcOXGqzO+RutRDWGBc7+C/FQ4FyjP2EorDiXPxeA EAow== X-Gm-Message-State: AEkoousNDoV0gTmNKHkg8kuoXvr3WFzhumjWRt25+hT0k6cNOqcWf2bMSGNKfjxdBTjhR2tX6GOOdEAurDN3UA== X-Received: by 10.36.149.193 with SMTP id m184mr3680559itd.94.1471577337707; Thu, 18 Aug 2016 20:28:57 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Thu, 18 Aug 2016 20:28:57 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> From: Warner Losh Date: Thu, 18 Aug 2016 21:28:57 -0600 X-Google-Sender-Auth: 3LzdAaRGVF3reeQGMZ4CC4gFNp8 Message-ID: Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd To: Julian Elischer Cc: John Baldwin , 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.22 Precedence: list List-Id: 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, 19 Aug 2016 03:28:58 -0000 On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer wrote: > On 16/08/2016 4:54 AM, John Baldwin wrote: >> >> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >>> >>> Author: jhb >>> Date: Mon Aug 15 20:38:02 2016 >>> New Revision: 304187 >>> URL: https://svnweb.freebsd.org/changeset/base/304187 >>> >>> Log: >>> Remove the mcd(4) driver for Mitsumi CD-ROM players. >>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in >>> the manpage, this driver is only useful as a backend to cdcontrol to >>> play audio CDs since it doesn't use DMA, so its data performance is >>> "abysmal" (and that was true in the mid 90's). >> >> No one stepped up to test patches for it either when I last posted patches >> to >> convert it from timeout(9) to callout(9). I have a few more drivers that >> are >> both very old and that people have no business using in 12 (think ISA >> adapters that don't do DMA and can't be used with pccard) that I will be >> removing over the next little while. I brought up a list of drivers on >> arch@ >> a couple of years ago and the conversation drifted off into the weeds >> about >> trimming GENERIC, etc. No one objected to the specific drivers I listed >> though (and I got a few pleas of "please remove"). If someone shows up >> desperately clutching an ISA adapter they can always dig up the source >> from >> svn and deal with forward porting it for whatever API changes have >> happened >> since it was removed. > > > I would imagine any machine still holding one of these probably has not > enough memory to run FreeBSD. > > would we still run in 2MB? With insane levels of tuning, we can run in 32MB userland that can do things. Even 64MB is tight w/o some tuning. 16MB is almost certainly right out except for very specialized situations. 2MB? We can't even load the loader in that :(. Oh, and all these memory configs are only possible if you tweak the loader's block cache... Warner From owner-svn-src-head@freebsd.org Fri Aug 19 03:32:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94180BBF741; Fri, 19 Aug 2016 03:32:06 +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 45AC11C06; Fri, 19 Aug 2016 03:32:06 +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 u7J3W5xe007060; Fri, 19 Aug 2016 03:32:05 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J3W5hm007056; Fri, 19 Aug 2016 03:32:05 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608190332.u7J3W5hm007056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 19 Aug 2016 03:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304441 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 03:32:06 -0000 Author: sephe Date: Fri Aug 19 03:32:04 2016 New Revision: 304441 URL: https://svnweb.freebsd.org/changeset/base/304441 Log: hyperv/hn: Move NVS version to softc MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7553 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 19 01:27:24 2016 (r304440) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 19 03:32:04 2016 (r304441) @@ -593,10 +593,11 @@ hv_nv_connect_to_vsp(struct hn_softc *sc for (i = protocol_number - 1; i >= 0; i--) { if (hv_nv_negotiate_nvsp_protocol(sc, net_dev, protocol_list[i]) == 0) { - net_dev->nvsp_version = protocol_list[i]; - if (bootverbose) - device_printf(dev, "Netvsc: got version 0x%x\n", - net_dev->nvsp_version); + sc->hn_nvs_ver = protocol_list[i]; + if (bootverbose) { + device_printf(dev, "NVS version 0x%x\n", + sc->hn_nvs_ver); + } break; } } @@ -612,7 +613,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc * Set the MTU if supported by this NVSP protocol version * This needs to be right after the NVSP init message per Haiyang */ - if (net_dev->nvsp_version >= NVSP_PROTOCOL_VERSION_2) + if (sc->hn_nvs_ver >= NVSP_PROTOCOL_VERSION_2) ret = hv_nv_send_ndis_config(sc, ifp->if_mtu); /* @@ -622,7 +623,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc memset(&ndis, 0, sizeof(ndis)); ndis.nvs_type = HN_NVS_TYPE_NDIS_INIT; ndis.nvs_ndis_major = NDIS_VERSION_MAJOR_6; - if (net_dev->nvsp_version <= NVSP_PROTOCOL_VERSION_4) + if (sc->hn_nvs_ver <= NVSP_PROTOCOL_VERSION_4) ndis.nvs_ndis_minor = NDIS_VERSION_MINOR_1; else ndis.nvs_ndis_minor = NDIS_VERSION_MINOR_30; @@ -636,7 +637,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc } /* Post the big receive buffer to NetVSP */ - if (net_dev->nvsp_version <= NVSP_PROTOCOL_VERSION_2) + if (sc->hn_nvs_ver <= NVSP_PROTOCOL_VERSION_2) net_dev->rx_buf_size = NETVSC_RECEIVE_BUFFER_SIZE_LEGACY; else net_dev->rx_buf_size = NETVSC_RECEIVE_BUFFER_SIZE; Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 01:27:24 2016 (r304440) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 03:32:04 2016 (r304441) @@ -237,8 +237,6 @@ typedef struct netvsc_dev_ { void *extension; uint8_t destroy; - /* Negotiated NVSP version */ - uint32_t nvsp_version; uint32_t num_channel; @@ -400,6 +398,7 @@ typedef struct hn_softc { struct sysctl_oid *hn_tx_sysctl_tree; struct sysctl_oid *hn_rx_sysctl_tree; struct vmbus_xact_ctx *hn_xact; + uint32_t hn_nvs_ver; } hn_softc_t; /* Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Aug 19 01:27:24 2016 (r304440) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Aug 19 03:32:04 2016 (r304441) @@ -611,6 +611,10 @@ netvsc_attach(device_t dev) hn_tx_chimney_size < sc->hn_tx_chimney_max) hn_set_tx_chimney_size(sc, hn_tx_chimney_size); + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "nvs_version", CTLFLAG_RD, &sc->hn_nvs_ver, 0, "NVS version"); + return (0); failed: hn_destroy_tx_data(sc); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Aug 19 01:27:24 2016 (r304440) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Aug 19 03:32:04 2016 (r304441) @@ -349,11 +349,10 @@ hv_rf_send_offload_request(struct hn_sof rndis_device *rndis_dev; device_t dev = sc->hn_dev; netvsc_dev *net_dev = sc->net_dev; - uint32_t vsp_version = net_dev->nvsp_version; uint32_t extlen = sizeof(rndis_offload_params); int ret; - if (vsp_version <= NVSP_PROTOCOL_VERSION_4) { + if (sc->hn_nvs_ver <= NVSP_PROTOCOL_VERSION_4) { extlen = VERSION_4_OFFLOAD_SIZE; /* On NVSP_PROTOCOL_VERSION_4 and below, we do not support * UDP checksum offload. @@ -1116,7 +1115,7 @@ hv_rf_on_device_add(struct hn_softc *sc, dev_info->link_state = rndis_dev->link_status; net_dev->num_channel = 1; - if (net_dev->nvsp_version < NVSP_PROTOCOL_VERSION_5 || nchan == 1) + if (sc->hn_nvs_ver < NVSP_PROTOCOL_VERSION_5 || nchan == 1) return (0); memset(&rsscaps, 0, rsscaps_size); From owner-svn-src-head@freebsd.org Fri Aug 19 04:15:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC5CABBD2F4 for ; Fri, 19 Aug 2016 04:15:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua0-x235.google.com (mail-ua0-x235.google.com [IPv6:2607:f8b0:400c:c08::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 902F81139 for ; Fri, 19 Aug 2016 04:15:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua0-x235.google.com with SMTP id 74so61670537uau.0 for ; Thu, 18 Aug 2016 21:15:14 -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:content-transfer-encoding; bh=iQ3YGGCdF+pAGNH7dNeoOcCqy3PJOVkUhFdPBrtmodQ=; b=OOfvKdy8ZCLij1L0Di5HwXqkCVfAl158iiokVGIPgKKeWLF4d1gtobCzrA4TUigrn8 i/tBDG0SGWB2y2/1PUtREubMPdGcGHCR+NQcuDQ6XGWC3opNWXRgJPYbw6X+cb0857ln UCVl3y5Tyqo9XqPkd4Gl9SKRmAu25fvsgdugKzNmv6Ja7B3rGrIUVf7PFFCPuCQ8b/sK R+oJ9slMeErvuTbjLQxjRbWKWoH5LL/VF11YjCDIK3rIhuhfSLV/A784bWC5oOYXeUfq LTPesbF0xeYB5cO5qxUzM01a+LIR+isC+UZnM8Gs3qiWrBFGlU276Gtluw9+WT6vxkJ+ pDzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=iQ3YGGCdF+pAGNH7dNeoOcCqy3PJOVkUhFdPBrtmodQ=; b=TAib2NZXmyxmJKgrhGSS259DW4QDoSbLrBZjQVqV5V+O3qodrS949ZsnCe+dEb6ZS5 TH6naBE6ko0emb0uuQgZWatUg8VKmalpyykzIpq/pHMLotbwsK5L32kC8fkcCZtKq1L5 sihkodDtaSYMajDiQtbKXhdP6LAAyXQjrVQ3CYGt5VxQZtCSGRbXLQnrrehN1A75Q2rZ W9VOlUEtkqK1Ztd9UrbVMPM+inH4zRiC6fDayHh473NXEvlKwxPL/MZrILyS+4kLtX9C c91lQl9bmGCBiLsNFCwkKKFd0dstcasQQIF+RCHHV2jF13610belxiuiCxBiN0VkFn/p 8EPg== X-Gm-Message-State: AEkoouuCqacqS79lAsaBS7ZrGbn14pmi78uSl5XQxfF1FbswaLpGNU3yfVbAa2qi7yKViFQyGwmWFHkfxjEb6Q== X-Received: by 10.176.1.69 with SMTP id 63mr2635301uak.54.1471580113525; Thu, 18 Aug 2016 21:15:13 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.103.0.84 with HTTP; Thu, 18 Aug 2016 21:15:12 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> From: Warner Losh Date: Thu, 18 Aug 2016 22:15:12 -0600 X-Google-Sender-Auth: EOoSBzZl5a8HyLOEO4kcFamTsuI Message-ID: Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Allan Jude Cc: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 04:15:15 -0000 On Thu, Aug 18, 2016 at 6:56 AM, Allan Jude wrote: > On 08/18/16 05:50 AM, Dag-Erling Sm=C3=B8rgrav wrote: >> Nathan Whitehorn writes: >>> OK. In which configurations? My Dell servers, for instance, don't do >>> this. How are they set up? What drivers are being used? Is this >>> something that affects passthrough disks, RAIDs, disk images? >> >> Most LSI MegaRAID controllers don't have real passthrough, only JBOD. >> You can query the drive with "camcontrol identify passX", but the >> controller does not report a stripe size for the volume (mfidY). >> >>> The point is that *if the reported stripe size is wrong*, more things >>> than partition alignment in the installer will suffer for it. >> >> It's not wrong, it's non-existent, and I'm getting really tired of >> repeating myself. >> >>> Fixing the installer with a bandaid in the run-up to a release is >>> fine, but *we need to fix the underlying problem*. >> >> We can't, because hardware sucks, and I'm getting really tired of >> repeating myself. >> >> DES >> > > Which makes more sense: > > A) If stripesize =3D=3D 0, use some sane value like 4096 I don't like this. > B) Some other combination that uses the reported stripe size, unless it > is 0, in which case it uses 4096 (or some other value controlled by a > different new sysctl) Don't like this so much. > C) create kern.geom.min_stripe_size with a default of 512, but users can > set 4096 if they use only 4k devices. (doesn't really solve the problem > for the installer) Default it to 4k, and allow users to set it to 512. If the drive reports < this value report this value instead. You'll need to make this a tunable. Then the upp= er layers wouldn't care. There's a small chance that some SD cards might be reporting values that are too large. But I think it is confined to SD cards= and if I see too many more I'll do something specific in the SD driver. Warner From owner-svn-src-head@freebsd.org Fri Aug 19 04:30:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1891BBD7B4; Fri, 19 Aug 2016 04:30:31 +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 73D351997; Fri, 19 Aug 2016 04:30:31 +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 u7J4UUwq025925; Fri, 19 Aug 2016 04:30:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J4UTqU025924; Fri, 19 Aug 2016 04:30:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201608190430.u7J4UTqU025924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 19 Aug 2016 04:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304443 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 04:30:31 -0000 Author: imp Date: Fri Aug 19 04:30:29 2016 New Revision: 304443 URL: https://svnweb.freebsd.org/changeset/base/304443 Log: Improve the pattern matching so that internal *'s work, as well as [set] notation. This fixes pattern matching for recently added drives that would set the NCQ Trim being broken incorrectly. PR: 210686 Tested-by: Tomoaki AOKI MFC After: 3 days Modified: head/sys/cam/cam.c Modified: head/sys/cam/cam.c ============================================================================== --- head/sys/cam/cam.c Fri Aug 19 04:21:16 2016 (r304442) +++ head/sys/cam/cam.c Fri Aug 19 04:30:29 2016 (r304443) @@ -207,32 +207,72 @@ cam_strvis_sbuf(struct sbuf *sb, const u /* * Compare string with pattern, returning 0 on match. * Short pattern matches trailing blanks in name, - * wildcard '*' in pattern matches rest of name, - * wildcard '?' matches a single non-space character. + * Shell globbing rules apply: * matches 0 or more characters, + * ? matchces one character, [...] denotes a set to match one char, + * [^...] denotes a complimented set to match one character. + * Spaces in str used to match anything in the pattern string + * but was removed because it's a bug. No current patterns require + * it, as far as I know, but it's impossible to know what drives + * returned. + * + * Each '*' generates recursion, so keep the number of * in check. */ int cam_strmatch(const u_int8_t *str, const u_int8_t *pattern, int str_len) { - while (*pattern != '\0'&& str_len > 0) { - + while (*pattern != '\0' && str_len > 0) { if (*pattern == '*') { - return (0); - } - if ((*pattern != *str) - && (*pattern != '?' || *str == ' ')) { + pattern++; + if (*pattern == '\0') + return (0); + do { + if (cam_strmatch(str, pattern, str_len) == 0) + return (0); + str++; + str_len--; + } while (str_len > 0); return (1); + } else if (*pattern == '[') { + int negate_range, ok; + uint8_t pc, sc; + + ok = 0; + sc = *str++; + str_len--; + if ((negate_range = (*pattern == '^')) != 0) + pattern++; + while (((pc = *pattern) != ']') && *pattern != '\0') { + pattern++; + if (*pattern == '-') { + if (pattern[1] == '\0') /* Bad pattern */ + return (1); + if (sc >= pc && sc <= pattern[1]) + ok = 1; + pattern += 2; + } else if (pc == sc) + ok = 1; + } + if (ok == negate_range) + return (1); + } else if (*pattern == '?') { + /* NB: || *str == ' ' of the old code is a bug and was removed */ + /* if you add it back, keep this the last if before the naked else */ + pattern++; + str++; + str_len--; + } else { + if (*str != *pattern) + return (1); + pattern++; + str++; + str_len--; } - pattern++; - str++; - str_len--; } while (str_len > 0 && *str == ' ') { str++; str_len--; } - if (str_len > 0 && *str == 0) - str_len = 0; return (str_len); } From owner-svn-src-head@freebsd.org Fri Aug 19 05:20:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74292BBE289; Fri, 19 Aug 2016 05:20:13 +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 433B61D67; Fri, 19 Aug 2016 05:20:13 +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 u7J5KCr5044633; Fri, 19 Aug 2016 05:20:12 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J5KC4l044631; Fri, 19 Aug 2016 05:20:12 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608190520.u7J5KC4l044631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 19 Aug 2016 05:20:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304444 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 05:20:13 -0000 Author: sephe Date: Fri Aug 19 05:20:12 2016 New Revision: 304444 URL: https://svnweb.freebsd.org/changeset/base/304444 Log: hyperv/hn: Remove assign-only struct field MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7554 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 19 04:30:29 2016 (r304443) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 19 05:20:12 2016 (r304444) @@ -88,7 +88,6 @@ hv_nv_alloc_net_device(struct hn_softc * net_dev = malloc(sizeof(netvsc_dev), M_NETVSC, M_WAITOK | M_ZERO); net_dev->sc = sc; - net_dev->destroy = FALSE; sc->net_dev = net_dev; return (net_dev); @@ -734,9 +733,6 @@ hv_nv_on_device_remove(struct hn_softc * { netvsc_dev *net_dev = sc->net_dev;; - /* Stop outbound traffic ie sends and receives completions */ - net_dev->destroy = TRUE; - hv_nv_disconnect_from_vsp(net_dev); /* At this point, no one should be accessing net_dev except in here */ Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 04:30:29 2016 (r304443) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 05:20:12 2016 (r304444) @@ -236,8 +236,6 @@ typedef struct netvsc_dev_ { /* Holds rndis device info */ void *extension; - uint8_t destroy; - uint32_t num_channel; struct hyperv_dma rxbuf_dma; From owner-svn-src-head@freebsd.org Fri Aug 19 05:21:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC48ABBE3AB; Fri, 19 Aug 2016 05:21:11 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F5E011AE; Fri, 19 Aug 2016 05:21:11 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7J5L4wL010396 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 18 Aug 2016 22:21:05 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Warner Losh , Allan Jude References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Nathan Whitehorn Message-ID: <081362ef-ff4a-61d5-46e4-9a4cf8b699ee@freebsd.org> Date: Thu, 18 Aug 2016 22:21:04 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVaAVGTML+dYPQh1Or1JSc7OEKqc6YVveMKxkVEmIOUxXNT5gzDB0bI/PeH4Ia2xtpiCzxzNQg7WXO0RDYals0byGoo744SXVmo= X-Sonic-ID: C;hI6+ucxl5hG5EqDx2xNB0g== M;eIcmusxl5hG5EqDx2xNB0g== 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.22 Precedence: list List-Id: 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, 19 Aug 2016 05:21:11 -0000 On 08/18/16 21:15, Warner Losh wrote: > On Thu, Aug 18, 2016 at 6:56 AM, Allan Jude wrote: >> On 08/18/16 05:50 AM, Dag-Erling Smørgrav wrote: >>> Nathan Whitehorn writes: >>>> OK. In which configurations? My Dell servers, for instance, don't do >>>> this. How are they set up? What drivers are being used? Is this >>>> something that affects passthrough disks, RAIDs, disk images? >>> Most LSI MegaRAID controllers don't have real passthrough, only JBOD. >>> You can query the drive with "camcontrol identify passX", but the >>> controller does not report a stripe size for the volume (mfidY). >>> >>>> The point is that *if the reported stripe size is wrong*, more things >>>> than partition alignment in the installer will suffer for it. >>> It's not wrong, it's non-existent, and I'm getting really tired of >>> repeating myself. >>> >>>> Fixing the installer with a bandaid in the run-up to a release is >>>> fine, but *we need to fix the underlying problem*. >>> We can't, because hardware sucks, and I'm getting really tired of >>> repeating myself. >>> >>> DES >>> >> Which makes more sense: >> >> A) If stripesize == 0, use some sane value like 4096 > I don't like this. > >> B) Some other combination that uses the reported stripe size, unless it >> is 0, in which case it uses 4096 (or some other value controlled by a >> different new sysctl) > Don't like this so much. > >> C) create kern.geom.min_stripe_size with a default of 512, but users can >> set 4096 if they use only 4k devices. (doesn't really solve the problem >> for the installer) > Default it to 4k, and allow users to set it to 512. If the drive > reports < this value > report this value instead. You'll need to make this a tunable. Then the upper > layers wouldn't care. There's a small chance that some SD cards might be > reporting values that are too large. But I think it is confined to SD cards and > if I see too many more I'll do something specific in the SD driver. > > Warner > > That sounds good to me and I think can clean up a lot of code and potential foot-shooting. Who is planning to make the patch? I'm happy to do anything that would be helpful. -Nathan From owner-svn-src-head@freebsd.org Fri Aug 19 05:30:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0F03BBE63F; Fri, 19 Aug 2016 05:30:40 +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 78A35164E; Fri, 19 Aug 2016 05:30:40 +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 u7J5Ud9A048990; Fri, 19 Aug 2016 05:30:39 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J5UdUn048986; Fri, 19 Aug 2016 05:30:39 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608190530.u7J5UdUn048986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 19 Aug 2016 05:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304446 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 05:30:40 -0000 Author: sephe Date: Fri Aug 19 05:30:39 2016 New Revision: 304446 URL: https://svnweb.freebsd.org/changeset/base/304446 Log: hyperv/hn: Remove the useless num_channel MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7555 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 05:30:02 2016 (r304445) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 05:30:39 2016 (r304446) @@ -236,8 +236,6 @@ typedef struct netvsc_dev_ { /* Holds rndis device info */ void *extension; - uint32_t num_channel; - struct hyperv_dma rxbuf_dma; struct hyperv_dma txbuf_dma; } netvsc_dev; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Aug 19 05:30:02 2016 (r304445) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Aug 19 05:30:39 2016 (r304446) @@ -551,26 +551,25 @@ netvsc_attach(device_t dev) if (sc->hn_xact == NULL) goto failed; - error = hv_rf_on_device_add(sc, &device_info, ring_cnt, + error = hv_rf_on_device_add(sc, &device_info, &ring_cnt, &sc->hn_rx_ring[0]); if (error) goto failed; - KASSERT(sc->net_dev->num_channel > 0 && - sc->net_dev->num_channel <= sc->hn_rx_ring_inuse, - ("invalid channel count %u, should be less than %d", - sc->net_dev->num_channel, sc->hn_rx_ring_inuse)); + KASSERT(ring_cnt > 0 && ring_cnt <= sc->hn_rx_ring_inuse, + ("invalid channel count %d, should be less than %d", + ring_cnt, sc->hn_rx_ring_inuse)); /* * Set the # of TX/RX rings that could be used according to * the # of channels that host offered. */ - if (sc->hn_tx_ring_inuse > sc->net_dev->num_channel) - sc->hn_tx_ring_inuse = sc->net_dev->num_channel; - sc->hn_rx_ring_inuse = sc->net_dev->num_channel; + if (sc->hn_tx_ring_inuse > ring_cnt) + sc->hn_tx_ring_inuse = ring_cnt; + sc->hn_rx_ring_inuse = ring_cnt; device_printf(dev, "%d TX ring, %d RX ring\n", sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse); - if (sc->net_dev->num_channel > 1) + if (sc->hn_rx_ring_inuse > 1) hn_subchan_setup(sc); #if __FreeBSD_version >= 1100099 @@ -1511,7 +1510,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, struct ifaddr *ifa = (struct ifaddr *)data; #endif netvsc_device_info device_info; - int mask, error = 0; + int mask, error = 0, ring_cnt; int retry_cnt = 500; switch(cmd) { @@ -1585,18 +1584,20 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, /* Wait for subchannels to be destroyed */ vmbus_subchan_drain(sc->hn_prichan); - error = hv_rf_on_device_add(sc, &device_info, - sc->hn_rx_ring_inuse, &sc->hn_rx_ring[0]); + ring_cnt = sc->hn_rx_ring_inuse; + error = hv_rf_on_device_add(sc, &device_info, &ring_cnt, + &sc->hn_rx_ring[0]); if (error) { NV_LOCK(sc); sc->temp_unusable = FALSE; NV_UNLOCK(sc); break; } - KASSERT(sc->hn_rx_ring_cnt == sc->net_dev->num_channel, + /* # of channels can _not_ be changed */ + KASSERT(sc->hn_rx_ring_inuse == ring_cnt, ("RX ring count %d and channel count %u mismatch", - sc->hn_rx_ring_cnt, sc->net_dev->num_channel)); - if (sc->net_dev->num_channel > 1) { + sc->hn_rx_ring_cnt, ring_cnt)); + if (sc->hn_rx_ring_inuse > 1) { int r; /* @@ -2966,7 +2967,7 @@ static void hn_subchan_setup(struct hn_softc *sc) { struct vmbus_channel **subchans; - int subchan_cnt = sc->net_dev->num_channel - 1; + int subchan_cnt = sc->hn_rx_ring_inuse - 1; int i; /* Wait for sub-channels setup to complete. */ Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Aug 19 05:30:02 2016 (r304445) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Aug 19 05:30:39 2016 (r304446) @@ -1035,7 +1035,7 @@ hv_rf_close_device(rndis_device *device) */ int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, - int nchan, struct hn_rx_ring *rxr) + int *nchan0, struct hn_rx_ring *rxr) { struct hn_send_ctx sndc; int ret; @@ -1051,6 +1051,7 @@ hv_rf_on_device_add(struct hn_softc *sc, size_t resp_len; struct vmbus_xact *xact; uint32_t status, nsubch; + int nchan = *nchan0; rndis_dev = hv_get_rndis_device(); if (rndis_dev == NULL) { @@ -1114,7 +1115,6 @@ hv_rf_on_device_add(struct hn_softc *sc, dev_info->link_state = rndis_dev->link_status; - net_dev->num_channel = 1; if (sc->hn_nvs_ver < NVSP_PROTOCOL_VERSION_5 || nchan == 1) return (0); @@ -1131,10 +1131,9 @@ hv_rf_on_device_add(struct hn_softc *sc, rsscaps.num_recv_que, nchan); if (nchan > rsscaps.num_recv_que) nchan = rsscaps.num_recv_que; - net_dev->num_channel = nchan; - if (net_dev->num_channel == 1) { - device_printf(dev, "net_dev->num_channel == 1 under VRSS\n"); + if (nchan == 1) { + device_printf(dev, "only 1 channel is supported, no vRSS\n"); goto out; } @@ -1151,7 +1150,7 @@ hv_rf_on_device_add(struct hn_softc *sc, req = vmbus_xact_req_data(xact); req->nvs_type = HN_NVS_TYPE_SUBCH_REQ; req->nvs_op = HN_NVS_SUBCH_OP_ALLOC; - req->nvs_nsubch = net_dev->num_channel - 1; + req->nvs_nsubch = nchan - 1; hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); vmbus_xact_activate(xact); @@ -1190,19 +1189,16 @@ hv_rf_on_device_add(struct hn_softc *sc, ret = EIO; goto out; } - if (nsubch > net_dev->num_channel - 1) { + if (nsubch > nchan - 1) { if_printf(sc->hn_ifp, "%u subchans are allocated, requested %u\n", - nsubch, net_dev->num_channel - 1); - nsubch = net_dev->num_channel - 1; + nsubch, nchan - 1); + nsubch = nchan - 1; } - net_dev->num_channel = nsubch + 1; - - ret = hv_rf_set_rss_param(rndis_dev, net_dev->num_channel); + nchan = nsubch + 1; + ret = hv_rf_set_rss_param(rndis_dev, nchan); + *nchan0 = nchan; out: - if (ret) - net_dev->num_channel = 1; - return (ret); } Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Fri Aug 19 05:30:02 2016 (r304445) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Fri Aug 19 05:30:39 2016 (r304446) @@ -119,7 +119,7 @@ int hv_rf_on_receive(netvsc_dev *net_dev const void *data, int dlen); void hv_rf_receive_rollup(netvsc_dev *net_dev); void hv_rf_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); -int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, int nchan, +int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, int *nchan, struct hn_rx_ring *rxr); int hv_rf_on_device_remove(struct hn_softc *sc, boolean_t destroy_channel); int hv_rf_on_open(struct hn_softc *sc); From owner-svn-src-head@freebsd.org Fri Aug 19 05:33:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE706BBE793 for ; Fri, 19 Aug 2016 05:33:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pf0-x230.google.com (mail-pf0-x230.google.com [IPv6:2607:f8b0:400e:c00::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 649491A07 for ; Fri, 19 Aug 2016 05:33:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-pf0-x230.google.com with SMTP id p64so5861202pfb.1 for ; Thu, 18 Aug 2016 22:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=Jx1mP6I5p+T7MOiWki8kiNSqTNOblyPuppv3sU8Nlr4=; b=w/G6Qod0HiO25lpPbt5HIOYSgXaVXh8W6b6+1HawdlkKRW9VI3iQQ5utZsr7v/0bDu vEgtVSbjcZftyew660VfchIw2lKueNXMOwb+EJ7nGGC/BkkW7EDj69WArpRM1pP2dBK/ 9Mk3G9nqJran+3xGy1z6vyZ5NZaUvvmyJCye1eugUf2CekjLQC/4YnItEIn3L+Tj8+eQ emArG/4zvle9P/JtMM8yucNs0SD2f0G32mz1P2Ct09jf5dyI4pkLk8+3TAM8R5NCIoiS 5IFfxkia98BLTnCPEqzLY9QSy7Gw9UGMdo97ZC84h0gTL3goiR8I2aRKLglrRZNAWc1P x7Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=Jx1mP6I5p+T7MOiWki8kiNSqTNOblyPuppv3sU8Nlr4=; b=F4/Jg7FLm7DTqLGz+rShVkl+5hNSoQ94zJO/j5/KRFQh3YLeFB4LWz0P77TCyQwZ0S 4VKXIwrOkzlO4N6Jk7OV6hX251wrJzDqtA7BOaA5VGsMujveGfNdz5McODPXAuiAwZ/R QIdlpXRwaY3OkCtP3X9pBCSU1/l9sG9WeWrlknXHRZTBvz4PPNpMtUmXVd7Z/m7XX9s6 LcERW8tBVzn4+9KdycBG0/5DdjGFtFSzGeMhKeUS29/3UYz7DgD3FZUTNa8tePR6zZRs Cj3H2kY/7H4rCahh/TODG+occlUKtgsfPS4dgAqggn5ohLiES2e83/Bb9RJ755Q6LEGe ibVg== X-Gm-Message-State: AEkoouv8+1jccoJuTCk/LMRz3Q+dLhoPzOBdWkBRQWYJlVrlMn6eU6xNO8Sth+BQO/voNw== X-Received: by 10.98.210.69 with SMTP id c66mr10909746pfg.71.1471584819461; Thu, 18 Aug 2016 22:33:39 -0700 (PDT) Received: from [100.127.66.142] ([69.53.245.200]) by smtp.gmail.com with ESMTPSA id n80sm2805889pfi.19.2016.08.18.22.33.37 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Aug 2016 22:33:38 -0700 (PDT) Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_57E9FE32-7095-4F78-A44E-0613250B6CE9"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: Warner Losh In-Reply-To: <081362ef-ff4a-61d5-46e4-9a4cf8b699ee@freebsd.org> Date: Thu, 18 Aug 2016 23:33:36 -0600 Cc: Warner Losh , Allan Jude , =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <880977BE-F00F-4188-A978-F292AB452C79@bsdimp.com> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> <081362ef-ff4a-61d5-46e4-9a4cf8b699ee@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 05:33:40 -0000 --Apple-Mail=_57E9FE32-7095-4F78-A44E-0613250B6CE9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 18, 2016, at 11:21 PM, Nathan Whitehorn = wrote: >=20 >=20 >=20 > On 08/18/16 21:15, Warner Losh wrote: >> On Thu, Aug 18, 2016 at 6:56 AM, Allan Jude = wrote: >>> On 08/18/16 05:50 AM, Dag-Erling Sm=C3=B8rgrav wrote: >>>> Nathan Whitehorn writes: >>>>> OK. In which configurations? My Dell servers, for instance, don't = do >>>>> this. How are they set up? What drivers are being used? Is this >>>>> something that affects passthrough disks, RAIDs, disk images? >>>> Most LSI MegaRAID controllers don't have real passthrough, only = JBOD. >>>> You can query the drive with "camcontrol identify passX", but the >>>> controller does not report a stripe size for the volume (mfidY). >>>>=20 >>>>> The point is that *if the reported stripe size is wrong*, more = things >>>>> than partition alignment in the installer will suffer for it. >>>> It's not wrong, it's non-existent, and I'm getting really tired of >>>> repeating myself. >>>>=20 >>>>> Fixing the installer with a bandaid in the run-up to a release is >>>>> fine, but *we need to fix the underlying problem*. >>>> We can't, because hardware sucks, and I'm getting really tired of >>>> repeating myself. >>>>=20 >>>> DES >>>>=20 >>> Which makes more sense: >>>=20 >>> A) If stripesize =3D=3D 0, use some sane value like 4096 >> I don't like this. >>=20 >>> B) Some other combination that uses the reported stripe size, unless = it >>> is 0, in which case it uses 4096 (or some other value controlled by = a >>> different new sysctl) >> Don't like this so much. >>=20 >>> C) create kern.geom.min_stripe_size with a default of 512, but users = can >>> set 4096 if they use only 4k devices. (doesn't really solve the = problem >>> for the installer) >> Default it to 4k, and allow users to set it to 512. If the drive >> reports < this value >> report this value instead. You'll need to make this a tunable. Then = the upper >> layers wouldn't care. There's a small chance that some SD cards might = be >> reporting values that are too large. But I think it is confined to SD = cards and >> if I see too many more I'll do something specific in the SD driver. >>=20 >> Warner >>=20 >>=20 >=20 > That sounds good to me and I think can clean up a lot of code and = potential foot-shooting. Who is planning to make the patch? I'm happy to = do anything that would be helpful. The patch is super-easy, but I need to get the concept validated and = make sure that it does not have unintended side effects. Warner --Apple-Mail=_57E9FE32-7095-4F78-A44E-0613250B6CE9 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 iQIcBAEBCgAGBQJXtpowAAoJEGwc0Sh9sBEAim0QAK13yHj3lbOzgRjx2Nh+FVAY BCLWRCEZC06sZ2cSxYi0LuTqgArYOKOXcgOacDDM2EbQz55Gj8SPWUenTIk0OVt/ 8BKnIytKqrv6mganZ7Rgyq0JLYmdcohAmqTDivrkx5Z983nwoMbYkAafrPKpjpL/ 3awi6+yUMw1s82jmQ3XbzDT8kfSI2aExgnJa9YRJ8R/oRZpVIWKJTY27lQHzDef/ OsTOtC/OjRQ7V7WHacyL2Pfm0XOFTM0JjPp0GK9BZy8LrtEle9ybRg4fnCo1wdwp dx2evQX6jmxG1mzHiMElpm6bN4A4PpWzjrSOQ4PO+1Ep4yd/OieDH5JmPoiGYywg qSssFUAyunf+4qW97pjwa7o+epR4iub7ITBaPyQgfFQvzn0BOnhNRCvVrTmxwcKN 6gDuwgFoaEIVP6bWlYENKMZsUtnqYzYyazEDT2pptE4wpjerw7i8LGC53f0Pz21+ /N5+hSnqZ3EvuQKX4FUKoiAl0x/1OASYYdjOCsq2sv3HZ04u7Mrbusjxk8eWGrLb 2od39bX9Ew4RhCFMxUNL4z0hci1LRTHWFnjhajXyDmX/rns8BuhFCHvtoohG4N6j C8uT14L6Oczlh1hc0GPfxyFeUCjSxX30OAiLvrHAnatGML+XQ1x/WSjWg+kmVmXd 4y4qoA5bnwxHL1GILyir =smyh -----END PGP SIGNATURE----- --Apple-Mail=_57E9FE32-7095-4F78-A44E-0613250B6CE9-- From owner-svn-src-head@freebsd.org Fri Aug 19 05:43:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 057C5BBE9C8; Fri, 19 Aug 2016 05:43:30 +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 B0D901E87; Fri, 19 Aug 2016 05:43:29 +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 u7J5hSKv055334; Fri, 19 Aug 2016 05:43:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J5hSJi055331; Fri, 19 Aug 2016 05:43:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608190543.u7J5hSJi055331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 19 Aug 2016 05:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304447 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 05:43:30 -0000 Author: sephe Date: Fri Aug 19 05:43:28 2016 New Revision: 304447 URL: https://svnweb.freebsd.org/changeset/base/304447 Log: hyperv/hn: Move RXBUF to hn_softc And don't recreate RXBUF for each primary channel open, it is now created in device_attach DEVMETHOD and destroyed in device_detach DEVMETHOD. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7556 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 19 05:30:39 2016 (r304446) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 19 05:43:28 2016 (r304447) @@ -59,9 +59,9 @@ MALLOC_DEFINE(M_NETVSC, "netvsc", "Hyper static void hv_nv_on_channel_callback(struct vmbus_channel *chan, void *xrxr); static int hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc); -static int hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *); +static int hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *, int); static int hv_nv_destroy_send_buffer(netvsc_dev *net_dev); -static int hv_nv_destroy_rx_buffer(netvsc_dev *net_dev); +static int hv_nv_destroy_rx_buffer(struct hn_softc *sc); static int hv_nv_connect_to_vsp(struct hn_softc *sc); static void hv_nv_on_send_completion(netvsc_dev *net_dev, struct vmbus_channel *, const struct vmbus_chanpkt_hdr *pkt); @@ -146,29 +146,18 @@ hv_nv_get_next_send_section(netvsc_dev * * Hyper-V extensible switch and the synthetic data path. */ static int -hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *sc) +hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *sc, int rxbuf_size) { struct vmbus_xact *xact; struct hn_nvs_rxbuf_conn *conn; const struct hn_nvs_rxbuf_connresp *resp; size_t resp_len; struct hn_send_ctx sndc; - netvsc_dev *net_dev; uint32_t status; int error; - net_dev = hv_nv_get_outbound_net_device(sc); - if (!net_dev) { - return (ENODEV); - } - - net_dev->rx_buf = hyperv_dmamem_alloc(bus_get_dma_tag(sc->hn_dev), - PAGE_SIZE, 0, net_dev->rx_buf_size, &net_dev->rxbuf_dma, - BUS_DMA_WAITOK | BUS_DMA_ZERO); - if (net_dev->rx_buf == NULL) { - device_printf(sc->hn_dev, "allocate rxbuf failed\n"); - return (ENOMEM); - } + KASSERT(rxbuf_size <= NETVSC_RECEIVE_BUFFER_SIZE, + ("invalid rxbuf size %d", rxbuf_size)); /* * Connect the RXBUF GPADL to the primary channel. @@ -178,8 +167,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct * just share this RXBUF. */ error = vmbus_chan_gpadl_connect(sc->hn_prichan, - net_dev->rxbuf_dma.hv_paddr, net_dev->rx_buf_size, - &net_dev->rx_buf_gpadl_handle); + sc->hn_rxbuf_dma.hv_paddr, rxbuf_size, &sc->hn_rxbuf_gpadl); if (error) { if_printf(sc->hn_ifp, "rxbuf gpadl connect failed: %d\n", error); @@ -199,7 +187,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct conn = vmbus_xact_req_data(xact); conn->nvs_type = HN_NVS_TYPE_RXBUF_CONN; - conn->nvs_gpadl = net_dev->rx_buf_gpadl_handle; + conn->nvs_gpadl = sc->hn_rxbuf_gpadl; conn->nvs_sig = HN_NVS_RXBUF_SIG; hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); @@ -239,12 +227,12 @@ hv_nv_init_rx_buffer_with_net_vsp(struct error = EIO; goto cleanup; } - net_dev->rx_section_count = 1; + sc->hn_flags |= HN_FLAG_RXBUF_CONNECTED; return (0); cleanup: - hv_nv_destroy_rx_buffer(net_dev); + hv_nv_destroy_rx_buffer(sc); return (error); } @@ -376,11 +364,11 @@ cleanup: * Net VSC destroy receive buffer */ static int -hv_nv_destroy_rx_buffer(netvsc_dev *net_dev) +hv_nv_destroy_rx_buffer(struct hn_softc *sc) { int ret = 0; - if (net_dev->rx_section_count) { + if (sc->hn_flags & HN_FLAG_RXBUF_CONNECTED) { struct hn_nvs_rxbuf_disconn disconn; /* @@ -391,37 +379,30 @@ hv_nv_destroy_rx_buffer(netvsc_dev *net_ disconn.nvs_sig = HN_NVS_RXBUF_SIG; /* NOTE: No response. */ - ret = hn_nvs_send(net_dev->sc->hn_prichan, + ret = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE, &disconn, sizeof(disconn), &hn_send_ctx_none); if (ret != 0) { - if_printf(net_dev->sc->hn_ifp, + if_printf(sc->hn_ifp, "send rxbuf disconn failed: %d\n", ret); return (ret); } - net_dev->rx_section_count = 0; + sc->hn_flags &= ~HN_FLAG_RXBUF_CONNECTED; } - /* Tear down the gpadl on the vsp end */ - if (net_dev->rx_buf_gpadl_handle) { - ret = vmbus_chan_gpadl_disconnect(net_dev->sc->hn_prichan, - net_dev->rx_buf_gpadl_handle); + if (sc->hn_rxbuf_gpadl != 0) { /* - * If we failed here, we might as well return and have a leak - * rather than continue and a bugchk + * Disconnect RXBUF from primary channel. */ + ret = vmbus_chan_gpadl_disconnect(sc->hn_prichan, + sc->hn_rxbuf_gpadl); if (ret != 0) { + if_printf(sc->hn_ifp, + "rxbuf disconn failed: %d\n", ret); return (ret); } - net_dev->rx_buf_gpadl_handle = 0; + sc->hn_rxbuf_gpadl = 0; } - - if (net_dev->rx_buf) { - /* Free up the receive buffer */ - hyperv_dmamem_free(&net_dev->rxbuf_dma, net_dev->rx_buf); - net_dev->rx_buf = NULL; - } - return (ret); } @@ -583,6 +564,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc device_t dev = sc->hn_dev; struct ifnet *ifp = sc->hn_ifp; struct hn_nvs_ndis_init ndis; + int rxbuf_size; net_dev = hv_nv_get_outbound_net_device(sc); @@ -637,12 +619,12 @@ hv_nv_connect_to_vsp(struct hn_softc *sc /* Post the big receive buffer to NetVSP */ if (sc->hn_nvs_ver <= NVSP_PROTOCOL_VERSION_2) - net_dev->rx_buf_size = NETVSC_RECEIVE_BUFFER_SIZE_LEGACY; + rxbuf_size = NETVSC_RECEIVE_BUFFER_SIZE_LEGACY; else - net_dev->rx_buf_size = NETVSC_RECEIVE_BUFFER_SIZE; + rxbuf_size = NETVSC_RECEIVE_BUFFER_SIZE; net_dev->send_buf_size = NETVSC_SEND_BUFFER_SIZE; - ret = hv_nv_init_rx_buffer_with_net_vsp(sc); + ret = hv_nv_init_rx_buffer_with_net_vsp(sc, rxbuf_size); if (ret == 0) ret = hv_nv_init_send_buffer_with_net_vsp(sc); @@ -654,10 +636,10 @@ cleanup: * Net VSC disconnect from VSP */ static void -hv_nv_disconnect_from_vsp(netvsc_dev *net_dev) +hv_nv_disconnect_from_vsp(struct hn_softc *sc) { - hv_nv_destroy_rx_buffer(net_dev); - hv_nv_destroy_send_buffer(net_dev); + hv_nv_destroy_rx_buffer(sc); + hv_nv_destroy_send_buffer(sc->net_dev); } void @@ -731,17 +713,14 @@ cleanup: int hv_nv_on_device_remove(struct hn_softc *sc, boolean_t destroy_channel) { - netvsc_dev *net_dev = sc->net_dev;; - hv_nv_disconnect_from_vsp(net_dev); - - /* At this point, no one should be accessing net_dev except in here */ + hv_nv_disconnect_from_vsp(sc); /* Now, we can close the channel safely */ vmbus_chan_close(sc->hn_prichan); - free(net_dev, M_NETVSC); + free(sc->net_dev, M_NETVSC); return (0); } @@ -865,7 +844,7 @@ hv_nv_on_receive(netvsc_dev *net_dev, st /* Each range represents 1 RNDIS pkt that contains 1 Ethernet frame */ for (i = 0; i < count; i++) { hv_rf_on_receive(net_dev, rxr, - (const uint8_t *)net_dev->rx_buf + pkt->cp_rxbuf[i].rb_ofs, + rxr->hn_rxbuf + pkt->cp_rxbuf[i].rb_ofs, pkt->cp_rxbuf[i].rb_len); } Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 05:30:39 2016 (r304446) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 05:43:28 2016 (r304447) @@ -227,16 +227,9 @@ typedef struct netvsc_dev_ { unsigned long bitsmap_words; unsigned long *send_section_bitsmap; - /* Receive buffer allocated by us but managed by NetVSP */ - void *rx_buf; - uint32_t rx_buf_size; - uint32_t rx_buf_gpadl_handle; - uint32_t rx_section_count; - /* Holds rndis device info */ void *extension; - struct hyperv_dma rxbuf_dma; struct hyperv_dma txbuf_dma; } netvsc_dev; @@ -286,6 +279,7 @@ struct hn_rx_ring { struct ifnet *hn_ifp; struct hn_tx_ring *hn_txr; void *hn_rdbuf; + uint8_t *hn_rxbuf; /* shadow sc->hn_rxbuf */ int hn_rx_idx; /* Trust csum verification on host side */ @@ -395,8 +389,15 @@ typedef struct hn_softc { struct sysctl_oid *hn_rx_sysctl_tree; struct vmbus_xact_ctx *hn_xact; uint32_t hn_nvs_ver; + + uint32_t hn_flags; + void *hn_rxbuf; + uint32_t hn_rxbuf_gpadl; + struct hyperv_dma hn_rxbuf_dma; } hn_softc_t; +#define HN_FLAG_RXBUF_CONNECTED 0x0001 + /* * Externs */ Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Aug 19 05:30:39 2016 (r304446) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Aug 19 05:43:28 2016 (r304447) @@ -342,7 +342,7 @@ static void hn_start_taskfunc(void *, in static void hn_start_txeof_taskfunc(void *, int); static void hn_stop_tx_tasks(struct hn_softc *); static int hn_encap(struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **); -static void hn_create_rx_data(struct hn_softc *sc, int); +static int hn_create_rx_data(struct hn_softc *sc, int); static void hn_destroy_rx_data(struct hn_softc *sc); static void hn_set_tx_chimney_size(struct hn_softc *, int); static void hn_channel_attach(struct hn_softc *, struct vmbus_channel *); @@ -504,7 +504,9 @@ netvsc_attach(device_t dev) error = hn_create_tx_data(sc, tx_ring_cnt); if (error) goto failed; - hn_create_rx_data(sc, ring_cnt); + error = hn_create_rx_data(sc, ring_cnt); + if (error) + goto failed; /* * Associate the first TX/RX ring w/ the primary channel. @@ -2176,7 +2178,7 @@ hn_check_iplen(const struct mbuf *m, int return ip->ip_p; } -static void +static int hn_create_rx_data(struct hn_softc *sc, int ring_cnt) { struct sysctl_oid_list *child; @@ -2189,6 +2191,22 @@ hn_create_rx_data(struct hn_softc *sc, i #endif int i; + /* + * Create RXBUF for reception. + * + * NOTE: + * - It is shared by all channels. + * - A large enough buffer is allocated, certain version of NVSes + * may further limit the usable space. + */ + sc->hn_rxbuf = hyperv_dmamem_alloc(bus_get_dma_tag(dev), + PAGE_SIZE, 0, NETVSC_RECEIVE_BUFFER_SIZE, &sc->hn_rxbuf_dma, + BUS_DMA_WAITOK | BUS_DMA_ZERO); + if (sc->hn_rxbuf == NULL) { + device_printf(sc->hn_dev, "allocate rxbuf failed\n"); + return (ENOMEM); + } + sc->hn_rx_ring_cnt = ring_cnt; sc->hn_rx_ring_inuse = sc->hn_rx_ring_cnt; @@ -2225,6 +2243,7 @@ hn_create_rx_data(struct hn_softc *sc, i rxr->hn_txr = &sc->hn_tx_ring[i]; rxr->hn_rdbuf = malloc(NETVSC_PACKET_SIZE, M_NETVSC, M_WAITOK); rxr->hn_rx_idx = i; + rxr->hn_rxbuf = sc->hn_rxbuf; /* * Initialize LRO. @@ -2331,6 +2350,8 @@ hn_create_rx_data(struct hn_softc *sc, i CTLFLAG_RD, &sc->hn_rx_ring_cnt, 0, "# created RX rings"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rx_ring_inuse", CTLFLAG_RD, &sc->hn_rx_ring_inuse, 0, "# used RX rings"); + + return (0); } static void @@ -2354,6 +2375,11 @@ hn_destroy_rx_data(struct hn_softc *sc) sc->hn_rx_ring_cnt = 0; sc->hn_rx_ring_inuse = 0; + + if (sc->hn_rxbuf != NULL) { + hyperv_dmamem_free(&sc->hn_rxbuf_dma, sc->hn_rxbuf); + sc->hn_rxbuf = NULL; + } } static int From owner-svn-src-head@freebsd.org Fri Aug 19 05:50:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54AE0BBEC01; Fri, 19 Aug 2016 05:50:51 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.fer.hr", Issuer "TERENA SSL CA 3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7A371366; Fri, 19 Aug 2016 05:50:49 +0000 (UTC) (envelope-from zec@fer.hr) Received: from x23 (31.147.40.243) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server (TLS) id 14.3.279.2; Fri, 19 Aug 2016 07:49:31 +0200 Date: Fri, 19 Aug 2016 07:49:20 +0200 From: Marko Zec To: Ryan Stone CC: , , Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160819074920.52c46f57@x23> In-Reply-To: <201608182259.u7IMx5oW002018@repo.freebsd.org> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd10.1) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [31.147.40.243] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 05:50:51 -0000 On Thu, 18 Aug 2016 22:59:05 +0000 Ryan Stone wrote: > Author: rstone > Date: Thu Aug 18 22:59:05 2016 > New Revision: 304436 > URL: https://svnweb.freebsd.org/changeset/base/304436 > > Log: > Don't check for broadcast IPs on non-bcast pkts > > in_broadcast() can be quite expensive, so skip calling it if the > incoming mbuf wasn't sent to a broadcast L2 address in the first > place. > > Reviewed by: gnn > MFC after: 2 months > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D7309 > > Modified: > head/UPDATING > head/sys/netinet/udp_usrreq.c > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Thu Aug 18 22:59:00 2016 (r304435) > +++ head/UPDATING Thu Aug 18 22:59:05 2016 (r304436) > @@ -32,6 +32,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > 20160818: > + The UDP receive code has been updated to only treat incoming > UDP > + packets that were addressed to an L2 broadcast address as L3 > + broadcast packets. It is not expected that this will affect > any > + standards-conforming UDP application. The new behaviour can > be > + disabled by setting the sysctl net.inet.udp.require_l2_bcast > to > + 0. > + > +20160818: > Remove the openbsd_poll system call. > __FreeBSD_version has been bumped because of this. > > > Modified: head/sys/netinet/udp_usrreq.c > ============================================================================== > --- head/sys/netinet/udp_usrreq.c Thu Aug 18 22:59:00 > 2016 (r304435) +++ head/sys/netinet/udp_usrreq.c Thu > Aug 18 22:59:05 2016 (r304436) @@ -126,6 +126,11 @@ > SYSCTL_INT(_net_inet_udp, OID_AUTO, blac &VNET_NAME(udp_blackhole), 0, > "Do not send port unreachables for refused connects"); > > +static VNET_DEFINE(int, udp_require_l2_bcast) = 1; > +SYSCTL_INT(_net_inet_udp, OID_AUTO, require_l2_bcast, CTLFLAG_VNET | > CTLFLAG_RW, > + &VNET_NAME(udp_require_l2_bcast), 0, > + "Only treat packets sent to an L2 broadcast address as broadcast > packets"); + > u_long udp_sendspace = 9216; /* really max > datagram size */ SYSCTL_ULONG(_net_inet_udp, UDPCTL_MAXDGRAM, > maxdgram, CTLFLAG_RW, &udp_sendspace, 0, "Maximum outgoing UDP > datagram size"); @@ -523,7 +528,8 @@ udp_input(struct mbuf **mp, int > *offp, i > pcbinfo = udp_get_inpcbinfo(proto); > if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || > - in_broadcast(ip->ip_dst, ifp)) { > + ((!VNET_NAME(udp_require_l2_bcast) || m->m_flags & > M_BCAST) && > + in_broadcast(ip->ip_dst, ifp))) { > struct inpcb *last; > struct inpcbhead *pcblist; > struct ip_moptions *imo; > VNET_NAME() macros should be used only within SYSCTL_* macros, otherwise (if I recall it correctly) this won't work with options VIMAGE enabled, so please don't use VNET_NAME() inside function bodies, or anywhere else. An accessor macro needs to resolve the variable inside the curvnet, and VNET() is the macro which accomplishes that, while VNET_NAME() doesn't. The norm is to declare an abbreviated accessor macro along the VNET_DEFINE() variable declaration, such as: #define V_udp_require_l2_bcast VNET(udp_require_l2_bcast) and then to use that accessor macro throught the rest of the code. Marko From owner-svn-src-head@freebsd.org Fri Aug 19 06:23:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AAF3BBF212; Fri, 19 Aug 2016 06:23:18 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id C4FB212A9; Fri, 19 Aug 2016 06:23:17 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 1CE23492B; Fri, 19 Aug 2016 06:23:16 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 04B588FEE; Fri, 19 Aug 2016 08:21:50 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <544c64f4-693a-c5bc-1fb2-e696589583b3@freebsd.org> <867fbe3yd3.fsf@desk.des.no> <4d097835-66ce-72b6-c774-a87e38d88625@freebsd.org> Date: Fri, 19 Aug 2016 08:21:49 +0200 In-Reply-To: <4d097835-66ce-72b6-c774-a87e38d88625@freebsd.org> (Nathan Whitehorn's message of "Thu, 18 Aug 2016 11:35:18 -0700") Message-ID: <86mvk9cm82.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 06:23:18 -0000 Nathan Whitehorn writes: > This is ridiculous. I've asked a series of technical questions about > generalizing a patch you made and that I think is a good idea. In > response, those questions have been met with a non-stop torrent of > insults and abuse instead of answers, with only one eventual nugget of > information in response to one of them -- that you ran into problems > with mfid -- to redeem it. I'm done with this discussion. I suggest you go and read through the discussion again. I gave you plenty of information, mentioning LSI and hypervisors, for instance, and even, as I grew increasingly frustrated by your stonewalling, showed you how to inspect the code to confirm that most RAID drivers do not even try to report a stripe size. Meanwhile, you steadfastedly refused to address my arguments, simply repeating your position again and again, and insisting that the fact that you have never encountered any systems that get the stripe size wrong (which I don't believe, but I'm willing to believe that you've never noticed) invalidates the fact that I have. Not to mention your steadfast defense of the non-existent purity of the installer. When Warner finally intervened, you switched to setting up strawmen, asking me to pick and defend one of two positions which I've never held. I'm not going to play that game. > Hopefully we can have a real conversation about this at this some > point after the release. Likewise, but I'm not holding my breath. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Fri Aug 19 06:44:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BE69BBF5C3; Fri, 19 Aug 2016 06:44:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 10BD21ABA; Fri, 19 Aug 2016 06:44:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 58BA7163D; Fri, 19 Aug 2016 06:44:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Fri, 19 Aug 2016 06:44:15 +0000 From: Glen Barber To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Cc: Nathan Whitehorn , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit Message-ID: <20160819064415.GB765@FreeBSD.org> References: <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <544c64f4-693a-c5bc-1fb2-e696589583b3@freebsd.org> <867fbe3yd3.fsf@desk.des.no> <4d097835-66ce-72b6-c774-a87e38d88625@freebsd.org> <86mvk9cm82.fsf@desk.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Rln2GmQ7CFmDhc9B" Content-Disposition: inline In-Reply-To: <86mvk9cm82.fsf@desk.des.no> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 06:44:18 -0000 --Rln2GmQ7CFmDhc9B Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 19, 2016 at 08:21:49AM +0200, Dag-Erling Sm=F8rgrav wrote: > Nathan Whitehorn writes: > > This is ridiculous. I've asked a series of technical questions about > > generalizing a patch you made and that I think is a good idea. In > > response, those questions have been met with a non-stop torrent of > > insults and abuse instead of answers, with only one eventual nugget of > > information in response to one of them -- that you ran into problems > > with mfid -- to redeem it. I'm done with this discussion. >=20 > I suggest you go and read through the discussion again. I gave you > plenty of information, mentioning LSI and hypervisors, for instance, and > even, as I grew increasingly frustrated by your stonewalling, showed you > how to inspect the code to confirm that most RAID drivers do not even > try to report a stripe size. Meanwhile, you steadfastedly refused to > address my arguments, simply repeating your position again and again, > and insisting that the fact that you have never encountered any systems > that get the stripe size wrong (which I don't believe, but I'm willing > to believe that you've never noticed) invalidates the fact that I have. > Not to mention your steadfast defense of the non-existent purity of the > installer. When Warner finally intervened, you switched to setting up > strawmen, asking me to pick and defend one of two positions which I've > never held. I'm not going to play that game. >=20 > > Hopefully we can have a real conversation about this at this some > > point after the release. >=20 > Likewise, but I'm not holding my breath. >=20 I'll mediate this then. Not right now. I think everyone needs to step back for a bit. Glen --Rln2GmQ7CFmDhc9B Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXtqq/AAoJEAMUWKVHj+KTYtYP/2BlDNU4cSPylfQ7LRQ2wr2t VW3IOgQa/weH6GF0+7suo/CLnOAS08sb38YsAf3V6AA3KlcatU/HNhvgJ8u8NHUC ULT15coffzQzMcfsLLK2zeWV7etElPNbWtu3y9LbYWafJcjqMYMMREDMn0nYr30X oXcUC1nv7ArM9xM1jUVERC0Va1/ZNr0O4adicVSxHL5PwnKTvguCAGz1ma+VFELy ggaMy14Id38N9bCp7uOyq3TDc9I8GRSERDcbbhf5xWqdb+7UJl5uUzuSTcNdxli+ Zi3fKmy9MsuKaQnHQL+5EiH+VZzmye2UzG8vBpG+hJlY0ump6TwGG4ew1dWinBPP 8RWCybkyuwDL0q6Kj1QVa7BRg653DW2KQRz2LZWlJRk0Hu9Tv99Ertd+kHZrfUqi x1MltUnyOUM+QPSoOLcfrjaMeh7Yw29ATCbxMhCyynO3USKyh9zUj4HwnbaBUn7A tly2VcRSOXUuCZ8OffjmuD1NYFCnSEfE0UE69i28CyT1NF49Yk7vkME4tiUw/Qgs E2pGsvpBe+pHS1b0XD/37zObd/2LB4YGq1Ng+FWvSIV2YJbC5LuwerI3WSlpho2Y i0J9zf6yWIIddji5TFRV60C40oyHs9JnSq4r60JS9pdkP4rkxm7acLfoX/j7J70t SJ62Pkze2omoyB8ngmUj =i5oO -----END PGP SIGNATURE----- --Rln2GmQ7CFmDhc9B-- From owner-svn-src-head@freebsd.org Fri Aug 19 06:52:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 395E4BBF813; Fri, 19 Aug 2016 06:52:29 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id EE3E51181; Fri, 19 Aug 2016 06:52:28 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 32E5F496D; Fri, 19 Aug 2016 06:52:27 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 1E18B8FF3; Fri, 19 Aug 2016 08:51:01 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Warner Losh Cc: Allan Jude , Nathan Whitehorn , src-committers , "svn-src-all\@freebsd.org" , "svn-src-head\@freebsd.org" Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> Date: Fri, 19 Aug 2016 08:51:01 +0200 In-Reply-To: (Warner Losh's message of "Thu, 18 Aug 2016 22:15:12 -0600") Message-ID: <86inuxckve.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 06:52:29 -0000 Warner Losh writes: > Allan Jude writes: > > Which makes more sense: > > > > A) If stripesize =3D=3D 0, use some sane value like 4096 > > I don't like this. > > > B) Some other combination that uses the reported stripe size, unless it > > is 0, in which case it uses 4096 (or some other value controlled by a > > different new sysctl) > > Don't like this so much. > > > C) create kern.geom.min_stripe_size with a default of 512, but users can > > set 4096 if they use only 4k devices. (doesn't really solve the problem > > for the installer) > > Default it to 4k, and allow users to set it to 512. If the drive > reports < this value > report this value instead. I don't like either option. Option D (which I don't like either, but which should at least work in most cases) is a sysctl that specifies a minimum factor, and set the reported stripe size to the least common multiple of that number and the actual stripe or sector size. This is what my bsdinstall patch does. However, I think that pushing this down to a layer where it will affect all applications is a terrible idea, because we have no way of knowing what will break[*], and it can seriously mislead users and hinder troubleshooting - especially if it is enabled by default rather than only when necessary. I don't think it's a good idea to enforce stripe alignment everywhere, either. It works for partitions because they are very large relative to the stripe size, and at worst we will waste a few millionths of the disk on inter-partition gaps, which should only occur between the partition table and the boot partition, and possibly, if the stripe size is very large, between the boot partition and the swap partition. But forcing filesystems to respect the stripe size will lead to no end of trouble, because RAID volumes can have stripe sizes of 16 kB or more. I think it is important to align partitions during installation because of the huge performance impact of misaligned partitions on AF disks, but despite what Nathan claims, I never advocated applying the same logic everywhere. [*] Apart from audio CDs. We already know that it will break those. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Fri Aug 19 07:40:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C7EFBBF080; Fri, 19 Aug 2016 07:40:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAF0516F1; Fri, 19 Aug 2016 07:40:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7J7dti7018946 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 19 Aug 2016 10:39:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7J7dti7018946 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7J7dt9G018945; Fri, 19 Aug 2016 10:39:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 19 Aug 2016 10:39:55 +0300 From: Konstantin Belousov To: Warner Losh Cc: Julian Elischer , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd Message-ID: <20160819073955.GC83214@kib.kiev.ua> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 07:40:03 -0000 On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: > On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer wrote: > > On 16/08/2016 4:54 AM, John Baldwin wrote: > >> > >> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: > >>> > >>> Author: jhb > >>> Date: Mon Aug 15 20:38:02 2016 > >>> New Revision: 304187 > >>> URL: https://svnweb.freebsd.org/changeset/base/304187 > >>> > >>> Log: > >>> Remove the mcd(4) driver for Mitsumi CD-ROM players. > >>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in > >>> the manpage, this driver is only useful as a backend to cdcontrol to > >>> play audio CDs since it doesn't use DMA, so its data performance is > >>> "abysmal" (and that was true in the mid 90's). > >> > >> No one stepped up to test patches for it either when I last posted patches > >> to > >> convert it from timeout(9) to callout(9). I have a few more drivers that > >> are > >> both very old and that people have no business using in 12 (think ISA > >> adapters that don't do DMA and can't be used with pccard) that I will be > >> removing over the next little while. I brought up a list of drivers on > >> arch@ > >> a couple of years ago and the conversation drifted off into the weeds > >> about > >> trimming GENERIC, etc. No one objected to the specific drivers I listed > >> though (and I got a few pleas of "please remove"). If someone shows up > >> desperately clutching an ISA adapter they can always dig up the source > >> from > >> svn and deal with forward porting it for whatever API changes have > >> happened > >> since it was removed. > > > > > > I would imagine any machine still holding one of these probably has not > > enough memory to run FreeBSD. > > > > would we still run in 2MB? > > With insane levels of tuning, we can run in 32MB userland that can do > things. Even 64MB is tight w/o some tuning. 16MB is almost certainly > right out except for very specialized situations. 2MB? We can't even > load the loader in that :(. Oh, and all these memory configs are only > possible if you tweak the loader's block cache... > 32MB is quite usable. Without any tuning, you get slightly less than 10MB for userspace, which is enough to for many things, and plenty if swap is added. Note that you cannot boot on such configurations since loader was broken, but if you do manage to jump to kernel, things were fine several months ago. I tested my relatively recent OOM changes on 32MB qemu config. > Warner From owner-svn-src-head@freebsd.org Fri Aug 19 08:46:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 891ECBBE6BC; Fri, 19 Aug 2016 08:46:20 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53A1816D7; Fri, 19 Aug 2016 08:46:20 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.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 463F91FE023; Fri, 19 Aug 2016 10:46:18 +0200 (CEST) Subject: Re: svn commit: r304439 - head/sys/dev/usb/net To: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608190050.u7J0oWkW043171@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> Date: Fri, 19 Aug 2016 10:50:47 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201608190050.u7J0oWkW043171@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 08:46:20 -0000 On 08/19/16 02:50, Pyun YongHyeon wrote: > Modified: head/sys/dev/usb/net/if_axgereg.h > ============================================================================== > --- head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:03:41 2016 (r304438) > +++ head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:50:32 2016 (r304439) > @@ -156,19 +156,20 @@ enum { > struct axge_frame_txhdr { > #if BYTE_ORDER == LITTLE_ENDIAN > uint32_t len; > -#define AXGE_TXLEN_MASK 0x0001FFFF > -#define AXGE_VLAN_INSERT 0x20000000 > -#define AXGE_CSUM_DISABLE 0x80000000 > uint32_t mss; > -#define AXGE_MSS_MASK 0x00003FFF > -#define AXGE_PADDING 0x80008000 > -#define AXGE_VLAN_TAG_MASK 0xFFFF0000 > #else > uint32_t mss; > uint32_t len; > #endif > } __packed; > Hi, Is it correct to switch the order of mss and len variables for bit/little endian? Looks buggy to me. --HPS From owner-svn-src-head@freebsd.org Fri Aug 19 08:48:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB653BBE733; Fri, 19 Aug 2016 08:48:54 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ua0-x232.google.com (mail-ua0-x232.google.com [IPv6:2607:f8b0:400c:c08::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 77A0C1871; Fri, 19 Aug 2016 08:48:54 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ua0-x232.google.com with SMTP id 74so69335284uau.0; Fri, 19 Aug 2016 01:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XgJJBoLT8Eilx3lX4NSIJ2hCmPe08Eoi3Gcb4LrUeMo=; b=QwqFQ/4cIdyq6h9C14Jrt0QB3knr+g/2Yrx9RTx2KF3TRUkHWpfh2ZQ6hFvOgmxO3t Z+AuULDmilgYvVrFVkpp1iG4fQfwnzbhlEM/Tw+nuU6aS/eLGfe+OvTDqUMZufp9V6HT 7DeLLWWedJ5JLdPn5Sp0vIsAqkipJnBDYK4xqesfWvAtf02zDgIjOfpEsqmce8DDuJUV E5TcCDfdTjGyye/v5P7AhfJ1Wfed7080UqyZITcvwHe4rx0t5NFl+ynx7eHMkEL48t20 htHcHHUn9G42zmhqaPiSGBqjAKn3AP8z5hNh20Dsn51Rp8GkYGExRIcyYP8k00ZxRP3q XtRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XgJJBoLT8Eilx3lX4NSIJ2hCmPe08Eoi3Gcb4LrUeMo=; b=gV02Kkog5HeoRkK0RjKBJN2vD0pfRrUYnHFJRJMueVSvcXZQ/QVUoccLR0lSCTPIUB 6oyliP7ZMCm4PvpdgHKA6TDPyNunPSccy00gtE4j/GMolrqiXsgvLE1axn8Lbm1p06eC hFShfkoRZhw9dthyOZcDP4kNi1kPzOatc/BbrGJfl3VEOSlJxGe+Wlp+bGLd2Py0+QLU Hb7fjQxZv7iasZzch0ctg8DgHtGPtjHjfae0RS0K5eYqMjA9kSxBDXdNSmBYOoBhTymX LedUG8LIYjiKQO1cMCST3GbcqU4kHLbntI3Gjusdmt29aeGkg9qxophYmHqnuQWVxfox eopw== X-Gm-Message-State: AEkoouu3iHkwN/z00M3I0u7stXnlLdnKvO49TcxWn/7VSFHB7BDF0pmG6qO26HvOJOkKwjYhEKzTJN2WtqRR5g== X-Received: by 10.176.0.115 with SMTP id 106mr3554940uai.43.1471596533535; Fri, 19 Aug 2016 01:48:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.1.54 with HTTP; Fri, 19 Aug 2016 01:48:53 -0700 (PDT) In-Reply-To: <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> References: <201608190050.u7J0oWkW043171@repo.freebsd.org> <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> From: Sepherosa Ziehau Date: Fri, 19 Aug 2016 16:48:53 +0800 Message-ID: Subject: Re: svn commit: r304439 - head/sys/dev/usb/net To: Hans Petter Selasky Cc: Pyun YongHyeon , 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.22 Precedence: list List-Id: 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, 19 Aug 2016 08:48:54 -0000 On Fri, Aug 19, 2016 at 4:50 PM, Hans Petter Selasky wrote: > On 08/19/16 02:50, Pyun YongHyeon wrote: >> >> Modified: head/sys/dev/usb/net/if_axgereg.h >> >> ============================================================================== >> --- head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:03:41 2016 >> (r304438) >> +++ head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:50:32 2016 >> (r304439) >> @@ -156,19 +156,20 @@ enum { >> struct axge_frame_txhdr { >> #if BYTE_ORDER == LITTLE_ENDIAN >> uint32_t len; >> -#define AXGE_TXLEN_MASK 0x0001FFFF >> -#define AXGE_VLAN_INSERT 0x20000000 >> -#define AXGE_CSUM_DISABLE 0x80000000 >> uint32_t mss; >> -#define AXGE_MSS_MASK 0x00003FFF >> -#define AXGE_PADDING 0x80008000 >> -#define AXGE_VLAN_TAG_MASK 0xFFFF0000 >> #else >> uint32_t mss; >> uint32_t len; >> #endif >> } __packed; >> > > Hi, > > Is it correct to switch the order of mss and len variables for bit/little > endian? Looks buggy to me. It probably is a 64bits field. IMHO, using a 64bits field and mask/shift-op probably will be better here. Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Fri Aug 19 08:50:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFA39BBE876; Fri, 19 Aug 2016 08:50:45 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp004.me.com (st13p35im-asmtp004.me.com [17.164.199.67]) (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 C39591ACC; Fri, 19 Aug 2016 08:50:45 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp004.me.com by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OC500H00EWOGM00@st13p35im-asmtp004.me.com>; Fri, 19 Aug 2016 08:50:39 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1471596639; bh=Qn2zRAbUldPkiw3VAJBhJSvOLsuK4ZF7r/VRJIhyp14=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=bpQv2ld4eAm/smsz3OUEU+tTMtRxJ83gl5gBN/ey78sOezV7Srq66mDWb6tb3IxO0 JXOa+Rx2WTeDS9R8jdnNGqyXh6f1sBmqLjJhi1BcUgCv3mjwo7WuPlm+m/cWoT4PDy UGmDs356ElYkijpRyd8Ylt9+EBIXW+pt0i3uuTXsLjlizNI8SL2GxezIAh7VJhC6QK X64JnvWCUeFMnjZieH9SSQH1xXkExQaEcafwDjc46Cr72+iG9Cdlo5MidtzGBsYeUX QvlJxztq3g7B1OIebA1rVxXbbWZz49ElrSAAKDeEjpaAodimDi2O9lEx3gKxGhv1aX gc5DqWg5gWtpw== Received: from [88.196.10.181] (181-10-196-88.dyn.estpak.ee [88.196.10.181]) by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OC5000O1F8BK040@st13p35im-asmtp004.me.com>; Fri, 19 Aug 2016 08:50:39 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-19_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1608190115 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd From: Toomas Soome In-reply-to: <20160819073955.GC83214@kib.kiev.ua> Date: Fri, 19 Aug 2016 11:50:35 +0300 Cc: Warner Losh , Julian Elischer , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-transfer-encoding: quoted-printable Message-id: <50AAF049-C8A7-4C69-A206-C3983FFA7867@me.com> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 08:50:46 -0000 > On 19. aug 2016, at 10:39, Konstantin Belousov = wrote: >=20 > On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: >> On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer = wrote: >>> On 16/08/2016 4:54 AM, John Baldwin wrote: >>>>=20 >>>> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >>>>>=20 >>>>> Author: jhb >>>>> Date: Mon Aug 15 20:38:02 2016 >>>>> New Revision: 304187 >>>>> URL: https://svnweb.freebsd.org/changeset/base/304187 >>>>>=20 >>>>> Log: >>>>> Remove the mcd(4) driver for Mitsumi CD-ROM players. >>>>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted = in >>>>> the manpage, this driver is only useful as a backend to cdcontrol = to >>>>> play audio CDs since it doesn't use DMA, so its data performance = is >>>>> "abysmal" (and that was true in the mid 90's). >>>>=20 >>>> No one stepped up to test patches for it either when I last posted = patches >>>> to >>>> convert it from timeout(9) to callout(9). I have a few more = drivers that >>>> are >>>> both very old and that people have no business using in 12 (think = ISA >>>> adapters that don't do DMA and can't be used with pccard) that I = will be >>>> removing over the next little while. I brought up a list of = drivers on >>>> arch@ >>>> a couple of years ago and the conversation drifted off into the = weeds >>>> about >>>> trimming GENERIC, etc. No one objected to the specific drivers I = listed >>>> though (and I got a few pleas of "please remove"). If someone = shows up >>>> desperately clutching an ISA adapter they can always dig up the = source >>>> from >>>> svn and deal with forward porting it for whatever API changes have >>>> happened >>>> since it was removed. >>>=20 >>>=20 >>> I would imagine any machine still holding one of these probably has = not >>> enough memory to run FreeBSD. >>>=20 >>> would we still run in 2MB? >>=20 >> With insane levels of tuning, we can run in 32MB userland that can do >> things. Even 64MB is tight w/o some tuning. 16MB is almost certainly >> right out except for very specialized situations. 2MB? We can't even >> load the loader in that :(. Oh, and all these memory configs are only >> possible if you tweak the loader's block cache... >>=20 >=20 > 32MB is quite usable. Without any tuning, you get slightly less than = 10MB > for userspace, which is enough to for many things, and plenty if swap = is > added. >=20 > Note that you cannot boot on such configurations since loader was = broken, > but if you do manage to jump to kernel, things were fine several = months > ago. I tested my relatively recent OOM changes on 32MB qemu config. >> Warner >=20 If the target is to go as low memory as possible, sure, you can strip = all off, from boot loader point, you should load kernel from stage2 and = not use loader at all (you can load and jump kernel even now from = stage2, assuming it wont need any special configuration from loader = config) etc etc. This means highly specialized build and has nothing to = do with generic all purpose system. Also at some point, there is an question about how reasonable it is to = have such configuration as part of generic code base for special bits = like boot loader itself, as the problem is, testing all those variants = is becoming impossible and even keeping reasonable code base in all of = the #if #else #endif spaghetti is getting quite hard and error prone. =46rom developers point of view, it is not really encouraging to have = possible feedback like =E2=80=9Coh, but you did break my 32MB system = boot=E2=80=9D ;) This does bring back some memories however. For first 2 = unix systems I was dealing with, one had 8MB and another had 12MB of = memory=E2=80=A6 it was ~ 1992-1993;) Right now the loader and stage2 are set to use 64MB heap to make it = possible to implement zfs feature support and later on, for more = features. Also note that UEFI setups are much harder to deal with regard of memory = management, because as long as BS are in control, you can not really = control the memory management there and can end up with fragmented = unusable (for kernel loading) layout. This is especially nasty as = apparently some (buggy) systems actually have runtime services using = boot services memory areas, so you can end up in setup where you can not = re-use BS memory and those chunks can be all over the low memory address = space=E2=80=A6=20 rgds, toomas= From owner-svn-src-head@freebsd.org Fri Aug 19 08:55:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09C3EBBEBF7; Fri, 19 Aug 2016 08:55:20 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pf0-x22e.google.com (mail-pf0-x22e.google.com [IPv6:2607:f8b0:400e:c00::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C88C01F6D; Fri, 19 Aug 2016 08:55:19 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by mail-pf0-x22e.google.com with SMTP id h186so7562989pfg.3; Fri, 19 Aug 2016 01:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=YfXQLXhfCrtbL9hEECbiVbiA7IuOyD4cPqW29dbz7Ko=; b=Yu9dTA5Yv5SFV4LsRGAckowTahqB2IMPbod+UCsv8Pl0qNWzY1jJ6f8mvdtU+Dcan2 eBl1/D2yY8XFJMgx53Fb8er3yTav5sLAzfwWXDKnwin1Iq5bNHoZlyrWpshszGrKdxbt Vko8Q/Y9PyZqjFZjoAZfac/EOyP81/GC2FQQu/vRWIntGbfiWaLKqIWlvvTIalCgSJMx LXIGvg6HQvS4CvKzH8Q3lJtq5+gpbhZtRCZ0iber8VXmaFWJgmqmOz5/CgVatJ/vOd7k qwvqVRLj6+XF5ArS69JVfyLpA+AgTNH/8c7M1aHnJH/w/WixRigN4KlNhUCugdC29a8y fmeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=YfXQLXhfCrtbL9hEECbiVbiA7IuOyD4cPqW29dbz7Ko=; b=O7lnY1vCa5lEPZG/ZoaezAP3jlWMit4kpTtQXSOnqELJ3bjNYOwIWFmjb5dgdvMwiz zSDQDOSVaVBmDOcBi+qI1GpbuKd1OBZ6WPjaE8nCKyK+n6vkKcDfyYR0GCJlnY39ZC3N lQEXABZN/bPSbrg6n9H/6e7kCdgWwYyS3WGv2uJLex/2jH7KuP/j5PZljFPjRXJtt4u4 5YsC0TRd6FGZ10On3UyhEqUE8mRYUuajR1TN54k1p0OgscquOFQuglPD6G2A9xVQ9ZPT el7MRHU7R4Kysa9Ch3TBWsxLMn+W1yCkw/6DB0zesUBOVxrNCAAYmxxpLNtcEQ4xOSI4 bGeQ== X-Gm-Message-State: AEkoouutN/LHwyPp7MkndgVeprwsHPX1hUpKLeJ3FEtpGrKz58vJ+UjzrWpZ0ydf6m5fRQ== X-Received: by 10.98.11.86 with SMTP id t83mr12085175pfi.51.1471596919354; Fri, 19 Aug 2016 01:55:19 -0700 (PDT) Received: from localhost ([106.247.248.2]) by smtp.gmail.com with ESMTPSA id xv9sm9514248pab.36.2016.08.19.01.55.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Aug 2016 01:55:18 -0700 (PDT) From: YongHyeon PYUN X-Google-Original-From: "YongHyeon PYUN" Received: by localhost (sSMTP sendmail emulation); Fri, 19 Aug 2016 17:55:11 +0900 Date: Fri, 19 Aug 2016 17:55:11 +0900 To: Hans Petter Selasky Cc: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304439 - head/sys/dev/usb/net Message-ID: <20160819085511.GF1186@michelle.fasterthan.co.kr> Reply-To: pyunyh@gmail.com References: <201608190050.u7J0oWkW043171@repo.freebsd.org> <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> User-Agent: Mutt/1.4.2.3i X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 08:55:20 -0000 On Fri, Aug 19, 2016 at 10:50:47AM +0200, Hans Petter Selasky wrote: > On 08/19/16 02:50, Pyun YongHyeon wrote: > >Modified: head/sys/dev/usb/net/if_axgereg.h > >============================================================================== > >--- head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:03:41 2016 (r304438) > >+++ head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:50:32 2016 (r304439) > >@@ -156,19 +156,20 @@ enum { > > struct axge_frame_txhdr { > > #if BYTE_ORDER == LITTLE_ENDIAN > > uint32_t len; > >-#define AXGE_TXLEN_MASK 0x0001FFFF > >-#define AXGE_VLAN_INSERT 0x20000000 > >-#define AXGE_CSUM_DISABLE 0x80000000 > > uint32_t mss; > >-#define AXGE_MSS_MASK 0x00003FFF > >-#define AXGE_PADDING 0x80008000 > >-#define AXGE_VLAN_TAG_MASK 0xFFFF0000 > > #else > > uint32_t mss; > > uint32_t len; > > #endif > > } __packed; > > > > Hi, > > Is it correct to switch the order of mss and len variables for > bit/little endian? Looks buggy to me. > I think the order is right but it was not tested on big-endian systems. From owner-svn-src-head@freebsd.org Fri Aug 19 09:07:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0590BBEFD8; Fri, 19 Aug 2016 09:07:28 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9949164F; Fri, 19 Aug 2016 09:07:28 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.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 037D01FE023; Fri, 19 Aug 2016 11:07:26 +0200 (CEST) Subject: Re: svn commit: r304439 - head/sys/dev/usb/net To: pyunyh@gmail.com References: <201608190050.u7J0oWkW043171@repo.freebsd.org> <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> <20160819085511.GF1186@michelle.fasterthan.co.kr> Cc: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <2e8143d4-eb32-693d-e5a4-49c380c100df@selasky.org> Date: Fri, 19 Aug 2016 11:11:56 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160819085511.GF1186@michelle.fasterthan.co.kr> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 09:07:29 -0000 On 08/19/16 10:55, YongHyeon PYUN wrote: > I think the order is right but it was not tested on big-endian > systems. Hi, I'm pretty sure the ifdef is wrong, because you write the fields one at a time, using htole32(): txhdr.mss = 0; txhdr.len = htole32(AXGE_TXBYTES(m->m_pkthdr.len)); Big endian machines don't re-order variables like this. You should remove the #else part. --HPS From owner-svn-src-head@freebsd.org Fri Aug 19 09:22:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 645DCBBF638; Fri, 19 Aug 2016 09:22:31 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pf0-x22d.google.com (mail-pf0-x22d.google.com [IPv6:2607:f8b0:400e:c00::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 327D5131F; Fri, 19 Aug 2016 09:22:31 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by mail-pf0-x22d.google.com with SMTP id p64so7855288pfb.1; Fri, 19 Aug 2016 02:22:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0tKUFsMP5VZ1nsYqsK9YkXZpIeXOKGbKlv7vxxzCCzo=; b=E1x9GsDmXf0QPqquGOnOwbXMJKTlbuhjWQxze7GKdxeFePtsANfdxxdJQnd+IqkRvh eBe9QyorMXNwuvi79x2shrb0Lljf3wPMgvEJMiScUYOWcmU8208Dk+bKH/AdrUeffaoO d3Cc411P9XEPPepTLvEbCluuEMoCcDSN+AdKViTfK9Y1PgEjbhyS/DxPjd7fkszBmMdZ J7tkYdngg0zHH5W1ByU2FoH62tjoPxxwqt4mAWFyM1x1etJJcldj7Jj6CL4cvfi4SNnI GjgafaSJlDBTiUShsxu06C6AkOag0+r0GOEHvcfGwJ1C6/tioA3ecoOFae+XaYrNaQ1i cbNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=0tKUFsMP5VZ1nsYqsK9YkXZpIeXOKGbKlv7vxxzCCzo=; b=KKv6WRHhcUiaAkWUdpqVaR/KmX6A2HbN9fxTmS2FqzU1giTgXYXVulLsxFEzae7Lwj bWFJF9yHe/1nwvdmGO7k8vGTM4P4Gu+0zUKdF8zefJ5EgIfToAnsshxfg6RJfKY9Co5x M5vEPQWbkMh+5bWAZNTd+ym+udFTgugSCXspLOYp75uc8z5r1Ei7GlPWhdKKRc91uJUi ugkZfbvvBmtQ9H6UacqDevTPvuCV55ucMB9c1Ng25hQYUmAU8pX93x8CdQG5sTDOcT9P Nl5uVpZKk7qEpGZ15ivyYOh/6ATf/4Z0YwnTH1lBQm1eyN6PMcsq0s9tEjjc9KsYW3lq hVew== X-Gm-Message-State: AEkoousbK+tLTBptLiuhAGUT1h9i8KYoA19jqqJ8r37JbuNhYUfw/azfzNNuv4n6kYGguQ== X-Received: by 10.98.22.212 with SMTP id 203mr12477907pfw.74.1471598550845; Fri, 19 Aug 2016 02:22:30 -0700 (PDT) Received: from localhost ([106.247.248.2]) by smtp.gmail.com with ESMTPSA id y2sm9756929pan.31.2016.08.19.02.22.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Aug 2016 02:22:30 -0700 (PDT) From: YongHyeon PYUN X-Google-Original-From: "YongHyeon PYUN" Received: by localhost (sSMTP sendmail emulation); Fri, 19 Aug 2016 18:22:23 +0900 Date: Fri, 19 Aug 2016 18:22:23 +0900 To: Hans Petter Selasky Cc: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304439 - head/sys/dev/usb/net Message-ID: <20160819092223.GG1186@michelle.fasterthan.co.kr> Reply-To: pyunyh@gmail.com References: <201608190050.u7J0oWkW043171@repo.freebsd.org> <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> <20160819085511.GF1186@michelle.fasterthan.co.kr> <2e8143d4-eb32-693d-e5a4-49c380c100df@selasky.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2e8143d4-eb32-693d-e5a4-49c380c100df@selasky.org> User-Agent: Mutt/1.4.2.3i X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 09:22:31 -0000 On Fri, Aug 19, 2016 at 11:11:56AM +0200, Hans Petter Selasky wrote: > On 08/19/16 10:55, YongHyeon PYUN wrote: > >I think the order is right but it was not tested on big-endian > >systems. > > Hi, > > I'm pretty sure the ifdef is wrong, because you write the fields one at > a time, using htole32(): > > txhdr.mss = 0; > txhdr.len = htole32(AXGE_TXBYTES(m->m_pkthdr.len)); > > Big endian machines don't re-order variables like this. > > You should remove the #else part. Wouldn't USB stack pass txhdr structure without any modification? And controller want to see len (low 32bits address) first and then mss (high 32bits address). On big endian systems I guess this should be reversed in host memory layout. This is so confusing so I could be wrong. From owner-svn-src-head@freebsd.org Fri Aug 19 09:24:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C3DFBBF76F; Fri, 19 Aug 2016 09:24:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BCC51606; Fri, 19 Aug 2016 09:24:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7J9OOr7050606 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 19 Aug 2016 12:24:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7J9OOr7050606 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7J9OOur050605; Fri, 19 Aug 2016 12:24:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 19 Aug 2016 12:24:24 +0300 From: Konstantin Belousov To: Toomas Soome Cc: Warner Losh , Julian Elischer , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd Message-ID: <20160819092424.GE83214@kib.kiev.ua> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> <50AAF049-C8A7-4C69-A206-C3983FFA7867@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50AAF049-C8A7-4C69-A206-C3983FFA7867@me.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 09:24:30 -0000 On Fri, Aug 19, 2016 at 11:50:35AM +0300, Toomas Soome wrote: > > > On 19. aug 2016, at 10:39, Konstantin Belousov wrote: > > > > On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: > >> On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer wrote: > >>> On 16/08/2016 4:54 AM, John Baldwin wrote: > >>>> > >>>> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: > >>>>> > >>>>> Author: jhb > >>>>> Date: Mon Aug 15 20:38:02 2016 > >>>>> New Revision: 304187 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/304187 > >>>>> > >>>>> Log: > >>>>> Remove the mcd(4) driver for Mitsumi CD-ROM players. > >>>>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in > >>>>> the manpage, this driver is only useful as a backend to cdcontrol to > >>>>> play audio CDs since it doesn't use DMA, so its data performance is > >>>>> "abysmal" (and that was true in the mid 90's). > >>>> > >>>> No one stepped up to test patches for it either when I last posted patches > >>>> to > >>>> convert it from timeout(9) to callout(9). I have a few more drivers that > >>>> are > >>>> both very old and that people have no business using in 12 (think ISA > >>>> adapters that don't do DMA and can't be used with pccard) that I will be > >>>> removing over the next little while. I brought up a list of drivers on > >>>> arch@ > >>>> a couple of years ago and the conversation drifted off into the weeds > >>>> about > >>>> trimming GENERIC, etc. No one objected to the specific drivers I listed > >>>> though (and I got a few pleas of "please remove"). If someone shows up > >>>> desperately clutching an ISA adapter they can always dig up the source > >>>> from > >>>> svn and deal with forward porting it for whatever API changes have > >>>> happened > >>>> since it was removed. > >>> > >>> > >>> I would imagine any machine still holding one of these probably has not > >>> enough memory to run FreeBSD. > >>> > >>> would we still run in 2MB? > >> > >> With insane levels of tuning, we can run in 32MB userland that can do > >> things. Even 64MB is tight w/o some tuning. 16MB is almost certainly > >> right out except for very specialized situations. 2MB? We can't even > >> load the loader in that :(. Oh, and all these memory configs are only > >> possible if you tweak the loader's block cache... > >> > > > > 32MB is quite usable. Without any tuning, you get slightly less than 10MB > > for userspace, which is enough to for many things, and plenty if swap is > > added. > > > > Note that you cannot boot on such configurations since loader was broken, > > but if you do manage to jump to kernel, things were fine several months > > ago. I tested my relatively recent OOM changes on 32MB qemu config. > >> Warner > > > > If the target is to go as low memory as possible, sure, you can strip all off, from boot loader point, you should load kernel from stage2 and not use loader at all (you can load and jump kernel even now from stage2, assuming it wont need any special configuration from loader config) etc etc. This means highly specialized build and has nothing to do with generic all purpose system. > Why you describe this as an 'alternative' ? Before that loader changes, I regularly tested on 32MB qemy i386 image and 64MB amd64 image. I do not see anything extreme in these configs. They use normal boot path, which provides kernels with debugging symbols, metadata, loaded modules etc. Why should I use deficient boot2-only loading, which, additionally, cannot work on amd64 ? More, this is the only reasonable way for most developers to ensure that system is still usable on tiny configs found on embedded devices. Right now the min which I have to set up is 128MB, and VM changes are simply not tested on anything smaller. It is guaranteed that small systems will grow regressions fast. And I will not jump through the hoops to mitigate breakage induced by other people' changes. > Also at some point, there is an question about how reasonable it is to have such configuration as part of generic code base for special bits like boot loader itself, as the problem is, testing all those variants is becoming impossible and even keeping reasonable code base in all of the #if #else #endif spaghetti is getting quite hard and error prone. > > >From developers point of view, it is not really encouraging to have possible feedback like ???oh, but you did break my 32MB system boot??? ;) This does bring back some memories however. For first 2 unix systems I was dealing with, one had 8MB and another had 12MB of memory??? it was ~ 1992-1993;) > Not mine, but you (?) indirectly broke system for people who do use 32MB on other arches, since low memory config on dev systems become 128MB. I cared about 32MB before, but not any longer. > Right now the loader and stage2 are set to use 64MB heap to make it possible to implement zfs feature support and later on, for more features. > > Also note that UEFI setups are much harder to deal with regard of memory management, because as long as BS are in control, you can not really control the memory management there and can end up with fragmented unusable (for kernel loading) layout. This is especially nasty as apparently some (buggy) systems actually have runtime services using boot services memory areas, so you can end up in setup where you can not re-use BS memory and those chunks can be all over the low memory address space??? Yes, I do suspect that eventually systems appear where our default layout of the kernel physical segments is not workable and both loader and kernel bootstrap would need to grow much more flexibility. Initial 1GB-idmap page table structure and kernel page table would need to handle this, and we will need a kernel relocator either in loader or in kernel itself. From owner-svn-src-head@freebsd.org Fri Aug 19 09:35:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89A10BBFA8A; Fri, 19 Aug 2016 09:35:35 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp004.me.com (st13p35im-asmtp004.me.com [17.164.199.67]) (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 5CA381CCC; Fri, 19 Aug 2016 09:35:35 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp004.me.com by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OC500N00GZUON00@st13p35im-asmtp004.me.com>; Fri, 19 Aug 2016 09:35:34 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1471599334; bh=m2j7mQzR1uPalnh8tIjmkZPL2B345cMzYeS0VhsT6qw=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=kqSjg6pFmykO+7l//pw19lQ3df9mbMag/+/KQXs1IrsoLD//lW7/PRKUixnzzaRks +yR5T8dFNBDMIbYCxPw2B4gODQWIoRlj4/aEw/0LLlZFvzXKA5QAfgsOy8rFyn/LeI VDbq9E3wQZUGAWkG2Ez456vcEF0tgwvqUxdGcxS5OQ3LFL95Cn2iRIu2vUDMX6aIqC DCglSHQetlfOO2AeEoGVWWAq6hVQGgs69yLclSCzPzQoSWosuY7MqJF5v+P68xiJXL AJP6GenJ0V0HBs4rPjA7zWOKx+PWoMFL73aaApc4nJYsLP96BH9Ipd3aItl5EPZbLO fdUyeeuswv8OA== Received: from [88.196.10.181] (181-10-196-88.dyn.estpak.ee [88.196.10.181]) by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OC5002VVHB6Z210@st13p35im-asmtp004.me.com>; Fri, 19 Aug 2016 09:35:34 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-19_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1608190124 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd From: Toomas Soome In-reply-to: <20160819092424.GE83214@kib.kiev.ua> Date: Fri, 19 Aug 2016 12:35:30 +0300 Cc: Warner Losh , Julian Elischer , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-transfer-encoding: quoted-printable Message-id: <514987E4-B953-467C-B53B-824B172A5211@me.com> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> <50AAF049-C8A7-4C69-A206-C3983FFA7867@me.com> <20160819092424.GE83214@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 09:35:35 -0000 > On 19. aug 2016, at 12:24, Konstantin Belousov = wrote: >=20 > On Fri, Aug 19, 2016 at 11:50:35AM +0300, Toomas Soome wrote: >>=20 >>> On 19. aug 2016, at 10:39, Konstantin Belousov = wrote: >>>=20 >>> On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: >>>> On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer = wrote: >>>>> On 16/08/2016 4:54 AM, John Baldwin wrote: >>>>>>=20 >>>>>> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >>>>>>>=20 >>>>>>> Author: jhb >>>>>>> Date: Mon Aug 15 20:38:02 2016 >>>>>>> New Revision: 304187 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/304187 >>>>>>>=20 >>>>>>> Log: >>>>>>> Remove the mcd(4) driver for Mitsumi CD-ROM players. >>>>>>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As = noted in >>>>>>> the manpage, this driver is only useful as a backend to = cdcontrol to >>>>>>> play audio CDs since it doesn't use DMA, so its data performance = is >>>>>>> "abysmal" (and that was true in the mid 90's). >>>>>>=20 >>>>>> No one stepped up to test patches for it either when I last = posted patches >>>>>> to >>>>>> convert it from timeout(9) to callout(9). I have a few more = drivers that >>>>>> are >>>>>> both very old and that people have no business using in 12 (think = ISA >>>>>> adapters that don't do DMA and can't be used with pccard) that I = will be >>>>>> removing over the next little while. I brought up a list of = drivers on >>>>>> arch@ >>>>>> a couple of years ago and the conversation drifted off into the = weeds >>>>>> about >>>>>> trimming GENERIC, etc. No one objected to the specific drivers I = listed >>>>>> though (and I got a few pleas of "please remove"). If someone = shows up >>>>>> desperately clutching an ISA adapter they can always dig up the = source >>>>>> from >>>>>> svn and deal with forward porting it for whatever API changes = have >>>>>> happened >>>>>> since it was removed. >>>>>=20 >>>>>=20 >>>>> I would imagine any machine still holding one of these probably = has not >>>>> enough memory to run FreeBSD. >>>>>=20 >>>>> would we still run in 2MB? >>>>=20 >>>> With insane levels of tuning, we can run in 32MB userland that can = do >>>> things. Even 64MB is tight w/o some tuning. 16MB is almost = certainly >>>> right out except for very specialized situations. 2MB? We can't = even >>>> load the loader in that :(. Oh, and all these memory configs are = only >>>> possible if you tweak the loader's block cache... >>>>=20 >>>=20 >>> 32MB is quite usable. Without any tuning, you get slightly less = than 10MB >>> for userspace, which is enough to for many things, and plenty if = swap is >>> added. >>>=20 >>> Note that you cannot boot on such configurations since loader was = broken, >>> but if you do manage to jump to kernel, things were fine several = months >>> ago. I tested my relatively recent OOM changes on 32MB qemu config. >>>> Warner >>>=20 >>=20 >> If the target is to go as low memory as possible, sure, you can strip = all off, from boot loader point, you should load kernel from stage2 and = not use loader at all (you can load and jump kernel even now from = stage2, assuming it wont need any special configuration from loader = config) etc etc. This means highly specialized build and has nothing to = do with generic all purpose system. >>=20 > Why you describe this as an 'alternative' ? Before that loader = changes, > I regularly tested on 32MB qemy i386 image and 64MB amd64 image. I do > not see anything extreme in these configs. They use normal boot path, > which provides kernels with debugging symbols, metadata, loaded = modules > etc. Why should I use deficient boot2-only loading, which, = additionally, > cannot work on amd64 ? >=20 > More, this is the only reasonable way for most developers to ensure = that > system is still usable on tiny configs found on embedded devices. = Right > now the min which I have to set up is 128MB, and VM changes are simply = not > tested on anything smaller. It is guaranteed that small systems will = grow > regressions fast. And I will not jump through the hoops to mitigate > breakage induced by other people' changes. >=20 >> Also at some point, there is an question about how reasonable it is = to have such configuration as part of generic code base for special bits = like boot loader itself, as the problem is, testing all those variants = is becoming impossible and even keeping reasonable code base in all of = the #if #else #endif spaghetti is getting quite hard and error prone. >>=20 >>> =46rom developers point of view, it is not really encouraging to = have possible feedback like ???oh, but you did break my 32MB system = boot??? ;) This does bring back some memories however. For first 2 unix = systems I was dealing with, one had 8MB and another had 12MB of = memory??? it was ~ 1992-1993;) >>=20 > Not mine, but you (?) indirectly broke system for people who do use = 32MB > on other arches, since low memory config on dev systems become 128MB. > I cared about 32MB before, but not any longer. Yep, I did set it to 64MB. And this is exactly why I wrote that small = systems do need special approaches, because getting updates for new = features and keeping tiny systems functional are conflicting options. So = far freebsd boot loader has managed this in some extent by massive = amount of preprocessor conditions and the result is insane list of = different boot programs in /boot - this is the price to pay. Even to = install the boot program you need to know when to use gpart and when = dd=E2=80=A6 rgds, toomas >=20 >> Right now the loader and stage2 are set to use 64MB heap to make it = possible to implement zfs feature support and later on, for more = features. >>=20 >> Also note that UEFI setups are much harder to deal with regard of = memory management, because as long as BS are in control, you can not = really control the memory management there and can end up with = fragmented unusable (for kernel loading) layout. This is especially = nasty as apparently some (buggy) systems actually have runtime services = using boot services memory areas, so you can end up in setup where you = can not re-use BS memory and those chunks can be all over the low memory = address space???=20 >=20 > Yes, I do suspect that eventually systems appear where our default > layout of the kernel physical segments is not workable and both loader > and kernel bootstrap would need to grow much more flexibility. Initial > 1GB-idmap page table structure and kernel page table would need to = handle > this, and we will need a kernel relocator either in loader or in = kernel > itself. From owner-svn-src-head@freebsd.org Fri Aug 19 10:35:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54F3FBBFC53; Fri, 19 Aug 2016 10:35:37 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B37F1453; Fri, 19 Aug 2016 10:35:36 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.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 62E191FE023; Fri, 19 Aug 2016 12:35:28 +0200 (CEST) Subject: Re: svn commit: r304439 - head/sys/dev/usb/net To: pyunyh@gmail.com References: <201608190050.u7J0oWkW043171@repo.freebsd.org> <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> <20160819085511.GF1186@michelle.fasterthan.co.kr> <2e8143d4-eb32-693d-e5a4-49c380c100df@selasky.org> <20160819092223.GG1186@michelle.fasterthan.co.kr> Cc: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <63a25b6b-4503-b136-7765-7744108db1a1@selasky.org> Date: Fri, 19 Aug 2016 12:39:58 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160819092223.GG1186@michelle.fasterthan.co.kr> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 10:35:37 -0000 On 08/19/16 11:22, YongHyeon PYUN wrote: > On Fri, Aug 19, 2016 at 11:11:56AM +0200, Hans Petter Selasky wrote: >> On 08/19/16 10:55, YongHyeon PYUN wrote: >>> I think the order is right but it was not tested on big-endian >>> systems. >> >> Hi, >> >> I'm pretty sure the ifdef is wrong, because you write the fields one at >> a time, using htole32(): >> >> txhdr.mss = 0; >> txhdr.len = htole32(AXGE_TXBYTES(m->m_pkthdr.len)); >> >> Big endian machines don't re-order variables like this. >> >> You should remove the #else part. > > Wouldn't USB stack pass txhdr structure without any > modification? And controller want to see len (low 32bits address) > first and then mss (high 32bits address). On big endian systems I > guess this should be reversed in host memory layout. This is so > confusing so I could be wrong. The USB stack passes TXHDR as-is and the host controller is byte oriented, not 64-bit word oriented. That's why the layout is the same as long as you assign per 32-bit field. --HPS From owner-svn-src-head@freebsd.org Fri Aug 19 10:51:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACA43BBF03E; Fri, 19 Aug 2016 10:51:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79A221BE0; Fri, 19 Aug 2016 10:51:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JApUov066830; Fri, 19 Aug 2016 10:51:30 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JApUKh066829; Fri, 19 Aug 2016 10:51:30 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608191051.u7JApUKh066829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Fri, 19 Aug 2016 10:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304458 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 10:51:31 -0000 Author: yongari Date: Fri Aug 19 10:51:30 2016 New Revision: 304458 URL: https://svnweb.freebsd.org/changeset/base/304458 Log: Host controller is byte oriented. Fix wrong assumption on big-endian systems. Pointed out by: hselasky Modified: head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axgereg.h ============================================================================== --- head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 09:11:50 2016 (r304457) +++ head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 10:51:30 2016 (r304458) @@ -154,21 +154,15 @@ enum { #define AXGE_N_FRAMES 16 struct axge_frame_txhdr { -#if BYTE_ORDER == LITTLE_ENDIAN uint32_t len; - uint32_t mss; -#else - uint32_t mss; - uint32_t len; -#endif -} __packed; - #define AXGE_TXLEN_MASK 0x0001FFFF #define AXGE_VLAN_INSERT 0x20000000 #define AXGE_CSUM_DISABLE 0x80000000 + uint32_t mss; #define AXGE_MSS_MASK 0x00003FFF #define AXGE_PADDING 0x80008000 #define AXGE_VLAN_TAG_MASK 0xFFFF0000 +} __packed; #define AXGE_TXBYTES(x) ((x) & AXGE_TXLEN_MASK) From owner-svn-src-head@freebsd.org Fri Aug 19 10:52:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51FE6BBF0C7; Fri, 19 Aug 2016 10:52:42 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CAC71F07; Fri, 19 Aug 2016 10:52:42 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JAqfDl070264; Fri, 19 Aug 2016 10:52:41 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JAqdPq070244; Fri, 19 Aug 2016 10:52:39 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201608191052.u7JAqdPq070244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Aug 2016 10:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304459 - in head/sys: arm/arm arm/nvidia arm/ti/omap4 arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 10:52:42 -0000 Author: mmel Date: Fri Aug 19 10:52:39 2016 New Revision: 304459 URL: https://svnweb.freebsd.org/changeset/base/304459 Log: INTRNG: Rework handling with resources. Partially revert r301453. - Read interrupt properties at bus enumeration time and store it into global mapping table. - At bus_activate_resource() time, given mapping entry is resolved and connected to real interrupt source. A copy of mapping entry is attached to given resource. - At bus_setup_intr() time, mapping entry stored in resource is used for delivery of requested interrupt configuration. - For MSI/MSIX interrupts, mapping entry is created within pci_alloc_msi()/pci_alloc_msix() call. - For legacy PCI interrupts, mapping entry must be created within pcib_route_interrupt() by pcib driver itself. Reviewed by: nwhitehorn, andrew Differential Revision: https://reviews.freebsd.org/D7493 Modified: head/sys/arm/arm/nexus.c head/sys/arm/nvidia/tegra_lic.c head/sys/arm/ti/omap4/omap4_wugen.c head/sys/arm64/arm64/nexus.c head/sys/dev/fdt/simplebus.c head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/ofw_gpiobus.c head/sys/dev/iicbus/ofw_iicbus.c head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h head/sys/dev/ofw/ofwbus.c head/sys/dev/pci/pci_host_generic.c head/sys/dev/vnic/mrml_bridge.c head/sys/dev/vnic/thunder_mdio_fdt.c head/sys/kern/bus_if.m head/sys/kern/pic_if.m head/sys/kern/subr_bus.c head/sys/kern/subr_intr.c head/sys/mips/mips/nexus.c head/sys/sys/bus.h head/sys/sys/intr.h Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/arm/arm/nexus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #ifdef FDT #include +#include #include "ofw_bus_if.h" #endif @@ -379,6 +380,11 @@ nexus_activate_resource(device_t bus, de #endif rman_set_virtual(r, (void *)vaddr); rman_set_bushandle(r, vaddr); + return (0); + } else if (type == SYS_RES_IRQ) { +#ifdef INTRNG + intr_activate_irq(child, r); +#endif } return (0); } @@ -390,17 +396,23 @@ nexus_deactivate_resource(device_t bus, bus_size_t psize; bus_space_handle_t vaddr; - psize = (bus_size_t)rman_get_size(r); - vaddr = rman_get_bushandle(r); + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + psize = (bus_size_t)rman_get_size(r); + vaddr = rman_get_bushandle(r); - if (vaddr != 0) { + if (vaddr != 0) { #ifdef FDT - bus_space_unmap(fdtbus_bs_tag, vaddr, psize); + bus_space_unmap(fdtbus_bs_tag, vaddr, psize); #else - pmap_unmapdev((vm_offset_t)vaddr, (vm_size_t)psize); + pmap_unmapdev((vm_offset_t)vaddr, (vm_size_t)psize); +#endif + rman_set_virtual(r, NULL); + rman_set_bushandle(r, 0); + } + } else if (type == SYS_RES_IRQ) { +#ifdef INTRNG + intr_deactivate_irq(child, r); #endif - rman_set_virtual(r, NULL); - rman_set_bushandle(r, 0); } return (rman_deactivate_resource(r)); @@ -411,11 +423,22 @@ static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells, pcell_t *intr) { - -#ifdef INTRNG - return (INTR_IRQ_INVALID); -#else +#ifndef INTRNG return (intr_fdt_map_irq(iparent, intr, icells)); -#endif +#else + u_int irq; + struct intr_map_data_fdt *fdt_data; + size_t len; + + len = sizeof(*fdt_data) + icells * sizeof(pcell_t); + fdt_data = (struct intr_map_data_fdt *)intr_alloc_map_data( + INTR_MAP_DATA_FDT, len, M_WAITOK | M_ZERO); + fdt_data->iparent = iparent; + fdt_data->ncells = icells; + memcpy(fdt_data->cells, intr, icells * sizeof(pcell_t)); + irq = intr_map_irq(NULL, iparent, (struct intr_map_data *)fdt_data); + return (irq); +#endif /* INTRNG */ } -#endif +#endif /* FDT */ + Modified: head/sys/arm/nvidia/tegra_lic.c ============================================================================== --- head/sys/arm/nvidia/tegra_lic.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/arm/nvidia/tegra_lic.c Fri Aug 19 10:52:39 2016 (r304459) @@ -88,12 +88,12 @@ struct tegra_lic_sc { }; static int -tegra_lic_alloc_intr(device_t dev, struct intr_irqsrc *isrc, +tegra_lic_activate_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { struct tegra_lic_sc *sc = device_get_softc(dev); - return (PIC_ALLOC_INTR(sc->parent, isrc, res, data)); + return (PIC_ACTIVATE_INTR(sc->parent, isrc, res, data)); } static void @@ -122,12 +122,12 @@ tegra_lic_map_intr(device_t dev, struct } static int -tegra_lic_release_intr(device_t dev, struct intr_irqsrc *isrc, +tegra_lic_deactivate_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { struct tegra_lic_sc *sc = device_get_softc(dev); - return (PIC_RELEASE_INTR(sc->parent, isrc, res, data)); + return (PIC_DEACTIVATE_INTR(sc->parent, isrc, res, data)); } static int @@ -266,11 +266,11 @@ static device_method_t tegra_lic_methods DEVMETHOD(device_detach, tegra_lic_detach), /* Interrupt controller interface */ - DEVMETHOD(pic_alloc_intr, tegra_lic_alloc_intr), + DEVMETHOD(pic_activate_intr, tegra_lic_activate_intr), DEVMETHOD(pic_disable_intr, tegra_lic_disable_intr), DEVMETHOD(pic_enable_intr, tegra_lic_enable_intr), DEVMETHOD(pic_map_intr, tegra_lic_map_intr), - DEVMETHOD(pic_release_intr, tegra_lic_release_intr), + DEVMETHOD(pic_deactivate_intr, tegra_lic_deactivate_intr), DEVMETHOD(pic_setup_intr, tegra_lic_setup_intr), DEVMETHOD(pic_teardown_intr, tegra_lic_teardown_intr), DEVMETHOD(pic_pre_ithread, tegra_lic_pre_ithread), Modified: head/sys/arm/ti/omap4/omap4_wugen.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_wugen.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/arm/ti/omap4/omap4_wugen.c Fri Aug 19 10:52:39 2016 (r304459) @@ -57,12 +57,12 @@ struct omap4_wugen_sc { }; static int -omap4_wugen_alloc_intr(device_t dev, struct intr_irqsrc *isrc, +omap4_wugen_activate_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { struct omap4_wugen_sc *sc = device_get_softc(dev); - return (PIC_ALLOC_INTR(sc->sc_parent, isrc, res, data)); + return (PIC_ACTIVATE_INTR(sc->sc_parent, isrc, res, data)); } static void @@ -91,12 +91,12 @@ omap4_wugen_map_intr(device_t dev, struc } static int -omap4_wugen_release_intr(device_t dev, struct intr_irqsrc *isrc, +omap4_wugen_deactivate_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { struct omap4_wugen_sc *sc = device_get_softc(dev); - return (PIC_RELEASE_INTR(sc->sc_parent, isrc, res, data)); + return (PIC_DEACTIVATE_INTR(sc->sc_parent, isrc, res, data)); } static int @@ -227,11 +227,11 @@ static device_method_t omap4_wugen_metho DEVMETHOD(device_detach, omap4_wugen_detach), /* Interrupt controller interface */ - DEVMETHOD(pic_alloc_intr, omap4_wugen_alloc_intr), + DEVMETHOD(pic_activate_intr, omap4_wugen_activate_intr), DEVMETHOD(pic_disable_intr, omap4_wugen_disable_intr), DEVMETHOD(pic_enable_intr, omap4_wugen_enable_intr), DEVMETHOD(pic_map_intr, omap4_wugen_map_intr), - DEVMETHOD(pic_release_intr, omap4_wugen_release_intr), + DEVMETHOD(pic_deactivate_intr, omap4_wugen_deactivate_intr), DEVMETHOD(pic_setup_intr, omap4_wugen_setup_intr), DEVMETHOD(pic_teardown_intr, omap4_wugen_teardown_intr), DEVMETHOD(pic_pre_ithread, omap4_wugen_pre_ithread), Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/arm64/arm64/nexus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef FDT +#include #include #include "ofw_bus_if.h" #endif @@ -345,6 +346,8 @@ nexus_activate_resource(device_t bus, de rman_set_bustag(r, &memmap_bus); rman_set_virtual(r, (void *)vaddr); rman_set_bushandle(r, vaddr); + } else if (type == SYS_RES_IRQ) { + intr_activate_irq(child, r); } return (0); } @@ -378,13 +381,17 @@ nexus_deactivate_resource(device_t bus, bus_size_t psize; bus_space_handle_t vaddr; - psize = (bus_size_t)rman_get_size(r); - vaddr = rman_get_bushandle(r); + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + psize = (bus_size_t)rman_get_size(r); + vaddr = rman_get_bushandle(r); - if (vaddr != 0) { - bus_space_unmap(&memmap_bus, vaddr, psize); - rman_set_virtual(r, NULL); - rman_set_bushandle(r, 0); + if (vaddr != 0) { + bus_space_unmap(&memmap_bus, vaddr, psize); + rman_set_virtual(r, NULL); + rman_set_bushandle(r, 0); + } + } else if (type == SYS_RES_IRQ) { + intr_deactivate_irq(child, r); } return (rman_deactivate_resource(r)); @@ -431,8 +438,18 @@ static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells, pcell_t *intr) { - - return (INTR_IRQ_INVALID); + u_int irq; + struct intr_map_data_fdt *fdt_data; + size_t len; + + len = sizeof(*fdt_data) + icells * sizeof(pcell_t); + fdt_data = (struct intr_map_data_fdt *)intr_alloc_map_data( + INTR_MAP_DATA_FDT, len, M_WAITOK | M_ZERO); + fdt_data->iparent = iparent; + fdt_data->ncells = icells; + memcpy(fdt_data->cells, intr, icells * sizeof(pcell_t)); + irq = intr_map_irq(NULL, iparent, (struct intr_map_data *)fdt_data); + return (irq); } #endif Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/fdt/simplebus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -251,9 +251,7 @@ simplebus_setup_dinfo(device_t dev, phan resource_list_init(&ndi->rl); ofw_bus_reg_to_rl(dev, node, sc->acells, sc->scells, &ndi->rl); -#ifndef INTRNG ofw_bus_intr_to_rl(dev, node, &ndi->rl, NULL); -#endif return (ndi); } Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/gpio/gpiobus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -31,7 +31,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef INTRNG #include +#endif #include #include #include @@ -79,43 +81,26 @@ static int gpiobus_pin_toggle(device_t, * data will be moved into struct resource. */ #ifdef INTRNG -static void -gpio_destruct_map_data(struct intr_map_data *map_data) -{ - - KASSERT(map_data->type == INTR_MAP_DATA_GPIO, - ("%s: bad map_data type %d", __func__, map_data->type)); - - free(map_data, M_DEVBUF); -} struct resource * gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags, gpio_pin_t pin, uint32_t intr_mode) { - int rv; u_int irq; struct intr_map_data_gpio *gpio_data; struct resource *res; - gpio_data = malloc(sizeof(*gpio_data), M_DEVBUF, M_WAITOK | M_ZERO); - gpio_data->hdr.type = INTR_MAP_DATA_GPIO; - gpio_data->hdr.destruct = gpio_destruct_map_data; + gpio_data = (struct intr_map_data_gpio *)intr_alloc_map_data( + INTR_MAP_DATA_GPIO, sizeof(*gpio_data), M_WAITOK | M_ZERO); gpio_data->gpio_pin_num = pin->pin; gpio_data->gpio_pin_flags = pin->flags; gpio_data->gpio_intr_mode = intr_mode; - rv = intr_map_irq(pin->dev, 0, (struct intr_map_data *)gpio_data, - &irq); - if (rv != 0) { - gpio_destruct_map_data((struct intr_map_data *)gpio_data); - return (NULL); - } - + irq = intr_map_irq(pin->dev, 0, (struct intr_map_data *)gpio_data); res = bus_alloc_resource(consumer_dev, SYS_RES_IRQ, rid, irq, irq, 1, alloc_flags); if (res == NULL) { - gpio_destruct_map_data((struct intr_map_data *)gpio_data); + intr_free_intr_map_data((struct intr_map_data *)gpio_data); return (NULL); } rman_set_virtual(res, gpio_data); Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/gpio/gpiobusvar.h Fri Aug 19 10:52:39 2016 (r304459) @@ -70,12 +70,14 @@ struct gpiobus_pin_data char *name; /* pin name. */ }; +#ifdef INTRNG struct intr_map_data_gpio { struct intr_map_data hdr; u_int gpio_pin_num; u_int gpio_pin_flags; u_int gpio_intr_mode; }; +#endif struct gpiobus_softc { Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/gpio/ofw_gpiobus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -321,13 +321,11 @@ ofw_gpiobus_setup_devinfo(device_t bus, devi->pins[i] = pins[i].pin; } free(pins, M_DEVBUF); -#ifndef INTRNG /* Parse the interrupt resources. */ if (ofw_bus_intr_to_rl(bus, node, &dinfo->opd_dinfo.rl, NULL) != 0) { ofw_gpiobus_destroy_devinfo(bus, dinfo); return (NULL); } -#endif device_set_ivars(child, dinfo); return (dinfo); Modified: head/sys/dev/iicbus/ofw_iicbus.c ============================================================================== --- head/sys/dev/iicbus/ofw_iicbus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/iicbus/ofw_iicbus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -187,10 +187,8 @@ ofw_iicbus_attach(device_t dev) childdev = device_add_child(dev, NULL, -1); resource_list_init(&dinfo->opd_dinfo.rl); -#ifndef INTRNG ofw_bus_intr_to_rl(childdev, child, &dinfo->opd_dinfo.rl, NULL); -#endif device_set_ivars(childdev, dinfo); } Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/ofw/ofw_bus_subr.c Fri Aug 19 10:52:39 2016 (r304459) @@ -516,7 +516,6 @@ ofw_bus_find_iparent(phandle_t node) return (iparent); } -#ifndef INTRNG int ofw_bus_intr_to_rl(device_t dev, phandle_t node, struct resource_list *rl, int *rlen) @@ -582,7 +581,6 @@ ofw_bus_intr_to_rl(device_t dev, phandle free(intr, M_OFWPROP); return (err); } -#endif int ofw_bus_intr_by_rid(device_t dev, phandle_t node, int wanted_rid, Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/ofw/ofw_bus_subr.h Fri Aug 19 10:52:39 2016 (r304459) @@ -32,7 +32,9 @@ #define _DEV_OFW_OFW_BUS_SUBR_H_ #include - +#ifdef INTRNG +#include +#endif #include #include "ofw_bus_if.h" @@ -52,12 +54,14 @@ struct ofw_compat_data { uintptr_t ocd_data; }; +#ifdef INTRNG struct intr_map_data_fdt { struct intr_map_data hdr; phandle_t iparent; u_int ncells; - pcell_t *cells; + pcell_t cells[]; }; +#endif #define SIMPLEBUS_PNP_DESCR "Z:compat;P:private;" #define SIMPLEBUS_PNP_INFO(t) \ @@ -89,9 +93,7 @@ int ofw_bus_msimap(phandle_t, uint16_t, /* Routines for parsing device-tree data into resource lists. */ int ofw_bus_reg_to_rl(device_t, phandle_t, pcell_t, pcell_t, struct resource_list *); -#ifndef INTRNG int ofw_bus_intr_to_rl(device_t, phandle_t, struct resource_list *, int *); -#endif int ofw_bus_intr_by_rid(device_t, phandle_t, int, phandle_t *, int *, pcell_t **); Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/ofw/ofwbus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -80,9 +80,6 @@ static device_attach_t ofwbus_attach; static bus_alloc_resource_t ofwbus_alloc_resource; static bus_adjust_resource_t ofwbus_adjust_resource; static bus_release_resource_t ofwbus_release_resource; -#ifdef INTRNG -static bus_map_intr_t ofwbus_map_intr; -#endif static device_method_t ofwbus_methods[] = { /* Device interface */ @@ -96,9 +93,6 @@ static device_method_t ofwbus_methods[] DEVMETHOD(bus_alloc_resource, ofwbus_alloc_resource), DEVMETHOD(bus_adjust_resource, ofwbus_adjust_resource), DEVMETHOD(bus_release_resource, ofwbus_release_resource), -#ifdef INTRNG - DEVMETHOD(bus_map_intr, ofwbus_map_intr), -#endif DEVMETHOD_END }; @@ -299,53 +293,3 @@ ofwbus_release_resource(device_t bus, de } return (rman_release_resource(r)); } - -#ifdef INTRNG -static void -ofwbus_destruct_map_data(struct intr_map_data *map_data) -{ - struct intr_map_data_fdt *fdt_map_data; - - KASSERT(map_data->type == INTR_MAP_DATA_FDT, - ("%s: bad map_data type %d", __func__, map_data->type)); - - fdt_map_data = (struct intr_map_data_fdt *)map_data; - OF_prop_free(fdt_map_data->cells); - free(fdt_map_data, M_OFWPROP); -} - -static int -ofwbus_map_intr(device_t bus, device_t child, int *rid, rman_res_t *start, - rman_res_t *end, rman_res_t *count, struct intr_map_data **imd) -{ - phandle_t iparent, node; - pcell_t *cells; - int ncells, rv; - u_int irq; - struct intr_map_data_fdt *fdt_data; - - node = ofw_bus_get_node(child); - rv = ofw_bus_intr_by_rid(child, node, *rid, &iparent, &ncells, &cells); - if (rv != 0) - return (rv); - - fdt_data = malloc(sizeof(*fdt_data), M_OFWPROP, M_WAITOK | M_ZERO); - fdt_data->hdr.type = INTR_MAP_DATA_FDT; - fdt_data->hdr.destruct = ofwbus_destruct_map_data; - fdt_data->iparent = iparent; - fdt_data->ncells = ncells; - fdt_data->cells = cells; - rv = intr_map_irq(NULL, iparent, (struct intr_map_data *)fdt_data, - &irq); - if (rv != 0) { - ofwbus_destruct_map_data((struct intr_map_data *)fdt_data); - return (rv); - } - - *start = irq; - *end = irq; - *count = 1; - *imd = (struct intr_map_data *)fdt_data; - return (0); -} -#endif Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/pci/pci_host_generic.c Fri Aug 19 10:52:39 2016 (r304459) @@ -939,9 +939,7 @@ generic_pcie_ofw_bus_attach(device_t dev resource_list_init(&di->di_rl); ofw_bus_reg_to_rl(dev, node, addr_cells, size_cells, &di->di_rl); -#ifndef INTRNG ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); -#endif /* Add newbus device for this FDT node */ child = device_add_child(dev, NULL, -1); Modified: head/sys/dev/vnic/mrml_bridge.c ============================================================================== --- head/sys/dev/vnic/mrml_bridge.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/vnic/mrml_bridge.c Fri Aug 19 10:52:39 2016 (r304459) @@ -263,9 +263,7 @@ mrmlb_ofw_bus_attach(device_t dev) resource_list_init(&di->di_rl); ofw_bus_reg_to_rl(dev, node, sc->acells, sc->scells, &di->di_rl); -#ifndef INTRNG ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); -#endif /* Add newbus device for this FDT node */ child = device_add_child(dev, NULL, -1); Modified: head/sys/dev/vnic/thunder_mdio_fdt.c ============================================================================== --- head/sys/dev/vnic/thunder_mdio_fdt.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/vnic/thunder_mdio_fdt.c Fri Aug 19 10:52:39 2016 (r304459) @@ -271,9 +271,7 @@ mdionexus_ofw_bus_attach(device_t dev) resource_list_init(&di->di_rl); ofw_bus_reg_to_rl(dev, node, sc->acells, sc->scells, &di->di_rl); -#ifndef INTRNG ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); -#endif /* Add newbus device for this FDT node */ child = device_add_child(dev, NULL, -1); Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/kern/bus_if.m Fri Aug 19 10:52:39 2016 (r304459) @@ -418,35 +418,6 @@ METHOD int release_resource { }; /** - * @brief Map an interrupt - * - * This method is used to get an interrupt mapping data according to provided - * hints. The hints could be modified afterwards, but only if mapping data was - * allocated. This method is intended to be called before BUS_ALLOC_RESOURCE(). - * - * @param _dev the parent device of @p _child - * @param _child the device which is requesting an allocation - * @param _rid a pointer to the resource identifier - * @param _start a pointer to the hint at the start of the resource - * range - pass @c 0 for any start address - * @param _end a pointer to the hint at the end of the resource - * range - pass @c ~0 for any end address - * @param _count a pointer to the hint at the size of resource - * range required - pass @c 1 for any size - * @param _imd a pointer to the interrupt mapping data which was - * allocated - */ -METHOD int map_intr { - device_t _dev; - device_t _child; - int *_rid; - rman_res_t *_start; - rman_res_t *_end; - rman_res_t *_count; - struct intr_map_data **_imd; -} DEFAULT bus_generic_map_intr; - -/** * @brief Install an interrupt handler * * This method is used to associate an interrupt handler function with Modified: head/sys/kern/pic_if.m ============================================================================== --- head/sys/kern/pic_if.m Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/kern/pic_if.m Fri Aug 19 10:52:39 2016 (r304459) @@ -43,7 +43,7 @@ CODE { } static int - null_pic_alloc_intr(device_t dev, struct intr_irqsrc *isrc, + null_pic_activate_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { @@ -51,7 +51,7 @@ CODE { } static int - null_pic_release_intr(device_t dev, struct intr_irqsrc *isrc, + null_pic_deactivate_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { @@ -92,12 +92,12 @@ CODE { } }; -METHOD int alloc_intr { +METHOD int activate_intr { device_t dev; struct intr_irqsrc *isrc; struct resource *res; struct intr_map_data *data; -} DEFAULT null_pic_alloc_intr; +} DEFAULT null_pic_activate_intr; METHOD int bind_intr { device_t dev; @@ -120,12 +120,12 @@ METHOD int map_intr { struct intr_irqsrc **isrcp; }; -METHOD int release_intr { +METHOD int deactivate_intr { device_t dev; struct intr_irqsrc *isrc; struct resource *res; struct intr_map_data *data; -} DEFAULT null_pic_release_intr; +} DEFAULT null_pic_deactivate_intr; METHOD int setup_intr { device_t dev; Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/kern/subr_bus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -3951,23 +3951,6 @@ bus_generic_new_pass(device_t dev) } /** - * @brief Helper function for implementing BUS_MAP_INTR(). - * - * This simple implementation of BUS_MAP_INTR() simply calls the - * BUS_MAP_INTR() method of the parent of @p dev. - */ -int -bus_generic_map_intr(device_t dev, device_t child, int *rid, rman_res_t *start, - rman_res_t *end, rman_res_t *count, struct intr_map_data **imd) -{ - /* Propagate up the bus hierarchy until someone handles it. */ - if (dev->parent) - return (BUS_MAP_INTR(dev->parent, child, rid, start, end, count, - imd)); - return (EINVAL); -} - -/** * @brief Helper function for implementing BUS_SETUP_INTR(). * * This simple implementation of BUS_SETUP_INTR() simply calls the @@ -4422,41 +4405,6 @@ bus_release_resources(device_t dev, cons } } -#ifdef INTRNG -/** - * @internal - * - * This can be converted to bus method later. (XXX) - */ -static struct intr_map_data * -bus_extend_resource(device_t dev, int type, int *rid, rman_res_t *start, - rman_res_t *end, rman_res_t *count) -{ - struct intr_map_data *imd; - struct resource_list *rl; - int rv; - - if (dev->parent == NULL) - return (NULL); - if (type != SYS_RES_IRQ) - return (NULL); - - if (!RMAN_IS_DEFAULT_RANGE(*start, *end)) - return (NULL); - rl = BUS_GET_RESOURCE_LIST(dev->parent, dev); - if (rl != NULL) { - if (resource_list_find(rl, type, *rid) != NULL) - return (NULL); - } - rv = BUS_MAP_INTR(dev->parent, dev, rid, start, end, count, &imd); - if (rv != 0) - return (NULL); - if (rl != NULL) - resource_list_add(rl, type, *rid, *start, *end, *count); - return (imd); -} -#endif - /** * @brief Wrapper function for BUS_ALLOC_RESOURCE(). * @@ -4468,26 +4416,11 @@ bus_alloc_resource(device_t dev, int typ rman_res_t end, rman_res_t count, u_int flags) { struct resource *res; -#ifdef INTRNG - struct intr_map_data *imd; -#endif if (dev->parent == NULL) return (NULL); - -#ifdef INTRNG - imd = bus_extend_resource(dev, type, rid, &start, &end, &count); -#endif res = BUS_ALLOC_RESOURCE(dev->parent, dev, type, rid, start, end, count, flags); -#ifdef INTRNG - if (imd != NULL) { - if (res != NULL && rman_get_virtual(res) == NULL) - rman_set_virtual(res, imd); - else - imd->destruct(imd); - } -#endif return (res); } @@ -4574,21 +4507,10 @@ int bus_release_resource(device_t dev, int type, int rid, struct resource *r) { int rv; -#ifdef INTRNG - struct intr_map_data *imd; -#endif if (dev->parent == NULL) return (EINVAL); - -#ifdef INTRNG - imd = (type == SYS_RES_IRQ) ? rman_get_virtual(r) : NULL; -#endif rv = BUS_RELEASE_RESOURCE(dev->parent, dev, type, rid, r); -#ifdef INTRNG - if (imd != NULL) - imd->destruct(imd); -#endif return (rv); } Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/kern/subr_intr.c Fri Aug 19 10:52:39 2016 (r304459) @@ -31,8 +31,9 @@ __FBSDID("$FreeBSD$"); /* * New-style Interrupt Framework * - * TODO: - to support IPI (PPI) enabling on other CPUs if already started - * - to complete things for removable PICs + * TODO: - add support for disconnected PICs. + * - to support IPI (PPI) enabling on other CPUs if already started. + * - to complete things for removable PICs. */ #include "opt_ddb.h" @@ -142,6 +143,11 @@ size_t sintrcnt = sizeof(intrcnt); size_t sintrnames = sizeof(intrnames); static u_int intrcnt_index; +static struct intr_irqsrc *intr_map_get_isrc(u_int res_id); +static void intr_map_set_isrc(u_int res_id, struct intr_irqsrc *isrc); +static void intr_map_copy_map_data(u_int res_id, device_t *dev, intptr_t *xref, + struct intr_map_data **data); + /* * Interrupt framework initialization routine. */ @@ -414,18 +420,6 @@ isrc_free_irq(struct intr_irqsrc *isrc) } /* - * Lookup interrupt source by interrupt number (resource handle). - */ -static inline struct intr_irqsrc * -isrc_lookup(u_int irq) -{ - - if (irq < nitems(irq_sources)) - return (irq_sources[irq]); - return (NULL); -} - -/* * Initialize interrupt source and register it into global interrupt table. */ int @@ -899,13 +893,12 @@ intr_pic_add_handler(device_t parent, st return (pic); } -int -intr_map_irq(device_t dev, intptr_t xref, struct intr_map_data *data, - u_int *irqp) +static int +intr_resolve_irq(device_t dev, intptr_t xref, struct intr_map_data *data, + struct intr_irqsrc **isrc) { - int error; - struct intr_irqsrc *isrc; struct intr_pic *pic; + struct intr_map_data_msi *msi; if (data == NULL) return (EINVAL); @@ -914,48 +907,77 @@ intr_map_irq(device_t dev, intptr_t xref if (pic == NULL) return (ESRCH); - KASSERT((pic->pic_flags & FLAG_PIC) != 0, - ("%s: Found a non-PIC controller: %s", __func__, - device_get_name(pic->pic_dev))); + switch (data->type) { + case INTR_MAP_DATA_MSI: + KASSERT((pic->pic_flags & FLAG_MSI) != 0, + ("%s: Found a non-MSI controller: %s", __func__, + device_get_name(pic->pic_dev))); + msi = (struct intr_map_data_msi *)data; + *isrc = msi->isrc; + return (0); - error = PIC_MAP_INTR(pic->pic_dev, data, &isrc); - if (error == 0) - *irqp = isrc->isrc_irq; - return (error); + default: + KASSERT((pic->pic_flags & FLAG_PIC) != 0, + ("%s: Found a non-PIC controller: %s", __func__, + device_get_name(pic->pic_dev))); + return (PIC_MAP_INTR(pic->pic_dev, data, isrc)); + + } } int -intr_alloc_irq(device_t dev, struct resource *res) +intr_activate_irq(device_t dev, struct resource *res) { + device_t map_dev; + intptr_t map_xref; struct intr_map_data *data; struct intr_irqsrc *isrc; + u_int res_id; + int error; KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = isrc_lookup(rman_get_start(res)); - if (isrc == NULL) - return (EINVAL); - - data = rman_get_virtual(res); - return (PIC_ALLOC_INTR(isrc->isrc_dev, isrc, res, data)); + res_id = (u_int)rman_get_start(res); + if (intr_map_get_isrc(res_id) != NULL) + panic("Attempt to double activation of resource id: %u\n", + res_id); + intr_map_copy_map_data(res_id, &map_dev, &map_xref, &data); + error = intr_resolve_irq(map_dev, map_xref, data, &isrc); + if (error != 0) { + free(data, M_INTRNG); + /* XXX TODO DISCONECTED PICs */ + /* if (error == EINVAL) return(0); */ + return (error); + } + intr_map_set_isrc(res_id, isrc); + rman_set_virtual(res, data); + return (PIC_ACTIVATE_INTR(isrc->isrc_dev, isrc, res, data)); } int -intr_release_irq(device_t dev, struct resource *res) +intr_deactivate_irq(device_t dev, struct resource *res) { struct intr_map_data *data; struct intr_irqsrc *isrc; + u_int res_id; + int error; KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = isrc_lookup(rman_get_start(res)); + res_id = (u_int)rman_get_start(res); + isrc = intr_map_get_isrc(res_id); if (isrc == NULL) - return (EINVAL); + panic("Attempt to deactivate non-active resource id: %u\n", + res_id); data = rman_get_virtual(res); - return (PIC_RELEASE_INTR(isrc->isrc_dev, isrc, res, data)); + error = PIC_DEACTIVATE_INTR(isrc->isrc_dev, isrc, res, data); + intr_map_set_isrc(res_id, NULL); + rman_set_virtual(res, NULL); + free(data, M_INTRNG); + return (error); } int @@ -966,13 +988,17 @@ intr_setup_irq(device_t dev, struct reso struct intr_map_data *data; struct intr_irqsrc *isrc; const char *name; + u_int res_id; KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = isrc_lookup(rman_get_start(res)); - if (isrc == NULL) + res_id = (u_int)rman_get_start(res); + isrc = intr_map_get_isrc(res_id); + if (isrc == NULL) { + /* XXX TODO DISCONECTED PICs */ return (EINVAL); + } data = rman_get_virtual(res); name = device_get_nameunit(dev); @@ -1027,11 +1053,13 @@ intr_teardown_irq(device_t dev, struct r int error; struct intr_map_data *data; struct intr_irqsrc *isrc; + u_int res_id; KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = isrc_lookup(rman_get_start(res)); + res_id = (u_int)rman_get_start(res); + isrc = intr_map_get_isrc(res_id); if (isrc == NULL || isrc->isrc_handlers == 0) return (EINVAL); @@ -1075,11 +1103,13 @@ intr_describe_irq(device_t dev, struct r { int error; struct intr_irqsrc *isrc; + u_int res_id; KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = isrc_lookup(rman_get_start(res)); + res_id = (u_int)rman_get_start(res); + isrc = intr_map_get_isrc(res_id); if (isrc == NULL || isrc->isrc_handlers == 0) return (EINVAL); #ifdef INTR_SOLO @@ -1107,11 +1137,13 @@ int intr_bind_irq(device_t dev, struct resource *res, int cpu) { struct intr_irqsrc *isrc; + u_int res_id; KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = isrc_lookup(rman_get_start(res)); + res_id = (u_int)rman_get_start(res); + isrc = intr_map_get_isrc(res_id); if (isrc == NULL || isrc->isrc_handlers == 0) return (EINVAL); #ifdef INTR_SOLO @@ -1191,6 +1223,28 @@ intr_irq_next_cpu(u_int current_cpu, cpu #endif /* + * Allocate memory for new intr_map_data structure. + * Initialize common fields. + */ +struct intr_map_data * +intr_alloc_map_data(enum intr_map_data_type type, size_t len, int flags) +{ + struct intr_map_data *data; + + data = malloc(len, M_INTRNG, flags); + data->type = type; + data->len = len; + return (data); +} + +void intr_free_intr_map_data(struct intr_map_data *data) +{ + + free(data, M_INTRNG); +} + + +/* * Register a MSI/MSI-X interrupt controller */ int @@ -1218,6 +1272,7 @@ intr_alloc_msi(device_t pci, device_t ch struct intr_irqsrc **isrc; struct intr_pic *pic; device_t pdev; + struct intr_map_data_msi *msi; int err, i; pic = pic_lookup(NULL, xref); @@ -1230,12 +1285,19 @@ intr_alloc_msi(device_t pci, device_t ch isrc = malloc(sizeof(*isrc) * count, M_INTRNG, M_WAITOK); err = MSI_ALLOC_MSI(pic->pic_dev, child, count, maxcount, &pdev, isrc); - if (err == 0) { - for (i = 0; i < count; i++) { - irqs[i] = isrc[i]->isrc_irq; - } + if (err != 0) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Aug 19 10:53:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDFF3BBF13E; Fri, 19 Aug 2016 10:53:18 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBB231221; Fri, 19 Aug 2016 10:53:18 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JArIeY070327; Fri, 19 Aug 2016 10:53:18 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JArIkg070326; Fri, 19 Aug 2016 10:53:18 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201608191053.u7JArIkg070326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Aug 2016 10:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304460 - head/sys/arm/nvidia X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 10:53:19 -0000 Author: mmel Date: Fri Aug 19 10:53:17 2016 New Revision: 304460 URL: https://svnweb.freebsd.org/changeset/base/304460 Log: TEGRA: Implement MSI/MSIX interrupts for pcie controller. Modified: head/sys/arm/nvidia/tegra_pcie.c Modified: head/sys/arm/nvidia/tegra_pcie.c ============================================================================== --- head/sys/arm/nvidia/tegra_pcie.c Fri Aug 19 10:52:39 2016 (r304459) +++ head/sys/arm/nvidia/tegra_pcie.c Fri Aug 19 10:53:17 2016 (r304460) @@ -33,20 +33,20 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include -#include #include #include #include -#include -#include #include -#include -#include #include #include +#include +#include #include #include @@ -68,8 +68,9 @@ __FBSDID("$FreeBSD$"); #include #include "ofw_bus_if.h" +#include "msi_if.h" #include "pcib_if.h" - +#include "pic_if.h" #define AFI_AXI_BAR0_SZ 0x000 @@ -93,17 +94,10 @@ __FBSDID("$FreeBSD$"); #define AFI_MSI_BAR_SZ 0x060 #define AFI_MSI_FPCI_BAR_ST 0x064 #define AFI_MSI_AXI_BAR_ST 0x068 - - -#define AFI_AXI_BAR6_SZ 0x134 -#define AFI_AXI_BAR7_SZ 0x138 -#define AFI_AXI_BAR8_SZ 0x13c -#define AFI_AXI_BAR6_START 0x140 -#define AFI_AXI_BAR7_START 0x144 -#define AFI_AXI_BAR8_START 0x148 -#define AFI_FPCI_BAR6 0x14c -#define AFI_FPCI_BAR7 0x150 -#define AFI_FPCI_BAR8 0x154 +#define AFI_MSI_VEC(x) (0x06c + 4 * (x)) +#define AFI_MSI_EN_VEC(x) (0x08c + 4 * (x)) +#define AFI_MSI_INTR_IN_REG 32 +#define AFI_MSI_REGS 8 #define AFI_CONFIGURATION 0x0ac #define AFI_CONFIGURATION_EN_FPCI (1 << 0) @@ -209,6 +203,8 @@ __FBSDID("$FreeBSD$"); #define TEGRA_PCIE_LINKUP_TIMEOUT 200 +#define TEGRA_PCIB_MSI_ENABLE + #define DEBUG #ifdef DEBUG #define debugf(fmt, args...) do { printf(fmt,##args); } while (0) @@ -258,6 +254,13 @@ static struct ofw_compat_data compat_dat {NULL, 0}, }; +#define TEGRA_FLAG_MSI_USED 0x0001 +struct tegra_pcib_irqsrc { + struct intr_irqsrc isrc; + u_int irq; + u_int flags; +}; + struct tegra_pcib_port { int enabled; int port_idx; /* chip port index */ @@ -271,6 +274,7 @@ struct tegra_pcib_port { }; #define TEGRA_PCIB_MAX_PORTS 3 +#define TEGRA_PCIB_MAX_MSI AFI_MSI_INTR_IN_REG * AFI_MSI_REGS struct tegra_pcib_softc { struct ofw_pci_softc ofw_pci; device_t dev; @@ -303,7 +307,7 @@ struct tegra_pcib_softc { regulator_t supply_vddio_pex_ctl; regulator_t supply_avdd_pll_erefe; - uint32_t msi_bitmap; + vm_offset_t msi_page; /* VA of MSI page */ bus_addr_t cfg_base_addr; /* base address of config */ bus_size_t cfg_cur_offs; /* currently mapped window */ bus_space_handle_t cfg_handle; /* handle of config window */ @@ -311,9 +315,9 @@ struct tegra_pcib_softc { int lanes_cfg; int num_ports; struct tegra_pcib_port *ports[TEGRA_PCIB_MAX_PORTS]; + struct tegra_pcib_irqsrc *isrcs; }; - static int tegra_pcib_maxslots(device_t dev) { @@ -324,13 +328,15 @@ static int tegra_pcib_route_interrupt(device_t bus, device_t dev, int pin) { struct tegra_pcib_softc *sc; + u_int irq; sc = device_get_softc(bus); - device_printf(bus, "route pin %d for device %d.%d to %ju\n", + irq = intr_map_clone_irq(rman_get_start(sc->irq_res)); + device_printf(bus, "route pin %d for device %d.%d to %u\n", pin, pci_get_slot(dev), pci_get_function(dev), - rman_get_start(sc->irq_res)); + irq); - return (rman_get_start(sc->irq_res)); + return (irq); } static int @@ -471,84 +477,320 @@ static int tegra_pci_intr(void *arg) return (FILTER_HANDLED); } -#if defined(TEGRA_PCI_MSI) +/* ----------------------------------------------------------------------- + * + * PCI MSI interface + */ +static int +tegra_pcib_alloc_msi(device_t pci, device_t child, int count, int maxcount, + int *irqs) +{ + phandle_t msi_parent; + + /* XXXX ofw_bus_msimap() don't works for Tegra DT. + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + */ + msi_parent = OF_xref_from_node(ofw_bus_get_node(pci)); + return (intr_alloc_msi(pci, child, msi_parent, count, maxcount, + irqs)); +} + static int -tegra_pcib_map_msi(device_t dev, device_t child, int irq, uint64_t *addr, +tegra_pcib_release_msi(device_t pci, device_t child, int count, int *irqs) +{ + phandle_t msi_parent; + + /* XXXX ofw_bus_msimap() don't works for Tegra DT. + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + */ + msi_parent = OF_xref_from_node(ofw_bus_get_node(pci)); + return (intr_release_msi(pci, child, msi_parent, count, irqs)); +} + +static int +tegra_pcib_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, uint32_t *data) { + phandle_t msi_parent; + + /* XXXX ofw_bus_msimap() don't works for Tegra DT. + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + */ + msi_parent = OF_xref_from_node(ofw_bus_get_node(pci)); + return (intr_map_msi(pci, child, msi_parent, irq, addr, data)); +} + +#ifdef TEGRA_PCIB_MSI_ENABLE + +/* -------------------------------------------------------------------------- + * + * Interrupts + * + */ + +static inline void +tegra_pcib_isrc_mask(struct tegra_pcib_softc *sc, + struct tegra_pcib_irqsrc *tgi, uint32_t val) +{ + uint32_t reg; + int offs, bit; + + offs = tgi->irq / AFI_MSI_INTR_IN_REG; + bit = 1 << (tgi->irq % AFI_MSI_INTR_IN_REG); + + if (val != 0) + AFI_WR4(sc, AFI_MSI_VEC(offs), bit); + reg = AFI_RD4(sc, AFI_MSI_EN_VEC(offs)); + if (val != 0) + reg |= bit; + else + reg &= ~bit; + AFI_WR4(sc, AFI_MSI_EN_VEC(offs), reg); +} + +static int +tegra_pcib_msi_intr(void *arg) +{ + u_int irq, i, bit, reg; struct tegra_pcib_softc *sc; + struct trapframe *tf; + struct tegra_pcib_irqsrc *tgi; - sc = device_get_softc(dev); - irq = irq - MSI_IRQ; + sc = (struct tegra_pcib_softc *)arg; + tf = curthread->td_intr_frame; + + for (i = 0; i < AFI_MSI_REGS; i++) { + reg = AFI_RD4(sc, AFI_MSI_VEC(i)); + /* Handle one vector. */ + while (reg != 0) { + bit = ffs(reg) - 1; +//printf("%s: i: %d, reg: 0x%08X, bit: 0x%08X, addr: 0x%08llX\n", __func__, i, reg, bit, rman_get_start(sc->afi_mem_res)); + /* Send EOI */ + AFI_WR4(sc, AFI_MSI_VEC(i), 1 << bit); + irq = i * AFI_MSI_INTR_IN_REG + bit; + tgi = &sc->isrcs[irq]; + if (intr_isrc_dispatch(&tgi->isrc, tf) != 0) { + /* Disable stray. */ + tegra_pcib_isrc_mask(sc, tgi, 0); + device_printf(sc->dev, + "Stray irq %u disabled\n", irq); + } + reg = AFI_RD4(sc, AFI_MSI_VEC(i)); + } + } + return (FILTER_HANDLED); +} - /* validate parameters */ - if (isclr(&sc->msi_bitmap, irq)) { - device_printf(dev, "invalid MSI 0x%x\n", irq); - return (EINVAL); +static int +tegra_pcib_msi_attach(struct tegra_pcib_softc *sc) +{ + int error; + uint32_t irq; + const char *name; + + sc->isrcs = malloc(sizeof(*sc->isrcs) * TEGRA_PCIB_MAX_MSI, M_DEVBUF, + M_WAITOK | M_ZERO); + + name = device_get_nameunit(sc->dev); + for (irq = 0; irq < TEGRA_PCIB_MAX_MSI; irq++) { + sc->isrcs[irq].irq = irq; + error = intr_isrc_register(&sc->isrcs[irq].isrc, + sc->dev, 0, "%s,%u", name, irq); + if (error != 0) + return (error); /* XXX deregister ISRCs */ } + if (intr_msi_register(sc->dev, + OF_xref_from_node(ofw_bus_get_node(sc->dev))) != 0) + return (ENXIO); + + return (0); +} + +static int +tegra_pcib_msi_detach(struct tegra_pcib_softc *sc) +{ + + /* + * There has not been established any procedure yet + * how to detach PIC from living system correctly. + */ + device_printf(sc->dev, "%s: not implemented yet\n", __func__); + return (EBUSY); +} + + +static void +tegra_pcib_msi_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct tegra_pcib_softc *sc; + struct tegra_pcib_irqsrc *tgi; + + sc = device_get_softc(dev); + tgi = (struct tegra_pcib_irqsrc *)isrc; + tegra_pcib_isrc_mask(sc, tgi, 0); +} + +static void +tegra_pcib_msi_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct tegra_pcib_softc *sc; + struct tegra_pcib_irqsrc *tgi; + + sc = device_get_softc(dev); + tgi = (struct tegra_pcib_irqsrc *)isrc; + tegra_pcib_isrc_mask(sc, tgi, 1); +} + +/* MSI interrupts are edge trigered -> do nothing */ +static void +tegra_pcib_msi_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ +} + +static void +tegra_pcib_msi_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ +} + +static void +tegra_pcib_msi_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ +} + +static int +tegra_pcib_msi_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct tegra_pcib_softc *sc; + struct tegra_pcib_irqsrc *tgi; - tegra_msi_data(irq, addr, data); + sc = device_get_softc(dev); + tgi = (struct tegra_pcib_irqsrc *)isrc; - debugf("%s: irq: %d addr: %jx data: %x\n", - __func__, irq, *addr, *data); + if (data == NULL || data->type != INTR_MAP_DATA_MSI) + return (ENOTSUP); + + if (isrc->isrc_handlers == 0) + tegra_pcib_msi_enable_intr(dev, isrc); return (0); } static int -tegra_pcib_alloc_msi(device_t dev, device_t child, int count, - int maxcount __unused, int *irqs) +tegra_pcib_msi_teardown_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) { struct tegra_pcib_softc *sc; - u_int start = 0, i; + struct tegra_pcib_irqsrc *tgi; - if (powerof2(count) == 0 || count > MSI_IRQ_NUM) - return (EINVAL); + sc = device_get_softc(dev); + tgi = (struct tegra_pcib_irqsrc *)isrc; + + if (isrc->isrc_handlers == 0) + tegra_pcib_isrc_mask(sc, tgi, 0); + return (0); +} + + +static int +tegra_pcib_msi_alloc_msi(device_t dev, device_t child, int count, int maxcount, + device_t *pic, struct intr_irqsrc **srcs) +{ + struct tegra_pcib_softc *sc; + int i, irq, end_irq; + bool found; + + KASSERT(powerof2(count), ("%s: bad count", __func__)); + KASSERT(powerof2(maxcount), ("%s: bad maxcount", __func__)); sc = device_get_softc(dev); mtx_lock(&sc->mtx); - for (start = 0; (start + count) < MSI_IRQ_NUM; start++) { - for (i = start; i < start + count; i++) { - if (isset(&sc->msi_bitmap, i)) + found = false; + for (irq = 0; irq < TEGRA_PCIB_MAX_MSI && !found; irq++) { + /* Start on an aligned interrupt */ + if ((irq & (maxcount - 1)) != 0) + continue; + + /* Assume we found a valid range until shown otherwise */ + found = true; + + /* Check this range is valid */ + for (end_irq = irq; end_irq != irq + count - 1; end_irq++) { + /* No free interrupts */ + if (end_irq == (TEGRA_PCIB_MAX_MSI - 1)) { + found = false; + break; + } + + /* This is already used */ + if ((sc->isrcs[irq].flags & TEGRA_FLAG_MSI_USED) == + TEGRA_FLAG_MSI_USED) { + found = false; break; + } } - if (i == start + count) - break; } - if ((start + count) == MSI_IRQ_NUM) { + /* Not enough interrupts were found */ + if (!found || irq == (TEGRA_PCIB_MAX_MSI - 1)) { mtx_unlock(&sc->mtx); return (ENXIO); } - for (i = start; i < start + count; i++) { - setbit(&sc->msi_bitmap, i); - irqs[i] = MSI_IRQ + i; - } - debugf("%s: start: %x count: %x\n", __func__, start, count); + for (i = 0; i < count; i++) { + /* Mark the interrupt as used */ + sc->isrcs[irq + i].flags |= TEGRA_FLAG_MSI_USED; + } mtx_unlock(&sc->mtx); + + for (i = 0; i < count; i++) + srcs[i] = (struct intr_irqsrc *)&sc->isrcs[irq + i]; + *pic = device_get_parent(dev); return (0); } static int -tegra_pcib_release_msi(device_t dev, device_t child, int count, int *irqs) +tegra_pcib_msi_release_msi(device_t dev, device_t child, int count, + struct intr_irqsrc **isrc) { struct tegra_pcib_softc *sc; - u_int i; + struct tegra_pcib_irqsrc *ti; + int i; sc = device_get_softc(dev); mtx_lock(&sc->mtx); + for (i = 0; i < count; i++) { + ti = (struct tegra_pcib_irqsrc *)isrc; - for (i = 0; i < count; i++) - clrbit(&sc->msi_bitmap, irqs[i] - MSI_IRQ); + KASSERT((ti->flags & TEGRA_FLAG_MSI_USED) == TEGRA_FLAG_MSI_USED, + ("%s: Trying to release an unused MSI-X interrupt", + __func__)); - mtx_unlock(&sc->mtx); + ti->flags &= ~TEGRA_FLAG_MSI_USED; + mtx_unlock(&sc->mtx); + } + return (0); +} + +static int +tegra_pcib_msi_map_msi(device_t dev, device_t child, struct intr_irqsrc *isrc, + uint64_t *addr, uint32_t *data) +{ + struct tegra_pcib_softc *sc = device_get_softc(dev); + struct tegra_pcib_irqsrc *ti = (struct tegra_pcib_irqsrc *)isrc; + + *addr = vtophys(sc->msi_page); + *data = ti->irq; return (0); } #endif +/* ------------------------------------------------------------------- */ static bus_size_t tegra_pcib_pex_ctrl(struct tegra_pcib_softc *sc, int port) { @@ -1137,6 +1379,52 @@ tegra_pcib_enable(struct tegra_pcib_soft return(0); } +#ifdef TEGRA_PCIB_MSI_ENABLE +static int +tegra_pcib_attach_msi(device_t dev) +{ + struct tegra_pcib_softc *sc; + uint32_t reg; + int i, rv; + + sc = device_get_softc(dev); + + sc->msi_page = kmem_alloc_contig(kernel_arena, PAGE_SIZE, M_WAITOK, + 0, BUS_SPACE_MAXADDR, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + + /* MSI BAR */ + tegra_pcib_set_bar(sc, 9, vtophys(sc->msi_page), vtophys(sc->msi_page), + PAGE_SIZE, 0); + + /* Disble and clear all interrupts. */ + for (i = 0; i < AFI_MSI_REGS; i++) { + AFI_WR4(sc, AFI_MSI_EN_VEC(i), 0); + AFI_WR4(sc, AFI_MSI_VEC(i), 0xFFFFFFFF); + } + rv = bus_setup_intr(dev, sc->msi_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + tegra_pcib_msi_intr, NULL, sc, &sc->msi_intr_cookie); + if (rv != 0) { + device_printf(dev, "cannot setup MSI interrupt handler\n"); + rv = ENXIO; + goto out; + } + + if (tegra_pcib_msi_attach(sc) != 0) { + device_printf(dev, "WARNING: unable to attach PIC\n"); + tegra_pcib_msi_detach(sc); + goto out; + } + + /* Unmask MSI interrupt. */ + reg = AFI_RD4(sc, AFI_INTR_MASK); + reg |= AFI_INTR_MASK_MSI_MASK; + AFI_WR4(sc, AFI_INTR_MASK, reg); + +out: + return (rv); +} +#endif + static int tegra_pcib_probe(device_t dev) { @@ -1254,7 +1542,7 @@ tegra_pcib_attach(device_t dev) goto out; if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - tegra_pci_intr, NULL, sc, &sc->intr_cookie)) { + tegra_pci_intr, NULL, sc, &sc->intr_cookie)) { device_printf(dev, "cannot setup interrupt handler\n"); rv = ENXIO; goto out; @@ -1275,6 +1563,11 @@ tegra_pcib_attach(device_t dev) tegra_pcib_port_disable(sc, i); } +#ifdef TEGRA_PCIB_MSI_ENABLE + rv = tegra_pcib_attach_msi(dev); + if (rv != 0) + goto out; +#endif device_add_child(dev, "pci", -1); return (bus_generic_attach(dev)); @@ -1299,11 +1592,24 @@ static device_method_t tegra_pcib_method DEVMETHOD(pcib_read_config, tegra_pcib_read_config), DEVMETHOD(pcib_write_config, tegra_pcib_write_config), DEVMETHOD(pcib_route_interrupt, tegra_pcib_route_interrupt), - -#if defined(TEGRA_PCI_MSI) DEVMETHOD(pcib_alloc_msi, tegra_pcib_alloc_msi), DEVMETHOD(pcib_release_msi, tegra_pcib_release_msi), DEVMETHOD(pcib_map_msi, tegra_pcib_map_msi), + +#ifdef TEGRA_PCIB_MSI_ENABLE + /* MSI/MSI-X */ + DEVMETHOD(msi_alloc_msi, tegra_pcib_msi_alloc_msi), + DEVMETHOD(msi_release_msi, tegra_pcib_msi_release_msi), + DEVMETHOD(msi_map_msi, tegra_pcib_msi_map_msi), + + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, tegra_pcib_msi_disable_intr), + DEVMETHOD(pic_enable_intr, tegra_pcib_msi_enable_intr), + DEVMETHOD(pic_setup_intr, tegra_pcib_msi_setup_intr), + DEVMETHOD(pic_teardown_intr, tegra_pcib_msi_teardown_intr), + DEVMETHOD(pic_post_filter, tegra_pcib_msi_post_filter), + DEVMETHOD(pic_post_ithread, tegra_pcib_msi_post_ithread), + DEVMETHOD(pic_pre_ithread, tegra_pcib_msi_pre_ithread), #endif /* OFW bus interface */ From owner-svn-src-head@freebsd.org Fri Aug 19 10:53:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D86FCBBF1B5; Fri, 19 Aug 2016 10:53:57 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5AE51396; Fri, 19 Aug 2016 10:53:57 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by mail-pf0-x231.google.com with SMTP id p64so8584373pfb.1; Fri, 19 Aug 2016 03:53:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DUsprsfJ5orhssKgeIBNIS2lU+o4fO28+dew68RxHd0=; b=hkIlqssN8HDDCi7Pien8rfTJNIcYZgG+Fk+ZQGwxtTY+0NonckkAHxFM2jmp3ehNii llid1p01u9ZcF+O1Jvif4m+YEHNK5RoHIF/87rlwtUeUeXlE+ZXyI7K3oWRgGpjNZeOw BculfPDLWlugNssPrCvl8ASqAMFy7Q976sruJxum7PRfvSQZmapwQjoNZcqSbULlo89m JaCW5mSJLo8BiQibBK5wayfVddlsraGyImKxl/iIUWlUcmt33T0Uj3AgyciD2nu5HPeb L79S3pLEi8wH2ZMbQP1N043vM5O/XDrTp8Zz3G/G9PptpMgsZmtpXoeEtcZ1s1MFeqgu oNSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=DUsprsfJ5orhssKgeIBNIS2lU+o4fO28+dew68RxHd0=; b=FiXD1V526YFo7ghfULyhQBdZswt8lrZC5iQ7mhpqG88EeRn57zeodenyWtoxXdGQ6U JAMyINMqQ0QAiQfy34CDYexFJOY0gN9yJ7J8gHtx/etuc5W0hr6Pqpogj05Pl8g3FmFn 8UFIlJ1+WbSRnC85rDigfi0TZfVtS/RTIXMm5OTJsZNO9FQu9gBG+k3SH3xQkJQ6t4AL BWJVGMntEwiprvNkcpaUkz7Qq45HWNiIOC6wuvWu77oFOx1BULcr4eeOGSKBhLdYMFOA kF8LUGG/ADEKTu0NvEfxahbvMEJ7VSjPnSU+jv9vOb3GU5Gq2iP+US5bkc7Z/BLng2lo nDSA== X-Gm-Message-State: AEkoousMYTmmj+PUGWktrlotMOQJbgmVMbRMyB0RcdG7K832UJZnAl8W7YKAogVbgBs8bg== X-Received: by 10.98.131.8 with SMTP id h8mr13181633pfe.124.1471604037307; Fri, 19 Aug 2016 03:53:57 -0700 (PDT) Received: from localhost ([106.247.248.2]) by smtp.gmail.com with ESMTPSA id g21sm5554805pfj.88.2016.08.19.03.53.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Aug 2016 03:53:56 -0700 (PDT) From: YongHyeon PYUN X-Google-Original-From: "YongHyeon PYUN" Received: by localhost (sSMTP sendmail emulation); Fri, 19 Aug 2016 19:53:49 +0900 Date: Fri, 19 Aug 2016 19:53:49 +0900 To: Hans Petter Selasky Cc: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304439 - head/sys/dev/usb/net Message-ID: <20160819105349.GJ1186@michelle.fasterthan.co.kr> Reply-To: pyunyh@gmail.com References: <201608190050.u7J0oWkW043171@repo.freebsd.org> <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> <20160819085511.GF1186@michelle.fasterthan.co.kr> <2e8143d4-eb32-693d-e5a4-49c380c100df@selasky.org> <20160819092223.GG1186@michelle.fasterthan.co.kr> <63a25b6b-4503-b136-7765-7744108db1a1@selasky.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <63a25b6b-4503-b136-7765-7744108db1a1@selasky.org> User-Agent: Mutt/1.4.2.3i X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 10:53:57 -0000 On Fri, Aug 19, 2016 at 12:39:58PM +0200, Hans Petter Selasky wrote: > On 08/19/16 11:22, YongHyeon PYUN wrote: > >On Fri, Aug 19, 2016 at 11:11:56AM +0200, Hans Petter Selasky wrote: > >>On 08/19/16 10:55, YongHyeon PYUN wrote: > >>>I think the order is right but it was not tested on big-endian > >>>systems. > >> > >>Hi, > >> > >>I'm pretty sure the ifdef is wrong, because you write the fields one at > >>a time, using htole32(): > >> > >> txhdr.mss = 0; > >> txhdr.len = > >> htole32(AXGE_TXBYTES(m->m_pkthdr.len)); > >> > >>Big endian machines don't re-order variables like this. > >> > >>You should remove the #else part. > > > >Wouldn't USB stack pass txhdr structure without any > >modification? And controller want to see len (low 32bits address) > >first and then mss (high 32bits address). On big endian systems I > >guess this should be reversed in host memory layout. This is so > >confusing so I could be wrong. > > The USB stack passes TXHDR as-is and the host controller is byte > oriented, not 64-bit word oriented. That's why the layout is the same as > long as you assign per 32-bit field. > Ok, fixed in r304458. Thanks for pointing it out! From owner-svn-src-head@freebsd.org Fri Aug 19 11:13:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D846BBBF926; Fri, 19 Aug 2016 11:13:00 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB3AD1F16; Fri, 19 Aug 2016 11:13:00 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JBCxIx077775; Fri, 19 Aug 2016 11:12:59 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JBCxd6077774; Fri, 19 Aug 2016 11:12:59 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201608191112.u7JBCxd6077774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Aug 2016 11:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304461 - head/sys/arm/nvidia X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 11:13:00 -0000 Author: mmel Date: Fri Aug 19 11:12:59 2016 New Revision: 304461 URL: https://svnweb.freebsd.org/changeset/base/304461 Log: TEGRA: Remove forgotten debug printf. Modified: head/sys/arm/nvidia/tegra_pcie.c Modified: head/sys/arm/nvidia/tegra_pcie.c ============================================================================== --- head/sys/arm/nvidia/tegra_pcie.c Fri Aug 19 10:53:17 2016 (r304460) +++ head/sys/arm/nvidia/tegra_pcie.c Fri Aug 19 11:12:59 2016 (r304461) @@ -567,7 +567,6 @@ tegra_pcib_msi_intr(void *arg) /* Handle one vector. */ while (reg != 0) { bit = ffs(reg) - 1; -//printf("%s: i: %d, reg: 0x%08X, bit: 0x%08X, addr: 0x%08llX\n", __func__, i, reg, bit, rman_get_start(sc->afi_mem_res)); /* Send EOI */ AFI_WR4(sc, AFI_MSI_VEC(i), 1 << bit); irq = i * AFI_MSI_INTR_IN_REG + bit; From owner-svn-src-head@freebsd.org Fri Aug 19 11:13:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31571BBF99F; Fri, 19 Aug 2016 11:13:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id CF1A811F7; Fri, 19 Aug 2016 11:13:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id E735FD66D23; Fri, 19 Aug 2016 21:12:53 +1000 (AEST) Date: Fri, 19 Aug 2016 21:12:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Warner Losh , Julian Elischer , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd In-Reply-To: <20160819073955.GC83214@kib.kiev.ua> Message-ID: <20160819202010.Y2407@besplex.bde.org> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=hW_HMr3p4KBcaiv7OY0A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 11:13:31 -0000 On Fri, 19 Aug 2016, Konstantin Belousov wrote: > On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: >> On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer wrote: >>> On 16/08/2016 4:54 AM, John Baldwin wrote: >>>> >>>> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >>>>> ,,, >>>>> Log: >>>>> Remove the mcd(4) driver for Mitsumi CD-ROM players. >>>>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in >>>>> the manpage, this driver is only useful as a backend to cdcontrol to >>>>> play audio CDs since it doesn't use DMA, so its data performance is >>>>> "abysmal" (and that was true in the mid 90's). >>>> >>>> No one stepped up to test patches for it either when I last posted patches >>>> to >>>> convert it from timeout(9) to callout(9). I have a few more drivers that >>>> are >>>> ... >>> >>> I would imagine any machine still holding one of these probably has not >>> enough memory to run FreeBSD. >>> >>> would we still run in 2MB? >> >> With insane levels of tuning, we can run in 32MB userland that can do >> things. Even 64MB is tight w/o some tuning. 16MB is almost certainly >> right out except for very specialized situations. 2MB? We can't even >> load the loader in that :(. Oh, and all these memory configs are only >> possible if you tweak the loader's block cache... > > 32MB is quite usable. Without any tuning, you get slightly less than 10MB > for userspace, which is enough to for many things, and plenty if swap is > added. No, 32MB needs lots of needs tuning. -current seems to need about 16MB more than just a few months ago when I last discussed this with you. My i386 system doesn't have many drivers or a bloated userland (*), but it took the following tuning plus my PAE tuning fixes to boot in 32MB: - disable [l]em1 - reduce tx and buffers to 256 for em0. They default to 4096 for em. That is something like 8K * 1500 bytes = 12MB for em0 alone. lem[1] wants another 12MB. I think this is not all statically allocated, but the drivers hang onto that much. This now longer works. -current without my PAE tuning fixes hangs mounting root or in usb initialization with this tuning and 40MB. -current with my PAE tuning fixes hangs similarly with 32MB; with 40MB it boots to the start of multiuser but then hangs (it starts 1 getty, then 2 sendmails and kills them with "out of swap space") and 1 rpcbind (also killed). I don't use swap, but it was needed 20 years ago on a system that actually had 32MB of memory. (*) /bin/sh doing nothing much in -current i386: size 6532K res 1924K /bin/sh in my ~5.2 i386: size 864K res 592K The kernel size is 5.5MB text 370K data 2.2MB bss (lots of bloat in bss for debugging and vt). In single user mode, with 40MB to start, there is 22116K wired and 2516K free. A few programs can be run in 2516K without swap if they have res 592K and not 1924K. > Note that you cannot boot on such configurations since loader was broken, > but if you do manage to jump to kernel, things were fine several months > ago. I tested my relatively recent OOM changes on 32MB qemu config. I have no problems booting such configuratations since I don't use the current loader and only use old loader to change the environment to set up special configurations like this. I use my version of biosboot for boot2. This requires fixing 2 layers of complicated breakage in init386(). vm86 is now used before the TSS and PIC resources that it uses are initialized, but only in paths that are not normally used because they are for memory sizing that is normally done by loader :-(. I normally use my version of biosboot for boot2. I improved its caching just a couple of years ago. It was using 9K buffer optimized for 1440K floppies. Now it uses a 32K buffer. Booting a 5.5MB kernel takes a fraction of a second. Of course I don't use modules, so not many seeks are needed. Bruce From owner-svn-src-head@freebsd.org Fri Aug 19 11:27:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E8E7BBFC7D; Fri, 19 Aug 2016 11:27:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17FE116F3; Fri, 19 Aug 2016 11:27:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7JBRdY8081111 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 19 Aug 2016 14:27:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7JBRdY8081111 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7JBRTo2081107; Fri, 19 Aug 2016 14:27:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 19 Aug 2016 14:27:29 +0300 From: Konstantin Belousov To: Bruce Evans Cc: Warner Losh , Julian Elischer , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd Message-ID: <20160819112729.GH83214@kib.kiev.ua> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> <20160819202010.Y2407@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160819202010.Y2407@besplex.bde.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 11:27:55 -0000 On Fri, Aug 19, 2016 at 09:12:53PM +1000, Bruce Evans wrote: > On Fri, 19 Aug 2016, Konstantin Belousov wrote: > > > On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: > >> On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer wrote: > >>> On 16/08/2016 4:54 AM, John Baldwin wrote: > >>>> > >>>> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: > >>>>> ,,, > >>>>> Log: > >>>>> Remove the mcd(4) driver for Mitsumi CD-ROM players. > >>>>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in > >>>>> the manpage, this driver is only useful as a backend to cdcontrol to > >>>>> play audio CDs since it doesn't use DMA, so its data performance is > >>>>> "abysmal" (and that was true in the mid 90's). > >>>> > >>>> No one stepped up to test patches for it either when I last posted patches > >>>> to > >>>> convert it from timeout(9) to callout(9). I have a few more drivers that > >>>> are > >>>> ... > >>> > >>> I would imagine any machine still holding one of these probably has not > >>> enough memory to run FreeBSD. > >>> > >>> would we still run in 2MB? > >> > >> With insane levels of tuning, we can run in 32MB userland that can do > >> things. Even 64MB is tight w/o some tuning. 16MB is almost certainly > >> right out except for very specialized situations. 2MB? We can't even > >> load the loader in that :(. Oh, and all these memory configs are only > >> possible if you tweak the loader's block cache... > > > > 32MB is quite usable. Without any tuning, you get slightly less than 10MB > > for userspace, which is enough to for many things, and plenty if swap is > > added. > > No, 32MB needs lots of needs tuning. -current seems to need about 16MB > more than just a few months ago when I last discussed this with you. > My i386 system doesn't have many drivers or a bloated userland (*), > but it took the following tuning plus my PAE tuning fixes to boot in > 32MB: > - disable [l]em1 > - reduce tx and buffers to 256 for em0. They default to 4096 for em. That > is something like 8K * 1500 bytes = 12MB for em0 alone. lem[1] wants > another 12MB. I think this is not all statically allocated, but the > drivers hang onto that much. > This now longer works. -current without my PAE tuning fixes hangs mounting > root or in usb initialization with this tuning and 40MB. -current with my > PAE tuning fixes hangs similarly with 32MB; with 40MB it boots to the > start of multiuser but then hangs (it starts 1 getty, then 2 sendmails > and kills them with "out of swap space") and 1 rpcbind (also killed). I > don't use swap, but it was needed 20 years ago on a system that actually > had 32MB of memory. > > (*) /bin/sh doing nothing much in -current i386: size 6532K res 1924K > /bin/sh in my ~5.2 i386: size 864K res 592K > > The kernel size is 5.5MB text 370K data 2.2MB bss (lots of bloat in bss > for debugging and vt). In single user mode, with 40MB to start, there > is 22116K wired and 2516K free. A few programs can be run in 2516K > without swap if they have res 592K and not 1924K. > > > Note that you cannot boot on such configurations since loader was broken, > > but if you do manage to jump to kernel, things were fine several months > > ago. I tested my relatively recent OOM changes on 32MB qemu config. > > I have no problems booting such configuratations since I don't use the > current loader and only use old loader to change the environment to > set up special configurations like this. I use my version of biosboot > for boot2. This requires fixing 2 layers of complicated breakage in > init386(). vm86 is now used before the TSS and PIC resources that it > uses are initialized, but only in paths that are not normally used > because they are for memory sizing that is normally done by loader > :-(. > > I normally use my version of biosboot for boot2. I improved its caching > just a couple of years ago. It was using 9K buffer optimized for 1440K > floppies. Now it uses a 32K buffer. Booting a 5.5MB kernel takes a > fraction of a second. Of course I don't use modules, so not many seeks > are needed. Of course I use modules and do not use GENERIC. I just tried: with today HEAD, and old loader on 32MB VM, I get 11MB free in single-user mode. Active+inactive is ~4MB, and 1M is eaten by buffers, which is about right for init+/bin/sh+top idle system. Anyway, judging from the other responses, this is the lost case. From owner-svn-src-head@freebsd.org Fri Aug 19 12:48:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5753BBE53A; Fri, 19 Aug 2016 12:48:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7788F1FDC; Fri, 19 Aug 2016 12:48:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JCmWjm011785; Fri, 19 Aug 2016 12:48:32 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JCmWOM011783; Fri, 19 Aug 2016 12:48:32 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608191248.u7JCmWOM011783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Aug 2016 12:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304464 - in head/sys/arm/allwinner: . a10 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 12:48:33 -0000 Author: manu Date: Fri Aug 19 12:48:32 2016 New Revision: 304464 URL: https://svnweb.freebsd.org/changeset/base/304464 Log: Allwinner: Move a10_padconf.c into a10 subdirectory. Added: head/sys/arm/allwinner/a10/a10_padconf.c - copied unchanged from r304463, head/sys/arm/allwinner/a10_padconf.c Deleted: head/sys/arm/allwinner/a10_padconf.c Modified: head/sys/arm/allwinner/a10/files.a10 Copied: head/sys/arm/allwinner/a10/a10_padconf.c (from r304463, head/sys/arm/allwinner/a10_padconf.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10/a10_padconf.c Fri Aug 19 12:48:32 2016 (r304464, copy of r304463, head/sys/arm/allwinner/a10_padconf.c) @@ -0,0 +1,231 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#ifdef SOC_ALLWINNER_A10 + +const static struct allwinner_pins a10_pins[] = { + {"PA0", 0, 0, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, + {"PA1", 0, 1, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, + {"PA2", 0, 2, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, + {"PA3", 0, 3, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, + {"PA4", 0, 4, {"gpio_in", "gpio_out", "emac", "spi1", NULL, NULL, NULL, NULL}}, + {"PA5", 0, 5, {"gpio_in", "gpio_out", "emac", "spi3", NULL, NULL, NULL, NULL}}, + {"PA6", 0, 6, {"gpio_in", "gpio_out", "emac", "spi3", NULL, NULL, NULL, NULL}}, + {"PA7", 0, 7, {"gpio_in", "gpio_out", "emac", "spi3", NULL, NULL, NULL, NULL}}, + {"PA8", 0, 8, {"gpio_in", "gpio_out", "emac", "spi3", NULL, NULL, NULL, NULL}}, + {"PA9", 0, 9, {"gpio_in", "gpio_out", "emac", "spi3", NULL, NULL, NULL, NULL}}, + {"PA10", 0, 10, {"gpio_in", "gpio_out", "emac", NULL, "uart1", NULL, NULL, NULL}}, + {"PA11", 0, 11, {"gpio_in", "gpio_out", "emac", NULL, "uart1", NULL, NULL, NULL}}, + {"PA12", 0, 12, {"gpio_in", "gpio_out", "emac", "uart6", "uart1", NULL, NULL, NULL}}, + {"PA13", 0, 13, {"gpio_in", "gpio_out", "emac", "uart6", "uart1", NULL, NULL, NULL}}, + {"PA14", 0, 14, {"gpio_in", "gpio_out", "emac", "uart7", "uart1", NULL, NULL, NULL}}, + {"PA15", 0, 15, {"gpio_in", "gpio_out", "emac", "uart7", "uart1", NULL, NULL, NULL}}, + {"PA16", 0, 16, {"gpio_in", "gpio_out", NULL, "can", "uart1", NULL, NULL, NULL}}, + {"PA17", 0, 17, {"gpio_in", "gpio_out", NULL, "can", "uart1", NULL, NULL, NULL}}, + + {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, + {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, + {"PB2", 1, 2, {"gpio_in", "gpio_out", "pwm", NULL, NULL, NULL, NULL, NULL}}, + {"PB3", 1, 3, {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, NULL, NULL}}, + {"PB4", 1, 4, {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, NULL, NULL}}, + {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s", "ac97", NULL, NULL, NULL, NULL}}, + {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s", "ac97", NULL, NULL, NULL, NULL}}, + {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s", "ac97", NULL, NULL, NULL, NULL}}, + {"PB8", 1, 8, {"gpio_in", "gpio_out", "i2s", "ac97", NULL, NULL, NULL, NULL}}, + {"PB9", 1, 9, {"gpio_in", "gpio_out", "i2s", NULL, NULL, NULL, NULL, NULL}}, + {"PB10", 1, 10, {"gpio_in", "gpio_out", "i2s", NULL, NULL, NULL, NULL, NULL}}, + {"PB11", 1, 11, {"gpio_in", "gpio_out", "i2s", NULL, NULL, NULL, NULL, NULL}}, + {"PB12", 1, 12, {"gpio_in", "gpio_out", "i2s", "ac97", NULL, NULL, NULL, NULL}}, + {"PB13", 1, 13, {"gpio_in", "gpio_out", "spi2", NULL, NULL, NULL, NULL, NULL}}, + {"PB14", 1, 14, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB15", 1, 15, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB16", 1, 16, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB17", 1, 17, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB18", 1, 18, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB19", 1, 19, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB20", 1, 20, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB21", 1, 21, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB22", 1, 22, {"gpio_in", "gpio_out", "uart0", "ir1", NULL, NULL, NULL, NULL}}, + {"PB23", 1, 23, {"gpio_in", "gpio_out", "uart0", "ir1", NULL, NULL, NULL, NULL}}, + + {"PC0", 2, 0, {"gpio_in", "gpio_out", "nand", "spi0", NULL, NULL, NULL, NULL}}, + {"PC1", 2, 1, {"gpio_in", "gpio_out", "nand", "spi0", NULL, NULL, NULL, NULL}}, + {"PC2", 2, 2, {"gpio_in", "gpio_out", "nand", "spi0", NULL, NULL, NULL, NULL}}, + {"PC3", 2, 3, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC4", 2, 4, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC5", 2, 5, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC6", 2, 6, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC7", 2, 7, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC8", 2, 8, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC9", 2, 9, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC10", 2, 10, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC11", 2, 11, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC12", 2, 12, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC13", 2, 13, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC14", 2, 14, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC15", 2, 15, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC16", 2, 16, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC17", 2, 17, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC18", 2, 18, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC19", 2, 19, {"gpio_in", "gpio_out", "nand", "spi2", NULL, NULL, NULL, NULL}}, + {"PC20", 2, 20, {"gpio_in", "gpio_out", "nand", "spi2", NULL, NULL, NULL, NULL}}, + {"PC21", 2, 21, {"gpio_in", "gpio_out", "nand", "spi2", NULL, NULL, NULL, NULL}}, + {"PC22", 2, 22, {"gpio_in", "gpio_out", "nand", "spi2", NULL, NULL, NULL, NULL}}, + {"PC23", 2, 23, {"gpio_in", "gpio_out", "spi0", NULL, NULL, NULL, NULL, NULL}}, + {"PC24", 2, 24, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + + {"PD0", 3, 0, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD1", 3, 1, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD2", 3, 2, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD3", 3, 3, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD4", 3, 4, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD5", 3, 5, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD6", 3, 6, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD7", 3, 7, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD8", 3, 8, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD9", 3, 9, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD10", 3, 10, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD11", 3, 11, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD12", 3, 12, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD13", 3, 13, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD14", 3, 14, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD15", 3, 15, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD16", 3, 16, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD17", 3, 17, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD18", 3, 18, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD19", 3, 19, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD20", 3, 20, {"gpio_in", "gpio_out", "lcd0", "csi1", NULL, NULL, NULL, NULL}}, + {"PD21", 3, 21, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD22", 3, 22, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD23", 3, 23, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD24", 3, 24, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD25", 3, 25, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD26", 3, 26, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD27", 3, 27, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + + {"PE0", 4, 0, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE1", 4, 1, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE2", 4, 2, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE3", 4, 3, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE4", 4, 4, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE5", 4, 5, {"gpio_in", "gpio_out", "ts0", "csi0", "sim", NULL, NULL, NULL}}, + {"PE6", 4, 6, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE7", 4, 7, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE8", 4, 8, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE9", 4, 9, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE10", 4, 10, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE11", 4, 11, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + + {"PF0", 5, 0, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF1", 5, 1, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF2", 5, 2, {"gpio_in", "gpio_out", "mmc0", NULL, "uart0", NULL, NULL, NULL}}, + {"PF3", 5, 3, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + + {"PG0", 6, 0, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG1", 6, 1, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG2", 6, 2, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", "csi0", NULL, NULL}}, + {"PG5", 6, 5, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", "csi0", NULL, NULL}}, + {"PG6", 6, 6, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG7", 6, 7, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG8", 6, 8, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, + + {"PH0", 7, 0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}}, + {"PH1", 7, 1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}}, + {"PH2", 7, 2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}}, + {"PH3", 7, 3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}}, + {"PH4", 7, 4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint", "csi1"}}, + {"PH5", 7, 5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint", "csi1"}}, + {"PH6", 7, 6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint", "csi1"}}, + {"PH7", 7, 7, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint", "csi1"}}, + {"PH8", 7, 8, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}}, + {"PH9", 7, 9, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}}, + {"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}}, + {"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}}, + {"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", NULL, "eint", "csi1"}}, + {"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", "sim", "eint", "csi1"}}, + {"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}}, + {"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}}, + {"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", NULL, "eint", "csi1"}}, + {"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}}, + {"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}}, + {"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}}, + {"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint", "csi1"}}, + {"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint", "csi1"}}, + {"PH22", 7, 22, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + {"PH23", 7, 23, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + {"PH24", 7, 24, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + {"PH25", 7, 25, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + {"PH26", 7, 26, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + {"PH27", 7, 27, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + + {"PI0", 8, 0, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PI1", 8, 1, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PI2", 8, 2, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PI3", 8, 3, {"gpio_in", "gpio_out", "pwm", NULL, NULL, NULL, NULL, NULL}}, + {"PI4", 8, 4, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI5", 8, 5, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI6", 8, 6, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI7", 8, 7, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI8", 8, 8, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI9", 8, 9, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI10", 8, 10, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint", NULL}}, + {"PI11", 8, 11, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint", NULL}}, + {"PI12", 8, 12, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "eint", NULL}}, + {"PI13", 8, 13, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "eint", NULL}}, + {"PI14", 8, 14, {"gpio_in", "gpio_out", "spi0", "ps2", "timer4", NULL, "eint", NULL}}, + {"PI15", 8, 15, {"gpio_in", "gpio_out", "spi1", "ps2", "timer5", NULL, "eint", NULL}}, + {"PI16", 8, 16, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI17", 8, 17, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI18", 8, 18, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI19", 8, 19, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI20", 8, 20, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, + {"PI21", 8, 21, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, +}; + +const struct allwinner_padconf a10_padconf = { + .npins = sizeof(a10_pins) / sizeof(struct allwinner_pins), + .pins = a10_pins, +}; + +#endif /* SOC_ALLWINNER_A10 */ Modified: head/sys/arm/allwinner/a10/files.a10 ============================================================================== --- head/sys/arm/allwinner/a10/files.a10 Fri Aug 19 11:36:00 2016 (r304463) +++ head/sys/arm/allwinner/a10/files.a10 Fri Aug 19 12:48:32 2016 (r304464) @@ -1,4 +1,4 @@ # $FreeBSD$ arm/allwinner/a10/a10_intc.c standard -arm/allwinner/a10_padconf.c standard +arm/allwinner/a10/a10_padconf.c standard From owner-svn-src-head@freebsd.org Fri Aug 19 13:39:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00262BBF59B; Fri, 19 Aug 2016 13:39:15 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id E4FD41735; Fri, 19 Aug 2016 13:39:15 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id E30E818D8; Fri, 19 Aug 2016 13:39:15 +0000 (UTC) Date: Fri, 19 Aug 2016 13:39:15 +0000 From: Alexey Dokuchaev To: Bruce Evans Cc: Konstantin Belousov , src-committers , John Baldwin , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Julian Elischer , Warner Losh Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd Message-ID: <20160819133915.GA8791@FreeBSD.org> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> <20160819202010.Y2407@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160819202010.Y2407@besplex.bde.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 13:39:16 -0000 On Fri, Aug 19, 2016 at 09:12:53PM +1000, Bruce Evans wrote: > I normally use my version of biosboot for boot2. I improved its caching > just a couple of years ago. It was using 9K buffer optimized for 1440K > floppies. Now it uses a 32K buffer. Booting a 5.5MB kernel takes a > fraction of a second. That looks like change that everyone would benefit from. Consider posting a patch or committing it yourself. ;-) > Of course I don't use modules, so not many seeks are needed. Why not, they're convenient (apart from "kernel version mismatch" crap that I keep hitting now and then)? AFAIR they were slow to load at some point but that was (not so) recently fixed. ./danfe From owner-svn-src-head@freebsd.org Fri Aug 19 14:13:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23FDABBE4EE for ; Fri, 19 Aug 2016 14:13:51 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::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 E0DA419A0 for ; Fri, 19 Aug 2016 14:13:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id b62so49261962iod.3 for ; Fri, 19 Aug 2016 07:13:49 -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:content-transfer-encoding; bh=i/l9y0cd+WJ0StxFQT7PRdsgnq1drneC5zZXUyUN4EI=; b=h3VI5Z15zKUhIuFHcB604BR38Y6impG5WVCTwG6h3jxnuPA+R9OFt8iEPkCYQpDqHT Q0X/KMODso2LganiDn3eyH6f/yo3Z6MN3O+z9L+e/5WN8DQgzJ+zPhSxBvsdoUHPf3Hu GB9e+gjD9G8dTXN9JWRJ4HsR9RzVGBNgkOtR/vWWJIOSy9mnpBOdF4CBsxwgN06FCv55 dzk3VcPCIjA3NODSY0ZNWVzwmTHCXuZClRgGwNDYqdvE3YJ6TA/vIFCqf0q3C5J0471B /Vfiz019zx9kuFog53DWEfkVcnLyBQkIsdKFUhFs4Fri+o45tHi0/QdH9QumcHn/lSil Uo6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=i/l9y0cd+WJ0StxFQT7PRdsgnq1drneC5zZXUyUN4EI=; b=Q8jNZOk8Efp/4ud5R3QCZOKWfESoISVcekP4HPySTt8NljnwOlzCiB52tZcGhuT5+K d0AZO6tohpEixeRTYYWY6ch8K6VXKUuzU9Q3NjleVTGr6EhMExT96mrmQt7xrF16hJv4 yMY6whGJUGXWA6aj4q0Fazp75mjhn9DkdhAv8WB2IfHVTXw98yT2F0JjCJfzmQeQ0oNE ZMca7eUOA4gKgPVpGDfc0vgt8UT/6WMzJUaOGzz1uFUlZ1F4l8P3r4R0RWhYoHrl+HaI 0YPX6Q3IegezdaPz4wRW53O6rqrhDGFEBCZ6OxrBe39TzyG21nYV4iiC57dsyBTMZw+k SL/A== X-Gm-Message-State: AEkoousOKUEac4LmH6frR2o3pmfi4hiUTGF4PRgKd2ODtkRpDb2+PC195TH0xzBsVhi2LppHk9V+z/dbv4sqbA== X-Received: by 10.107.145.214 with SMTP id t205mr9727255iod.135.1471616029242; Fri, 19 Aug 2016 07:13:49 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Fri, 19 Aug 2016 07:13:48 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <86inuxckve.fsf@desk.des.no> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> <86inuxckve.fsf@desk.des.no> From: Warner Losh Date: Fri, 19 Aug 2016 08:13:48 -0600 X-Google-Sender-Auth: -ojWIqbLySqMO4LZPvT22rT1mWY Message-ID: Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: Allan Jude , Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 14:13:51 -0000 On Fri, Aug 19, 2016 at 12:51 AM, Dag-Erling Sm=C3=B8rgrav wro= te: > Warner Losh writes: >> Allan Jude writes: >> > Which makes more sense: >> > >> > A) If stripesize =3D=3D 0, use some sane value like 4096 >> >> I don't like this. >> >> > B) Some other combination that uses the reported stripe size, unless i= t >> > is 0, in which case it uses 4096 (or some other value controlled by a >> > different new sysctl) >> >> Don't like this so much. >> >> > C) create kern.geom.min_stripe_size with a default of 512, but users c= an >> > set 4096 if they use only 4k devices. (doesn't really solve the proble= m >> > for the installer) >> >> Default it to 4k, and allow users to set it to 512. If the drive >> reports < this value >> report this value instead. > > I don't like either option. Option D (which I don't like either, but > which should at least work in most cases) is a sysctl that specifies a > minimum factor, and set the reported stripe size to the least common > multiple of that number and the actual stripe or sector size. This is > what my bsdinstall patch does. However, I think that pushing this down > to a layer where it will affect all applications is a terrible idea, > because we have no way of knowing what will break[*], and it can > seriously mislead users and hinder troubleshooting - especially if it is > enabled by default rather than only when necessary. I took a look into the implications of doing a 4k stripesize 'automatically= ' this morning. I found a few places in g_part where it would actively hurt when coupled with gpart's insistence on aligning things. So I now think it's a bad idea. This will make it harder for FreeBSD to generate arbitrary disk layouts. And I'm not too sure about what things like gstripe would report as a result and if this would actually interfere if you had a large, but not power of two stripe size. > I don't think it's a good idea to enforce stripe alignment everywhere, > either. It works for partitions because they are very large relative to > the stripe size, and at worst we will waste a few millionths of the disk > on inter-partition gaps, which should only occur between the partition > table and the boot partition, and possibly, if the stripe size is very > large, between the boot partition and the swap partition. But forcing > filesystems to respect the stripe size will lead to no end of trouble, > because RAID volumes can have stripe sizes of 16 kB or more. I think it > is important to align partitions during installation because of the huge > performance impact of misaligned partitions on AF disks, but despite > what Nathan claims, I never advocated applying the same logic > everywhere. Yea, having poked at it for just a little while, I agree. The installer is = the right place to make sure we don't cross-thread the 4k sectors. Stripe size means too many other things to have it be useful in that context. Warner From owner-svn-src-head@freebsd.org Fri Aug 19 14:23:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEAEABBE71A for ; Fri, 19 Aug 2016 14:23:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B41E61F93 for ; Fri, 19 Aug 2016 14:23:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id m101so49638346ioi.2 for ; Fri, 19 Aug 2016 07:23:33 -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=zLVgCSfTZmemUtK+6Izrubttf8rBWRaCRFnMQRY18PY=; b=MAS2yod/C7uyF/Pf6SmxDkTwFNV39XCXP3GYo/6PCqMJj2laQz3ZD/GNItETZQejez Cift6Yl21n54oPT/u4VtVePdIeoR5OI1LJ7kyTjG1sE4dDhgKBp8wzLUYwSQKJjJVTs9 +uHFBuEs/1rkyGsqR+svnO6H+TOkywCACXzHnMO4S9bc/dMd1s6lnH7neSQ32mWUHXQy QyYQ/k4jR5Fg1LNDyrvNRPElZIT29RNzenCvydNSo3ayBxXjqdy15IRcLMXwHzIXMzot +cc35fLGH5FIe4AC2icC0feFSBTjOearEtUbkW+i8dQyGeq+eDWFDSMfRPW2nN2oGqgk QUiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=zLVgCSfTZmemUtK+6Izrubttf8rBWRaCRFnMQRY18PY=; b=F001WPeK+dXVp7nqX05mNqZNfTCXp9PzHt5S3WQTwpBW2HSFnh1c2CtGuL4qgbN6hn 0LxrMqpef/A+14C5GaRsQRHZOXNtPhe1y/4cbsBsshVxli+rCCqXFUZRdHK4Z1sB5K09 YiIQmEbSnXRJhci2QmoLAYkajs+2Zbhb9154sKH4Ez1+ZJMx95gOg94aTLnT2YCw4ucs D3PByOvoVm0N6LGTOIooHDRQni0HBhBRtjEnyoNRwN31F+6wmHhSxbnbUuCx9lpYEehk T88eqRElLzmDYgpWGVaUIMBjiZ5CALXjkhrbei9NFAmLtCBK+NQRkl87VdtoFT9jbBHl 8Ryg== X-Gm-Message-State: AEkoouvwKzkEbH9x0rh9EW9XSqAC8jcM5zzcYXIj0gzLyQh4bRhVm/O2hD8s43V8fGosVTMj2gZf9+qIMwRotQ== X-Received: by 10.107.21.134 with SMTP id 128mr9765364iov.59.1471616613066; Fri, 19 Aug 2016 07:23:33 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Fri, 19 Aug 2016 07:23:32 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <20160819112729.GH83214@kib.kiev.ua> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> <20160819202010.Y2407@besplex.bde.org> <20160819112729.GH83214@kib.kiev.ua> From: Warner Losh Date: Fri, 19 Aug 2016 08:23:32 -0600 X-Google-Sender-Auth: cXFAmKjKlxTW8VfMOC6WvJUMggg Message-ID: Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd To: Konstantin Belousov Cc: Bruce Evans , Julian Elischer , John Baldwin , 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.22 Precedence: list List-Id: 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, 19 Aug 2016 14:23:34 -0000 On Fri, Aug 19, 2016 at 5:27 AM, Konstantin Belousov wrote: > On Fri, Aug 19, 2016 at 09:12:53PM +1000, Bruce Evans wrote: >> On Fri, 19 Aug 2016, Konstantin Belousov wrote: >> >> > On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: >> >> On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer wrote: >> >>> On 16/08/2016 4:54 AM, John Baldwin wrote: >> >>>> >> >>>> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >> >>>>> ,,, >> >>>>> Log: >> >>>>> Remove the mcd(4) driver for Mitsumi CD-ROM players. >> >>>>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in >> >>>>> the manpage, this driver is only useful as a backend to cdcontrol to >> >>>>> play audio CDs since it doesn't use DMA, so its data performance is >> >>>>> "abysmal" (and that was true in the mid 90's). >> >>>> >> >>>> No one stepped up to test patches for it either when I last posted patches >> >>>> to >> >>>> convert it from timeout(9) to callout(9). I have a few more drivers that >> >>>> are >> >>>> ... >> >>> >> >>> I would imagine any machine still holding one of these probably has not >> >>> enough memory to run FreeBSD. >> >>> >> >>> would we still run in 2MB? >> >> >> >> With insane levels of tuning, we can run in 32MB userland that can do >> >> things. Even 64MB is tight w/o some tuning. 16MB is almost certainly >> >> right out except for very specialized situations. 2MB? We can't even >> >> load the loader in that :(. Oh, and all these memory configs are only >> >> possible if you tweak the loader's block cache... >> > >> > 32MB is quite usable. Without any tuning, you get slightly less than 10MB >> > for userspace, which is enough to for many things, and plenty if swap is >> > added. >> >> No, 32MB needs lots of needs tuning. -current seems to need about 16MB >> more than just a few months ago when I last discussed this with you. >> My i386 system doesn't have many drivers or a bloated userland (*), >> but it took the following tuning plus my PAE tuning fixes to boot in >> 32MB: >> - disable [l]em1 >> - reduce tx and buffers to 256 for em0. They default to 4096 for em. That >> is something like 8K * 1500 bytes = 12MB for em0 alone. lem[1] wants >> another 12MB. I think this is not all statically allocated, but the >> drivers hang onto that much. >> This now longer works. -current without my PAE tuning fixes hangs mounting >> root or in usb initialization with this tuning and 40MB. -current with my >> PAE tuning fixes hangs similarly with 32MB; with 40MB it boots to the >> start of multiuser but then hangs (it starts 1 getty, then 2 sendmails >> and kills them with "out of swap space") and 1 rpcbind (also killed). I >> don't use swap, but it was needed 20 years ago on a system that actually >> had 32MB of memory. >> >> (*) /bin/sh doing nothing much in -current i386: size 6532K res 1924K >> /bin/sh in my ~5.2 i386: size 864K res 592K >> >> The kernel size is 5.5MB text 370K data 2.2MB bss (lots of bloat in bss >> for debugging and vt). In single user mode, with 40MB to start, there >> is 22116K wired and 2516K free. A few programs can be run in 2516K >> without swap if they have res 592K and not 1924K. >> >> > Note that you cannot boot on such configurations since loader was broken, >> > but if you do manage to jump to kernel, things were fine several months >> > ago. I tested my relatively recent OOM changes on 32MB qemu config. >> >> I have no problems booting such configuratations since I don't use the >> current loader and only use old loader to change the environment to >> set up special configurations like this. I use my version of biosboot >> for boot2. This requires fixing 2 layers of complicated breakage in >> init386(). vm86 is now used before the TSS and PIC resources that it >> uses are initialized, but only in paths that are not normally used >> because they are for memory sizing that is normally done by loader >> :-(. >> >> I normally use my version of biosboot for boot2. I improved its caching >> just a couple of years ago. It was using 9K buffer optimized for 1440K >> floppies. Now it uses a 32K buffer. Booting a 5.5MB kernel takes a >> fraction of a second. Of course I don't use modules, so not many seeks >> are needed. > > Of course I use modules and do not use GENERIC. I just tried: with today > HEAD, and old loader on 32MB VM, I get 11MB free in single-user mode. > Active+inactive is ~4MB, and 1M is eaten by buffers, which is about right > for init+/bin/sh+top idle system. The situation on x86 must be a lot better than arm. My old Atmel boards with 32MB have < 1MB free when booted to the login prompt (more at single user) and need special tuning to reduce the 5MB of network buffers allocated to be anything approaching useful. Warner From owner-svn-src-head@freebsd.org Fri Aug 19 14:27:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C7B9BBE7BD for ; Fri, 19 Aug 2016 14:27:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::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 6062C12C5 for ; Fri, 19 Aug 2016 14:27:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x236.google.com with SMTP id q83so49915745iod.1 for ; Fri, 19 Aug 2016 07:27:03 -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:content-transfer-encoding; bh=dRNBAs+LP5n3I7fl627FF2bmDIn0xYhOgVBikW6pGFw=; b=DhWQBOWKkV0fy4eFhioznjwdUQOQa/IRQt5GXdAAnDO+eRpQpIAQcwRu3gSYuD3Te+ WLZHWNNSHqgMJE8yyxE9hL2UWKdR0FzEOZg2OceS6guhVwq6IP/KpFWtBtGY4LBPWJsp Ajdgyu601YU6paKeAZl28Pe8T4mLUeiQ71tSrfibWH9KgAseFhp/gdf37JuY2Yr88kH5 ONj/Bq0w2zplTUpKbPtSGWDXkewgydIiBFlj/rnjgQQdZok1SfDhCQwNdDYDdpsmQQNa zODvb3WvP0XNJfXqHaEOlfiSrHu+m/NoolZxAjuezX3RHCI7k26BupsXxKOtB3Pol6hF fuPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=dRNBAs+LP5n3I7fl627FF2bmDIn0xYhOgVBikW6pGFw=; b=WzWVjJamPz4rO0aVhyoMK5zjLE0VeDwalYFetj3NVqZGJHnZC/1juR3J8oPjWLa6OS ohfBWAqLd1vsKNkVtysR/T8rWf5BIOVBOwEfpqJaC+8uT2g7lxydmwiGHpjrqXmsnJg3 xllkoixtzxNuydxJ3D63/siUICqy0+3V3VaYZES5UpiZ0AvNFKzE7Hufo7Iw9SnvDKL2 2dOW0hG7hqxifj7LKmoGAEpLa0UTYIi0OEeUS5DTkgpX0DCs+DDD30sxbKtk3J0gr38w mulQz7RyIxSDVVbZLjlFvVHfFNK5a9VUn8K5xvbtTrG1NuEEqAXLFH6G2TYj37DxAJyT J3RA== X-Gm-Message-State: AEkooutGaiLCfIsKpIEEtKyYKTcq00B3mGh72+H2As1Hg0u6AnveZwMjNf4V3j1i2lJaaktw2OjanHzRpZsbwQ== X-Received: by 10.107.145.214 with SMTP id t205mr9805219iod.135.1471616822697; Fri, 19 Aug 2016 07:27:02 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Fri, 19 Aug 2016 07:27:02 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <514987E4-B953-467C-B53B-824B172A5211@me.com> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> <50AAF049-C8A7-4C69-A206-C3983FFA7867@me.com> <20160819092424.GE83214@kib.kiev.ua> <514987E4-B953-467C-B53B-824B172A5211@me.com> From: Warner Losh Date: Fri, 19 Aug 2016 08:27:02 -0600 X-Google-Sender-Auth: bWHWVvzGc435-D3-ZAwd_VO3p4E Message-ID: Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd To: Toomas Soome Cc: Konstantin Belousov , Julian Elischer , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 14:27:03 -0000 On Fri, Aug 19, 2016 at 3:35 AM, Toomas Soome wrote: > >> On 19. aug 2016, at 12:24, Konstantin Belousov wro= te: >> >> On Fri, Aug 19, 2016 at 11:50:35AM +0300, Toomas Soome wrote: >>> >>>> On 19. aug 2016, at 10:39, Konstantin Belousov w= rote: >>>> >>>> On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: >>>>> On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer wrote: >>>>>> On 16/08/2016 4:54 AM, John Baldwin wrote: >>>>>>> >>>>>>> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >>>>>>>> >>>>>>>> Author: jhb >>>>>>>> Date: Mon Aug 15 20:38:02 2016 >>>>>>>> New Revision: 304187 >>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/304187 >>>>>>>> >>>>>>>> Log: >>>>>>>> Remove the mcd(4) driver for Mitsumi CD-ROM players. >>>>>>>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted = in >>>>>>>> the manpage, this driver is only useful as a backend to cdcontrol = to >>>>>>>> play audio CDs since it doesn't use DMA, so its data performance i= s >>>>>>>> "abysmal" (and that was true in the mid 90's). >>>>>>> >>>>>>> No one stepped up to test patches for it either when I last posted = patches >>>>>>> to >>>>>>> convert it from timeout(9) to callout(9). I have a few more driver= s that >>>>>>> are >>>>>>> both very old and that people have no business using in 12 (think I= SA >>>>>>> adapters that don't do DMA and can't be used with pccard) that I wi= ll be >>>>>>> removing over the next little while. I brought up a list of driver= s on >>>>>>> arch@ >>>>>>> a couple of years ago and the conversation drifted off into the wee= ds >>>>>>> about >>>>>>> trimming GENERIC, etc. No one objected to the specific drivers I l= isted >>>>>>> though (and I got a few pleas of "please remove"). If someone show= s up >>>>>>> desperately clutching an ISA adapter they can always dig up the sou= rce >>>>>>> from >>>>>>> svn and deal with forward porting it for whatever API changes have >>>>>>> happened >>>>>>> since it was removed. >>>>>> >>>>>> >>>>>> I would imagine any machine still holding one of these probably has = not >>>>>> enough memory to run FreeBSD. >>>>>> >>>>>> would we still run in 2MB? >>>>> >>>>> With insane levels of tuning, we can run in 32MB userland that can do >>>>> things. Even 64MB is tight w/o some tuning. 16MB is almost certainly >>>>> right out except for very specialized situations. 2MB? We can't even >>>>> load the loader in that :(. Oh, and all these memory configs are only >>>>> possible if you tweak the loader's block cache... >>>>> >>>> >>>> 32MB is quite usable. Without any tuning, you get slightly less than = 10MB >>>> for userspace, which is enough to for many things, and plenty if swap = is >>>> added. >>>> >>>> Note that you cannot boot on such configurations since loader was brok= en, >>>> but if you do manage to jump to kernel, things were fine several month= s >>>> ago. I tested my relatively recent OOM changes on 32MB qemu config. >>>>> Warner >>>> >>> >>> If the target is to go as low memory as possible, sure, you can strip a= ll off, from boot loader point, you should load kernel from stage2 and not = use loader at all (you can load and jump kernel even now from stage2, assum= ing it wont need any special configuration from loader config) etc etc. Thi= s means highly specialized build and has nothing to do with generic all pur= pose system. >>> >> Why you describe this as an 'alternative' ? Before that loader changes, >> I regularly tested on 32MB qemy i386 image and 64MB amd64 image. I do >> not see anything extreme in these configs. They use normal boot path, >> which provides kernels with debugging symbols, metadata, loaded modules >> etc. Why should I use deficient boot2-only loading, which, additionally, >> cannot work on amd64 ? >> >> More, this is the only reasonable way for most developers to ensure that >> system is still usable on tiny configs found on embedded devices. Right >> now the min which I have to set up is 128MB, and VM changes are simply n= ot >> tested on anything smaller. It is guaranteed that small systems will gro= w >> regressions fast. And I will not jump through the hoops to mitigate >> breakage induced by other people' changes. >> >>> Also at some point, there is an question about how reasonable it is to = have such configuration as part of generic code base for special bits like = boot loader itself, as the problem is, testing all those variants is becomi= ng impossible and even keeping reasonable code base in all of the #if #else= #endif spaghetti is getting quite hard and error prone. >>> >>>> From developers point of view, it is not really encouraging to have po= ssible feedback like ???oh, but you did break my 32MB system boot??? ;) Thi= s does bring back some memories however. For first 2 unix systems I was dea= ling with, one had 8MB and another had 12MB of memory??? it was ~ 1992-1993= ;) >>> >> Not mine, but you (?) indirectly broke system for people who do use 32MB >> on other arches, since low memory config on dev systems become 128MB. >> I cared about 32MB before, but not any longer. > > > Yep, I did set it to 64MB. And this is exactly why I wrote that small sys= tems do need special approaches, because getting updates for new features a= nd keeping tiny systems functional are conflicting options. So far freebsd = boot loader has managed this in some extent by massive amount of preprocess= or conditions and the result is insane list of different boot programs in There's only one boot program that's bloated recently, and that's /boot/loader. the static allocation of large buffers because malloc isn't working well is the problem. This isn't a small system vs large system problem, but a convenience vs complexity problem. Installing the base boot loader (that loads /boot/loader or kernel) is and always will be system dependent with very real constraints. Warner From owner-svn-src-head@freebsd.org Fri Aug 19 14:45:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F2C9BBEEB1; Fri, 19 Aug 2016 14:45:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 448BA1D0A; Fri, 19 Aug 2016 14:45:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 531D5D66ED6; Sat, 20 Aug 2016 00:45:31 +1000 (AEST) Date: Sat, 20 Aug 2016 00:45:31 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexey Dokuchaev cc: Bruce Evans , Konstantin Belousov , src-committers , John Baldwin , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Julian Elischer , Warner Losh Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd In-Reply-To: <20160819133915.GA8791@FreeBSD.org> Message-ID: <20160820000234.W3223@besplex.bde.org> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> <20160819202010.Y2407@besplex.bde.org> <20160819133915.GA8791@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=kt6ZAA2GVHG-pnxd31oA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 14:45:37 -0000 On Fri, 19 Aug 2016, Alexey Dokuchaev wrote: > On Fri, Aug 19, 2016 at 09:12:53PM +1000, Bruce Evans wrote: >> I normally use my version of biosboot for boot2. I improved its caching >> just a couple of years ago. It was using 9K buffer optimized for 1440K >> floppies. Now it uses a 32K buffer. Booting a 5.5MB kernel takes a >> fraction of a second. > > That looks like change that everyone would benefit from. Consider posting > a patch or committing it yourself. ;-) Oops, it is actually loading that takes a fraction of a second. Not much different than with -current boot2 or old loader. -current boot2 also works for me, but I managed to squeeze more of the features that I want into biosboot (everything except ufs2). Booting from the boot1 prompt takes 20-25 seconds here. >> Of course I don't use modules, so not many seeks are needed. > > Why not, they're convenient (apart from "kernel version mismatch" crap > that I keep hitting now and then)? AFAIR they were slow to load at some > point but that was (not so) recently fixed. Same reason that I don't use shared libraries if possible - they are larger, slower and more difficult to debug. For kernel development, the version control problem is large. Modules are good for avoiding rebooting when developing something in a single module, but I usually work on either small changes that panic often or system wide-changes that need recompiling everything. Both require rebooting a lot to test, and I can rebuild a kernel and without modules and reboot it almost faster than I can remember where the modules directories are. Bruce From owner-svn-src-head@freebsd.org Fri Aug 19 15:54:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87252BBDFA0; Fri, 19 Aug 2016 15:54:01 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D0241202; Fri, 19 Aug 2016 15:54:01 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 9C6101D60; Fri, 19 Aug 2016 15:53:54 +0000 (UTC) Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Warner Losh References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Allan Jude Message-ID: <2c942f49-b90c-58eb-159f-4c4e62624bac@freebsd.org> Date: Fri, 19 Aug 2016 11:53:42 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3vJ9Ixf52qiPb3wJHq6RTu3p9IpOuxluR" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 15:54:01 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3vJ9Ixf52qiPb3wJHq6RTu3p9IpOuxluR Content-Type: multipart/mixed; boundary="sxpS8TNfnWpFWDHAo0LUfWPwPtRHSisr1" From: Allan Jude To: Warner Losh Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <2c942f49-b90c-58eb-159f-4c4e62624bac@freebsd.org> Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> In-Reply-To: --sxpS8TNfnWpFWDHAo0LUfWPwPtRHSisr1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-08-19 00:15, Warner Losh wrote: >> Which makes more sense: >> >> A) If stripesize =3D=3D 0, use some sane value like 4096 >=20 > I don't like this. >=20 >> B) Some other combination that uses the reported stripe size, unless i= t >> is 0, in which case it uses 4096 (or some other value controlled by a >> different new sysctl) >=20 > Don't like this so much. >=20 >> C) create kern.geom.min_stripe_size with a default of 512, but users c= an >> set 4096 if they use only 4k devices. (doesn't really solve the proble= m >> for the installer) >=20 > Default it to 4k, and allow users to set it to 512. If the drive > reports < this value > report this value instead. You'll need to make this a tunable. Then the= upper > layers wouldn't care. There's a small chance that some SD cards might b= e > reporting values that are too large. But I think it is confined to SD c= ards and > if I see too many more I'll do something specific in the SD driver. >=20 > Warner >=20 I think I mentioned this earlier in the thread,, but I do have a USB thumbstick that reports an 8mb stripe size. But I agree, I think a sysctl where you set the minimum (default 4096, but settable to 512), that is a tunable that can be overwritten in loader.conf What do we want for the logic as to what values it can be set to? Any power of 2 greater than or equal to 512? --=20 Allan Jude --sxpS8TNfnWpFWDHAo0LUfWPwPtRHSisr1-- --3vJ9Ixf52qiPb3wJHq6RTu3p9IpOuxluR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJXtyuSAAoJEBmVNT4SmAt+iUEP/Raxai9knKnFs6fsTxwaTKDF T1PeDFetotiNtYqQMlvbOVyEissp1HfYfhMSF0ON8Q6Pk4PzLA/eBveIzMB9dMqo /7jc66atNRP7WX7WB1zK/bbAxk7TQ1HbRztk7bTnHlTJNJbxfbAo6yfUwwzJQOYQ Lm8IMD2gURcWek0qVs0hFfjhZ73wi5ZiHbcHOzQ9Z4b6M0g/buU7/DwLkLFxGsOy UKdQQmi32BRqiFoQRfeRq7urF48yQHzYcKy3b8b0DoltYZjR3KYJrIoZX9qF/qOt rTyTHJeYWwLeZQ6+SGa1YtTU4omb1JLRDAFa7EDpbML4Rl9xHWVjQ2OMXcN2GUHH QHV+Iug+FitVIL5y9KiGYTw0N4xspVc6qfkbiNOkBb/9Xr8SX1Fj8W1ssqffOhp0 4Ve2upnbDuEJvHz+31CwkFP2M4C0uf8/7B4dA+P1gk1TwJXoXbX1gaVFemsVx0lk k4PhMh2y9wRchKvpS4hDv7zmYxxdD3QEtgzwRa2G5oYKvJwB9EHsP+MGhlGFBUsr L7YGwGC0UwCBm81SUYt5un7fO/cE0LiXLc2AF1g6yysoJmQjc6F2h+/mApxy3Qjz T4PyY6vrdr8mJGL0jmmKhZ/Mc87cEjmUDqlAyF/9+29IBEodfQmrIP+9jNRk1wlY 7Cb9OEHWn2SbxaGuaSFM =rTGD -----END PGP SIGNATURE----- --3vJ9Ixf52qiPb3wJHq6RTu3p9IpOuxluR-- From owner-svn-src-head@freebsd.org Fri Aug 19 15:57:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF150BBF025; Fri, 19 Aug 2016 15:57:25 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 835B213E0; Fri, 19 Aug 2016 15:57:25 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 6D2161D74; Fri, 19 Aug 2016 15:57:24 +0000 (UTC) Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Warner Losh , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> <86inuxckve.fsf@desk.des.no> Cc: Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Allan Jude Message-ID: Date: Fri, 19 Aug 2016 11:57:23 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HBoKUtE0wg8OgvF8HaIeneDahTDhXpNSt" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 15:57:25 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HBoKUtE0wg8OgvF8HaIeneDahTDhXpNSt Content-Type: multipart/mixed; boundary="jAP4CfVQqcvQPCnoNDJvL0XrEI6hqrdEk" From: Allan Jude To: Warner Losh , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Cc: Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> <86inuxckve.fsf@desk.des.no> In-Reply-To: --jAP4CfVQqcvQPCnoNDJvL0XrEI6hqrdEk Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-08-19 10:13, Warner Losh wrote: > On Fri, Aug 19, 2016 at 12:51 AM, Dag-Erling Sm=C3=B8rgrav = wrote: >> Warner Losh writes: >>> Allan Jude writes: >>>> Which makes more sense: >>>> >>>> A) If stripesize =3D=3D 0, use some sane value like 4096 >>> >>> I don't like this. >>> >>>> B) Some other combination that uses the reported stripe size, unless= it >>>> is 0, in which case it uses 4096 (or some other value controlled by = a >>>> different new sysctl) >>> >>> Don't like this so much. >>> >>>> C) create kern.geom.min_stripe_size with a default of 512, but users= can >>>> set 4096 if they use only 4k devices. (doesn't really solve the prob= lem >>>> for the installer) >>> >>> Default it to 4k, and allow users to set it to 512. If the drive >>> reports < this value >>> report this value instead. >> >> I don't like either option. Option D (which I don't like either, but >> which should at least work in most cases) is a sysctl that specifies a= >> minimum factor, and set the reported stripe size to the least common >> multiple of that number and the actual stripe or sector size. This is= >> what my bsdinstall patch does. However, I think that pushing this dow= n >> to a layer where it will affect all applications is a terrible idea, >> because we have no way of knowing what will break[*], and it can >> seriously mislead users and hinder troubleshooting - especially if it = is >> enabled by default rather than only when necessary. >=20 > I took a look into the implications of doing a 4k stripesize 'automatic= ally' > this morning. I found a few places in g_part where it would actively > hurt when coupled with gpart's insistence on aligning things. So I > now think it's a bad idea. This will make it harder for FreeBSD to > generate arbitrary disk layouts. And I'm not too sure about what > things like gstripe would report as a result and if this would actually= > interfere if you had a large, but not power of two stripe size. >=20 >> I don't think it's a good idea to enforce stripe alignment everywhere,= >> either. It works for partitions because they are very large relative = to >> the stripe size, and at worst we will waste a few millionths of the di= sk >> on inter-partition gaps, which should only occur between the partition= >> table and the boot partition, and possibly, if the stripe size is very= >> large, between the boot partition and the swap partition. But forcing= >> filesystems to respect the stripe size will lead to no end of trouble,= >> because RAID volumes can have stripe sizes of 16 kB or more. I think = it >> is important to align partitions during installation because of the hu= ge >> performance impact of misaligned partitions on AF disks, but despite >> what Nathan claims, I never advocated applying the same logic >> everywhere. >=20 > Yea, having poked at it for just a little while, I agree. The installer= is the > right place to make sure we don't cross-thread the 4k sectors. Stripe s= ize > means too many other things to have it be useful in that context. >=20 > Warner >=20 Maybe instead we just change gpart to default to 4k alignment, but users can always override with -a 512 or some other value? Then the installer behaves the same as a user typing 'gpart', but we don't mess with the entire geom layer? --=20 Allan Jude --jAP4CfVQqcvQPCnoNDJvL0XrEI6hqrdEk-- --HBoKUtE0wg8OgvF8HaIeneDahTDhXpNSt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJXtyxkAAoJEBmVNT4SmAt+aHsQALZH84SBlTJAX36cnNuq8/vZ Iy/NGS364jYsz/rwT1mTLqaB5e+Iiu9ZCF8dkDocAr9X4EqfuxWKuI0pZoPzxJtI zjgxwuWMU21UoSBffpncK3R/iHw1faz2Xq4lV+IKKyS22U9XJGmr3uC+k6Lu3J2m ja7uFKdVaBSNH0FG4+HygUGyRtL4vUZiAa9whe/u/hgxVv/JQCZTwQ86DTSzjEYz volBGOb1ooiVPBDqm/WP53SJCL/5nSUthMxn2NdK1scD7LlYNKXAS6dC1Lgf942c KSZ9c+noIppz/OQovkmGzCepRKvcWSHm+NIcEVXCrFj8oaVH8ys8/i9DMPhDbdD+ CeIpOTYB+yiGFCiWp07y5yTLtOAcH1873zoy/yB6iNadSuCVgKDvqO3dEe1cEJcL O7cl2lOoWJwYHRbfZuPvATc4X91suhO0KQfZJ9+GeXpUIrvl/TCXMFYrRfM+8nPK hK4bdvLVrmSOS1eiU0cZIIvrxgJ1mjtHARW9sBBLVowN+gJ1lQ8U+u93PFfncJ7K YQ+m0/s8AGg406uud68H5Xn9I1FdYBXDoT+P1iayiqFJ7mEllFgaxpH5zlzWODZT KImo0lDRly2DcGcgyWDsFxYjSvPtDnbTdc0zntMCHXblH2ZoAdutil00mD/SJGya TssJryhudabz40FIFTXR =3kd0 -----END PGP SIGNATURE----- --HBoKUtE0wg8OgvF8HaIeneDahTDhXpNSt-- From owner-svn-src-head@freebsd.org Fri Aug 19 16:31:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1606DBBF8EA; Fri, 19 Aug 2016 16:31:48 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1E7E16CD; Fri, 19 Aug 2016 16:31:47 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7JGVYS7013718 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 19 Aug 2016 09:31:35 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Warner Losh References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> <081362ef-ff4a-61d5-46e4-9a4cf8b699ee@freebsd.org> <880977BE-F00F-4188-A978-F292AB452C79@bsdimp.com> Cc: Warner Losh , Allan Jude , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Nathan Whitehorn Message-ID: <16daa43f-fe4f-d191-b18f-da4ae3e690f5@freebsd.org> Date: Fri, 19 Aug 2016 09:31:34 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <880977BE-F00F-4188-A978-F292AB452C79@bsdimp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVYrmu75wg1SZTo2Cfybe/4EHQ+tKEjyQsDtgDtuaOX2tXPvIg3zZA+WeTWl3LTT+tlOFXZLUu2gl6/djTC2DuQCGGD7gLJvsIM= X-Sonic-ID: C;VI7gZCpm5hGVEKDx2xNB0g== M;fEpCZSpm5hGVEKDx2xNB0g== 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.22 Precedence: list List-Id: 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, 19 Aug 2016 16:31:48 -0000 On 08/18/16 22:33, Warner Losh wrote: >> On Aug 18, 2016, at 11:21 PM, Nathan Whitehorn wrote: >> >> >> >> On 08/18/16 21:15, Warner Losh wrote: >>> On Thu, Aug 18, 2016 at 6:56 AM, Allan Jude wrote: >>>> On 08/18/16 05:50 AM, Dag-Erling Smørgrav wrote: >>>>> Nathan Whitehorn writes: >>>>>> OK. In which configurations? My Dell servers, for instance, don't do >>>>>> this. How are they set up? What drivers are being used? Is this >>>>>> something that affects passthrough disks, RAIDs, disk images? >>>>> Most LSI MegaRAID controllers don't have real passthrough, only JBOD. >>>>> You can query the drive with "camcontrol identify passX", but the >>>>> controller does not report a stripe size for the volume (mfidY). >>>>> >>>>>> The point is that *if the reported stripe size is wrong*, more things >>>>>> than partition alignment in the installer will suffer for it. >>>>> It's not wrong, it's non-existent, and I'm getting really tired of >>>>> repeating myself. >>>>> >>>>>> Fixing the installer with a bandaid in the run-up to a release is >>>>>> fine, but *we need to fix the underlying problem*. >>>>> We can't, because hardware sucks, and I'm getting really tired of >>>>> repeating myself. >>>>> >>>>> DES >>>>> >>>> Which makes more sense: >>>> >>>> A) If stripesize == 0, use some sane value like 4096 >>> I don't like this. >>> >>>> B) Some other combination that uses the reported stripe size, unless it >>>> is 0, in which case it uses 4096 (or some other value controlled by a >>>> different new sysctl) >>> Don't like this so much. >>> >>>> C) create kern.geom.min_stripe_size with a default of 512, but users can >>>> set 4096 if they use only 4k devices. (doesn't really solve the problem >>>> for the installer) >>> Default it to 4k, and allow users to set it to 512. If the drive >>> reports < this value >>> report this value instead. You'll need to make this a tunable. Then the upper >>> layers wouldn't care. There's a small chance that some SD cards might be >>> reporting values that are too large. But I think it is confined to SD cards and >>> if I see too many more I'll do something specific in the SD driver. >>> >>> Warner >>> >>> >> That sounds good to me and I think can clean up a lot of code and potential foot-shooting. Who is planning to make the patch? I'm happy to do anything that would be helpful. > The patch is super-easy, but I need to get the concept validated and make sure that it does not have unintended side effects. > > Warner > Sounds great. There is no urgency here -- we have a good solution for 11.0 already -- so taking time to do it right sounds good. I believe stripesize is only consumed by disk formatting tools, so unintended side effects at least should be minimal. -Nathan From owner-svn-src-head@freebsd.org Fri Aug 19 16:37:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AA8BBBF96B; Fri, 19 Aug 2016 16:37:28 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0253119D7; Fri, 19 Aug 2016 16:37:27 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7JGbNcn019863 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 19 Aug 2016 09:37:23 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Allan Jude , Warner Losh , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> <86inuxckve.fsf@desk.des.no> Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Nathan Whitehorn Message-ID: <0c319857-77cf-76de-0e82-08bc989713a0@freebsd.org> Date: Fri, 19 Aug 2016 09:37:23 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVbcZXulEIHbegWGALzasNF46nhhHfD3HfhLw3kEQyI+/2JW+gQqerXDadJCQQMjfn5IogqlJlj+5zGIEIU8/+haOtsP5U637ag= X-Sonic-ID: C;uuh3NCtm5hGi9KDx2xNB0g== M;4n+zNCtm5hGi9KDx2xNB0g== 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.22 Precedence: list List-Id: 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, 19 Aug 2016 16:37:28 -0000 On 08/19/16 08:57, Allan Jude wrote: > On 2016-08-19 10:13, Warner Losh wrote: >> On Fri, Aug 19, 2016 at 12:51 AM, Dag-Erling Smørgrav wrote: >>> Warner Losh writes: >>>> Allan Jude writes: >>>>> Which makes more sense: >>>>> >>>>> A) If stripesize == 0, use some sane value like 4096 >>>> I don't like this. >>>> >>>>> B) Some other combination that uses the reported stripe size, unless it >>>>> is 0, in which case it uses 4096 (or some other value controlled by a >>>>> different new sysctl) >>>> Don't like this so much. >>>> >>>>> C) create kern.geom.min_stripe_size with a default of 512, but users can >>>>> set 4096 if they use only 4k devices. (doesn't really solve the problem >>>>> for the installer) >>>> Default it to 4k, and allow users to set it to 512. If the drive >>>> reports < this value >>>> report this value instead. >>> I don't like either option. Option D (which I don't like either, but >>> which should at least work in most cases) is a sysctl that specifies a >>> minimum factor, and set the reported stripe size to the least common >>> multiple of that number and the actual stripe or sector size. This is >>> what my bsdinstall patch does. However, I think that pushing this down >>> to a layer where it will affect all applications is a terrible idea, >>> because we have no way of knowing what will break[*], and it can >>> seriously mislead users and hinder troubleshooting - especially if it is >>> enabled by default rather than only when necessary. >> I took a look into the implications of doing a 4k stripesize 'automatically' >> this morning. I found a few places in g_part where it would actively >> hurt when coupled with gpart's insistence on aligning things. So I >> now think it's a bad idea. This will make it harder for FreeBSD to >> generate arbitrary disk layouts. And I'm not too sure about what >> things like gstripe would report as a result and if this would actually >> interfere if you had a large, but not power of two stripe size. >> >>> I don't think it's a good idea to enforce stripe alignment everywhere, >>> either. It works for partitions because they are very large relative to >>> the stripe size, and at worst we will waste a few millionths of the disk >>> on inter-partition gaps, which should only occur between the partition >>> table and the boot partition, and possibly, if the stripe size is very >>> large, between the boot partition and the swap partition. But forcing >>> filesystems to respect the stripe size will lead to no end of trouble, >>> because RAID volumes can have stripe sizes of 16 kB or more. I think it >>> is important to align partitions during installation because of the huge >>> performance impact of misaligned partitions on AF disks, but despite >>> what Nathan claims, I never advocated applying the same logic >>> everywhere. >> Yea, having poked at it for just a little while, I agree. The installer is the >> right place to make sure we don't cross-thread the 4k sectors. Stripe size >> means too many other things to have it be useful in that context. >> >> Warner >> > Maybe instead we just change gpart to default to 4k alignment, but users > can always override with -a 512 or some other value? > > Then the installer behaves the same as a user typing 'gpart', but we > don't mess with the entire geom layer? > ZFS also looks at this, so we would need it there, and there might be a few others. At the very least, gpart and the installer should have the same behavior. Warner, could you elaborate on what you mean by "cross-threading"? Are you worried about nested partition tables in which the outer one is misaligned? Having the disk drivers report a 4K stripesize seems to have worked so far; I'm not sure how reporting it more often would cause problems. You wouldn't want all drivers, or all GEOM layers, to do this, of course. If the problem is that "stripe size" has an overloaded meaning, we could easily add another GEOM property. -Nathan From owner-svn-src-head@freebsd.org Fri Aug 19 17:37:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66D06BBF7EE; Fri, 19 Aug 2016 17:37: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 412DE1699; Fri, 19 Aug 2016 17:37: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 u7JHbXKm022189; Fri, 19 Aug 2016 17:37:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHbXd7022185; Fri, 19 Aug 2016 17:37:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608191737.u7JHbXd7022185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 17:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304476 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 17:37:34 -0000 Author: jhb Date: Fri Aug 19 17:37:32 2016 New Revision: 304476 URL: https://svnweb.freebsd.org/changeset/base/304476 Log: Fix various nits in the aio operation manpages. - Avoid double use of "request" in a single sentence. Instead, describe aio_sigevent as being used to request notification of the associated operation's completion. This matches the language used to describe aio_sigevent in aio(4). - Simplify the prohibition on modifying buffers while requests are in flight. - Fix case mismatch. - Drop note about not using stack variables. C programmers should be able to figure out if a stack variable is safe based on the later warning about the life cycle requirements of control blocks. - Remove prohibition on modifying the I/O buffer for aio_fsync() since it does not use an I/O buffer. For aio_mlock(), prohibit modifications to the mapping (e.g. due to mprotect, munmap, mmap, etc.) but do not prohibit modifications to the memory backing the buffer (stores into the pages backing the buffer). Requested by: wblock (1,2), kib (4) Reviewed by: kib, rpokala, wblock MFC after: 3 days Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7462 Modified: head/lib/libc/sys/aio_fsync.2 head/lib/libc/sys/aio_mlock.2 head/lib/libc/sys/aio_read.2 head/lib/libc/sys/aio_write.2 Modified: head/lib/libc/sys/aio_fsync.2 ============================================================================== --- head/lib/libc/sys/aio_fsync.2 Fri Aug 19 17:03:14 2016 (r304475) +++ head/lib/libc/sys/aio_fsync.2 Fri Aug 19 17:37:32 2016 (r304476) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2016 +.Dd August 19, 2016 .Dt AIO_FSYNC 2 .Os .Sh NAME @@ -74,16 +74,14 @@ the call returns without having enqueued .Pp The .Fa iocb->aio_sigevent -structure can be used to request notification of the request's +structure can be used to request notification of the operation's completion as described in .Xr aio 4 . .Sh RESTRICTIONS -The asynchronous I/O Control Block structure pointed to by +The Asynchronous I/O Control Block structure pointed to by .Fa iocb must remain valid until the operation has completed. -For this reason, use of auto (stack) variables -for these objects is discouraged. .Pp The asynchronous I/O control buffer .Fa iocb @@ -91,9 +89,8 @@ should be zeroed before the .Fn aio_fsync call to avoid passing bogus context information to the kernel. .Pp -Modifications of the Asynchronous I/O Control Block structure or the -buffer contents after the request has been enqueued, but before the -request has completed, are not allowed. +Modification of the Asynchronous I/O Control Block structure is not allowed +while the request is queued. .Sh RETURN VALUES .Rv -std aio_fsync .Sh ERRORS Modified: head/lib/libc/sys/aio_mlock.2 ============================================================================== --- head/lib/libc/sys/aio_mlock.2 Fri Aug 19 17:03:14 2016 (r304475) +++ head/lib/libc/sys/aio_mlock.2 Fri Aug 19 17:37:32 2016 (r304476) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2016 +.Dd August 19, 2016 .Dt AIO_MLOCK 2 .Os .Sh NAME @@ -67,7 +67,7 @@ then the call returns without having enq .Pp The .Fa iocb->aio_sigevent -structure can be used to request notification of the request's +structure can be used to request notification of the operation's completion as described in .Xr aio 4 . .Sh RESTRICTIONS @@ -77,8 +77,6 @@ and the buffer that the .Fa iocb->aio_buf member of that structure references must remain valid until the operation has completed. -For this reason, use of auto (stack) variables -for these objects is discouraged. .Pp The asynchronous I/O control buffer .Fa iocb @@ -87,8 +85,8 @@ should be zeroed before the call to avoid passing bogus context information to the kernel. .Pp Modifications of the Asynchronous I/O Control Block structure or the -buffer contents after the request has been enqueued, but before the -request has completed, are not allowed. +memory mapping described by the virtual address range are not allowed +while the request is queued. .Sh RETURN VALUES .Rv -std aio_mlock .Sh ERRORS Modified: head/lib/libc/sys/aio_read.2 ============================================================================== --- head/lib/libc/sys/aio_read.2 Fri Aug 19 17:03:14 2016 (r304475) +++ head/lib/libc/sys/aio_read.2 Fri Aug 19 17:37:32 2016 (r304476) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2016 +.Dd August 19, 2016 .Dt AIO_READ 2 .Os .Sh NAME @@ -82,7 +82,7 @@ not be referenced after the request is e .Pp The .Fa iocb->aio_sigevent -structure can be used to request notification of the request's +structure can be used to request notification of the operation's completion as described in .Xr aio 4 . .Sh RESTRICTIONS @@ -92,8 +92,6 @@ and the buffer that the .Fa iocb->aio_buf member of that structure references must remain valid until the operation has completed. -For this reason, use of auto (stack) variables -for these objects is discouraged. .Pp The asynchronous I/O control buffer .Fa iocb @@ -102,8 +100,7 @@ should be zeroed before the call to avoid passing bogus context information to the kernel. .Pp Modifications of the Asynchronous I/O Control Block structure or the -buffer contents after the request has been enqueued, but before the -request has completed, are not allowed. +buffer contents are not allowed while the request is queued. .Pp If the file offset in .Fa iocb->aio_offset Modified: head/lib/libc/sys/aio_write.2 ============================================================================== --- head/lib/libc/sys/aio_write.2 Fri Aug 19 17:03:14 2016 (r304475) +++ head/lib/libc/sys/aio_write.2 Fri Aug 19 17:37:32 2016 (r304476) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2016 +.Dd August 19, 2016 .Dt AIO_WRITE 2 .Os .Sh NAME @@ -88,7 +88,7 @@ be referenced after the request is enque .Pp The .Fa iocb->aio_sigevent -structure can be used to request notification of the request's +structure can be used to request notification of the operation's completion as described in .Xr aio 4 . .Sh RESTRICTIONS @@ -98,8 +98,6 @@ and the buffer that the .Fa iocb->aio_buf member of that structure references must remain valid until the operation has completed. -For this reason, use of auto (stack) variables -for these objects is discouraged. .Pp The asynchronous I/O control buffer .Fa iocb @@ -108,8 +106,7 @@ should be zeroed before the system call to avoid passing bogus context information to the kernel. .Pp Modifications of the Asynchronous I/O Control Block structure or the -buffer contents after the request has been enqueued, but before the -request has completed, are not allowed. +buffer contents are not allowed while the request is queued. .Pp If the file offset in .Fa iocb->aio_offset From owner-svn-src-head@freebsd.org Fri Aug 19 17:49:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F655BBFB0F; Fri, 19 Aug 2016 17:49:37 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6BA61F34; Fri, 19 Aug 2016 17:49:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JHnatG026281; Fri, 19 Aug 2016 17:49:36 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHnZU3026272; Fri, 19 Aug 2016 17:49:35 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608191749.u7JHnZU3026272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 19 Aug 2016 17:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304478 - in head: sys/compat/cloudabi sys/compat/cloudabi64 sys/contrib/cloudabi usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 17:49:37 -0000 Author: ed Date: Fri Aug 19 17:49:35 2016 New Revision: 304478 URL: https://svnweb.freebsd.org/changeset/base/304478 Log: Import the new automatically generated system call table for CloudABI. Now that we've switched over to using the vDSO on CloudABI, it becomes a lot easier for us to phase out old features. System call numbering is no longer something that's part of the ABI. It's fully based on names. As long as the numbering used by the kernel and the vDSO is consistent (which it always is), it's all right. Let's put this to the test by removing a system call (thread_tcb_set()) that's already unused for quite some time now, but was only left intact to serve as a placeholder. Sync in the new system call table that uses alphabetic sorting of system calls. Obtained from: https://github.com/NuxiNL/cloudabi Added: head/sys/contrib/cloudabi/syscalls64.master Deleted: head/sys/contrib/cloudabi/syscalls.master Modified: head/sys/compat/cloudabi/cloudabi_thread.c head/sys/compat/cloudabi64/Makefile head/sys/compat/cloudabi64/cloudabi64_proto.h head/sys/compat/cloudabi64/cloudabi64_syscall.h head/sys/compat/cloudabi64/cloudabi64_syscalls.c head/sys/compat/cloudabi64/cloudabi64_sysent.c head/sys/compat/cloudabi64/cloudabi64_systrace_args.c head/sys/contrib/cloudabi/cloudabi64_types.h head/sys/contrib/cloudabi/cloudabi_types.h head/sys/contrib/cloudabi/cloudabi_types_common.h head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.c head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.c head/usr.bin/truss/syscalls.c Modified: head/sys/compat/cloudabi/cloudabi_thread.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_thread.c Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/compat/cloudabi/cloudabi_thread.c Fri Aug 19 17:49:35 2016 (r304478) @@ -60,14 +60,6 @@ cloudabi_sys_thread_exit(struct thread * } int -cloudabi_sys_thread_tcb_set(struct thread *td, - struct cloudabi_sys_thread_tcb_set_args *uap) -{ - - return (cpu_set_user_tls(td, uap->tcb)); -} - -int cloudabi_sys_thread_yield(struct thread *td, struct cloudabi_sys_thread_yield_args *uap) { Modified: head/sys/compat/cloudabi64/Makefile ============================================================================== --- head/sys/compat/cloudabi64/Makefile Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/compat/cloudabi64/Makefile Fri Aug 19 17:49:35 2016 (r304478) @@ -8,7 +8,7 @@ sysent: cloudabi64_sysent.c cloudabi64_s cloudabi64_sysent.c cloudabi64_syscall.h cloudabi64_proto.h \ cloudabi64_syscalls.c cloudabi64_systrace_args.c: \ - ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls.master \ + ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls64.master \ syscalls.conf - sh ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls.master \ + sh ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls64.master \ syscalls.conf Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_proto.h Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/compat/cloudabi64/cloudabi64_proto.h Fri Aug 19 17:49:35 2016 (r304478) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed + * created from FreeBSD */ #ifndef _CLOUDABI64_SYSPROTO_H_ @@ -236,6 +236,14 @@ struct cloudabi64_sys_poll_args { char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; char nsubscriptions_l_[PADL_(size_t)]; size_t nsubscriptions; char nsubscriptions_r_[PADR_(size_t)]; }; +struct cloudabi64_sys_poll_fd_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)]; + char nin_l_[PADL_(size_t)]; size_t nin; char nin_r_[PADR_(size_t)]; + char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; + char nout_l_[PADL_(size_t)]; size_t nout; char nout_r_[PADR_(size_t)]; + char timeout_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi64_subscription_t *)]; +}; struct cloudabi_sys_proc_exec_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char data_l_[PADL_(const void *)]; const void * data; char data_r_[PADR_(const void *)]; @@ -302,20 +310,9 @@ struct cloudabi_sys_thread_exit_args { char lock_l_[PADL_(cloudabi_lock_t *)]; cloudabi_lock_t * lock; char lock_r_[PADR_(cloudabi_lock_t *)]; char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; }; -struct cloudabi_sys_thread_tcb_set_args { - char tcb_l_[PADL_(void *)]; void * tcb; char tcb_r_[PADR_(void *)]; -}; struct cloudabi_sys_thread_yield_args { register_t dummy; }; -struct cloudabi64_sys_poll_fd_args { - char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)]; - char nin_l_[PADL_(size_t)]; size_t nin; char nin_r_[PADR_(size_t)]; - char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; - char nout_l_[PADL_(size_t)]; size_t nout; char nout_r_[PADR_(size_t)]; - char timeout_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi64_subscription_t *)]; -}; int cloudabi_sys_clock_res_get(struct thread *, struct cloudabi_sys_clock_res_get_args *); int cloudabi_sys_clock_time_get(struct thread *, struct cloudabi_sys_clock_time_get_args *); int cloudabi_sys_condvar_signal(struct thread *, struct cloudabi_sys_condvar_signal_args *); @@ -356,6 +353,7 @@ int cloudabi_sys_mem_sync(struct thread int cloudabi_sys_mem_unlock(struct thread *, struct cloudabi_sys_mem_unlock_args *); int cloudabi_sys_mem_unmap(struct thread *, struct cloudabi_sys_mem_unmap_args *); int cloudabi64_sys_poll(struct thread *, struct cloudabi64_sys_poll_args *); +int cloudabi64_sys_poll_fd(struct thread *, struct cloudabi64_sys_poll_fd_args *); int cloudabi_sys_proc_exec(struct thread *, struct cloudabi_sys_proc_exec_args *); int cloudabi_sys_proc_exit(struct thread *, struct cloudabi_sys_proc_exit_args *); int cloudabi_sys_proc_fork(struct thread *, struct cloudabi_sys_proc_fork_args *); @@ -371,9 +369,7 @@ int cloudabi_sys_sock_shutdown(struct th int cloudabi_sys_sock_stat_get(struct thread *, struct cloudabi_sys_sock_stat_get_args *); int cloudabi64_sys_thread_create(struct thread *, struct cloudabi64_sys_thread_create_args *); int cloudabi_sys_thread_exit(struct thread *, struct cloudabi_sys_thread_exit_args *); -int cloudabi_sys_thread_tcb_set(struct thread *, struct cloudabi_sys_thread_tcb_set_args *); int cloudabi_sys_thread_yield(struct thread *, struct cloudabi_sys_thread_yield_args *); -int cloudabi64_sys_poll_fd(struct thread *, struct cloudabi64_sys_poll_fd_args *); #ifdef COMPAT_43 @@ -398,6 +394,12 @@ int cloudabi64_sys_poll_fd(struct thread #endif /* COMPAT_FREEBSD7 */ + +#ifdef COMPAT_FREEBSD10 + + +#endif /* COMPAT_FREEBSD10 */ + #define CLOUDABI64_SYS_AUE_cloudabi_sys_clock_res_get AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_clock_time_get AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_condvar_signal AUE_NULL @@ -438,6 +440,7 @@ int cloudabi64_sys_poll_fd(struct thread #define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_unlock AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_unmap AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_poll AUE_NULL +#define CLOUDABI64_SYS_AUE_cloudabi64_sys_poll_fd AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_proc_exec AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_proc_exit AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_proc_fork AUE_NULL @@ -453,9 +456,7 @@ int cloudabi64_sys_poll_fd(struct thread #define CLOUDABI64_SYS_AUE_cloudabi_sys_sock_stat_get AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_thread_create AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_thread_exit AUE_NULL -#define CLOUDABI64_SYS_AUE_cloudabi_sys_thread_tcb_set AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_thread_yield AUE_NULL -#define CLOUDABI64_SYS_AUE_cloudabi64_sys_poll_fd AUE_NULL #undef PAD_ #undef PADL_ Modified: head/sys/compat/cloudabi64/cloudabi64_syscall.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscall.h Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/compat/cloudabi64/cloudabi64_syscall.h Fri Aug 19 17:49:35 2016 (r304478) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed + * created from FreeBSD */ #define CLOUDABI64_SYS_cloudabi_sys_clock_res_get 0 @@ -46,22 +46,21 @@ #define CLOUDABI64_SYS_cloudabi_sys_mem_unlock 37 #define CLOUDABI64_SYS_cloudabi_sys_mem_unmap 38 #define CLOUDABI64_SYS_cloudabi64_sys_poll 39 -#define CLOUDABI64_SYS_cloudabi_sys_proc_exec 40 -#define CLOUDABI64_SYS_cloudabi_sys_proc_exit 41 -#define CLOUDABI64_SYS_cloudabi_sys_proc_fork 42 -#define CLOUDABI64_SYS_cloudabi_sys_proc_raise 43 -#define CLOUDABI64_SYS_cloudabi_sys_random_get 44 -#define CLOUDABI64_SYS_cloudabi_sys_sock_accept 45 -#define CLOUDABI64_SYS_cloudabi_sys_sock_bind 46 -#define CLOUDABI64_SYS_cloudabi_sys_sock_connect 47 -#define CLOUDABI64_SYS_cloudabi_sys_sock_listen 48 -#define CLOUDABI64_SYS_cloudabi64_sys_sock_recv 49 -#define CLOUDABI64_SYS_cloudabi64_sys_sock_send 50 -#define CLOUDABI64_SYS_cloudabi_sys_sock_shutdown 51 -#define CLOUDABI64_SYS_cloudabi_sys_sock_stat_get 52 -#define CLOUDABI64_SYS_cloudabi64_sys_thread_create 53 -#define CLOUDABI64_SYS_cloudabi_sys_thread_exit 54 -#define CLOUDABI64_SYS_cloudabi_sys_thread_tcb_set 55 +#define CLOUDABI64_SYS_cloudabi64_sys_poll_fd 40 +#define CLOUDABI64_SYS_cloudabi_sys_proc_exec 41 +#define CLOUDABI64_SYS_cloudabi_sys_proc_exit 42 +#define CLOUDABI64_SYS_cloudabi_sys_proc_fork 43 +#define CLOUDABI64_SYS_cloudabi_sys_proc_raise 44 +#define CLOUDABI64_SYS_cloudabi_sys_random_get 45 +#define CLOUDABI64_SYS_cloudabi_sys_sock_accept 46 +#define CLOUDABI64_SYS_cloudabi_sys_sock_bind 47 +#define CLOUDABI64_SYS_cloudabi_sys_sock_connect 48 +#define CLOUDABI64_SYS_cloudabi_sys_sock_listen 49 +#define CLOUDABI64_SYS_cloudabi64_sys_sock_recv 50 +#define CLOUDABI64_SYS_cloudabi64_sys_sock_send 51 +#define CLOUDABI64_SYS_cloudabi_sys_sock_shutdown 52 +#define CLOUDABI64_SYS_cloudabi_sys_sock_stat_get 53 +#define CLOUDABI64_SYS_cloudabi64_sys_thread_create 54 +#define CLOUDABI64_SYS_cloudabi_sys_thread_exit 55 #define CLOUDABI64_SYS_cloudabi_sys_thread_yield 56 -#define CLOUDABI64_SYS_cloudabi64_sys_poll_fd 57 -#define CLOUDABI64_SYS_MAXSYSCALL 58 +#define CLOUDABI64_SYS_MAXSYSCALL 57 Modified: head/sys/compat/cloudabi64/cloudabi64_syscalls.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscalls.c Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/compat/cloudabi64/cloudabi64_syscalls.c Fri Aug 19 17:49:35 2016 (r304478) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed + * created from FreeBSD */ const char *cloudabi64_syscallnames[] = { @@ -47,22 +47,21 @@ const char *cloudabi64_syscallnames[] = "cloudabi_sys_mem_unlock", /* 37 = cloudabi_sys_mem_unlock */ "cloudabi_sys_mem_unmap", /* 38 = cloudabi_sys_mem_unmap */ "cloudabi64_sys_poll", /* 39 = cloudabi64_sys_poll */ - "cloudabi_sys_proc_exec", /* 40 = cloudabi_sys_proc_exec */ - "cloudabi_sys_proc_exit", /* 41 = cloudabi_sys_proc_exit */ - "cloudabi_sys_proc_fork", /* 42 = cloudabi_sys_proc_fork */ - "cloudabi_sys_proc_raise", /* 43 = cloudabi_sys_proc_raise */ - "cloudabi_sys_random_get", /* 44 = cloudabi_sys_random_get */ - "cloudabi_sys_sock_accept", /* 45 = cloudabi_sys_sock_accept */ - "cloudabi_sys_sock_bind", /* 46 = cloudabi_sys_sock_bind */ - "cloudabi_sys_sock_connect", /* 47 = cloudabi_sys_sock_connect */ - "cloudabi_sys_sock_listen", /* 48 = cloudabi_sys_sock_listen */ - "cloudabi64_sys_sock_recv", /* 49 = cloudabi64_sys_sock_recv */ - "cloudabi64_sys_sock_send", /* 50 = cloudabi64_sys_sock_send */ - "cloudabi_sys_sock_shutdown", /* 51 = cloudabi_sys_sock_shutdown */ - "cloudabi_sys_sock_stat_get", /* 52 = cloudabi_sys_sock_stat_get */ - "cloudabi64_sys_thread_create", /* 53 = cloudabi64_sys_thread_create */ - "cloudabi_sys_thread_exit", /* 54 = cloudabi_sys_thread_exit */ - "cloudabi_sys_thread_tcb_set", /* 55 = cloudabi_sys_thread_tcb_set */ + "cloudabi64_sys_poll_fd", /* 40 = cloudabi64_sys_poll_fd */ + "cloudabi_sys_proc_exec", /* 41 = cloudabi_sys_proc_exec */ + "cloudabi_sys_proc_exit", /* 42 = cloudabi_sys_proc_exit */ + "cloudabi_sys_proc_fork", /* 43 = cloudabi_sys_proc_fork */ + "cloudabi_sys_proc_raise", /* 44 = cloudabi_sys_proc_raise */ + "cloudabi_sys_random_get", /* 45 = cloudabi_sys_random_get */ + "cloudabi_sys_sock_accept", /* 46 = cloudabi_sys_sock_accept */ + "cloudabi_sys_sock_bind", /* 47 = cloudabi_sys_sock_bind */ + "cloudabi_sys_sock_connect", /* 48 = cloudabi_sys_sock_connect */ + "cloudabi_sys_sock_listen", /* 49 = cloudabi_sys_sock_listen */ + "cloudabi64_sys_sock_recv", /* 50 = cloudabi64_sys_sock_recv */ + "cloudabi64_sys_sock_send", /* 51 = cloudabi64_sys_sock_send */ + "cloudabi_sys_sock_shutdown", /* 52 = cloudabi_sys_sock_shutdown */ + "cloudabi_sys_sock_stat_get", /* 53 = cloudabi_sys_sock_stat_get */ + "cloudabi64_sys_thread_create", /* 54 = cloudabi64_sys_thread_create */ + "cloudabi_sys_thread_exit", /* 55 = cloudabi_sys_thread_exit */ "cloudabi_sys_thread_yield", /* 56 = cloudabi_sys_thread_yield */ - "cloudabi64_sys_poll_fd", /* 57 = cloudabi64_sys_poll_fd */ }; Modified: head/sys/compat/cloudabi64/cloudabi64_sysent.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sysent.c Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/compat/cloudabi64/cloudabi64_sysent.c Fri Aug 19 17:49:35 2016 (r304478) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed + * created from FreeBSD */ #include @@ -55,22 +55,21 @@ struct sysent cloudabi64_sysent[] = { { AS(cloudabi_sys_mem_unlock_args), (sy_call_t *)cloudabi_sys_mem_unlock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = cloudabi_sys_mem_unlock */ { AS(cloudabi_sys_mem_unmap_args), (sy_call_t *)cloudabi_sys_mem_unmap, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = cloudabi_sys_mem_unmap */ { AS(cloudabi64_sys_poll_args), (sy_call_t *)cloudabi64_sys_poll, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = cloudabi64_sys_poll */ - { AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi_sys_proc_exec */ - { AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_exit */ - { 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_fork */ - { AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_proc_raise */ - { AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi_sys_random_get */ - { AS(cloudabi_sys_sock_accept_args), (sy_call_t *)cloudabi_sys_sock_accept, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_sock_accept */ - { AS(cloudabi_sys_sock_bind_args), (sy_call_t *)cloudabi_sys_sock_bind, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_bind */ - { AS(cloudabi_sys_sock_connect_args), (sy_call_t *)cloudabi_sys_sock_connect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_connect */ - { AS(cloudabi_sys_sock_listen_args), (sy_call_t *)cloudabi_sys_sock_listen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_sock_listen */ - { AS(cloudabi64_sys_sock_recv_args), (sy_call_t *)cloudabi64_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi64_sys_sock_recv */ - { AS(cloudabi64_sys_sock_send_args), (sy_call_t *)cloudabi64_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi64_sys_sock_send */ - { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi_sys_sock_shutdown */ - { AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = cloudabi_sys_sock_stat_get */ - { AS(cloudabi64_sys_thread_create_args), (sy_call_t *)cloudabi64_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = cloudabi64_sys_thread_create */ - { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi_sys_thread_exit */ - { AS(cloudabi_sys_thread_tcb_set_args), (sy_call_t *)cloudabi_sys_thread_tcb_set, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 55 = cloudabi_sys_thread_tcb_set */ + { AS(cloudabi64_sys_poll_fd_args), (sy_call_t *)cloudabi64_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi64_sys_poll_fd */ + { AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_exec */ + { AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_exit */ + { 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_proc_fork */ + { AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi_sys_proc_raise */ + { AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_random_get */ + { AS(cloudabi_sys_sock_accept_args), (sy_call_t *)cloudabi_sys_sock_accept, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_accept */ + { AS(cloudabi_sys_sock_bind_args), (sy_call_t *)cloudabi_sys_sock_bind, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_bind */ + { AS(cloudabi_sys_sock_connect_args), (sy_call_t *)cloudabi_sys_sock_connect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_sock_connect */ + { AS(cloudabi_sys_sock_listen_args), (sy_call_t *)cloudabi_sys_sock_listen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi_sys_sock_listen */ + { AS(cloudabi64_sys_sock_recv_args), (sy_call_t *)cloudabi64_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi64_sys_sock_recv */ + { AS(cloudabi64_sys_sock_send_args), (sy_call_t *)cloudabi64_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi64_sys_sock_send */ + { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = cloudabi_sys_sock_shutdown */ + { AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = cloudabi_sys_sock_stat_get */ + { AS(cloudabi64_sys_thread_create_args), (sy_call_t *)cloudabi64_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi64_sys_thread_create */ + { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 55 = cloudabi_sys_thread_exit */ { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 56 = cloudabi_sys_thread_yield */ - { AS(cloudabi64_sys_poll_fd_args), (sy_call_t *)cloudabi64_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 57 = cloudabi64_sys_poll_fd */ }; Modified: head/sys/compat/cloudabi64/cloudabi64_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Fri Aug 19 17:49:35 2016 (r304478) @@ -373,8 +373,20 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } - /* cloudabi_sys_proc_exec */ + /* cloudabi64_sys_poll_fd */ case 40: { + struct cloudabi64_sys_poll_fd_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */ + uarg[2] = p->nin; /* size_t */ + uarg[3] = (intptr_t) p->out; /* cloudabi64_event_t * */ + uarg[4] = p->nout; /* size_t */ + uarg[5] = (intptr_t) p->timeout; /* const cloudabi64_subscription_t * */ + *n_args = 6; + break; + } + /* cloudabi_sys_proc_exec */ + case 41: { struct cloudabi_sys_proc_exec_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->data; /* const void * */ @@ -385,26 +397,26 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi_sys_proc_exit */ - case 41: { + case 42: { struct cloudabi_sys_proc_exit_args *p = params; iarg[0] = p->rval; /* cloudabi_exitcode_t */ *n_args = 1; break; } /* cloudabi_sys_proc_fork */ - case 42: { + case 43: { *n_args = 0; break; } /* cloudabi_sys_proc_raise */ - case 43: { + case 44: { struct cloudabi_sys_proc_raise_args *p = params; iarg[0] = p->sig; /* cloudabi_signal_t */ *n_args = 1; break; } /* cloudabi_sys_random_get */ - case 44: { + case 45: { struct cloudabi_sys_random_get_args *p = params; uarg[0] = (intptr_t) p->buf; /* void * */ uarg[1] = p->nbyte; /* size_t */ @@ -412,7 +424,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi_sys_sock_accept */ - case 45: { + case 46: { struct cloudabi_sys_sock_accept_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */ @@ -420,7 +432,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi_sys_sock_bind */ - case 46: { + case 47: { struct cloudabi_sys_sock_bind_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->fd; /* cloudabi_fd_t */ @@ -430,7 +442,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi_sys_sock_connect */ - case 47: { + case 48: { struct cloudabi_sys_sock_connect_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->fd; /* cloudabi_fd_t */ @@ -440,7 +452,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi_sys_sock_listen */ - case 48: { + case 49: { struct cloudabi_sys_sock_listen_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->backlog; /* cloudabi_backlog_t */ @@ -448,7 +460,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi64_sys_sock_recv */ - case 49: { + case 50: { struct cloudabi64_sys_sock_recv_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi64_recv_in_t * */ @@ -457,7 +469,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi64_sys_sock_send */ - case 50: { + case 51: { struct cloudabi64_sys_sock_send_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi64_send_in_t * */ @@ -466,7 +478,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi_sys_sock_shutdown */ - case 51: { + case 52: { struct cloudabi_sys_sock_shutdown_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->how; /* cloudabi_sdflags_t */ @@ -474,7 +486,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi_sys_sock_stat_get */ - case 52: { + case 53: { struct cloudabi_sys_sock_stat_get_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */ @@ -483,44 +495,25 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi64_sys_thread_create */ - case 53: { + case 54: { struct cloudabi64_sys_thread_create_args *p = params; uarg[0] = (intptr_t) p->attr; /* cloudabi64_threadattr_t * */ *n_args = 1; break; } /* cloudabi_sys_thread_exit */ - case 54: { + case 55: { struct cloudabi_sys_thread_exit_args *p = params; uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */ iarg[1] = p->scope; /* cloudabi_scope_t */ *n_args = 2; break; } - /* cloudabi_sys_thread_tcb_set */ - case 55: { - struct cloudabi_sys_thread_tcb_set_args *p = params; - uarg[0] = (intptr_t) p->tcb; /* void * */ - *n_args = 1; - break; - } /* cloudabi_sys_thread_yield */ case 56: { *n_args = 0; break; } - /* cloudabi64_sys_poll_fd */ - case 57: { - struct cloudabi64_sys_poll_fd_args *p = params; - iarg[0] = p->fd; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */ - uarg[2] = p->nin; /* size_t */ - uarg[3] = (intptr_t) p->out; /* cloudabi64_event_t * */ - uarg[4] = p->nout; /* size_t */ - uarg[5] = (intptr_t) p->timeout; /* const cloudabi64_subscription_t * */ - *n_args = 6; - break; - } default: *n_args = 0; break; @@ -1177,13 +1170,38 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* cloudabi_sys_proc_exec */ + /* cloudabi64_sys_poll_fd */ case 40: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: + p = "const cloudabi64_subscription_t *"; + break; + case 2: + p = "size_t"; + break; + case 3: + p = "cloudabi64_event_t *"; + break; + case 4: + p = "size_t"; + break; + case 5: + p = "const cloudabi64_subscription_t *"; + break; + default: + break; + }; + break; + /* cloudabi_sys_proc_exec */ + case 41: + switch(ndx) { + case 0: + p = "cloudabi_fd_t"; + break; + case 1: p = "const void *"; break; case 2: @@ -1200,7 +1218,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_proc_exit */ - case 41: + case 42: switch(ndx) { case 0: p = "cloudabi_exitcode_t"; @@ -1210,10 +1228,10 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_proc_fork */ - case 42: + case 43: break; /* cloudabi_sys_proc_raise */ - case 43: + case 44: switch(ndx) { case 0: p = "cloudabi_signal_t"; @@ -1223,7 +1241,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_random_get */ - case 44: + case 45: switch(ndx) { case 0: p = "void *"; @@ -1236,7 +1254,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_sock_accept */ - case 45: + case 46: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1249,7 +1267,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_sock_bind */ - case 46: + case 47: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1268,7 +1286,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_sock_connect */ - case 47: + case 48: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1287,7 +1305,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_sock_listen */ - case 48: + case 49: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1300,7 +1318,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi64_sys_sock_recv */ - case 49: + case 50: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1316,7 +1334,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi64_sys_sock_send */ - case 50: + case 51: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1332,7 +1350,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_sock_shutdown */ - case 51: + case 52: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1345,7 +1363,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_sock_stat_get */ - case 52: + case 53: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1361,7 +1379,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi64_sys_thread_create */ - case 53: + case 54: switch(ndx) { case 0: p = "cloudabi64_threadattr_t *"; @@ -1371,7 +1389,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_thread_exit */ - case 54: + case 55: switch(ndx) { case 0: p = "cloudabi_lock_t *"; @@ -1383,44 +1401,9 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* cloudabi_sys_thread_tcb_set */ - case 55: - switch(ndx) { - case 0: - p = "void *"; - break; - default: - break; - }; - break; /* cloudabi_sys_thread_yield */ case 56: break; - /* cloudabi64_sys_poll_fd */ - case 57: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: - p = "const cloudabi64_subscription_t *"; - break; - case 2: - p = "size_t"; - break; - case 3: - p = "cloudabi64_event_t *"; - break; - case 4: - p = "size_t"; - break; - case 5: - p = "const cloudabi64_subscription_t *"; - break; - default: - break; - }; - break; default: break; }; @@ -1632,90 +1615,85 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "size_t"; break; - /* cloudabi_sys_proc_exec */ + /* cloudabi64_sys_poll_fd */ case 40: if (ndx == 0 || ndx == 1) + p = "size_t"; + break; + /* cloudabi_sys_proc_exec */ + case 41: + if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_proc_exit */ - case 41: + case 42: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_proc_fork */ - case 42: - /* cloudabi_sys_proc_raise */ case 43: + /* cloudabi_sys_proc_raise */ + case 44: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_random_get */ - case 44: + case 45: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_sock_accept */ - case 45: + case 46: if (ndx == 0 || ndx == 1) p = "cloudabi_fd_t"; break; /* cloudabi_sys_sock_bind */ - case 46: + case 47: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_sock_connect */ - case 47: + case 48: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_sock_listen */ - case 48: + case 49: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi64_sys_sock_recv */ - case 49: + case 50: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi64_sys_sock_send */ - case 50: + case 51: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_sock_shutdown */ - case 51: + case 52: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_sock_stat_get */ - case 52: + case 53: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi64_sys_thread_create */ - case 53: + case 54: if (ndx == 0 || ndx == 1) p = "cloudabi_tid_t"; break; /* cloudabi_sys_thread_exit */ - case 54: - if (ndx == 0 || ndx == 1) - p = "void"; - break; - /* cloudabi_sys_thread_tcb_set */ case 55: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_thread_yield */ case 56: - /* cloudabi64_sys_poll_fd */ - case 57: - if (ndx == 0 || ndx == 1) - p = "size_t"; - break; default: break; }; Modified: head/sys/contrib/cloudabi/cloudabi64_types.h ============================================================================== --- head/sys/contrib/cloudabi/cloudabi64_types.h Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/contrib/cloudabi/cloudabi64_types.h Fri Aug 19 17:49:35 2016 (r304478) @@ -31,11 +31,11 @@ #include "cloudabi_types_common.h" typedef struct { - _Alignas(4) cloudabi_auxtype_t a_type; - union { - _Alignas(8) uint64_t a_val; - _Alignas(8) uint64_t a_ptr; - }; + _Alignas(4) cloudabi_auxtype_t a_type; + union { + _Alignas(8) uint64_t a_val; + _Alignas(8) uint64_t a_ptr; + }; } cloudabi64_auxv_t; _Static_assert(offsetof(cloudabi64_auxv_t, a_type) == 0, "Incorrect layout"); _Static_assert(offsetof(cloudabi64_auxv_t, a_val) == 8, "Incorrect layout"); @@ -44,58 +44,68 @@ _Static_assert(sizeof(cloudabi64_auxv_t) _Static_assert(_Alignof(cloudabi64_auxv_t) == 8, "Incorrect layout"); typedef struct { - _Alignas(8) uint64_t iov_base; - _Alignas(8) uint64_t iov_len; + _Alignas(8) uint64_t iov_base; + _Alignas(8) uint64_t iov_len; } cloudabi64_ciovec_t; -_Static_assert(offsetof(cloudabi64_ciovec_t, iov_base) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_ciovec_t, iov_base) == 0, + "Incorrect layout"); _Static_assert(offsetof(cloudabi64_ciovec_t, iov_len) == 8, "Incorrect layout"); _Static_assert(sizeof(cloudabi64_ciovec_t) == 16, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_ciovec_t) == 8, "Incorrect layout"); typedef struct { - _Alignas(8) cloudabi_userdata_t userdata; - _Alignas(2) cloudabi_errno_t error; - _Alignas(1) cloudabi_eventtype_t type; - union { - struct { - _Alignas(8) cloudabi_userdata_t identifier; - } clock; - struct { - _Alignas(8) uint64_t condvar; - } condvar; - struct { - _Alignas(8) cloudabi_filesize_t nbytes; - _Alignas(4) cloudabi_fd_t fd; - _Alignas(2) cloudabi_eventrwflags_t flags; - } fd_readwrite; - struct { - _Alignas(8) uint64_t lock; - } lock; - struct { - _Alignas(4) cloudabi_fd_t fd; - _Alignas(1) cloudabi_signal_t signal; - _Alignas(4) cloudabi_exitcode_t exitcode; - } proc_terminate; - }; + _Alignas(8) cloudabi_userdata_t userdata; + _Alignas(2) cloudabi_errno_t error; + _Alignas(1) cloudabi_eventtype_t type; + union { + struct { + _Alignas(8) cloudabi_userdata_t identifier; + } clock; + struct { + _Alignas(8) uint64_t condvar; + } condvar; + struct { + _Alignas(8) cloudabi_filesize_t nbytes; + _Alignas(4) cloudabi_fd_t fd; + _Alignas(2) cloudabi_eventrwflags_t flags; + } fd_readwrite; + struct { + _Alignas(8) uint64_t lock; + } lock; + struct { + _Alignas(4) cloudabi_fd_t fd; + _Alignas(1) cloudabi_signal_t signal; + _Alignas(4) cloudabi_exitcode_t exitcode; + } proc_terminate; + }; } cloudabi64_event_t; _Static_assert(offsetof(cloudabi64_event_t, userdata) == 0, "Incorrect layout"); _Static_assert(offsetof(cloudabi64_event_t, error) == 8, "Incorrect layout"); _Static_assert(offsetof(cloudabi64_event_t, type) == 10, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, clock.identifier) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, condvar.condvar) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.nbytes) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.fd) == 24, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.flags) == 28, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, lock.lock) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.fd) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.signal) == 20, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.exitcode) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, clock.identifier) == 16, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, condvar.condvar) == 16, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.nbytes) == 16, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.fd) == 24, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.flags) == 28, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, lock.lock) == 16, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.fd) == 16, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.signal) == 20, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.exitcode) == 24, + "Incorrect layout"); _Static_assert(sizeof(cloudabi64_event_t) == 32, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_event_t) == 8, "Incorrect layout"); typedef struct { - _Alignas(8) uint64_t iov_base; - _Alignas(8) uint64_t iov_len; + _Alignas(8) uint64_t iov_base; + _Alignas(8) uint64_t iov_len; } cloudabi64_iovec_t; _Static_assert(offsetof(cloudabi64_iovec_t, iov_base) == 0, "Incorrect layout"); _Static_assert(offsetof(cloudabi64_iovec_t, iov_len) == 8, "Incorrect layout"); @@ -105,96 +115,120 @@ _Static_assert(_Alignof(cloudabi64_iovec typedef void cloudabi64_processentry_t(uint64_t auxv); typedef struct { - _Alignas(8) uint64_t ri_data; - _Alignas(8) uint64_t ri_datalen; - _Alignas(8) uint64_t ri_fds; - _Alignas(8) uint64_t ri_fdslen; - _Alignas(2) cloudabi_msgflags_t ri_flags; + _Alignas(8) uint64_t ri_data; + _Alignas(8) uint64_t ri_datalen; + _Alignas(8) uint64_t ri_fds; + _Alignas(8) uint64_t ri_fdslen; + _Alignas(2) cloudabi_msgflags_t ri_flags; } cloudabi64_recv_in_t; -_Static_assert(offsetof(cloudabi64_recv_in_t, ri_data) == 0, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_in_t, ri_datalen) == 8, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fds) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fdslen) == 24, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_in_t, ri_flags) == 32, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_data) == 0, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_datalen) == 8, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fds) == 16, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fdslen) == 24, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_flags) == 32, + "Incorrect layout"); _Static_assert(sizeof(cloudabi64_recv_in_t) == 40, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_recv_in_t) == 8, "Incorrect layout"); typedef struct { - _Alignas(8) uint64_t si_data; - _Alignas(8) uint64_t si_datalen; - _Alignas(8) uint64_t si_fds; - _Alignas(8) uint64_t si_fdslen; - _Alignas(2) cloudabi_msgflags_t si_flags; + _Alignas(8) uint64_t si_data; + _Alignas(8) uint64_t si_datalen; + _Alignas(8) uint64_t si_fds; + _Alignas(8) uint64_t si_fdslen; + _Alignas(2) cloudabi_msgflags_t si_flags; } cloudabi64_send_in_t; -_Static_assert(offsetof(cloudabi64_send_in_t, si_data) == 0, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_send_in_t, si_datalen) == 8, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_send_in_t, si_fds) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_send_in_t, si_fdslen) == 24, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_send_in_t, si_flags) == 32, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_data) == 0, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_datalen) == 8, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_fds) == 16, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_fdslen) == 24, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_flags) == 32, + "Incorrect layout"); _Static_assert(sizeof(cloudabi64_send_in_t) == 40, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_send_in_t) == 8, "Incorrect layout"); -typedef struct { - _Alignas(8) uint64_t so_datalen; -} cloudabi64_send_out_t; -_Static_assert(offsetof(cloudabi64_send_out_t, so_datalen) == 0, "Incorrect layout"); +typedef struct { _Alignas(8) uint64_t so_datalen; } cloudabi64_send_out_t; +_Static_assert(offsetof(cloudabi64_send_out_t, so_datalen) == 0, + "Incorrect layout"); _Static_assert(sizeof(cloudabi64_send_out_t) == 8, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_send_out_t) == 8, "Incorrect layout"); typedef struct { - _Alignas(8) cloudabi_userdata_t userdata; - _Alignas(2) cloudabi_subflags_t flags; - _Alignas(1) cloudabi_eventtype_t type; - union { - struct { - _Alignas(8) cloudabi_userdata_t identifier; - _Alignas(4) cloudabi_clockid_t clock_id; - _Alignas(8) cloudabi_timestamp_t timeout; - _Alignas(8) cloudabi_timestamp_t precision; - _Alignas(2) cloudabi_subclockflags_t flags; - } clock; - struct { - _Alignas(8) uint64_t condvar; - _Alignas(8) uint64_t lock; - _Alignas(1) cloudabi_scope_t condvar_scope; - _Alignas(1) cloudabi_scope_t lock_scope; - } condvar; - struct { - _Alignas(4) cloudabi_fd_t fd; - _Alignas(2) cloudabi_subrwflags_t flags; - } fd_readwrite; - struct { - _Alignas(8) uint64_t lock; - _Alignas(1) cloudabi_scope_t lock_scope; - } lock; - struct { - _Alignas(4) cloudabi_fd_t fd; - } proc_terminate; - }; + _Alignas(8) cloudabi_userdata_t userdata; + _Alignas(2) cloudabi_subflags_t flags; + _Alignas(1) cloudabi_eventtype_t type; + union { + struct { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Aug 19 17:49:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96A9DBBFB75; Fri, 19 Aug 2016 17:49:50 +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 4A77F1207; Fri, 19 Aug 2016 17:49:50 +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 u7JHnnbR026335; Fri, 19 Aug 2016 17:49:49 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHnnlF026334; Fri, 19 Aug 2016 17:49:49 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608191749.u7JHnnlF026334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 17:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304479 - head/sys/dev/cxgbe/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 17:49:50 -0000 Author: jhb Date: Fri Aug 19 17:49:49 2016 New Revision: 304479 URL: https://svnweb.freebsd.org/changeset/base/304479 Log: Add structures for VF-specific adapter parameters. While here, mark which parameters are PF-specific and which are VF-specific. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7508 Modified: head/sys/dev/cxgbe/common/common.h Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Fri Aug 19 17:49:35 2016 (r304478) +++ head/sys/dev/cxgbe/common/common.h Fri Aug 19 17:49:49 2016 (r304479) @@ -280,12 +280,52 @@ struct chip_params { u16 mps_tcam_size; }; +/* VF-only parameters. */ + +/* + * Global Receive Side Scaling (RSS) parameters in host-native format. + */ +struct rss_params { + unsigned int mode; /* RSS mode */ + union { + struct { + u_int synmapen:1; /* SYN Map Enable */ + u_int syn4tupenipv6:1; /* enable hashing 4-tuple IPv6 SYNs */ + u_int syn2tupenipv6:1; /* enable hashing 2-tuple IPv6 SYNs */ + u_int syn4tupenipv4:1; /* enable hashing 4-tuple IPv4 SYNs */ + u_int syn2tupenipv4:1; /* enable hashing 2-tuple IPv4 SYNs */ + u_int ofdmapen:1; /* Offload Map Enable */ + u_int tnlmapen:1; /* Tunnel Map Enable */ + u_int tnlalllookup:1; /* Tunnel All Lookup */ + u_int hashtoeplitz:1; /* use Toeplitz hash */ + } basicvirtual; + } u; +}; + +/* + * Maximum resources provisioned for a PCI VF. + */ +struct vf_resources { + unsigned int nvi; /* N virtual interfaces */ + unsigned int neq; /* N egress Qs */ + unsigned int nethctrl; /* N egress ETH or CTRL Qs */ + unsigned int niqflint; /* N ingress Qs/w free list(s) & intr */ + unsigned int niq; /* N ingress Qs */ + unsigned int tc; /* PCI-E traffic class */ + unsigned int pmask; /* port access rights mask */ + unsigned int nexactf; /* N exact MPS filters */ + unsigned int r_caps; /* read capabilities */ + unsigned int wx_caps; /* write/execute capabilities */ +}; + struct adapter_params { struct sge_params sge; - struct tp_params tp; + struct tp_params tp; /* PF-only */ struct vpd_params vpd; struct pci_params pci; - struct devlog_params devlog; + struct devlog_params devlog; /* PF-only */ + struct rss_params rss; /* VF-only */ + struct vf_resources vfres; /* VF-only */ unsigned int sf_size; /* serial flash size in bytes */ unsigned int sf_nsec; /* # of flash sectors */ From owner-svn-src-head@freebsd.org Fri Aug 19 17:51:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B54EEBBFD34; Fri, 19 Aug 2016 17:51:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B801170A; Fri, 19 Aug 2016 17:51:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JHprVA029286; Fri, 19 Aug 2016 17:51:53 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHpql3029285; Fri, 19 Aug 2016 17:51:52 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608191751.u7JHpql3029285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 19 Aug 2016 17:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304481 - head/sys/contrib/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 17:51:54 -0000 Author: ed Date: Fri Aug 19 17:51:52 2016 New Revision: 304481 URL: https://svnweb.freebsd.org/changeset/base/304481 Log: Add missing SVN keywords keyword. Modified: Directory Properties: head/sys/contrib/cloudabi/syscalls64.master (props changed) From owner-svn-src-head@freebsd.org Fri Aug 19 17:52:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57D7FBBFD9C; Fri, 19 Aug 2016 17:52:50 +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 0B3C61940; Fri, 19 Aug 2016 17:52:49 +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 u7JHqnbn030010; Fri, 19 Aug 2016 17:52:49 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHqnKs030009; Fri, 19 Aug 2016 17:52:49 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608191752.u7JHqnKs030009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 17:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304482 - head/sys/dev/cxgbe/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 17:52:50 -0000 Author: jhb Date: Fri Aug 19 17:52:48 2016 New Revision: 304482 URL: https://svnweb.freebsd.org/changeset/base/304482 Log: Adjust t4_port_init() to work with VF devices. Specifically, the FW_PORT_CMD may or may not work for a VF (the PF driver can choose whether or not to permit access to this command), so don't attempt to fetch port information on a VF if permission is denied by the PF. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7511 Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Fri Aug 19 17:51:52 2016 (r304481) +++ head/sys/dev/cxgbe/common/t4_hw.c Fri Aug 19 17:52:48 2016 (r304482) @@ -7938,15 +7938,26 @@ int t4_port_init(struct adapter *adap, i } while ((adap->params.portvec & (1 << j)) == 0); } - c.op_to_portid = htonl(V_FW_CMD_OP(FW_PORT_CMD) | - F_FW_CMD_REQUEST | F_FW_CMD_READ | - V_FW_PORT_CMD_PORTID(j)); - c.action_to_len16 = htonl( - V_FW_PORT_CMD_ACTION(FW_PORT_ACTION_GET_PORT_INFO) | - FW_LEN16(c)); - ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); - if (ret) - return ret; + if (!(adap->flags & IS_VF) || + adap->params.vfres.r_caps & FW_CMD_CAP_PORT) { + c.op_to_portid = htonl(V_FW_CMD_OP(FW_PORT_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_READ | + V_FW_PORT_CMD_PORTID(j)); + c.action_to_len16 = htonl( + V_FW_PORT_CMD_ACTION(FW_PORT_ACTION_GET_PORT_INFO) | + FW_LEN16(c)); + ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); + if (ret) + return ret; + + ret = be32_to_cpu(c.u.info.lstatus_to_modtype); + p->mdio_addr = (ret & F_FW_PORT_CMD_MDIOCAP) ? + G_FW_PORT_CMD_MDIOADDR(ret) : -1; + p->port_type = G_FW_PORT_CMD_PTYPE(ret); + p->mod_type = G_FW_PORT_CMD_MODTYPE(ret); + + init_link_config(&p->link_cfg, be16_to_cpu(c.u.info.pcap)); + } ret = t4_alloc_vi(adap, mbox, j, pf, vf, 1, addr, &rss_size); if (ret < 0) @@ -7959,14 +7970,6 @@ int t4_port_init(struct adapter *adap, i p->vi[0].rss_size = rss_size; t4_os_set_hw_addr(adap, p->port_id, addr); - ret = be32_to_cpu(c.u.info.lstatus_to_modtype); - p->mdio_addr = (ret & F_FW_PORT_CMD_MDIOCAP) ? - G_FW_PORT_CMD_MDIOADDR(ret) : -1; - p->port_type = G_FW_PORT_CMD_PTYPE(ret); - p->mod_type = G_FW_PORT_CMD_MODTYPE(ret); - - init_link_config(&p->link_cfg, be16_to_cpu(c.u.info.pcap)); - param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_RSSINFO) | V_FW_PARAMS_PARAM_YZ(p->vi[0].viid); From owner-svn-src-head@freebsd.org Fri Aug 19 17:53:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 760BFBBFDFC; Fri, 19 Aug 2016 17:53:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F53E1B0D; Fri, 19 Aug 2016 17:53:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JHrb0h030083; Fri, 19 Aug 2016 17:53:37 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHrbGY030082; Fri, 19 Aug 2016 17:53:37 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608191753.u7JHrbGY030082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 19 Aug 2016 17:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304483 - head/sys/contrib/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 17:53:38 -0000 Author: ed Date: Fri Aug 19 17:53:37 2016 New Revision: 304483 URL: https://svnweb.freebsd.org/changeset/base/304483 Log: Use the proper value for svn:keywords. Pointy hat to: me Modified: Directory Properties: head/sys/contrib/cloudabi/syscalls64.master (props changed) From owner-svn-src-head@freebsd.org Fri Aug 19 17:54:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F8E7BBFE4F; Fri, 19 Aug 2016 17:54:08 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05EC11C9C; Fri, 19 Aug 2016 17:54:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JHs7KS030156; Fri, 19 Aug 2016 17:54:07 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHs6DW030152; Fri, 19 Aug 2016 17:54:06 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608191754.u7JHs6DW030152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 19 Aug 2016 17:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304484 - head/sys/compat/cloudabi64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 17:54:08 -0000 Author: ed Date: Fri Aug 19 17:54:06 2016 New Revision: 304484 URL: https://svnweb.freebsd.org/changeset/base/304484 Log: Regenerate system call table after r304483. Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h head/sys/compat/cloudabi64/cloudabi64_syscall.h head/sys/compat/cloudabi64/cloudabi64_syscalls.c head/sys/compat/cloudabi64/cloudabi64_sysent.c Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_proto.h Fri Aug 19 17:53:37 2016 (r304483) +++ head/sys/compat/cloudabi64/cloudabi64_proto.h Fri Aug 19 17:54:06 2016 (r304484) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed */ #ifndef _CLOUDABI64_SYSPROTO_H_ Modified: head/sys/compat/cloudabi64/cloudabi64_syscall.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscall.h Fri Aug 19 17:53:37 2016 (r304483) +++ head/sys/compat/cloudabi64/cloudabi64_syscall.h Fri Aug 19 17:54:06 2016 (r304484) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed */ #define CLOUDABI64_SYS_cloudabi_sys_clock_res_get 0 Modified: head/sys/compat/cloudabi64/cloudabi64_syscalls.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscalls.c Fri Aug 19 17:53:37 2016 (r304483) +++ head/sys/compat/cloudabi64/cloudabi64_syscalls.c Fri Aug 19 17:54:06 2016 (r304484) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed */ const char *cloudabi64_syscallnames[] = { Modified: head/sys/compat/cloudabi64/cloudabi64_sysent.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sysent.c Fri Aug 19 17:53:37 2016 (r304483) +++ head/sys/compat/cloudabi64/cloudabi64_sysent.c Fri Aug 19 17:54:06 2016 (r304484) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed */ #include From owner-svn-src-head@freebsd.org Fri Aug 19 17:54:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 562F8BBFEAB; Fri, 19 Aug 2016 17:54:52 +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 2E0091E02; Fri, 19 Aug 2016 17:54:52 +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 u7JHspvV030229; Fri, 19 Aug 2016 17:54:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHspnD030228; Fri, 19 Aug 2016 17:54:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608191754.u7JHspnD030228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 17:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304485 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 17:54:52 -0000 Author: jhb Date: Fri Aug 19 17:54:51 2016 New Revision: 304485 URL: https://svnweb.freebsd.org/changeset/base/304485 Log: Reorder sysctls so that nodes shared with the VF driver are added first. This permits a single early return for VF devices in the routines that add sysctl nodes. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7512 Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Aug 19 17:54:06 2016 (r304484) +++ head/sys/dev/cxgbe/t4_main.c Fri Aug 19 17:54:51 2016 (r304485) @@ -4592,6 +4592,32 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nports", CTLFLAG_RD, NULL, sc->params.nports, "# of ports"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "doorbells", + CTLTYPE_STRING | CTLFLAG_RD, doorbells, sc->doorbells, + sysctl_bitfield, "A", "available doorbells"); + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_clock", CTLFLAG_RD, NULL, + sc->params.vpd.cclk, "core clock frequency (in KHz)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_timers", + CTLTYPE_STRING | CTLFLAG_RD, sc->params.sge.timer_val, + sizeof(sc->params.sge.timer_val), sysctl_int_array, "A", + "interrupt holdoff timer values (us)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pkt_counts", + CTLTYPE_STRING | CTLFLAG_RD, sc->params.sge.counter_val, + sizeof(sc->params.sge.counter_val), sysctl_int_array, "A", + "interrupt holdoff packet counter values"); + + t4_sge_sysctls(sc, ctx, children); + + sc->lro_timeout = 100; + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lro_timeout", CTLFLAG_RW, + &sc->lro_timeout, 0, "lro inactive-flush timeout (in us)"); + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "debug_flags", CTLFLAG_RW, + &sc->debug_flags, 0, "flags to enable runtime debugging"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "hw_revision", CTLFLAG_RD, NULL, chip_rev(sc), "chip hardware revision"); @@ -4612,10 +4638,6 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "cfcsum", CTLFLAG_RD, NULL, sc->cfcsum, "config file checksum"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "doorbells", - CTLTYPE_STRING | CTLFLAG_RD, doorbells, sc->doorbells, - sysctl_bitfield, "A", "available doorbells"); - #define SYSCTL_CAP(name, n, text) \ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, #name, \ CTLTYPE_STRING | CTLFLAG_RD, caps_decoder[n], sc->name, \ @@ -4632,19 +4654,6 @@ t4_sysctls(struct adapter *sc) SYSCTL_CAP(fcoecaps, 8, "FCoE"); #undef SYSCTL_CAP - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_clock", CTLFLAG_RD, NULL, - sc->params.vpd.cclk, "core clock frequency (in KHz)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_timers", - CTLTYPE_STRING | CTLFLAG_RD, sc->params.sge.timer_val, - sizeof(sc->params.sge.timer_val), sysctl_int_array, "A", - "interrupt holdoff timer values (us)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pkt_counts", - CTLTYPE_STRING | CTLFLAG_RD, sc->params.sge.counter_val, - sizeof(sc->params.sge.counter_val), sysctl_int_array, "A", - "interrupt holdoff packet counter values"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nfilters", CTLFLAG_RD, NULL, sc->tids.nftids, "number of filters"); @@ -4652,15 +4661,6 @@ t4_sysctls(struct adapter *sc) CTLFLAG_RD, sc, 0, sysctl_temperature, "I", "chip temperature (in Celsius)"); - t4_sge_sysctls(sc, ctx, children); - - sc->lro_timeout = 100; - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lro_timeout", CTLFLAG_RW, - &sc->lro_timeout, 0, "lro inactive-flush timeout (in us)"); - - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "debug_flags", CTLFLAG_RW, - &sc->debug_flags, 0, "flags to enable runtime debugging"); - #ifdef SBUF_DRAIN /* * dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload. From owner-svn-src-head@freebsd.org Fri Aug 19 17:57:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5FE1BBFF5A; Fri, 19 Aug 2016 17:57:15 +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 89298126A; Fri, 19 Aug 2016 17:57:15 +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 u7JHvELY030463; Fri, 19 Aug 2016 17:57:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHvEB2030460; Fri, 19 Aug 2016 17:57:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608191757.u7JHvEB2030460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Aug 2016 17:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304487 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 17:57:15 -0000 Author: markj Date: Fri Aug 19 17:57:14 2016 New Revision: 304487 URL: https://svnweb.freebsd.org/changeset/base/304487 Log: Don't set P2_PTRACE_FSTP in a process that invokes ptrace(PT_TRACE_ME). Such processes are stopped synchronously by a direct call to ptracestop(SIGTRAP) upon exec. P2_PTRACE_FSTP causes the exec()ing thread to suspend itself while waiting for a SIGSTOP that never arrives. Reviewed by: kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D7576 Modified: head/sys/kern/kern_fork.c head/sys/kern/sys_process.c head/sys/sys/proc.h Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Fri Aug 19 17:55:34 2016 (r304486) +++ head/sys/kern/kern_fork.c Fri Aug 19 17:57:14 2016 (r304487) @@ -1074,7 +1074,7 @@ fork_return(struct thread *td, struct tr * parent's children, do it now. */ dbg = p->p_pptr->p_pptr; - proc_set_traced(p); + proc_set_traced(p, true); CTR2(KTR_PTRACE, "fork_return: attaching to new child pid %d: oppid %d", p->p_pid, p->p_oppid); Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Fri Aug 19 17:55:34 2016 (r304486) +++ head/sys/kern/sys_process.c Fri Aug 19 17:57:14 2016 (r304487) @@ -693,12 +693,13 @@ sys_ptrace(struct thread *td, struct ptr #endif void -proc_set_traced(struct proc *p) +proc_set_traced(struct proc *p, bool stop) { PROC_LOCK_ASSERT(p, MA_OWNED); p->p_flag |= P_TRACED; - p->p_flag2 |= P2_PTRACE_FSTP; + if (stop) + p->p_flag2 |= P2_PTRACE_FSTP; p->p_ptevents = PTRACE_DEFAULT; p->p_oppid = p->p_pptr->p_pid; } @@ -910,7 +911,7 @@ kern_ptrace(struct thread *td, int req, switch (req) { case PT_TRACE_ME: /* set my trace flag and "owner" so it can read/write me */ - proc_set_traced(p); + proc_set_traced(p, false); if (p->p_flag & P_PPWAIT) p->p_flag |= P_PPTRACE; CTR1(KTR_PTRACE, "PT_TRACE_ME: pid %d", p->p_pid); @@ -927,7 +928,7 @@ kern_ptrace(struct thread *td, int req, * The old parent is remembered so we can put things back * on a "detach". */ - proc_set_traced(p); + proc_set_traced(p, true); if (p->p_pptr != td->td_proc) { proc_reparent(p, td->td_proc); } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Fri Aug 19 17:55:34 2016 (r304486) +++ head/sys/sys/proc.h Fri Aug 19 17:57:14 2016 (r304487) @@ -1010,7 +1010,7 @@ void proc_linkup(struct proc *p, struct struct proc *proc_realparent(struct proc *child); void proc_reap(struct thread *td, struct proc *p, int *status, int options); void proc_reparent(struct proc *child, struct proc *newparent); -void proc_set_traced(struct proc *p); +void proc_set_traced(struct proc *p, bool stop); struct pstats *pstats_alloc(void); void pstats_fork(struct pstats *src, struct pstats *dst); void pstats_free(struct pstats *ps); From owner-svn-src-head@freebsd.org Fri Aug 19 18:02:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5977BBC013C; Fri, 19 Aug 2016 18:02:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 283BF17E9; Fri, 19 Aug 2016 18:02:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JI2aF3033951; Fri, 19 Aug 2016 18:02:36 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JI2ana033950; Fri, 19 Aug 2016 18:02:36 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608191802.u7JI2ana033950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Aug 2016 18:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304488 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 18:02:37 -0000 Author: manu Date: Fri Aug 19 18:02:36 2016 New Revision: 304488 URL: https://svnweb.freebsd.org/changeset/base/304488 Log: Keep boot parameters in ARM trampoline code Currently boot parameters (r0 - r3) are forgotten in ARM trampoline code. This patch save them at startup and restore them before jumping into kernel _start() routine. This is usefull when booting with Linux ABI and/or custom bootloader. Submitted by: Grégory Soutadé Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D7395 Modified: head/sys/arm/arm/elf_trampoline.c Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Fri Aug 19 17:57:14 2016 (r304487) +++ head/sys/arm/arm/elf_trampoline.c Fri Aug 19 18:02:36 2016 (r304488) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include extern char kernel_start[]; extern char kernel_end[]; @@ -47,7 +48,7 @@ extern void *_end; void _start(void); void __start(void); -void __startC(void); +void __startC(unsigned r0, unsigned r1, unsigned r2, unsigned r3); extern unsigned int cpu_ident(void); extern void armv6_idcache_wbinv_all(void); @@ -124,6 +125,10 @@ static int arm_dcache_l2_nsets; static int arm_dcache_l2_assoc; static int arm_dcache_l2_linesize; +/* + * Boot parameters + */ +static struct arm_boot_params s_boot_params; extern int arm9_dcache_sets_inc; extern int arm9_dcache_sets_max; @@ -172,12 +177,17 @@ bzero(void *addr, int count) static void arm9_setup(void); void -_startC(void) +_startC(unsigned r0, unsigned r1, unsigned r2, unsigned r3) { int tmp1; unsigned int sp = ((unsigned int)&_end & ~3) + 4; unsigned int pc, kernphysaddr; + s_boot_params.abp_r0 = r0; + s_boot_params.abp_r1 = r1; + s_boot_params.abp_r2 = r2; + s_boot_params.abp_r3 = r3; + /* * Figure out the physical address the kernel was loaded at. This * assumes the entry point (this code right here) is in the first page, @@ -211,8 +221,15 @@ _startC(void) /* Temporary set the sp and jump to the new location. */ __asm __volatile( "mov sp, %1\n" + "mov r0, %2\n" + "mov r1, %3\n" + "mov r2, %4\n" + "mov r3, %5\n" "mov pc, %0\n" - : : "r" (target_addr), "r" (tmp_sp)); + : : "r" (target_addr), "r" (tmp_sp), + "r" (s_boot_params.abp_r0), "r" (s_boot_params.abp_r1), + "r" (s_boot_params.abp_r2), "r" (s_boot_params.abp_r3), + : "r0", "r1", "r2", "r3"); } #endif @@ -487,6 +504,7 @@ load_kernel(unsigned int kstart, unsigne vm_offset_t lastaddr = 0; Elf_Addr ssym = 0; Elf_Dyn *dp; + struct arm_boot_params local_boot_params; eh = (Elf32_Ehdr *)kstart; ssym = 0; @@ -555,6 +573,12 @@ load_kernel(unsigned int kstart, unsigne if (!d) return ((void *)lastaddr); + /* + * Now the stack is fixed, copy boot params + * before it's overrided + */ + memcpy(&local_boot_params, &s_boot_params, sizeof(local_boot_params)); + j = eh->e_phnum; for (i = 0; i < j; i++) { volatile char c; @@ -604,7 +628,10 @@ load_kernel(unsigned int kstart, unsigne "mcr p15, 0, %0, c1, c0, 0\n" /* CP15_SCTLR(%0)*/ : "=r" (ssym)); /* Jump to the entry point. */ - ((void(*)(void))(entry_point - KERNVIRTADDR + curaddr))(); + ((void(*)(unsigned, unsigned, unsigned, unsigned)) + (entry_point - KERNVIRTADDR + curaddr)) + (local_boot_params.abp_r0, local_boot_params.abp_r1, + local_boot_params.abp_r2, local_boot_params.abp_r3); __asm __volatile(".globl func_end\n" "func_end:"); From owner-svn-src-head@freebsd.org Fri Aug 19 18:45:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E964BC0A2A; Fri, 19 Aug 2016 18:45:44 +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 CF9531887; Fri, 19 Aug 2016 18:45:43 +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 u7JIjgRn049224; Fri, 19 Aug 2016 18:45:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JIjgn5049223; Fri, 19 Aug 2016 18:45:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608191845.u7JIjgn5049223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 18:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304492 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 18:45:44 -0000 Author: jhb Date: Fri Aug 19 18:45:42 2016 New Revision: 304492 URL: https://svnweb.freebsd.org/changeset/base/304492 Log: Move cxgb and cxgbe down to the non-mii PCI NIC section. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Aug 19 18:40:47 2016 (r304491) +++ head/sys/conf/NOTES Fri Aug 19 18:45:42 2016 (r304492) @@ -2116,9 +2116,6 @@ device bce # Broadcom BCM5706/BCM5708 device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn -device cxgb # Chelsio T3 10 Gigabit Ethernet -device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware -device cxgbe # Chelsio T4 and T5 1GbE/10GbE/40GbE device dc # DEC/Intel 21143 and various workalikes device et # Agere ET1310 10/100/Gigabit Ethernet device fxp # Intel EtherExpress PRO/100B (82557, 82558) @@ -2149,6 +2146,9 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # PCI Ethernet NICs. +device cxgb # Chelsio T3 10 Gigabit Ethernet +device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware +device cxgbe # Chelsio T4 and T5 1GbE/10GbE/40GbE device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel Pro/1000 Gigabit Ethernet device igb # Intel Pro/1000 PCIE Gigabit Ethernet From owner-svn-src-head@freebsd.org Fri Aug 19 19:31:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2FD5BBF70D; Fri, 19 Aug 2016 19:31:56 +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 8FD7918CF; Fri, 19 Aug 2016 19:31:56 +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 u7JJVt0O067198; Fri, 19 Aug 2016 19:31:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JJVth8067193; Fri, 19 Aug 2016 19:31:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608191931.u7JJVth8067193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 19:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304498 - in head: . share/man/man4 sys/conf sys/dev/scd sys/modules sys/modules/scd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 19:31:56 -0000 Author: jhb Date: Fri Aug 19 19:31:55 2016 New Revision: 304498 URL: https://svnweb.freebsd.org/changeset/base/304498 Log: Remove the scd(4) driver for Sony CDU31/33 CD-ROM drives. This is a driver for a pre-ATAPI ISA CD-ROM adapter. The driver only uses PIO. Deleted: head/share/man/man4/scd.4 head/sys/dev/scd/ head/sys/modules/scd/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Aug 19 19:30:00 2016 (r304497) +++ head/ObsoleteFiles.inc Fri Aug 19 19:31:55 2016 (r304498) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160819: Remove scd(4) +OLD_FILES+=usr/share/man/man4/scd.4.gz # 20160815: Remove mcd(4) OLD_FILES+=usr/share/man/man4/mcd.4.gz # 20160703: POSIXify locales with variants Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Aug 19 19:30:00 2016 (r304497) +++ head/share/man/man4/Makefile Fri Aug 19 19:31:55 2016 (r304498) @@ -441,7 +441,6 @@ MAN= aac.4 \ sbp.4 \ sbp_targ.4 \ scc.4 \ - scd.4 \ sched_4bsd.4 \ sched_ule.4 \ screen.4 \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Aug 19 19:30:00 2016 (r304497) +++ head/sys/conf/NOTES Fri Aug 19 19:31:55 2016 (r304498) @@ -2411,15 +2411,10 @@ options SND_OLDSTEREO # # Miscellaneous hardware: # -# scd: Sony CD-ROM using proprietary (non-ATAPI) interface # bktr: Brooktree bt848/848a/849a/878/879 video capture and TV Tuner board # joy: joystick (including IO DATA PCJOY PC Card joystick) # cmx: OmniKey CardMan 4040 pccard smartcard reader -# for the Sony CDU31/33A CDROM -device scd -hint.scd.0.at="isa" -hint.scd.0.port="0x230" device joy # PnP aware, hints for non-PnP only hint.joy.0.at="isa" hint.joy.0.port="0x201" Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 19 19:30:00 2016 (r304497) +++ head/sys/conf/files Fri Aug 19 19:31:55 2016 (r304498) @@ -2506,8 +2506,6 @@ dev/scc/scc_core.c optional scc dev/scc/scc_dev_quicc.c optional scc quicc dev/scc/scc_dev_sab82532.c optional scc dev/scc/scc_dev_z8530.c optional scc -dev/scd/scd.c optional scd isa -dev/scd/scd_isa.c optional scd isa dev/sdhci/sdhci.c optional sdhci dev/sdhci/sdhci_if.m optional sdhci dev/sdhci/sdhci_pci.c optional sdhci pci Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Aug 19 19:30:00 2016 (r304497) +++ head/sys/modules/Makefile Fri Aug 19 19:31:55 2016 (r304498) @@ -322,7 +322,6 @@ SUBDIR= \ ${_safe} \ ${_sbni} \ scc \ - scd \ ${_scsi_low} \ sdhci \ sdhci_pci \ From owner-svn-src-head@freebsd.org Fri Aug 19 20:53:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37804BC0217; Fri, 19 Aug 2016 20:53:57 +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 E36721B36; Fri, 19 Aug 2016 20:53:56 +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 u7JKru6j098191; Fri, 19 Aug 2016 20:53:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JKru2K098190; Fri, 19 Aug 2016 20:53:56 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192053.u7JKru2K098190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 20:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304501 - head/tools/kerneldoc/subsys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 20:53:57 -0000 Author: jhb Date: Fri Aug 19 20:53:55 2016 New Revision: 304501 URL: https://svnweb.freebsd.org/changeset/base/304501 Log: Remove doxygen files for mcd(4) and scd(4) drivers. Submitted by: ak Deleted: head/tools/kerneldoc/subsys/Doxyfile-dev_mcd head/tools/kerneldoc/subsys/Doxyfile-dev_scd From owner-svn-src-head@freebsd.org Fri Aug 19 21:14:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F7E2BC0556; Fri, 19 Aug 2016 21:14:29 +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 2FAED1564; Fri, 19 Aug 2016 21:14:29 +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 u7JLESZW005669; Fri, 19 Aug 2016 21:14:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JLER34005659; Fri, 19 Aug 2016 21:14:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192114.u7JLER34005659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 21:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304502 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/si sys/i386/conf sys/modules sys/modules/si targets/pseudo/userland tools/kerneldoc/subsys usr.sbin usr.sbin/sicontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 21:14:29 -0000 Author: jhb Date: Fri Aug 19 21:14:27 2016 New Revision: 304502 URL: https://svnweb.freebsd.org/changeset/base/304502 Log: Remove the si(4) driver and sicontrol(8) for Specialix serial cards. The si(4) driver supported multiport serial adapters for ISA, EISA, and PCI buses. This driver does not use bus_space, instead it depends on direct use of the pointer returned by rman_get_virtual(). It is also still locked by Giant and calls for patch testing to convert it to use bus_space were unanswered. Relnotes: yes Deleted: head/share/man/man4/si.4 head/sys/dev/si/ head/sys/modules/si/ head/tools/kerneldoc/subsys/Doxyfile-dev_si head/usr.sbin/sicontrol/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/amd64/conf/NOTES head/sys/conf/files head/sys/i386/conf/NOTES head/sys/modules/Makefile head/targets/pseudo/userland/Makefile.depend head/usr.sbin/Makefile.amd64 head/usr.sbin/Makefile.i386 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Aug 19 20:53:55 2016 (r304501) +++ head/ObsoleteFiles.inc Fri Aug 19 21:14:27 2016 (r304502) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20160819: Remove si(4) and sicontrol(8) +OLD_FILES+=usr/share/man/man4/si.4.gz +OLD_FILES+=usr/sbin/sicontrol +OLD_FILES+=usr/share/man/man8/sicontrol.8.gz # 20160819: Remove scd(4) OLD_FILES+=usr/share/man/man4/scd.4.gz # 20160815: Remove mcd(4) Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Aug 19 20:53:55 2016 (r304501) +++ head/share/man/man4/Makefile Fri Aug 19 21:14:27 2016 (r304502) @@ -453,7 +453,6 @@ MAN= aac.4 \ sf.4 \ ${_sfxge.4} \ sge.4 \ - si.4 \ siba.4 \ siftr.4 \ siis.4 \ Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Fri Aug 19 20:53:55 2016 (r304501) +++ head/sys/amd64/conf/NOTES Fri Aug 19 21:14:27 2016 (r304502) @@ -542,7 +542,6 @@ hint.pbio.0.port="0x360" device smbios device vpd device asmc -device si device tpm device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 19 20:53:55 2016 (r304501) +++ head/sys/conf/files Fri Aug 19 21:14:27 2016 (r304502) @@ -2511,12 +2511,6 @@ dev/sdhci/sdhci_if.m optional sdhci dev/sdhci/sdhci_pci.c optional sdhci pci dev/sf/if_sf.c optional sf pci dev/sge/if_sge.c optional sge pci -dev/si/si.c optional si -dev/si/si2_z280.c optional si -dev/si/si3_t225.c optional si -dev/si/si_eisa.c optional si eisa -dev/si/si_isa.c optional si isa -dev/si/si_pci.c optional si pci dev/siba/siba_bwn.c optional siba_bwn pci dev/siba/siba_core.c optional siba_bwn pci dev/siis/siis.c optional siis pci Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Aug 19 20:53:55 2016 (r304501) +++ head/sys/i386/conf/NOTES Fri Aug 19 21:14:27 2016 (r304502) @@ -880,7 +880,6 @@ device spic hint.spic.0.at="isa" hint.spic.0.port="0x10a0" device asmc -device si device tpm device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Aug 19 20:53:55 2016 (r304501) +++ head/sys/modules/Makefile Fri Aug 19 21:14:27 2016 (r304502) @@ -330,7 +330,6 @@ SUBDIR= \ ${_sf} \ ${_sfxge} \ sge \ - ${_si} \ siba_bwn \ siftr \ siis \ @@ -584,7 +583,6 @@ _rdma= rdma .endif _safe= safe _scsi_low= scsi_low -_si= si _speaker= speaker _splash= splash _sppp= sppp Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Fri Aug 19 20:53:55 2016 (r304501) +++ head/targets/pseudo/userland/Makefile.depend Fri Aug 19 21:14:27 2016 (r304502) @@ -834,7 +834,6 @@ DIRDEPS.amd64= \ usr.sbin/lptcontrol \ usr.sbin/mptable \ usr.sbin/ndiscvt \ - usr.sbin/sicontrol \ usr.sbin/spkrtest \ usr.sbin/sade \ usr.sbin/zzz @@ -863,7 +862,6 @@ DIRDEPS.i386= \ usr.sbin/ndiscvt \ usr.sbin/pnpinfo \ usr.sbin/sade \ - usr.sbin/sicontrol \ usr.sbin/spkrtest \ usr.sbin/zzz \ usr.sbin/acpi \ Modified: head/usr.sbin/Makefile.amd64 ============================================================================== --- head/usr.sbin/Makefile.amd64 Fri Aug 19 20:53:55 2016 (r304501) +++ head/usr.sbin/Makefile.amd64 Fri Aug 19 21:14:27 2016 (r304502) @@ -29,6 +29,5 @@ SUBDIR+= mptable .if ${MK_NDIS} != "no" SUBDIR+= ndiscvt .endif -SUBDIR+= sicontrol SUBDIR+= spkrtest SUBDIR+= zzz Modified: head/usr.sbin/Makefile.i386 ============================================================================== --- head/usr.sbin/Makefile.i386 Fri Aug 19 20:53:55 2016 (r304501) +++ head/usr.sbin/Makefile.i386 Fri Aug 19 21:14:27 2016 (r304502) @@ -17,7 +17,6 @@ SUBDIR+= mptable SUBDIR+= ndiscvt .endif SUBDIR+= pnpinfo -SUBDIR+= sicontrol SUBDIR+= spkrtest SUBDIR+= zzz From owner-svn-src-head@freebsd.org Fri Aug 19 21:51:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55194BC0CBF; Fri, 19 Aug 2016 21:51:44 +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 1515719B9; Fri, 19 Aug 2016 21:51:44 +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 u7JLphxN017160; Fri, 19 Aug 2016 21:51:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JLpgk0017152; Fri, 19 Aug 2016 21:51:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192151.u7JLpgk0017152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 21:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304503 - in head: etc release/doc/en_US.ISO8859-1/hardware sys/conf sys/dev/wds sys/modules sys/modules/wds sys/pc98/conf sys/sparc64/conf tools/kerneldoc/subsys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 21:51:44 -0000 Author: jhb Date: Fri Aug 19 21:51:42 2016 New Revision: 304503 URL: https://svnweb.freebsd.org/changeset/base/304503 Log: Remove the wds(4) driver for the WD700 ISA SCSI HBA. While this driver does do DMA, it bounce buffers all transactions through a single 64k buffer. It also does not have a manpage. Relnotes: yes Deleted: head/sys/dev/wds/ head/sys/modules/wds/ head/tools/kerneldoc/subsys/Doxyfile-dev_wds Modified: head/etc/devd.conf head/release/doc/en_US.ISO8859-1/hardware/article.xml head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile head/sys/pc98/conf/NOTES head/sys/sparc64/conf/NOTES Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Fri Aug 19 21:14:27 2016 (r304502) +++ head/etc/devd.conf Fri Aug 19 21:51:42 2016 (r304503) @@ -20,7 +20,7 @@ options { #XXX Yes, these are gross -- imp set scsi-controller-regex "(aac|adv|adw|aha|ahb|ahc|ahd|aic|amd|amr|asr|bt|ciss|ct|dpt|\ - esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wds)\ + esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm)\ [0-9]+"; set wifi-driver-regex "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|ral|rsu|rum|run|uath|\ Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 21:14:27 2016 (r304502) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 21:51:42 2016 (r304503) @@ -751,9 +751,6 @@ &hwlist.vpo; - [&arch.i386;] The wds(4) driver supports the WD7000 SCSI - controller. - With all supported SCSI controllers, full support is provided for SCSI-I, SCSI-II, and SCSI-III peripherals, including hard disks, optical disks, tape drives (including Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Aug 19 21:14:27 2016 (r304502) +++ head/sys/conf/NOTES Fri Aug 19 21:51:42 2016 (r304503) @@ -1560,7 +1560,6 @@ options TERMINAL_KERN_ATTR=(FG_LIGHTRED # 53C876, 53C885, 53C895, 53C895A, 53C896, 53C897, 53C1510D, # 53C1010-33, 53C1010-66. # trm: Tekram DC395U/UW/F DC315U adapters. -# wds: WD7000 # # Note that the order is important in order for Buslogic ISA/EISA cards to be @@ -1602,11 +1601,6 @@ device mpt device ncr device sym device trm -device wds -hint.wds.0.at="isa" -hint.wds.0.port="0x350" -hint.wds.0.irq="11" -hint.wds.0.drq="6" # The aic7xxx driver will attempt to use memory mapped I/O for all PCI # controllers that have it configured only if this option is set. Unfortunately, Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 19 21:14:27 2016 (r304502) +++ head/sys/conf/files Fri Aug 19 21:51:42 2016 (r304503) @@ -2930,7 +2930,6 @@ dev/vxge/vxgehal/vxgehal-channel.c optio dev/vxge/vxgehal/vxgehal-fifo.c optional vxge dev/watchdog/watchdog.c standard dev/wb/if_wb.c optional wb pci -dev/wds/wd7000.c optional wds isa dev/wi/if_wi.c optional wi dev/wi/if_wi_pccard.c optional wi pccard dev/wi/if_wi_pci.c optional wi pci Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Aug 19 21:14:27 2016 (r304502) +++ head/sys/modules/Makefile Fri Aug 19 21:51:42 2016 (r304503) @@ -390,7 +390,6 @@ SUBDIR= \ ${_vxge} \ wb \ ${_wbwd} \ - ${_wds} \ ${_wi} \ ${_wl} \ wlan \ @@ -718,7 +717,6 @@ _sbni= sbni _streams= streams _stg= stg _svr4= svr4 -_wds= wds .if ${MACHINE} == "i386" .if ${MK_EISA} != "no" _ahb= ahb Modified: head/sys/pc98/conf/NOTES ============================================================================== --- head/sys/pc98/conf/NOTES Fri Aug 19 21:14:27 2016 (r304502) +++ head/sys/pc98/conf/NOTES Fri Aug 19 21:51:42 2016 (r304503) @@ -595,7 +595,6 @@ nodevice ahb nodevice ahd nodevice mpt nodevice trm -nodevice wds nodevice dpt nodevice ciss nodevice iir Modified: head/sys/sparc64/conf/NOTES ============================================================================== --- head/sys/sparc64/conf/NOTES Fri Aug 19 21:14:27 2016 (r304502) +++ head/sys/sparc64/conf/NOTES Fri Aug 19 21:51:42 2016 (r304503) @@ -121,7 +121,6 @@ nodevice snd_vibes nodevice snd_uaudio nodevice aha nodevice bt -nodevice wds nodevice ep nodevice ex From owner-svn-src-head@freebsd.org Fri Aug 19 22:05:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D534BBF08C; Fri, 19 Aug 2016 22:05:23 +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 5038B1302; Fri, 19 Aug 2016 22:05:23 +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 u7JM5MxN024403; Fri, 19 Aug 2016 22:05:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JM5MiR024402; Fri, 19 Aug 2016 22:05:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192205.u7JM5MiR024402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 22:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304504 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 22:05:23 -0000 Author: jhb Date: Fri Aug 19 22:05:22 2016 New Revision: 304504 URL: https://svnweb.freebsd.org/changeset/base/304504 Log: Remove stale drivers (amd(4) and asr(4)) from the SCSI controller regex. Modified: head/etc/devd.conf Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Fri Aug 19 21:51:42 2016 (r304503) +++ head/etc/devd.conf Fri Aug 19 22:05:22 2016 (r304504) @@ -19,7 +19,7 @@ options { # Setup some shorthand for regex that we use later in the file. #XXX Yes, these are gross -- imp set scsi-controller-regex - "(aac|adv|adw|aha|ahb|ahc|ahd|aic|amd|amr|asr|bt|ciss|ct|dpt|\ + "(aac|adv|adw|aha|ahb|ahc|ahd|aic|amr|bt|ciss|ct|dpt|\ esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm)\ [0-9]+"; set wifi-driver-regex From owner-svn-src-head@freebsd.org Fri Aug 19 22:13:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78954BBF2B2; Fri, 19 Aug 2016 22:13:02 +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 45AF518B3; Fri, 19 Aug 2016 22:13:02 +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 u7JMD1nZ028153; Fri, 19 Aug 2016 22:13:01 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JMD12W028152; Fri, 19 Aug 2016 22:13:01 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192213.u7JMD12W028152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 22:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304505 - head/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 22:13:02 -0000 Author: jhb Date: Fri Aug 19 22:13:01 2016 New Revision: 304505 URL: https://svnweb.freebsd.org/changeset/base/304505 Log: Remove mentions of the mcd(4), scd(4), and si(4) drivers. Relnotes: yes Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 22:05:22 2016 (r304504) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 22:13:01 2016 (r304505) @@ -772,23 +772,9 @@ - [&arch.i386;] Sony proprietary interface (all models) - (&man.scd.4;) - - - ATAPI IDE interface (&man.acd.4;) - - [&arch.i386;] The following device is unmaintained: - - - - Mitsumi proprietary CD-ROM interface (all models) - (&man.mcd.4;) - - @@ -1235,13 +1221,6 @@ &hwlist.rc; - [&arch.i386;, &arch.amd64;] Specialix SI/XIO/SX multiport - serial cards, with both the older SIHOST2.x and the - enhanced (transputer based, aka JET) host cards - (ISA, EISA and PCI) are supported. Note that the newer SX+ - PCI cards are not currently supported. (&man.si.4; - driver) - [&arch.pc98;] Internel serial interfaces (&man.sio.4; driver) From owner-svn-src-head@freebsd.org Fri Aug 19 22:27:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7444BBF8C2; Fri, 19 Aug 2016 22:27:16 +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 A286D14D2; Fri, 19 Aug 2016 22:27:16 +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 u7JMRFfo032694; Fri, 19 Aug 2016 22:27:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JMREIo032684; Fri, 19 Aug 2016 22:27:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192227.u7JMREIo032684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 22:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304506 - in head: . release/doc/en_US.ISO8859-1/hardware share/man/man4/man4.i386 sys/conf sys/dev/wl sys/i386/conf sys/modules sys/modules/wl targets/pseudo/userland tools/build/mk to... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 22:27:16 -0000 Author: jhb Date: Fri Aug 19 22:27:14 2016 New Revision: 304506 URL: https://svnweb.freebsd.org/changeset/base/304506 Log: Remove the wl(4) driver and wlconfig(8) utility. The wl(4) driver supports pre-802.11 PCCard wireless adapters that are slower than 802.11b. They do not work with any of the 802.11 framework and the driver hasn't been reported to actually work in a long time. Relnotes: yes Deleted: head/share/man/man4/man4.i386/wl.4 head/sys/dev/wl/ head/sys/modules/wl/ head/tools/kerneldoc/subsys/Doxyfile-dev_wl head/usr.sbin/wlconfig/ Modified: head/ObsoleteFiles.inc head/release/doc/en_US.ISO8859-1/hardware/article.xml head/share/man/man4/man4.i386/Makefile head/sys/conf/files head/sys/conf/options head/sys/i386/conf/NOTES head/sys/modules/Makefile head/targets/pseudo/userland/Makefile.depend head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/Makefile.i386 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Aug 19 22:13:01 2016 (r304505) +++ head/ObsoleteFiles.inc Fri Aug 19 22:27:14 2016 (r304506) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20160819: Remove wl(4) and wlconfig(8) +OLD_FILES+=usr/share/man/man4/i386/wl.4.gz +OLD_FILES+=usr/sbin/wlconfig +OLD_FILES+=usr/share/man/man8/i386/wlconfig.8.gz # 20160819: Remove si(4) and sicontrol(8) OLD_FILES+=usr/share/man/man4/si.4.gz OLD_FILES+=usr/sbin/sicontrol Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 22:13:01 2016 (r304505) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 22:27:14 2016 (r304506) @@ -1023,9 +1023,6 @@ Intersil PRISM-2.5, Intersil Prism-3, and Symbol Spectrum24 chipsets (&man.wi.4; driver) - [&arch.i386;] NCR / AT&T / Lucent Technologies WaveLan - T1-speed ISA/radio LAN cards (&man.wl.4; driver) - [&arch.i386;, &arch.amd64;] Intel PRO/Wireless 3945ABG MiniPCI network adapters (&man.wpi.4; driver) Modified: head/share/man/man4/man4.i386/Makefile ============================================================================== --- head/share/man/man4/man4.i386/Makefile Fri Aug 19 22:13:01 2016 (r304505) +++ head/share/man/man4/man4.i386/Makefile Fri Aug 19 22:27:14 2016 (r304506) @@ -31,8 +31,7 @@ MAN= aic.4 \ streams.4 \ svr4.4 \ vpd.4 \ - vx.4 \ - wl.4 + vx.4 MLINKS= CPU_ELAN.4 CPU_SOEKRIS.4 MLINKS+=pae.4 PAE.4 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 19 22:13:01 2016 (r304505) +++ head/sys/conf/files Fri Aug 19 22:27:14 2016 (r304506) @@ -2933,7 +2933,6 @@ dev/wb/if_wb.c optional wb pci dev/wi/if_wi.c optional wi dev/wi/if_wi_pccard.c optional wi pccard dev/wi/if_wi_pci.c optional wi pci -dev/wl/if_wl.c optional wl isa dev/wpi/if_wpi.c optional wpi pci wpifw.c optional wpifw \ compile-with "${AWK} -f $S/tools/fw_stub.awk wpi.fw:wpifw:153229 -mwpi -c${.TARGET}" \ Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Aug 19 22:13:01 2016 (r304505) +++ head/sys/conf/options Fri Aug 19 22:27:14 2016 (r304506) @@ -218,8 +218,6 @@ SW_WATCHDOG opt_watchdog.h TURNSTILE_PROFILING UMTX_PROFILING VERBOSE_SYSINIT -WLCACHE opt_wavelan.h -WLDEBUG opt_wavelan.h # POSIX kernel options P1003_1B_MQUEUE opt_posix.h Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Aug 19 22:13:01 2016 (r304505) +++ head/sys/i386/conf/NOTES Fri Aug 19 22:27:14 2016 (r304506) @@ -648,11 +648,6 @@ hint.sbni.0.port="0x210" hint.sbni.0.irq="0xefdead" hint.sbni.0.flags="0" device vmx # VMware VMXNET3 Ethernet -device wl -hint.wl.0.at="isa" -hint.wl.0.port="0x300" -options WLCACHE # enables the signal-strength cache -options WLDEBUG # enables verbose debugging output device wpi # Intel 3945ABG wireless NICs. # IEEE 802.11 adapter firmware modules Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Aug 19 22:13:01 2016 (r304505) +++ head/sys/modules/Makefile Fri Aug 19 22:27:14 2016 (r304506) @@ -391,7 +391,6 @@ SUBDIR= \ wb \ ${_wbwd} \ ${_wi} \ - ${_wl} \ wlan \ wlan_acl \ wlan_amrr \ @@ -728,7 +727,6 @@ _ctau= ctau .endif _dpt= dpt _ex= ex -_wl= wl .elif ${MACHINE} == "pc98" _canbepm= canbepm _canbus= canbus Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Fri Aug 19 22:13:01 2016 (r304505) +++ head/targets/pseudo/userland/Makefile.depend Fri Aug 19 22:27:14 2016 (r304506) @@ -865,8 +865,7 @@ DIRDEPS.i386= \ usr.sbin/spkrtest \ usr.sbin/zzz \ usr.sbin/acpi \ - usr.sbin/boot0cfg \ - usr.sbin/wlconfig + usr.sbin/boot0cfg DIRDEPS.arm64= \ usr.sbin/acpi \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Aug 19 22:13:01 2016 (r304505) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Aug 19 22:27:14 2016 (r304506) @@ -8744,9 +8744,6 @@ OLD_FILES+=usr/sbin/hostapd OLD_FILES+=usr/sbin/hostapd_cli OLD_FILES+=usr/sbin/ndis_events OLD_FILES+=usr/sbin/wlandebug -.if ${TARGET_ARCH} == "i386" -OLD_FILES+=usr/sbin/wlconfig -.endif OLD_FILES+=usr/sbin/wpa_cli OLD_FILES+=usr/sbin/wpa_passphrase OLD_FILES+=usr/sbin/wpa_supplicant @@ -8761,9 +8758,6 @@ OLD_FILES+=usr/share/man/man5/wpa_suppli OLD_FILES+=usr/share/man/man8/ancontrol.8.gz OLD_FILES+=usr/share/man/man8/hostapd.8.gz OLD_FILES+=usr/share/man/man8/hostapd_cli.8.gz -.if ${TARGET_ARCH} == "i386" -OLD_FILES+=usr/share/man/man8/i386/wlconfig.8.gz -.endif OLD_FILES+=usr/share/man/man8/ndis_events.8.gz OLD_FILES+=usr/share/man/man8/wlandebug.8.gz OLD_FILES+=usr/share/man/man8/wpa_cli.8.gz Modified: head/usr.sbin/Makefile.i386 ============================================================================== --- head/usr.sbin/Makefile.i386 Fri Aug 19 22:13:01 2016 (r304505) +++ head/usr.sbin/Makefile.i386 Fri Aug 19 22:27:14 2016 (r304506) @@ -29,9 +29,6 @@ SUBDIR+= boot0cfg .if ${MK_HYPERV} != "no" SUBDIR+= hyperv .endif -.if ${MK_WIRELESS} != "no" -SUBDIR+= wlconfig -.endif .elif ${MACHINE} == "pc98" SUBDIR+= boot98cfg .endif From owner-svn-src-head@freebsd.org Fri Aug 19 23:39:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BC01BC07C2; Fri, 19 Aug 2016 23:39:09 +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 4FFD017F0; Fri, 19 Aug 2016 23:39:09 +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 u7JNd80c058628; Fri, 19 Aug 2016 23:39:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JNd8Yg058624; Fri, 19 Aug 2016 23:39:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192339.u7JNd8Yg058624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 23:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304508 - in head: . share/man/man4 sys/conf sys/i386/conf sys/i386/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 23:39:09 -0000 Author: jhb Date: Fri Aug 19 23:39:08 2016 New Revision: 304508 URL: https://svnweb.freebsd.org/changeset/base/304508 Log: Remove the spic(4) driver for the Sony Vaoi Jogdial. This hardware is not present on any modern systems. The driver is quite hackish (raw inb/outb instead of bus_space, and raw inb/outb to random I/O ports to enable ACPI since it predated proper ACPI support). Relnotes: yes Deleted: head/share/man/man4/spic.4 head/sys/i386/isa/spic.c head/sys/i386/isa/spicreg.h Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/conf/files.i386 head/sys/i386/conf/NOTES Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Aug 19 23:31:56 2016 (r304507) +++ head/ObsoleteFiles.inc Fri Aug 19 23:39:08 2016 (r304508) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160819: Remove spic(4) +OLD_FILES+=usr/share/man/man4/spic.4.gz # 20160819: Remove wl(4) and wlconfig(8) OLD_FILES+=usr/share/man/man4/i386/wl.4.gz OLD_FILES+=usr/sbin/wlconfig Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Aug 19 23:31:56 2016 (r304507) +++ head/share/man/man4/Makefile Fri Aug 19 23:39:08 2016 (r304508) @@ -496,7 +496,6 @@ MAN= aac.4 \ snd_via82c686.4 \ snd_vibes.4 \ snp.4 \ - spic.4 \ ${_spkr.4} \ splash.4 \ sppp.4 \ Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri Aug 19 23:31:56 2016 (r304507) +++ head/sys/conf/files.i386 Fri Aug 19 23:39:08 2016 (r304508) @@ -516,7 +516,6 @@ i386/isa/elink.c optional ep | ie i386/isa/npx.c optional npx i386/isa/pmtimer.c optional pmtimer i386/isa/prof_machdep.c optional profiling-routine -i386/isa/spic.c optional spic i386/linux/imgact_linux.c optional compat_linux i386/linux/linux_dummy.c optional compat_linux i386/linux/linux_machdep.c optional compat_linux Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Aug 19 23:31:56 2016 (r304507) +++ head/sys/i386/conf/NOTES Fri Aug 19 23:39:08 2016 (r304508) @@ -834,7 +834,6 @@ device hyperv # HyperV drivers # vpd: Vital Product Data kernel interface # pmtimer: Adjust system timer at wakeup time # pbio: Parallel (8255 PPI) basic I/O (mode 0) port (e.g. Advantech PCL-724) -# spic: Sony Programmable I/O controller (VAIO notebooks) # asmc: Apple System Management Controller # si: Specialix International SI/XIO or SX intelligent serial card driver # tpm: Trusted Platform Module @@ -871,9 +870,6 @@ device pmtimer device pbio hint.pbio.0.at="isa" hint.pbio.0.port="0x360" -device spic -hint.spic.0.at="isa" -hint.spic.0.port="0x10a0" device asmc device tpm device padlock_rng # VIA Padlock RNG From owner-svn-src-head@freebsd.org Fri Aug 19 23:44:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE2BCBC091C; Fri, 19 Aug 2016 23:44:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 755711C12; Fri, 19 Aug 2016 23:44:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JNi7CX062274; Fri, 19 Aug 2016 23:44:07 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JNi7db062273; Fri, 19 Aug 2016 23:44:07 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608192344.u7JNi7db062273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Aug 2016 23:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304509 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 19 Aug 2016 23:44:08 -0000 Author: manu Date: Fri Aug 19 23:44:07 2016 New Revision: 304509 URL: https://svnweb.freebsd.org/changeset/base/304509 Log: if_emac: Before generating a random MAC address, try using the SID rootkey to generate one. This is was U-Boot does to generate a random MAC so we end up with the same MAC address as if U-Boot did generate it. MFC after: 1 week Modified: head/sys/arm/allwinner/if_emac.c Modified: head/sys/arm/allwinner/if_emac.c ============================================================================== --- head/sys/arm/allwinner/if_emac.c Fri Aug 19 23:39:08 2016 (r304508) +++ head/sys/arm/allwinner/if_emac.c Fri Aug 19 23:44:07 2016 (r304509) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -167,12 +168,17 @@ static void emac_get_hwaddr(struct emac_softc *sc, uint8_t *hwaddr) { uint32_t val0, val1, rnd; + u_char rootkey[16]; /* * Try to get MAC address from running hardware. * If there is something non-zero there just use it. * * Otherwise set the address to a convenient locally assigned address, + * using the SID rootkey. + * This is was uboot does so we end up with the same mac as if uboot + * did set it. + * If we can't get the root key, generate a random one, * 'bsd' + random 24 low-order bits. 'b' is 0x62, which has the locally * assigned bit set, and the broadcast/multicast bit clear. */ @@ -186,13 +192,23 @@ emac_get_hwaddr(struct emac_softc *sc, u hwaddr[4] = (val0 >> 8) & 0xff; hwaddr[5] = (val0 >> 0) & 0xff; } else { - rnd = arc4random() & 0x00ffffff; - hwaddr[0] = 'b'; - hwaddr[1] = 's'; - hwaddr[2] = 'd'; - hwaddr[3] = (rnd >> 16) & 0xff; - hwaddr[4] = (rnd >> 8) & 0xff; - hwaddr[5] = (rnd >> 0) & 0xff; + if (aw_sid_get_rootkey(rootkey) == 0) { + hwaddr[0] = 0x2; + hwaddr[1] = rootkey[3]; + hwaddr[2] = rootkey[12]; + hwaddr[3] = rootkey[13]; + hwaddr[4] = rootkey[14]; + hwaddr[5] = rootkey[15]; + } + else { + rnd = arc4random() & 0x00ffffff; + hwaddr[0] = 'b'; + hwaddr[1] = 's'; + hwaddr[2] = 'd'; + hwaddr[3] = (rnd >> 16) & 0xff; + hwaddr[4] = (rnd >> 8) & 0xff; + hwaddr[5] = (rnd >> 0) & 0xff; + } } if (bootverbose) printf("MAC address: %s\n", ether_sprintf(hwaddr)); From owner-svn-src-head@freebsd.org Sat Aug 20 00:08:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BDA8BBE001; Sat, 20 Aug 2016 00:08:12 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD60E17A1; Sat, 20 Aug 2016 00:08:11 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7K08Bai069628; Sat, 20 Aug 2016 00:08:11 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K08Bok069627; Sat, 20 Aug 2016 00:08:11 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201608200008.u7K08Bok069627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Sat, 20 Aug 2016 00:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304510 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 00:08:12 -0000 Author: erj Date: Sat Aug 20 00:08:10 2016 New Revision: 304510 URL: https://svnweb.freebsd.org/changeset/base/304510 Log: ixlv(4): Fix ixlv(4) not loading when loaded as a kernel module and netmap is enabled. Define (unused) netmap variables; ixlv(4) doesn't support netmap yet. Reported by: sergey.kozlov@intel.com Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/if_ixlv.c Modified: head/sys/dev/ixl/if_ixlv.c ============================================================================== --- head/sys/dev/ixl/if_ixlv.c Fri Aug 19 23:44:07 2016 (r304509) +++ head/sys/dev/ixl/if_ixlv.c Sat Aug 20 00:08:10 2016 (r304510) @@ -217,6 +217,10 @@ TUNABLE_INT("hw.ixlv.tx_itr", &ixlv_tx_i SYSCTL_INT(_hw_ixlv, OID_AUTO, tx_itr, CTLFLAG_RDTUN, &ixlv_tx_itr, 0, "TX Interrupt Rate"); +/* Fix when building as a standalone module when netmap is enabled */ +#if defined(DEV_NETMAP) && !defined(NETMAP_IXL_MAIN) +int ixl_rx_miss, ixl_rx_miss_bufs, ixl_crcstrip; +#endif /********************************************************************* * Device identification routine From owner-svn-src-head@freebsd.org Sat Aug 20 00:38:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E55ABBE7BC for ; Sat, 20 Aug 2016 00:38:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::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 E9F3A1BD4 for ; Sat, 20 Aug 2016 00:38:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22c.google.com with SMTP id x131so42920477ite.0 for ; Fri, 19 Aug 2016 17:38:02 -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=NeV5NDPF2NWw9BEr3MvWAbE0xhQTmLnzfsgdif7vQtk=; b=UmKuTHdGTuBO+ZCwqUx6h/8FM3V5v38MZI316e3MbsBA3J3ygUYsK/SCg0PsbG421p FkBOcEh26E4YktlhusQrfftLMaLllmLoxyVoPdf6YnA/ECXyBDjI6hEux5N24cua7oF9 Vm1dRvR7NJboEhwt2xC0+XmOWSFiBkxc4KXiU99jXasVW+eN6iJhJeA68PBzqy5nlnLI pDzGL/ghK2+YK8nhnPs51RuUOx58a+Ej/zjJXtU7d6TYhf2IWAAwhrlISK84lauYHDUm w3idHLTKlpKWW+r4hvhYvG867yjfJWdJ16Imc0gik8fflSHwmgHhxa6KVILtApplgHma dh5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=NeV5NDPF2NWw9BEr3MvWAbE0xhQTmLnzfsgdif7vQtk=; b=Z6ODbLPqg1K3DIY/sXp/nAi4TADzcPH2mWZfcBzAlW4AqjfPCRqbKcrNDdc0DEjQn2 9fIdx9c6ppg7WGsNeP0XNSyaZ+roWj0UEzswA3xXWQYjA1Gr3zu9lWTytf/0r9+z8j3g VfVZ7Ij8JxDV3NHzfcyikSgjp2zzVdY2sRdrYOrnGybawQuH639PuOjSsDeArghMj11H +TuBCHey3Z6lW7KqDYgfPOLPsQ5n2oCwbHviMSwJvuzYBNwg703ZDFk36TPVO4PdP1xx kw4ycyFvV5KO93RUEcuSb0pRFVCftDpu0RP389zWybn+JxpOeCYejOq8+dYaOieWvL0g ZGmg== X-Gm-Message-State: AEkoouuY34lyxEmhYl5Pj68NecMvrF1gh0WW1QoP6n+aMg9NvSpu94DiOuYtJqER9qQcQm67Ha6H1u/QFMAPdw== X-Received: by 10.36.210.68 with SMTP id z65mr9602383itf.32.1471653482187; Fri, 19 Aug 2016 17:38:02 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Fri, 19 Aug 2016 17:38:01 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <201608192227.u7JMREIo032684@repo.freebsd.org> References: <201608192227.u7JMREIo032684@repo.freebsd.org> From: Warner Losh Date: Fri, 19 Aug 2016 18:38:01 -0600 X-Google-Sender-Auth: jJKEURcMAKkFIhONyLjeCz-VVlE Message-ID: Subject: Re: svn commit: r304506 - in head: . release/doc/en_US.ISO8859-1/hardware share/man/man4/man4.i386 sys/conf sys/dev/wl sys/i386/conf sys/modules sys/modules/wl targets/pseudo/userland tools/build/mk to... To: John Baldwin 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.22 Precedence: list List-Id: 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, 20 Aug 2016 00:38:03 -0000 On Fri, Aug 19, 2016 at 4:27 PM, John Baldwin wrote: > Author: jhb > Date: Fri Aug 19 22:27:14 2016 > New Revision: 304506 > URL: https://svnweb.freebsd.org/changeset/base/304506 > > Log: > Remove the wl(4) driver and wlconfig(8) utility. > > The wl(4) driver supports pre-802.11 PCCard wireless adapters that > are slower than 802.11b. They do not work with any of the 802.11 > framework and the driver hasn't been reported to actually work in a > long time. s/PC Card/ISA/g There never were any PC Card wl cards. These cards were ISA only and ran at up to 1Mbps. Warner > Relnotes: yes > > Deleted: > head/share/man/man4/man4.i386/wl.4 > head/sys/dev/wl/ > head/sys/modules/wl/ > head/tools/kerneldoc/subsys/Doxyfile-dev_wl > head/usr.sbin/wlconfig/ > Modified: > head/ObsoleteFiles.inc > head/release/doc/en_US.ISO8859-1/hardware/article.xml > head/share/man/man4/man4.i386/Makefile > head/sys/conf/files > head/sys/conf/options > head/sys/i386/conf/NOTES > head/sys/modules/Makefile > head/targets/pseudo/userland/Makefile.depend > head/tools/build/mk/OptionalObsoleteFiles.inc > head/usr.sbin/Makefile.i386 > > Modified: head/ObsoleteFiles.inc > ============================================================================== > --- head/ObsoleteFiles.inc Fri Aug 19 22:13:01 2016 (r304505) > +++ head/ObsoleteFiles.inc Fri Aug 19 22:27:14 2016 (r304506) > @@ -38,6 +38,10 @@ > # xargs -n1 | sort | uniq -d; > # done > > +# 20160819: Remove wl(4) and wlconfig(8) > +OLD_FILES+=usr/share/man/man4/i386/wl.4.gz > +OLD_FILES+=usr/sbin/wlconfig > +OLD_FILES+=usr/share/man/man8/i386/wlconfig.8.gz > # 20160819: Remove si(4) and sicontrol(8) > OLD_FILES+=usr/share/man/man4/si.4.gz > OLD_FILES+=usr/sbin/sicontrol > > Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml > ============================================================================== > --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 22:13:01 2016 (r304505) > +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 22:27:14 2016 (r304506) > @@ -1023,9 +1023,6 @@ > Intersil PRISM-2.5, Intersil Prism-3, and Symbol Spectrum24 > chipsets (&man.wi.4; driver) > > - [&arch.i386;] NCR / AT&T / Lucent Technologies WaveLan > - T1-speed ISA/radio LAN cards (&man.wl.4; driver) > - > [&arch.i386;, &arch.amd64;] Intel PRO/Wireless 3945ABG > MiniPCI network adapters (&man.wpi.4; driver) > > > Modified: head/share/man/man4/man4.i386/Makefile > ============================================================================== > --- head/share/man/man4/man4.i386/Makefile Fri Aug 19 22:13:01 2016 (r304505) > +++ head/share/man/man4/man4.i386/Makefile Fri Aug 19 22:27:14 2016 (r304506) > @@ -31,8 +31,7 @@ MAN= aic.4 \ > streams.4 \ > svr4.4 \ > vpd.4 \ > - vx.4 \ > - wl.4 > + vx.4 > > MLINKS= CPU_ELAN.4 CPU_SOEKRIS.4 > MLINKS+=pae.4 PAE.4 > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Fri Aug 19 22:13:01 2016 (r304505) > +++ head/sys/conf/files Fri Aug 19 22:27:14 2016 (r304506) > @@ -2933,7 +2933,6 @@ dev/wb/if_wb.c optional wb pci > dev/wi/if_wi.c optional wi > dev/wi/if_wi_pccard.c optional wi pccard > dev/wi/if_wi_pci.c optional wi pci > -dev/wl/if_wl.c optional wl isa > dev/wpi/if_wpi.c optional wpi pci > wpifw.c optional wpifw \ > compile-with "${AWK} -f $S/tools/fw_stub.awk wpi.fw:wpifw:153229 -mwpi -c${.TARGET}" \ > > Modified: head/sys/conf/options > ============================================================================== > --- head/sys/conf/options Fri Aug 19 22:13:01 2016 (r304505) > +++ head/sys/conf/options Fri Aug 19 22:27:14 2016 (r304506) > @@ -218,8 +218,6 @@ SW_WATCHDOG opt_watchdog.h > TURNSTILE_PROFILING > UMTX_PROFILING > VERBOSE_SYSINIT > -WLCACHE opt_wavelan.h > -WLDEBUG opt_wavelan.h > > # POSIX kernel options > P1003_1B_MQUEUE opt_posix.h > > Modified: head/sys/i386/conf/NOTES > ============================================================================== > --- head/sys/i386/conf/NOTES Fri Aug 19 22:13:01 2016 (r304505) > +++ head/sys/i386/conf/NOTES Fri Aug 19 22:27:14 2016 (r304506) > @@ -648,11 +648,6 @@ hint.sbni.0.port="0x210" > hint.sbni.0.irq="0xefdead" > hint.sbni.0.flags="0" > device vmx # VMware VMXNET3 Ethernet > -device wl > -hint.wl.0.at="isa" > -hint.wl.0.port="0x300" > -options WLCACHE # enables the signal-strength cache > -options WLDEBUG # enables verbose debugging output > device wpi # Intel 3945ABG wireless NICs. > > # IEEE 802.11 adapter firmware modules > > Modified: head/sys/modules/Makefile > ============================================================================== > --- head/sys/modules/Makefile Fri Aug 19 22:13:01 2016 (r304505) > +++ head/sys/modules/Makefile Fri Aug 19 22:27:14 2016 (r304506) > @@ -391,7 +391,6 @@ SUBDIR= \ > wb \ > ${_wbwd} \ > ${_wi} \ > - ${_wl} \ > wlan \ > wlan_acl \ > wlan_amrr \ > @@ -728,7 +727,6 @@ _ctau= ctau > .endif > _dpt= dpt > _ex= ex > -_wl= wl > .elif ${MACHINE} == "pc98" > _canbepm= canbepm > _canbus= canbus > > Modified: head/targets/pseudo/userland/Makefile.depend > ============================================================================== > --- head/targets/pseudo/userland/Makefile.depend Fri Aug 19 22:13:01 2016 (r304505) > +++ head/targets/pseudo/userland/Makefile.depend Fri Aug 19 22:27:14 2016 (r304506) > @@ -865,8 +865,7 @@ DIRDEPS.i386= \ > usr.sbin/spkrtest \ > usr.sbin/zzz \ > usr.sbin/acpi \ > - usr.sbin/boot0cfg \ > - usr.sbin/wlconfig > + usr.sbin/boot0cfg > > DIRDEPS.arm64= \ > usr.sbin/acpi \ > > Modified: head/tools/build/mk/OptionalObsoleteFiles.inc > ============================================================================== > --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Aug 19 22:13:01 2016 (r304505) > +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Aug 19 22:27:14 2016 (r304506) > @@ -8744,9 +8744,6 @@ OLD_FILES+=usr/sbin/hostapd > OLD_FILES+=usr/sbin/hostapd_cli > OLD_FILES+=usr/sbin/ndis_events > OLD_FILES+=usr/sbin/wlandebug > -.if ${TARGET_ARCH} == "i386" > -OLD_FILES+=usr/sbin/wlconfig > -.endif > OLD_FILES+=usr/sbin/wpa_cli > OLD_FILES+=usr/sbin/wpa_passphrase > OLD_FILES+=usr/sbin/wpa_supplicant > @@ -8761,9 +8758,6 @@ OLD_FILES+=usr/share/man/man5/wpa_suppli > OLD_FILES+=usr/share/man/man8/ancontrol.8.gz > OLD_FILES+=usr/share/man/man8/hostapd.8.gz > OLD_FILES+=usr/share/man/man8/hostapd_cli.8.gz > -.if ${TARGET_ARCH} == "i386" > -OLD_FILES+=usr/share/man/man8/i386/wlconfig.8.gz > -.endif > OLD_FILES+=usr/share/man/man8/ndis_events.8.gz > OLD_FILES+=usr/share/man/man8/wlandebug.8.gz > OLD_FILES+=usr/share/man/man8/wpa_cli.8.gz > > Modified: head/usr.sbin/Makefile.i386 > ============================================================================== > --- head/usr.sbin/Makefile.i386 Fri Aug 19 22:13:01 2016 (r304505) > +++ head/usr.sbin/Makefile.i386 Fri Aug 19 22:27:14 2016 (r304506) > @@ -29,9 +29,6 @@ SUBDIR+= boot0cfg > .if ${MK_HYPERV} != "no" > SUBDIR+= hyperv > .endif > -.if ${MK_WIRELESS} != "no" > -SUBDIR+= wlconfig > -.endif > .elif ${MACHINE} == "pc98" > SUBDIR+= boot98cfg > .endif > From owner-svn-src-head@freebsd.org Sat Aug 20 00:49:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B320BBEA04; Sat, 20 Aug 2016 00:49:31 +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 7915A1199; Sat, 20 Aug 2016 00:49:31 +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 u7K0nUaT084691; Sat, 20 Aug 2016 00:49:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K0nUYd084685; Sat, 20 Aug 2016 00:49:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608200049.u7K0nUYd084685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 20 Aug 2016 00:49:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304513 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/ie sys/i386/conf sys/modules sys/modules/ie sys/pc98/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 00:49:31 -0000 Author: jhb Date: Sat Aug 20 00:49:29 2016 New Revision: 304513 URL: https://svnweb.freebsd.org/changeset/base/304513 Log: Remove the ie(4) driver for Intel 82586 ISA Ethernet adapters. This driver only supports 10Mb Ethernet using PIO (the hardware supports DMA, but the driver only does PIO). There are not any PCCard adapters supported by this driver, only ISA cards. In addition, it does not use bus_space but instead uses bcopy with volatile pointers triggering a host of warnings. (if_ie.c is one of 3 files always built with -Wno-error) Relnotes: yes Deleted: head/share/man/man4/man4.i386/ie.4 head/sys/dev/ie/ head/sys/modules/ie/ Modified: head/ObsoleteFiles.inc head/share/man/man4/man4.i386/Makefile head/sys/conf/files head/sys/i386/conf/NOTES head/sys/modules/Makefile head/sys/pc98/conf/NOTES Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Aug 20 00:34:19 2016 (r304512) +++ head/ObsoleteFiles.inc Sat Aug 20 00:49:29 2016 (r304513) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160819: Remove ie(4) +OLD_FILES+=usr/share/man/man4/i386/ie.4.gz # 20160819: Remove spic(4) OLD_FILES+=usr/share/man/man4/spic.4.gz # 20160819: Remove wl(4) and wlconfig(8) Modified: head/share/man/man4/man4.i386/Makefile ============================================================================== --- head/share/man/man4/man4.i386/Makefile Sat Aug 20 00:34:19 2016 (r304512) +++ head/share/man/man4/man4.i386/Makefile Sat Aug 20 00:49:29 2016 (r304513) @@ -16,7 +16,6 @@ MAN= aic.4 \ fe.4 \ glxiic.4 \ glxsb.4 \ - ie.4 \ longrun.4 \ mse.4 \ npx.4 \ Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Aug 20 00:34:19 2016 (r304512) +++ head/sys/conf/files Sat Aug 20 00:49:29 2016 (r304513) @@ -1579,8 +1579,6 @@ dev/ida/ida.c optional ida dev/ida/ida_disk.c optional ida dev/ida/ida_eisa.c optional ida eisa dev/ida/ida_pci.c optional ida pci -dev/ie/if_ie.c optional ie isa nowerror -dev/ie/if_ie_isa.c optional ie isa dev/iicbus/ad7418.c optional ad7418 dev/iicbus/ds1307.c optional ds1307 dev/iicbus/ds133x.c optional ds133x Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Sat Aug 20 00:34:19 2016 (r304512) +++ head/sys/i386/conf/NOTES Sat Aug 20 00:49:29 2016 (r304513) @@ -624,12 +624,6 @@ hint.ed.0.at="isa" hint.ed.0.port="0x280" hint.ed.0.irq="5" hint.ed.0.maddr="0xd8000" -device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc. -# Hints only required for Starlan -hint.ie.2.at="isa" -hint.ie.2.port="0x300" -hint.ie.2.irq="5" -hint.ie.2.maddr="0xd0000" device ipw # Intel 2100 wireless NICs. device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. device iwn # Intel 4965/1000/5000/6000 wireless NICs. Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Aug 20 00:34:19 2016 (r304512) +++ head/sys/modules/Makefile Sat Aug 20 00:49:29 2016 (r304513) @@ -141,7 +141,6 @@ SUBDIR= \ ${_ibcs2} \ ${_ichwd} \ ${_ida} \ - ${_ie} \ if_bridge \ if_disc \ if_edsc \ @@ -705,7 +704,6 @@ _elink= elink _glxiic= glxiic _glxsb= glxsb #_ibcs2= ibcs2 -_ie= ie _mse= mse _ncr= ncr _ncv= ncv Modified: head/sys/pc98/conf/NOTES ============================================================================== --- head/sys/pc98/conf/NOTES Sat Aug 20 00:34:19 2016 (r304512) +++ head/sys/pc98/conf/NOTES Sat Aug 20 00:49:29 2016 (r304513) @@ -390,11 +390,6 @@ hint.ed.0.at="isa" hint.ed.0.port="0x280" hint.ed.0.irq="5" hint.ed.0.maddr="0xd8000" -device ie # Hints only required for Starlan -hint.ie.2.at="isa" -hint.ie.2.port="0x300" -hint.ie.2.irq="5" -hint.ie.2.maddr="0xd0000" #device le # Hint for the PC98-only C-NET(98)S C-bus front-end of le(4). hint.le.0.at="isa" From owner-svn-src-head@freebsd.org Sat Aug 20 00:56:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F372BBEBD6; Sat, 20 Aug 2016 00:56:00 +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 C29A415A1; Sat, 20 Aug 2016 00:55:59 +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 u7K0twjY088184; Sat, 20 Aug 2016 00:55:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K0twMd088183; Sat, 20 Aug 2016 00:55:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608200055.u7K0twMd088183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 20 Aug 2016 00:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304514 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 00:56:00 -0000 Author: jhibbits Date: Sat Aug 20 00:55:58 2016 New Revision: 304514 URL: https://svnweb.freebsd.org/changeset/base/304514 Log: Skip HID1 initialization on e6500 cores, it doesn't exist. With this, and some drivers removed, a T2080 dev board boots to mountroot. Submitted by: Ivan Krivonos Modified: head/sys/powerpc/booke/locore.S Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Sat Aug 20 00:49:29 2016 (r304513) +++ head/sys/powerpc/booke/locore.S Sat Aug 20 00:55:58 2016 (r304514) @@ -140,6 +140,8 @@ __start: beq 1f cmpli 0, 0, %r3, FSL_E5500 beq 1f + cmpli 0, 0, %r3, FSL_E6500 + beq 1f lis %r3, HID1_E500_DEFAULT_SET@h ori %r3, %r3, HID1_E500_DEFAULT_SET@l From owner-svn-src-head@freebsd.org Sat Aug 20 09:12:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1626BC07EC; Sat, 20 Aug 2016 09:12:02 +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 8812916CC; Sat, 20 Aug 2016 09:12:02 +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 u7K9C1b4074012; Sat, 20 Aug 2016 09:12:01 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K9C1i5074011; Sat, 20 Aug 2016 09:12:01 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608200912.u7K9C1i5074011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 20 Aug 2016 09:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304520 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 09:12:02 -0000 Author: avg Date: Sat Aug 20 09:12:01 2016 New Revision: 304520 URL: https://svnweb.freebsd.org/changeset/base/304520 Log: fix bug introduced in r297521, set canmount=on doesn't mount filesystem There are two cases where changing canmount should result in an action: - canmount is set to off for a mounted filesystem - canmount is set to on for an unmounted filesystem Before r297521 we could unmount and re-mount a filesystem when that was not necessary, but after r297521 we only handled the first of the above cases. MFC after: 5 days Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sat Aug 20 07:44:41 2016 (r304519) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sat Aug 20 09:12:01 2016 (r304520) @@ -1630,12 +1630,17 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvl assert(cl_idx < nvl_len); /* * We don't want to unmount & remount the dataset when changing - * its canmount property to 'on' or 'noauto'. We only use - * the changelist logic to unmount when setting canmount=off. + * its canmount property. We only use the changelist logic to + * unmount when setting canmount=off for a mounted filesystem + * or when setting canmount=on for an unmounted filesystem. + * For all other changes to canmount property the filesystem + * remains the same. */ if (prop != ZFS_PROP_CANMOUNT || (fnvpair_value_uint64(elem) == ZFS_CANMOUNT_OFF && - zfs_is_mounted(zhp, NULL))) { + zfs_is_mounted(zhp, NULL)) || + (fnvpair_value_uint64(elem) == ZFS_CANMOUNT_ON && + !zfs_is_mounted(zhp, NULL))) { cls[cl_idx] = changelist_gather(zhp, prop, 0, 0); if (cls[cl_idx] == NULL) goto error; From owner-svn-src-head@freebsd.org Sat Aug 20 09:13:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8363ABC0847; Sat, 20 Aug 2016 09:13: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 4C1AA18B6; Sat, 20 Aug 2016 09:13: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 u7K9DEDc074096; Sat, 20 Aug 2016 09:13:14 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K9DEZH074095; Sat, 20 Aug 2016 09:13:14 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608200913.u7K9DEZH074095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 20 Aug 2016 09:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304521 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 09:13:15 -0000 Author: avg Date: Sat Aug 20 09:13:14 2016 New Revision: 304521 URL: https://svnweb.freebsd.org/changeset/base/304521 Log: JMicron JMB361 has only a single SATA port Discussed with: mav MFC after: 3 days Modified: head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Sat Aug 20 09:12:01 2016 (r304520) +++ head/sys/dev/ahci/ahci_pci.c Sat Aug 20 09:13:14 2016 (r304521) @@ -187,7 +187,7 @@ static const struct { {0xa10f8086, 0x00, "Intel Sunrise Point (RAID)", 0}, {0x23238086, 0x00, "Intel DH89xxCC", 0}, {0x2360197b, 0x00, "JMicron JMB360", 0}, - {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE}, + {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE | AHCI_Q_1CH}, {0x2362197b, 0x00, "JMicron JMB362", 0}, {0x2363197b, 0x00, "JMicron JMB363", AHCI_Q_NOFORCE}, {0x2365197b, 0x00, "JMicron JMB365", AHCI_Q_NOFORCE}, From owner-svn-src-head@freebsd.org Sat Aug 20 10:08:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32B90BBE71B; Sat, 20 Aug 2016 10:08:12 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00B931D64; Sat, 20 Aug 2016 10:08:12 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf0-x231.google.com with SMTP id y134so17039971pfg.0; Sat, 20 Aug 2016 03:08:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RTBoPYKDXjEhQMmHNzONhCLcBtzhsYUbtTJHWPKHfMc=; b=fUN3rASsbJpJwhe4dx0DyB7acKukOq2SXzSNWOjSNVOUBAFdFk/7HofwZR37Yhx3/x hKm7buu9Vpc31i3VjB1v8Q5Bc9oQI4EZihJhPCQB7krbKSaMee/CObbGIlN9HDkEh+Ec Q+LVpp6kaCgjSa55kXwg4AoWu8bUOS0qSajwFzy+Jlwcv6oXRys1WP//LAguc9A5oEOc kEaqDCu8d8TLMhKi7M1uTZ587ohTfowUVwZlJ2zF/EAL4yXolMjokMisiwHX4kmpxunh zimXGvpXEPNDTOCEWVJTMUhaayYKus15424kn6v86wqEdakAbYTwHkzZxNWX93lEfSGo KArg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:reply-to:subject:references:to:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=RTBoPYKDXjEhQMmHNzONhCLcBtzhsYUbtTJHWPKHfMc=; b=XJcWa66vmQ64uG06Oe1KqZAWuGEdnFBuVPdyjHLv/6VG/hdbrbL7LNZ9ifrCAQb/Yd NgPkaIlNvY7CnAGfxKdpsj9e1Q4immcEsahwSmT/SfGsq7DjyuLlEbJe6HceFlr88T0H w3n6mcUfvwG6xdeXtZ7v9Mix/7Xl5g5YTEj4oPtSlI8wn75nvjSCi7McIvn2NuQvn0iV fJy9yoboxS3ATULVMOviEJ8WUaQaKvOL1/jP71GbspZEz/uiV6jcs/g5BHgSnOiQTYvs 5veZJgjPe69TcHQGiJ0i2C7+nIRCsN1ZOD7xSEiGQWdbXREFAEisylIsUNZajLKT3BjH jawg== X-Gm-Message-State: AEkoouvPH5ZsF0SLh8RvEw3UF0tBOH4fnjsUYOK+Xq6LYjn5FvO0J9kTt47uF+RyMqG65Q== X-Received: by 10.98.80.220 with SMTP id g89mr22649121pfj.12.1471687691487; Sat, 20 Aug 2016 03:08:11 -0700 (PDT) Received: from ?IPv6:2001:44b8:31ae:7b01:f985:3c4b:2a0c:8bea? (2001-44b8-31ae-7b01-f985-3c4b-2a0c-8bea.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:f985:3c4b:2a0c:8bea]) by smtp.gmail.com with ESMTPSA id w76sm12698589pfd.69.2016.08.20.03.08.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Aug 2016 03:08:10 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r304435 - head/sys/netinet References: <201608182259.u7IMx0bx001967@repo.freebsd.org> To: Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Kubilay Kocak Message-ID: <96b7428a-0a57-6d6d-4b2e-24010596ceaf@FreeBSD.org> Date: Sat, 20 Aug 2016 20:08:01 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Thunderbird/50.0a2 MIME-Version: 1.0 In-Reply-To: <201608182259.u7IMx0bx001967@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 10:08:12 -0000 On 19/08/2016 8:59 AM, Ryan Stone wrote: > Author: rstone > Date: Thu Aug 18 22:59:00 2016 > New Revision: 304435 > URL: https://svnweb.freebsd.org/changeset/base/304435 > > Log: > Don't iterate over the ifnet addr list in ip_output() > > For almost every packet that is transmitted through ip_output(), > a call to in_broadcast() was made to decide if the destination > IP was a broadcast address. in_broadcast() iterates over the > ifnet's address to find a source IP matching the subnet of the > destination IP, and then checks if the IP is a broadcast in that > subnet. > > This is completely redundant as we have already performed the > route lookup, so the source IP is already known. Just use that > address to directly check whether the destination IP is a > broadcast address or not. Hi Ryan, Could you elaborate on any of the potential performance implications of this? > MFC after: 2 months > Sponsored By: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D7266 > > Modified: > head/sys/netinet/in.c > head/sys/netinet/in.h > head/sys/netinet/ip_output.c > > Modified: head/sys/netinet/in.c From owner-svn-src-head@freebsd.org Sat Aug 20 11:43:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21D6ABBAEFA; Sat, 20 Aug 2016 11:43:03 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D84C3186A; Sat, 20 Aug 2016 11:43:02 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id E348620283; Sat, 20 Aug 2016 07:33:14 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 07:33:14 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=/8q/Kh34eNzdb/7HFT1hBSvn3HM=; b=Yksf5P LoBLgZYqB30PPamLHbExsD0J+fXYs+Rj96q+/QZef0BtqmbN/LIn1s0H+iBXek+x WnaEcu9pGU5IGRtd/Oh9k73L4c6W+2KUDTIG2/2lxY2uc1JttMCZYbiH85o2txhW 8vWYkS3hKfyYF06AI9DTSDeyBMxBCW/spMQiI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=/8q/Kh34eNzdb/7 HFT1hBSvn3HM=; b=g2FA/CfQmtMrfZyfrVjbgsvOmC1NXqn2qcd1dB8Li3XlZLS gIykxsnc1QlvJwcMBqAHYdwgQZdKAF5D0QH0CNzWFKmpNeTdlE5Kvr5ihYXFYK52 6lgBtIobmpstnKqplEBpfnl+9rMfrCzhEq1CtGWKvU6P40JygbxuIuyp0i1Y= X-Sasl-enc: Q4DfqWyUouwhaEvr13jaBRIrmFYT3qPyzIsVuIW0p9Hd 1471692794 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 2F0D0CCE69; Sat, 20 Aug 2016 07:33:14 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608182259.u7IMx5oW002018@repo.freebsd.org> From: Bruce Simpson Message-ID: <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> Date: Sat, 20 Aug 2016 12:33:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608182259.u7IMx5oW002018@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 11:43:03 -0000 This potentially breaks reception of IPv4 broadcasts where FreeBSD is the endpoint at the end of a P2P interface, or other forms of links, where there is no guarantee that the link layer will set M_BCAST (or indeed M_MCAST). On 18/08/16 23:59, Ryan Stone wrote: > Author: rstone > Date: Thu Aug 18 22:59:05 2016 > New Revision: 304436 > URL: https://svnweb.freebsd.org/changeset/base/304436 > > Log: > Don't check for broadcast IPs on non-bcast pkts > > in_broadcast() can be quite expensive, so skip calling it if the > incoming mbuf wasn't sent to a broadcast L2 address in the first > place. > > Reviewed by: gnn > MFC after: 2 months > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D7309 > > Modified: > head/UPDATING > head/sys/netinet/udp_usrreq.c > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Thu Aug 18 22:59:00 2016 (r304435) > +++ head/UPDATING Thu Aug 18 22:59:05 2016 (r304436) > @@ -32,6 +32,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > 20160818: > + The UDP receive code has been updated to only treat incoming UDP > + packets that were addressed to an L2 broadcast address as L3 > + broadcast packets. It is not expected that this will affect any > + standards-conforming UDP application. The new behaviour can be > + disabled by setting the sysctl net.inet.udp.require_l2_bcast to > + 0. > + > +20160818: > Remove the openbsd_poll system call. > __FreeBSD_version has been bumped because of this. > > > Modified: head/sys/netinet/udp_usrreq.c > ============================================================================== > --- head/sys/netinet/udp_usrreq.c Thu Aug 18 22:59:00 2016 (r304435) > +++ head/sys/netinet/udp_usrreq.c Thu Aug 18 22:59:05 2016 (r304436) > @@ -126,6 +126,11 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, blac > &VNET_NAME(udp_blackhole), 0, > "Do not send port unreachables for refused connects"); > > +static VNET_DEFINE(int, udp_require_l2_bcast) = 1; > +SYSCTL_INT(_net_inet_udp, OID_AUTO, require_l2_bcast, CTLFLAG_VNET | CTLFLAG_RW, > + &VNET_NAME(udp_require_l2_bcast), 0, > + "Only treat packets sent to an L2 broadcast address as broadcast packets"); > + > u_long udp_sendspace = 9216; /* really max datagram size */ > SYSCTL_ULONG(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW, > &udp_sendspace, 0, "Maximum outgoing UDP datagram size"); > @@ -523,7 +528,8 @@ udp_input(struct mbuf **mp, int *offp, i > > pcbinfo = udp_get_inpcbinfo(proto); > if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || > - in_broadcast(ip->ip_dst, ifp)) { > + ((!VNET_NAME(udp_require_l2_bcast) || m->m_flags & M_BCAST) && > + in_broadcast(ip->ip_dst, ifp))) { > struct inpcb *last; > struct inpcbhead *pcblist; > struct ip_moptions *imo; > From owner-svn-src-head@freebsd.org Sat Aug 20 11:48:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5469BBF097; Sat, 20 Aug 2016 11:48:10 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAF3A1B9B; Sat, 20 Aug 2016 11:48:10 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 6AD9820248; Sat, 20 Aug 2016 07:48:09 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 07:48:09 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=dM81jlqjZi/vINEioo43lhyBipk=; b=HpJtbc UA31uyG7hw791hNn4Qfqqdvc34iT+IcOnFVEw66cQua19e1jMXnXqq7OOJGYTtpK yWO65rWVRZZV33QH5fCfuYtjCmDa0dEs7qi/np8VJk2iIyaye9nGeDbTB5J8d/Yr pNs88m4LLkdJABGpaE9DVv1ugB8byOc3Vlim4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=dM81jlqjZi/vINE ioo43lhyBipk=; b=c+9M1V83oSknCS+VcvWbu5TbAm36chtZJqT9glTZ1H1PG+q baYJtf+6eLiTeMwOThpat7vW7T+kWk/ba6+FPdevTbBQoJ1zPYx6dI4VxgfKHzlM C58fbv0YQlxqj73S/6QqjixHtkZFWvBRNUsoizUC/94Dze3fy/wb0OZKsIeg= X-Sasl-enc: T0q1dIbBgEf8uXfYEacP89j23rOX/uhakPSfqnZbeu5A 1471693689 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id A74E8CC021; Sat, 20 Aug 2016 07:48:08 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> From: Bruce Simpson Message-ID: <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> Date: Sat, 20 Aug 2016 12:48:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 11:48:10 -0000 On 20/08/16 12:33, Bruce Simpson wrote: > This potentially breaks reception of IPv4 broadcasts where FreeBSD is > the endpoint at the end of a P2P interface, or other forms of links, > where there is no guarantee that the link layer will set M_BCAST (or > indeed M_MCAST). I appreciate it probably looks like a quick win, but if it's only been tested with Ethernet (it looks like it has only been written with Ethernet in mind), it does strongly look as if it breaks broadcast for UDP/IPv4 in other situations. So, maybe it should be backed out ASAP. (I haven't tested this code.) It is perfectly legal for broadcast packets to be addressed to the end of a P2P or non-Ethernet link, which may not set M_BCAST or M_MCAST. The classic example is ATM (Non-Broadcast, Multiple Access (NBMA)) but the situation may be readily observed with loopback or tunnels. The same issue doesn't exist in your output path change, which looks sane. The same issue doesn't exist with IPv6 where broadcast is dead. From owner-svn-src-head@freebsd.org Sat Aug 20 14:04:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21932BC0D16; Sat, 20 Aug 2016 14:04:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D09CD188C; Sat, 20 Aug 2016 14:04:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KE4qCS082083; Sat, 20 Aug 2016 14:04:52 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KE4pML082079; Sat, 20 Aug 2016 14:04:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608201404.u7KE4pML082079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Aug 2016 14:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304530 - in head: contrib/llvm/lib/Target/ARM/MCTargetDesc lib/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 14:04:53 -0000 Author: dim Date: Sat Aug 20 14:04:51 2016 New Revision: 304530 URL: https://svnweb.freebsd.org/changeset/base/304530 Log: Pull in r265122 from upstream llvm trunk (by James Molloy): Fix for pr24346: arm asm label calculation error in sub Some ARM instructions encode 32-bit immediates as a 8-bit integer (0-255) and a 4-bit rotation (0-30, even) in its least significant 12 bits. The original fixup, FK_Data_4, patches the instruction by the value bit-to-bit, regardless of the encoding. For example, assuming the label L1 and L2 are 0x0 and 0x104 respectively, the following instruction: add r0, r0, #(L2 - L1) ; expects 0x104, i.e., 260 would be assembled to the following, which adds 1 to r0, instead of 260: e2800104 add r0, r0, #4, 2 ; equivalently 1 The new fixup kind fixup_arm_mod_imm takes care of the encoding: e2800f41 add r0, r0, #260 Patch by Ting-Yuan Huang! This fixes label calculation for ARM assembly, and is needed to enable ARM assembly sources for OpenSSL. Requested by: jkim MFC after: 3 days Modified: head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMFixupKinds.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp head/lib/clang/freebsd_cc_version.h Modified: head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp Sat Aug 20 13:29:58 2016 (r304529) +++ head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp Sat Aug 20 14:04:51 2016 (r304530) @@ -90,6 +90,7 @@ const MCFixupKindInfo &ARMAsmBackend::ge {"fixup_arm_movw_lo16", 0, 20, 0}, {"fixup_t2_movt_hi16", 0, 20, 0}, {"fixup_t2_movw_lo16", 0, 20, 0}, + {"fixup_arm_mod_imm", 0, 12, 0}, }; const static MCFixupKindInfo InfosBE[ARM::NumTargetFixupKinds] = { // This table *must* be in the order that the fixup_* kinds are defined in @@ -133,6 +134,7 @@ const MCFixupKindInfo &ARMAsmBackend::ge {"fixup_arm_movw_lo16", 12, 20, 0}, {"fixup_t2_movt_hi16", 12, 20, 0}, {"fixup_t2_movw_lo16", 12, 20, 0}, + {"fixup_arm_mod_imm", 20, 12, 0}, }; if (Kind < FirstTargetFixupKind) @@ -624,6 +626,13 @@ unsigned ARMAsmBackend::adjustFixupValue return Value; } + case ARM::fixup_arm_mod_imm: + Value = ARM_AM::getSOImmVal(Value); + if (Ctx && Value >> 12) { + Ctx->reportError(Fixup.getLoc(), "out of range immediate fixup value"); + return 0; + } + return Value; } } @@ -690,6 +699,7 @@ static unsigned getFixupKindNumBytes(uns case FK_Data_2: case ARM::fixup_arm_thumb_br: case ARM::fixup_arm_thumb_cb: + case ARM::fixup_arm_mod_imm: return 2; case ARM::fixup_arm_pcrel_10_unscaled: @@ -766,6 +776,7 @@ static unsigned getFixupKindContainerSiz case ARM::fixup_arm_movw_lo16: case ARM::fixup_t2_movt_hi16: case ARM::fixup_t2_movw_lo16: + case ARM::fixup_arm_mod_imm: // Instruction size is 4 bytes. return 4; } Modified: head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMFixupKinds.h ============================================================================== --- head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMFixupKinds.h Sat Aug 20 13:29:58 2016 (r304529) +++ head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMFixupKinds.h Sat Aug 20 14:04:51 2016 (r304530) @@ -100,6 +100,9 @@ enum Fixups { fixup_t2_movt_hi16, // :upper16: fixup_t2_movw_lo16, // :lower16: + // fixup_arm_mod_imm - Fixup for mod_imm + fixup_arm_mod_imm, + // Marker LastTargetFixupKind, NumTargetFixupKinds = LastTargetFixupKind - FirstTargetFixupKind Modified: head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp Sat Aug 20 13:29:58 2016 (r304529) +++ head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp Sat Aug 20 14:04:51 2016 (r304530) @@ -312,12 +312,8 @@ public: // Support for fixups (MCFixup) if (MO.isExpr()) { const MCExpr *Expr = MO.getExpr(); - // In instruction code this value always encoded as lowest 12 bits, - // so we don't have to perform any specific adjustments. - // Due to requirements of relocatable records we have to use FK_Data_4. - // See ARMELFObjectWriter::ExplicitRelSym and - // ARMELFObjectWriter::GetRelocTypeInner for more details. - MCFixupKind Kind = MCFixupKind(FK_Data_4); + // Fixups resolve to plain values that need to be encoded. + MCFixupKind Kind = MCFixupKind(ARM::fixup_arm_mod_imm); Fixups.push_back(MCFixup::create(0, Expr, Kind, MI.getLoc())); return 0; } Modified: head/lib/clang/freebsd_cc_version.h ============================================================================== --- head/lib/clang/freebsd_cc_version.h Sat Aug 20 13:29:58 2016 (r304529) +++ head/lib/clang/freebsd_cc_version.h Sat Aug 20 14:04:51 2016 (r304530) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1200001 +#define FREEBSD_CC_VERSION 1200002 From owner-svn-src-head@freebsd.org Sat Aug 20 14:52:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7FC2BC0D45; Sat, 20 Aug 2016 14:52:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 963E415B3; Sat, 20 Aug 2016 14:52:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CD550B9B7; Sat, 20 Aug 2016 10:52:22 -0400 (EDT) From: John Baldwin To: Warner Losh Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r304506 - in head: . release/doc/en_US.ISO8859-1/hardware share/man/man4/man4.i386 sys/conf sys/dev/wl sys/i386/conf sys/modules sys/modules/wl targets/pseudo/userland tools/build/mk to... Date: Sat, 20 Aug 2016 07:33:59 -0700 Message-ID: <9056382.PA4dZNFpPe@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201608192227.u7JMREIo032684@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 20 Aug 2016 10:52:22 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 14:52:24 -0000 On Friday, August 19, 2016 06:38:01 PM Warner Losh wrote: > On Fri, Aug 19, 2016 at 4:27 PM, John Baldwin wrote: > > Author: jhb > > Date: Fri Aug 19 22:27:14 2016 > > New Revision: 304506 > > URL: https://svnweb.freebsd.org/changeset/base/304506 > > > > Log: > > Remove the wl(4) driver and wlconfig(8) utility. > > > > The wl(4) driver supports pre-802.11 PCCard wireless adapters that > > are slower than 802.11b. They do not work with any of the 802.11 > > framework and the driver hasn't been reported to actually work in a > > long time. > > s/PC Card/ISA/g > > There never were any PC Card wl cards. These cards were ISA only > and ran at up to 1Mbps. Wow, even worse than I thought. -- John Baldwin From owner-svn-src-head@freebsd.org Sat Aug 20 14:52:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B615BBC0D44; Sat, 20 Aug 2016 14:52:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 924C415B2; Sat, 20 Aug 2016 14:52:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6F86CB9B3; Sat, 20 Aug 2016 10:52:21 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304513 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/ie sys/i386/conf sys/modules sys/modules/ie sys/pc98/conf Date: Sat, 20 Aug 2016 07:51:55 -0700 Message-ID: <1699917.hhfoKyASTk@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201608200049.u7K0nUYd084685@repo.freebsd.org> References: <201608200049.u7K0nUYd084685@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 20 Aug 2016 10:52:21 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 14:52:24 -0000 On Saturday, August 20, 2016 12:49:30 AM John Baldwin wrote: > Author: jhb > Date: Sat Aug 20 00:49:29 2016 > New Revision: 304513 > URL: https://svnweb.freebsd.org/changeset/base/304513 > > Log: > Remove the ie(4) driver for Intel 82586 ISA Ethernet adapters. > > This driver only supports 10Mb Ethernet using PIO (the hardware supports > DMA, but the driver only does PIO). There are not any PCCard adapters > supported by this driver, only ISA cards. In addition, it does not use > bus_space but instead uses bcopy with volatile pointers triggering a > host of warnings. (if_ie.c is one of 3 files always built with > -Wno-error) > > Relnotes: yes This concludes the list of older drivers I had from earlier after working on the timeout(9) -> callout(9) changes (almost finished with that, just a few things left to test changes for, one of them being fail points before we can remove timeout()/untimeout() entirely). I do not have plans for removing any other drivers, though am open to suggestions. Some possibilities include: - tty drivers that haven't been updated to new tty and have been disconnected from the build since 8.0 including digi(4) and cy(4). I know Bruce has patches for sio(4) that I just haven't merged, so I'm inclined to leave sio(4), but the other disconnected drivers are candidates I think. - Older storage adapters: - aha (ISA) - ahb (EISA) - adv (ISA / EISA / PCI) - adw (PCI)? - bt (ISA / EISA / PCI) - aic (ISA / PCCard) - ct (ISA / CBUS) - dpt (ISA / EISA / PCI) - ncv (PCCard / PCI) - nsp (PCCard) - stg (ISA / PCCard / PCI) (Note: some of these are PC-98 related and might remove too much of the PC-98 ecosystem if removed?) - mse(4) (ISA-only non-PS-2, non-serial mouse) - joy(4) (ISA-only, was on various Sound Cards, etc., but I haven't seen a "game port" on a modern box in a long while) -- John Baldwin From owner-svn-src-head@freebsd.org Sat Aug 20 14:52:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9958BC0DA0; Sat, 20 Aug 2016 14:52:40 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::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 A20D918B7; Sat, 20 Aug 2016 14:52:40 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-io0-x236.google.com with SMTP id q83so73969936iod.1; Sat, 20 Aug 2016 07:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cHtUpT9qnNvZfxYRWw6IqHPt1+9EbeZ3eOWKs7pukZs=; b=aqhJaldXlqPzueZOsG7AioREiCOAZ5k6sMiSZfAojmteFKacrp6kGwhW4EPf7rBIN5 /Wi19jEkvROsoAYVxcSpQGaTj3swMtbnHitteoL93Rq4Z3PNk+zsHAdLNA0EWJFCyy4N 76t5UND/gaPYodievPqH7gKYBnAEpE0dZWJMIWMeytbEjtKCXPRZSJCSibQ2jnn7tJhw dC0x2B2NQsJ9XfqBuZsEwoutSb39GTJ2dZIZqRXBF2N6tAd6USfrkzAS5kL+tMTNo2hG y50zvc17U945MPMyxWPuxehtcmestbWMB3sIeDkh4P7rTPTSdpoqP7gZOlTirVuIvgR6 k/BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cHtUpT9qnNvZfxYRWw6IqHPt1+9EbeZ3eOWKs7pukZs=; b=HrzH7zfXqYb/q4HTv9y3+nzqNjXppWbROvc0PmdFUt5FqxR2+b2Su9pj/lr+bqudX4 EbhJrQmx/XhW8bRaylQ+jKf0HYfEkM6uN8bihIOFS+7MbhfStuiW4epRnoi0RjdhTwyL /ILKoep4nxcPPhP3ZDc1y2qTNrPCtOjY3pGiGCF7FCQ3AwuHJJHWPQqEzMIc/ian/egM 5isqEJ9b0v0ecBqima2JqzgwiKnsSL9ERyMld3vk/pxtcAnOC3dr/aX5Y6VK9TWpYlgi 4IFmDZhsEmSLCXS+z38wvYbGjjJEM/o53+QG4lhiOHCb8AfXhapiD0+sf/GbztHfhMND md3g== X-Gm-Message-State: AEkoousFo5DJ1/4T9xUePnNL0uzO6BL+cBO/batve8JtNk2oIktNQPpf8y7WlrKqFg/YVsiCFt7q7Jnkwg1tTA== X-Received: by 10.107.159.147 with SMTP id i141mr14877367ioe.29.1471704760079; Sat, 20 Aug 2016 07:52:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Sat, 20 Aug 2016 07:52:39 -0700 (PDT) In-Reply-To: <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> From: Ryan Stone Date: Sat, 20 Aug 2016 10:52:39 -0400 Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Bruce Simpson Cc: Ryan Stone , "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.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 14:52:41 -0000 On Sat, Aug 20, 2016 at 7:48 AM, Bruce Simpson wrote: > It is perfectly legal for broadcast packets to be addressed to the end of > a P2P or non-Ethernet link, which may not set M_BCAST or M_MCAST. The > classic example is ATM (Non-Broadcast, Multiple Access (NBMA)) but the > situation may be readily observed with loopback or tunnels. > Can you give an example of a tunneling protocol support by FreeBSD that may be affected? I looked and didn't see any. OpenVPN, as best that I can tell, injects frames into a tap interface, which appears as a Ethernet interface, for example. From owner-svn-src-head@freebsd.org Sat Aug 20 14:54:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6FD4BC0EB1; Sat, 20 Aug 2016 14:54:54 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FDFC1AA6; Sat, 20 Aug 2016 14:54:54 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-io0-x22b.google.com with SMTP id b62so73648816iod.3; Sat, 20 Aug 2016 07:54:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Tfi3owlqCfj8981TI6k8TparvoQIFPJNpp1nuc9Uur0=; b=ZwRPb34zv8WzCnIyQbXNLC+SjRjo7gV35ReNflHKOBMbXHw5Be56C8w5B91g1PeuEU LMxRz2bKTGA0t05lNPqI6nhSb0rgRbrMidOiDBXHzz7PdQsnQ812tk4X8KZrmVqaNW4w d/JGWWM0W5e/bCjRuQo3GAew6Nn9k5cpKCDKqO6UQouK9Wo3tsViripHYjhuxkzYrseJ EhoRbcFP1yyp5ofMRHk0jmm80FoSXtCquHldZv6ZwQsEho9wIbf+zb4PV/DZsDkepEKT HT03jWPVgojRRDE6mRwJ0Kp9fpWYIjww+O/Z0fCN8IVLHuWY8aIVrAK0WFNacG+3IAt5 adCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Tfi3owlqCfj8981TI6k8TparvoQIFPJNpp1nuc9Uur0=; b=eQtpIeH0ZOchqFeGClslJ+m29VrrV5r3HpmB8abDAHLVsjURdxOb0KtJ4qCaAvHaOi gIvRxGfkE47SxYky9lUpLkftxZz3iob9uj4jwzjBMJ5xYblyMGTEiF5ZeNLA/NqyNo0H uNIWdzH3vTL4jSe25+Tnn1GnwH4qNb+JVlFHxTNivIRSEIE+w8sFfx5bq+eWsXUdIRJZ yzlJRayW/5EsulAbKTsiDdsdDCaT5QPY7cormuTrZT+WQ4KZiWAT8/t2OS1fOJ55zwVt E7liaweA7ELJqpPham8uc03sbi3zA1Ty0nRyl0prUYcmeh6nayn35LILFlAcJyUdOEFg EVEQ== X-Gm-Message-State: AEkoouvBmPOaHLghL743/i7hFXdRFfhUTv0AmCF+bLddw/V9z4fR/smac3yGp8GsWjHoUFBDSxd9U1ei0JlLig== X-Received: by 10.107.129.97 with SMTP id c94mr15695178iod.102.1471704894032; Sat, 20 Aug 2016 07:54:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Sat, 20 Aug 2016 07:54:53 -0700 (PDT) In-Reply-To: <96b7428a-0a57-6d6d-4b2e-24010596ceaf@FreeBSD.org> References: <201608182259.u7IMx0bx001967@repo.freebsd.org> <96b7428a-0a57-6d6d-4b2e-24010596ceaf@FreeBSD.org> From: Ryan Stone Date: Sat, 20 Aug 2016 10:54:53 -0400 Message-ID: Subject: Re: svn commit: r304435 - head/sys/netinet To: koobs@freebsd.org Cc: Ryan Stone , "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.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 14:54:55 -0000 On Sat, Aug 20, 2016 at 6:08 AM, Kubilay Kocak wrote: > Hi Ryan, > > Could you elaborate on any of the potential performance implications of > this? > As if r304437, skipping the call to in_broadcast() means that we avoid an additional (potentially heavily contended) rlock acquire and release on the ifnet address list. From owner-svn-src-head@freebsd.org Sat Aug 20 15:01:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 272F3BC005D; Sat, 20 Aug 2016 15:01:51 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9E221DD0; Sat, 20 Aug 2016 15:01:50 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 6914A201A8; Sat, 20 Aug 2016 11:01:49 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 11:01:49 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=Pj5M0mpxOizfmg7RoJRrR2rGghw=; b=Q6CEd3 6mSvdjhgwE1UXy++g9PnzNiMpaEGO7HkOjcv8kyA8eu26/dHf6Y7t9VhlhBeIm9K PoSGU+rQF8D1Gw/uIyzeToeMbB6z/6HKNzk7r8rSrju2SfrxblxzqrmB87WamAXU azsT2k1yy/NJcQ4+Q+KsiRnIec7aXhIlBCJIc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=Pj5M0mpxOizfmg7 RoJRrR2rGghw=; b=EPF66NF5cq0EPSgLVcBl76ujSPVAyg9jLi62fitbW8pdCBF 0HtSZ7QLocjXWrEDev4G+mmuGBD6PRk3OAW7kXUX3OUcgp12jVLG1WFUZ2os/42J nLA1XKFqm8N2oD+TOLxWkZmL85p9+hkB1r0lH3Rv2/nmwl566+C99ogpDEx4= X-Sasl-enc: aUdf3kewzlhPGIt7OEyQ64m95xBUAmC3hV4wOBoLrkOr 1471705308 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 4F568CCE6C; Sat, 20 Aug 2016 11:01:48 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bruce Simpson Message-ID: Date: Sat, 20 Aug 2016 16:01:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 15:01:51 -0000 On 20/08/16 15:52, Ryan Stone wrote: > It is perfectly legal for broadcast packets to be addressed to the > end of a P2P or non-Ethernet link, which may not set M_BCAST or > M_MCAST. The classic example is ATM (Non-Broadcast, Multiple Access > (NBMA)) but the situation may be readily observed with loopback or > tunnels. > > Can you give an example of a tunneling protocol support by FreeBSD that > may be affected? I looked and didn't see any. OpenVPN, as best that I > can tell, injects frames into a tap interface, which appears as a > Ethernet interface, for example. Potentially any and all PPP, tun(4); any link layer with plain IP on top of it other than Ethernet, which may not set M_BCAST for an IPv4 broadcast packet (or does not distinguish between broadcast and unicast/multicast packets). if_ethersubr.c does set M_BCAST correctly for Ethernet broadcast packets in the receive path. That is guaranteed, and the majority of Ethernet network drivers will pass packets up the stack through it more or less directly. tap(4) is an exception because, as you rightly point out, it is pretty faithfully Ethernet, although I may have had to add code around Ethernet address conditions like this to it in the very distant past. tun(4) on the other hand is a plain, PPP-like, IP tunnel. But this mbuf flag is not guaranteed to be set in all situations; e.g. where the link layer does not have the concept of broadcast being distinct from other kinds of network traffic. PPP and ATM are the most obvious examples. From owner-svn-src-head@freebsd.org Sat Aug 20 15:24:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 441DCBC053E; Sat, 20 Aug 2016 15:24:15 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [192.108.105.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "StartCom Class 2 IV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29BA51BE6; Sat, 20 Aug 2016 15:24:14 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (bones.soaustin.net [192.108.105.22]) by mail.soaustin.net (Postfix) with ESMTPSA id 98FC1C6; Sat, 20 Aug 2016 10:24:07 -0500 (CDT) Date: Sat, 20 Aug 2016 10:24:06 -0500 From: Mark Linimon To: John Baldwin Cc: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r304513 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/ie sys/i386/conf sys/modules sys/modules/ie sys/pc98/conf Message-ID: <20160820152406.GA8132@lonesome.com> References: <201608200049.u7K0nUYd084685@repo.freebsd.org> <1699917.hhfoKyASTk@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1699917.hhfoKyASTk@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 15:24:15 -0000 On Sat, Aug 20, 2016 at 07:51:55AM -0700, John Baldwin wrote: > - aha (ISA) > - bt (ISA / EISA / PCI) If anyone complains, tell them I'll ship them cards. If they consider that a threat ... so be it :-) (I *am* in the middle of a big decluttering, you know. I can find them ...) mcl From owner-svn-src-head@freebsd.org Sat Aug 20 15:27:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5578BC05E0; Sat, 20 Aug 2016 15:27:26 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C82D1D85; Sat, 20 Aug 2016 15:27:26 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-it0-x22d.google.com with SMTP id f6so48938004ith.0; Sat, 20 Aug 2016 08:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=eioi5Epu3j8krd89wzUcKFDS3pNH7+kcQliPrOJpvl8=; b=YxYVjF2IEPBXiy58KVxZPXQfzU8K14PrAmLlZW8LekOt+XyHAQevdSYOzP1jv1DfDD esKy1+zfK4swBiV9iLhksZ/r4pNsPAAT8OZ1RvcwiMx1Y1UOOH4jL1iLVsoxi3fyLQMI 6IXfOmQlqSaCg3ak/A2Pjncd4bhg+c/N9IxItHmr946VEXgACw2F4VQosP7eqimzkA8O vEuO7GLiUpTx3AoW42ChrK74zshqqU0UFTvVy5HOgFEOpRt2hefo67y44LTymj3NUOmc GnjBKaaDLfR/qCTDPlhvEmDR5FauIyj8dLk/t6PWTByBv/lAmEVv51ldwyi3Qww0GjrE 4IIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eioi5Epu3j8krd89wzUcKFDS3pNH7+kcQliPrOJpvl8=; b=G90gFA109hyX31Y1mqA9j2vux9cnyH4dqrz8xKwn4chD4/cDlRzuo+zeJjMG9vDieT BXgOlJz1u12bLxzctVl2jkkWwr+hGNe0bDyALFTH6IYHFj5DFZY619h3cGXXxRs1HNNO DjH2/D/UkWcVoqNRF4dYXKWx9I0kqNYQWk/r1/eXISGmQ/3ouBn7cmjG6pI3lvs9V+9A 5QyclgKovNKc9DW2YNyI30Eglm9aii1ns1gbsdd8CCJ7CrEJiJ8RL30cZ+JaEKfLEVhR l2iNK9NyDEn1lkw+dttW4FXAjRsWXu8giYMNfPSaOoCtCrjOc2fsIPAvQFP0ahlP73/U yzDA== X-Gm-Message-State: AEkoouvRH/VW0sPWGLpGBYPIEVd3LT+1cyntIJXrwQ+UjvtUUoh2b65o2w9SivrLF1wF/FXPqzcsR0Wra+zghQ== X-Received: by 10.36.79.148 with SMTP id c142mr12610355itb.20.1471706845911; Sat, 20 Aug 2016 08:27:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Sat, 20 Aug 2016 08:27:25 -0700 (PDT) In-Reply-To: References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> From: Ryan Stone Date: Sat, 20 Aug 2016 11:27:25 -0400 Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Bruce Simpson Cc: Ryan Stone , "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.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 15:27:26 -0000 On Sat, Aug 20, 2016 at 11:01 AM, Bruce Simpson wrote: > tun(4) on the other hand is a plain, PPP-like, IP tunnel. > Can you send a broadcast packet through an L3 tunnel? I thought that a L2 tunnel was required. But this mbuf flag is not guaranteed to be set in all situations; e.g. > where the link layer does not have the concept of broadcast being distinct > from other kinds of network traffic. PPP and ATM are the most obvious > examples. > We don't support ATM, but PPP is a good example. I hadn't thought of that. Hm, ip_input() already has to check for a broadcast IP. What it set M_BCAST on the mbuf at that time? From owner-svn-src-head@freebsd.org Sat Aug 20 15:42:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 675A7BC0AEF; Sat, 20 Aug 2016 15:42:55 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 293F218C7; Sat, 20 Aug 2016 15:42:54 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id D9A86202F5; Sat, 20 Aug 2016 11:42:53 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 11:42:53 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=LYUiRwQW/Yn0ths87CpgZiZgB3k=; b=LLZSIc /4dEN4bPR8LZNV0pVk97oPatlvOCi3fR3ng3wkcfoC3wx9pcCPSrpm56MmS9G4xx 6cED7pjGf5Bklbh6LnHNA5yWckKCdnmF7x7AU2Sczw+xOPK05jzcv8nJ8ctlTbLQ BTTKIgKVauYxvtk7psDSrPXudLtk41oez/bK0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=LYUiRwQW/Yn0ths 87CpgZiZgB3k=; b=UK2Esf1gn6ZpSIYDvMQ8a6+kAsRA901DcVhJimC6xoozUd7 E0+qUHSQAjkRai5wk2ZPz+x2TnwvQqkmX1DxM679iAbER7UEzzyE3f6DTP9yr5YO an48Ddp7fnG6K3gKE/1HiVFuK3lhhav1waDEp8R6PhpHndgvV4WAMazwlK/o= X-Sasl-enc: xwIL2zYPqE4RXuqZLNZV+0mKcz0R/myLAhUpidRGoScs 1471707773 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 04CA2F296F; Sat, 20 Aug 2016 11:42:52 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bruce Simpson Message-ID: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> Date: Sat, 20 Aug 2016 16:42:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 15:42:55 -0000 On 20/08/16 16:27, Ryan Stone wrote: > Can you send a broadcast packet through an L3 tunnel? I thought that a > L2 tunnel was required. Yes. This is perfectly legal and necessary for forwarding of IPv4 broadcasts to work. (it is Internet Protocol after all, not Infernal-ethernet-extension Protocol. ;-)) The change is in UDP input so it will not affect routers. But if a FreeBSD system were at the end of a link layer, and was the final recipient of the IPv4 broadcast packet, then if that link layer is not Ethernet, all bets are off. That situation could occur very easily where FreeBSD is hanging off the end of a PPPoE link: e.g. consumer DSL, microwave, etc. The underlying link layer for the tunnel might be Ethernet, but it will be demuxed as a PPP tunnel. PPP is treated as a bit pipe and does not normally distinguish between unicast, broadcast, multicast. Broadcast destined for the host on its PPP address would be transported inside the tunnel, encapsulated as a normal unicast Ethernet packet. > But this mbuf flag is not guaranteed to be set in all situations; > e.g. where the link layer does not have the concept of broadcast > being distinct from other kinds of network traffic. PPP and ATM are > the most obvious examples. > > > We don't support ATM, but PPP is a good example. I hadn't thought of > that. Hm, ip_input() already has to check for a broadcast IP. What it > set M_BCAST on the mbuf at that time? ATM is one of those things everyone kind of has to support by default in some way because of the ITU ADSL specs. It is literally written into G.992.x. Linux can do it, FreeBSD can't. PPP over ATM is something BT inflicted on the UK all by themselves, though, and we wish it would just go away. Whilst your suggestion may work, it may be dangerous, as you are then stepping on the meaning of the flags. Some of them are intended to be used for one layer to signal another. M_BCAST is pretty rigidly defined in mbuf.h as "The link layer received this as a broadcast / I intended for link layer to send this as a broadcast". M_PROTOFLAGS is normally used to clear flags with different meaning in different protocol layers. M_MCAST also has similar status. On my PhD, I wrote code which uses a private Ethernet link between FreeBSD routers for load distribution; it distributes unicast traffic using IPv6 multicast. It uses multicast both as convenience, and as a way to 'channelise' traffic if the Ethernet link supports it, using multicast groups. (Modern shared memory switches can slice L2 multicast traffic like this quite efficiently. So one slice of unicast traffic could be switched across locations purely at L2. However, the distribution of actual IPv6 multicast was out of scope.) The routers have to very carefully clear M_MCAST on egress, to ensure normal L2 next-hop resolution for IPv6 destinations. From owner-svn-src-head@freebsd.org Sat Aug 20 16:17:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F448BC047D for ; Sat, 20 Aug 2016 16:17:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::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 E5E3C1A6A for ; Sat, 20 Aug 2016 16:17:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22b.google.com with SMTP id n128so49639650ith.1 for ; Sat, 20 Aug 2016 09:17:56 -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=Dy/42n6ZEpFBcrEoNKxZ/1ZwMFvS8KP2a8stVxxfxuo=; b=N/0vQOBUm1LVBnpMvNCC0pmiYbj3x2FSARFh1NzWk84vLO9IWe0QrwS+asfTdlMBAy hi/4f7opiqY93NKxNOANEyFmXmy8YMOzfyo7MKEvJ+Q3hn+2MfkwTHUCmv/u15txdabt HP8dn5fGgFzApZ93cfRVYiqxBt7p21zoGsRBfoFw6BtJN+Yp6EfMP04uMj7AViDFvo1F yeMFJDOoVMfa2QGci/jCqPyR2oRS4ny8A2vnzqnS1bpbyLeSzJhhRfA8jvwuLdeva8oj ulmim+Bt1nwBBWNzuhUSJoMELCSDwa5pCXb9/lVg+NgQ6f85r3QMSBGTqwKMJWroBzZw 8cxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Dy/42n6ZEpFBcrEoNKxZ/1ZwMFvS8KP2a8stVxxfxuo=; b=VQQZGm9oYlBVhZLzYvNjJApf4BDaS6wm75K5hKFWDFro1WInVbvLKoRntllKJ3/Jii aKI34JJY7d84PCmkMUaN3/r5pKKMGD0wmoEh/fsI/zgDaxAaXpkWFJYWIhRziwrvYoPI pdYwPSM+Hy5i4TA59nZIGZhWmRVToI4Utdwovml2dkdQ5sd0ugAbFyxFxZ7OtSs3lApP yQoIZSoFKEHNmXeZtFRMfVz7K0GSf/Wb46k3upKsJxvIHdCH79i8j/w+wGKtCF5if0ax b98GsiFB9Pa8R/jxqmStP40fFPLxTJgA21vgE2S3wzy3vHaSHdQhqZGq12Md8eqIpXiF Uakg== X-Gm-Message-State: AEkoouv89UDzqOSqRS4kiL7U1kYO6sOK9FpBQKMgojA72uPQhbT0IJY9MDFJrkkQTEBQzLldagTvKRUzndfw4g== X-Received: by 10.36.17.20 with SMTP id 20mr13014752itf.94.1471709876122; Sat, 20 Aug 2016 09:17:56 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Sat, 20 Aug 2016 09:17:55 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <9056382.PA4dZNFpPe@ralph.baldwin.cx> References: <201608192227.u7JMREIo032684@repo.freebsd.org> <9056382.PA4dZNFpPe@ralph.baldwin.cx> From: Warner Losh Date: Sat, 20 Aug 2016 10:17:55 -0600 X-Google-Sender-Auth: c7HXzinL-m4Hh4pe7mo_IR9W__k Message-ID: Subject: Re: svn commit: r304506 - in head: . release/doc/en_US.ISO8859-1/hardware share/man/man4/man4.i386 sys/conf sys/dev/wl sys/i386/conf sys/modules sys/modules/wl targets/pseudo/userland tools/build/mk to... To: John Baldwin 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.22 Precedence: list List-Id: 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, 20 Aug 2016 16:17:57 -0000 On Sat, Aug 20, 2016 at 8:33 AM, John Baldwin wrote: > On Friday, August 19, 2016 06:38:01 PM Warner Losh wrote: >> On Fri, Aug 19, 2016 at 4:27 PM, John Baldwin wrote: >> > Author: jhb >> > Date: Fri Aug 19 22:27:14 2016 >> > New Revision: 304506 >> > URL: https://svnweb.freebsd.org/changeset/base/304506 >> > >> > Log: >> > Remove the wl(4) driver and wlconfig(8) utility. >> > >> > The wl(4) driver supports pre-802.11 PCCard wireless adapters that >> > are slower than 802.11b. They do not work with any of the 802.11 >> > framework and the driver hasn't been reported to actually work in a >> > long time. >> >> s/PC Card/ISA/g >> >> There never were any PC Card wl cards. These cards were ISA only >> and ran at up to 1Mbps. > > Wow, even worse than I thought. In the days of 144kbps ISDN lines being the best you could get many places, 1Mbps was awesome. I had one for a 7 mile link to a friend's house in town who had better connectivity. Cards supported by the awi driver were 2Mbps and were the first 802.11 cards. wi blew that away with 10Mbps and a variety of suppliers... wl lost its relevance in 2000 or so. wi was committed in 1999 for hardware that had been around a couple of years in various forms. There was a fast adaptation of it. I moved from my wl-based system to wi-based in 2000 or so once I was able to get a ISA to PC Card adapter and the right connectors to go from the funky tiny connectors on the WaveLan cards to the N connectors that the rest of the gear was setup with. Heck, wi hasn't been all that relevant since ath went into the tree with the boatload of features it supported and way better features... And that's been since 2003 or 2004 or so. Warner From owner-svn-src-head@freebsd.org Sat Aug 20 16:23:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C056BC063E; Sat, 20 Aug 2016 16:23:21 +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 198B81F1F; Sat, 20 Aug 2016 16:23: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 u7KGNKkW034014; Sat, 20 Aug 2016 16:23:20 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KGNJn7034005; Sat, 20 Aug 2016 16:23:19 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201608201623.u7KGNJn7034005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 20 Aug 2016 16:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304532 - in head/sys/boot: common efi/loader/arch/amd64 fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 16:23:21 -0000 Author: tsoome Date: Sat Aug 20 16:23:19 2016 New Revision: 304532 URL: https://svnweb.freebsd.org/changeset/base/304532 Log: loader is filling fixed length command_errbuf with sprintf() and is trusting strings provided by user/config files. This update is replacing sprintf with snprintf for cases the command_errbuf is built from dynamic content. PR: 211958 Reported by: ecturt@gmail.com Reviewed by: imp, allanjude Approved by: imp (mentor), allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D7563 Modified: head/sys/boot/common/boot.c head/sys/boot/common/bootstrap.h head/sys/boot/common/commands.c head/sys/boot/common/interp.c head/sys/boot/common/ls.c head/sys/boot/common/module.c head/sys/boot/efi/loader/arch/amd64/framebuffer.c head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/common/boot.c ============================================================================== --- head/sys/boot/common/boot.c Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/common/boot.c Sat Aug 20 16:23:19 2016 (r304532) @@ -61,7 +61,8 @@ command_boot(int argc, char *argv[]) /* XXX maybe we should discard everything and start again? */ if (file_findfile(NULL, NULL) != NULL) { - sprintf(command_errbuf, "can't boot '%s', kernel module already loaded", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't boot '%s', kernel module already loaded", argv[1]); return(CMD_ERROR); } @@ -129,7 +130,8 @@ command_autoboot(int argc, char *argv[]) case 2: howlong = strtol(argv[1], &cp, 0); if (*cp != 0) { - sprintf(command_errbuf, "bad delay '%s'", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "bad delay '%s'", argv[1]); return(CMD_ERROR); } /* FALLTHROUGH */ Modified: head/sys/boot/common/bootstrap.h ============================================================================== --- head/sys/boot/common/bootstrap.h Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/common/bootstrap.h Sat Aug 20 16:23:19 2016 (r304532) @@ -35,8 +35,9 @@ /* Commands and return values; nonzero return sets command_errmsg != NULL */ typedef int (bootblk_cmd_t)(int argc, char *argv[]); +#define COMMAND_ERRBUFSZ (256) extern char *command_errmsg; -extern char command_errbuf[]; /* XXX blah, length */ +extern char command_errbuf[COMMAND_ERRBUFSZ]; #define CMD_OK 0 #define CMD_WARN 1 #define CMD_ERROR 2 Modified: head/sys/boot/common/commands.c ============================================================================== --- head/sys/boot/common/commands.c Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/common/commands.c Sat Aug 20 16:23:19 2016 (r304532) @@ -33,7 +33,8 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" char *command_errmsg; -char command_errbuf[256]; /* XXX should have procedural interface for setting, size limit? */ +/* XXX should have procedural interface for setting, size limit? */ +char command_errbuf[COMMAND_ERRBUFSZ]; static int page_file(char *filename); @@ -196,7 +197,8 @@ command_help(int argc, char *argv[]) pager_close(); close(hfd); if (!matched) { - sprintf(command_errbuf, "no help available for '%s'", topic); + snprintf(command_errbuf, sizeof(command_errbuf), + "no help available for '%s'", topic); free(topic); if (subtopic) free(subtopic); @@ -276,7 +278,8 @@ command_show(int argc, char *argv[]) if ((cp = getenv(argv[1])) != NULL) { printf("%s\n", cp); } else { - sprintf(command_errbuf, "variable '%s' not found", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "variable '%s' not found", argv[1]); return(CMD_ERROR); } } @@ -386,7 +389,8 @@ command_read(int argc, char *argv[]) case 't': timeout = strtol(optarg, &cp, 0); if (cp == optarg) { - sprintf(command_errbuf, "bad timeout '%s'", optarg); + snprintf(command_errbuf, sizeof(command_errbuf), + "bad timeout '%s'", optarg); return(CMD_ERROR); } break; @@ -454,8 +458,10 @@ page_file(char *filename) result = pager_file(filename); - if (result == -1) - sprintf(command_errbuf, "error showing %s", filename); + if (result == -1) { + snprintf(command_errbuf, sizeof(command_errbuf), + "error showing %s", filename); + } return result; } Modified: head/sys/boot/common/interp.c ============================================================================== --- head/sys/boot/common/interp.c Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/common/interp.c Sat Aug 20 16:23:19 2016 (r304532) @@ -214,7 +214,8 @@ include(const char *filename) #endif if (((fd = open(filename, O_RDONLY)) == -1)) { - sprintf(command_errbuf,"can't open '%s': %s", filename, strerror(errno)); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't open '%s': %s", filename, strerror(errno)); return(CMD_ERROR); } @@ -256,8 +257,9 @@ include(const char *filename) script = script->next; free(se); } - sprintf(command_errbuf, "file '%s' line %d: memory allocation " - "failure - aborting", filename, line); + snprintf(command_errbuf, sizeof(command_errbuf), + "file '%s' line %d: memory allocation failure - aborting", + filename, line); return (CMD_ERROR); } strcpy(sp->text, cp); @@ -291,7 +293,9 @@ include(const char *filename) #ifdef BOOT_FORTH res = bf_run(sp->text); if (res != VM_OUTOFTEXT) { - sprintf(command_errbuf, "Error while including %s, in the line:\n%s", filename, sp->text); + snprintf(command_errbuf, sizeof(command_errbuf), + "Error while including %s, in the line:\n%s", + filename, sp->text); res = CMD_ERROR; break; } else Modified: head/sys/boot/common/ls.c ============================================================================== --- head/sys/boot/common/ls.c Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/common/ls.c Sat Aug 20 16:23:19 2016 (r304532) @@ -150,7 +150,8 @@ ls_getdir(char **pathp) /* Make sure the path is respectable to begin with */ if (archsw.arch_getdev(NULL, path, &cp)) { - sprintf(command_errbuf, "bad path '%s'", path); + snprintf(command_errbuf, sizeof(command_errbuf), + "bad path '%s'", path); goto out; } @@ -160,15 +161,18 @@ ls_getdir(char **pathp) fd = open(path, O_RDONLY); if (fd < 0) { - sprintf(command_errbuf, "open '%s' failed: %s", path, strerror(errno)); + snprintf(command_errbuf, sizeof(command_errbuf), + "open '%s' failed: %s", path, strerror(errno)); goto out; } if (fstat(fd, &sb) < 0) { - sprintf(command_errbuf, "stat failed: %s", strerror(errno)); + snprintf(command_errbuf, sizeof(command_errbuf), + "stat failed: %s", strerror(errno)); goto out; } if (!S_ISDIR(sb.st_mode)) { - sprintf(command_errbuf, "%s: %s", path, strerror(ENOTDIR)); + snprintf(command_errbuf, sizeof(command_errbuf), + "%s: %s", path, strerror(ENOTDIR)); goto out; } Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/common/module.c Sat Aug 20 16:23:19 2016 (r304532) @@ -143,7 +143,8 @@ command_load(int argc, char *argv[]) fp = file_findfile(argv[1], typestr); if (fp) { - sprintf(command_errbuf, "warning: file '%s' already loaded", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: file '%s' already loaded", argv[1]); return (CMD_WARN); } @@ -162,7 +163,8 @@ command_load(int argc, char *argv[]) if (dokld || file_havepath(argv[1])) { error = mod_loadkld(argv[1], argc - 2, argv + 2); if (error == EEXIST) { - sprintf(command_errbuf, "warning: KLD '%s' already loaded", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: KLD '%s' already loaded", argv[1]); return (CMD_WARN); } @@ -173,7 +175,8 @@ command_load(int argc, char *argv[]) */ error = mod_load(argv[1], NULL, argc - 2, argv + 2); if (error == EEXIST) { - sprintf(command_errbuf, "warning: module '%s' already loaded", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: module '%s' already loaded", argv[1]); return (CMD_WARN); } @@ -202,7 +205,8 @@ command_load_geli(int argc, char *argv[] case 'n': num = strtol(optarg, &cp, 0); if (cp == optarg) { - sprintf(command_errbuf, "bad key index '%s'", optarg); + snprintf(command_errbuf, sizeof(command_errbuf), + "bad key index '%s'", optarg); return(CMD_ERROR); } break; @@ -334,8 +338,8 @@ file_load(char *filename, vm_offset_t de if (error == EFTYPE) continue; /* Unknown to this handler? */ if (error) { - sprintf(command_errbuf, "can't load file '%s': %s", - filename, strerror(error)); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't load file '%s': %s", filename, strerror(error)); break; } } @@ -371,8 +375,8 @@ file_load_dependencies(struct preloaded_ */ mp = file_findmodule(NULL, dmodname, verinfo); if (mp == NULL) { - sprintf(command_errbuf, "module '%s' exists but with wrong version", - dmodname); + snprintf(command_errbuf, sizeof(command_errbuf), + "module '%s' exists but with wrong version", dmodname); error = ENOENT; break; } @@ -411,12 +415,14 @@ file_loadraw(const char *fname, char *ty /* locate the file on the load path */ name = file_search(fname, NULL); if (name == NULL) { - sprintf(command_errbuf, "can't find '%s'", fname); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't find '%s'", fname); return(NULL); } if ((fd = open(name, O_RDONLY)) < 0) { - sprintf(command_errbuf, "can't open '%s': %s", name, strerror(errno)); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't open '%s': %s", name, strerror(errno)); free(name); return(NULL); } @@ -433,7 +439,8 @@ file_loadraw(const char *fname, char *ty if (got == 0) /* end of file */ break; if (got < 0) { /* error */ - sprintf(command_errbuf, "error reading '%s': %s", name, strerror(errno)); + snprintf(command_errbuf, sizeof(command_errbuf), + "error reading '%s': %s", name, strerror(errno)); free(name); close(fd); return(NULL); @@ -487,13 +494,15 @@ mod_load(char *modname, struct mod_depen free(mp->m_args); mp->m_args = unargv(argc, argv); #endif - sprintf(command_errbuf, "warning: module '%s' already loaded", mp->m_name); + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: module '%s' already loaded", mp->m_name); return (0); } /* locate file with the module on the search path */ filename = mod_searchmodule(modname, verinfo); if (filename == NULL) { - sprintf(command_errbuf, "can't find '%s'", modname); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't find '%s'", modname); return (ENOENT); } err = mod_loadkld(filename, argc, argv); @@ -516,7 +525,8 @@ mod_loadkld(const char *kldname, int arg */ filename = file_search(kldname, kld_ext_list); if (filename == NULL) { - sprintf(command_errbuf, "can't find '%s'", kldname); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't find '%s'", kldname); return (ENOENT); } /* @@ -524,7 +534,8 @@ mod_loadkld(const char *kldname, int arg */ fp = file_findfile(filename, NULL); if (fp) { - sprintf(command_errbuf, "warning: KLD '%s' already loaded", filename); + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: KLD '%s' already loaded", filename); free(filename); return (0); } @@ -548,8 +559,10 @@ mod_loadkld(const char *kldname, int arg break; } } while(0); - if (err == EFTYPE) - sprintf(command_errbuf, "don't know how to load module '%s'", filename); + if (err == EFTYPE) { + snprintf(command_errbuf, sizeof(command_errbuf), + "don't know how to load module '%s'", filename); + } if (err && fp) file_discard(fp); free(filename); Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/framebuffer.c Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/efi/loader/arch/amd64/framebuffer.c Sat Aug 20 16:23:19 2016 (r304532) @@ -474,8 +474,9 @@ command_gop(int argc, char *argv[]) status = BS->LocateProtocol(&gop_guid, NULL, (VOID **)&gop); if (EFI_ERROR(status)) { - sprintf(command_errbuf, "%s: Graphics Output Protocol not " - "present (error=%lu)", argv[0], EFI_ERROR_CODE(status)); + snprintf(command_errbuf, sizeof(command_errbuf), + "%s: Graphics Output Protocol not present (error=%lu)", + argv[0], EFI_ERROR_CODE(status)); return (CMD_ERROR); } @@ -494,9 +495,9 @@ command_gop(int argc, char *argv[]) } status = gop->SetMode(gop, mode); if (EFI_ERROR(status)) { - sprintf(command_errbuf, "%s: Unable to set mode to " - "%u (error=%lu)", argv[0], mode, - EFI_ERROR_CODE(status)); + snprintf(command_errbuf, sizeof(command_errbuf), + "%s: Unable to set mode to %u (error=%lu)", + argv[0], mode, EFI_ERROR_CODE(status)); return (CMD_ERROR); } } else if (!strcmp(argv[1], "get")) { @@ -526,8 +527,8 @@ command_gop(int argc, char *argv[]) return (CMD_OK); usage: - sprintf(command_errbuf, "usage: %s [list | get | set ]", - argv[0]); + snprintf(command_errbuf, sizeof(command_errbuf), + "usage: %s [list | get | set ]", argv[0]); return (CMD_ERROR); } @@ -542,8 +543,9 @@ command_uga(int argc, char *argv[]) status = BS->LocateProtocol(&uga_guid, NULL, (VOID **)&uga); if (EFI_ERROR(status)) { - sprintf(command_errbuf, "%s: UGA Protocol not present " - "(error=%lu)", argv[0], EFI_ERROR_CODE(status)); + snprintf(command_errbuf, sizeof(command_errbuf), + "%s: UGA Protocol not present (error=%lu)", + argv[0], EFI_ERROR_CODE(status)); return (CMD_ERROR); } @@ -551,8 +553,8 @@ command_uga(int argc, char *argv[]) goto usage; if (efifb_from_uga(&efifb, uga) != CMD_OK) { - sprintf(command_errbuf, "%s: Unable to get UGA information", - argv[0]); + snprintf(command_errbuf, sizeof(command_errbuf), + "%s: Unable to get UGA information", argv[0]); return (CMD_ERROR); } @@ -561,6 +563,6 @@ command_uga(int argc, char *argv[]) return (CMD_OK); usage: - sprintf(command_errbuf, "usage: %s", argv[0]); + snprintf(command_errbuf, sizeof(command_errbuf), "usage: %s", argv[0]); return (CMD_ERROR); } Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/fdt/fdt_loader_cmd.c Sat Aug 20 16:23:19 2016 (r304532) @@ -194,14 +194,14 @@ fdt_load_dtb(vm_offset_t va) COPYOUT(va, &header, sizeof(header)); err = fdt_check_header(&header); if (err < 0) { - if (err == -FDT_ERR_BADVERSION) - sprintf(command_errbuf, + if (err == -FDT_ERR_BADVERSION) { + snprintf(command_errbuf, sizeof(command_errbuf), "incompatible blob version: %d, should be: %d", fdt_version(fdtp), FDT_LAST_SUPPORTED_VERSION); - - else - sprintf(command_errbuf, "error validating blob: %s", - fdt_strerror(err)); + } else { + snprintf(command_errbuf, sizeof(command_errbuf), + "error validating blob: %s", fdt_strerror(err)); + } return (1); } @@ -236,8 +236,8 @@ fdt_load_dtb_addr(struct fdt_header *hea fdtp_size = fdt_totalsize(header); err = fdt_check_header(header); if (err < 0) { - sprintf(command_errbuf, "error validating blob: %s", - fdt_strerror(err)); + snprintf(command_errbuf, sizeof(command_errbuf), + "error validating blob: %s", fdt_strerror(err)); return (err); } free(fdtp); @@ -263,7 +263,8 @@ fdt_load_dtb_file(const char * filename) /* Attempt to load and validate a new dtb from a file. */ if ((bfp = file_loadraw(filename, "dtb", 1)) == NULL) { - sprintf(command_errbuf, "failed to load file '%s'", filename); + snprintf(command_errbuf, sizeof(command_errbuf), + "failed to load file '%s'", filename); return (1); } if ((err = fdt_load_dtb(bfp->f_addr)) != 0) { @@ -609,7 +610,8 @@ fdt_fixup_memory(struct fdt_mem_region * /* Create proper '/memory' node. */ memory = fdt_add_subnode(fdtp, root, "memory"); if (memory <= 0) { - sprintf(command_errbuf, "Could not fixup '/memory' " + snprintf(command_errbuf, sizeof(command_errbuf), + "Could not fixup '/memory' " "node, error code : %d!\n", memory); return; } @@ -626,7 +628,8 @@ fdt_fixup_memory(struct fdt_mem_region * size_cellsp = (uint32_t *)fdt_getprop(fdtp, root, "#size-cells", NULL); if (addr_cellsp == NULL || size_cellsp == NULL) { - sprintf(command_errbuf, "Could not fixup '/memory' node : " + snprintf(command_errbuf, sizeof(command_errbuf), + "Could not fixup '/memory' node : " "%s %s property not found in root node!\n", (!addr_cellsp) ? "#address-cells" : "", (!size_cellsp) ? "#size-cells" : ""); @@ -906,7 +909,8 @@ fdt_cmd_addr(int argc, char *argv[]) hdr = (struct fdt_header *)strtoul(addr, &cp, 16); if (cp == addr) { - sprintf(command_errbuf, "Invalid address: %s", addr); + snprintf(command_errbuf, sizeof(command_errbuf), + "Invalid address: %s", addr); return (CMD_ERROR); } @@ -945,7 +949,8 @@ fdt_cmd_cd(int argc, char *argv[]) o = fdt_path_offset(fdtp, path); if (o < 0) { - sprintf(command_errbuf, "could not find node: '%s'", path); + snprintf(command_errbuf, sizeof(command_errbuf), + "could not find node: '%s'", path); return (CMD_ERROR); } @@ -953,8 +958,8 @@ fdt_cmd_cd(int argc, char *argv[]) return (CMD_OK); fail: - sprintf(command_errbuf, "path too long: %d, max allowed: %d", - len, FDT_CWD_LEN - 1); + snprintf(command_errbuf, sizeof(command_errbuf), + "path too long: %d, max allowed: %d", len, FDT_CWD_LEN - 1); return (CMD_ERROR); } @@ -1037,7 +1042,8 @@ fdt_cmd_ls(int argc, char *argv[]) o = fdt_path_offset(fdtp, path); if (o < 0) { - sprintf(command_errbuf, "could not find node: '%s'", path); + snprintf(command_errbuf, sizeof(command_errbuf), + "could not find node: '%s'", path); return (CMD_ERROR); } @@ -1483,7 +1489,8 @@ fdt_extract_nameloc(char **pathp, char * return (1); } if (o < 0) { - sprintf(command_errbuf, "could not find node: '%s'", path); + snprintf(command_errbuf, sizeof(command_errbuf), + "could not find node: '%s'", path); return (1); } *namep = name; @@ -1530,7 +1537,8 @@ fdt_cmd_prop(int argc, char *argv[]) o = fdt_path_offset(fdtp, path); if (o < 0) { - sprintf(command_errbuf, "could not find node: '%s'", path); + snprintf(command_errbuf, sizeof(command_errbuf), + "could not find node: '%s'", path); rv = CMD_ERROR; goto out; } @@ -1623,8 +1631,9 @@ fdt_cmd_rm(int argc, char *argv[]) return (CMD_ERROR); if ((rv = fdt_delprop(fdtp, o, propname)) != 0) { - sprintf(command_errbuf, "could not delete" - "%s\n", (rv == -FDT_ERR_NOTFOUND) ? + snprintf(command_errbuf, sizeof(command_errbuf), + "could not delete %s\n", + (rv == -FDT_ERR_NOTFOUND) ? "(property/node does not exist)" : ""); return (CMD_ERROR); From owner-svn-src-head@freebsd.org Sat Aug 20 16:27:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 862FCBC077A for ; Sat, 20 Aug 2016 16:27:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::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 4E6EF1397 for ; Sat, 20 Aug 2016 16:27:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id e63so8532882ith.1 for ; Sat, 20 Aug 2016 09:27:06 -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=95seXCNaNNZQstCyvOjKrdvLSzvuovFq9BTsM7xvg7o=; b=QfcqJW0o5Vx4Zepcf+UWWTW2A0VGEeu7hHRjBdJrjhw1T2/6wAD7ShBnrGV8RjQY9B 38urdzRipUiSDP/EqVQxdbcKZ0LuTV3mVNEfsQoufzwkOTuH6+wIPcPkbvEKqOt3ccSH LHIEvjTgQ5WTFNJx4gHlRNamppyxYetzhMPIIR1asUyc+rcYfK0LvQtFxpwASH+ku50r xTUv/9WmclUXLle7udBEDgk0dloLnWb2OraLLb0XlaawiEMQLX3sn1PejbnaeIY8/dlX /ZDbdXT1y/sPwa36cCURgLKnXGuTBs0qAwRUDOrs01sBE9I7gKt9EcFz2H8iqf2Q9qX4 MXuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=95seXCNaNNZQstCyvOjKrdvLSzvuovFq9BTsM7xvg7o=; b=G34bdbMhn0wyD9mIjtUq63lIDzoyzkWQxVM+skoQrhjZAzuICSC1+7B2QDTLJ6kuS0 C8hQb6RL1eg4X16HMA7KvFeqzN03W//hmta3EEqZO40x6LSCFwxbFBPdrvnQe+F7dtC8 7l6oWnOYYkhfUyVoga5q6Z+jIZ/oZCocmYb7bI0Nb9yvMLGmnDn+m3VbI2JwRfl8WBEo lZVQ4ySnUDIjYWXh9Vt85+KR+koZXh2XsxDgTU52oAHC+IC0tMpEHX5mw//8hLh1ASoi kB27L+0nu8Q/TjZ8dE3rmSDYUZcekACMZplWIG7dYd1aDsFTAgNaKpPlfnztOWREAKUg dqiA== X-Gm-Message-State: AEkoouvztWJT1/WXWpZOVddwflxuDTXjLMY56PbtOMU1cb2JcXOYLORc0/l5vvtOD/qlGLeQtUwb/820HBfe5Q== X-Received: by 10.36.236.193 with SMTP id g184mr2263784ith.32.1471710425724; Sat, 20 Aug 2016 09:27:05 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Sat, 20 Aug 2016 09:27:05 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <1699917.hhfoKyASTk@ralph.baldwin.cx> References: <201608200049.u7K0nUYd084685@repo.freebsd.org> <1699917.hhfoKyASTk@ralph.baldwin.cx> From: Warner Losh Date: Sat, 20 Aug 2016 10:27:05 -0600 X-Google-Sender-Auth: sZ77SfQ7zrVEf9mYFqjGbs5GJEg Message-ID: Subject: Re: svn commit: r304513 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/ie sys/i386/conf sys/modules sys/modules/ie sys/pc98/conf To: John Baldwin 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.22 Precedence: list List-Id: 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, 20 Aug 2016 16:27:06 -0000 On Sat, Aug 20, 2016 at 8:51 AM, John Baldwin wrote: > On Saturday, August 20, 2016 12:49:30 AM John Baldwin wrote: >> Author: jhb >> Date: Sat Aug 20 00:49:29 2016 >> New Revision: 304513 >> URL: https://svnweb.freebsd.org/changeset/base/304513 >> >> Log: >> Remove the ie(4) driver for Intel 82586 ISA Ethernet adapters. >> >> This driver only supports 10Mb Ethernet using PIO (the hardware supports >> DMA, but the driver only does PIO). There are not any PCCard adapters >> supported by this driver, only ISA cards. In addition, it does not use >> bus_space but instead uses bcopy with volatile pointers triggering a >> host of warnings. (if_ie.c is one of 3 files always built with >> -Wno-error) >> >> Relnotes: yes > > This concludes the list of older drivers I had from earlier after working > on the timeout(9) -> callout(9) changes (almost finished with that, just > a few things left to test changes for, one of them being fail points before > we can remove timeout()/untimeout() entirely). > > I do not have plans for removing any other drivers, though am open to > suggestions. Some possibilities include: > > - tty drivers that haven't been updated to new tty and have been disconnected > from the build since 8.0 including digi(4) and cy(4). I know Bruce has > patches for sio(4) that I just haven't merged, so I'm inclined to leave > sio(4), but the other disconnected drivers are candidates I think. These should be removed. > - Older storage adapters: > - aha (ISA) > - ahb (EISA) > - adv (ISA / EISA / PCI) > - adw (PCI)? > - bt (ISA / EISA / PCI) > - aic (ISA / PCCard) Most of these can go. There were PC Card versions of adv, but I never got around to getting the adv attachment working. Mostly because the cards were expensive and the one that fell into my hands lacked the dongle. aic was a workhorse, but I think is no longer. > - ct (ISA / CBUS) ct likely should stay. It's used in a lot of PC-98 gear that I think is still deployed. > - dpt (ISA / EISA / PCI) Not sure on this one. > - ncv (PCCard / PCI) > - nsp (PCCard) > - stg (ISA / PCCard / PCI) > (Note: some of these are PC-98 related and might remove too much of the > PC-98 ecosystem if removed?) That's hard to say. They were widely used on PC-9821 laptops back in the day, but I'm not sure how much. I'd be inclined to keep them in pending discussions with the pc98 folks. > - mse(4) (ISA-only non-PS-2, non-serial mouse) This is the PC-98 mouse. > - joy(4) (ISA-only, was on various Sound Cards, etc., but I haven't seen > a "game port" on a modern box in a long while) If it still works, what's the rush? Then again, I doubt it's been attached to in many years. EISA can likely be safely removed in 12. It was deprecated in 11 when I made it opt-in. MCA likely can go too. I used to have a boatload of aha and bt cards, but gave up on them years ago. It would be a shame to see them go, but it would help to cleanup CAM a bit since many of the dark corner cases in CAM exist for one ancient SIM or another. While I'd like my aic card to keep working, I've long since tossed the SCSI gear I used to connect with it. The PC Card network drivers, on the other hand, do all still work and I've tested them recently. I'll send pics of my wall of drawers that I keep them all in. My only request is that if there's any PC Card related removals to please put me on the reviews. Warner From owner-svn-src-head@freebsd.org Sat Aug 20 16:27:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08A1EBC07AE; Sat, 20 Aug 2016 16:27:24 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF3251575; Sat, 20 Aug 2016 16:27:23 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id A0BFC201CC; Sat, 20 Aug 2016 12:27:22 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 12:27:22 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=xeOSLIFBYuICVQfKvILC/IX2ZFc=; b=GsZEPA zrZLqLn+kyIQ765wk8GyNAVwIJ9YoXTK3PC8z/7ko2lyAqa8J+ivS9oghN5Ze6E3 dBhGAKsU6ixfI5s7CoIvd8SjKBVvldoigIfVfL1qPsd/ERIaPkRxQ2ahxNkBNbfv EKF7USPU7siiA9lSVX0Ry6lm2t6Avx+q+7zdA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=xeOSLIFBYuICVQf KvILC/IX2ZFc=; b=IWDvx4/recMznSVftLj0jn4lS1SacKEMeOksDRyY8Yg7DRK vaA9UG9REBOiSGFosf/RXoNOznvcP4W+/QwDzwik5CHzprEOOrNclTLxLFD7+0tn gMksPF27d6jEpEwjKSJub76tJq7GLr5xEeOuxsLIG7Cz7llSeZeEWUE02UKU= X-Sasl-enc: 8tOkE+GdM5NfsFvgM7oX/e7b7B5yi9jGaRo4kcdOwaWV 1471710442 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id BDA1DF2986; Sat, 20 Aug 2016 12:27:21 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bruce Simpson Message-ID: <091555f6-05a8-3f91-0486-beb6531abd34@fastmail.net> Date: Sat, 20 Aug 2016 17:27:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 16:27:24 -0000 On 20/08/16 16:42, Bruce Simpson wrote: > On 20/08/16 16:27, Ryan Stone wrote: >> Can you send a broadcast packet through an L3 tunnel? I thought that a >> L2 tunnel was required. > > Yes. This is perfectly legal and necessary for forwarding of IPv4 > broadcasts to work. (it is Internet Protocol after all, not > Infernal-ethernet-extension Protocol. ;-)) For completeness: This does not hold true for L2 in L2, the most obvious example being Metro Ethernet VMAN style service. There, Ethernet is the transport (link layer), as well as the payload. That's a concrete example of the kind of L2 'tunnel' you may be referring to. Sometimes, specific Ethernet [broad|multi]cast destinations -- notably L2 control protocols, e.g. RSTP within the customer VLAN, may need to be tunnelled (Provider-Backbone-Bridges (PBB) style). Alternatively, the L2 destination MAC may be rewritten for that specific address, to avoid the destination being interpreted by routers in the Metro Ethernet core. It can be considered a crude form of Ethernet NAT, but it's common practice. But, for IP, forwarding IPv4 directed broadcast packets over a non-broadcast link is completely legal (and required for normal operation). From owner-svn-src-head@freebsd.org Sat Aug 20 16:30:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD325BC0947; Sat, 20 Aug 2016 16:30:02 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E97C19FC; Sat, 20 Aug 2016 16:30:02 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 8904420292; Sat, 20 Aug 2016 12:30:01 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 12:30:01 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=sIB/sfc8rtF+GuAFxaEs1far7Pg=; b=gjcK7K bQaykjSsfhfN18CZrVWJxXhBlAn53LOJvuIivfOlp56GR3kA5/OywAsmPBDYnnKb PkfRNJGFE2Y0YZz1tmvzeWWqkhhygTGoRhOzsOk1YsEUILJ9odQOITowKq/hsj2H 1i1QH+saceIJFQImDqMgyUdu/GmDJIshaUaOM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=sIB/sfc8rtF+GuA FxaEs1far7Pg=; b=f1EAqDC5DDpmNiUxB88vroRBwfXrKe392fmu/7Iej4fNOki 2rWjQkb3bey/0HhsaWTaHmhdLuVGo/+fNlBndKLYvsl7pbFwRmijHUB4ohHk2Lav Shl5jysMiC9U70V0O5pFzbuppmhCaYjQ+7iJd+y37D8PF0PAM1KsaJOwhEng= X-Sasl-enc: V/YZyvhsPuokhS8czSFf2FkHLq/jjmVtn51VgE7+t2Hu 1471710601 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id B30B6F296F; Sat, 20 Aug 2016 12:30:00 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <091555f6-05a8-3f91-0486-beb6531abd34@fastmail.net> Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bruce Simpson Message-ID: Date: Sat, 20 Aug 2016 17:29:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <091555f6-05a8-3f91-0486-beb6531abd34@fastmail.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 16:30:02 -0000 On 20/08/16 17:27, Bruce Simpson wrote: > Alternatively, the L2 destination MAC may be rewritten for that specific > address, to avoid the destination being interpreted by routers in the > Metro Ethernet core. s/routers/switches/ -- in some views of the world, they are the same :) PBB is also known as 'MAC-in-MAC' for this reason. There's also L2TP pseudowires, but we're not really there yet. From owner-svn-src-head@freebsd.org Sat Aug 20 16:36:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07D73BC0B87; Sat, 20 Aug 2016 16:36:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD4971EA5; Sat, 20 Aug 2016 16:36:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KGa5Mr037867; Sat, 20 Aug 2016 16:36:05 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KGa59Z037859; Sat, 20 Aug 2016 16:36:05 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608201636.u7KGa59Z037859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 20 Aug 2016 16:36:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304535 - in head: contrib/dma libexec/dma X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 16:36:07 -0000 Author: bapt Date: Sat Aug 20 16:36:05 2016 New Revision: 304535 URL: https://svnweb.freebsd.org/changeset/base/304535 Log: Import Dragonfly Mail Agent snapshort from 20160806 aka v0.11+ Most important change being: dma - Fix security hole (#46) Affecting DragonFly 4.6 and earlier, Matt Dillon fixed this in base after finding out from BSDNow Episode 152. Comments following were from his commit which explains better than I. Just taking his change and putting it here as well. * dma makes an age-old mistake of not properly checking whether a file owned by a user is a symlink or not, a bug which the original mail.local also had. * Add O_NOFOLLOW to disallow symlinks. Thanks-to: BSDNow Episode 152, made me dive dma to check when they talked about the mail.local bug. MFC After: 2 days Modified: head/contrib/dma/VERSION head/contrib/dma/dma-mbox-create.c head/contrib/dma/dma.c head/contrib/dma/dma.h head/contrib/dma/dns.c head/contrib/dma/local.c head/contrib/dma/net.c head/libexec/dma/Makefile.inc Directory Properties: head/contrib/dma/ (props changed) Modified: head/contrib/dma/VERSION ============================================================================== --- head/contrib/dma/VERSION Sat Aug 20 16:29:08 2016 (r304534) +++ head/contrib/dma/VERSION Sat Aug 20 16:36:05 2016 (r304535) @@ -1 +1 @@ -v0.10 +v0.11 Modified: head/contrib/dma/dma-mbox-create.c ============================================================================== --- head/contrib/dma/dma-mbox-create.c Sat Aug 20 16:29:08 2016 (r304534) +++ head/contrib/dma/dma-mbox-create.c Sat Aug 20 16:36:05 2016 (r304535) @@ -142,7 +142,7 @@ main(int argc, char **argv) logfail(EX_CANTCREAT, "cannot build mbox path for `%s/%s'", _PATH_MAILDIR, user); } - f = open(fn, O_RDONLY|O_CREAT, 0600); + f = open(fn, O_RDONLY|O_CREAT|O_NOFOLLOW, 0600); if (f < 0) logfail(EX_NOINPUT, "cannt open mbox `%s'", fn); Modified: head/contrib/dma/dma.c ============================================================================== --- head/contrib/dma/dma.c Sat Aug 20 16:29:08 2016 (r304534) +++ head/contrib/dma/dma.c Sat Aug 20 16:36:05 2016 (r304535) @@ -321,7 +321,7 @@ deliver(struct qitem *it) snprintf(errmsg, sizeof(errmsg), "unknown bounce reason"); retry: - syslog(LOG_INFO, "trying delivery"); + syslog(LOG_INFO, "<%s> trying delivery", it->addr); if (it->remote) error = deliver_remote(it); @@ -331,7 +331,7 @@ retry: switch (error) { case 0: delqueue(it); - syslog(LOG_INFO, "delivery successful"); + syslog(LOG_INFO, "<%s> delivery successful", it->addr); exit(EX_OK); case 1: Modified: head/contrib/dma/dma.h ============================================================================== --- head/contrib/dma/dma.h Sat Aug 20 16:29:08 2016 (r304534) +++ head/contrib/dma/dma.h Sat Aug 20 16:36:05 2016 (r304535) @@ -49,7 +49,7 @@ #define VERSION "DragonFly Mail Agent " DMA_VERSION #define BUF_SIZE 2048 -#define ERRMSG_SIZE 200 +#define ERRMSG_SIZE 1024 #define USERNAME_SIZE 50 #define MIN_RETRY 300 /* 5 minutes */ #define MAX_RETRY (3*60*60) /* retry at least every 3 hours */ Modified: head/contrib/dma/dns.c ============================================================================== --- head/contrib/dma/dns.c Sat Aug 20 16:29:08 2016 (r304534) +++ head/contrib/dma/dns.c Sat Aug 20 16:36:05 2016 (r304535) @@ -34,6 +34,7 @@ */ #include +#include #include #include #include Modified: head/contrib/dma/local.c ============================================================================== --- head/contrib/dma/local.c Sat Aug 20 16:29:08 2016 (r304534) +++ head/contrib/dma/local.c Sat Aug 20 16:36:05 2016 (r304535) @@ -196,7 +196,7 @@ retry: goto out; } - error = snprintf(line, sizeof(line), "%sFrom %s\t%s", newline, sender, ctime(&now)); + error = snprintf(line, sizeof(line), "%sFrom %s %s", newline, sender, ctime(&now)); if (error < 0 || (size_t)error >= sizeof(line)) { syslog(LOG_NOTICE, "local delivery deferred: can not write header: %m"); goto out; Modified: head/contrib/dma/net.c ============================================================================== --- head/contrib/dma/net.c Sat Aug 20 16:29:08 2016 (r304534) +++ head/contrib/dma/net.c Sat Aug 20 16:36:05 2016 (r304535) @@ -372,11 +372,13 @@ deliver_to_host(struct qitem *it, struct host->host, host->addr, c, neterr); \ snprintf(errmsg, sizeof(errmsg), "%s [%s] did not like our %s:\n%s", \ host->host, host->addr, c, neterr); \ - return (-1); \ + error = -1; \ + goto out; \ } else if (res != exp) { \ syslog(LOG_NOTICE, "remote delivery deferred: %s [%s] failed after %s: %s", \ host->host, host->addr, c, neterr); \ - return (1); \ + error = 1; \ + goto out; \ } /* Check first reply from remote host */ @@ -426,7 +428,8 @@ deliver_to_host(struct qitem *it, struct syslog(LOG_ERR, "remote delivery failed:" " SMTP login failed: %m"); snprintf(errmsg, sizeof(errmsg), "SMTP login to %s failed", host->host); - return (-1); + error = -1; + goto out; } /* SMTP login is not available, so try without */ else if (error > 0) { Modified: head/libexec/dma/Makefile.inc ============================================================================== --- head/libexec/dma/Makefile.inc Sat Aug 20 16:29:08 2016 (r304534) +++ head/libexec/dma/Makefile.inc Sat Aug 20 16:36:05 2016 (r304535) @@ -7,7 +7,7 @@ DMA_SOURCES= ${.CURDIR}/../../../contrib CFLAGS+= -I${DMA_SOURCES} \ -DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME \ -DCONF_PATH='"/etc/dma"' \ - -DLIBEXEC_PATH='"/usr/libexec"' -DDMA_VERSION='"v0.10"' \ + -DLIBEXEC_PATH='"/usr/libexec"' -DDMA_VERSION='"v0.11+"' \ -DDMA_ROOT_USER='"mailnull"' \ -DDMA_GROUP='"mail"' BINGRP= mail From owner-svn-src-head@freebsd.org Sat Aug 20 16:36:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D560BC0C12; Sat, 20 Aug 2016 16:36:59 +0000 (UTC) (envelope-from rysto32@gmail.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 6363F125C; Sat, 20 Aug 2016 16:36:59 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-it0-x232.google.com with SMTP id x131so54577905ite.0; Sat, 20 Aug 2016 09:36:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6DGdjVJFCS/p3RRXAlo3iTeQlDzxVyFU9q4i8aqPXbg=; b=qmHRrSu39Dv6tcNhmQEvaQbZPeoJejO1LC9jJiLgH/3Zbs5XvVgutEQqTMEW3p78aO Io4Acw/L4UM7k7sYRw4p21j5sOilPOkGtcZw9KuAR0HOhFfX5L0R5h3nOpm1geF4Pg12 JbpR15u4tHYNqteNghQSMzGIl8oCxRtdGlz6G76eAkkcJ5oJYNj9K19DVlZByZDNQ4Ba zqRSS3XBS95/wggiztvJ8vin4w6/sJ7Uz6YsEVE/Gl4ZpkHIdHZ6sbPl8FyLiLJ2KuKE kDe+/7az6pPcU3WimB6d59wEQmhOZBUXnnSF1l+diD7TIjg8Xf71do7W5QMFjuuz4B9J PQFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6DGdjVJFCS/p3RRXAlo3iTeQlDzxVyFU9q4i8aqPXbg=; b=ZXUWTU4CTaFApzawzd79fkQJLDmj9uuFLCfbIiYQ3Rft1tOrOAFzBJ7ZekyYV/uebY Ii3loJSPJiC7mjbGemGtQn7B71kap77WjuDWduO+z0nV2CeskZRWl7af6Xs9sH96WRIv O/h2hj2NyZ/awHpU1SK2afJs004x5TzFKev/Rs7voCKDaNM0LmoHJE+FgSgBaSS9JG+u JsWOWiSDOkVOt8+OE05yZdP6L22qNbs7RfRyVIH+mDOOGjvJ+l6mvxr25UUX0erR4olU VlMb10l4x+0yXQNdPwD91GLfyaBNKYkjbxFBHv8VTS3DPZhlhfd4M0LF1u3izNISl01j 38kg== X-Gm-Message-State: AEkoouvvnhA3D+fO+YXGpu63yoktS+8b0EpyNUekJeTLerYQdGSiVfWfN2khM+NYF7F395i+Pzr1wosFs50rXQ== X-Received: by 10.36.149.5 with SMTP id m5mr12870457itd.20.1471711018603; Sat, 20 Aug 2016 09:36:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Sat, 20 Aug 2016 09:36:58 -0700 (PDT) In-Reply-To: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> From: Ryan Stone Date: Sat, 20 Aug 2016 12:36:58 -0400 Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Bruce Simpson Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 16:36:59 -0000 + adrian@, who prompted me to look at UDP in the first place I'm really not sure what my next step should be. I'm willing to revert r304436, but I really don't want to revert r304437 because we've seen crashes in the real world due to the missing locking. Unfortunately, reverting r304436 would mean that every UDP packet would incur the overhead of an additional rlock/runlock call, which is what I've been trying to avoid. I don't see a particularly good path forward. - The if_addr_lock would appear to be an excellent candidate to be converted into an rmlock, but unfortunately we made the mistake of exposing the lock through the ifnet KPI. Fixing that would require rototilling every single Ethernet/WiFi/etc driver in the tree. - Providing a mechanism for ip_input() to signal to udp_input() that the packet was addressed to an L3 broadcast address would require rototilling the pr_input interface, and I'd have to carefully ensure that if anything might interpose itself between the two layers (IPSec?) that the flag would have to be passed through correctly. - mbuf flags are far too precious to allocate a new one for such a narrow use-case On Sat, Aug 20, 2016 at 11:42 AM, Bruce Simpson wrote: > On 20/08/16 16:27, Ryan Stone wrote: > >> Can you send a broadcast packet through an L3 tunnel? I thought that a >> L2 tunnel was required. >> > > Yes. This is perfectly legal and necessary for forwarding of IPv4 > broadcasts to work. (it is Internet Protocol after all, not > Infernal-ethernet-extension Protocol. ;-)) > > The change is in UDP input so it will not affect routers. But if a FreeBSD > system were at the end of a link layer, and was the final recipient of the > IPv4 broadcast packet, then if that link layer is not Ethernet, all bets > are off. > > That situation could occur very easily where FreeBSD is hanging off the > end of a PPPoE link: e.g. consumer DSL, microwave, etc. > > The underlying link layer for the tunnel might be Ethernet, but it will be > demuxed as a PPP tunnel. PPP is treated as a bit pipe and does not normally > distinguish between unicast, broadcast, multicast. > > Broadcast destined for the host on its PPP address would be transported > inside the tunnel, encapsulated as a normal unicast Ethernet packet. > > But this mbuf flag is not guaranteed to be set in all situations; >> e.g. where the link layer does not have the concept of broadcast >> being distinct from other kinds of network traffic. PPP and ATM are >> the most obvious examples. >> >> >> We don't support ATM, but PPP is a good example. I hadn't thought of >> that. Hm, ip_input() already has to check for a broadcast IP. What it >> set M_BCAST on the mbuf at that time? >> > > ATM is one of those things everyone kind of has to support by default in > some way because of the ITU ADSL specs. It is literally written into > G.992.x. > > Linux can do it, FreeBSD can't. PPP over ATM is something BT inflicted on > the UK all by themselves, though, and we wish it would just go away. > > Whilst your suggestion may work, it may be dangerous, as you are then > stepping on the meaning of the flags. Some of them are intended to be used > for one layer to signal another. > > M_BCAST is pretty rigidly defined in mbuf.h as "The link layer received > this as a broadcast / I intended for link layer to send this as a > broadcast". M_PROTOFLAGS is normally used to clear flags with different > meaning in different protocol layers. > > M_MCAST also has similar status. On my PhD, I wrote code which uses a > private Ethernet link between FreeBSD routers for load distribution; it > distributes unicast traffic using IPv6 multicast. > > It uses multicast both as convenience, and as a way to 'channelise' > traffic if the Ethernet link supports it, using multicast groups. (Modern > shared memory switches can slice L2 multicast traffic like this quite > efficiently. So one slice of unicast traffic could be switched across > locations purely at L2. However, the distribution of actual IPv6 multicast > was out of scope.) > > The routers have to very carefully clear M_MCAST on egress, to ensure > normal L2 next-hop resolution for IPv6 destinations. > > From owner-svn-src-head@freebsd.org Sat Aug 20 16:49:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB599BC0EEE; Sat, 20 Aug 2016 16:49:24 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD1C7197A; Sat, 20 Aug 2016 16:49:24 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 5EE752025C; Sat, 20 Aug 2016 12:49:23 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 12:49:23 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=HD4EHIlt6M4xzmvuJDV950U3/Mw=; b=EJ0msq 4yGWrPS5BJ/0Gxd0QT/ifUtfOCY7xxDAKIrDz8h4E3argkAQLbh+H921tqVhTPpX d1RBSjBLaNdX+/aHLZLJE38H8QadqEJ/edNUG4gFjvI5M0oeZ80v7SJGbTlcB+RY mdzRIlzsaOyU3Ao1TXzC9ualTYaDjgeitp4cI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=HD4EHIlt6M4xzmv uJDV950U3/Mw=; b=QCub3SnybNF/WP7abOJGJ4Rbjz2qnrDx/Tl6lt/K7s1cDo+ fFgp4zXRujBTIKZoY6fqQG9CbO3mgM6w3AOVLMLc0CIcrZ+AhBhpQJvxDiAQHjnK KuQ6/hAfQ5NXOPsAsa+PlFaDnoaJ6aRu+uI9NJAy8elf9q2SsOkGySvjg2x8= X-Sasl-enc: 4VKkddHAUxSSovpPlkHKDtLaq7PR3qKCTOlsY1n9GefT 1471711763 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 6AD24F285F; Sat, 20 Aug 2016 12:49:22 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <990e003f-6180-b016-3b5f-6bdf579d073f@fastmail.net> Date: Sat, 20 Aug 2016 17:49:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 16:49:25 -0000 On 20/08/16 17:36, Ryan Stone wrote: > + adrian@, who prompted me to look at UDP in the first place > > I'm really not sure what my next step should be. I'm willing to revert > r304436, but I really don't want to revert r304437 because we've seen > crashes in the real world due to the missing locking. Unfortunately, > reverting r304436 would mean that every UDP packet would incur the > overhead of an additional rlock/runlock call, which is what I've been > trying to avoid. I don't see a particularly good path forward. Your changes have the same motivations as my historical change to move group-level IP multicast lookups (and locking) out of the output path. Source-specific multicast (SSM) requires support for reception filters on individual sockets, so I moved those multicast-specific input checks into the socket layer. > - The if_addr_lock would appear to be an excellent candidate to be > converted into an rmlock, but unfortunately we made the mistake of > exposing the lock through the ifnet KPI. Fixing that would require > rototilling every single Ethernet/WiFi/etc driver in the tree. Oops... > - Providing a mechanism for ip_input() to signal to udp_input() that the > packet was addressed to an L3 broadcast address would require > rototilling the pr_input interface, and I'd have to carefully ensure > that if anything might interpose itself between the two layers (IPSec?) > that the flag would have to be passed through correctly. > > - mbuf flags are far too precious to allocate a new one for such a > narrow use-case Agree. Then it may be that slipping the definition of M_BCAST to mean 'And IP identified that this is network-layer broadcast' is the most expedient solution. A quick look around suggests you may be able to get away with it. You'd essentially be widening the definition of the existing M_BCAST flag. Given the ultimate consumer of the mbuf in the case you are addressing in the code (bad pun) is udp_input(), that may be fine. (We had to do something similar for ILNPv6, because of how IPv6 input works, so it allocates an unused bit from the IPv6 flow label.) But it has to be qualified very carefully. If L2 is re-entered from IP (e.g. a netgraph IP-level hook), it may have unexpected side-effects. I have not given this the KScope treatment, just a quick fxr.watson.org. From owner-svn-src-head@freebsd.org Sat Aug 20 16:57:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B14DDBC0071; Sat, 20 Aug 2016 16:57:36 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D3E51DC9; Sat, 20 Aug 2016 16:57:36 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 5EDB220413; Sat, 20 Aug 2016 12:57:35 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 12:57:35 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=R46HCLwo9z5g0uEpAZRtscNLB18=; b=W5qdJB mjU6W1YBNBTyabt+INad7/g/oP4F1yhiQvQz0MuEjd2iXBdOm7l5Gr7cD8HThuby tv9kyW4YYGlC0FDPtXgt7LXFSCVNxPrvF6lv7zJKQeBj10tTZvCOTy4GV6Tv+7Z3 jYvIzeGNCbd53UCULSiRA9ZWknATq5jyWIVz4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=R46HCLwo9z5g0uE pAZRtscNLB18=; b=ja21MswIV2b5L8lWV340DRWm7PqEgn9BswQGQW8vbS81S+l HCpL1UySkjMt+zix2wuPXAtLcPN/zKz0IwJ2jXsTukrRpDbeoDEntVvocyMvq/V4 yzZak+lMj+ECVTmgKuoFBb7rukNFGSfbsY1siHNIPrJcwX7Xx2LigC5HQCx8= X-Sasl-enc: TI4htLTa4peMX11iDWGh9oqCjxxD8hXV/nysyvOmuR3V 1471712255 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 7A1FFF296E; Sat, 20 Aug 2016 12:57:34 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <990e003f-6180-b016-3b5f-6bdf579d073f@fastmail.net> Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <7779ae65-5366-0f42-4369-7f0647abca3c@fastmail.net> Date: Sat, 20 Aug 2016 17:57:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <990e003f-6180-b016-3b5f-6bdf579d073f@fastmail.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 16:57:36 -0000 On 20/08/16 17:49, Bruce Simpson wrote: >> - Providing a mechanism for ip_input() to signal to udp_input() that the >> packet was addressed to an L3 broadcast address would require >> rototilling the pr_input interface, and I'd have to carefully ensure >> that if anything might interpose itself between the two layers (IPSec?) >> that the flag would have to be passed through correctly. > (We had to do something similar for ILNPv6, because of how IPv6 input > works, so it allocates an unused bit from the IPv6 flow label.) In case anyone's interested, IPSEC is one big reason we had to do this. Performance was another; without marking ILNPv6 traffic, demultiplexing an ILNPv6 packet -- even 'just enough' to forward it -- would have required processing all IPv6 extension headers, and additional state lookups. Using a bit from the flow label means ILNPv6 routers don't need to do any of that, and it got translated into an M_ILNP mbuf flag internally. I shudder to think what gymnastics the FreeBSD stack may have to endure to accommodate modern Ethernet switching capabilities, though. From owner-svn-src-head@freebsd.org Sat Aug 20 17:18:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37A0CBC0606; Sat, 20 Aug 2016 17:18:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 1B6BF1848; Sat, 20 Aug 2016 17:18:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 1334714F6; Sat, 20 Aug 2016 17:18:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id C65772311D; Sat, 20 Aug 2016 17:18:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id Se97EHV2nC9I; Sat, 20 Aug 2016 17:18:16 +0000 (UTC) Subject: Re: svn commit: r304244 - head/sys/kern DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com C054C23117 To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608162155.u7GLtYp4091232@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <529d7219-4dc9-eb06-2a5d-682c725855f6@FreeBSD.org> Date: Sat, 20 Aug 2016 10:18:14 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608162155.u7GLtYp4091232@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wHtvbNoT5HReuwovSiwOqFQdfUfw5jNmc" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 17:18:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wHtvbNoT5HReuwovSiwOqFQdfUfw5jNmc Content-Type: multipart/mixed; boundary="je8VnCsmxL1ejnTS2WSvjbIdtebWlkmSf" From: Bryan Drewery To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <529d7219-4dc9-eb06-2a5d-682c725855f6@FreeBSD.org> Subject: Re: svn commit: r304244 - head/sys/kern References: <201608162155.u7GLtYp4091232@repo.freebsd.org> In-Reply-To: <201608162155.u7GLtYp4091232@repo.freebsd.org> --je8VnCsmxL1ejnTS2WSvjbIdtebWlkmSf Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/16/2016 2:55 PM, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Aug 16 21:55:34 2016 > New Revision: 304244 > URL: https://svnweb.freebsd.org/changeset/base/304244 >=20 > Log: > We should not be allowing a timeout to reset when a drain is in progr= ess on > it (either async or sync drain). > =20 > At this moment the only user of drain is TCP, but TCP wouldn't resche= dule a > callout after it has drained it, since it drains only when a tcpcb is= closed. > This for now the problem isn't observed. > =20 > Submitted by: rrs Should this be MFC'd into 11.0? >=20 > Modified: > head/sys/kern/kern_timeout.c >=20 > Modified: head/sys/kern/kern_timeout.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/kern_timeout.c Tue Aug 16 21:32:05 2016 (r304243) > +++ head/sys/kern/kern_timeout.c Tue Aug 16 21:55:34 2016 (r304244) > @@ -1061,7 +1061,7 @@ callout_reset_sbt_on(struct callout *c,=20 > */ > if (c->c_lock !=3D NULL && !cc_exec_cancel(cc, direct)) > cancelled =3D cc_exec_cancel(cc, direct) =3D true; > - if (cc_exec_waiting(cc, direct)) { > + if (cc_exec_waiting(cc, direct) || cc_exec_drain(cc, dir)) { > /* > * Someone has called callout_drain to kill this > * callout. Don't reschedule. >=20 --=20 Regards, Bryan Drewery --je8VnCsmxL1ejnTS2WSvjbIdtebWlkmSf-- --wHtvbNoT5HReuwovSiwOqFQdfUfw5jNmc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXuJDWAAoJEDXXcbtuRpfP2MYH/2GQ3qnxniBeflXbty2Eml/g Paz2/gYCydCRtTKbflW9ZT1szB913ju0T6IswdBjXjsUm4bls6sME5/37D0bqBj1 3ril9Vz7uC1T5HEQ65giK0l/r6ROsL7IOJ9befUjOQo5OTe6XqPf878xk3pxmjhM XtrmBy6wW4nvRgZJRxY2nFbP7efH/14ugexeksf4NA3n6aoY+kG5SHHpVLSzUDdi 3v2YOulmnPVGkTSt5Kd9J0VMdtTkBnvRfXhR1PwCByfAPHf0MYsfAmhF9B0H32GJ AuKV3Bny5KEahQjW3G7VBBfd0+cD25kKfxzrZgyJZS/o+Fz/+5m1AbLX73MfKRg= =u2W6 -----END PGP SIGNATURE----- --wHtvbNoT5HReuwovSiwOqFQdfUfw5jNmc-- From owner-svn-src-head@freebsd.org Sat Aug 20 17:30:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46120BC0857; Sat, 20 Aug 2016 17:30:56 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 043821F0B; Sat, 20 Aug 2016 17:30:56 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbA6c-0004bP-UR; Sat, 20 Aug 2016 20:30:50 +0300 Date: Sat, 20 Aug 2016 20:30:50 +0300 From: Slawa Olhovchenkov To: Ryan Stone Cc: Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160820173050.GQ22212@zxy.spb.ru> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 17:30:56 -0000 On Sat, Aug 20, 2016 at 12:36:58PM -0400, Ryan Stone wrote: > + adrian@, who prompted me to look at UDP in the first place > > > I'm really not sure what my next step should be. I'm willing to revert > r304436, but I really don't want to revert r304437 because we've seen > crashes in the real world due to the missing locking. Unfortunately, > reverting r304436 would mean that every UDP packet would incur the overhead > of an additional rlock/runlock call, which is what I've been trying to > avoid. I don't see a particularly good path forward. As I understund specific handling of broadcast required only for routers (by RFC1812). For host enought have [hidden] alias with broadcsts bits. Anyway, don't should relay on the L2 information, you can recive L3 unicast addressed packets (with alien dst IP address) in L2 broadcas packet. Sorry if I am miss something in you discurs. From owner-svn-src-head@freebsd.org Sat Aug 20 17:48:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3B86BC0B9F; Sat, 20 Aug 2016 17:48:01 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93D70181B; Sat, 20 Aug 2016 17:48:01 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 05CD52043E; Sat, 20 Aug 2016 13:47:59 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 13:48:00 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=q/qH+owN5tPPAXQXPTDVjlduApQ=; b=PeOQBO s869a9UqOL5UP9mSNXEjiRXW+gLf9FMJWLqK6JdlIywponEcrP7pwIwM7ks9d4BH YAIkhKVKuGCDtgMbPuncSQYFHVYCT5yejubeBjLLO/myp+DFFKJmGN4Nj/v9gRoC OuoLM5vE+dI3C2c4aUnEgjg8fCc6DinliTwLU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=q/qH+owN5tPPAXQ XPTDVjlduApQ=; b=WVNW8GbNQ34Pk98sLQcl3HiNVidlADvzpSTFF36QQkY4Pi8 dIjt+u+YOO2smcUhc3jhSHuO5krMeZTuxT1Z8EPJEvlXhl842lcc3CotaCpF1wRC wQd1uOH6gOm2rmQJ1EMGUsr1zIdN5SdQOt6PvHE0tkhK53RhWs4BJH6jb+HY= X-Sasl-enc: 5TSZvYUUe2LhxwKSUFRksqrw09YN9FT+36ddcN7msXnw 1471715279 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id F24EDF296E; Sat, 20 Aug 2016 13:47:58 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov , Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> Cc: "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <598d1827-f834-5172-1431-9ecf25eb3b5c@fastmail.net> Date: Sat, 20 Aug 2016 18:47:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160820173050.GQ22212@zxy.spb.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 17:48:01 -0000 On 20/08/16 18:30, Slawa Olhovchenkov wrote: > Anyway, don't should relay on the L2 information, you can recive L3 > unicast addressed packets (with alien dst IP address) in L2 broadcas > packet. That is exactly what the egress routers in chapter 6 of my PhD do, but in a very controlled way -- by setting and clearing M_MCAST ! http://hdl.handle.net/10023/8681 In Ch6, ILNPv6 packets are effective being routed, using a multicast next-hop address (as distinct from the destination I-LV, which in turn is distinct from an IPv6 destination -- it just uses the same format.) It's counter-intuitive (and should not happen outside of that constrained scenario), but it has real world applications. From owner-svn-src-head@freebsd.org Sat Aug 20 18:02:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5014BC0E73; Sat, 20 Aug 2016 18:02:17 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::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 894B01F54; Sat, 20 Aug 2016 18:02:17 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-it0-x22c.google.com with SMTP id x131so55674631ite.0; Sat, 20 Aug 2016 11:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=v9OLQOo+Y0l3GbiUA62s4FVnJ1Hub/t1TivCgvOVANE=; b=MIjprukg6ab0dOlgKdz1MGws8kEtfnS8iN89W4LIOLepZJh1wjwU8AgtZn/vIqnq0P xUabxeDePw2sROqrxgPHCsh20ZdajQ422gHjSTIVtUcIxNWyOUAZItEcgIyVuw63l8Ok Ae7MBKkBWNAVr6TV0Qh0YxtjriDV1ISXA2LXFaVSNOXWsh9hn88CdQ//S/eKqoUzxMyB 01Y8R9Yw+KLXDuqyKyVKV8t8imzINaiSsHSOSgfqmuV3dEJntTRV2XIJEAUi2sOcOFX7 rn3ndlDvQMLfxp/2IaPO+uA/Yzphp+CVUkEyYUptYmVuLk3Vy/TIpeXiPrYNeDHqDcOe Jgrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=v9OLQOo+Y0l3GbiUA62s4FVnJ1Hub/t1TivCgvOVANE=; b=KmOQKxfo0TSILoywjwb2WCgtpQCvXLVbRCDMPeWFPUF77tRHURG3ZN97GfCQoegjuq qXuw8a+m3E79D6jtDk/yE+hJiP4NC638re0m9OaDP4JOqhfMFhtCxKmAz3FBBZbdstCu 6Pf9z3OROBoYkBOGfCd9e81t8iCb5Z9cnFQiHm7OPSKHZnRC0LZjv9UR1F+FJXl6hAac oINK0z97/D4NHK5VeI4Ws3qTL9fuenq1dXn9UPObMlXJSi0QJtpao8qhwmbMCzKbeOm7 fuOdqHOIwgyzzH+pgtaHSpgXJonvQuUqXwVC6k4cUZnJkF9ra4xsRyCCBFvn6YwwZ4Od /gtw== X-Gm-Message-State: AEkoousJ0lPSVKx13m7FujqwvueVTgZJhsXxhklQftnKW12iOdmrvGhYNn5gcgphpBW5HuHJYLMR0+Wc1oT08Q== X-Received: by 10.36.217.9 with SMTP id p9mr13165883itg.46.1471716136825; Sat, 20 Aug 2016 11:02:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Sat, 20 Aug 2016 11:02:16 -0700 (PDT) In-Reply-To: <20160820173050.GQ22212@zxy.spb.ru> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> From: Ryan Stone Date: Sat, 20 Aug 2016 14:02:16 -0400 Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov Cc: Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 18:02:17 -0000 On Sat, Aug 20, 2016 at 1:30 PM, Slawa Olhovchenkov wrote: > For host enought have [hidden] alias with broadcsts bits. > Anyway, don't should relay on the L2 information, you can recive L3 > unicast addressed packets (with alien dst IP address) in L2 broadcas > packet. > This is still handled correctly. The new code only checks for L3 broadcast addresses on L2 broadcast packets, but we still check the L3 address before treating it as a broadcast. The problem is that I assumed that all paths into the IP stack would set M_BCAST, but as Bruce has pointed out there are cases like PPP which do not. From owner-svn-src-head@freebsd.org Sat Aug 20 18:09:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 972AEBC0FDE; Sat, 20 Aug 2016 18:09:03 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B5CB1515; Sat, 20 Aug 2016 18:09:03 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x229.google.com with SMTP id f6so50941699ith.0; Sat, 20 Aug 2016 11:09:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4z1cCjGuWk0OgmimvNkvzCSHCDErys4eX9qRzUhqty0=; b=ZG4ZMZMLZZSo9h/XZB6+9Kg0mN/WoZIMXLXebQdX9nnIAixRgiYDQGFr8CZV236g+c iaJd0TQGXU/EUvxSbIgIGzuyPJVTgoKgazPcXGpWTArlz2p2S/RQz/iDdX1pWQCKzdxg woOSJpMuSj4dxFt+XCfN5vErt3dc2zmn2xx+Z7AB1fn7U1Oc24a6gmNHlAFPAxMSgUS5 Z+iQoCyKK/517Wu2DK7eD51/OnbwaV0NTDqmi/5jM0CTQaS3laQlozJbUQbsmj2qDqGa wmZPf2jNbCohC6coNS7ML3AF6BAyL8avHVV4lMwmoF4C2r1zlIusVieZZzoO80PQ3xwg 53eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4z1cCjGuWk0OgmimvNkvzCSHCDErys4eX9qRzUhqty0=; b=JPFg52sI2s++fSx0SdF6Kc2Ll2M9eUgvHdtHah/nZAubpcVzJ5F4K6+cCObbz6yY4v 8UqlQYovfBAPzKxmpDGFsYwS3fY7MyhbdnyhTSyG9l6oQSmII59rwEycD7gDkG4TA0ft rnCymDa0zoQIeWdtUmf96yupbo+rRRsp3xpMVG0l9hPb+ZUtVLo1yAcjluqj2g7LacKO Mc+IOZF6/9NQR7l1QaP3Fs5bQEMGbWtlDKwWPFjmMz2GADyKDXL0xBS/9wOvnmRFIUsb 0KJZOYfkeTx8B2AnlrTm9Ue8kfgWr47O3ZEyiUJFsp68RNJBFdSyIYlSyGbGAVHVt3sm Zn6A== X-Gm-Message-State: AEkoousWlkIwyrp3UCWnuBjtyTh/GpTG52JtoPGy1U+cSUMQx8JsZE9zqwZuhPIxtTxKQdfAMEBQiLWrQIe7xA== X-Received: by 10.36.124.141 with SMTP id a135mr12217351itd.25.1471716542851; Sat, 20 Aug 2016 11:09:02 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.141.129 with HTTP; Sat, 20 Aug 2016 11:09:00 -0700 (PDT) In-Reply-To: References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> From: Adrian Chadd Date: Sat, 20 Aug 2016 11:09:00 -0700 X-Google-Sender-Auth: YziLzUTXKROMF11KP8fB-oTNByE Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone Cc: Slawa Olhovchenkov , Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 18:09:03 -0000 On 20 August 2016 at 11:02, Ryan Stone wrote: > On Sat, Aug 20, 2016 at 1:30 PM, Slawa Olhovchenkov wrote: >> >> For host enought have [hidden] alias with broadcsts bits. >> Anyway, don't should relay on the L2 information, you can recive L3 >> unicast addressed packets (with alien dst IP address) in L2 broadcas >> packet. > > > This is still handled correctly. The new code only checks for L3 broadcast > addresses on L2 broadcast packets, but we still check the L3 address before > treating it as a broadcast. The problem is that I assumed that all paths > into the IP stack would set M_BCAST, but as Bruce has pointed out there are > cases like PPP which do not. Hi, So why not fix those paths? -adrian From owner-svn-src-head@freebsd.org Sat Aug 20 18:14:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB556BC04CB; Sat, 20 Aug 2016 18:14:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::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 B327B1A82; Sat, 20 Aug 2016 18:14:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x230.google.com with SMTP id f6so51001670ith.0; Sat, 20 Aug 2016 11:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=dGqO+tn/D525kzTtDs0kB0laYiXrK1QMfBViTE4djno=; b=TItnNkk4q7oOYjQsPpXIaauXuTKHF6Wz1jI4+JkEAtak5s7OL+miAs00wsq3heYCly UzdcpZAEM8RUpIB98fVKwOJox5Vf92Ezg5oqf7/O+xX0rh9iCOqIAMEMfUwF6+GJrEw+ QTHYp5uW8Q2Dmtwz/+Qu7TGwwHttCzU9TYe8taUNlkxhhXpKMP3GYgKeYPwUWwx7To08 KGQPchXmWGdPsuj/Tetd/dH28PKH/t9aUp0td56d2/9Jbnt37/dXgsMXYzG1wY/o87vb mOi5XO8ppDC5kS9aiS7N+IkcDf9c30v/a223f3RKTJ7zUqKWAdbbIZx0NyspULM6ECAy QxIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=dGqO+tn/D525kzTtDs0kB0laYiXrK1QMfBViTE4djno=; b=kW0pSQVLPJ1GXfVl1epTewZ0q6QFeN0RyM25RXSd6x29BXVKAqBXapQRKGyaE0ayey TFeErvRgRLqtVUwrdv70J/YnIANz481A26MGOBXweCn/Qv2Xe1Sf8BqVUVEPDbtaiWnB znKmvpPVclKXYqUBIIv4+ecCPqxwSLI9mVOczgxBhL2OF3BEKazIIVPP0u84p51maznd KgJ/HUBSg+PbrGgLUinCr5rl9PZJTg5jOLHEo44Y/m12jx+DjdH+k4rV1+opbSwv7J2k 9VuWQ8lQj+imftGzvomPQmkSboBE+2HUn9KgyZVmLQrAdpK7mWfb4ioKsk4suppqkfOj QSyw== X-Gm-Message-State: AEkoouvtVAyZmWkr1q3YM3LLH9kBdN8Mb9Jun1bTQsagy8sF/DUduP6SPNWnr7H0icZwRwb+0F0CocSw+kJFfg== X-Received: by 10.36.242.68 with SMTP id j65mr12149576ith.25.1471716846196; Sat, 20 Aug 2016 11:14:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.141.129 with HTTP; Sat, 20 Aug 2016 11:14:05 -0700 (PDT) In-Reply-To: References: <201608192227.u7JMREIo032684@repo.freebsd.org> <9056382.PA4dZNFpPe@ralph.baldwin.cx> From: Adrian Chadd Date: Sat, 20 Aug 2016 11:14:05 -0700 Message-ID: Subject: Re: svn commit: r304506 - in head: . release/doc/en_US.ISO8859-1/hardware share/man/man4/man4.i386 sys/conf sys/dev/wl sys/i386/conf sys/modules sys/modules/wl targets/pseudo/userland tools/build/mk to... To: Warner Losh Cc: John Baldwin , 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.22 Precedence: list List-Id: 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, 20 Aug 2016 18:14:07 -0000 [snip] I ... may do some kind of anniversary related work to fix up wi support again. Because - and this is pretty god damned hilarious - the same stack features (no raw frames, 802.3 encapsulation, scan/join/etc done via commands only, etc) that I need to 'fix' for wi are also required for almost all the 11ac hardware. ... -a From owner-svn-src-head@freebsd.org Sat Aug 20 18:14:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBAF3BC055B; Sat, 20 Aug 2016 18:14:41 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F7301D21; Sat, 20 Aug 2016 18:14:41 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id AB6C5202AD; Sat, 20 Aug 2016 14:14:40 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 14:14:40 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=e2mvHCawrJuBq0N8ULSLjAcU72w=; b=iA3rvP jF/2Qm19n16LgGF7nu/g8zYi5dxYSqhObPPe61cjQatqchQfLum9bT+4HOzR+w/X +bX8w1VrJBpox+WRBBbcoVjMM2A3y4IrdhBeqfdXWHYiKjvjaVc7QvZdT3Nu14ir i20Ic3SwIaLnVY9J1p6RIIREzrZ38uNaeTofE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=e2mvHCawrJuBq0N 8ULSLjAcU72w=; b=uZVUPrmmfIHd0dfmJ1ir9YA4vdvn65oQrWPFdJgpQ7UNPKF 5yTkyeWxnJF+ckjUMDwWW+PMDaUwt9kXXX2q3jKIe6Dkb6QAmlwM8TjK7+Zc7Hsa 4pabbdy44DKajReGMqAT39zuzRatjEb+P7Xabo/xpGGKihHChCqX/HVkutyo= X-Sasl-enc: nwhWTdUlbtl42Nj5JUtjqr2wj6SMLe3vzp0YS5xgeBTf 1471716880 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 9D442F2983; Sat, 20 Aug 2016 14:14:39 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Adrian Chadd , Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> Cc: Slawa Olhovchenkov , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" From: Bruce Simpson Message-ID: Date: Sat, 20 Aug 2016 19:14:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 18:14:42 -0000 On 20/08/16 19:09, Adrian Chadd wrote: > On 20 August 2016 at 11:02, Ryan Stone wrote: >> On Sat, Aug 20, 2016 at 1:30 PM, Slawa Olhovchenkov wrote: >>> For host enought have [hidden] alias with broadcsts bits. >>> Anyway, don't should relay on the L2 information, you can recive L3 >>> unicast addressed packets (with alien dst IP address) in L2 broadcas >>> packet. >> >> This is still handled correctly. The new code only checks for L3 broadcast >> addresses on L2 broadcast packets, but we still check the L3 address before >> treating it as a broadcast. The problem is that I assumed that all paths >> into the IP stack would set M_BCAST, but as Bruce has pointed out there are >> cases like PPP which do not. > > So why not fix those paths? Because it would involve doing something similar to what if_ethersubr.c does right now: a direct comparison with FF:FF:FF:FF:FF:FF. Doing so outside of Ethernet would be invasive and one of those 'bad' layer crossings. This is tricky to get right. NetBSD introduced the M_PROMISC flag to cover situations which can occur when Ethernet can be re-entered by layers 'above' its original invocation. (I merged it here.) Ryan proposes slipping the definition of M_BCAST to include the network layer, inside ip_input() itself. That would not strictly violate layering, but bends the original meaning of the flag somewhat. That may work, provided it doesn't tread on the toes of anything above it. However the situation is somewhat similar to that of M_PROMISC. From owner-svn-src-head@freebsd.org Sat Aug 20 18:25:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66866BC0788; Sat, 20 Aug 2016 18:25:14 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29E40139E; Sat, 20 Aug 2016 18:25:14 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-it0-x235.google.com with SMTP id f6so51128314ith.0; Sat, 20 Aug 2016 11:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YAf9EztyzzeE1TzgR/ts5noeSFkit9TlfBYOWy4enb8=; b=lctsOHI95WRc4CHwHWptZ0FtnyNYckxqFZL9qRhBEuiSzd/kFj8DgPS13R86gMZfvH ccbTAjNOadTmyvByw7CRnD2pCrVD5mat/+Dneccq7O+5d19z6Pa1wqLXlq7WuGe7wqu9 821k8g8VwHrya13lhcC2JOgLb264tSinLXvU5bc+2moNeNj12zG/pjrMVDaDQmT9d8KN mTCHqRIFpfg+j3NbpLP4s1G7b4A8k7Bp037Bvz7Vrk45/x42vVqrWr8rvxqnVhDWebbt wqJw4L+fz1MPVgI10DHgqyUjKjXmB/G4VFyIv4fVajEo9lPVhETFWVOPB4Q4AdYKnWdu 3ZYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=YAf9EztyzzeE1TzgR/ts5noeSFkit9TlfBYOWy4enb8=; b=C/wIuC+yPhW/iB6RTf/4Oboq3rX7tD2vXVPv+ckRZbm4qQ9ZKhx6x1OJZfwrS2m/j+ pLav/hwQ8rivYFIajQsCNNR0YFOG/dYgAwEg0O8G7M4dCqdWA2ZPRRbHELxmfftBNMLS tlHKZX/blWbJH5dEWjq8OnO7c788lEdRpl2dGOZglnmcYd8Zeb6DCVm3FI9gOiirgPv7 e0Ugs9tHtnkNiR58giX7L1HgRmeiJj6blSBxSU1pkgQLYB3FlxbBKWePrAkUcKJwM4Si On/hxXBuMTiA8CvT0hfPsdwqTxDNQoQWV+U1VjnolHLdoNR0OA4mGDRYzw9D9769R6PV 42FQ== X-Gm-Message-State: AEkoout/di+jMMuDUlDLI5+8zf6G3QMw14rh6C+/tpqm0ugC4vMsgzj6bkyPgH/tPjJEXYmE56T5aXXmn5k4EQ== X-Received: by 10.36.149.5 with SMTP id m5mr13230521itd.20.1471717513546; Sat, 20 Aug 2016 11:25:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Sat, 20 Aug 2016 11:25:12 -0700 (PDT) In-Reply-To: References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> From: Ryan Stone Date: Sat, 20 Aug 2016 14:25:13 -0400 Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Adrian Chadd Cc: Slawa Olhovchenkov , Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 18:25:14 -0000 On Sat, Aug 20, 2016 at 2:09 PM, Adrian Chadd wrote: > Hi, > > So why not fix those paths? > > > > -adrian > Is there even a fix that can be done there? I wouldn't expect a point-to-point protocol like PPP to have any need to explicitly signal that a packet is a broadcast. Is the information even available at that layer? From owner-svn-src-head@freebsd.org Sat Aug 20 18:27:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 582D5BC080D for ; Sat, 20 Aug 2016 18:27:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A7BC15AD for ; Sat, 20 Aug 2016 18:27:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22a.google.com with SMTP id n128so51191313ith.1 for ; Sat, 20 Aug 2016 11:27:22 -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=sv2hwK0p6fLzKjcHHY7xRz+goI3LCYD0nDnsBH+wNLQ=; b=PBjvgMlq5lPeZvR1JL/pQTMOpExFmV5+nBXjk3lY2+NXaW7sbz6mniWsQ2PGV3bVul 8sQ7IAKDS9uA+qaJml4Rh/x2lDjEHRvX/PwYvMddepbX20oE2JOhuOHuOMaQdwQ5ZeRo FgQGXqF2uQAl0uiIcLrRYSZP7+7K+piDenuh4rRvOcyawRpOOLFn1/mFBixz8IAjicRU Xur+pnLL1XX36uWwFav6O1nzEFYFFVzINZ03PlXbEGXoh3oFh2FtmlPJKRE7w7f32d68 L7sVE3QcK29LF+gul7qAVf3heN7LrVujgnQGjoNeMqmYgMKadCKglPXCBIURkYzEWvrS CoPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=sv2hwK0p6fLzKjcHHY7xRz+goI3LCYD0nDnsBH+wNLQ=; b=fBPGZcBnwqAwJTJyYIQIFHreXe1+FEz4ZjSJEnIRbSIbpmrsYACPVRBpUDpsu32yn2 SHhGtmJvDHE5T84hcFkAjad7hnKjjQSHpGsb8O1Mh8hTW6BdgYcJJDzsmeYgB1P4ZlM9 og307KzHUSBRS27o47X9Bc8K+hQEUYiLCHYMp3tL+wMiJj6Sr0LobkjT5nl1R9OFbh8k H/2j+ZuxnAwSmkiywskcaBSig8Nev2l5Kf3Tv2yfJQrpR6nfwe1QEsd1D5inO1rQT9tV pmehP3/0xdopNy7xoP/ivM+Ea20wn/0ndidSZttkqx31JQGiXz5I0MOH8wt5Lv+1Ubm9 PPag== X-Gm-Message-State: AEkooutwXQsZJCFgjYuv1CclJeqCyQJ2CeRBAeOxFLSShkoaSqU0W+HMtlexWQeu6iC/B9Pes9zpwR5luPeU2w== X-Received: by 10.36.116.193 with SMTP id o184mr12597269itc.14.1471717641486; Sat, 20 Aug 2016 11:27:21 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Sat, 20 Aug 2016 11:27:20 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: References: <201608192227.u7JMREIo032684@repo.freebsd.org> <9056382.PA4dZNFpPe@ralph.baldwin.cx> From: Warner Losh Date: Sat, 20 Aug 2016 12:27:20 -0600 X-Google-Sender-Auth: KZsKYsDvBRjtIRpVKCoafD70wNA Message-ID: Subject: Re: svn commit: r304506 - in head: . release/doc/en_US.ISO8859-1/hardware share/man/man4/man4.i386 sys/conf sys/dev/wl sys/i386/conf sys/modules sys/modules/wl targets/pseudo/userland tools/build/mk to... To: Adrian Chadd Cc: John Baldwin , 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.22 Precedence: list List-Id: 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, 20 Aug 2016 18:27:22 -0000 On Sat, Aug 20, 2016 at 12:14 PM, Adrian Chadd wrote: > [snip] > > I ... may do some kind of anniversary related work to fix up wi support again. > > Because - and this is pretty god damned hilarious - the same stack > features (no raw frames, 802.3 encapsulation, scan/join/etc done via > commands only, etc) that I need to 'fix' for wi are also required for > almost all the 11ac hardware. I'm not saying don't fix it. There's a bunch of older laptops that still have these cards in them (much to my amazement). Just that it shouldn't be a priority. If it works, keep it in the tree. If it is broken, though, the time has come to ditch it... Warner From owner-svn-src-head@freebsd.org Sat Aug 20 18:45:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90584BC0C14; Sat, 20 Aug 2016 18:45:11 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E7E61F91; Sat, 20 Aug 2016 18:45:11 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbBGU-0006Js-6W; Sat, 20 Aug 2016 21:45:06 +0300 Date: Sat, 20 Aug 2016 21:45:06 +0300 From: Slawa Olhovchenkov To: Ryan Stone Cc: Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160820184506.GV8192@zxy.spb.ru> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 18:45:11 -0000 On Sat, Aug 20, 2016 at 02:02:16PM -0400, Ryan Stone wrote: > On Sat, Aug 20, 2016 at 1:30 PM, Slawa Olhovchenkov wrote: > > > For host enought have [hidden] alias with broadcsts bits. > > Anyway, don't should relay on the L2 information, you can recive L3 > > unicast addressed packets (with alien dst IP address) in L2 broadcas > > packet. > > > > This is still handled correctly. The new code only checks for L3 broadcast > addresses on L2 broadcast packets, but we still check the L3 address before > treating it as a broadcast. The problem is that I assumed that all paths > into the IP stack would set M_BCAST, but as Bruce has pointed out there are > cases like PPP which do not. You also can recive this on ethernet too, IMHO, in case of /32. Receiving L3 broadcst in L2 unicast is legitime (IMHO) and we must be relaxed on this. From owner-svn-src-head@freebsd.org Sat Aug 20 18:51:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B58ABC0E2B; Sat, 20 Aug 2016 18:51:50 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFFDF16BF; Sat, 20 Aug 2016 18:51:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KIpn1T086910; Sat, 20 Aug 2016 18:51:49 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KIpnSf086909; Sat, 20 Aug 2016 18:51:49 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201608201851.u7KIpnSf086909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sat, 20 Aug 2016 18:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304537 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 18:51:50 -0000 Author: rwatson Date: Sat Aug 20 18:51:48 2016 New Revision: 304537 URL: https://svnweb.freebsd.org/changeset/base/304537 Log: Audit additional vnode information in the implementation of the ftruncate(2) system call. This was not required by the Common Criteria, which needed only open-time audit. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sat Aug 20 18:45:25 2016 (r304536) +++ head/sys/kern/vfs_vnops.c Sat Aug 20 18:51:48 2016 (r304537) @@ -1302,6 +1302,7 @@ vn_truncate(struct file *fp, off_t lengt if (error) goto out1; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + AUDIT_ARG_VNODE1(vp); if (vp->v_type == VDIR) { error = EISDIR; goto out; From owner-svn-src-head@freebsd.org Sat Aug 20 18:57:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 621A1BC0EFF; Sat, 20 Aug 2016 18:57:37 +0000 (UTC) (envelope-from rysto32@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 25B1B1C40; Sat, 20 Aug 2016 18:57:37 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-io0-x230.google.com with SMTP id 38so76997594iol.0; Sat, 20 Aug 2016 11:57:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GzYXeQos5FAGlL7ru4K5UO/s8F6AQg6K/om87Nb9uKU=; b=q7WmFaa6CXZTl5INjzABW+AlfowKzcq9rWbUtPffcGeWgEZaiNyzAFPrebQ57IzT00 dw/QvZCSj0860EKt2fbbAJzVFGfetev2a4nLPWnfiq6kNKM5oIlfMTkjgkRl8g6LOC18 IS2PTUw2W/HW2r69z1N3VamnwBVDQUf5T9oSZXtlAeLltUDAokttbddrIiuHiw6D37v7 XebnvhYD5xe2eCvwawCNc3lxRuiiHOCKb8BEat3bvLpLUEGLocln65LX+yjVRa6YPl4n 4cgezvg8wguqK9+mQF0GiKWkxDOlj0OWIyH7Z9vTr9i117lPq/BW4OfcJWPeKoitSx2M xBnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GzYXeQos5FAGlL7ru4K5UO/s8F6AQg6K/om87Nb9uKU=; b=j827XgqeNnzZIQdWyL/VQMI+FGAUdNcfrIy0ahmiBRwIYRqLtsKQzxSknAuhXJmM8q /t4oVu74BirFU/xFnSVF1k+3iazicrn3UHWTYbCW+gDyTSU5AaexXVce9Q1CcsXz8Cmu EhEpoDU43/rI01Xbnx9Wm/E92DYH7O2bHv1bMr+N1XyZOZpVWFcFyktR7Tw32klU/9dq t+xqrUvZOr+lQkWRB47VK0p1XfIwtKZLMNn0RhjLRB0GZ264wiHT2Ji62sukhZXS9Vsh GH2P1ovEdeFKcbVCA0qlKhZeFQDOnMQQl11l32QZcHdHYsKVPsN5s8YUtlPesUzS9Rz7 7CMQ== X-Gm-Message-State: AEkooutXMg6FTowNDHPbsVrUdOYlwONLncND+rXhwE8VW0BogQ0+ei1jn2d1xFGvfwvqOflz8cTAVDiB7hu3gg== X-Received: by 10.107.159.147 with SMTP id i141mr15640182ioe.29.1471719456573; Sat, 20 Aug 2016 11:57:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Sat, 20 Aug 2016 11:57:36 -0700 (PDT) In-Reply-To: <20160820184506.GV8192@zxy.spb.ru> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> From: Ryan Stone Date: Sat, 20 Aug 2016 14:57:36 -0400 Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov Cc: Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 18:57:37 -0000 On Sat, Aug 20, 2016 at 2:45 PM, Slawa Olhovchenkov wrote: > You also can recive this on ethernet too, IMHO, in case of /32. > Receiving L3 broadcst in L2 unicast is legitime (IMHO) and we must be > relaxed on this. > There is no broadcast address on a /32 network. Independent of my change, we would not treat a packet received on a /32 network as a broadcast here because in_broadcast() will return 0 for it. From owner-svn-src-head@freebsd.org Sat Aug 20 18:59:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4001CBC0013; Sat, 20 Aug 2016 18:59:58 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F23881E0B; Sat, 20 Aug 2016 18:59:57 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbBUp-0006eV-Uj; Sat, 20 Aug 2016 21:59:55 +0300 Date: Sat, 20 Aug 2016 21:59:55 +0300 From: Slawa Olhovchenkov To: Ryan Stone Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160820185955.GR22212@zxy.spb.ru> References: <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 18:59:58 -0000 On Sat, Aug 20, 2016 at 02:57:36PM -0400, Ryan Stone wrote: > On Sat, Aug 20, 2016 at 2:45 PM, Slawa Olhovchenkov wrote: > > > You also can recive this on ethernet too, IMHO, in case of /32. > > Receiving L3 broadcst in L2 unicast is legitime (IMHO) and we must be > > relaxed on this. > > > > There is no broadcast address on a /32 network. Independent of my change, > we would not treat a packet received on a /32 network as a broadcast here > because in_broadcast() will return 0 for it. /32 only from router side (+proxy arp). host configured for /24 From owner-svn-src-head@freebsd.org Sat Aug 20 19:49:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A26ACBC0E4E; Sat, 20 Aug 2016 19:49:31 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (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 5AF2619F4; Sat, 20 Aug 2016 19:49:31 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id bCGlbzcvzXHJlbCGmbB2B9; Sat, 20 Aug 2016 13:49:29 -0600 X-Authority-Analysis: v=2.2 cv=Ffh1/926 c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=7z1cN_iqozsA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=mqxo5rJUD7QTCOWbiGwA:9 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 47968137E8; Sat, 20 Aug 2016 12:49:27 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u7KJnRHf003966; Sat, 20 Aug 2016 12:49:27 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201608201949.u7KJnRHf003966@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: John Baldwin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304513 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/ie sys/i386/conf sys/modules sys/modules/ie sys/pc98/conf In-Reply-To: Message from John Baldwin of "Sat, 20 Aug 2016 07:51:55 -0700." <1699917.hhfoKyASTk@ralph.baldwin.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 20 Aug 2016 12:49:27 -0700 X-CMAE-Envelope: MS4wfMyzrH08pCe6dKy9TLaVEbNSBAJJKT5pbv3ptl2k5im7m+De20N6PG6oUbGZUMdhyhOyHtAtK3nKOPYnhLq5u1BhvzFlBY2GW9v+aX17Ei/V4CbEGGNh gwhW3FNL2V1F5Ue69BS4elAMj/4bgiyyr19ZJnFdUndLXd5MhGcbOLjsscR77O10T29Jl2ystbTsWpjCTdDOIXl+dl2DOdFfrLtRuLWiPkstZvSSzEBfIw/H eJBXMKdPhBGyuAjWowJiN9J6FBKLpwJd9qqGmlI6Lzmmtu7OhZzsnt7oKnKzb+rs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 19:49:31 -0000 In message <1699917.hhfoKyASTk@ralph.baldwin.cx>, John Baldwin writes: > On Saturday, August 20, 2016 12:49:30 AM John Baldwin wrote: > > Author: jhb > > Date: Sat Aug 20 00:49:29 2016 > > New Revision: 304513 > > URL: https://svnweb.freebsd.org/changeset/base/304513 > > > > Log: > > Remove the ie(4) driver for Intel 82586 ISA Ethernet adapters. > > > > This driver only supports 10Mb Ethernet using PIO (the hardware supports > > DMA, but the driver only does PIO). There are not any PCCard adapters > > supported by this driver, only ISA cards. In addition, it does not use > > bus_space but instead uses bcopy with volatile pointers triggering a > > host of warnings. (if_ie.c is one of 3 files always built with > > -Wno-error) > > > > Relnotes: yes > > This concludes the list of older drivers I had from earlier after working > on the timeout(9) -> callout(9) changes (almost finished with that, just > a few things left to test changes for, one of them being fail points before > we can remove timeout()/untimeout() entirely). > > I do not have plans for removing any other drivers, though am open to > suggestions. Some possibilities include: > > - tty drivers that haven't been updated to new tty and have been disconnected > from the build since 8.0 including digi(4) and cy(4). I know Bruce has > patches for sio(4) that I just haven't merged, so I'm inclined to leave > sio(4), but the other disconnected drivers are candidates I think. > - Older storage adapters: > - aha (ISA) I have a bunch of AHA-1542s in a storage locker (along with the contents of my house when I sold it). I recall that SCSI was better behaved on my first FreeBSD machine (FreeBSD 2.0.5) than was IDE. (Except for IDE support, Linux sucked badly in all other areas at the time, thus my introduction to FreeBSD, thanks to jkh@. But that's going down memory lane...) I digress... > - ahb (EISA) > - adv (ISA / EISA / PCI) > - adw (PCI)? > - bt (ISA / EISA / PCI) I have one of these. IIRC, a 948 PCI card. Though I don't use it any more. The Adaptec 2940s -- ahc -- of which I have many -- were my mainstay. > - aic (ISA / PCCard) > - ct (ISA / CBUS) > - dpt (ISA / EISA / PCI) > - ncv (PCCard / PCI) > - nsp (PCCard) > - stg (ISA / PCCard / PCI) > (Note: some of these are PC-98 related and might remove too much of the > PC-98 ecosystem if removed?) > - mse(4) (ISA-only non-PS-2, non-serial mouse) > - joy(4) (ISA-only, was on various Sound Cards, etc., but I haven't seen > a "game port" on a modern box in a long while) > Hmmm. I could open another bikeshed here. I'd better not. -- 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 Aug 20 19:51:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0259FBC0FE0; Sat, 20 Aug 2016 19:51:53 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (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 AAA301CBF; Sat, 20 Aug 2016 19:51:52 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id bCIzbzeDPXHJlbCJ0bB2VK; Sat, 20 Aug 2016 13:51:46 -0600 X-Authority-Analysis: v=2.2 cv=Ffh1/926 c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=7z1cN_iqozsA:10 a=-FGs326eAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=Uq3-0apMmEqrnhaVEVUA:9 a=7Nw9HX5Nqxt2AnyyOhBr:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 2975D13860; Sat, 20 Aug 2016 12:51:45 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u7KJpiAZ004000; Sat, 20 Aug 2016 12:51:44 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201608201951.u7KJpiAZ004000@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: Mark Linimon cc: John Baldwin , src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r304513 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/ie sys/i386/conf sys/modules sys/modules/ie sys/pc98/conf In-Reply-To: Message from Mark Linimon of "Sat, 20 Aug 2016 10:24:06 -0500." <20160820152406.GA8132@lonesome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 20 Aug 2016 12:51:44 -0700 X-CMAE-Envelope: MS4wfOABDrGxCxOAT27jgoYAh2cctIViKz/o/7nbiGDv3t1Q0h/pGAaB0i2jso5fZ9un6/k/RPBHS7O27WEbM4DrFDyanGMnS0jo0xaGEZQkbPvD7Y5e7yHC yNUT8JQ4yIwUXCKG+4q9M+v8MjsncVrxN69n7NpVkMQ2gCo+foktAUEsIuP1mH7H6jy+zoByZM+PHyoXBfKGly1/XWO/dj0gW1b+zF8UowmaWvc/LqUk6Whu WYF1T/RaWstZ/g5l0w9P+L0Ht1lLW+Zn+TWTEKaFNWfsw4QQmdORdU+OXrQpNZkm4RmQiOiwRGZNeCsU8YsNZw== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 19:51:53 -0000 In message <20160820152406.GA8132@lonesome.com>, Mark Linimon writes: > On Sat, Aug 20, 2016 at 07:51:55AM -0700, John Baldwin wrote: > > - aha (ISA) > > - bt (ISA / EISA / PCI) > > If anyone complains, tell them I'll ship them cards. > > If they consider that a threat ... so be it :-) > > (I *am* in the middle of a big decluttering, you know. I can find > them ...) Add my BT-948 to the list. -- 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 Aug 20 20:05:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11D7CBC02C9; Sat, 20 Aug 2016 20:05:47 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D41A315B2; Sat, 20 Aug 2016 20:05:46 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id BC830202B5; Sat, 20 Aug 2016 16:05:45 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 16:05:45 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=0aA0EwChDLlZjobxX68vrGtvK6c=; b=ipXi6g W9EH8gUVIQhw5/UwOnME5dLFhE38cZAjSks2lqZLRJ8Qf3CccD5cfCpHtJIUSxg3 Fg8BOYbInaT/ob04WM7V3A2D/rjKjDAWgYg2tQ/2E+z/r5Larvow+O1BH0V9p171 w1kEHttXN6/iPWf/A/46ZqRh5Kizj4wOj3Qxo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=0aA0EwChDLlZjob xX68vrGtvK6c=; b=W1FbtqDOq9W6un0/6x0JIz0EwMXqSxmIizApWAGXQqIXE8+ OsDABX9aUXzh0Su+QFYJIib9NoQAOxv0THxD6c6BmsoXrLzIP+9jh0h/lBbAnUaj gNES2E7cFRM/73piUT6YgqEjK3H+lTix0+D0oS2pJwNwWE+tUMJCUJvvpzHw= X-Sasl-enc: MF2XJ7uoXbQbK+CQB3Fav63UhRk+v+eFwzUr74cXXwTe 1471723545 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 88C8EF296F; Sat, 20 Aug 2016 16:05:44 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone , Slawa Olhovchenkov References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> Cc: "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: Date: Sat, 20 Aug 2016 21:05:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 20:05:47 -0000 On 20/08/16 19:57, Ryan Stone wrote: > > > On Sat, Aug 20, 2016 at 2:45 PM, Slawa Olhovchenkov > wrote: > > You also can recive this on ethernet too, IMHO, in case of /32. > Receiving L3 broadcst in L2 unicast is legitime (IMHO) and we must be > relaxed on this. > > > There is no broadcast address on a /32 network. Independent of my > change, we would not treat a packet received on a /32 network as a > broadcast here because in_broadcast() will return 0 for it. Hmm. That is not entirely true for /32. Even though the link layer might be Ethernet in that case, in the traditional BSD ifnet sense, while the broadcast address slot may have the same value (and actual location) as the peer end of a P2P (as in generically IFF_PPP, not just pppd(8)) interface), because it's on an Ethernet (IFF_BROADCAST) interface, the host part of the /32's value in in the broadcast address is still valid, and will probably get mapped that way if M_BCAST is set on outgoing traffic. (You are, after all, going to go through ARP on Ethernet, even for a /32, so that mapping will be triggered.) Unless I am missing something crucial here? As far as I can tell, arpresolve() unconditionally resolves L2 next-hop to the value of ifp->if_broadcastaddr. And that is always set to 'etherbroadcastaddr' by default for Ethernet ifnets: FF:FF:FF:FF:FF:FF. Would that not get past the M_BCAST check which replaced the call to in_broadcast()? From owner-svn-src-head@freebsd.org Sat Aug 20 20:15:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EF88BC04FF; Sat, 20 Aug 2016 20:15:38 +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 DFC191A0B; Sat, 20 Aug 2016 20:15:37 +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 u7KKFbFq020468; Sat, 20 Aug 2016 20:15:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KKFbm9020467; Sat, 20 Aug 2016 20:15:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608202015.u7KKFbm9020467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 20 Aug 2016 20:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304543 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 20:15:38 -0000 Author: tuexen Date: Sat Aug 20 20:15:36 2016 New Revision: 304543 URL: https://svnweb.freebsd.org/changeset/base/304543 Log: Unbreak sctp_connectx(). MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Aug 20 19:48:03 2016 (r304542) +++ head/sys/netinet/sctputil.c Sat Aug 20 20:15:36 2016 (r304543) @@ -6356,7 +6356,7 @@ sctp_connectx_helper_find(struct sctp_in struct sctp_tcb *stcb = NULL; unsigned int incr, at, i; - at = incr = 0; + at = 0; sa = addr; *error = *num_v6 = *num_v4 = 0; /* account and validate addresses */ @@ -6364,6 +6364,7 @@ sctp_connectx_helper_find(struct sctp_in switch (sa->sa_family) { #ifdef INET case AF_INET: + incr = (unsigned int)sizeof(struct sockaddr_in); if (sa->sa_len != incr) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); *error = EINVAL; @@ -6371,7 +6372,6 @@ sctp_connectx_helper_find(struct sctp_in return (NULL); } (*num_v4) += 1; - incr = (unsigned int)sizeof(struct sockaddr_in); break; #endif #ifdef INET6 @@ -6387,6 +6387,7 @@ sctp_connectx_helper_find(struct sctp_in *bad_addr = 1; return (NULL); } + incr = (unsigned int)sizeof(struct sockaddr_in6); if (sa->sa_len != incr) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); *error = EINVAL; @@ -6394,7 +6395,6 @@ sctp_connectx_helper_find(struct sctp_in return (NULL); } (*num_v6) += 1; - incr = (unsigned int)sizeof(struct sockaddr_in6); break; } #endif From owner-svn-src-head@freebsd.org Sat Aug 20 20:28:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33EC3BC07C2; Sat, 20 Aug 2016 20:28:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E00701FE4; Sat, 20 Aug 2016 20:28:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KKS9JR024167; Sat, 20 Aug 2016 20:28:09 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KKS84V024163; Sat, 20 Aug 2016 20:28:08 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201608202028.u7KKS84V024163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sat, 20 Aug 2016 20:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304544 - in head/sys: kern security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 20:28:10 -0000 Author: rwatson Date: Sat Aug 20 20:28:08 2016 New Revision: 304544 URL: https://svnweb.freebsd.org/changeset/base/304544 Log: Audit the accepted (or rejected) username argument to setlogin(2). (NB: This was likely a mismerge from XNU in audit support, where the text argument to setlogin(2) is captured -- but as a text token, whereas this change uses the dedicated login-name field in struct audit_record.) MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/kern/kern_prot.c head/sys/security/audit/audit.h head/sys/security/audit/audit_bsm.c Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Sat Aug 20 20:15:36 2016 (r304543) +++ head/sys/kern/kern_prot.c Sat Aug 20 20:28:08 2016 (r304544) @@ -2105,6 +2105,7 @@ sys_setlogin(struct thread *td, struct s error = EINVAL; return (error); } + AUDIT_ARG_LOGIN(logintmp); PROC_LOCK(p); SESS_LOCK(p->p_session); strcpy(p->p_session->s_login, logintmp); Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Sat Aug 20 20:15:36 2016 (r304543) +++ head/sys/security/audit/audit.h Sat Aug 20 20:28:08 2016 (r304544) @@ -212,6 +212,11 @@ void audit_thread_free(struct thread *t audit_arg_groupset((gidset), (gidset_size)); \ } while (0) +#define AUDIT_ARG_LOGIN(login) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_login((login)); \ +} while (0) + #define AUDIT_ARG_MODE(mode) do { \ if (AUDITING_TD(curthread)) \ audit_arg_mode((mode)); \ @@ -354,6 +359,7 @@ void audit_thread_free(struct thread *t #define AUDIT_ARG_FFLAGS(fflags) #define AUDIT_ARG_GID(gid) #define AUDIT_ARG_GROUPSET(gidset, gidset_size) +#define AUDIT_ARG_LOGIN(login) #define AUDIT_ARG_MODE(mode) #define AUDIT_ARG_OWNER(uid, gid) #define AUDIT_ARG_PID(pid) Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Sat Aug 20 20:15:36 2016 (r304543) +++ head/sys/security/audit/audit_bsm.c Sat Aug 20 20:28:08 2016 (r304544) @@ -1394,8 +1394,8 @@ kaudit_to_bsm(struct kaudit_record *kar, break; case AUE_SETLOGIN: - if (ARG_IS_VALID(kar, ARG_TEXT)) { - tok = au_to_text(ar->ar_arg_text); + if (ARG_IS_VALID(kar, ARG_LOGIN)) { + tok = au_to_text(ar->ar_arg_login); kau_write(rec, tok); } break; From owner-svn-src-head@freebsd.org Sat Aug 20 20:34:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99E9CBC0C81; Sat, 20 Aug 2016 20:34:17 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67D101799; Sat, 20 Aug 2016 20:34:17 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 1242E20255; Sat, 20 Aug 2016 16:34:16 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 16:34:16 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=M7X4CaGypMylhBzxghJSCv+oHWo=; b=EOJJYG xbUmLKZuneEjiCIUSktkelx+QjFvtC3QpFzWFURxxSR3QHj0MGae5hXRp5qAdBaT g+qFLEIYW/gCCMHAZlH4CNQExwM0Xo/HNqdrHYYbtZb0zhfjNe2R0Oh81MEUgViI LDInhTsFEJyA+QeakHthmJQngygUYBT5sPeV4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=M7X4CaGypMylhBz xghJSCv+oHWo=; b=KUGqd+8g0hrUhwZaAsE+oRgPSwxBX38vlw1CGY11W+zRP4A lkPQmfQlk1xa7ptXALhzdQgQP1GdRhNXur12Kf5ZBj3INUuvwWGEDuYYNIUIlNz9 9Wc212G84910cblVxXs2030gew6QAKMdN/Pf10Za04DaIeHXFOeCxLIwVEQg= X-Sasl-enc: 1gldOMlIDvVgByxfQ2KhLaQPibzj7HX+xqcoHNgmK9Io 1471725255 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 07B94F2983; Sat, 20 Aug 2016 16:34:14 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone , Slawa Olhovchenkov References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> Cc: "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> Date: Sat, 20 Aug 2016 21:34:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 20:34:17 -0000 On 20/08/16 21:05, Bruce Simpson wrote: > Unless I am missing something crucial here? As far as I can tell, > arpresolve() unconditionally resolves L2 next-hop to the value of > ifp->if_broadcastaddr. And that is always set to 'etherbroadcastaddr' by > default for Ethernet ifnets: FF:FF:FF:FF:FF:FF. > > Would that not get past the M_BCAST check which replaced the call to > in_broadcast()? Based on my reading of the UDP-and-plumbing layer, it looks like we will only see FF:FF:FF:FF:FF:FF being used by the undirected IPv4 broadcast address, 255.255.255.255. But, in fact, this is probably a far more valid address to use for discovery services than the x.x.x.255-style IPv4 directed broadcast address, as, for Ethernet at least, it is guaranteed not to propagate beyond 1 union-of (on-link broadcast domain (layer 2, hop 1) & other ways that IPv4 subnet is bridged). So, Ryan -- your original reading of how in_broadcast() behaves is correct, modulo the all-ones bypassing it. (I believe dhclient and isc-dhcpd bypass it at BPF injection, though.) From owner-svn-src-head@freebsd.org Sat Aug 20 20:41:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 022E5BC0DA1; Sat, 20 Aug 2016 20:41:16 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B429F1A24; Sat, 20 Aug 2016 20:41:15 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbD4k-0008qT-VJ; Sat, 20 Aug 2016 23:41:06 +0300 Date: Sat, 20 Aug 2016 23:41:06 +0300 From: Slawa Olhovchenkov To: Bruce Simpson Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160820204106.GW8192@zxy.spb.ru> References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 20:41:16 -0000 On Sat, Aug 20, 2016 at 09:34:06PM +0100, Bruce Simpson wrote: > On 20/08/16 21:05, Bruce Simpson wrote: > > Unless I am missing something crucial here? As far as I can tell, > > arpresolve() unconditionally resolves L2 next-hop to the value of > > ifp->if_broadcastaddr. And that is always set to 'etherbroadcastaddr' by > > default for Ethernet ifnets: FF:FF:FF:FF:FF:FF. > > > > Would that not get past the M_BCAST check which replaced the call to > > in_broadcast()? > > Based on my reading of the UDP-and-plumbing layer, it looks like we will > only see FF:FF:FF:FF:FF:FF being used by the undirected IPv4 broadcast > address, 255.255.255.255. > > But, in fact, this is probably a far more valid address to use for > discovery services than the x.x.x.255-style IPv4 directed broadcast > address, as, for Ethernet at least, it is guaranteed not to propagate > beyond 1 union-of (on-link broadcast domain (layer 2, hop 1) & other > ways that IPv4 subnet is bridged). > > So, Ryan -- your original reading of how in_broadcast() behaves is > correct, modulo the all-ones bypassing it. > > (I believe dhclient and isc-dhcpd bypass it at BPF injection, though.) What purpose to analyse L2 header? Yes, curently FreeBSD don't support multiaccess media other then ethernet (i.e. ATM, FrameRelay), but in case of mGRE L2 header will be absent. From owner-svn-src-head@freebsd.org Sat Aug 20 20:46:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BDC9BC0F73; Sat, 20 Aug 2016 20:46:55 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E14D61ECF; Sat, 20 Aug 2016 20:46:54 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KKksWk031559; Sat, 20 Aug 2016 20:46:54 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KKksdN031558; Sat, 20 Aug 2016 20:46:54 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201608202046.u7KKksdN031558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Sat, 20 Aug 2016 20:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304545 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 20:46:55 -0000 Author: karels Date: Sat Aug 20 20:46:53 2016 New Revision: 304545 URL: https://svnweb.freebsd.org/changeset/base/304545 Log: Disable L2 caching for UDP over IPv6 The ip6_output routine is missing L2 cache invalication as done in ip_output. Even with that code, some problems with UDP over IPv6 have been reported. Diabling L2 cache for that problem works around the problem for now. PR: 211872 211926 Reviewed by: gnn Approved by: gnn (mentor) MFC after: immediate Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Sat Aug 20 20:28:08 2016 (r304544) +++ head/sys/netinet6/udp6_usrreq.c Sat Aug 20 20:46:53 2016 (r304545) @@ -898,7 +898,7 @@ udp6_output(struct inpcb *inp, struct mb UDP_PROBE(send, NULL, inp, ip6, inp, udp6); UDPSTAT_INC(udps_opackets); - error = ip6_output(m, optp, &inp->inp_route6, flags, + error = ip6_output(m, optp, NULL, flags, inp->in6p_moptions, NULL, inp); break; case AF_INET: From owner-svn-src-head@freebsd.org Sat Aug 20 21:17:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C311BC07F3; Sat, 20 Aug 2016 21:17:38 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C12411E6; Sat, 20 Aug 2016 21:17:37 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id A5EC220439; Sat, 20 Aug 2016 17:17:36 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 17:17:36 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=O6Z7xG76TTuAkgoUdfUY2eoEuoI=; b=C6mbdP PH9svkcWDsV50MurSQeeMJ1yVaTXJwolUv1RxzW34VHSIl/ibyqMT5vorl9SaP34 SxzP7XJzo/k7VmvVeCAQqdUQ1676aO8zoeYvwHs2qI9AhSK9lU31a1QETc1r1Rzp 2kR/4dlkEYGltRv+T242LAwveRs9FAJph+YRw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=O6Z7xG76TTuAkgo UdfUY2eoEuoI=; b=ER/hqcGoq8Fv0lcRpzQiA0H00tsgJd4D5K7mb774KsN1/gl NpIt699cxcnS6/pqXoajYa/FEuP2e1OxDlmARKYXBt5aFZqUyDzM103HrBVnJLaa 2z2qrenIXKg9j8bW5OS5TjhIiedszhtFrsmpU5HBh1wpsQ0rkjV7ZBpkOtfU= X-Sasl-enc: QA6B73tyS1i9DvM8kfr4NMEayXNK3yiKbN8mXfF9N7Z1 1471727856 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 9EF7BCCDC5; Sat, 20 Aug 2016 17:17:35 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> Date: Sat, 20 Aug 2016 22:17:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160820204106.GW8192@zxy.spb.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 21:17:38 -0000 On 20/08/16 21:41, Slawa Olhovchenkov wrote: > On Sat, Aug 20, 2016 at 09:34:06PM +0100, Bruce Simpson wrote: >> So, Ryan -- your original reading of how in_broadcast() behaves is >> correct, modulo the all-ones bypassing it. > What purpose to analyse L2 header? I was just checking for possible edge cases for a substitution of the in_broadcast() check with some other way of logically summarising the real broadcast disposition of the interface in bits, given your mGRE example below. Like M_BCAST, but 'This packet is flagged as broadcast, but only by a proxy method, not L2'. > Yes, curently FreeBSD don't support multiaccess media other then > ethernet (i.e. ATM, FrameRelay), but in case of mGRE L2 header will be > absent. Exactly! People forget that certain legitimate multipoint protocols already exist as overlays already. It is easy when all we grow up with is Ethernet. :-) Until we peek under the hood, we may not know. Slawa, you have hit the nail on the head. The situation can naturally arise anywhere we bridge L2/L3 in certain directions, be that in VPN aggregation or PPPoE aggregation. In many ways I regret never being able to have executed work on a design for ng_pppoa in 2005/6. But, given the pain people in the UK are having with BT and VDSL modem provision right now... it comes as no surprise that the next generation of DSL access, for us, can be as bad. For some, multipoint is less important now we have SR-IOV VFs and other means of allocating discrete unicast Ethernet MACs and using them as links, but... Roundabout the time I merged M_PROMISC from NetBSD to FreeBSD in 2006/7, I considered that we should add an abstraction to ifnet to permit multiple unicast (or special) MACs to be bound to existing ifnets, and -- where the card permits it, expedite that MAC in some way. That capability was present on the (legacy) Adaptec Starfire quad 100TX from that era. Today, it exists in e.g. Chelsio T4/5 TCAM filter, or multiple perfect hashes on the previous generations of cards. (Currently the FreeBSD stack does nothing about such.) I suspect it is less important now we have RSS for raw TCP throughput, but, for those of us -- e.g. in internet service provider (ISP) type environments, we have to keep a careful eye on how well FreeBSD plays nice with other Ethernet equipment, with a view to these types of potential optimizations in future. However, we still have to keep the FreeBSD-on-Ethernet ship sailing smoothly. The intent of the original input path change is clearly for performance, but perhaps slipping the M_BCAST tag in the stack is the right way forward. I would also suggest: we add ability to qualify where in the stack M_BCAST was raised (in case of any possible re-entry), by allocating one more MBUF flag to Layer 2. Then, the same M_PROMISC flag trick can be applied... and Ryan's broadcast performance boost could perhaps even carry across L2 bridging tiers, e.g. stacked if_bridge or netgraph, providing we know what direction in the stack it's traveling in (and its absolute ifnet origin). From owner-svn-src-head@freebsd.org Sat Aug 20 21:44:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28867BC0FEB; Sat, 20 Aug 2016 21:44:14 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB8F11F93; Sat, 20 Aug 2016 21:44:13 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 71159202A9; Sat, 20 Aug 2016 17:44:12 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 17:44:12 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=4tDGJUWkgw6O2b3yyyB14QlnOBw=; b=YNfFak ccUFbmvGTvs9djkypX2pDjGfEHm4zDisLmeS5UBSLLPbc3imw//1pcTV7cehBmt3 K1CL01CucWxF1b3MNwGgQ/Ha1V4wxpRHXO3owUWrrMENaNeTb62bLlEz2CzvnzTI rG9fIZwaaLdwhiP7htkZGUL4sH5opzm3SyoXs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=4tDGJUWkgw6O2b3 yyyB14QlnOBw=; b=rFaiYVl1WWa3CzHThzRZX1Ha+D1uWN+ap45Z4Km+x3pbW32 KtHzxriqanIr3BY6L0ON7+Vgl3gCv6EepcbTcK+0ArcKgASYKuYcxA8cJfrYjRWE u7+Ux63oNlhW78s7wGF7bW/hoSY+95wjSLPBBnDx6kJTNoYaKvJd6AdZERdg= X-Sasl-enc: rRPDW19BbktxvWNZkTIKvCOjeCjZeF4jxYUK/Gypz7Qw 1471729452 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 4A850CCE68; Sat, 20 Aug 2016 17:44:11 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: Date: Sat, 20 Aug 2016 22:44:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 21:44:14 -0000 On 20/08/16 22:17, Bruce Simpson wrote: > However, we still have to keep the FreeBSD-on-Ethernet ship sailing > smoothly. The intent of the original input path change is clearly for > performance, but perhaps slipping the M_BCAST tag in the stack is the > right way forward. > > I would also suggest: we add ability to qualify where in the stack > M_BCAST was raised (in case of any possible re-entry), by allocating one > more MBUF flag to Layer 2. > > Then, the same M_PROMISC flag trick can be applied... and Ryan's > broadcast performance boost could perhaps even carry across L2 bridging > tiers, e.g. stacked if_bridge or netgraph, providing we know what > direction in the stack it's traveling in (and its absolute ifnet origin) The main motivation for this: retain the original meaning of M_BCAST. (in addition to Ryan's intended new meaning that IP indicate to itself "This is IPv4 broadcast" and to others - it could be used to expedite delivery with some form of map). But, say, let's add a second flag which allows for controlled stacking of L2 in situations like this. Let's call it M_BCPROXY. It can be tracked for the original meaning, i.e. without the new meaning Ryan proposes for M_BCAST. When M_BCAST is set and M_BCPROXY is clear, we know the packet is broadcast, but we don't know for sure that this isn't because IP inspected it, and set the M_BCAST flag due to the destination IPv4 address being identified as such (and valid for its link, if you are enforcing the Strong IP End-Station model, RFC 1122 style, as is the BSD default). However, if we set M_BCPROXY at the same time, then, in situations where we might potentially re-enter the stack holding the same broadcast packet, we know that IP marked the packet as broadcast, and - on entry - can change our routing/switching/allocation/replication strategies accordingly. (This is not information which, on its own, holding the origin ifnet pointer provides; the flag is needed to sense direction in the stack.) So, as the mbuf chain is handed-off between other L2 entities (this can easily happen with stacked VLAN tags, in Q-in-Q and provider environments, which pfSense can service very well) - and, if the node itself determines that it is also a recipient of the broadcast, for correct hand-off if the broadcast does need to be forwarded by some other FreeBSD subsystem. It could also be checked by firewalls: e.g. for a corroborated check, from the mask of these two flags, where in the stack (or link forest) a purported broadcast packet actually originated from. (Pretty much essential for maintaining audit trail if a Smurf-like amplification attack is caught in the act, or if an NTP relay (or other association) terminates in an NTP broadcast association. And, of course, to trace dodgy broadcast Sun-style XDR RPC back to its source.) From owner-svn-src-head@freebsd.org Sat Aug 20 22:05:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BA87BC0325; Sat, 20 Aug 2016 22:05:16 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AD7618B5; Sat, 20 Aug 2016 22:05:16 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbEO6-000Ah9-VS; Sun, 21 Aug 2016 01:05:10 +0300 Date: Sun, 21 Aug 2016 01:05:10 +0300 From: Slawa Olhovchenkov To: Bruce Simpson Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160820220510.GX8192@zxy.spb.ru> References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 22:05:16 -0000 On Sat, Aug 20, 2016 at 10:17:27PM +0100, Bruce Simpson wrote: > On 20/08/16 21:41, Slawa Olhovchenkov wrote: > > On Sat, Aug 20, 2016 at 09:34:06PM +0100, Bruce Simpson wrote: > >> So, Ryan -- your original reading of how in_broadcast() behaves is > >> correct, modulo the all-ones bypassing it. > > What purpose to analyse L2 header? > > I was just checking for possible edge cases for a substitution of the > in_broadcast() check with some other way of logically summarising the > real broadcast disposition of the interface in bits, given your mGRE > example below. I am think this substitution is very bad idea (by design). Also, on transmit side this is must be irrelevant on received L2 header (and this in many cases this is will be L2 unicast packet). For other cases packet will be created on host and don't have any received information. On received side for host relaing on L2 information for accepting packet as host targeting sound like security hole. In router case receiving broadcast packet in any way need additional check for dst IP address (host part is all zero or all one? what about handling this broadcast type (RFC talk about conroling variation of this)? what about sysctl control of receiving routed broadcast packets? what about handling 255.255.255.255?) In any way, this is irrelevant to L2 broadcast MAC and present L2 broadcast flags. > Like M_BCAST, but 'This packet is flagged as broadcast, but only by a > proxy method, not L2'. > > > Yes, curently FreeBSD don't support multiaccess media other then > > ethernet (i.e. ATM, FrameRelay), but in case of mGRE L2 header will be > > absent. > > Exactly! People forget that certain legitimate multipoint protocols > already exist as overlays already. It is easy when all we grow up with > is Ethernet. :-) Until we peek under the hood, we may not know. > > Slawa, you have hit the nail on the head. > > The situation can naturally arise anywhere we bridge L2/L3 in certain > directions, be that in VPN aggregation or PPPoE aggregation. > > In many ways I regret never being able to have executed work on a design > for ng_pppoa in 2005/6. But, given the pain people in the UK are having > with BT and VDSL modem provision right now... it comes as no surprise > that the next generation of DSL access, for us, can be as bad. > > For some, multipoint is less important now we have SR-IOV VFs and other > means of allocating discrete unicast Ethernet MACs and using them as > links, but... Multipoint is mandatory for DMVPN. > Roundabout the time I merged M_PROMISC from NetBSD to FreeBSD in 2006/7, > I considered that we should add an abstraction to ifnet to permit > multiple unicast (or special) MACs to be bound to existing ifnets, and > -- where the card permits it, expedite that MAC in some way. > > That capability was present on the (legacy) Adaptec Starfire quad 100TX > from that era. Today, it exists in e.g. Chelsio T4/5 TCAM filter, or > multiple perfect hashes on the previous generations of cards. (Currently > the FreeBSD stack does nothing about such.) > > I suspect it is less important now we have RSS for raw TCP throughput, > but, for those of us -- e.g. in internet service provider (ISP) type > environments, we have to keep a careful eye on how well FreeBSD plays > nice with other Ethernet equipment, with a view to these types of > potential optimizations in future. May be only as options, per NIC based? I.e. check for L3 broadcasy only when NIC flaged? w/o check L2 dst MAC for broadcasting, because this is excessively and don't give any speed up (in any case need check for L3 broadcast). > However, we still have to keep the FreeBSD-on-Ethernet ship sailing > smoothly. The intent of the original input path change is clearly for > performance, but perhaps slipping the M_BCAST tag in the stack is the > right way forward. > > I would also suggest: we add ability to qualify where in the stack > M_BCAST was raised (in case of any possible re-entry), by allocating one > more MBUF flag to Layer 2. > > Then, the same M_PROMISC flag trick can be applied... and Ryan's > broadcast performance boost could perhaps even carry across L2 bridging > tiers, e.g. stacked if_bridge or netgraph, providing we know what > direction in the stack it's traveling in (and its absolute ifnet origin). > Because L3 broadcast check need be in any case (and can be perform by hash lookup in same time as host ip check) L2 broadcaste check needless. From owner-svn-src-head@freebsd.org Sat Aug 20 22:12:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 094D3BC0603; Sat, 20 Aug 2016 22:12:28 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDF021F07; Sat, 20 Aug 2016 22:12:27 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KMCRWo065107; Sat, 20 Aug 2016 22:12:27 GMT (envelope-from zec@FreeBSD.org) Received: (from zec@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KMCRQU065106; Sat, 20 Aug 2016 22:12:27 GMT (envelope-from zec@FreeBSD.org) Message-Id: <201608202212.u7KMCRQU065106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zec set sender to zec@FreeBSD.org using -f From: Marko Zec Date: Sat, 20 Aug 2016 22:12:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304548 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 22:12:28 -0000 Author: zec Date: Sat Aug 20 22:12:26 2016 New Revision: 304548 URL: https://svnweb.freebsd.org/changeset/base/304548 Log: Permit disabling net.inet.udp.require_l2_bcast in VIMAGE kernels. The default value of the tunable introduced in r304436 couldn't be effectively overrided on VIMAGE kernels, because instead of being accessed via the appropriate VNET() accessor macro, it was accessed via the VNET_NAME() macro, which resolves to the (should-be) read-only master template of initial values of per-VNET data. Hence, while the value of udp_require_l2_bcast could be altered on per-VNET basis, the code in udp_input() would ignore it as it would always read the default value (one) from the VNET master template. Silence from: rstone Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Sat Aug 20 21:34:41 2016 (r304547) +++ head/sys/netinet/udp_usrreq.c Sat Aug 20 22:12:26 2016 (r304548) @@ -127,6 +127,7 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, blac "Do not send port unreachables for refused connects"); static VNET_DEFINE(int, udp_require_l2_bcast) = 1; +#define V_udp_require_l2_bcast VNET(udp_require_l2_bcast) SYSCTL_INT(_net_inet_udp, OID_AUTO, require_l2_bcast, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(udp_require_l2_bcast), 0, "Only treat packets sent to an L2 broadcast address as broadcast packets"); @@ -528,7 +529,7 @@ udp_input(struct mbuf **mp, int *offp, i pcbinfo = udp_get_inpcbinfo(proto); if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || - ((!VNET_NAME(udp_require_l2_bcast) || m->m_flags & M_BCAST) && + ((!V_udp_require_l2_bcast || m->m_flags & M_BCAST) && in_broadcast(ip->ip_dst, ifp))) { struct inpcb *last; struct inpcbhead *pcblist; From owner-svn-src-head@freebsd.org Sat Aug 20 23:25:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7231CBC059B; Sat, 20 Aug 2016 23:25:57 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 430C31DAA; Sat, 20 Aug 2016 23:25:57 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 2D95720597; Sat, 20 Aug 2016 19:25:56 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 19:25:56 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=GhyA1fRNWhlqlLzVIAEtg6zuTFk=; b=ERoLN6 Otka4TQ0s7fi7aUC00ZBD4FT8ACKsVdKQEYYiRLutr5PRb65w+SNYvdlor4ckDaX Ofo0nyjKGQsu9ndjq1s8mHDNJ71Xmuywtc+48i4QPGnBnGzuQ69k6MTiUBoT3q4Q NbJZIUAlNQHqgjhY8+aVa/JPUViWQwWUx/20o= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=GhyA1fRNWhlqlLz VIAEtg6zuTFk=; b=Y+F+S10mUNaA5Odut60dwlFJ9OCYhhtSbGiYphE/gCE0zSA iGzALGJlTOpHSYQXyL4h7FT4FbCJ8zqIQJVtp5vtbGQAH/uOJyTDeiAyHw4L2DG5 ZvkVl8gzGp1Wr7qTZxwjp7mMRLOxOM5KAtsxF3855Mx58rD39pBnBnA9fcP4= X-Sasl-enc: J12LT999O2YQnjP2/ci8YMhrCX0TtWQ5TNHG9/6kLkDr 1471735555 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id F2234CCE7E; Sat, 20 Aug 2016 19:25:54 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> Date: Sun, 21 Aug 2016 00:25:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160820220510.GX8192@zxy.spb.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 23:25:57 -0000 On 20/08/16 23:05, Slawa Olhovchenkov wrote: > I am think this substitution is very bad idea (by design). > Also, on transmit side this is must be irrelevant on received L2 > header (and this in many cases this is will be L2 unicast packet). For > other cases packet will be created on host and don't have any received > information. > Whilst I agree with your concerns about multipoint, I support the motivation behind Ryan's original change: optimize the common case. On the other hand, I'm suggesting a slight extension to it -- one which would probably require adoption across some L2-exposed subsystems, or anywhere which might reinterpret an M_BCAST from re-entrant encapsulation (i.e. I receive a UDP broadcast packet, but my VPN daemon then decides it needs to be NATted and forwarded somewhere else). Whilst I believe the scope for problems like this are limited (and perhaps to Netgraph permutations), I do believe they exist, and should be defensively coded for. And: If, the logic for this can be factored out into one additional bit, in a conditional branch (or small set of those) in terms of delta to the existing FreeBSD data plane path -- i.e. my suggestion; Then: we should be able to preserve correctness for multipoint configurations, without sacrificing performance. Or, a possible tie-breaker: ...we ensure that M_BCAST is cleared at all times before possible re-entry, and use a separate M_BCASTL3 bit. Let the ethernet protocols decide themselves if re-entered about M_BCAST based on DMAC. > On received side for host relaing on L2 information for accepting > packet as host targeting sound like security hole. > > In router case receiving broadcast packet in any way need additional > check for dst IP address (host part is all zero or all one? what about > handling this broadcast type (RFC talk about conroling variation of > this)? what about sysctl control of receiving routed broadcast > packets? what about handling 255.255.255.255?) I believe most of this is already special-cased in ip_fastfwd.c (which gnn@ of course has merged, as it's full of sensible FIB-like operators which most router forwarding planes adopt on *their* IP input paths up to the forwarding decision), assuming the Ethernet input path colours packets with the right flags. Although, no direct distinction between IPv4 directed or undirected broadcast is made, until that code (or a full rtalloc()) is hit. In the past, I have tried to "hack around" the issue on the output (send) side, by introducing IP_ONESBCAST from BSD/OS. The fundamental problem there is that the IPv4 socket APIs were never designed to deal with 'with link' as well as 'with destination' particularly well -- i.e. to direct traffic to a particular host, with correct L2 resolution, but over a specific choice of link (or even, class of link). So, for correct behaviour when handling packets like this, the XORP FEA and libfeaclient frameworks would attempt to fully-bind control sockets requiring broadcast input where possible (OLSR being one candidate, but there are also other protocols requiring them). > In any way, this is irrelevant to L2 broadcast MAC and present L2 > broadcast flags. On the contrary, I believe in teasing as much explanation about the Layer 2 Soup 'out there' and how in FreeBSD it is treated, as this lends much background to the original problem posed by Ryan's change, to those who may not be from a primarily networking-oriented background. From owner-svn-src-head@freebsd.org Sat Aug 20 23:31:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B3DDBC06EF; Sat, 20 Aug 2016 23:31:59 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA96F13A9; Sat, 20 Aug 2016 23:31:58 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 8EBF0205B0; Sat, 20 Aug 2016 19:31:57 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 19:31:57 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=iMpxhCqsV5FAagN/y0xbnI4kdqY=; b=Q0vVJe lERh0CZIOgtnXQt+rW0FEJZvitckzy7EYvdNz5iesv0B4Ki/ODKJ+nkrr/KQrGxD Faem6TPdcT0bYVOegJM7nNeC0PS1bkbDELEhV5mNhHRLAnxH3KrSmAFq5Eh/mxMr JqAJ8FingLMEu/m9EWxm05qDK3cRRRHCs5jTo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=iMpxhCqsV5FAagN /y0xbnI4kdqY=; b=t1gTXdx6lI3GjyG9j2ned8PktUVNYNGrKIR2wrz9h6WHpS5 FRRTeYQwKrxwww8E/WC8WykXaMsSQbFYQsctn3/iOd6STWkhIjYsUjK/8R8SbGvx JPSSBu7u6PVmRngHnOkoDT6eVauK/CEqrk1/9xhsYoPGdNfSGjT/dJNNORwQ= X-Sasl-enc: ydkpiFx6+H6ogYnBec9ba1o4yuR5jKcKCj4wprcXZfSw 1471735917 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 8903BCCDC7; Sat, 20 Aug 2016 19:31:56 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <6edd84f0-6bbc-d080-3763-fddb3df609fb@fastmail.net> Date: Sun, 21 Aug 2016 00:31:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 23:31:59 -0000 On 21/08/16 00:25, Bruce Simpson wrote: [Use a predicted branch in favour of Ethernet to optimize common case comments snipped] > ...we ensure that M_BCAST is cleared at all times before possible > re-entry, and use a separate M_BCASTL3 bit. Let the ethernet protocols > decide themselves if re-entered about M_BCAST based on DMAC. Better still, rename it to M_IPBCAST, because that is exactly what that flag would be. Treat it like M_PROMISC, hands off, use THAT test instead of M_BCAST in the code (but predictive branch the original in_broadcast() call), make sure M_BCAST is cleared before possible Netgraph handoff, but leave M_IPBCAST set. That way, anyone can tell IP set the M_BCAST bit - not Ethernet - just by XORing them together. I'd code this, but I don't have a -CURRENT box. :-( From owner-svn-src-head@freebsd.org Sat Aug 20 23:42:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 731C8BC09AC; Sat, 20 Aug 2016 23:42:34 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B4FB188C; Sat, 20 Aug 2016 23:42:33 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id B41812060F; Sat, 20 Aug 2016 19:42:32 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 19:42:32 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=WAl1E+q9SPAnri9ThpISU7pyAq0=; b=DNfhFr I4cbJgAofhUGEG2zytJZgwi7/EMH/FgM4yraV+UbHr4IFxhws1rwdHbs6/+0Ope9 gN+9csSFkyEQPNVVfHyovBvwiKkmbRYo2saMagOqNYm+lDJNj4w69mwm9JjOOIh4 iggXU6IOvkHXfYc5Ft7t8WA0JRp3/B6pzXKJk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=WAl1E+q9SPAnri9 ThpISU7pyAq0=; b=Hl0XYto+5ddXxL+ijx78+KiWnNHsrlK/8+uMPXEj2Pp06vU FdUr577/FWfQXwDRg5+1TEylnbOEIv+b8ckAlf6UpJc5Cjg4YicrXb7KxP7os9AP HMg+W/eOtO8PgbE+GJrHH+5p4J3TWFb5NozXtVV3cQrGfvviUp3Dd4irtIPQ= X-Sasl-enc: H4QZNNI+5FvuL2/TX9NrZ/f+aYP/9ePmyBcUZuOE0jx9 1471736552 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 9F9D5CCE6E; Sat, 20 Aug 2016 19:42:31 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <1ebf4e2c-5fa1-29bc-0dc9-7ee2d7e2dc59@fastmail.net> Date: Sun, 21 Aug 2016 00:42:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 23:42:34 -0000 On 21/08/16 00:25, Bruce Simpson wrote: > On 20/08/16 23:05, Slawa Olhovchenkov wrote: >> In router case receiving broadcast packet in any way need additional >> check for dst IP address (host part is all zero or all one? what about >> handling this broadcast type (RFC talk about conroling variation of >> this)? what about sysctl control of receiving routed broadcast >> packets? what about handling 255.255.255.255?) > > I believe most of this is already special-cased in ip_fastfwd.c (which > gnn@ of course has merged, as it's full of sensible FIB-like operators > which most router forwarding planes adopt on *their* IP input paths up > to the forwarding decision), assuming the Ethernet input path colours > packets with the right flags. Just for reference, many of these 'sensible FIB operators' in the former ip_fastfwd.c came from the experience of James Jun at Towardex Systems. I merged his patch on the job whilst staying in Berkeley, CA and working on XORP at ICSI. I was only too happy to do that on their ticket, as it covered a lot of little performance cases which the pure rtalloc() fallthrough made us wince about. From owner-svn-src-head@freebsd.org Sat Aug 20 23:48:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6798FBC0C9D; Sat, 20 Aug 2016 23:48:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.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 2B1711D62; Sat, 20 Aug 2016 23:48:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x232.google.com with SMTP id e63so59571752ith.1; Sat, 20 Aug 2016 16:48:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=vIqMmC71rb5PEl2dX6XbSmk98cirMrgn6avwsGPS1ns=; b=xRmKHq5fbHyl0Ab3iLY/s9tjEwfpJyAgPOh0L6DVuO9ZyyPytd4KIvFZT8Bv0t5jnI 9Zym1UW8Bq+5VLZI1+IrDyUh7eB7GsZoTvSXKRO6rHma8YR2ylmOH78q7YJp5JmNxYS6 F9LdlzBjnZ4qB9vbxQu7jOSfvalExUL9q8DyPnjaj3CDSsZNLJVl/vkBWzG1mdqxreCG l5CDyFfo2PKmpCq4ik70hMwSef1Rwfj+GXM1/Y7LrwOYvWjlclFYyxoQ0OSiMe/Oa/Iv p91QspmYvpSV083tvjXBmjbYCQIYhKuzusXBcZwxBU4E60u15pCz148q1fwajSLiYuJE k+ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=vIqMmC71rb5PEl2dX6XbSmk98cirMrgn6avwsGPS1ns=; b=PUW4YKQBjtNRN8gvDHWW9ogmRsLlhZevo/sbFt9rGtCWKCDXLHSEX7TXmO75WPZq6g bIJld3rkIeZQJHBtTMawT7iesV+RuNCDaTwhJ7ab/0mjEBcVAhQ8JlTyTRDrD3UVWRpD /Cum1BbzVfpWW7OV59qEs67toKWzkgaDb+I9vYxpnyDkBnXOg2Z/1yUV20CLeWqGMWWr 5z99H0Agcv6uPmZ/GvzYG/xDAPRUOEiAwJJx+/k+ryqpD9A2Bm+MPliEy7Bx72PK2fvX qKJKfUKY1ajwT/A+YLc13C4tN+9JjG3WgWvcyFdxhbXDbywiRPDKG+CIlZ/OJ+34rK2x vwLA== X-Gm-Message-State: AEkoouvjaD4jXZJ5Metr0VD88mfwQji28ggd1b+dQH/FgIDTxg6pnPKjAu9rtWy2tCVl9pOvbi30Waf9vA+0Qw== X-Received: by 10.36.150.70 with SMTP id z67mr12692987itd.80.1471736879570; Sat, 20 Aug 2016 16:47:59 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.141.129 with HTTP; Sat, 20 Aug 2016 16:47:58 -0700 (PDT) In-Reply-To: <1ebf4e2c-5fa1-29bc-0dc9-7ee2d7e2dc59@fastmail.net> References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> <1ebf4e2c-5fa1-29bc-0dc9-7ee2d7e2dc59@fastmail.net> From: Adrian Chadd Date: Sat, 20 Aug 2016 16:47:58 -0700 X-Google-Sender-Auth: B90BxaiDiEGvtDtLM8ivNQBo3Rg Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Bruce Simpson Cc: Slawa Olhovchenkov , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 23:48:00 -0000 [snip] Just for everyone else on the list, would you mind distilling the original versus now-from-ryan meaning of M_BCAST and M_MCAST ? And how they're supposed to be used? thanks, -adrian From owner-svn-src-head@freebsd.org Sat Aug 20 23:49:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BF9FBC0D3F; Sat, 20 Aug 2016 23:49:31 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A7C01EDF; Sat, 20 Aug 2016 23:49:30 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 819C5205B9; Sat, 20 Aug 2016 19:49:29 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 19:49:29 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=rNEMRENFJErC9f2QgECBldjwE2A=; b=alUOsR oOYvkQFZ3WKIZ9Zn/sg6BHH5Mr5n4dZQMSnC58R4mvSuG3BtIkPTDOGD89Pw3t1U 6cL+YhrBMjYkB3LXrfxhtvGzrM5HtcZtW7KRPUnshnTxzY+NXC8MWZ+xOHOCwzVZ 2WkdZZj3FZwW8rfkiqEE8gziIt0p09ddO2pM4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=rNEMRENFJErC9f2 QgECBldjwE2A=; b=kz7GSKsPrU9DovyPZIDeMiAQuyLzwRA6zZKcu8Ej+Pvu0hl MN8shf078UIdPegrPsutryNUJfklfbElEN74nfJdnkXzJrK/pGr+rv7BDqxZLOQh wZsate0TKO3NPYiKEZIk36GQAGmFjMktvSwltioQ6OINTiUwjNui1BR5UDDk= X-Sasl-enc: cQfRtxCGqyMIdqJmZDqtGZdegluw48hhtJiIc1qSv+9I 1471736969 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 5DC68CCDB8; Sat, 20 Aug 2016 19:49:28 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Adrian Chadd References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> <1ebf4e2c-5fa1-29bc-0dc9-7ee2d7e2dc59@fastmail.net> Cc: Slawa Olhovchenkov , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" From: Bruce Simpson Message-ID: <483c533b-cb83-5234-0e99-61bbdadc9fea@fastmail.net> Date: Sun, 21 Aug 2016 00:49:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: 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, 20 Aug 2016 23:49:31 -0000 On 21/08/16 00:47, Adrian Chadd wrote: > [snip] > > Just for everyone else on the list, would you mind distilling the > original versus now-from-ryan meaning of M_BCAST and M_MCAST ? And how > they're supposed to be used? (With my best Liam Neeson 'Dad' voice from Fallout 3) They stay as-is, but IP is allowed to slip the tag. But it has to slip another tag in there, to say it slipped the tag. The rest is M_PROTOFLAG style hand-off hygeine, along the mbuf pipeline.