From owner-svn-src-stable@freebsd.org Sun Sep 6 10:19:00 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB1AD3CD002; Sun, 6 Sep 2020 10:19:00 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BknSh4h2Xz3Srd; Sun, 6 Sep 2020 10:19:00 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FC2DCC61; Sun, 6 Sep 2020 10:19:00 +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 086AJ0b0083979; Sun, 6 Sep 2020 10:19:00 GMT (envelope-from zec@FreeBSD.org) Received: (from zec@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086AIxPd083971; Sun, 6 Sep 2020 10:18:59 GMT (envelope-from zec@FreeBSD.org) Message-Id: <202009061018.086AIxPd083971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zec set sender to zec@FreeBSD.org using -f From: Marko Zec Date: Sun, 6 Sep 2020 10:18:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365374 - in stable/12: share/man/man4 sys/conf sys/dev/sume sys/modules sys/modules/sume X-SVN-Group: stable-12 X-SVN-Commit-Author: zec X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/conf sys/dev/sume sys/modules sys/modules/sume X-SVN-Commit-Revision: 365374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2020 10:19:00 -0000 Author: zec Date: Sun Sep 6 10:18:59 2020 New Revision: 365374 URL: https://svnweb.freebsd.org/changeset/base/365374 Log: MFC r364973: Driver for 4x10Gb Ethernet reference NIC FPGA design for NetFPGA SUME development board. Submitted by: Denis Salopek Reviewed by: zec, bz (src); rgrimes, bcr (manpages) Sponsored by: Google Summer of Code 2020 Differential Revision: https://reviews.freebsd.org/D26074 Added: stable/12/share/man/man4/sume.4 - copied unchanged from r364973, head/share/man/man4/sume.4 stable/12/sys/dev/sume/ - copied from r364973, head/sys/dev/sume/ stable/12/sys/modules/sume/ - copied from r364973, head/sys/modules/sume/ Modified: stable/12/share/man/man4/Makefile stable/12/sys/conf/files.amd64 stable/12/sys/modules/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/Makefile ============================================================================== --- stable/12/share/man/man4/Makefile Sun Sep 6 09:08:06 2020 (r365373) +++ stable/12/share/man/man4/Makefile Sun Sep 6 10:18:59 2020 (r365374) @@ -532,6 +532,7 @@ MAN= aac.4 \ stf.4 \ stg.4 \ stge.4 \ + ${_sume.4} \ ${_superio.4} \ sym.4 \ syncache.4 \ @@ -881,12 +882,14 @@ _qlxgbe.4= qlxgbe.4 _qlnxe.4= qlnxe.4 _sfxge.4= sfxge.4 _smartpqi.4= smartpqi.4 +_sume.4= sume.4 MLINKS+=qlxge.4 if_qlxge.4 MLINKS+=qlxgb.4 if_qlxgb.4 MLINKS+=qlxgbe.4 if_qlxgbe.4 MLINKS+=qlnxe.4 if_qlnxe.4 MLINKS+=sfxge.4 if_sfxge.4 +MLINKS+=sume.4 if_sume.4 .if ${MK_BHYVE} != "no" _bhyve.4= bhyve.4 Copied: stable/12/share/man/man4/sume.4 (from r364973, head/share/man/man4/sume.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man4/sume.4 Sun Sep 6 10:18:59 2020 (r365374, copy of r364973, head/share/man/man4/sume.4) @@ -0,0 +1,98 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2020 Denis Salopek +.\" +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd August 30, 2020 +.Dt SUME 4 +.Os +.Sh NAME +.Nm sume +.Nd "NetFPGA SUME 4x10Gb Ethernet driver" +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines +in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device sume" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place +the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_sume_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for NetFPGA SUME Virtex-7 FPGA Development Board +with the reference NIC bitstream loaded onto it. +The HDL design for the reference NIC project uses the RIFFA based DMA +engine to communicate with the host machine over PCIe. +Every packet is transmitted to / from the board via a single DMA +transaction, taking up to two or three interrupts per one transaction +which yields low performance. +.Pp +There is no support for Jumbo frames as the hardware is capable of +dealing only with frames with maximum size of 1514 bytes. +The hardware does not support multicast filtering, provides no checksums, +and offers no other offloading. +.Sh SEE ALSO +.Xr arp 4 , +.Xr netgraph 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh AUTHORS +The Linux +.Nm +driver was originally written by +.An -nosplit +.An Bjoern A. Zeeb . +The +.Fx version and this manual page were written by +.An Denis Salopek +as a GSoC project. +More information about the project can be found here: +.Pa https://wiki.freebsd.org/SummerOfCode2020Projects/NetFPGA_SUME_Driver +.Sh BUGS +The reference NIC hardware design provides no mechanism for quiescing +inbound traffic from interfaces configured as DOWN. +All packets from administratively disabled interfaces are transferred to +main memory, leaving the driver with the task of dropping such packets, +thus consuming PCI bandwidth, interrupts and CPU cycles in vain. +.Pp +Pre-built FPGA bitstream from the NetFPGA project may not work correctly. +At higher RX packet rates, the newly incoming packets can overwrite the +ones in an internal FIFO so the packets would arrive in main memory +corrupted, until a physical reset of the board. +.Pp +Occasionally, the driver can get stuck in a non-IDLE TX state due to +a missed interrupt. +The driver includes a watchdog function which monitors for such a +condition and resets the board automatically. +For more details, visit the NetFPGA SUME project site. Modified: stable/12/sys/conf/files.amd64 ============================================================================== --- stable/12/sys/conf/files.amd64 Sun Sep 6 09:08:06 2020 (r365373) +++ stable/12/sys/conf/files.amd64 Sun Sep 6 10:18:59 2020 (r365374) @@ -493,6 +493,7 @@ dev/smartpqi/smartpqi_response.c optional smartpqi dev/smartpqi/smartpqi_sis.c optional smartpqi dev/smartpqi/smartpqi_tag.c optional smartpqi dev/speaker/spkr.c optional speaker +dev/sume/if_sume.c optional sume dev/superio/superio.c optional superio isa dev/syscons/apm/apm_saver.c optional apm_saver apm dev/syscons/scterm-teken.c optional sc Modified: stable/12/sys/modules/Makefile ============================================================================== --- stable/12/sys/modules/Makefile Sun Sep 6 09:08:06 2020 (r365373) +++ stable/12/sys/modules/Makefile Sun Sep 6 10:18:59 2020 (r365374) @@ -372,6 +372,7 @@ SUBDIR= \ ste \ ${_stg} \ stge \ + ${_sume} \ ${_superio} \ ${_sym} \ ${_syscons} \ @@ -752,6 +753,7 @@ _nvdimm= nvdimm _pms= pms _qlxge= qlxge _qlxgb= qlxgb +_sume= sume .if ${MK_SOURCELESS_UCODE} != "no" _qlxgbe= qlxgbe _qlnx= qlnx From owner-svn-src-stable@freebsd.org Sun Sep 6 10:23:14 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9647C3CD0A5; Sun, 6 Sep 2020 10:23:14 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BknYZ3W2sz3TGc; Sun, 6 Sep 2020 10:23:14 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43FFBD3A5; Sun, 6 Sep 2020 10:23:14 +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 086ANEpf090127; Sun, 6 Sep 2020 10:23:14 GMT (envelope-from zec@FreeBSD.org) Received: (from zec@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086ANDIU090124; Sun, 6 Sep 2020 10:23:13 GMT (envelope-from zec@FreeBSD.org) Message-Id: <202009061023.086ANDIU090124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zec set sender to zec@FreeBSD.org using -f From: Marko Zec Date: Sun, 6 Sep 2020 10:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365375 - in stable/11: share/man/man4 sys/conf sys/dev/sume sys/modules sys/modules/sume X-SVN-Group: stable-11 X-SVN-Commit-Author: zec X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/conf sys/dev/sume sys/modules sys/modules/sume X-SVN-Commit-Revision: 365375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2020 10:23:14 -0000 Author: zec Date: Sun Sep 6 10:23:13 2020 New Revision: 365375 URL: https://svnweb.freebsd.org/changeset/base/365375 Log: MFC r364973: Driver for 4x10Gb Ethernet reference NIC FPGA design for NetFPGA SUME development board. Submitted by: Denis Salopek Reviewed by: zec, bz (src); rgrimes, bcr (manpages) Sponsored by: Google Summer of Code 2020 Differential Revision: https://reviews.freebsd.org/D26074 Added: stable/11/share/man/man4/sume.4 - copied unchanged from r364973, head/share/man/man4/sume.4 stable/11/sys/dev/sume/ - copied from r364973, head/sys/dev/sume/ stable/11/sys/modules/sume/ - copied from r364973, head/sys/modules/sume/ Modified: stable/11/share/man/man4/Makefile stable/11/sys/conf/files.amd64 stable/11/sys/modules/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Sun Sep 6 10:18:59 2020 (r365374) +++ stable/11/share/man/man4/Makefile Sun Sep 6 10:23:13 2020 (r365375) @@ -533,6 +533,7 @@ MAN= aac.4 \ stf.4 \ stg.4 \ stge.4 \ + ${_sume.4} \ sym.4 \ syncache.4 \ syncer.4 \ @@ -884,12 +885,14 @@ _qlxgbe.4= qlxgbe.4 _qlnxe.4= qlnxe.4 _sfxge.4= sfxge.4 _smartpqi.4= smartpqi.4 +_sume.4= sume.4 MLINKS+=qlxge.4 if_qlxge.4 MLINKS+=qlxgb.4 if_qlxgb.4 MLINKS+=qlxgbe.4 if_qlxgbe.4 MLINKS+=qlnxe.4 if_qlnxe.4 MLINKS+=sfxge.4 if_sfxge.4 +MLINKS+=sume.4 if_sume.4 .if ${MK_BHYVE} != "no" _bhyve.4= bhyve.4 Copied: stable/11/share/man/man4/sume.4 (from r364973, head/share/man/man4/sume.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/sume.4 Sun Sep 6 10:23:13 2020 (r365375, copy of r364973, head/share/man/man4/sume.4) @@ -0,0 +1,98 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2020 Denis Salopek +.\" +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd August 30, 2020 +.Dt SUME 4 +.Os +.Sh NAME +.Nm sume +.Nd "NetFPGA SUME 4x10Gb Ethernet driver" +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines +in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device sume" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place +the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_sume_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for NetFPGA SUME Virtex-7 FPGA Development Board +with the reference NIC bitstream loaded onto it. +The HDL design for the reference NIC project uses the RIFFA based DMA +engine to communicate with the host machine over PCIe. +Every packet is transmitted to / from the board via a single DMA +transaction, taking up to two or three interrupts per one transaction +which yields low performance. +.Pp +There is no support for Jumbo frames as the hardware is capable of +dealing only with frames with maximum size of 1514 bytes. +The hardware does not support multicast filtering, provides no checksums, +and offers no other offloading. +.Sh SEE ALSO +.Xr arp 4 , +.Xr netgraph 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh AUTHORS +The Linux +.Nm +driver was originally written by +.An -nosplit +.An Bjoern A. Zeeb . +The +.Fx version and this manual page were written by +.An Denis Salopek +as a GSoC project. +More information about the project can be found here: +.Pa https://wiki.freebsd.org/SummerOfCode2020Projects/NetFPGA_SUME_Driver +.Sh BUGS +The reference NIC hardware design provides no mechanism for quiescing +inbound traffic from interfaces configured as DOWN. +All packets from administratively disabled interfaces are transferred to +main memory, leaving the driver with the task of dropping such packets, +thus consuming PCI bandwidth, interrupts and CPU cycles in vain. +.Pp +Pre-built FPGA bitstream from the NetFPGA project may not work correctly. +At higher RX packet rates, the newly incoming packets can overwrite the +ones in an internal FIFO so the packets would arrive in main memory +corrupted, until a physical reset of the board. +.Pp +Occasionally, the driver can get stuck in a non-IDLE TX state due to +a missed interrupt. +The driver includes a watchdog function which monitors for such a +condition and resets the board automatically. +For more details, visit the NetFPGA SUME project site. Modified: stable/11/sys/conf/files.amd64 ============================================================================== --- stable/11/sys/conf/files.amd64 Sun Sep 6 10:18:59 2020 (r365374) +++ stable/11/sys/conf/files.amd64 Sun Sep 6 10:23:13 2020 (r365375) @@ -467,6 +467,7 @@ dev/smartpqi/smartpqi_response.c optional smartpqi dev/smartpqi/smartpqi_sis.c optional smartpqi dev/smartpqi/smartpqi_tag.c optional smartpqi dev/speaker/spkr.c optional speaker +dev/sume/if_sume.c optional sume dev/syscons/apm/apm_saver.c optional apm_saver apm dev/syscons/scterm-teken.c optional sc dev/syscons/scvesactl.c optional sc vga vesa Modified: stable/11/sys/modules/Makefile ============================================================================== --- stable/11/sys/modules/Makefile Sun Sep 6 10:18:59 2020 (r365374) +++ stable/11/sys/modules/Makefile Sun Sep 6 10:23:13 2020 (r365375) @@ -374,6 +374,7 @@ SUBDIR= \ ${_stg} \ stge \ ${_streams} \ + ${_sume} \ ${_svr4} \ ${_sym} \ ${_syscons} \ @@ -735,6 +736,7 @@ _ntb= ntb _pms= pms _qlxge= qlxge _qlxgb= qlxgb +_sume= sume .if ${MK_SOURCELESS_UCODE} != "no" _qlxgbe= qlxgbe _qlnx= qlnx From owner-svn-src-stable@freebsd.org Sun Sep 6 11:23:59 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74DB93CE1A7; Sun, 6 Sep 2020 11:23:59 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bkpvg2V1Gz3WTJ; Sun, 6 Sep 2020 11:23:59 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38FE5D97D; Sun, 6 Sep 2020 11:23:59 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086BNx8p026879; Sun, 6 Sep 2020 11:23:59 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086BNx6T026878; Sun, 6 Sep 2020 11:23:59 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <202009061123.086BNx6T026878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Sun, 6 Sep 2020 11:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365376 - stable/12/sys/dev/drm X-SVN-Group: stable-12 X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: stable/12/sys/dev/drm X-SVN-Commit-Revision: 365376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2020 11:23:59 -0000 Author: zeising (doc,ports committer) Date: Sun Sep 6 11:23:58 2020 New Revision: 365376 URL: https://svnweb.freebsd.org/changeset/base/365376 Log: drm: Update deprecation message Update the deprecation message in the drm1 (aka legacy drm or drm-legacy) drivers to not point towards the drm-legacy-kmod port, as that is being deprecated. This is a direct commit to stable/12 since the drm1 code has been removed from 13 already. Reviewed by: imp Approved by: imp Differential Revision: https://reviews.freebsd.org/D26175 Modified: stable/12/sys/dev/drm/drm.h Modified: stable/12/sys/dev/drm/drm.h ============================================================================== --- stable/12/sys/dev/drm/drm.h Sun Sep 6 10:23:13 2020 (r365375) +++ stable/12/sys/dev/drm/drm.h Sun Sep 6 11:23:58 2020 (r365376) @@ -1145,12 +1145,10 @@ typedef struct drm_mm_init_arg drm_mm_init_arg_t; typedef enum drm_bo_type drm_bo_type_t; #endif -#define DRM_PORT "graphics/drm-legacy-kmod" - #define DRM_OBSOLETE(dev) \ do { \ device_printf(dev, "=======================================================\n"); \ - device_printf(dev, "This code is obsolete abandonware. Install the " DRM_PORT " pkg\n"); \ + device_printf(dev, "This code is deprecated.\n"); \ device_printf(dev, "=======================================================\n"); \ gone_in_dev(dev, 13, "drm drivers"); \ } while (0) From owner-svn-src-stable@freebsd.org Sun Sep 6 11:29:07 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 954F33CE148; Sun, 6 Sep 2020 11:29:07 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bkq1b3Q86z3WZm; Sun, 6 Sep 2020 11:29:07 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5828FDF04; Sun, 6 Sep 2020 11:29:07 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086BT7x3027154; Sun, 6 Sep 2020 11:29:07 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086BT6jh027152; Sun, 6 Sep 2020 11:29:06 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <202009061129.086BT6jh027152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Sun, 6 Sep 2020 11:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365377 - stable/12/sys/dev/drm2 X-SVN-Group: stable-12 X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: stable/12/sys/dev/drm2 X-SVN-Commit-Revision: 365377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2020 11:29:07 -0000 Author: zeising (doc,ports committer) Date: Sun Sep 6 11:29:06 2020 New Revision: 365377 URL: https://svnweb.freebsd.org/changeset/base/365377 Log: MFC: r364737, r365264 and r365287 Together, these three revisions improve the drm2 (aka legacy drm or drm-legacy) drivers to point towards graphics/drm-kmod where relevant, and to remove references to graphics/drm-legacy-kmd as that is being deprecated. Since part of the drm2 drivers are still used on arm, arm is currently excluded from the deprecation message. Approved by: imp, manu (implicit, MFC) Modified: stable/12/sys/dev/drm2/drm_os_freebsd.c stable/12/sys/dev/drm2/drm_os_freebsd.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/drm2/drm_os_freebsd.c ============================================================================== --- stable/12/sys/dev/drm2/drm_os_freebsd.c Sun Sep 6 11:23:58 2020 (r365376) +++ stable/12/sys/dev/drm2/drm_os_freebsd.c Sun Sep 6 11:29:06 2020 (r365377) @@ -126,7 +126,9 @@ drm_probe_helper(device_t kdev, const drm_pci_id_list_ device_get_nameunit(kdev), id_entry->name); device_set_desc(kdev, id_entry->name); } +#if !defined(__arm__) DRM_OBSOLETE(kdev); +#endif return (-BUS_PROBE_GENERIC); } Modified: stable/12/sys/dev/drm2/drm_os_freebsd.h ============================================================================== --- stable/12/sys/dev/drm2/drm_os_freebsd.h Sun Sep 6 11:23:58 2020 (r365376) +++ stable/12/sys/dev/drm2/drm_os_freebsd.h Sun Sep 6 11:29:06 2020 (r365377) @@ -154,19 +154,21 @@ typedef void irqreturn_t; *(volatile u_int64_t *)(((vm_offset_t)(map)->handle) + \ (vm_offset_t)(offset)) = htole64(val) -#ifdef amd64 -#define DRM_PORT "graphics/drm-kmod" +#if !defined(__arm__) +#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) +#define DRM_MSG "This code is deprecated. Install the graphics/drm-kmod pkg\n" #else -#define DRM_PORT "graphics/drm-legacy-kmod" +#define DRM_MSG "This code is deprecated." #endif #define DRM_OBSOLETE(dev) \ do { \ device_printf(dev, "=======================================================\n"); \ - device_printf(dev, "This code is obsolete abandonware. Install the " DRM_PORT " pkg\n"); \ + device_printf(dev, DRM_MSG); \ device_printf(dev, "=======================================================\n"); \ gone_in_dev(dev, 13, "drm2 drivers"); \ } while (0) +#endif /* __arm__ */ /* DRM_READMEMORYBARRIER() prevents reordering of reads. * DRM_WRITEMEMORYBARRIER() prevents reordering of writes. From owner-svn-src-stable@freebsd.org Sun Sep 6 14:13:52 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CE313D2482; Sun, 6 Sep 2020 14:13:52 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bktgh40C9z3fWq; Sun, 6 Sep 2020 14:13:52 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 545EDFAB9; Sun, 6 Sep 2020 14:13:52 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086EDqdI030869; Sun, 6 Sep 2020 14:13:52 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086EDqQ4030866; Sun, 6 Sep 2020 14:13:52 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202009061413.086EDqQ4030866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sun, 6 Sep 2020 14:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365379 - in stable/12: share/man/man4 sys/contrib/ena-com sys/contrib/ena-com/ena_defs sys/dev/ena sys/modules/ena X-SVN-Group: stable-12 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/contrib/ena-com sys/contrib/ena-com/ena_defs sys/dev/ena sys/modules/ena X-SVN-Commit-Revision: 365379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2020 14:13:52 -0000 Author: mw Date: Sun Sep 6 14:13:51 2020 New Revision: 365379 URL: https://svnweb.freebsd.org/changeset/base/365379 Log: MFC: Merge ENA v2.0.0 driver r348416 Update ENA version to v2.0.0 r348414 Fix ENA manual issues r348413 Improve ENA reset handling r348412 Fix NULL pointer dereference in ena_up() r348411 Unify new line characters in the ENA driver r348410 Fix Tx offloads for fragmented pkt headers in ENA r348409 Split ENA reset routine into restore and destroy stages r348408 Use bitfield for storing global ENA device states r348407 Fix error handling when ENA reset fails r348406 Fill bdf field of the host_info structure in ENA r348405 Add additional doorbells on ENA Tx path r348404 Limit maximum size of Rx refill threshold in ENA r348403 Add support for the LLQv2 and WC in ENA r348402 Lock optimization in ENA r348401 Add tuneable drbr ring size and hw queues depth for ENA r348400 Fix error in validate_tx_req_id() in ENA r348399 Change attach order to prevent crash upon failure in ENA r348398 Change order of ifp release on ENA detach r348397 Check for number of MSI-x upon partial allocation in ENA r348396 Set error value when allocation of IO irq fails in ENA r348395 Set vaddr and paddr as NULL when DMA alloc fails in ENA r348394 Fix DMA synchronization in the ENA driver Tx and Rx paths r348393 Check for missing MSI-x and Tx completions in ENA r348392 Fill number of CPUs field on ENA host_info structure r348391 Print ENA Tx error conditionally r348390 Trigger reset in ENA if there are too many Rx descriptors r348389 Remove RSS support in ENA r348388 Add notification AENQ handler for ENA r348387 Print information when ENA admin error occurs r348386 Do not specify active media type in ENA r348385 Adjust ENA driver to the new ena-com Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: stable/12/share/man/man4/ena.4 stable/12/sys/contrib/ena-com/ena_com.c stable/12/sys/contrib/ena-com/ena_com.h stable/12/sys/contrib/ena-com/ena_defs/ena_admin_defs.h stable/12/sys/contrib/ena-com/ena_defs/ena_common_defs.h stable/12/sys/contrib/ena-com/ena_defs/ena_eth_io_defs.h stable/12/sys/contrib/ena-com/ena_defs/ena_gen_info.h stable/12/sys/contrib/ena-com/ena_defs/ena_regs_defs.h stable/12/sys/contrib/ena-com/ena_eth_com.c stable/12/sys/contrib/ena-com/ena_eth_com.h stable/12/sys/contrib/ena-com/ena_plat.h stable/12/sys/dev/ena/ena.c stable/12/sys/dev/ena/ena.h stable/12/sys/dev/ena/ena_sysctl.c stable/12/sys/dev/ena/ena_sysctl.h stable/12/sys/modules/ena/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/ena.4 ============================================================================== --- stable/12/share/man/man4/ena.4 Sun Sep 6 14:04:02 2020 (r365378) +++ stable/12/share/man/man4/ena.4 Sun Sep 6 14:13:51 2020 (r365379) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 04, 2017 +.Dd August 16, 2017 .Dt ENA 4 .Os .Sh NAME @@ -35,7 +35,7 @@ .Nd "FreeBSD kernel driver for Elastic Network Adapter (ENA) family" .Sh SYNOPSIS To compile this driver into the kernel, -place the following line in your +place the following line in the kernel configuration file: .Bd -ragged -offset indent .Cd "device ena" @@ -59,8 +59,9 @@ The driver supports a range of ENA devices, is link-sp (i.e., the same driver is used for 10GbE, 25GbE, 40GbE, etc.), and has a negotiated and extendable feature set. .Pp -Some ENA devices support SR-IOV. This driver is used for both the -SR-IOV Physical Function (PF) and Virtual Function (VF) devices. +Some ENA devices support SR-IOV. +This driver is used for both the SR-IOV Physical Function (PF) and Virtual +Function (VF) devices. .Pp The ENA devices enable high speed and low overhead network traffic processing by providing multiple Tx/Rx queue pairs (the maximum number @@ -82,8 +83,8 @@ to recover in a manner transparent to the application, debug logs. .Pp Some of the ENA devices support a working mode called Low-latency -Queue (LLQ), which saves several more microseconds. This feature will -be implemented for driver in future releases. +Queue (LLQ), which saves several more microseconds. +This feature will be implemented for driver in future releases. .Sh HARDWARE Supported PCI vendor ID/device IDs: .Pp @@ -105,19 +106,23 @@ Supported PCI vendor ID/device IDs: Error occurred during initialization of the mmio register read request. .It ena%d: Can not reset device .Pp -Device could not be reset; device may not be responding or is already -during reset. +Device could not be reset. +.br +Device may not be responding or is already during reset. .It ena%d: device version is too low .Pp -Version of the controller is too low and it is not supported by the driver. +Version of the controller is too old and it is not supported by the driver. .It ena%d: Invalid dma width value %d .Pp -The controller is able to request dma transcation width. Device stopped -responding or it demanded invalid value. +The controller is able to request dma transaction width. +.br +Device stopped responding or it demanded invalid value. .It ena%d: Can not initialize ena admin queue with device .Pp -Initialization of the Admin Queue failed; device may not be responding or there -was a problem with initialization of the resources. +Initialization of the Admin Queue failed. +.br +Device may not be responding or there was a problem with initialization of +the resources. .It ena%d: Cannot get attribute for ena device rc: %d .Pp Failed to get attributes of the device from the controller. @@ -141,11 +146,14 @@ Errors occurred when trying to configure AENQ groups. .It ena%d: could not allocate irq vector: %d .It ena%d: Unable to allocate bus resource: registers .Pp -Resource allocation failed when initializing the device; driver will not -be attached. +Resource allocation failed when initializing the device. +.br +Driver will not be attached. .It ena%d: ENA device init failed (err: %d) .Pp -Device initialization failed; driver will not be attached. +Device initialization failed. +.br +Driver will not be attached. .It ena%d: could not activate irq vector: %d .Pp Error occurred when trying to activate interrupt vectors for Admin Queue. @@ -157,13 +165,16 @@ Error occurred when trying to register Admin Queue int Error occurred during configuration of the Admin Queue interrupts. .It ena%d: Enable MSI-X failed .Pp -Configuration of the MSI-X for Admin Queue failed; there could be lack -of resources or interrupts could not have been configured; driver will -not be attached. +Configuration of the MSI-X for Admin Queue failed. +.br +There could be lack of resources or interrupts could not have been configured. +.br +Driver will not be attached. .It ena%d: VLAN is in use, detach first .Pp -VLANs are being used when trying to detach the driver; VLANs should be detached -first and then detach routine should be called again. +VLANs are being used when trying to detach the driver. +.br +VLANs must be detached first and then detach routine have to be called again. .It ena%d: Unmapped RX DMA tag associations .It ena%d: Unmapped TX DMA tag associations .Pp @@ -175,8 +186,9 @@ Error occurred when trying to destroy RX/TX DMA tag. .It ena%d: Cannot fill hash control .It ena%d: WARNING: RSS was not properly initialized, it will affect bandwidth .Pp -Error occurred during initialization of one of RSS resources; device is still -going to work but it will affect performance because all RX packets will be +Error occurred during initialization of one of RSS resources. +.br +The device will work with reduced performance because all RX packets will be passed to queue 0 and there will be no hash information. .It ena%d: failed to tear down irq: %d .It ena%d: dev has no parent while releasing res for irq: %d @@ -196,16 +208,20 @@ Requested MTU value is not supported and will not be s Device stopped responding and will be reset. .It ena%d: Found a Tx that wasn't completed on time, qid %d, index %d. .Pp -Packet was pushed to the NIC but not sent within given time limit; it may -be caused by hang of the IO queue. +Packet was pushed to the NIC but not sent within given time limit. +.br +It may be caused by hang of the IO queue. .It ena%d: The number of lost tx completion is aboce the threshold (%d > %d). Reset the device .Pp -If too many Tx wasn't completed on time the device is going to be reset; it may -be caused by hanged queue or device. +If too many Tx wasn't completed on time the device is going to be reset. +.br +It may be caused by hanged queue or device. .It ena%d: trigger reset is on .Pp -Device will be reset; reset is triggered either by watchdog or if too many TX -packets were not completed on time. +Device will be reset. +.br +Reset is triggered either by watchdog or if too many TX packets were not +completed on time. .It ena%d: invalid value recvd .Pp Link status received from the device in the AENQ handler is invalid. @@ -220,7 +236,9 @@ Link status received from the device in the AENQ handl .It ena%d: could not allocate irq vector: %d .It ena%d: failed to register interrupt handler for irq %ju: %d .Pp -IO resources initialization failed. Interface will not be brought up. +IO resources initialization failed. +.br +Interface will not be brought up. .It ena%d: LRO[%d] Initialization failed! .Pp Initialization of the LRO for the RX ring failed. @@ -228,20 +246,26 @@ Initialization of the LRO for the RX ring failed. .It ena%d: failed to add buffer for rx queue %d .It ena%d: refilled rx queue %d with %d pages only .Pp -Allocation of resources used on RX path failed; if happened during -initialization of the IO queue, the interface will not be brought up. +Allocation of resources used on RX path failed. +.br +If happened during initialization of the IO queue, the interface will not be +brought up. .It ena%d: ioctl promisc/allmulti .Pp -IOCTL request for the device to work in promiscuous/allmulti mode; see +IOCTL request for the device to work in promiscuous/allmulti mode. +.br +See .Xr ifconfig 8 for more details. .It ena%d: too many fragments. Last fragment: %d! .Pp Packet with unsupported number of segments was queued for sending to the -device; packet will be dropped. +device. +.br +Packet will be dropped. .Sh SUPPORT -If an issue is identified with the released source code with a supported adapter -email the specific information related to the issue to +If an issue is identified with the released source code with a supported +adapter, please email the specific information related to the issue to .Aq Mt mk@semihalf.com and .Aq Mt mw@semihalf.com . Modified: stable/12/sys/contrib/ena-com/ena_com.c ============================================================================== --- stable/12/sys/contrib/ena-com/ena_com.c Sun Sep 6 14:04:02 2020 (r365378) +++ stable/12/sys/contrib/ena-com/ena_com.c Sun Sep 6 14:13:51 2020 (r365379) @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright (c) 2015-2017 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,9 +32,6 @@ */ #include "ena_com.h" -#ifdef ENA_INTERNAL -#include "ena_gen_info.h" -#endif /*****************************************************************************/ /*****************************************************************************/ @@ -52,9 +49,6 @@ #define ENA_EXTENDED_STAT_GET_QUEUE(_funct_queue) (_funct_queue >> 16) #endif /* ENA_EXTENDED_STATS */ -#define MIN_ENA_VER (((ENA_COMMON_SPEC_VERSION_MAJOR) << \ - ENA_REGS_VERSION_MAJOR_VERSION_SHIFT) \ - | (ENA_COMMON_SPEC_VERSION_MINOR)) #define ENA_CTRL_MAJOR 0 #define ENA_CTRL_MINOR 0 @@ -76,6 +70,8 @@ #define ENA_REGS_ADMIN_INTR_MASK 1 +#define ENA_POLL_MS 5 + /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ @@ -112,8 +108,8 @@ static inline int ena_com_mem_addr_set(struct ena_com_ return ENA_COM_INVAL; } - ena_addr->mem_addr_low = (u32)addr; - ena_addr->mem_addr_high = (u16)((u64)addr >> 32); + ena_addr->mem_addr_low = lower_32_bits(addr); + ena_addr->mem_addr_high = (u16)upper_32_bits(addr); return 0; } @@ -127,7 +123,7 @@ static int ena_com_admin_init_sq(struct ena_com_admin_ sq->mem_handle); if (!sq->entries) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -149,7 +145,7 @@ static int ena_com_admin_init_cq(struct ena_com_admin_ cq->mem_handle); if (!cq->entries) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -174,7 +170,7 @@ static int ena_com_admin_init_aenq(struct ena_com_dev aenq->mem_handle); if (!aenq->entries) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -249,7 +245,7 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd tail_masked = admin_queue->sq.tail & queue_size_mask; /* In case of queue FULL */ - cnt = ATOMIC32_READ(&admin_queue->outstanding_cmds); + cnt = (u16)ATOMIC32_READ(&admin_queue->outstanding_cmds); if (cnt >= admin_queue->q_depth) { ena_trc_dbg("admin queue is full.\n"); admin_queue->stats.out_of_space++; @@ -301,7 +297,7 @@ static inline int ena_com_init_comp_ctxt(struct ena_co queue->comp_ctx = ENA_MEM_ALLOC(queue->q_dmadev, size); if (unlikely(!queue->comp_ctx)) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -320,7 +316,7 @@ static struct ena_comp_ctx *ena_com_submit_admin_cmd(s struct ena_admin_acq_entry *comp, size_t comp_size_in_bytes) { - unsigned long flags; + unsigned long flags = 0; struct ena_comp_ctx *comp_ctx; ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); @@ -332,7 +328,7 @@ static struct ena_comp_ctx *ena_com_submit_admin_cmd(s cmd_size_in_bytes, comp, comp_size_in_bytes); - if (unlikely(IS_ERR(comp_ctx))) + if (IS_ERR(comp_ctx)) admin_queue->running_state = false; ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); @@ -348,6 +344,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ memset(&io_sq->desc_addr, 0x0, sizeof(io_sq->desc_addr)); + io_sq->dma_addr_bits = (u8)ena_dev->dma_addr_bits; io_sq->desc_entry_size = (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) ? sizeof(struct ena_eth_io_tx_desc) : @@ -373,18 +370,21 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ } if (!io_sq->desc_addr.virt_addr) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } } if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { /* Allocate bounce buffers */ - io_sq->bounce_buf_ctrl.buffer_size = ena_dev->llq_info.desc_list_entry_size; - io_sq->bounce_buf_ctrl.buffers_num = ENA_COM_BOUNCE_BUFFER_CNTRL_CNT; + io_sq->bounce_buf_ctrl.buffer_size = + ena_dev->llq_info.desc_list_entry_size; + io_sq->bounce_buf_ctrl.buffers_num = + ENA_COM_BOUNCE_BUFFER_CNTRL_CNT; io_sq->bounce_buf_ctrl.next_to_use = 0; - size = io_sq->bounce_buf_ctrl.buffer_size * io_sq->bounce_buf_ctrl.buffers_num; + size = io_sq->bounce_buf_ctrl.buffer_size * + io_sq->bounce_buf_ctrl.buffers_num; ENA_MEM_ALLOC_NODE(ena_dev->dmadev, size, @@ -395,11 +395,12 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ io_sq->bounce_buf_ctrl.base_buffer = ENA_MEM_ALLOC(ena_dev->dmadev, size); if (!io_sq->bounce_buf_ctrl.base_buffer) { - ena_trc_err("bounce buffer memory allocation failed"); + ena_trc_err("bounce buffer memory allocation failed\n"); return ENA_COM_NO_MEM; } - memcpy(&io_sq->llq_info, &ena_dev->llq_info, sizeof(io_sq->llq_info)); + memcpy(&io_sq->llq_info, &ena_dev->llq_info, + sizeof(io_sq->llq_info)); /* Initiate the first bounce buffer */ io_sq->llq_buf_ctrl.curr_bounce_buf = @@ -408,6 +409,10 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ 0x0, io_sq->llq_info.desc_list_entry_size); io_sq->llq_buf_ctrl.descs_left_in_line = io_sq->llq_info.descs_num_before_header; + + if (io_sq->llq_info.max_entries_in_tx_burst > 0) + io_sq->entries_in_tx_burst_left = + io_sq->llq_info.max_entries_in_tx_burst; } io_sq->tail = 0; @@ -451,7 +456,7 @@ static int ena_com_init_io_cq(struct ena_com_dev *ena_ } if (!io_cq->cdesc_addr.virt_addr) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -500,12 +505,12 @@ static void ena_com_handle_admin_completion(struct ena cqe = &admin_queue->cq.entries[head_masked]; /* Go over all the completions */ - while ((cqe->acq_common_descriptor.flags & + while ((READ_ONCE8(cqe->acq_common_descriptor.flags) & ENA_ADMIN_ACQ_COMMON_DESC_PHASE_MASK) == phase) { /* Do not read the rest of the completion entry before the * phase bit was validated */ - rmb(); + dma_rmb(); ena_com_handle_single_admin_completion(admin_queue, cqe); head_masked++; @@ -552,7 +557,8 @@ static int ena_com_comp_status_to_errno(u8 comp_status static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_ctx, struct ena_com_admin_queue *admin_queue) { - unsigned long flags, timeout; + unsigned long flags = 0; + unsigned long timeout; int ret; timeout = ENA_GET_SYSTEM_TIMEOUT(admin_queue->completion_timeout); @@ -577,7 +583,7 @@ static int ena_com_wait_and_process_admin_cq_polling(s goto err; } - ENA_MSLEEP(100); + ENA_MSLEEP(ENA_POLL_MS); } if (unlikely(comp_ctx->status == ENA_CMD_ABORTED)) { @@ -598,42 +604,113 @@ err: return ret; } +/** + * Set the LLQ configurations of the firmware + * + * The driver provides only the enabled feature values to the device, + * which in turn, checks if they are supported. + */ +static int ena_com_set_llq(struct ena_com_dev *ena_dev) +{ + struct ena_com_admin_queue *admin_queue; + struct ena_admin_set_feat_cmd cmd; + struct ena_admin_set_feat_resp resp; + struct ena_com_llq_info *llq_info = &ena_dev->llq_info; + int ret; + + memset(&cmd, 0x0, sizeof(cmd)); + admin_queue = &ena_dev->admin_queue; + + cmd.aq_common_descriptor.opcode = ENA_ADMIN_SET_FEATURE; + cmd.feat_common.feature_id = ENA_ADMIN_LLQ; + + cmd.u.llq.header_location_ctrl_enabled = llq_info->header_location_ctrl; + cmd.u.llq.entry_size_ctrl_enabled = llq_info->desc_list_entry_size_ctrl; + cmd.u.llq.desc_num_before_header_enabled = llq_info->descs_num_before_header; + cmd.u.llq.descriptors_stride_ctrl_enabled = llq_info->desc_stride_ctrl; + + ret = ena_com_execute_admin_command(admin_queue, + (struct ena_admin_aq_entry *)&cmd, + sizeof(cmd), + (struct ena_admin_acq_entry *)&resp, + sizeof(resp)); + + if (unlikely(ret)) + ena_trc_err("Failed to set LLQ configurations: %d\n", ret); + + return ret; +} + static int ena_com_config_llq_info(struct ena_com_dev *ena_dev, - struct ena_admin_feature_llq_desc *llq_desc) + struct ena_admin_feature_llq_desc *llq_features, + struct ena_llq_configurations *llq_default_cfg) { struct ena_com_llq_info *llq_info = &ena_dev->llq_info; + u16 supported_feat; + int rc; memset(llq_info, 0, sizeof(*llq_info)); - switch (llq_desc->header_location_ctrl) { - case ENA_ADMIN_INLINE_HEADER: - llq_info->inline_header = true; - break; - case ENA_ADMIN_HEADER_RING: - llq_info->inline_header = false; - break; - default: - ena_trc_err("Invalid header location control\n"); + supported_feat = llq_features->header_location_ctrl_supported; + + if (likely(supported_feat & llq_default_cfg->llq_header_location)) { + llq_info->header_location_ctrl = + llq_default_cfg->llq_header_location; + } else { + ena_trc_err("Invalid header location control, supported: 0x%x\n", + supported_feat); return -EINVAL; } - switch (llq_desc->entry_size_ctrl) { - case ENA_ADMIN_LIST_ENTRY_SIZE_128B: - llq_info->desc_list_entry_size = 128; - break; - case ENA_ADMIN_LIST_ENTRY_SIZE_192B: - llq_info->desc_list_entry_size = 192; - break; - case ENA_ADMIN_LIST_ENTRY_SIZE_256B: - llq_info->desc_list_entry_size = 256; - break; - default: - ena_trc_err("Invalid entry_size_ctrl %d\n", - llq_desc->entry_size_ctrl); - return -EINVAL; + if (likely(llq_info->header_location_ctrl == ENA_ADMIN_INLINE_HEADER)) { + supported_feat = llq_features->descriptors_stride_ctrl_supported; + if (likely(supported_feat & llq_default_cfg->llq_stride_ctrl)) { + llq_info->desc_stride_ctrl = llq_default_cfg->llq_stride_ctrl; + } else { + if (supported_feat & ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY) { + llq_info->desc_stride_ctrl = ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY; + } else if (supported_feat & ENA_ADMIN_SINGLE_DESC_PER_ENTRY) { + llq_info->desc_stride_ctrl = ENA_ADMIN_SINGLE_DESC_PER_ENTRY; + } else { + ena_trc_err("Invalid desc_stride_ctrl, supported: 0x%x\n", + supported_feat); + return -EINVAL; + } + + ena_trc_err("Default llq stride ctrl is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", + llq_default_cfg->llq_stride_ctrl, + supported_feat, + llq_info->desc_stride_ctrl); + } + } else { + llq_info->desc_stride_ctrl = 0; } - if ((llq_info->desc_list_entry_size & 0x7)) { + supported_feat = llq_features->entry_size_ctrl_supported; + if (likely(supported_feat & llq_default_cfg->llq_ring_entry_size)) { + llq_info->desc_list_entry_size_ctrl = llq_default_cfg->llq_ring_entry_size; + llq_info->desc_list_entry_size = llq_default_cfg->llq_ring_entry_size_value; + } else { + if (supported_feat & ENA_ADMIN_LIST_ENTRY_SIZE_128B) { + llq_info->desc_list_entry_size_ctrl = ENA_ADMIN_LIST_ENTRY_SIZE_128B; + llq_info->desc_list_entry_size = 128; + } else if (supported_feat & ENA_ADMIN_LIST_ENTRY_SIZE_192B) { + llq_info->desc_list_entry_size_ctrl = ENA_ADMIN_LIST_ENTRY_SIZE_192B; + llq_info->desc_list_entry_size = 192; + } else if (supported_feat & ENA_ADMIN_LIST_ENTRY_SIZE_256B) { + llq_info->desc_list_entry_size_ctrl = ENA_ADMIN_LIST_ENTRY_SIZE_256B; + llq_info->desc_list_entry_size = 256; + } else { + ena_trc_err("Invalid entry_size_ctrl, supported: 0x%x\n", supported_feat); + return -EINVAL; + } + + ena_trc_err("Default llq ring entry size is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", + llq_default_cfg->llq_ring_entry_size, + supported_feat, + llq_info->desc_list_entry_size); + } + if (unlikely(llq_info->desc_list_entry_size & 0x7)) { /* The desc list entry size should be whole multiply of 8 * This requirement comes from __iowrite64_copy() */ @@ -642,35 +719,50 @@ static int ena_com_config_llq_info(struct ena_com_dev return -EINVAL; } - if (llq_info->inline_header) { - llq_info->desc_stride_ctrl = llq_desc->descriptors_stride_ctrl; - if ((llq_info->desc_stride_ctrl != ENA_ADMIN_SINGLE_DESC_PER_ENTRY) && - (llq_info->desc_stride_ctrl != ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY)) { - ena_trc_err("Invalid desc_stride_ctrl %d\n", - llq_info->desc_stride_ctrl); - return -EINVAL; - } - } else { - llq_info->desc_stride_ctrl = ENA_ADMIN_SINGLE_DESC_PER_ENTRY; - } - - if (llq_info->desc_stride_ctrl == ENA_ADMIN_SINGLE_DESC_PER_ENTRY) + if (llq_info->desc_stride_ctrl == ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY) llq_info->descs_per_entry = llq_info->desc_list_entry_size / sizeof(struct ena_eth_io_tx_desc); else llq_info->descs_per_entry = 1; - llq_info->descs_num_before_header = llq_desc->desc_num_before_header_ctrl; + supported_feat = llq_features->desc_num_before_header_supported; + if (likely(supported_feat & llq_default_cfg->llq_num_decs_before_header)) { + llq_info->descs_num_before_header = llq_default_cfg->llq_num_decs_before_header; + } else { + if (supported_feat & ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_2) { + llq_info->descs_num_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_2; + } else if (supported_feat & ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_1) { + llq_info->descs_num_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_1; + } else if (supported_feat & ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_4) { + llq_info->descs_num_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_4; + } else if (supported_feat & ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_8) { + llq_info->descs_num_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_8; + } else { + ena_trc_err("Invalid descs_num_before_header, supported: 0x%x\n", + supported_feat); + return -EINVAL; + } - return 0; -} + ena_trc_err("Default llq num descs before header is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", + llq_default_cfg->llq_num_decs_before_header, + supported_feat, + llq_info->descs_num_before_header); + } + llq_info->max_entries_in_tx_burst = + (u16)(llq_features->max_tx_burst_size / llq_default_cfg->llq_ring_entry_size_value); + rc = ena_com_set_llq(ena_dev); + if (rc) + ena_trc_err("Cannot set LLQ configuration: %d\n", rc); + return 0; +} + static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *comp_ctx, struct ena_com_admin_queue *admin_queue) { - unsigned long flags; + unsigned long flags = 0; int ret; ENA_WAIT_EVENT_WAIT(comp_ctx->wait_event, @@ -715,7 +807,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev * volatile struct ena_admin_ena_mmio_req_read_less_resp *read_resp = mmio_read->read_resp; u32 mmio_read_reg, ret, i; - unsigned long flags; + unsigned long flags = 0; u32 timeout = mmio_read->reg_read_to; ENA_MIGHT_SLEEP(); @@ -736,15 +828,11 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev * mmio_read_reg |= mmio_read->seq_num & ENA_REGS_MMIO_REG_READ_REQ_ID_MASK; - /* make sure read_resp->req_id get updated before the hw can write - * there - */ - wmb(); + ENA_REG_WRITE32(ena_dev->bus, mmio_read_reg, + ena_dev->reg_bar + ENA_REGS_MMIO_REG_READ_OFF); - ENA_REG_WRITE32(ena_dev->bus, mmio_read_reg, ena_dev->reg_bar + ENA_REGS_MMIO_REG_READ_OFF); - for (i = 0; i < timeout; i++) { - if (read_resp->req_id == mmio_read->seq_num) + if (READ_ONCE16(read_resp->req_id) == mmio_read->seq_num) break; ENA_UDELAY(1); @@ -761,7 +849,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev * } if (read_resp->reg_off != offset) { - ena_trc_err("Read failure: wrong offset provided"); + ena_trc_err("Read failure: wrong offset provided\n"); ret = ENA_MMIO_READ_TIMEOUT; } else { ret = read_resp->reg_val; @@ -856,7 +944,6 @@ static void ena_com_io_queue_free(struct ena_com_dev * } if (io_sq->bounce_buf_ctrl.base_buffer) { - size = io_sq->llq_info.desc_list_entry_size * ENA_COM_BOUNCE_BUFFER_CNTRL_CNT; ENA_MEM_FREE(ena_dev->dmadev, io_sq->bounce_buf_ctrl.base_buffer); io_sq->bounce_buf_ctrl.base_buffer = NULL; } @@ -867,6 +954,9 @@ static int wait_for_reset_state(struct ena_com_dev *en { u32 val, i; + /* Convert timeout from resolution of 100ms to ENA_POLL_MS */ + timeout = (timeout * 100) / ENA_POLL_MS; + for (i = 0; i < timeout; i++) { val = ena_com_reg_bar_read32(ena_dev, ENA_REGS_DEV_STS_OFF); @@ -879,8 +969,7 @@ static int wait_for_reset_state(struct ena_com_dev *en exp_state) return 0; - /* The resolution of the timeout is 100ms */ - ENA_MSLEEP(100); + ENA_MSLEEP(ENA_POLL_MS); } return ENA_COM_TIMER_EXPIRED; @@ -903,7 +992,8 @@ static int ena_com_get_feature_ex(struct ena_com_dev * struct ena_admin_get_feat_resp *get_resp, enum ena_admin_aq_feature_id feature_id, dma_addr_t control_buf_dma_addr, - u32 control_buff_size) + u32 control_buff_size, + u8 feature_ver) { struct ena_com_admin_queue *admin_queue; struct ena_admin_get_feat_cmd get_cmd; @@ -934,7 +1024,7 @@ static int ena_com_get_feature_ex(struct ena_com_dev * } get_cmd.control_buffer.length = control_buff_size; - + get_cmd.feat_common.feature_version = feature_ver; get_cmd.feat_common.feature_id = feature_id; ret = ena_com_execute_admin_command(admin_queue, @@ -954,13 +1044,15 @@ static int ena_com_get_feature_ex(struct ena_com_dev * static int ena_com_get_feature(struct ena_com_dev *ena_dev, struct ena_admin_get_feat_resp *get_resp, - enum ena_admin_aq_feature_id feature_id) + enum ena_admin_aq_feature_id feature_id, + u8 feature_ver) { return ena_com_get_feature_ex(ena_dev, get_resp, feature_id, 0, - 0); + 0, + feature_ver); } static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev) @@ -1030,7 +1122,7 @@ static int ena_com_indirect_table_allocate(struct ena_ int ret; ret = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG); + ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG, 0); if (unlikely(ret)) return ret; @@ -1269,7 +1361,7 @@ int ena_com_execute_admin_command(struct ena_com_admin comp_ctx = ena_com_submit_admin_cmd(admin_queue, cmd, cmd_size, comp, comp_size); - if (unlikely(IS_ERR(comp_ctx))) { + if (IS_ERR(comp_ctx)) { if (comp_ctx == ERR_PTR(ENA_COM_NO_DEVICE)) ena_trc_dbg("Failed to submit command [%ld]\n", PTR_ERR(comp_ctx)); @@ -1389,12 +1481,12 @@ void ena_com_abort_admin_commands(struct ena_com_dev * void ena_com_wait_for_abort_completion(struct ena_com_dev *ena_dev) { struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue; - unsigned long flags; + unsigned long flags = 0; ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); while (ATOMIC32_READ(&admin_queue->outstanding_cmds) != 0) { ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); - ENA_MSLEEP(20); + ENA_MSLEEP(ENA_POLL_MS); ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); } ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); @@ -1433,7 +1525,7 @@ bool ena_com_get_admin_running_state(struct ena_com_de void ena_com_set_admin_running_state(struct ena_com_dev *ena_dev, bool state) { struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue; - unsigned long flags; + unsigned long flags = 0; ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); ena_dev->admin_queue.running_state = state; @@ -1460,14 +1552,14 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_de struct ena_admin_get_feat_resp get_resp; int ret; - ret = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_AENQ_CONFIG); + ret = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_AENQ_CONFIG, 0); if (ret) { ena_trc_info("Can't get aenq configuration\n"); return ret; } if ((get_resp.u.aenq.supported_groups & groups_flag) != groups_flag) { - ena_trc_warn("Trying to set unsupported aenq events. supported flag: %x asked flag: %x\n", + ena_trc_warn("Trying to set unsupported aenq events. supported flag: 0x%x asked flag: 0x%x\n", get_resp.u.aenq.supported_groups, groups_flag); return ENA_COM_UNSUPPORTED; @@ -1542,11 +1634,6 @@ int ena_com_validate_version(struct ena_com_dev *ena_d ENA_REGS_VERSION_MAJOR_VERSION_SHIFT, ver & ENA_REGS_VERSION_MINOR_VERSION_MASK); - if (ver < MIN_ENA_VER) { - ena_trc_err("ENA version is lower than the minimal version the driver supports\n"); - return -1; - } - ena_trc_info("ena controller version: %d.%d.%d implementation version %d\n", (ctrl_ver & ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_MASK) >> ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_SHIFT, @@ -1579,9 +1666,6 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev u16 size; ENA_WAIT_EVENT_DESTROY(admin_queue->comp_ctx->wait_event); - - ENA_SPINLOCK_DESTROY(admin_queue->q_lock); - if (admin_queue->comp_ctx) ENA_MEM_FREE(ena_dev->dmadev, admin_queue->comp_ctx); admin_queue->comp_ctx = NULL; @@ -1602,6 +1686,7 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev ENA_MEM_FREE_COHERENT(ena_dev->dmadev, size, aenq->entries, aenq->dma_addr, aenq->mem_handle); aenq->entries = NULL; + ENA_SPINLOCK_DESTROY(admin_queue->q_lock); } void ena_com_set_admin_polling_mode(struct ena_com_dev *ena_dev, bool polling) @@ -1611,7 +1696,8 @@ void ena_com_set_admin_polling_mode(struct ena_com_dev if (polling) mask_value = ENA_REGS_ADMIN_INTR_MASK; - ENA_REG_WRITE32(ena_dev->bus, mask_value, ena_dev->reg_bar + ENA_REGS_INTR_MASK_OFF); + ENA_REG_WRITE32(ena_dev->bus, mask_value, + ena_dev->reg_bar + ENA_REGS_INTR_MASK_OFF); ena_dev->admin_queue.polling = polling; } @@ -1626,7 +1712,7 @@ int ena_com_mmio_reg_read_request_init(struct ena_com_ mmio_read->read_resp_dma_addr, mmio_read->read_resp_mem_handle); if (unlikely(!mmio_read->read_resp)) - return ENA_COM_NO_MEM; + goto err; ena_com_mmio_reg_read_request_write_dev_addr(ena_dev); @@ -1635,6 +1721,10 @@ int ena_com_mmio_reg_read_request_init(struct ena_com_ mmio_read->readless_supported = true; return 0; + +err: + ENA_SPINLOCK_DESTROY(mmio_read->lock); + return ENA_COM_NO_MEM; } void ena_com_set_mmio_read_mode(struct ena_com_dev *ena_dev, bool readless_supported) @@ -1658,7 +1748,6 @@ void ena_com_mmio_reg_read_request_destroy(struct ena_ mmio_read->read_resp_mem_handle); mmio_read->read_resp = NULL; - ENA_SPINLOCK_DESTROY(mmio_read->lock); } @@ -1675,17 +1764,12 @@ void ena_com_mmio_reg_read_request_write_dev_addr(stru } int ena_com_admin_init(struct ena_com_dev *ena_dev, - struct ena_aenq_handlers *aenq_handlers, - bool init_spinlock) + struct ena_aenq_handlers *aenq_handlers) { struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue; u32 aq_caps, acq_caps, dev_sts, addr_low, addr_high; int ret; -#ifdef ENA_INTERNAL - ena_trc_info("ena_defs : Version:[%s] Build date [%s]", - ENA_GEN_COMMIT, ENA_GEN_DATE); -#endif dev_sts = ena_com_reg_bar_read32(ena_dev, ENA_REGS_DEV_STS_OFF); if (unlikely(dev_sts == ENA_MMIO_READ_TIMEOUT)) { @@ -1707,8 +1791,7 @@ int ena_com_admin_init(struct ena_com_dev *ena_dev, ATOMIC32_SET(&admin_queue->outstanding_cmds, 0); - if (init_spinlock) - ENA_SPINLOCK_INIT(admin_queue->q_lock); + ENA_SPINLOCK_INIT(admin_queue->q_lock); ret = ena_com_init_comp_ctxt(admin_queue); if (ret) @@ -1848,9 +1931,65 @@ void ena_com_destroy_io_queue(struct ena_com_dev *ena_ int ena_com_get_link_params(struct ena_com_dev *ena_dev, struct ena_admin_get_feat_resp *resp) { - return ena_com_get_feature(ena_dev, resp, ENA_ADMIN_LINK_CONFIG); + return ena_com_get_feature(ena_dev, resp, ENA_ADMIN_LINK_CONFIG, 0); } +int ena_com_extra_properties_strings_init(struct ena_com_dev *ena_dev) +{ + struct ena_admin_get_feat_resp resp; + struct ena_extra_properties_strings *extra_properties_strings = + &ena_dev->extra_properties_strings; + u32 rc; + extra_properties_strings->size = ENA_ADMIN_EXTRA_PROPERTIES_COUNT * + ENA_ADMIN_EXTRA_PROPERTIES_STRING_LEN; + + ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev, + extra_properties_strings->size, + extra_properties_strings->virt_addr, + extra_properties_strings->dma_addr, + extra_properties_strings->dma_handle); + if (unlikely(!extra_properties_strings->virt_addr)) { + ena_trc_err("Failed to allocate extra properties strings\n"); + return 0; + } + + rc = ena_com_get_feature_ex(ena_dev, &resp, + ENA_ADMIN_EXTRA_PROPERTIES_STRINGS, + extra_properties_strings->dma_addr, + extra_properties_strings->size, 0); + if (rc) { + ena_trc_dbg("Failed to get extra properties strings\n"); + goto err; + } + + return resp.u.extra_properties_strings.count; +err: + ena_com_delete_extra_properties_strings(ena_dev); + return 0; +} + +void ena_com_delete_extra_properties_strings(struct ena_com_dev *ena_dev) +{ + struct ena_extra_properties_strings *extra_properties_strings = + &ena_dev->extra_properties_strings; + + if (extra_properties_strings->virt_addr) { + ENA_MEM_FREE_COHERENT(ena_dev->dmadev, + extra_properties_strings->size, + extra_properties_strings->virt_addr, + extra_properties_strings->dma_addr, + extra_properties_strings->dma_handle); + extra_properties_strings->virt_addr = NULL; + } +} + +int ena_com_get_extra_properties_flags(struct ena_com_dev *ena_dev, + struct ena_admin_get_feat_resp *resp) +{ + return ena_com_get_feature(ena_dev, resp, + ENA_ADMIN_EXTRA_PROPERTIES_FLAGS, 0); +} + int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev, struct ena_com_dev_get_features_ctx *get_feat_ctx) { @@ -1858,7 +1997,7 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ int rc; rc = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_DEVICE_ATTRIBUTES); + ENA_ADMIN_DEVICE_ATTRIBUTES, 0); if (rc) return rc; @@ -1866,17 +2005,34 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ sizeof(get_resp.u.dev_attr)); ena_dev->supported_features = get_resp.u.dev_attr.supported_features; - rc = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_MAX_QUEUES_NUM); - if (rc) - return rc; + if (ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) { + rc = ena_com_get_feature(ena_dev, &get_resp, + ENA_ADMIN_MAX_QUEUES_EXT, + ENA_FEATURE_MAX_QUEUE_EXT_VER); + if (rc) + return rc; - memcpy(&get_feat_ctx->max_queues, &get_resp.u.max_queue, - sizeof(get_resp.u.max_queue)); - ena_dev->tx_max_header_size = get_resp.u.max_queue.max_header_size; + if (get_resp.u.max_queue_ext.version != ENA_FEATURE_MAX_QUEUE_EXT_VER) + return -EINVAL; + memcpy(&get_feat_ctx->max_queue_ext, &get_resp.u.max_queue_ext, + sizeof(get_resp.u.max_queue_ext)); + ena_dev->tx_max_header_size = + get_resp.u.max_queue_ext.max_queue_ext.max_tx_header_size; + } else { + rc = ena_com_get_feature(ena_dev, &get_resp, + ENA_ADMIN_MAX_QUEUES_NUM, 0); + memcpy(&get_feat_ctx->max_queues, &get_resp.u.max_queue, + sizeof(get_resp.u.max_queue)); + ena_dev->tx_max_header_size = + get_resp.u.max_queue.max_header_size; + + if (rc) + return rc; + } + rc = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_AENQ_CONFIG); + ENA_ADMIN_AENQ_CONFIG, 0); if (rc) return rc; @@ -1884,7 +2040,7 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ sizeof(get_resp.u.aenq)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sun Sep 6 14:23:32 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94D433D281A; Sun, 6 Sep 2020 14:23:32 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bkttr3kKhz3gND; Sun, 6 Sep 2020 14:23:32 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6381AFD4C; Sun, 6 Sep 2020 14:23:32 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086ENWRH036873; Sun, 6 Sep 2020 14:23:32 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086ENV4j036869; Sun, 6 Sep 2020 14:23:31 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202009061423.086ENV4j036869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sun, 6 Sep 2020 14:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365380 - in stable/12/sys: conf contrib/ena-com dev/ena modules/ena X-SVN-Group: stable-12 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in stable/12/sys: conf contrib/ena-com dev/ena modules/ena X-SVN-Commit-Revision: 365380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2020 14:23:32 -0000 Author: mw Date: Sun Sep 6 14:23:31 2020 New Revision: 365380 URL: https://svnweb.freebsd.org/changeset/base/365380 Log: MFC: ENA netmap support and bug fixes r363638 Fix ENA build when integrated into kernel r354242 Make valdiate_rx_req_id static inline because it uses other static r354225 Update ENA version to v2.1.0 r354224 Add support for ENA NETMAP partial initialization r354223 Add support for ENA NETMAP Tx r354222 Add support for ENA NETMAP Rx r354221 Introduce NETMAP support in ENA r354220 Split Rx/Tx from initialization code in ENA driver r354219 Fix ENA keep-alive timeout due to prolonged reset r354218 Add WC support for arm64 in the ENA driver Obtained from: Semihalf Sponsored by: Amazon, Inc. Added: stable/12/sys/dev/ena/ena_datapath.c - copied, changed from r354225, head/sys/dev/ena/ena_datapath.c stable/12/sys/dev/ena/ena_datapath.h - copied unchanged from r354225, head/sys/dev/ena/ena_datapath.h stable/12/sys/dev/ena/ena_netmap.c - copied unchanged from r354225, head/sys/dev/ena/ena_netmap.c stable/12/sys/dev/ena/ena_netmap.h - copied unchanged from r354225, head/sys/dev/ena/ena_netmap.h Modified: stable/12/sys/conf/files stable/12/sys/contrib/ena-com/ena_plat.h stable/12/sys/dev/ena/ena.c stable/12/sys/dev/ena/ena.h stable/12/sys/modules/ena/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Sun Sep 6 14:13:51 2020 (r365379) +++ stable/12/sys/conf/files Sun Sep 6 14:23:31 2020 (r365380) @@ -1707,6 +1707,10 @@ dev/e1000/e1000_osdep.c optional em \ dev/et/if_et.c optional et dev/ena/ena.c optional ena \ compile-with "${NORMAL_C} -I$S/contrib" +dev/ena/ena_datapath.c optional ena \ + compile-with "${NORMAL_C} -I$S/contrib" +dev/ena/ena_netmap.c optional ena \ + compile-with "${NORMAL_C} -I$S/contrib" dev/ena/ena_sysctl.c optional ena \ compile-with "${NORMAL_C} -I$S/contrib" contrib/ena-com/ena_com.c optional ena Modified: stable/12/sys/contrib/ena-com/ena_plat.h ============================================================================== --- stable/12/sys/contrib/ena-com/ena_plat.h Sun Sep 6 14:13:51 2020 (r365379) +++ stable/12/sys/contrib/ena-com/ena_plat.h Sun Sep 6 14:23:31 2020 (r365380) @@ -103,6 +103,7 @@ extern struct ena_bus_space ebs; #define ENA_RSC (1 << 6) /* Goes with TXPTH or RXPTH, free/alloc res. */ #define ENA_IOQ (1 << 7) /* Detailed info about IO queues. */ #define ENA_ADMQ (1 << 8) /* Detailed info about admin queue. */ +#define ENA_NETMAP (1 << 9) /* Detailed info about netmap. */ extern int ena_log_level; Modified: stable/12/sys/dev/ena/ena.c ============================================================================== --- stable/12/sys/dev/ena/ena.c Sun Sep 6 14:13:51 2020 (r365379) +++ stable/12/sys/dev/ena/ena.c Sun Sep 6 14:23:31 2020 (r365380) @@ -81,9 +81,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include "ena_datapath.h" #include "ena.h" #include "ena_sysctl.h" +#ifdef DEV_NETMAP +#include "ena_netmap.h" +#endif /* DEV_NETMAP */ + /********************************************************* * Function prototypes *********************************************************/ @@ -103,11 +108,11 @@ static int ena_setup_tx_dma_tag(struct ena_adapter *); static int ena_free_tx_dma_tag(struct ena_adapter *); static int ena_setup_rx_dma_tag(struct ena_adapter *); static int ena_free_rx_dma_tag(struct ena_adapter *); +static void ena_release_all_tx_dmamap(struct ena_ring *); static int ena_setup_tx_resources(struct ena_adapter *, int); static void ena_free_tx_resources(struct ena_adapter *, int); static int ena_setup_all_tx_resources(struct ena_adapter *); static void ena_free_all_tx_resources(struct ena_adapter *); -static inline int validate_rx_req_id(struct ena_ring *, uint16_t); static int ena_setup_rx_resources(struct ena_adapter *, unsigned int); static void ena_free_rx_resources(struct ena_adapter *, unsigned int); static int ena_setup_all_rx_resources(struct ena_adapter *); @@ -116,7 +121,6 @@ static inline int ena_alloc_rx_mbuf(struct ena_adapter struct ena_rx_buffer *); static void ena_free_rx_mbuf(struct ena_adapter *, struct ena_ring *, struct ena_rx_buffer *); -static int ena_refill_rx_bufs(struct ena_ring *, uint32_t); static void ena_free_rx_bufs(struct ena_adapter *, unsigned int); static void ena_refill_all_rx_bufs(struct ena_adapter *); static void ena_free_all_rx_bufs(struct ena_adapter *); @@ -126,16 +130,6 @@ static void ena_destroy_all_tx_queues(struct ena_adapt static void ena_destroy_all_rx_queues(struct ena_adapter *); static void ena_destroy_all_io_queues(struct ena_adapter *); static int ena_create_io_queues(struct ena_adapter *); -static int ena_tx_cleanup(struct ena_ring *); -static int ena_rx_cleanup(struct ena_ring *); -static inline int validate_tx_req_id(struct ena_ring *, uint16_t); -static void ena_rx_hash_mbuf(struct ena_ring *, struct ena_com_rx_ctx *, - struct mbuf *); -static struct mbuf* ena_rx_mbuf(struct ena_ring *, struct ena_com_rx_buf_info *, - struct ena_com_rx_ctx *, uint16_t *); -static inline void ena_rx_checksum(struct ena_ring *, struct ena_com_rx_ctx *, - struct mbuf *); -static void ena_cleanup(void *arg, int pending); static int ena_handle_msix(void *); static int ena_enable_msix(struct ena_adapter *); static void ena_setup_mgmnt_intr(struct ena_adapter *); @@ -149,8 +143,6 @@ static void ena_disable_msix(struct ena_adapter *); static void ena_unmask_all_io_irqs(struct ena_adapter *); static int ena_rss_configure(struct ena_adapter *); static int ena_up_complete(struct ena_adapter *); -static int ena_up(struct ena_adapter *); -static void ena_down(struct ena_adapter *); static uint64_t ena_get_counter(if_t, ift_counter); static int ena_media_change(if_t); static void ena_media_status(if_t, struct ifmediareq *); @@ -161,15 +153,6 @@ static void ena_update_host_info(struct ena_admin_host static void ena_update_hwassist(struct ena_adapter *); static int ena_setup_ifnet(device_t, struct ena_adapter *, struct ena_com_dev_get_features_ctx *); -static void ena_tx_csum(struct ena_com_tx_ctx *, struct mbuf *); -static int ena_check_and_collapse_mbuf(struct ena_ring *tx_ring, - struct mbuf **mbuf); -static void ena_dmamap_llq(void *, bus_dma_segment_t *, int, int); -static int ena_xmit_mbuf(struct ena_ring *, struct mbuf **); -static void ena_start_xmit(struct ena_ring *); -static int ena_mq_start(if_t, struct mbuf *); -static void ena_deferred_mq_start(void *, int); -static void ena_qflush(if_t); static int ena_enable_wc(struct resource *); static int ena_set_queues_placement_policy(device_t, struct ena_com_dev *, struct ena_admin_feature_llq_desc *, struct ena_llq_configurations *); @@ -555,6 +538,44 @@ ena_free_rx_dma_tag(struct ena_adapter *adapter) return (ret); } +static void +ena_release_all_tx_dmamap(struct ena_ring *tx_ring) +{ + struct ena_adapter *adapter = tx_ring->adapter; + struct ena_tx_buffer *tx_info; + bus_dma_tag_t tx_tag = adapter->tx_buf_tag;; + int i; +#ifdef DEV_NETMAP + struct ena_netmap_tx_info *nm_info; + int j; +#endif /* DEV_NETMAP */ + + for (i = 0; i < tx_ring->ring_size; ++i) { + tx_info = &tx_ring->tx_buffer_info[i]; +#ifdef DEV_NETMAP + if (adapter->ifp->if_capenable & IFCAP_NETMAP) { + nm_info = &tx_info->nm_info; + for (j = 0; j < ENA_PKT_MAX_BUFS; ++j) { + if (nm_info->map_seg[j] != NULL) { + bus_dmamap_destroy(tx_tag, + nm_info->map_seg[j]); + nm_info->map_seg[j] = NULL; + } + } + } +#endif /* DEV_NETMAP */ + if (tx_info->map_head != NULL) { + bus_dmamap_destroy(tx_tag, tx_info->map_head); + tx_info->map_head = NULL; + } + + if (tx_info->map_seg != NULL) { + bus_dmamap_destroy(tx_tag, tx_info->map_seg); + tx_info->map_seg = NULL; + } + } +} + /** * ena_setup_tx_resources - allocate Tx resources (Descriptors) * @adapter: network interface device structure @@ -568,7 +589,13 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in struct ena_que *que = &adapter->que[qid]; struct ena_ring *tx_ring = que->tx_ring; int size, i, err; +#ifdef DEV_NETMAP + bus_dmamap_t *map; + int j; + ena_netmap_reset_tx_ring(adapter, qid); +#endif /* DEV_NETMAP */ + size = sizeof(struct ena_tx_buffer) * tx_ring->ring_size; tx_ring->tx_buffer_info = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -611,7 +638,7 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in ena_trace(ENA_ALERT, "Unable to create Tx DMA map_head for buffer %d\n", i); - goto err_buf_info_unmap; + goto err_map_release; } tx_ring->tx_buffer_info[i].seg_mapped = false; @@ -621,9 +648,24 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in ena_trace(ENA_ALERT, "Unable to create Tx DMA map_seg for buffer %d\n", i); - goto err_buf_info_head_unmap; + goto err_map_release; } tx_ring->tx_buffer_info[i].head_mapped = false; + +#ifdef DEV_NETMAP + if (adapter->ifp->if_capenable & IFCAP_NETMAP) { + map = tx_ring->tx_buffer_info[i].nm_info.map_seg; + for (j = 0; j < ENA_PKT_MAX_BUFS; j++) { + err = bus_dmamap_create(adapter->tx_buf_tag, 0, + &map[j]); + if (unlikely(err != 0)) { + ena_trace(ENA_ALERT, "Unable to create " + "Tx DMA for buffer %d %d\n", i, j); + goto err_map_release; + } + } + } +#endif /* DEV_NETMAP */ } /* Allocate taskqueues */ @@ -634,7 +676,7 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in ena_trace(ENA_ALERT, "Unable to create taskqueue for enqueue task\n"); i = tx_ring->ring_size; - goto err_buf_info_unmap; + goto err_map_release; } tx_ring->running = true; @@ -644,17 +686,8 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in return (0); -err_buf_info_head_unmap: - bus_dmamap_destroy(adapter->tx_buf_tag, - tx_ring->tx_buffer_info[i].map_head); -err_buf_info_unmap: - while (i--) { - bus_dmamap_destroy(adapter->tx_buf_tag, - tx_ring->tx_buffer_info[i].map_head); - bus_dmamap_destroy(adapter->tx_buf_tag, - tx_ring->tx_buffer_info[i].map_seg); - } - free(tx_ring->push_buf_intermediate_buf, M_DEVBUF); +err_map_release: + ena_release_all_tx_dmamap(tx_ring); err_tx_ids_free: free(tx_ring->free_tx_ids, M_DEVBUF); tx_ring->free_tx_ids = NULL; @@ -676,6 +709,10 @@ static void ena_free_tx_resources(struct ena_adapter *adapter, int qid) { struct ena_ring *tx_ring = &adapter->tx_ring[qid]; +#ifdef DEV_NETMAP + struct ena_netmap_tx_info *nm_info; + int j; +#endif /* DEV_NETMAP */ while (taskqueue_cancel(tx_ring->enqueue_tq, &tx_ring->enqueue_task, NULL)) @@ -711,6 +748,24 @@ ena_free_tx_resources(struct ena_adapter *adapter, int bus_dmamap_destroy(adapter->tx_buf_tag, tx_ring->tx_buffer_info[i].map_seg); +#ifdef DEV_NETMAP + if (adapter->ifp->if_capenable & IFCAP_NETMAP) { + nm_info = &tx_ring->tx_buffer_info[i].nm_info; + for (j = 0; j < ENA_PKT_MAX_BUFS; j++) { + if (nm_info->socket_buf_idx[j] != 0) { + bus_dmamap_sync(adapter->tx_buf_tag, + nm_info->map_seg[j], + BUS_DMASYNC_POSTWRITE); + ena_netmap_unload(adapter, + nm_info->map_seg[j]); + } + bus_dmamap_destroy(adapter->tx_buf_tag, + nm_info->map_seg[j]); + nm_info->socket_buf_idx[j] = 0; + } + } +#endif /* DEV_NETMAP */ + m_freem(tx_ring->tx_buffer_info[i].mbuf); tx_ring->tx_buffer_info[i].mbuf = NULL; } @@ -772,25 +827,6 @@ ena_free_all_tx_resources(struct ena_adapter *adapter) ena_free_tx_resources(adapter, i); } -static inline int -validate_rx_req_id(struct ena_ring *rx_ring, uint16_t req_id) -{ - if (likely(req_id < rx_ring->ring_size)) - return (0); - - device_printf(rx_ring->adapter->pdev, "Invalid rx req_id: %hu\n", - req_id); - counter_u64_add(rx_ring->rx_stats.bad_req_id, 1); - - /* Trigger device reset */ - if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, rx_ring->adapter))) { - rx_ring->adapter->reset_reason = ENA_REGS_RESET_INV_RX_REQ_ID; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, rx_ring->adapter); - } - - return (EFAULT); -} - /** * ena_setup_rx_resources - allocate Rx resources (Descriptors) * @adapter: network interface device structure @@ -807,6 +843,11 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un size = sizeof(struct ena_rx_buffer) * rx_ring->ring_size; +#ifdef DEV_NETMAP + ena_netmap_reset_rx_ring(adapter, qid); + rx_ring->initialized = false; +#endif /* DEV_NETMAP */ + /* * Alloc extra element so in rx path * we can always prefetch rx_info + 1 @@ -1031,7 +1072,7 @@ ena_free_rx_mbuf(struct ena_adapter *adapter, struct e * @num: number of descriptors to refill * Refills the ring with newly allocated DMA-mapped mbufs for receiving **/ -static int +int ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t num) { struct ena_adapter *adapter = rx_ring->adapter; @@ -1052,8 +1093,12 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t req_id = rx_ring->free_rx_ids[next_to_use]; rx_info = &rx_ring->rx_buffer_info[req_id]; - - rc = ena_alloc_rx_mbuf(adapter, rx_ring, rx_info); +#ifdef DEV_NETMAP + if (ena_rx_ring_in_netmap(adapter, rx_ring->qid)) + rc = ena_netmap_alloc_rx_slot(adapter, rx_ring, rx_info); + else +#endif /* DEV_NETMAP */ + rc = ena_alloc_rx_mbuf(adapter, rx_ring, rx_info); if (unlikely(rc != 0)) { ena_trace(ENA_WARNING, "failed to alloc buffer for rx queue %d\n", @@ -1098,6 +1143,14 @@ ena_free_rx_bufs(struct ena_adapter *adapter, unsigned if (rx_info->mbuf != NULL) ena_free_rx_mbuf(adapter, rx_ring, rx_info); +#ifdef DEV_NETMAP + if (((if_getflags(adapter->ifp) & IFF_DYING) == 0) && + (adapter->ifp->if_capenable & IFCAP_NETMAP)) { + if (rx_info->netmap_buf_idx != 0) + ena_netmap_free_rx_slot(adapter, rx_ring, + rx_info); + } +#endif /* DEV_NETMAP */ } } @@ -1116,10 +1169,12 @@ ena_refill_all_rx_bufs(struct ena_adapter *adapter) rx_ring = &adapter->rx_ring[i]; bufs_num = rx_ring->ring_size - 1; rc = ena_refill_rx_bufs(rx_ring, bufs_num); - if (unlikely(rc != bufs_num)) ena_trace(ENA_WARNING, "refilling Queue %d failed. " "Allocated %d buffers from: %d\n", i, rc, bufs_num); +#ifdef DEV_NETMAP + rx_ring->initialized = true; +#endif /* DEV_NETMAP */ } } @@ -1234,30 +1289,6 @@ ena_destroy_all_io_queues(struct ena_adapter *adapter) ena_destroy_all_rx_queues(adapter); } -static inline int -validate_tx_req_id(struct ena_ring *tx_ring, uint16_t req_id) -{ - struct ena_adapter *adapter = tx_ring->adapter; - struct ena_tx_buffer *tx_info = NULL; - - if (likely(req_id < tx_ring->ring_size)) { - tx_info = &tx_ring->tx_buffer_info[req_id]; - if (tx_info->mbuf != NULL) - return (0); - device_printf(adapter->pdev, - "tx_info doesn't have valid mbuf\n"); - } - - device_printf(adapter->pdev, "Invalid req_id: %hu\n", req_id); - counter_u64_add(tx_ring->tx_stats.bad_req_id, 1); - - /* Trigger device reset */ - adapter->reset_reason = ENA_REGS_RESET_INV_TX_REQ_ID; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); - - return (EFAULT); -} - static int ena_create_io_queues(struct ena_adapter *adapter) { @@ -1351,488 +1382,6 @@ err_tx: return (ENXIO); } -/** - * ena_tx_cleanup - clear sent packets and corresponding descriptors - * @tx_ring: ring for which we want to clean packets - * - * Once packets are sent, we ask the device in a loop for no longer used - * descriptors. We find the related mbuf chain in a map (index in an array) - * and free it, then update ring state. - * This is performed in "endless" loop, updating ring pointers every - * TX_COMMIT. The first check of free descriptor is performed before the actual - * loop, then repeated at the loop end. - **/ -static int -ena_tx_cleanup(struct ena_ring *tx_ring) -{ - struct ena_adapter *adapter; - struct ena_com_io_cq* io_cq; - uint16_t next_to_clean; - uint16_t req_id; - uint16_t ena_qid; - unsigned int total_done = 0; - int rc; - int commit = TX_COMMIT; - int budget = TX_BUDGET; - int work_done; - bool above_thresh; - - adapter = tx_ring->que->adapter; - ena_qid = ENA_IO_TXQ_IDX(tx_ring->que->id); - io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; - next_to_clean = tx_ring->next_to_clean; - - do { - struct ena_tx_buffer *tx_info; - struct mbuf *mbuf; - - rc = ena_com_tx_comp_req_id_get(io_cq, &req_id); - if (unlikely(rc != 0)) - break; - - rc = validate_tx_req_id(tx_ring, req_id); - if (unlikely(rc != 0)) - break; - - tx_info = &tx_ring->tx_buffer_info[req_id]; - - mbuf = tx_info->mbuf; - - tx_info->mbuf = NULL; - bintime_clear(&tx_info->timestamp); - - /* Map is no longer required */ - if (tx_info->head_mapped == true) { - bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map_head, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(adapter->tx_buf_tag, - tx_info->map_head); - tx_info->head_mapped = false; - } - if (tx_info->seg_mapped == true) { - bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map_seg, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(adapter->tx_buf_tag, - tx_info->map_seg); - tx_info->seg_mapped = false; - } - - ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d mbuf %p completed\n", - tx_ring->qid, mbuf); - - m_freem(mbuf); - - total_done += tx_info->tx_descs; - - tx_ring->free_tx_ids[next_to_clean] = req_id; - next_to_clean = ENA_TX_RING_IDX_NEXT(next_to_clean, - tx_ring->ring_size); - - if (unlikely(--commit == 0)) { - commit = TX_COMMIT; - /* update ring state every TX_COMMIT descriptor */ - tx_ring->next_to_clean = next_to_clean; - ena_com_comp_ack( - &adapter->ena_dev->io_sq_queues[ena_qid], - total_done); - ena_com_update_dev_comp_head(io_cq); - total_done = 0; - } - } while (likely(--budget)); - - work_done = TX_BUDGET - budget; - - ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d done. total pkts: %d\n", - tx_ring->qid, work_done); - - /* If there is still something to commit update ring state */ - if (likely(commit != TX_COMMIT)) { - tx_ring->next_to_clean = next_to_clean; - ena_com_comp_ack(&adapter->ena_dev->io_sq_queues[ena_qid], - total_done); - ena_com_update_dev_comp_head(io_cq); - } - - /* - * Need to make the rings circular update visible to - * ena_xmit_mbuf() before checking for tx_ring->running. - */ - mb(); - - above_thresh = ena_com_sq_have_enough_space(tx_ring->ena_com_io_sq, - ENA_TX_RESUME_THRESH); - if (unlikely(!tx_ring->running && above_thresh)) { - ENA_RING_MTX_LOCK(tx_ring); - above_thresh = - ena_com_sq_have_enough_space(tx_ring->ena_com_io_sq, - ENA_TX_RESUME_THRESH); - if (!tx_ring->running && above_thresh) { - tx_ring->running = true; - counter_u64_add(tx_ring->tx_stats.queue_wakeup, 1); - taskqueue_enqueue(tx_ring->enqueue_tq, - &tx_ring->enqueue_task); - } - ENA_RING_MTX_UNLOCK(tx_ring); - } - - return (work_done); -} - -static void -ena_rx_hash_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_ctx *ena_rx_ctx, - struct mbuf *mbuf) -{ - struct ena_adapter *adapter = rx_ring->adapter; - - if (likely(ENA_FLAG_ISSET(ENA_FLAG_RSS_ACTIVE, adapter))) { - mbuf->m_pkthdr.flowid = ena_rx_ctx->hash; - -#ifdef RSS - /* - * Hardware and software RSS are in agreement only when both are - * configured to Toeplitz algorithm. This driver configures - * that algorithm only when software RSS is enabled and uses it. - */ - if (adapter->ena_dev->rss.hash_func != ENA_ADMIN_TOEPLITZ && - ena_rx_ctx->l3_proto != ENA_ETH_IO_L3_PROTO_UNKNOWN) { - M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH); - return; - } -#endif - - if (ena_rx_ctx->frag && - (ena_rx_ctx->l3_proto != ENA_ETH_IO_L3_PROTO_UNKNOWN)) { - M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH); - return; - } - - switch (ena_rx_ctx->l3_proto) { - case ENA_ETH_IO_L3_PROTO_IPV4: - switch (ena_rx_ctx->l4_proto) { - case ENA_ETH_IO_L4_PROTO_TCP: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_TCP_IPV4); - break; - case ENA_ETH_IO_L4_PROTO_UDP: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_UDP_IPV4); - break; - default: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_IPV4); - } - break; - case ENA_ETH_IO_L3_PROTO_IPV6: - switch (ena_rx_ctx->l4_proto) { - case ENA_ETH_IO_L4_PROTO_TCP: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_TCP_IPV6); - break; - case ENA_ETH_IO_L4_PROTO_UDP: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_UDP_IPV6); - break; - default: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_IPV6); - } - break; - case ENA_ETH_IO_L3_PROTO_UNKNOWN: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_NONE); - break; - default: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH); - } - } else { - mbuf->m_pkthdr.flowid = rx_ring->qid; - M_HASHTYPE_SET(mbuf, M_HASHTYPE_NONE); - } -} - -/** - * ena_rx_mbuf - assemble mbuf from descriptors - * @rx_ring: ring for which we want to clean packets - * @ena_bufs: buffer info - * @ena_rx_ctx: metadata for this packet(s) - * @next_to_clean: ring pointer, will be updated only upon success - * - **/ -static struct mbuf* -ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_buf_info *ena_bufs, - struct ena_com_rx_ctx *ena_rx_ctx, uint16_t *next_to_clean) -{ - struct mbuf *mbuf; - struct ena_rx_buffer *rx_info; - struct ena_adapter *adapter; - unsigned int descs = ena_rx_ctx->descs; - int rc; - uint16_t ntc, len, req_id, buf = 0; - - ntc = *next_to_clean; - adapter = rx_ring->adapter; - - len = ena_bufs[buf].len; - req_id = ena_bufs[buf].req_id; - rc = validate_rx_req_id(rx_ring, req_id); - if (unlikely(rc != 0)) - return (NULL); - - rx_info = &rx_ring->rx_buffer_info[req_id]; - if (unlikely(rx_info->mbuf == NULL)) { - device_printf(adapter->pdev, "NULL mbuf in rx_info"); - return (NULL); - } - - ena_trace(ENA_DBG | ENA_RXPTH, "rx_info %p, mbuf %p, paddr %jx\n", - rx_info, rx_info->mbuf, (uintmax_t)rx_info->ena_buf.paddr); - - bus_dmamap_sync(adapter->rx_buf_tag, rx_info->map, - BUS_DMASYNC_POSTREAD); - mbuf = rx_info->mbuf; - mbuf->m_flags |= M_PKTHDR; - mbuf->m_pkthdr.len = len; - mbuf->m_len = len; - mbuf->m_pkthdr.rcvif = rx_ring->que->adapter->ifp; - - /* Fill mbuf with hash key and it's interpretation for optimization */ - ena_rx_hash_mbuf(rx_ring, ena_rx_ctx, mbuf); - - ena_trace(ENA_DBG | ENA_RXPTH, "rx mbuf 0x%p, flags=0x%x, len: %d\n", - mbuf, mbuf->m_flags, mbuf->m_pkthdr.len); - - /* DMA address is not needed anymore, unmap it */ - bus_dmamap_unload(rx_ring->adapter->rx_buf_tag, rx_info->map); - - rx_info->mbuf = NULL; - rx_ring->free_rx_ids[ntc] = req_id; - ntc = ENA_RX_RING_IDX_NEXT(ntc, rx_ring->ring_size); - - /* - * While we have more than 1 descriptors for one rcvd packet, append - * other mbufs to the main one - */ - while (--descs) { - ++buf; - len = ena_bufs[buf].len; - req_id = ena_bufs[buf].req_id; - rc = validate_rx_req_id(rx_ring, req_id); - if (unlikely(rc != 0)) { - /* - * If the req_id is invalid, then the device will be - * reset. In that case we must free all mbufs that - * were already gathered. - */ - m_freem(mbuf); - return (NULL); - } - rx_info = &rx_ring->rx_buffer_info[req_id]; - - if (unlikely(rx_info->mbuf == NULL)) { - device_printf(adapter->pdev, "NULL mbuf in rx_info"); - /* - * If one of the required mbufs was not allocated yet, - * we can break there. - * All earlier used descriptors will be reallocated - * later and not used mbufs can be reused. - * The next_to_clean pointer will not be updated in case - * of an error, so caller should advance it manually - * in error handling routine to keep it up to date - * with hw ring. - */ - m_freem(mbuf); - return (NULL); - } - - bus_dmamap_sync(adapter->rx_buf_tag, rx_info->map, - BUS_DMASYNC_POSTREAD); - if (unlikely(m_append(mbuf, len, rx_info->mbuf->m_data) == 0)) { - counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); - ena_trace(ENA_WARNING, "Failed to append Rx mbuf %p\n", - mbuf); - } - - ena_trace(ENA_DBG | ENA_RXPTH, - "rx mbuf updated. len %d\n", mbuf->m_pkthdr.len); - - /* Free already appended mbuf, it won't be useful anymore */ - bus_dmamap_unload(rx_ring->adapter->rx_buf_tag, rx_info->map); - m_freem(rx_info->mbuf); - rx_info->mbuf = NULL; - - rx_ring->free_rx_ids[ntc] = req_id; - ntc = ENA_RX_RING_IDX_NEXT(ntc, rx_ring->ring_size); - } - - *next_to_clean = ntc; - - return (mbuf); -} - -/** - * ena_rx_checksum - indicate in mbuf if hw indicated a good cksum - **/ -static inline void -ena_rx_checksum(struct ena_ring *rx_ring, struct ena_com_rx_ctx *ena_rx_ctx, - struct mbuf *mbuf) -{ - - /* if IP and error */ - if (unlikely((ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4) && - ena_rx_ctx->l3_csum_err)) { - /* ipv4 checksum error */ - mbuf->m_pkthdr.csum_flags = 0; - counter_u64_add(rx_ring->rx_stats.bad_csum, 1); - ena_trace(ENA_DBG, "RX IPv4 header checksum error\n"); - return; - } - - /* if TCP/UDP */ - if ((ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_TCP) || - (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_UDP)) { - if (ena_rx_ctx->l4_csum_err) { - /* TCP/UDP checksum error */ - mbuf->m_pkthdr.csum_flags = 0; - counter_u64_add(rx_ring->rx_stats.bad_csum, 1); - ena_trace(ENA_DBG, "RX L4 checksum error\n"); - } else { - mbuf->m_pkthdr.csum_flags = CSUM_IP_CHECKED; - mbuf->m_pkthdr.csum_flags |= CSUM_IP_VALID; - } - } -} - -/** - * ena_rx_cleanup - handle rx irq - * @arg: ring for which irq is being handled - **/ -static int -ena_rx_cleanup(struct ena_ring *rx_ring) -{ - struct ena_adapter *adapter; - struct mbuf *mbuf; - struct ena_com_rx_ctx ena_rx_ctx; - struct ena_com_io_cq* io_cq; - struct ena_com_io_sq* io_sq; - if_t ifp; - uint16_t ena_qid; - uint16_t next_to_clean; - uint32_t refill_required; - uint32_t refill_threshold; - uint32_t do_if_input = 0; - unsigned int qid; - int rc, i; - int budget = RX_BUDGET; - - adapter = rx_ring->que->adapter; - ifp = adapter->ifp; - qid = rx_ring->que->id; - ena_qid = ENA_IO_RXQ_IDX(qid); - io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; - io_sq = &adapter->ena_dev->io_sq_queues[ena_qid]; - next_to_clean = rx_ring->next_to_clean; - - ena_trace(ENA_DBG, "rx: qid %d\n", qid); - - do { - ena_rx_ctx.ena_bufs = rx_ring->ena_bufs; - ena_rx_ctx.max_bufs = adapter->max_rx_sgl_size; - ena_rx_ctx.descs = 0; - bus_dmamap_sync(io_cq->cdesc_addr.mem_handle.tag, - io_cq->cdesc_addr.mem_handle.map, BUS_DMASYNC_POSTREAD); - rc = ena_com_rx_pkt(io_cq, io_sq, &ena_rx_ctx); - - if (unlikely(rc != 0)) - goto error; - - if (unlikely(ena_rx_ctx.descs == 0)) - break; - - ena_trace(ENA_DBG | ENA_RXPTH, "rx: q %d got packet from ena. " - "descs #: %d l3 proto %d l4 proto %d hash: %x\n", - rx_ring->qid, ena_rx_ctx.descs, ena_rx_ctx.l3_proto, - ena_rx_ctx.l4_proto, ena_rx_ctx.hash); - - /* Receive mbuf from the ring */ - mbuf = ena_rx_mbuf(rx_ring, rx_ring->ena_bufs, - &ena_rx_ctx, &next_to_clean); - bus_dmamap_sync(io_cq->cdesc_addr.mem_handle.tag, - io_cq->cdesc_addr.mem_handle.map, BUS_DMASYNC_PREREAD); - /* Exit if we failed to retrieve a buffer */ - if (unlikely(mbuf == NULL)) { - for (i = 0; i < ena_rx_ctx.descs; ++i) { - rx_ring->free_rx_ids[next_to_clean] = - rx_ring->ena_bufs[i].req_id; - next_to_clean = - ENA_RX_RING_IDX_NEXT(next_to_clean, - rx_ring->ring_size); - - } - break; - } - - if (((ifp->if_capenable & IFCAP_RXCSUM) != 0) || - ((ifp->if_capenable & IFCAP_RXCSUM_IPV6) != 0)) { - ena_rx_checksum(rx_ring, &ena_rx_ctx, mbuf); - } - - counter_enter(); - counter_u64_add_protected(rx_ring->rx_stats.bytes, - mbuf->m_pkthdr.len); - counter_u64_add_protected(adapter->hw_stats.rx_bytes, - mbuf->m_pkthdr.len); - counter_exit(); - /* - * LRO is only for IP/TCP packets and TCP checksum of the packet - * should be computed by hardware. - */ - do_if_input = 1; - if (((ifp->if_capenable & IFCAP_LRO) != 0) && - ((mbuf->m_pkthdr.csum_flags & CSUM_IP_VALID) != 0) && - (ena_rx_ctx.l4_proto == ENA_ETH_IO_L4_PROTO_TCP)) { - /* - * Send to the stack if: - * - LRO not enabled, or - * - no LRO resources, or - * - lro enqueue fails - */ - if ((rx_ring->lro.lro_cnt != 0) && - (tcp_lro_rx(&rx_ring->lro, mbuf, 0) == 0)) - do_if_input = 0; - } - if (do_if_input != 0) { - ena_trace(ENA_DBG | ENA_RXPTH, - "calling if_input() with mbuf %p\n", mbuf); - (*ifp->if_input)(ifp, mbuf); - } - - counter_enter(); - counter_u64_add_protected(rx_ring->rx_stats.cnt, 1); - counter_u64_add_protected(adapter->hw_stats.rx_packets, 1); - counter_exit(); - } while (--budget); - - rx_ring->next_to_clean = next_to_clean; - - refill_required = ena_com_free_desc(io_sq); - refill_threshold = min_t(int, - rx_ring->ring_size / ENA_RX_REFILL_THRESH_DIVIDER, - ENA_RX_REFILL_THRESH_PACKET); - - if (refill_required > refill_threshold) { - ena_com_update_dev_comp_head(rx_ring->ena_com_io_cq); - ena_refill_rx_bufs(rx_ring, refill_required); - } - - tcp_lro_flush_all(&rx_ring->lro); - - return (RX_BUDGET - budget); - -error: - counter_u64_add(rx_ring->rx_stats.bad_desc_num, 1); - - /* Too many desc from the device. Trigger reset */ - if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { - adapter->reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); - } - - return (0); -} - /********************************************************************* * * MSIX & Interrupt Service routine @@ -1853,52 +1402,6 @@ ena_intr_msix_mgmnt(void *arg) ena_com_aenq_intr_handler(adapter->ena_dev, arg); } -static void -ena_cleanup(void *arg, int pending) -{ - struct ena_que *que = arg; - struct ena_adapter *adapter = que->adapter; - if_t ifp = adapter->ifp; - struct ena_ring *tx_ring; - struct ena_ring *rx_ring; - struct ena_com_io_cq* io_cq; - struct ena_eth_io_intr_reg intr_reg; - int qid, ena_qid; - int txc, rxc, i; - - if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) - return; - - ena_trace(ENA_DBG, "MSI-X TX/RX routine\n"); - - tx_ring = que->tx_ring; - rx_ring = que->rx_ring; - qid = que->id; - ena_qid = ENA_IO_TXQ_IDX(qid); - io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; - - tx_ring->first_interrupt = true; - rx_ring->first_interrupt = true; - - for (i = 0; i < CLEAN_BUDGET; ++i) { - rxc = ena_rx_cleanup(rx_ring); - txc = ena_tx_cleanup(tx_ring); - - if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) - return; - - if ((txc != TX_BUDGET) && (rxc != RX_BUDGET)) - break; - } - - /* Signal that work is done and unmask interrupt */ - ena_com_update_intr_reg(&intr_reg, - RX_IRQ_INTERVAL, - TX_IRQ_INTERVAL, - true); - ena_com_unmask_intr(io_cq, &intr_reg); -} - /** * ena_handle_msix - MSIX Interrupt Handler for Tx/Rx * @arg: queue @@ -2309,7 +1812,7 @@ ena_up_complete(struct ena_adapter *adapter) return (0); } -static int +int ena_up(struct ena_adapter *adapter) { int rc = 0; @@ -2370,8 +1873,14 @@ ena_up(struct ena_adapter *adapter) if_setdrvflagbits(adapter->ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE); - callout_reset_sbt(&adapter->timer_service, SBT_1S, SBT_1S, - ena_timer_service, (void *)adapter, 0); + /* Activate timer service only if the device is running. + * If this flag is not set, it means that the driver is being + * reset and timer service will be activated afterwards. + */ + if (ENA_FLAG_ISSET(ENA_FLAG_DEVICE_RUNNING, adapter)) { + callout_reset_sbt(&adapter->timer_service, SBT_1S, + SBT_1S, ena_timer_service, (void *)adapter, 0); + } ENA_FLAG_SET_ATOMIC(ENA_FLAG_DEV_UP, adapter); @@ -2680,7 +2189,7 @@ ena_setup_ifnet(device_t pdev, struct ena_adapter *ada return (0); } -static void +void ena_down(struct ena_adapter *adapter) { int rc; @@ -2715,579 +2224,7 @@ ena_down(struct ena_adapter *adapter) } } -static void -ena_tx_csum(struct ena_com_tx_ctx *ena_tx_ctx, struct mbuf *mbuf) -{ - struct ena_com_tx_meta *ena_meta; - struct ether_vlan_header *eh; - struct mbuf *mbuf_next; - u32 mss; - bool offload; - uint16_t etype; - int ehdrlen; - struct ip *ip; - int iphlen; - struct tcphdr *th; - int offset; - - offload = false; - ena_meta = &ena_tx_ctx->ena_meta; - mss = mbuf->m_pkthdr.tso_segsz; - - if (mss != 0) - offload = true; - - if ((mbuf->m_pkthdr.csum_flags & CSUM_TSO) != 0) - offload = true; - - if ((mbuf->m_pkthdr.csum_flags & CSUM_OFFLOAD) != 0) - offload = true; - - if (!offload) { - ena_tx_ctx->meta_valid = 0; - return; - } - - /* Determine where frame payload starts. */ - eh = mtod(mbuf, struct ether_vlan_header *); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sun Sep 6 14:41:36 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 128A33D3290; Sun, 6 Sep 2020 14:41:36 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BkvHg70zFz3yjd; Sun, 6 Sep 2020 14:41:35 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA755100B4; Sun, 6 Sep 2020 14:41:35 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086EfZjO049740; Sun, 6 Sep 2020 14:41:35 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086EfZbv049737; Sun, 6 Sep 2020 14:41:35 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202009061441.086EfZbv049737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sun, 6 Sep 2020 14:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365381 - in stable/12/sys: contrib/ena-com contrib/ena-com/ena_defs dev/ena X-SVN-Group: stable-12 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in stable/12/sys: contrib/ena-com contrib/ena-com/ena_defs dev/ena X-SVN-Commit-Revision: 365381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2020 14:41:36 -0000 Author: mw Date: Sun Sep 6 14:41:35 2020 New Revision: 365381 URL: https://svnweb.freebsd.org/changeset/base/365381 Log: MFC: Merge ENA v2.2.0 driver r361530 Update ENA driver version to v2.2.0 r361529 Refactor ena_tx_map_mbuf() function r361528 Fix double-free bug within ena_detach() r361527 Allow disabling meta caching for ENA Tx path r361526 Create ENA IO queues with optional backoff r361525 Add sysctl node for ENA IO queues number adjustment r361524 Fix assumptions about number of IO queues in the ENA r361523 Rework ENA Tx buffer ring size reconfiguration r361521 Rework ENA Rx queue size configuration r361518 Improve indentation in ena_up() and ena_down() r361517 Expose argument names for non static ENA driver functions r361516 Use single global lock in the ENA driver r361515 Add trigger reset function in the ENA driver r361514 Provide ENA driver version in a sysctl node r361513 Remove unused argument from static function in ena.c r361512 Enable Tx drops reporting in the ENA driver r361511 Adjust ENA driver to the new HAL r358289 Rework and simplify Tx DMA mapping in ENA Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: stable/12/sys/contrib/ena-com/ena_com.c stable/12/sys/contrib/ena-com/ena_com.h stable/12/sys/contrib/ena-com/ena_defs/ena_admin_defs.h stable/12/sys/contrib/ena-com/ena_defs/ena_common_defs.h stable/12/sys/contrib/ena-com/ena_defs/ena_eth_io_defs.h stable/12/sys/contrib/ena-com/ena_defs/ena_gen_info.h stable/12/sys/contrib/ena-com/ena_defs/ena_regs_defs.h stable/12/sys/contrib/ena-com/ena_eth_com.c stable/12/sys/contrib/ena-com/ena_eth_com.h stable/12/sys/contrib/ena-com/ena_plat.h stable/12/sys/dev/ena/ena.c stable/12/sys/dev/ena/ena.h stable/12/sys/dev/ena/ena_datapath.c stable/12/sys/dev/ena/ena_datapath.h stable/12/sys/dev/ena/ena_netmap.c stable/12/sys/dev/ena/ena_netmap.h stable/12/sys/dev/ena/ena_sysctl.c stable/12/sys/dev/ena/ena_sysctl.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/ena-com/ena_com.c ============================================================================== --- stable/12/sys/contrib/ena-com/ena_com.c Sun Sep 6 14:23:31 2020 (r365380) +++ stable/12/sys/contrib/ena-com/ena_com.c Sun Sep 6 14:41:35 2020 (r365381) @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -70,8 +70,10 @@ #define ENA_REGS_ADMIN_INTR_MASK 1 -#define ENA_POLL_MS 5 +#define ENA_MIN_POLL_US 100 +#define ENA_MAX_POLL_US 5000 + /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ @@ -99,7 +101,7 @@ struct ena_com_stats_ctx { struct ena_admin_acq_get_stats_resp get_resp; }; -static inline int ena_com_mem_addr_set(struct ena_com_dev *ena_dev, +static int ena_com_mem_addr_set(struct ena_com_dev *ena_dev, struct ena_common_mem_addr *ena_addr, dma_addr_t addr) { @@ -200,7 +202,7 @@ static int ena_com_admin_init_aenq(struct ena_com_dev return 0; } -static inline void comp_ctxt_release(struct ena_com_admin_queue *queue, +static void comp_ctxt_release(struct ena_com_admin_queue *queue, struct ena_comp_ctx *comp_ctx) { comp_ctx->occupied = false; @@ -216,6 +218,11 @@ static struct ena_comp_ctx *get_comp_ctxt(struct ena_c return NULL; } + if (unlikely(!queue->comp_ctx)) { + ena_trc_err("Completion context is NULL\n"); + return NULL; + } + if (unlikely(queue->comp_ctx[command_id].occupied && capture)) { ena_trc_err("Completion context is occupied\n"); return NULL; @@ -289,7 +296,7 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd return comp_ctx; } -static inline int ena_com_init_comp_ctxt(struct ena_com_admin_queue *queue) +static int ena_com_init_comp_ctxt(struct ena_com_admin_queue *queue) { size_t size = queue->q_depth * sizeof(struct ena_comp_ctx); struct ena_comp_ctx *comp_ctx; @@ -409,6 +416,8 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ 0x0, io_sq->llq_info.desc_list_entry_size); io_sq->llq_buf_ctrl.descs_left_in_line = io_sq->llq_info.descs_num_before_header; + io_sq->disable_meta_caching = + io_sq->llq_info.disable_meta_caching; if (io_sq->llq_info.max_entries_in_tx_burst > 0) io_sq->entries_in_tx_burst_left = @@ -534,12 +543,9 @@ static int ena_com_comp_status_to_errno(u8 comp_status if (unlikely(comp_status != 0)) ena_trc_err("admin command failed[%u]\n", comp_status); - if (unlikely(comp_status > ENA_ADMIN_UNKNOWN_ERROR)) - return ENA_COM_INVAL; - switch (comp_status) { case ENA_ADMIN_SUCCESS: - return 0; + return ENA_COM_OK; case ENA_ADMIN_RESOURCE_ALLOCATION_FAILURE: return ENA_COM_NO_MEM; case ENA_ADMIN_UNSUPPORTED_OPCODE: @@ -551,24 +557,32 @@ static int ena_com_comp_status_to_errno(u8 comp_status return ENA_COM_INVAL; } - return 0; + return ENA_COM_INVAL; } +static inline void ena_delay_exponential_backoff_us(u32 exp, u32 delay_us) +{ + delay_us = ENA_MAX32(ENA_MIN_POLL_US, delay_us); + delay_us = ENA_MIN32(delay_us * (1 << exp), ENA_MAX_POLL_US); + ENA_USLEEP(delay_us); +} + static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_ctx, struct ena_com_admin_queue *admin_queue) { unsigned long flags = 0; - unsigned long timeout; + ena_time_t timeout; int ret; + u32 exp = 0; timeout = ENA_GET_SYSTEM_TIMEOUT(admin_queue->completion_timeout); while (1) { - ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); - ena_com_handle_admin_completion(admin_queue); - ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); + ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); + ena_com_handle_admin_completion(admin_queue); + ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); - if (comp_ctx->status != ENA_CMD_SUBMITTED) + if (comp_ctx->status != ENA_CMD_SUBMITTED) break; if (ENA_TIME_EXPIRE(timeout)) { @@ -583,7 +597,7 @@ static int ena_com_wait_and_process_admin_cq_polling(s goto err; } - ENA_MSLEEP(ENA_POLL_MS); + ena_delay_exponential_backoff_us(exp++, admin_queue->ena_dev->ena_min_poll_delay_us); } if (unlikely(comp_ctx->status == ENA_CMD_ABORTED)) { @@ -629,6 +643,14 @@ static int ena_com_set_llq(struct ena_com_dev *ena_dev cmd.u.llq.desc_num_before_header_enabled = llq_info->descs_num_before_header; cmd.u.llq.descriptors_stride_ctrl_enabled = llq_info->desc_stride_ctrl; + if (llq_info->disable_meta_caching) + cmd.u.llq.accel_mode.u.set.enabled_flags |= + BIT(ENA_ADMIN_DISABLE_META_CACHING); + + if (llq_info->max_entries_in_tx_burst) + cmd.u.llq.accel_mode.u.set.enabled_flags |= + BIT(ENA_ADMIN_LIMIT_TX_BURST); + ret = ena_com_execute_admin_command(admin_queue, (struct ena_admin_aq_entry *)&cmd, sizeof(cmd), @@ -748,15 +770,21 @@ static int ena_com_config_llq_info(struct ena_com_dev supported_feat, llq_info->descs_num_before_header); } + /* Check for accelerated queue supported */ + llq_info->disable_meta_caching = + llq_features->accel_mode.u.get.supported_flags & + BIT(ENA_ADMIN_DISABLE_META_CACHING); - llq_info->max_entries_in_tx_burst = - (u16)(llq_features->max_tx_burst_size / llq_default_cfg->llq_ring_entry_size_value); + if (llq_features->accel_mode.u.get.supported_flags & BIT(ENA_ADMIN_LIMIT_TX_BURST)) + llq_info->max_entries_in_tx_burst = + llq_features->accel_mode.u.get.max_tx_burst_size / + llq_default_cfg->llq_ring_entry_size_value; rc = ena_com_set_llq(ena_dev); if (rc) ena_trc_err("Cannot set LLQ configuration: %d\n", rc); - return 0; + return rc; } static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *comp_ctx, @@ -779,16 +807,25 @@ static int ena_com_wait_and_process_admin_cq_interrupt admin_queue->stats.no_completion++; ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); - if (comp_ctx->status == ENA_CMD_COMPLETED) - ena_trc_err("The ena device have completion but the driver didn't receive any MSI-X interrupt (cmd %d)\n", - comp_ctx->cmd_opcode); - else - ena_trc_err("The ena device doesn't send any completion for the admin cmd %d status %d\n", + if (comp_ctx->status == ENA_CMD_COMPLETED) { + ena_trc_err("The ena device sent a completion but the driver didn't receive a MSI-X interrupt (cmd %d), autopolling mode is %s\n", + comp_ctx->cmd_opcode, admin_queue->auto_polling ? "ON" : "OFF"); + /* Check if fallback to polling is enabled */ + if (admin_queue->auto_polling) + admin_queue->polling = true; + } else { + ena_trc_err("The ena device didn't send a completion for the admin cmd %d status %d\n", comp_ctx->cmd_opcode, comp_ctx->status); - - admin_queue->running_state = false; - ret = ENA_COM_TIMER_EXPIRED; - goto err; + } + /* Check if shifted to polling mode. + * This will happen if there is a completion without an interrupt + * and autopolling mode is enabled. Continuing normal execution in such case + */ + if (!admin_queue->polling) { + admin_queue->running_state = false; + ret = ENA_COM_TIMER_EXPIRED; + goto err; + } } ret = ena_com_comp_status_to_errno(comp_ctx->comp_status); @@ -944,7 +981,9 @@ static void ena_com_io_queue_free(struct ena_com_dev * } if (io_sq->bounce_buf_ctrl.base_buffer) { - ENA_MEM_FREE(ena_dev->dmadev, io_sq->bounce_buf_ctrl.base_buffer); + ENA_MEM_FREE(ena_dev->dmadev, + io_sq->bounce_buf_ctrl.base_buffer, + (io_sq->llq_info.desc_list_entry_size * ENA_COM_BOUNCE_BUFFER_CNTRL_CNT)); io_sq->bounce_buf_ctrl.base_buffer = NULL; } } @@ -952,12 +991,13 @@ static void ena_com_io_queue_free(struct ena_com_dev * static int wait_for_reset_state(struct ena_com_dev *ena_dev, u32 timeout, u16 exp_state) { - u32 val, i; + u32 val, exp = 0; + ena_time_t timeout_stamp; - /* Convert timeout from resolution of 100ms to ENA_POLL_MS */ - timeout = (timeout * 100) / ENA_POLL_MS; + /* Convert timeout from resolution of 100ms to us resolution. */ + timeout_stamp = ENA_GET_SYSTEM_TIMEOUT(100 * 1000 * timeout); - for (i = 0; i < timeout; i++) { + while (1) { val = ena_com_reg_bar_read32(ena_dev, ENA_REGS_DEV_STS_OFF); if (unlikely(val == ENA_MMIO_READ_TIMEOUT)) { @@ -969,10 +1009,11 @@ static int wait_for_reset_state(struct ena_com_dev *en exp_state) return 0; - ENA_MSLEEP(ENA_POLL_MS); - } + if (ENA_TIME_EXPIRE(timeout_stamp)) + return ENA_COM_TIMER_EXPIRED; - return ENA_COM_TIMER_EXPIRED; + ena_delay_exponential_backoff_us(exp++, ena_dev->ena_min_poll_delay_us); + } } static bool ena_com_check_supported_feature_id(struct ena_com_dev *ena_dev, @@ -1055,10 +1096,34 @@ static int ena_com_get_feature(struct ena_com_dev *ena feature_ver); } +int ena_com_get_current_hash_function(struct ena_com_dev *ena_dev) +{ + return ena_dev->rss.hash_func; +} + +static void ena_com_hash_key_fill_default_key(struct ena_com_dev *ena_dev) +{ + struct ena_admin_feature_rss_flow_hash_control *hash_key = + (ena_dev->rss).hash_key; + + ENA_RSS_FILL_KEY(&hash_key->key, sizeof(hash_key->key)); + /* The key buffer is stored in the device in an array of + * uint32 elements. Therefore the number of elements can be derived + * by dividing the buffer length by the size of each array element. + * In current implementation each element is sized at uint32_t + * so it's actually a division by 4 but if the element size changes, + * there is no need to rewrite this code. + */ + hash_key->keys_num = sizeof(hash_key->key) / sizeof(hash_key->key[0]); +} + static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev) { struct ena_rss *rss = &ena_dev->rss; + if (!ena_com_check_supported_feature_id(ena_dev, ENA_ADMIN_RSS_HASH_FUNCTION)) + return ENA_COM_UNSUPPORTED; + ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev, sizeof(*rss->hash_key), rss->hash_key, @@ -1186,7 +1251,9 @@ static void ena_com_indirect_table_destroy(struct ena_ rss->rss_ind_tbl = NULL; if (rss->host_rss_ind_tbl) - ENA_MEM_FREE(ena_dev->dmadev, rss->host_rss_ind_tbl); + ENA_MEM_FREE(ena_dev->dmadev, + rss->host_rss_ind_tbl, + ((1ULL << rss->tbl_log_size) * sizeof(u16))); rss->host_rss_ind_tbl = NULL; } @@ -1287,63 +1354,29 @@ static int ena_com_ind_tbl_convert_to_device(struct en return 0; } -static int ena_com_ind_tbl_convert_from_device(struct ena_com_dev *ena_dev) -{ - u16 dev_idx_to_host_tbl[ENA_TOTAL_NUM_QUEUES] = { (u16)-1 }; - struct ena_rss *rss = &ena_dev->rss; - u8 idx; - u16 i; - - for (i = 0; i < ENA_TOTAL_NUM_QUEUES; i++) - dev_idx_to_host_tbl[ena_dev->io_sq_queues[i].idx] = i; - - for (i = 0; i < 1 << rss->tbl_log_size; i++) { - if (rss->rss_ind_tbl[i].cq_idx > ENA_TOTAL_NUM_QUEUES) - return ENA_COM_INVAL; - idx = (u8)rss->rss_ind_tbl[i].cq_idx; - - if (dev_idx_to_host_tbl[idx] > ENA_TOTAL_NUM_QUEUES) - return ENA_COM_INVAL; - - rss->host_rss_ind_tbl[i] = dev_idx_to_host_tbl[idx]; - } - - return 0; -} - -static int ena_com_init_interrupt_moderation_table(struct ena_com_dev *ena_dev) -{ - size_t size; - - size = sizeof(struct ena_intr_moder_entry) * ENA_INTR_MAX_NUM_OF_LEVELS; - - ena_dev->intr_moder_tbl = ENA_MEM_ALLOC(ena_dev->dmadev, size); - if (!ena_dev->intr_moder_tbl) - return ENA_COM_NO_MEM; - - ena_com_config_default_interrupt_moderation_table(ena_dev); - - return 0; -} - static void ena_com_update_intr_delay_resolution(struct ena_com_dev *ena_dev, u16 intr_delay_resolution) { - struct ena_intr_moder_entry *intr_moder_tbl = ena_dev->intr_moder_tbl; - unsigned int i; + u16 prev_intr_delay_resolution = ena_dev->intr_delay_resolution; - if (!intr_delay_resolution) { + if (unlikely(!intr_delay_resolution)) { ena_trc_err("Illegal intr_delay_resolution provided. Going to use default 1 usec resolution\n"); - intr_delay_resolution = 1; + intr_delay_resolution = ENA_DEFAULT_INTR_DELAY_RESOLUTION; } - ena_dev->intr_delay_resolution = intr_delay_resolution; /* update Rx */ - for (i = 0; i < ENA_INTR_MAX_NUM_OF_LEVELS; i++) - intr_moder_tbl[i].intr_moder_interval /= intr_delay_resolution; + ena_dev->intr_moder_rx_interval = + ena_dev->intr_moder_rx_interval * + prev_intr_delay_resolution / + intr_delay_resolution; /* update Tx */ - ena_dev->intr_moder_tx_interval /= intr_delay_resolution; + ena_dev->intr_moder_tx_interval = + ena_dev->intr_moder_tx_interval * + prev_intr_delay_resolution / + intr_delay_resolution; + + ena_dev->intr_delay_resolution = intr_delay_resolution; } /*****************************************************************************/ @@ -1482,11 +1515,12 @@ void ena_com_wait_for_abort_completion(struct ena_com_ { struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue; unsigned long flags = 0; + u32 exp = 0; ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); while (ATOMIC32_READ(&admin_queue->outstanding_cmds) != 0) { ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); - ENA_MSLEEP(ENA_POLL_MS); + ena_delay_exponential_backoff_us(exp++, ena_dev->ena_min_poll_delay_us); ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); } ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); @@ -1667,7 +1701,9 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev ENA_WAIT_EVENT_DESTROY(admin_queue->comp_ctx->wait_event); if (admin_queue->comp_ctx) - ENA_MEM_FREE(ena_dev->dmadev, admin_queue->comp_ctx); + ENA_MEM_FREE(ena_dev->dmadev, + admin_queue->comp_ctx, + (admin_queue->q_depth * sizeof(struct ena_comp_ctx))); admin_queue->comp_ctx = NULL; size = ADMIN_SQ_SIZE(admin_queue->q_depth); if (sq->entries) @@ -1701,6 +1737,17 @@ void ena_com_set_admin_polling_mode(struct ena_com_dev ena_dev->admin_queue.polling = polling; } +bool ena_com_get_admin_polling_mode(struct ena_com_dev *ena_dev) +{ + return ena_dev->admin_queue.polling; +} + +void ena_com_set_admin_auto_polling_mode(struct ena_com_dev *ena_dev, + bool polling) +{ + ena_dev->admin_queue.auto_polling = polling; +} + int ena_com_mmio_reg_read_request_init(struct ena_com_dev *ena_dev) { struct ena_com_mmio_read *mmio_read = &ena_dev->mmio_read; @@ -1838,6 +1885,7 @@ int ena_com_admin_init(struct ena_com_dev *ena_dev, if (ret) goto error; + admin_queue->ena_dev = ena_dev; admin_queue->running_state = true; return 0; @@ -1934,62 +1982,6 @@ int ena_com_get_link_params(struct ena_com_dev *ena_de return ena_com_get_feature(ena_dev, resp, ENA_ADMIN_LINK_CONFIG, 0); } -int ena_com_extra_properties_strings_init(struct ena_com_dev *ena_dev) -{ - struct ena_admin_get_feat_resp resp; - struct ena_extra_properties_strings *extra_properties_strings = - &ena_dev->extra_properties_strings; - u32 rc; - extra_properties_strings->size = ENA_ADMIN_EXTRA_PROPERTIES_COUNT * - ENA_ADMIN_EXTRA_PROPERTIES_STRING_LEN; - - ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev, - extra_properties_strings->size, - extra_properties_strings->virt_addr, - extra_properties_strings->dma_addr, - extra_properties_strings->dma_handle); - if (unlikely(!extra_properties_strings->virt_addr)) { - ena_trc_err("Failed to allocate extra properties strings\n"); - return 0; - } - - rc = ena_com_get_feature_ex(ena_dev, &resp, - ENA_ADMIN_EXTRA_PROPERTIES_STRINGS, - extra_properties_strings->dma_addr, - extra_properties_strings->size, 0); - if (rc) { - ena_trc_dbg("Failed to get extra properties strings\n"); - goto err; - } - - return resp.u.extra_properties_strings.count; -err: - ena_com_delete_extra_properties_strings(ena_dev); - return 0; -} - -void ena_com_delete_extra_properties_strings(struct ena_com_dev *ena_dev) -{ - struct ena_extra_properties_strings *extra_properties_strings = - &ena_dev->extra_properties_strings; - - if (extra_properties_strings->virt_addr) { - ENA_MEM_FREE_COHERENT(ena_dev->dmadev, - extra_properties_strings->size, - extra_properties_strings->virt_addr, - extra_properties_strings->dma_addr, - extra_properties_strings->dma_handle); - extra_properties_strings->virt_addr = NULL; - } -} - -int ena_com_get_extra_properties_flags(struct ena_com_dev *ena_dev, - struct ena_admin_get_feat_resp *resp) -{ - return ena_com_get_feature(ena_dev, resp, - ENA_ADMIN_EXTRA_PROPERTIES_FLAGS, 0); -} - int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev, struct ena_com_dev_get_features_ctx *get_feat_ctx) { @@ -2111,7 +2103,7 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev struct ena_admin_aenq_entry *aenq_e; struct ena_admin_aenq_common_desc *aenq_common; struct ena_com_aenq *aenq = &dev->aenq; - unsigned long long timestamp; + u64 timestamp; ena_aenq_handler handler_cb; u16 masked_head, processed = 0; u8 phase; @@ -2129,9 +2121,9 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev */ dma_rmb(); - timestamp = (unsigned long long)aenq_common->timestamp_low | - ((unsigned long long)aenq_common->timestamp_high << 32); - ena_trc_dbg("AENQ! Group[%x] Syndrom[%x] timestamp: [%llus]\n", + timestamp = (u64)aenq_common->timestamp_low | + ((u64)aenq_common->timestamp_high << 32); + ena_trc_dbg("AENQ! Group[%x] Syndrom[%x] timestamp: [%" ENA_PRIu64 "s]\n", aenq_common->group, aenq_common->syndrom, timestamp); @@ -2452,12 +2444,14 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena enum ena_admin_hash_functions func, const u8 *key, u16 key_len, u32 init_val) { - struct ena_rss *rss = &ena_dev->rss; + struct ena_admin_feature_rss_flow_hash_control *hash_key; struct ena_admin_get_feat_resp get_resp; - struct ena_admin_feature_rss_flow_hash_control *hash_key = - rss->hash_key; + enum ena_admin_hash_functions old_func; + struct ena_rss *rss = &ena_dev->rss; int rc; + hash_key = rss->hash_key; + /* Make sure size is a mult of DWs */ if (unlikely(key_len & 0x3)) return ENA_COM_INVAL; @@ -2469,22 +2463,23 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena if (unlikely(rc)) return rc; - if (!((1 << func) & get_resp.u.flow_hash_func.supported_func)) { + if (!(BIT(func) & get_resp.u.flow_hash_func.supported_func)) { ena_trc_err("Flow hash function %d isn't supported\n", func); return ENA_COM_UNSUPPORTED; } switch (func) { case ENA_ADMIN_TOEPLITZ: - if (key_len > sizeof(hash_key->key)) { - ena_trc_err("key len (%hu) is bigger than the max supported (%zu)\n", - key_len, sizeof(hash_key->key)); - return ENA_COM_INVAL; + if (key) { + if (key_len != sizeof(hash_key->key)) { + ena_trc_err("key len (%hu) doesn't equal the supported size (%zu)\n", + key_len, sizeof(hash_key->key)); + return ENA_COM_INVAL; + } + memcpy(hash_key->key, key, key_len); + rss->hash_init_val = init_val; + hash_key->keys_num = key_len / sizeof(hash_key->key[0]); } - - memcpy(hash_key->key, key, key_len); - rss->hash_init_val = init_val; - hash_key->keys_num = key_len >> 2; break; case ENA_ADMIN_CRC32: rss->hash_init_val = init_val; @@ -2494,26 +2489,27 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena return ENA_COM_INVAL; } + old_func = rss->hash_func; rss->hash_func = func; rc = ena_com_set_hash_function(ena_dev); /* Restore the old function */ if (unlikely(rc)) - ena_com_get_hash_function(ena_dev, NULL, NULL); + rss->hash_func = old_func; return rc; } int ena_com_get_hash_function(struct ena_com_dev *ena_dev, - enum ena_admin_hash_functions *func, - u8 *key) + enum ena_admin_hash_functions *func) { struct ena_rss *rss = &ena_dev->rss; struct ena_admin_get_feat_resp get_resp; - struct ena_admin_feature_rss_flow_hash_control *hash_key = - rss->hash_key; int rc; + if (unlikely(!func)) + return ENA_COM_INVAL; + rc = ena_com_get_feature_ex(ena_dev, &get_resp, ENA_ADMIN_RSS_HASH_FUNCTION, rss->hash_key_dma_addr, @@ -2521,10 +2517,21 @@ int ena_com_get_hash_function(struct ena_com_dev *ena_ if (unlikely(rc)) return rc; - rss->hash_func = get_resp.u.flow_hash_func.selected_func; - if (func) - *func = rss->hash_func; + /* ENA_FFS() returns 1 in case the lsb is set */ + rss->hash_func = ENA_FFS(get_resp.u.flow_hash_func.selected_func); + if (rss->hash_func) + rss->hash_func--; + *func = rss->hash_func; + + return 0; +} + +int ena_com_get_hash_key(struct ena_com_dev *ena_dev, u8 *key) +{ + struct ena_admin_feature_rss_flow_hash_control *hash_key = + ena_dev->rss.hash_key; + if (key) memcpy(key, hash_key->key, (size_t)(hash_key->keys_num) << 2); @@ -2785,10 +2792,6 @@ int ena_com_indirect_table_get(struct ena_com_dev *ena if (!ind_tbl) return 0; - rc = ena_com_ind_tbl_convert_from_device(ena_dev); - if (unlikely(rc)) - return rc; - for (i = 0; i < (1 << rss->tbl_log_size); i++) ind_tbl[i] = rss->host_rss_ind_tbl[i]; @@ -2805,8 +2808,14 @@ int ena_com_rss_init(struct ena_com_dev *ena_dev, u16 if (unlikely(rc)) goto err_indr_tbl; + /* The following function might return unsupported in case the + * device doesn't support setting the key / hash function. We can safely + * ignore this error and have indirection table support only. + */ rc = ena_com_hash_key_allocate(ena_dev); - if (unlikely(rc)) + if (likely(!rc)) + ena_com_hash_key_fill_default_key(ena_dev); + else if (rc != ENA_COM_UNSUPPORTED) goto err_hash_key; rc = ena_com_hash_ctrl_init(ena_dev); @@ -2956,42 +2965,35 @@ bool ena_com_interrupt_moderation_supported(struct ena ENA_ADMIN_INTERRUPT_MODERATION); } -int ena_com_update_nonadaptive_moderation_interval_tx(struct ena_com_dev *ena_dev, - u32 tx_coalesce_usecs) +static int ena_com_update_nonadaptive_moderation_interval(u32 coalesce_usecs, + u32 intr_delay_resolution, + u32 *intr_moder_interval) { - if (!ena_dev->intr_delay_resolution) { + if (!intr_delay_resolution) { ena_trc_err("Illegal interrupt delay granularity value\n"); return ENA_COM_FAULT; } - ena_dev->intr_moder_tx_interval = tx_coalesce_usecs / - ena_dev->intr_delay_resolution; + *intr_moder_interval = coalesce_usecs / intr_delay_resolution; return 0; } -int ena_com_update_nonadaptive_moderation_interval_rx(struct ena_com_dev *ena_dev, - u32 rx_coalesce_usecs) -{ - if (!ena_dev->intr_delay_resolution) { - ena_trc_err("Illegal interrupt delay granularity value\n"); - return ENA_COM_FAULT; - } - /* We use LOWEST entry of moderation table for storing - * nonadaptive interrupt coalescing values - */ - ena_dev->intr_moder_tbl[ENA_INTR_MODER_LOWEST].intr_moder_interval = - rx_coalesce_usecs / ena_dev->intr_delay_resolution; - - return 0; +int ena_com_update_nonadaptive_moderation_interval_tx(struct ena_com_dev *ena_dev, + u32 tx_coalesce_usecs) +{ + return ena_com_update_nonadaptive_moderation_interval(tx_coalesce_usecs, + ena_dev->intr_delay_resolution, + &ena_dev->intr_moder_tx_interval); } -void ena_com_destroy_interrupt_moderation(struct ena_com_dev *ena_dev) +int ena_com_update_nonadaptive_moderation_interval_rx(struct ena_com_dev *ena_dev, + u32 rx_coalesce_usecs) { - if (ena_dev->intr_moder_tbl) - ENA_MEM_FREE(ena_dev->dmadev, ena_dev->intr_moder_tbl); - ena_dev->intr_moder_tbl = NULL; + return ena_com_update_nonadaptive_moderation_interval(rx_coalesce_usecs, + ena_dev->intr_delay_resolution, + &ena_dev->intr_moder_rx_interval); } int ena_com_init_interrupt_moderation(struct ena_com_dev *ena_dev) @@ -3018,64 +3020,16 @@ int ena_com_init_interrupt_moderation(struct ena_com_d return rc; } - rc = ena_com_init_interrupt_moderation_table(ena_dev); - if (rc) - goto err; - /* if moderation is supported by device we set adaptive moderation */ delay_resolution = get_resp.u.intr_moderation.intr_delay_resolution; ena_com_update_intr_delay_resolution(ena_dev, delay_resolution); - ena_com_enable_adaptive_moderation(ena_dev); + /* Disable adaptive moderation by default - can be enabled later */ + ena_com_disable_adaptive_moderation(ena_dev); + return 0; -err: - ena_com_destroy_interrupt_moderation(ena_dev); - return rc; } -void ena_com_config_default_interrupt_moderation_table(struct ena_com_dev *ena_dev) -{ - struct ena_intr_moder_entry *intr_moder_tbl = ena_dev->intr_moder_tbl; - - if (!intr_moder_tbl) - return; - - intr_moder_tbl[ENA_INTR_MODER_LOWEST].intr_moder_interval = - ENA_INTR_LOWEST_USECS; - intr_moder_tbl[ENA_INTR_MODER_LOWEST].pkts_per_interval = - ENA_INTR_LOWEST_PKTS; - intr_moder_tbl[ENA_INTR_MODER_LOWEST].bytes_per_interval = - ENA_INTR_LOWEST_BYTES; - - intr_moder_tbl[ENA_INTR_MODER_LOW].intr_moder_interval = - ENA_INTR_LOW_USECS; - intr_moder_tbl[ENA_INTR_MODER_LOW].pkts_per_interval = - ENA_INTR_LOW_PKTS; - intr_moder_tbl[ENA_INTR_MODER_LOW].bytes_per_interval = - ENA_INTR_LOW_BYTES; - - intr_moder_tbl[ENA_INTR_MODER_MID].intr_moder_interval = - ENA_INTR_MID_USECS; - intr_moder_tbl[ENA_INTR_MODER_MID].pkts_per_interval = - ENA_INTR_MID_PKTS; - intr_moder_tbl[ENA_INTR_MODER_MID].bytes_per_interval = - ENA_INTR_MID_BYTES; - - intr_moder_tbl[ENA_INTR_MODER_HIGH].intr_moder_interval = - ENA_INTR_HIGH_USECS; - intr_moder_tbl[ENA_INTR_MODER_HIGH].pkts_per_interval = - ENA_INTR_HIGH_PKTS; - intr_moder_tbl[ENA_INTR_MODER_HIGH].bytes_per_interval = - ENA_INTR_HIGH_BYTES; - - intr_moder_tbl[ENA_INTR_MODER_HIGHEST].intr_moder_interval = - ENA_INTR_HIGHEST_USECS; - intr_moder_tbl[ENA_INTR_MODER_HIGHEST].pkts_per_interval = - ENA_INTR_HIGHEST_PKTS; - intr_moder_tbl[ENA_INTR_MODER_HIGHEST].bytes_per_interval = - ENA_INTR_HIGHEST_BYTES; -} - unsigned int ena_com_get_nonadaptive_moderation_interval_tx(struct ena_com_dev *ena_dev) { return ena_dev->intr_moder_tx_interval; @@ -3083,57 +3037,15 @@ unsigned int ena_com_get_nonadaptive_moderation_interv unsigned int ena_com_get_nonadaptive_moderation_interval_rx(struct ena_com_dev *ena_dev) { - struct ena_intr_moder_entry *intr_moder_tbl = ena_dev->intr_moder_tbl; - - if (intr_moder_tbl) - return intr_moder_tbl[ENA_INTR_MODER_LOWEST].intr_moder_interval; - - return 0; + return ena_dev->intr_moder_rx_interval; } -void ena_com_init_intr_moderation_entry(struct ena_com_dev *ena_dev, - enum ena_intr_moder_level level, - struct ena_intr_moder_entry *entry) -{ - struct ena_intr_moder_entry *intr_moder_tbl = ena_dev->intr_moder_tbl; - - if (level >= ENA_INTR_MAX_NUM_OF_LEVELS) - return; - - intr_moder_tbl[level].intr_moder_interval = entry->intr_moder_interval; - if (ena_dev->intr_delay_resolution) - intr_moder_tbl[level].intr_moder_interval /= - ena_dev->intr_delay_resolution; - intr_moder_tbl[level].pkts_per_interval = entry->pkts_per_interval; - - /* use hardcoded value until ethtool supports bytecount parameter */ - if (entry->bytes_per_interval != ENA_INTR_BYTE_COUNT_NOT_SUPPORTED) - intr_moder_tbl[level].bytes_per_interval = entry->bytes_per_interval; -} - -void ena_com_get_intr_moderation_entry(struct ena_com_dev *ena_dev, - enum ena_intr_moder_level level, - struct ena_intr_moder_entry *entry) -{ - struct ena_intr_moder_entry *intr_moder_tbl = ena_dev->intr_moder_tbl; - - if (level >= ENA_INTR_MAX_NUM_OF_LEVELS) - return; - - entry->intr_moder_interval = intr_moder_tbl[level].intr_moder_interval; - if (ena_dev->intr_delay_resolution) - entry->intr_moder_interval *= ena_dev->intr_delay_resolution; - entry->pkts_per_interval = - intr_moder_tbl[level].pkts_per_interval; - entry->bytes_per_interval = intr_moder_tbl[level].bytes_per_interval; -} - int ena_com_config_dev_mode(struct ena_com_dev *ena_dev, struct ena_admin_feature_llq_desc *llq_features, struct ena_llq_configurations *llq_default_cfg) { + struct ena_com_llq_info *llq_info = &ena_dev->llq_info; int rc; - int size; if (!llq_features->max_llq_num) { ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; @@ -3144,14 +3056,12 @@ int ena_com_config_dev_mode(struct ena_com_dev *ena_de if (rc) return rc; - /* Validate the descriptor is not too big */ - size = ena_dev->tx_max_header_size; - size += ena_dev->llq_info.descs_num_before_header * - sizeof(struct ena_eth_io_tx_desc); + ena_dev->tx_max_header_size = llq_info->desc_list_entry_size - + (llq_info->descs_num_before_header * sizeof(struct ena_eth_io_tx_desc)); - if (unlikely(ena_dev->llq_info.desc_list_entry_size < size)) { + if (unlikely(ena_dev->tx_max_header_size == 0)) { ena_trc_err("the size of the LLQ entry is smaller than needed\n"); - return ENA_COM_INVAL; + return -EINVAL; } ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_DEV; Modified: stable/12/sys/contrib/ena-com/ena_com.h ============================================================================== --- stable/12/sys/contrib/ena-com/ena_com.h Sun Sep 6 14:23:31 2020 (r365380) +++ stable/12/sys/contrib/ena-com/ena_com.h Sun Sep 6 14:41:35 2020 (r365381) @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,9 +36,9 @@ #include "ena_plat.h" -#define ENA_MAX_NUM_IO_QUEUES 128U +#define ENA_MAX_NUM_IO_QUEUES 128U /* We need to queues for each IO (on for Tx and one for Rx) */ -#define ENA_TOTAL_NUM_QUEUES (2 * (ENA_MAX_NUM_IO_QUEUES)) +#define ENA_TOTAL_NUM_QUEUES (2 * (ENA_MAX_NUM_IO_QUEUES)) #define ENA_MAX_HANDLERS 256 @@ -55,46 +55,16 @@ /*****************************************************************************/ /* ENA adaptive interrupt moderation settings */ -#define ENA_INTR_LOWEST_USECS (0) -#define ENA_INTR_LOWEST_PKTS (3) -#define ENA_INTR_LOWEST_BYTES (2 * 1524) +#define ENA_INTR_INITIAL_TX_INTERVAL_USECS ENA_INTR_INITIAL_TX_INTERVAL_USECS_PLAT +#define ENA_INTR_INITIAL_RX_INTERVAL_USECS 0 +#define ENA_DEFAULT_INTR_DELAY_RESOLUTION 1 -#define ENA_INTR_LOW_USECS (32) -#define ENA_INTR_LOW_PKTS (12) -#define ENA_INTR_LOW_BYTES (16 * 1024) +#define ENA_HASH_KEY_SIZE 40 -#define ENA_INTR_MID_USECS (80) -#define ENA_INTR_MID_PKTS (48) -#define ENA_INTR_MID_BYTES (64 * 1024) +#define ENA_HW_HINTS_NO_TIMEOUT 0xFFFF -#define ENA_INTR_HIGH_USECS (128) -#define ENA_INTR_HIGH_PKTS (96) -#define ENA_INTR_HIGH_BYTES (128 * 1024) +#define ENA_FEATURE_MAX_QUEUE_EXT_VER 1 -#define ENA_INTR_HIGHEST_USECS (192) -#define ENA_INTR_HIGHEST_PKTS (128) -#define ENA_INTR_HIGHEST_BYTES (192 * 1024) - -#define ENA_INTR_INITIAL_TX_INTERVAL_USECS 196 -#define ENA_INTR_INITIAL_RX_INTERVAL_USECS 4 -#define ENA_INTR_DELAY_OLD_VALUE_WEIGHT 6 -#define ENA_INTR_DELAY_NEW_VALUE_WEIGHT 4 -#define ENA_INTR_MODER_LEVEL_STRIDE 1 -#define ENA_INTR_BYTE_COUNT_NOT_SUPPORTED 0xFFFFFF - -#define ENA_HW_HINTS_NO_TIMEOUT 0xFFFF - -#define ENA_FEATURE_MAX_QUEUE_EXT_VER 1 - -enum ena_intr_moder_level { - ENA_INTR_MODER_LOWEST = 0, - ENA_INTR_MODER_LOW, - ENA_INTR_MODER_MID, - ENA_INTR_MODER_HIGH, - ENA_INTR_MODER_HIGHEST, - ENA_INTR_MAX_NUM_OF_LEVELS, -}; - struct ena_llq_configurations { enum ena_admin_llq_header_location llq_header_location; enum ena_admin_llq_ring_entry_size llq_ring_entry_size; @@ -103,12 +73,6 @@ struct ena_llq_configurations { u16 llq_ring_entry_size_value; }; -struct ena_intr_moder_entry { - unsigned int intr_moder_interval; - unsigned int pkts_per_interval; - unsigned int bytes_per_interval; -}; - enum queue_direction { ENA_COM_IO_QUEUE_DIRECTION_TX, ENA_COM_IO_QUEUE_DIRECTION_RX @@ -146,6 +110,7 @@ struct ena_com_llq_info { u16 descs_num_before_header; u16 descs_per_entry; u16 max_entries_in_tx_burst; + bool disable_meta_caching; }; struct ena_com_io_cq { @@ -210,6 +175,8 @@ struct ena_com_io_sq { enum queue_direction direction; enum ena_admin_placement_policy_type mem_queue_type; + bool disable_meta_caching; + u32 msix_vector; struct ena_com_tx_meta cached_tx_meta; struct ena_com_llq_info llq_info; @@ -253,16 +220,17 @@ struct ena_com_admin_sq { }; struct ena_com_stats_admin { - u32 aborted_cmd; - u32 submitted_cmd; - u32 completed_cmd; - u32 out_of_space; - u32 no_completion; + u64 aborted_cmd; + u64 submitted_cmd; + u64 completed_cmd; + u64 out_of_space; + u64 no_completion; }; struct ena_com_admin_queue { void *q_dmadev; void *bus; + struct ena_com_dev *ena_dev; ena_spinlock_t q_lock; /* spinlock for the admin queue */ struct ena_comp_ctx *comp_ctx; @@ -274,6 +242,9 @@ struct ena_com_admin_queue { /* Indicate if the admin queue should poll for completion */ bool polling; + /* Define if fallback to polling mode should occur */ + bool auto_polling; + u16 curr_cmd_id; /* Indicate that the ena was initialized and can @@ -345,13 +316,6 @@ struct ena_host_attribute { ena_mem_handle_t host_info_dma_handle; }; -struct ena_extra_properties_strings { - u8 *virt_addr; - dma_addr_t dma_addr; - ena_mem_handle_t dma_handle; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sun Sep 6 17:40:37 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D15E3D86CD; Sun, 6 Sep 2020 17:40:37 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BkzGD6dyVz4Gdf; Sun, 6 Sep 2020 17:40:36 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C72B512481; Sun, 6 Sep 2020 17:40:36 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086HeaXH061902; Sun, 6 Sep 2020 17:40:36 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086HeZDQ061127; Sun, 6 Sep 2020 17:40:35 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202009061740.086HeZDQ061127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 6 Sep 2020 17:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365383 - in stable/12: share/man/man9 sys/compat/linuxkpi/common/include/linux sys/kern sys/sys sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in stable/12: share/man/man9 sys/compat/linuxkpi/common/include/linux sys/kern sys/sys sys/vm X-SVN-Commit-Revision: 365383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2020 17:40:37 -0000 Author: wulf Date: Sun Sep 6 17:40:35 2020 New Revision: 365383 URL: https://svnweb.freebsd.org/changeset/base/365383 Log: MFC r364964: LinuxKPI: Implement ksize() function. In Linux, ksize() gets the actual amount of memory allocated for a given object. This commit adds malloc_usable_size() to FreeBSD KPI which does the same. It also maps LinuxKPI ksize() to newly created function. ksize() function is used by drm-kmod. Reviewed by: hselasky, kib Differential Revision: https://reviews.freebsd.org/D26215 Modified: stable/12/share/man/man9/malloc.9 stable/12/sys/compat/linuxkpi/common/include/linux/slab.h stable/12/sys/kern/kern_malloc.c stable/12/sys/sys/malloc.h stable/12/sys/vm/memguard.c stable/12/sys/vm/memguard.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/malloc.9 ============================================================================== --- stable/12/share/man/man9/malloc.9 Sun Sep 6 15:44:09 2020 (r365382) +++ stable/12/share/man/man9/malloc.9 Sun Sep 6 17:40:35 2020 (r365383) @@ -29,7 +29,7 @@ .\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $ .\" $FreeBSD$ .\" -.Dd October 30, 2018 +.Dd August 28, 2020 .Dt MALLOC 9 .Os .Sh NAME @@ -53,6 +53,8 @@ .Fn realloc "void *addr" "size_t size" "struct malloc_type *type" "int flags" .Ft void * .Fn reallocf "void *addr" "size_t size" "struct malloc_type *type" "int flags" +.Ft size_t +.Fn malloc_usable_size "const void *addr" .Fn MALLOC_DECLARE type .In sys/param.h .In sys/malloc.h @@ -138,6 +140,13 @@ function is identical to .Fn realloc except that it will free the passed pointer when the requested memory cannot be allocated. +.Pp +The +.Fn malloc_usable_size +function returns the usable size of the allocation pointed to by +.Fa addr . +The return value may be larger than the size that was requested during +allocation. .Pp Unlike its standard C library counterpart .Pq Xr malloc 3 , Modified: stable/12/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/slab.h Sun Sep 6 15:44:09 2020 (r365382) +++ stable/12/sys/compat/linuxkpi/common/include/linux/slab.h Sun Sep 6 17:40:35 2020 (r365383) @@ -154,6 +154,12 @@ kfree(const void *ptr) free(__DECONST(void *, ptr), M_KMALLOC); } +static inline size_t +ksize(const void *ptr) +{ + return (malloc_usable_size(ptr)); +} + extern struct linux_kmem_cache *linux_kmem_cache_create(const char *name, size_t size, size_t align, unsigned flags, linux_kmem_ctor_t *ctor); Modified: stable/12/sys/kern/kern_malloc.c ============================================================================== --- stable/12/sys/kern/kern_malloc.c Sun Sep 6 15:44:09 2020 (r365382) +++ stable/12/sys/kern/kern_malloc.c Sun Sep 6 17:40:35 2020 (r365383) @@ -867,6 +867,41 @@ reallocf(void *addr, size_t size, struct malloc_type * return (mem); } +/* + * malloc_usable_size: returns the usable size of the allocation. + */ +size_t +malloc_usable_size(const void *addr) +{ +#ifndef DEBUG_REDZONE + uma_slab_t slab; +#endif + u_long size; + + if (addr == NULL) + return (0); + +#ifdef DEBUG_MEMGUARD + if (is_memguard_addr(__DECONST(void *, addr))) + return (memguard_get_req_size(addr)); +#endif + +#ifdef DEBUG_REDZONE + size = redzone_get_size(__DECONST(void *, addr)); +#else + slab = vtoslab((vm_offset_t)addr & (~UMA_SLAB_MASK)); + if (slab == NULL) + panic("malloc_usable_size: address %p(%p) is not allocated.\n", + addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); + + if (!(slab->us_flags & UMA_SLAB_MALLOC)) + size = slab->us_keg->uk_size; + else + size = slab->us_size; +#endif + return (size); +} + #ifndef __sparc64__ CTASSERT(VM_KMEM_SIZE_SCALE >= 1); #endif Modified: stable/12/sys/sys/malloc.h ============================================================================== --- stable/12/sys/sys/malloc.h Sun Sep 6 15:44:09 2020 (r365382) +++ stable/12/sys/sys/malloc.h Sun Sep 6 17:40:35 2020 (r365383) @@ -244,6 +244,7 @@ void malloc_type_allocated(struct malloc_type *type, u void malloc_type_freed(struct malloc_type *type, unsigned long size); void malloc_type_list(malloc_type_list_func_t *, void *); void malloc_uninit(void *); +size_t malloc_usable_size(const void *); void *realloc(void *addr, size_t size, struct malloc_type *type, int flags) __result_use_check __alloc_size(2); void *reallocf(void *addr, size_t size, struct malloc_type *type, int flags) Modified: stable/12/sys/vm/memguard.c ============================================================================== --- stable/12/sys/vm/memguard.c Sun Sep 6 15:44:09 2020 (r365382) +++ stable/12/sys/vm/memguard.c Sun Sep 6 17:40:35 2020 (r365383) @@ -503,3 +503,9 @@ memguard_cmp_zone(uma_zone_t zone) */ return (strcmp(zone->uz_name, vm_memguard_desc) == 0); } + +unsigned long +memguard_get_req_size(const void *addr) +{ + return (*v2sizep(trunc_page((uintptr_t)addr))); +} Modified: stable/12/sys/vm/memguard.h ============================================================================== --- stable/12/sys/vm/memguard.h Sun Sep 6 15:44:09 2020 (r365382) +++ stable/12/sys/vm/memguard.h Sun Sep 6 17:40:35 2020 (r365383) @@ -43,6 +43,7 @@ void memguard_init(struct vmem *); void *memguard_alloc(unsigned long, int); void *memguard_realloc(void *, unsigned long, struct malloc_type *, int); void memguard_free(void *); +unsigned long memguard_get_req_size(const void *); int memguard_cmp_mtp(struct malloc_type *, unsigned long); int memguard_cmp_zone(uma_zone_t); int is_memguard_addr(void *); @@ -52,6 +53,7 @@ int is_memguard_addr(void *); #define memguard_alloc(size, flags) NULL #define memguard_realloc(a, s, mtp, f) NULL #define memguard_free(addr) do { } while (0) +#define memguard_get_req_size(addr) 0 #define memguard_cmp_mtp(mtp, size) 0 #define memguard_cmp_zone(zone) 0 #define is_memguard_addr(addr) 0 From owner-svn-src-stable@freebsd.org Sun Sep 6 18:20:26 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DE9D3D95BB; Sun, 6 Sep 2020 18:20:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl08B0SRJz4JW4; Sun, 6 Sep 2020 18:20:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7212127FB; Sun, 6 Sep 2020 18:20:25 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086IKPqL086096; Sun, 6 Sep 2020 18:20:25 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086IKPXN086094; Sun, 6 Sep 2020 18:20:25 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202009061820.086IKPXN086094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 6 Sep 2020 18:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365384 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 365384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2020 18:20:26 -0000 Author: gonzo Date: Sun Sep 6 18:20:25 2020 New Revision: 365384 URL: https://svnweb.freebsd.org/changeset/base/365384 Log: MFC r353419: Provide new KPI for network drivers to access lists of interface addresses. The KPI doesn't reveal neither how addresses are stored, how the access to them is synchronized, neither reveal struct ifaddr and struct ifmaddr. Reviewed by: gallatin, erj, hselasky, philip, stevek Differential Revision: https://reviews.freebsd.org/D21943 Modified: stable/12/sys/net/if.c stable/12/sys/net/if_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if.c ============================================================================== --- stable/12/sys/net/if.c Sun Sep 6 17:40:35 2020 (r365383) +++ stable/12/sys/net/if.c Sun Sep 6 18:20:25 2020 (r365384) @@ -4313,6 +4313,53 @@ if_getmtu_family(if_t ifp, int family) return (((struct ifnet *)ifp)->if_mtu); } +/* + * Methods for drivers to access interface unicast and multicast + * link level addresses. Driver shall not know 'struct ifaddr' neither + * 'struct ifmultiaddr'. + */ +u_int +if_foreach_lladdr(if_t ifp, iflladdr_cb_t cb, void *cb_arg) +{ + struct ifaddr *ifa; + u_int count; + + MPASS(cb); + + count = 0; + IF_ADDR_RLOCK(ifp); + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family != AF_LINK) + continue; + count += (*cb)(cb_arg, (struct sockaddr_dl *)ifa->ifa_addr, + count); + } + IF_ADDR_RUNLOCK(ifp); + + return (count); +} + +u_int +if_foreach_llmaddr(if_t ifp, iflladdr_cb_t cb, void *cb_arg) +{ + struct ifmultiaddr *ifma; + u_int count; + + MPASS(cb); + + count = 0; + IF_ADDR_RLOCK(ifp); + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + count += (*cb)(cb_arg, (struct sockaddr_dl *)ifma->ifma_addr, + count); + } + IF_ADDR_RUNLOCK(ifp); + + return (count); +} + int if_setsoftc(if_t ifp, void *softc) { Modified: stable/12/sys/net/if_var.h ============================================================================== --- stable/12/sys/net/if_var.h Sun Sep 6 17:40:35 2020 (r365383) +++ stable/12/sys/net/if_var.h Sun Sep 6 18:20:25 2020 (r365384) @@ -735,11 +735,20 @@ void if_bpfmtap(if_t ifp, struct mbuf *m); void if_etherbpfmtap(if_t ifp, struct mbuf *m); void if_vlancap(if_t ifp); -int if_setupmultiaddr(if_t ifp, void *mta, int *cnt, int max); -int if_multiaddr_array(if_t ifp, void *mta, int *cnt, int max); +/* + * Traversing through interface address lists. + */ +struct sockaddr_dl; +typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int); +u_int if_foreach_lladdr(if_t, iflladdr_cb_t, void *); +u_int if_foreach_llmaddr(if_t, iflladdr_cb_t, void *); int if_multiaddr_count(if_t ifp, int max); +/* Obsoleted multicast management functions. */ +int if_setupmultiaddr(if_t ifp, void *mta, int *cnt, int max); +int if_multiaddr_array(if_t ifp, void *mta, int *cnt, int max); int if_multi_apply(struct ifnet *ifp, int (*filter)(void *, struct ifmultiaddr *, int), void *arg); + int if_getamcount(if_t ifp); struct ifaddr * if_getifaddr(if_t ifp); From owner-svn-src-stable@freebsd.org Sun Sep 6 18:25:51 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A73303D975B; Sun, 6 Sep 2020 18:25:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl0GR3zs1z4Jvf; Sun, 6 Sep 2020 18:25:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BD1812999; Sun, 6 Sep 2020 18:25:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086IPprX092378; Sun, 6 Sep 2020 18:25:51 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086IPpGt092376; Sun, 6 Sep 2020 18:25:51 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202009061825.086IPpGt092376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 6 Sep 2020 18:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365385 - in stable/12/sys: arm64/conf conf dev/altera/dwc X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/12/sys: arm64/conf conf dev/altera/dwc X-SVN-Commit-Revision: 365385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2020 18:25:51 -0000 Author: gonzo Date: Sun Sep 6 18:25:50 2020 New Revision: 365385 URL: https://svnweb.freebsd.org/changeset/base/365385 Log: MFC r350418 by br: Add glue driver for Altera SOCFPGA Ethernet MAC (EMAC) found in Terasic DE10-Pro (an Intel Stratix 10 GX/SX FPGA Development Kit). The Altera EMAC is an instance of Synopsys DesignWare Gigabit MAC. This driver sets correct clock range for MDIO interface on Intel Stratix 10 platform. This is required due to lack of support for clock manager device for this platform that could tell us the clock frequency value for ethernet clock domain. Sponsored by: DARPA, AFRL Added: stable/12/sys/dev/altera/dwc/ - copied from r350418, head/sys/dev/altera/dwc/ Modified: stable/12/sys/arm64/conf/GENERIC stable/12/sys/conf/files.arm64 Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/conf/GENERIC ============================================================================== --- stable/12/sys/arm64/conf/GENERIC Sun Sep 6 18:20:25 2020 (r365384) +++ stable/12/sys/arm64/conf/GENERIC Sun Sep 6 18:25:50 2020 (r365385) @@ -146,6 +146,7 @@ device smc # SMSC LAN91C111 device vnic # Cavium ThunderX NIC device al_eth # Annapurna Alpine Ethernet NIC device dwc_rk # Rockchip Designware +device dwc_socfpga # Altera SOCFPGA Ethernet MAC # Block devices device ahci Modified: stable/12/sys/conf/files.arm64 ============================================================================== --- stable/12/sys/conf/files.arm64 Sun Sep 6 18:20:25 2020 (r365384) +++ stable/12/sys/conf/files.arm64 Sun Sep 6 18:25:50 2020 (r365385) @@ -214,6 +214,7 @@ dev/acpica/acpi_pci_link.c optional acpi pci dev/acpica/acpi_pcib.c optional acpi pci dev/acpica/acpi_pxm.c optional acpi dev/ahci/ahci_generic.c optional ahci +dev/altera/dwc/if_dwc_socfpga.c optional fdt dwc_socfpga dev/axgbe/if_axgbe.c optional axgbe dev/axgbe/xgbe-desc.c optional axgbe dev/axgbe/xgbe-dev.c optional axgbe From owner-svn-src-stable@freebsd.org Sun Sep 6 18:27:37 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D0143D9BA4; Sun, 6 Sep 2020 18:27:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl0JT0QtRz4KFB; Sun, 6 Sep 2020 18:27:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5FAA12A31; Sun, 6 Sep 2020 18:27:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086IRaTw092512; Sun, 6 Sep 2020 18:27:36 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086IRawb092511; Sun, 6 Sep 2020 18:27:36 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202009061827.086IRawb092511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 6 Sep 2020 18:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365386 - stable/12/sys/dev/dwc X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/12/sys/dev/dwc X-SVN-Commit-Revision: 365386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2020 18:27:37 -0000 Author: gonzo Date: Sun Sep 6 18:27:36 2020 New Revision: 365386 URL: https://svnweb.freebsd.org/changeset/base/365386 Log: MFC r353843 by glebius: Convert to if_foreach_llmaddr() KPI. Modified: stable/12/sys/dev/dwc/if_dwc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/dwc/if_dwc.c ============================================================================== --- stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 18:25:50 2020 (r365385) +++ stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 18:27:36 2020 (r365386) @@ -581,13 +581,37 @@ bitreverse(uint8_t x) return (nibbletab[x & 0xf] << 4) | nibbletab[x >> 4]; } +struct dwc_hash_maddr_ctx { + struct dwc_softc *sc; + uint32_t hash[8]; +}; + +static u_int +dwc_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) +{ + struct dwc_hash_maddr_ctx *ctx = arg; + uint32_t crc, hashbit, hashreg; + uint8_t val; + + crc = ether_crc32_le(LLADDR(sdl), ETHER_ADDR_LEN); + /* Take lower 8 bits and reverse it */ + val = bitreverse(~crc & 0xff); + if (ctx->sc->mactype == DWC_GMAC_ALT_DESC) + val >>= 2; /* Only need lower 6 bits */ + hashreg = (val >> 5); + hashbit = (val & 31); + ctx->hash[hashreg] |= (1 << hashbit); + + return (1); +} + static void dwc_setup_rxfilter(struct dwc_softc *sc) { - struct ifmultiaddr *ifma; + struct dwc_hash_maddr_ctx ctx; struct ifnet *ifp; - uint8_t *eaddr, val; - uint32_t crc, ffval, hashbit, hashreg, hi, lo, hash[8]; + uint8_t *eaddr; + uint32_t ffval, hi, lo; int nhash, i; DWC_ASSERT_LOCKED(sc); @@ -601,27 +625,13 @@ dwc_setup_rxfilter(struct dwc_softc *sc) if ((ifp->if_flags & IFF_ALLMULTI) != 0) { ffval = (FRAME_FILTER_PM); for (i = 0; i < nhash; i++) - hash[i] = ~0; + ctx.hash[i] = ~0; } else { ffval = (FRAME_FILTER_HMC); for (i = 0; i < nhash; i++) - hash[i] = 0; - if_maddr_rlock(ifp); - CK_STAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) - ifma->ifma_addr), ETHER_ADDR_LEN); - - /* Take lower 8 bits and reverse it */ - val = bitreverse(~crc & 0xff); - if (sc->mactype == DWC_GMAC_ALT_DESC) - val >>= nhash; /* Only need lower 6 bits */ - hashreg = (val >> 5); - hashbit = (val & 31); - hash[hashreg] |= (1 << hashbit); - } - if_maddr_runlock(ifp); + ctx.hash[i] = 0; + ctx.sc = sc; + if_foreach_llmaddr(ifp, dwc_hash_maddr, &ctx); } /* @@ -641,11 +651,11 @@ dwc_setup_rxfilter(struct dwc_softc *sc) WRITE4(sc, MAC_ADDRESS_HIGH(0), hi); WRITE4(sc, MAC_FRAME_FILTER, ffval); if (sc->mactype == DWC_GMAC_ALT_DESC) { - WRITE4(sc, GMAC_MAC_HTLOW, hash[0]); - WRITE4(sc, GMAC_MAC_HTHIGH, hash[1]); + WRITE4(sc, GMAC_MAC_HTLOW, ctx.hash[0]); + WRITE4(sc, GMAC_MAC_HTHIGH, ctx.hash[1]); } else { for (i = 0; i < nhash; i++) - WRITE4(sc, HASH_TABLE_REG(i), hash[i]); + WRITE4(sc, HASH_TABLE_REG(i), ctx.hash[i]); } } From owner-svn-src-stable@freebsd.org Sun Sep 6 18:48:52 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9837D3DA547; Sun, 6 Sep 2020 18:48:52 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl0n03sB9z4LRm; Sun, 6 Sep 2020 18:48:52 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6798412F23; Sun, 6 Sep 2020 18:48:52 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086ImqQX004647; Sun, 6 Sep 2020 18:48:52 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086ImoH1004639; Sun, 6 Sep 2020 18:48:50 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202009061848.086ImoH1004639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 6 Sep 2020 18:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365387 - in stable/12/sys: arm/allwinner arm/amlogic/aml8726 arm64/rockchip dev/altera/dwc dev/dwc X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/12/sys: arm/allwinner arm/amlogic/aml8726 arm64/rockchip dev/altera/dwc dev/dwc X-SVN-Commit-Revision: 365387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2020 18:48:52 -0000 Author: gonzo Date: Sun Sep 6 18:48:50 2020 New Revision: 365387 URL: https://svnweb.freebsd.org/changeset/base/365387 Log: MFC r360467, r362399, r362405, r362415 r360467 by mmel: Fix style(9). Strip write only variables. Not a functional change. r362399 by mmel: Use naming nomenclature used in DesignWare TRM. Use naming nomenclature used in DesignWare TRM. This driver was written by using Altera (now Intel) documentation for Arria FPGA manual. Unfortunately this manual used very different (and in some cases opposite naming) for registers and descriptor fields. Unfortunately, this makes future expansion extremely hard. Should not been functional change. r362405 by mmel: Finish renaming in if_dwc. By using DWC TRM terminology, normal descriptor format should be named extended and alternate descriptor format should be named normal. Should not been functional change. r362415 by mmel: Improve if_dwc: - refactorize packet receive path. Make sure that we don't leak mbufs and/or that we don't create holes in RX descriptor ring - slightly simplify handling with TX descriptors Modified: stable/12/sys/arm/allwinner/aw_if_dwc.c stable/12/sys/arm/amlogic/aml8726/aml8726_if_dwc.c stable/12/sys/arm64/rockchip/if_dwc_rk.c stable/12/sys/dev/altera/dwc/if_dwc_socfpga.c stable/12/sys/dev/dwc/if_dwc.c stable/12/sys/dev/dwc/if_dwc.h stable/12/sys/dev/dwc/if_dwc_if.m stable/12/sys/dev/dwc/if_dwcvar.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/aw_if_dwc.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_if_dwc.c Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/arm/allwinner/aw_if_dwc.c Sun Sep 6 18:48:50 2020 (r365387) @@ -114,7 +114,7 @@ static int a20_if_dwc_mac_type(device_t dev) { - return (DWC_GMAC_ALT_DESC); + return (DWC_GMAC_NORMAL_DESC); } static int Modified: stable/12/sys/arm/amlogic/aml8726/aml8726_if_dwc.c ============================================================================== --- stable/12/sys/arm/amlogic/aml8726/aml8726_if_dwc.c Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/arm/amlogic/aml8726/aml8726_if_dwc.c Sun Sep 6 18:48:50 2020 (r365387) @@ -66,7 +66,7 @@ static int aml8726_if_dwc_mac_type(device_t dev) { - return (DWC_GMAC_ALT_DESC); + return (DWC_GMAC_NORMAL_DESC); } static int Modified: stable/12/sys/arm64/rockchip/if_dwc_rk.c ============================================================================== --- stable/12/sys/arm64/rockchip/if_dwc_rk.c Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/arm64/rockchip/if_dwc_rk.c Sun Sep 6 18:48:50 2020 (r365387) @@ -161,7 +161,7 @@ static int if_dwc_rk_mac_type(device_t dev) { - return (DWC_GMAC_ALT_DESC); + return (DWC_GMAC_NORMAL_DESC); } static int Modified: stable/12/sys/dev/altera/dwc/if_dwc_socfpga.c ============================================================================== --- stable/12/sys/dev/altera/dwc/if_dwc_socfpga.c Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/dev/altera/dwc/if_dwc_socfpga.c Sun Sep 6 18:48:50 2020 (r365387) @@ -74,7 +74,7 @@ static int if_dwc_socfpga_mac_type(device_t dev) { - return (DWC_GMAC); + return (DWC_GMAC_EXT_DESC); } static int Modified: stable/12/sys/dev/dwc/if_dwc.c ============================================================================== --- stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 18:48:50 2020 (r365387) @@ -93,46 +93,113 @@ __FBSDID("$FreeBSD$"); #define DWC_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED) #define DWC_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED) -#define DDESC_TDES0_OWN (1U << 31) -#define DDESC_TDES0_TXINT (1U << 30) -#define DDESC_TDES0_TXLAST (1U << 29) -#define DDESC_TDES0_TXFIRST (1U << 28) -#define DDESC_TDES0_TXCRCDIS (1U << 27) -#define DDESC_TDES0_TXRINGEND (1U << 21) -#define DDESC_TDES0_TXCHAIN (1U << 20) +/* TX descriptors - TDESC0 is almost unified */ +#define TDESC0_OWN (1U << 31) +#define TDESC0_IHE (1U << 16) /* IP Header Error */ +#define TDESC0_ES (1U << 15) /* Error Summary */ +#define TDESC0_JT (1U << 14) /* Jabber Timeout */ +#define TDESC0_FF (1U << 13) /* Frame Flushed */ +#define TDESC0_PCE (1U << 12) /* Payload Checksum Error */ +#define TDESC0_LOC (1U << 11) /* Loss of Carrier */ +#define TDESC0_NC (1U << 10) /* No Carrier */ +#define TDESC0_LC (1U << 9) /* Late Collision */ +#define TDESC0_EC (1U << 8) /* Excessive Collision */ +#define TDESC0_VF (1U << 7) /* VLAN Frame */ +#define TDESC0_CC_MASK 0xf +#define TDESC0_CC_SHIFT 3 /* Collision Count */ +#define TDESC0_ED (1U << 2) /* Excessive Deferral */ +#define TDESC0_UF (1U << 1) /* Underflow Error */ +#define TDESC0_DB (1U << 0) /* Deferred Bit */ +/* TX descriptors - TDESC0 extended format only */ +#define ETDESC0_IC (1U << 30) /* Interrupt on Completion */ +#define ETDESC0_LS (1U << 29) /* Last Segment */ +#define ETDESC0_FS (1U << 28) /* First Segment */ +#define ETDESC0_DC (1U << 27) /* Disable CRC */ +#define ETDESC0_DP (1U << 26) /* Disable Padding */ +#define ETDESC0_CIC_NONE (0U << 22) /* Checksum Insertion Control */ +#define ETDESC0_CIC_HDR (1U << 22) +#define ETDESC0_CIC_SEG (2U << 22) +#define ETDESC0_CIC_FULL (3U << 22) +#define ETDESC0_TER (1U << 21) /* Transmit End of Ring */ +#define ETDESC0_TCH (1U << 20) /* Second Address Chained */ -#define DDESC_RDES0_OWN (1U << 31) -#define DDESC_RDES0_FL_MASK 0x3fff -#define DDESC_RDES0_FL_SHIFT 16 /* Frame Length */ -#define DDESC_RDES1_CHAINED (1U << 14) +/* TX descriptors - TDESC1 normal format */ +#define NTDESC1_IC (1U << 31) /* Interrupt on Completion */ +#define NTDESC1_LS (1U << 30) /* Last Segment */ +#define NTDESC1_FS (1U << 29) /* First Segment */ +#define NTDESC1_CIC_NONE (0U << 27) /* Checksum Insertion Control */ +#define NTDESC1_CIC_HDR (1U << 27) +#define NTDESC1_CIC_SEG (2U << 27) +#define NTDESC1_CIC_FULL (3U << 27) +#define NTDESC1_DC (1U << 26) /* Disable CRC */ +#define NTDESC1_TER (1U << 25) /* Transmit End of Ring */ +#define NTDESC1_TCH (1U << 24) /* Second Address Chained */ +/* TX descriptors - TDESC1 extended format */ +#define ETDESC1_DP (1U << 23) /* Disable Padding */ +#define ETDESC1_TBS2_MASK 0x7ff +#define ETDESC1_TBS2_SHIFT 11 /* Receive Buffer 2 Size */ +#define ETDESC1_TBS1_MASK 0x7ff +#define ETDESC1_TBS1_SHIFT 0 /* Receive Buffer 1 Size */ -/* Alt descriptor bits. */ -#define DDESC_CNTL_TXINT (1U << 31) -#define DDESC_CNTL_TXLAST (1U << 30) -#define DDESC_CNTL_TXFIRST (1U << 29) -#define DDESC_CNTL_TXCRCDIS (1U << 26) -#define DDESC_CNTL_TXRINGEND (1U << 25) -#define DDESC_CNTL_TXCHAIN (1U << 24) +/* RX descriptor - RDESC0 is unified */ +#define RDESC0_OWN (1U << 31) +#define RDESC0_AFM (1U << 30) /* Dest. Address Filter Fail */ +#define RDESC0_FL_MASK 0x3fff +#define RDESC0_FL_SHIFT 16 /* Frame Length */ +#define RDESC0_ES (1U << 15) /* Error Summary */ +#define RDESC0_DE (1U << 14) /* Descriptor Error */ +#define RDESC0_SAF (1U << 13) /* Source Address Filter Fail */ +#define RDESC0_LE (1U << 12) /* Length Error */ +#define RDESC0_OE (1U << 11) /* Overflow Error */ +#define RDESC0_VLAN (1U << 10) /* VLAN Tag */ +#define RDESC0_FS (1U << 9) /* First Descriptor */ +#define RDESC0_LS (1U << 8) /* Last Descriptor */ +#define RDESC0_ICE (1U << 7) /* IPC Checksum Error */ +#define RDESC0_GF (1U << 7) /* Giant Frame */ +#define RDESC0_LC (1U << 6) /* Late Collision */ +#define RDESC0_FT (1U << 5) /* Frame Type */ +#define RDESC0_RWT (1U << 4) /* Receive Watchdog Timeout */ +#define RDESC0_RE (1U << 3) /* Receive Error */ +#define RDESC0_DBE (1U << 2) /* Dribble Bit Error */ +#define RDESC0_CE (1U << 1) /* CRC Error */ +#define RDESC0_PCE (1U << 0) /* Payload Checksum Error */ +#define RDESC0_RXMA (1U << 0) /* Rx MAC Address */ -#define DDESC_CNTL_CHAINED (1U << 24) +/* RX descriptors - RDESC1 normal format */ +#define NRDESC1_DIC (1U << 31) /* Disable Intr on Completion */ +#define NRDESC1_RER (1U << 25) /* Receive End of Ring */ +#define NRDESC1_RCH (1U << 24) /* Second Address Chained */ +#define NRDESC1_RBS2_MASK 0x7ff +#define NRDESC1_RBS2_SHIFT 11 /* Receive Buffer 2 Size */ +#define NRDESC1_RBS1_MASK 0x7ff +#define NRDESC1_RBS1_SHIFT 0 /* Receive Buffer 1 Size */ +/* RX descriptors - RDESC1 enhanced format */ +#define ERDESC1_DIC (1U << 31) /* Disable Intr on Completion */ +#define ERDESC1_RBS2_MASK 0x7ffff +#define ERDESC1_RBS2_SHIFT 16 /* Receive Buffer 2 Size */ +#define ERDESC1_RER (1U << 15) /* Receive End of Ring */ +#define ERDESC1_RCH (1U << 14) /* Second Address Chained */ +#define ERDESC1_RBS1_MASK 0x7ffff +#define ERDESC1_RBS1_SHIFT 0 /* Receive Buffer 1 Size */ + /* * A hardware buffer descriptor. Rx and Tx buffers have the same descriptor * layout, but the bits in the fields have different meanings. */ struct dwc_hwdesc { - uint32_t tdes0; /* status for alt layout */ - uint32_t tdes1; /* cntl for alt layout */ - uint32_t addr; /* pointer to buffer data */ - uint32_t addr_next; /* link to next descriptor */ + uint32_t desc0; + uint32_t desc1; + uint32_t addr1; /* ptr to first buffer data */ + uint32_t addr2; /* ptr to next descriptor / second buffer data*/ }; /* * The hardware imposes alignment restrictions on various objects involved in * DMA transfers. These values are expressed in bytes (not bits). */ -#define DWC_DESC_RING_ALIGN 2048 +#define DWC_DESC_RING_ALIGN 2048 static struct resource_spec dwc_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -168,45 +235,39 @@ dwc_get1paddr(void *arg, bus_dma_segment_t *segs, int *(bus_addr_t *)arg = segs[0].ds_addr; } -inline static uint32_t +inline static void dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_addr_t paddr, uint32_t len) { - uint32_t flags; - uint32_t nidx; + uint32_t desc0, desc1; - nidx = next_txidx(sc, idx); - /* Addr/len 0 means we're clearing the descriptor after xmit done. */ if (paddr == 0 || len == 0) { - flags = 0; + desc0 = 0; + desc1 = 0; --sc->txcount; } else { - if (sc->mactype == DWC_GMAC_ALT_DESC) - flags = DDESC_CNTL_TXCHAIN | DDESC_CNTL_TXFIRST - | DDESC_CNTL_TXLAST | DDESC_CNTL_TXINT; - else - flags = DDESC_TDES0_TXCHAIN | DDESC_TDES0_TXFIRST - | DDESC_TDES0_TXLAST | DDESC_TDES0_TXINT; + if (sc->mactype != DWC_GMAC_EXT_DESC) { + desc0 = 0; + desc1 = NTDESC1_TCH | NTDESC1_FS | NTDESC1_LS | + NTDESC1_IC | len; + } else { + desc0 = ETDESC0_TCH | ETDESC0_FS | ETDESC0_LS | + ETDESC0_IC; + desc1 = len; + } ++sc->txcount; } - sc->txdesc_ring[idx].addr = (uint32_t)(paddr); - if (sc->mactype == DWC_GMAC_ALT_DESC) { - sc->txdesc_ring[idx].tdes0 = 0; - sc->txdesc_ring[idx].tdes1 = flags | len; - } else { - sc->txdesc_ring[idx].tdes0 = flags; - sc->txdesc_ring[idx].tdes1 = len; - } + sc->txdesc_ring[idx].addr1 = (uint32_t)(paddr); + sc->txdesc_ring[idx].desc0 = desc0; + sc->txdesc_ring[idx].desc1 = desc1; if (paddr && len) { wmb(); - sc->txdesc_ring[idx].tdes0 |= DDESC_TDES0_OWN; + sc->txdesc_ring[idx].desc0 |= TDESC0_OWN; wmb(); } - - return (nidx); } static int @@ -252,14 +313,13 @@ dwc_txstart_locked(struct dwc_softc *sc) ifp = sc->ifp; - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; - } enqueued = 0; for (;;) { - if (sc->txcount == (TX_DESC_COUNT-1)) { + if (sc->txcount == (TX_DESC_COUNT - 1)) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -268,7 +328,7 @@ dwc_txstart_locked(struct dwc_softc *sc) if (m == NULL) break; if (dwc_setup_txbuf(sc, sc->tx_idx_head, &m) != 0) { - IFQ_DRV_PREPEND(&ifp->if_snd, m); + IFQ_DRV_PREPEND(&ifp->if_snd, m); break; } BPF_MTAP(ifp, m); @@ -462,24 +522,26 @@ dwc_init(void *if_softc) DWC_UNLOCK(sc); } + inline static uint32_t dwc_setup_rxdesc(struct dwc_softc *sc, int idx, bus_addr_t paddr) { uint32_t nidx; - sc->rxdesc_ring[idx].addr = (uint32_t)paddr; + sc->rxdesc_ring[idx].addr1 = (uint32_t)paddr; nidx = next_rxidx(sc, idx); - sc->rxdesc_ring[idx].addr_next = sc->rxdesc_ring_paddr + \ + sc->rxdesc_ring[idx].addr2 = sc->rxdesc_ring_paddr + (nidx * sizeof(struct dwc_hwdesc)); - if (sc->mactype == DWC_GMAC_ALT_DESC) - sc->rxdesc_ring[idx].tdes1 = DDESC_CNTL_CHAINED | RX_MAX_PACKET; + if (sc->mactype != DWC_GMAC_EXT_DESC) + sc->rxdesc_ring[idx].desc1 = NRDESC1_RCH | + MIN(MCLBYTES, NRDESC1_RBS1_MASK); else - sc->rxdesc_ring[idx].tdes1 = DDESC_RDES1_CHAINED | MCLBYTES; + sc->rxdesc_ring[idx].desc1 = ERDESC1_RCH | + MIN(MCLBYTES, ERDESC1_RBS1_MASK); wmb(); - sc->rxdesc_ring[idx].tdes0 = DDESC_RDES0_OWN; + sc->rxdesc_ring[idx].desc0 = RDESC0_OWN; wmb(); - return (nidx); } @@ -493,9 +555,8 @@ dwc_setup_rxbuf(struct dwc_softc *sc, int idx, struct error = bus_dmamap_load_mbuf_sg(sc->rxbuf_tag, sc->rxbuf_map[idx].map, m, &seg, &nsegs, 0); - if (error != 0) { + if (error != 0) return (error); - } KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); @@ -520,6 +581,74 @@ dwc_alloc_mbufcl(struct dwc_softc *sc) return (m); } +static struct mbuf * +dwc_rxfinish_one(struct dwc_softc *sc, struct dwc_hwdesc *desc, + struct dwc_bufmap *map) +{ + struct ifnet *ifp; + struct mbuf *m, *m0; + int len; + uint32_t rdesc0; + + m = map->mbuf; + ifp = sc->ifp; + rdesc0 = desc ->desc0; + /* Validate descriptor. */ + if (rdesc0 & RDESC0_ES) { + /* + * Errored packet. Statistic counters are updated + * globally, so do nothing + */ + return (NULL); + } + + if ((rdesc0 & (RDESC0_FS | RDESC0_LS)) != + (RDESC0_FS | RDESC0_LS)) { + /* + * Something very wrong happens. The whole packet should be + * recevied in one descriptr. Report problem. + */ + device_printf(sc->dev, + "%s: RX descriptor without FIRST and LAST bit set: 0x%08X", + __func__, rdesc0); + return (NULL); + } + + len = (rdesc0 >> RDESC0_FL_SHIFT) & RDESC0_FL_MASK; + if (len < 64) { + /* + * Lenght is invalid, recycle old mbuf + * Probably impossible case + */ + return (NULL); + } + + /* Allocate new buffer */ + m0 = dwc_alloc_mbufcl(sc); + if (m0 == NULL) { + /* no new mbuf available, recycle old */ + if_inc_counter(sc->ifp, IFCOUNTER_IQDROPS, 1); + return (NULL); + } + /* Do dmasync for newly received packet */ + bus_dmamap_sync(sc->rxbuf_tag, map->map, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->rxbuf_tag, map->map); + + /* Received packet is valid, process it */ + m->m_pkthdr.rcvif = ifp; + m->m_pkthdr.len = len; + m->m_len = len; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + + /* Remove trailing FCS */ + m_adj(m, -ETHER_CRC_LEN); + + DWC_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + DWC_LOCK(sc); + return (m0); +} + static void dwc_media_status(struct ifnet * ifp, struct ifmediareq *ifmr) { @@ -596,7 +725,7 @@ dwc_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_i crc = ether_crc32_le(LLADDR(sdl), ETHER_ADDR_LEN); /* Take lower 8 bits and reverse it */ val = bitreverse(~crc & 0xff); - if (ctx->sc->mactype == DWC_GMAC_ALT_DESC) + if (ctx->sc->mactype != DWC_GMAC_EXT_DESC) val >>= 2; /* Only need lower 6 bits */ hashreg = (val >> 5); hashbit = (val & 31); @@ -617,7 +746,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc) DWC_ASSERT_LOCKED(sc); ifp = sc->ifp; - nhash = sc->mactype == DWC_GMAC_ALT_DESC ? 2 : 8; + nhash = sc->mactype != DWC_GMAC_EXT_DESC ? 2 : 8; /* * Set the multicast (group) filter hash. @@ -650,7 +779,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc) WRITE4(sc, MAC_ADDRESS_LOW(0), lo); WRITE4(sc, MAC_ADDRESS_HIGH(0), hi); WRITE4(sc, MAC_FRAME_FILTER, ffval); - if (sc->mactype == DWC_GMAC_ALT_DESC) { + if (sc->mactype != DWC_GMAC_EXT_DESC) { WRITE4(sc, GMAC_MAC_HTLOW, ctx.hash[0]); WRITE4(sc, GMAC_MAC_HTHIGH, ctx.hash[1]); } else { @@ -731,7 +860,7 @@ dwc_txfinish_locked(struct dwc_softc *sc) ifp = sc->ifp; while (sc->tx_idx_tail != sc->tx_idx_head) { desc = &sc->txdesc_ring[sc->tx_idx_tail]; - if ((desc->tdes0 & DDESC_TDES0_OWN) != 0) + if ((desc->desc0 & TDESC0_OWN) != 0) break; bmap = &sc->txbuf_map[sc->tx_idx_tail]; bus_dmamap_sync(sc->txbuf_tag, bmap->map, @@ -755,52 +884,30 @@ static void dwc_rxfinish_locked(struct dwc_softc *sc) { struct ifnet *ifp; - struct mbuf *m0; struct mbuf *m; - int error, idx, len; - uint32_t rdes0; + int error, idx; + struct dwc_hwdesc *desc; + DWC_ASSERT_LOCKED(sc); ifp = sc->ifp; - for (;;) { idx = sc->rx_idx; - - rdes0 = sc->rxdesc_ring[idx].tdes0; - if ((rdes0 & DDESC_RDES0_OWN) != 0) + desc = sc->rxdesc_ring + idx; + if ((desc->desc0 & RDESC0_OWN) != 0) break; - bus_dmamap_sync(sc->rxbuf_tag, sc->rxbuf_map[idx].map, - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->rxbuf_tag, sc->rxbuf_map[idx].map); - - len = (rdes0 >> DDESC_RDES0_FL_SHIFT) & DDESC_RDES0_FL_MASK; - if (len != 0) { - m = sc->rxbuf_map[idx].mbuf; - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = len; - m->m_len = len; - if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - - /* Remove trailing FCS */ - m_adj(m, -ETHER_CRC_LEN); - - DWC_UNLOCK(sc); - (*ifp->if_input)(ifp, m); - DWC_LOCK(sc); + m = dwc_rxfinish_one(sc, desc, sc->rxbuf_map + idx); + if (m == NULL) { + wmb(); + desc->desc0 = RDESC0_OWN; + wmb(); } else { - /* XXX Zero-length packet ? */ + /* We cannot create hole in RX ring */ + error = dwc_setup_rxbuf(sc, idx, m); + if (error != 0) + panic("dwc_setup_rxbuf failed: error %d\n", + error); } - - if ((m0 = dwc_alloc_mbufcl(sc)) != NULL) { - if ((error = dwc_setup_rxbuf(sc, idx, m0)) != 0) { - /* - * XXX Now what? - * We've got a hole in the rx ring. - */ - } - } else - if_inc_counter(sc->ifp, IFCOUNTER_IQDROPS, 1); - sc->rx_idx = next_rxidx(sc, sc->rx_idx); } } @@ -892,7 +999,7 @@ setup_dma(struct dwc_softc *sc) for (idx = 0; idx < TX_DESC_COUNT; idx++) { nidx = next_txidx(sc, idx); - sc->txdesc_ring[idx].addr_next = sc->txdesc_ring_paddr + + sc->txdesc_ring[idx].addr2 = sc->txdesc_ring_paddr + (nidx * sizeof(struct dwc_hwdesc)); } @@ -1168,10 +1275,6 @@ dwc_attach(device_t dev) return (ENXIO); } - /* Memory interface */ - sc->bst = rman_get_bustag(sc->res[0]); - sc->bsh = rman_get_bushandle(sc->res[0]); - /* Read MAC before reset */ if (dwc_get_hwaddr(sc, macaddr)) { device_printf(sc->dev, "can't get mac\n"); @@ -1199,7 +1302,7 @@ dwc_attach(device_t dev) return (ENXIO); } - if (sc->mactype == DWC_GMAC_ALT_DESC) { + if (sc->mactype != DWC_GMAC_EXT_DESC) { reg = BUS_MODE_FIXEDBURST; reg |= (BUS_MODE_PRIORXTX_41 << BUS_MODE_PRIORXTX_SHIFT); } else Modified: stable/12/sys/dev/dwc/if_dwc.h ============================================================================== --- stable/12/sys/dev/dwc/if_dwc.h Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/dev/dwc/if_dwc.h Sun Sep 6 18:48:50 2020 (r365387) @@ -272,8 +272,9 @@ #define CURRENT_HOST_RECEIVE_BUF_ADDR 0x1054 #define HW_FEATURE 0x1058 -#define DWC_GMAC 0x1 -#define DWC_GMAC_ALT_DESC 0x2 +#define DWC_GMAC_NORMAL_DESC 0x1 +#define DWC_GMAC_EXT_DESC 0x2 + #define GMAC_MII_CLK_60_100M_DIV42 0x0 #define GMAC_MII_CLK_100_150M_DIV62 0x1 #define GMAC_MII_CLK_25_35M_DIV16 0x2 Modified: stable/12/sys/dev/dwc/if_dwc_if.m ============================================================================== --- stable/12/sys/dev/dwc/if_dwc_if.m Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/dev/dwc/if_dwc_if.m Sun Sep 6 18:48:50 2020 (r365387) @@ -41,7 +41,7 @@ CODE { static int if_dwc_default_mac_type(device_t dev) { - return (DWC_GMAC); + return (DWC_GMAC_EXT_DESC); } static int Modified: stable/12/sys/dev/dwc/if_dwcvar.h ============================================================================== --- stable/12/sys/dev/dwc/if_dwcvar.h Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/dev/dwc/if_dwcvar.h Sun Sep 6 18:48:50 2020 (r365387) @@ -44,7 +44,6 @@ /* * Driver data and defines. */ -#define RX_MAX_PACKET 0x7ff #define RX_DESC_COUNT 1024 #define RX_DESC_SIZE (sizeof(struct dwc_hwdesc) * RX_DESC_COUNT) #define TX_DESC_COUNT 1024 @@ -57,8 +56,6 @@ struct dwc_bufmap { struct dwc_softc { struct resource *res[2]; - bus_space_tag_t bst; - bus_space_handle_t bsh; device_t dev; int mactype; int mii_clk; From owner-svn-src-stable@freebsd.org Sun Sep 6 19:03:21 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 043313DA7B8; Sun, 6 Sep 2020 19:03:21 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl15h6YKpz4MGH; Sun, 6 Sep 2020 19:03:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4317130E9; Sun, 6 Sep 2020 19:03:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086J3KR9016904; Sun, 6 Sep 2020 19:03:20 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086J3J9v016899; Sun, 6 Sep 2020 19:03:19 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202009061903.086J3J9v016899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 6 Sep 2020 19:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365388 - in stable/12/sys: arm64/rockchip dev/dwc X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/12/sys: arm64/rockchip dev/dwc X-SVN-Commit-Revision: 365388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2020 19:03:21 -0000 Author: gonzo Date: Sun Sep 6 19:03:19 2020 New Revision: 365388 URL: https://svnweb.freebsd.org/changeset/base/365388 Log: MFC r362736, r364088 r362736: Configure rx_delay/tx_delay values for RK3399/RK3328 GMAC For 1000Mb mode to work reliably TX/RX delays need to be configured between the TX/RX clock and the respective signals on the PHY to compensate for differing trace lengths on the PCB. Reviewed by: manu r364088: Improve Rockchip's integration of if_dwc - Do not rely on U-Boot for clocks configuration, enable and set frequencies in the driver's attach method. - Adjust MAC settings according to detected linespeed on RK3399 and RK3328. - Add support for RMII PHY mode on RK3328. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D26006 Modified: stable/12/sys/arm64/rockchip/if_dwc_rk.c stable/12/sys/dev/dwc/if_dwc.c stable/12/sys/dev/dwc/if_dwc.h stable/12/sys/dev/dwc/if_dwc_if.m stable/12/sys/dev/dwc/if_dwcvar.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/rockchip/if_dwc_rk.c ============================================================================== --- stable/12/sys/arm64/rockchip/if_dwc_rk.c Sun Sep 6 18:48:50 2020 (r365387) +++ stable/12/sys/arm64/rockchip/if_dwc_rk.c Sun Sep 6 19:03:19 2020 (r365388) @@ -24,7 +24,7 @@ * 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$"); @@ -34,91 +34,350 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include +#include + #include #include #include #include #include +#include #include - #include +#include "if_dwc_if.h" #include "syscon_if.h" -#include "if_dwc_if.h" - #define RK3328_GRF_MAC_CON0 0x0900 -#define RK3328_GRF_MAC_CON0_TX_MASK 0x7F -#define RK3328_GRF_MAC_CON0_TX_SHIFT 0 -#define RK3328_GRF_MAC_CON0_RX_MASK 0x7F -#define RK3328_GRF_MAC_CON0_RX_SHIFT 7 +#define MAC_CON0_GMAC2IO_TX_DL_CFG_MASK 0x7F +#define MAC_CON0_GMAC2IO_TX_DL_CFG_SHIFT 0 +#define MAC_CON0_GMAC2IO_RX_DL_CFG_MASK 0x7F +#define MAC_CON0_GMAC2IO_RX_DL_CFG_SHIFT 7 #define RK3328_GRF_MAC_CON1 0x0904 +#define MAC_CON1_GMAC2IO_GMAC_TXCLK_DLY_ENA (1 << 0) +#define MAC_CON1_GMAC2IO_GMAC_RXCLK_DLY_ENA (1 << 1) +#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_MASK (3 << 11) +#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_125 (0 << 11) +#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_25 (3 << 11) +#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_2_5 (2 << 11) +#define MAC_CON1_GMAC2IO_RMII_MODE_MASK (1 << 9) +#define MAC_CON1_GMAC2IO_RMII_MODE (1 << 9) +#define MAC_CON1_GMAC2IO_INTF_SEL_MASK (7 << 4) +#define MAC_CON1_GMAC2IO_INTF_RMII (4 << 4) +#define MAC_CON1_GMAC2IO_INTF_RGMII (1 << 4) +#define MAC_CON1_GMAC2IO_RMII_CLK_SEL_MASK (1 << 7) +#define MAC_CON1_GMAC2IO_RMII_CLK_SEL_25 (1 << 7) +#define MAC_CON1_GMAC2IO_RMII_CLK_SEL_2_5 (0 << 7) +#define MAC_CON1_GMAC2IO_MAC_SPEED_MASK (1 << 2) +#define MAC_CON1_GMAC2IO_MAC_SPEED_100 (1 << 2) +#define MAC_CON1_GMAC2IO_MAC_SPEED_10 (0 << 2) #define RK3328_GRF_MAC_CON2 0x0908 #define RK3328_GRF_MACPHY_CON0 0x0B00 +#define MACPHY_CON0_CLK_50M_MASK (1 << 14) +#define MACPHY_CON0_CLK_50M (1 << 14) +#define MACPHY_CON0_RMII_MODE_MASK (3 << 6) +#define MACPHY_CON0_RMII_MODE (1 << 6) #define RK3328_GRF_MACPHY_CON1 0x0B04 +#define MACPHY_CON1_RMII_MODE_MASK (1 << 9) +#define MACPHY_CON1_RMII_MODE (1 << 9) #define RK3328_GRF_MACPHY_CON2 0x0B08 #define RK3328_GRF_MACPHY_CON3 0x0B0C #define RK3328_GRF_MACPHY_STATUS 0x0B10 +#define RK3399_GRF_SOC_CON5 0xc214 +#define SOC_CON5_GMAC_CLK_SEL_MASK (3 << 4) +#define SOC_CON5_GMAC_CLK_SEL_125 (0 << 4) +#define SOC_CON5_GMAC_CLK_SEL_25 (3 << 4) +#define SOC_CON5_GMAC_CLK_SEL_2_5 (2 << 4) +#define RK3399_GRF_SOC_CON6 0xc218 +#define SOC_CON6_GMAC_TXCLK_DLY_ENA (1 << 7) +#define SOC_CON6_TX_DL_CFG_MASK 0x7F +#define SOC_CON6_TX_DL_CFG_SHIFT 0 +#define SOC_CON6_RX_DL_CFG_MASK 0x7F +#define SOC_CON6_GMAC_RXCLK_DLY_ENA (1 << 15) +#define SOC_CON6_RX_DL_CFG_SHIFT 8 + +struct if_dwc_rk_softc; + +typedef void (*if_dwc_rk_set_delaysfn_t)(struct if_dwc_rk_softc *); +typedef int (*if_dwc_rk_set_speedfn_t)(struct if_dwc_rk_softc *, int); +typedef void (*if_dwc_rk_set_phy_modefn_t)(struct if_dwc_rk_softc *); +typedef void (*if_dwc_rk_phy_powerupfn_t)(struct if_dwc_rk_softc *); + +struct if_dwc_rk_ops { + if_dwc_rk_set_delaysfn_t set_delays; + if_dwc_rk_set_speedfn_t set_speed; + if_dwc_rk_set_phy_modefn_t set_phy_mode; + if_dwc_rk_phy_powerupfn_t phy_powerup; +}; + +struct if_dwc_rk_softc { + struct dwc_softc base; + uint32_t tx_delay; + uint32_t rx_delay; + bool integrated_phy; + bool clock_in; + phandle_t phy_node; + struct syscon *grf; + struct if_dwc_rk_ops *ops; + /* Common clocks */ + clk_t mac_clk_rx; + clk_t mac_clk_tx; + clk_t aclk_mac; + clk_t pclk_mac; + clk_t clk_stmmaceth; + /* RMII clocks */ + clk_t clk_mac_ref; + clk_t clk_mac_refout; + /* PHY clock */ + clk_t clk_phy; +}; + +static void rk3328_set_delays(struct if_dwc_rk_softc *sc); +static int rk3328_set_speed(struct if_dwc_rk_softc *sc, int speed); +static void rk3328_set_phy_mode(struct if_dwc_rk_softc *sc); +static void rk3328_phy_powerup(struct if_dwc_rk_softc *sc); + +static void rk3399_set_delays(struct if_dwc_rk_softc *sc); +static int rk3399_set_speed(struct if_dwc_rk_softc *sc, int speed); + +static struct if_dwc_rk_ops rk3288_ops = { +}; + +static struct if_dwc_rk_ops rk3328_ops = { + .set_delays = rk3328_set_delays, + .set_speed = rk3328_set_speed, + .set_phy_mode = rk3328_set_phy_mode, + .phy_powerup = rk3328_phy_powerup, +}; + +static struct if_dwc_rk_ops rk3399_ops = { + .set_delays = rk3399_set_delays, + .set_speed = rk3399_set_speed, +}; + static struct ofw_compat_data compat_data[] = { - {"rockchip,rk3288-gmac", 1}, - {"rockchip,rk3328-gmac", 1}, - {"rockchip,rk3399-gmac", 1}, + {"rockchip,rk3288-gmac", (uintptr_t)&rk3288_ops}, + {"rockchip,rk3328-gmac", (uintptr_t)&rk3328_ops}, + {"rockchip,rk3399-gmac", (uintptr_t)&rk3399_ops}, {NULL, 0} }; -#ifdef notyet static void -rk3328_set_delays(struct syscon *grf, phandle_t node) +rk3328_set_delays(struct if_dwc_rk_softc *sc) { + uint32_t reg; uint32_t tx, rx; - if (OF_getencprop(node, "tx_delay", &tx, sizeof(tx)) <= 0) - tx = 0x30; - if (OF_getencprop(node, "rx_delay", &rx, sizeof(rx)) <= 0) - rx = 0x10; + if (sc->base.phy_mode != PHY_MODE_RGMII) + return; - tx = ((tx & RK3328_GRF_MAC_CON0_TX_MASK) << - RK3328_GRF_MAC_CON0_TX_SHIFT); - rx = ((rx & RK3328_GRF_MAC_CON0_TX_MASK) << - RK3328_GRF_MAC_CON0_RX_SHIFT); + reg = SYSCON_READ_4(sc->grf, RK3328_GRF_MAC_CON0); + tx = ((reg >> MAC_CON0_GMAC2IO_TX_DL_CFG_SHIFT) & MAC_CON0_GMAC2IO_TX_DL_CFG_MASK); + rx = ((reg >> MAC_CON0_GMAC2IO_RX_DL_CFG_SHIFT) & MAC_CON0_GMAC2IO_RX_DL_CFG_MASK); - SYSCON_WRITE_4(grf, RK3328_GRF_MAC_CON0, tx | rx | 0xFFFF0000); + reg = SYSCON_READ_4(sc->grf, RK3328_GRF_MAC_CON1); + if (bootverbose) { + device_printf(sc->base.dev, "current delays settings: tx=%u(%s) rx=%u(%s)\n", + tx, ((reg & MAC_CON1_GMAC2IO_GMAC_TXCLK_DLY_ENA) ? "enabled" : "disabled"), + rx, ((reg & MAC_CON1_GMAC2IO_GMAC_RXCLK_DLY_ENA) ? "enabled" : "disabled")); + + device_printf(sc->base.dev, "setting new RK3328 RX/TX delays: %d/%d\n", + sc->tx_delay, sc->rx_delay); + } + + reg = (MAC_CON1_GMAC2IO_GMAC_TXCLK_DLY_ENA | MAC_CON1_GMAC2IO_GMAC_RXCLK_DLY_ENA) << 16; + reg |= (MAC_CON1_GMAC2IO_GMAC_TXCLK_DLY_ENA | MAC_CON1_GMAC2IO_GMAC_RXCLK_DLY_ENA); + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MAC_CON1, reg); + + reg = 0xffff << 16; + reg |= ((sc->tx_delay & MAC_CON0_GMAC2IO_TX_DL_CFG_MASK) << + MAC_CON0_GMAC2IO_TX_DL_CFG_SHIFT); + reg |= ((sc->rx_delay & MAC_CON0_GMAC2IO_TX_DL_CFG_MASK) << + MAC_CON0_GMAC2IO_RX_DL_CFG_SHIFT); + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MAC_CON0, reg); } -#endif -#define RK3399_GRF_SOC_CON6 0xc218 -#define RK3399_GRF_SOC_CON6_TX_MASK 0x7F -#define RK3399_GRF_SOC_CON6_TX_SHIFT 0 -#define RK3399_GRF_SOC_CON6_RX_MASK 0x7F -#define RK3399_GRF_SOC_CON6_RX_SHIFT 8 +static int +rk3328_set_speed(struct if_dwc_rk_softc *sc, int speed) +{ + uint32_t reg; -#ifdef notyet + switch (sc->base.phy_mode) { + case PHY_MODE_RGMII: + switch (speed) { + case IFM_1000_T: + case IFM_1000_SX: + reg = MAC_CON1_GMAC2IO_GMII_CLK_SEL_125; + break; + case IFM_100_TX: + reg = MAC_CON1_GMAC2IO_GMII_CLK_SEL_25; + break; + case IFM_10_T: + reg = MAC_CON1_GMAC2IO_GMII_CLK_SEL_2_5; + break; + default: + device_printf(sc->base.dev, "unsupported RGMII media %u\n", speed); + return (-1); + } + + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MAC_CON1, + ((MAC_CON1_GMAC2IO_GMII_CLK_SEL_MASK << 16) | reg)); + break; + case PHY_MODE_RMII: + switch (speed) { + case IFM_100_TX: + reg = MAC_CON1_GMAC2IO_RMII_CLK_SEL_25 | + MAC_CON1_GMAC2IO_MAC_SPEED_100; + break; + case IFM_10_T: + reg = MAC_CON1_GMAC2IO_RMII_CLK_SEL_2_5 | + MAC_CON1_GMAC2IO_MAC_SPEED_10; + break; + default: + device_printf(sc->base.dev, "unsupported RMII media %u\n", speed); + return (-1); + } + + SYSCON_WRITE_4(sc->grf, + sc->integrated_phy ? RK3328_GRF_MAC_CON2 : RK3328_GRF_MAC_CON1, + reg | + ((MAC_CON1_GMAC2IO_RMII_CLK_SEL_MASK | MAC_CON1_GMAC2IO_MAC_SPEED_MASK) << 16)); + break; + } + + return (0); +} + static void -rk3399_set_delays(struct syscon *grf, phandle_t node) +rk3328_set_phy_mode(struct if_dwc_rk_softc *sc) { - uint32_t tx, rx; - if (OF_getencprop(node, "tx_delay", &tx, sizeof(tx)) <= 0) - tx = 0x30; - if (OF_getencprop(node, "rx_delay", &rx, sizeof(rx)) <= 0) - rx = 0x10; + switch (sc->base.phy_mode) { + case PHY_MODE_RGMII: + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MAC_CON1, + ((MAC_CON1_GMAC2IO_INTF_SEL_MASK | MAC_CON1_GMAC2IO_RMII_MODE_MASK) << 16) | + MAC_CON1_GMAC2IO_INTF_RGMII); + break; + case PHY_MODE_RMII: + SYSCON_WRITE_4(sc->grf, sc->integrated_phy ? RK3328_GRF_MAC_CON2 : RK3328_GRF_MAC_CON1, + ((MAC_CON1_GMAC2IO_INTF_SEL_MASK | MAC_CON1_GMAC2IO_RMII_MODE_MASK) << 16) | + MAC_CON1_GMAC2IO_INTF_RMII | MAC_CON1_GMAC2IO_RMII_MODE); + break; + } +} - tx = ((tx & RK3399_GRF_SOC_CON6_TX_MASK) << - RK3399_GRF_SOC_CON6_TX_SHIFT); - rx = ((rx & RK3399_GRF_SOC_CON6_TX_MASK) << - RK3399_GRF_SOC_CON6_RX_SHIFT); +static void +rk3328_phy_powerup(struct if_dwc_rk_softc *sc) +{ + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MACPHY_CON1, + (MACPHY_CON1_RMII_MODE_MASK << 16) | + MACPHY_CON1_RMII_MODE); +} - SYSCON_WRITE_4(grf, RK3399_GRF_SOC_CON6, tx | rx | 0xFFFF0000); +static void +rk3399_set_delays(struct if_dwc_rk_softc *sc) +{ + uint32_t reg, tx, rx; + + if (sc->base.phy_mode != PHY_MODE_RGMII) + return; + + reg = SYSCON_READ_4(sc->grf, RK3399_GRF_SOC_CON6); + tx = ((reg >> SOC_CON6_TX_DL_CFG_SHIFT) & SOC_CON6_TX_DL_CFG_MASK); + rx = ((reg >> SOC_CON6_RX_DL_CFG_SHIFT) & SOC_CON6_RX_DL_CFG_MASK); + + if (bootverbose) { + device_printf(sc->base.dev, "current delays settings: tx=%u(%s) rx=%u(%s)\n", + tx, ((reg & SOC_CON6_GMAC_TXCLK_DLY_ENA) ? "enabled" : "disabled"), + rx, ((reg & SOC_CON6_GMAC_RXCLK_DLY_ENA) ? "enabled" : "disabled")); + + device_printf(sc->base.dev, "setting new RK3399 RX/TX delays: %d/%d\n", + sc->rx_delay, sc->tx_delay); + } + + reg = 0xFFFF << 16; + reg |= ((sc->tx_delay & SOC_CON6_TX_DL_CFG_MASK) << + SOC_CON6_TX_DL_CFG_SHIFT); + reg |= ((sc->rx_delay & SOC_CON6_RX_DL_CFG_MASK) << + SOC_CON6_RX_DL_CFG_SHIFT); + reg |= SOC_CON6_GMAC_TXCLK_DLY_ENA | SOC_CON6_GMAC_RXCLK_DLY_ENA; + + SYSCON_WRITE_4(sc->grf, RK3399_GRF_SOC_CON6, reg); } -#endif static int +rk3399_set_speed(struct if_dwc_rk_softc *sc, int speed) +{ + uint32_t reg; + + switch (speed) { + case IFM_1000_T: + case IFM_1000_SX: + reg = SOC_CON5_GMAC_CLK_SEL_125; + break; + case IFM_100_TX: + reg = SOC_CON5_GMAC_CLK_SEL_25; + break; + case IFM_10_T: + reg = SOC_CON5_GMAC_CLK_SEL_2_5; + break; + default: + device_printf(sc->base.dev, "unsupported media %u\n", speed); + return (-1); + } + + SYSCON_WRITE_4(sc->grf, RK3399_GRF_SOC_CON5, + ((SOC_CON5_GMAC_CLK_SEL_MASK << 16) | reg)); + return (0); +} + +static int +if_dwc_rk_sysctl_delays(SYSCTL_HANDLER_ARGS) +{ + struct if_dwc_rk_softc *sc; + int rv; + uint32_t rxtx; + + sc = arg1; + rxtx = ((sc->rx_delay << 8) | sc->tx_delay); + + rv = sysctl_handle_int(oidp, &rxtx, 0, req); + if (rv != 0 || req->newptr == NULL) + return (rv); + sc->tx_delay = rxtx & 0xff; + sc->rx_delay = (rxtx >> 8) & 0xff; + + if (sc->ops->set_delays) + sc->ops->set_delays(sc); + + return (0); +} + +static int +if_dwc_rk_init_sysctl(struct if_dwc_rk_softc *sc) +{ + struct sysctl_oid *child; + struct sysctl_ctx_list *ctx_list; + + ctx_list = device_get_sysctl_ctx(sc->base.dev); + child = device_get_sysctl_tree(sc->base.dev); + SYSCTL_ADD_PROC(ctx_list, + SYSCTL_CHILDREN(child), OID_AUTO, "delays", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, sc, 0, + if_dwc_rk_sysctl_delays, "", "RGMII RX/TX delays: ((rx << 8) | tx)"); + + return (0); +} + +static int if_dwc_rk_probe(device_t dev) { @@ -132,28 +391,189 @@ if_dwc_rk_probe(device_t dev) } static int +if_dwc_rk_init_clocks(device_t dev) +{ + struct if_dwc_rk_softc *sc; + int error; + + sc = device_get_softc(dev); + error = clk_set_assigned(dev, ofw_bus_get_node(dev)); + if (error != 0) { + device_printf(dev, "clk_set_assigned failed\n"); + return (error); + } + + /* Enable clocks */ + error = clk_get_by_ofw_name(dev, 0, "stmmaceth", &sc->clk_stmmaceth); + if (error != 0) { + device_printf(dev, "could not find clock stmmaceth\n"); + return (error); + } + + if (clk_get_by_ofw_name(dev, 0, "mac_clk_rx", &sc->mac_clk_rx) != 0) { + device_printf(sc->base.dev, "could not get mac_clk_rx clock\n"); + sc->mac_clk_rx = NULL; + } + + if (clk_get_by_ofw_name(dev, 0, "mac_clk_tx", &sc->mac_clk_tx) != 0) { + device_printf(sc->base.dev, "could not get mac_clk_tx clock\n"); + sc->mac_clk_tx = NULL; + } + + if (clk_get_by_ofw_name(dev, 0, "aclk_mac", &sc->aclk_mac) != 0) { + device_printf(sc->base.dev, "could not get aclk_mac clock\n"); + sc->aclk_mac = NULL; + } + + if (clk_get_by_ofw_name(dev, 0, "pclk_mac", &sc->pclk_mac) != 0) { + device_printf(sc->base.dev, "could not get pclk_mac clock\n"); + sc->pclk_mac = NULL; + } + + if (sc->base.phy_mode == PHY_MODE_RGMII) { + if (clk_get_by_ofw_name(dev, 0, "clk_mac_ref", &sc->clk_mac_ref) != 0) { + device_printf(sc->base.dev, "could not get clk_mac_ref clock\n"); + sc->clk_mac_ref = NULL; + } + + if (!sc->clock_in) { + if (clk_get_by_ofw_name(dev, 0, "clk_mac_refout", &sc->clk_mac_refout) != 0) { + device_printf(sc->base.dev, "could not get clk_mac_refout clock\n"); + sc->clk_mac_refout = NULL; + } + + clk_set_freq(sc->clk_stmmaceth, 50000000, 0); + } + } + + if ((sc->phy_node != 0) && sc->integrated_phy) { + if (clk_get_by_ofw_index(dev, sc->phy_node, 0, &sc->clk_phy) != 0) { + device_printf(sc->base.dev, "could not get PHY clock\n"); + sc->clk_phy = NULL; + } + + if (sc->clk_phy) { + clk_set_freq(sc->clk_phy, 50000000, 0); + } + } + + if (sc->base.phy_mode == PHY_MODE_RMII) { + if (sc->mac_clk_rx) + clk_enable(sc->mac_clk_rx); + if (sc->clk_mac_ref) + clk_enable(sc->clk_mac_ref); + if (sc->clk_mac_refout) + clk_enable(sc->clk_mac_refout); + } + if (sc->clk_phy) + clk_enable(sc->clk_phy); + if (sc->aclk_mac) + clk_enable(sc->aclk_mac); + if (sc->pclk_mac) + clk_enable(sc->pclk_mac); + if (sc->mac_clk_tx) + clk_enable(sc->mac_clk_tx); + + DELAY(50); + + return (0); +} + +static int if_dwc_rk_init(device_t dev) { + struct if_dwc_rk_softc *sc; phandle_t node; - struct syscon *grf = NULL; + uint32_t rx, tx; + int err; + pcell_t phy_handle; + char *clock_in_out; + hwreset_t phy_reset; + regulator_t phy_supply; + sc = device_get_softc(dev); node = ofw_bus_get_node(dev); + sc->ops = (struct if_dwc_rk_ops *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; if (OF_hasprop(node, "rockchip,grf") && syscon_get_by_ofw_property(dev, node, - "rockchip,grf", &grf) != 0) { + "rockchip,grf", &sc->grf) != 0) { device_printf(dev, "cannot get grf driver handle\n"); return (ENXIO); } -#ifdef notyet - if (ofw_bus_is_compatible(dev, "rockchip,rk3399-gmac")) - rk3399_set_delays(grf, node); - else if (ofw_bus_is_compatible(dev, "rockchip,rk3328-gmac")) - rk3328_set_delays(grf, node); -#endif + if (OF_getencprop(node, "tx_delay", &tx, sizeof(tx)) <= 0) + tx = 0x30; + if (OF_getencprop(node, "rx_delay", &rx, sizeof(rx)) <= 0) + rx = 0x10; + sc->tx_delay = tx; + sc->rx_delay = rx; - /* Mode should be set according to dtb property */ + sc->clock_in = true; + if (OF_getprop_alloc(node, "clock_in_out", (void **)&clock_in_out)) { + if (strcmp(clock_in_out, "input") == 0) + sc->clock_in = true; + else + sc->clock_in = false; + OF_prop_free(clock_in_out); + } + if (OF_getencprop(node, "phy-handle", (void *)&phy_handle, + sizeof(phy_handle)) > 0) + sc->phy_node = OF_node_from_xref(phy_handle); + + if (sc->phy_node) + sc->integrated_phy = OF_hasprop(sc->phy_node, "phy-is-integrated"); + + if (sc->integrated_phy) + device_printf(sc->base.dev, "PHY is integrated\n"); + + if_dwc_rk_init_clocks(dev); + + if (sc->ops->set_phy_mode) + sc->ops->set_phy_mode(sc); + + if (sc->ops->set_delays) + sc->ops->set_delays(sc); + + /* + * this also sets delays if tunable is defined + */ + err = if_dwc_rk_init_sysctl(sc); + if (err != 0) + return (err); + + if (regulator_get_by_ofw_property(sc->base.dev, 0, + "phy-supply", &phy_supply) == 0) { + if (regulator_enable(phy_supply)) { + device_printf(sc->base.dev, + "cannot enable 'phy' regulator\n"); + } + } + else + device_printf(sc->base.dev, "no phy-supply property\n"); + + /* Power up */ + if (sc->integrated_phy) { + if (sc->ops->phy_powerup) + sc->ops->phy_powerup(sc); + + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MACPHY_CON0, + (MACPHY_CON0_CLK_50M_MASK << 16) | + MACPHY_CON0_CLK_50M); + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MACPHY_CON0, + (MACPHY_CON0_RMII_MODE_MASK << 16) | + MACPHY_CON0_RMII_MODE); + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MACPHY_CON2, 0xffff1234); + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MACPHY_CON3, 0x003f0035); + + if (hwreset_get_by_ofw_idx(dev, sc->phy_node, 0, &phy_reset) == 0) { + hwreset_assert(phy_reset); + DELAY(20); + hwreset_deassert(phy_reset); + DELAY(20); + } + } + return (0); } @@ -172,12 +592,26 @@ if_dwc_rk_mii_clk(device_t dev) return (GMAC_MII_CLK_150_250M_DIV102); } +static int +if_dwc_rk_set_speed(device_t dev, int speed) +{ + struct if_dwc_rk_softc *sc; + + sc = device_get_softc(dev); + + if (sc->ops->set_speed) + return sc->ops->set_speed(sc, speed); + + return (0); +} + static device_method_t if_dwc_rk_methods[] = { DEVMETHOD(device_probe, if_dwc_rk_probe), DEVMETHOD(if_dwc_init, if_dwc_rk_init), DEVMETHOD(if_dwc_mac_type, if_dwc_rk_mac_type), DEVMETHOD(if_dwc_mii_clk, if_dwc_rk_mii_clk), + DEVMETHOD(if_dwc_set_speed, if_dwc_rk_set_speed), DEVMETHOD_END }; @@ -187,6 +621,6 @@ static devclass_t dwc_rk_devclass; extern driver_t dwc_driver; DEFINE_CLASS_1(dwc, dwc_rk_driver, if_dwc_rk_methods, - sizeof(struct dwc_softc), dwc_driver); + sizeof(struct if_dwc_rk_softc), dwc_driver); DRIVER_MODULE(dwc_rk, simplebus, dwc_rk_driver, dwc_rk_devclass, 0, 0); MODULE_DEPEND(dwc_rk, dwc, 1, 1, 1); Modified: stable/12/sys/dev/dwc/if_dwc.c ============================================================================== --- stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 18:48:50 2020 (r365387) +++ stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 19:03:19 2020 (r365388) @@ -1209,15 +1209,23 @@ dwc_clock_init(device_t dev) hwreset_t rst; clk_t clk; int error; + int64_t freq; - /* Enable clock */ + /* Enable clocks */ if (clk_get_by_ofw_name(dev, 0, "stmmaceth", &clk) == 0) { error = clk_enable(clk); if (error != 0) { device_printf(dev, "could not enable main clock\n"); return (error); } + if (bootverbose) { + clk_get_freq(clk, &freq); + device_printf(dev, "MAC clock(%s) freq: %ld\n", clk_get_name(clk), freq); + } } + else { + device_printf(dev, "could not find clock stmmaceth\n"); + } /* De-assert reset */ if (hwreset_get_by_ofw_name(dev, 0, "stmmaceth", &rst) == 0) { @@ -1254,6 +1262,8 @@ dwc_attach(device_t dev) struct ifnet *ifp; int error, i; uint32_t reg; + char *phy_mode; + phandle_t node; sc = device_get_softc(dev); sc->dev = dev; @@ -1262,6 +1272,15 @@ dwc_attach(device_t dev) sc->mii_clk = IF_DWC_MII_CLK(dev); sc->mactype = IF_DWC_MAC_TYPE(dev); + node = ofw_bus_get_node(dev); + if (OF_getprop_alloc(node, "phy-mode", (void **)&phy_mode)) { + if (strcmp(phy_mode, "rgmii") == 0) + sc->phy_mode = PHY_MODE_RGMII; + if (strcmp(phy_mode, "rmii") == 0) + sc->phy_mode = PHY_MODE_RMII; + OF_prop_free(phy_mode); + } + if (IF_DWC_INIT(dev) != 0) return (ENXIO); @@ -1475,6 +1494,9 @@ dwc_miibus_statchg(device_t dev) else reg &= ~(CONF_DM); WRITE4(sc, MAC_CONFIGURATION, reg); + + IF_DWC_SET_SPEED(dev, IFM_SUBTYPE(mii->mii_media_active)); + } static device_method_t dwc_methods[] = { Modified: stable/12/sys/dev/dwc/if_dwc.h ============================================================================== --- stable/12/sys/dev/dwc/if_dwc.h Sun Sep 6 18:48:50 2020 (r365387) +++ stable/12/sys/dev/dwc/if_dwc.h Sun Sep 6 19:03:19 2020 (r365388) @@ -37,6 +37,10 @@ #ifndef __IF_DWC_H__ #define __IF_DWC_H__ +#define PHY_MODE_UNKNOWN 0x0 +#define PHY_MODE_RMII 0x1 +#define PHY_MODE_RGMII 0x2 + #define MAC_CONFIGURATION 0x0 #define CONF_JD (1 << 22) /* jabber timer disable */ #define CONF_BE (1 << 21) /* Frame Burst Enable */ Modified: stable/12/sys/dev/dwc/if_dwc_if.m ============================================================================== --- stable/12/sys/dev/dwc/if_dwc_if.m Sun Sep 6 18:48:50 2020 (r365387) +++ stable/12/sys/dev/dwc/if_dwc_if.m Sun Sep 6 19:03:19 2020 (r365388) @@ -49,6 +49,12 @@ CODE { { return (GMAC_MII_CLK_25_35M_DIV16); } + + static int + if_dwc_default_set_speed(device_t dev, int speed) + { + return (0); + } }; HEADER { @@ -74,3 +80,11 @@ METHOD int mac_type { METHOD int mii_clk { device_t dev; } DEFAULT if_dwc_default_mii_clk; + +# +# Signal media change to a specific hardware +# +METHOD int set_speed { + device_t dev; + int speed; +} DEFAULT if_dwc_default_set_speed; Modified: stable/12/sys/dev/dwc/if_dwcvar.h ============================================================================== --- stable/12/sys/dev/dwc/if_dwcvar.h Sun Sep 6 18:48:50 2020 (r365387) +++ stable/12/sys/dev/dwc/if_dwcvar.h Sun Sep 6 19:03:19 2020 (r365388) @@ -71,6 +71,7 @@ struct dwc_softc { boolean_t is_detaching; int tx_watchdog_count; int stats_harvest_count; + int phy_mode; /* RX */ bus_dma_tag_t rxdesc_tag; From owner-svn-src-stable@freebsd.org Sun Sep 6 20:03:14 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E2D13DC21D; Sun, 6 Sep 2020 20:03:14 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl2Qp0VnXz4QCy; Sun, 6 Sep 2020 20:03:14 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E825513F8E; Sun, 6 Sep 2020 20:03:13 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086K3DDI053919; Sun, 6 Sep 2020 20:03:13 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086K3DCV053918; Sun, 6 Sep 2020 20:03:13 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202009062003.086K3DCV053918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 6 Sep 2020 20:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365390 - stable/12/sys/dev/dwc X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/12/sys/dev/dwc X-SVN-Commit-Revision: 365390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2020 20:03:14 -0000 Author: gonzo Date: Sun Sep 6 20:03:13 2020 New Revision: 365390 URL: https://svnweb.freebsd.org/changeset/base/365390 Log: MFC r364098 by lwhsu: Fix armv{6,7} build after r364088 Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/dev/dwc/if_dwc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/dwc/if_dwc.c ============================================================================== --- stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 19:25:31 2020 (r365389) +++ stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 20:03:13 2020 (r365390) @@ -1220,7 +1220,8 @@ dwc_clock_init(device_t dev) } if (bootverbose) { clk_get_freq(clk, &freq); - device_printf(dev, "MAC clock(%s) freq: %ld\n", clk_get_name(clk), freq); + device_printf(dev, "MAC clock(%s) freq: %jd\n", + clk_get_name(clk), (intmax_t)freq); } } else { From owner-svn-src-stable@freebsd.org Mon Sep 7 06:14:43 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AB2D3EA34E; Mon, 7 Sep 2020 06:14:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlJ0L6t93z3Rcg; Mon, 7 Sep 2020 06:14:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6F0C1B21A; Mon, 7 Sep 2020 06:14:42 +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 0876EgMo026782; Mon, 7 Sep 2020 06:14:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0876EgED026781; Mon, 7 Sep 2020 06:14:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009070614.0876EgED026781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 7 Sep 2020 06:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365392 - stable/12/sys/dev/gpio X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/gpio X-SVN-Commit-Revision: 365392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 06:14:43 -0000 Author: avg Date: Mon Sep 7 06:14:42 2020 New Revision: 365392 URL: https://svnweb.freebsd.org/changeset/base/365392 Log: MFC r364145: gpiokeys: add evdev support Only linux,code is supported as it maps 1:1 to evdev key codes. No reverse mapping for freebsd,code yet. Modified: stable/12/sys/dev/gpio/gpiokeys.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/gpio/gpiokeys.c ============================================================================== --- stable/12/sys/dev/gpio/gpiokeys.c Sun Sep 6 20:32:13 2020 (r365391) +++ stable/12/sys/dev/gpio/gpiokeys.c Mon Sep 7 06:14:42 2020 (r365392) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "opt_platform.h" #include "opt_kbd.h" +#include "opt_evdev.h" #include #include @@ -56,6 +57,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef EVDEV_SUPPORT +#include +#include +#endif + #define KBD_DRIVER_NAME "gpiokeys" #define GPIOKEYS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) @@ -99,6 +105,9 @@ struct gpiokey struct resource *irq_res; void *intr_hl; struct mtx mtx; +#ifdef EVDEV_SUPPORT + uint32_t evcode; +#endif uint32_t keycode; int autorepeat; struct callout debounce_callout; @@ -115,6 +124,9 @@ struct gpiokeys_softc struct gpiokey *sc_keys; int sc_total_keys; +#ifdef EVDEV_SUPPORT + struct evdev_dev *sc_evdev; +#endif keyboard_t sc_kbd; keymap_t sc_keymap; accentmap_t sc_accmap; @@ -171,26 +183,34 @@ gpiokeys_put_key(struct gpiokeys_softc *sc, uint32_t k } static void -gpiokeys_key_event(struct gpiokeys_softc *sc, uint16_t keycode, int pressed) +gpiokeys_key_event(struct gpiokeys_softc *sc, struct gpiokey *key, int pressed) { - uint32_t key; + uint32_t code; - - key = keycode & SCAN_KEYCODE_MASK; - - if (!pressed) - key |= KEY_RELEASE; - GPIOKEYS_LOCK(sc); - if (keycode & SCAN_PREFIX_E0) - gpiokeys_put_key(sc, 0xe0); - else if (keycode & SCAN_PREFIX_E1) - gpiokeys_put_key(sc, 0xe1); +#ifdef EVDEV_SUPPORT + if (key->evcode != GPIOKEY_NONE && + (evdev_rcpt_mask & EVDEV_RCPT_HW_KBD) != 0) { + evdev_push_key(sc->sc_evdev, key->evcode, pressed); + evdev_sync(sc->sc_evdev); + } +#endif + if (key->keycode != GPIOKEY_NONE) { + code = key->keycode & SCAN_KEYCODE_MASK; + if (!pressed) + code |= KEY_RELEASE; - gpiokeys_put_key(sc, key); + if (key->keycode & SCAN_PREFIX_E0) + gpiokeys_put_key(sc, 0xe0); + else if (key->keycode & SCAN_PREFIX_E1) + gpiokeys_put_key(sc, 0xe1); + + gpiokeys_put_key(sc, code); + } GPIOKEYS_UNLOCK(sc); - gpiokeys_event_keyinput(sc); + if (key->keycode != GPIOKEY_NONE) + gpiokeys_event_keyinput(sc); } static void @@ -200,11 +220,8 @@ gpiokey_autorepeat(void *arg) key = arg; - if (key->keycode == GPIOKEY_NONE) - return; + gpiokeys_key_event(key->parent_sc, key, 1); - gpiokeys_key_event(key->parent_sc, key->keycode, 1); - callout_reset(&key->repeat_callout, key->repeat, gpiokey_autorepeat, key); } @@ -217,12 +234,9 @@ gpiokey_debounced_intr(void *arg) key = arg; - if (key->keycode == GPIOKEY_NONE) - return; - gpio_pin_is_active(key->pin, &active); if (active) { - gpiokeys_key_event(key->parent_sc, key->keycode, 1); + gpiokeys_key_event(key->parent_sc, key, 1); if (key->autorepeat) { callout_reset(&key->repeat_callout, key->repeat_delay, gpiokey_autorepeat, key); @@ -232,7 +246,7 @@ gpiokey_debounced_intr(void *arg) if (key->autorepeat && callout_pending(&key->repeat_callout)) callout_stop(&key->repeat_callout); - gpiokeys_key_event(key->parent_sc, key->keycode, 0); + gpiokeys_key_event(key->parent_sc, key, 0); } } @@ -301,6 +315,10 @@ gpiokeys_attach_key(struct gpiokeys_softc *sc, phandle if (key->keycode == GPIOKEY_NONE) device_printf(sc->sc_dev, "<%s> failed to map linux,code value 0x%x\n", key_name, code); +#ifdef EVDEV_SUPPORT + key->evcode = code; + evdev_support_key(sc->sc_evdev, code); +#endif } else device_printf(sc->sc_dev, "<%s> no linux,code or freebsd,code property\n", @@ -365,7 +383,6 @@ gpiokeys_detach_key(struct gpiokeys_softc *sc, struct if (key->pin) gpio_pin_release(key->pin); GPIOKEY_UNLOCK(key); - GPIOKEY_LOCK_DESTROY(key); } @@ -383,11 +400,14 @@ gpiokeys_probe(device_t dev) static int gpiokeys_attach(device_t dev) { - int unit; struct gpiokeys_softc *sc; keyboard_t *kbd; +#ifdef EVDEV_SUPPORT + char *name; +#endif phandle_t keys, child; int total_keys; + int unit; if ((keys = ofw_bus_get_node(dev)) == -1) return (ENXIO); @@ -435,6 +455,19 @@ gpiokeys_attach(device_t dev) kbdd_diag(kbd, 1); } +#ifdef EVDEV_SUPPORT + sc->sc_evdev = evdev_alloc(); + evdev_set_name(sc->sc_evdev, device_get_desc(dev)); + + OF_getprop_alloc(keys, "name", (void **)&name); + evdev_set_phys(sc->sc_evdev, name != NULL ? name : "unknown"); + OF_prop_free(name); + + evdev_set_id(sc->sc_evdev, BUS_VIRTUAL, 0, 0, 0); + evdev_support_event(sc->sc_evdev, EV_SYN); + evdev_support_event(sc->sc_evdev, EV_KEY); +#endif + total_keys = 0; /* Traverse the 'gpio-keys' node and count keys */ @@ -458,6 +491,13 @@ gpiokeys_attach(device_t dev) } } +#ifdef EVDEV_SUPPORT + if (evdev_register_mtx(sc->sc_evdev, &sc->sc_mtx) != 0) { + device_printf(dev, "failed to register evdev device\n"); + goto detach; + } +#endif + return (0); detach: @@ -484,6 +524,10 @@ gpiokeys_detach(device_t dev) kbd_detach(kbd); #endif kbd_unregister(kbd); + +#ifdef EVDEV_SUPPORT + evdev_free(sc->sc_evdev); +#endif GPIOKEYS_LOCK_DESTROY(sc); if (sc->sc_keys) From owner-svn-src-stable@freebsd.org Mon Sep 7 06:21:02 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44C513EA6A4; Mon, 7 Sep 2020 06:21:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlJ7f17Cnz3SCc; Mon, 7 Sep 2020 06:21: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09FF01B404; Mon, 7 Sep 2020 06:21: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 0876L1ZW029689; Mon, 7 Sep 2020 06:21:01 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0876L1O1029688; Mon, 7 Sep 2020 06:21:01 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009070621.0876L1O1029688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 7 Sep 2020 06:21:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365393 - stable/12/sys/arm/allwinner X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/arm/allwinner X-SVN-Commit-Revision: 365393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 06:21:02 -0000 Author: avg Date: Mon Sep 7 06:21:01 2020 New Revision: 365393 URL: https://svnweb.freebsd.org/changeset/base/365393 Log: MFC r364148: aw_cir: lower activation threshold to support NECx protocol Modified: stable/12/sys/arm/allwinner/aw_cir.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/aw_cir.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_cir.c Mon Sep 7 06:14:42 2020 (r365392) +++ stable/12/sys/arm/allwinner/aw_cir.c Mon Sep 7 06:21:01 2020 (r365393) @@ -126,8 +126,10 @@ __FBSDID("$FreeBSD$"); #define AW_IR_DMAX 53 /* Active Thresholds */ -#define AW_IR_ACTIVE_T ((0 & 0xff) << 16) -#define AW_IR_ACTIVE_T_C ((1 & 0xff) << 23) +#define AW_IR_ACTIVE_T_VAL AW_IR_L1_MIN +#define AW_IR_ACTIVE_T (((AW_IR_ACTIVE_T_VAL - 1) & 0xff) << 16) +#define AW_IR_ACTIVE_T_C_VAL 0 +#define AW_IR_ACTIVE_T_C ((AW_IR_ACTIVE_T_C_VAL & 0xff) << 23) /* Code masks */ #define CODE_MASK 0x00ff00ff @@ -209,9 +211,9 @@ aw_ir_decode_packets(struct aw_ir_softc *sc) device_printf(sc->dev, "sc->dcnt = %d\n", sc->dcnt); /* Find Lead 1 (bit separator) */ - active_delay = (AW_IR_ACTIVE_T + 1) * (AW_IR_ACTIVE_T_C != 0 ? 128 : 1); - len = 0; - len += (active_delay >> 1); + active_delay = AW_IR_ACTIVE_T_VAL * + (AW_IR_ACTIVE_T_C_VAL != 0 ? 128 : 1); + len = active_delay; if (bootverbose) device_printf(sc->dev, "Initial len: %ld\n", len); for (i = 0; i < sc->dcnt; i++) { From owner-svn-src-stable@freebsd.org Mon Sep 7 06:22:31 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2081E3EA89B; Mon, 7 Sep 2020 06:22:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlJ9M01PGz3SYC; Mon, 7 Sep 2020 06:22:31 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D80451B556; Mon, 7 Sep 2020 06:22:30 +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 0876MUme033087; Mon, 7 Sep 2020 06:22:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0876MUiI033086; Mon, 7 Sep 2020 06:22:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009070622.0876MUiI033086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 7 Sep 2020 06:22:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365394 - stable/12/sys/arm/allwinner X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/arm/allwinner X-SVN-Commit-Revision: 365394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 06:22:31 -0000 Author: avg Date: Mon Sep 7 06:22:30 2020 New Revision: 365394 URL: https://svnweb.freebsd.org/changeset/base/365394 Log: MFC r364149: aw_cir: in pulse encoding actual length is one greater than value Modified: stable/12/sys/arm/allwinner/aw_cir.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/aw_cir.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_cir.c Mon Sep 7 06:21:01 2020 (r365393) +++ stable/12/sys/arm/allwinner/aw_cir.c Mon Sep 7 06:22:30 2020 (r365394) @@ -202,9 +202,9 @@ aw_ir_read_data(struct aw_ir_softc *sc) static unsigned long aw_ir_decode_packets(struct aw_ir_softc *sc) { - unsigned long len, code; - unsigned char val, last; + unsigned int len, code; unsigned int active_delay; + unsigned char val, last; int i, bitcount; if (bootverbose) @@ -215,11 +215,11 @@ aw_ir_decode_packets(struct aw_ir_softc *sc) (AW_IR_ACTIVE_T_C_VAL != 0 ? 128 : 1); len = active_delay; if (bootverbose) - device_printf(sc->dev, "Initial len: %ld\n", len); + device_printf(sc->dev, "Initial len: %d\n", len); for (i = 0; i < sc->dcnt; i++) { val = sc->buf[i]; if (val & VAL_MASK) - len += val & PERIOD_MASK; + len += (val & PERIOD_MASK) + 1; else { if (len > AW_IR_L1_MIN) break; @@ -227,7 +227,7 @@ aw_ir_decode_packets(struct aw_ir_softc *sc) } } if (bootverbose) - device_printf(sc->dev, "len = %ld\n", len); + device_printf(sc->dev, "len = %d\n", len); if ((val & VAL_MASK) || (len <= AW_IR_L1_MIN)) { if (bootverbose) device_printf(sc->dev, "Bit separator error\n"); @@ -243,7 +243,7 @@ aw_ir_decode_packets(struct aw_ir_softc *sc) break; len = 0; } else - len += val & PERIOD_MASK; + len += (val & PERIOD_MASK) + 1; } if ((!(val & VAL_MASK)) || (len <= AW_IR_L0_MIN)) { if (bootverbose) @@ -260,23 +260,25 @@ aw_ir_decode_packets(struct aw_ir_softc *sc) val = sc->buf[i]; if (last) { if (val & VAL_MASK) - len += val & PERIOD_MASK; + len += (val & PERIOD_MASK) + 1; else { if (len > AW_IR_PMAX) { if (bootverbose) device_printf(sc->dev, - "Pulse error\n"); + "Pulse error, len=%d\n", + len); goto error_code; } last = 0; - len = val & PERIOD_MASK; + len = (val & PERIOD_MASK) + 1; } } else { if (val & VAL_MASK) { if (len > AW_IR_DMAX) { if (bootverbose) device_printf(sc->dev, - "Distant error\n"); + "Distance error, len=%d\n", + len); goto error_code; } else { if (len > AW_IR_DMID) { @@ -288,9 +290,9 @@ aw_ir_decode_packets(struct aw_ir_softc *sc) break; /* Finish decoding */ } last = 1; - len = val & PERIOD_MASK; + len = (val & PERIOD_MASK) + 1; } else - len += val & PERIOD_MASK; + len += (val & PERIOD_MASK) + 1; } } return (code); From owner-svn-src-stable@freebsd.org Mon Sep 7 10:34:24 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A9E13EE12B; Mon, 7 Sep 2020 10:34:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlPlz68p9z3gV4; Mon, 7 Sep 2020 10:34: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DB631E387; Mon, 7 Sep 2020 10:34: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 087AYN7X086391; Mon, 7 Sep 2020 10:34:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087AYMMv086388; Mon, 7 Sep 2020 10:34:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071034.087AYMMv086388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365405 - in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 365405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 10:34:24 -0000 Author: kib Date: Mon Sep 7 10:34:22 2020 New Revision: 365405 URL: https://svnweb.freebsd.org/changeset/base/365405 Log: MFC r364999: mlx5_core: Import PDDR register definitions Modified: stable/12/sys/dev/mlx5/driver.h stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h stable/12/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/driver.h ============================================================================== --- stable/12/sys/dev/mlx5/driver.h Mon Sep 7 10:13:54 2020 (r365404) +++ stable/12/sys/dev/mlx5/driver.h Mon Sep 7 10:34:22 2020 (r365405) @@ -145,6 +145,7 @@ enum { MLX5_REG_PMPE = 0x5010, MLX5_REG_PMAOS = 0x5012, MLX5_REG_PPLM = 0x5023, + MLX5_REG_PDDR = 0x5031, MLX5_REG_PBSR = 0x5038, MLX5_REG_PCAM = 0x507f, MLX5_REG_NODE_DESC = 0x6001, Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:13:54 2020 (r365404) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:34:22 2020 (r365405) @@ -79,6 +79,35 @@ enum mlx5_semaphore_space_address { struct mlx5_core_dev; +enum mlx5_pddr_page_select { + MLX5_PDDR_OPERATIONAL_INFO_PAGE = 0x0, + MLX5_PDDR_TROUBLESHOOTING_INFO_PAGE = 0x1, + MLX5_PDDR_MODULE_INFO_PAGE = 0x3, +}; + +enum mlx5_pddr_monitor_opcodes { + MLX5_LINK_NO_ISSUE_OBSERVED = 0x0, + MLX5_LINK_PORT_CLOSED = 0x1, + MLX5_LINK_AN_FAILURE = 0x2, + MLX5_LINK_TRAINING_FAILURE = 0x5, + MLX5_LINK_LOGICAL_MISMATCH = 0x9, + MLX5_LINK_REMOTE_FAULT_INDICATION = 0xe, + MLX5_LINK_BAD_SIGNAL_INTEGRITY = 0xf, + MLX5_LINK_CABLE_COMPLIANCE_CODE_MISMATCH = 0x10, + MLX5_LINK_INTERNAL_ERR = 0x17, + MLX5_LINK_INFO_NOT_AVAIL = 0x3ff, + MLX5_LINK_CABLE_UNPLUGGED = 0x400, + MLX5_LINK_LONG_RANGE_FOR_NON_MLX_CABLE = 0x401, + MLX5_LINK_BUS_STUCK = 0x402, + MLX5_LINK_UNSUPP_EEPROM = 0x403, + MLX5_LINK_PART_NUM_LIST = 0x404, + MLX5_LINK_UNSUPP_CABLE = 0x405, + MLX5_LINK_MODULE_TEMP_SHUTDOWN = 0x406, + MLX5_LINK_SHORTED_CABLE = 0x407, + MLX5_LINK_POWER_BUDGET_EXCEEDED = 0x408, + MLX5_LINK_MNG_FORCED_DOWN = 0x409, +}; + int mlx5_query_hca_caps(struct mlx5_core_dev *dev); int mlx5_query_board_id(struct mlx5_core_dev *dev); int mlx5_query_qcam_reg(struct mlx5_core_dev *mdev, u32 *qcam, Modified: stable/12/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:13:54 2020 (r365404) +++ stable/12/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:34:22 2020 (r365405) @@ -849,23 +849,6 @@ struct mlx5_ifc_pddr_module_info_bits { u8 reserved_at_4c0[0x300]; }; -union mlx5_ifc_pddr_operation_info_page_pddr_phy_info_page_pddr_troubleshooting_page_pddr_module_info_auto_bits { - struct mlx5_ifc_pddr_module_info_bits pddr_module_info; - u8 reserved_at_0[0x7c0]; -}; - -struct mlx5_ifc_pddr_reg_bits { - u8 reserved_at_0[0x8]; - u8 local_port[0x8]; - u8 pnat[0x2]; - u8 reserved_at_12[0xe]; - - u8 reserved_at_20[0x18]; - u8 page_select[0x8]; - - union mlx5_ifc_pddr_operation_info_page_pddr_phy_info_page_pddr_troubleshooting_page_pddr_module_info_auto_bits page_data; -}; - struct mlx5_ifc_per_protocol_networking_offload_caps_bits { u8 csum_cap[0x1]; u8 vlan_cap[0x1]; @@ -8637,7 +8620,10 @@ struct mlx5_ifc_pcam_regs_5000_to_507f_bits { u8 port_access_reg_cap_mask_127_to_96[0x20]; u8 port_access_reg_cap_mask_95_to_64[0x20]; - u8 port_access_reg_cap_mask_63_to_36[0x1c]; + u8 reserved_at_40[0xe]; + u8 pddr[0x1]; + u8 reserved_at_4f[0xd]; + u8 pplm[0x1]; u8 port_access_reg_cap_mask_34_to_32[0x3]; @@ -10189,6 +10175,46 @@ struct mlx5_ifc_mpcnt_reg_ext_bits { u8 reserved_at_21[0x1f]; union mlx5_ifc_mpcnt_reg_counter_set_auto_ext_bits counter_set; +}; + +struct mlx5_ifc_monitor_opcodes_layout_bits { + u8 reserved_at_0[0x10]; + u8 monitor_opcode[0x10]; +}; + +union mlx5_ifc_pddr_status_opcode_bits { + struct mlx5_ifc_monitor_opcodes_layout_bits monitor_opcodes; + u8 reserved_at_0[0x20]; +}; + +struct mlx5_ifc_troubleshooting_info_page_layout_bits { + u8 reserved_at_0[0x10]; + u8 group_opcode[0x10]; + + union mlx5_ifc_pddr_status_opcode_bits status_opcode; + + u8 user_feedback_data[0x10]; + u8 user_feedback_index[0x10]; + + u8 status_message[0x760]; +}; + +union mlx5_ifc_pddr_page_data_bits { + struct mlx5_ifc_troubleshooting_info_page_layout_bits troubleshooting_info_page; + struct mlx5_ifc_pddr_module_info_bits pddr_module_info; + u8 reserved_at_0[0x7c0]; +}; + +struct mlx5_ifc_pddr_reg_bits { + u8 reserved_at_0[0x8]; + u8 local_port[0x8]; + u8 pnat[0x2]; + u8 reserved_at_12[0xe]; + + u8 reserved_at_20[0x18]; + u8 page_select[0x8]; + + union mlx5_ifc_pddr_page_data_bits page_data; }; enum { From owner-svn-src-stable@freebsd.org Mon Sep 7 10:35:23 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA9083EDEDF; Mon, 7 Sep 2020 10:35:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlPn74vxZz3gjb; Mon, 7 Sep 2020 10:35: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BC211E406; Mon, 7 Sep 2020 10:35: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 087AZNMr086501; Mon, 7 Sep 2020 10:35:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087AZNA2086499; Mon, 7 Sep 2020 10:35:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071035.087AZNA2086499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365406 - in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 365406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 10:35:23 -0000 Author: kib Date: Mon Sep 7 10:35:22 2020 New Revision: 365406 URL: https://svnweb.freebsd.org/changeset/base/365406 Log: MFC r365000: mlx5_core: add mlx5_query_pddr(). Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c stable/12/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:34:22 2020 (r365405) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:35:22 2020 (r365406) @@ -1175,19 +1175,29 @@ out: return err; } +static int mlx5_query_pddr(struct mlx5_core_dev *mdev, + u8 local_port, int page_select, u32 *out, int outlen) +{ + u32 in[MLX5_ST_SZ_DW(pddr_reg)] = {0}; + + if (!MLX5_CAP_PCAM_REG(mdev, pddr)) + return -EOPNOTSUPP; + + MLX5_SET(pddr_reg, in, local_port, local_port); + MLX5_SET(pddr_reg, in, page_select, page_select); + + return mlx5_core_access_reg(mdev, in, sizeof(in), out, outlen, MLX5_REG_PDDR, 0, 0); +} + int mlx5_query_pddr_range_info(struct mlx5_core_dev *mdev, u8 local_port, u8 *is_er_type) { u32 pddr_reg[MLX5_ST_SZ_DW(pddr_reg)] = {}; - int sz = MLX5_ST_SZ_BYTES(pddr_reg); int error; u8 ecc; u8 ci; - MLX5_SET(pddr_reg, pddr_reg, local_port, local_port); - MLX5_SET(pddr_reg, pddr_reg, page_select, 3 /* module info page */); - - error = mlx5_core_access_reg(mdev, pddr_reg, sz, pddr_reg, sz, - MLX5_ACCESS_REG_SUMMARY_CTRL_ID_PDDR, 0, 0); + error = mlx5_query_pddr(mdev, local_port, MLX5_PDDR_MODULE_INFO_PAGE, + pddr_reg, sizeof(pddr_reg)); if (error != 0) return (error); Modified: stable/12/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:34:22 2020 (r365405) +++ stable/12/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:35:22 2020 (r365406) @@ -757,10 +757,6 @@ struct mlx5_ifc_flow_table_nic_cap_bits { u8 reserved_1[0x7200]; }; -enum { - MLX5_ACCESS_REG_SUMMARY_CTRL_ID_PDDR = 0x5031, -}; - struct mlx5_ifc_pddr_module_info_bits { u8 cable_technology[0x8]; u8 cable_breakout[0x8]; From owner-svn-src-stable@freebsd.org Mon Sep 7 10:36:08 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C95FA3EE2C8; Mon, 7 Sep 2020 10:36:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlPp04vF2z3gmy; Mon, 7 Sep 2020 10:36:08 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B4161E198; Mon, 7 Sep 2020 10:36:08 +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 087Aa8tf086590; Mon, 7 Sep 2020 10:36:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087Aa7rl086587; Mon, 7 Sep 2020 10:36:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071036.087Aa7rl086587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365407 - in stable/12/sys/dev/mlx5: mlx5_core mlx5_en X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys/dev/mlx5: mlx5_core mlx5_en X-SVN-Commit-Revision: 365407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 10:36:08 -0000 Author: kib Date: Mon Sep 7 10:36:07 2020 New Revision: 365407 URL: https://svnweb.freebsd.org/changeset/base/365407 Log: MFC r365001: mlx5en: Implement SIOCGIFDOWNREASON. Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:35:22 2020 (r365406) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:36:07 2020 (r365407) @@ -127,6 +127,9 @@ void mlx5_core_event(struct mlx5_core_dev *dev, enum m void mlx5_enter_error_state(struct mlx5_core_dev *dev, bool force); void mlx5_disable_device(struct mlx5_core_dev *dev); void mlx5_recover_device(struct mlx5_core_dev *dev); +int mlx5_query_pddr_troubleshooting_info(struct mlx5_core_dev *mdev, + u16 *monitor_opcode, + u8 *status_message, size_t sm_len); int mlx5_register_device(struct mlx5_core_dev *dev); void mlx5_unregister_device(struct mlx5_core_dev *dev); Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:35:22 2020 (r365406) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:36:07 2020 (r365407) @@ -1221,6 +1221,31 @@ int mlx5_query_pddr_range_info(struct mlx5_core_dev *m } EXPORT_SYMBOL_GPL(mlx5_query_pddr_range_info); +int mlx5_query_pddr_troubleshooting_info(struct mlx5_core_dev *mdev, + u16 *monitor_opcode, u8 *status_message, size_t sm_len) +{ + int outlen = MLX5_ST_SZ_BYTES(pddr_reg); + u32 out[MLX5_ST_SZ_DW(pddr_reg)] = {0}; + int err; + + err = mlx5_query_pddr(mdev, MLX5_PDDR_TROUBLESHOOTING_INFO_PAGE, 1, + out, outlen); + if (err != 0) + return err; + if (monitor_opcode != NULL) { + *monitor_opcode = MLX5_GET(pddr_reg, out, + page_data.troubleshooting_info_page.status_opcode. + monitor_opcodes); + } + if (status_message != NULL) { + strlcpy(status_message, + MLX5_ADDR_OF(pddr_reg, out, + page_data.troubleshooting_info_page.status_message), + sm_len); + } + return (0); +} + int mlx5_query_mfrl_reg(struct mlx5_core_dev *mdev, u8 *reset_level) { Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Sep 7 10:35:22 2020 (r365406) +++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Sep 7 10:36:07 2020 (r365407) @@ -3195,6 +3195,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t { struct mlx5e_priv *priv; struct ifreq *ifr; + struct ifdownreason *ifdr; struct ifi2creq i2c; int error = 0; int mask = 0; @@ -3456,6 +3457,16 @@ out: error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); err_i2c: PRIV_UNLOCK(priv); + break; + case SIOCGIFDOWNREASON: + ifdr = (struct ifdownreason *)data; + bzero(ifdr->ifdr_msg, sizeof(ifdr->ifdr_msg)); + PRIV_LOCK(priv); + error = -mlx5_query_pddr_troubleshooting_info(priv->mdev, NULL, + ifdr->ifdr_msg, sizeof(ifdr->ifdr_msg)); + PRIV_UNLOCK(priv); + if (error == 0) + ifdr->ifdr_reason = IFDR_REASON_MSG; break; default: From owner-svn-src-stable@freebsd.org Mon Sep 7 10:36:53 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4B393EE15F; Mon, 7 Sep 2020 10:36:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlPps5kVnz3xwN; Mon, 7 Sep 2020 10:36: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A82491E30B; Mon, 7 Sep 2020 10:36: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 087AarqN086677; Mon, 7 Sep 2020 10:36:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087AarZd086676; Mon, 7 Sep 2020 10:36:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071036.087AarZd086676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365408 - stable/12/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 365408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 10:36:54 -0000 Author: kib Date: Mon Sep 7 10:36:53 2020 New Revision: 365408 URL: https://svnweb.freebsd.org/changeset/base/365408 Log: MFC r365002: mlx5 sriov: add error message for failed MAC programming on VF. Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:36:07 2020 (r365407) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:36:53 2020 (r365408) @@ -1838,6 +1838,11 @@ mlx5_iov_add_vf(device_t dev, uint16_t vfnum, const nv &mac_size); error = -mlx5_eswitch_set_vport_mac(priv->eswitch, vfnum + 1, __DECONST(u8 *, mac)); + if (error != 0) { + mlx5_core_err(core_dev, + "setting MAC for VF %d failed, error %d\n", + vfnum + 1, error); + } } error = -mlx5_eswitch_set_vport_state(priv->eswitch, vfnum + 1, From owner-svn-src-stable@freebsd.org Mon Sep 7 10:37:45 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EBA03EE59E; Mon, 7 Sep 2020 10:37:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlPqs0RJxz3gtM; Mon, 7 Sep 2020 10:37:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E66981E407; Mon, 7 Sep 2020 10:37:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087AbiSP086768; Mon, 7 Sep 2020 10:37:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087Abih6086767; Mon, 7 Sep 2020 10:37:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071037.087Abih6086767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365409 - stable/12/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 365409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 10:37:45 -0000 Author: kib Date: Mon Sep 7 10:37:44 2020 New Revision: 365409 URL: https://svnweb.freebsd.org/changeset/base/365409 Log: MFC r365003: mlx5 sriov: Add controls for VFs to set port/node GUIDs. Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:36:53 2020 (r365408) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:37:44 2020 (r365409) @@ -179,6 +179,8 @@ static struct mlx5_profile profiles[] = { #ifdef PCI_IOV static const char iov_mac_addr_name[] = "mac-addr"; +static const char iov_node_guid_name[] = "node-guid"; +static const char iov_port_guid_name[] = "port-guid"; #endif static int set_dma_caps(struct pci_dev *pdev) @@ -1623,6 +1625,10 @@ static int init_one(struct pci_dev *pdev, vf_schema = pci_iov_schema_alloc_node(); pci_iov_schema_add_unicast_mac(vf_schema, iov_mac_addr_name, 0, NULL); + pci_iov_schema_add_uint64(vf_schema, iov_node_guid_name, + 0, 0); + pci_iov_schema_add_uint64(vf_schema, iov_port_guid_name, + 0, 0); err = pci_iov_attach(bsddev, pf_schema, vf_schema); if (err != 0) { device_printf(bsddev, @@ -1824,6 +1830,7 @@ mlx5_iov_add_vf(device_t dev, uint16_t vfnum, const nv struct mlx5_priv *priv; const void *mac; size_t mac_size; + uint64_t node_guid, port_guid; int error; pdev = device_get_softc(dev); @@ -1841,6 +1848,28 @@ mlx5_iov_add_vf(device_t dev, uint16_t vfnum, const nv if (error != 0) { mlx5_core_err(core_dev, "setting MAC for VF %d failed, error %d\n", + vfnum + 1, error); + } + } + + if (nvlist_exists_number(vf_config, iov_node_guid_name)) { + node_guid = nvlist_get_number(vf_config, iov_node_guid_name); + error = -mlx5_modify_nic_vport_node_guid(core_dev, vfnum + 1, + node_guid); + if (error != 0) { + mlx5_core_err(core_dev, + "modifying node GUID for VF %d failed, error %d\n", + vfnum + 1, error); + } + } + + if (nvlist_exists_number(vf_config, iov_port_guid_name)) { + port_guid = nvlist_get_number(vf_config, iov_port_guid_name); + error = -mlx5_modify_nic_vport_port_guid(core_dev, vfnum + 1, + port_guid); + if (error != 0) { + mlx5_core_err(core_dev, + "modifying port GUID for VF %d failed, error %d\n", vfnum + 1, error); } } From owner-svn-src-stable@freebsd.org Mon Sep 7 10:49:43 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C5293EE887; Mon, 7 Sep 2020 10:49:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlQ5g3BLSz3y1y; Mon, 7 Sep 2020 10:49: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50D9E1DFEB; Mon, 7 Sep 2020 10:49: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 087Anhvd092720; Mon, 7 Sep 2020 10:49:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087AngTP092718; Mon, 7 Sep 2020 10:49:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071049.087AngTP092718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365410 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 365410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 10:49:43 -0000 Author: kib Date: Mon Sep 7 10:49:42 2020 New Revision: 365410 URL: https://svnweb.freebsd.org/changeset/base/365410 Log: MFC r364999: mlx5_core: Import PDDR register definitions Modified: stable/11/sys/dev/mlx5/driver.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h stable/11/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Mon Sep 7 10:37:44 2020 (r365409) +++ stable/11/sys/dev/mlx5/driver.h Mon Sep 7 10:49:42 2020 (r365410) @@ -143,6 +143,7 @@ enum { MLX5_REG_PMPE = 0x5010, MLX5_REG_PMAOS = 0x5012, MLX5_REG_PPLM = 0x5023, + MLX5_REG_PDDR = 0x5031, MLX5_REG_PBSR = 0x5038, MLX5_REG_PCAM = 0x507f, MLX5_REG_NODE_DESC = 0x6001, Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:37:44 2020 (r365409) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:49:42 2020 (r365410) @@ -79,6 +79,35 @@ enum mlx5_semaphore_space_address { struct mlx5_core_dev; +enum mlx5_pddr_page_select { + MLX5_PDDR_OPERATIONAL_INFO_PAGE = 0x0, + MLX5_PDDR_TROUBLESHOOTING_INFO_PAGE = 0x1, + MLX5_PDDR_MODULE_INFO_PAGE = 0x3, +}; + +enum mlx5_pddr_monitor_opcodes { + MLX5_LINK_NO_ISSUE_OBSERVED = 0x0, + MLX5_LINK_PORT_CLOSED = 0x1, + MLX5_LINK_AN_FAILURE = 0x2, + MLX5_LINK_TRAINING_FAILURE = 0x5, + MLX5_LINK_LOGICAL_MISMATCH = 0x9, + MLX5_LINK_REMOTE_FAULT_INDICATION = 0xe, + MLX5_LINK_BAD_SIGNAL_INTEGRITY = 0xf, + MLX5_LINK_CABLE_COMPLIANCE_CODE_MISMATCH = 0x10, + MLX5_LINK_INTERNAL_ERR = 0x17, + MLX5_LINK_INFO_NOT_AVAIL = 0x3ff, + MLX5_LINK_CABLE_UNPLUGGED = 0x400, + MLX5_LINK_LONG_RANGE_FOR_NON_MLX_CABLE = 0x401, + MLX5_LINK_BUS_STUCK = 0x402, + MLX5_LINK_UNSUPP_EEPROM = 0x403, + MLX5_LINK_PART_NUM_LIST = 0x404, + MLX5_LINK_UNSUPP_CABLE = 0x405, + MLX5_LINK_MODULE_TEMP_SHUTDOWN = 0x406, + MLX5_LINK_SHORTED_CABLE = 0x407, + MLX5_LINK_POWER_BUDGET_EXCEEDED = 0x408, + MLX5_LINK_MNG_FORCED_DOWN = 0x409, +}; + int mlx5_query_hca_caps(struct mlx5_core_dev *dev); int mlx5_query_board_id(struct mlx5_core_dev *dev); int mlx5_query_qcam_reg(struct mlx5_core_dev *mdev, u32 *qcam, Modified: stable/11/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:37:44 2020 (r365409) +++ stable/11/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:49:42 2020 (r365410) @@ -848,23 +848,6 @@ struct mlx5_ifc_pddr_module_info_bits { u8 reserved_at_4c0[0x300]; }; -union mlx5_ifc_pddr_operation_info_page_pddr_phy_info_page_pddr_troubleshooting_page_pddr_module_info_auto_bits { - struct mlx5_ifc_pddr_module_info_bits pddr_module_info; - u8 reserved_at_0[0x7c0]; -}; - -struct mlx5_ifc_pddr_reg_bits { - u8 reserved_at_0[0x8]; - u8 local_port[0x8]; - u8 pnat[0x2]; - u8 reserved_at_12[0xe]; - - u8 reserved_at_20[0x18]; - u8 page_select[0x8]; - - union mlx5_ifc_pddr_operation_info_page_pddr_phy_info_page_pddr_troubleshooting_page_pddr_module_info_auto_bits page_data; -}; - struct mlx5_ifc_per_protocol_networking_offload_caps_bits { u8 csum_cap[0x1]; u8 vlan_cap[0x1]; @@ -8630,7 +8613,10 @@ struct mlx5_ifc_pcam_regs_5000_to_507f_bits { u8 port_access_reg_cap_mask_127_to_96[0x20]; u8 port_access_reg_cap_mask_95_to_64[0x20]; - u8 port_access_reg_cap_mask_63_to_36[0x1c]; + u8 reserved_at_40[0xe]; + u8 pddr[0x1]; + u8 reserved_at_4f[0xd]; + u8 pplm[0x1]; u8 port_access_reg_cap_mask_34_to_32[0x3]; @@ -10182,6 +10168,46 @@ struct mlx5_ifc_mpcnt_reg_ext_bits { u8 reserved_at_21[0x1f]; union mlx5_ifc_mpcnt_reg_counter_set_auto_ext_bits counter_set; +}; + +struct mlx5_ifc_monitor_opcodes_layout_bits { + u8 reserved_at_0[0x10]; + u8 monitor_opcode[0x10]; +}; + +union mlx5_ifc_pddr_status_opcode_bits { + struct mlx5_ifc_monitor_opcodes_layout_bits monitor_opcodes; + u8 reserved_at_0[0x20]; +}; + +struct mlx5_ifc_troubleshooting_info_page_layout_bits { + u8 reserved_at_0[0x10]; + u8 group_opcode[0x10]; + + union mlx5_ifc_pddr_status_opcode_bits status_opcode; + + u8 user_feedback_data[0x10]; + u8 user_feedback_index[0x10]; + + u8 status_message[0x760]; +}; + +union mlx5_ifc_pddr_page_data_bits { + struct mlx5_ifc_troubleshooting_info_page_layout_bits troubleshooting_info_page; + struct mlx5_ifc_pddr_module_info_bits pddr_module_info; + u8 reserved_at_0[0x7c0]; +}; + +struct mlx5_ifc_pddr_reg_bits { + u8 reserved_at_0[0x8]; + u8 local_port[0x8]; + u8 pnat[0x2]; + u8 reserved_at_12[0xe]; + + u8 reserved_at_20[0x18]; + u8 page_select[0x8]; + + union mlx5_ifc_pddr_page_data_bits page_data; }; enum { From owner-svn-src-stable@freebsd.org Mon Sep 7 10:50:18 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6A463EE83C; Mon, 7 Sep 2020 10:50:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlQ6L5rj1z3yMc; Mon, 7 Sep 2020 10:50:18 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91FDD1DFEC; Mon, 7 Sep 2020 10:50:18 +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 087AoI2R092841; Mon, 7 Sep 2020 10:50:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087AoI0A092839; Mon, 7 Sep 2020 10:50:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071050.087AoI0A092839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365411 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 365411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 10:50:19 -0000 Author: kib Date: Mon Sep 7 10:50:17 2020 New Revision: 365411 URL: https://svnweb.freebsd.org/changeset/base/365411 Log: MFC r365000: mlx5_core: add mlx5_query_pddr(). Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c stable/11/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:49:42 2020 (r365410) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:50:17 2020 (r365411) @@ -1175,19 +1175,29 @@ out: return err; } +static int mlx5_query_pddr(struct mlx5_core_dev *mdev, + u8 local_port, int page_select, u32 *out, int outlen) +{ + u32 in[MLX5_ST_SZ_DW(pddr_reg)] = {0}; + + if (!MLX5_CAP_PCAM_REG(mdev, pddr)) + return -EOPNOTSUPP; + + MLX5_SET(pddr_reg, in, local_port, local_port); + MLX5_SET(pddr_reg, in, page_select, page_select); + + return mlx5_core_access_reg(mdev, in, sizeof(in), out, outlen, MLX5_REG_PDDR, 0, 0); +} + int mlx5_query_pddr_range_info(struct mlx5_core_dev *mdev, u8 local_port, u8 *is_er_type) { u32 pddr_reg[MLX5_ST_SZ_DW(pddr_reg)] = {}; - int sz = MLX5_ST_SZ_BYTES(pddr_reg); int error; u8 ecc; u8 ci; - MLX5_SET(pddr_reg, pddr_reg, local_port, local_port); - MLX5_SET(pddr_reg, pddr_reg, page_select, 3 /* module info page */); - - error = mlx5_core_access_reg(mdev, pddr_reg, sz, pddr_reg, sz, - MLX5_ACCESS_REG_SUMMARY_CTRL_ID_PDDR, 0, 0); + error = mlx5_query_pddr(mdev, local_port, MLX5_PDDR_MODULE_INFO_PAGE, + pddr_reg, sizeof(pddr_reg)); if (error != 0) return (error); Modified: stable/11/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:49:42 2020 (r365410) +++ stable/11/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:50:17 2020 (r365411) @@ -756,10 +756,6 @@ struct mlx5_ifc_flow_table_nic_cap_bits { u8 reserved_1[0x7200]; }; -enum { - MLX5_ACCESS_REG_SUMMARY_CTRL_ID_PDDR = 0x5031, -}; - struct mlx5_ifc_pddr_module_info_bits { u8 cable_technology[0x8]; u8 cable_breakout[0x8]; From owner-svn-src-stable@freebsd.org Mon Sep 7 10:50:48 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96E313EE855; Mon, 7 Sep 2020 10:50:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlQ6w3RkNz3ydT; Mon, 7 Sep 2020 10:50:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AEF71E32C; Mon, 7 Sep 2020 10:50: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 087AomkX092919; Mon, 7 Sep 2020 10:50:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087Aol68092914; Mon, 7 Sep 2020 10:50:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071050.087Aol68092914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365412 - in stable/11/sys/dev/mlx5: mlx5_core mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: mlx5_core mlx5_en X-SVN-Commit-Revision: 365412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 10:50:48 -0000 Author: kib Date: Mon Sep 7 10:50:47 2020 New Revision: 365412 URL: https://svnweb.freebsd.org/changeset/base/365412 Log: MFC r365001: mlx5en: Implement SIOCGIFDOWNREASON. Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:50:17 2020 (r365411) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:50:47 2020 (r365412) @@ -127,6 +127,9 @@ void mlx5_core_event(struct mlx5_core_dev *dev, enum m void mlx5_enter_error_state(struct mlx5_core_dev *dev, bool force); void mlx5_disable_device(struct mlx5_core_dev *dev); void mlx5_recover_device(struct mlx5_core_dev *dev); +int mlx5_query_pddr_troubleshooting_info(struct mlx5_core_dev *mdev, + u16 *monitor_opcode, + u8 *status_message, size_t sm_len); int mlx5_register_device(struct mlx5_core_dev *dev); void mlx5_unregister_device(struct mlx5_core_dev *dev); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:50:17 2020 (r365411) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:50:47 2020 (r365412) @@ -1221,6 +1221,31 @@ int mlx5_query_pddr_range_info(struct mlx5_core_dev *m } EXPORT_SYMBOL_GPL(mlx5_query_pddr_range_info); +int mlx5_query_pddr_troubleshooting_info(struct mlx5_core_dev *mdev, + u16 *monitor_opcode, u8 *status_message, size_t sm_len) +{ + int outlen = MLX5_ST_SZ_BYTES(pddr_reg); + u32 out[MLX5_ST_SZ_DW(pddr_reg)] = {0}; + int err; + + err = mlx5_query_pddr(mdev, MLX5_PDDR_TROUBLESHOOTING_INFO_PAGE, 1, + out, outlen); + if (err != 0) + return err; + if (monitor_opcode != NULL) { + *monitor_opcode = MLX5_GET(pddr_reg, out, + page_data.troubleshooting_info_page.status_opcode. + monitor_opcodes); + } + if (status_message != NULL) { + strlcpy(status_message, + MLX5_ADDR_OF(pddr_reg, out, + page_data.troubleshooting_info_page.status_message), + sm_len); + } + return (0); +} + int mlx5_query_mfrl_reg(struct mlx5_core_dev *mdev, u8 *reset_level) { Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Sep 7 10:50:17 2020 (r365411) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Sep 7 10:50:47 2020 (r365412) @@ -3077,6 +3077,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t { struct mlx5e_priv *priv; struct ifreq *ifr; + struct ifdownreason *ifdr; struct ifi2creq i2c; int error = 0; int mask = 0; @@ -3328,6 +3329,16 @@ out: error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); err_i2c: PRIV_UNLOCK(priv); + break; + case SIOCGIFDOWNREASON: + ifdr = (struct ifdownreason *)data; + bzero(ifdr->ifdr_msg, sizeof(ifdr->ifdr_msg)); + PRIV_LOCK(priv); + error = -mlx5_query_pddr_troubleshooting_info(priv->mdev, NULL, + ifdr->ifdr_msg, sizeof(ifdr->ifdr_msg)); + PRIV_UNLOCK(priv); + if (error == 0) + ifdr->ifdr_reason = IFDR_REASON_MSG; break; default: From owner-svn-src-stable@freebsd.org Mon Sep 7 10:51:19 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE7CD3EEB8E; Mon, 7 Sep 2020 10:51:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlQ7W5X3fz3ybk; Mon, 7 Sep 2020 10:51:19 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A28FE1DFFC; Mon, 7 Sep 2020 10:51:19 +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 087ApJm6096050; Mon, 7 Sep 2020 10:51:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087ApJAN096049; Mon, 7 Sep 2020 10:51:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071051.087ApJAN096049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365413 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 365413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 10:51:19 -0000 Author: kib Date: Mon Sep 7 10:51:19 2020 New Revision: 365413 URL: https://svnweb.freebsd.org/changeset/base/365413 Log: MFC r365002: mlx5 sriov: add error message for failed MAC programming on VF. Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:50:47 2020 (r365412) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:51:19 2020 (r365413) @@ -1820,6 +1820,11 @@ mlx5_iov_add_vf(device_t dev, uint16_t vfnum, const nv &mac_size); error = -mlx5_eswitch_set_vport_mac(priv->eswitch, vfnum + 1, __DECONST(u8 *, mac)); + if (error != 0) { + mlx5_core_err(core_dev, + "setting MAC for VF %d failed, error %d\n", + vfnum + 1, error); + } } error = -mlx5_eswitch_set_vport_state(priv->eswitch, vfnum + 1, From owner-svn-src-stable@freebsd.org Mon Sep 7 10:51:49 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C0883EEC10; Mon, 7 Sep 2020 10:51:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlQ853jvrz3yyL; Mon, 7 Sep 2020 10:51: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6343E1DDEE; Mon, 7 Sep 2020 10:51: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 087ApnTo097374; Mon, 7 Sep 2020 10:51:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087Apn2v097361; Mon, 7 Sep 2020 10:51:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071051.087Apn2v097361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365414 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 365414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 10:51:49 -0000 Author: kib Date: Mon Sep 7 10:51:48 2020 New Revision: 365414 URL: https://svnweb.freebsd.org/changeset/base/365414 Log: MFC r365003: mlx5 sriov: Add controls for VFs to set port/node GUIDs. Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:51:19 2020 (r365413) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:51:48 2020 (r365414) @@ -179,6 +179,8 @@ static struct mlx5_profile profiles[] = { #ifdef PCI_IOV static const char iov_mac_addr_name[] = "mac-addr"; +static const char iov_node_guid_name[] = "node-guid"; +static const char iov_port_guid_name[] = "port-guid"; #endif static int set_dma_caps(struct pci_dev *pdev) @@ -1605,6 +1607,10 @@ static int init_one(struct pci_dev *pdev, vf_schema = pci_iov_schema_alloc_node(); pci_iov_schema_add_unicast_mac(vf_schema, iov_mac_addr_name, 0, NULL); + pci_iov_schema_add_uint64(vf_schema, iov_node_guid_name, + 0, 0); + pci_iov_schema_add_uint64(vf_schema, iov_port_guid_name, + 0, 0); err = pci_iov_attach(bsddev, pf_schema, vf_schema); if (err != 0) { device_printf(bsddev, @@ -1806,6 +1812,7 @@ mlx5_iov_add_vf(device_t dev, uint16_t vfnum, const nv struct mlx5_priv *priv; const void *mac; size_t mac_size; + uint64_t node_guid, port_guid; int error; pdev = device_get_softc(dev); @@ -1823,6 +1830,28 @@ mlx5_iov_add_vf(device_t dev, uint16_t vfnum, const nv if (error != 0) { mlx5_core_err(core_dev, "setting MAC for VF %d failed, error %d\n", + vfnum + 1, error); + } + } + + if (nvlist_exists_number(vf_config, iov_node_guid_name)) { + node_guid = nvlist_get_number(vf_config, iov_node_guid_name); + error = -mlx5_modify_nic_vport_node_guid(core_dev, vfnum + 1, + node_guid); + if (error != 0) { + mlx5_core_err(core_dev, + "modifying node GUID for VF %d failed, error %d\n", + vfnum + 1, error); + } + } + + if (nvlist_exists_number(vf_config, iov_port_guid_name)) { + port_guid = nvlist_get_number(vf_config, iov_port_guid_name); + error = -mlx5_modify_nic_vport_port_guid(core_dev, vfnum + 1, + port_guid); + if (error != 0) { + mlx5_core_err(core_dev, + "modifying port GUID for VF %d failed, error %d\n", vfnum + 1, error); } } From owner-svn-src-stable@freebsd.org Mon Sep 7 14:22:28 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01B483CAA69; Mon, 7 Sep 2020 14:22:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlVq76FsTz493s; Mon, 7 Sep 2020 14:22:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9FB120B41; Mon, 7 Sep 2020 14:22:27 +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 087EMRrW026910; Mon, 7 Sep 2020 14:22:27 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087EMR3S026909; Mon, 7 Sep 2020 14:22:27 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202009071422.087EMR3S026909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 7 Sep 2020 14:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365416 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 365416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 14:22:28 -0000 Author: bz Date: Mon Sep 7 14:22:27 2020 New Revision: 365416 URL: https://svnweb.freebsd.org/changeset/base/365416 Log: MFC r364466: After the clang/llvm version 11 import LLD_VERSION is no longer used upstream so Version.inc now only defines LLD_VERSION_STRING. This breaks the WANT_LINKER_VERSION magic and might lead to us building more than needed (e.g., for croos-tools). Change the awk script to parse LLD_VERSION_STRING instead of LLD_VERSION, which not only unbreaks the current situation but should also be backwards compatible as dim points out. Merging this before r364284 will ensure that stable/12 won't break. PR: 248818 Reviewed by: emaste, dim (seems right and the way to go) Modified: stable/12/Makefile.inc1 Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile.inc1 ============================================================================== --- stable/12/Makefile.inc1 Mon Sep 7 13:44:54 2020 (r365415) +++ stable/12/Makefile.inc1 Mon Sep 7 14:22:27 2020 (r365416) @@ -286,7 +286,7 @@ _WANT_LINKER_FREEBSD_VERSION!= \ WANT_LINKER_FREEBSD_VERSION=${_WANT_LINKER_FREEBSD_VERSION:C/.*-(.*)/\1/} WANT_LINKER_VERSION_FILE= lib/clang/include/lld/Common/Version.inc WANT_LINKER_VERSION!= \ - awk '$$2 == "LLD_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \ + awk '$$2 == "LLD_VERSION_STRING" { gsub("\"", "", $$3); split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \ ${SRCDIR}/${WANT_LINKER_VERSION_FILE} || echo unknown .else WANT_LINKER_FREEBSD_VERSION_FILE= From owner-svn-src-stable@freebsd.org Mon Sep 7 14:38:39 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD1D13CB387; Mon, 7 Sep 2020 14:38:39 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlW9q47sgz49j3; Mon, 7 Sep 2020 14:38:39 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DD0620A65; Mon, 7 Sep 2020 14:38:39 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087Ecde9033506; Mon, 7 Sep 2020 14:38:39 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087Ecd9m033505; Mon, 7 Sep 2020 14:38:39 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009071438.087Ecd9m033505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Mon, 7 Sep 2020 14:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365417 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 365417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 14:38:39 -0000 Author: gbe (doc committer) Date: Mon Sep 7 14:38:38 2020 New Revision: 365417 URL: https://svnweb.freebsd.org/changeset/base/365417 Log: MFC r365008: vtnet(4): improve the wording PR: 247936 Submitted by: PauAmma Reported by: PauAmma Differential Revision: https://reviews.freebsd.org/D26244 Modified: stable/12/share/man/man4/vtnet.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/vtnet.4 ============================================================================== --- stable/12/share/man/man4/vtnet.4 Mon Sep 7 14:22:27 2020 (r365416) +++ stable/12/share/man/man4/vtnet.4 Mon Sep 7 14:38:38 2020 (r365417) @@ -49,7 +49,7 @@ The .Nm device driver provides support for VirtIO Ethernet devices. .Pp -If the hypervisor advertises the appreciate features, the +If the hypervisor advertises the appropriate features, the .Nm driver supports TCP/UDP checksum offload for both transmit and receive, TCP segmentation offload (TSO), TCP large receive offload (LRO), From owner-svn-src-stable@freebsd.org Mon Sep 7 14:40:34 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F6BA3CB52D; Mon, 7 Sep 2020 14:40:34 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlWD20tFzz4BNv; Mon, 7 Sep 2020 14:40:34 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 024C720E43; Mon, 7 Sep 2020 14:40:34 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087EeXHq034428; Mon, 7 Sep 2020 14:40:33 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087EeX6r034427; Mon, 7 Sep 2020 14:40:33 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009071440.087EeX6r034427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Mon, 7 Sep 2020 14:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365418 - stable/12/usr.bin/fortune/datfiles X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/usr.bin/fortune/datfiles X-SVN-Commit-Revision: 365418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 14:40:34 -0000 Author: gbe (doc committer) Date: Mon Sep 7 14:40:33 2020 New Revision: 365418 URL: https://svnweb.freebsd.org/changeset/base/365418 Log: MFC r365328: fortune(6): Grammar fix for a hint on searching ports PR: 249078 Submitted by: PauAmma Reported by: PauAmma Modified: stable/12/usr.bin/fortune/datfiles/freebsd-tips Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/fortune/datfiles/freebsd-tips ============================================================================== --- stable/12/usr.bin/fortune/datfiles/freebsd-tips Mon Sep 7 14:38:38 2020 (r365417) +++ stable/12/usr.bin/fortune/datfiles/freebsd-tips Mon Sep 7 14:40:33 2020 (r365418) @@ -304,8 +304,8 @@ been replaced with other messages, look at /var/run/dm Want colour in your directory listings? Use "ls -G". "ls -F" is also useful, and they can be combined as "ls -FG". % -Want to find a specific port, just type the following under /usr/ports -or one its subdirectories: +Want to find a specific port? Just type the following under /usr/ports +or one of its subdirectories: make search name= or From owner-svn-src-stable@freebsd.org Mon Sep 7 16:09:38 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 794DA3CE0F8; Mon, 7 Sep 2020 16:09:38 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlYBp2cy7z4LNB; Mon, 7 Sep 2020 16:09:38 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DFC921B4D; Mon, 7 Sep 2020 16:09:38 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087G9cIX094405; Mon, 7 Sep 2020 16:09:38 GMT (envelope-from blackend@FreeBSD.org) Received: (from blackend@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087G9c4C094404; Mon, 7 Sep 2020 16:09:38 GMT (envelope-from blackend@FreeBSD.org) Message-Id: <202009071609.087G9c4C094404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: blackend set sender to blackend@FreeBSD.org using -f From: Marc Fonvieille Date: Mon, 7 Sep 2020 16:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365420 - stable/12/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-12 X-SVN-Commit-Author: blackend X-SVN-Commit-Paths: stable/12/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 365420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 16:09:38 -0000 Author: blackend (doc committer) Date: Mon Sep 7 16:09:37 2020 New Revision: 365420 URL: https://svnweb.freebsd.org/changeset/base/365420 Log: MFC r364682: Add missing Korean doc package entry, remove non-existent Serbian doc package entry. Approved by: re (gjb) Modified: stable/12/usr.sbin/bsdinstall/scripts/docsinstall Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bsdinstall/scripts/docsinstall ============================================================================== --- stable/12/usr.sbin/bsdinstall/scripts/docsinstall Mon Sep 7 15:35:40 2020 (r365419) +++ stable/12/usr.sbin/bsdinstall/scripts/docsinstall Mon Sep 7 16:09:37 2020 (r365420) @@ -42,7 +42,7 @@ f_include $BSDCFG_SHARE/packages/packages.subr # List of languages to display (descriptions pulled from $msg_{lang}doc_desc) # : ${DOCSINSTALL_LANGS:=\ - bn da de el en es fr hu it ja mn nl pl pt ru sr tr zh_cn zh_tw \ + bn da de el en es fr hu it ja ko mn nl pl pt ru tr zh_cn zh_tw \ } ############################################################ GLOBALS @@ -65,13 +65,13 @@ msg_freebsd_installer="FreeBSD Installer" msg_hudoc_desc="Hungarian Documentation" msg_itdoc_desc="Italian Documentation" msg_jadoc_desc="Japanese Documentation" +msg_kodoc_desc="Korean Documentation" msg_mndoc_desc="Mongolian Documentation" msg_nldoc_desc="Dutch Documentation" msg_ok="OK" msg_pldoc_desc="Polish Documentation" msg_ptdoc_desc="Portuguese Documentation" msg_rudoc_desc="Russian Documentation" -msg_srdoc_desc="Serbian Documentation" msg_trdoc_desc="Turkish Documentation" msg_zh_cndoc_desc="Simplified Chinese Documentation" msg_zh_twdoc_desc="Traditional Chinese Documentation" From owner-svn-src-stable@freebsd.org Mon Sep 7 16:11:50 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D9813CE995; Mon, 7 Sep 2020 16:11:50 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlYFL0whSz4LWs; Mon, 7 Sep 2020 16:11:50 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 032F321CC0; Mon, 7 Sep 2020 16:11:50 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087GBnBc095644; Mon, 7 Sep 2020 16:11:49 GMT (envelope-from blackend@FreeBSD.org) Received: (from blackend@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087GBn64095643; Mon, 7 Sep 2020 16:11:49 GMT (envelope-from blackend@FreeBSD.org) Message-Id: <202009071611.087GBn64095643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: blackend set sender to blackend@FreeBSD.org using -f From: Marc Fonvieille Date: Mon, 7 Sep 2020 16:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365421 - stable/12/usr.sbin/bsdinstall X-SVN-Group: stable-12 X-SVN-Commit-Author: blackend X-SVN-Commit-Paths: stable/12/usr.sbin/bsdinstall X-SVN-Commit-Revision: 365421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 16:11:50 -0000 Author: blackend (doc committer) Date: Mon Sep 7 16:11:49 2020 New Revision: 365421 URL: https://svnweb.freebsd.org/changeset/base/365421 Log: MFC r364684: s/redundacy/redundancy Modified: stable/12/usr.sbin/bsdinstall/bsdinstall.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- stable/12/usr.sbin/bsdinstall/bsdinstall.8 Mon Sep 7 16:09:37 2020 (r365420) +++ stable/12/usr.sbin/bsdinstall/bsdinstall.8 Mon Sep 7 16:11:49 2020 (r365421) @@ -345,7 +345,7 @@ Default: .Dq default .It Ev ZFSBOOT_VDEV_TYPE The type of pool to be created for the base system. -This variable can take one of this values: stripe (No redundacy), +This variable can take one of this values: stripe (No redundancy), mirror (n-Way mirroring), raid10 (RAID 1+0 - n x 2-Way Mirrors), raidz1 (RAID-Z1 - Single Redundacy RAID), raidz2 (RAID-Z2 - Double Redundacy RAID) or raidz3 (RAID-Z3 Triple Redundacy RAID). From owner-svn-src-stable@freebsd.org Mon Sep 7 17:31:59 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EA443D0944; Mon, 7 Sep 2020 17:31:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blb1p73ryz4RMs; Mon, 7 Sep 2020 17:31:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5B2622F9F; Mon, 7 Sep 2020 17:31:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087HVwoB052287; Mon, 7 Sep 2020 17:31:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087HVwEq052286; Mon, 7 Sep 2020 17:31:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009071731.087HVwEq052286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 7 Sep 2020 17:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365423 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 17:31:59 -0000 Author: emaste Date: Mon Sep 7 17:31:58 2020 New Revision: 365423 URL: https://svnweb.freebsd.org/changeset/base/365423 Log: TPC rack: use #error rather than syntax error Until the changes to make this a proper dependency are merged, avoid using a syntax error for a user-facing error report. PR: 249037 Suggested by: avg Modified: stable/12/sys/netinet/tcp_stacks/rack.c Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Mon Sep 7 17:19:31 2020 (r365422) +++ stable/12/sys/netinet/tcp_stacks/rack.c Mon Sep 7 17:31:58 2020 (r365423) @@ -128,7 +128,7 @@ struct sysctl_ctx_list rack_sysctl_ctx; struct sysctl_oid *rack_sysctl_root; #ifndef TCPHPTS -fatal error missing option TCPHSTS in the build; +#error Kernel option TCPHPTS is required #endif #define CUM_ACKED 1 From owner-svn-src-stable@freebsd.org Mon Sep 7 18:47:26 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6CBE3D3DA5; Mon, 7 Sep 2020 18:47:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blcht4W3Dz4ZN3; Mon, 7 Sep 2020 18:47:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77B0D23B65; Mon, 7 Sep 2020 18:47:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087IlQZh098504; Mon, 7 Sep 2020 18:47:26 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087IlQq0098503; Mon, 7 Sep 2020 18:47:26 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202009071847.087IlQq0098503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 7 Sep 2020 18:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365425 - stable/12/release/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/12/release/tools X-SVN-Commit-Revision: 365425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 18:47:26 -0000 Author: gonzo Date: Mon Sep 7 18:47:25 2020 New Revision: 365425 URL: https://svnweb.freebsd.org/changeset/base/365425 Log: Revert r364939 and add a stable/12 approach for populating the ESP make_esp_file is not available in stable/12 so r364939 broke VM-related targets. Revert offending commit and use pre-r342283 approach to populate ESP partition. PR: 249168 Tested on: VirtualBox, Hyper-V v2 VM Modified: stable/12/release/tools/vmimage.subr Modified: stable/12/release/tools/vmimage.subr ============================================================================== --- stable/12/release/tools/vmimage.subr Mon Sep 7 18:15:58 2020 (r365424) +++ stable/12/release/tools/vmimage.subr Mon Sep 7 18:47:25 2020 (r365425) @@ -21,17 +21,13 @@ write_partition_layout() { case "${TARGET}:${TARGET_ARCH}" in amd64:amd64 | i386:i386) - # Create an ESP - espfilename=$(mktemp /tmp/efiboot.XXXXXX) - make_esp_file ${espfilename} ${fat32min} ${BOOTFILES}/efi/loader_lua/loader_lua.efi mkimg -s gpt -f ${VMFORMAT} \ -b ${BOOTFILES}/i386/pmbr/pmbr \ -p freebsd-boot/bootfs:=${BOOTFILES}/i386/gptboot/gptboot \ - -p efi:=${espfilename} \ + -p efi:=${BOOTFILES}/efi/boot1/boot1.efifat \ ${SWAPOPT} \ -p freebsd-ufs/rootfs:=${VMBASE} \ -o ${VMIMAGE} - rm ${espfilename} ;; arm64:aarch64) mkimg -s mbr -f ${VMFORMAT} \ From owner-svn-src-stable@freebsd.org Mon Sep 7 19:29:08 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F28633D4CC8; Mon, 7 Sep 2020 19:29:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bldcz6BHnz4cNh; Mon, 7 Sep 2020 19:29:07 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7B892451A; Mon, 7 Sep 2020 19:29:07 +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 087JT7cw023315; Mon, 7 Sep 2020 19:29:07 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087JT7oo023312; Mon, 7 Sep 2020 19:29:07 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009071929.087JT7oo023312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 7 Sep 2020 19:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365426 - in stable: 11/lib/libclang_rt/fuzzer 11/lib/libclang_rt/profile 11/lib/libclang_rt/xray 12/lib/libclang_rt/fuzzer 12/lib/libclang_rt/profile 12/lib/libclang_rt/xray X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/lib/libclang_rt/fuzzer 11/lib/libclang_rt/profile 11/lib/libclang_rt/xray 12/lib/libclang_rt/fuzzer 12/lib/libclang_rt/profile 12/lib/libclang_rt/xray X-SVN-Commit-Revision: 365426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 19:29:08 -0000 Author: dim Date: Mon Sep 7 19:29:06 2020 New Revision: 365426 URL: https://svnweb.freebsd.org/changeset/base/365426 Log: MFC r364081: Follow-up to r358851 (llvm-project 10.0.0-rc3 import), where I added subdirectories for compiler-rt's internal fuzzer, profile and xray headers, but forgot to add installing those headers themselves. Modified: stable/12/lib/libclang_rt/fuzzer/Makefile stable/12/lib/libclang_rt/profile/Makefile stable/12/lib/libclang_rt/xray/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libclang_rt/fuzzer/Makefile stable/11/lib/libclang_rt/profile/Makefile stable/11/lib/libclang_rt/xray/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libclang_rt/fuzzer/Makefile ============================================================================== --- stable/12/lib/libclang_rt/fuzzer/Makefile Mon Sep 7 18:47:25 2020 (r365425) +++ stable/12/lib/libclang_rt/fuzzer/Makefile Mon Sep 7 19:29:06 2020 (r365426) @@ -23,4 +23,8 @@ SRCS+= fuzzer/FuzzerUtil.cpp SRCS+= fuzzer/FuzzerUtilLinux.cpp SRCS+= fuzzer/FuzzerUtilPosix.cpp +.PATH: ${CRTSRC}/include/fuzzer +INCSDIR= ${CLANGDIR}/include/fuzzer +INCS+= FuzzedDataProvider.h + .include Modified: stable/12/lib/libclang_rt/profile/Makefile ============================================================================== --- stable/12/lib/libclang_rt/profile/Makefile Mon Sep 7 18:47:25 2020 (r365425) +++ stable/12/lib/libclang_rt/profile/Makefile Mon Sep 7 19:29:06 2020 (r365426) @@ -25,4 +25,8 @@ SRCS+= profile/InstrProfilingUtil.c SRCS+= profile/InstrProfilingValue.c SRCS+= profile/InstrProfilingWriter.c +.PATH: ${CRTSRC}/include/profile +INCSDIR= ${CLANGDIR}/include/profile +INCS+= InstrProfData.inc + .include Modified: stable/12/lib/libclang_rt/xray/Makefile ============================================================================== --- stable/12/lib/libclang_rt/xray/Makefile Mon Sep 7 18:47:25 2020 (r365425) +++ stable/12/lib/libclang_rt/xray/Makefile Mon Sep 7 19:29:06 2020 (r365426) @@ -41,4 +41,10 @@ SRCS+= xray/xray_trampoline_x86_64.S SRCS+= xray/xray_utils.cpp SRCS+= xray/xray_x86_64.cpp +.PATH: ${CRTSRC}/include/xray +INCSDIR= ${CLANGDIR}/include/xray +INCS+= xray_interface.h +INCS+= xray_log_interface.h +INCS+= xray_records.h + .include From owner-svn-src-stable@freebsd.org Mon Sep 7 19:29:08 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B13C13D4E9D; Mon, 7 Sep 2020 19:29:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bldd04Kk8z4cF3; Mon, 7 Sep 2020 19:29:08 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78B732451B; Mon, 7 Sep 2020 19:29:08 +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 087JT8XA023323; Mon, 7 Sep 2020 19:29:08 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087JT7Kc023321; Mon, 7 Sep 2020 19:29:07 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009071929.087JT7Kc023321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 7 Sep 2020 19:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365426 - in stable: 11/lib/libclang_rt/fuzzer 11/lib/libclang_rt/profile 11/lib/libclang_rt/xray 12/lib/libclang_rt/fuzzer 12/lib/libclang_rt/profile 12/lib/libclang_rt/xray X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/lib/libclang_rt/fuzzer 11/lib/libclang_rt/profile 11/lib/libclang_rt/xray 12/lib/libclang_rt/fuzzer 12/lib/libclang_rt/profile 12/lib/libclang_rt/xray X-SVN-Commit-Revision: 365426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 19:29:08 -0000 Author: dim Date: Mon Sep 7 19:29:06 2020 New Revision: 365426 URL: https://svnweb.freebsd.org/changeset/base/365426 Log: MFC r364081: Follow-up to r358851 (llvm-project 10.0.0-rc3 import), where I added subdirectories for compiler-rt's internal fuzzer, profile and xray headers, but forgot to add installing those headers themselves. Modified: stable/11/lib/libclang_rt/fuzzer/Makefile stable/11/lib/libclang_rt/profile/Makefile stable/11/lib/libclang_rt/xray/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libclang_rt/fuzzer/Makefile stable/12/lib/libclang_rt/profile/Makefile stable/12/lib/libclang_rt/xray/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libclang_rt/fuzzer/Makefile ============================================================================== --- stable/11/lib/libclang_rt/fuzzer/Makefile Mon Sep 7 18:47:25 2020 (r365425) +++ stable/11/lib/libclang_rt/fuzzer/Makefile Mon Sep 7 19:29:06 2020 (r365426) @@ -23,4 +23,8 @@ SRCS+= fuzzer/FuzzerUtil.cpp SRCS+= fuzzer/FuzzerUtilLinux.cpp SRCS+= fuzzer/FuzzerUtilPosix.cpp +.PATH: ${CRTSRC}/include/fuzzer +INCSDIR= ${CLANGDIR}/include/fuzzer +INCS+= FuzzedDataProvider.h + .include Modified: stable/11/lib/libclang_rt/profile/Makefile ============================================================================== --- stable/11/lib/libclang_rt/profile/Makefile Mon Sep 7 18:47:25 2020 (r365425) +++ stable/11/lib/libclang_rt/profile/Makefile Mon Sep 7 19:29:06 2020 (r365426) @@ -25,4 +25,8 @@ SRCS+= profile/InstrProfilingUtil.c SRCS+= profile/InstrProfilingValue.c SRCS+= profile/InstrProfilingWriter.c +.PATH: ${CRTSRC}/include/profile +INCSDIR= ${CLANGDIR}/include/profile +INCS+= InstrProfData.inc + .include Modified: stable/11/lib/libclang_rt/xray/Makefile ============================================================================== --- stable/11/lib/libclang_rt/xray/Makefile Mon Sep 7 18:47:25 2020 (r365425) +++ stable/11/lib/libclang_rt/xray/Makefile Mon Sep 7 19:29:06 2020 (r365426) @@ -41,4 +41,10 @@ SRCS+= xray/xray_trampoline_x86_64.S SRCS+= xray/xray_utils.cpp SRCS+= xray/xray_x86_64.cpp +.PATH: ${CRTSRC}/include/xray +INCSDIR= ${CLANGDIR}/include/xray +INCS+= xray_interface.h +INCS+= xray_log_interface.h +INCS+= xray_records.h + .include From owner-svn-src-stable@freebsd.org Mon Sep 7 19:35:31 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB0653D4CEE; Mon, 7 Sep 2020 19:35:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BldmM51qtz4csB; Mon, 7 Sep 2020 19:35:31 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B0F02462A; Mon, 7 Sep 2020 19:35:31 +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 087JZVpH029141; Mon, 7 Sep 2020 19:35:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087JZUYZ029135; Mon, 7 Sep 2020 19:35:30 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009071935.087JZUYZ029135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 7 Sep 2020 19:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365427 - in stable: 11/contrib/llvm-project/openmp/runtime/src 11/share/mk 12/contrib/llvm-project/openmp/runtime/src 12/share/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/openmp/runtime/src 11/share/mk 12/contrib/llvm-project/openmp/runtime/src 12/share/mk X-SVN-Commit-Revision: 365427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 19:35:31 -0000 Author: dim Date: Mon Sep 7 19:35:30 2020 New Revision: 365427 URL: https://svnweb.freebsd.org/changeset/base/365427 Log: MFC r364732: Merge commit cde8f4c16 from llvm git (by me): Move special va_list handling to kmp_os.h Instead of copying and pasting the same #ifdef expressions in multiple places, define a type and a pair of macros in kmp_os.h, to handle whether va_list is pointer-like or not: * kmp_va_list is the type to use for __kmp_fork_call() * kmp_va_deref() dereferences a va_list, if necessary * kmp_va_addr_of() takes the address of a va_list, if necessary Also add FreeBSD to the list of OSes that has a non pointer-like va_list. This can now be easily extended to other OSes too. Reviewed By: AndreyChurbanov Differential Revision: https://reviews.llvm.org/D86397 This should enable building of LLVM's OpenMP on AArch64. Addition to share/mk will follow in a subsequent commit. PR: 248864 MFC r364733: After r364732, we can now enable MK_OPENMP for aarch64 by default. PR: 248864 Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp.h stable/12/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp stable/12/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h stable/12/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp stable/12/share/mk/src.opts.mk Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp.h stable/11/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp stable/11/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h stable/11/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp stable/11/share/mk/src.opts.mk Directory Properties: stable/11/ (props changed) stable/11/contrib/llvm-project/openmp/ (props changed) Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp.h ============================================================================== --- stable/12/contrib/llvm-project/openmp/runtime/src/kmp.h Mon Sep 7 19:29:06 2020 (r365426) +++ stable/12/contrib/llvm-project/openmp/runtime/src/kmp.h Mon Sep 7 19:35:30 2020 (r365427) @@ -3463,13 +3463,7 @@ enum fork_context_e { extern int __kmp_fork_call(ident_t *loc, int gtid, enum fork_context_e fork_context, kmp_int32 argc, microtask_t microtask, launch_t invoker, -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_ARM || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && KMP_OS_LINUX - va_list *ap -#else - va_list ap -#endif - ); + kmp_va_list ap); extern void __kmp_join_call(ident_t *loc, int gtid #if OMPT_SUPPORT Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp ============================================================================== --- stable/12/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp Mon Sep 7 19:29:06 2020 (r365426) +++ stable/12/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp Mon Sep 7 19:35:30 2020 (r365427) @@ -308,13 +308,7 @@ void __kmpc_fork_call(ident_t *loc, kmp_int32 argc, km __kmp_fork_call(loc, gtid, fork_context_intel, argc, VOLATILE_CAST(microtask_t) microtask, // "wrapped" task VOLATILE_CAST(launch_t) __kmp_invoke_task_func, -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - &ap -#else - ap -#endif - ); + kmp_va_addr_of(ap)); #if INCLUDE_SSC_MARKS SSC_MARK_JOINING(); #endif @@ -408,16 +402,10 @@ void __kmpc_fork_teams(ident_t *loc, kmp_int32 argc, k KMP_DEBUG_ASSERT(this_thr->th.th_teams_size.nteams >= 1); KMP_DEBUG_ASSERT(this_thr->th.th_teams_size.nth >= 1); - __kmp_fork_call(loc, gtid, fork_context_intel, argc, - VOLATILE_CAST(microtask_t) - __kmp_teams_master, // "wrapped" task - VOLATILE_CAST(launch_t) __kmp_invoke_teams_master, -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - &ap -#else - ap -#endif - ); + __kmp_fork_call( + loc, gtid, fork_context_intel, argc, + VOLATILE_CAST(microtask_t) __kmp_teams_master, // "wrapped" task + VOLATILE_CAST(launch_t) __kmp_invoke_teams_master, kmp_va_addr_of(ap)); __kmp_join_call(loc, gtid #if OMPT_SUPPORT , Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp ============================================================================== --- stable/12/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp Mon Sep 7 19:29:06 2020 (r365426) +++ stable/12/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp Mon Sep 7 19:35:30 2020 (r365427) @@ -376,13 +376,7 @@ static va_start(ap, argc); rc = __kmp_fork_call(loc, gtid, fork_context_gnu, argc, wrapper, - __kmp_invoke_task_func, -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - &ap -#else - ap -#endif - ); + __kmp_invoke_task_func, kmp_va_addr_of(ap)); va_end(ap); Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h ============================================================================== --- stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 19:29:06 2020 (r365426) +++ stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 19:35:30 2020 (r365427) @@ -200,6 +200,18 @@ typedef kmp_uint32 kmp_uint; #define KMP_INT_MAX ((kmp_int32)0x7FFFFFFF) #define KMP_INT_MIN ((kmp_int32)0x80000000) +// stdarg handling +#if (KMP_ARCH_ARM || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && \ + (KMP_OS_FREEBSD || KMP_OS_LINUX) +typedef va_list *kmp_va_list; +#define kmp_va_deref(ap) (*(ap)) +#define kmp_va_addr_of(ap) (&(ap)) +#else +typedef va_list kmp_va_list; +#define kmp_va_deref(ap) (ap) +#define kmp_va_addr_of(ap) (ap) +#endif + #ifdef __cplusplus // macros to cast out qualifiers and to re-interpret types #define CCAST(type, var) const_cast(var) Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp ============================================================================== --- stable/12/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp Mon Sep 7 19:29:06 2020 (r365426) +++ stable/12/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp Mon Sep 7 19:35:30 2020 (r365427) @@ -1389,13 +1389,7 @@ void __kmp_serialized_parallel(ident_t *loc, kmp_int32 int __kmp_fork_call(ident_t *loc, int gtid, enum fork_context_e call_context, // Intel, GNU, ... kmp_int32 argc, microtask_t microtask, launch_t invoker, -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - va_list *ap -#else - va_list ap -#endif - ) { + kmp_va_list ap) { void **argv; int i; int master_tid; @@ -1505,12 +1499,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, parent_team->t.t_argc = argc; argv = (void **)parent_team->t.t_argv; for (i = argc - 1; i >= 0; --i) -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - *argv++ = va_arg(*ap, void *); -#else - *argv++ = va_arg(ap, void *); -#endif + *argv++ = va_arg(kmp_va_deref(ap), void *); // Increment our nested depth levels, but not increase the serialization if (parent_team == master_th->th.th_serial_team) { // AC: we are in serialized parallel @@ -1804,12 +1793,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, argv = (void **)team->t.t_argv; if (ap) { for (i = argc - 1; i >= 0; --i) -// TODO: revert workaround for Intel(R) 64 tracker #96 -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - *argv++ = va_arg(*ap, void *); -#else - *argv++ = va_arg(ap, void *); -#endif + *argv++ = va_arg(kmp_va_deref(ap), void *); } else { for (i = 0; i < argc; ++i) // Get args from parent team for teams construct @@ -1840,12 +1824,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, } else { argv = args; for (i = argc - 1; i >= 0; --i) -// TODO: revert workaround for Intel(R) 64 tracker #96 -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - *argv++ = va_arg(*ap, void *); -#else - *argv++ = va_arg(ap, void *); -#endif + *argv++ = va_arg(kmp_va_deref(ap), void *); KMP_MB(); #if OMPT_SUPPORT @@ -2130,12 +2109,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, argv = (void **)team->t.t_argv; if (ap) { for (i = argc - 1; i >= 0; --i) { -// TODO: revert workaround for Intel(R) 64 tracker #96 -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - void *new_argv = va_arg(*ap, void *); -#else - void *new_argv = va_arg(ap, void *); -#endif + void *new_argv = va_arg(kmp_va_deref(ap), void *); KMP_CHECK_UPDATE(*argv, new_argv); argv++; } Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Mon Sep 7 19:29:06 2020 (r365426) +++ stable/12/share/mk/src.opts.mk Mon Sep 7 19:35:30 2020 (r365427) @@ -409,7 +409,8 @@ BROKEN_OPTIONS+=BSD_CRTBEGIN .endif .if ${COMPILER_FEATURES:Mc++11} && \ - (${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc64") + (${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ + ${__T} == "powerpc64") __DEFAULT_YES_OPTIONS+=OPENMP .else __DEFAULT_NO_OPTIONS+=OPENMP From owner-svn-src-stable@freebsd.org Mon Sep 7 19:35:33 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56EAF3D4F4A; Mon, 7 Sep 2020 19:35:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BldmP1hjyz4cvh; Mon, 7 Sep 2020 19:35:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D9CA2462B; Mon, 7 Sep 2020 19:35:33 +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 087JZWoP029152; Mon, 7 Sep 2020 19:35:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087JZVZV029146; Mon, 7 Sep 2020 19:35:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009071935.087JZVZV029146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 7 Sep 2020 19:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365427 - in stable: 11/contrib/llvm-project/openmp/runtime/src 11/share/mk 12/contrib/llvm-project/openmp/runtime/src 12/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/openmp/runtime/src 11/share/mk 12/contrib/llvm-project/openmp/runtime/src 12/share/mk X-SVN-Commit-Revision: 365427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 19:35:33 -0000 Author: dim Date: Mon Sep 7 19:35:30 2020 New Revision: 365427 URL: https://svnweb.freebsd.org/changeset/base/365427 Log: MFC r364732: Merge commit cde8f4c16 from llvm git (by me): Move special va_list handling to kmp_os.h Instead of copying and pasting the same #ifdef expressions in multiple places, define a type and a pair of macros in kmp_os.h, to handle whether va_list is pointer-like or not: * kmp_va_list is the type to use for __kmp_fork_call() * kmp_va_deref() dereferences a va_list, if necessary * kmp_va_addr_of() takes the address of a va_list, if necessary Also add FreeBSD to the list of OSes that has a non pointer-like va_list. This can now be easily extended to other OSes too. Reviewed By: AndreyChurbanov Differential Revision: https://reviews.llvm.org/D86397 This should enable building of LLVM's OpenMP on AArch64. Addition to share/mk will follow in a subsequent commit. PR: 248864 MFC r364733: After r364732, we can now enable MK_OPENMP for aarch64 by default. PR: 248864 Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp.h stable/11/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp stable/11/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h stable/11/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp stable/11/share/mk/src.opts.mk Directory Properties: stable/11/ (props changed) stable/11/contrib/llvm-project/openmp/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp.h stable/12/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp stable/12/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h stable/12/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp stable/12/share/mk/src.opts.mk Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp.h ============================================================================== --- stable/11/contrib/llvm-project/openmp/runtime/src/kmp.h Mon Sep 7 19:29:06 2020 (r365426) +++ stable/11/contrib/llvm-project/openmp/runtime/src/kmp.h Mon Sep 7 19:35:30 2020 (r365427) @@ -3463,13 +3463,7 @@ enum fork_context_e { extern int __kmp_fork_call(ident_t *loc, int gtid, enum fork_context_e fork_context, kmp_int32 argc, microtask_t microtask, launch_t invoker, -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_ARM || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && KMP_OS_LINUX - va_list *ap -#else - va_list ap -#endif - ); + kmp_va_list ap); extern void __kmp_join_call(ident_t *loc, int gtid #if OMPT_SUPPORT Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp ============================================================================== --- stable/11/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp Mon Sep 7 19:29:06 2020 (r365426) +++ stable/11/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp Mon Sep 7 19:35:30 2020 (r365427) @@ -308,13 +308,7 @@ void __kmpc_fork_call(ident_t *loc, kmp_int32 argc, km __kmp_fork_call(loc, gtid, fork_context_intel, argc, VOLATILE_CAST(microtask_t) microtask, // "wrapped" task VOLATILE_CAST(launch_t) __kmp_invoke_task_func, -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - &ap -#else - ap -#endif - ); + kmp_va_addr_of(ap)); #if INCLUDE_SSC_MARKS SSC_MARK_JOINING(); #endif @@ -408,16 +402,10 @@ void __kmpc_fork_teams(ident_t *loc, kmp_int32 argc, k KMP_DEBUG_ASSERT(this_thr->th.th_teams_size.nteams >= 1); KMP_DEBUG_ASSERT(this_thr->th.th_teams_size.nth >= 1); - __kmp_fork_call(loc, gtid, fork_context_intel, argc, - VOLATILE_CAST(microtask_t) - __kmp_teams_master, // "wrapped" task - VOLATILE_CAST(launch_t) __kmp_invoke_teams_master, -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - &ap -#else - ap -#endif - ); + __kmp_fork_call( + loc, gtid, fork_context_intel, argc, + VOLATILE_CAST(microtask_t) __kmp_teams_master, // "wrapped" task + VOLATILE_CAST(launch_t) __kmp_invoke_teams_master, kmp_va_addr_of(ap)); __kmp_join_call(loc, gtid #if OMPT_SUPPORT , Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp ============================================================================== --- stable/11/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp Mon Sep 7 19:29:06 2020 (r365426) +++ stable/11/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp Mon Sep 7 19:35:30 2020 (r365427) @@ -376,13 +376,7 @@ static va_start(ap, argc); rc = __kmp_fork_call(loc, gtid, fork_context_gnu, argc, wrapper, - __kmp_invoke_task_func, -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - &ap -#else - ap -#endif - ); + __kmp_invoke_task_func, kmp_va_addr_of(ap)); va_end(ap); Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h ============================================================================== --- stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 19:29:06 2020 (r365426) +++ stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 19:35:30 2020 (r365427) @@ -200,6 +200,18 @@ typedef kmp_uint32 kmp_uint; #define KMP_INT_MAX ((kmp_int32)0x7FFFFFFF) #define KMP_INT_MIN ((kmp_int32)0x80000000) +// stdarg handling +#if (KMP_ARCH_ARM || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && \ + (KMP_OS_FREEBSD || KMP_OS_LINUX) +typedef va_list *kmp_va_list; +#define kmp_va_deref(ap) (*(ap)) +#define kmp_va_addr_of(ap) (&(ap)) +#else +typedef va_list kmp_va_list; +#define kmp_va_deref(ap) (ap) +#define kmp_va_addr_of(ap) (ap) +#endif + #ifdef __cplusplus // macros to cast out qualifiers and to re-interpret types #define CCAST(type, var) const_cast(var) Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp ============================================================================== --- stable/11/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp Mon Sep 7 19:29:06 2020 (r365426) +++ stable/11/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp Mon Sep 7 19:35:30 2020 (r365427) @@ -1389,13 +1389,7 @@ void __kmp_serialized_parallel(ident_t *loc, kmp_int32 int __kmp_fork_call(ident_t *loc, int gtid, enum fork_context_e call_context, // Intel, GNU, ... kmp_int32 argc, microtask_t microtask, launch_t invoker, -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - va_list *ap -#else - va_list ap -#endif - ) { + kmp_va_list ap) { void **argv; int i; int master_tid; @@ -1505,12 +1499,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, parent_team->t.t_argc = argc; argv = (void **)parent_team->t.t_argv; for (i = argc - 1; i >= 0; --i) -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - *argv++ = va_arg(*ap, void *); -#else - *argv++ = va_arg(ap, void *); -#endif + *argv++ = va_arg(kmp_va_deref(ap), void *); // Increment our nested depth levels, but not increase the serialization if (parent_team == master_th->th.th_serial_team) { // AC: we are in serialized parallel @@ -1804,12 +1793,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, argv = (void **)team->t.t_argv; if (ap) { for (i = argc - 1; i >= 0; --i) -// TODO: revert workaround for Intel(R) 64 tracker #96 -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - *argv++ = va_arg(*ap, void *); -#else - *argv++ = va_arg(ap, void *); -#endif + *argv++ = va_arg(kmp_va_deref(ap), void *); } else { for (i = 0; i < argc; ++i) // Get args from parent team for teams construct @@ -1840,12 +1824,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, } else { argv = args; for (i = argc - 1; i >= 0; --i) -// TODO: revert workaround for Intel(R) 64 tracker #96 -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - *argv++ = va_arg(*ap, void *); -#else - *argv++ = va_arg(ap, void *); -#endif + *argv++ = va_arg(kmp_va_deref(ap), void *); KMP_MB(); #if OMPT_SUPPORT @@ -2130,12 +2109,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, argv = (void **)team->t.t_argv; if (ap) { for (i = argc - 1; i >= 0; --i) { -// TODO: revert workaround for Intel(R) 64 tracker #96 -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - void *new_argv = va_arg(*ap, void *); -#else - void *new_argv = va_arg(ap, void *); -#endif + void *new_argv = va_arg(kmp_va_deref(ap), void *); KMP_CHECK_UPDATE(*argv, new_argv); argv++; } Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Mon Sep 7 19:29:06 2020 (r365426) +++ stable/11/share/mk/src.opts.mk Mon Sep 7 19:35:30 2020 (r365427) @@ -342,7 +342,8 @@ __DEFAULT_NO_OPTIONS+=OFED .endif .if ${COMPILER_FEATURES:Mc++11} && \ - (${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc64") + (${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ + ${__T} == "powerpc64") __DEFAULT_YES_OPTIONS+=OPENMP .else __DEFAULT_NO_OPTIONS+=OPENMP From owner-svn-src-stable@freebsd.org Mon Sep 7 20:17:14 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D5493D594A; Mon, 7 Sep 2020 20:17:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlfhT6brSz4g7C; Mon, 7 Sep 2020 20:17:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5FF924DAC; Mon, 7 Sep 2020 20:17:13 +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 087KHDpt053799; Mon, 7 Sep 2020 20:17:13 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087KHDGH053798; Mon, 7 Sep 2020 20:17:13 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009072017.087KHDGH053798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 7 Sep 2020 20:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365430 - in stable: 11/contrib/llvm-project/openmp/runtime/src 12/contrib/llvm-project/openmp/runtime/src X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/openmp/runtime/src 12/contrib/llvm-project/openmp/runtime/src X-SVN-Commit-Revision: 365430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 20:17:14 -0000 Author: dim Date: Mon Sep 7 20:17:13 2020 New Revision: 365430 URL: https://svnweb.freebsd.org/changeset/base/365430 Log: MFC r365429: Merge commit 47b0262d3 from llvm git (by me): Add include to kmp_os.h, to get the va_list type, required after cde8f4c164a2. Sort system includes, while here. The original merged commit works fine by itself on head, but fails to compile on stable branches because stdarg.h is not implicitly pulled in. PR: 248864 Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h Directory Properties: stable/11/ (props changed) stable/11/contrib/llvm-project/openmp/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h ============================================================================== --- stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 20:10:03 2020 (r365429) +++ stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 20:17:13 2020 (r365430) @@ -14,8 +14,9 @@ #define KMP_OS_H #include "kmp_config.h" -#include #include +#include +#include #define KMP_FTN_PLAIN 1 #define KMP_FTN_APPEND 2 From owner-svn-src-stable@freebsd.org Mon Sep 7 20:17:13 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0CFB3D537D; Mon, 7 Sep 2020 20:17:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlfhT4YqYz4g7B; Mon, 7 Sep 2020 20:17:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B67A24E1B; Mon, 7 Sep 2020 20:17:13 +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 087KHD2X053793; Mon, 7 Sep 2020 20:17:13 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087KHDIl053792; Mon, 7 Sep 2020 20:17:13 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009072017.087KHDIl053792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 7 Sep 2020 20:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365430 - in stable: 11/contrib/llvm-project/openmp/runtime/src 12/contrib/llvm-project/openmp/runtime/src X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/openmp/runtime/src 12/contrib/llvm-project/openmp/runtime/src X-SVN-Commit-Revision: 365430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 20:17:13 -0000 Author: dim Date: Mon Sep 7 20:17:13 2020 New Revision: 365430 URL: https://svnweb.freebsd.org/changeset/base/365430 Log: MFC r365429: Merge commit 47b0262d3 from llvm git (by me): Add include to kmp_os.h, to get the va_list type, required after cde8f4c164a2. Sort system includes, while here. The original merged commit works fine by itself on head, but fails to compile on stable branches because stdarg.h is not implicitly pulled in. PR: 248864 Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h Directory Properties: stable/11/ (props changed) stable/11/contrib/llvm-project/openmp/ (props changed) Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h ============================================================================== --- stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 20:10:03 2020 (r365429) +++ stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 20:17:13 2020 (r365430) @@ -14,8 +14,9 @@ #define KMP_OS_H #include "kmp_config.h" -#include #include +#include +#include #define KMP_FTN_PLAIN 1 #define KMP_FTN_APPEND 2 From owner-svn-src-stable@freebsd.org Mon Sep 7 23:20:03 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 424053D93B1; Mon, 7 Sep 2020 23:20:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlklR11zKz3cDT; Mon, 7 Sep 2020 23:20:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02D7F26F2B; Mon, 7 Sep 2020 23:20:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087NK2J0065486; Mon, 7 Sep 2020 23:20:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087NK2or065485; Mon, 7 Sep 2020 23:20:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009072320.087NK2or065485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 7 Sep 2020 23:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365434 - stable/12/sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/netinet6 X-SVN-Commit-Revision: 365434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 23:20:03 -0000 Author: kevans Date: Mon Sep 7 23:20:02 2020 New Revision: 365434 URL: https://svnweb.freebsd.org/changeset/base/365434 Log: MFC r364982: ipv6: quit dropping packets looping back on p2p interfaces PR: 247718 Modified: stable/12/sys/netinet6/ip6_forward.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet6/ip6_forward.c ============================================================================== --- stable/12/sys/netinet6/ip6_forward.c Mon Sep 7 21:37:16 2020 (r365433) +++ stable/12/sys/netinet6/ip6_forward.c Mon Sep 7 23:20:02 2020 (r365434) @@ -257,24 +257,8 @@ again2: * modified by a redirect. */ if (V_ip6_sendredirects && rt->rt_ifp == m->m_pkthdr.rcvif && !srcrt && - (rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0) { - if ((rt->rt_ifp->if_flags & IFF_POINTOPOINT) != 0) { - /* - * If the incoming interface is equal to the outgoing - * one, and the link attached to the interface is - * point-to-point, then it will be highly probable - * that a routing loop occurs. Thus, we immediately - * drop the packet and send an ICMPv6 error message. - * - * type/code is based on suggestion by Rich Draves. - * not sure if it is the best pick. - */ - icmp6_error(mcopy, ICMP6_DST_UNREACH, - ICMP6_DST_UNREACH_ADDR, 0); - goto bad; - } + (rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0) type = ND_REDIRECT; - } /* * Fake scoped addresses. Note that even link-local source or From owner-svn-src-stable@freebsd.org Mon Sep 7 23:21:54 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FA663D961D; Mon, 7 Sep 2020 23:21:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlknZ3p7Vz3cJR; Mon, 7 Sep 2020 23:21:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6589527277; Mon, 7 Sep 2020 23:21:54 +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 087NLsVO071153; Mon, 7 Sep 2020 23:21:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087NLsxR071151; Mon, 7 Sep 2020 23:21:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009072321.087NLsxR071151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 7 Sep 2020 23:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365435 - in stable/12/sys/dev: rtwn/usb usb X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys/dev: rtwn/usb usb X-SVN-Commit-Revision: 365435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 23:21:54 -0000 Author: markj Date: Mon Sep 7 23:21:53 2020 New Revision: 365435 URL: https://svnweb.freebsd.org/changeset/base/365435 Log: MFC r364993: rtwn(4): Add support for the Belkin N300. PR: 249034 Modified: stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h stable/12/sys/dev/usb/usbdevs Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h Mon Sep 7 23:20:02 2020 (r365434) +++ stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h Mon Sep 7 23:21:53 2020 (r365435) @@ -49,6 +49,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8192CU_DEV(AZUREWAVE, RTL8188CE_2), RTWN_RTL8192CU_DEV(AZUREWAVE, RTL8188CU), RTWN_RTL8192CU_DEV(BELKIN, F7D2102), + RTWN_RTL8192CU_DEV(BELKIN, F9L1004V1), RTWN_RTL8192CU_DEV(BELKIN, RTL8188CU), RTWN_RTL8192CU_DEV(BELKIN, RTL8192CU), RTWN_RTL8192CU_DEV(CHICONY, RTL8188CUS_1), Modified: stable/12/sys/dev/usb/usbdevs ============================================================================== --- stable/12/sys/dev/usb/usbdevs Mon Sep 7 23:20:02 2020 (r365434) +++ stable/12/sys/dev/usb/usbdevs Mon Sep 7 23:21:53 2020 (r365435) @@ -1379,6 +1379,7 @@ product BELKIN F6C900UNV 0x0900 F6C900-UNV product BELKIN F6C100UNV 0x0910 F6C100-UNV product BELKIN F6C120UNV 0x0912 F6C120-UNV UPS product BELKIN F6C800UNV 0x0980 F6C800-UNV +product BELKIN F9L1004V1 0x1004 N300 Wireless Adapter product BELKIN F6C1100UNV 0x1100 F6C1100-UNV, F6C1200-UNV product BELKIN F5U120 0x1203 F5U120-PC Hub product BELKIN RTL8188CU 0x1102 RTL8188CU Wireless Adapter From owner-svn-src-stable@freebsd.org Mon Sep 7 23:22:17 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3756B3D935E; Mon, 7 Sep 2020 23:22:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blkp10nllz3cX6; Mon, 7 Sep 2020 23:22:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F297C26F43; Mon, 7 Sep 2020 23:22:16 +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 087NMGGP071256; Mon, 7 Sep 2020 23:22:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087NMGK9071255; Mon, 7 Sep 2020 23:22:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009072322.087NMGK9071255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 7 Sep 2020 23:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365436 - stable/12/sbin/ggate/ggated X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sbin/ggate/ggated X-SVN-Commit-Revision: 365436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 23:22:17 -0000 Author: markj Date: Mon Sep 7 23:22:16 2020 New Revision: 365436 URL: https://svnweb.freebsd.org/changeset/base/365436 Log: MFC r364995: ggated(8): Avoid doubly opening the requested disk device. PR: 132845 Modified: stable/12/sbin/ggate/ggated/ggated.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ggate/ggated/ggated.c ============================================================================== --- stable/12/sbin/ggate/ggated/ggated.c Mon Sep 7 23:21:53 2020 (r365435) +++ stable/12/sbin/ggate/ggated/ggated.c Mon Sep 7 23:22:16 2020 (r365436) @@ -349,6 +349,16 @@ exports_check(struct ggd_export *ex, struct g_gate_cin flags = O_WRONLY; else flags = O_RDWR; + if (conn->c_diskfd != -1) { + if (strcmp(conn->c_path, ex->e_path) != 0) { + g_gate_log(LOG_ERR, "old %s and new %s: " + "Path mismatch during handshakes.", + conn->c_path, ex->e_path); + return (EPERM); + } + return (0); + } + conn->c_diskfd = open(ex->e_path, flags); if (conn->c_diskfd == -1) { error = errno; @@ -455,7 +465,7 @@ connection_new(struct g_gate_cinit *cinit, struct sock conn->c_token = cinit->gc_token; ip = htonl(((struct sockaddr_in *)(void *)s)->sin_addr.s_addr); conn->c_srcip = ip; - conn->c_sendfd = conn->c_recvfd = -1; + conn->c_diskfd = conn->c_sendfd = conn->c_recvfd = -1; if ((cinit->gc_flags & GGATE_FLAG_SEND) != 0) conn->c_sendfd = sfd; else @@ -510,6 +520,8 @@ connection_remove(struct ggd_connection *conn) LIST_REMOVE(conn, c_next); g_gate_log(LOG_DEBUG, "Connection removed [%s %s].", ip2str(conn->c_srcip), conn->c_path); + if (conn->c_diskfd != -1) + close(conn->c_diskfd); if (conn->c_sendfd != -1) close(conn->c_sendfd); if (conn->c_recvfd != -1) From owner-svn-src-stable@freebsd.org Tue Sep 8 03:55:50 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B11E23E1AF5; Tue, 8 Sep 2020 03:55:50 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blrsf4GXMz4BJb; Tue, 8 Sep 2020 03:55:50 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 767C2A934; Tue, 8 Sep 2020 03:55:50 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0883to0D039051; Tue, 8 Sep 2020 03:55:50 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0883to9S039050; Tue, 8 Sep 2020 03:55:50 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202009080355.0883to9S039050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Tue, 8 Sep 2020 03:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365443 - stable/12/sys/amd64/vmm X-SVN-Group: stable-12 X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: stable/12/sys/amd64/vmm X-SVN-Commit-Revision: 365443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 03:55:50 -0000 Author: grehan Date: Tue Sep 8 03:55:49 2020 New Revision: 365443 URL: https://svnweb.freebsd.org/changeset/base/365443 Log: MFC 364339 Allow guest device MMIO access from bootmem memory segments. Differential Revision: https://reviews.freebsd.org/D25955 Modified: stable/12/sys/amd64/vmm/vmm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/vmm/vmm.c ============================================================================== --- stable/12/sys/amd64/vmm/vmm.c Tue Sep 8 03:00:31 2020 (r365442) +++ stable/12/sys/amd64/vmm/vmm.c Tue Sep 8 03:55:49 2020 (r365443) @@ -980,8 +980,7 @@ vm_gpa_hold(struct vm *vm, int vcpuid, vm_paddr_t gpa, count = 0; for (i = 0; i < VM_MAX_MEMMAPS; i++) { mm = &vm->mem_maps[i]; - if (sysmem_mapping(vm, mm) && gpa >= mm->gpa && - gpa < mm->gpa + mm->len) { + if (gpa >= mm->gpa && gpa < mm->gpa + mm->len) { count = vm_fault_quick_hold_pages(&vm->vmspace->vm_map, trunc_page(gpa), PAGE_SIZE, reqprot, &m, 1); break; From owner-svn-src-stable@freebsd.org Tue Sep 8 07:37:46 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55D8D3E6569; Tue, 8 Sep 2020 07:37:46 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blxnk1P35z4NhT; Tue, 8 Sep 2020 07:37:46 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F78ACB67; Tue, 8 Sep 2020 07:37:46 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0887bjWk074807; Tue, 8 Sep 2020 07:37:45 GMT (envelope-from rew@FreeBSD.org) Received: (from rew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0887bjE8074806; Tue, 8 Sep 2020 07:37:45 GMT (envelope-from rew@FreeBSD.org) Message-Id: <202009080737.0887bjE8074806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rew set sender to rew@FreeBSD.org using -f From: Robert Wing Date: Tue, 8 Sep 2020 07:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365448 - stable/12/sbin/bectl X-SVN-Group: stable-12 X-SVN-Commit-Author: rew X-SVN-Commit-Paths: stable/12/sbin/bectl X-SVN-Commit-Revision: 365448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 07:37:46 -0000 Author: rew Date: Tue Sep 8 07:37:45 2020 New Revision: 365448 URL: https://svnweb.freebsd.org/changeset/base/365448 Log: MFC r364369: bectl(8): Fix output of 'bectl list' for the 'Mountpoint' column. PR: 241064 Modified: stable/12/sbin/bectl/bectl_list.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/bectl/bectl_list.c ============================================================================== --- stable/12/sbin/bectl/bectl_list.c Tue Sep 8 06:19:23 2020 (r365447) +++ stable/12/sbin/bectl/bectl_list.c Tue Sep 8 07:37:45 2020 (r365448) @@ -292,19 +292,23 @@ print_headers(nvlist_t *props, struct printc *pc) nvpair_t *cur; nvlist_t *dsprops; char *propstr; - size_t be_maxcol; + size_t be_maxcol, mount_colsz; if (pc->show_all_datasets || pc->show_snaps) chosen_be_header = HEADER_BEPLUS; else chosen_be_header = HEADER_BE; be_maxcol = strlen(chosen_be_header); + mount_colsz = strlen(HEADER_MOUNT); for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; cur = nvlist_next_nvpair(props, cur)) { be_maxcol = MAX(be_maxcol, strlen(nvpair_name(cur))); + nvpair_value_nvlist(cur, &dsprops); + + if (nvlist_lookup_string(dsprops, "mounted", &propstr) == 0) + mount_colsz = MAX(mount_colsz, strlen(propstr)); if (!pc->show_all_datasets && !pc->show_snaps) continue; - nvpair_value_nvlist(cur, &dsprops); if (nvlist_lookup_string(dsprops, "dataset", &propstr) != 0) continue; be_maxcol = MAX(be_maxcol, strlen(propstr) + INDENT_INCREMENT); @@ -316,10 +320,10 @@ print_headers(nvlist_t *props, struct printc *pc) pc->be_colsz = be_maxcol; pc->active_colsz_def = strlen(HEADER_ACTIVE); - pc->mount_colsz = strlen(HEADER_MOUNT); + pc->mount_colsz = mount_colsz; pc->space_colsz = strlen(HEADER_SPACE); - printf("%*s %s %s %s %s\n", -pc->be_colsz, chosen_be_header, - HEADER_ACTIVE, HEADER_MOUNT, HEADER_SPACE, HEADER_CREATED); + printf("%*s %s %*s %s %s\n", -pc->be_colsz, chosen_be_header, + HEADER_ACTIVE, -pc->mount_colsz, HEADER_MOUNT, HEADER_SPACE, HEADER_CREATED); /* * All other invocations in which we aren't using the default header From owner-svn-src-stable@freebsd.org Tue Sep 8 12:37:19 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46E48337543; Tue, 8 Sep 2020 12:37:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm4RM14qDz3S7p; Tue, 8 Sep 2020 12:37:19 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0830C10748; Tue, 8 Sep 2020 12:37:19 +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 088CbI6B058076; Tue, 8 Sep 2020 12:37:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088CbITP058075; Tue, 8 Sep 2020 12:37:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009081237.088CbITP058075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 8 Sep 2020 12:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365452 - stable/12/cddl/lib/libdtrace X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/cddl/lib/libdtrace X-SVN-Commit-Revision: 365452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 12:37:19 -0000 Author: markj Date: Tue Sep 8 12:37:18 2020 New Revision: 365452 URL: https://svnweb.freebsd.org/changeset/base/365452 Log: MFC r365047: Correct the D definition for EINTEGRITY. Modified: stable/12/cddl/lib/libdtrace/errno.d Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/lib/libdtrace/errno.d ============================================================================== --- stable/12/cddl/lib/libdtrace/errno.d Tue Sep 8 11:46:33 2020 (r365451) +++ stable/12/cddl/lib/libdtrace/errno.d Tue Sep 8 12:37:18 2020 (r365452) @@ -225,7 +225,7 @@ inline int ENOTRECOVERABLE = 95; #pragma D binding "1.13" ENOTRECOVERABLE inline int EOWNERDEAD = 96; #pragma D binding "1.13" EOWNERDEAD -inline int EINTEGRITY = 96; +inline int EINTEGRITY = 97; #pragma D binding "1.13" EINTEGRITY inline int ELAST = 97; #pragma D binding "1.0" ELAST From owner-svn-src-stable@freebsd.org Tue Sep 8 12:37:49 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 254363373FD; Tue, 8 Sep 2020 12:37:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm4Rv1W0Pz3SV8; Tue, 8 Sep 2020 12:37:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A824E10661; Tue, 8 Sep 2020 12:37:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088Cbk0e058243; Tue, 8 Sep 2020 12:37:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088Cbktc058242; Tue, 8 Sep 2020 12:37:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009081237.088Cbktc058242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 8 Sep 2020 12:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365453 - stable/12/sys/cddl/dev/dtrace/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/cddl/dev/dtrace/amd64 X-SVN-Commit-Revision: 365453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 12:37:51 -0000 Author: markj Date: Tue Sep 8 12:37:46 2020 New Revision: 365453 URL: https://svnweb.freebsd.org/changeset/base/365453 Log: MFC r365048: Tighten frame pointer checking in DTrace's amd64 stack unwinder. Modified: stable/12/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/dev/dtrace/amd64/dtrace_isa.c ============================================================================== --- stable/12/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Tue Sep 8 12:37:18 2020 (r365452) +++ stable/12/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Tue Sep 8 12:37:46 2020 (r365453) @@ -56,6 +56,7 @@ void dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, uint32_t *intrpc) { + struct thread *td; int depth = 0; register_t rbp; struct amd64_frame *frame; @@ -70,10 +71,16 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in __asm __volatile("movq %%rbp,%0" : "=r" (rbp)); frame = (struct amd64_frame *)rbp; + td = curthread; while (depth < pcstack_limit) { if (!INKERNEL((long) frame)) break; + if ((vm_offset_t)frame >= + td->td_kstack + ptoa(td->td_kstack_pages) || + (vm_offset_t)frame < td->td_kstack) + break; + callpc = frame->f_retaddr; if (!INKERNEL(callpc)) @@ -84,14 +91,11 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in if ((aframes == 0) && (caller != 0)) { pcstack[depth++] = caller; } - } - else { + } else { pcstack[depth++] = callpc; } - if (frame->f_frame <= frame || - (vm_offset_t)frame->f_frame >= curthread->td_kstack + - curthread->td_kstack_pages * PAGE_SIZE) + if ((vm_offset_t)frame->f_frame <= (vm_offset_t)frame) break; frame = frame->f_frame; } From owner-svn-src-stable@freebsd.org Tue Sep 8 12:38:36 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A671337736; Tue, 8 Sep 2020 12:38:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm4Sr1pwLz3SSw; Tue, 8 Sep 2020 12:38:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 218CC1098F; Tue, 8 Sep 2020 12:38:36 +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 088CcZBh058332; Tue, 8 Sep 2020 12:38:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088CcZll058328; Tue, 8 Sep 2020 12:38:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009081238.088CcZll058328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 8 Sep 2020 12:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365454 - stable/12/usr.sbin/pw X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.sbin/pw X-SVN-Commit-Revision: 365454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 12:38:36 -0000 Author: markj Date: Tue Sep 8 12:38:34 2020 New Revision: 365454 URL: https://svnweb.freebsd.org/changeset/base/365454 Log: MFC r365043-r365046: pw: Coverity fixes. Modified: stable/12/usr.sbin/pw/pw_group.c stable/12/usr.sbin/pw/pw_user.c stable/12/usr.sbin/pw/rm_r.c stable/12/usr.sbin/pw/strtounum.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/pw/pw_group.c ============================================================================== --- stable/12/usr.sbin/pw/pw_group.c Tue Sep 8 12:37:46 2020 (r365453) +++ stable/12/usr.sbin/pw/pw_group.c Tue Sep 8 12:38:34 2020 (r365454) @@ -66,13 +66,18 @@ grp_set_passwd(struct group *grp, bool update, int fd, } if ((istty = isatty(fd))) { - n = t; - /* Disable echo */ - n.c_lflag &= ~(ECHO); - tcsetattr(fd, TCSANOW, &n); - printf("%sassword for group %s:", update ? "New p" : "P", - grp->gr_name); - fflush(stdout); + if (tcgetattr(fd, &t) == -1) + istty = 0; + else { + n = t; + /* Disable echo */ + n.c_lflag &= ~(ECHO); + tcsetattr(fd, TCSANOW, &n); + printf("%sassword for group %s:", + update ? "New p" : "P", + grp->gr_name); + fflush(stdout); + } } b = read(fd, line, sizeof(line) - 1); if (istty) { /* Restore state */ Modified: stable/12/usr.sbin/pw/pw_user.c ============================================================================== --- stable/12/usr.sbin/pw/pw_user.c Tue Sep 8 12:37:46 2020 (r365453) +++ stable/12/usr.sbin/pw/pw_user.c Tue Sep 8 12:38:34 2020 (r365454) @@ -712,24 +712,24 @@ rmopie(char const * name) { char tmp[1014]; FILE *fp; - int fd; size_t len; - off_t atofs = 0; - + long atofs; + int fd; + if ((fd = openat(conf.rootfd, "etc/opiekeys", O_RDWR)) == -1) return; fp = fdopen(fd, "r+"); len = strlen(name); - while (fgets(tmp, sizeof(tmp), fp) != NULL) { + for (atofs = 0; fgets(tmp, sizeof(tmp), fp) != NULL && atofs >= 0; + atofs = ftell(fp)) { if (strncmp(name, tmp, len) == 0 && tmp[len]==' ') { /* Comment username out */ if (fseek(fp, atofs, SEEK_SET) == 0) fwrite("#", 1, 1, fp); break; } - atofs = ftell(fp); } /* * If we got an error of any sort, don't update! Modified: stable/12/usr.sbin/pw/rm_r.c ============================================================================== --- stable/12/usr.sbin/pw/rm_r.c Tue Sep 8 12:37:46 2020 (r365453) +++ stable/12/usr.sbin/pw/rm_r.c Tue Sep 8 12:38:34 2020 (r365454) @@ -57,6 +57,10 @@ rm_r(int rootfd, const char *path, uid_t uid) } d = fdopendir(dirfd); + if (d == NULL) { + (void)close(dirfd); + return; + } while ((e = readdir(d)) != NULL) { if (strcmp(e->d_name, ".") == 0 || strcmp(e->d_name, "..") == 0) continue; Modified: stable/12/usr.sbin/pw/strtounum.c ============================================================================== --- stable/12/usr.sbin/pw/strtounum.c Tue Sep 8 12:37:46 2020 (r365453) +++ stable/12/usr.sbin/pw/strtounum.c Tue Sep 8 12:38:34 2020 (r365454) @@ -44,28 +44,24 @@ strtounum(const char * __restrict np, uintmax_t minval *errpp = NULL; if (minval > maxval) { errno = EINVAL; - if (errpp != NULL) - *errpp = "invalid"; + *errpp = "invalid"; return (0); } errno = 0; ret = strtoumax(np, &endp, 10); if (endp == np || *endp != '\0') { errno = EINVAL; - if (errpp != NULL) - *errpp = "invalid"; + *errpp = "invalid"; return (0); } if (ret < minval) { errno = ERANGE; - if (errpp != NULL) - *errpp = "too small"; + *errpp = "too small"; return (0); } if (errno == ERANGE || ret > maxval) { errno = ERANGE; - if (errpp != NULL) - *errpp = "too large"; + *errpp = "too large"; return (0); } return (ret); From owner-svn-src-stable@freebsd.org Tue Sep 8 16:43:34 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C8DC3CF484; Tue, 8 Sep 2020 16:43:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm9vV0CJKz41GB; Tue, 8 Sep 2020 16:43: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE87A137D1; Tue, 8 Sep 2020 16:43:33 +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 088GhXxZ012092; Tue, 8 Sep 2020 16:43:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088GhXAC012090; Tue, 8 Sep 2020 16:43:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081643.088GhXAC012090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 16:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365465 - in stable: 11/share/mk 11/sys/conf 12/share/mk 12/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/share/mk 11/sys/conf 12/share/mk 12/sys/conf X-SVN-Commit-Revision: 365465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 16:43:34 -0000 Author: jhb Date: Tue Sep 8 16:43:32 2020 New Revision: 365465 URL: https://svnweb.freebsd.org/changeset/base/365465 Log: MFC 354970: Add a kmod.opts.mk. This Makefile sets KERN_OPTS. This permits kernel module Makefiles to use KERN_OPTS to control the value of variables such as SRCS that are used by bsd.kmod.mk for KERN_OPTS values that honor WITH/WITHOUT options for standalone builds. Added: stable/11/share/mk/kmod.opts.mk - copied unchanged from r354970, head/share/mk/kmod.opts.mk stable/11/sys/conf/kmod.opts.mk - copied unchanged from r354970, head/sys/conf/kmod.opts.mk Modified: stable/11/sys/conf/kmod.mk Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Added: stable/12/share/mk/kmod.opts.mk - copied unchanged from r354970, head/share/mk/kmod.opts.mk stable/12/sys/conf/kmod.opts.mk - copied unchanged from r354970, head/sys/conf/kmod.opts.mk Modified: stable/12/sys/conf/kmod.mk Directory Properties: stable/12/ (props changed) Copied: stable/11/share/mk/kmod.opts.mk (from r354970, head/share/mk/kmod.opts.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/mk/kmod.opts.mk Tue Sep 8 16:43:32 2020 (r365465, copy of r354970, head/share/mk/kmod.opts.mk) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +.include +.include "${SYSDIR}/conf/kmod.opts.mk" Modified: stable/11/sys/conf/kmod.mk ============================================================================== --- stable/11/sys/conf/kmod.mk Tue Sep 8 16:07:47 2020 (r365464) +++ stable/11/sys/conf/kmod.mk Tue Sep 8 16:43:32 2020 (r365465) @@ -69,12 +69,7 @@ KMODUNLOAD?= /sbin/kldunload KMODISLOADED?= /sbin/kldstat -q -n OBJCOPY?= objcopy -.include -# Grab all the options for a kernel build. For backwards compat, we need to -# do this after bsd.own.mk. -.include "kern.opts.mk" -.include -.include "config.mk" +.include "kmod.opts.mk" # Search for kernel source tree in standard places. .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys Copied: stable/11/sys/conf/kmod.opts.mk (from r354970, head/sys/conf/kmod.opts.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/conf/kmod.opts.mk Tue Sep 8 16:43:32 2020 (r365465, copy of r354970, head/sys/conf/kmod.opts.mk) @@ -0,0 +1,16 @@ +# $FreeBSD$ +# +# Handle options (KERN_OPTS) for kernel module options. This can be included earlier in a kmod Makefile +# to allow KERN_OPTS to control SRCS, etc. + +.if !target(____) +____: + +.include +# Grab all the options for a kernel build. For backwards compat, we need to +# do this after bsd.own.mk. +.include "kern.opts.mk" +.include +.include "config.mk" + +.endif # !target(____) From owner-svn-src-stable@freebsd.org Tue Sep 8 16:43:33 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 759673CF2E2; Tue, 8 Sep 2020 16:43:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm9vT2VWJz414d; Tue, 8 Sep 2020 16:43:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 392521385C; Tue, 8 Sep 2020 16:43:33 +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 088GhXeA012084; Tue, 8 Sep 2020 16:43:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088GhWEV012082; Tue, 8 Sep 2020 16:43:32 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081643.088GhWEV012082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 16:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365465 - in stable: 11/share/mk 11/sys/conf 12/share/mk 12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/share/mk 11/sys/conf 12/share/mk 12/sys/conf X-SVN-Commit-Revision: 365465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 16:43:33 -0000 Author: jhb Date: Tue Sep 8 16:43:32 2020 New Revision: 365465 URL: https://svnweb.freebsd.org/changeset/base/365465 Log: MFC 354970: Add a kmod.opts.mk. This Makefile sets KERN_OPTS. This permits kernel module Makefiles to use KERN_OPTS to control the value of variables such as SRCS that are used by bsd.kmod.mk for KERN_OPTS values that honor WITH/WITHOUT options for standalone builds. Added: stable/12/share/mk/kmod.opts.mk - copied unchanged from r354970, head/share/mk/kmod.opts.mk stable/12/sys/conf/kmod.opts.mk - copied unchanged from r354970, head/sys/conf/kmod.opts.mk Modified: stable/12/sys/conf/kmod.mk Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Added: stable/11/share/mk/kmod.opts.mk - copied unchanged from r354970, head/share/mk/kmod.opts.mk stable/11/sys/conf/kmod.opts.mk - copied unchanged from r354970, head/sys/conf/kmod.opts.mk Modified: stable/11/sys/conf/kmod.mk Directory Properties: stable/11/ (props changed) Copied: stable/12/share/mk/kmod.opts.mk (from r354970, head/share/mk/kmod.opts.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/mk/kmod.opts.mk Tue Sep 8 16:43:32 2020 (r365465, copy of r354970, head/share/mk/kmod.opts.mk) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +.include +.include "${SYSDIR}/conf/kmod.opts.mk" Modified: stable/12/sys/conf/kmod.mk ============================================================================== --- stable/12/sys/conf/kmod.mk Tue Sep 8 16:07:47 2020 (r365464) +++ stable/12/sys/conf/kmod.mk Tue Sep 8 16:43:32 2020 (r365465) @@ -73,12 +73,7 @@ KMODUNLOAD?= /sbin/kldunload KMODISLOADED?= /sbin/kldstat -q -n OBJCOPY?= objcopy -.include -# Grab all the options for a kernel build. For backwards compat, we need to -# do this after bsd.own.mk. -.include "kern.opts.mk" -.include -.include "config.mk" +.include "kmod.opts.mk" # Search for kernel source tree in standard places. .if empty(KERNBUILDDIR) Copied: stable/12/sys/conf/kmod.opts.mk (from r354970, head/sys/conf/kmod.opts.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/conf/kmod.opts.mk Tue Sep 8 16:43:32 2020 (r365465, copy of r354970, head/sys/conf/kmod.opts.mk) @@ -0,0 +1,16 @@ +# $FreeBSD$ +# +# Handle options (KERN_OPTS) for kernel module options. This can be included earlier in a kmod Makefile +# to allow KERN_OPTS to control SRCS, etc. + +.if !target(____) +____: + +.include +# Grab all the options for a kernel build. For backwards compat, we need to +# do this after bsd.own.mk. +.include "kern.opts.mk" +.include +.include "config.mk" + +.endif # !target(____) From owner-svn-src-stable@freebsd.org Tue Sep 8 18:29:21 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47E513D2D1C; Tue, 8 Sep 2020 18:29:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmDFY1Fy9z4FSM; Tue, 8 Sep 2020 18:29:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E5D614A5B; Tue, 8 Sep 2020 18:29:21 +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 088ITK8r079959; Tue, 8 Sep 2020 18:29:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088ITKk0079958; Tue, 8 Sep 2020 18:29:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081829.088ITKk0079958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 18:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365467 - in stable: 11/sys/modules/if_enc 12/sys/modules/if_enc X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/modules/if_enc 12/sys/modules/if_enc X-SVN-Commit-Revision: 365467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 18:29:21 -0000 Author: jhb Date: Tue Sep 8 18:29:20 2020 New Revision: 365467 URL: https://svnweb.freebsd.org/changeset/base/365467 Log: MFC 361634: Add opt_ipsec.h to fix standalone builds after r361633. Modified: stable/11/sys/modules/if_enc/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/modules/if_enc/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/modules/if_enc/Makefile ============================================================================== --- stable/11/sys/modules/if_enc/Makefile Tue Sep 8 17:47:30 2020 (r365466) +++ stable/11/sys/modules/if_enc/Makefile Tue Sep 8 18:29:20 2020 (r365467) @@ -6,6 +6,6 @@ SYSDIR?=${SRCTOP}/sys .PATH: ${SYSDIR}/net KMOD= if_enc -SRCS= if_enc.c opt_inet.h opt_inet6.h +SRCS= if_enc.c opt_inet.h opt_inet6.h opt_ipsec.h .include From owner-svn-src-stable@freebsd.org Tue Sep 8 18:29:20 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA4703D2B75; Tue, 8 Sep 2020 18:29:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmDFX5wszz4FC9; Tue, 8 Sep 2020 18:29:20 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEFB714F17; Tue, 8 Sep 2020 18:29:20 +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 088ITKOL079953; Tue, 8 Sep 2020 18:29:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088ITKje079952; Tue, 8 Sep 2020 18:29:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081829.088ITKje079952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 18:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365467 - in stable: 11/sys/modules/if_enc 12/sys/modules/if_enc X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/modules/if_enc 12/sys/modules/if_enc X-SVN-Commit-Revision: 365467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 18:29:21 -0000 Author: jhb Date: Tue Sep 8 18:29:20 2020 New Revision: 365467 URL: https://svnweb.freebsd.org/changeset/base/365467 Log: MFC 361634: Add opt_ipsec.h to fix standalone builds after r361633. Modified: stable/12/sys/modules/if_enc/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/modules/if_enc/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/modules/if_enc/Makefile ============================================================================== --- stable/12/sys/modules/if_enc/Makefile Tue Sep 8 17:47:30 2020 (r365466) +++ stable/12/sys/modules/if_enc/Makefile Tue Sep 8 18:29:20 2020 (r365467) @@ -6,6 +6,6 @@ SYSDIR?=${SRCTOP}/sys .PATH: ${SYSDIR}/net KMOD= if_enc -SRCS= if_enc.c opt_inet.h opt_inet6.h +SRCS= if_enc.c opt_inet.h opt_inet6.h opt_ipsec.h .include From owner-svn-src-stable@freebsd.org Tue Sep 8 18:33:43 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E98573D2E3C; Tue, 8 Sep 2020 18:33:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmDLb4CVMz4FsW; Tue, 8 Sep 2020 18:33:43 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F16014C52; Tue, 8 Sep 2020 18:33:42 +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 088IXgbp086147; Tue, 8 Sep 2020 18:33:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088IXgNi086146; Tue, 8 Sep 2020 18:33:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081833.088IXgNi086146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 18:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365468 - stable/12/sys/modules/if_vlan X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/modules/if_vlan X-SVN-Commit-Revision: 365468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 18:33:44 -0000 Author: jhb Date: Tue Sep 8 18:33:41 2020 New Revision: 365468 URL: https://svnweb.freebsd.org/changeset/base/365468 Log: Partial MFC 357275: if_vlan grew a dependency on opt_inet6.h in r356993 Modified: stable/12/sys/modules/if_vlan/Makefile Modified: stable/12/sys/modules/if_vlan/Makefile ============================================================================== --- stable/12/sys/modules/if_vlan/Makefile Tue Sep 8 18:29:20 2020 (r365467) +++ stable/12/sys/modules/if_vlan/Makefile Tue Sep 8 18:33:41 2020 (r365468) @@ -4,6 +4,6 @@ KMOD= if_vlan SRCS= if_vlan.c -SRCS+= opt_inet.h opt_vlan.h opt_ratelimit.h +SRCS+= opt_inet.h opt_inet6.h opt_vlan.h opt_ratelimit.h .include From owner-svn-src-stable@freebsd.org Tue Sep 8 18:49:59 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5C4A3D3334; Tue, 8 Sep 2020 18:49:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmDjM5Pqyz4Gtd; Tue, 8 Sep 2020 18:49:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CA1E14FFE; Tue, 8 Sep 2020 18:49:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088InxHE092610; Tue, 8 Sep 2020 18:49:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088InxlC092609; Tue, 8 Sep 2020 18:49:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081849.088InxlC092609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 18:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365469 - in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Commit-Revision: 365469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 18:49:59 -0000 Author: jhb Date: Tue Sep 8 18:49:58 2020 New Revision: 365469 URL: https://svnweb.freebsd.org/changeset/base/365469 Log: Use kmod.opts.mk in sys/modules/tcp/Makefile to fix standalone builds. This was included in the original commit to head that added use of KERN_OPTS (r361638) but was left out of the MFC since kmod.opts.mk hadn't been MFC'd at the time. It has since been merged. This is a direct commit to stable/11 and stable/12. Reported by: Eugene Grosbein Modified: stable/11/sys/modules/tcp/Makefile Changes in other areas also in this revision: Modified: stable/12/sys/modules/tcp/Makefile Modified: stable/11/sys/modules/tcp/Makefile ============================================================================== --- stable/11/sys/modules/tcp/Makefile Tue Sep 8 18:33:41 2020 (r365468) +++ stable/11/sys/modules/tcp/Makefile Tue Sep 8 18:49:58 2020 (r365469) @@ -2,8 +2,7 @@ # $FreeBSD$ # -SYSDIR?=${SRCTOP}/sys -.include "${SYSDIR}/conf/kern.opts.mk" +.include SUBDIR= \ ${_tcp_fastpath} \ From owner-svn-src-stable@freebsd.org Tue Sep 8 18:49:59 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D36B3D3630; Tue, 8 Sep 2020 18:49:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmDjM3J2hz4Gcc; Tue, 8 Sep 2020 18:49:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50533150C2; Tue, 8 Sep 2020 18:49:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088InxSw092604; Tue, 8 Sep 2020 18:49:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088InxoL092603; Tue, 8 Sep 2020 18:49:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081849.088InxoL092603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 18:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365469 - in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Commit-Revision: 365469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 18:49:59 -0000 Author: jhb Date: Tue Sep 8 18:49:58 2020 New Revision: 365469 URL: https://svnweb.freebsd.org/changeset/base/365469 Log: Use kmod.opts.mk in sys/modules/tcp/Makefile to fix standalone builds. This was included in the original commit to head that added use of KERN_OPTS (r361638) but was left out of the MFC since kmod.opts.mk hadn't been MFC'd at the time. It has since been merged. This is a direct commit to stable/11 and stable/12. Reported by: Eugene Grosbein Modified: stable/12/sys/modules/tcp/Makefile Changes in other areas also in this revision: Modified: stable/11/sys/modules/tcp/Makefile Modified: stable/12/sys/modules/tcp/Makefile ============================================================================== --- stable/12/sys/modules/tcp/Makefile Tue Sep 8 18:33:41 2020 (r365468) +++ stable/12/sys/modules/tcp/Makefile Tue Sep 8 18:49:58 2020 (r365469) @@ -2,8 +2,7 @@ # $FreeBSD$ # -SYSDIR?=${SRCTOP}/sys -.include "${SYSDIR}/conf/kern.opts.mk" +.include SUBDIR= \ ${_tcp_rack} \ From owner-svn-src-stable@freebsd.org Tue Sep 8 18:58:39 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3C513D3BF7; Tue, 8 Sep 2020 18:58:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmDvL6DFjz4J24; Tue, 8 Sep 2020 18:58:38 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA46915271; Tue, 8 Sep 2020 18:58:38 +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 088IwccH099081; Tue, 8 Sep 2020 18:58:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088IwcHn099080; Tue, 8 Sep 2020 18:58:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081858.088IwcHn099080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 18:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365470 - in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Commit-Revision: 365470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 18:58:39 -0000 Author: jhb Date: Tue Sep 8 18:58:38 2020 New Revision: 365470 URL: https://svnweb.freebsd.org/changeset/base/365470 Log: MFC 361764: Revise r361712 to disable tcpmd5.ko for 'options TCP_SIGNATURE' Modified: stable/12/sys/modules/tcp/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/modules/tcp/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/modules/tcp/Makefile ============================================================================== --- stable/12/sys/modules/tcp/Makefile Tue Sep 8 18:49:58 2020 (r365469) +++ stable/12/sys/modules/tcp/Makefile Tue Sep 8 18:58:38 2020 (r365470) @@ -14,7 +14,7 @@ _tcp_rack= rack .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ defined(ALL_MODULES) -.if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MIPSEC} +.if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MTCP_SIGNATURE} _tcpmd5= tcpmd5 .endif .endif From owner-svn-src-stable@freebsd.org Tue Sep 8 18:58:39 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 522313D3DA3; Tue, 8 Sep 2020 18:58:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmDvM1Xc8z4Hl5; Tue, 8 Sep 2020 18:58:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1838914F78; Tue, 8 Sep 2020 18:58:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088IwcLf099087; Tue, 8 Sep 2020 18:58:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088IwcjU099086; Tue, 8 Sep 2020 18:58:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081858.088IwcjU099086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 18:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365470 - in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Commit-Revision: 365470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 18:58:39 -0000 Author: jhb Date: Tue Sep 8 18:58:38 2020 New Revision: 365470 URL: https://svnweb.freebsd.org/changeset/base/365470 Log: MFC 361764: Revise r361712 to disable tcpmd5.ko for 'options TCP_SIGNATURE' Modified: stable/11/sys/modules/tcp/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/modules/tcp/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/modules/tcp/Makefile ============================================================================== --- stable/11/sys/modules/tcp/Makefile Tue Sep 8 18:49:58 2020 (r365469) +++ stable/11/sys/modules/tcp/Makefile Tue Sep 8 18:58:38 2020 (r365470) @@ -14,7 +14,7 @@ _tcp_fastpath= fastpath .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ defined(ALL_MODULES) -.if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MIPSEC} +.if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MTCP_SIGNATURE} _tcpmd5= tcpmd5 .endif .endif From owner-svn-src-stable@freebsd.org Tue Sep 8 20:02:09 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E7143D5D8C; Tue, 8 Sep 2020 20:02:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmGJd1L7sz4Ms3; Tue, 8 Sep 2020 20:02:09 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 112A216175; Tue, 8 Sep 2020 20:02:09 +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 088K28ge040371; Tue, 8 Sep 2020 20:02:08 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088K28kF040369; Tue, 8 Sep 2020 20:02:08 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009082002.088K28kF040369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 8 Sep 2020 20:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365471 - in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Commit-Revision: 365471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 20:02:09 -0000 Author: dim Date: Tue Sep 8 20:02:08 2020 New Revision: 365471 URL: https://svnweb.freebsd.org/changeset/base/365471 Log: MFC r364753: Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. PR: 230888 Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/12/lib/libcompiler_rt/Makefile.inc stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/11/lib/libcompiler_rt/Makefile.inc stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c ============================================================================== --- stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 18:58:38 2020 (r365470) +++ stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 20:02:08 2020 (r365471) @@ -124,8 +124,8 @@ static __inline Lock *lock_for_pointer(void *ptr) { #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) -/// 32 bit PowerPC doesn't support 8-byte lock_free atomics -#if !defined(__powerpc64__) && defined(__powerpc__) +/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics +#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__)) #define IS_LOCK_FREE_8 0 #else #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) Modified: stable/12/lib/libcompiler_rt/Makefile.inc ============================================================================== --- stable/12/lib/libcompiler_rt/Makefile.inc Tue Sep 8 18:58:38 2020 (r365470) +++ stable/12/lib/libcompiler_rt/Makefile.inc Tue Sep 8 20:02:08 2020 (r365471) @@ -18,6 +18,9 @@ SRCF+= ashldi3 SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 +SRCF+= atomic +SRCF+= bswapdi2 +SRCF+= bswapsi2 SRCF+= clear_cache SRCF+= clzdi2 SRCF+= clzsi2 @@ -213,12 +216,6 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS SRCF+= stdatomic .endif -.if "${COMPILER_TYPE}" == "clang" && \ - (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") -SRCS+= atomic.c -CFLAGS.atomic.c+= -Wno-atomic-alignment -.endif - .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) @@ -240,18 +237,9 @@ SRCS+= aeabi_memmove.S SRCS+= aeabi_memset.S SRCS+= aeabi_uidivmod.S SRCS+= aeabi_uldivmod.S -SRCS+= bswapdi2.S -SRCS+= bswapsi2.S SRCS+= switch16.S SRCS+= switch32.S SRCS+= switch8.S SRCS+= switchu8.S SRCS+= sync_synchronize.S -.endif - -# On some archs GCC-6.3 requires bswap32 built-in. -.if ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "riscv" || \ - ${MACHINE_CPUARCH} == "sparc64" -SRCS+= bswapdi2.c -SRCS+= bswapsi2.c .endif Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Tue Sep 8 18:58:38 2020 (r365470) +++ stable/12/sys/sys/param.h Tue Sep 8 20:02:08 2020 (r365471) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1201524 /* Master, propagated to newvers */ +#define __FreeBSD_version 1201525 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@freebsd.org Tue Sep 8 20:02:10 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22ACE3D5945; Tue, 8 Sep 2020 20:02:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmGJd6zDLz4MdS; Tue, 8 Sep 2020 20:02:09 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2AB616176; Tue, 8 Sep 2020 20:02:09 +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 088K29QG040379; Tue, 8 Sep 2020 20:02:09 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088K29sm040376; Tue, 8 Sep 2020 20:02:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009082002.088K29sm040376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 8 Sep 2020 20:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365471 - in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Commit-Revision: 365471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 20:02:10 -0000 Author: dim Date: Tue Sep 8 20:02:08 2020 New Revision: 365471 URL: https://svnweb.freebsd.org/changeset/base/365471 Log: MFC r364753: Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. PR: 230888 Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/11/lib/libcompiler_rt/Makefile.inc stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/12/lib/libcompiler_rt/Makefile.inc stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c ============================================================================== --- stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 18:58:38 2020 (r365470) +++ stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 20:02:08 2020 (r365471) @@ -124,8 +124,8 @@ static __inline Lock *lock_for_pointer(void *ptr) { #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) -/// 32 bit PowerPC doesn't support 8-byte lock_free atomics -#if !defined(__powerpc64__) && defined(__powerpc__) +/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics +#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__)) #define IS_LOCK_FREE_8 0 #else #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) Modified: stable/11/lib/libcompiler_rt/Makefile.inc ============================================================================== --- stable/11/lib/libcompiler_rt/Makefile.inc Tue Sep 8 18:58:38 2020 (r365470) +++ stable/11/lib/libcompiler_rt/Makefile.inc Tue Sep 8 20:02:08 2020 (r365471) @@ -18,6 +18,9 @@ SRCF+= ashldi3 SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 +SRCF+= atomic +SRCF+= bswapdi2 +SRCF+= bswapsi2 SRCF+= clear_cache SRCF+= clzdi2 SRCF+= clzsi2 @@ -215,12 +218,6 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS SRCF+= stdatomic .endif -.if "${COMPILER_TYPE}" == "clang" && \ - (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") -SRCS+= atomic.c -CFLAGS.atomic.c+= -Wno-atomic-alignment -.endif - .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) @@ -242,18 +239,9 @@ SRCS+= aeabi_memmove.S SRCS+= aeabi_memset.S SRCS+= aeabi_uidivmod.S SRCS+= aeabi_uldivmod.S -SRCS+= bswapdi2.S -SRCS+= bswapsi2.S SRCS+= switch16.S SRCS+= switch32.S SRCS+= switch8.S SRCS+= switchu8.S SRCS+= sync_synchronize.S .endif - -# GCC-6.3 on mips32 requires bswap32 built-in. -.if ${MACHINE_CPUARCH} == "mips" -SRCS+= bswapdi2.c -SRCS+= bswapsi2.c -.endif - Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Tue Sep 8 18:58:38 2020 (r365470) +++ stable/11/sys/sys/param.h Tue Sep 8 20:02:08 2020 (r365471) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1104505 /* Master, propagated to newvers */ +#define __FreeBSD_version 1104506 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@freebsd.org Tue Sep 8 20:28:39 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBA2B3D6B8D; Tue, 8 Sep 2020 20:28:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmGvC5XMdz4Q6D; Tue, 8 Sep 2020 20:28:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A15F016261; Tue, 8 Sep 2020 20:28:39 +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 088KSdIS054360; Tue, 8 Sep 2020 20:28:39 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088KSdWY054359; Tue, 8 Sep 2020 20:28:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009082028.088KSdWY054359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 8 Sep 2020 20:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365472 - in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt X-SVN-Commit-Revision: 365472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 20:28:39 -0000 Author: dim Date: Tue Sep 8 20:28:39 2020 New Revision: 365472 URL: https://svnweb.freebsd.org/changeset/base/365472 Log: Revert r365471 as it is breaking with old gcc on various arches: MFC r364753: Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. PR: 230888 Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/12/lib/libcompiler_rt/Makefile.inc Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/11/lib/libcompiler_rt/Makefile.inc Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c ============================================================================== --- stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 20:02:08 2020 (r365471) +++ stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 20:28:39 2020 (r365472) @@ -124,8 +124,8 @@ static __inline Lock *lock_for_pointer(void *ptr) { #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) -/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics -#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__)) +/// 32 bit PowerPC doesn't support 8-byte lock_free atomics +#if !defined(__powerpc64__) && defined(__powerpc__) #define IS_LOCK_FREE_8 0 #else #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) Modified: stable/12/lib/libcompiler_rt/Makefile.inc ============================================================================== --- stable/12/lib/libcompiler_rt/Makefile.inc Tue Sep 8 20:02:08 2020 (r365471) +++ stable/12/lib/libcompiler_rt/Makefile.inc Tue Sep 8 20:28:39 2020 (r365472) @@ -18,9 +18,6 @@ SRCF+= ashldi3 SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 -SRCF+= atomic -SRCF+= bswapdi2 -SRCF+= bswapsi2 SRCF+= clear_cache SRCF+= clzdi2 SRCF+= clzsi2 @@ -216,6 +213,12 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS SRCF+= stdatomic .endif +.if "${COMPILER_TYPE}" == "clang" && \ + (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") +SRCS+= atomic.c +CFLAGS.atomic.c+= -Wno-atomic-alignment +.endif + .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) @@ -237,9 +240,18 @@ SRCS+= aeabi_memmove.S SRCS+= aeabi_memset.S SRCS+= aeabi_uidivmod.S SRCS+= aeabi_uldivmod.S +SRCS+= bswapdi2.S +SRCS+= bswapsi2.S SRCS+= switch16.S SRCS+= switch32.S SRCS+= switch8.S SRCS+= switchu8.S SRCS+= sync_synchronize.S +.endif + +# On some archs GCC-6.3 requires bswap32 built-in. +.if ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "riscv" || \ + ${MACHINE_CPUARCH} == "sparc64" +SRCS+= bswapdi2.c +SRCS+= bswapsi2.c .endif From owner-svn-src-stable@freebsd.org Tue Sep 8 20:28:40 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71D353D6B54; Tue, 8 Sep 2020 20:28:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmGvD2Scnz4Q6F; Tue, 8 Sep 2020 20:28:40 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37B8D16262; Tue, 8 Sep 2020 20:28:40 +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 088KSevp054367; Tue, 8 Sep 2020 20:28:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088KSdHL054366; Tue, 8 Sep 2020 20:28:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009082028.088KSdHL054366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 8 Sep 2020 20:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365472 - in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt X-SVN-Commit-Revision: 365472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 20:28:40 -0000 Author: dim Date: Tue Sep 8 20:28:39 2020 New Revision: 365472 URL: https://svnweb.freebsd.org/changeset/base/365472 Log: Revert r365471 as it is breaking with old gcc on various arches: MFC r364753: Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. PR: 230888 Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/11/lib/libcompiler_rt/Makefile.inc Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/12/lib/libcompiler_rt/Makefile.inc Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c ============================================================================== --- stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 20:02:08 2020 (r365471) +++ stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 20:28:39 2020 (r365472) @@ -124,8 +124,8 @@ static __inline Lock *lock_for_pointer(void *ptr) { #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) -/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics -#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__)) +/// 32 bit PowerPC doesn't support 8-byte lock_free atomics +#if !defined(__powerpc64__) && defined(__powerpc__) #define IS_LOCK_FREE_8 0 #else #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) Modified: stable/11/lib/libcompiler_rt/Makefile.inc ============================================================================== --- stable/11/lib/libcompiler_rt/Makefile.inc Tue Sep 8 20:02:08 2020 (r365471) +++ stable/11/lib/libcompiler_rt/Makefile.inc Tue Sep 8 20:28:39 2020 (r365472) @@ -18,9 +18,6 @@ SRCF+= ashldi3 SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 -SRCF+= atomic -SRCF+= bswapdi2 -SRCF+= bswapsi2 SRCF+= clear_cache SRCF+= clzdi2 SRCF+= clzsi2 @@ -218,6 +215,12 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS SRCF+= stdatomic .endif +.if "${COMPILER_TYPE}" == "clang" && \ + (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") +SRCS+= atomic.c +CFLAGS.atomic.c+= -Wno-atomic-alignment +.endif + .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) @@ -239,9 +242,18 @@ SRCS+= aeabi_memmove.S SRCS+= aeabi_memset.S SRCS+= aeabi_uidivmod.S SRCS+= aeabi_uldivmod.S +SRCS+= bswapdi2.S +SRCS+= bswapsi2.S SRCS+= switch16.S SRCS+= switch32.S SRCS+= switch8.S SRCS+= switchu8.S SRCS+= sync_synchronize.S .endif + +# GCC-6.3 on mips32 requires bswap32 built-in. +.if ${MACHINE_CPUARCH} == "mips" +SRCS+= bswapdi2.c +SRCS+= bswapsi2.c +.endif + From owner-svn-src-stable@freebsd.org Tue Sep 8 20:51:29 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC3253D7890; Tue, 8 Sep 2020 20:51:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmHPY5G4Xz4RQ8; Tue, 8 Sep 2020 20:51: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E5291692E; Tue, 8 Sep 2020 20:51: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 088KpTeo070594; Tue, 8 Sep 2020 20:51:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088KpJjw069873; Tue, 8 Sep 2020 20:51:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082051.088KpJjw069873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 20:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365473 - in stable/12: lib/libc/sys share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/12: lib/libc/sys share/man/man9 X-SVN-Commit-Revision: 365473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 20:51:29 -0000 Author: jhb Date: Tue Sep 8 20:51:19 2020 New Revision: 365473 URL: https://svnweb.freebsd.org/changeset/base/365473 Log: MFC 359465: Document EINTEGRITY errors for many system calls. EINTEGRITY was previously documented as a UFS-specific error for mount(2). This documents EINTEGRITY as a filesystem-independent error that may be reported by the backing store of a filesystem. While here, document EIO as a filesystem-independent error for both mount(2) and posix_fadvise(2). EIO was previously only documented for UFS for mount(2). Modified: stable/12/lib/libc/sys/access.2 stable/12/lib/libc/sys/acct.2 stable/12/lib/libc/sys/bind.2 stable/12/lib/libc/sys/chdir.2 stable/12/lib/libc/sys/chflags.2 stable/12/lib/libc/sys/chmod.2 stable/12/lib/libc/sys/chown.2 stable/12/lib/libc/sys/chroot.2 stable/12/lib/libc/sys/execve.2 stable/12/lib/libc/sys/fhlink.2 stable/12/lib/libc/sys/fhreadlink.2 stable/12/lib/libc/sys/fsync.2 stable/12/lib/libc/sys/getdirentries.2 stable/12/lib/libc/sys/getfh.2 stable/12/lib/libc/sys/getfsstat.2 stable/12/lib/libc/sys/ktrace.2 stable/12/lib/libc/sys/link.2 stable/12/lib/libc/sys/mkdir.2 stable/12/lib/libc/sys/mkfifo.2 stable/12/lib/libc/sys/mknod.2 stable/12/lib/libc/sys/mount.2 stable/12/lib/libc/sys/open.2 stable/12/lib/libc/sys/pathconf.2 stable/12/lib/libc/sys/posix_fadvise.2 stable/12/lib/libc/sys/posix_fallocate.2 stable/12/lib/libc/sys/quotactl.2 stable/12/lib/libc/sys/read.2 stable/12/lib/libc/sys/readlink.2 stable/12/lib/libc/sys/rename.2 stable/12/lib/libc/sys/rmdir.2 stable/12/lib/libc/sys/sendfile.2 stable/12/lib/libc/sys/stat.2 stable/12/lib/libc/sys/statfs.2 stable/12/lib/libc/sys/swapon.2 stable/12/lib/libc/sys/symlink.2 stable/12/lib/libc/sys/truncate.2 stable/12/lib/libc/sys/undelete.2 stable/12/lib/libc/sys/unlink.2 stable/12/lib/libc/sys/utimensat.2 stable/12/lib/libc/sys/utimes.2 stable/12/lib/libc/sys/write.2 stable/12/share/man/man9/VOP_READDIR.9 stable/12/share/man/man9/VOP_READLINK.9 stable/12/share/man/man9/g_data.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/access.2 ============================================================================== --- stable/12/lib/libc/sys/access.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/access.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd September 15, 2014 +.Dd March 30, 2020 .Dt ACCESS 2 .Os .Sh NAME @@ -168,6 +168,8 @@ argument points outside the process's allocated address space. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp Also, the Modified: stable/12/lib/libc/sys/acct.2 ============================================================================== --- stable/12/lib/libc/sys/acct.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/acct.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)acct.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 17, 2004 +.Dd March 30, 2020 .Dt ACCT 2 .Os .Sh NAME @@ -119,6 +119,8 @@ argument points outside the process's allocated address space. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr acct 5 , Modified: stable/12/lib/libc/sys/bind.2 ============================================================================== --- stable/12/lib/libc/sys/bind.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/bind.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)bind.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd August 18, 2016 +.Dd March 30, 2020 .Dt BIND 2 .Os .Sh NAME @@ -122,6 +122,8 @@ A prefix component of the path name does not exist. Too many symbolic links were encountered in translating the pathname. .It Bq Er EIO An I/O error occurred while making the directory entry or allocating the inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EROFS The name would reside on a read-only file system. .It Bq Er EISDIR Modified: stable/12/lib/libc/sys/chdir.2 ============================================================================== --- stable/12/lib/libc/sys/chdir.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/chdir.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)chdir.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt CHDIR 2 .Os .Sh NAME @@ -96,6 +96,8 @@ argument points outside the process's allocated address space. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp The Modified: stable/12/lib/libc/sys/chflags.2 ============================================================================== --- stable/12/lib/libc/sys/chflags.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/chflags.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)chflags.2 8.3 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd March 22, 2013 +.Dd March 30, 2020 .Dt CHFLAGS 2 .Os .Sh NAME @@ -256,6 +256,8 @@ points outside the process's allocated address space. An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EOPNOTSUPP The underlying file system does not support file flags, or does not support all of the flags set in @@ -298,6 +300,8 @@ The file resides on a read-only file system. An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EOPNOTSUPP The underlying file system does not support file flags, or does not support all of the flags set in Modified: stable/12/lib/libc/sys/chmod.2 ============================================================================== --- stable/12/lib/libc/sys/chmod.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/chmod.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)chmod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt CHMOD 2 .Os .Sh NAME @@ -236,6 +236,8 @@ argument points outside the process's allocated address space. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFTYPE The effective user ID is not the super-user, the mode includes the sticky bit .Dv ( S_ISVTX ) , @@ -257,6 +259,8 @@ refers to a socket, not to a file. The file resides on a read-only file system. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp In addition to the Modified: stable/12/lib/libc/sys/chown.2 ============================================================================== --- stable/12/lib/libc/sys/chown.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/chown.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)chown.2 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt CHOWN 2 .Os .Sh NAME @@ -175,6 +175,8 @@ argument points outside the process's allocated address space. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp The @@ -197,6 +199,8 @@ The effective user ID is not the super-user. The named file resides on a read-only file system. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp In addition to the errors specified for Modified: stable/12/lib/libc/sys/chroot.2 ============================================================================== --- stable/12/lib/libc/sys/chroot.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/chroot.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)chroot.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 3, 2012 +.Dd March 30, 2020 .Dt CHROOT 2 .Os .Sh NAME @@ -121,6 +121,8 @@ argument points outside the process's allocated address space. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr chdir 2 , Modified: stable/12/lib/libc/sys/execve.2 ============================================================================== --- stable/12/lib/libc/sys/execve.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/execve.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)execve.2 8.5 (Berkeley) 6/1/94 .\" $FreeBSD$ .\" -.Dd September 21, 2010 +.Dd March 30, 2020 .Dt EXECVE 2 .Os .Sh NAME @@ -304,6 +304,8 @@ point to an illegal address. .It Bq Er EIO An I/O error occurred while reading from the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp In addition, the Modified: stable/12/lib/libc/sys/fhlink.2 ============================================================================== --- stable/12/lib/libc/sys/fhlink.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/fhlink.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2018 +.Dd March 30, 2020 .Dt FHLINK 2 .Os .Sh NAME @@ -219,6 +219,8 @@ containing the directory has been exhausted. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system to make the directory entry. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EROFS The requested link requires writing in a directory on a read-only file system. Modified: stable/12/lib/libc/sys/fhreadlink.2 ============================================================================== --- stable/12/lib/libc/sys/fhreadlink.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/fhreadlink.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2018 +.Dd March 30, 2020 .Dt FHREADLINK 2 .Os .Sh NAME @@ -76,6 +76,8 @@ Too many symbolic links were encountered in translatin The named file is not a symbolic link. .It Bq Er EIO An I/O error occurred while reading from the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFAULT The .Fa buf Modified: stable/12/lib/libc/sys/fsync.2 ============================================================================== --- stable/12/lib/libc/sys/fsync.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/fsync.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -34,7 +34,7 @@ .\" @(#)fsync.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 6, 2018 +.Dd March 30, 2020 .Dt FSYNC 2 .Os .Sh NAME @@ -107,6 +107,8 @@ argument refers to a socket, not to a file. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr fsync 1 , Modified: stable/12/lib/libc/sys/getdirentries.2 ============================================================================== --- stable/12/lib/libc/sys/getdirentries.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/getdirentries.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)getdirentries.2 8.2 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd Nov 14, 2018 +.Dd March 30, 2020 .Dt GETDIRENTRIES 2 .Os .Sh NAME @@ -189,6 +189,8 @@ or the current position pointer is invalid. An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr lseek 2 , Modified: stable/12/lib/libc/sys/getfh.2 ============================================================================== --- stable/12/lib/libc/sys/getfh.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/getfh.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -29,7 +29,7 @@ .\" @(#)getfh.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd December 11, 2018 +.Dd March 30, 2020 .Dt GETFH 2 .Os .Sh NAME @@ -192,6 +192,8 @@ points to an invalid address. An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er ESTALE The file handle .Fa fhp Modified: stable/12/lib/libc/sys/getfsstat.2 ============================================================================== --- stable/12/lib/libc/sys/getfsstat.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/getfsstat.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)getfsstat.2 8.3 (Berkeley) 5/25/95 .\" $FreeBSD$ .\" -.Dd December 27, 2016 +.Dd March 30, 2020 .Dt GETFSSTAT 2 .Os .Sh NAME @@ -118,6 +118,8 @@ or An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr statfs 2 , Modified: stable/12/lib/libc/sys/ktrace.2 ============================================================================== --- stable/12/lib/libc/sys/ktrace.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/ktrace.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)ktrace.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 31, 2016 +.Dd March 30, 2020 .Dt KTRACE 2 .Os .Sh NAME @@ -177,6 +177,8 @@ Search permission is denied for a component of the pat Too many symbolic links were encountered in translating the pathname. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er ENOSYS The kernel was not compiled with .Nm Modified: stable/12/lib/libc/sys/link.2 ============================================================================== --- stable/12/lib/libc/sys/link.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/link.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)link.2 8.3 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt LINK 2 .Os .Sh NAME @@ -215,6 +215,8 @@ containing the directory has been exhausted. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system to make the directory entry. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EROFS The requested link requires writing in a directory on a read-only file system. Modified: stable/12/lib/libc/sys/mkdir.2 ============================================================================== --- stable/12/lib/libc/sys/mkdir.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/mkdir.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)mkdir.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd June 26, 2008 +.Dd March 30, 2020 .Dt MKDIR 2 .Os .Sh NAME @@ -126,6 +126,8 @@ which the directory is being created has been exhauste An I/O error occurred while making the directory entry or allocating the inode. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFAULT The .Fa path Modified: stable/12/lib/libc/sys/mkfifo.2 ============================================================================== --- stable/12/lib/libc/sys/mkfifo.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/mkfifo.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)mkfifo.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd March 30, 2020 .Dt MKFIFO 2 .Os .Sh NAME @@ -134,6 +134,8 @@ error occurred while making the directory entry or all An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFAULT The .Fa path Modified: stable/12/lib/libc/sys/mknod.2 ============================================================================== --- stable/12/lib/libc/sys/mknod.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/mknod.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)mknod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt MKNOD 2 .Os .Sh NAME @@ -108,6 +108,8 @@ Too many symbolic links were encountered in translatin The process's effective user ID is not super-user. .It Bq Er EIO An I/O error occurred while making the directory entry or allocating the inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er ENOSPC The directory in which the entry for the new node is being placed cannot be extended because there is no space left on the file Modified: stable/12/lib/libc/sys/mount.2 ============================================================================== --- stable/12/lib/libc/sys/mount.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/mount.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)mount.2 8.3 (Berkeley) 5/24/95 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt MOUNT 2 .Os .Sh NAME @@ -265,6 +265,13 @@ The .Fa dir argument points outside the process's allocated address space. +.It Bq Er EIO +An I/O error occurred while reading data from +.Fa special . +.It Bq Er EINTEGRITY +The backing store for +.Fa special +detected corrupted data while reading. .El .Pp The following errors can occur for a Modified: stable/12/lib/libc/sys/open.2 ============================================================================== --- stable/12/lib/libc/sys/open.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/open.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd February 9, 2020 +.Dd March 30, 2020 .Dt OPEN 2 .Os .Sh NAME @@ -450,6 +450,8 @@ which the file is being created has been exhausted. An I/O error occurred while making the directory entry or allocating the inode for .Dv O_CREAT . +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er ETXTBSY The file is a pure procedure (shared text) file that is being executed and the Modified: stable/12/lib/libc/sys/pathconf.2 ============================================================================== --- stable/12/lib/libc/sys/pathconf.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/pathconf.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)pathconf.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 7, 2009 +.Dd March 30, 2020 .Dt PATHCONF 2 .Os .Sh NAME @@ -230,6 +230,8 @@ Search permission is denied for a component of the pat Too many symbolic links were encountered in translating the pathname. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp The @@ -244,6 +246,8 @@ argument is not a valid open file descriptor. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr lseek 2 , Modified: stable/12/lib/libc/sys/posix_fadvise.2 ============================================================================== --- stable/12/lib/libc/sys/posix_fadvise.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/posix_fadvise.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)madvise.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd October 3, 2015 +.Dd March 30, 2020 .Dt POSIX_FADVISE 2 .Os .Sh NAME @@ -124,6 +124,10 @@ argument does not refer to a regular file. The .Fa fd argument is associated with a pipe or FIFO. +.It Bq Er EIO +An I/O error occurred while reading from or writing to a file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr madvise 2 Modified: stable/12/lib/libc/sys/posix_fallocate.2 ============================================================================== --- stable/12/lib/libc/sys/posix_fallocate.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/posix_fallocate.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd November 4, 2017 +.Dd March 30, 2020 .Dt POSIX_FALLOCATE 2 .Os .Sh NAME @@ -112,6 +112,8 @@ argument was less than zero, or the operation is not supported by the file system. .It Bq Er EIO An I/O error occurred while reading from or writing to a file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er ENODEV The .Fa fd Modified: stable/12/lib/libc/sys/quotactl.2 ============================================================================== --- stable/12/lib/libc/sys/quotactl.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/quotactl.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -31,7 +31,7 @@ .\" @(#)quotactl.2 8.2 (Berkeley) 3/10/95 .\" $FreeBSD$ .\" -.Dd March 5, 1999 +.Dd March 30, 2020 .Dt QUOTACTL 2 .Os .Sh NAME @@ -228,6 +228,8 @@ An .Tn I/O error occurred while reading from or writing to a file containing quotas. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFAULT An invalid .Fa addr Modified: stable/12/lib/libc/sys/read.2 ============================================================================== --- stable/12/lib/libc/sys/read.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/read.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)read.2 8.4 (Berkeley) 2/26/94 .\" $FreeBSD$ .\" -.Dd July 8, 2020 +.Dd March 30, 2020 .Dt READ 2 .Os .Sh NAME @@ -182,6 +182,8 @@ argument points outside the allocated address space. .It Bq Er EIO An I/O error occurred while reading from the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EBUSY Failed to read from a file, e.g. /proc//regs while is not stopped .It Bq Er EINTR Modified: stable/12/lib/libc/sys/readlink.2 ============================================================================== --- stable/12/lib/libc/sys/readlink.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/readlink.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)readlink.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd March 30, 2020 .Dt READLINK 2 .Os .Sh NAME @@ -108,6 +108,8 @@ Too many symbolic links were encountered in translatin The named file is not a symbolic link. .It Bq Er EIO An I/O error occurred while reading from the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFAULT The .Fa buf Modified: stable/12/lib/libc/sys/rename.2 ============================================================================== --- stable/12/lib/libc/sys/rename.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/rename.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)rename.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 21, 2018 +.Dd March 30, 2020 .Dt RENAME 2 .Os .Sh NAME @@ -240,6 +240,8 @@ user's quota of disk blocks on the file system containing the directory has been exhausted. .It Bq Er EIO An I/O error occurred while making or updating a directory entry. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EROFS The requested link requires writing in a directory on a read-only file system. Modified: stable/12/lib/libc/sys/rmdir.2 ============================================================================== --- stable/12/lib/libc/sys/rmdir.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/rmdir.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)rmdir.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 9, 2006 +.Dd March 30, 2020 .Dt RMDIR 2 .Os .Sh NAME @@ -100,6 +100,8 @@ for a mounted file system. .It Bq Er EIO An I/O error occurred while deleting the directory entry or deallocating the inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EROFS The directory entry to be removed resides on a read-only file system. .It Bq Er EFAULT Modified: stable/12/lib/libc/sys/sendfile.2 ============================================================================== --- stable/12/lib/libc/sys/sendfile.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/sendfile.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2019 +.Dd March 30, 2020 .Dt SENDFILE 2 .Os .Sh NAME @@ -335,6 +335,9 @@ argument is negative. .It Bq Er EIO An error occurred while reading from +.Fa fd . +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from .Fa fd . .It Bq Er ENOTCAPABLE The Modified: stable/12/lib/libc/sys/stat.2 ============================================================================== --- stable/12/lib/libc/sys/stat.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/stat.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)stat.2 8.4 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd December 5, 2018 +.Dd March 30, 2020 .Dt STAT 2 .Os .Sh NAME @@ -342,6 +342,8 @@ argument points to an invalid address. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er ELOOP Too many symbolic links were encountered in translating the pathname. .It Bq Er ENAMETOOLONG @@ -373,6 +375,8 @@ argument points to an invalid address. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EOVERFLOW The file size in bytes cannot be represented correctly in the structure pointed to by Modified: stable/12/lib/libc/sys/statfs.2 ============================================================================== --- stable/12/lib/libc/sys/statfs.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/statfs.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)statfs.2 8.5 (Berkeley) 5/24/95 .\" $FreeBSD$ .\" -.Dd February 13, 2017 +.Dd March 30, 2020 .Dt STATFS 2 .Os .Sh NAME @@ -204,6 +204,8 @@ points to an invalid address. An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp The @@ -225,6 +227,8 @@ points to an invalid address. An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr fhstatfs 2 , Modified: stable/12/lib/libc/sys/swapon.2 ============================================================================== --- stable/12/lib/libc/sys/swapon.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/swapon.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)swapon.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd October 4, 2013 +.Dd March 30, 2020 .Dt SWAPON 2 .Os .Sh NAME @@ -115,6 +115,9 @@ is out of range (this indicates no device driver exist for the associated hardware). .It Bq Er EIO An I/O error occurred while opening the swap device. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system to open the +swap device. .El .Pp Lastly, Modified: stable/12/lib/libc/sys/symlink.2 ============================================================================== --- stable/12/lib/libc/sys/symlink.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/symlink.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)symlink.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd March 30, 2020 .Dt SYMLINK 2 .Os .Sh NAME @@ -151,6 +151,8 @@ The user's quota of inodes on the file system on which the symbolic link is being created has been exhausted. .It Bq Er EIO An I/O error occurred while making the directory entry or allocating the inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFAULT The .Fa name1 Modified: stable/12/lib/libc/sys/truncate.2 ============================================================================== --- stable/12/lib/libc/sys/truncate.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/truncate.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)truncate.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 4, 2015 +.Dd March 30, 2020 .Dt TRUNCATE 2 .Os .Sh NAME @@ -117,6 +117,8 @@ The argument was less than 0. .It Bq Er EIO An I/O error occurred updating the inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFAULT The .Fa path Modified: stable/12/lib/libc/sys/undelete.2 ============================================================================== --- stable/12/lib/libc/sys/undelete.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/undelete.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -29,7 +29,7 @@ .\" @(#)undelete.2 8.4 (Berkeley) 10/18/94 .\" $FreeBSD$ .\" -.Dd January 22, 2006 +.Dd March 30, 2020 .Dt UNDELETE 2 .Os .Sh NAME @@ -87,6 +87,8 @@ The last component of the path is .Ql .. . .It Bq Er EIO An I/O error occurred while updating the directory entry. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EROFS The name resides on a read-only file system. .It Bq Er EFAULT Modified: stable/12/lib/libc/sys/unlink.2 ============================================================================== --- stable/12/lib/libc/sys/unlink.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/unlink.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)unlink.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt UNLINK 2 .Os .Sh NAME @@ -144,6 +144,8 @@ are owned by the effective user ID. .It Bq Er EIO An I/O error occurred while deleting the directory entry or deallocating the inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EROFS The named file resides on a read-only file system. .It Bq Er EFAULT Modified: stable/12/lib/libc/sys/utimensat.2 ============================================================================== --- stable/12/lib/libc/sys/utimensat.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/utimensat.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -31,7 +31,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 7, 2017 +.Dd March 30, 2020 .Dt UTIMENSAT 2 .Os .Sh NAME @@ -192,6 +192,8 @@ or .Dv UTIME_OMIT . .It Bq Er EIO An I/O error occurred while reading or writing the affected inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EPERM The .Fa times Modified: stable/12/lib/libc/sys/utimes.2 ============================================================================== --- stable/12/lib/libc/sys/utimes.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/utimes.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -30,7 +30,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 9, 2016 +.Dd March 30, 2020 .Dt UTIMES 2 .Os .Sh NAME @@ -165,6 +165,8 @@ component of at least one of the values specified by t argument has a value less than 0 or greater than 999999. .It Bq Er EIO An I/O error occurred while reading or writing the affected inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er ELOOP Too many symbolic links were encountered in translating the pathname. .It Bq Er ENAMETOOLONG Modified: stable/12/lib/libc/sys/write.2 ============================================================================== --- stable/12/lib/libc/sys/write.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/write.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)write.2 8.5 (Berkeley) 4/2/94 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt WRITE 2 .Os .Sh NAME @@ -205,6 +205,12 @@ is greater than if the sysctl .Va debug.iosize_max_clamp is non-zero). +.It Bq Er EINTEGRITY +The backing store for +.Fa fd +detected corrupted data while reading. +(For example, writing a partial filesystem block may require first reading +the existing block which may trigger this error.) .El .Pp In addition, Modified: stable/12/share/man/man9/VOP_READDIR.9 ============================================================================== --- stable/12/share/man/man9/VOP_READDIR.9 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/share/man/man9/VOP_READDIR.9 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 1996 +.Dd March 30, 2020 .Dt VOP_READDIR 9 .Os .Sh NAME @@ -100,6 +100,8 @@ Memory for the cookies should be allocated using: An attempt was made to read from an illegal offset in the directory. .It Bq Er EIO A read error occurred while reading the directory. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading the directory. .El .Sh SEE ALSO .Xr vnode 9 Modified: stable/12/share/man/man9/VOP_READLINK.9 ============================================================================== --- stable/12/share/man/man9/VOP_READLINK.9 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/share/man/man9/VOP_READLINK.9 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 1996 +.Dd March 30, 2020 .Dt VOP_READLINK 9 .Os .Sh NAME @@ -58,6 +58,8 @@ Zero is returned on success, otherwise an error code i .Bl -tag -width Er .It Bq Er EIO A read error occurred while reading the contents of the symlink. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading the contents of the symlink. .El .Sh SEE ALSO .Xr uiomove 9 , Modified: stable/12/share/man/man9/g_data.9 ============================================================================== --- stable/12/share/man/man9/g_data.9 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/share/man/man9/g_data.9 Tue Sep 8 20:51:19 2020 (r365473) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2004 +.Dd March 30, 2020 .Dt G_DATA 9 .Os .Sh NAME @@ -103,6 +103,8 @@ Possible errors: .Bl -tag -width Er .It Bq Er EIO An I/O error occurred while reading from or writing to the consumer. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the consumer. .El .Sh SEE ALSO .Xr geom 4 , From owner-svn-src-stable@freebsd.org Tue Sep 8 20:53:45 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 843803D7832; Tue, 8 Sep 2020 20:53:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmHS930MDz4S0H; Tue, 8 Sep 2020 20:53:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A03B168C6; Tue, 8 Sep 2020 20:53:45 +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 088Krjjp072453; Tue, 8 Sep 2020 20:53:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088Krivl072451; Tue, 8 Sep 2020 20:53:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082053.088Krivl072451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 20:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365474 - in stable: 11/lib/libc/sys 12/lib/libc/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/lib/libc/sys 12/lib/libc/sys X-SVN-Commit-Revision: 365474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 20:53:45 -0000 Author: jhb Date: Tue Sep 8 20:53:44 2020 New Revision: 365474 URL: https://svnweb.freebsd.org/changeset/base/365474 Log: MFC 359467: Trim some duplicate EIO descriptions. While here, drop an extra conjunction from the list of error conditions for the remaining EIO description in symlink(2). Modified: stable/12/lib/libc/sys/mkfifo.2 stable/12/lib/libc/sys/symlink.2 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libc/sys/mkfifo.2 stable/11/lib/libc/sys/symlink.2 Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libc/sys/mkfifo.2 ============================================================================== --- stable/12/lib/libc/sys/mkfifo.2 Tue Sep 8 20:51:19 2020 (r365473) +++ stable/12/lib/libc/sys/mkfifo.2 Tue Sep 8 20:53:44 2020 (r365474) @@ -130,10 +130,6 @@ which the fifo is being created has been exhausted. An .Tn I/O error occurred while making the directory entry or allocating the inode. -.It Bq Er EIO -An -.Tn I/O -error occurred while reading from or writing to the file system. .It Bq Er EINTEGRITY Corrupted data was detected while reading from the file system. .It Bq Er EFAULT Modified: stable/12/lib/libc/sys/symlink.2 ============================================================================== --- stable/12/lib/libc/sys/symlink.2 Tue Sep 8 20:51:19 2020 (r365473) +++ stable/12/lib/libc/sys/symlink.2 Tue Sep 8 20:53:44 2020 (r365474) @@ -118,7 +118,7 @@ manual page for more information. .It Bq Er EIO An I/O error occurred while making the directory entry for .Fa name2 , -or allocating the inode for +allocating the inode for .Fa name2 , or writing out the link contents of .Fa name2 . @@ -149,8 +149,6 @@ contain the symbolic link has been exhausted. .It Bq Er EDQUOT The user's quota of inodes on the file system on which the symbolic link is being created has been exhausted. -.It Bq Er EIO -An I/O error occurred while making the directory entry or allocating the inode. .It Bq Er EINTEGRITY Corrupted data was detected while reading from the file system. .It Bq Er EFAULT From owner-svn-src-stable@freebsd.org Tue Sep 8 20:53:46 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10FB63D7A08; Tue, 8 Sep 2020 20:53:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmHS96m4Rz4S2c; Tue, 8 Sep 2020 20:53:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB1E616C38; Tue, 8 Sep 2020 20:53:45 +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 088Krj3G072461; Tue, 8 Sep 2020 20:53:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088Krjn4072459; Tue, 8 Sep 2020 20:53:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082053.088Krjn4072459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 20:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365474 - in stable: 11/lib/libc/sys 12/lib/libc/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/lib/libc/sys 12/lib/libc/sys X-SVN-Commit-Revision: 365474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 20:53:46 -0000 Author: jhb Date: Tue Sep 8 20:53:44 2020 New Revision: 365474 URL: https://svnweb.freebsd.org/changeset/base/365474 Log: MFC 359467: Trim some duplicate EIO descriptions. While here, drop an extra conjunction from the list of error conditions for the remaining EIO description in symlink(2). Modified: stable/11/lib/libc/sys/mkfifo.2 stable/11/lib/libc/sys/symlink.2 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libc/sys/mkfifo.2 stable/12/lib/libc/sys/symlink.2 Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libc/sys/mkfifo.2 ============================================================================== --- stable/11/lib/libc/sys/mkfifo.2 Tue Sep 8 20:51:19 2020 (r365473) +++ stable/11/lib/libc/sys/mkfifo.2 Tue Sep 8 20:53:44 2020 (r365474) @@ -130,10 +130,6 @@ which the fifo is being created has been exhausted. An .Tn I/O error occurred while making the directory entry or allocating the inode. -.It Bq Er EIO -An -.Tn I/O -error occurred while reading from or writing to the file system. .It Bq Er EFAULT The .Fa path Modified: stable/11/lib/libc/sys/symlink.2 ============================================================================== --- stable/11/lib/libc/sys/symlink.2 Tue Sep 8 20:51:19 2020 (r365473) +++ stable/11/lib/libc/sys/symlink.2 Tue Sep 8 20:53:44 2020 (r365474) @@ -118,7 +118,7 @@ manual page for more information. .It Bq Er EIO An I/O error occurred while making the directory entry for .Fa name2 , -or allocating the inode for +allocating the inode for .Fa name2 , or writing out the link contents of .Fa name2 . @@ -149,8 +149,6 @@ contain the symbolic link has been exhausted. .It Bq Er EDQUOT The user's quota of inodes on the file system on which the symbolic link is being created has been exhausted. -.It Bq Er EIO -An I/O error occurred while making the directory entry or allocating the inode. .It Bq Er EFAULT The .Fa name1 From owner-svn-src-stable@freebsd.org Tue Sep 8 22:19:07 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3E993D9A73; Tue, 8 Sep 2020 22:19:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmKLg5nTGz4Xd4; Tue, 8 Sep 2020 22:19:07 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9DC017756; Tue, 8 Sep 2020 22:19:07 +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 088MJ7O0021934; Tue, 8 Sep 2020 22:19:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088MJ7C6021933; Tue, 8 Sep 2020 22:19:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082219.088MJ7C6021933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 22:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365476 - in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Commit-Revision: 365476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 22:19:08 -0000 Author: jhb Date: Tue Sep 8 22:19:06 2020 New Revision: 365476 URL: https://svnweb.freebsd.org/changeset/base/365476 Log: MFC 359899: Correct baud rate error calculation. Shifting right by 1 is not the same as dividing by 2 for signed values. In particular, dividing a signed value by 2 gives the integer ceiling of the (e.g. -5 / 2 == -2) whereas shifting right by 1 always gives the floor (-5 >> 1 == -3). An embedded board with a 25 Mhz base clock results in an error of -30.5% when used with a baud rate of 115200. Using division, this truncates to -30% and is permitted. Using the shift, this fails and is rejected causing TIOCSETA requests to fail with EINVAL and breaking getty(8). Using division gives the same error range for both over and under baud rates and also makes the code match the behavior documented in the existing comment about supporting boards with 25 Mhz clocks. Modified: stable/11/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- stable/11/sys/dev/uart/uart_dev_ns8250.c Tue Sep 8 21:39:34 2020 (r365475) +++ stable/11/sys/dev/uart/uart_dev_ns8250.c Tue Sep 8 22:19:06 2020 (r365476) @@ -136,7 +136,7 @@ ns8250_divisor(int rclk, int baudrate) actual_baud = rclk / (divisor << 4); /* 10 times error in percent: */ - error = ((actual_baud - baudrate) * 2000 / baudrate + 1) >> 1; + error = ((actual_baud - baudrate) * 2000 / baudrate + 1) / 2; /* enforce maximum error tolerance: */ if (error < -UART_DEV_TOLERANCE_PCT || error > UART_DEV_TOLERANCE_PCT) From owner-svn-src-stable@freebsd.org Tue Sep 8 22:19:07 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93D563D9AD4; Tue, 8 Sep 2020 22:19:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmKLg3Mmrz4Xd3; Tue, 8 Sep 2020 22:19:07 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56DB817755; Tue, 8 Sep 2020 22:19:07 +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 088MJ7BM021928; Tue, 8 Sep 2020 22:19:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088MJ7Cg021927; Tue, 8 Sep 2020 22:19:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082219.088MJ7Cg021927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 22:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365476 - in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Commit-Revision: 365476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 22:19:07 -0000 Author: jhb Date: Tue Sep 8 22:19:06 2020 New Revision: 365476 URL: https://svnweb.freebsd.org/changeset/base/365476 Log: MFC 359899: Correct baud rate error calculation. Shifting right by 1 is not the same as dividing by 2 for signed values. In particular, dividing a signed value by 2 gives the integer ceiling of the (e.g. -5 / 2 == -2) whereas shifting right by 1 always gives the floor (-5 >> 1 == -3). An embedded board with a 25 Mhz base clock results in an error of -30.5% when used with a baud rate of 115200. Using division, this truncates to -30% and is permitted. Using the shift, this fails and is rejected causing TIOCSETA requests to fail with EINVAL and breaking getty(8). Using division gives the same error range for both over and under baud rates and also makes the code match the behavior documented in the existing comment about supporting boards with 25 Mhz clocks. Modified: stable/12/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- stable/12/sys/dev/uart/uart_dev_ns8250.c Tue Sep 8 21:39:34 2020 (r365475) +++ stable/12/sys/dev/uart/uart_dev_ns8250.c Tue Sep 8 22:19:06 2020 (r365476) @@ -139,7 +139,7 @@ ns8250_divisor(int rclk, int baudrate) actual_baud = rclk / (divisor << 4); /* 10 times error in percent: */ - error = ((actual_baud - baudrate) * 2000 / baudrate + 1) >> 1; + error = ((actual_baud - baudrate) * 2000 / baudrate + 1) / 2; /* enforce maximum error tolerance: */ if (error < -UART_DEV_TOLERANCE_PCT || error > UART_DEV_TOLERANCE_PCT) From owner-svn-src-stable@freebsd.org Tue Sep 8 22:50:25 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 864623DAC66; Tue, 8 Sep 2020 22:50:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmL2n2zrGz4ZsQ; Tue, 8 Sep 2020 22:50:25 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AD7B17F11; Tue, 8 Sep 2020 22:50:25 +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 088MoP9x040308; Tue, 8 Sep 2020 22:50:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088MoOll040306; Tue, 8 Sep 2020 22:50:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082250.088MoOll040306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 22:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365480 - in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Commit-Revision: 365480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 22:50:25 -0000 Author: jhb Date: Tue Sep 8 22:50:24 2020 New Revision: 365480 URL: https://svnweb.freebsd.org/changeset/base/365480 Log: MFC 359900: Export a sysctl count of RX FIFO overrun events. uart(4) backends currently detect RX FIFO overrun errors and report them to the uart(4) core layer. They are then reported to the generic TTY layer which promptly ignores them. As a result, there is currently no good way to determine if a uart is experiencing RX FIFO overruns. One could add a generic per-tty counter, but there did not appear to be a good way to export those. Instead, add a sysctl under the uart(4) sysctl tree to export the count of overruns. Modified: stable/12/sys/dev/uart/uart_bus.h stable/12/sys/dev/uart/uart_core.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/uart/uart_bus.h stable/11/sys/dev/uart/uart_core.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/uart/uart_bus.h ============================================================================== --- stable/12/sys/dev/uart/uart_bus.h Tue Sep 8 22:42:41 2020 (r365479) +++ stable/12/sys/dev/uart/uart_bus.h Tue Sep 8 22:50:24 2020 (r365480) @@ -111,6 +111,7 @@ struct uart_softc { int sc_rxput; int sc_rxget; int sc_rxfifosz; /* Size of RX FIFO. */ + int sc_rxoverruns; /* Transmitter data. */ uint8_t *sc_txbuf; Modified: stable/12/sys/dev/uart/uart_core.c ============================================================================== --- stable/12/sys/dev/uart/uart_core.c Tue Sep 8 22:42:41 2020 (r365479) +++ stable/12/sys/dev/uart/uart_core.c Tue Sep 8 22:50:24 2020 (r365480) @@ -333,6 +333,7 @@ uart_intr_overrun(void *arg) sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; uart_sched_softih(sc, SER_INT_RXREADY); } + sc->sc_rxoverruns++; UART_FLUSH(sc, UART_FLUSH_RECEIVER); return (0); } @@ -740,6 +741,12 @@ uart_bus_attach(device_t dev) if (sc->sc_sysdev != NULL) sc->sc_sysdev->hwmtx = sc->sc_hwmtx; + + if (sc->sc_rxfifosz > 1) + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "rx_overruns", CTLFLAG_RD, &sc->sc_rxoverruns, 0, + "Receive overruns"); return (0); From owner-svn-src-stable@freebsd.org Tue Sep 8 22:50:25 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5C383DADDC; Tue, 8 Sep 2020 22:50:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmL2n5rPlz4Zkc; Tue, 8 Sep 2020 22:50:25 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABF8D18104; Tue, 8 Sep 2020 22:50:25 +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 088MoP4e040315; Tue, 8 Sep 2020 22:50:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088MoP6T040314; Tue, 8 Sep 2020 22:50:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082250.088MoP6T040314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 22:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365480 - in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Commit-Revision: 365480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 22:50:26 -0000 Author: jhb Date: Tue Sep 8 22:50:24 2020 New Revision: 365480 URL: https://svnweb.freebsd.org/changeset/base/365480 Log: MFC 359900: Export a sysctl count of RX FIFO overrun events. uart(4) backends currently detect RX FIFO overrun errors and report them to the uart(4) core layer. They are then reported to the generic TTY layer which promptly ignores them. As a result, there is currently no good way to determine if a uart is experiencing RX FIFO overruns. One could add a generic per-tty counter, but there did not appear to be a good way to export those. Instead, add a sysctl under the uart(4) sysctl tree to export the count of overruns. Modified: stable/11/sys/dev/uart/uart_bus.h stable/11/sys/dev/uart/uart_core.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/uart/uart_bus.h stable/12/sys/dev/uart/uart_core.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/uart/uart_bus.h ============================================================================== --- stable/11/sys/dev/uart/uart_bus.h Tue Sep 8 22:42:41 2020 (r365479) +++ stable/11/sys/dev/uart/uart_bus.h Tue Sep 8 22:50:24 2020 (r365480) @@ -108,6 +108,7 @@ struct uart_softc { int sc_rxput; int sc_rxget; int sc_rxfifosz; /* Size of RX FIFO. */ + int sc_rxoverruns; /* Transmitter data. */ uint8_t *sc_txbuf; Modified: stable/11/sys/dev/uart/uart_core.c ============================================================================== --- stable/11/sys/dev/uart/uart_core.c Tue Sep 8 22:42:41 2020 (r365479) +++ stable/11/sys/dev/uart/uart_core.c Tue Sep 8 22:50:24 2020 (r365480) @@ -327,6 +327,7 @@ uart_intr_overrun(void *arg) sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; uart_sched_softih(sc, SER_INT_RXREADY); } + sc->sc_rxoverruns++; UART_FLUSH(sc, UART_FLUSH_RECEIVER); return (0); } @@ -735,6 +736,12 @@ uart_bus_attach(device_t dev) if (sc->sc_sysdev != NULL) sc->sc_sysdev->hwmtx = sc->sc_hwmtx; + + if (sc->sc_rxfifosz > 1) + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "rx_overruns", CTLFLAG_RD, &sc->sc_rxoverruns, 0, + "Receive overruns"); return (0); From owner-svn-src-stable@freebsd.org Tue Sep 8 23:20:00 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1D143DB97E; Tue, 8 Sep 2020 23:20:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmLhw3rSnz4cvK; Tue, 8 Sep 2020 23:20:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68759185DA; Tue, 8 Sep 2020 23:20:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088NK0lW058848; Tue, 8 Sep 2020 23:20:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088NK0e6058847; Tue, 8 Sep 2020 23:20:00 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082320.088NK0e6058847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 23:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365482 - stable/12/sys/crypto/aesni X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/crypto/aesni X-SVN-Commit-Revision: 365482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 23:20:00 -0000 Author: jhb Date: Tue Sep 8 23:19:59 2020 New Revision: 365482 URL: https://svnweb.freebsd.org/changeset/base/365482 Log: MFC 362123: Fix AES-CCM requests with an AAD size smaller than a single block. The amount to copy for the first block is the minimum of the size of the AAD region or the remaining space in the first block. Modified: stable/12/sys/crypto/aesni/aesni_ccm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/crypto/aesni/aesni_ccm.c ============================================================================== --- stable/12/sys/crypto/aesni/aesni_ccm.c Tue Sep 8 22:59:43 2020 (r365481) +++ stable/12/sys/crypto/aesni/aesni_ccm.c Tue Sep 8 23:19:59 2020 (r365482) @@ -155,7 +155,7 @@ cbc_mac_start(const unsigned char *auth_data, size_t a * already partially filled, by auth_amt, so we need * to handle that. The last block needs to be zero padded. */ - copy_amt = MIN(auth_len - auth_amt, + copy_amt = MIN(auth_len, sizeof(staging_block) - auth_amt); byte_ptr = (uint8_t*)&staging_block; bcopy(auth_ptr, &byte_ptr[auth_amt], copy_amt); From owner-svn-src-stable@freebsd.org Wed Sep 9 13:16:20 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5D5F3D0D15; Wed, 9 Sep 2020 13:16:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmjFw4s93z4G0t; Wed, 9 Sep 2020 13:16:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B1012238B; Wed, 9 Sep 2020 13:16:20 +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 089DGKZm075369; Wed, 9 Sep 2020 13:16:20 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089DGKGZ075368; Wed, 9 Sep 2020 13:16:20 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202009091316.089DGKGZ075368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 9 Sep 2020 13:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365503 - stable/12/usr.bin/nfsstat X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/usr.bin/nfsstat X-SVN-Commit-Revision: 365503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 13:16:20 -0000 Author: asomers Date: Wed Sep 9 13:16:20 2020 New Revision: 365503 URL: https://svnweb.freebsd.org/changeset/base/365503 Log: MFC r365262: Fix output of nfsstat -cE in json or xml mode Due to a copy/paste error, the "getacl" field was duplicated, but only in XML or JSON mode, not in txt mode. Discussed with: rmacklem Sponsored by: Axcient Modified: stable/12/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/nfsstat/nfsstat.c ============================================================================== --- stable/12/usr.bin/nfsstat/nfsstat.c Wed Sep 9 12:58:19 2020 (r365502) +++ stable/12/usr.bin/nfsstat/nfsstat.c Wed Sep 9 13:16:20 2020 (r365503) @@ -731,7 +731,7 @@ exp_intpr(int clientOnly, int serverOnly, int nfs41) "{T:PutRootFH/%13.13s}{T:DelegRet/%13.13s}" "{T:GetAcl/%13.13s}{T:SetAcl/%13.13s}\n"); xo_emit("{:rellckown/%13ju}{:freestateid/%13ju}" - "{:getacl/%13ju}{:delegret/%13ju}" + "{:putrootfh/%13ju}{:delegret/%13ju}" "{:getacl/%13ju}{:setacl/%13ju}\n", (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_RELEASELCKOWN], (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_FREESTATEID], From owner-svn-src-stable@freebsd.org Wed Sep 9 19:55:18 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 443A33DA8EE; Wed, 9 Sep 2020 19:55:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmt6G0zh2z3TZB; Wed, 9 Sep 2020 19:55:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8681:1cb0:1577:6de4:8b12:1f92]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 78D9F1214E; Wed, 9 Sep 2020 19:55:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r365281 - in stable: 11/sys/conf 11/sys/modules 11/sys/modules/tcp 12/sys/conf 12/sys/modules 12/sys/modules/tcp From: John Baldwin To: Eugene Grosbein , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <202009022136.082LatjO029946@repo.freebsd.org> <7795ab88-6220-150b-38e9-0ffae40a6093@grosbein.net> Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <13b91b06-b75b-55d7-64b6-d05e0a2a1c2c@FreeBSD.org> Date: Wed, 9 Sep 2020 12:55:16 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 19:55:18 -0000 On 9/4/20 8:33 AM, John Baldwin wrote: > On 9/3/20 11:39 AM, Eugene Grosbein wrote: >> 04.09.2020 1:16, Eugene Grosbein wrote: >> Additional rollback of r365277 gave me successfull buildworld. > > Ah, it is MODULES_WITH_WORLD that is tripping you up. What is probably > needed to fix this is merging kmod.opts.mk. I can work on that. This should all be fixed now. -- John Baldwin From owner-svn-src-stable@freebsd.org Wed Sep 9 21:57:56 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 744973DE22B; Wed, 9 Sep 2020 21:57:56 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmwqm2QFSz3gMc; Wed, 9 Sep 2020 21:57:56 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 362E28624; Wed, 9 Sep 2020 21:57:56 +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 089LvuhK001796; Wed, 9 Sep 2020 21:57:56 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089Lvu5J001795; Wed, 9 Sep 2020 21:57:56 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202009092157.089Lvu5J001795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 9 Sep 2020 21:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365519 - stable/12/sbin/init X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/sbin/init X-SVN-Commit-Revision: 365519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 21:57:56 -0000 Author: brooks Date: Wed Sep 9 21:57:55 2020 New Revision: 365519 URL: https://svnweb.freebsd.org/changeset/base/365519 Log: MFC r365279: Remove risky compatability with old kernels The badsys() handler for SIGSYS was added as a transtion aid for kernels lacking sysctl() in 1993. It is unsafe and unsound so remove it rather than running the risk of a privilege-dropping system call being silently omitted. This partially reverts SCCSID 6.12 (Berkeley) 03/03/93 "add code to change the system security level". Reviewed by: mckusick, imp, kevans Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26289 Modified: stable/12/sbin/init/init.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/init/init.c ============================================================================== --- stable/12/sbin/init/init.c Wed Sep 9 21:50:24 2020 (r365518) +++ stable/12/sbin/init/init.c Wed Sep 9 21:57:55 2020 (r365519) @@ -106,7 +106,6 @@ static void stall(const char *, ...) __printflike(1, 2 static void warning(const char *, ...) __printflike(1, 2); static void emergency(const char *, ...) __printflike(1, 2); static void disaster(int); -static void badsys(int); static void revoke_ttys(void); static int runshutdown(void); static char *strk(char *); @@ -307,9 +306,8 @@ invalid: * We catch or block signals rather than ignore them, * so that they get reset on exec. */ - handle(badsys, SIGSYS, 0); - handle(disaster, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGXCPU, - SIGXFSZ, 0); + handle(disaster, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGSYS, + SIGXCPU, SIGXFSZ, 0); handle(transition_handler, SIGHUP, SIGINT, SIGEMT, SIGTERM, SIGTSTP, SIGUSR1, SIGUSR2, SIGWINCH, 0); handle(alrm_handler, SIGALRM, 0); @@ -504,22 +502,6 @@ emergency(const char *message, ...) vsyslog(LOG_EMERG, message, ap); va_end(ap); -} - -/* - * Catch a SIGSYS signal. - * - * These may arise if a system does not support sysctl. - * We tolerate up to 25 of these, then throw in the towel. - */ -static void -badsys(int sig) -{ - static int badcount = 0; - - if (badcount++ < 25) - return; - disaster(sig); } /* From owner-svn-src-stable@freebsd.org Wed Sep 9 22:22:39 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A14C03DEBF2; Wed, 9 Sep 2020 22:22:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxNH3kV3z40bm; Wed, 9 Sep 2020 22:22:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AE278C2D; Wed, 9 Sep 2020 22:22:39 +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 089MMdmo020213; Wed, 9 Sep 2020 22:22:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MMdGo020212; Wed, 9 Sep 2020 22:22:39 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092222.089MMdGo020212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365526 - stable/12/usr.bin/uname X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/usr.bin/uname X-SVN-Commit-Revision: 365526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:22:39 -0000 Author: imp Date: Wed Sep 9 22:22:38 2020 New Revision: 365526 URL: https://svnweb.freebsd.org/changeset/base/365526 Log: MFC r360993: r360993 | imp | 2020-05-12 16:44:51 -0600 (Tue, 12 May 2020) | 6 lines Refine the history of uname. It appeared in 4.4BSD. It was not in v7 unix. It was one of the additions in PWB, and appeared in System III and later commercial versions of Unix. The different args to uname weren't aded until System III. Add a quick note to note the late entry into the BSD fork of Unix since PWB otherwise implies a pre-fork date. Modified: stable/12/usr.bin/uname/uname.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/uname/uname.1 ============================================================================== --- stable/12/usr.bin/uname/uname.1 Wed Sep 9 22:22:02 2020 (r365525) +++ stable/12/usr.bin/uname/uname.1 Wed Sep 9 22:22:38 2020 (r365526) @@ -144,7 +144,11 @@ specification. .Sh HISTORY The .Nm -command appeared in PWB UNIX. +command appeared in PWB UNIX 1.0, however +.Bx 4.4 +was the first Berkeley release with the +.Nm +command. .Pp The .Fl K From owner-svn-src-stable@freebsd.org Wed Sep 9 22:24:10 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CDF13DEC6C; Wed, 9 Sep 2020 22:24:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxQ23dpXz40ZQ; Wed, 9 Sep 2020 22:24:10 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60D0A8D1D; Wed, 9 Sep 2020 22:24:10 +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 089MOA8v020353; Wed, 9 Sep 2020 22:24:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MOAHv020352; Wed, 9 Sep 2020 22:24:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092224.089MOAHv020352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365527 - stable/12/share/misc X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/share/misc X-SVN-Commit-Revision: 365527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:24:10 -0000 Author: imp Date: Wed Sep 9 22:24:09 2020 New Revision: 365527 URL: https://svnweb.freebsd.org/changeset/base/365527 Log: MFC r361673: r361673 | imp | 2020-05-31 15:38:33 -0600 (Sun, 31 May 2020) | 14 lines Correct the release date for 2.11BSD 2.11BSD was announced on March 14, 1991 in comp.bugs.2bsd by Steven M. Schultz. The document has a 'revised January 1991' date at the top. Patch/1 in the official repo is dated March 31, 1991, and an identical copy of it was posted to comp.bugs.2bsd on May 5, 1991. Patch 2 in 22 parts was likewise posted May 18, 1991. This makes the Feb 1992 date too late. It's possible it's a typo for Feb 1991 since that lines up with the announcement being 2 weeks later. Without an extant copy of the 2.11 tape, however, it's hard to say for sure. Go with the date we have the most independent, direct evidence for, which is the announcement date. Modified: stable/12/share/misc/bsd-family-tree Directory Properties: stable/12/ (props changed) Modified: stable/12/share/misc/bsd-family-tree ============================================================================== --- stable/12/share/misc/bsd-family-tree Wed Sep 9 22:22:38 2020 (r365526) +++ stable/12/share/misc/bsd-family-tree Wed Sep 9 22:24:09 2020 (r365527) @@ -456,7 +456,7 @@ Tenth Edition 1989-10-xx [QCU] 2.9BSD-Seismo 1985-08-xx [SMS] 2.10BSD 1987-04-xx [KKK] 2.10.1BSD 1989-01-xx [SMS] -2.11BSD 1992-02-xx [SMS] +2.11BSD 1991-03-14 [SMS] 2.11BSD rev #430 1999-12-13 [SMS] 32V 1978-1[01]-xx [QCU] 1979-03-26 [TUHS] From owner-svn-src-stable@freebsd.org Wed Sep 9 22:29:45 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 739ED3DF122; Wed, 9 Sep 2020 22:29:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxXT2WxGz40hZ; Wed, 9 Sep 2020 22:29:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21E918BC2; Wed, 9 Sep 2020 22:29:45 +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 089MTjXH020767; Wed, 9 Sep 2020 22:29:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MTjQT020766; Wed, 9 Sep 2020 22:29:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092229.089MTjQT020766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365528 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 365528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:29:45 -0000 Author: imp Date: Wed Sep 9 22:29:44 2020 New Revision: 365528 URL: https://svnweb.freebsd.org/changeset/base/365528 Log: MFC r361867: r361867 | imp | 2020-06-06 00:21:20 -0600 (Sat, 06 Jun 2020) | 4 lines Document all the sysctl values for the nda devices. Include some minimal documentation on namespace support for nda devices. Fix a few typos and formatting nits to apease igor. Modified: stable/12/share/man/man4/nda.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/nda.4 ============================================================================== --- stable/12/share/man/man4/nda.4 Wed Sep 9 22:24:09 2020 (r365527) +++ stable/12/share/man/man4/nda.4 Wed Sep 9 22:29:44 2020 (r365528) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 20, 2017 +.Dd June 6, 2020 .Dt NDA 4 .Os .Sh NAME @@ -48,36 +48,156 @@ variables and .Xr loader 8 tunables: .Bl -tag -width 12 +.It Va hw.nvme.use_nvd +The +.Xr nvme 4 +driver will create +.Nm +device nodes for block storage when set to 0. +Create +.Xr nvd 4 +device nodes for block storage when set to 1. +See +.Xr nvd 4 +when set to 1. +.It Va kern.cam.nda.nvd_compat +When set to 1, +.Xr nvd 4 +aliases will be created for all +.Nm +devices, including partitions and other +.Xr goem 4 +providers that take their names from the disk's name. +.Xr nvd +devices will not, however, be reported in the +.Va kern.disks +.Xr sysctl 8 . .It Va kern.cam.nda.sort_io_queue -.Pp This variable determines whether the software queued entries are sorted in LBA order or not. Sorting is almost always a waste of time. The default is to not sort. +.It Va kern.cam.nda.enable_biospeedup +This variable determines if the +.Nm +devices participate in the speedup protocol. +When the device participates in the speedup, then when the upper layers +send a +.Va BIO_SPEEDUP , +all current +.Va BIO_DELETE +requests not yet sent to the hardware are completed successfully immediate +without sending them to the hardware. +Used in low disk space scenarios when the filesystem encounters +a critical shortage and needs blocks immediately. +Since trims have maximum benefit when the LBA is unused for a long time, +skipping the trim when space is needed for immediate writes results in little to +no excess wear. +When participation is disabled, +.Va BIO_SPEEDUP +requests are ignored. +.It Va kern.cam.nda.max_trim +The maximum number of LBA ranges to be collected together for each DSM trims +send to the hardware. +Defaults to 256, which is the maximum number of ranges the protocol supports. +Sometimes poor trim performance can be mitigated by limiting the number of +ranges sent to the device. +This value must be between 1 and 256 inclusive. .El .Pp The following report per-device settings, and are read-only unless -otherwise indicated. Replace +otherwise indicated. +Replace .Va N with the device unit number. .Bl -tag -width 12 .It Va kern.cam.nda.N.rotating -.Pp This variable reports whether the storage volume is spinning or flash. -It's value is hard coded to 0 indicating flash. +Its value is hard coded to 0 indicating flash. .It Va kern.cam.nda.N.unmapped_io This variable reports whether the .Nm driver accepts unmapped I/O for this unit. +.It Va kern.cam.nda.N.flags +This variable reports the current flags. +.Bl -tag -width 12 +.It Va OPEN +The device is open. +.It Va DIRTY +Set when a write to the drive is scheduled. +Cleared after flush commands. +.It Va SCTX_INIT +Internal flag set after +.Xr sysctl 8 +nodes have been created. +.El +.It Va kern.cam.nda.N.sort_io_queue +Same as the +.Va kern.cam.nda.sort_io_queue +tunable. +.It Va kern.cam.nda.N.trim_ticks +Writable. +When greater than zero, hold trims for up to this many ticks before sending +to the drive. +Sometimes waiting a little bit to collect more trims to send at one time +improves trim performance. +When 0, no delaying of trims are done. +.It Va kern.cam.nda.N.trim_goal +Writable. +When delaying a bit to collect multiple trims, send the accumulated DSM TRIM to +the drive. +.It Va kern.cam.nda.N.trim_lbas +Total number of LBAs that have been trimmed. +.It Va kern.cam.nda.N.trim_ranges +Total number of LBA ranges that have been trimmed. +.It Va kern.cam.nda.N.trim_count +Total number of trims sent to the hardware. +.It Va kern.cam.nda.N.deletes +Total number of +.Va BIO_DELETE +requests queued to the device. +.El +.Sh NAMESPACE MAPPING +Each +.Xr nvme 4 +drive has one or more namespaces associated with it. +One instance of the +.Nm +driver will be created for each of the namespaces on +the drive. +All the +.Nm +nodes for a +.Xr nvme 4 +device are at target 0. +However, the namespace ID maps to the CAM lun, as reported +in kernel messages and in the +.Va devlist +sub command of +.Xr camcontrol 8 . +.Pp +Namespaces are managed with the +.Va ns +sub command of +.Xr nvmecontrol 8 . +Not all drives support namespace management, +but all drives support at least one namespace. +Device nodes for +.Nm +will be created and destroyed dynamically as +namespaces are activated or detached. .Sh FILES .Bl -tag -width ".Pa /dev/nda*" -compact .It Pa /dev/nda* NVMe storage device nodes .El .Sh SEE ALSO +.Xr cam 4 , +.Xr geom 4 , +.Xr nvd 4 , .Xr nvme 4 , -.Xr nvd 4 +.Xr gpart 8 .Sh HISTORY The .Nm From owner-svn-src-stable@freebsd.org Wed Sep 9 22:30:44 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 226ED3DF21C; Wed, 9 Sep 2020 22:30:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxYc08LRz40nG; Wed, 9 Sep 2020 22:30:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDD128BC6; Wed, 9 Sep 2020 22:30:43 +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 089MUhBU023415; Wed, 9 Sep 2020 22:30:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MUhQt023414; Wed, 9 Sep 2020 22:30:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092230.089MUhQt023414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:30:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365529 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 365529 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:30:44 -0000 Author: imp Date: Wed Sep 9 22:30:43 2020 New Revision: 365529 URL: https://svnweb.freebsd.org/changeset/base/365529 Log: MFC: r361868: r361868 | imp | 2020-06-06 00:49:06 -0600 (Sat, 06 Jun 2020) | 4 lines Fix typo Submitted by: Yuri Pankov Modified: stable/12/share/man/man4/nda.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/nda.4 ============================================================================== --- stable/12/share/man/man4/nda.4 Wed Sep 9 22:29:44 2020 (r365528) +++ stable/12/share/man/man4/nda.4 Wed Sep 9 22:30:43 2020 (r365529) @@ -66,7 +66,7 @@ When set to 1, aliases will be created for all .Nm devices, including partitions and other -.Xr goem 4 +.Xr geom 4 providers that take their names from the disk's name. .Xr nvd devices will not, however, be reported in the From owner-svn-src-stable@freebsd.org Wed Sep 9 22:33:12 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FE713DF06F; Wed, 9 Sep 2020 22:33:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxcS3hD6z413J; Wed, 9 Sep 2020 22:33:12 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6201F8BE4; Wed, 9 Sep 2020 22:33:12 +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 089MXC90026804; Wed, 9 Sep 2020 22:33:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MXCUr026803; Wed, 9 Sep 2020 22:33:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092233.089MXCUr026803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365530 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 365530 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:33:12 -0000 Author: imp Date: Wed Sep 9 22:33:11 2020 New Revision: 365530 URL: https://svnweb.freebsd.org/changeset/base/365530 Log: MFC: r361882: r361882 | imp | 2020-06-06 20:40:21 -0600 (Sat, 06 Jun 2020) | 2 lines Mention nda where we mention nvd. Modified: stable/12/share/man/man4/nvme.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/nvme.4 ============================================================================== --- stable/12/share/man/man4/nvme.4 Wed Sep 9 22:30:43 2020 (r365529) +++ stable/12/share/man/man4/nvme.4 Wed Sep 9 22:33:11 2020 (r365530) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2020 +.Dd June 6, 2020 .Dt NVME 4 .Os .Sh NAME @@ -54,6 +54,8 @@ nvme_load="YES" .Pp Most users will also want to enable .Xr nvd 4 +or +.Xr nda 4 to expose NVM Express namespaces as disk devices which can be partitioned. Note that in NVM Express terms, a namespace is roughly equivalent to a From owner-svn-src-stable@freebsd.org Wed Sep 9 22:35:39 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBA843DF179; Wed, 9 Sep 2020 22:35:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxgH51Wwz41QV; Wed, 9 Sep 2020 22:35:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B2C88E40; Wed, 9 Sep 2020 22:35:39 +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 089MZdKC026988; Wed, 9 Sep 2020 22:35:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MZdoV026987; Wed, 9 Sep 2020 22:35:39 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092235.089MZdoV026987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365531 - stable/12/share/misc X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/share/misc X-SVN-Commit-Revision: 365531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:35:39 -0000 Author: imp Date: Wed Sep 9 22:35:39 2020 New Revision: 365531 URL: https://svnweb.freebsd.org/changeset/base/365531 Log: MFC r362420: r362420 | imp | 2020-06-19 22:07:44 -0600 (Fri, 19 Jun 2020) | 13 lines Correct 1BSD release date. The Quarter Century of Unix book said that 1BSD was released March 1979. However, the 1BSD tape image that's on Kirk's historical unix collection has an earlier date. It was common practice, at the time, to create a new copy of the tape from the master system when a new tape was to go out, so several different versions of 1BSD, etc were shipped from Berkerely. The date on the 1BSD tape in the Berkeley archives on Kirk's DVD is dated in January 16 1979 on the label, and has dates as late as Jan 29 (there's an UPDATE file that says this includes updates through this date). Note this date as well. Modified: stable/12/share/misc/bsd-family-tree Directory Properties: stable/12/ (props changed) Modified: stable/12/share/misc/bsd-family-tree ============================================================================== --- stable/12/share/misc/bsd-family-tree Wed Sep 9 22:33:11 2020 (r365530) +++ stable/12/share/misc/bsd-family-tree Wed Sep 9 22:35:39 2020 (r365531) @@ -440,6 +440,7 @@ Ninth Edition 1986-09-xx [QCU] Tenth Edition 1989-10-xx [QCU] 1BSD late 1977 + 1978-01-16 [DOC] 1978-03-09 [QCU] PDP-11, Pascal, ex(1) 30 free copies of 1BSD sent out From owner-svn-src-stable@freebsd.org Wed Sep 9 22:38:19 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CEB2F3DF4A5; Wed, 9 Sep 2020 22:38:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxkM5601z41ds; Wed, 9 Sep 2020 22:38:19 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E6238E42; Wed, 9 Sep 2020 22:38:19 +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 089McJ3G027156; Wed, 9 Sep 2020 22:38:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089McJJu027154; Wed, 9 Sep 2020 22:38:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092238.089McJJu027154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365532 - in stable/12: lib/libc/sys usr.sbin/chroot X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/12: lib/libc/sys usr.sbin/chroot X-SVN-Commit-Revision: 365532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:38:19 -0000 Author: imp Date: Wed Sep 9 22:38:18 2020 New Revision: 365532 URL: https://svnweb.freebsd.org/changeset/base/365532 Log: MFC r362664, r362665: r362664 | imp | 2020-06-26 16:05:23 -0600 (Fri, 26 Jun 2020) | 21 lines Chroot(2) actually appeared in 7th Edition Unix. ... r362665 | imp | 2020-06-26 16:23:15 -0600 (Fri, 26 Jun 2020) | 10 lines Chroot(8) first appeared in 4.3-Reno, not in 4.4 in the BSD world, but in System III in the AT&T world. Examination of the TUHS archives shows this was present in 4.3-Reno and System III. Reviewed by: 0mp@, allanjude@ MFC After: 3 days Differential Revision: https://reviews.freebsd.org/D25479 Modified: stable/12/lib/libc/sys/chroot.2 stable/12/usr.sbin/chroot/chroot.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/chroot.2 ============================================================================== --- stable/12/lib/libc/sys/chroot.2 Wed Sep 9 22:35:39 2020 (r365531) +++ stable/12/lib/libc/sys/chroot.2 Wed Sep 9 22:38:18 2020 (r365532) @@ -28,7 +28,7 @@ .\" @(#)chroot.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd June 26, 2020 .Dt CHROOT 2 .Os .Sh NAME @@ -131,7 +131,7 @@ Corrupted data was detected while reading from the fil The .Fn chroot system call appeared in -.Bx 4.2 . +.At v7 . It was marked as .Dq legacy in Modified: stable/12/usr.sbin/chroot/chroot.8 ============================================================================== --- stable/12/usr.sbin/chroot/chroot.8 Wed Sep 9 22:35:39 2020 (r365531) +++ stable/12/usr.sbin/chroot/chroot.8 Wed Sep 9 22:38:18 2020 (r365532) @@ -28,7 +28,7 @@ .\" @(#)chroot.8 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 7, 2003 +.Dd June 27, 2020 .Dt CHROOT 8 .Os .Sh NAME @@ -91,4 +91,6 @@ is used. The .Nm utility first appeared in -.Bx 4.4 . +.At III +and +.Bx 4.3 Reno . From owner-svn-src-stable@freebsd.org Wed Sep 9 22:40:15 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 561533DF5AC; Wed, 9 Sep 2020 22:40:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmxmb1XGvz41cn; Wed, 9 Sep 2020 22:40:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18E898EC3; Wed, 9 Sep 2020 22:40:15 +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 089MeEV5027333; Wed, 9 Sep 2020 22:40:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MeEI8027332; Wed, 9 Sep 2020 22:40:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092240.089MeEI8027332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365533 - stable/12/libexec/getty X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/libexec/getty X-SVN-Commit-Revision: 365533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:40:15 -0000 Author: imp Date: Wed Sep 9 22:40:14 2020 New Revision: 365533 URL: https://svnweb.freebsd.org/changeset/base/365533 Log: MFC r363408: r363408 | imp | 2020-07-21 18:44:47 -0600 (Tue, 21 Jul 2020) | 4 lines getty appears to date from 3rd edition research unix. That's the oldest man page on TUHS and its 'unix 1972' restoration effort has assembler sources that look like simpler version of what's in the 5th edition. Modified: stable/12/libexec/getty/getty.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/getty/getty.8 ============================================================================== --- stable/12/libexec/getty/getty.8 Wed Sep 9 22:38:18 2020 (r365532) +++ stable/12/libexec/getty/getty.8 Wed Sep 9 22:40:14 2020 (r365533) @@ -28,7 +28,7 @@ .\" from: @(#)getty.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" " -.Dd March 2, 2018 +.Dd July 21, 2020 .Dt GETTY 8 .Os .Sh NAME @@ -122,4 +122,4 @@ does not exist. A .Nm utility appeared in -.At v6 . +.At v3 . From owner-svn-src-stable@freebsd.org Wed Sep 9 22:40:39 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C95AD3DF79D; Wed, 9 Sep 2020 22:40:39 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmxn34yBkz41gP; Wed, 9 Sep 2020 22:40:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D683905A; Wed, 9 Sep 2020 22:40:39 +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 089Medh5027405; Wed, 9 Sep 2020 22:40:39 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MedNr027404; Wed, 9 Sep 2020 22:40:39 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202009092240.089MedNr027404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 9 Sep 2020 22:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365534 - stable/11/sbin/init X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sbin/init X-SVN-Commit-Revision: 365534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:40:39 -0000 Author: brooks Date: Wed Sep 9 22:40:39 2020 New Revision: 365534 URL: https://svnweb.freebsd.org/changeset/base/365534 Log: MFC r365279: Remove risky compatability with old kernels The badsys() handler for SIGSYS was added as a transtion aid for kernels lacking sysctl() in 1993. It is unsafe and unsound so remove it rather than running the risk of a privilege-dropping system call being silently omitted. This partially reverts SCCSID 6.12 (Berkeley) 03/03/93 "add code to change the system security level". Reviewed by: mckusick, imp, kevans Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26289 Modified: stable/11/sbin/init/init.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/init/init.c ============================================================================== --- stable/11/sbin/init/init.c Wed Sep 9 22:40:14 2020 (r365533) +++ stable/11/sbin/init/init.c Wed Sep 9 22:40:39 2020 (r365534) @@ -104,7 +104,6 @@ static void stall(const char *, ...) __printflike(1, 2 static void warning(const char *, ...) __printflike(1, 2); static void emergency(const char *, ...) __printflike(1, 2); static void disaster(int); -static void badsys(int); static void revoke_ttys(void); static int runshutdown(void); static char *strk(char *); @@ -305,9 +304,8 @@ invalid: * We catch or block signals rather than ignore them, * so that they get reset on exec. */ - handle(badsys, SIGSYS, 0); - handle(disaster, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGXCPU, - SIGXFSZ, 0); + handle(disaster, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGSYS, + SIGXCPU, SIGXFSZ, 0); handle(transition_handler, SIGHUP, SIGINT, SIGEMT, SIGTERM, SIGTSTP, SIGUSR1, SIGUSR2, 0); handle(alrm_handler, SIGALRM, 0); @@ -502,22 +500,6 @@ emergency(const char *message, ...) vsyslog(LOG_EMERG, message, ap); va_end(ap); -} - -/* - * Catch a SIGSYS signal. - * - * These may arise if a system does not support sysctl. - * We tolerate up to 25 of these, then throw in the towel. - */ -static void -badsys(int sig) -{ - static int badcount = 0; - - if (badcount++ < 25) - return; - disaster(sig); } /* From owner-svn-src-stable@freebsd.org Wed Sep 9 22:42:14 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76EE13DF6FE; Wed, 9 Sep 2020 22:42:14 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmxpr4Pnmz42F7; Wed, 9 Sep 2020 22:42:12 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id 089MfoNo058630 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 9 Sep 2020 22:41:53 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: jhb@FreeBSD.org Received: from [10.58.0.10] (dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.16.1/8.16.1) with ESMTPS id 089MfrOR024531 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 10 Sep 2020 05:41:54 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r365281 - in stable: 11/sys/conf 11/sys/modules 11/sys/modules/tcp 12/sys/conf 12/sys/modules 12/sys/modules/tcp To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <202009022136.082LatjO029946@repo.freebsd.org> <7795ab88-6220-150b-38e9-0ffae40a6093@grosbein.net> <13b91b06-b75b-55d7-64b6-d05e0a2a1c2c@FreeBSD.org> From: Eugene Grosbein Message-ID: <40c61507-42c8-3dda-d25a-467a984582bb@grosbein.net> Date: Thu, 10 Sep 2020 05:41:45 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <13b91b06-b75b-55d7-64b6-d05e0a2a1c2c@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,LOCAL_FROM, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains * -1.6 NICE_REPLY_A Looks like a legit reply (A) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 4Bmxpr4Pnmz42F7 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-1.64 / 15.00]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[eugen]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.97)[-0.965]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; NEURAL_HAM_MEDIUM(-0.92)[-0.920]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_SPAM_SHORT(0.35)[0.348]; R_SPF_PERMFAIL(0.00)[empty SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-stable-12,svn-src-stable,svn-src-all] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:42:14 -0000 10.09.2020 2:55, John Baldwin wrote: > On 9/4/20 8:33 AM, John Baldwin wrote: >> On 9/3/20 11:39 AM, Eugene Grosbein wrote: >>> 04.09.2020 1:16, Eugene Grosbein wrote: >>> Additional rollback of r365277 gave me successfull buildworld. >> >> Ah, it is MODULES_WITH_WORLD that is tripping you up. What is probably >> needed to fix this is merging kmod.opts.mk. I can work on that. > > This should all be fixed now. Thank you, it is really fixed. From owner-svn-src-stable@freebsd.org Wed Sep 9 22:42:15 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D0BD3DFB09; Wed, 9 Sep 2020 22:42:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmxpv0tsDz42HQ; Wed, 9 Sep 2020 22:42:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F39DB913E; Wed, 9 Sep 2020 22:42:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089MgENn030536; Wed, 9 Sep 2020 22:42:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MgEnE030535; Wed, 9 Sep 2020 22:42:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092242.089MgEnE030535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365535 - stable/12/usr.bin/patch X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/usr.bin/patch X-SVN-Commit-Revision: 365535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:42:15 -0000 Author: imp Date: Wed Sep 9 22:42:14 2020 New Revision: 365535 URL: https://svnweb.freebsd.org/changeset/base/365535 Log: MFC r364291: r364291 | imp | 2020-08-16 17:55:23 -0600 (Sun, 16 Aug 2020) | 33 lines Remove heuristic for dealing with trailing newlines being truncated by mailers. ... Modified: stable/12/usr.bin/patch/pch.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/patch/pch.c ============================================================================== --- stable/12/usr.bin/patch/pch.c Wed Sep 9 22:40:39 2020 (r365534) +++ stable/12/usr.bin/patch/pch.c Wed Sep 9 22:42:14 2020 (r365535) @@ -587,16 +587,11 @@ another_hunk(void) len = pgets(true); p_input_line++; if (len == 0) { - if (p_max - p_end < 4) { - /* assume blank lines got chopped */ - strlcpy(buf, " \n", buf_size); - } else { - if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - fatal("unexpected end of file in patch\n"); + if (repl_beginning && repl_could_be_missing) { + repl_missing = true; + goto hunk_done; } + fatal("unexpected end of file in patch\n"); } p_end++; if (p_end >= hunkmax) From owner-svn-src-stable@freebsd.org Wed Sep 9 22:45:13 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26E223DF9FB; Wed, 9 Sep 2020 22:45:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxtJ6FY2z42DY; Wed, 9 Sep 2020 22:45:12 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B590E8E59; Wed, 9 Sep 2020 22:45:12 +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 089MjCsl033083; Wed, 9 Sep 2020 22:45:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MjBRX033079; Wed, 9 Sep 2020 22:45:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092245.089MjBRX033079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365536 - in stable/12: sbin/devd share/man/man4 sys/dev/pccard X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/12: sbin/devd share/man/man4 sys/dev/pccard X-SVN-Commit-Revision: 365536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:45:13 -0000 Author: imp Date: Wed Sep 9 22:45:11 2020 New Revision: 365536 URL: https://svnweb.freebsd.org/changeset/base/365536 Log: MFC r364335,r364336,r364337,r364351 r364335 | imp | 2020-08-18 00:07:34 -0600 (Tue, 18 Aug 2020) | 6 lines Modernize a bit. Remove PC Card specific information. It's of little value these days and on the way out after most of its drivers have been removed. Use iwn instead of wi device. r364336 | imp | 2020-08-18 00:18:18 -0600 (Tue, 18 Aug 2020) | 9 lines Document that PC Card will likely be removed before 13. This was discussed in arch@ a while ago. Most of the 16-bit drivers that it relied on have been removed. There's only a few other drivers remaining that support it, and those are very rare the days (even the once ubiquitious wi(1) is now quite rare). Indvidual drivers will be handled separately before pccard itself is removed. r364337 | imp | 2020-08-18 00:34:56 -0600 (Tue, 18 Aug 2020) | 2 lines Use better gone_in_dev rather than just gone_in to print the device name. r364351 | imp | 2020-08-18 11:29:01 -0600 (Tue, 18 Aug 2020) | 4 lines bt(4) has already been removed. Add a deprecation notice. MFC After: 1 day Modified: stable/12/sbin/devd/devd.conf.5 stable/12/share/man/man4/bt.4 stable/12/share/man/man4/pccard.4 stable/12/sys/dev/pccard/pccard.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/devd/devd.conf.5 ============================================================================== --- stable/12/sbin/devd/devd.conf.5 Wed Sep 9 22:42:14 2020 (r365535) +++ stable/12/sbin/devd/devd.conf.5 Wed Sep 9 22:45:11 2020 (r365536) @@ -41,7 +41,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd May 31, 2019 +.Dd August 18, 2020 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -253,10 +253,6 @@ Device name of parent bus. Device node path if one is created by the .Xr devfs 5 filesystem. -.It Li cisproduct -CIS-product. -.It Li cisvendor -CIS-vendor. .It Li class Device class. .It Li comm @@ -285,8 +281,6 @@ Interface Protocol (USB). Interface Sub-class (USB). .It Li jail Jail name for the process triggering the rule (RCTL). -.It Li manufacturer -Manufacturer ID (pccard). .It Li mode Peripheral mode (USB). .It Li notify @@ -300,7 +294,7 @@ PID of the process triggering the rule (RCTL). .It Li port Hub port number (USB). .It Li product -Product ID (pccard/USB). +Product ID (USB). .It Li release Hardware revision (USB). .It Li ruid @@ -312,9 +306,9 @@ Serial Number (USB). .It Li slot Card slot. .It Li subvendor -Sub-vendor ID. +Sub-vendor ID (PCI). .It Li subdevice -Sub-device ID. +Sub-device ID (PCI). .It Li subsystem Matches a subsystem of a system, see below. .It Li system @@ -641,20 +635,20 @@ notify 0 { }; # -# Try to configure ath and wi devices with pccard_ether +# Try to configure ath and iwn devices with pccard_ether # as they are attached. # attach 0 { - device-name "(ath|wi)[0-9]+"; + device-name "(ath|iwn)[0-9]+"; action "/etc/pccard_ether $device-name start"; }; # -# Stop ath and wi devices as they are detached from +# Stop ath and iwn devices as they are detached from # the system. # detach 0 { - device-name "(ath|wi)[0-9]+"; + device-name "(ath|iwn)[0-9]+"; action "/etc/pccard_ether $device-name stop"; }; .Ed Modified: stable/12/share/man/man4/bt.4 ============================================================================== --- stable/12/share/man/man4/bt.4 Wed Sep 9 22:42:14 2020 (r365535) +++ stable/12/share/man/man4/bt.4 Wed Sep 9 22:45:11 2020 (r365536) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2017 +.Dd August 18, 2020 .Dt BT 4 .Os .Sh NAME @@ -46,6 +46,9 @@ In .Cd hint.bt.0.at="isa" .Cd hint.bt.0.port="0x330" .Ed +.Sh DEPRECATION NOTICE +This driver is scheduled for removal prior to the release of +.Fx 13.0 . .Sh DESCRIPTION This driver provides access to the .Tn SCSI Modified: stable/12/share/man/man4/pccard.4 ============================================================================== --- stable/12/share/man/man4/pccard.4 Wed Sep 9 22:42:14 2020 (r365535) +++ stable/12/share/man/man4/pccard.4 Wed Sep 9 22:45:11 2020 (r365536) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2002 +.Dd August 18, 2020 .Dt PCCARD 4 .Os .Sh NAME @@ -32,6 +32,9 @@ .Nd PC Card bus driver .Sh SYNOPSIS .Cd device pccard +.Sh DEPRECATION NOTICE +This driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh DESCRIPTION The .Nm Modified: stable/12/sys/dev/pccard/pccard.c ============================================================================== --- stable/12/sys/dev/pccard/pccard.c Wed Sep 9 22:42:14 2020 (r365535) +++ stable/12/sys/dev/pccard/pccard.c Wed Sep 9 22:45:11 2020 (r365536) @@ -843,6 +843,7 @@ pccard_attach(device_t dev) sc->sc_enabled_count = 0; if ((err = pccard_device_create(sc)) != 0) return (err); + gone_in_dev(dev, 13, "PC Card to be removed."); STAILQ_INIT(&sc->card.pf_head); return (bus_generic_attach(dev)); } From owner-svn-src-stable@freebsd.org Wed Sep 9 22:49:44 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B9263DFD93; Wed, 9 Sep 2020 22:49:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxzW714Xz42hk; Wed, 9 Sep 2020 22:49:43 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B99009180; Wed, 9 Sep 2020 22:49:43 +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 089MnhIH033361; Wed, 9 Sep 2020 22:49:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MnhUO033360; Wed, 9 Sep 2020 22:49:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092249.089MnhUO033360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365537 - stable/12/sbin/devd X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/sbin/devd X-SVN-Commit-Revision: 365537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:49:44 -0000 Author: imp Date: Wed Sep 9 22:49:43 2020 New Revision: 365537 URL: https://svnweb.freebsd.org/changeset/base/365537 Log: MFC r364359, r364360, r364361, r364362, r364364, r364370 r364359 | imp | 2020-08-18 15:26:39 -0600 (Tue, 18 Aug 2020) | 9 lines Move the possible event types into a column table to make it easier to read. Sort system type alphabetically. Remove some commas that aren't in the devd notification messages. MFC After: 3 days Reviewed by: 0mp (earlier versions), jhb (useful feedback on earlier versions) Differential Revision: https://reviews.freebsd.org/D26105 r364360 | imp | 2020-08-18 15:26:45 -0600 (Tue, 18 Aug 2020) | 4 lines GEOM::rotation_rate changes are also signaled via devctl. MFC After: 3 days r364361 | imp | 2020-08-18 15:26:50 -0600 (Tue, 18 Aug 2020) | 8 lines Document the PMU system The pmu(4) and adb(4) drivers on powerpc generate PMU events. Document them. The allwinner power modules also generate these events. Document those as well. MFC After: 3 days r364362 | imp | 2020-08-18 15:26:54 -0600 (Tue, 18 Aug 2020) | 4 lines Document the AEON subsystem for the Amiga's power button. MFC After: 3 days r364364 | imp | 2020-08-18 15:42:02 -0600 (Tue, 18 Aug 2020) | 5 lines Fix two typos. Submitted by: rpokala@ MFC After: 3 days r364370 | imp | 2020-08-18 20:18:11 -0600 (Tue, 18 Aug 2020) | 8 lines Three typos: Amiga is a proper noun Condition is traditionally spelled starting with 'c' Some, but not all, of the over/under-voltage instances were hyphenated. Since they are all adverb phrases, they all need to be hyphenated. Pointy hat: imp Modified: stable/12/sbin/devd/devd.conf.5 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/devd/devd.conf.5 ============================================================================== --- stable/12/sbin/devd/devd.conf.5 Wed Sep 9 22:45:11 2020 (r365536) +++ stable/12/sbin/devd/devd.conf.5 Wed Sep 9 22:49:43 2020 (r365537) @@ -322,96 +322,118 @@ Vendor ID. A partial list of systems, subsystems, and types used within the .Ic notify mechanism. +.\" +.\" Please keep these tables sorted. Also, please use the same parameters +.\" for each of the tables so that things line up in columns nicely. +.\" Please do not omit the type column for notifiers that omit it. .Pp -.Bl -tag -width ".Li coretemp" -compact -.It Sy System -.It Li ACPI -Events related to the ACPI subsystem. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li ACAD +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li ACPI Ta Ta Ta +Events related to the ACPI Subsystem. +.It Li ACPI Ta Li ACAD Ta Ta AC line state ($notify=0x00 is offline, 0x01 is online). -.It Li Button +.It Li ACPI Ta Li Button Ta Ta Button state ($notify=0x00 is power, 0x01 is sleep). -.It Li CMBAT +.It Li ACPI Ta Li CMBAT Ta Ta Battery events. -.It Li Dock +.It Li ACPI Ta Li Dock Ta Ta Dock state ($notify=0x00 is undocked, 0x01 is docked). -.It Li Lid +.It Li ACPI Ta Li Lid Ta Ta Lid state ($notify=0x00 is closed, 0x01 is open). -.It Li PROCESSOR +.It Li ACPI Ta Li PROCESSOR Ta Ta Processor state/configuration ($notify=0x81 is a change in available Cx states). -.It Li Resume +.It Li ACPI Ta Li Resume Ta Ta Resume notification. -.It Li Suspend +.It Li ACPI Ta Li Suspend Ta Ta Suspend notification. -.It Li Thermal +.It Li ACPI Ta Li Thermal Ta Ta Thermal zone events. .El .Pp -.It Li CARP +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li AEON Ta Li power Ta Li press Ta +The power button on an Amiga has been pressed. +.El +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li CAM Ta Ta Ta Events related to the +.Xr cam 4 +system. +.It Li CAM Ta Li periph Ta Ta +Events related to peripheral devices. +.It Li CAM Ta Li periph Ta Li error Ta +Generic errors. +.It Li CAM Ta Li periph Ta Li timeout Ta +Command timeouts. +.El +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li CARP Ta Ta Ta +Events related to the .Xr carp 4 protocol. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Ar vhid@interface +.It CARP Ta Ar vhid@inet Ta Ta The .Dq subsystem contains the actual CARP vhid and the name of the network interface on which the event took place. -.Bl -tag -width ".Li MASTER" -compact -.It Sy Type -.It Li MASTER +.It CARP Ta Ar vhid@inet Ta MASTER Ta Node become the master for a virtual host. -.It Li BACKUP +.It CARP Ta Ar vhid@inet Ta BACKUP Ta Node become the backup for a virtual host. .El +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li coretemp Ta Ta Ta +Events related to the +.Xr coretemp 4 +device. +.It Li coretemp Ta Li Thermal Ta Ta +Notification that the CPU core has reached critical temperature. +.It Li coretemp Ta Li Thermal Ta Li temperature Ta +String containing the temperature of the core that has become too hot. .El .Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li IFNET -Events related to the network subsystem. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Ar interface +.It Li IFNET Ta Ar inet Ta Ta The .Dq subsystem is the actual name of the network interface on which the event took place. -.Bl -tag -width ".Li LINK_DOWN" -compact -.It Sy Type -.It Li LINK_UP +.It Li IFNET Ta Ar inet Ta Li LINK_UP Ta Carrier status changed to UP. -.It Li LINK_DOWN +.It Li IFNET Ta Ar inet Ta Li LINK_DOWN Ta Carrier status changed to DOWN. -.It Li ATTACH +.It Li IFNET Ta Ar inet Ta Li ATTACH Ta The network interface is attached to the system. -.It Li DETACH +.It Li IFNET Ta Ar inet Ta Li DETACH Ta The network interface is detached from the system. .El -.El .Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li DEVFS -Events related to the -.Xr devfs 5 -filesystem. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li CDEV -.Bl -tag -width ".Li DESTROY" -compact -.It Sy Type -.It Li CREATE +.It Li DEVFS Ta Li CDEV Ta Li CREATE Ta The .Xr devfs 5 node is created. -.It Li DESTROY +.It Li DEVFS Ta Li CDEV Ta Li DESTROY Ta The .Xr devfs 5 node is destroyed. .El -.El .Pp -.It Li GEOM +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li GEOM Ta Ta Ta Events related to the .Xr geom 4 framework. @@ -420,131 +442,151 @@ The difference compared to is that .Li GEOM only includes disk-like devices. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li DEV -.Bl -tag -width ".Li MEDIACHANGE" -compact -.It Sy Type -.It Li CREATE +.It Li GEOM Ta Li DEV Ta Li CREATE Ta A .Xr geom 4 device node is created. -.It Li DESTROY +.It Li GEOM Ta Li DEV Ta Li DESTROY Ta A .Xr geom 4 device node is destroyed. -.It Li GEOM::physpath +.It Li GEOM Ta Li DEV Ta Li GEOM::physpath Ta The physical path of a device has changed. -.It Li MEDIACHANGE +.It Li GEOM Ta Li DEV Ta Li GEOM::rotation_rate Ta +The rotation rate of the disk has changed. +.It Li GEOM Ta Li DEV Ta Li MEDIACHANGE Ta Physical media has changed. +.It Li GEOM Ta Li DEV Ta Li SIZECHANGE Ta +A +.Xr geom 4 +provider size has changed. .El +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li kern Ta Li power Ta Li resume Ta +Notification that the system has woken from the suspended state. .El .Pp -.It Li RCTL +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li kernel Ta Li signal Ta Li coredump Ta +Notification that a process has crashed and dumped core. +.El +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li PMU Ta Ta Ta +Notification of events from various types of Power Management Units. +.It Li PMU Ta Li "AC" Ta Ta +Notifications of AC power related events. +.It Li PMU Ta Li "AC" Ta Li overvoltage Ta +An over-voltage condition was detected on the AC power line. +.It Li PMU Ta Li "AC" Ta Li plugged Ta +Power has been applied to the AC power line. +.It Li PMU Ta Li "AC" Ta Li unplugged Ta +Power has been removed from the AC power line. +.It Li PMU Ta Li Battery Ta Ta +.It Li PMU Ta Li Battery Ta absent Ta +Battery is no longer absent. +.It Li PMU Ta Li Battery Ta charged Ta +The battery has become charged. +.It Li PMU Ta Li Battery Ta charging Ta +The battery has started charging. +.It Li PMU Ta Li Battery Ta disconnected Ta +The battery has been disconnected. +.It Li PMU Ta Li Battery Ta high-temp Ta +The battery reported a temperature over the limit. +.It Li PMU Ta Li Battery Ta low-temp Ta +The battery reported a temperature under the limit. +.It Li PMU Ta Li Battery Ta plugged Ta +The battery has become plugged (eg connected). +.It Li PMU Ta Li Battery Ta shutdown-threshold Ta +The power in the battery has fallen below the shutdown threshold. +.It Li PMU Ta Li Battery Ta warning-threshold Ta +The power in the battery has fallen below the warn the user threshold. +.It Li PMU Ta Li Button Ta pressed Ta +A button on a +.Xr adb 4 +or +.Xr pmu 4 +has been pressed. +.It Li PMU Ta Li keys Ta Ta +One of the keys on the +.Xr adb 4 +keyboard has been pressed. +.It Li PMU Ta Li keys Ta brightness Ta +A brightness level change has been requested. +Direction is in the $notify variable. +.It Li PMU Ta Li keys Ta mute Ta +The mute key +.It Li PMU Ta Li keys Ta volume Ta +A volume level change has been requested. +Direction is in the $notify variable. +.It Li PMU Ta Li keys Ta eject Ta +An ejection has been requested. +.It Li PMU Ta Li lid Ta close Ta +The +.Xr pmc 4 +device has detected the lid closing. +.It Li PMU Ta Li lid Ta open Ta +The +.Xr pmc 4 +device has detected the lid openinging. +.It Li PMU Ta Li POWER Ta ACLINE Ta +The +.Xr pmc 4 +device has deteted an AC line state ($notify=0x00 is offline, 0x01 is online). +.It Li PMU Ta Li USB Ta overvoltage Ta +An over-voltage condition on the power lines for the USB power pins. +.It Li PMU Ta Li USB Ta plugged Ta +A device has been plugged into a USB device. +.It Li PMU Ta Li USB Ta undervoltage Ta +An under-voltage condition on the power lines for the USB power pins. +.It Li PMU Ta Li USB Ta unplugged Ta +A device has been unplugged into a USB device. +.El +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li RCTL Ta Ta Ta Events related to the .Xr rctl 8 framework. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li rule -.Bl -tag -width ".Li matched" -compact -.It Sy Type -.It Li matched +.It Li RCTL Ta Li rule Ta Li matched Ta A rule with action specified as "devctl" was triggered. .El -.El .Pp -.It Li USB +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li USB Ta Ta Ta Events related to the USB subsystem. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li DEVICE -.Bl -tag -width ".Li DETACH" -compact -.It Sy Type -.It Li ATTACH +.It Li USB Ta Li DEVICE Ta Li ATTACH Ta USB device is attached to the system. -.It Li DETACH -USB device is detached from the system. -.El -.It Li INTERFACE -.Bl -tag -width ".Li DETACH" -compact -.It Sy Type -.It Li ATTACH +.It Li USB Ta Li DEVICE Ta Li DETACH Ta +USB device is detached to the system. +.It Li USB Ta Li INTERFACE Ta Li ATTACH Ta USB interface is attached to a device. -.It Li DETACH +.It Li USB Ta Li INTERFACE Ta Li DETACH Ta USB interface is detached from a device. .El -.El .Pp -.It Li coretemp -Events related to the -.Xr coretemp 4 -device. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li Thermal -Notification that the CPU core has reached critical temperature. -.Bl -tag -width ".Ar temperature" -compact -.It Sy Type -.It Ar temperature -String containing the temperature of the core that has become too hot. -.El -.El -.Pp -.It Li kern -Events related to the kernel. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li power -.Bl -tag -width ".li resume" -compact -.It Sy Type -.It Li resume -Notification that the system has woken from the suspended state. -.El -.El -.Pp -.It Li kernel -More events related to the kernel. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li signal -.Bl -tag -width ".li resume" -compact -.It Sy Type -.It Li coredump -Notification that a process has crashed and dumped core. -.El -.El -.Pp -.It Li CAM -Events related to the -.Xr cam 4 -system. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li periph -Events related to peripheral devices. -.Bl -tag -width ".li timeout" -compact -.It Sy Type -.It Li error -Generic errors. -.It Li timeout -Command timeouts. -.El -.El -.El -.Pp +.\" +.\" End of tables +.\" A link state change to UP on the interface .Dq Li fxp0 would result in the following notify event: .Bd -literal -offset indent -system=IFNET, subsystem=fxp0, type=LINK_UP +system=IFNET subsystem=fxp0 type=LINK_UP .Ed .Pp An AC line state change to .Dq offline would result in the following event: .Bd -literal -offset indent -system=ACPI, subsystem=ACAD, notify=0x00 +system=ACPI subsystem=ACAD notify=0x00 .Ed .Ss Comments Comments may appear anywhere that whitespace may appear in a From owner-svn-src-stable@freebsd.org Wed Sep 9 22:51:59 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81D133DFCEC; Wed, 9 Sep 2020 22:51:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmy272wDRz430w; Wed, 9 Sep 2020 22:51:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4841E8CD7; Wed, 9 Sep 2020 22:51:59 +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 089MpxAs037276; Wed, 9 Sep 2020 22:51:59 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089Mpxc5037275; Wed, 9 Sep 2020 22:51:59 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092251.089Mpxc5037275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365538 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 365538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:51:59 -0000 Author: imp Date: Wed Sep 9 22:51:58 2020 New Revision: 365538 URL: https://svnweb.freebsd.org/changeset/base/365538 Log: MFC r364424: r364424 | imp | 2020-08-20 10:52:34 -0600 (Thu, 20 Aug 2020) | 5 lines Fix function name in zone.9 uma_zone_prealloc -> uma_prealloc. There's no uma_zone_prealloc defined and the docs for it describe uma_prealloc exactly. Modified: stable/12/share/man/man9/zone.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/zone.9 ============================================================================== --- stable/12/share/man/man9/zone.9 Wed Sep 9 22:49:43 2020 (r365537) +++ stable/12/share/man/man9/zone.9 Wed Sep 9 22:51:58 2020 (r365538) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 30, 2019 +.Dd August 20, 2020 .Dt UMA 9 .Os .Sh NAME @@ -401,7 +401,7 @@ This function infers the domain from the pointer and d argument. .Pp The -.Fn uma_zone_prealloc +.Fn uma_prealloc function allocates slabs for the requested number of items, typically following the initial creation of a zone. Subsequent allocations from the zone will be satisfied using the pre-allocated @@ -409,7 +409,7 @@ slabs. Note that slab allocation is performed with the .Dv M_WAITOK flag, so -.Fn uma_zone_prealloc +.Fn uma_prealloc may sleep. .Pp The From owner-svn-src-stable@freebsd.org Wed Sep 9 22:54:14 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B798F3DFE3B; Wed, 9 Sep 2020 22:54:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmy4k4TPFz43Mn; Wed, 9 Sep 2020 22:54:14 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E1759371; Wed, 9 Sep 2020 22:54:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089MsEeM039264; Wed, 9 Sep 2020 22:54:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MsAhQ039244; Wed, 9 Sep 2020 22:54:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092254.089MsAhQ039244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365539 - in stable/12: share/man/man4 sys/dev/an sys/dev/ata sys/dev/cmx sys/dev/fdc sys/dev/if_ndis sys/dev/puc sys/dev/uart sys/dev/wi sys/netgraph/bluetooth/drivers/bt3c X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/an sys/dev/ata sys/dev/cmx sys/dev/fdc sys/dev/if_ndis sys/dev/puc sys/dev/uart sys/dev/wi sys/netgraph/bluetooth/drivers/bt3c X-SVN-Commit-Revision: 365539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:54:14 -0000 Author: imp Date: Wed Sep 9 22:54:09 2020 New Revision: 365539 URL: https://svnweb.freebsd.org/changeset/base/365539 Log: MFC: 364430: r364430 | imp | 2020-08-20 11:19:40 -0600 (Thu, 20 Aug 2020) | 6 lines Tag pccard drivers with gone in 13. MFC After: 3 days Reviewed by: emaste, brooks, adrian (on twitter) Differential Revision: https://reviews.freebsd.org/D26095 Modified: stable/12/share/man/man4/an.4 stable/12/share/man/man4/ata.4 stable/12/share/man/man4/cmx.4 stable/12/share/man/man4/fdc.4 stable/12/share/man/man4/ndis.4 stable/12/share/man/man4/ng_bt3c.4 stable/12/share/man/man4/pccard.4 stable/12/share/man/man4/puc.4 stable/12/share/man/man4/uart.4 stable/12/share/man/man4/wi.4 stable/12/sys/dev/an/if_an_pccard.c stable/12/sys/dev/ata/ata-card.c stable/12/sys/dev/cmx/cmx_pccard.c stable/12/sys/dev/fdc/fdc_pccard.c stable/12/sys/dev/if_ndis/if_ndis_pccard.c stable/12/sys/dev/puc/puc_pccard.c stable/12/sys/dev/uart/uart_bus_pccard.c stable/12/sys/dev/wi/if_wi_pccard.c stable/12/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/an.4 ============================================================================== --- stable/12/share/man/man4/an.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/an.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -51,6 +51,9 @@ module at boot time, place the following line in .Bd -literal -offset indent if_an_load="YES" .Ed +.Sh DEPRECATION NOTICE +This driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh DESCRIPTION The .Nm Modified: stable/12/share/man/man4/ata.4 ============================================================================== --- stable/12/share/man/man4/ata.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/ata.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -222,6 +222,9 @@ Unknown ATA chipsets are supported in PIO modes, and i busmaster DMA registers are present and contain valid setup, DMA is also enabled, although the max mode is limited to UDMA33, as it is not known what the chipset can do and how to program it. +.Sh DEPRECATION NOTICE +The PC Card attachment of this driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh NOTES Please remember that in order to use UDMA4/ATA66 and above modes you .Em must Modified: stable/12/share/man/man4/cmx.4 ============================================================================== --- stable/12/share/man/man4/cmx.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/cmx.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -34,6 +34,9 @@ .Nd Omnikey CardMan 4040 smartcard reader device driver .Sh SYNOPSIS .Cd device cmx +.Sh DEPRECATION NOTICE +This driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh DESCRIPTION The .Nm Modified: stable/12/share/man/man4/fdc.4 ============================================================================== --- stable/12/share/man/man4/fdc.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/fdc.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -313,6 +313,9 @@ Third argument is a pointer to This type is the same as being used in the per-drive configuration flags, or in the CMOS configuration data or ACPI namespace on IA32 systems. .El +.Sh DEPRECATION NOTICE +The PC Card attachment of this driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh FILES .Bl -tag -width ".Pa /dev/fd*" -compact .It Pa /dev/fd* Modified: stable/12/share/man/man4/ndis.4 ============================================================================== --- stable/12/share/man/man4/ndis.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/ndis.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -120,6 +120,9 @@ driver-specific registry keys to control the media set which can be configured via the .Xr sysctl 8 command. +.Sh DEPRECATION NOTICE +The PC Card attachment of this driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh DIAGNOSTICS .Bl -diag .It "ndis%d: watchdog timeout" Modified: stable/12/share/man/man4/ng_bt3c.4 ============================================================================== --- stable/12/share/man/man4/ng_bt3c.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/ng_bt3c.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -34,6 +34,9 @@ .Sh SYNOPSIS .In sys/types.h .In netgraph/bluetooth/include/ng_bt3c.h +.Sh DEPRECATION NOTICE +This driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh DESCRIPTION The .Nm btccc Modified: stable/12/share/man/man4/pccard.4 ============================================================================== --- stable/12/share/man/man4/pccard.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/pccard.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -34,7 +34,7 @@ .Cd device pccard .Sh DEPRECATION NOTICE This driver is scheduled for removal prior to the release of -.Fx 13.0 +.Fx 13.0 . .Sh DESCRIPTION The .Nm Modified: stable/12/share/man/man4/puc.4 ============================================================================== --- stable/12/share/man/man4/puc.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/puc.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -47,6 +47,9 @@ driver. The list of supported devices is in .Pa sys/dev/puc/pucdata.c . Support for new cards should be added there. +.Sh DEPRECATION NOTICE +The PC Card attachment of this driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh SEE ALSO .Xr ppc 4 , .Xr uart 4 Modified: stable/12/share/man/man4/uart.4 ============================================================================== --- stable/12/share/man/man4/uart.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/uart.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -271,6 +271,9 @@ be locked for devices that support more than one setti The CLOCAL flag on callin ports should be locked off for logins to avoid certain security holes, but this needs to be done by getty if the callin port is used for anything else. +.Sh DEPRECATION NOTICE +The PC Card attachment of this driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh FILES .Bl -tag -width "/dev/ttyu?.init" -compact .It Pa /dev/ttyu? Modified: stable/12/share/man/man4/wi.4 ============================================================================== --- stable/12/share/man/man4/wi.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/wi.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -52,6 +52,9 @@ module at boot time, place the following line in .Bd -literal -offset indent if_wi_load="YES" .Ed +.Sh DEPRECATION NOTICE +This driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh DESCRIPTION The .Nm Modified: stable/12/sys/dev/an/if_an_pccard.c ============================================================================== --- stable/12/sys/dev/an/if_an_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/an/if_an_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -156,5 +156,7 @@ an_pccard_attach(device_t dev) fail: if (error) an_release_resources(dev); + else + gone_in_dev(dev, 13, "pccard removed"); return (error); } Modified: stable/12/sys/dev/ata/ata-card.c ============================================================================== --- stable/12/sys/dev/ata/ata-card.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/ata/ata-card.c Wed Sep 9 22:54:09 2020 (r365539) @@ -144,6 +144,7 @@ ata_pccard_attach(device_t dev) err = ata_probe(dev); if (err > 0) return (err); + gone_in_dev(dev, 13, "pccard removed"); return (ata_attach(dev)); } Modified: stable/12/sys/dev/cmx/cmx_pccard.c ============================================================================== --- stable/12/sys/dev/cmx/cmx_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/cmx/cmx_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -95,7 +95,7 @@ cmx_pccard_attach(device_t dev) return rv; } - device_printf(dev, "attached\n"); + gone_in_dev(dev, 13, "pccard removed"); return 0; } Modified: stable/12/sys/dev/fdc/fdc_pccard.c ============================================================================== --- stable/12/sys/dev/fdc/fdc_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/fdc/fdc_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -111,9 +111,10 @@ fdc_pccard_attach(device_t dev) device_set_flags(child, 0x24); error = bus_generic_attach(dev); } - if (error == 0) + if (error == 0) { + gone_in_dev(dev, 13, "pccard removed"); fdc_start_worker(dev); - else + } else fdc_release_resources(fdc); return (error); } Modified: stable/12/sys/dev/if_ndis/if_ndis_pccard.c ============================================================================== --- stable/12/sys/dev/if_ndis/if_ndis_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/if_ndis/if_ndis_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -303,6 +303,8 @@ ndis_attach_pccard(dev) } error = ndis_attach(dev); + if (error == 0) + gone_in_dev(dev, 13, "pccard removed"); fail: return(error); Modified: stable/12/sys/dev/puc/puc_pccard.c ============================================================================== --- stable/12/sys/dev/puc/puc_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/puc/puc_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -73,10 +73,21 @@ puc_pccard_probe(device_t dev) return (ENXIO); } +static int +puc_pccard_attach(device_t dev) +{ + int error; + + error = puc_bfe_attach(dev); + if (error == 0) + gone_in_dev(dev, 13, "pccard removed"); + return (error); +} + static device_method_t puc_pccard_methods[] = { /* Device interface */ DEVMETHOD(device_probe, puc_pccard_probe), - DEVMETHOD(device_attach, puc_bfe_attach), + DEVMETHOD(device_attach, puc_pccard_attach), DEVMETHOD(device_detach, puc_bfe_detach), DEVMETHOD(bus_alloc_resource, puc_bus_alloc_resource), Modified: stable/12/sys/dev/uart/uart_bus_pccard.c ============================================================================== --- stable/12/sys/dev/uart/uart_bus_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/uart/uart_bus_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -98,6 +98,7 @@ uart_pccard_attach(device_t dev) error = uart_bus_probe(dev, 0, 0, 0, 0, 0, 0); if (error > 0) return (error); + gone_in_dev(dev, 13, "pccard removed"); return (uart_bus_attach(dev)); } Modified: stable/12/sys/dev/wi/if_wi_pccard.c ============================================================================== --- stable/12/sys/dev/wi/if_wi_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/wi/if_wi_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -200,6 +200,7 @@ wi_pccard_attach(device_t dev) error = wi_attach(dev); if (error != 0) wi_free(dev); + gone_in_dev(dev, 13, "pccard removed"); } return error; } Modified: stable/12/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c ============================================================================== --- stable/12/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -677,6 +677,8 @@ bt3c_pccard_attach(device_t dev) NG_NODE_SET_PRIVATE(sc->node, sc); + gone_in_dev(dev, 13, "pccard removed"); + return (0); bad: if (sc->ith != NULL) { From owner-svn-src-stable@freebsd.org Wed Sep 9 22:59:48 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 595C53E00B2; Wed, 9 Sep 2020 22:59:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmyC81mCBz43V9; Wed, 9 Sep 2020 22:59:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F7A68E6D; Wed, 9 Sep 2020 22:59:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089MxmcP039618; Wed, 9 Sep 2020 22:59:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089Mxldo039615; Wed, 9 Sep 2020 22:59:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092259.089Mxldo039615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365540 - in stable/12: . sbin/devd sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/12: . sbin/devd sys/kern X-SVN-Commit-Revision: 365540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:59:48 -0000 Author: imp Date: Wed Sep 9 22:59:47 2020 New Revision: 365540 URL: https://svnweb.freebsd.org/changeset/base/365540 Log: MFC r364725, r364726 r364725 | imp | 2020-08-24 13:35:15 -0600 (Mon, 24 Aug 2020) | 9 lines Change the resume notification event from 'kern' to 'kernel' We have both a system of 'kern' and of 'kernel'. Prefer the latter and convert this notification to use 'kernel' instead of 'kern'. As a transition period, continue to also generate the 'kern' notification until sometime after FreeBSD 13 is branched. r364726 | imp | 2020-08-24 13:35:27 -0600 (Mon, 24 Aug 2020) | 4 lines Document the kern -> kernel name change for resume events. Relnotes: YES Modified: stable/12/UPDATING stable/12/sbin/devd/devd.conf.5 stable/12/sys/kern/subr_bus.c Directory Properties: stable/12/ (props changed) Modified: stable/12/UPDATING ============================================================================== --- stable/12/UPDATING Wed Sep 9 22:54:09 2020 (r365539) +++ stable/12/UPDATING Wed Sep 9 22:59:47 2020 (r365540) @@ -16,6 +16,12 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200909: + The resume code now notifies devd with the 'kernel' system + rather than the old 'kern' subsystem to be consistent with + other use. The old notification will be created as well, but + will be removed prior to FreeBSD 14.0. + 20200722: Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have been upgraded to 10.0.1. Please see the 20141231 entry below for Modified: stable/12/sbin/devd/devd.conf.5 ============================================================================== --- stable/12/sbin/devd/devd.conf.5 Wed Sep 9 22:54:09 2020 (r365539) +++ stable/12/sbin/devd/devd.conf.5 Wed Sep 9 22:59:47 2020 (r365540) @@ -466,6 +466,8 @@ provider size has changed. .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li kern Ta Li power Ta Li resume Ta Notification that the system has woken from the suspended state. +Note: this notification is deprecated and will be removed in +.Fx 14.0 . .El .Pp .Pp @@ -473,6 +475,8 @@ Notification that the system has woken from the suspen .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li kernel Ta Li signal Ta Li coredump Ta Notification that a process has crashed and dumped core. +.It Li kernel Ta Li power Ta Li resume Ta +Notification that the system has woken from the suspended state. .El .Pp .Bl -column "System" "Subsystem" "1234567" -compact Modified: stable/12/sys/kern/subr_bus.c ============================================================================== --- stable/12/sys/kern/subr_bus.c Wed Sep 9 22:54:09 2020 (r365539) +++ stable/12/sys/kern/subr_bus.c Wed Sep 9 22:59:47 2020 (r365540) @@ -5024,8 +5024,10 @@ root_resume(device_t dev) int error; error = bus_generic_resume(dev); - if (error == 0) - devctl_notify("kern", "power", "resume", NULL); + if (error == 0) { + devctl_notify("kern", "power", "resume", NULL); /* Deprecated gone in 14 */ + devctl_notify("kernel", "power", "resume", NULL); + } return (error); } From owner-svn-src-stable@freebsd.org Wed Sep 9 23:01:55 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7FAA3E0291; Wed, 9 Sep 2020 23:01:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmyFb5Q5fz43gv; Wed, 9 Sep 2020 23:01:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D21F8CF5; Wed, 9 Sep 2020 23:01:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089N1tDA042353; Wed, 9 Sep 2020 23:01:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089N1tMi042352; Wed, 9 Sep 2020 23:01:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092301.089N1tMi042352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 23:01:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365541 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 365541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 23:01:55 -0000 Author: imp Date: Wed Sep 9 23:01:55 2020 New Revision: 365541 URL: https://svnweb.freebsd.org/changeset/base/365541 Log: MFC r364824: r364824 | imp | 2020-08-26 11:06:16 -0600 (Wed, 26 Aug 2020) | 8 lines Make sbuf_setpos match the implementation. sbuf_setpos can only be used to truncate the buffer, never to make it longer. Update the documentation to reflect this. Reviewed By: allanjude, phk Differential Revision: https://reviews.freebsd.org/D26198 Modified: stable/12/share/man/man9/sbuf.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/sbuf.9 ============================================================================== --- stable/12/share/man/man9/sbuf.9 Wed Sep 9 22:59:47 2020 (r365540) +++ stable/12/share/man/man9/sbuf.9 Wed Sep 9 23:01:55 2020 (r365541) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2018 +.Dd August 26, 2020 .Dt SBUF 9 .Os .Sh NAME @@ -348,9 +348,8 @@ function sets the .Fa sbuf Ns 's end position to .Fa pos , -which is a value between zero and one less than the size of the -storage buffer. -This effectively truncates the sbuf at the new position. +which is a value between zero and the current position in the buffer. +It can only truncate the sbuf to the new position. .Pp The .Fn sbuf_bcat From owner-svn-src-stable@freebsd.org Wed Sep 9 23:04:41 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A910D3E0504; Wed, 9 Sep 2020 23:04:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmyJn40Fnz44C2; Wed, 9 Sep 2020 23:04:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 678C2950A; Wed, 9 Sep 2020 23:04:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089N4fi6045963; Wed, 9 Sep 2020 23:04:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089N4eY3045960; Wed, 9 Sep 2020 23:04:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092304.089N4eY3045960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 23:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365542 - in stable/12: share/man/man4/man4.i386 sys/i386/bios X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/12: share/man/man4/man4.i386 sys/i386/bios X-SVN-Commit-Revision: 365542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 23:04:41 -0000 Author: imp Date: Wed Sep 9 23:04:40 2020 New Revision: 365542 URL: https://svnweb.freebsd.org/changeset/base/365542 Log: MFC: r365009 r365009 | imp | 2020-08-31 15:04:00 -0600 (Mon, 31 Aug 2020) | 10 lines Add deprecation notice for apm BIOS Add deprecation notice for apm bios, aka the apm(4) device. The apm(8) command will remain, at least for a while, since ACPI emulates the apm ioctl interface. Discussed on: arch@ Relnotes: yes MFC After: 3 days Modified: stable/12/share/man/man4/man4.i386/apm.4 stable/12/sys/i386/bios/apm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/man4.i386/apm.4 ============================================================================== --- stable/12/share/man/man4/man4.i386/apm.4 Wed Sep 9 23:01:55 2020 (r365541) +++ stable/12/share/man/man4/man4.i386/apm.4 Wed Sep 9 23:04:40 2020 (r365542) @@ -19,6 +19,9 @@ .Nd APM BIOS interface .Sh SYNOPSIS .Cd device apm +.Sh DEPRECATION NOTICE +This driver is scheduled for removal prior to the release of +.Fx 13.0 . .Sh DESCRIPTION .Nm is an interface to the Intel / Microsoft APM (Advanced Power Management) BIOS Modified: stable/12/sys/i386/bios/apm.c ============================================================================== --- stable/12/sys/i386/bios/apm.c Wed Sep 9 23:01:55 2020 (r365541) +++ stable/12/sys/i386/bios/apm.c Wed Sep 9 23:04:40 2020 (r365542) @@ -1214,6 +1214,8 @@ apm_attach(device_t dev) sc->sc_resume.ah_arg = sc; apm_hook_establish(APM_HOOK_RESUME, &sc->sc_resume); + gone_in_dev(dev, 13, "APM support has been removed."); + return 0; } From owner-svn-src-stable@freebsd.org Wed Sep 9 23:05:49 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C53C3DFBDC; Wed, 9 Sep 2020 23:05:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmyL51msrz44Cp; Wed, 9 Sep 2020 23:05:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 209BD91C3; Wed, 9 Sep 2020 23:05:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089N5nOj046080; Wed, 9 Sep 2020 23:05:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089N5lB3046072; Wed, 9 Sep 2020 23:05:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092305.089N5lB3046072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 23:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365543 - in stable/12/sys/dev: an wi X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/12/sys/dev: an wi X-SVN-Commit-Revision: 365543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 23:05:49 -0000 Author: imp Date: Wed Sep 9 23:05:47 2020 New Revision: 365543 URL: https://svnweb.freebsd.org/changeset/base/365543 Log: MFC r365015: r365015 | imp | 2020-08-31 17:31:16 -0600 (Mon, 31 Aug 2020) | 12 lines Warn for the non pccard attachments These devices have non-pccard attachments. Warn for those as well. Both an and wi don't do the modern cyrpto needed to use these cards on secure wifi networks. an needs firmware from Cisco, which I don't think was ever produced. wi could in theory do it with raw frames and on-host encryption, but nobody has written that in the 15 years since WEP was cracked. MFC After: 3 days Noticed by: rgrimes Differential Revision: https://reviews.freebsd.org/D26138 Modified: stable/12/sys/dev/an/if_an_isa.c stable/12/sys/dev/an/if_an_pccard.c stable/12/sys/dev/an/if_an_pci.c stable/12/sys/dev/wi/if_wi_macio.c stable/12/sys/dev/wi/if_wi_pccard.c stable/12/sys/dev/wi/if_wi_pci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/an/if_an_isa.c ============================================================================== --- stable/12/sys/dev/an/if_an_isa.c Wed Sep 9 23:04:40 2020 (r365542) +++ stable/12/sys/dev/an/if_an_isa.c Wed Sep 9 23:05:47 2020 (r365543) @@ -127,6 +127,7 @@ an_attach_isa(device_t dev) an_release_resources(dev); return (error); } + gone_in_dev(dev, 13, "pccard removed, an doesn't support modern crypto"); return (0); } Modified: stable/12/sys/dev/an/if_an_pccard.c ============================================================================== --- stable/12/sys/dev/an/if_an_pccard.c Wed Sep 9 23:04:40 2020 (r365542) +++ stable/12/sys/dev/an/if_an_pccard.c Wed Sep 9 23:05:47 2020 (r365543) @@ -157,6 +157,6 @@ fail: if (error) an_release_resources(dev); else - gone_in_dev(dev, 13, "pccard removed"); + gone_in_dev(dev, 13, "pccard removed, an doesn't support modern crypto"); return (error); } Modified: stable/12/sys/dev/an/if_an_pci.c ============================================================================== --- stable/12/sys/dev/an/if_an_pci.c Wed Sep 9 23:04:40 2020 (r365542) +++ stable/12/sys/dev/an/if_an_pci.c Wed Sep 9 23:05:47 2020 (r365543) @@ -230,7 +230,8 @@ an_attach_pci(dev) NULL, an_intr, sc, &sc->irq_handle); if (error) device_printf(dev, "couldn't setup interrupt\n"); - + else + gone_in_dev(dev, 13, "pccard removed, an doesn't support modern crypto"); fail: if (error) an_release_resources(dev); Modified: stable/12/sys/dev/wi/if_wi_macio.c ============================================================================== --- stable/12/sys/dev/wi/if_wi_macio.c Wed Sep 9 23:04:40 2020 (r365542) +++ stable/12/sys/dev/wi/if_wi_macio.c Wed Sep 9 23:05:47 2020 (r365543) @@ -142,6 +142,8 @@ wi_macio_attach(device_t dev) error = wi_attach(dev); if (error != 0) wi_free(dev); + else + gone_in_dev(dev, 13, "pccard removed, wi doesn't support modern crypto"); } return error; } Modified: stable/12/sys/dev/wi/if_wi_pccard.c ============================================================================== --- stable/12/sys/dev/wi/if_wi_pccard.c Wed Sep 9 23:04:40 2020 (r365542) +++ stable/12/sys/dev/wi/if_wi_pccard.c Wed Sep 9 23:05:47 2020 (r365543) @@ -200,7 +200,7 @@ wi_pccard_attach(device_t dev) error = wi_attach(dev); if (error != 0) wi_free(dev); - gone_in_dev(dev, 13, "pccard removed"); + gone_in_dev(dev, 13, "pccard removed, wi doesn't support modern crypto"); } return error; } Modified: stable/12/sys/dev/wi/if_wi_pci.c ============================================================================== --- stable/12/sys/dev/wi/if_wi_pci.c Wed Sep 9 23:04:40 2020 (r365542) +++ stable/12/sys/dev/wi/if_wi_pci.c Wed Sep 9 23:05:47 2020 (r365543) @@ -233,6 +233,8 @@ wi_pci_attach(device_t dev) error = wi_attach(dev); if (error != 0) wi_free(dev); + else + gone_in_dev(dev, 13, "pccard removed, wi doesn't support modern crypto"); return (error); } From owner-svn-src-stable@freebsd.org Wed Sep 9 23:06:36 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A53C73E03CC; Wed, 9 Sep 2020 23:06:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmyM03vT2z44V3; Wed, 9 Sep 2020 23:06:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 690B693A3; Wed, 9 Sep 2020 23:06:36 +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 089N6aBD046172; Wed, 9 Sep 2020 23:06:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089N6aNA046171; Wed, 9 Sep 2020 23:06:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092306.089N6aNA046171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 23:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365544 - stable/12/sbin/devd X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/sbin/devd X-SVN-Commit-Revision: 365544 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 23:06:36 -0000 Author: imp Date: Wed Sep 9 23:06:35 2020 New Revision: 365544 URL: https://svnweb.freebsd.org/changeset/base/365544 Log: MFC r365016 | imp | 2020-08-31 17:48:23 -0600 (Mon, 31 Aug 2020) | 2 lines Add documentation for ETHERNET events. Modified: stable/12/sbin/devd/devd.conf.5 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/devd/devd.conf.5 ============================================================================== --- stable/12/sbin/devd/devd.conf.5 Wed Sep 9 23:05:47 2020 (r365543) +++ stable/12/sbin/devd/devd.conf.5 Wed Sep 9 23:06:35 2020 (r365544) @@ -433,6 +433,14 @@ node is destroyed. .Pp .Bl -column "System" "Subsystem" "1234567" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li ETHERNET Ta Ar inet Ta IFATTACH Ta +Notification when the default VNET instance of the +.Ar inet +interface is attached. +.El +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li GEOM Ta Ta Ta Events related to the .Xr geom 4 From owner-svn-src-stable@freebsd.org Wed Sep 9 23:11:55 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3C223E026E; Wed, 9 Sep 2020 23:11:55 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmyT74PgXz44Y8; Wed, 9 Sep 2020 23:11:55 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B9C79781; Wed, 9 Sep 2020 23:11:55 +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 089NBtQr051286; Wed, 9 Sep 2020 23:11:55 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089NBtjr051285; Wed, 9 Sep 2020 23:11:55 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202009092311.089NBtjr051285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 9 Sep 2020 23:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365545 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 365545 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 23:11:55 -0000 Author: brooks Date: Wed Sep 9 23:11:55 2020 New Revision: 365545 URL: https://svnweb.freebsd.org/changeset/base/365545 Log: MFC r365284: Always report ENOSYS in init While rare, encountering an unimplemented system call early in init is catastrophic and difficult to debug. Even after a SIGSYS handler is registered, such configurations are problematic. As such, always report such events for pid 1 (following kern.lognosys if non-zero). Reviewed by: kevans, imp Obtained from: CheriBSD (plus suggestions from kevans) Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26288 Modified: stable/12/sys/kern/kern_sig.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_sig.c ============================================================================== --- stable/12/sys/kern/kern_sig.c Wed Sep 9 23:06:35 2020 (r365544) +++ stable/12/sys/kern/kern_sig.c Wed Sep 9 23:11:55 2020 (r365545) @@ -3760,7 +3760,8 @@ nosys(struct thread *td, struct nosys_args *args) uprintf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm, td->td_sa.code); } - if (kern_lognosys == 2 || kern_lognosys == 3) { + if (kern_lognosys == 2 || kern_lognosys == 3 || + (p->p_pid == 1 && (kern_lognosys & 3) == 0)) { printf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm, td->td_sa.code); } From owner-svn-src-stable@freebsd.org Thu Sep 10 04:17:05 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3E983E9E45; Thu, 10 Sep 2020 04:17:05 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bn5FF4qqTz4QjT; Thu, 10 Sep 2020 04:17:05 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89092D10A; Thu, 10 Sep 2020 04:17:05 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08A4H5TJ038020; Thu, 10 Sep 2020 04:17:05 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A4H5oS038019; Thu, 10 Sep 2020 04:17:05 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009100417.08A4H5oS038019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 10 Sep 2020 04:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365551 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 365551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 04:17:05 -0000 Author: lwhsu Date: Thu Sep 10 04:17:05 2020 New Revision: 365551 URL: https://svnweb.freebsd.org/changeset/base/365551 Log: MFC r365403: Slightly improve usb(4) - Mention USB 3.0 - Update links - Fix `mandoc -T lint` warnings Reviewed by: bcr, hselasky Differential Revision: https://reviews.freebsd.org/D26349 Modified: stable/12/share/man/man4/usb.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/usb.4 ============================================================================== --- stable/12/share/man/man4/usb.4 Thu Sep 10 04:00:13 2020 (r365550) +++ stable/12/share/man/man4/usb.4 Thu Sep 10 04:17:05 2020 (r365551) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2018 +.Dd September 7, 2020 .Dt USB 4 .Os .Sh NAME @@ -52,8 +52,7 @@ for more information. .Sh DESCRIPTION .Fx provides machine-independent bus support and drivers for -.Tn USB -devices in host and device side mode. +USB devices in host and device side mode. .Pp The .Nm @@ -67,32 +66,25 @@ driver has three layers: The controller attaches to a physical bus like .Xr pci 4 . -The -.Tn USB -bus attaches to the controller, and the root hub attaches +The USB bus attaches to the controller, and the root hub attaches to the controller. Any devices attached to the bus will attach to the root hub -or another hub attached to the -.Tn USB -bus. +or another hub attached to the USB bus. .Pp The .Nm uhub device will always be present as it is needed for the root hub. .Sh INTRODUCTION TO USB -The -.Tn USB -is a system where external devices can be connected to a PC. +The USB is a system where external devices can be connected to a PC. The most common USB speeds are: .Bl -tag -width 6n -offset indent -.It Low Speed (1.5MBit/sec) -.It Full Speed (12MBit/sec) -.It High Speed (480MBit/sec) +.It Low Speed (1.5 MBit/sec) +.It Full Speed (12 MBit/sec) +.It High Speed (480 MBit/sec) +.It SuperSpeed (5 GBit/sec) .El .Pp -Each -.Tn USB -has a USB controller that is the master of the bus. +Each USB has a USB controller that is the master of the bus. The physical communication is simplex which means the host controller only communicates with one USB device at a time. .Pp @@ -122,9 +114,7 @@ A device may operate in different configurations. Depending on the configuration, the device may present different sets of endpoints and interfaces. .Pp -The bus enumeration of the -.Tn USB -bus proceeds in several steps: +The bus enumeration of the USB bus proceeds in several steps: .Bl -enum .It Any interface specific driver can attach to the device. @@ -143,11 +133,9 @@ Debug output level, where 0 is debugging disabled and debug message verbosity. Default is 0. .Sh SEE ALSO -The -.Tn USB -specifications can be found at: +The USB specifications can be found at: .Pp -.D1 Pa http://www.usb.org/developers/docs/ +.D1 Pa https://www.usb.org/documents .Pp .Xr libusb 3 , .Xr aue 4 , @@ -177,7 +165,7 @@ specifications can be found at: .Sh STANDARDS The .Nm -module complies with the USB 2.0 standard. +module complies with the USB 3.0 standard. .Sh HISTORY The .Nm From owner-svn-src-stable@freebsd.org Thu Sep 10 04:17:23 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECA113E9C62; Thu, 10 Sep 2020 04:17:23 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bn5Fb646Sz4QpN; Thu, 10 Sep 2020 04:17:23 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2730CFB6; Thu, 10 Sep 2020 04:17:23 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08A4HNHp038079; Thu, 10 Sep 2020 04:17:23 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A4HNw4038078; Thu, 10 Sep 2020 04:17:23 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009100417.08A4HNw4038078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 10 Sep 2020 04:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365552 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 365552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 04:17:24 -0000 Author: lwhsu Date: Thu Sep 10 04:17:23 2020 New Revision: 365552 URL: https://svnweb.freebsd.org/changeset/base/365552 Log: MFC r365403: Slightly improve usb(4) - Mention USB 3.0 - Update links - Fix `mandoc -T lint` warnings Reviewed by: bcr, hselasky Differential Revision: https://reviews.freebsd.org/D26349 Modified: stable/11/share/man/man4/usb.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/usb.4 ============================================================================== --- stable/11/share/man/man4/usb.4 Thu Sep 10 04:17:05 2020 (r365551) +++ stable/11/share/man/man4/usb.4 Thu Sep 10 04:17:23 2020 (r365552) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2017 +.Dd September 7, 2020 .Dt USB 4 .Os .Sh NAME @@ -52,8 +52,7 @@ for more information. .Sh DESCRIPTION .Fx provides machine-independent bus support and drivers for -.Tn USB -devices in host and device side mode. +USB devices in host and device side mode. .Pp The .Nm @@ -67,32 +66,25 @@ driver has three layers: The controller attaches to a physical bus like .Xr pci 4 . -The -.Tn USB -bus attaches to the controller, and the root hub attaches +The USB bus attaches to the controller, and the root hub attaches to the controller. Any devices attached to the bus will attach to the root hub -or another hub attached to the -.Tn USB -bus. +or another hub attached to the USB bus. .Pp The .Nm uhub device will always be present as it is needed for the root hub. .Sh INTRODUCTION TO USB -The -.Tn USB -is a system where external devices can be connected to a PC. +The USB is a system where external devices can be connected to a PC. The most common USB speeds are: .Bl -tag -width 6n -offset indent -.It Low Speed (1.5MBit/sec) -.It Full Speed (12MBit/sec) -.It High Speed (480MBit/sec) +.It Low Speed (1.5 MBit/sec) +.It Full Speed (12 MBit/sec) +.It High Speed (480 MBit/sec) +.It SuperSpeed (5 GBit/sec) .El .Pp -Each -.Tn USB -has a USB controller that is the master of the bus. +Each USB has a USB controller that is the master of the bus. The physical communication is simplex which means the host controller only communicates with one USB device at a time. .Pp @@ -122,9 +114,7 @@ A device may operate in different configurations. Depending on the configuration, the device may present different sets of endpoints and interfaces. .Pp -The bus enumeration of the -.Tn USB -bus proceeds in several steps: +The bus enumeration of the USB bus proceeds in several steps: .Bl -enum .It Any interface specific driver can attach to the device. @@ -132,11 +122,9 @@ Any interface specific driver can attach to the device If none is found, generic interface class drivers can attach. .El .Sh SEE ALSO -The -.Tn USB -specifications can be found at: +The USB specifications can be found at: .Pp -.D1 Pa http://www.usb.org/developers/docs/ +.D1 Pa https://www.usb.org/documents .Pp .Xr libusb 3 , .Xr aue 4 , @@ -166,7 +154,7 @@ specifications can be found at: .Sh STANDARDS The .Nm -module complies with the USB 2.0 standard. +module complies with the USB 3.0 standard. .Sh HISTORY The .Nm From owner-svn-src-stable@freebsd.org Thu Sep 10 09:02:00 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AA663EF37C; Thu, 10 Sep 2020 09:02:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnCYz6bNyz4gDG; Thu, 10 Sep 2020 09:01:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C57FA10710; Thu, 10 Sep 2020 09:01:59 +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 08A91xbN014011; Thu, 10 Sep 2020 09:01:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A91xtl014010; Thu, 10 Sep 2020 09:01:59 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009100901.08A91xtl014010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 10 Sep 2020 09:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365555 - stable/12/sys/dev/iicbus/twsi X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/iicbus/twsi X-SVN-Commit-Revision: 365555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 09:02:00 -0000 Author: avg Date: Thu Sep 10 09:01:59 2020 New Revision: 365555 URL: https://svnweb.freebsd.org/changeset/base/365555 Log: MFC r365289: twsi: no need to compare boolean with boolean constant Modified: stable/12/sys/dev/iicbus/twsi/twsi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/iicbus/twsi/twsi.c ============================================================================== --- stable/12/sys/dev/iicbus/twsi/twsi.c Thu Sep 10 07:05:31 2020 (r365554) +++ stable/12/sys/dev/iicbus/twsi/twsi.c Thu Sep 10 09:01:59 2020 (r365555) @@ -484,7 +484,7 @@ twsi_transfer(device_t dev, struct iic_msg *msgs, uint sc = device_get_softc(dev); - if (sc->have_intr == false) + if (!sc->have_intr) return (iicbus_transfer_gen(dev, msgs, nmsgs)); sc->error = 0; From owner-svn-src-stable@freebsd.org Thu Sep 10 09:10:34 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06F803EF965; Thu, 10 Sep 2020 09:10:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnCls6S1Lz3SCJ; Thu, 10 Sep 2020 09:10:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0C7310887; Thu, 10 Sep 2020 09:10:33 +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 08A9AXB4015475; Thu, 10 Sep 2020 09:10:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A9AXxS015474; Thu, 10 Sep 2020 09:10:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009100910.08A9AXxS015474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 10 Sep 2020 09:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365556 - stable/12/sys/dev/iicbus/twsi X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/iicbus/twsi X-SVN-Commit-Revision: 365556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 09:10:34 -0000 Author: avg Date: Thu Sep 10 09:10:33 2020 New Revision: 365556 URL: https://svnweb.freebsd.org/changeset/base/365556 Log: MFC r365288: twsi: replace a couple of errno codes with i2c error codes Modified: stable/12/sys/dev/iicbus/twsi/twsi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/iicbus/twsi/twsi.c ============================================================================== --- stable/12/sys/dev/iicbus/twsi/twsi.c Thu Sep 10 09:01:59 2020 (r365555) +++ stable/12/sys/dev/iicbus/twsi/twsi.c Thu Sep 10 09:10:33 2020 (r365556) @@ -573,7 +573,7 @@ twsi_intr(void *arg) case TWSI_STATUS_ADDR_R_NACK: debugf(sc->dev, "No ack received after transmitting the address\n"); sc->transfer = 0; - sc->error = ETIMEDOUT; + sc->error = IIC_ENOACK; sc->control_val = 0; wakeup(sc); break; @@ -642,7 +642,7 @@ twsi_intr(void *arg) default: debugf(sc->dev, "status=%x hot handled\n", status); sc->transfer = 0; - sc->error = ENXIO; + sc->error = IIC_EBUSERR; sc->control_val = 0; wakeup(sc); break; From owner-svn-src-stable@freebsd.org Thu Sep 10 10:50:01 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD3883D215C; Thu, 10 Sep 2020 10:50:01 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnFyd5tyvz3YyS; Thu, 10 Sep 2020 10:50:01 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD96A11AA4; Thu, 10 Sep 2020 10:50:01 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AAo1Nk077610; Thu, 10 Sep 2020 10:50:01 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AAnx2F077560; Thu, 10 Sep 2020 10:49:59 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202009101049.08AAnx2F077560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Thu, 10 Sep 2020 10:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365560 - in stable/12/sys: amd64/amd64 amd64/include amd64/vmm amd64/vmm/intel i386/i386 x86/include X-SVN-Group: stable-12 X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 amd64/include amd64/vmm amd64/vmm/intel i386/i386 x86/include X-SVN-Commit-Revision: 365560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 10:50:01 -0000 Author: grehan Date: Thu Sep 10 10:49:59 2020 New Revision: 365560 URL: https://svnweb.freebsd.org/changeset/base/365560 Log: MFC r364340, r364343, r364656 r364340 Support guest rdtscp and rdpid instructions on Intel VT-x Follow-on commits: r364343 Export a routine to provide the TSC_AUX MSR value and use this in vmm r364656 assert caller is preventing CPU migration Submitted by: adam_fenn.io Differential Revision: https://reviews.freebsd.org/D26003 Modified: stable/12/sys/amd64/amd64/initcpu.c stable/12/sys/amd64/include/vmm.h stable/12/sys/amd64/vmm/intel/vmx.c stable/12/sys/amd64/vmm/intel/vmx.h stable/12/sys/amd64/vmm/intel/vmx_msr.c stable/12/sys/amd64/vmm/intel/vmx_msr.h stable/12/sys/amd64/vmm/x86.c stable/12/sys/i386/i386/initcpu.c stable/12/sys/x86/include/x86_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/12/sys/amd64/amd64/initcpu.c Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/amd64/amd64/initcpu.c Thu Sep 10 10:49:59 2020 (r365560) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -218,6 +219,18 @@ init_via(void) } /* + * The value for the TSC_AUX MSR and rdtscp/rdpid on the invoking CPU. + * + * Caller should prevent CPU migration. + */ +u_int +cpu_auxmsr(void) +{ + KASSERT((read_rflags() & PSL_I) == 0, ("context switch possible")); + return (PCPU_GET(cpuid)); +} + +/* * Initialize CPU control registers */ void @@ -283,7 +296,7 @@ initializecpu(void) if ((amd_feature & AMDID_RDTSCP) != 0 || (cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0) - wrmsr(MSR_TSC_AUX, PCPU_GET(cpuid)); + wrmsr(MSR_TSC_AUX, cpu_auxmsr()); } void Modified: stable/12/sys/amd64/include/vmm.h ============================================================================== --- stable/12/sys/amd64/include/vmm.h Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/amd64/include/vmm.h Thu Sep 10 10:49:59 2020 (r365560) @@ -436,6 +436,8 @@ enum vm_cap_type { VM_CAP_UNRESTRICTED_GUEST, VM_CAP_ENABLE_INVPCID, VM_CAP_BPT_EXIT, + VM_CAP_RDPID, + VM_CAP_RDTSCP, VM_CAP_MAX }; Modified: stable/12/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx.c Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/amd64/vmm/intel/vmx.c Thu Sep 10 10:49:59 2020 (r365560) @@ -160,6 +160,14 @@ static int cap_pause_exit; SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, pause_exit, CTLFLAG_RD, &cap_pause_exit, 0, "PAUSE triggers a VM-exit"); +static int cap_rdpid; +SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, rdpid, CTLFLAG_RD, &cap_rdpid, 0, + "Guests are allowed to use RDPID"); + +static int cap_rdtscp; +SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, rdtscp, CTLFLAG_RD, &cap_rdtscp, 0, + "Guests are allowed to use RDTSCP"); + static int cap_unrestricted_guest; SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, unrestricted_guest, CTLFLAG_RD, &cap_unrestricted_guest, 0, "Unrestricted guests"); @@ -293,6 +301,18 @@ static int vmx_getreg(void *arg, int vcpu, int reg, ui static int vmxctx_setreg(struct vmxctx *vmxctx, int reg, uint64_t val); static void vmx_inject_pir(struct vlapic *vlapic); +static inline bool +host_has_rdpid(void) +{ + return ((cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0); +} + +static inline bool +host_has_rdtscp(void) +{ + return ((amd_feature & AMDID_RDTSCP) != 0); +} + #ifdef KTR static const char * exit_reason_to_str(int reason) @@ -745,6 +765,43 @@ vmx_init(int ipinum) PROCBASED_PAUSE_EXITING, 0, &tmp) == 0); + /* + * Check support for RDPID and/or RDTSCP. + * + * Support a pass-through-based implementation of these via the + * "enable RDTSCP" VM-execution control and the "RDTSC exiting" + * VM-execution control. + * + * The "enable RDTSCP" VM-execution control applies to both RDPID + * and RDTSCP (see SDM volume 3, section 25.3, "Changes to + * Instruction Behavior in VMX Non-root operation"); this is why + * only this VM-execution control needs to be enabled in order to + * enable passing through whichever of RDPID and/or RDTSCP are + * supported by the host. + * + * The "RDTSC exiting" VM-execution control applies to both RDTSC + * and RDTSCP (again, per SDM volume 3, section 25.3), and is + * already set up for RDTSC and RDTSCP pass-through by the current + * implementation of RDTSC. + * + * Although RDPID and RDTSCP are optional capabilities, since there + * does not currently seem to be a use case for enabling/disabling + * these via libvmmapi, choose not to support this and, instead, + * just statically always enable or always disable this support + * across all vCPUs on all VMs. (Note that there may be some + * complications to providing this functionality, e.g., the MSR + * bitmap is currently per-VM rather than per-vCPU while the + * capability API wants to be able to control capabilities on a + * per-vCPU basis). + */ + error = vmx_set_ctlreg(MSR_VMX_PROCBASED_CTLS2, + MSR_VMX_PROCBASED_CTLS2, + PROCBASED2_ENABLE_RDTSCP, 0, &tmp); + cap_rdpid = error == 0 && host_has_rdpid(); + cap_rdtscp = error == 0 && host_has_rdtscp(); + if (cap_rdpid || cap_rdtscp) + procbased_ctls2 |= PROCBASED2_ENABLE_RDTSCP; + cap_unrestricted_guest = (vmx_set_ctlreg(MSR_VMX_PROCBASED_CTLS2, MSR_VMX_PROCBASED_CTLS2, PROCBASED2_UNRESTRICTED_GUEST, 0, @@ -997,6 +1054,15 @@ vmx_vminit(struct vm *vm, pmap_t pmap) * the "use TSC offsetting" execution control is enabled and the * difference between the host TSC and the guest TSC is written * into the TSC offset in the VMCS. + * + * Guest TSC_AUX support is enabled if any of guest RDPID and/or + * guest RDTSCP support are enabled (since, as per Table 2-2 in SDM + * volume 4, TSC_AUX is supported if any of RDPID and/or RDTSCP are + * supported). If guest TSC_AUX support is enabled, TSC_AUX is + * exposed read-only so that the VMM can do one fewer MSR read per + * exit than if this register were exposed read-write; the guest + * restore value can be updated during guest writes (expected to be + * rare) instead of during all exits (common). */ if (guest_msr_rw(vmx, MSR_GSBASE) || guest_msr_rw(vmx, MSR_FSBASE) || @@ -1004,7 +1070,8 @@ vmx_vminit(struct vm *vm, pmap_t pmap) guest_msr_rw(vmx, MSR_SYSENTER_ESP_MSR) || guest_msr_rw(vmx, MSR_SYSENTER_EIP_MSR) || guest_msr_rw(vmx, MSR_EFER) || - guest_msr_ro(vmx, MSR_TSC)) + guest_msr_ro(vmx, MSR_TSC) || + ((cap_rdpid || cap_rdtscp) && guest_msr_ro(vmx, MSR_TSC_AUX))) panic("vmx_vminit: error setting guest msr access"); vpid_alloc(vpid, VM_MAXCPU); @@ -1083,6 +1150,8 @@ vmx_vminit(struct vm *vm, pmap_t pmap) KASSERT(error == 0, ("vmx_vminit: error customizing the vmcs")); vmx->cap[i].set = 0; + vmx->cap[i].set |= cap_rdpid != 0 ? 1 << VM_CAP_RDPID : 0; + vmx->cap[i].set |= cap_rdtscp != 0 ? 1 << VM_CAP_RDTSCP : 0; vmx->cap[i].proc_ctls = procbased_ctls; vmx->cap[i].proc_ctls2 = procbased_ctls2; vmx->cap[i].exc_bitmap = exc_bitmap; @@ -2989,11 +3058,30 @@ vmx_run(void *arg, int vcpu, register_t rip, pmap_t pm sidt(&idtr); ldt_sel = sldt(); + /* + * The TSC_AUX MSR must be saved/restored while interrupts + * are disabled so that it is not possible for the guest + * TSC_AUX MSR value to be overwritten by the resume + * portion of the IPI_SUSPEND codepath. This is why the + * transition of this MSR is handled separately from those + * handled by vmx_msr_guest_{enter,exit}(), which are ok to + * be transitioned with preemption disabled but interrupts + * enabled. + * + * These vmx_msr_guest_{enter,exit}_tsc_aux() calls can be + * anywhere in this loop so long as they happen with + * interrupts disabled. This location is chosen for + * simplicity. + */ + vmx_msr_guest_enter_tsc_aux(vmx, vcpu); + vmx_run_trace(vmx, vcpu); vmx_dr_enter_guest(vmxctx); rc = vmx_enter_guest(vmxctx, vmx, launched); vmx_dr_leave_guest(vmxctx); + vmx_msr_guest_exit_tsc_aux(vmx, vcpu); + bare_lgdt(&gdtr); lidt(&idtr); lldt(ldt_sel); @@ -3331,6 +3419,14 @@ vmx_getcap(void *arg, int vcpu, int type, int *retval) if (cap_monitor_trap) ret = 0; break; + case VM_CAP_RDPID: + if (cap_rdpid) + ret = 0; + break; + case VM_CAP_RDTSCP: + if (cap_rdtscp) + ret = 0; + break; case VM_CAP_UNRESTRICTED_GUEST: if (cap_unrestricted_guest) ret = 0; @@ -3394,6 +3490,17 @@ vmx_setcap(void *arg, int vcpu, int type, int val) flag = PROCBASED_PAUSE_EXITING; reg = VMCS_PRI_PROC_BASED_CTLS; } + break; + case VM_CAP_RDPID: + case VM_CAP_RDTSCP: + if (cap_rdpid || cap_rdtscp) + /* + * Choose not to support enabling/disabling + * RDPID/RDTSCP via libvmmapi since, as per the + * discussion in vmx_init(), RDPID/RDTSCP are + * either always enabled or always disabled. + */ + error = EOPNOTSUPP; break; case VM_CAP_UNRESTRICTED_GUEST: if (cap_unrestricted_guest) { Modified: stable/12/sys/amd64/vmm/intel/vmx.h ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx.h Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/amd64/vmm/intel/vmx.h Thu Sep 10 10:49:59 2020 (r365560) @@ -117,6 +117,7 @@ enum { IDX_MSR_SF_MASK, IDX_MSR_KGSBASE, IDX_MSR_PAT, + IDX_MSR_TSC_AUX, GUEST_MSR_NUM /* must be the last enumeration */ }; @@ -152,5 +153,19 @@ int vmx_set_tsc_offset(struct vmx *vmx, int vcpu, uint extern char vmx_exit_guest[]; extern char vmx_exit_guest_flush_rsb[]; + +static inline bool +vmx_have_msr_tsc_aux(struct vmx *vmx) +{ + int rdpid_rdtscp_bits = ((1 << VM_CAP_RDPID) | (1 << VM_CAP_RDTSCP)); + + /* + * Since the values of these bits are uniform across all vCPUs + * (see discussion in vmx_init() and initialization of these bits + * in vmx_vminit()), just always use vCPU-zero's capability set and + * remove the need to require a vcpuid argument. + */ + return ((vmx->cap[0].set & rdpid_rdtscp_bits) != 0); +} #endif Modified: stable/12/sys/amd64/vmm/intel/vmx_msr.c ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx_msr.c Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/amd64/vmm/intel/vmx_msr.c Thu Sep 10 10:49:59 2020 (r365560) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include "vmx.h" #include "vmx_msr.h" +#include "x86.h" static bool vmx_ctl_allows_one_setting(uint64_t msr_val, int bitpos) @@ -361,6 +362,16 @@ vmx_msr_guest_enter(struct vmx *vmx, int vcpuid) } void +vmx_msr_guest_enter_tsc_aux(struct vmx *vmx, int vcpuid) +{ + uint64_t guest_tsc_aux = vmx->guest_msrs[vcpuid][IDX_MSR_TSC_AUX]; + uint32_t host_aux = cpu_auxmsr(); + + if (vmx_have_msr_tsc_aux(vmx) && guest_tsc_aux != host_aux) + wrmsr(MSR_TSC_AUX, guest_tsc_aux); +} + +void vmx_msr_guest_exit(struct vmx *vmx, int vcpuid) { uint64_t *guest_msrs = vmx->guest_msrs[vcpuid]; @@ -381,6 +392,23 @@ vmx_msr_guest_exit(struct vmx *vmx, int vcpuid) /* MSR_KGSBASE will be restored on the way back to userspace */ } +void +vmx_msr_guest_exit_tsc_aux(struct vmx *vmx, int vcpuid) +{ + uint64_t guest_tsc_aux = vmx->guest_msrs[vcpuid][IDX_MSR_TSC_AUX]; + uint32_t host_aux = cpu_auxmsr(); + + if (vmx_have_msr_tsc_aux(vmx) && guest_tsc_aux != host_aux) + /* + * Note that it is not necessary to save the guest value + * here; vmx->guest_msrs[vcpuid][IDX_MSR_TSC_AUX] always + * contains the current value since it is updated whenever + * the guest writes to it (which is expected to be very + * rare). + */ + wrmsr(MSR_TSC_AUX, host_aux); +} + int vmx_rdmsr(struct vmx *vmx, int vcpuid, u_int num, uint64_t *val, bool *retu) { @@ -472,6 +500,17 @@ vmx_wrmsr(struct vmx *vmx, int vcpuid, u_int num, uint break; case MSR_TSC: error = vmx_set_tsc_offset(vmx, vcpuid, val - rdtsc()); + break; + case MSR_TSC_AUX: + if (vmx_have_msr_tsc_aux(vmx)) + /* + * vmx_msr_guest_enter_tsc_aux() will apply this + * value when it is called immediately before guest + * entry. + */ + guest_msrs[IDX_MSR_TSC_AUX] = val; + else + vm_inject_gp(vmx->vm, vcpuid); break; default: error = EINVAL; Modified: stable/12/sys/amd64/vmm/intel/vmx_msr.h ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx_msr.h Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/amd64/vmm/intel/vmx_msr.h Thu Sep 10 10:49:59 2020 (r365560) @@ -35,8 +35,10 @@ struct vmx; void vmx_msr_init(void); void vmx_msr_guest_init(struct vmx *vmx, int vcpuid); +void vmx_msr_guest_enter_tsc_aux(struct vmx *vmx, int vcpuid); void vmx_msr_guest_enter(struct vmx *vmx, int vcpuid); void vmx_msr_guest_exit(struct vmx *vmx, int vcpuid); +void vmx_msr_guest_exit_tsc_aux(struct vmx *vmx, int vcpuid); int vmx_rdmsr(struct vmx *, int vcpuid, u_int num, uint64_t *val, bool *retu); int vmx_wrmsr(struct vmx *, int vcpuid, u_int num, uint64_t val, bool *retu); Modified: stable/12/sys/amd64/vmm/x86.c ============================================================================== --- stable/12/sys/amd64/vmm/x86.c Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/amd64/vmm/x86.c Thu Sep 10 10:49:59 2020 (r365560) @@ -91,7 +91,8 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, { const struct xsave_limits *limits; uint64_t cr4; - int error, enable_invpcid, level, width, x2apic_id; + int error, enable_invpcid, enable_rdpid, enable_rdtscp, level, + width, x2apic_id; unsigned int func, regs[4], logical_cpus; enum x2apic_state x2apic_state; uint16_t cores, maxcpus, sockets, threads; @@ -194,11 +195,13 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, /* Hide mwaitx/monitorx capability from the guest */ regs[2] &= ~AMDID2_MWAITX; - /* - * Hide rdtscp/ia32_tsc_aux until we know how - * to deal with them. - */ - regs[3] &= ~AMDID_RDTSCP; + /* Advertise RDTSCP if it is enabled. */ + error = vm_get_capability(vm, vcpu_id, + VM_CAP_RDTSCP, &enable_rdtscp); + if (error == 0 && enable_rdtscp) + regs[3] |= AMDID_RDTSCP; + else + regs[3] &= ~AMDID_RDTSCP; break; case CPUID_8000_0007: @@ -441,6 +444,12 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, CPUID_STDEXT_AVX512CD | CPUID_STDEXT_SHA); regs[2] = 0; regs[3] &= CPUID_STDEXT3_MD_CLEAR; + + /* Advertise RDPID if it is enabled. */ + error = vm_get_capability(vm, vcpu_id, + VM_CAP_RDPID, &enable_rdpid); + if (error == 0 && enable_rdpid) + regs[2] |= CPUID_STDEXT2_RDPID; /* Advertise INVPCID if it is enabled. */ error = vm_get_capability(vm, vcpu_id, Modified: stable/12/sys/i386/i386/initcpu.c ============================================================================== --- stable/12/sys/i386/i386/initcpu.c Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/i386/i386/initcpu.c Thu Sep 10 10:49:59 2020 (r365560) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -627,6 +628,18 @@ init_transmeta(void) } #endif +/* + * The value for the TSC_AUX MSR and rdtscp/rdpid on the invoking CPU. + * + * Caller should prevent CPU migration. + */ +u_int +cpu_auxmsr(void) +{ + KASSERT((read_eflags() & PSL_I) == 0, ("context switch possible")); + return (PCPU_GET(cpuid)); +} + extern int elf32_nxstack; void @@ -756,7 +769,7 @@ initializecpu(void) #endif if ((amd_feature & AMDID_RDTSCP) != 0 || (cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0) - wrmsr(MSR_TSC_AUX, PCPU_GET(cpuid)); + wrmsr(MSR_TSC_AUX, cpu_auxmsr()); } void Modified: stable/12/sys/x86/include/x86_var.h ============================================================================== --- stable/12/sys/x86/include/x86_var.h Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/x86/include/x86_var.h Thu Sep 10 10:49:59 2020 (r365560) @@ -123,6 +123,7 @@ cpu_getmaxphyaddr(void) bool acpi_get_fadt_bootflags(uint16_t *flagsp); void *alloc_fpusave(int flags); void busdma_swi(void); +u_int cpu_auxmsr(void); bool cpu_mwait_usable(void); void cpu_probe_amdc1e(void); void cpu_setregs(void); From owner-svn-src-stable@freebsd.org Thu Sep 10 11:43:24 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C08E3D3414; Thu, 10 Sep 2020 11:43:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnH8D1gzrz3cfd; Thu, 10 Sep 2020 11:43:24 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D08612599; Thu, 10 Sep 2020 11:43:24 +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 08ABhNAY013736; Thu, 10 Sep 2020 11:43:23 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ABhN3r013735; Thu, 10 Sep 2020 11:43:23 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101143.08ABhN3r013735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 11:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365561 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 11:43:24 -0000 Author: tuexen Date: Thu Sep 10 11:43:23 2020 New Revision: 365561 URL: https://svnweb.freebsd.org/changeset/base/365561 Log: MFC r361750: Restrict enabling TCP-FASTOPEN to end-points in CLOSED or LISTEN state Enabling TCP-FASTOPEN on an end-point which is in a state other than CLOSED or LISTEN, is a bug in the application. So it should not work. Also the TCP code does not (and needs not to) handle this. While there, also simplify the setting of the TF_FASTOPEN flag. Modified: stable/12/sys/netinet/tcp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/12/sys/netinet/tcp_usrreq.c Thu Sep 10 10:49:59 2020 (r365560) +++ stable/12/sys/netinet/tcp_usrreq.c Thu Sep 10 11:43:23 2020 (r365561) @@ -2082,6 +2082,11 @@ unlock_and_done: return (error); INP_WLOCK_RECHECK(inp); + if ((tp->t_state != TCPS_CLOSED) && + (tp->t_state != TCPS_LISTEN)) { + error = EINVAL; + goto unlock_and_done; + } if (tfo_optval.enable) { if (tp->t_state == TCPS_LISTEN) { if (!V_tcp_fastopen_server_enable) { @@ -2089,7 +2094,6 @@ unlock_and_done: goto unlock_and_done; } - tp->t_flags |= TF_FASTOPEN; if (tp->t_tfo_pending == NULL) tp->t_tfo_pending = tcp_fastopen_alloc_counter(); @@ -2108,8 +2112,8 @@ unlock_and_done: tp->t_tfo_client_cookie_len = TCP_FASTOPEN_PSK_LEN; } - tp->t_flags |= TF_FASTOPEN; } + tp->t_flags |= TF_FASTOPEN; } else tp->t_flags &= ~TF_FASTOPEN; goto unlock_and_done; From owner-svn-src-stable@freebsd.org Thu Sep 10 11:45:03 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C62473D3467; Thu, 10 Sep 2020 11:45:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnHB74rLQz3cJd; Thu, 10 Sep 2020 11:45:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88E2A124B5; Thu, 10 Sep 2020 11:45:03 +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 08ABj38l013892; Thu, 10 Sep 2020 11:45:03 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ABj3kI013891; Thu, 10 Sep 2020 11:45:03 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101145.08ABj3kI013891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 11:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365562 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 11:45:03 -0000 Author: tuexen Date: Thu Sep 10 11:45:03 2020 New Revision: 365562 URL: https://svnweb.freebsd.org/changeset/base/365562 Log: MFC r364054: Improve the ECN negotiation when the TCP SYN-cache is used by making sure that * ECN is disabled if the client sends an non-ECN-setup SYN segment. * ECN is disabled is the ECN-setup SYN-ACK segment is retransmitted more than net.inet.tcp.ecn.maxretries times. Modified: stable/12/sys/netinet/tcp_syncache.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 11:43:23 2020 (r365561) +++ stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 11:45:03 2020 (r365562) @@ -477,6 +477,9 @@ syncache_timer(void *xsch) sch->sch_nextc = sc->sc_rxttime; continue; } + if (sc->sc_rxmits > V_tcp_ecn_maxretries) { + sc->sc_flags &= ~SCF_ECN; + } if (sc->sc_rxmits > V_tcp_syncache.rexmt_limit) { if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { log(LOG_DEBUG, "%s; %s: Retransmits exhausted, " @@ -1430,6 +1433,13 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t sc->sc_tsreflect = to->to_tsval; else sc->sc_flags &= ~SCF_TIMESTAMP; + /* + * Disable ECN if needed. + */ + if ((sc->sc_flags & SCF_ECN) && + ((th->th_flags & (TH_ECE|TH_CWR)) != (TH_ECE|TH_CWR))) { + sc->sc_flags &= ~SCF_ECN; + } #ifdef MAC /* * Since we have already unconditionally allocated label From owner-svn-src-stable@freebsd.org Thu Sep 10 11:46:37 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18CC73D3AA0; Thu, 10 Sep 2020 11:46:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnHCw6pRHz3cq6; Thu, 10 Sep 2020 11:46:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCEFE1270E; Thu, 10 Sep 2020 11:46:36 +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 08ABkaSF014009; Thu, 10 Sep 2020 11:46:36 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ABka4M014007; Thu, 10 Sep 2020 11:46:36 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101146.08ABka4M014007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 11:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365563 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 11:46:37 -0000 Author: tuexen Date: Thu Sep 10 11:46:36 2020 New Revision: 365563 URL: https://svnweb.freebsd.org/changeset/base/365563 Log: MFC r364089: Fix the following issues related to the TCP SYN-cache: * Let the accepted TCP/IPv4 socket inherit the configured TTL and TOS value. * Let the accepted TCP/IPv6 socket inherit the configured Hop Limit. * Use the configured Hop Limit and Traffic Class when sending IPv6 packets. Modified: stable/12/sys/netinet/tcp_syncache.c stable/12/sys/netinet/tcp_syncache.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 11:45:03 2020 (r365562) +++ stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 11:46:36 2020 (r365563) @@ -768,6 +768,8 @@ syncache_socket(struct syncache *sc, struct socket *ls inp->inp_vflag &= ~INP_IPV6; inp->inp_vflag |= INP_IPV4; #endif + inp->inp_ip_ttl = sc->sc_ip_ttl; + inp->inp_ip_tos = sc->sc_ip_tos; inp->inp_laddr = sc->sc_inc.inc_laddr; #ifdef INET6 } @@ -800,6 +802,7 @@ syncache_socket(struct syncache *sc, struct socket *ls if (oinp->in6p_outputopts) inp->in6p_outputopts = ip6_copypktopts(oinp->in6p_outputopts, M_NOWAIT); + inp->in6p_hops = oinp->in6p_hops; } if (sc->sc_inc.inc_flags & INC_ISIPV6) { @@ -1321,12 +1324,28 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t cred = crhold(so->so_cred); #ifdef INET6 - if ((inc->inc_flags & INC_ISIPV6) && - (inp->inp_flags & IN6P_AUTOFLOWLABEL)) - autoflowlabel = 1; + if (inc->inc_flags & INC_ISIPV6) { + if (inp->inp_flags & IN6P_AUTOFLOWLABEL) { + autoflowlabel = 1; + } + ip_ttl = in6_selecthlim(inp, NULL); + if ((inp->in6p_outputopts == NULL) || + (inp->in6p_outputopts->ip6po_tclass == -1)) { + ip_tos = 0; + } else { + ip_tos = inp->in6p_outputopts->ip6po_tclass; + } + } #endif - ip_ttl = inp->inp_ip_ttl; - ip_tos = inp->inp_ip_tos; +#if defined(INET6) && defined(INET) + else +#endif +#ifdef INET + { + ip_ttl = inp->inp_ip_ttl; + ip_tos = inp->inp_ip_tos; + } +#endif win = so->sol_sbrcv_hiwat; ltflags = (tp->t_flags & (TF_NOOPT | TF_SIGNATURE)); @@ -1512,13 +1531,8 @@ skip_alloc: cred = NULL; sc->sc_ipopts = ipopts; bcopy(inc, &sc->sc_inc, sizeof(struct in_conninfo)); -#ifdef INET6 - if (!(inc->inc_flags & INC_ISIPV6)) -#endif - { - sc->sc_ip_tos = ip_tos; - sc->sc_ip_ttl = ip_ttl; - } + sc->sc_ip_tos = ip_tos; + sc->sc_ip_ttl = ip_ttl; #ifdef TCP_OFFLOAD sc->sc_tod = tod; sc->sc_todctx = todctx; @@ -1715,6 +1729,7 @@ syncache_respond(struct syncache *sc, struct syncache_ /* Zero out traffic class and flow label. */ ip6->ip6_flow &= ~IPV6_FLOWINFO_MASK; ip6->ip6_flow |= sc->sc_flowlabel; + ip6->ip6_flow |= htonl(sc->sc_ip_tos << 20); th = (struct tcphdr *)(ip6 + 1); } @@ -1843,7 +1858,7 @@ syncache_respond(struct syncache *sc, struct syncache_ m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; th->th_sum = in6_cksum_pseudo(ip6, tlen + optlen - hlen, IPPROTO_TCP, 0); - ip6->ip6_hlim = in6_selecthlim(NULL, NULL); + ip6->ip6_hlim = sc->sc_ip_ttl; #ifdef TCP_OFFLOAD if (ADDED_BY_TOE(sc)) { struct toedev *tod = sc->sc_tod; Modified: stable/12/sys/netinet/tcp_syncache.h ============================================================================== --- stable/12/sys/netinet/tcp_syncache.h Thu Sep 10 11:45:03 2020 (r365562) +++ stable/12/sys/netinet/tcp_syncache.h Thu Sep 10 11:46:36 2020 (r365563) @@ -63,8 +63,8 @@ struct syncache { struct mbuf *sc_ipopts; /* source route */ u_int16_t sc_peer_mss; /* peer's MSS */ u_int16_t sc_wnd; /* advertised window */ - u_int8_t sc_ip_ttl; /* IPv4 TTL */ - u_int8_t sc_ip_tos; /* IPv4 TOS */ + u_int8_t sc_ip_ttl; /* TTL / Hop Limit */ + u_int8_t sc_ip_tos; /* TOS / Traffic Class */ u_int8_t sc_requested_s_scale:4, sc_requested_r_scale:4; u_int16_t sc_flags; From owner-svn-src-stable@freebsd.org Thu Sep 10 11:55:46 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8612A3D3B9D; Thu, 10 Sep 2020 11:55:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnHQV2x2sz3d2C; Thu, 10 Sep 2020 11:55:46 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DBB012734; Thu, 10 Sep 2020 11:55:46 +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 08ABtjxU020176; Thu, 10 Sep 2020 11:55:45 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ABtjTq020175; Thu, 10 Sep 2020 11:55:45 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101155.08ABtjTq020175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 11:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365564 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 11:55:46 -0000 Author: tuexen Date: Thu Sep 10 11:55:45 2020 New Revision: 365564 URL: https://svnweb.freebsd.org/changeset/base/365564 Log: MFC r361752: We should never allow either the broadcast or IN_ADDR_ANY to be connected to or sent to. This was fond when working with Michael Tuexen and Skyzaller. Skyzaller seems to want to use either of these two addresses to connect to at times. And it really is an error to do so, so lets not allow that behavior. MFC r363256: (Re)-allow 0.0.0.0 to be used as an address in connect() for TCP In r361752 an error handling was introduced for using 0.0.0.0 or 255.255.255.255 as the address in connect() for TCP, since both addresses can't be used. However, the stack maps 0.0.0.0 implicitly to a local address and at least two regressions were reported. Therefore, re-allow the usage of 0.0.0.0. While there, change the error indicated when using 255.255.255.255 from EAFNOSUPPORT to EACCES as mentioned in the man-page of connect(). Modified: stable/12/sys/netinet/tcp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/12/sys/netinet/tcp_usrreq.c Thu Sep 10 11:46:36 2020 (r365563) +++ stable/12/sys/netinet/tcp_usrreq.c Thu Sep 10 11:55:45 2020 (r365564) @@ -543,6 +543,9 @@ tcp_usr_connect(struct socket *so, struct sockaddr *na if (sinp->sin_family == AF_INET && IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) return (EAFNOSUPPORT); + if ((sinp->sin_family == AF_INET) && + (ntohl(sinp->sin_addr.s_addr) == INADDR_BROADCAST)) + return (EACCES); if ((error = prison_remote_ip4(td->td_ucred, &sinp->sin_addr)) != 0) return (error); @@ -639,6 +642,10 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *n error = EAFNOSUPPORT; goto out; } + if (ntohl(sin.sin_addr.s_addr) == INADDR_BROADCAST) { + error = EACCES; + goto out; + } if ((error = prison_remote_ip4(td->td_ucred, &sin.sin_addr)) != 0) goto out; @@ -994,6 +1001,12 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf if (m) m_freem(m); error = EAFNOSUPPORT; + goto out; + } + if (ntohl(sinp->sin_addr.s_addr) == INADDR_BROADCAST) { + if (m) + m_freem(m); + error = EACCES; goto out; } if ((error = prison_remote_ip4(td->td_ucred, From owner-svn-src-stable@freebsd.org Thu Sep 10 12:01:36 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 600203D477F; Thu, 10 Sep 2020 12:01:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnHYD1xV3z3dgd; Thu, 10 Sep 2020 12:01:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2681612835; Thu, 10 Sep 2020 12:01:36 +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 08AC1aM0022857; Thu, 10 Sep 2020 12:01:36 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AC1aGe022856; Thu, 10 Sep 2020 12:01:36 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101201.08AC1aGe022856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 12:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365565 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 12:01:36 -0000 Author: tuexen Date: Thu Sep 10 12:01:35 2020 New Revision: 365565 URL: https://svnweb.freebsd.org/changeset/base/365565 Log: MFC r361081: Allow only IPv4 addresses in sendto() for TCP on AF_INET sockets. This problem was found by looking at syzkaller reproducers for some other problems. Modified: stable/12/sys/netinet/tcp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/12/sys/netinet/tcp_usrreq.c Thu Sep 10 11:55:45 2020 (r365564) +++ stable/12/sys/netinet/tcp_usrreq.c Thu Sep 10 12:01:35 2020 (r365565) @@ -1032,6 +1032,12 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf error = EINVAL; goto out; } + if ((inp->inp_vflag & INP_IPV6PROTO) == 0) { + if (m != NULL) + m_freem(m); + error = EAFNOSUPPORT; + goto out; + } if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { if (m) m_freem(m); From owner-svn-src-stable@freebsd.org Thu Sep 10 12:41:03 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C54B3D608D; Thu, 10 Sep 2020 12:41:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnJQl0rbBz3gvj; Thu, 10 Sep 2020 12:41: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01ADA1318C; Thu, 10 Sep 2020 12:41:03 +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 08ACf2qM049591; Thu, 10 Sep 2020 12:41:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ACf2cY049587; Thu, 10 Sep 2020 12:41:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009101241.08ACf2cY049587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 10 Sep 2020 12:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365566 - in stable/12/cddl: contrib/opensolaris/lib/libdtrace/common usr.sbin/dtrace/tests/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/cddl: contrib/opensolaris/lib/libdtrace/common usr.sbin/dtrace/tests/tools X-SVN-Commit-Revision: 365566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 12:41:03 -0000 Author: markj Date: Thu Sep 10 12:41:01 2020 New Revision: 365566 URL: https://svnweb.freebsd.org/changeset/base/365566 Log: MFC r364438, r364440, r364483: Enable creation of static userspace probes in incremental builds. Modified: stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h stable/12/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Thu Sep 10 12:01:35 2020 (r365565) +++ stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Thu Sep 10 12:41:01 2020 (r365566) @@ -770,6 +770,7 @@ dt_symtab_lookup(Elf_Data *data_sym, int start, int en #define DT_OP_RET 0xd65f03c0 #define DT_OP_CALL26 0x94000000 #define DT_OP_JUMP26 0x14000000 +#define DT_REL_NONE R_AARCH64_NONE static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, @@ -828,7 +829,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, return (0); } #elif defined(__arm__) -/* XXX */ +#define DT_REL_NONE R_ARM_NONE + static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) @@ -838,7 +840,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, return (-1); } #elif defined(__mips__) -/* XXX */ +#define DT_REL_NONE R_MIPS_NONE + static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) @@ -858,7 +861,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, #define DT_IS_BRANCH(inst) ((inst & 0xfc000000) == 0x48000000) #define DT_IS_BL(inst) (DT_IS_BRANCH(inst) && (inst & 0x01)) -/* XXX */ +#define DT_REL_NONE R_PPC_NONE + static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) @@ -875,7 +879,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, * We only know about some specific relocation types. */ if (GELF_R_TYPE(rela->r_info) != R_PPC_REL24 && - GELF_R_TYPE(rela->r_info) != R_PPC_PLTREL24) + GELF_R_TYPE(rela->r_info) != R_PPC_PLTREL24 && + GELF_R_TYPE(rela->r_info) != R_PPC_NONE) return (-1); /* @@ -929,7 +934,7 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, return (0); } #elif defined(__riscv) -/* XXX */ +#define DT_REL_NONE R_RISCV_NONE static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) @@ -949,6 +954,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, #define DT_OP_XOR_EAX_0 0x33 #define DT_OP_XOR_EAX_1 0xc0 +#define DT_REL_NONE R_386_NONE + static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) @@ -971,7 +978,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, * x86 architectures. */ if (GELF_R_TYPE(rela->r_info) != R_386_PC32 && - GELF_R_TYPE(rela->r_info) != R_386_PLT32) + GELF_R_TYPE(rela->r_info) != R_386_PLT32 && + GELF_R_TYPE(rela->r_info) != R_386_NONE) return (-1); /* @@ -1267,6 +1275,11 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e * We take a first pass through all the relocations to * populate our string table and count the number of extra * symbols we'll require. + * + * We also handle the case where the object has already been + * processed, to support incremental rebuilds. Relocations + * of interest are converted to type NONE, but all information + * needed to reconstruct the output DOF is retained. */ strtab = dt_strtab_create(1); nsym = 0; @@ -1274,7 +1287,6 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e istr = data_str->d_size; for (i = 0; i < shdr_rel.sh_size / shdr_rel.sh_entsize; i++) { - if (shdr_rel.sh_type == SHT_RELA) { if (gelf_getrela(data_rel, i, &rela) == NULL) continue; @@ -1339,7 +1351,12 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e objkey, s); if (dt_strtab_index(strtab, p) == -1) { - nsym++; + /* + * Do not add new symbols if this object file + * has already been processed. + */ + if (GELF_R_TYPE(rela.r_info) != DT_REL_NONE) + nsym++; (void) dt_strtab_insert(strtab, p); } @@ -1347,13 +1364,14 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e } /* - * If any probes were found, allocate the additional space for - * the symbol table and string table, copying the old data into - * the new buffers, and marking the buffers as dirty. We inject - * those newly allocated buffers into the libelf data + * If any new probes were found, allocate the additional space + * for the symbol table and string table, copying the old data + * into the new buffers, and marking the buffers as dirty. We + * inject those newly allocated buffers into the libelf data * structures, but are still responsible for freeing them once * we're done with the elf handle. */ + osym = isym; if (nsym > 0) { /* * The first byte of the string table is reserved for @@ -1405,9 +1423,8 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e shdr_sym.sh_size += nsym * symsize; (void) gelf_update_shdr(scn_sym, &shdr_sym); - osym = isym; nsym += isym; - } else { + } else if (dt_strtab_empty(strtab)) { dt_strtab_destroy(strtab); continue; } @@ -1417,7 +1434,6 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e * modifications described above. */ for (i = 0; i < shdr_rel.sh_size / shdr_rel.sh_entsize; i++) { - if (shdr_rel.sh_type == SHT_RELA) { if (gelf_getrela(data_rel, i, &rela) == NULL) continue; @@ -1484,32 +1500,51 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e bind = GELF_ST_BIND(fsym.st_info) == STB_WEAK ? STB_WEAK : STB_GLOBAL; - - /* - * Emit an alias for the symbol. It needs to be - * non-preemptible so that .SUNW_dof relocations - * may be resolved at static link time. Aliases - * of weak symbols are given a non-unique name - * so that they may be merged by the linker. - */ - dsym = fsym; - dsym.st_name = istr; - dsym.st_info = GELF_ST_INFO(bind, STT_FUNC); - dsym.st_other = GELF_ST_VISIBILITY(STV_HIDDEN); - (void) gelf_update_sym(data_sym, isym, &dsym); - r = (char *) data_str->d_buf + istr; s = (char *) data_str->d_buf + fsym.st_name; - if (bind == STB_WEAK) - istr += sprintf(r, dt_weaksymfmt, - dt_symprefix, s); - else - istr += sprintf(r, dt_symfmt, - dt_symprefix, objkey, s); - istr++; - isym++; - assert(isym <= nsym); - } else + if (GELF_R_TYPE(rela.r_info) != DT_REL_NONE) { + /* + * Emit an alias for the symbol. It + * needs to be non-preemptible so that + * .SUNW_dof relocations may be resolved + * at static link time. Aliases of weak + * symbols are given a non-unique name + * so that they may be merged by the + * linker. + */ + dsym = fsym; + dsym.st_name = istr; + dsym.st_info = GELF_ST_INFO(bind, + STT_FUNC); + dsym.st_other = + GELF_ST_VISIBILITY(STV_HIDDEN); + (void) gelf_update_sym(data_sym, isym, + &dsym); + isym++; + assert(isym <= nsym); + + r = (char *) data_str->d_buf + istr; + if (bind == STB_WEAK) { + istr += sprintf(r, + dt_weaksymfmt, dt_symprefix, + s); + } else { + istr += sprintf(r, dt_symfmt, + dt_symprefix, objkey, s); + } + istr++; + } else { + if (bind == STB_WEAK) { + (void) asprintf(&r, + dt_weaksymfmt, dt_symprefix, + s); + } else { + (void) asprintf(&r, dt_symfmt, + dt_symprefix, objkey, s); + } + } + } else { goto err; + } if ((pvp = dt_provider_lookup(dtp, pname)) == NULL) { return (dt_link_error(dtp, elf, fd, bufs, @@ -1538,24 +1573,18 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e } /* - * Our linker doesn't understand the SUNW_IGNORE ndx and - * will try to use this relocation when we build the - * final executable. Since we are done processing this - * relocation, mark it as inexistant and let libelf - * remove it from the file. - * If this wasn't done, we would have garbage added to - * the executable file as the symbol is going to be - * change from UND to ABS. + * We are done with this relocation, but it must be + * preserved in order to support incremental rebuilds. */ if (shdr_rel.sh_type == SHT_RELA) { - rela.r_offset = 0; - rela.r_info = 0; - rela.r_addend = 0; + rela.r_info = GELF_R_INFO( + GELF_R_SYM(rela.r_info), DT_REL_NONE); (void) gelf_update_rela(data_rel, i, &rela); } else { GElf_Rel rel; - rel.r_offset = 0; - rel.r_info = 0; + rel.r_offset = rela.r_offset; + rel.r_info = GELF_R_INFO( + GELF_R_SYM(rela.r_info), DT_REL_NONE); (void) gelf_update_rel(data_rel, i, &rel); } @@ -1607,19 +1636,6 @@ dtrace_program_link(dtrace_hdl_t *dtp, dtrace_prog_t * char *cmd, tmp; size_t len; int eprobes = 0, ret = 0; - - if (access(file, R_OK) == 0) { - fprintf(stderr, "dtrace: target object (%s) already exists. " - "Please remove the target\ndtrace: object and rebuild all " - "the source objects if you wish to run the DTrace\n" - "dtrace: linking process again\n", file); - /* - * Several build infrastructures run DTrace twice (e.g. - * postgres) and we don't want the build to fail. Return - * 0 here since this isn't really a fatal error. - */ - return (0); - } /* * A NULL program indicates a special use in which we just link Modified: stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Thu Sep 10 12:01:35 2020 (r365565) +++ stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Thu Sep 10 12:41:01 2020 (r365566) @@ -206,6 +206,13 @@ err: return (-1); } +boolean_t +dt_strtab_empty(dt_strtab_t *sp) +{ + /* Always contains "\0". */ + return (sp->str_nstrs == 1); +} + ssize_t dt_strtab_index(dt_strtab_t *sp, const char *str) { Modified: stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h Thu Sep 10 12:01:35 2020 (r365565) +++ stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h Thu Sep 10 12:41:01 2020 (r365566) @@ -58,6 +58,7 @@ typedef ssize_t dt_strtab_write_f(const char *, size_t extern dt_strtab_t *dt_strtab_create(size_t); extern void dt_strtab_destroy(dt_strtab_t *); +extern boolean_t dt_strtab_empty(dt_strtab_t *); extern ssize_t dt_strtab_index(dt_strtab_t *, const char *); extern ssize_t dt_strtab_insert(dt_strtab_t *, const char *); extern size_t dt_strtab_size(const dt_strtab_t *); Modified: stable/12/cddl/usr.sbin/dtrace/tests/tools/exclude.sh ============================================================================== --- stable/12/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Thu Sep 10 12:01:35 2020 (r365565) +++ stable/12/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Thu Sep 10 12:41:01 2020 (r365566) @@ -186,10 +186,6 @@ exclude EXFAIL common/usdt/tst.eliminate.ksh # Generated headers include , so _DTRACE_VERSION is always defined. exclude EXFAIL common/usdt/tst.nodtrace.ksh -# The second dtrace -G invocation returns an error with "no probes found," which -# makes sense to me. Not yet sure what the expected behaviour is here. -exclude EXFAIL common/usdt/tst.static2.ksh - # Uses the Solaris-specific ppriv(1). exclude EXFAIL common/usdt/tst.user.ksh From owner-svn-src-stable@freebsd.org Thu Sep 10 12:49:17 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 299F73D6357; Thu, 10 Sep 2020 12:49:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnJcF06rlz3y1l; Thu, 10 Sep 2020 12:49:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2AE3131AB; Thu, 10 Sep 2020 12:49:16 +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 08ACnGc6050810; Thu, 10 Sep 2020 12:49:16 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ACnG8g050809; Thu, 10 Sep 2020 12:49:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101249.08ACnG8g050809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 12:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365567 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 365567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 12:49:17 -0000 Author: tuexen Date: Thu Sep 10 12:49:16 2020 New Revision: 365567 URL: https://svnweb.freebsd.org/changeset/base/365567 Log: MFC 359422: Be a bit more precisly in the description of the sysctl variable net.inet.tcp.pmtud_blackhole_detection. Also remove three entries, which are not sysctl variables but statistic counters for TCP. Thanks to 0mp@ for suggesting an improvement. Modified: stable/12/share/man/man4/tcp.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/tcp.4 ============================================================================== --- stable/12/share/man/man4/tcp.4 Thu Sep 10 12:41:01 2020 (r365566) +++ stable/12/share/man/man4/tcp.4 Thu Sep 10 12:49:16 2020 (r365567) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd December 1, 2019 +.Dd March 29, 2020 .Dt TCP 4 .Os .Sh NAME @@ -577,7 +577,12 @@ Turn on automatic path MTU blackhole detection. In case of retransmits OS will lower the MSS to check if it's MTU problem. If current MSS is greater than -configured value to try, it will be set to configured value, otherwise, +configured value to try +.Po Va net.inet.tcp.pmtud_blackhole_mss +and +.Va net.inet.tcp.v6pmtud_blackhole_mss +.Pc , +it will be set to this value, otherwise, MSS will be set to default values .Po Va net.inet.tcp.mssdflt and @@ -587,13 +592,6 @@ and MSS to try for IPv4 if PMTU blackhole detection is turned on. .It Va v6pmtud_blackhole_mss MSS to try for IPv6 if PMTU blackhole detection is turned on. -.It Va pmtud_blackhole_activated -Number of times configured values were used in an attempt to downshift. -.It Va pmtud_blackhole_activated_min_mss -Number of times default MSS was used in an attempt to downshift. -.It Va pmtud_blackhole_failed -Number of connections for which retransmits continued even after MSS -downshift. .It Va functions_available List of available TCP function blocks (TCP stacks). .It Va functions_default From owner-svn-src-stable@freebsd.org Thu Sep 10 12:52:52 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DFD63D65A5; Thu, 10 Sep 2020 12:52:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnJhM72mLz3yR2; Thu, 10 Sep 2020 12:52:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BADF11313A; Thu, 10 Sep 2020 12:52:51 +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 08ACqpJ3056833; Thu, 10 Sep 2020 12:52:51 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ACqpBK056831; Thu, 10 Sep 2020 12:52:51 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101252.08ACqpBK056831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 12:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365568 - in stable/12: share/man/man4 sys/netinet sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/netinet sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 12:52:52 -0000 Author: tuexen Date: Thu Sep 10 12:52:50 2020 New Revision: 365568 URL: https://svnweb.freebsd.org/changeset/base/365568 Log: MFC r359487: Allow the TCP backhole detection to be disabled at all, enabled only for IPv4, enabled only for IPv6, and enabled for IPv4 and IPv6. The current blackhole detection might classify a temporary outage as an MTU issue and reduces permanently the MSS. Since the consequences of such a reduction due to a misclassification are much more drastically for IPv4 than for IPv6, allow the administrator to enable it for IPv6 only. Manually resolve conflict for BBR, which does not exist in stable/12 Modified: stable/12/share/man/man4/tcp.4 stable/12/sys/netinet/tcp_stacks/rack.c stable/12/sys/netinet/tcp_timer.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/tcp.4 ============================================================================== --- stable/12/share/man/man4/tcp.4 Thu Sep 10 12:49:16 2020 (r365567) +++ stable/12/share/man/man4/tcp.4 Thu Sep 10 12:52:50 2020 (r365568) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd March 29, 2020 +.Dd March 31, 2020 .Dt TCP 4 .Os .Sh NAME @@ -573,21 +573,31 @@ specific connection. This is needed to help with connection establishment when a broken firewall is in the network path. .It Va pmtud_blackhole_detection -Turn on automatic path MTU blackhole detection. -In case of retransmits OS will -lower the MSS to check if it's MTU problem. -If current MSS is greater than -configured value to try +Enable automatic path MTU blackhole detection. +In case of retransmits of MSS sized segments, +the OS will lower the MSS to check if it's an MTU problem. +If the current MSS is greater than the configured value to try .Po Va net.inet.tcp.pmtud_blackhole_mss and .Va net.inet.tcp.v6pmtud_blackhole_mss .Pc , it will be set to this value, otherwise, -MSS will be set to default values +the MSS will be set to the default values .Po Va net.inet.tcp.mssdflt and .Va net.inet.tcp.v6mssdflt .Pc . +Settings: +.Bl -tag -compact +.It 0 +Disable path MTU blackhole detection. +.It 1 +Enable path MTU blackhole detection for IPv4 and IPv6. +.It 2 +Enable path MTU blackhole detection only for IPv4. +.It 3 +Enable path MTU blackhole detection only for IPv6. +.El .It Va pmtud_blackhole_mss MSS to try for IPv4 if PMTU blackhole detection is turned on. .It Va v6pmtud_blackhole_mss Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 12:49:16 2020 (r365567) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 12:52:50 2020 (r365568) @@ -2934,6 +2934,7 @@ rack_timeout_rxt(struct tcpcb *tp, struct tcp_rack *ra int32_t rexmt; struct inpcb *inp; int32_t retval = 0; + bool isipv6; inp = tp->t_inpcb; if (tp->t_timers->tt_flags & TT_STOPPED) { @@ -3010,11 +3011,16 @@ rack_timeout_rxt(struct tcpcb *tp, struct tcp_rack *ra * of packets and process straight to FIN. In that case we won't * catch ESTABLISHED state. */ - if (V_tcp_pmtud_blackhole_detect && (((tp->t_state == TCPS_ESTABLISHED)) - || (tp->t_state == TCPS_FIN_WAIT_1))) { #ifdef INET6 - int32_t isipv6; + isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) ? true : false; +#else + isipv6 = false; #endif + if (((V_tcp_pmtud_blackhole_detect == 1) || + (V_tcp_pmtud_blackhole_detect == 2 && !isipv6) || + (V_tcp_pmtud_blackhole_detect == 3 && isipv6)) && + ((tp->t_state == TCPS_ESTABLISHED) || + (tp->t_state == TCPS_FIN_WAIT_1))) { /* * Idea here is that at each stage of mtu probe (usually, @@ -3044,7 +3050,6 @@ rack_timeout_rxt(struct tcpcb *tp, struct tcp_rack *ra * default in an attempt to retransmit. */ #ifdef INET6 - isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) ? 1 : 0; if (isipv6 && tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss) { /* Use the sysctl tuneable blackhole MSS. */ Modified: stable/12/sys/netinet/tcp_timer.c ============================================================================== --- stable/12/sys/netinet/tcp_timer.c Thu Sep 10 12:49:16 2020 (r365567) +++ stable/12/sys/netinet/tcp_timer.c Thu Sep 10 12:52:50 2020 (r365568) @@ -589,6 +589,7 @@ tcp_timer_rexmt(void * xtp) int rexmt; struct inpcb *inp; struct epoch_tracker et; + bool isipv6; #ifdef TCPDEBUG int ostate; @@ -687,12 +688,16 @@ tcp_timer_rexmt(void * xtp) * packets and process straight to FIN. In that case we won't catch * ESTABLISHED state. */ - if (V_tcp_pmtud_blackhole_detect && (((tp->t_state == TCPS_ESTABLISHED)) - || (tp->t_state == TCPS_FIN_WAIT_1))) { #ifdef INET6 - int isipv6; + isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) ? true : false; +#else + isipv6 = false; #endif - + if (((V_tcp_pmtud_blackhole_detect == 1) || + (V_tcp_pmtud_blackhole_detect == 2 && !isipv6) || + (V_tcp_pmtud_blackhole_detect == 3 && isipv6)) && + ((tp->t_state == TCPS_ESTABLISHED) || + (tp->t_state == TCPS_FIN_WAIT_1))) { /* * Idea here is that at each stage of mtu probe (usually, 1448 * -> 1188 -> 524) should be given 2 chances to recover before @@ -721,7 +726,6 @@ tcp_timer_rexmt(void * xtp) * in an attempt to retransmit. */ #ifdef INET6 - isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) ? 1 : 0; if (isipv6 && tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss) { /* Use the sysctl tuneable blackhole MSS. */ From owner-svn-src-stable@freebsd.org Thu Sep 10 12:54:47 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EDE43D65B9; Thu, 10 Sep 2020 12:54:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnJkb2MTbz3yjh; Thu, 10 Sep 2020 12:54:47 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DB291313B; Thu, 10 Sep 2020 12:54:47 +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 08ACslA1056977; Thu, 10 Sep 2020 12:54:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ACskT1056975; Thu, 10 Sep 2020 12:54:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101254.08ACskT1056975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 12:54:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365569 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 12:54:47 -0000 Author: tuexen Date: Thu Sep 10 12:54:46 2020 New Revision: 365569 URL: https://svnweb.freebsd.org/changeset/base/365569 Log: MFC r359926: Improve the TCP blackhole detection. The principle is to reduce the MSS in two steps and try each candidate two times. However, if two candidates are the same (which is the case in TCP/IPv6), this candidate was tested four times. This patch ensures that each candidate actually reduced the MSS and is only tested 2 times. This reduces the time window of missclassifying a temporary outage as an MTU issue. Modified: stable/12/sys/netinet/tcp_timer.c stable/12/sys/netinet/tcp_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_timer.c ============================================================================== --- stable/12/sys/netinet/tcp_timer.c Thu Sep 10 12:52:50 2020 (r365568) +++ stable/12/sys/netinet/tcp_timer.c Thu Sep 10 12:54:46 2020 (r365569) @@ -698,16 +698,40 @@ tcp_timer_rexmt(void * xtp) (V_tcp_pmtud_blackhole_detect == 3 && isipv6)) && ((tp->t_state == TCPS_ESTABLISHED) || (tp->t_state == TCPS_FIN_WAIT_1))) { - /* - * Idea here is that at each stage of mtu probe (usually, 1448 - * -> 1188 -> 524) should be given 2 chances to recover before - * further clamping down. 'tp->t_rxtshift % 2 == 0' should - * take care of that. - */ + if (tp->t_rxtshift == 1) { + /* + * We enter blackhole detection after the first + * unsuccessful timer based retransmission. + * Then we reduce up to two times the MSS, each + * candidate giving two tries of retransmissions. + * But we give a candidate only two tries, if it + * actually reduces the MSS. + */ + tp->t_blackhole_enter = 2; + tp->t_blackhole_exit = tp->t_blackhole_enter; + if (isipv6) { +#ifdef INET6 + if (tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss) + tp->t_blackhole_exit += 2; + if (tp->t_maxseg > V_tcp_v6mssdflt && + V_tcp_v6pmtud_blackhole_mss > V_tcp_v6mssdflt) + tp->t_blackhole_exit += 2; +#endif + } else { +#ifdef INET + if (tp->t_maxseg > V_tcp_pmtud_blackhole_mss) + tp->t_blackhole_exit += 2; + if (tp->t_maxseg > V_tcp_mssdflt && + V_tcp_pmtud_blackhole_mss > V_tcp_mssdflt) + tp->t_blackhole_exit += 2; +#endif + } + } if (((tp->t_flags2 & (TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) == (TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) && - (tp->t_rxtshift >= 2 && tp->t_rxtshift < 6 && - tp->t_rxtshift % 2 == 0)) { + (tp->t_rxtshift >= tp->t_blackhole_enter && + tp->t_rxtshift < tp->t_blackhole_exit && + (tp->t_rxtshift - tp->t_blackhole_enter) % 2 == 0)) { /* * Enter Path MTU Black-hole Detection mechanism: * - Disable Path MTU Discovery (IP "DF" bit). @@ -727,7 +751,8 @@ tcp_timer_rexmt(void * xtp) */ #ifdef INET6 if (isipv6 && - tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss) { + tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss && + V_tcp_v6pmtud_blackhole_mss > V_tcp_v6mssdflt) { /* Use the sysctl tuneable blackhole MSS. */ tp->t_maxseg = V_tcp_v6pmtud_blackhole_mss; TCPSTAT_INC(tcps_pmtud_blackhole_activated); @@ -746,7 +771,8 @@ tcp_timer_rexmt(void * xtp) else #endif #ifdef INET - if (tp->t_maxseg > V_tcp_pmtud_blackhole_mss) { + if (tp->t_maxseg > V_tcp_pmtud_blackhole_mss && + V_tcp_pmtud_blackhole_mss > V_tcp_mssdflt) { /* Use the sysctl tuneable blackhole MSS. */ tp->t_maxseg = V_tcp_pmtud_blackhole_mss; TCPSTAT_INC(tcps_pmtud_blackhole_activated); @@ -773,11 +799,9 @@ tcp_timer_rexmt(void * xtp) * with a lowered MTU, maybe this isn't a blackhole and * we restore the previous MSS and blackhole detection * flags. - * The limit '6' is determined by giving each probe - * stage (1448, 1188, 524) 2 chances to recover. */ if ((tp->t_flags2 & TF2_PLPMTU_BLACKHOLE) && - (tp->t_rxtshift >= 6)) { + (tp->t_rxtshift >= tp->t_blackhole_exit)) { tp->t_flags2 |= TF2_PLPMTU_PMTUD; tp->t_flags2 &= ~TF2_PLPMTU_BLACKHOLE; tp->t_maxseg = tp->t_pmtud_saved_maxseg; Modified: stable/12/sys/netinet/tcp_var.h ============================================================================== --- stable/12/sys/netinet/tcp_var.h Thu Sep 10 12:52:50 2020 (r365568) +++ stable/12/sys/netinet/tcp_var.h Thu Sep 10 12:54:46 2020 (r365569) @@ -169,6 +169,8 @@ struct tcpcb { u_int t_starttime; /* time connection was established */ u_int t_pmtud_saved_maxseg; /* pre-blackhole MSS */ + int t_blackhole_enter; /* when to enter blackhole detection */ + int t_blackhole_exit; /* when to exit blackhole detection */ u_int t_rttmin; /* minimum rtt allowed */ u_int t_rttbest; /* best rtt we've seen */ From owner-svn-src-stable@freebsd.org Thu Sep 10 13:15:18 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 690003D6D7D; Thu, 10 Sep 2020 13:15:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnKBG2B7jz40PG; Thu, 10 Sep 2020 13:15:18 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F62E1363C; Thu, 10 Sep 2020 13:15:18 +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 08ADFIWW069017; Thu, 10 Sep 2020 13:15:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ADFI7t069016; Thu, 10 Sep 2020 13:15:18 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101315.08ADFI7t069016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 13:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365570 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 13:15:18 -0000 Author: tuexen Date: Thu Sep 10 13:15:17 2020 New Revision: 365570 URL: https://svnweb.freebsd.org/changeset/base/365570 Log: MFC r358621: When using automatically generated flow labels and using TCP SYN cookies, use the same flow label for the segments sent during the handshake and after the handshake. This fixes a bug by making sure that sc_flowlabel is always stored in network byte order. Modified: stable/12/sys/netinet/tcp_syncache.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 12:54:46 2020 (r365569) +++ stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 13:15:17 2020 (r365570) @@ -2161,7 +2161,8 @@ syncookie_lookup(struct in_conninfo *inc, struct synca #ifdef INET6 case INC_ISIPV6: if (sotoinpcb(lso)->inp_flags & IN6P_AUTOFLOWLABEL) - sc->sc_flowlabel = sc->sc_iss & IPV6_FLOWLABEL_MASK; + sc->sc_flowlabel = + htonl(sc->sc_iss) & IPV6_FLOWLABEL_MASK; break; #endif } From owner-svn-src-stable@freebsd.org Thu Sep 10 13:17:24 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B38F3D6FA4; Thu, 10 Sep 2020 13:17:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnKDh0MWnz40mD; Thu, 10 Sep 2020 13:17:24 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3D1E133D1; Thu, 10 Sep 2020 13:17:23 +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 08ADHNQf069160; Thu, 10 Sep 2020 13:17:23 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ADHNi1069159; Thu, 10 Sep 2020 13:17:23 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101317.08ADHNi1069159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 13:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365571 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 365571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 13:17:24 -0000 Author: tuexen Date: Thu Sep 10 13:17:23 2020 New Revision: 365571 URL: https://svnweb.freebsd.org/changeset/base/365571 Log: MFC r357101: Don't delay the ACK for a TCP segment with the CWR flag set. This allows the data sender to increase the CWND faster. Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu Sep 10 13:15:17 2020 (r365570) +++ stable/12/sys/netinet/tcp_input.c Thu Sep 10 13:17:23 2020 (r365571) @@ -1610,8 +1610,10 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru * TCP ECN processing. */ if (tp->t_flags & TF_ECN_PERMIT) { - if (thflags & TH_CWR) + if (thflags & TH_CWR) { tp->t_flags &= ~TF_ECN_SND_ECE; + tp->t_flags |= TF_ACKNOW; + } switch (iptos & IPTOS_ECN_MASK) { case IPTOS_ECN_CE: tp->t_flags |= TF_ECN_SND_ECE; Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 13:15:17 2020 (r365570) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 13:17:23 2020 (r365571) @@ -6733,8 +6733,10 @@ rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th * this to occur after we've validated the segment. */ if (tp->t_flags & TF_ECN_PERMIT) { - if (thflags & TH_CWR) + if (thflags & TH_CWR) { tp->t_flags &= ~TF_ECN_SND_ECE; + tp->t_flags |= TF_ACKNOW; + } switch (iptos & IPTOS_ECN_MASK) { case IPTOS_ECN_CE: tp->t_flags |= TF_ECN_SND_ECE; From owner-svn-src-stable@freebsd.org Thu Sep 10 13:27:54 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48EBD3D726E; Thu, 10 Sep 2020 13:27:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnKSp1DwFz41D3; Thu, 10 Sep 2020 13:27:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F2C01391B; Thu, 10 Sep 2020 13:27:54 +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 08ADRrRO075320; Thu, 10 Sep 2020 13:27:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ADRr88075318; Thu, 10 Sep 2020 13:27:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101327.08ADRr88075318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 13:27:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365572 - in stable/12/sys/netinet: . cc X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . cc X-SVN-Commit-Revision: 365572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 13:27:54 -0000 Author: tuexen Date: Thu Sep 10 13:27:53 2020 New Revision: 365572 URL: https://svnweb.freebsd.org/changeset/base/365572 Log: MFC r356235: Fix delayed ACK generation for DCTCP. Manually changed to use TF_ECN_SND_ECE. Modified: stable/12/sys/netinet/cc/cc_dctcp.c stable/12/sys/netinet/tcp_input.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/cc/cc_dctcp.c ============================================================================== --- stable/12/sys/netinet/cc/cc_dctcp.c Thu Sep 10 13:17:23 2020 (r365571) +++ stable/12/sys/netinet/cc/cc_dctcp.c Thu Sep 10 13:27:53 2020 (r365572) @@ -272,9 +272,9 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) dctcp_data->bytes_total = 0; dctcp_data->save_sndnxt = CCV(ccv, snd_nxt); } else - CCV(ccv, snd_ssthresh) = + CCV(ccv, snd_ssthresh) = max((cwin - (((uint64_t)cwin * - dctcp_data->alpha) >> (DCTCP_SHIFT+1))), + dctcp_data->alpha) >> (DCTCP_SHIFT+1))), 2 * mss); CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); ENTER_CONGRECOVERY(CCV(ccv, t_flags)); @@ -316,46 +316,43 @@ dctcp_post_recovery(struct cc_var *ccv) } /* - * Execute an additional ECN processing using ECN field in IP header and the CWR - * bit in TCP header. - * - * delay_ack == 0 - Delayed ACK disabled - * delay_ack == 1 - Delayed ACK enabled + * Execute an additional ECN processing using ECN field in IP header + * and the CWR bit in TCP header. */ - static void dctcp_ecnpkt_handler(struct cc_var *ccv) { struct dctcp *dctcp_data; uint32_t ccflag; - int delay_ack; + int acknow; dctcp_data = ccv->cc_data; ccflag = ccv->flags; - delay_ack = 1; + acknow = 0; /* * DCTCP responds with an ACK immediately when the CE state * in between this segment and the last segment has changed. */ if (ccflag & CCF_IPHDR_CE) { - if (!dctcp_data->ce_prev && (ccflag & CCF_DELACK)) - delay_ack = 0; - dctcp_data->ce_prev = 1; - CCV(ccv, t_flags) |= TF_ECN_SND_ECE; + if (!dctcp_data->ce_prev) { + acknow = 1; + dctcp_data->ce_prev = 1; + CCV(ccv, t_flags2) |= TF_ECN_SND_ECE; + } } else { - if (dctcp_data->ce_prev && (ccflag & CCF_DELACK)) - delay_ack = 0; - dctcp_data->ce_prev = 0; - CCV(ccv, t_flags) &= ~TF_ECN_SND_ECE; + if (dctcp_data->ce_prev) { + acknow = 1; + dctcp_data->ce_prev = 0; + CCV(ccv, t_flags2) &= ~TF_ECN_SND_ECE; + } } - /* DCTCP sets delayed ack when this segment sets the CWR flag. */ - if ((ccflag & CCF_DELACK) && (ccflag & CCF_TCPHDR_CWR)) - delay_ack = 1; - - if (delay_ack == 0) + if ((acknow) || (ccflag & CCF_TCPHDR_CWR)) { ccv->flags |= CCF_ACKNOW; + } else { + ccv->flags &= ~CCF_ACKNOW; + } } /* Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu Sep 10 13:17:23 2020 (r365571) +++ stable/12/sys/netinet/tcp_input.c Thu Sep 10 13:27:53 2020 (r365572) @@ -516,15 +516,12 @@ cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, else tp->ccv->flags &= ~CCF_TCPHDR_CWR; - if (tp->t_flags & TF_DELACK) - tp->ccv->flags |= CCF_DELACK; - else - tp->ccv->flags &= ~CCF_DELACK; - CC_ALGO(tp)->ecnpkt_handler(tp->ccv); - if (tp->ccv->flags & CCF_ACKNOW) + if (tp->ccv->flags & CCF_ACKNOW) { tcp_timer_activate(tp, TT_DELACK, tcp_delacktime); + tp->t_flags |= TF_ACKNOW; + } } } From owner-svn-src-stable@freebsd.org Thu Sep 10 13:44:37 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 028983D792C; Thu, 10 Sep 2020 13:44:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnKr457Jfz42HR; Thu, 10 Sep 2020 13:44:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9264913C9B; Thu, 10 Sep 2020 13:44:36 +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 08ADiafu087365; Thu, 10 Sep 2020 13:44:36 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ADiaRT087363; Thu, 10 Sep 2020 13:44:36 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101344.08ADiaRT087363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 13:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365573 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 365573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 13:44:37 -0000 Author: tuexen Date: Thu Sep 10 13:44:35 2020 New Revision: 365573 URL: https://svnweb.freebsd.org/changeset/base/365573 Log: MFC r357114: As a TCP client only enable ECN when the corresponding sysctl variable indicates that ECN should be negotiated for the client side. Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu Sep 10 13:27:53 2020 (r365572) +++ stable/12/sys/netinet/tcp_input.c Thu Sep 10 13:44:35 2020 (r365573) @@ -2044,7 +2044,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru tp->t_flags |= TF_ACKNOW; if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && - V_tcp_do_ecn) { + (V_tcp_do_ecn == 1)) { tp->t_flags |= TF_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 13:27:53 2020 (r365572) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 13:44:35 2020 (r365573) @@ -5416,7 +5416,8 @@ rack_do_syn_sent(struct mbuf *m, struct tcphdr *th, st tp->t_flags |= TF_ACKNOW; } - if ((thflags & TH_ECE) && V_tcp_do_ecn) { + if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && + (V_tcp_do_ecn == 1)) { tp->t_flags |= TF_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } From owner-svn-src-stable@freebsd.org Thu Sep 10 15:58:38 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B49823DAEE0; Thu, 10 Sep 2020 15:58:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnNpk4KWWz4D4w; Thu, 10 Sep 2020 15:58: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7467415248; Thu, 10 Sep 2020 15:58:38 +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 08AFwcux068132; Thu, 10 Sep 2020 15:58:38 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AFwcJS068130; Thu, 10 Sep 2020 15:58:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101558.08AFwcJS068130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 15:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365585 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 365585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 15:58:38 -0000 Author: tuexen Date: Thu Sep 10 15:58:37 2020 New Revision: 365585 URL: https://svnweb.freebsd.org/changeset/base/365585 Log: MFC r357115: Don't set the ECT codepoint on retransmitted packets during SACK loss recovery. This is required by RFC 3168. Modified: stable/12/sys/netinet/tcp_output.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_output.c ============================================================================== --- stable/12/sys/netinet/tcp_output.c Thu Sep 10 15:37:29 2020 (r365584) +++ stable/12/sys/netinet/tcp_output.c Thu Sep 10 15:58:37 2020 (r365585) @@ -1133,6 +1133,7 @@ send: * Ignore pure ack packets, retransmissions and window probes. */ if (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) && + (sack_rxmit == 0) && !((tp->t_flags & TF_FORCEDATA) && len == 1 && SEQ_LT(tp->snd_una, tp->snd_max))) { #ifdef INET6 Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 15:37:29 2020 (r365584) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 15:58:37 2020 (r365585) @@ -8272,6 +8272,7 @@ send: * retransmissions and window probes. */ if (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) && + (sack_rxmit == 0) && !((tp->t_flags & TF_FORCEDATA) && len == 1)) { #ifdef INET6 if (isipv6) From owner-svn-src-stable@freebsd.org Thu Sep 10 16:44:31 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26C1F3DD1C8; Thu, 10 Sep 2020 16:44:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnPqf2kcDz4HVr; Thu, 10 Sep 2020 16:44:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C69E915EE8; Thu, 10 Sep 2020 16:44:29 +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 08AGiTdX098704; Thu, 10 Sep 2020 16:44:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AGiTSa098701; Thu, 10 Sep 2020 16:44:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101644.08AGiTSa098701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 16:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365586 - in stable/12/sys/netinet: . cc tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . cc tcp_stacks X-SVN-Commit-Revision: 365586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 16:44:31 -0000 Author: tuexen Date: Thu Sep 10 16:44:28 2020 New Revision: 365586 URL: https://svnweb.freebsd.org/changeset/base/365586 Log: MFC r357116: Sending CWR after an RTO is according to RFC 3168 generally required and not only for the DCTCP congestion control. Modified: stable/12/sys/netinet/cc/cc_dctcp.c stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/cc/cc_dctcp.c ============================================================================== --- stable/12/sys/netinet/cc/cc_dctcp.c Thu Sep 10 15:58:37 2020 (r365585) +++ stable/12/sys/netinet/cc/cc_dctcp.c Thu Sep 10 16:44:28 2020 (r365586) @@ -282,7 +282,6 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) dctcp_data->ece_curr = 1; break; case CC_RTO: - CCV(ccv, t_flags) |= TF_ECN_SND_CWR; dctcp_update_alpha(ccv); dctcp_data->save_sndnxt += CCV(ccv, t_maxseg); dctcp_data->num_cong_events++; Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu Sep 10 15:58:37 2020 (r365585) +++ stable/12/sys/netinet/tcp_input.c Thu Sep 10 16:44:28 2020 (r365586) @@ -438,6 +438,8 @@ cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, ui tp->snd_ssthresh = max(2, min(tp->snd_wnd, tp->snd_cwnd) / 2 / maxseg) * maxseg; tp->snd_cwnd = maxseg; + if (tp->t_flags & TF_ECN_PERMIT) + tp->t_flags |= TF_ECN_SND_CWR; break; case CC_RTO_ERR: TCPSTAT_INC(tcps_sndrexmitbad); Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 15:58:37 2020 (r365585) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 16:44:28 2020 (r365586) @@ -1444,6 +1444,8 @@ rack_cong_signal(struct tcpcb *tp, struct tcphdr *th, tp->snd_ssthresh = max(2, min(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg) * tp->t_maxseg; tp->snd_cwnd = tp->t_maxseg; + if (tp->t_flags & TF_ECN_PERMIT) + tp->t_flags |= TF_ECN_SND_CWR; break; case CC_RTO_ERR: TCPSTAT_INC(tcps_sndrexmitbad); From owner-svn-src-stable@freebsd.org Thu Sep 10 16:47:09 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46CB33DD682; Thu, 10 Sep 2020 16:47:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnPtj1961z4J8X; Thu, 10 Sep 2020 16:47: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CAF515D40; Thu, 10 Sep 2020 16:47:09 +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 08AGl81A098877; Thu, 10 Sep 2020 16:47:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AGl8xV098876; Thu, 10 Sep 2020 16:47:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101647.08AGl8xV098876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 16:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365587 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 16:47:09 -0000 Author: tuexen Date: Thu Sep 10 16:47:08 2020 New Revision: 365587 URL: https://svnweb.freebsd.org/changeset/base/365587 Log: MFC r358023: Don't use uninitialised stack memory if the sysctl variable net.inet.tcp.hostcache.enable is set to 0. The bug resulted in using possibly a too small MSS value or wrong initial retransmission timer settings. Possibly the value used for ssthresh was also wrong. Modified: stable/12/sys/netinet/tcp_hostcache.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_hostcache.c ============================================================================== --- stable/12/sys/netinet/tcp_hostcache.c Thu Sep 10 16:44:28 2020 (r365586) +++ stable/12/sys/netinet/tcp_hostcache.c Thu Sep 10 16:47:08 2020 (r365587) @@ -437,8 +437,10 @@ tcp_hc_get(struct in_conninfo *inc, struct hc_metrics_ { struct hc_metrics *hc_entry; - if (!V_tcp_use_hostcache) + if (!V_tcp_use_hostcache) { + bzero(hc_metrics_lite, sizeof(*hc_metrics_lite)); return; + } /* * Find the right bucket. From owner-svn-src-stable@freebsd.org Thu Sep 10 16:59:55 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C9883DE196; Thu, 10 Sep 2020 16:59:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQ9Q6JRQz4KbX; Thu, 10 Sep 2020 16:59:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBA6F15FE4; Thu, 10 Sep 2020 16:59:54 +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 08AGxsKv005320; Thu, 10 Sep 2020 16:59:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AGxs0x005318; Thu, 10 Sep 2020 16:59:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101659.08AGxs0x005318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 16:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365589 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 365589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 16:59:55 -0000 Author: tuexen Date: Thu Sep 10 16:59:54 2020 New Revision: 365589 URL: https://svnweb.freebsd.org/changeset/base/365589 Log: MFC r357100: The server side of TCP fast open relies on the delayed ACK timer to allow including user data in the SYN-ACK. When DSACK support was added in r347382, an immediate ACK was sent even for the received SYN with user data. This patch fixes that and allows again to send user data with the SYN-ACK. Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu Sep 10 16:47:12 2020 (r365588) +++ stable/12/sys/netinet/tcp_input.c Thu Sep 10 16:59:54 2020 (r365589) @@ -2299,7 +2299,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru /* * DSACK - add SACK block for dropped range */ - if (tp->t_flags & TF_SACK_PERMIT) { + if ((todrop > 0) && (tp->t_flags & TF_SACK_PERMIT)) { tcp_update_sack_list(tp, th->th_seq, th->th_seq + todrop); /* Modified: stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c Thu Sep 10 16:47:12 2020 (r365588) +++ stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c Thu Sep 10 16:59:54 2020 (r365589) @@ -495,7 +495,7 @@ ctf_drop_checks(struct tcpopt *to, struct mbuf *m, str /* * DSACK - add SACK block for dropped range */ - if (tp->t_flags & TF_SACK_PERMIT) { + if ((todrop > 0) && (tp->t_flags & TF_SACK_PERMIT)) { tcp_update_sack_list(tp, th->th_seq, th->th_seq + tlen); /* * ACK now, as the next in-sequence segment From owner-svn-src-stable@freebsd.org Thu Sep 10 17:03:37 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 946F73DE155; Thu, 10 Sep 2020 17:03:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQFj3QN9z4KpT; Thu, 10 Sep 2020 17:03:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58889161CD; Thu, 10 Sep 2020 17:03: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 08AH3bbt011266; Thu, 10 Sep 2020 17:03:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AH3boX011265; Thu, 10 Sep 2020 17:03:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101703.08AH3boX011265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365590 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 17:03:37 -0000 Author: tuexen Date: Thu Sep 10 17:03:36 2020 New Revision: 365590 URL: https://svnweb.freebsd.org/changeset/base/365590 Log: MFC r357816 (from rrs) This small fix makes it so we properly follow the RFC and only enable ECN when both the CWR and ECT bits our set within the SYN packet. Modified: stable/12/sys/netinet/tcp_syncache.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 16:59:54 2020 (r365589) +++ stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 17:03:36 2020 (r365590) @@ -1607,7 +1607,8 @@ skip_alloc: sc->sc_peer_mss = to->to_mss; /* peer mss may be zero */ if (ltflags & TF_NOOPT) sc->sc_flags |= SCF_NOOPT; - if ((th->th_flags & (TH_ECE|TH_CWR)) && V_tcp_do_ecn) + if (((th->th_flags & (TH_ECE|TH_CWR)) == (TH_ECE|TH_CWR)) && + V_tcp_do_ecn) sc->sc_flags |= SCF_ECN; if (V_tcp_syncookies) From owner-svn-src-stable@freebsd.org Thu Sep 10 17:12:42 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA6FE3DE723; Thu, 10 Sep 2020 17:12:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQSB5Tk1z4LZY; Thu, 10 Sep 2020 17:12:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0D7D164B8; Thu, 10 Sep 2020 17:12:42 +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 08AHCgrh017308; Thu, 10 Sep 2020 17:12:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHCgso017306; Thu, 10 Sep 2020 17:12:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101712.08AHCgso017306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365591 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 365591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 17:12:42 -0000 Author: tuexen Date: Thu Sep 10 17:12:42 2020 New Revision: 365591 URL: https://svnweb.freebsd.org/changeset/base/365591 Log: MFC r364754: RFC 3465 defines a limit L used in TCP slow start for limiting the number of acked bytes as described in Section 2.2 of that document. This patch ensures that this limit is not also applied in congestion avoidance. Applying this limit also in congestion avoidance can result in using less bandwidth than allowed. Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu Sep 10 17:03:36 2020 (r365590) +++ stable/12/sys/netinet/tcp_input.c Thu Sep 10 17:12:42 2020 (r365591) @@ -309,8 +309,7 @@ cc_ack_received(struct tcpcb *tp, struct tcphdr *th, u if (type == CC_ACK) { if (tp->snd_cwnd > tp->snd_ssthresh) { - tp->t_bytes_acked += min(tp->ccv->bytes_this_ack, - nsegs * V_tcp_abc_l_var * tcp_maxseg(tp)); + tp->t_bytes_acked += tp->ccv->bytes_this_ack; if (tp->t_bytes_acked >= tp->snd_cwnd) { tp->t_bytes_acked -= tp->snd_cwnd; tp->ccv->flags |= CCF_ABC_SENTAWND; Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:03:36 2020 (r365590) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:12:42 2020 (r365591) @@ -1322,8 +1322,7 @@ rack_ack_received(struct tcpcb *tp, struct tcp_rack *r } #endif if (tp->snd_cwnd > tp->snd_ssthresh) { - tp->t_bytes_acked += min(tp->ccv->bytes_this_ack, - nsegs * V_tcp_abc_l_var * tp->t_maxseg); + tp->t_bytes_acked += tp->ccv->bytes_this_ack; if (tp->t_bytes_acked >= tp->snd_cwnd) { tp->t_bytes_acked -= tp->snd_cwnd; tp->ccv->flags |= CCF_ABC_SENTAWND; From owner-svn-src-stable@freebsd.org Thu Sep 10 17:26:17 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A6313DF18C; Thu, 10 Sep 2020 17:26:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQlr6MDdz4Md4; Thu, 10 Sep 2020 17:26:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B658A16445; Thu, 10 Sep 2020 17:26:16 +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 08AHQGjL023539; Thu, 10 Sep 2020 17:26:16 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHQGCJ023538; Thu, 10 Sep 2020 17:26:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101726.08AHQGCJ023538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365594 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 17:26:17 -0000 Author: tuexen Date: Thu Sep 10 17:26:16 2020 New Revision: 365594 URL: https://svnweb.freebsd.org/changeset/base/365594 Log: MFC r350973 (from rrs): Place back in the dependency on HPTS via module depends versus a fatal error in compiling. This was taken out by mistake when I mis-merged from the 18q22p2 sources of rack in NF. Opps. Modified: stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:23:30 2020 (r365593) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:26:16 2020 (r365594) @@ -127,10 +127,6 @@ uma_zone_t rack_pcb_zone; struct sysctl_ctx_list rack_sysctl_ctx; struct sysctl_oid *rack_sysctl_root; -#ifndef TCPHPTS -#error Kernel option TCPHPTS is required -#endif - #define CUM_ACKED 1 #define SACKED 2 @@ -9296,3 +9292,4 @@ static moduledata_t tcp_rack = { MODULE_VERSION(MODNAME, 1); DECLARE_MODULE(MODNAME, tcp_rack, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); +MODULE_DEPEND(MODNAME, tcphpts, 1, 1, 1); From owner-svn-src-stable@freebsd.org Thu Sep 10 17:29:21 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 232943DF1B1; Thu, 10 Sep 2020 17:29:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQqP07dJz4Myg; Thu, 10 Sep 2020 17:29: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC0E216341; Thu, 10 Sep 2020 17:29:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AHTKS8023741; Thu, 10 Sep 2020 17:29:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHTKPc023740; Thu, 10 Sep 2020 17:29:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101729.08AHTKPc023740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365595 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 17:29:21 -0000 Author: tuexen Date: Thu Sep 10 17:29:20 2020 New Revision: 365595 URL: https://svnweb.freebsd.org/changeset/base/365595 Log: MFC r351328 (by rrs): Fix an issue when TSO and Rack play together. Basically an retransmission of the initial SYN (with data) would cause us to strip the SYN and decrement/increase offset/len which then caused us a -1 offset and a panic. Modified: stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:26:16 2020 (r365594) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:29:20 2020 (r365595) @@ -7467,9 +7467,6 @@ again: (tp->t_state == TCPS_SYN_RECEIVED)) flags &= ~TH_SYN; #endif - sb_offset--, len++; - if (sbavail(sb) == 0) - len = 0; } /* * Be careful not to send data and/or FIN on SYN segments. This From owner-svn-src-stable@freebsd.org Thu Sep 10 17:31:35 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A5FB3DF242; Thu, 10 Sep 2020 17:31:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQsz18rqz4NTy; Thu, 10 Sep 2020 17:31:35 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B0C316351; Thu, 10 Sep 2020 17:31:35 +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 08AHVY6d024657; Thu, 10 Sep 2020 17:31:34 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHVYSE024656; Thu, 10 Sep 2020 17:31:34 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101731.08AHVYSE024656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365596 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 17:31:35 -0000 Author: tuexen Date: Thu Sep 10 17:31:34 2020 New Revision: 365596 URL: https://svnweb.freebsd.org/changeset/base/365596 Log: MFC r351782: Fix two TCP RACK issues: * Convert the TCP delayed ACK timer from ms to ticks as required. This fixes the timer on platforms with hz != 1000. * Don't delay acknowledgements which report duplicate data using DSACKs. Modified: stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:29:20 2020 (r365595) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:31:34 2020 (r365596) @@ -1802,6 +1802,11 @@ rack_drop_checks(struct tcpopt *to, struct mbuf *m, st * will clear the DSACK block again */ tp->t_flags |= TF_ACKNOW; + /* + * ACK now, as the next in-sequence segment + * will clear the DSACK block again + */ + tp->t_flags |= TF_ACKNOW; } *drop_hdrlen += todrop; /* drop from the top afterwards */ th->th_seq += todrop; @@ -2350,7 +2355,7 @@ rack_start_hpts_timer(struct tcp_rack *rack, struct tc } hpts_timeout = rack_timer_start(tp, rack, cts); if (tp->t_flags & TF_DELACK) { - delayed_ack = tcp_delacktime; + delayed_ack = TICKS_2_MSEC(tcp_delacktime); rack->r_ctl.rc_hpts_flags |= PACE_TMR_DELACK; } if (delayed_ack && ((hpts_timeout == 0) || From owner-svn-src-stable@freebsd.org Thu Sep 10 17:41:24 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A6953DF712; Thu, 10 Sep 2020 17:41:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnR5J24Tdz4NnW; Thu, 10 Sep 2020 17:41:24 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A93116361; Thu, 10 Sep 2020 17:41:24 +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 08AHfOIK030127; Thu, 10 Sep 2020 17:41:24 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHfO8w030126; Thu, 10 Sep 2020 17:41:24 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101741.08AHfO8w030126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365597 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 17:41:24 -0000 Author: tuexen Date: Thu Sep 10 17:41:23 2020 New Revision: 365597 URL: https://svnweb.freebsd.org/changeset/base/365597 Log: MFC r352661 (from rrs): lets put (void) in a couple of functions to keep older platforms that are stuck with gcc happy (ppc). The changes are needed in both bbr and rack. Modified: stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:31:34 2020 (r365596) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:41:23 2020 (r365597) @@ -479,7 +479,7 @@ sysctl_rack_clear(SYSCTL_HANDLER_ARGS) static void -rack_init_sysctls() +rack_init_sysctls(void) { SYSCTL_ADD_S32(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_sysctl_root), @@ -1130,7 +1130,7 @@ rack_log_to_processing(struct tcp_rack *rack, uint32_t } static void -rack_counter_destroy() +rack_counter_destroy(void) { counter_u64_free(rack_badfr); counter_u64_free(rack_badfr_bytes); From owner-svn-src-stable@freebsd.org Thu Sep 10 17:44:28 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E09B3DF5BF; Thu, 10 Sep 2020 17:44:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnR8r000Vz4P2k; Thu, 10 Sep 2020 17:44:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D688616952; Thu, 10 Sep 2020 17:44:27 +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 08AHiRYl036199; Thu, 10 Sep 2020 17:44:27 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHiRRm036198; Thu, 10 Sep 2020 17:44:27 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101744.08AHiRRm036198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365598 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 17:44:28 -0000 Author: tuexen Date: Thu Sep 10 17:44:27 2020 New Revision: 365598 URL: https://svnweb.freebsd.org/changeset/base/365598 Log: MFC r353490 (from rrs): if_hw_tsomaxsegsize needs to be initialized to zero, just like in bbr.c and tcp_output.c Modified: stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:41:23 2020 (r365597) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:44:27 2020 (r365598) @@ -6996,7 +6996,7 @@ rack_output(struct tcpcb *tp) struct mbuf *m; struct mbuf *mb; uint32_t if_hw_tsomaxsegcount = 0; - uint32_t if_hw_tsomaxsegsize; + uint32_t if_hw_tsomaxsegsize = 0; long tot_len_this_send = 0; struct ip *ip = NULL; #ifdef TCPDEBUG From owner-svn-src-stable@freebsd.org Thu Sep 10 17:49:22 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 592413DF873; Thu, 10 Sep 2020 17:49:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnRGV1hh8z4PVL; Thu, 10 Sep 2020 17:49:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D43616C91; Thu, 10 Sep 2020 17:49:22 +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 08AHnLWg036660; Thu, 10 Sep 2020 17:49:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHnL8m036658; Thu, 10 Sep 2020 17:49:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101749.08AHnL8m036658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365601 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 365601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 17:49:22 -0000 Author: tuexen Date: Thu Sep 10 17:49:21 2020 New Revision: 365601 URL: https://svnweb.freebsd.org/changeset/base/365601 Log: MFC r356417 (from rrs): This catches rack up in the recent changes to ECN and also commonizes the functions that both the freebsd and rack stack uses. Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c stable/12/sys/netinet/tcp_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu Sep 10 17:48:27 2020 (r365600) +++ stable/12/sys/netinet/tcp_input.c Thu Sep 10 17:49:21 2020 (r365601) @@ -493,7 +493,7 @@ cc_post_recovery(struct tcpcb *tp, struct tcphdr *th) (tlen <= tp->t_maxseg) && \ (V_tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN))) -static void inline +void inline cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos) { INP_WLOCK_ASSERT(tp->t_inpcb); Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:48:27 2020 (r365600) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:49:21 2020 (r365601) @@ -6752,6 +6752,10 @@ rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th TCPSTAT_INC(tcps_ecn_ect1); break; } + + /* Process a packet differently from RFC3168. */ + cc_ecnpkt_handler(tp, th, iptos); + /* Congestion experienced. */ if (thflags & TH_ECE) { rack_cong_signal(tp, th, CC_ECN); Modified: stable/12/sys/netinet/tcp_var.h ============================================================================== --- stable/12/sys/netinet/tcp_var.h Thu Sep 10 17:48:27 2020 (r365600) +++ stable/12/sys/netinet/tcp_var.h Thu Sep 10 17:49:21 2020 (r365601) @@ -868,6 +868,7 @@ void cc_ack_received(struct tcpcb *tp, struct tcphdr * uint16_t nsegs, uint16_t type); void cc_conn_init(struct tcpcb *tp); void cc_post_recovery(struct tcpcb *tp, struct tcphdr *th); +void cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos); void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); #ifdef TCP_HHOOK void hhook_run_tcp_est_in(struct tcpcb *tp, From owner-svn-src-stable@freebsd.org Thu Sep 10 18:04:35 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C8063E0195; Thu, 10 Sep 2020 18:04:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnRc2714qz4Qtp; Thu, 10 Sep 2020 18:04:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3F4A16E2D; Thu, 10 Sep 2020 18:04:34 +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 08AI4YAu048484; Thu, 10 Sep 2020 18:04:34 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AI4YOW048483; Thu, 10 Sep 2020 18:04:34 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101804.08AI4YOW048483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 18:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365604 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 18:04:35 -0000 Author: tuexen Date: Thu Sep 10 18:04:34 2020 New Revision: 365604 URL: https://svnweb.freebsd.org/changeset/base/365604 Log: MFC r350061: Fix compilation on platforms using gcc. When compiling RACK on platforms using gcc, a warning that tcp_outflags is defined but not used is issued and terminates compilation on PPC64, for example. So don't indicate that tcp_outflags is used. Modified: stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c Thu Sep 10 17:58:24 2020 (r365603) +++ stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c Thu Sep 10 18:04:34 2020 (r365604) @@ -85,7 +85,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define TCPOUTFLAGS #include #include #include From owner-svn-src-stable@freebsd.org Thu Sep 10 19:00:22 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D0453E180F; Thu, 10 Sep 2020 19:00:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnSrQ0Zpbz4VF3; Thu, 10 Sep 2020 19:00:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBF5D179BF; Thu, 10 Sep 2020 19:00:21 +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 08AJ0LYH082502; Thu, 10 Sep 2020 19:00:21 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AJ0Iql082480; Thu, 10 Sep 2020 19:00:18 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202009101900.08AJ0Iql082480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 10 Sep 2020 19:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365608 - in stable/12: lib/lib80211 sbin/ifconfig share/man/man4 sys/contrib/dev/ath/ath_hal/ar9300 sys/dev/an sys/dev/ath sys/dev/ath/ath_dfs/null sys/dev/ath/ath_hal sys/dev/ath/ath_... X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in stable/12: lib/lib80211 sbin/ifconfig share/man/man4 sys/contrib/dev/ath/ath_hal/ar9300 sys/dev/an sys/dev/ath sys/dev/ath/ath_dfs/null sys/dev/ath/ath_hal sys/dev/ath/ath_hal/ah_regdomain sys/dev/... X-SVN-Commit-Revision: 365608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 19:00:22 -0000 Author: bz Date: Thu Sep 10 19:00:17 2020 New Revision: 365608 URL: https://svnweb.freebsd.org/changeset/base/365608 Log: MFC r344749-344750,344841-344843,345284,346405,346470,347140-347141,348331, 349593,351868,353506-353507,353809,353853,353858,353860,356852,359063, 359158,360819,360888,360950-360951,360953-360954,360998,361009,361025, 361085,361087,361098,361106-361107,361115,361118,361319-361321,361486, 361560,361566,361626,361636-361637,361687,361726,361737-361738,361768, 361778,361811-361813,361819-361822,361825-361826,361834,361863-361864, 361878,361885-361886,362016,362084-362085,362156-362157,362161-362162, 362210-362213,362216,362256-362257,362671,362815-362816,363325, 363327-363328,364011-364012,364299,364301,364303,364312,364315, 364326-364327,364551,364553,364673,365097,365116,365125-365126, 365130-365131,365198,365419 by adrian(78), bcran(1), bz(13), cem(1), gavin(1), glebius(6), landonf(1), mjg(7) Merge WiFi net80211, drivers, and management in order to support better 11n and upcoming 11ac. This includes an ath(4) update, some run(4) 11n support, 11n for otus(4), A-MPDU, A-MSDU, A-MPDU+A-MSDU and Fast frames options, scanning fixes, enahnced PRIV checks for jails, restored parent device name printing, improvements for upcoming VHT support, lots of under-the-hood infrastructure improvements, new device ID, debug tools updates, some whistespace changes (to make future MFCs easier). This does not include (nost) epoch(9) related changes as too much other infrastructure was not merged for that. Bump __FreeBSD_veresion as this changes the priv(9) names (not know to be used externally), and net80211 structures. Tested on: some ath(4) AP, run(4) STA, and rtwn(4) STA Discussed with: adrian (extremly briefly) Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") [partially] Relnotes: yes Added: stable/12/tools/tools/ath/athani/ - copied from r344842, head/tools/tools/ath/athani/ Modified: stable/12/lib/lib80211/lib80211_regdomain.c stable/12/lib/lib80211/lib80211_regdomain.h stable/12/lib/lib80211/regdomain.xml stable/12/sbin/ifconfig/ifieee80211.c stable/12/share/man/man4/ath.4 stable/12/share/man/man4/net80211.4 stable/12/share/man/man4/run.4 stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_osprey_k31.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_wasp_2.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb112.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb113.h stable/12/sys/dev/an/if_an.c stable/12/sys/dev/ath/ah_osdep.c stable/12/sys/dev/ath/ah_osdep_ar5210.c stable/12/sys/dev/ath/ah_osdep_ar5211.c stable/12/sys/dev/ath/ah_osdep_ar5212.c stable/12/sys/dev/ath/ah_osdep_ar5416.c stable/12/sys/dev/ath/ah_osdep_ar9300.c stable/12/sys/dev/ath/ath_dfs/null/dfs_null.c stable/12/sys/dev/ath/ath_hal/ah.c stable/12/sys/dev/ath/ath_hal/ah.h stable/12/sys/dev/ath/ath_hal/ah_eeprom_9287.c stable/12/sys/dev/ath/ath_hal/ah_eeprom_9287.h stable/12/sys/dev/ath/ath_hal/ah_eeprom_v14.c stable/12/sys/dev/ath/ath_hal/ah_eeprom_v3.c stable/12/sys/dev/ath/ath_hal/ah_eeprom_v3.h stable/12/sys/dev/ath/ath_hal/ah_eeprom_v4k.c stable/12/sys/dev/ath/ath_hal/ah_internal.h stable/12/sys/dev/ath/ath_hal/ah_regdomain.c stable/12/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h stable/12/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_freqbands.h stable/12/sys/dev/ath/ath_hal/ah_soc.h stable/12/sys/dev/ath/ath_hal/ar5210/ar5210.h stable/12/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c stable/12/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c stable/12/sys/dev/ath/ath_hal/ar5211/ar5211.h stable/12/sys/dev/ath/ath_hal/ar5211/ar5211_keycache.c stable/12/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c stable/12/sys/dev/ath/ath_hal/ar5211/ar5211_phy.c stable/12/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c stable/12/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c stable/12/sys/dev/ath/ath_hal/ar5211/ar5211phy.h stable/12/sys/dev/ath/ath_hal/ar5211/ar5211reg.h stable/12/sys/dev/ath/ath_hal/ar5212/ar2316.c stable/12/sys/dev/ath/ath_hal/ar5212/ar2317.c stable/12/sys/dev/ath/ath_hal/ar5212/ar2413.c stable/12/sys/dev/ath/ath_hal/ar5212/ar2425.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5111.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5112.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212.h stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_keycache.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212phy.h stable/12/sys/dev/ath/ath_hal/ar5212/ar5413.c stable/12/sys/dev/ath/ath_hal/ar5312/ar5312_eeprom.c stable/12/sys/dev/ath/ath_hal/ar5312/ar5312_gpio.c stable/12/sys/dev/ath/ath_hal/ar5312/ar5312_interrupts.c stable/12/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c stable/12/sys/dev/ath/ath_hal/ar5312/ar5312reg.h stable/12/sys/dev/ath/ath_hal/ar5312/ar5315_gpio.c stable/12/sys/dev/ath/ath_hal/ar5416/ar2133.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416.h stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_power.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416desc.h stable/12/sys/dev/ath/ath_hal/ar5416/ar5416reg.h stable/12/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c stable/12/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9285.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9287_cal.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c stable/12/sys/dev/ath/ath_rate/amrr/amrr.c stable/12/sys/dev/ath/ath_rate/onoe/onoe.c stable/12/sys/dev/ath/ath_rate/sample/sample.c stable/12/sys/dev/ath/ath_rate/sample/sample.h stable/12/sys/dev/ath/ath_rate/sample/tx_schedules.h stable/12/sys/dev/ath/if_ath.c stable/12/sys/dev/ath/if_ath_ahb.c stable/12/sys/dev/ath/if_ath_beacon.c stable/12/sys/dev/ath/if_ath_beacon.h stable/12/sys/dev/ath/if_ath_btcoex.c stable/12/sys/dev/ath/if_ath_dfs.c stable/12/sys/dev/ath/if_ath_drv.c stable/12/sys/dev/ath/if_ath_ioctl.c stable/12/sys/dev/ath/if_ath_led.c stable/12/sys/dev/ath/if_ath_lna_div.c stable/12/sys/dev/ath/if_ath_misc.h stable/12/sys/dev/ath/if_ath_pci.c stable/12/sys/dev/ath/if_ath_pci_devlist.h stable/12/sys/dev/ath/if_ath_rate.c stable/12/sys/dev/ath/if_ath_rx.c stable/12/sys/dev/ath/if_ath_rx_edma.c stable/12/sys/dev/ath/if_ath_spectral.c stable/12/sys/dev/ath/if_ath_sysctl.c stable/12/sys/dev/ath/if_ath_tx.c stable/12/sys/dev/ath/if_ath_tx.h stable/12/sys/dev/ath/if_ath_tx_edma.c stable/12/sys/dev/ath/if_ath_tx_ht.c stable/12/sys/dev/ath/if_athioctl.h stable/12/sys/dev/ath/if_athrate.h stable/12/sys/dev/ath/if_athvar.h stable/12/sys/dev/bwi/bwimac.c stable/12/sys/dev/bwi/bwiphy.c stable/12/sys/dev/bwi/bwirf.c stable/12/sys/dev/bwi/if_bwi.c stable/12/sys/dev/bwi/if_bwi_pci.c stable/12/sys/dev/bwi/if_bwireg.h stable/12/sys/dev/bwn/if_bwn.c stable/12/sys/dev/bwn/if_bwn_pci.c stable/12/sys/dev/bwn/if_bwn_pcivar.h stable/12/sys/dev/bwn/if_bwn_phy_g.c stable/12/sys/dev/bwn/if_bwnvar.h stable/12/sys/dev/iwm/if_iwm.c stable/12/sys/dev/iwn/if_iwn.c stable/12/sys/dev/mwl/if_mwl.c stable/12/sys/dev/mwl/if_mwl_pci.c stable/12/sys/dev/mwl/mwlreg.h stable/12/sys/dev/otus/if_otus.c stable/12/sys/dev/otus/if_otusreg.h stable/12/sys/dev/rtwn/if_rtwn.c stable/12/sys/dev/rtwn/if_rtwn_beacon.c stable/12/sys/dev/rtwn/if_rtwn_calib.c stable/12/sys/dev/rtwn/if_rtwn_cam.c stable/12/sys/dev/rtwn/if_rtwn_efuse.c stable/12/sys/dev/rtwn/if_rtwn_fw.c stable/12/sys/dev/rtwn/if_rtwn_fw.h stable/12/sys/dev/rtwn/if_rtwn_ridx.h stable/12/sys/dev/rtwn/if_rtwn_rx.c stable/12/sys/dev/rtwn/if_rtwn_rx.h stable/12/sys/dev/rtwn/if_rtwn_task.c stable/12/sys/dev/rtwn/if_rtwn_tx.c stable/12/sys/dev/rtwn/if_rtwnreg.h stable/12/sys/dev/rtwn/if_rtwnvar.h stable/12/sys/dev/rtwn/pci/rtwn_pci_attach.c stable/12/sys/dev/rtwn/pci/rtwn_pci_reg.c stable/12/sys/dev/rtwn/pci/rtwn_pci_rx.c stable/12/sys/dev/rtwn/pci/rtwn_pci_tx.c stable/12/sys/dev/rtwn/pci/rtwn_pci_var.h stable/12/sys/dev/rtwn/rtl8188e/pci/r88ee.h stable/12/sys/dev/rtwn/rtl8188e/pci/r88ee_reg.h stable/12/sys/dev/rtwn/rtl8188e/r88e.h stable/12/sys/dev/rtwn/rtl8188e/r88e_beacon.c stable/12/sys/dev/rtwn/rtl8188e/r88e_calib.c stable/12/sys/dev/rtwn/rtl8188e/r88e_chan.c stable/12/sys/dev/rtwn/rtl8188e/r88e_fw.c stable/12/sys/dev/rtwn/rtl8188e/r88e_init.c stable/12/sys/dev/rtwn/rtl8188e/r88e_led.c stable/12/sys/dev/rtwn/rtl8188e/r88e_priv.h stable/12/sys/dev/rtwn/rtl8188e/r88e_reg.h stable/12/sys/dev/rtwn/rtl8188e/r88e_rf.c stable/12/sys/dev/rtwn/rtl8188e/r88e_rom.c stable/12/sys/dev/rtwn/rtl8188e/r88e_rx.c stable/12/sys/dev/rtwn/rtl8188e/r88e_tx.c stable/12/sys/dev/rtwn/rtl8188e/usb/r88eu.h stable/12/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c stable/12/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce.h stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_calib.c stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_fw.c stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_init.c stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_priv.h stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_reg.h stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_rx.c stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_tx.c stable/12/sys/dev/rtwn/rtl8192c/r92c.h stable/12/sys/dev/rtwn/rtl8192c/r92c_attach.c stable/12/sys/dev/rtwn/rtl8192c/r92c_beacon.c stable/12/sys/dev/rtwn/rtl8192c/r92c_calib.c stable/12/sys/dev/rtwn/rtl8192c/r92c_chan.c stable/12/sys/dev/rtwn/rtl8192c/r92c_fw.c stable/12/sys/dev/rtwn/rtl8192c/r92c_init.c stable/12/sys/dev/rtwn/rtl8192c/r92c_priv.h stable/12/sys/dev/rtwn/rtl8192c/r92c_reg.h stable/12/sys/dev/rtwn/rtl8192c/r92c_rf.c stable/12/sys/dev/rtwn/rtl8192c/r92c_rom.c stable/12/sys/dev/rtwn/rtl8192c/r92c_rx.c stable/12/sys/dev/rtwn/rtl8192c/r92c_tx.c stable/12/sys/dev/rtwn/rtl8192c/r92c_tx_desc.h stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu.h stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_led.c stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_priv.h stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_reg.h stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_rx.c stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_tx.c stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_tx_desc.h stable/12/sys/dev/rtwn/rtl8192e/r92e.h stable/12/sys/dev/rtwn/rtl8192e/r92e_chan.c stable/12/sys/dev/rtwn/rtl8192e/r92e_priv.h stable/12/sys/dev/rtwn/rtl8192e/usb/r92eu.h stable/12/sys/dev/rtwn/rtl8812a/r12a.h stable/12/sys/dev/rtwn/rtl8812a/r12a_beacon.c stable/12/sys/dev/rtwn/rtl8812a/r12a_calib.c stable/12/sys/dev/rtwn/rtl8812a/r12a_caps.c stable/12/sys/dev/rtwn/rtl8812a/r12a_chan.c stable/12/sys/dev/rtwn/rtl8812a/r12a_fw.c stable/12/sys/dev/rtwn/rtl8812a/r12a_fw_cmd.h stable/12/sys/dev/rtwn/rtl8812a/r12a_init.c stable/12/sys/dev/rtwn/rtl8812a/r12a_led.c stable/12/sys/dev/rtwn/rtl8812a/r12a_priv.h stable/12/sys/dev/rtwn/rtl8812a/r12a_reg.h stable/12/sys/dev/rtwn/rtl8812a/r12a_rf.c stable/12/sys/dev/rtwn/rtl8812a/r12a_rom.c stable/12/sys/dev/rtwn/rtl8812a/r12a_rx.c stable/12/sys/dev/rtwn/rtl8812a/r12a_tx.c stable/12/sys/dev/rtwn/rtl8812a/r12a_tx_desc.h stable/12/sys/dev/rtwn/rtl8812a/usb/r12au.h stable/12/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c stable/12/sys/dev/rtwn/rtl8812a/usb/r12au_init.c stable/12/sys/dev/rtwn/rtl8812a/usb/r12au_rx.c stable/12/sys/dev/rtwn/rtl8812a/usb/r12au_tx.c stable/12/sys/dev/rtwn/rtl8821a/r21a.h stable/12/sys/dev/rtwn/rtl8821a/r21a_beacon.c stable/12/sys/dev/rtwn/rtl8821a/r21a_calib.c stable/12/sys/dev/rtwn/rtl8821a/r21a_chan.c stable/12/sys/dev/rtwn/rtl8821a/r21a_fw.c stable/12/sys/dev/rtwn/rtl8821a/r21a_init.c stable/12/sys/dev/rtwn/rtl8821a/r21a_led.c stable/12/sys/dev/rtwn/rtl8821a/r21a_priv.h stable/12/sys/dev/rtwn/rtl8821a/r21a_reg.h stable/12/sys/dev/rtwn/rtl8821a/r21a_rom.c stable/12/sys/dev/rtwn/rtl8821a/r21a_rx.c stable/12/sys/dev/rtwn/rtl8821a/usb/r21au.h stable/12/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c stable/12/sys/dev/rtwn/rtl8821a/usb/r21au_dfs.c stable/12/sys/dev/rtwn/rtl8821a/usb/r21au_init.c stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.c stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h stable/12/sys/dev/rtwn/usb/rtwn_usb_ep.c stable/12/sys/dev/rtwn/usb/rtwn_usb_reg.c stable/12/sys/dev/rtwn/usb/rtwn_usb_tx.c stable/12/sys/dev/usb/usbdevs stable/12/sys/dev/usb/wlan/if_rsu.c stable/12/sys/dev/usb/wlan/if_run.c stable/12/sys/dev/usb/wlan/if_runreg.h stable/12/sys/dev/usb/wlan/if_runvar.h stable/12/sys/dev/usb/wlan/if_zyd.c stable/12/sys/dev/wi/if_wavelan_ieee.h stable/12/sys/dev/wi/if_wi.c stable/12/sys/dev/wi/if_wi_macio.c stable/12/sys/dev/wi/if_wi_pccard.c stable/12/sys/dev/wi/if_wi_pci.c stable/12/sys/dev/wpi/if_wpireg.h stable/12/sys/dev/wtap/if_wtap.c stable/12/sys/kern/kern_jail.c stable/12/sys/net80211/_ieee80211.h stable/12/sys/net80211/ieee80211.c stable/12/sys/net80211/ieee80211.h stable/12/sys/net80211/ieee80211_adhoc.c stable/12/sys/net80211/ieee80211_amrr.c stable/12/sys/net80211/ieee80211_ddb.c stable/12/sys/net80211/ieee80211_freebsd.c stable/12/sys/net80211/ieee80211_freebsd.h stable/12/sys/net80211/ieee80211_hostap.c stable/12/sys/net80211/ieee80211_ht.c stable/12/sys/net80211/ieee80211_ht.h stable/12/sys/net80211/ieee80211_input.h stable/12/sys/net80211/ieee80211_ioctl.c stable/12/sys/net80211/ieee80211_ioctl.h stable/12/sys/net80211/ieee80211_node.c stable/12/sys/net80211/ieee80211_node.h stable/12/sys/net80211/ieee80211_output.c stable/12/sys/net80211/ieee80211_phy.h stable/12/sys/net80211/ieee80211_power.c stable/12/sys/net80211/ieee80211_proto.c stable/12/sys/net80211/ieee80211_proto.h stable/12/sys/net80211/ieee80211_regdomain.c stable/12/sys/net80211/ieee80211_scan_sta.c stable/12/sys/net80211/ieee80211_scan_sw.c stable/12/sys/net80211/ieee80211_sta.c stable/12/sys/net80211/ieee80211_sta.h stable/12/sys/net80211/ieee80211_var.h stable/12/sys/net80211/ieee80211_vht.c stable/12/sys/net80211/ieee80211_vht.h stable/12/sys/sys/param.h stable/12/sys/sys/priv.h stable/12/tools/tools/ath/Makefile stable/12/tools/tools/ath/ath_ee_9300_print/main.c stable/12/tools/tools/ath/athratestats/main.c stable/12/tools/tools/net80211/wlanstats/main.c stable/12/tools/tools/net80211/wlanstats/wlanstats.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/lib80211/lib80211_regdomain.c ============================================================================== --- stable/12/lib/lib80211/lib80211_regdomain.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/lib/lib80211/lib80211_regdomain.c Thu Sep 10 19:00:17 2020 (r365608) @@ -192,7 +192,7 @@ decode_flag(struct mystate *mt, const char *p, int len FLAG(IEEE80211_CHAN_VHT40), FLAG(IEEE80211_CHAN_VHT80), /* - * XXX VHT80_80? This likely should be done by + * XXX VHT80P80? This likely should be done by * 80MHz chan logic in net80211 / ifconfig. */ FLAG(IEEE80211_CHAN_VHT160), Modified: stable/12/lib/lib80211/lib80211_regdomain.h ============================================================================== --- stable/12/lib/lib80211/lib80211_regdomain.h Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/lib/lib80211/lib80211_regdomain.h Thu Sep 10 19:00:17 2020 (r365608) @@ -73,10 +73,10 @@ struct regdomain { netband_head bands_11b; /* 11b operation */ netband_head bands_11g; /* 11g operation */ netband_head bands_11a; /* 11a operation */ - netband_head bands_11ng;/* 11ng operation */ - netband_head bands_11na;/* 11na operation */ - netband_head bands_11ac;/* 11ac 5GHz operation */ - netband_head bands_11acg;/* 11ac 2GHz operation */ + netband_head bands_11ng; /* 11ng operation */ + netband_head bands_11na; /* 11na operation */ + netband_head bands_11ac; /* 11ac 5GHz operation */ + netband_head bands_11acg; /* 11ac 2GHz operation */ LIST_ENTRY(regdomain) next; }; Modified: stable/12/lib/lib80211/regdomain.xml ============================================================================== --- stable/12/lib/lib80211/regdomain.xml Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/lib/lib80211/regdomain.xml Thu Sep 10 19:00:17 2020 (r365608) @@ -111,6 +111,44 @@ IEEE80211_CHAN_HT40 + + + + 17 + IEEE80211_CHAN_HT20 + IEEE80211_CHAN_VHT20 + + + + 17 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_VHT40 + + + + 17 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_VHT80 + + + + 17 + IEEE80211_CHAN_HT20 + IEEE80211_CHAN_VHT20 + + + + 17 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_VHT40 + + + + 17 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_VHT80 + + @@ -1735,6 +1773,21 @@ 20 20 IEEE80211_CHAN_A + + 5180 5240 + 20 20 + IEEE80211_CHAN_A + + + 5180 5240 + 40 20 + IEEE80211_CHAN_A + + + 5180 5240 + 80 20 + IEEE80211_CHAN_A + 5180 5240 40 20 @@ -1823,6 +1876,21 @@ 5745 5805 20 20 + IEEE80211_CHAN_A + + + 5745 5805 + 20 20 + IEEE80211_CHAN_A + + + 5745 5805 + 40 20 + IEEE80211_CHAN_A + + + 5745 5805 + 80 20 IEEE80211_CHAN_A Modified: stable/12/sbin/ifconfig/ifieee80211.c ============================================================================== --- stable/12/sbin/ifconfig/ifieee80211.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sbin/ifconfig/ifieee80211.c Thu Sep 10 19:00:17 2020 (r365608) @@ -125,8 +125,19 @@ #define IEEE80211_NODE_AMSDU_RX 0x040000 /* AMSDU rx enabled */ #define IEEE80211_NODE_AMSDU_TX 0x080000 /* AMSDU tx enabled */ #define IEEE80211_NODE_VHT 0x100000 /* VHT enabled */ +#define IEEE80211_NODE_LDPC 0x200000 /* LDPC enabled */ +#define IEEE80211_NODE_UAPSD 0x400000 /* UAPSD enabled */ #endif +/* XXX should also figure out where to put these for k/u-space sharing. */ +#ifndef IEEE80211_FVHT_VHT +#define IEEE80211_FVHT_VHT 0x000000001 /* CONF: VHT supported */ +#define IEEE80211_FVHT_USEVHT40 0x000000002 /* CONF: Use VHT40 */ +#define IEEE80211_FVHT_USEVHT80 0x000000004 /* CONF: Use VHT80 */ +#define IEEE80211_FVHT_USEVHT160 0x000000008 /* CONF: Use VHT160 */ +#define IEEE80211_FVHT_USEVHT80P80 0x000000010 /* CONF: Use VHT 80+80 */ +#endif + #define MAXCHAN 1536 /* max 1.5K channels */ #define MAXCOL 78 @@ -1804,6 +1815,12 @@ set80211ldpc(const char *val, int d, int s, const stru set80211(s, IEEE80211_IOC_LDPC, ldpc, 0, NULL); } +static void +set80211uapsd(const char *val, int d, int s, const struct afswtch *rafp) +{ + set80211(s, IEEE80211_IOC_UAPSD, d, 0, NULL); +} + static DECL_CMD_FUNC(set80211ampdulimit, val, d) { @@ -2159,8 +2176,6 @@ regdomain_addchans(struct ieee80211req_chaninfo *ci, /* * VHT first - HT is a subset. - * - * XXX TODO: VHT80p80, VHT160 is not yet done. */ if (flags & IEEE80211_CHAN_VHT) { if ((chanFlags & IEEE80211_CHAN_VHT20) && @@ -2184,7 +2199,20 @@ regdomain_addchans(struct ieee80211req_chaninfo *ci, "VHT80 channel\n", freq); continue; } - + if ((chanFlags & IEEE80211_CHAN_VHT160) && + (flags & IEEE80211_CHAN_VHT160) == 0) { + if (verbose) + printf("%u: skip, not a " + "VHT160 channel\n", freq); + continue; + } + if ((chanFlags & IEEE80211_CHAN_VHT80P80) && + (flags & IEEE80211_CHAN_VHT80P80) == 0) { + if (verbose) + printf("%u: skip, not a " + "VHT80+80 channel\n", freq); + continue; + } flags &= ~IEEE80211_CHAN_VHT; flags |= chanFlags & IEEE80211_CHAN_VHT; } @@ -2370,7 +2398,7 @@ regdomain_makechannels( &dc->dc_chaninfo); } - /* XXX TODO: VHT80_80, VHT160 */ + /* XXX TODO: VHT80P80, VHT160 */ } if (!LIST_EMPTY(&rd->bands_11ng) && dc->dc_htcaps != 0) { @@ -2631,6 +2659,10 @@ getflags(int flags) *cp++ = 't'; if (flags & IEEE80211_NODE_AMSDU_RX) *cp++ = 'r'; + if (flags & IEEE80211_NODE_UAPSD) + *cp++ = 'U'; + if (flags & IEEE80211_NODE_LDPC) + *cp++ = 'L'; *cp = '\0'; return flagstring; } @@ -3840,8 +3872,8 @@ list_stations(int s) , "TXSEQ" , "RXSEQ" ); - else - printf("%-17.17s %4s %4s %4s %4s %4s %6s %6s %4s %-7s\n" + else + printf("%-17.17s %4s %4s %4s %4s %4s %6s %6s %4s %-12s\n" , "ADDR" , "AID" , "CHAN" @@ -3875,8 +3907,8 @@ list_stations(int s) , gettxseq(si) , getrxseq(si) ); - else - printf("%s %4u %4d %3dM %4.1f %4d %6d %6d %-4.4s %-7.7s" + else + printf("%s %4u %4d %3dM %4.1f %4d %6d %6d %-4.4s %-12.12s" , ether_ntoa((const struct ether_addr*) si->isi_macaddr) , IEEE80211_AID(si->isi_associd) @@ -3937,8 +3969,11 @@ get_chaninfo(const struct ieee80211_channel *c, int pr if (IEEE80211_IS_CHAN_TURBO(c)) strlcat(buf, " Turbo", bsize); if (precise) { - /* XXX should make VHT80U, VHT80D */ - if (IEEE80211_IS_CHAN_VHT80(c) && + if (IEEE80211_IS_CHAN_VHT80P80(c)) + strlcat(buf, " vht/80p80", bsize); + else if (IEEE80211_IS_CHAN_VHT160(c)) + strlcat(buf, " vht/160", bsize); + else if (IEEE80211_IS_CHAN_VHT80(c) && IEEE80211_IS_CHAN_HT40D(c)) strlcat(buf, " vht/80-", bsize); else if (IEEE80211_IS_CHAN_VHT80(c) && @@ -3992,10 +4027,11 @@ print_chaninfo(const struct ieee80211_channel *c, int static int chanpref(const struct ieee80211_channel *c) { + + if (IEEE80211_IS_CHAN_VHT80P80(c)) + return 90; if (IEEE80211_IS_CHAN_VHT160(c)) return 80; - if (IEEE80211_IS_CHAN_VHT80_80(c)) - return 75; if (IEEE80211_IS_CHAN_VHT80(c)) return 70; if (IEEE80211_IS_CHAN_VHT40(c)) @@ -4767,6 +4803,23 @@ getid(int s, int ix, void *data, size_t len, int *plen return 0; } +static int +getdevicename(int s, void *data, size_t len, int *plen) +{ + struct ieee80211req ireq; + + (void) memset(&ireq, 0, sizeof(ireq)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); + ireq.i_type = IEEE80211_IOC_IC_NAME; + ireq.i_val = -1; + ireq.i_data = data; + ireq.i_len = len; + if (ioctl(s, SIOCG80211, &ireq) < 0) + return (-1); + *plen = ireq.i_len; + return (0); +} + static void ieee80211_status(int s) { @@ -5288,30 +5341,40 @@ end: break; } } + if (get80211val(s, IEEE80211_IOC_UAPSD, &val) != -1) { + switch (val) { + case 0: + LINE_CHECK("-uapsd"); + break; + case 1: + LINE_CHECK("uapsd"); + break; + } + } } if (IEEE80211_IS_CHAN_VHT(c) || verbose) { getvhtconf(s); - if (vhtconf & 0x1) + if (vhtconf & IEEE80211_FVHT_VHT) LINE_CHECK("vht"); else LINE_CHECK("-vht"); - if (vhtconf & 0x2) + if (vhtconf & IEEE80211_FVHT_USEVHT40) LINE_CHECK("vht40"); else LINE_CHECK("-vht40"); - if (vhtconf & 0x4) + if (vhtconf & IEEE80211_FVHT_USEVHT80) LINE_CHECK("vht80"); else LINE_CHECK("-vht80"); - if (vhtconf & 0x8) - LINE_CHECK("vht80p80"); - else - LINE_CHECK("-vht80p80"); - if (vhtconf & 0x10) + if (vhtconf & IEEE80211_FVHT_USEVHT160) LINE_CHECK("vht160"); else LINE_CHECK("-vht160"); + if (vhtconf & IEEE80211_FVHT_USEVHT80P80) + LINE_CHECK("vht80p80"); + else + LINE_CHECK("-vht80p80"); } if (get80211val(s, IEEE80211_IOC_WME, &wme) != -1) { @@ -5481,6 +5544,12 @@ end: } LINE_BREAK(); + + if (getdevicename(s, data, sizeof(data), &len) < 0) + return; + LINE_CHECK("parent interface: %s", data); + + LINE_BREAK(); } static int @@ -5872,6 +5941,8 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD("-ldpctx", -1, set80211ldpc), DEF_CMD("ldpc", 3, set80211ldpc), /* NB: tx+rx */ DEF_CMD("-ldpc", -3, set80211ldpc), + DEF_CMD("uapsd", 1, set80211uapsd), + DEF_CMD("-uapsd", 0, set80211uapsd), DEF_CMD("puren", 1, set80211puren), DEF_CMD("-puren", 0, set80211puren), DEF_CMD("doth", 1, set80211doth), @@ -5904,16 +5975,16 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD("-ht40", 0, set80211htconf), DEF_CMD("ht", 3, set80211htconf), /* NB: 20+40 */ DEF_CMD("-ht", 0, set80211htconf), - DEF_CMD("vht", 1, set80211vhtconf), - DEF_CMD("-vht", 0, set80211vhtconf), - DEF_CMD("vht40", 2, set80211vhtconf), - DEF_CMD("-vht40", -2, set80211vhtconf), - DEF_CMD("vht80", 4, set80211vhtconf), - DEF_CMD("-vht80", -4, set80211vhtconf), - DEF_CMD("vht80p80", 8, set80211vhtconf), - DEF_CMD("-vht80p80", -8, set80211vhtconf), - DEF_CMD("vht160", 16, set80211vhtconf), - DEF_CMD("-vht160", -16, set80211vhtconf), + DEF_CMD("vht", IEEE80211_FVHT_VHT, set80211vhtconf), + DEF_CMD("-vht", 0, set80211vhtconf), + DEF_CMD("vht40", IEEE80211_FVHT_USEVHT40, set80211vhtconf), + DEF_CMD("-vht40", -IEEE80211_FVHT_USEVHT40, set80211vhtconf), + DEF_CMD("vht80", IEEE80211_FVHT_USEVHT80, set80211vhtconf), + DEF_CMD("-vht80", -IEEE80211_FVHT_USEVHT80, set80211vhtconf), + DEF_CMD("vht160", IEEE80211_FVHT_USEVHT160, set80211vhtconf), + DEF_CMD("-vht160", -IEEE80211_FVHT_USEVHT160, set80211vhtconf), + DEF_CMD("vht80p80", IEEE80211_FVHT_USEVHT80P80, set80211vhtconf), + DEF_CMD("-vht80p80", -IEEE80211_FVHT_USEVHT80P80, set80211vhtconf), DEF_CMD("rifs", 1, set80211rifs), DEF_CMD("-rifs", 0, set80211rifs), DEF_CMD("smps", IEEE80211_HTCAP_SMPS_ENA, set80211smps), Modified: stable/12/share/man/man4/ath.4 ============================================================================== --- stable/12/share/man/man4/ath.4 Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/share/man/man4/ath.4 Thu Sep 10 19:00:17 2020 (r365608) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd April 14, 2014 +.Dd June 16, 2020 .Dt ATH 4 .Os .Sh NAME @@ -60,10 +60,10 @@ The driver provides support for wireless network adapters based on the Atheros AR5210, AR5211, AR5212, AR5416 and AR9300 programming APIs. These APIs are used by a wide variety of chips; most all chips with -a PCI and/or CardBus interface are supported. +a PCI, PCIe and/or CardBus interface are supported. .Pp Supported features include 802.11 and 802.3 frames, power management, BSS, -IBSS, MBSS, TDMA, and host-based access point operation modes. +IBSS, MBSS, WDS/DWDS TDMA, and host-based access point operation modes. All host/device interaction is via DMA. .Pp Please note that from FreeBSD-9.0, the @@ -148,12 +148,13 @@ For more information on configuring this device, see .Pp Devices supported by the .Nm -driver come in either Cardbus or mini-PCI packages. -Wireless cards in Cardbus slots may be inserted and ejected on the fly. +driver come in Cardbus, ExpressCard, Mini-PCI and Mini-PCIe packages. +Wireless cards in Cardbus and ExpressCard slots may be inserted and +ejected on the fly. .Sh HARDWARE The .Nm -driver supports all Atheros Cardbus and PCI cards, +driver supports all Atheros Cardbus, ExpressCard, PCI and PCIe cards, except those that are based on the AR5005VL chipset. .Sh EXAMPLES Join a specific BSS network with WEP encryption: @@ -293,8 +294,7 @@ device driver first appeared in Revision A1 of the D-LINK DWL-G520 and DWL-G650 are based on an Intersil PrismGT chip and are not supported by this driver. .Sh BUGS -The driver does not fully enable power-save operation of the chip -in station mode; consequently power use is suboptimal (e.g. on a laptop). +The driver does supports optional station mode power-save operation. .Pp The AR5210 can only do WEP in hardware; consequently hardware assisted WEP is disabled in order to allow software implementations of TKIP and CCMP to Modified: stable/12/share/man/man4/net80211.4 ============================================================================== --- stable/12/share/man/man4/net80211.4 Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/share/man/man4/net80211.4 Thu Sep 10 19:00:17 2020 (r365608) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2009 +.Dd August 7, 2020 .Dt NET80211 4 .Os .Sh NAME @@ -393,6 +393,16 @@ Valid values are: and .Dv IEEE80211_HWMP_ROOTMODE_RANN (send broadcast Root Announcement (RANN) frames). +.It Dv IEEE80211_IOC_IC_NAME +Return the underlying hardware +.Xr device 9 +name in the buffer pointed to by +.Va i_data +and the name length including terminating NUL character in +.Va i_len . +If the buffer length is too small to hold the full name +.Er EINVAL +will be returned. .It Dv IEEE80211_IOC_INACTIVITY Return whether or not the system handles inactivity processing in .Va i_val . Modified: stable/12/share/man/man4/run.4 ============================================================================== --- stable/12/share/man/man4/run.4 Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/share/man/man4/run.4 Thu Sep 10 19:00:17 2020 (r365608) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 8, 2018 +.Dd June 16, 2020 .Dt RUN 4 .Os .Sh NAME @@ -251,5 +251,5 @@ driver was written by .Sh CAVEATS The .Nm -driver does not support any of the 802.11n capabilities offered by the +driver supports some of the 11n capabilities found in the RT2800, RT3000 and RT3900 chipsets. Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Thu Sep 10 19:00:17 2020 (r365608) @@ -19,18 +19,14 @@ #include "ar9300_freebsd_inc.h" -#define AH_BIG_ENDIAN 4321 -#define AH_LITTLE_ENDIAN 1234 - -#if _BYTE_ORDER == _BIG_ENDIAN -#define AH_BYTE_ORDER AH_BIG_ENDIAN -#else -#define AH_BYTE_ORDER AH_LITTLE_ENDIAN -#endif - /* XXX doesn't belong here */ #define AR_EEPROM_MODAL_SPURS 5 +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + /* * (a) this should be N(a), * (b) FreeBSD does define nitems, @@ -43,10 +39,8 @@ #include "ah_devid.h" #include "ar9300eep.h" /* For Eeprom definitions */ - #define AR9300_MAGIC 0x19741014 - /* MAC register values */ #define INIT_CONFIG_STATUS 0x00000000 @@ -1396,7 +1390,7 @@ extern void ar9300_wowoffload_download_ns_info(struct extern HAL_BOOL ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask, u_int8_t rxchainmask, HAL_HT_EXTPROTSPACING extprotspacing, - HAL_BOOL b_channel_change, HAL_STATUS *status, int is_scan); + HAL_BOOL b_channel_change, HAL_STATUS *status, HAL_RESET_TYPE reset_type, int is_scan); extern HAL_BOOL ar9300_lean_channel_change(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask, u_int8_t rxchainmask); extern HAL_BOOL ar9300_set_reset_reg(struct ath_hal *ah, u_int32_t type); @@ -1406,7 +1400,7 @@ extern u_int16_t ar9300_is_single_ant_power_save_poss extern void ar9300_set_operating_mode(struct ath_hal *ah, int opmode); extern HAL_BOOL ar9300_phy_disable(struct ath_hal *ah); extern HAL_BOOL ar9300_disable(struct ath_hal *ah); -extern HAL_BOOL ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *); +extern HAL_BOOL ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *, HAL_RESET_TYPE type); extern HAL_BOOL ar9300_calibration(struct ath_hal *ah, struct ieee80211_channel *chan, u_int8_t rxchainmask, HAL_BOOL longcal, HAL_BOOL *isIQdone, int is_scan, u_int32_t *sched_cals); extern void ar9300_reset_cal_valid(struct ath_hal *ah, Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Thu Sep 10 19:00:17 2020 (r365608) @@ -462,13 +462,55 @@ ar9300_ani_control(struct ath_hal *ah, HAL_ANI_CMD cmd u_int level = param; u_int is_on; + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: cmd=%d, param=%d, chan=%p, funcmask=0x%08x\n", + __func__, + cmd, + param, + chan, + ahp->ah_ani_function); + + if (chan == NULL && cmd != HAL_ANI_MODE) { HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, "%s: ignoring cmd 0x%02x - no channel\n", __func__, cmd); return AH_FALSE; } - switch (cmd & ahp->ah_ani_function) { + /* + * These two control the top-level cck/ofdm immunity levels and will + * program the rest of the values. + */ + if (cmd == HAL_ANI_NOISE_IMMUNITY_LEVEL) { + if (param > HAL_ANI_OFDM_NUM_LEVEL) + return AH_FALSE; + ar9300_ani_set_odfm_noise_immunity_level(ah, param); + return AH_TRUE; + } + + if (cmd == HAL_ANI_CCK_NOISE_IMMUNITY_LEVEL) { + if (param > HAL_ANI_CCK_NUM_LEVEL) + return AH_FALSE; + ar9300_ani_set_cck_noise_immunity_level(ah, param); + return AH_TRUE; + } + + /* + * Check to see if this command is available in the + * current operating mode. + */ + if (((1 << cmd) & ahp->ah_ani_function) == 0) { + HALDEBUG(ah, HAL_DEBUG_ANI, + "%s: early check: invalid cmd 0x%02x (allowed=0x%02x)\n", + __func__, cmd, ahp->ah_ani_function); + return AH_FALSE; + } + + /* + * The rest of these program in the requested parameter values + * into the PHY. + */ + switch (cmd) { + case HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION: { int m1_thresh_low, m2_thresh_low; @@ -887,13 +929,16 @@ ar9300_ani_reset(struct ath_hal *ah, HAL_BOOL is_scann /* only allow a subset of functions in AP mode */ if (AH_PRIVATE(ah)->ah_opmode == HAL_M_HOSTAP) { if (IS_CHAN_2GHZ(ichan)) { - ahp->ah_ani_function = (HAL_ANI_SPUR_IMMUNITY_LEVEL | - HAL_ANI_FIRSTEP_LEVEL | - HAL_ANI_MRC_CCK); + ahp->ah_ani_function = (1 << HAL_ANI_SPUR_IMMUNITY_LEVEL) | + (1 << HAL_ANI_FIRSTEP_LEVEL) | + (1 << HAL_ANI_MRC_CCK); } else { ahp->ah_ani_function = 0; } + } else { + ahp->ah_ani_function = HAL_ANI_ALL; } + /* always allow mode (on/off) to be controlled */ ahp->ah_ani_function |= HAL_ANI_MODE; @@ -1172,6 +1217,7 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ cck_phy_err_cnt = OS_REG_READ(ah, AR_PHY_ERR_2); /* Populate HAL_ANISTATS */ + /* XXX TODO: are these correct? */ if (ani_stats) { ani_stats->cckphyerr_cnt = cck_phy_err_cnt - ani_state->cck_phy_err_count; @@ -1212,18 +1258,32 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ return; } + /* + * Calculate the OFDM/CCK phy error rate over the listen time interval. + * This is used in subsequent math to see if the OFDM/CCK phy error rate + * is above or below the threshold checks. + */ + ofdm_phy_err_rate = ani_state->ofdm_phy_err_count * 1000 / ani_state->listen_time; cck_phy_err_rate = ani_state->cck_phy_err_count * 1000 / ani_state->listen_time; HALDEBUG(ah, HAL_DEBUG_ANI, - "%s: listen_time=%d OFDM:%d errs=%d/s CCK:%d errs=%d/s ofdm_turn=%d\n", + "%s: listen_time=%d (total: %d) OFDM:%d errs=%d/s CCK:%d errs=%d/s ofdm_turn=%d\n", __func__, listen_time, + ani_state->listen_time, ani_state->ofdm_noise_immunity_level, ofdm_phy_err_rate, ani_state->cck_noise_immunity_level, cck_phy_err_rate, ani_state->ofdms_turn); + /* + * Check for temporary noise spurs. This is intended to be used by + * rate control to check if we should try higher packet rates or not. + * If the noise period is short enough then we shouldn't avoid trying + * higher rates but if the noise is high/sustained then it's likely + * not a great idea to try the higher MCS rates. + */ if (ani_state->listen_time >= HAL_NOISE_DETECT_PERIOD) { old_phy_noise_spur = ani_state->phy_noise_spur; if (ofdm_phy_err_rate <= ani_state->ofdm_trig_low && @@ -1236,7 +1296,7 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ } if (old_phy_noise_spur != ani_state->phy_noise_spur) { HALDEBUG(ah, HAL_DEBUG_ANI, - "%s: enviroment change from %d to %d\n", + "%s: environment change from %d to %d\n", __func__, old_phy_noise_spur, ani_state->phy_noise_spur); } } @@ -1259,6 +1319,10 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ ar9300_ani_lower_immunity(ah); ani_state->ofdms_turn = !ani_state->ofdms_turn; } + /* + * Force an ANI restart regardless of whether the lower immunity + * level was met. + */ HALDEBUG(ah, HAL_DEBUG_ANI, "%s: 1 listen_time=%d ofdm=%d/s cck=%d/s - " "calling ar9300_ani_restart\n", @@ -1292,6 +1356,13 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ ani_state->ofdms_turn = AH_TRUE; } } + + /* + * Note that currently this poll function doesn't reset the listen + * time after it accumulates a second worth of error samples. + * It will continue to accumulate samples until a counter overflows, + * or a raise threshold is met, or 5 seconds passes. + */ } /* Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Thu Sep 10 19:00:17 2020 (r365608) @@ -3040,6 +3040,33 @@ ar9300_eeprom_set_transmit_power(struct ath_hal *ah, ahp->reg_dmn = ath_hal_getctl(ah, chan); /* + * After reading FCC/OET 13TR1003 (Directional Gain of IEEE 802.11 + * MIMO devices employing cyclic delay diversity) and looking at what + * ath9k does, let's disable the CDD check until it's clearer exactly + * how the maximum cap should be applied here. + * + * Right now the CDD check is simply unconditionally reducing the + * gain of legacy and 1/2 stream rates depending upon the chainmask. + * (CDD is used when transmitting rates that don't already use up the + * full set of streams - eg OFDM or MCS0-7 on a 2 or 3 chain TX path.) + * + * It's dropping the 2-chain TX by 3dB and 3-chain by 5dB to "meet" + * power spectral density requirements but it's not currently taking + * into account how close to the regulatory limit the hardware/antenna + * system is already at. It doesn't help that the conductive testing + * limits have the array gain at 0dB for all AR9300/derivative + * configurations. + * + * It also doesn't let us do single chain transmit at the full allowed + * power for the regulatory/CTL limits as it subtracts it from what's + * programmed into the hardware. + * + * ath9k doesn't factor any of the CDD stuff into account, so I'm going + * to disable it here and in the TPC path until I get a better idea + * of what to really do here. + */ +#if 0 + /* * Always use CDD/direct per rate power table for register based approach. * For FCC, CDD calculations should factor in the array gain, hence * this adjust call. ETSI and MKK does not have this requirement. @@ -3050,6 +3077,7 @@ ar9300_eeprom_set_transmit_power(struct ath_hal *ah, __func__); ar9300_adjust_reg_txpower_cdd(ah, target_power_val_t2); } +#endif if (ar9300_eeprom_get(ahp, EEP_PAPRD_ENABLED)) { for (i = 0; i < ar9300_rate_size; i++) { Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Thu Sep 10 19:00:17 2020 (r365608) @@ -355,7 +355,7 @@ ar9300_attach_freebsd_ops(struct ath_hal *ah) ah->ah_setRxDP = ar9300_set_rx_dp; ah->ah_enableReceive = ar9300_enable_receive; ah->ah_stopDmaReceive = ar9300_stop_dma_receive_freebsd; - ah->ah_startPcuReceive = ar9300_start_pcu_receive_freebsd; + ah->ah_startPcuReceive = ar9300_start_pcu_receive; ah->ah_stopPcuReceive = ar9300_stop_pcu_receive; ah->ah_setMulticastFilter = ar9300_set_multicast_filter; ah->ah_setMulticastFilterIndex = ar9300SetMulticastFilterIndex; @@ -543,6 +543,7 @@ ar9300_reset_freebsd(struct ath_hal *ah, HAL_OPMODE op HAL_HT_EXTPROTSPACING_20, /* always 20Mhz channel spacing */ bChannelChange, status, + resetType, AH_FALSE); /* XXX should really extend ath_hal_reset() */ return (r); @@ -678,14 +679,6 @@ ar9300_reset_cal_valid_freebsd(struct ath_hal *ah, return (is_cal_done); } - -void -ar9300_start_pcu_receive_freebsd(struct ath_hal *ah) -{ - - /* is_scanning flag == NULL */ - ar9300_start_pcu_receive(ah, AH_FALSE); -} /* * FreeBSD will just pass in the descriptor value as 'pa'. Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Thu Sep 10 19:00:17 2020 (r365608) @@ -1263,15 +1263,13 @@ ar9300_get_diag_state(struct ath_hal *ah, int request, if (ani == AH_NULL) return AH_FALSE; /* Convert ar9300 HAL to FreeBSD HAL ANI state */ - /* XXX TODO: add all of these to the HAL ANI state structure */ bzero(&ahp->ext_ani_state, sizeof(ahp->ext_ani_state)); - /* XXX should this be OFDM or CCK noise immunity level? */ ahp->ext_ani_state.noiseImmunityLevel = ani->ofdm_noise_immunity_level; ahp->ext_ani_state.spurImmunityLevel = ani->spur_immunity_level; ahp->ext_ani_state.firstepLevel = ani->firstep_level; ahp->ext_ani_state.ofdmWeakSigDetectOff = ani->ofdm_weak_sig_detect_off; - /* mrc_cck_off */ - /* cck_noise_immunity_level */ + ahp->ext_ani_state.mrcCck = !! ani->mrc_cck_off; + ahp->ext_ani_state.cckNoiseImmunityLevel = ani->cck_noise_immunity_level; ahp->ext_ani_state.listenTime = ani->listen_time; @@ -1289,12 +1287,18 @@ ar9300_get_diag_state(struct ath_hal *ah, int request, 0 : sizeof(HAL_ANI_STATS); return AH_TRUE; case HAL_DIAG_ANI_CMD: + { + HAL_ANI_CMD savefunc = ahp->ah_ani_function; if (argsize != 2*sizeof(u_int32_t)) { return AH_FALSE; } + /* temporarly allow all functions so we can override */ + ahp->ah_ani_function = HAL_ANI_ALL; ar9300_ani_control( ah, ((const u_int32_t *)args)[0], ((const u_int32_t *)args)[1]); + ahp->ah_ani_function = savefunc; return AH_TRUE; + } #if 0 case HAL_DIAG_TXCONT: /*AR9300_CONTTXMODE(ah, (struct ath_desc *)args, argsize );*/ Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c Thu Sep 10 19:00:17 2020 (r365608) @@ -55,10 +55,12 @@ static inline void ar9300_init_rate_txpower_stbc(struc const HAL_RATE_TABLE *rt, HAL_BOOL is40, int rt_ss_offset, int rt_ds_offset, int rt_ts_offset, u_int8_t chainmask); +#if 0 static inline void ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, const HAL_RATE_TABLE *rt, HAL_BOOL is40, int rt_ss_offset, int rt_ds_offset, int rt_ts_offset, u_int8_t chainmask); +#endif #define AR9300_11A_RT_OFDM_OFFSET 0 HAL_RATE_TABLE ar9300_11a_table = { @@ -442,6 +444,8 @@ ar9300_adjust_reg_txpower_cdd(struct ath_hal *ah, ((int16_t)AH_MIN((ahp->twice_antenna_reduction - (ahp->twice_antenna_gain + AR9300_TXBF_2TX_ARRAY_GAIN)), 0)); cdd_power = ahp->upper_limit[1] + twice_array_gain; + + HALDEBUG(ah, HAL_DEBUG_CALIBRATE, "%s: 2 chain; cdd_power=%d", __func__, cdd_power); /* Adjust OFDM legacy rates as well */ for (i = ALL_TARGET_LEGACY_6_24; i <= ALL_TARGET_LEGACY_54; i++) { if (power_per_rate[i] > cdd_power) { @@ -471,6 +475,7 @@ ar9300_adjust_reg_txpower_cdd(struct ath_hal *ah, ((int16_t)AH_MIN((ahp->twice_antenna_reduction - (ahp->twice_antenna_gain + AR9300_TXBF_3TX_ARRAY_GAIN)), 0)); cdd_power = ahp->upper_limit[2] + twice_array_gain; + HALDEBUG(ah, HAL_DEBUG_CALIBRATE, "%s: 3 chain; cdd_power=%d", __func__, cdd_power); /* Adjust OFDM legacy rates as well */ for (i = ALL_TARGET_LEGACY_6_24; i <= ALL_TARGET_LEGACY_54; i++) { if (power_per_rate[i] > cdd_power) { @@ -531,6 +536,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NA_RT_HT_SS_OFFSET, AR9300_11NA_RT_HT_DS_OFFSET, AR9300_11NA_RT_HT_TS_OFFSET, chainmask); +#if 0 /* For FCC the array gain has to be factored for CDD mode */ if (is_reg_dmn_fcc(ath_hal_getctl(ah, chan))) { ar9300_adjust_rate_txpower_cdd(ah, rt, is40, @@ -538,6 +544,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NA_RT_HT_DS_OFFSET, AR9300_11NA_RT_HT_TS_OFFSET, chainmask); } +#endif break; case HAL_MODE_11G: ar9300_init_rate_txpower_cck(ah, rt, power_per_rate, chainmask); @@ -561,6 +568,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NG_RT_HT_SS_OFFSET, AR9300_11NG_RT_HT_DS_OFFSET, AR9300_11NG_RT_HT_TS_OFFSET, chainmask); +#if 0 /* For FCC the array gain needs to be factored for CDD mode */ if (is_reg_dmn_fcc(ath_hal_getctl(ah, chan))) { ar9300_adjust_rate_txpower_cdd(ah, rt, is40, @@ -568,6 +576,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NG_RT_HT_DS_OFFSET, AR9300_11NG_RT_HT_TS_OFFSET, chainmask); } +#endif break; default: HALDEBUG(ah, HAL_DEBUG_POWER_MGMT, "%s: invalid mode 0x%x\n", @@ -941,6 +950,10 @@ ar9300_init_rate_txpower_stbc(struct ath_hal *ah, cons return; } +/* + * To see why this is disabled, look at ar9300_eeprom.c for FCC/OET 13TR1003. + */ +#if 0 static inline void ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, const HAL_RATE_TABLE *rt, HAL_BOOL is40, @@ -1037,6 +1050,7 @@ ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, con return; } +#endif void ar9300_disp_tpc_tables(struct ath_hal *ah) { Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Thu Sep 10 19:00:17 2020 (r365608) @@ -2064,7 +2064,7 @@ ar9300_set_rf_mode(struct ath_hal *ah, struct ieee8021 * Places the hardware into reset and then pulls it out of reset */ HAL_BOOL -ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *chan) +ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *chan, HAL_RESET_TYPE reset_type) { struct ath_hal_9300 *ahp = AH9300(ah); int type = HAL_RESET_WARM; @@ -2080,8 +2080,13 @@ ar9300_chip_reset(struct ath_hal *ah, struct ieee80211 */ if (ahp->ah_chip_full_sleep || (ah->ah_config.ah_force_full_reset == 1) || + (reset_type == HAL_RESET_FORCE_COLD) || + (reset_type == HAL_RESET_BBPANIC) || OS_REG_READ(ah, AR_Q_TXE) || (OS_REG_READ(ah, AR_CR) & AR_CR_RXE)) { + HALDEBUG(ah, HAL_DEBUG_RESET, + "%s: full reset; reset_type=%d, full_sleep=%d\n", + __func__, reset_type, ahp->ah_chip_full_sleep); type = HAL_RESET_COLD; } @@ -4510,7 +4515,7 @@ HAL_BOOL ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask, u_int8_t rxchainmask, HAL_HT_EXTPROTSPACING extprotspacing, HAL_BOOL b_channel_change, - HAL_STATUS *status, int is_scan) + HAL_STATUS *status, HAL_RESET_TYPE reset_type, int is_scan) { #define FAIL(_code) do { ecode = _code; goto bad; } while (0) u_int32_t save_led_state; @@ -4864,7 +4869,7 @@ ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, st /* Mark PHY inactive prior to reset, to be undone in ar9300_init_bb () */ ar9300_mark_phy_inactive(ah); - if (!ar9300_chip_reset(ah, chan)) { + if (!ar9300_chip_reset(ah, chan, reset_type)) { HALDEBUG(ah, HAL_DEBUG_RESET, "%s: chip reset failed\n", __func__); FAIL(HAL_EIO); } Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c Thu Sep 10 19:00:17 2020 (r365608) @@ -691,7 +691,7 @@ ar9300_Stub_StopDmaReceive(struct ath_hal *ah) } void -ar9300_Stub_StartPcuReceive(struct ath_hal *ah) +ar9300_Stub_StartPcuReceive(struct ath_hal *ah, HAL_BOOL is_scanning) { ath_hal_printf(ah, "%s: called\n", __func__); Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h Thu Sep 10 19:00:17 2020 (r365608) @@ -112,7 +112,7 @@ extern void ar9300_Stub_SetRxDP(struct ath_hal *ah, ui HAL_RX_QUEUE); extern void ar9300_Stub_EnableReceive(struct ath_hal *ah); extern HAL_BOOL ar9300_Stub_StopDmaReceive(struct ath_hal *ah); -extern void ar9300_Stub_StartPcuReceive(struct ath_hal *ah); +extern void ar9300_Stub_StartPcuReceive(struct ath_hal *ah, HAL_BOOL); extern void ar9300_Stub_StopPcuReceive(struct ath_hal *ah); extern void ar9300_Stub_SetMulticastFilter(struct ath_hal *ah, uint32_t filter0, uint32_t filter1); Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Thu Sep 10 19:00:17 2020 (r365608) @@ -18,13 +18,17 @@ #define _ATH_AR9300_EEP_H_ #include "opt_ah.h" - #include "ah.h" #if defined(WIN32) || defined(WIN64) #pragma pack (push, ar9300, 1) #endif +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + /* FreeBSD extras - should be in ah_eeprom.h ? */ #define AR_EEPROM_EEPCAP_COMPRESS_DIS 0x0001 #define AR_EEPROM_EEPCAP_AES_DIS 0x0002 @@ -345,11 +349,13 @@ typedef struct CalCtlEdgePwr { u_int8_t flag :2, t_power :6; } __packed CAL_CTL_EDGE_PWR; -#else +#elif AH_BYTE_ORDER == AH_LITTLE_ENDIAN typedef struct CalCtlEdgePwr { u_int8_t t_power :6, flag :2; } __packed CAL_CTL_EDGE_PWR; +#else +#error AH_BYTE_ORDER undefined! #endif typedef struct ospCalCtlData_5G { Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h Thu Sep 10 19:00:17 2020 (r365608) @@ -25,6 +25,11 @@ #ifndef __ar9300templateAP121_h__ #define __ar9300templateAP121_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_ap121= { Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h Thu Sep 10 18:41:15 2020 (r365607) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Thu Sep 10 20:34:45 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBF693E350D; Thu, 10 Sep 2020 20:34:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnVxK4W6Rz4cJf; Thu, 10 Sep 2020 20:34:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7994E18A45; Thu, 10 Sep 2020 20:34:45 +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 08AKYjKq044382; Thu, 10 Sep 2020 20:34:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AKYjpE044381; Thu, 10 Sep 2020 20:34:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009102034.08AKYjpE044381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 10 Sep 2020 20:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365611 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 365611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 20:34:45 -0000 Author: jhb Date: Thu Sep 10 20:34:44 2020 New Revision: 365611 URL: https://svnweb.freebsd.org/changeset/base/365611 Log: MFC 363459: Pass the right size to memcpy() when copying the array of FP registers. The size of the containing structure was passed instead of the size of the array. This happened to be harmless as the extra word copied is one we copy in the next line anyway. Modified: stable/12/sys/riscv/riscv/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Thu Sep 10 20:28:43 2020 (r365610) +++ stable/12/sys/riscv/riscv/machdep.c Thu Sep 10 20:34:44 2020 (r365611) @@ -414,7 +414,7 @@ get_fpcontext(struct thread *td, mcontext_t *mcp) KASSERT((curpcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, ("Non-userspace FPE flags set in get_fpcontext")); memcpy(mcp->mc_fpregs.fp_x, curpcb->pcb_x, - sizeof(mcp->mc_fpregs)); + sizeof(mcp->mc_fpregs.fp_x)); mcp->mc_fpregs.fp_fcsr = curpcb->pcb_fcsr; mcp->mc_fpregs.fp_flags = curpcb->pcb_fpflags; mcp->mc_flags |= _MC_FP_VALID; @@ -441,7 +441,7 @@ set_fpcontext(struct thread *td, mcontext_t *mcp) curpcb = curthread->td_pcb; /* FPE usage is enabled, override registers. */ memcpy(curpcb->pcb_x, mcp->mc_fpregs.fp_x, - sizeof(mcp->mc_fpregs)); + sizeof(mcp->mc_fpregs.fp_x)); curpcb->pcb_fcsr = mcp->mc_fpregs.fp_fcsr; curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags & PCB_FP_USERMASK; td->td_frame->tf_sstatus |= SSTATUS_FS_CLEAN; From owner-svn-src-stable@freebsd.org Thu Sep 10 20:46:18 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A2F03E34F7; Thu, 10 Sep 2020 20:46:18 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnWBf2b6Cz4cb5; Thu, 10 Sep 2020 20:46:18 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 225A118A5F; Thu, 10 Sep 2020 20:46:18 +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 08AKkIGh050447; Thu, 10 Sep 2020 20:46:18 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AKkG3i050439; Thu, 10 Sep 2020 20:46:16 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202009102046.08AKkG3i050439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 10 Sep 2020 20:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365612 - in stable/12: . sys/amd64/conf sys/conf sys/contrib/dev/ice sys/dev/ice sys/modules sys/modules/ice sys/modules/ice_ddp tools/kerneldoc/subsys X-SVN-Group: stable-12 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in stable/12: . sys/amd64/conf sys/conf sys/contrib/dev/ice sys/dev/ice sys/modules sys/modules/ice sys/modules/ice_ddp tools/kerneldoc/subsys X-SVN-Commit-Revision: 365612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 20:46:18 -0000 Author: erj Date: Thu Sep 10 20:46:16 2020 New Revision: 365612 URL: https://svnweb.freebsd.org/changeset/base/365612 Log: MFC r361541, r362038, r364240 These MFCs add the ice(4) driver to the kernel for Intel 800 Series Ethernet adapters, a couple fixes for the ice_ddp module makefile, and remove some redeclarations, respectively. Relnotes: yes Sponsored by: Intel Corporation Added: stable/12/sys/contrib/dev/ice/ - copied from r361541, head/sys/contrib/dev/ice/ stable/12/sys/dev/ice/ - copied from r361541, head/sys/dev/ice/ stable/12/sys/modules/ice/ - copied from r361541, head/sys/modules/ice/ stable/12/sys/modules/ice_ddp/ - copied from r361541, head/sys/modules/ice_ddp/ stable/12/tools/kerneldoc/subsys/Doxyfile-dev_ice - copied unchanged from r361541, head/tools/kerneldoc/subsys/Doxyfile-dev_ice Modified: stable/12/MAINTAINERS stable/12/sys/amd64/conf/GENERIC stable/12/sys/amd64/conf/NOTES stable/12/sys/conf/files.amd64 stable/12/sys/conf/files.arm64 stable/12/sys/dev/ice/ice_common.h stable/12/sys/modules/Makefile stable/12/sys/modules/ice_ddp/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/MAINTAINERS ============================================================================== --- stable/12/MAINTAINERS Thu Sep 10 20:34:44 2020 (r365611) +++ stable/12/MAINTAINERS Thu Sep 10 20:46:16 2020 (r365612) @@ -89,9 +89,11 @@ share/mk/*.test.mk freebsd-testing,ngie (same list as stand/forth dteske Pre-commit review requested. stand/lua kevans Pre-commit review requested sys/compat/linuxkpi hselasky If in doubt, ask. +sys/contrib/dev/ice erj Pre-commit phabricator review requested. sys/dev/e1000 erj Pre-commit phabricator review requested. sys/dev/ixgbe erj Pre-commit phabricator review requested. sys/dev/ixl erj Pre-commit phabricator review requested. +sys/dev/ice erj Pre-commit phabricator review requested. sys/dev/sound/usb hselasky If in doubt, ask. sys/dev/usb hselasky If in doubt, ask. sys/dev/xen royger Pre-commit review recommended. Modified: stable/12/sys/amd64/conf/GENERIC ============================================================================== --- stable/12/sys/amd64/conf/GENERIC Thu Sep 10 20:34:44 2020 (r365611) +++ stable/12/sys/amd64/conf/GENERIC Thu Sep 10 20:46:16 2020 (r365612) @@ -225,6 +225,7 @@ device ix # Intel PRO/10GbE PCIE PF Ethernet device ixv # Intel PRO/10GbE PCIE VF Ethernet device ixl # Intel 700 Series Physical Function device iavf # Intel Adaptive Virtual Function +device ice # Intel 800 Series Physical Function device vmx # VMware VMXNET3 Ethernet # PCI Ethernet NICs. Modified: stable/12/sys/amd64/conf/NOTES ============================================================================== --- stable/12/sys/amd64/conf/NOTES Thu Sep 10 20:34:44 2020 (r365611) +++ stable/12/sys/amd64/conf/NOTES Thu Sep 10 20:46:16 2020 (r365612) @@ -306,6 +306,8 @@ options DRM_DEBUG # Include debug printfs (slow) # ed: Western Digital and SMC 80xx; Novell NE1000 and NE2000; 3Com 3C503 # HP PC Lan+, various PC Card devices # (requires miibus) +# ice: Intel 800 Series Physical Function +# Requires the ice_ddp module for full functionality # ipw: Intel PRO/Wireless 2100 IEEE 802.11 adapter # Requires the ipw firmware module # iwi: Intel PRO/Wireless 2200BG/2225BG/2915ABG IEEE 802.11 adapters @@ -332,6 +334,8 @@ device iwi # Intel 2200BG/2225BG/2915ABG wireless NI device iwn # Intel 4965/1000/5000/6000 wireless NICs. device ixl # Intel 700 Series Physical Function device iavf # Intel Adaptive Virtual Function +device ice # Intel 800 Series Physical Function +device ice_ddp # Intel 800 Series DDP Package device mthca # Mellanox HCA InfiniBand device mlx4 # Shared code module between IB and Ethernet device mlx4ib # Mellanox ConnectX HCA InfiniBand Modified: stable/12/sys/conf/files.amd64 ============================================================================== --- stable/12/sys/conf/files.amd64 Thu Sep 10 20:34:44 2020 (r365611) +++ stable/12/sys/conf/files.amd64 Thu Sep 10 20:46:16 2020 (r365612) @@ -255,6 +255,52 @@ dev/imcsmb/imcsmb.c optional imcsmb dev/imcsmb/imcsmb_pci.c optional imcsmb pci dev/intel/spi.c optional intelspi dev/io/iodev.c optional io +dev/ice/if_ice_iflib.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_lib.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_osdep.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_resmgr.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_strings.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_iflib_recovery_txrx.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_iflib_txrx.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_common.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_controlq.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_dcb.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_flex_pipe.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_flow.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_nvm.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_sched.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_sriov.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_switch.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +ice_ddp.c optional ice_ddp \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01030900 -mice_ddp -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "ice_ddp.c" +ice_ddp.fwo optional ice_ddp \ + dependency "ice_ddp.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "ice_ddp.fwo" +ice_ddp.fw optional ice_ddp \ + dependency "$S/contrib/dev/ice/ice-1.3.9.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.9.0.pkg ice_ddp.fw" \ + no-obj no-implicit-rule \ + clean "ice_ddp.fw" dev/ioat/ioat.c optional ioat pci dev/ioat/ioat_test.c optional ioat pci dev/ipmi/ipmi.c optional ipmi Modified: stable/12/sys/conf/files.arm64 ============================================================================== --- stable/12/sys/conf/files.arm64 Thu Sep 10 20:34:44 2020 (r365611) +++ stable/12/sys/conf/files.arm64 Thu Sep 10 20:46:16 2020 (r365612) @@ -221,6 +221,53 @@ dev/axgbe/xgbe-dev.c optional axgbe dev/axgbe/xgbe-drv.c optional axgbe dev/axgbe/xgbe-mdio.c optional axgbe dev/cpufreq/cpufreq_dt.c optional cpufreq fdt +dev/ice/if_ice_iflib.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_lib.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_osdep.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_resmgr.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_strings.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_iflib_recovery_txrx.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_iflib_txrx.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_common.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_controlq.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_dcb.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_flex_pipe.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_flow.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_nvm.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_sched.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_sriov.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_switch.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +ice_ddp.c optional ice_ddp \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01030900 -mice_ddp -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "ice_ddp.c" +ice_ddp.fwo optional ice_ddp \ + dependency "ice_ddp.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "ice_ddp.fwo" +ice_ddp.fw optional ice_ddp \ + dependency "$S/contrib/dev/ice/ice-1.3.9.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.9.0.pkg ice_ddp.fw" \ + no-obj no-implicit-rule \ + clean "ice_ddp.fw" +dev/iicbus/sy8106a.c optional sy8106a fdt dev/iicbus/twsi/mv_twsi.c optional twsi fdt dev/iicbus/twsi/a10_twsi.c optional twsi fdt dev/iicbus/twsi/twsi.c optional twsi fdt Modified: stable/12/sys/dev/ice/ice_common.h ============================================================================== --- head/sys/dev/ice/ice_common.h Tue May 26 23:35:10 2020 (r361541) +++ stable/12/sys/dev/ice/ice_common.h Thu Sep 10 20:46:16 2020 (r365612) @@ -46,16 +46,6 @@ enum ice_fw_modes { ICE_FW_MODE_ROLLBACK }; -/* prototype for functions used for SW locks */ -void ice_free_list(struct LIST_HEAD_TYPE *list); -void ice_init_lock(struct ice_lock *lock); -void ice_acquire_lock(struct ice_lock *lock); -void ice_release_lock(struct ice_lock *lock); -void ice_destroy_lock(struct ice_lock *lock); - -void *ice_alloc_dma_mem(struct ice_hw *hw, struct ice_dma_mem *m, u64 size); -void ice_free_dma_mem(struct ice_hw *hw, struct ice_dma_mem *m); - void ice_idle_aq(struct ice_hw *hw, struct ice_ctl_q_info *cq); bool ice_sq_done(struct ice_hw *hw, struct ice_ctl_q_info *cq); @@ -77,13 +67,6 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_ enum ice_status ice_get_link_status(struct ice_port_info *pi, bool *link_up); enum ice_status ice_update_link_info(struct ice_port_info *pi); -enum ice_status -ice_acquire_nvm(struct ice_hw *hw, enum ice_aq_res_access_type access); -void ice_release_nvm(struct ice_hw *hw); -enum ice_status -ice_aq_read_nvm(struct ice_hw *hw, u16 module_typeid, u32 offset, u16 length, - void *data, bool last_command, bool read_shadow_ram, - struct ice_sq_cd *cd); enum ice_status ice_acquire_res(struct ice_hw *hw, enum ice_aq_res_ids res, enum ice_aq_res_access_type access, u32 timeout); Modified: stable/12/sys/modules/Makefile ============================================================================== --- stable/12/sys/modules/Makefile Thu Sep 10 20:34:44 2020 (r365611) +++ stable/12/sys/modules/Makefile Thu Sep 10 20:46:16 2020 (r365612) @@ -160,6 +160,8 @@ SUBDIR= \ ${_ibcore} \ ${_ibcs2} \ ${_ichwd} \ + ${_ice} \ + ${_ice_ddp} \ ${_ida} \ if_bridge \ if_disc \ @@ -566,6 +568,13 @@ _rtwnfw= rtwnfw ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \ ${MACHINE_CPUARCH} != "riscv" _cxgbe= cxgbe +.endif + +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "arm64" +_ice= ice +.if ${MK_SOURCELESS_UCODE} != "no" +_ice_ddp= ice_ddp +.endif .endif # These rely on 64bit atomics Modified: stable/12/sys/modules/ice_ddp/Makefile ============================================================================== --- head/sys/modules/ice_ddp/Makefile Tue May 26 23:35:10 2020 (r361541) +++ stable/12/sys/modules/ice_ddp/Makefile Thu Sep 10 20:46:16 2020 (r365612) @@ -1,24 +1,6 @@ # $FreeBSD$ -# Find the highest version DDP package file and build a .ko for it -PKG_FILE != find ${SRCTOP}/sys/contrib/dev/ice -name 'ice-*.pkg' | sort -V | tail -1 +KMOD= ice_ddp +FIRMWS= ${SRCTOP}/sys/contrib/dev/ice/ice-1.3.9.0.pkg:ice_ddp:0x01030900 -.if empty(PKG_FILE) -.error Unable to locate the DDP package binary file -.endif - -.info Found ${PKG_FILE} - -PKG_NAME != basename ${PKG_FILE} -PKG_VER_STR != basename -s .pkg ${PKG_NAME} -PKG_VER_STR := ${PKG_VER_STR:S/^ice-//} -PKG_VER_STR := ${PKG_VER_STR:S/-signed$//} -PKG_VER_MAJ != echo ${PKG_VER_STR} | cut -d. -f1 -PKG_VER_MIN != echo ${PKG_VER_STR} | cut -d. -f2 -PKG_VER_UPD != echo ${PKG_VER_STR} | cut -d. -f3 -PKG_VER_DFT != echo ${PKG_VER_STR} | cut -d. -f4 -PKG_VERSION != printf "0x%02x%02x%02x%02x" "${PKG_VER_MAJ}" "${PKG_VER_MIN}" "${PKG_VER_UPD}" "${PKG_VER_DFT}" - -KMOD := ice_ddp -FIRMWS := ${PKG_FILE}:ice_ddp:${PKG_VERSION} .include Copied: stable/12/tools/kerneldoc/subsys/Doxyfile-dev_ice (from r361541, head/tools/kerneldoc/subsys/Doxyfile-dev_ice) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/kerneldoc/subsys/Doxyfile-dev_ice Thu Sep 10 20:46:16 2020 (r365612, copy of r361541, head/tools/kerneldoc/subsys/Doxyfile-dev_ice) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ice device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ice/ +EXTRACT_ALL = YES # TODO: ice has @file comments.. disable this? +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ice/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ice/dev_ice.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + From owner-svn-src-stable@freebsd.org Thu Sep 10 21:01:23 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B31FB3E3D0D; Thu, 10 Sep 2020 21:01:23 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnWX34dgNz4dGB; Thu, 10 Sep 2020 21:01:23 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8248D1920E; Thu, 10 Sep 2020 21:01:23 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AL1NN6060905; Thu, 10 Sep 2020 21:01:23 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AL1MDW060901; Thu, 10 Sep 2020 21:01:22 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <202009102101.08AL1MDW060901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 10 Sep 2020 21:01:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365614 - in stable/12: sys/dev/virtio/block usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: in stable/12: sys/dev/virtio/block usr.sbin/bhyve X-SVN-Commit-Revision: 365614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 21:01:23 -0000 Author: allanjude Date: Thu Sep 10 21:01:22 2020 New Revision: 365614 URL: https://svnweb.freebsd.org/changeset/base/365614 Log: MFC r360229, r363255 r360229: Add VIRTIO_BLK_T_DISCARD (TRIM) support to the bhyve virtio-blk backend This will advertise support for TRIM to the guest virtio-blk driver and perform the DIOCGDELETE ioctl on the backing storage if it supports it. Thanks to Jason King and others at Joyent and illumos for expanding on my original patch, adding improvements including better error handling and making sure to following the virtio spec. r363255: Add VIRTIO_BLK_T_DISCARD support to the virtio-blk driver If the hypervisor advertises support for the DISCARD command then the guest can perform TRIM commands, freeing space on the backing store. If VIRTIO_BLK_F_DISCARD is enabled, advertise DISKFLAG_CANDELETE Tested with FreeBSD guests on bhyve and KVM Relnotes: yes Sponsored by: Klara Inc. Modified: stable/12/sys/dev/virtio/block/virtio_blk.c stable/12/sys/dev/virtio/block/virtio_blk.h stable/12/usr.sbin/bhyve/block_if.c stable/12/usr.sbin/bhyve/pci_virtio_block.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- stable/12/sys/dev/virtio/block/virtio_blk.c Thu Sep 10 20:54:44 2020 (r365613) +++ stable/12/sys/dev/virtio/block/virtio_blk.c Thu Sep 10 21:01:22 2020 (r365614) @@ -81,6 +81,7 @@ struct vtblk_softc { #define VTBLK_FLAG_SUSPEND 0x0008 #define VTBLK_FLAG_BARRIER 0x0010 #define VTBLK_FLAG_WC_CONFIG 0x0020 +#define VTBLK_FLAG_DISCARD 0x0040 struct virtqueue *vtblk_vq; struct sglist *vtblk_sglist; @@ -112,6 +113,7 @@ static struct virtio_feature_desc vtblk_feature_desc[] { VIRTIO_BLK_F_WCE, "WriteCache" }, { VIRTIO_BLK_F_TOPOLOGY, "Topology" }, { VIRTIO_BLK_F_CONFIG_WCE, "ConfigWCE" }, + { VIRTIO_BLK_F_DISCARD, "Discard" }, { 0, NULL } }; @@ -210,6 +212,7 @@ TUNABLE_INT("hw.vtblk.writecache_mode", &vtblk_writeca VIRTIO_BLK_F_WCE | \ VIRTIO_BLK_F_TOPOLOGY | \ VIRTIO_BLK_F_CONFIG_WCE | \ + VIRTIO_BLK_F_DISCARD | \ VIRTIO_RING_F_INDIRECT_DESC) #define VTBLK_MTX(_sc) &(_sc)->vtblk_mtx @@ -461,7 +464,7 @@ vtblk_config_change(device_t dev) vtblk_read_config(sc, &blkcfg); /* Capacity is always in 512-byte units. */ - capacity = blkcfg.capacity * 512; + capacity = blkcfg.capacity * VTBLK_BSIZE; if (sc->vtblk_disk->d_mediasize != capacity) vtblk_resize_disk(sc, capacity); @@ -546,11 +549,18 @@ vtblk_strategy(struct bio *bp) * be a better way to report our readonly'ness to GEOM above. */ if (sc->vtblk_flags & VTBLK_FLAG_READONLY && - (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH)) { + (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH || + bp->bio_cmd == BIO_DELETE)) { vtblk_bio_done(sc, bp, EROFS); return; } + if ((bp->bio_cmd != BIO_READ) && (bp->bio_cmd != BIO_WRITE) && + (bp->bio_cmd != BIO_FLUSH) && (bp->bio_cmd != BIO_DELETE)) { + vtblk_bio_done(sc, bp, EOPNOTSUPP); + return; + } + VTBLK_LOCK(sc); if (sc->vtblk_flags & VTBLK_FLAG_DETACH) { @@ -559,6 +569,13 @@ vtblk_strategy(struct bio *bp) return; } + if ((bp->bio_cmd == BIO_DELETE) && + !(sc->vtblk_flags & VTBLK_FLAG_DISCARD)) { + VTBLK_UNLOCK(sc); + vtblk_bio_done(sc, bp, EOPNOTSUPP); + return; + } + bioq_insert_tail(&sc->vtblk_bioq, bp); vtblk_startio(sc); @@ -594,6 +611,8 @@ vtblk_setup_features(struct vtblk_softc *sc) sc->vtblk_flags |= VTBLK_FLAG_BARRIER; if (virtio_with_feature(dev, VIRTIO_BLK_F_CONFIG_WCE)) sc->vtblk_flags |= VTBLK_FLAG_WC_CONFIG; + if (virtio_with_feature(dev, VIRTIO_BLK_F_DISCARD)) + sc->vtblk_flags |= VTBLK_FLAG_DISCARD; } static int @@ -683,12 +702,12 @@ vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio dp->d_dump = vtblk_dump; /* Capacity is always in 512-byte units. */ - dp->d_mediasize = blkcfg->capacity * 512; + dp->d_mediasize = blkcfg->capacity * VTBLK_BSIZE; if (virtio_with_feature(dev, VIRTIO_BLK_F_BLK_SIZE)) dp->d_sectorsize = blkcfg->blk_size; else - dp->d_sectorsize = 512; + dp->d_sectorsize = VTBLK_BSIZE; /* * The VirtIO maximum I/O size is given in terms of segments. @@ -722,6 +741,11 @@ vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio dp->d_stripesize; } + if (virtio_with_feature(dev, VIRTIO_BLK_F_DISCARD)) { + dp->d_flags |= DISKFLAG_CANDELETE; + dp->d_delmaxsize = blkcfg->max_discard_sectors * VTBLK_BSIZE; + } + if (vtblk_write_cache_enabled(sc, blkcfg) != 0) sc->vtblk_write_cache = VTBLK_CACHE_WRITEBACK; else @@ -872,12 +896,16 @@ vtblk_request_bio(struct vtblk_softc *sc) break; case BIO_READ: req->vbr_hdr.type = VIRTIO_BLK_T_IN; - req->vbr_hdr.sector = bp->bio_offset / 512; + req->vbr_hdr.sector = bp->bio_offset / VTBLK_BSIZE; break; case BIO_WRITE: req->vbr_hdr.type = VIRTIO_BLK_T_OUT; - req->vbr_hdr.sector = bp->bio_offset / 512; + req->vbr_hdr.sector = bp->bio_offset / VTBLK_BSIZE; break; + case BIO_DELETE: + req->vbr_hdr.type = VIRTIO_BLK_T_DISCARD; + req->vbr_hdr.sector = bp->bio_offset / VTBLK_BSIZE; + break; default: panic("%s: bio with unhandled cmd: %d", __func__, bp->bio_cmd); } @@ -931,6 +959,20 @@ vtblk_request_execute(struct vtblk_softc *sc, struct v /* BIO_READ means the host writes into our buffer. */ if (bp->bio_cmd == BIO_READ) writable = sg->sg_nseg - 1; + } else if (bp->bio_cmd == BIO_DELETE) { + struct virtio_blk_discard_write_zeroes *discard; + + discard = malloc(sizeof(*discard), M_DEVBUF, M_NOWAIT | M_ZERO); + if (discard == NULL) + return (ENOMEM); + discard->sector = bp->bio_offset / VTBLK_BSIZE; + discard->num_sectors = bp->bio_bcount / VTBLK_BSIZE; + bp->bio_driver1 = discard; + error = sglist_append(sg, discard, sizeof(*discard)); + if (error || sg->sg_nseg == sg->sg_maxseg) { + panic("%s: bio %p data buffer too big %d", + __func__, bp, error); + } } writable++; @@ -1091,6 +1133,11 @@ vtblk_bio_done(struct vtblk_softc *sc, struct bio *bp, bp->bio_flags |= BIO_ERROR; } + if (bp->bio_driver1 != NULL) { + free(bp->bio_driver1, M_DEVBUF); + bp->bio_driver1 = NULL; + } + biodone(bp); } @@ -1120,7 +1167,12 @@ vtblk_read_config(struct vtblk_softc *sc, struct virti VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_GEOMETRY, geometry, blkcfg); VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_BLK_SIZE, blk_size, blkcfg); VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_TOPOLOGY, topology, blkcfg); - VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_CONFIG_WCE, writeback, blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_CONFIG_WCE, wce, blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_DISCARD, max_discard_sectors, + blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_DISCARD, max_discard_seg, blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_DISCARD, discard_sector_alignment, + blkcfg); } #undef VTBLK_GET_CONFIG @@ -1278,7 +1330,7 @@ vtblk_dump_write(struct vtblk_softc *sc, void *virtual req->vbr_ack = -1; req->vbr_hdr.type = VIRTIO_BLK_T_OUT; req->vbr_hdr.ioprio = 1; - req->vbr_hdr.sector = offset / 512; + req->vbr_hdr.sector = offset / VTBLK_BSIZE; req->vbr_bp = &buf; g_reset_bio(&buf); @@ -1327,7 +1379,7 @@ vtblk_set_write_cache(struct vtblk_softc *sc, int wc) /* Set either writeback (1) or writethrough (0) mode. */ virtio_write_dev_config_1(sc->vtblk_dev, - offsetof(struct virtio_blk_config, writeback), wc); + offsetof(struct virtio_blk_config, wce), wc); } static int @@ -1342,7 +1394,7 @@ vtblk_write_cache_enabled(struct vtblk_softc *sc, if (wc >= 0 && wc < VTBLK_CACHE_MAX) vtblk_set_write_cache(sc, wc); else - wc = blkcfg->writeback; + wc = blkcfg->wce; } else wc = virtio_with_feature(sc->vtblk_dev, VIRTIO_BLK_F_WCE); Modified: stable/12/sys/dev/virtio/block/virtio_blk.h ============================================================================== --- stable/12/sys/dev/virtio/block/virtio_blk.h Thu Sep 10 20:54:44 2020 (r365613) +++ stable/12/sys/dev/virtio/block/virtio_blk.h Thu Sep 10 21:01:22 2020 (r365614) @@ -33,20 +33,27 @@ #ifndef _VIRTIO_BLK_H #define _VIRTIO_BLK_H +#define VTBLK_BSIZE 512 + /* Feature bits */ -#define VIRTIO_BLK_F_BARRIER 0x0001 /* Does host support barriers? */ -#define VIRTIO_BLK_F_SIZE_MAX 0x0002 /* Indicates maximum segment size */ -#define VIRTIO_BLK_F_SEG_MAX 0x0004 /* Indicates maximum # of segments */ -#define VIRTIO_BLK_F_GEOMETRY 0x0010 /* Legacy geometry available */ -#define VIRTIO_BLK_F_RO 0x0020 /* Disk is read-only */ -#define VIRTIO_BLK_F_BLK_SIZE 0x0040 /* Block size of disk is available*/ -#define VIRTIO_BLK_F_SCSI 0x0080 /* Supports scsi command passthru */ -#define VIRTIO_BLK_F_WCE 0x0200 /* Writeback mode enabled after reset */ -#define VIRTIO_BLK_F_TOPOLOGY 0x0400 /* Topology information is available */ -#define VIRTIO_BLK_F_CONFIG_WCE 0x0800 /* Writeback mode available in config */ -#define VIRTIO_BLK_ID_BYTES 20 /* ID string length */ +#define VIRTIO_BLK_F_BARRIER 0x0001 /* Does host support barriers? */ +#define VIRTIO_BLK_F_SIZE_MAX 0x0002 /* Indicates maximum segment size */ +#define VIRTIO_BLK_F_SEG_MAX 0x0004 /* Indicates maximum # of segments */ +#define VIRTIO_BLK_F_GEOMETRY 0x0010 /* Legacy geometry available */ +#define VIRTIO_BLK_F_RO 0x0020 /* Disk is read-only */ +#define VIRTIO_BLK_F_BLK_SIZE 0x0040 /* Block size of disk is available*/ +#define VIRTIO_BLK_F_SCSI 0x0080 /* Supports scsi command passthru */ +#define VIRTIO_BLK_F_FLUSH 0x0200 /* Flush command supported */ +#define VIRTIO_BLK_F_WCE 0x0200 /* Legacy alias for FLUSH */ +#define VIRTIO_BLK_F_TOPOLOGY 0x0400 /* Topology information is available */ +#define VIRTIO_BLK_F_CONFIG_WCE 0x0800 /* Writeback mode available in config */ +#define VIRTIO_BLK_F_MQ 0x1000 /* Support more than one vq */ +#define VIRTIO_BLK_F_DISCARD 0x2000 /* Trim blocks */ +#define VIRTIO_BLK_F_WRITE_ZEROES 0x4000 /* Write zeros */ +#define VIRTIO_BLK_ID_BYTES 20 /* ID string length */ + struct virtio_blk_config { /* The capacity (in 512-byte sectors). */ uint64_t capacity; @@ -66,15 +73,29 @@ struct virtio_blk_config { /* Topology of the device (if VIRTIO_BLK_F_TOPOLOGY) */ struct virtio_blk_topology { + /* Exponent for physical block per logical block. */ uint8_t physical_block_exp; + /* Alignment offset in logical blocks. */ uint8_t alignment_offset; + /* Minimum I/O size without performance penalty in logical + * blocks. */ uint16_t min_io_size; + /* Optimal sustained I/O size in logical blocks. */ uint32_t opt_io_size; } topology; /* Writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */ - uint8_t writeback; - + uint8_t wce; + uint8_t unused; + /* Number of vqs, only available when VIRTIO_BLK_F_MQ is set */ + uint16_t num_queues; + uint32_t max_discard_sectors; + uint32_t max_discard_seg; + uint32_t discard_sector_alignment; + uint32_t max_write_zeroes_sectors; + uint32_t max_write_zeroes_seg; + uint8_t write_zeroes_may_unmap; + uint8_t unused1[3]; } __packed; /* @@ -89,24 +110,35 @@ struct virtio_blk_config { */ /* These two define direction. */ -#define VIRTIO_BLK_T_IN 0 -#define VIRTIO_BLK_T_OUT 1 +#define VIRTIO_BLK_T_IN 0 +#define VIRTIO_BLK_T_OUT 1 /* This bit says it's a scsi command, not an actual read or write. */ -#define VIRTIO_BLK_T_SCSI_CMD 2 +#define VIRTIO_BLK_T_SCSI_CMD 2 +#define VIRTIO_BLK_T_SCSI_CMD_OUT 3 /* Cache flush command */ -#define VIRTIO_BLK_T_FLUSH 4 +#define VIRTIO_BLK_T_FLUSH 4 +#define VIRTIO_BLK_T_FLUSH_OUT 5 /* Get device ID command */ -#define VIRTIO_BLK_T_GET_ID 8 +#define VIRTIO_BLK_T_GET_ID 8 +/* Discard command */ +#define VIRTIO_BLK_T_DISCARD 11 + +/* Write zeros command */ +#define VIRTIO_BLK_T_WRITE_ZEROES 13 + /* Barrier before this op. */ -#define VIRTIO_BLK_T_BARRIER 0x80000000 +#define VIRTIO_BLK_T_BARRIER 0x80000000 /* ID string length */ -#define VIRTIO_BLK_ID_BYTES 20 +#define VIRTIO_BLK_ID_BYTES 20 +/* Unmap this range (only valid for write zeroes command) */ +#define VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP 0x00000001 + /* This is the first element of the read scatter-gather list. */ struct virtio_blk_outhdr { /* VIRTIO_BLK_T* */ @@ -115,6 +147,15 @@ struct virtio_blk_outhdr { uint32_t ioprio; /* Sector (ie. 512 byte offset) */ uint64_t sector; +}; + +struct virtio_blk_discard_write_zeroes { + uint64_t sector; + uint32_t num_sectors; + struct { + uint32_t unmap:1; + uint32_t reserved:31; + } flags; }; struct virtio_scsi_inhdr { Modified: stable/12/usr.sbin/bhyve/block_if.c ============================================================================== --- stable/12/usr.sbin/bhyve/block_if.c Thu Sep 10 20:54:44 2020 (r365613) +++ stable/12/usr.sbin/bhyve/block_if.c Thu Sep 10 21:01:22 2020 (r365614) @@ -3,6 +3,7 @@ * * Copyright (c) 2013 Peter Grehan * All rights reserved. + * Copyright 2020 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -410,6 +411,8 @@ blockif_open(const char *optstr, const char *ident) off_t size, psectsz, psectoff; int extra, fd, i, sectsz; int nocache, sync, ro, candelete, geom, ssopt, pssopt; + int nodelete; + #ifndef WITHOUT_CAPSICUM cap_rights_t rights; cap_ioctl_t cmds[] = { DIOCGFLUSH, DIOCGDELETE }; @@ -422,6 +425,7 @@ blockif_open(const char *optstr, const char *ident) nocache = 0; sync = 0; ro = 0; + nodelete = 0; /* * The first element in the optstring is always a pathname. @@ -434,6 +438,8 @@ blockif_open(const char *optstr, const char *ident) continue; else if (!strcmp(cp, "nocache")) nocache = 1; + else if (!strcmp(cp, "nodelete")) + nodelete = 1; else if (!strcmp(cp, "sync") || !strcmp(cp, "direct")) sync = 1; else if (!strcmp(cp, "ro")) @@ -500,7 +506,7 @@ blockif_open(const char *optstr, const char *ident) ioctl(fd, DIOCGSTRIPEOFFSET, &psectoff); strlcpy(arg.name, "GEOM::candelete", sizeof(arg.name)); arg.len = sizeof(arg.value.i); - if (ioctl(fd, DIOCGATTR, &arg) == 0) + if (nodelete == 0 && ioctl(fd, DIOCGATTR, &arg) == 0) candelete = arg.value.i; if (ioctl(fd, DIOCGPROVIDERNAME, name) == 0) geom = 1; Modified: stable/12/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_virtio_block.c Thu Sep 10 20:54:44 2020 (r365613) +++ stable/12/usr.sbin/bhyve/pci_virtio_block.c Thu Sep 10 21:01:22 2020 (r365614) @@ -3,7 +3,7 @@ * * Copyright (c) 2011 NetApp, Inc. * All rights reserved. - * Copyright (c) 2019 Joyent, Inc. + * Copyright 2020 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,26 +57,37 @@ __FBSDID("$FreeBSD$"); #include "virtio.h" #include "block_if.h" -#define VTBLK_RINGSZ 128 +#define VTBLK_BSIZE 512 +#define VTBLK_RINGSZ 128 _Static_assert(VTBLK_RINGSZ <= BLOCKIF_RING_MAX, "Each ring entry must be able to queue a request"); -#define VTBLK_S_OK 0 -#define VTBLK_S_IOERR 1 +#define VTBLK_S_OK 0 +#define VTBLK_S_IOERR 1 #define VTBLK_S_UNSUPP 2 #define VTBLK_BLK_ID_BYTES 20 + 1 /* Capability bits */ -#define VTBLK_F_SEG_MAX (1 << 2) /* Maximum request segments */ -#define VTBLK_F_BLK_SIZE (1 << 6) /* cfg block size valid */ -#define VTBLK_F_FLUSH (1 << 9) /* Cache flush support */ -#define VTBLK_F_TOPOLOGY (1 << 10) /* Optimal I/O alignment */ +#define VTBLK_F_BARRIER (1 << 0) /* Does host support barriers? */ +#define VTBLK_F_SIZE_MAX (1 << 1) /* Indicates maximum segment size */ +#define VTBLK_F_SEG_MAX (1 << 2) /* Indicates maximum # of segments */ +#define VTBLK_F_GEOMETRY (1 << 4) /* Legacy geometry available */ +#define VTBLK_F_RO (1 << 5) /* Disk is read-only */ +#define VTBLK_F_BLK_SIZE (1 << 6) /* Block size of disk is available*/ +#define VTBLK_F_SCSI (1 << 7) /* Supports scsi command passthru */ +#define VTBLK_F_FLUSH (1 << 9) /* Writeback mode enabled after reset */ +#define VTBLK_F_WCE (1 << 9) /* Legacy alias for FLUSH */ +#define VTBLK_F_TOPOLOGY (1 << 10) /* Topology information is available */ +#define VTBLK_F_CONFIG_WCE (1 << 11) /* Writeback mode available in config */ +#define VTBLK_F_MQ (1 << 12) /* Multi-Queue */ +#define VTBLK_F_DISCARD (1 << 13) /* Trim blocks */ +#define VTBLK_F_WRITE_ZEROES (1 << 14) /* Write zeros */ /* * Host capabilities */ -#define VTBLK_S_HOSTCAPS \ +#define VTBLK_S_HOSTCAPS \ ( VTBLK_F_SEG_MAX | \ VTBLK_F_BLK_SIZE | \ VTBLK_F_FLUSH | \ @@ -84,6 +95,18 @@ _Static_assert(VTBLK_RINGSZ <= BLOCKIF_RING_MAX, "Each VIRTIO_RING_F_INDIRECT_DESC ) /* indirect descriptors */ /* + * The current blockif_delete() interface only allows a single delete + * request at a time. + */ +#define VTBLK_MAX_DISCARD_SEG 1 + +/* + * An arbitrary limit to prevent excessive latency due to large + * delete requests. + */ +#define VTBLK_MAX_DISCARD_SECT ((16 << 20) / VTBLK_BSIZE) /* 16 MiB */ + +/* * Config space "registers" */ struct vtblk_config { @@ -103,6 +126,15 @@ struct vtblk_config { uint32_t opt_io_size; } vbc_topology; uint8_t vbc_writeback; + uint8_t unused0[1]; + uint16_t num_queues; + uint32_t max_discard_sectors; + uint32_t max_discard_seg; + uint32_t discard_sector_alignment; + uint32_t max_write_zeroes_sectors; + uint32_t max_write_zeroes_seg; + uint8_t write_zeroes_may_unmap; + uint8_t unused1[3]; } __packed; /* @@ -111,9 +143,14 @@ struct vtblk_config { struct virtio_blk_hdr { #define VBH_OP_READ 0 #define VBH_OP_WRITE 1 +#define VBH_OP_SCSI_CMD 2 +#define VBH_OP_SCSI_CMD_OUT 3 #define VBH_OP_FLUSH 4 #define VBH_OP_FLUSH_OUT 5 #define VBH_OP_IDENT 8 +#define VBH_OP_DISCARD 11 +#define VBH_OP_WRITE_ZEROES 13 + #define VBH_FLAG_BARRIER 0x80000000 /* OR'ed into vbh_type */ uint32_t vbh_type; uint32_t vbh_ioprio; @@ -124,8 +161,8 @@ struct virtio_blk_hdr { * Debug printf */ static int pci_vtblk_debug; -#define DPRINTF(params) if (pci_vtblk_debug) PRINTLN params -#define WPRINTF(params) PRINTLN params +#define DPRINTF(params) if (pci_vtblk_debug) PRINTLN params +#define WPRINTF(params) PRINTLN params struct pci_vtblk_ioreq { struct blockif_req io_req; @@ -134,6 +171,15 @@ struct pci_vtblk_ioreq { uint16_t io_idx; }; +struct virtio_blk_discard_write_zeroes { + uint64_t sector; + uint32_t num_sectors; + struct { + uint32_t unmap:1; + uint32_t reserved:31; + } flags; +}; + /* * Per-device softc */ @@ -142,6 +188,7 @@ struct pci_vtblk_softc { pthread_mutex_t vsc_mtx; struct vqueue_info vbsc_vq; struct vtblk_config vbsc_cfg; + struct virtio_consts vbsc_consts; struct blockif_ctxt *bc; char vbsc_ident[VTBLK_BLK_ID_BYTES]; struct pci_vtblk_ioreq vbsc_ios[VTBLK_RINGSZ]; @@ -174,9 +221,8 @@ pci_vtblk_reset(void *vsc) } static void -pci_vtblk_done(struct blockif_req *br, int err) +pci_vtblk_done_locked(struct pci_vtblk_ioreq *io, int err) { - struct pci_vtblk_ioreq *io = br->br_param; struct pci_vtblk_softc *sc = io->io_sc; /* convert errno into a virtio block error return */ @@ -191,9 +237,18 @@ pci_vtblk_done(struct blockif_req *br, int err) * Return the descriptor back to the host. * We wrote 1 byte (our status) to host. */ - pthread_mutex_lock(&sc->vsc_mtx); vq_relchain(&sc->vbsc_vq, io->io_idx, 1); vq_endchains(&sc->vbsc_vq, 0); +} + +static void +pci_vtblk_done(struct blockif_req *br, int err) +{ + struct pci_vtblk_ioreq *io = br->br_param; + struct pci_vtblk_softc *sc = io->io_sc; + + pthread_mutex_lock(&sc->vsc_mtx); + pci_vtblk_done_locked(io, err); pthread_mutex_unlock(&sc->vsc_mtx); } @@ -208,6 +263,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque int writeop, type; struct iovec iov[BLOCKIF_IOV_MAX + 2]; uint16_t idx, flags[BLOCKIF_IOV_MAX + 2]; + struct virtio_blk_discard_write_zeroes *discard; n = vq_getchain(vq, &idx, iov, BLOCKIF_IOV_MAX + 2, flags); @@ -224,11 +280,11 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque io = &sc->vbsc_ios[idx]; assert((flags[0] & VRING_DESC_F_WRITE) == 0); assert(iov[0].iov_len == sizeof(struct virtio_blk_hdr)); - vbh = iov[0].iov_base; + vbh = (struct virtio_blk_hdr *)iov[0].iov_base; memcpy(&io->io_req.br_iov, &iov[1], sizeof(struct iovec) * (n - 2)); io->io_req.br_iovcnt = n - 2; - io->io_req.br_offset = vbh->vbh_sector * DEV_BSIZE; - io->io_status = iov[--n].iov_base; + io->io_req.br_offset = vbh->vbh_sector * VTBLK_BSIZE; + io->io_status = (uint8_t *)iov[--n].iov_base; assert(iov[n].iov_len == 1); assert(flags[n] & VRING_DESC_F_WRITE); @@ -238,7 +294,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque * we don't advertise the capability. */ type = vbh->vbh_type & ~VBH_FLAG_BARRIER; - writeop = (type == VBH_OP_WRITE); + writeop = (type == VBH_OP_WRITE || type == VBH_OP_DISCARD); iolen = 0; for (i = 1; i < n; i++) { @@ -254,7 +310,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque io->io_req.br_resid = iolen; DPRINTF(("virtio-block: %s op, %zd bytes, %d segs, offset %ld", - writeop ? "write" : "read/ident", iolen, i - 1, + writeop ? "write/discard" : "read/ident", iolen, i - 1, io->io_req.br_offset)); switch (type) { @@ -264,6 +320,46 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque case VBH_OP_WRITE: err = blockif_write(sc->bc, &io->io_req); break; + case VBH_OP_DISCARD: + /* + * We currently only support a single request, if the guest + * has submitted a request that doesn't conform to the + * requirements, we return a error. + */ + if (iov[1].iov_len != sizeof (*discard)) { + pci_vtblk_done_locked(io, EINVAL); + return; + } + + /* The segments to discard are provided rather than data */ + discard = (struct virtio_blk_discard_write_zeroes *) + iov[1].iov_base; + + /* + * virtio v1.1 5.2.6.2: + * The device MUST set the status byte to VIRTIO_BLK_S_UNSUPP + * for discard and write zeroes commands if any unknown flag is + * set. Furthermore, the device MUST set the status byte to + * VIRTIO_BLK_S_UNSUPP for discard commands if the unmap flag + * is set. + * + * Currently there are no known flags for a DISCARD request. + */ + if (discard->flags.unmap != 0 || discard->flags.reserved != 0) { + pci_vtblk_done_locked(io, ENOTSUP); + return; + } + + /* Make sure the request doesn't exceed our size limit */ + if (discard->num_sectors > VTBLK_MAX_DISCARD_SECT) { + pci_vtblk_done_locked(io, EINVAL); + return; + } + + io->io_req.br_offset = discard->sector * VTBLK_BSIZE; + io->io_req.br_resid = discard->num_sectors * VTBLK_BSIZE; + err = blockif_delete(sc->bc, &io->io_req); + break; case VBH_OP_FLUSH: case VBH_OP_FLUSH_OUT: err = blockif_flush(sc->bc, &io->io_req); @@ -274,10 +370,10 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque memset(iov[1].iov_base, 0, iov[1].iov_len); strncpy(iov[1].iov_base, sc->vbsc_ident, MIN(iov[1].iov_len, sizeof(sc->vbsc_ident))); - pci_vtblk_done(&io->io_req, 0); + pci_vtblk_done_locked(io, 0); return; default: - pci_vtblk_done(&io->io_req, EOPNOTSUPP); + pci_vtblk_done_locked(io, EOPNOTSUPP); return; } assert(err == 0); @@ -332,10 +428,14 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * io->io_idx = i; } + bcopy(&vtblk_vi_consts, &sc->vbsc_consts, sizeof (vtblk_vi_consts)); + if (blockif_candelete(sc->bc)) + sc->vbsc_consts.vc_hv_caps |= VTBLK_F_DISCARD; + pthread_mutex_init(&sc->vsc_mtx, NULL); /* init virtio softc and virtqueues */ - vi_softc_linkup(&sc->vbsc_vs, &vtblk_vi_consts, sc, pi, &sc->vbsc_vq); + vi_softc_linkup(&sc->vbsc_vs, &sc->vbsc_consts, sc, pi, &sc->vbsc_vq); sc->vbsc_vs.vs_mtx = &sc->vsc_mtx; sc->vbsc_vq.vq_qsize = VTBLK_RINGSZ; @@ -353,7 +453,7 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); /* setup virtio block config space */ - sc->vbsc_cfg.vbc_capacity = size / DEV_BSIZE; /* 512-byte units */ + sc->vbsc_cfg.vbc_capacity = size / VTBLK_BSIZE; /* 512-byte units */ sc->vbsc_cfg.vbc_size_max = 0; /* not negotiated */ /* @@ -375,6 +475,9 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * sc->vbsc_cfg.vbc_topology.min_io_size = 0; sc->vbsc_cfg.vbc_topology.opt_io_size = 0; sc->vbsc_cfg.vbc_writeback = 0; + sc->vbsc_cfg.max_discard_sectors = VTBLK_MAX_DISCARD_SECT; + sc->vbsc_cfg.max_discard_seg = VTBLK_MAX_DISCARD_SEG; + sc->vbsc_cfg.discard_sector_alignment = sectsz / VTBLK_BSIZE; /* * Should we move some of this into virtio.c? Could From owner-svn-src-stable@freebsd.org Thu Sep 10 21:44:38 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EC603E4BAB; Thu, 10 Sep 2020 21:44:38 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnXTx5dsTz4gvP; Thu, 10 Sep 2020 21:44:37 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f53.google.com with SMTP id g10so6646530otq.9; Thu, 10 Sep 2020 14:44:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=42z1Oe2biSkBNAfsJH0xt9cSIkjMRSuPkouocb5PUNQ=; b=EPbgH3oAXQToIV1/N/xictyN4B4j2hVPrNjGFa1iZXYrzSCxdoqLny4YnMvIdlhX20 nyDlmBdKfcDq/33TLXTJkjurZc9KeKkW+A4sCqspvuMdawMgmnFCAlCGmjBxkw50wjmL 4fPp64u5QzK8WTH0FoOrQb4P0vrde5Btc7l9y8JPYZQdpfTsWPXdzfRw681KCFdmkign /CysvjzIinLxUVk+sUy1AilgsqcbotqIgGEIXV5DFmk1f8md+yVL9U+0wcB8l84YJBuX C9j5fMDiuLsQpNosfDBiC59Sy34Ovot3aWioboJ9UP4ZrHPtiIDWQm0MXXs5qzwKK72/ hWbQ== X-Gm-Message-State: AOAM530u6VSwMsi+LfdZmkuHE9gT0qpRnANEncMXKkdsuQIpMXAXctPK /cVq97Hse8jOcnHjssEE4LORdIjIuLtWgFvryEuhOyHg X-Google-Smtp-Source: ABdhPJzsINizzCpst2n9bCZHaUykhj2rxPw4T4JURAGjomrmAXnWrzO5OKKxOd2mYQHLsIveuPAiZwfy4rRKG6nMHn0= X-Received: by 2002:a05:6830:1e30:: with SMTP id t16mr5445672otr.18.1599774275601; Thu, 10 Sep 2020 14:44:35 -0700 (PDT) MIME-Version: 1.0 References: <202009102101.08AL1MDW060901@repo.freebsd.org> In-Reply-To: <202009102101.08AL1MDW060901@repo.freebsd.org> From: Alan Somers Date: Thu, 10 Sep 2020 15:44:24 -0600 Message-ID: Subject: Re: svn commit: r365614 - in stable/12: sys/dev/virtio/block usr.sbin/bhyve To: Allan Jude Cc: src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org X-Rspamd-Queue-Id: 4BnXTx5dsTz4gvP X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 21:44:38 -0000 On Thu, Sep 10, 2020 at 3:01 PM Allan Jude wrote: > Author: allanjude > Date: Thu Sep 10 21:01:22 2020 > New Revision: 365614 > URL: https://svnweb.freebsd.org/changeset/base/365614 > > Log: > MFC r360229, r363255 > > r360229: > Add VIRTIO_BLK_T_DISCARD (TRIM) support to the bhyve virtio-blk backend > > This will advertise support for TRIM to the guest virtio-blk driver and > perform the DIOCGDELETE ioctl on the backing storage if it supports it. > > Thanks to Jason King and others at Joyent and illumos for expanding on > my original patch, adding improvements including better error handling > and making sure to following the virtio spec. > > r363255: > Add VIRTIO_BLK_T_DISCARD support to the virtio-blk driver > > If the hypervisor advertises support for the DISCARD command then the > guest can perform TRIM commands, freeing space on the backing store. > > If VIRTIO_BLK_F_DISCARD is enabled, advertise DISKFLAG_CANDELETE > > Tested with FreeBSD guests on bhyve and KVM > > Relnotes: yes > Sponsored by: Klara Inc. > > Modified: > stable/12/sys/dev/virtio/block/virtio_blk.c > stable/12/sys/dev/virtio/block/virtio_blk.h > stable/12/usr.sbin/bhyve/block_if.c > stable/12/usr.sbin/bhyve/pci_virtio_block.c > Directory Properties: > stable/12/ (props changed) > Yay! From owner-svn-src-stable@freebsd.org Fri Sep 11 00:04:23 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D88393E7B41; Fri, 11 Sep 2020 00:04:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnbbC5QC5z4pfH; Fri, 11 Sep 2020 00:04:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D2901B4A5; Fri, 11 Sep 2020 00:04:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08B04Nsn072375; Fri, 11 Sep 2020 00:04:23 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08B04NNO072373; Fri, 11 Sep 2020 00:04:23 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202009110004.08B04NNO072373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 11 Sep 2020 00:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365619 - in stable/12/sys: conf sys X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/12/sys: conf sys X-SVN-Commit-Revision: 365619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2020 00:04:23 -0000 Author: gjb Date: Fri Sep 11 00:04:23 2020 New Revision: 365619 URL: https://svnweb.freebsd.org/changeset/base/365619 Log: Rename stable/12 to -STABLE, and bump __FreeBSD_version after releng/12.2 had been created. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/12/sys/conf/newvers.sh stable/12/sys/sys/param.h Modified: stable/12/sys/conf/newvers.sh ============================================================================== --- stable/12/sys/conf/newvers.sh Thu Sep 10 23:56:59 2020 (r365618) +++ stable/12/sys/conf/newvers.sh Fri Sep 11 00:04:23 2020 (r365619) @@ -49,7 +49,7 @@ TYPE="FreeBSD" REVISION="12.2" -BRANCH=${BRANCH_OVERRIDE:-PRERELEASE} +BRANCH=${BRANCH_OVERRIDE:-STABLE} RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Thu Sep 10 23:56:59 2020 (r365618) +++ stable/12/sys/sys/param.h Fri Sep 11 00:04:23 2020 (r365619) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1201526 /* Master, propagated to newvers */ +#define __FreeBSD_version 1202500 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@freebsd.org Fri Sep 11 10:05:45 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04B973D48CF; Fri, 11 Sep 2020 10:05:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bnrx465SZz467k; Fri, 11 Sep 2020 10:05:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4F672250E; Fri, 11 Sep 2020 10:05:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08BA5iph038562; Fri, 11 Sep 2020 10:05:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BA5iGY038561; Fri, 11 Sep 2020 10:05:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009111005.08BA5iGY038561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 11 Sep 2020 10:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365627 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 365627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2020 10:05:45 -0000 Author: kib Date: Fri Sep 11 10:05:44 2020 New Revision: 365627 URL: https://svnweb.freebsd.org/changeset/base/365627 Log: MFC r365360, r365370: rtld: Handle ELF dso with program headers outside the first page. PR: 229708 Modified: stable/12/libexec/rtld-elf/map_object.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/map_object.c ============================================================================== --- stable/12/libexec/rtld-elf/map_object.c Fri Sep 11 09:15:49 2020 (r365626) +++ stable/12/libexec/rtld-elf/map_object.c Fri Sep 11 10:05:44 2020 (r365627) @@ -40,11 +40,19 @@ #include "debug.h" #include "rtld.h" -static Elf_Ehdr *get_elf_header(int, const char *, const struct stat *); +static Elf_Ehdr *get_elf_header(int, const char *, const struct stat *, + Elf_Phdr **phdr); static int convert_flags(int); /* Elf flags -> mmap flags */ int __getosreldate(void); +static bool +phdr_in_zero_page(const Elf_Ehdr *hdr) +{ + return (hdr->e_phoff + hdr->e_phnum * sizeof(Elf_Phdr) <= + (size_t)PAGE_SIZE); +} + /* * Map a shared object into memory. The "fd" argument is a file descriptor, * which must be open on the object and positioned at its beginning. @@ -94,17 +102,15 @@ map_object(int fd, const char *path, const struct stat char *note_map; size_t note_map_len; - hdr = get_elf_header(fd, path, sb); + hdr = get_elf_header(fd, path, sb, &phdr); if (hdr == NULL) return (NULL); /* * Scan the program header entries, and save key information. - * * We expect that the loadable segments are ordered by load address. */ - phdr = (Elf_Phdr *)((char *)hdr + hdr->e_phoff); - phsize = hdr->e_phnum * sizeof (phdr[0]); + phsize = hdr->e_phnum * sizeof(phdr[0]); phlimit = phdr + hdr->e_phnum; nsegs = -1; phdyn = phinterp = phtls = NULL; @@ -327,14 +333,18 @@ error1: error: if (note_map != NULL && note_map != MAP_FAILED) munmap(note_map, note_map_len); + if (!phdr_in_zero_page(hdr)) + munmap(phdr, hdr->e_phnum * sizeof(phdr[0])); munmap(hdr, PAGE_SIZE); return (NULL); } static Elf_Ehdr * -get_elf_header(int fd, const char *path, const struct stat *sbp) +get_elf_header(int fd, const char *path, const struct stat *sbp, + Elf_Phdr **phdr_p) { Elf_Ehdr *hdr; + Elf_Phdr *phdr; /* Make sure file has enough data for the ELF header */ if (sbp != NULL && sbp->st_size < (off_t)sizeof(Elf_Ehdr)) { @@ -383,11 +393,19 @@ get_elf_header(int fd, const char *path, const struct "%s: invalid shared object: e_phentsize != sizeof(Elf_Phdr)", path); goto error; } - if (hdr->e_phoff + hdr->e_phnum * sizeof(Elf_Phdr) > - (size_t)PAGE_SIZE) { - _rtld_error("%s: program header too large", path); - goto error; + if (phdr_in_zero_page(hdr)) { + phdr = (Elf_Phdr *)((char *)hdr + hdr->e_phoff); + } else { + phdr = mmap(NULL, hdr->e_phnum * sizeof(phdr[0]), + PROT_READ, MAP_PRIVATE | MAP_PREFAULT_READ, fd, + hdr->e_phoff); + if (phdr == MAP_FAILED) { + _rtld_error("%s: error mapping phdr: %s", path, + rtld_strerror(errno)); + goto error; + } } + *phdr_p = phdr; return (hdr); error: From owner-svn-src-stable@freebsd.org Fri Sep 11 10:11:05 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 455FD3D4933; Fri, 11 Sep 2020 10:11:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bns3F19JLz46mK; Fri, 11 Sep 2020 10:11: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C89D2232D; Fri, 11 Sep 2020 10:11: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 08BAB4df039844; Fri, 11 Sep 2020 10:11:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BAB4HJ039843; Fri, 11 Sep 2020 10:11:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009111011.08BAB4HJ039843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 11 Sep 2020 10:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365629 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/libexec/rtld-elf X-SVN-Commit-Revision: 365629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2020 10:11:05 -0000 Author: kib Date: Fri Sep 11 10:11:04 2020 New Revision: 365629 URL: https://svnweb.freebsd.org/changeset/base/365629 Log: MFC r365360, r365370: rtld: Handle ELF dso with program headers outside the first page. PR: 229708 Modified: stable/11/libexec/rtld-elf/map_object.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/map_object.c ============================================================================== --- stable/11/libexec/rtld-elf/map_object.c Fri Sep 11 10:07:09 2020 (r365628) +++ stable/11/libexec/rtld-elf/map_object.c Fri Sep 11 10:11:04 2020 (r365629) @@ -38,11 +38,19 @@ #include "debug.h" #include "rtld.h" -static Elf_Ehdr *get_elf_header(int, const char *, const struct stat *); +static Elf_Ehdr *get_elf_header(int, const char *, const struct stat *, + Elf_Phdr **phdr); static int convert_flags(int); /* Elf flags -> mmap flags */ int __getosreldate(void); +static bool +phdr_in_zero_page(const Elf_Ehdr *hdr) +{ + return (hdr->e_phoff + hdr->e_phnum * sizeof(Elf_Phdr) <= + (size_t)PAGE_SIZE); +} + /* * Map a shared object into memory. The "fd" argument is a file descriptor, * which must be open on the object and positioned at its beginning. @@ -92,17 +100,15 @@ map_object(int fd, const char *path, const struct stat char *note_map; size_t note_map_len; - hdr = get_elf_header(fd, path, sb); + hdr = get_elf_header(fd, path, sb, &phdr); if (hdr == NULL) return (NULL); /* * Scan the program header entries, and save key information. - * * We expect that the loadable segments are ordered by load address. */ - phdr = (Elf_Phdr *) ((char *)hdr + hdr->e_phoff); - phsize = hdr->e_phnum * sizeof (phdr[0]); + phsize = hdr->e_phnum * sizeof(phdr[0]); phlimit = phdr + hdr->e_phnum; nsegs = -1; phdyn = phinterp = phtls = NULL; @@ -324,14 +330,18 @@ error1: error: if (note_map != NULL && note_map != MAP_FAILED) munmap(note_map, note_map_len); + if (!phdr_in_zero_page(hdr)) + munmap(phdr, hdr->e_phnum * sizeof(phdr[0])); munmap(hdr, PAGE_SIZE); return (NULL); } static Elf_Ehdr * -get_elf_header(int fd, const char *path, const struct stat *sbp) +get_elf_header(int fd, const char *path, const struct stat *sbp, + Elf_Phdr **phdr_p) { Elf_Ehdr *hdr; + Elf_Phdr *phdr; /* Make sure file has enough data for the ELF header */ if (sbp != NULL && sbp->st_size < sizeof(Elf_Ehdr)) { @@ -380,11 +390,19 @@ get_elf_header(int fd, const char *path, const struct "%s: invalid shared object: e_phentsize != sizeof(Elf_Phdr)", path); goto error; } - if (hdr->e_phoff + hdr->e_phnum * sizeof(Elf_Phdr) > - (size_t)PAGE_SIZE) { - _rtld_error("%s: program header too large", path); - goto error; + if (phdr_in_zero_page(hdr)) { + phdr = (Elf_Phdr *)((char *)hdr + hdr->e_phoff); + } else { + phdr = mmap(NULL, hdr->e_phnum * sizeof(phdr[0]), + PROT_READ, MAP_PRIVATE | MAP_PREFAULT_READ, fd, + hdr->e_phoff); + if (phdr == MAP_FAILED) { + _rtld_error("%s: error mapping phdr: %s", path, + rtld_strerror(errno)); + goto error; + } } + *phdr_p = phdr; return (hdr); error: From owner-svn-src-stable@freebsd.org Fri Sep 11 12:36:08 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 463D93D920B; Fri, 11 Sep 2020 12:36:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnwGc1S8Gz4Hx7; Fri, 11 Sep 2020 12:36:08 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F78623F33; Fri, 11 Sep 2020 12:36:08 +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 08BCa8u1030729; Fri, 11 Sep 2020 12:36:08 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BCa6VP030719; Fri, 11 Sep 2020 12:36:06 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202009111236.08BCa6VP030719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 11 Sep 2020 12:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365630 - in stable/12: sbin/rtsol usr.sbin/rtsold X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in stable/12: sbin/rtsol usr.sbin/rtsold X-SVN-Commit-Revision: 365630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2020 12:36:08 -0000 Author: bz Date: Fri Sep 11 12:36:05 2020 New Revision: 365630 URL: https://svnweb.freebsd.org/changeset/base/365630 Log: MFC r342788,354926,364771 (markj, bz) - Capsicumize rtsol(8) and rtsold(8). - Avoid relying on pollution from libcasper.h. - Add script for "M bit". Added: stable/12/usr.sbin/rtsold/cap_llflags.c - copied, changed from r342788, head/usr.sbin/rtsold/cap_llflags.c stable/12/usr.sbin/rtsold/cap_script.c - copied unchanged from r342788, head/usr.sbin/rtsold/cap_script.c stable/12/usr.sbin/rtsold/cap_sendmsg.c - copied unchanged from r342788, head/usr.sbin/rtsold/cap_sendmsg.c Deleted: stable/12/usr.sbin/rtsold/probe.c Modified: stable/12/sbin/rtsol/Makefile stable/12/usr.sbin/rtsold/Makefile stable/12/usr.sbin/rtsold/dump.c stable/12/usr.sbin/rtsold/if.c stable/12/usr.sbin/rtsold/rtsock.c stable/12/usr.sbin/rtsold/rtsol.c stable/12/usr.sbin/rtsold/rtsold.8 stable/12/usr.sbin/rtsold/rtsold.c stable/12/usr.sbin/rtsold/rtsold.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/rtsol/Makefile ============================================================================== --- stable/12/sbin/rtsol/Makefile Fri Sep 11 10:11:04 2020 (r365629) +++ stable/12/sbin/rtsol/Makefile Fri Sep 11 12:36:05 2020 (r365630) @@ -18,10 +18,24 @@ PACKAGE=runtime PROG= rtsol -SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c +SRCS= cap_llflags.c \ + cap_script.c \ + cap_sendmsg.c \ + dump.c \ + if.c \ + rtsol.c \ + rtsold.c \ + rtsock.c MAN= +LIBADD= util -WARNS?= 3 -CFLAGS+= -DSMALL +.include + +.if ${MK_DYNAMICROOT} == "no" +.warning ${PROG} built without libcasper support +.elif ${MK_CASPER} != "no" && !defined(RESCUE) +CFLAGS+= -DWITH_CASPER +LIBADD+= cap_syslog casper nv +.endif .include Modified: stable/12/usr.sbin/rtsold/Makefile ============================================================================== --- stable/12/usr.sbin/rtsold/Makefile Fri Sep 11 10:11:04 2020 (r365629) +++ stable/12/usr.sbin/rtsold/Makefile Fri Sep 11 12:36:05 2020 (r365630) @@ -17,8 +17,22 @@ PROG= rtsold MAN= rtsold.8 MLINKS= rtsold.8 rtsol.8 -SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c +SRCS= cap_llflags.c \ + cap_script.c \ + cap_sendmsg.c \ + dump.c \ + if.c \ + rtsock.c \ + rtsol.c \ + rtsold.c -WARNS?= 3 +LIBADD= util + +.include + +.if ${MK_CASPER} != "no" +CFLAGS+= -DWITH_CASPER +LIBADD+= casper cap_syslog nv +.endif .include Copied and modified: stable/12/usr.sbin/rtsold/cap_llflags.c (from r342788, head/usr.sbin/rtsold/cap_llflags.c) ============================================================================== --- head/usr.sbin/rtsold/cap_llflags.c Sat Jan 5 16:05:39 2019 (r342788, copy source) +++ stable/12/usr.sbin/rtsold/cap_llflags.c Fri Sep 11 12:36:05 2020 (r365630) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Copied: stable/12/usr.sbin/rtsold/cap_script.c (from r342788, head/usr.sbin/rtsold/cap_script.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/usr.sbin/rtsold/cap_script.c Fri Sep 11 12:36:05 2020 (r365630, copy of r342788, head/usr.sbin/rtsold/cap_script.c) @@ -0,0 +1,236 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 The FreeBSD Foundation + * + * This software was developed by Mark Johnston under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "rtsold.h" + +/* + * Run the script and return the write end of a pipe to the main process. + * Return -1 and set errno on error. + */ +static int +script_run(char **argv) +{ + pid_t pid; + int fd[2], null; + + if (pipe(fd) != 0) + return (-1); + if ((pid = fork()) < 0) + return (-1); + if (pid == 0) { + (void)close(fd[1]); + null = open("/dev/null", O_RDWR); + if (null < 0) + _exit(1); + if (dup2(fd[0], STDIN_FILENO) != STDIN_FILENO) + _exit(1); + + closefrom(3); + (void)execve(argv[0], argv, NULL); + _exit(1); + } else + (void)close(fd[0]); + + return (fd[1]); +} + +int +cap_script_run(cap_channel_t *cap, const char *const *argv) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + size_t argc; + int error, wfd; + + for (argc = 0; argv[argc] != NULL; argc++) + ; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "script_run"); + nvlist_add_string_array(nvl, "argv", argv, argc); + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (-1); + + error = (int)dnvlist_get_number(nvl, "error", 0); + if (error == 0) + wfd = nvlist_take_descriptor(nvl, "fd"); + nvlist_destroy(nvl); + if (error != 0) + errno = error; + return (error == 0 ? wfd : -1); +#else + (void)cap; + return (script_run(__DECONST(char **, argv))); +#endif +} + +/* + * Wait for a child process to exit, and return its status. + * Return -1 and set errno upon error. + */ +static int +script_wait(int *statusp) +{ + int error; + + error = wait(statusp); + return (error >= 0 ? 0 : -1); +} + +int +cap_script_wait(cap_channel_t *cap, int *statusp) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + int error; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "script_wait"); + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (-1); + + error = (int)dnvlist_get_number(nvl, "error", 0); + if (error == 0) + *statusp = (int)nvlist_get_number(nvl, "status"); + nvlist_destroy(nvl); + if (error != 0) + errno = error; + return (error == 0 ? 0 : -1); +#else + (void)cap; + return (script_wait(statusp)); +#endif +} + +#ifdef WITH_CASPER +static int +script_command(const char *cmd, const nvlist_t *limits, nvlist_t *nvlin, + nvlist_t *nvlout) +{ + cap_rights_t rights; + const char *const *iargv, *const *scripts; + char **argv; + size_t argc, i, nscripts; + int fd, status; + + if (strcmp(cmd, "script_wait") == 0) { + /* Wait for the result of a previous "script_run" command. */ + if (script_wait(&status) == -1) + return (errno); + nvlist_add_number(nvlout, "status", status); + return (0); + } + if (strcmp(cmd, "script_run") != 0) + return (EINVAL); + + /* + * Validate the argv against the limits specified at initialization + * time. + */ + iargv = nvlist_get_string_array(nvlin, "argv", &argc); + if (argc == 0) + return (EINVAL); + scripts = nvlist_get_string_array(limits, "scripts", &nscripts); + for (i = 0; i < nscripts; i++) + if (strcmp(iargv[0], scripts[i]) == 0) + break; + if (i == nscripts) + return (EINVAL); + + /* + * The nvlist API does not permit NULL pointers in an array, so we have + * to add the nul terminator ourselves. Yuck. + */ + argv = calloc(argc + 1, sizeof(*argv)); + if (argv == NULL) + return (errno); + memcpy(argv, iargv, sizeof(*argv) * argc); + + fd = script_run(argv); + if (fd < 0) + return (errno); + + (void)caph_rights_limit(fd, cap_rights_init(&rights, CAP_WRITE)); + nvlist_move_descriptor(nvlout, "fd", fd); + return (0); +} + +static int +script_limit(const nvlist_t *oldlimits, const nvlist_t *newlimits __unused) +{ + const char *name; + void *cookie; + int nvtype; + bool hasscripts; + + /* Limits may only be set once. */ + if (oldlimits != NULL) + return (ENOTCAPABLE); + + cookie = NULL; + hasscripts = false; + while ((name = nvlist_next(newlimits, &nvtype, &cookie)) != NULL) { + if (nvtype == NV_TYPE_STRING_ARRAY && + strcmp(name, "scripts") == 0) + hasscripts = true; + else + return (EINVAL); + } + if (!hasscripts) + return (EINVAL); + return (0); +} + +CREATE_SERVICE("rtsold.script", script_limit, script_command, 0); +#endif /* WITH_CASPER */ Copied: stable/12/usr.sbin/rtsold/cap_sendmsg.c (from r342788, head/usr.sbin/rtsold/cap_sendmsg.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/usr.sbin/rtsold/cap_sendmsg.c Fri Sep 11 12:36:05 2020 (r365630, copy of r342788, head/usr.sbin/rtsold/cap_sendmsg.c) @@ -0,0 +1,282 @@ +/* $KAME: probe.c,v 1.17 2003/10/05 00:09:36 itojun Exp $ */ + +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (C) 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "rtsold.h" + +static int +getsocket(int *sockp, int proto) +{ + cap_rights_t rights; + int sock; + + if (*sockp >= 0) + return (0); + + if ((sock = socket(AF_INET6, SOCK_RAW, proto)) < 0) + return (-1); + cap_rights_init(&rights, CAP_CONNECT, CAP_SEND); + if (caph_rights_limit(sock, &rights) != 0) + return (-1); + *sockp = sock; + + return (0); +} + +static ssize_t +sendpacket(int sock, struct sockaddr_in6 *dst, uint32_t ifindex, int hoplimit, + const void *data, size_t len) +{ + uint8_t cmsg[CMSG_SPACE(sizeof(struct in6_pktinfo)) + + CMSG_SPACE(sizeof(int))]; + struct msghdr hdr; + struct iovec iov; + struct in6_pktinfo *pi; + struct cmsghdr *cm; + + memset(&hdr, 0, sizeof(hdr)); + hdr.msg_name = dst; + hdr.msg_namelen = sizeof(*dst); + hdr.msg_iov = &iov; + hdr.msg_iovlen = 1; + hdr.msg_control = cmsg; + hdr.msg_controllen = sizeof(cmsg); + + iov.iov_base = __DECONST(void *, data); + iov.iov_len = len; + + /* Specify the outbound interface. */ + cm = CMSG_FIRSTHDR(&hdr); + cm->cmsg_level = IPPROTO_IPV6; + cm->cmsg_type = IPV6_PKTINFO; + cm->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo)); + pi = (struct in6_pktinfo *)(void *)CMSG_DATA(cm); + memset(&pi->ipi6_addr, 0, sizeof(pi->ipi6_addr)); /*XXX*/ + pi->ipi6_ifindex = ifindex; + + /* Specify the hop limit of the packet for safety. */ + cm = CMSG_NXTHDR(&hdr, cm); + cm->cmsg_level = IPPROTO_IPV6; + cm->cmsg_type = IPV6_HOPLIMIT; + cm->cmsg_len = CMSG_LEN(sizeof(int)); + memcpy(CMSG_DATA(cm), &hoplimit, sizeof(int)); + + return (sendmsg(sock, &hdr, 0)); +} + +static int +probe_defrouters(uint32_t ifindex, uint32_t linkid) +{ + static int probesock = -1; + struct sockaddr_in6 dst; + struct in6_defrouter *p, *ep; + char *buf; + size_t len; + int mib[4]; + + if (ifindex == 0) + return (0); + if (getsocket(&probesock, IPPROTO_NONE) != 0) + return (-1); + + mib[0] = CTL_NET; + mib[1] = PF_INET6; + mib[2] = IPPROTO_ICMPV6; + mib[3] = ICMPV6CTL_ND6_DRLIST; + if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0) + return (-1); + if (len == 0) + return (0); + + memset(&dst, 0, sizeof(dst)); + dst.sin6_family = AF_INET6; + dst.sin6_len = sizeof(dst); + + buf = malloc(len); + if (buf == NULL) + return (-1); + if (sysctl(mib, nitems(mib), buf, &len, NULL, 0) < 0) + return (-1); + ep = (struct in6_defrouter *)(void *)(buf + len); + for (p = (struct in6_defrouter *)(void *)buf; p < ep; p++) { + if (ifindex != p->if_index) + continue; + if (!IN6_IS_ADDR_LINKLOCAL(&p->rtaddr.sin6_addr)) + continue; + dst.sin6_addr = p->rtaddr.sin6_addr; + dst.sin6_scope_id = linkid; + (void)sendpacket(probesock, &dst, ifindex, 1, NULL, 0); + } + free(buf); + + return (0); +} + +static int +rssend(uint32_t ifindex, uint32_t linkid, const void *data, size_t len) +{ + static int rssock = -1; + struct sockaddr_in6 dst; + ssize_t n; + + if (getsocket(&rssock, IPPROTO_ICMPV6) != 0) + return (-1); + + memset(&dst, 0, sizeof(dst)); + dst.sin6_family = AF_INET6; + dst.sin6_len = sizeof(dst); + dst.sin6_addr = (struct in6_addr)IN6ADDR_LINKLOCAL_ALLROUTERS_INIT; + dst.sin6_scope_id = linkid; + + n = sendpacket(rssock, &dst, ifindex, 255, data, len); + if (n < 0 || (size_t)n != len) + return (-1); + return (0); +} + +int +cap_probe_defrouters(cap_channel_t *cap, struct ifinfo *ifinfo) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + int error; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "probe_defrouters"); + nvlist_add_number(nvl, "ifindex", ifinfo->sdl->sdl_index); + nvlist_add_number(nvl, "linkid", ifinfo->linkid); + + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (errno); + error = (int)dnvlist_get_number(nvl, "error", 0); + nvlist_destroy(nvl); + errno = error; + return (error == 0 ? 0 : -1); +#else + (void)cap; + return (probe_defrouters(ifinfo->sdl->sdl_index, ifinfo->linkid)); +#endif +} + +int +cap_rssend(cap_channel_t *cap, struct ifinfo *ifinfo) +{ + int error; + +#ifdef WITH_CASPER + nvlist_t *nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "rssend"); + nvlist_add_number(nvl, "ifindex", ifinfo->sdl->sdl_index); + nvlist_add_number(nvl, "linkid", ifinfo->linkid); + nvlist_add_binary(nvl, "data", ifinfo->rs_data, ifinfo->rs_datalen); + + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (errno); + error = (int)dnvlist_get_number(nvl, "error", 0); + nvlist_destroy(nvl); + errno = error; +#else + (void)cap; + error = rssend(ifinfo->sdl->sdl_index, ifinfo->linkid, ifinfo->rs_data, + ifinfo->rs_datalen); +#endif + + ifinfo->probes++; + if (error != 0 && (errno != ENETDOWN || dflag > 0)) { + error = errno; + warnmsg(LOG_ERR, __func__, "sendmsg on %s: %s", + ifinfo->ifname, strerror(errno)); + errno = error; + } + return (error == 0 ? 0 : -1); +} + +#ifdef WITH_CASPER +static int +sendmsg_command(const char *cmd, const nvlist_t *limits __unused, nvlist_t *nvlin, + nvlist_t *nvlout __unused) +{ + const void *data; + size_t len; + uint32_t ifindex, linkid; + int error; + + if (strcmp(cmd, "probe_defrouters") != 0 && + strcmp(cmd, "rssend") != 0) + return (EINVAL); + + ifindex = (uint32_t)nvlist_get_number(nvlin, "ifindex"); + linkid = (uint32_t)nvlist_get_number(nvlin, "linkid"); + if (strcmp(cmd, "probe_defrouters") == 0) { + error = probe_defrouters(ifindex, linkid); + } else { + data = nvlist_get_binary(nvlin, "data", &len); + error = rssend(ifindex, linkid, data, len); + } + if (error != 0) + return (errno); + return (0); +} + +CREATE_SERVICE("rtsold.sendmsg", NULL, sendmsg_command, 0); +#endif /* WITH_CASPER */ Modified: stable/12/usr.sbin/rtsold/dump.c ============================================================================== --- stable/12/usr.sbin/rtsold/dump.c Fri Sep 11 10:11:04 2020 (r365629) +++ stable/12/usr.sbin/rtsold/dump.c Fri Sep 11 12:36:05 2020 (r365630) @@ -34,6 +34,7 @@ */ #include +#include #include #include @@ -42,21 +43,20 @@ #include #include -#include -#include +#include +#include #include #include -#include +#include +#include #include "rtsold.h" -static FILE *fp; +static const char * const ifstatstr[] = + { "IDLE", "DELAY", "PROBE", "DOWN", "TENTATIVE" }; -static void dump_interface_status(void); -static const char * const ifstatstr[] = {"IDLE", "DELAY", "PROBE", "DOWN", "TENTATIVE"}; - -static void -dump_interface_status(void) +void +rtsold_dump(FILE *fp) { struct ifinfo *ifi; struct rainfo *rai; @@ -64,8 +64,14 @@ dump_interface_status(void) struct timespec now; char ntopbuf[INET6_ADDRSTRLEN]; - clock_gettime(CLOCK_MONOTONIC_FAST, &now); + if (fseek(fp, 0, SEEK_SET) != 0) { + warnmsg(LOG_ERR, __func__, "fseek(): %s", strerror(errno)); + return; + } + (void)ftruncate(fileno(fp), 0); + (void)clock_gettime(CLOCK_MONOTONIC_FAST, &now); + TAILQ_FOREACH(ifi, &ifinfo_head, ifi_next) { fprintf(fp, "Interface %s\n", ifi->ifname); fprintf(fp, " probe interval: "); @@ -78,6 +84,8 @@ dump_interface_status(void) } fprintf(fp, " interface status: %s\n", ifi->active > 0 ? "active" : "inactive"); + fprintf(fp, " managed config: %s\n", + ifi->managedconfig ? "on" : "off"); fprintf(fp, " other config: %s\n", ifi->otherconfig ? "on" : "off"); fprintf(fp, " rtsold status: %s\n", ifstatstr[ifi->state]); @@ -121,18 +129,28 @@ dump_interface_status(void) fprintf(fp, "\n"); } } + fflush(fp); } -void -rtsold_dump_file(const char *dumpfile) +FILE * +rtsold_init_dumpfile(const char *dumpfile) { + cap_rights_t rights; + FILE *fp; + if ((fp = fopen(dumpfile, "w")) == NULL) { - warnmsg(LOG_WARNING, __func__, "open a dump file(%s): %s", + warnmsg(LOG_WARNING, __func__, "opening a dump file(%s): %s", dumpfile, strerror(errno)); - return; + return (NULL); } - dump_interface_status(); - fclose(fp); + + cap_rights_init(&rights, CAP_FSTAT, CAP_FTRUNCATE, CAP_SEEK, CAP_WRITE); + if (caph_rights_limit(fileno(fp), &rights) != 0) { + warnmsg(LOG_WARNING, __func__, "caph_rights_limit(%s): %s", + dumpfile, strerror(errno)); + return (NULL); + } + return (fp); } const char * Modified: stable/12/usr.sbin/rtsold/if.c ============================================================================== --- stable/12/usr.sbin/rtsold/if.c Fri Sep 11 10:11:04 2020 (r365629) +++ stable/12/usr.sbin/rtsold/if.c Fri Sep 11 12:36:05 2020 (r365630) @@ -34,10 +34,11 @@ */ #include -#include -#include +#include #include #include +#include +#include #include #include @@ -51,6 +52,7 @@ #include #include +#include #include #include #include @@ -63,16 +65,28 @@ #include "rtsold.h" static int ifsock; - -static int get_llflag(const char *); static void get_rtaddrs(int, struct sockaddr *, struct sockaddr **); int ifinit(void) { - ifsock = rssock; + cap_rights_t rights; + int sock; - return(0); + sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6); + if (sock < 0) { + warnmsg(LOG_ERR, __func__, "socket(): %s", + strerror(errno)); + return (-1); + } + if (caph_rights_limit(sock, cap_rights_init(&rights, CAP_IOCTL)) < 0) { + warnmsg(LOG_ERR, __func__, "caph_rights_limit(): %s", + strerror(errno)); + (void)close(sock); + return (-1); + } + ifsock = sock; + return (0); } int @@ -150,10 +164,9 @@ interface_up(char *name) } close(s); - llflag = get_llflag(name); - if (llflag < 0) { + if (cap_llflags_get(capllflags, name, &llflag) != 0) { warnmsg(LOG_WARNING, __func__, - "get_llflag() failed, anyway I'll try"); + "cap_llflags_get() failed, anyway I'll try"); return (0); } @@ -273,8 +286,6 @@ lladdropt_fill(struct sockaddr_dl *sdl, struct nd_opt_ "unsupported link type(%d)", sdl->sdl_type); exit(1); } - - return; } struct sockaddr_dl * @@ -331,58 +342,6 @@ if_nametosdl(char *name) free(buf); return (ret_sdl); } - -/*------------------------------------------------------------*/ - -/* get ia6_flags for link-local addr on if. returns -1 on error. */ -static int -get_llflag(const char *name) -{ - struct ifaddrs *ifap, *ifa; - struct in6_ifreq ifr6; - struct sockaddr_in6 *sin6; - int s; - - if ((s = socket(PF_INET6, SOCK_DGRAM, 0)) < 0) { - warnmsg(LOG_ERR, __func__, "socket(SOCK_DGRAM): %s", - strerror(errno)); - exit(1); - } - if (getifaddrs(&ifap) != 0) { - warnmsg(LOG_ERR, __func__, "getifaddrs: %s", - strerror(errno)); - exit(1); - } - - for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - if (strlen(ifa->ifa_name) != strlen(name) || - strncmp(ifa->ifa_name, name, strlen(name)) != 0) - continue; - if (ifa->ifa_addr->sa_family != AF_INET6) - continue; - sin6 = (struct sockaddr_in6 *)(void *)ifa->ifa_addr; - if (!IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) - continue; - - memset(&ifr6, 0, sizeof(ifr6)); - strlcpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name)); - memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); - if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { - warnmsg(LOG_ERR, __func__, - "ioctl(SIOCGIFAFLAG_IN6): %s", strerror(errno)); - exit(1); - } - - freeifaddrs(ifap); - close(s); - return (ifr6.ifr_ifru.ifru_flags6); - } - - freeifaddrs(ifap); - close(s); - return (-1); -} - static void get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info) Modified: stable/12/usr.sbin/rtsold/rtsock.c ============================================================================== --- stable/12/usr.sbin/rtsold/rtsock.c Fri Sep 11 10:11:04 2020 (r365629) +++ stable/12/usr.sbin/rtsold/rtsock.c Fri Sep 11 12:36:05 2020 (r365630) @@ -33,10 +33,11 @@ */ #include +#include +#include #include -#include #include -#include +#include #include #include @@ -46,6 +47,7 @@ #include #include +#include #include #include #include @@ -72,8 +74,20 @@ static struct { int rtsock_open(void) { + cap_rights_t rights; + int error, s; - return (socket(PF_ROUTE, SOCK_RAW, 0)); + s = socket(PF_ROUTE, SOCK_RAW, 0); + if (s < 0) + return (s); + cap_rights_init(&rights, CAP_EVENT, CAP_READ); + if (caph_rights_limit(s, &rights) != 0) { + error = errno; + (void)close(s); + errno = errno; + return (-1); + } + return (s); } int Modified: stable/12/usr.sbin/rtsold/rtsol.c ============================================================================== --- stable/12/usr.sbin/rtsold/rtsol.c Fri Sep 11 10:11:04 2020 (r365629) +++ stable/12/usr.sbin/rtsold/rtsol.c Fri Sep 11 12:36:05 2020 (r365630) @@ -35,11 +35,12 @@ */ #include +#include +#include #include +#include #include -#include #include -#include #include #include @@ -54,6 +55,7 @@ #include +#include #include #include #include @@ -67,40 +69,24 @@ #include #include "rtsold.h" -static struct msghdr rcvmhdr; -static struct msghdr sndmhdr; -static struct iovec rcviov[2]; -static struct iovec sndiov[2]; -static struct sockaddr_in6 from; -static int rcvcmsglen; - -int rssock; static char rsid[IFNAMSIZ + 1 + sizeof(DNSINFO_ORIGIN_LABEL) + 1 + NI_MAXHOST]; -struct ifinfo_head_t ifinfo_head = - TAILQ_HEAD_INITIALIZER(ifinfo_head); +struct ifinfo_head_t ifinfo_head = TAILQ_HEAD_INITIALIZER(ifinfo_head); -static const struct sockaddr_in6 sin6_allrouters = { - .sin6_len = sizeof(sin6_allrouters), - .sin6_family = AF_INET6, - .sin6_addr = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT, -}; - -static void call_script(const int, const char *const *, - struct script_msg_head_t *); +static void call_script(const char *const *, struct script_msg_head_t *); static size_t dname_labeldec(char *, size_t, const char *); -static int safefile(const char *); static struct ra_opt *find_raopt(struct rainfo *, int, void *, size_t); static int ra_opt_rdnss_dispatch(struct ifinfo *, struct rainfo *, struct script_msg_head_t *, struct script_msg_head_t *); static char *make_rsid(const char *, const char *, struct rainfo *); +#define _ARGS_MANAGED managedconf_script, ifi->ifname #define _ARGS_OTHER otherconf_script, ifi->ifname #define _ARGS_RESADD resolvconf_script, "-a", rsid #define _ARGS_RESDEL resolvconf_script, "-d", rsid #define CALL_SCRIPT(name, sm_head) do { \ const char *const sarg[] = { _ARGS_##name, NULL }; \ - call_script(sizeof(sarg), sarg, sm_head); \ + call_script(sarg, sm_head); \ } while (0) #define ELM_MALLOC(p, error_action) do { \ @@ -114,130 +100,69 @@ static char *make_rsid(const char *, const char *, str } while (0) int -sockopen(void) +recvsockopen(void) { - static u_char *rcvcmsgbuf = NULL, *sndcmsgbuf = NULL; - int sndcmsglen, on; - static u_char answer[1500]; struct icmp6_filter filt; + cap_rights_t rights; + int on, sock; - sndcmsglen = rcvcmsglen = CMSG_SPACE(sizeof(struct in6_pktinfo)) + - CMSG_SPACE(sizeof(int)); - if (rcvcmsgbuf == NULL && (rcvcmsgbuf = malloc(rcvcmsglen)) == NULL) { - warnmsg(LOG_ERR, __func__, - "malloc for receive msghdr failed"); - return (-1); - } - if (sndcmsgbuf == NULL && (sndcmsgbuf = malloc(sndcmsglen)) == NULL) { - warnmsg(LOG_ERR, __func__, - "malloc for send msghdr failed"); - return (-1); - } - if ((rssock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) { + if ((sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) { warnmsg(LOG_ERR, __func__, "socket: %s", strerror(errno)); - return (-1); + goto fail; } - /* specify to tell receiving interface */ + /* Provide info about the receiving interface. */ on = 1; - if (setsockopt(rssock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, + if (setsockopt(sock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on)) < 0) { - warnmsg(LOG_ERR, __func__, "IPV6_RECVPKTINFO: %s", + warnmsg(LOG_ERR, __func__, "setsockopt(IPV6_RECVPKTINFO): %s", strerror(errno)); - exit(1); + goto fail; } - /* specify to tell value of hoplimit field of received IP6 hdr */ + /* Include the hop limit from the received header. */ on = 1; - if (setsockopt(rssock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &on, + if (setsockopt(sock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &on, sizeof(on)) < 0) { - warnmsg(LOG_ERR, __func__, "IPV6_RECVHOPLIMIT: %s", + warnmsg(LOG_ERR, __func__, "setsockopt(IPV6_RECVHOPLIMIT): %s", strerror(errno)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Fri Sep 11 14:00:12 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0DA23DB617; Fri, 11 Sep 2020 14:00:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bny7c3pqCz4NMG; Fri, 11 Sep 2020 14:00:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 672B624AC2; Fri, 11 Sep 2020 14:00:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08BE0Cwi079802; Fri, 11 Sep 2020 14:00:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BE0BTK079796; Fri, 11 Sep 2020 14:00:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202009111400.08BE0BTK079796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 11 Sep 2020 14:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365632 - in stable/12/sys/powerpc: include powernv powerpc ps3 pseries X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/powerpc: include powernv powerpc ps3 pseries X-SVN-Commit-Revision: 365632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2020 14:00:12 -0000 Author: mav Date: Fri Sep 11 14:00:10 2020 New Revision: 365632 URL: https://svnweb.freebsd.org/changeset/base/365632 Log: MFC r342852 (by cem): powerpc: Fix regression introduced in r342771 In r342771, I introduced a regression in Power by abusing the platform smp_topo() method as a shortcut for providing the MI information needed for the stated sysctls. The smp_topo() method was already called later by sched_ule (under the name cpu_topo()), and initializes a static array of scheduler topology information. I had skimmed the smp_topo_foo() functions and assumed they were idempotent; empirically, they are not (or at least, detect re-initialization and panic). Do the cleaner thing I should have done in the first place and add a platform method specifically for core- and thread-count probing. PR: 249250 Modified: stable/12/sys/powerpc/include/platform.h stable/12/sys/powerpc/powernv/platform_powernv.c stable/12/sys/powerpc/powerpc/mp_machdep.c stable/12/sys/powerpc/powerpc/platform.c stable/12/sys/powerpc/powerpc/platform_if.m stable/12/sys/powerpc/ps3/platform_ps3.c stable/12/sys/powerpc/pseries/platform_chrp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/include/platform.h ============================================================================== --- stable/12/sys/powerpc/include/platform.h Fri Sep 11 13:28:37 2020 (r365631) +++ stable/12/sys/powerpc/include/platform.h Fri Sep 11 14:00:10 2020 (r365632) @@ -58,6 +58,7 @@ int platform_smp_get_bsp(struct cpuref *); int platform_smp_start_cpu(struct pcpu *); void platform_smp_timebase_sync(u_long tb, int ap); void platform_smp_ap_init(void); +void platform_smp_probe_threads(void); const char *installed_platform(void); void platform_probe_and_attach(void); Modified: stable/12/sys/powerpc/powernv/platform_powernv.c ============================================================================== --- stable/12/sys/powerpc/powernv/platform_powernv.c Fri Sep 11 13:28:37 2020 (r365631) +++ stable/12/sys/powerpc/powernv/platform_powernv.c Fri Sep 11 14:00:10 2020 (r365632) @@ -71,6 +71,7 @@ static int powernv_smp_get_bsp(platform_t, struct cpur static void powernv_smp_ap_init(platform_t); #ifdef SMP static int powernv_smp_start_cpu(platform_t, struct pcpu *cpu); +static void powernv_smp_probe_threads(platform_t); static struct cpu_group *powernv_smp_topo(platform_t plat); #endif static void powernv_reset(platform_t); @@ -89,6 +90,7 @@ static platform_method_t powernv_methods[] = { PLATFORMMETHOD(platform_smp_get_bsp, powernv_smp_get_bsp), #ifdef SMP PLATFORMMETHOD(platform_smp_start_cpu, powernv_smp_start_cpu), + PLATFORMMETHOD(platform_smp_probe_threads, powernv_smp_probe_threads), PLATFORMMETHOD(platform_smp_topo, powernv_smp_topo), #endif @@ -403,8 +405,8 @@ powernv_smp_start_cpu(platform_t plat, struct pcpu *pc return (0); } -static struct cpu_group * -powernv_smp_topo(platform_t plat) +static void +powernv_smp_probe_threads(platform_t plat) { char buf[8]; phandle_t cpu, dev, root; @@ -436,21 +438,26 @@ powernv_smp_topo(platform_t plat) } smp_threads_per_core = nthreads; + if (mp_ncpus % nthreads == 0) + mp_ncores = mp_ncpus / nthreads; +} - if (mp_ncpus % nthreads != 0) { +static struct cpu_group * +powernv_smp_topo(platform_t plat) +{ + if (mp_ncpus % smp_threads_per_core != 0) { printf("WARNING: Irregular SMP topology. Performance may be " "suboptimal (%d threads, %d on first core)\n", - mp_ncpus, nthreads); + mp_ncpus, smp_threads_per_core); return (smp_topo_none()); } - mp_ncores = mp_ncpus / nthreads; - /* Don't do anything fancier for non-threaded SMP */ - if (nthreads == 1) + if (smp_threads_per_core == 1) return (smp_topo_none()); - return (smp_topo_1level(CG_SHARE_L1, nthreads, CG_FLAG_SMT)); + return (smp_topo_1level(CG_SHARE_L1, smp_threads_per_core, + CG_FLAG_SMT)); } #endif Modified: stable/12/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- stable/12/sys/powerpc/powerpc/mp_machdep.c Fri Sep 11 13:28:37 2020 (r365631) +++ stable/12/sys/powerpc/powerpc/mp_machdep.c Fri Sep 11 14:00:10 2020 (r365632) @@ -182,8 +182,7 @@ next: } #ifdef SMP - /* Probe mp_ncores and smp_threads_per_core as a side effect. */ - (void)cpu_topo(); + platform_smp_probe_threads(); #endif } Modified: stable/12/sys/powerpc/powerpc/platform.c ============================================================================== --- stable/12/sys/powerpc/powerpc/platform.c Fri Sep 11 13:28:37 2020 (r365631) +++ stable/12/sys/powerpc/powerpc/platform.c Fri Sep 11 14:00:10 2020 (r365632) @@ -242,6 +242,12 @@ platform_smp_ap_init() PLATFORM_SMP_AP_INIT(plat_obj); } +void +platform_smp_probe_threads(void) +{ + PLATFORM_SMP_PROBE_THREADS(plat_obj); +} + #ifdef SMP struct cpu_group * cpu_topo(void) Modified: stable/12/sys/powerpc/powerpc/platform_if.m ============================================================================== --- stable/12/sys/powerpc/powerpc/platform_if.m Fri Sep 11 13:28:37 2020 (r365631) +++ stable/12/sys/powerpc/powerpc/platform_if.m Fri Sep 11 14:00:10 2020 (r365632) @@ -84,6 +84,10 @@ CODE { { return; } + static void platform_null_smp_probe_threads(void) + { + return; + } }; /** @@ -195,6 +199,13 @@ METHOD int smp_start_cpu { METHOD void smp_ap_init { platform_t _plat; } DEFAULT platform_null_smp_ap_init; + +/** + * @brief Probe mp_ncores and smp_threads_per_core for early MI code + */ +METHOD void smp_probe_threads { + platform_t _plat; +} DEFAULT platform_null_smp_probe_threads; /** * @brief Return SMP topology Modified: stable/12/sys/powerpc/ps3/platform_ps3.c ============================================================================== --- stable/12/sys/powerpc/ps3/platform_ps3.c Fri Sep 11 13:28:37 2020 (r365631) +++ stable/12/sys/powerpc/ps3/platform_ps3.c Fri Sep 11 14:00:10 2020 (r365632) @@ -70,6 +70,7 @@ static int ps3_smp_first_cpu(platform_t, struct cpuref static int ps3_smp_next_cpu(platform_t, struct cpuref *cpuref); static int ps3_smp_get_bsp(platform_t, struct cpuref *cpuref); static int ps3_smp_start_cpu(platform_t, struct pcpu *cpu); +static void ps3_smp_probe_threads(platform_t); static struct cpu_group *ps3_smp_topo(platform_t); #endif static void ps3_reset(platform_t); @@ -87,6 +88,7 @@ static platform_method_t ps3_methods[] = { PLATFORMMETHOD(platform_smp_next_cpu, ps3_smp_next_cpu), PLATFORMMETHOD(platform_smp_get_bsp, ps3_smp_get_bsp), PLATFORMMETHOD(platform_smp_start_cpu, ps3_smp_start_cpu), + PLATFORMMETHOD(platform_smp_probe_threads, ps3_smp_probe_threads), PLATFORMMETHOD(platform_smp_topo, ps3_smp_topo), #endif @@ -243,11 +245,16 @@ ps3_smp_start_cpu(platform_t plat, struct pcpu *pc) return ((pc->pc_awake) ? 0 : EBUSY); } -static struct cpu_group * -ps3_smp_topo(platform_t plat) +static void +ps3_smp_probe_threads(platform_t plat) { mp_ncores = 1; smp_threads_per_core = 2; +} + +static struct cpu_group * +ps3_smp_topo(platform_t plat) +{ return (smp_topo_1level(CG_SHARE_L1, 2, CG_FLAG_SMT)); } #endif Modified: stable/12/sys/powerpc/pseries/platform_chrp.c ============================================================================== --- stable/12/sys/powerpc/pseries/platform_chrp.c Fri Sep 11 13:28:37 2020 (r365631) +++ stable/12/sys/powerpc/pseries/platform_chrp.c Fri Sep 11 14:00:10 2020 (r365632) @@ -78,6 +78,7 @@ static void chrp_smp_ap_init(platform_t); static int chrp_cpuref_init(void); #ifdef SMP static int chrp_smp_start_cpu(platform_t, struct pcpu *cpu); +static void chrp_smp_probe_threads(platform_t plat); static struct cpu_group *chrp_smp_topo(platform_t plat); #endif static void chrp_reset(platform_t); @@ -103,6 +104,7 @@ static platform_method_t chrp_methods[] = { PLATFORMMETHOD(platform_smp_get_bsp, chrp_smp_get_bsp), #ifdef SMP PLATFORMMETHOD(platform_smp_start_cpu, chrp_smp_start_cpu), + PLATFORMMETHOD(platform_smp_probe_threads, chrp_smp_probe_threads), PLATFORMMETHOD(platform_smp_topo, chrp_smp_topo), #endif @@ -499,13 +501,13 @@ chrp_smp_start_cpu(platform_t plat, struct pcpu *pc) return ((pc->pc_awake) ? 0 : EBUSY); } -static struct cpu_group * -chrp_smp_topo(platform_t plat) +static void +chrp_smp_probe_threads(platform_t plat) { struct pcpu *pc, *last_pc; - int i, ncores, ncpus; + int i, ncores; - ncores = ncpus = 0; + ncores = 0; last_pc = NULL; for (i = 0; i <= mp_maxid; i++) { pc = pcpu_find(i); @@ -514,23 +516,29 @@ chrp_smp_topo(platform_t plat) if (last_pc == NULL || pc->pc_hwref != last_pc->pc_hwref) ncores++; last_pc = pc; - ncpus++; } mp_ncores = ncores; + if (mp_ncpus % ncores == 0) + smp_threads_per_core = mp_ncpus / ncores; +} - if (ncpus % ncores != 0) { +static struct cpu_group * +chrp_smp_topo(platform_t plat) +{ + + if (mp_ncpus % mp_ncores != 0) { printf("WARNING: Irregular SMP topology. Performance may be " - "suboptimal (%d CPUS, %d cores)\n", ncpus, ncores); + "suboptimal (%d CPUS, %d cores)\n", mp_ncpus, mp_ncores); return (smp_topo_none()); } /* Don't do anything fancier for non-threaded SMP */ - if (ncpus == ncores) + if (mp_ncpus == mp_ncores) return (smp_topo_none()); - smp_threads_per_core = ncpus / ncores; - return (smp_topo_1level(CG_SHARE_L1, ncpus / ncores, CG_FLAG_SMT)); + return (smp_topo_1level(CG_SHARE_L1, smp_threads_per_core, + CG_FLAG_SMT)); } #endif From owner-svn-src-stable@freebsd.org Sat Sep 12 00:22:02 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4CA83EA96A; Sat, 12 Sep 2020 00:22:02 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpCx65qcYz444f; Sat, 12 Sep 2020 00:22:02 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB3A3C3DC; Sat, 12 Sep 2020 00:22:02 +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 08C0M2ee065946; Sat, 12 Sep 2020 00:22:02 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C0M2WF065944; Sat, 12 Sep 2020 00:22:02 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202009120022.08C0M2WF065944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Sat, 12 Sep 2020 00:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365647 - stable/12/sys/dev/ixl X-SVN-Group: stable-12 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/12/sys/dev/ixl X-SVN-Commit-Revision: 365647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 00:22:03 -0000 Author: erj Date: Sat Sep 12 00:22:02 2020 New Revision: 365647 URL: https://svnweb.freebsd.org/changeset/base/365647 Log: MFC r358698 and r364241 r358698: ixl: Add missing conversions from/to LE16 r364241: Remove redeclaration found by gcc build Together, these should allow ixl(4) to work properly on powerpc64 and prevent build warnings there. PR: 249254 Reported by: pkubaj@ MFC after: 3 days Modified: stable/12/sys/dev/ixl/i40e_prototype.h stable/12/sys/dev/ixl/ixl_pf_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ixl/i40e_prototype.h ============================================================================== --- stable/12/sys/dev/ixl/i40e_prototype.h Sat Sep 12 00:06:45 2020 (r365646) +++ stable/12/sys/dev/ixl/i40e_prototype.h Sat Sep 12 00:22:02 2020 (r365647) @@ -627,6 +627,4 @@ enum i40e_status_code i40e_read_phy_register(struct i4 enum i40e_status_code i40e_write_phy_register(struct i40e_hw *hw, u8 page, u16 reg, u8 phy_addr, u16 value); u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num); -enum i40e_status_code i40e_blink_phy_link_led(struct i40e_hw *hw, - u32 time, u32 interval); #endif /* _I40E_PROTOTYPE_H_ */ Modified: stable/12/sys/dev/ixl/ixl_pf_main.c ============================================================================== --- stable/12/sys/dev/ixl/ixl_pf_main.c Sat Sep 12 00:06:45 2020 (r365646) +++ stable/12/sys/dev/ixl/ixl_pf_main.c Sat Sep 12 00:22:02 2020 (r365647) @@ -729,20 +729,22 @@ ixl_switch_config(struct ixl_pf *pf) if (pf->dbg_mask & IXL_DBG_SWITCH_INFO) { device_printf(dev, "Switch config: header reported: %d in structure, %d total\n", - sw_config->header.num_reported, sw_config->header.num_total); - for (int i = 0; i < sw_config->header.num_reported; i++) { + LE16_TO_CPU(sw_config->header.num_reported), + LE16_TO_CPU(sw_config->header.num_total)); + for (int i = 0; + i < LE16_TO_CPU(sw_config->header.num_reported); i++) { device_printf(dev, "-> %d: type=%d seid=%d uplink=%d downlink=%d\n", i, sw_config->element[i].element_type, - sw_config->element[i].seid, - sw_config->element[i].uplink_seid, - sw_config->element[i].downlink_seid); + LE16_TO_CPU(sw_config->element[i].seid), + LE16_TO_CPU(sw_config->element[i].uplink_seid), + LE16_TO_CPU(sw_config->element[i].downlink_seid)); } } /* Simplified due to a single VSI */ - vsi->uplink_seid = sw_config->element[0].uplink_seid; - vsi->downlink_seid = sw_config->element[0].downlink_seid; - vsi->seid = sw_config->element[0].seid; + vsi->uplink_seid = LE16_TO_CPU(sw_config->element[0].uplink_seid); + vsi->downlink_seid = LE16_TO_CPU(sw_config->element[0].downlink_seid); + vsi->seid = LE16_TO_CPU(sw_config->element[0].seid); return (ret); } @@ -1219,12 +1221,14 @@ ixl_add_hw_filters(struct ixl_vsi *vsi, int flags, int bcopy(f->macaddr, b->mac_addr, ETHER_ADDR_LEN); if (f->vlan == IXL_VLAN_ANY) { b->vlan_tag = 0; - b->flags = I40E_AQC_MACVLAN_ADD_IGNORE_VLAN; + b->flags = CPU_TO_LE16( + I40E_AQC_MACVLAN_ADD_IGNORE_VLAN); } else { - b->vlan_tag = f->vlan; + b->vlan_tag = CPU_TO_LE16(f->vlan); b->flags = 0; } - b->flags |= I40E_AQC_MACVLAN_ADD_PERFECT_MATCH; + b->flags |= CPU_TO_LE16( + I40E_AQC_MACVLAN_ADD_PERFECT_MATCH); f->flags &= ~IXL_FILTER_ADD; j++; From owner-svn-src-stable@freebsd.org Sat Sep 12 01:48:00 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EEE823EDA75; Sat, 12 Sep 2020 01:48:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpFrJ642bz4BCP; Sat, 12 Sep 2020 01:48:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B36E3D4BE; Sat, 12 Sep 2020 01:48:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08C1m0Q7015899; Sat, 12 Sep 2020 01:48:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C1lxGg015891; Sat, 12 Sep 2020 01:47:59 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009120147.08C1lxGg015891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 12 Sep 2020 01:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365649 - in stable/12: libexec libexec/phttpget share/mk tools/build/mk usr.sbin/portsnap usr.sbin/portsnap/phttpget X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: libexec libexec/phttpget share/mk tools/build/mk usr.sbin/portsnap usr.sbin/portsnap/phttpget X-SVN-Commit-Revision: 365649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 01:48:01 -0000 Author: kevans Date: Sat Sep 12 01:47:59 2020 New Revision: 365649 URL: https://svnweb.freebsd.org/changeset/base/365649 Log: MFC r365490-r365491: Remove FREEBSD_UPDATE dependency on PORTSNAP r365490: phttpget: move out of portsnap Currently, WITHOUT_PORTSNAP forces WITHOUT_FREEBSD_UPDATE because the latter relies on phttpget, which lives inside the portsnap build bits. Remove the dependency between these two options by moving phttpget out into ^/libexec and building/installing it if either WITH_PORTSNAP or WITH_FREEBSD_UPDATE. Future work could remove the conditional if it's decided that users will use it independently of either the current in-base consumers. r365491: opts: FREEBSD_UPDATE no longer relies on PORTSNAP phttpget is no longer tied to the portsnap build as of r365490. Added: stable/12/libexec/phttpget/ - copied from r365491, head/libexec/phttpget/ Deleted: stable/12/usr.sbin/portsnap/phttpget/ Modified: stable/12/libexec/Makefile stable/12/share/mk/src.opts.mk stable/12/tools/build/mk/OptionalObsoleteFiles.inc stable/12/usr.sbin/portsnap/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/Makefile ============================================================================== --- stable/12/libexec/Makefile Sat Sep 12 00:33:11 2020 (r365648) +++ stable/12/libexec/Makefile Sat Sep 12 01:47:59 2020 (r365649) @@ -13,6 +13,7 @@ SUBDIR= ${_atf} \ ${_mail.local} \ ${_makewhatis.local} \ ${_mknetid} \ + ${_phttpget} \ ${_pppoed} \ rc \ revnetgroup \ @@ -46,6 +47,10 @@ SUBDIR+= bootpd .if ${MK_FINGER} != "no" SUBDIR+= fingerd +.endif + +.if ${MK_FREEBSD_UPDATE} != "no" || ${MK_PORTSNAP} != "no" +_phttpget= phttpget .endif .if ${MK_FTP} != "no" Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Sat Sep 12 00:33:11 2020 (r365648) +++ stable/12/share/mk/src.opts.mk Sat Sep 12 01:47:59 2020 (r365649) @@ -527,11 +527,6 @@ MK_AUTHPF:= no MK_OFED_EXTRA:= no .endif -.if ${MK_PORTSNAP} == "no" -# freebsd-update depends on phttpget from portsnap -MK_FREEBSD_UPDATE:= no -.endif - .if ${MK_TESTS} == "no" MK_DTRACE_TESTS:= no .endif Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Sat Sep 12 00:33:11 2020 (r365648) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Sat Sep 12 01:47:59 2020 (r365649) @@ -2851,6 +2851,11 @@ OLD_FILES+=usr/share/man/man5/freebsd-update.conf.5.gz OLD_FILES+=usr/share/man/man8/freebsd-update.8.gz .endif +.if ${MK_FREEBSD_UPDATE} == no && ${MK_PORTSNAP} == no +OLD_FILES+=usr/libexec/phttpget +OLD_FILES+=usr/share/man/man8/phttpget.8.gz +.endif + .if ${MK_GAMES} == no OLD_FILES+=usr/bin/caesar OLD_FILES+=usr/bin/factor @@ -7870,10 +7875,8 @@ OLD_FILES+=usr/share/man/man8/pmcstudy.8.gz .if ${MK_PORTSNAP} == no OLD_FILES+=etc/portsnap.conf OLD_FILES+=usr/libexec/make_index -OLD_FILES+=usr/libexec/phttpget OLD_FILES+=usr/sbin/portsnap OLD_FILES+=usr/share/examples/etc/portsnap.conf -OLD_FILES+=usr/share/man/man8/phttpget.8.gz OLD_FILES+=usr/share/man/man8/portsnap.8.gz .endif Modified: stable/12/usr.sbin/portsnap/Makefile ============================================================================== --- stable/12/usr.sbin/portsnap/Makefile Sat Sep 12 00:33:11 2020 (r365648) +++ stable/12/usr.sbin/portsnap/Makefile Sat Sep 12 01:47:59 2020 (r365649) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= portsnap make_index phttpget +SUBDIR= portsnap make_index .include From owner-svn-src-stable@freebsd.org Sat Sep 12 01:54:47 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7A6D3EDDEF; Sat, 12 Sep 2020 01:54:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpG073xhBz4Bs5; Sat, 12 Sep 2020 01:54:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BE30D900; Sat, 12 Sep 2020 01:54:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08C1slwk022316; Sat, 12 Sep 2020 01:54:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C1slEH022315; Sat, 12 Sep 2020 01:54:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009120154.08C1slEH022315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 12 Sep 2020 01:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365650 - stable/12/tools/build/options X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/tools/build/options X-SVN-Commit-Revision: 365650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 01:54:47 -0000 Author: kevans Date: Sat Sep 12 01:54:47 2020 New Revision: 365650 URL: https://svnweb.freebsd.org/changeset/base/365650 Log: Add missing WITHOUT_CAROOT description This should have been MFC'd as part of r353800, but was not because caroot had not been MFC'd at that time. As such, this is a direct commit to stable/12. Added: stable/12/tools/build/options/WITHOUT_CAROOT - copied unchanged from r365649, head/tools/build/options/WITHOUT_CAROOT Copied: stable/12/tools/build/options/WITHOUT_CAROOT (from r365649, head/tools/build/options/WITHOUT_CAROOT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/build/options/WITHOUT_CAROOT Sat Sep 12 01:54:47 2020 (r365650, copy of r365649, head/tools/build/options/WITHOUT_CAROOT) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not add the trusted certificates from the Mozilla NSS bundle to +base. From owner-svn-src-stable@freebsd.org Sat Sep 12 01:55:08 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 718323EE03C; Sat, 12 Sep 2020 01:55:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpG0X2pgvz4CQr; Sat, 12 Sep 2020 01:55:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43D48D4ED; Sat, 12 Sep 2020 01:55:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08C1t80u022413; Sat, 12 Sep 2020 01:55:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C1t8gC022412; Sat, 12 Sep 2020 01:55:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009120155.08C1t8gC022412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 12 Sep 2020 01:55:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365651 - stable/12/share/man/man5 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/share/man/man5 X-SVN-Commit-Revision: 365651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 01:55:08 -0000 Author: kevans Date: Sat Sep 12 01:55:07 2020 New Revision: 365651 URL: https://svnweb.freebsd.org/changeset/base/365651 Log: Regen src.conf(5) after r365649 Modified: stable/12/share/man/man5/src.conf.5 Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Sat Sep 12 01:54:47 2020 (r365650) +++ stable/12/share/man/man5/src.conf.5 Sat Sep 12 01:55:07 2020 (r365651) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd April 9, 2020 +.Dd September 11, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -188,7 +188,7 @@ as part of the normal system build. .Pp This is a default setting on -arm64/aarch64 and riscv/riscv64. +arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. When set, it enforces these options: .Pp .Bl -item -compact @@ -211,7 +211,7 @@ Do not build GNU binutils as part of the bootstrap process. .Pp This is a default setting on -arm64/aarch64 and riscv/riscv64. +arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_BINUTILS_BOOTSTRAP Build GNU binutils as part of the bootstrap process. @@ -294,6 +294,9 @@ When set, it enforces these options: .It .Va WITHOUT_CASPER .El +.It Va WITHOUT_CAROOT +Set to not add the trusted certificates from the Mozilla NSS bundle to +base. .It Va WITHOUT_CASPER Set to not build Casper program and related libraries. .It Va WITH_CCACHE_BUILD @@ -355,13 +358,15 @@ When set, it enforces these options: Set to not build the Clang C/C++ compiler during the regular phase of the build. .Pp This is a default setting on -riscv/riscv64 and sparc64/sparc64. +sparc64/sparc64. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_CLANG_EXTRAS .It +.Va WITHOUT_CLANG_FORMAT +.It .Va WITHOUT_CLANG_FULL .It .Va WITHOUT_LLVM_COV @@ -370,7 +375,7 @@ When set, it enforces these options: Set to build the Clang C/C++ compiler during the normal phase of the build. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_CLANG_BOOTSTRAP Set to not build the Clang C/C++ compiler during the bootstrap phase of the build. @@ -378,26 +383,28 @@ To be able to build the system, either gcc or clang bo enabled unless an alternate compiler is provided via XCC. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_CLANG_BOOTSTRAP Set to build the Clang C/C++ compiler during the bootstrap phase of the build. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_CLANG_EXTRAS Set to build additional clang and llvm tools, such as bugpoint. +.It Va WITH_CLANG_FORMAT +Set to build clang-format. .It Va WITHOUT_CLANG_FULL Set to avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .Pp This is a default setting on -riscv/riscv64 and sparc64/sparc64. +sparc64/sparc64. .It Va WITH_CLANG_FULL Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_CLANG_IS_CC Set to install the GCC compiler as .Pa /usr/bin/cc , @@ -406,7 +413,7 @@ and .Pa /usr/bin/cpp . .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_CLANG_IS_CC Set to install the Clang C/C++ compiler as .Pa /usr/bin/cc , @@ -415,7 +422,7 @@ and .Pa /usr/bin/cpp . .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_CPP Set to not build .Xr cpp 1 . @@ -464,7 +471,15 @@ When set, it enforces these options: .It .Va WITHOUT_OPENSSL .It +.Va WITHOUT_PKGBOOTSTRAP +.It +.Va WITHOUT_SVN +.It +.Va WITHOUT_SVNLITE +.It .Va WITHOUT_UNBOUND +.It +.Va WITHOUT_WIRELESS .El .Pp When set, these options are also in effect: @@ -490,7 +505,7 @@ Set to not build .Xr cxgbetool 8 .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe and riscv/riscv64. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_CXGBETOOL Set to build .Xr cxgbetool 8 @@ -513,6 +528,8 @@ When set, it enforces these options: .It .Va WITHOUT_CLANG_EXTRAS .It +.Va WITHOUT_CLANG_FORMAT +.It .Va WITHOUT_CLANG_FULL .It .Va WITHOUT_DTRACE_TESTS @@ -655,7 +672,7 @@ and .Xr efivar 8 . .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_EFI Set to build .Xr efivar 3 @@ -719,7 +736,7 @@ Set to not build games. Set to not build and install gcc and g++ as part of the normal build process. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GCC Set to build and install gcc and g++. .Pp @@ -732,7 +749,7 @@ unless an alternative compiler is provided via XCC. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GCC_BOOTSTRAP Set to build gcc and g++ as part of the bootstrap process. .Pp @@ -747,7 +764,7 @@ Set to not build .Xr gdb 1 . .Pp This is a default setting on -arm64/aarch64 and riscv/riscv64. +arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GDB Set to build .Xr gdb 1 . @@ -774,19 +791,19 @@ to be used as a fallback for if a newer version is not installed. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and riscv/riscv64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_GNUCXX Do not build the GNU C++ stack (g++, libstdc++). This is the default on platforms where clang is the system compiler. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GNUCXX Build the GNU C++ stack (g++, libstdc++). This is the default on platforms where gcc is the system compiler. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_GNU_DIFF Set to not build GNU .Xr diff 1 @@ -813,13 +830,13 @@ Set to build the BSD licensed version of the device tr than the GPLed one from elinux.org. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GPL_DTC Set to build the GPL'd version of the device tree compiler from elinux.org, instead of the BSD licensed one. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_GSSAPI Set to not build libgssapi. .It Va WITHOUT_HAST @@ -834,7 +851,7 @@ Set to not build HTML docs. Set to not build or install HyperV utilities. .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_HYPERV Set to build or install HyperV utilities. .Pp @@ -1011,17 +1028,17 @@ library. Set to not build LLVM's lld linker. .Pp This is a default setting on -riscv/riscv64 and sparc64/sparc64. +sparc64/sparc64. .It Va WITH_LLD Set to build LLVM's lld linker. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LLDB Set to not build the LLDB debugger. .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LLDB Set to build the LLDB debugger. .Pp @@ -1034,22 +1051,22 @@ To be able to build the system, either Binutils or LLD enabled unless an alternate linker is provided via XLD. .Pp This is a default setting on -arm/arm, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +arm/arm, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LLD_BOOTSTRAP Set to build the LLD linker during the bootstrap phase of the build. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LLD_IS_LD Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp This is a default setting on -arm/arm, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +arm/arm, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LLD_IS_LD Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_LLVM_ASSERTIONS Set to enable debugging assertions in LLVM. .It Va WITHOUT_LLVM_COV @@ -1058,14 +1075,14 @@ Set to not build the tool. .Pp This is a default setting on -riscv/riscv64 and sparc64/sparc64. +sparc64/sparc64. .It Va WITH_LLVM_COV Set to build the .Xr llvm-cov 1 tool. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LLVM_LIBUNWIND Set to use GCC's stack unwinder (instead of LLVM's libunwind). .Pp @@ -1075,7 +1092,7 @@ arm/arm, arm/armv6, arm/armv7, powerpc/powerpc, powerp Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64. +amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LLVM_TARGET_AARCH64 Set to not build LLVM target support for AArch64. The @@ -1083,7 +1100,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -arm/arm and arm/armv6. +arm/arm. .It Va WITH_LLVM_TARGET_AARCH64 Set to build LLVM target support for AArch64. The @@ -1091,7 +1108,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITHOUT_LLVM_TARGET_ALL Set to only build the required LLVM target support. This option is preferred to specific target support options. @@ -1114,6 +1131,10 @@ is set explicitly) (unless .Va WITH_LLVM_TARGET_POWERPC is set explicitly) +.It Va WITHOUT_LLVM_TARGET_RISCV +(unless +.Va WITH_LLVM_TARGET_RISCV +is set explicitly) .It Va WITHOUT_LLVM_TARGET_SPARC (unless .Va WITH_LLVM_TARGET_SPARC @@ -1136,7 +1157,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -arm/arm and arm/armv6. +arm/arm. .It Va WITH_LLVM_TARGET_MIPS Set to build LLVM target support for MIPS. The @@ -1144,7 +1165,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITHOUT_LLVM_TARGET_POWERPC Set to not build LLVM target support for PowerPC. The @@ -1152,7 +1173,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -arm/arm and arm/armv6. +arm/arm. .It Va WITH_LLVM_TARGET_POWERPC Set to build LLVM target support for PowerPC. The @@ -1160,12 +1181,23 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +.It Va WITHOUT_LLVM_TARGET_RISCV +Set to not build LLVM target support for RISC-V. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. +.Pp +This is a default setting on +arm/arm. .It Va WITH_LLVM_TARGET_RISCV Set to build LLVM target support for RISC-V. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. +.Pp +This is a default setting on +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITHOUT_LLVM_TARGET_SPARC Set to not build LLVM target support for SPARC. The @@ -1173,7 +1205,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -arm/arm and arm/armv6. +arm/arm. .It Va WITH_LLVM_TARGET_SPARC Set to build LLVM target support for SPARC. The @@ -1181,7 +1213,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITHOUT_LLVM_TARGET_X86 Set to not build LLVM target support for X86. The @@ -1189,7 +1221,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -arm/arm and arm/armv6. +arm/arm. .It Va WITH_LLVM_TARGET_X86 Set to build LLVM target support for X86. The @@ -1197,7 +1229,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LOADER_EFI_SECUREBOOT Enable building .Xr loader 8 @@ -1218,7 +1250,7 @@ powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe Set to build GELI bootloader support. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LOADER_LUA Set to not build LUA bindings for the boot loader. .Pp @@ -1228,12 +1260,12 @@ powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe Set to build LUA bindings for the boot loader. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LOADER_OFW Disable building of openfirmware bootloader components. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_LOADER_OFW Set to build openfirmware bootloader components. .Pp @@ -1243,7 +1275,7 @@ powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe Disable building of ubldr. .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LOADER_UBOOT Set to build ubldr. .Pp @@ -1407,7 +1439,7 @@ Set to not build .Xr mlx5tool 8 .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe and riscv/riscv64. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_MLX5TOOL Set to build .Xr mlx5tool 8 @@ -1485,7 +1517,7 @@ and related programs. Set to not build nvme related tools and kernel modules. .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_NVME Set to build nvme related tools and kernel modules. @@ -1506,12 +1538,12 @@ Enable building openldap support for kerberos. Set to not build LLVM's OpenMP runtime. .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_OPENMP Set to build LLVM's OpenMP runtime. .Pp This is a default setting on -amd64/amd64, i386/i386 and powerpc/powerpc64. +amd64/amd64, arm64/aarch64, i386/i386 and powerpc/powerpc64. .It Va WITHOUT_OPENSSH Set to not build OpenSSH. .It Va WITHOUT_OPENSSL @@ -1530,7 +1562,15 @@ When set, it enforces these options: .It .Va WITHOUT_OPENSSH .It +.Va WITHOUT_PKGBOOTSTRAP +.It +.Va WITHOUT_SVN +.It +.Va WITHOUT_SVNLITE +.It .Va WITHOUT_UNBOUND +.It +.Va WITHOUT_WIRELESS .El .Pp When set, these options are also in effect: @@ -1586,12 +1626,6 @@ and related programs. Set to not build or install .Xr portsnap 8 and related files. -When set, it enforces these options: -.Pp -.Bl -item -compact -.It -.Va WITHOUT_FREEBSD_UPDATE -.El .It Va WITHOUT_PPP Set to not build .Xr ppp 8 @@ -1607,7 +1641,7 @@ Set to build profiled libraries for use with .Xr gprof 8 . .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITHOUT_QUOTAS Set to not build .Xr quota 1 @@ -1697,7 +1731,7 @@ mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mi Set to build world with propolice stack smashing protection. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_STAGING Enable staging of files to a stage tree. This can be best thought of as auto-install to @@ -1859,6 +1893,8 @@ When set, it enforces these options: .It .Va WITHOUT_CLANG_EXTRAS .It +.Va WITHOUT_CLANG_FORMAT +.It .Va WITHOUT_CLANG_FULL .It .Va WITHOUT_GCC @@ -1961,14 +1997,9 @@ When set, it enforces these options: .Bl -item -compact .It .Va WITHOUT_ZONEINFO_LEAPSECONDS_SUPPORT -.It -.Va WITHOUT_ZONEINFO_OLD_TIMEZONES_SUPPORT .El .It Va WITH_ZONEINFO_LEAPSECONDS_SUPPORT Set to build leapsecond information in to the timezone database. -.It Va WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT -Set to build backward compatibility timezone aliases in to the timezone -database. .El .Sh FILES .Bl -tag -compact -width Pa From owner-svn-src-stable@freebsd.org Sat Sep 12 09:44:51 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41C533D1FE1; Sat, 12 Sep 2020 09:44:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpSQW0h08z4dv5; Sat, 12 Sep 2020 09:44:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB71613306; Sat, 12 Sep 2020 09:44:50 +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 08C9ios6012371; Sat, 12 Sep 2020 09:44:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C9ioQh012370; Sat, 12 Sep 2020 09:44:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009120944.08C9ioQh012370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 12 Sep 2020 09:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365653 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 365653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 09:44:51 -0000 Author: kib Date: Sat Sep 12 09:44:50 2020 New Revision: 365653 URL: https://svnweb.freebsd.org/changeset/base/365653 Log: MFC r365368: rtld: do not process absent dynamic. PR: 249121 Modified: stable/12/libexec/rtld-elf/rtld.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld.c Sat Sep 12 07:04:00 2020 (r365652) +++ stable/12/libexec/rtld-elf/rtld.c Sat Sep 12 09:44:50 2020 (r365653) @@ -1066,7 +1066,10 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_D *dyn_runpath = NULL; obj->bind_now = false; - for (dynp = obj->dynamic; dynp->d_tag != DT_NULL; dynp++) { + dynp = obj->dynamic; + if (dynp == NULL) + return; + for (; dynp->d_tag != DT_NULL; dynp++) { switch (dynp->d_tag) { case DT_REL: From owner-svn-src-stable@freebsd.org Sat Sep 12 09:46:14 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D054D3D2184; Sat, 12 Sep 2020 09:46:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpSS65CzXz4f6V; Sat, 12 Sep 2020 09:46:14 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96679130AA; Sat, 12 Sep 2020 09:46:14 +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 08C9kEUb012551; Sat, 12 Sep 2020 09:46:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C9kEhp012550; Sat, 12 Sep 2020 09:46:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009120946.08C9kEhp012550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 12 Sep 2020 09:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365654 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 365654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 09:46:14 -0000 Author: kib Date: Sat Sep 12 09:46:14 2020 New Revision: 365654 URL: https://svnweb.freebsd.org/changeset/base/365654 Log: MFC r365369: rtld: do not refuse to relocate objects without dynamic symtabs. PR: 249121 Modified: stable/12/libexec/rtld-elf/rtld.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld.c Sat Sep 12 09:44:50 2020 (r365653) +++ stable/12/libexec/rtld-elf/rtld.c Sat Sep 12 09:46:14 2020 (r365654) @@ -2979,11 +2979,8 @@ relocate_object(Obj_Entry *obj, bool bind_now, Obj_Ent dbg("relocating \"%s\"", obj->path); if (obj->symtab == NULL || obj->strtab == NULL || - !(obj->valid_hash_sysv || obj->valid_hash_gnu)) { - _rtld_error("%s: Shared object has no run-time symbol table", - obj->path); - return (-1); - } + !(obj->valid_hash_sysv || obj->valid_hash_gnu)) + dbg("object %s has no run-time symbol table", obj->path); /* There are relocations to the write-protected text segment. */ if (obj->textrel && reloc_textrel_prot(obj, true) != 0) From owner-svn-src-stable@freebsd.org Sat Sep 12 09:47:26 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 179DD3D20CD; Sat, 12 Sep 2020 09:47:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpSTT6xzPz4fZQ; Sat, 12 Sep 2020 09:47: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D32B81330D; Sat, 12 Sep 2020 09:47: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 08C9lPM1012682; Sat, 12 Sep 2020 09:47:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C9lPpB012681; Sat, 12 Sep 2020 09:47:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009120947.08C9lPpB012681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 12 Sep 2020 09:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365655 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/libexec/rtld-elf X-SVN-Commit-Revision: 365655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 09:47:26 -0000 Author: kib Date: Sat Sep 12 09:47:25 2020 New Revision: 365655 URL: https://svnweb.freebsd.org/changeset/base/365655 Log: MFC r365368: rtld: do not process absent dynamic. PR: 249121 Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Sat Sep 12 09:46:14 2020 (r365654) +++ stable/11/libexec/rtld-elf/rtld.c Sat Sep 12 09:47:25 2020 (r365655) @@ -1066,7 +1066,10 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_D *dyn_runpath = NULL; obj->bind_now = false; - for (dynp = obj->dynamic; dynp->d_tag != DT_NULL; dynp++) { + dynp = obj->dynamic; + if (dynp == NULL) + return; + for (; dynp->d_tag != DT_NULL; dynp++) { switch (dynp->d_tag) { case DT_REL: From owner-svn-src-stable@freebsd.org Sat Sep 12 09:47:59 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 198F93D1F11; Sat, 12 Sep 2020 09:47:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpSV66Xnbz4fbl; Sat, 12 Sep 2020 09:47:58 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3F2213383; Sat, 12 Sep 2020 09:47:58 +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 08C9lwbc012772; Sat, 12 Sep 2020 09:47:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C9lwi5012771; Sat, 12 Sep 2020 09:47:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009120947.08C9lwi5012771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 12 Sep 2020 09:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365656 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/libexec/rtld-elf X-SVN-Commit-Revision: 365656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 09:47:59 -0000 Author: kib Date: Sat Sep 12 09:47:58 2020 New Revision: 365656 URL: https://svnweb.freebsd.org/changeset/base/365656 Log: MFC r365369: rtld: do not refuse to relocate objects without dynamic symtabs. PR: 249121 Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Sat Sep 12 09:47:25 2020 (r365655) +++ stable/11/libexec/rtld-elf/rtld.c Sat Sep 12 09:47:58 2020 (r365656) @@ -2955,11 +2955,8 @@ relocate_object(Obj_Entry *obj, bool bind_now, Obj_Ent dbg("relocating \"%s\"", obj->path); if (obj->symtab == NULL || obj->strtab == NULL || - !(obj->valid_hash_sysv || obj->valid_hash_gnu)) { - _rtld_error("%s: Shared object has no run-time symbol table", - obj->path); - return (-1); - } + !(obj->valid_hash_sysv || obj->valid_hash_gnu)) + dbg("object %s has no run-time symbol table", obj->path); /* There are relocations to the write-protected text segment. */ if (obj->textrel && reloc_textrel_prot(obj, true) != 0) From owner-svn-src-stable@freebsd.org Sat Sep 12 12:45:32 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6022A3D6F5B; Sat, 12 Sep 2020 12:45:32 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpXR01vSkz3g2b; Sat, 12 Sep 2020 12:45:32 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FE79152B7; Sat, 12 Sep 2020 12:45:32 +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 08CCjVB6028797; Sat, 12 Sep 2020 12:45:31 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CCjV3o028796; Sat, 12 Sep 2020 12:45:31 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202009121245.08CCjV3o028796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 12 Sep 2020 12:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365659 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 365659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 12:45:32 -0000 Author: kp Date: Sat Sep 12 12:45:31 2020 New Revision: 365659 URL: https://svnweb.freebsd.org/changeset/base/365659 Log: MFC r365457: net: mitigate vnet / epair cleanup races There's a race where dying vnets move their interfaces back to their original vnet, and if_epair cleanup (where deleting one interface also deletes the other end of the epair). This is commonly triggered by the pf tests, but also by cleanup of vnet jails. As we've not yet been able to fix the root cause of the issue work around the panic by not dereferencing a NULL softc in epair_qflush() and by not re-attaching DYING interfaces. This isn't a full fix, but makes a very common panic far less likely. PR: 244703, 238870 Modified: stable/12/sys/net/if.c stable/12/sys/net/if_epair.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if.c ============================================================================== --- stable/12/sys/net/if.c Sat Sep 12 11:24:36 2020 (r365658) +++ stable/12/sys/net/if.c Sat Sep 12 12:45:31 2020 (r365659) @@ -1280,6 +1280,10 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet) ifindex_free_locked(ifp->if_index); IFNET_WUNLOCK(); + /* Don't re-attach DYING interfaces. */ + if (ifp->if_flags & IFF_DYING) + return; + /* * Perform interface-specific reassignment tasks, if provided by * the driver. Modified: stable/12/sys/net/if_epair.c ============================================================================== --- stable/12/sys/net/if_epair.c Sat Sep 12 11:24:36 2020 (r365658) +++ stable/12/sys/net/if_epair.c Sat Sep 12 12:45:31 2020 (r365659) @@ -609,8 +609,14 @@ epair_qflush(struct ifnet *ifp) struct epair_softc *sc; sc = ifp->if_softc; - KASSERT(sc != NULL, ("%s: ifp=%p, epair_softc gone? sc=%p\n", - __func__, ifp, sc)); + + /* + * See epair_clone_destroy(), we can end up getting called twice. + * Don't do anything on the second call. + */ + if (sc == NULL) + return; + /* * Remove this ifp from all backpointer lists. The interface will not * usable for flushing anyway nor should it have anything to flush From owner-svn-src-stable@freebsd.org Sat Sep 12 16:33:06 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D64353DCB73; Sat, 12 Sep 2020 16:33:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpdTZ5H2wz4CTN; Sat, 12 Sep 2020 16:33:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9870F17DF6; Sat, 12 Sep 2020 16:33:06 +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 08CGX6pb072945; Sat, 12 Sep 2020 16:33:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CGX6bf072943; Sat, 12 Sep 2020 16:33:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009121633.08CGX6bf072943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 16:33:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365661 - in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Commit-Revision: 365661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 16:33:06 -0000 Author: dim Date: Sat Sep 12 16:33:05 2020 New Revision: 365661 URL: https://svnweb.freebsd.org/changeset/base/365661 Log: MFC r364753: Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. MFC r365509: Follow-up r364753 by enabling compiler-rt's atomic implementation only for clang, as it uses clang specific builtins, and does not compile correctly with gcc. Note that gcc packages usually come with their own libatomic, providing these primitives. MFC r365588: Follow-up r364753 by only using arm's stdatomic.c implementation, as it already covers the functions in compiler-rt's atomic.c, leading to conflicts when linking. PR: 230888 Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/12/lib/libcompiler_rt/Makefile.inc stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/11/lib/libcompiler_rt/Makefile.inc stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c ============================================================================== --- stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Sat Sep 12 15:18:52 2020 (r365660) +++ stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Sat Sep 12 16:33:05 2020 (r365661) @@ -124,8 +124,8 @@ static __inline Lock *lock_for_pointer(void *ptr) { #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) -/// 32 bit PowerPC doesn't support 8-byte lock_free atomics -#if !defined(__powerpc64__) && defined(__powerpc__) +/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics +#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__)) #define IS_LOCK_FREE_8 0 #else #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) Modified: stable/12/lib/libcompiler_rt/Makefile.inc ============================================================================== --- stable/12/lib/libcompiler_rt/Makefile.inc Sat Sep 12 15:18:52 2020 (r365660) +++ stable/12/lib/libcompiler_rt/Makefile.inc Sat Sep 12 16:33:05 2020 (r365661) @@ -18,6 +18,8 @@ SRCF+= ashldi3 SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 +SRCF+= bswapdi2 +SRCF+= bswapsi2 SRCF+= clear_cache SRCF+= clzdi2 SRCF+= clzsi2 @@ -121,6 +123,13 @@ SRCF+= umoddi3 SRCF+= umodsi3 SRCF+= umodti3 +# Enable compiler-rt's atomic implementation only for clang, as it uses clang +# specific builtins, and gcc packages usually come with their own libatomic. +# Exclude arm which has its own implementations of atomic functions, below. +.if "${COMPILER_TYPE}" == "clang" && ${MACHINE_CPUARCH} != "arm" +SRCF+= atomic +.endif + # Avoid using SSE2 instructions on i386, if unsupported. .if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2) SRCS+= floatdidf.c @@ -213,12 +222,6 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS SRCF+= stdatomic .endif -.if "${COMPILER_TYPE}" == "clang" && \ - (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") -SRCS+= atomic.c -CFLAGS.atomic.c+= -Wno-atomic-alignment -.endif - .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) @@ -240,18 +243,9 @@ SRCS+= aeabi_memmove.S SRCS+= aeabi_memset.S SRCS+= aeabi_uidivmod.S SRCS+= aeabi_uldivmod.S -SRCS+= bswapdi2.S -SRCS+= bswapsi2.S SRCS+= switch16.S SRCS+= switch32.S SRCS+= switch8.S SRCS+= switchu8.S SRCS+= sync_synchronize.S -.endif - -# On some archs GCC-6.3 requires bswap32 built-in. -.if ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "riscv" || \ - ${MACHINE_CPUARCH} == "sparc64" -SRCS+= bswapdi2.c -SRCS+= bswapsi2.c .endif Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Sat Sep 12 15:18:52 2020 (r365660) +++ stable/12/sys/sys/param.h Sat Sep 12 16:33:05 2020 (r365661) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1202500 /* Master, propagated to newvers */ +#define __FreeBSD_version 1202501 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@freebsd.org Sat Sep 12 16:33:07 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B384B3DCB75; Sat, 12 Sep 2020 16:33:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpdTb4KW3z4CTJ; Sat, 12 Sep 2020 16:33:07 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77BE5180A2; Sat, 12 Sep 2020 16:33:07 +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 08CGX7an072955; Sat, 12 Sep 2020 16:33:07 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CGX6Pl072952; Sat, 12 Sep 2020 16:33:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009121633.08CGX6Pl072952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 16:33:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365661 - in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Commit-Revision: 365661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 16:33:07 -0000 Author: dim Date: Sat Sep 12 16:33:05 2020 New Revision: 365661 URL: https://svnweb.freebsd.org/changeset/base/365661 Log: MFC r364753: Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. MFC r365509: Follow-up r364753 by enabling compiler-rt's atomic implementation only for clang, as it uses clang specific builtins, and does not compile correctly with gcc. Note that gcc packages usually come with their own libatomic, providing these primitives. MFC r365588: Follow-up r364753 by only using arm's stdatomic.c implementation, as it already covers the functions in compiler-rt's atomic.c, leading to conflicts when linking. PR: 230888 Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/11/lib/libcompiler_rt/Makefile.inc stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/12/lib/libcompiler_rt/Makefile.inc stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c ============================================================================== --- stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Sat Sep 12 15:18:52 2020 (r365660) +++ stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Sat Sep 12 16:33:05 2020 (r365661) @@ -124,8 +124,8 @@ static __inline Lock *lock_for_pointer(void *ptr) { #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) -/// 32 bit PowerPC doesn't support 8-byte lock_free atomics -#if !defined(__powerpc64__) && defined(__powerpc__) +/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics +#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__)) #define IS_LOCK_FREE_8 0 #else #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) Modified: stable/11/lib/libcompiler_rt/Makefile.inc ============================================================================== --- stable/11/lib/libcompiler_rt/Makefile.inc Sat Sep 12 15:18:52 2020 (r365660) +++ stable/11/lib/libcompiler_rt/Makefile.inc Sat Sep 12 16:33:05 2020 (r365661) @@ -18,6 +18,8 @@ SRCF+= ashldi3 SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 +SRCF+= bswapdi2 +SRCF+= bswapsi2 SRCF+= clear_cache SRCF+= clzdi2 SRCF+= clzsi2 @@ -117,6 +119,14 @@ SRCF+= udivti3 SRCF+= umoddi3 SRCF+= umodti3 +# Enable compiler-rt's atomic implementation only for clang, as it uses clang +# specific builtins, and gcc packages usually come with their own libatomic. +# Exclude arm which has its own implementations of atomic functions, below. +.if "${COMPILER_TYPE}" == "clang" && \ + !(${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "armv6") +SRCF+= atomic +.endif + # Avoid using SSE2 instructions on i386, if unsupported. .if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2) SRCS+= floatdidf.c @@ -215,12 +225,6 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS SRCF+= stdatomic .endif -.if "${COMPILER_TYPE}" == "clang" && \ - (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") -SRCS+= atomic.c -CFLAGS.atomic.c+= -Wno-atomic-alignment -.endif - .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) @@ -242,18 +246,9 @@ SRCS+= aeabi_memmove.S SRCS+= aeabi_memset.S SRCS+= aeabi_uidivmod.S SRCS+= aeabi_uldivmod.S -SRCS+= bswapdi2.S -SRCS+= bswapsi2.S SRCS+= switch16.S SRCS+= switch32.S SRCS+= switch8.S SRCS+= switchu8.S SRCS+= sync_synchronize.S .endif - -# GCC-6.3 on mips32 requires bswap32 built-in. -.if ${MACHINE_CPUARCH} == "mips" -SRCS+= bswapdi2.c -SRCS+= bswapsi2.c -.endif - Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Sat Sep 12 15:18:52 2020 (r365660) +++ stable/11/sys/sys/param.h Sat Sep 12 16:33:05 2020 (r365661) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1104506 /* Master, propagated to newvers */ +#define __FreeBSD_version 1104507 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@freebsd.org Sat Sep 12 16:50:07 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F295F3DD418; Sat, 12 Sep 2020 16:50:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpdsB684yz4DQh; Sat, 12 Sep 2020 16:50:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B74C017E73; Sat, 12 Sep 2020 16:50:06 +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 08CGo6BV079761; Sat, 12 Sep 2020 16:50:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CGo5Eq079753; Sat, 12 Sep 2020 16:50:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009121650.08CGo5Eq079753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 16:50:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365662 - in stable: 11/contrib/jemalloc 11/contrib/jemalloc/doc 11/lib/libc/stdlib/jemalloc 11/share/man/man5 11/share/mk 11/tools/build/options 12/contrib/jemalloc 12/contrib/jemalloc... X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/jemalloc 11/contrib/jemalloc/doc 11/lib/libc/stdlib/jemalloc 11/share/man/man5 11/share/mk 11/tools/build/options 12/contrib/jemalloc 12/contrib/jemalloc/doc 12/lib/libc/stdlib/j... X-SVN-Commit-Revision: 365662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 16:50:07 -0000 Author: dim Date: Sat Sep 12 16:50:04 2020 New Revision: 365662 URL: https://svnweb.freebsd.org/changeset/base/365662 Log: MFC r365371: Turn MALLOC_PRODUCTION into a regular src.conf(5) option For historical reasons, defining MALLOC_PRODUCTION in /etc/make.conf has been used to turn off potentially expensive debug checks and statistics gathering in the implementation of malloc(3). It seems more consistent to turn this into a regular src.conf(5) option, e.g. WITH_MALLOC_PRODUCTION / WITHOUT_MALLOC_PRODUCTION. This can then be toggled similar to any other source build option, and turned on or off by default for e.g. stable branches. Reviewed by: imp, #manpages Differential Revision: https://reviews.freebsd.org/D26337 MFC r365373: Follow-up r365371 by removing sentences which indicate the state of the MK_MALLOC_PRODUCTION option on -CURRENT. Also, for the sake of backwards compatibility, support the old way of enabling 'production malloc', e.g. by adding a define in make.conf(5). Added: stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITHOUT_MALLOC_PRODUCTION stable/12/tools/build/options/WITH_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITH_MALLOC_PRODUCTION Modified: stable/12/contrib/jemalloc/FREEBSD-diffs stable/12/contrib/jemalloc/doc/jemalloc.3 stable/12/lib/libc/stdlib/jemalloc/Makefile.inc stable/12/share/man/man5/make.conf.5 stable/12/share/man/man5/src.conf.5 stable/12/share/mk/src.opts.mk Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Added: stable/11/tools/build/options/WITHOUT_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITHOUT_MALLOC_PRODUCTION stable/11/tools/build/options/WITH_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITH_MALLOC_PRODUCTION Modified: stable/11/contrib/jemalloc/FREEBSD-diffs stable/11/contrib/jemalloc/doc/jemalloc.3 stable/11/lib/libc/stdlib/jemalloc/Makefile.inc stable/11/share/man/man5/make.conf.5 stable/11/share/man/man5/src.conf.5 stable/11/share/mk/src.opts.mk Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- stable/12/contrib/jemalloc/FREEBSD-diffs Sat Sep 12 16:33:05 2020 (r365661) +++ stable/12/contrib/jemalloc/FREEBSD-diffs Sat Sep 12 16:50:04 2020 (r365662) @@ -14,7 +14,7 @@ index 1e12fd3a..c42a7e10 100644 + . + Additionally, is enabled in development + versions of FreeBSD (controlled by the -+ MALLOC_PRODUCTION make variable). ++ MK_MALLOC_PRODUCTION make variable). + Modified: stable/12/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- stable/12/contrib/jemalloc/doc/jemalloc.3 Sat Sep 12 16:33:05 2020 (r365661) +++ stable/12/contrib/jemalloc/doc/jemalloc.3 Sat Sep 12 16:50:04 2020 (r365662) @@ -43,7 +43,7 @@ The following configuration options are enabled in lib \fB\-\-with\-malloc\-conf=abort_conf:false\fR\&. Additionally, \fB\-\-enable\-debug\fR is enabled in development versions of FreeBSD (controlled by the -\fBMALLOC_PRODUCTION\fR +\fBMK_MALLOC_PRODUCTION\fR make variable)\&. .SH "SYNOPSIS" .sp Modified: stable/12/lib/libc/stdlib/jemalloc/Makefile.inc ============================================================================== --- stable/12/lib/libc/stdlib/jemalloc/Makefile.inc Sat Sep 12 16:33:05 2020 (r365661) +++ stable/12/lib/libc/stdlib/jemalloc/Makefile.inc Sat Sep 12 16:50:04 2020 (r365662) @@ -44,6 +44,6 @@ MLINKS+= \ jemalloc.3 nallocx.3 \ jemalloc.3 malloc.conf.5 -.if defined(MALLOC_PRODUCTION) +.if ${MK_MALLOC_PRODUCTION} != "no" || defined(MALLOC_PRODUCTION) CFLAGS+= -DMALLOC_PRODUCTION .endif Modified: stable/12/share/man/man5/make.conf.5 ============================================================================== --- stable/12/share/man/man5/make.conf.5 Sat Sep 12 16:33:05 2020 (r365661) +++ stable/12/share/man/man5/make.conf.5 Sat Sep 12 16:50:04 2020 (r365662) @@ -401,12 +401,6 @@ console driver to and allow access over FireWire(IEEE1394) using .Xr dconschat 8 . Currently, only i386 and amd64 are supported. -.It Va MALLOC_PRODUCTION -.Pq Vt bool -Set this to disable assertions and statistics gathering in -.Xr malloc 3 . -It also defaults the A and J runtime options to off. -Disabled by default on -CURRENT. .It Va MAN_ARCH .Pq Vt str Space-delimited list of one or more MACHINE and/or MACHINE_ARCH values Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Sat Sep 12 16:33:05 2020 (r365661) +++ stable/12/share/man/man5/src.conf.5 Sat Sep 12 16:50:04 2020 (r365662) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 11, 2020 +.Dd September 12, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1357,6 +1357,10 @@ if executed as an unprivileged user. See .Xr tests 7 for more details. +.It Va WITH_MALLOC_PRODUCTION +Set to disable assertions and statistics gathering in +.Xr malloc 3 . +It also defaults the A and J runtime options to off. .It Va WITHOUT_MAN Set to not build manual pages. When set, these options are also in effect: Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Sat Sep 12 16:33:05 2020 (r365661) +++ stable/12/share/mk/src.opts.mk Sat Sep 12 16:50:04 2020 (r365662) @@ -208,6 +208,7 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FIREWIRE \ LOADER_FORCE_LE \ LOADER_VERIEXEC_PASS_MANIFEST \ + MALLOC_PRODUCTION \ NAND \ OFED_EXTRA \ OPENLDAP \ Copied and modified: stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION (from r365371, head/tools/build/options/WITHOUT_MALLOC_PRODUCTION) ============================================================================== --- head/tools/build/options/WITHOUT_MALLOC_PRODUCTION Sat Sep 5 23:30:17 2020 (r365371, copy source) +++ stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION Sat Sep 12 16:50:04 2020 (r365662) @@ -2,4 +2,3 @@ Set to enable assertions and statistics gathering in .Xr malloc 3 . It also defaults the A and J runtime options to on. -Enabled by default on -CURRENT. Copied and modified: stable/12/tools/build/options/WITH_MALLOC_PRODUCTION (from r365371, head/tools/build/options/WITH_MALLOC_PRODUCTION) ============================================================================== --- head/tools/build/options/WITH_MALLOC_PRODUCTION Sat Sep 5 23:30:17 2020 (r365371, copy source) +++ stable/12/tools/build/options/WITH_MALLOC_PRODUCTION Sat Sep 12 16:50:04 2020 (r365662) @@ -2,4 +2,3 @@ Set to disable assertions and statistics gathering in .Xr malloc 3 . It also defaults the A and J runtime options to off. -Disabled by default on -CURRENT. From owner-svn-src-stable@freebsd.org Sat Sep 12 16:50:08 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A61E33DCFC8; Sat, 12 Sep 2020 16:50:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpdsD3z0jz4D8F; Sat, 12 Sep 2020 16:50:08 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C25617BE9; Sat, 12 Sep 2020 16:50:08 +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 08CGo8kH079775; Sat, 12 Sep 2020 16:50:08 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CGo6Nh079767; Sat, 12 Sep 2020 16:50:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009121650.08CGo6Nh079767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 16:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365662 - in stable: 11/contrib/jemalloc 11/contrib/jemalloc/doc 11/lib/libc/stdlib/jemalloc 11/share/man/man5 11/share/mk 11/tools/build/options 12/contrib/jemalloc 12/contrib/jemalloc... X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/jemalloc 11/contrib/jemalloc/doc 11/lib/libc/stdlib/jemalloc 11/share/man/man5 11/share/mk 11/tools/build/options 12/contrib/jemalloc 12/contrib/jemalloc/doc 12/lib/libc/stdlib/j... X-SVN-Commit-Revision: 365662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 16:50:08 -0000 Author: dim Date: Sat Sep 12 16:50:04 2020 New Revision: 365662 URL: https://svnweb.freebsd.org/changeset/base/365662 Log: MFC r365371: Turn MALLOC_PRODUCTION into a regular src.conf(5) option For historical reasons, defining MALLOC_PRODUCTION in /etc/make.conf has been used to turn off potentially expensive debug checks and statistics gathering in the implementation of malloc(3). It seems more consistent to turn this into a regular src.conf(5) option, e.g. WITH_MALLOC_PRODUCTION / WITHOUT_MALLOC_PRODUCTION. This can then be toggled similar to any other source build option, and turned on or off by default for e.g. stable branches. Reviewed by: imp, #manpages Differential Revision: https://reviews.freebsd.org/D26337 MFC r365373: Follow-up r365371 by removing sentences which indicate the state of the MK_MALLOC_PRODUCTION option on -CURRENT. Also, for the sake of backwards compatibility, support the old way of enabling 'production malloc', e.g. by adding a define in make.conf(5). Added: stable/11/tools/build/options/WITHOUT_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITHOUT_MALLOC_PRODUCTION stable/11/tools/build/options/WITH_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITH_MALLOC_PRODUCTION Modified: stable/11/contrib/jemalloc/FREEBSD-diffs stable/11/contrib/jemalloc/doc/jemalloc.3 stable/11/lib/libc/stdlib/jemalloc/Makefile.inc stable/11/share/man/man5/make.conf.5 stable/11/share/man/man5/src.conf.5 stable/11/share/mk/src.opts.mk Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Added: stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITHOUT_MALLOC_PRODUCTION stable/12/tools/build/options/WITH_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITH_MALLOC_PRODUCTION Modified: stable/12/contrib/jemalloc/FREEBSD-diffs stable/12/contrib/jemalloc/doc/jemalloc.3 stable/12/lib/libc/stdlib/jemalloc/Makefile.inc stable/12/share/man/man5/make.conf.5 stable/12/share/man/man5/src.conf.5 stable/12/share/mk/src.opts.mk Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- stable/11/contrib/jemalloc/FREEBSD-diffs Sat Sep 12 16:33:05 2020 (r365661) +++ stable/11/contrib/jemalloc/FREEBSD-diffs Sat Sep 12 16:50:04 2020 (r365662) @@ -14,7 +14,7 @@ index c4a44e3..4626e9b 100644 + , , and + . Additionally, + is enabled in development versions of -+ FreeBSD (controlled by the MALLOC_PRODUCTION make ++ FreeBSD (controlled by the MK_MALLOC_PRODUCTION make + variable). + Modified: stable/11/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- stable/11/contrib/jemalloc/doc/jemalloc.3 Sat Sep 12 16:33:05 2020 (r365661) +++ stable/11/contrib/jemalloc/doc/jemalloc.3 Sat Sep 12 16:50:04 2020 (r365662) @@ -45,7 +45,7 @@ The following configuration options are enabled in lib \fB\-\-enable\-xmalloc\fR\&. Additionally, \fB\-\-enable\-debug\fR is enabled in development versions of FreeBSD (controlled by the -\fBMALLOC_PRODUCTION\fR +\fBMK_MALLOC_PRODUCTION\fR make variable)\&. .SH "SYNOPSIS" .sp Modified: stable/11/lib/libc/stdlib/jemalloc/Makefile.inc ============================================================================== --- stable/11/lib/libc/stdlib/jemalloc/Makefile.inc Sat Sep 12 16:33:05 2020 (r365661) +++ stable/11/lib/libc/stdlib/jemalloc/Makefile.inc Sat Sep 12 16:50:04 2020 (r365662) @@ -44,6 +44,6 @@ MLINKS+= \ jemalloc.3 nallocx.3 \ jemalloc.3 malloc.conf.5 -.if defined(MALLOC_PRODUCTION) +.if ${MK_MALLOC_PRODUCTION} != "no" || defined(MALLOC_PRODUCTION) CFLAGS+= -DMALLOC_PRODUCTION .endif Modified: stable/11/share/man/man5/make.conf.5 ============================================================================== --- stable/11/share/man/man5/make.conf.5 Sat Sep 12 16:33:05 2020 (r365661) +++ stable/11/share/man/man5/make.conf.5 Sat Sep 12 16:50:04 2020 (r365662) @@ -388,12 +388,6 @@ console driver to and allow access over FireWire(IEEE1394) using .Xr dconschat 8 . Currently, only i386 and amd64 are supported. -.It Va MALLOC_PRODUCTION -.Pq Vt bool -Set this to disable assertions and statistics gathering in -.Xr malloc 3 . -It also defaults the A and J runtime options to off. -Disabled by default on -CURRENT. .It Va MODULES_WITH_WORLD .Pq Vt bool Set to build modules with the system instead of the kernel. Modified: stable/11/share/man/man5/src.conf.5 ============================================================================== --- stable/11/share/man/man5/src.conf.5 Sat Sep 12 16:33:05 2020 (r365661) +++ stable/11/share/man/man5/src.conf.5 Sat Sep 12 16:50:04 2020 (r365662) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd May 5, 2020 +.Dd September 12, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -315,6 +315,8 @@ When set, it enforces these options: .It .Va WITHOUT_CLANG_EXTRAS .It +.Va WITHOUT_CLANG_FORMAT +.It .Va WITHOUT_CLANG_FULL .It .Va WITHOUT_LLVM_COV @@ -339,6 +341,8 @@ This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386. .It Va WITH_CLANG_EXTRAS Set to build additional clang and llvm tools, such as bugpoint. +.It Va WITH_CLANG_FORMAT +Set to build clang-format. .It Va WITHOUT_CLANG_FULL Set to avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. @@ -460,6 +464,8 @@ When set, it enforces these options: .It .Va WITHOUT_CLANG_EXTRAS .It +.Va WITHOUT_CLANG_FORMAT +.It .Va WITHOUT_CLANG_FULL .It .Va WITHOUT_GNUCXX @@ -1177,6 +1183,10 @@ MTA selector. Set to not install .Xr make 1 and related support files. +.It Va WITH_MALLOC_PRODUCTION +Set to disable assertions and statistics gathering in +.Xr malloc 3 . +It also defaults the A and J runtime options to off. .It Va WITHOUT_MAN Set to not build manual pages. When set, these options are also in effect: @@ -1356,12 +1366,12 @@ Enable building openldap support for kerberos. Set to not build LLVM's OpenMP runtime. .Pp This is a default setting on -arm/arm, arm/armeb, arm/armv6, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc and sparc64/sparc64. +arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc and sparc64/sparc64. .It Va WITH_OPENMP Set to build LLVM's OpenMP runtime. .Pp This is a default setting on -amd64/amd64, i386/i386, pc98/i386 and powerpc/powerpc64. +amd64/amd64, arm64/aarch64, i386/i386, pc98/i386 and powerpc/powerpc64. .It Va WITHOUT_OPENSSH Set to not build OpenSSH. .It Va WITHOUT_OPENSSL @@ -1651,6 +1661,8 @@ When set, it enforces these options: .Va WITHOUT_CLANG .It .Va WITHOUT_CLANG_EXTRAS +.It +.Va WITHOUT_CLANG_FORMAT .It .Va WITHOUT_CLANG_FULL .It Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Sat Sep 12 16:33:05 2020 (r365661) +++ stable/11/share/mk/src.opts.mk Sat Sep 12 16:50:04 2020 (r365662) @@ -203,6 +203,7 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FORCE_LE \ LOADER_VERBOSE \ NAND \ + MALLOC_PRODUCTION \ OFED_EXTRA \ OPENLDAP \ REPRODUCIBLE_BUILD \ Copied and modified: stable/11/tools/build/options/WITHOUT_MALLOC_PRODUCTION (from r365371, head/tools/build/options/WITHOUT_MALLOC_PRODUCTION) ============================================================================== --- head/tools/build/options/WITHOUT_MALLOC_PRODUCTION Sat Sep 5 23:30:17 2020 (r365371, copy source) +++ stable/11/tools/build/options/WITHOUT_MALLOC_PRODUCTION Sat Sep 12 16:50:04 2020 (r365662) @@ -2,4 +2,3 @@ Set to enable assertions and statistics gathering in .Xr malloc 3 . It also defaults the A and J runtime options to on. -Enabled by default on -CURRENT. Copied and modified: stable/11/tools/build/options/WITH_MALLOC_PRODUCTION (from r365371, head/tools/build/options/WITH_MALLOC_PRODUCTION) ============================================================================== --- head/tools/build/options/WITH_MALLOC_PRODUCTION Sat Sep 5 23:30:17 2020 (r365371, copy source) +++ stable/11/tools/build/options/WITH_MALLOC_PRODUCTION Sat Sep 12 16:50:04 2020 (r365662) @@ -2,4 +2,3 @@ Set to disable assertions and statistics gathering in .Xr malloc 3 . It also defaults the A and J runtime options to off. -Disabled by default on -CURRENT. From owner-svn-src-stable@freebsd.org Sat Sep 12 18:40:40 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DA2D3DFD96; Sat, 12 Sep 2020 18:40:40 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BphJm0kN5z4MX3; Sat, 12 Sep 2020 18:40:40 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7573190EF; Sat, 12 Sep 2020 18:40:39 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08CIediS051642; Sat, 12 Sep 2020 18:40:39 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CIedei051640; Sat, 12 Sep 2020 18:40:39 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202009121840.08CIedei051640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 12 Sep 2020 18:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365667 - stable/12/sys/geom/part X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sys/geom/part X-SVN-Commit-Revision: 365667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 18:40:40 -0000 Author: eugen Date: Sat Sep 12 18:40:39 2020 New Revision: 365667 URL: https://svnweb.freebsd.org/changeset/base/365667 Log: MFC r365477: geom_part: extend kern.geom.part.check_integrity to work on GPT In short, this change allows accessing partition and recovering secondary GPT in case it is unaccessible but primary table is fine. Reported by: Alex Korchmar Modified: stable/12/sys/geom/part/g_part.c stable/12/sys/geom/part/g_part_gpt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/geom/part/g_part.c ============================================================================== --- stable/12/sys/geom/part/g_part.c Sat Sep 12 18:23:27 2020 (r365666) +++ stable/12/sys/geom/part/g_part.c Sat Sep 12 18:40:39 2020 (r365667) @@ -135,9 +135,9 @@ struct g_part_alias_list { SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0, "GEOM_PART stuff"); -static u_int check_integrity = 1; +u_int geom_part_check_integrity = 1; SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity, - CTLFLAG_RWTUN, &check_integrity, 1, + CTLFLAG_RWTUN, &geom_part_check_integrity, 1, "Enable integrity checking"); static u_int auto_resize = 1; SYSCTL_UINT(_kern_geom_part, OID_AUTO, auto_resize, @@ -420,7 +420,7 @@ g_part_check_integrity(struct g_part_table *table, str if (failed != 0) { printf("GEOM_PART: integrity check failed (%s, %s)\n", pp->name, table->gpt_scheme->name); - if (check_integrity != 0) + if (geom_part_check_integrity != 0) return (EINVAL); table->gpt_corrupt = 1; } Modified: stable/12/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/12/sys/geom/part/g_part_gpt.c Sat Sep 12 18:23:27 2020 (r365666) +++ stable/12/sys/geom/part/g_part_gpt.c Sat Sep 12 18:40:39 2020 (r365667) @@ -64,6 +64,8 @@ SYSCTL_UINT(_kern_geom_part_gpt, OID_AUTO, allow_nesti CTASSERT(offsetof(struct gpt_hdr, padding) == 92); CTASSERT(sizeof(struct gpt_ent) == 128); +extern u_int geom_part_check_integrity; + #define EQUUID(a,b) (memcmp(a, b, sizeof(struct uuid)) == 0) #define MBRSIZE 512 @@ -460,8 +462,9 @@ gpt_read_hdr(struct g_part_gpt_table *table, struct g_ if (hdr->hdr_lba_self != table->lba[elt]) goto fail; hdr->hdr_lba_alt = le64toh(buf->hdr_lba_alt); - if (hdr->hdr_lba_alt == hdr->hdr_lba_self || - hdr->hdr_lba_alt > last) + if (hdr->hdr_lba_alt == hdr->hdr_lba_self) + goto fail; + if (hdr->hdr_lba_alt > last && geom_part_check_integrity) goto fail; /* Check the managed area. */ From owner-svn-src-stable@freebsd.org Sat Sep 12 18:42:15 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A3D23E003C; Sat, 12 Sep 2020 18:42:15 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BphLb0q3Yz4Mtn; Sat, 12 Sep 2020 18:42:15 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F36E0196E6; Sat, 12 Sep 2020 18:42:14 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08CIgEAI056404; Sat, 12 Sep 2020 18:42:14 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CIgEBa056402; Sat, 12 Sep 2020 18:42:14 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202009121842.08CIgEBa056402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 12 Sep 2020 18:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365668 - stable/11/sys/geom/part X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sys/geom/part X-SVN-Commit-Revision: 365668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 18:42:15 -0000 Author: eugen Date: Sat Sep 12 18:42:14 2020 New Revision: 365668 URL: https://svnweb.freebsd.org/changeset/base/365668 Log: MFC r365477: geom_part: extend kern.geom.part.check_integrity to work on GPT In short, this change allows accessing partition and recovering secondary GPT in case it is unaccessible but primary table is fine. Reported by: Alex Korchmar Modified: stable/11/sys/geom/part/g_part.c stable/11/sys/geom/part/g_part_gpt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/part/g_part.c ============================================================================== --- stable/11/sys/geom/part/g_part.c Sat Sep 12 18:40:39 2020 (r365667) +++ stable/11/sys/geom/part/g_part.c Sat Sep 12 18:42:14 2020 (r365668) @@ -132,9 +132,9 @@ struct g_part_alias_list { SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0, "GEOM_PART stuff"); -static u_int check_integrity = 1; +u_int geom_part_check_integrity = 1; SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity, - CTLFLAG_RWTUN, &check_integrity, 1, + CTLFLAG_RWTUN, &geom_part_check_integrity, 1, "Enable integrity checking"); /* @@ -409,7 +409,7 @@ g_part_check_integrity(struct g_part_table *table, str if (failed != 0) { printf("GEOM_PART: integrity check failed (%s, %s)\n", pp->name, table->gpt_scheme->name); - if (check_integrity != 0) + if (geom_part_check_integrity != 0) return (EINVAL); table->gpt_corrupt = 1; } Modified: stable/11/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/11/sys/geom/part/g_part_gpt.c Sat Sep 12 18:40:39 2020 (r365667) +++ stable/11/sys/geom/part/g_part_gpt.c Sat Sep 12 18:42:14 2020 (r365668) @@ -54,6 +54,8 @@ FEATURE(geom_part_gpt, "GEOM partitioning class for GP CTASSERT(offsetof(struct gpt_hdr, padding) == 92); CTASSERT(sizeof(struct gpt_ent) == 128); +extern u_int geom_part_check_integrity; + #define EQUUID(a,b) (memcmp(a, b, sizeof(struct uuid)) == 0) #define MBRSIZE 512 @@ -448,8 +450,9 @@ gpt_read_hdr(struct g_part_gpt_table *table, struct g_ if (hdr->hdr_lba_self != table->lba[elt]) goto fail; hdr->hdr_lba_alt = le64toh(buf->hdr_lba_alt); - if (hdr->hdr_lba_alt == hdr->hdr_lba_self || - hdr->hdr_lba_alt > last) + if (hdr->hdr_lba_alt == hdr->hdr_lba_self) + goto fail; + if (hdr->hdr_lba_alt > last && geom_part_check_integrity) goto fail; /* Check the managed area. */ From owner-svn-src-stable@freebsd.org Sat Sep 12 19:13:18 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6551F3E0819; Sat, 12 Sep 2020 19:13:18 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bpj2N5FDzz4PXS; Sat, 12 Sep 2020 19:13:15 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.110.112]) by smarthost1.greenhost.nl with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1kHAxU-0003Tb-Q8; Sat, 12 Sep 2020 21:13:14 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=klop.ws; s=mail; h=In-Reply-To:Message-ID:From:Content-Transfer-Encoding:MIME-Version: Date:References:Subject:To:Content-Type:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/rzhUdtBbmwJFFhT42vPB+pj5W+IxfbDkgRKBkwoG+M=; b=kaE3MB5FHRfEOmK9xxLAs/6tRi vOqBigIb33o3cP/emQchOvYo0nI7tNKDtwC+hFvPCWQDMi0Z3Q1PNwq9riHV2TZcHt7UXrNkAYFiM mYWB6I+ps3cZefJyN5P+3F02owx6Q5G9y0/D7ZhPNT32Hw/Ob421sJSrxKMi+csnVOfs=; Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org, "Dimitry Andric" Subject: Re: svn commit: r365662 - in stable: 11/contrib/jemalloc 11/contrib/jemalloc/doc 11/lib/libc/stdlib/jemalloc 11/share/man/man5 11/share/mk 11/tools/build/options 12/contrib/jemalloc 12/contrib/jemalloc... References: <202009121650.08CGo5Eq079753@repo.freebsd.org> Date: Sat, 12 Sep 2020 21:13:10 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <202009121650.08CGo5Eq079753@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.4 X-Spam-Status: No, score=-0.4 required=5.0 tests=ALL_TRUSTED, BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF autolearn=disabled version=3.4.2 X-Scan-Signature: 1629bd954af37e9bd463cbe85bf61e19 X-Rspamd-Queue-Id: 4Bpj2N5FDzz4PXS X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=klop.ws header.s=mail header.b=kaE3MB5F; dmarc=none; spf=pass (mx1.freebsd.org: domain of ronald-lists@klop.ws designates 195.190.28.88 as permitted sender) smtp.mailfrom=ronald-lists@klop.ws X-Spamd-Result: default: False [-1.77 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.05)[-1.051]; R_DKIM_ALLOW(-0.20)[klop.ws:s=mail]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:195.190.28.64/27]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[klop.ws]; NEURAL_HAM_LONG(-0.99)[-0.990]; RWL_MAILSPIKE_GOOD(0.00)[195.190.28.88:from]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_SPAM_SHORT(0.27)[0.268]; DKIM_TRACE(0.00)[klop.ws:+]; RCVD_IN_DNSWL_NONE(0.00)[195.190.28.88:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; ASN(0.00)[asn:47172, ipnet:195.190.28.0/24, country:NL]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-stable,svn-src-stable-12]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 19:13:18 -0000 Hi, Isn't this important enough for a note in UPDATING? Or a message in the backwards compatibility code to point the user to the new setting? Regards, Ronald. On Sat, 12 Sep 2020 18:50:05 +0200, Dimitry Andric wrote: > Author: dim > Date: Sat Sep 12 16:50:04 2020 > New Revision: 365662 > URL: https://svnweb.freebsd.org/changeset/base/365662 > > Log: > MFC r365371: > Turn MALLOC_PRODUCTION into a regular src.conf(5) option > For historical reasons, defining MALLOC_PRODUCTION in /etc/make.conf has > been used to turn off potentially expensive debug checks and statistics > gathering in the implementation of malloc(3). > It seems more consistent to turn this into a regular src.conf(5) option, > e.g. WITH_MALLOC_PRODUCTION / WITHOUT_MALLOC_PRODUCTION. This can then > be toggled similar to any other source build option, and turned on or > off by default for e.g. stable branches. > Reviewed by: imp, #manpages > Differential Revision: https://reviews.freebsd.org/D26337 > MFC r365373: > Follow-up r365371 by removing sentences which indicate the state of the > MK_MALLOC_PRODUCTION option on -CURRENT. > Also, for the sake of backwards compatibility, support the old way of > enabling 'production malloc', e.g. by adding a define in make.conf(5). > > Added: > stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION > - copied, changed from r365371, > head/tools/build/options/WITHOUT_MALLOC_PRODUCTION > stable/12/tools/build/options/WITH_MALLOC_PRODUCTION > - copied, changed from r365371, > head/tools/build/options/WITH_MALLOC_PRODUCTION > Modified: > stable/12/contrib/jemalloc/FREEBSD-diffs > stable/12/contrib/jemalloc/doc/jemalloc.3 > stable/12/lib/libc/stdlib/jemalloc/Makefile.inc > stable/12/share/man/man5/make.conf.5 > stable/12/share/man/man5/src.conf.5 > stable/12/share/mk/src.opts.mk > Directory Properties: > stable/12/ (props changed) > > Changes in other areas also in this revision: > Added: > stable/11/tools/build/options/WITHOUT_MALLOC_PRODUCTION > - copied, changed from r365371, > head/tools/build/options/WITHOUT_MALLOC_PRODUCTION > stable/11/tools/build/options/WITH_MALLOC_PRODUCTION > - copied, changed from r365371, > head/tools/build/options/WITH_MALLOC_PRODUCTION > Modified: > stable/11/contrib/jemalloc/FREEBSD-diffs > stable/11/contrib/jemalloc/doc/jemalloc.3 > stable/11/lib/libc/stdlib/jemalloc/Makefile.inc > stable/11/share/man/man5/make.conf.5 > stable/11/share/man/man5/src.conf.5 > stable/11/share/mk/src.opts.mk > Directory Properties: > stable/11/ (props changed) > > Modified: stable/12/contrib/jemalloc/FREEBSD-diffs > ============================================================================== > --- stable/12/contrib/jemalloc/FREEBSD-diffs Sat Sep 12 16:33:05 > 2020 (r365661) > +++ stable/12/contrib/jemalloc/FREEBSD-diffs Sat Sep 12 16:50:04 > 2020 (r365662) > @@ -14,7 +14,7 @@ index 1e12fd3a..c42a7e10 100644 > + . > + Additionally, is enabled in > development > + versions of FreeBSD (controlled by the > -+ MALLOC_PRODUCTION make variable). > ++ MK_MALLOC_PRODUCTION make variable). > + > > > > Modified: stable/12/contrib/jemalloc/doc/jemalloc.3 > ============================================================================== > --- stable/12/contrib/jemalloc/doc/jemalloc.3 Sat Sep 12 16:33:05 > 2020 (r365661) > +++ stable/12/contrib/jemalloc/doc/jemalloc.3 Sat Sep 12 16:50:04 > 2020 (r365662) > @@ -43,7 +43,7 @@ The following configuration options are enabled in lib > \fB\-\-with\-malloc\-conf=abort_conf:false\fR\&. Additionally, > \fB\-\-enable\-debug\fR > is enabled in development versions of FreeBSD (controlled by the > -\fBMALLOC_PRODUCTION\fR > +\fBMK_MALLOC_PRODUCTION\fR > make variable)\&. > .SH "SYNOPSIS" > .sp > > Modified: stable/12/lib/libc/stdlib/jemalloc/Makefile.inc > ============================================================================== > --- stable/12/lib/libc/stdlib/jemalloc/Makefile.inc Sat Sep 12 16:33:05 > 2020 (r365661) > +++ stable/12/lib/libc/stdlib/jemalloc/Makefile.inc Sat Sep 12 16:50:04 > 2020 (r365662) > @@ -44,6 +44,6 @@ MLINKS+= \ > jemalloc.3 nallocx.3 \ > jemalloc.3 malloc.conf.5 > -.if defined(MALLOC_PRODUCTION) > +.if ${MK_MALLOC_PRODUCTION} != "no" || defined(MALLOC_PRODUCTION) > CFLAGS+= -DMALLOC_PRODUCTION > .endif > > Modified: stable/12/share/man/man5/make.conf.5 > ============================================================================== > --- stable/12/share/man/man5/make.conf.5 Sat Sep 12 16:33:05 > 2020 (r365661) > +++ stable/12/share/man/man5/make.conf.5 Sat Sep 12 16:50:04 > 2020 (r365662) > @@ -401,12 +401,6 @@ console driver to > and allow access over FireWire(IEEE1394) using > .Xr dconschat 8 . > Currently, only i386 and amd64 are supported. > -.It Va MALLOC_PRODUCTION > -.Pq Vt bool > -Set this to disable assertions and statistics gathering in > -.Xr malloc 3 . > -It also defaults the A and J runtime options to off. > -Disabled by default on -CURRENT. > .It Va MAN_ARCH > .Pq Vt str > Space-delimited list of one or more MACHINE and/or MACHINE_ARCH values > > Modified: stable/12/share/man/man5/src.conf.5 > ============================================================================== > --- stable/12/share/man/man5/src.conf.5 Sat Sep 12 16:33:05 > 2020 (r365661) > +++ stable/12/share/man/man5/src.conf.5 Sat Sep 12 16:50:04 > 2020 (r365662) > @@ -1,6 +1,6 @@ > .\" DO NOT EDIT-- this file is @generated by > tools/build/options/makeman. > .\" $FreeBSD$ > -.Dd September 11, 2020 > +.Dd September 12, 2020 > .Dt SRC.CONF 5 > .Os > .Sh NAME > @@ -1357,6 +1357,10 @@ if executed as an unprivileged user. > See > .Xr tests 7 > for more details. > +.It Va WITH_MALLOC_PRODUCTION > +Set to disable assertions and statistics gathering in > +.Xr malloc 3 . > +It also defaults the A and J runtime options to off. > .It Va WITHOUT_MAN > Set to not build manual pages. > When set, these options are also in effect: > > Modified: stable/12/share/mk/src.opts.mk > ============================================================================== > --- stable/12/share/mk/src.opts.mk Sat Sep 12 16:33:05 2020 (r365661) > +++ stable/12/share/mk/src.opts.mk Sat Sep 12 16:50:04 2020 (r365662) > @@ -208,6 +208,7 @@ __DEFAULT_NO_OPTIONS = \ > LOADER_FIREWIRE \ > LOADER_FORCE_LE \ > LOADER_VERIEXEC_PASS_MANIFEST \ > + MALLOC_PRODUCTION \ > NAND \ > OFED_EXTRA \ > OPENLDAP \ > > Copied and modified: > stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION (from r365371, > head/tools/build/options/WITHOUT_MALLOC_PRODUCTION) > ============================================================================== > --- head/tools/build/options/WITHOUT_MALLOC_PRODUCTION Sat Sep 5 > 23:30:17 2020 (r365371, copy source) > +++ stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION Sat Sep 12 > 16:50:04 2020 (r365662) > @@ -2,4 +2,3 @@ > Set to enable assertions and statistics gathering in > .Xr malloc 3 . > It also defaults the A and J runtime options to on. > -Enabled by default on -CURRENT. > > Copied and modified: > stable/12/tools/build/options/WITH_MALLOC_PRODUCTION (from r365371, > head/tools/build/options/WITH_MALLOC_PRODUCTION) > ============================================================================== > --- head/tools/build/options/WITH_MALLOC_PRODUCTION Sat Sep 5 23:30:17 > 2020 (r365371, copy source) > +++ stable/12/tools/build/options/WITH_MALLOC_PRODUCTION Sat Sep 12 > 16:50:04 2020 (r365662) > @@ -2,4 +2,3 @@ > Set to disable assertions and statistics gathering in > .Xr malloc 3 . > It also defaults the A and J runtime options to off. > -Disabled by default on -CURRENT. > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-stable@freebsd.org Sat Sep 12 19:40:06 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24B633E16AB; Sat, 12 Sep 2020 19:40:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpjdL0F2Pz4Rfj; Sat, 12 Sep 2020 19:40:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCACE1A1B4; Sat, 12 Sep 2020 19:40:05 +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 08CJe5gU088359; Sat, 12 Sep 2020 19:40:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CJe5ZA088356; Sat, 12 Sep 2020 19:40:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009121940.08CJe5ZA088356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 19:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365671 - in stable: 11 11/share/man/man5 11/share/mk 12 12/share/man/man5 12/share/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11 11/share/man/man5 11/share/mk 12 12/share/man/man5 12/share/mk X-SVN-Commit-Revision: 365671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 19:40:06 -0000 Author: dim Date: Sat Sep 12 19:40:04 2020 New Revision: 365671 URL: https://svnweb.freebsd.org/changeset/base/365671 Log: Follow-up r365662 (MFC of r365371 and r365373) by correctly setting WITH_MALLOC_PRODUCTION for stable branches. Also add a note to UPDATING, to inform users about the new setting. Direct commit to stable/{11,12} as this does not apply to head. Noticed by: imp, Ronald Klop Modified: stable/12/UPDATING stable/12/share/man/man5/src.conf.5 stable/12/share/mk/src.opts.mk Changes in other areas also in this revision: Modified: stable/11/UPDATING stable/11/share/man/man5/src.conf.5 stable/11/share/mk/src.opts.mk Modified: stable/12/UPDATING ============================================================================== --- stable/12/UPDATING Sat Sep 12 19:33:25 2020 (r365670) +++ stable/12/UPDATING Sat Sep 12 19:40:04 2020 (r365671) @@ -16,6 +16,18 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200912: + The make.conf(5) MALLOC_PRODUCTION variable, used for disabling and + enabling assertions and statistics gathering in malloc(3), has been + migrated to a src.conf(5) WITH/WITHOUT_MALLOC_PRODUCTION option. + + On stable branches, WITH_MALLOC_PRODUCTION is set by default, which + means that malloc(3) has assertions and statistics gathering disabled, + for improved performance. + + For backwards compatibility, the make.conf(5) MALLOC_PRODUCTION is still + honored, but it is now deprecated and undocumented. + 20200909: The resume code now notifies devd with the 'kernel' system rather than the old 'kern' subsystem to be consistent with Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Sat Sep 12 19:33:25 2020 (r365670) +++ stable/12/share/man/man5/src.conf.5 Sat Sep 12 19:40:04 2020 (r365671) @@ -1357,10 +1357,10 @@ if executed as an unprivileged user. See .Xr tests 7 for more details. -.It Va WITH_MALLOC_PRODUCTION -Set to disable assertions and statistics gathering in +.It Va WITHOUT_MALLOC_PRODUCTION +Set to enable assertions and statistics gathering in .Xr malloc 3 . -It also defaults the A and J runtime options to off. +It also defaults the A and J runtime options to on. .It Va WITHOUT_MAN Set to not build manual pages. When set, these options are also in effect: Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Sat Sep 12 19:33:25 2020 (r365670) +++ stable/12/share/mk/src.opts.mk Sat Sep 12 19:40:04 2020 (r365671) @@ -143,6 +143,7 @@ __DEFAULT_YES_OPTIONS = \ MAIL \ MAILWRAPPER \ MAKE \ + MALLOC_PRODUCTION \ NDIS \ NETCAT \ NETGRAPH \ @@ -208,7 +209,6 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FIREWIRE \ LOADER_FORCE_LE \ LOADER_VERIEXEC_PASS_MANIFEST \ - MALLOC_PRODUCTION \ NAND \ OFED_EXTRA \ OPENLDAP \ From owner-svn-src-stable@freebsd.org Sat Sep 12 19:40:06 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2FFE3E16B2; Sat, 12 Sep 2020 19:40:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpjdL4N6Qz4Rcx; Sat, 12 Sep 2020 19:40:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AD9119E52; Sat, 12 Sep 2020 19:40:06 +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 08CJe6ad088367; Sat, 12 Sep 2020 19:40:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CJe5GP088364; Sat, 12 Sep 2020 19:40:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009121940.08CJe5GP088364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 19:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365671 - in stable: 11 11/share/man/man5 11/share/mk 12 12/share/man/man5 12/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11 11/share/man/man5 11/share/mk 12 12/share/man/man5 12/share/mk X-SVN-Commit-Revision: 365671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 19:40:06 -0000 Author: dim Date: Sat Sep 12 19:40:04 2020 New Revision: 365671 URL: https://svnweb.freebsd.org/changeset/base/365671 Log: Follow-up r365662 (MFC of r365371 and r365373) by correctly setting WITH_MALLOC_PRODUCTION for stable branches. Also add a note to UPDATING, to inform users about the new setting. Direct commit to stable/{11,12} as this does not apply to head. Noticed by: imp, Ronald Klop Modified: stable/11/UPDATING stable/11/share/man/man5/src.conf.5 stable/11/share/mk/src.opts.mk Changes in other areas also in this revision: Modified: stable/12/UPDATING stable/12/share/man/man5/src.conf.5 stable/12/share/mk/src.opts.mk Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Sat Sep 12 19:33:25 2020 (r365670) +++ stable/11/UPDATING Sat Sep 12 19:40:04 2020 (r365671) @@ -16,6 +16,18 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200912: + The make.conf(5) MALLOC_PRODUCTION variable, used for disabling and + enabling assertions and statistics gathering in malloc(3), has been + migrated to a src.conf(5) WITH/WITHOUT_MALLOC_PRODUCTION option. + + On stable branches, WITH_MALLOC_PRODUCTION is set by default, which + means that malloc(3) has assertions and statistics gathering disabled, + for improved performance. + + For backwards compatibility, the make.conf(5) MALLOC_PRODUCTION is still + honored, but it is now deprecated and undocumented. + 20200723: Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have been upgraded to 10.0.1. Please see the 20141231 entry below for Modified: stable/11/share/man/man5/src.conf.5 ============================================================================== --- stable/11/share/man/man5/src.conf.5 Sat Sep 12 19:33:25 2020 (r365670) +++ stable/11/share/man/man5/src.conf.5 Sat Sep 12 19:40:04 2020 (r365671) @@ -1183,10 +1183,10 @@ MTA selector. Set to not install .Xr make 1 and related support files. -.It Va WITH_MALLOC_PRODUCTION -Set to disable assertions and statistics gathering in +.It Va WITHOUT_MALLOC_PRODUCTION +Set to enable assertions and statistics gathering in .Xr malloc 3 . -It also defaults the A and J runtime options to off. +It also defaults the A and J runtime options to on. .It Va WITHOUT_MAN Set to not build manual pages. When set, these options are also in effect: Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Sat Sep 12 19:33:25 2020 (r365670) +++ stable/11/share/mk/src.opts.mk Sat Sep 12 19:40:04 2020 (r365671) @@ -139,6 +139,7 @@ __DEFAULT_YES_OPTIONS = \ MAIL \ MAILWRAPPER \ MAKE \ + MALLOC_PRODUCTION \ MANDOCDB \ NDIS \ NETCAT \ @@ -203,7 +204,6 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FORCE_LE \ LOADER_VERBOSE \ NAND \ - MALLOC_PRODUCTION \ OFED_EXTRA \ OPENLDAP \ REPRODUCIBLE_BUILD \ From owner-svn-src-stable@freebsd.org Sat Sep 12 20:20:56 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C15283E1CC0; Sat, 12 Sep 2020 20:20:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpkXS4m89z4TDP; Sat, 12 Sep 2020 20:20:56 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86CD71A9C5; Sat, 12 Sep 2020 20:20:56 +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 08CKKutO014223; Sat, 12 Sep 2020 20:20:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CKKumn014222; Sat, 12 Sep 2020 20:20:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009122020.08CKKumn014222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 20:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365672 - in stable: 11/contrib/jemalloc/include/jemalloc 12/contrib/jemalloc/include/jemalloc X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/jemalloc/include/jemalloc 12/contrib/jemalloc/include/jemalloc X-SVN-Commit-Revision: 365672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 20:20:56 -0000 Author: dim Date: Sat Sep 12 20:20:55 2020 New Revision: 365672 URL: https://svnweb.freebsd.org/changeset/base/365672 Log: Follow-up r365662 (MFC of r365371 and r365373) by also removing the header hack from jemalloc_FreeBSD.h, which rendered any make.conf MALLOC_PRODUCTION or src.conf WITH/WITHOUT_MALLOC_PRODUCTION irrelevant. Direct commit to stable/{11,12} as this does not apply to head. Noticed by: kevans Modified: stable/11/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Changes in other areas also in this revision: Modified: stable/12/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Modified: stable/11/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- stable/11/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Sat Sep 12 19:40:04 2020 (r365671) +++ stable/11/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Sat Sep 12 20:20:55 2020 (r365672) @@ -5,9 +5,6 @@ #undef JEMALLOC_OVERRIDE_VALLOC #ifndef MALLOC_PRODUCTION -#define MALLOC_PRODUCTION -#endif -#ifndef MALLOC_PRODUCTION #define JEMALLOC_DEBUG #endif From owner-svn-src-stable@freebsd.org Sat Sep 12 20:20:56 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7420E3E1E3B; Sat, 12 Sep 2020 20:20:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpkXS2W7Tz4T7p; Sat, 12 Sep 2020 20:20:56 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 396391A9C4; Sat, 12 Sep 2020 20:20:56 +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 08CKKuwg013709; Sat, 12 Sep 2020 20:20:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CKKuRg013693; Sat, 12 Sep 2020 20:20:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009122020.08CKKuRg013693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 20:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365672 - in stable: 11/contrib/jemalloc/include/jemalloc 12/contrib/jemalloc/include/jemalloc X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/jemalloc/include/jemalloc 12/contrib/jemalloc/include/jemalloc X-SVN-Commit-Revision: 365672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 20:20:56 -0000 Author: dim Date: Sat Sep 12 20:20:55 2020 New Revision: 365672 URL: https://svnweb.freebsd.org/changeset/base/365672 Log: Follow-up r365662 (MFC of r365371 and r365373) by also removing the header hack from jemalloc_FreeBSD.h, which rendered any make.conf MALLOC_PRODUCTION or src.conf WITH/WITHOUT_MALLOC_PRODUCTION irrelevant. Direct commit to stable/{11,12} as this does not apply to head. Noticed by: kevans Modified: stable/12/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Changes in other areas also in this revision: Modified: stable/11/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Modified: stable/12/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- stable/12/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Sat Sep 12 19:40:04 2020 (r365671) +++ stable/12/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Sat Sep 12 20:20:55 2020 (r365672) @@ -5,7 +5,7 @@ #undef JEMALLOC_OVERRIDE_VALLOC #ifndef MALLOC_PRODUCTION -#define MALLOC_PRODUCTION +#define JEMALLOC_DEBUG #endif #undef JEMALLOC_DSS